From 5bd31d254d00b0686a343c8fac451778aea5bd2b Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 15:16:23 -0500 Subject: [PATCH 01/12] Updated config --- lib/bigcommerce/api/index.ts | 61 ++++++++++++++++++++++++------------ lib/commerce-api.ts | 9 ------ 2 files changed, 41 insertions(+), 29 deletions(-) delete mode 100644 lib/commerce-api.ts diff --git a/lib/bigcommerce/api/index.ts b/lib/bigcommerce/api/index.ts index aada33024..0cf0568c7 100644 --- a/lib/bigcommerce/api/index.ts +++ b/lib/bigcommerce/api/index.ts @@ -26,8 +26,11 @@ export type ProductImageVariables = Pick< | 'imgXLHeight' >; -export interface BigcommerceConfig extends CommerceAPIConfig { +export interface BigcommerceConfigOptions extends CommerceAPIConfig { images?: Images; +} + +export interface BigcommerceConfig extends BigcommerceConfigOptions { readonly imageVariables?: ProductImageVariables; } @@ -46,31 +49,49 @@ if (!API_TOKEN) { ); } -const config: BigcommerceConfig = { +export class Config { + private config: BigcommerceConfig; + + constructor(config: BigcommerceConfigOptions) { + this.config = { + ...config, + get imageVariables() { + const { images } = this; + return images + ? { + imgSmallWidth: images.small?.width, + imgSmallHeight: images.small?.height, + imgMediumWidth: images.medium?.height, + imgMediumHeight: images.medium?.height, + imgLargeWidth: images.large?.height, + imgLargeHeight: images.large?.height, + imgXLWidth: images.xl?.height, + imgXLHeight: images.xl?.height, + } + : undefined; + }, + }; + } + + getConfig() { + return this.config; + } + + setConfig(newConfig: Partial) { + Object.assign(this.config, newConfig); + } +} + +const config = new Config({ commerceUrl: API_URL, apiToken: API_TOKEN, fetch: fetchAPI, - get imageVariables() { - const { images } = this; - return images - ? { - imgSmallWidth: images.small?.width, - imgSmallHeight: images.small?.height, - imgMediumWidth: images.medium?.height, - imgMediumHeight: images.medium?.height, - imgLargeWidth: images.large?.height, - imgLargeHeight: images.large?.height, - imgXLWidth: images.xl?.height, - imgXLHeight: images.xl?.height, - } - : undefined; - }, -}; +}); export function getConfig() { - return config; + return config.getConfig(); } export function setConfig(newConfig: Partial) { - Object.assign(config, newConfig); + return config.setConfig(newConfig); } diff --git a/lib/commerce-api.ts b/lib/commerce-api.ts deleted file mode 100644 index e2288f197..000000000 --- a/lib/commerce-api.ts +++ /dev/null @@ -1,9 +0,0 @@ -import BigcommerceAPI from "./bigcommerce/api"; - -const API_URL = process.env.NEXT_EXAMPLE_BIGCOMMERCE_STOREFRONT_API_URL!; -const API_TOKEN = process.env.NEXT_EXAMPLE_BIGCOMMERCE_STOREFRONT_API_TOKEN!; - -export const commerce = new BigcommerceAPI({ - commerceUrl: API_URL, - apiToken: API_TOKEN, -}); From 22bd962b7113df3867fbba224e2c6c1e80eb3727 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 18:55:50 -0500 Subject: [PATCH 02/12] Use fragments --- codegen.json | 2 +- lib/bigcommerce/api/fragments/product.ts | 66 +++++++ .../api/operations/get-all-products.ts | 75 +------- lib/bigcommerce/api/operations/get-product.ts | 60 +----- .../api/{types/index.ts => utils/types.ts} | 0 lib/bigcommerce/schema.d.ts | 172 +++++++----------- 6 files changed, 143 insertions(+), 232 deletions(-) create mode 100644 lib/bigcommerce/api/fragments/product.ts rename lib/bigcommerce/api/{types/index.ts => utils/types.ts} (100%) diff --git a/codegen.json b/codegen.json index dfd125f82..c2f13e69b 100644 --- a/codegen.json +++ b/codegen.json @@ -8,7 +8,7 @@ }, "documents": [ { - "./lib/bigcommerce/api/operations/**/*.ts": { + "./lib/bigcommerce/api/{operations,fragments}/**/*.ts": { "noRequire": true } } diff --git a/lib/bigcommerce/api/fragments/product.ts b/lib/bigcommerce/api/fragments/product.ts new file mode 100644 index 000000000..48c0df36d --- /dev/null +++ b/lib/bigcommerce/api/fragments/product.ts @@ -0,0 +1,66 @@ +export const responsiveImageFragment = /* GraphQL */ ` + fragment responsiveImage on Image { + urlSmall: url(width: $imgSmallWidth, height: $imgSmallHeight) + urlMedium: url(width: $imgMediumWidth, height: $imgMediumHeight) + urlLarge: url(width: $imgLargeWidth, height: $imgLargeHeight) + urlXL: url(width: $imgXLWidth, height: $imgXLHeight) + } +`; + +export const productInfoFragment = /* GraphQL */ ` + fragment productInfo on Product { + entityId + name + path + brand { + name + } + description + prices { + price { + value + currencyCode + } + salePrice { + value + currencyCode + } + } + images { + edges { + node { + ...responsiveImage + } + } + } + variants { + edges { + node { + entityId + defaultImage { + ...responsiveImage + } + } + } + } + options { + edges { + node { + entityId + displayName + isRequired + values { + edges { + node { + entityId + label + } + } + } + } + } + } + } + + ${responsiveImageFragment} +`; diff --git a/lib/bigcommerce/api/operations/get-all-products.ts b/lib/bigcommerce/api/operations/get-all-products.ts index f120e2e43..5ba9c008f 100644 --- a/lib/bigcommerce/api/operations/get-all-products.ts +++ b/lib/bigcommerce/api/operations/get-all-products.ts @@ -2,7 +2,8 @@ import type { GetAllProductsQuery, GetAllProductsQueryVariables, } from 'lib/bigcommerce/schema'; -import type { RecursivePartial, RecursiveRequired } from '../types'; +import type { RecursivePartial, RecursiveRequired } from '../utils/types'; +import { productInfoFragment } from '../fragments/product'; import { getConfig, Images, ProductImageVariables } from '..'; export const getAllProductsQuery = /* GraphQL */ ` @@ -26,80 +27,14 @@ export const getAllProductsQuery = /* GraphQL */ ` edges { cursor node { - entityId - name - path - brand { - name - } - description - prices { - price { - value - currencyCode - } - salePrice { - value - currencyCode - } - } - images { - edges { - node { - urlSmall: url(width: $imgSmallWidth, height: $imgSmallHeight) - urlMedium: url( - width: $imgMediumWidth - height: $imgMediumHeight - ) - urlLarge: url(width: $imgLargeWidth, height: $imgLargeHeight) - urlXL: url(width: $imgXLWidth, height: $imgXLHeight) - } - } - } - variants { - edges { - node { - entityId - defaultImage { - urlSmall: url( - width: $imgSmallWidth - height: $imgSmallHeight - ) - urlMedium: url( - width: $imgMediumWidth - height: $imgMediumHeight - ) - urlLarge: url( - width: $imgLargeWidth - height: $imgLargeHeight - ) - urlXL: url(width: $imgXLWidth, height: $imgXLHeight) - } - } - } - } - options { - edges { - node { - entityId - displayName - isRequired - values { - edges { - node { - entityId - label - } - } - } - } - } - } + ...productInfo } } } } } + + ${productInfoFragment} `; export interface GetAllProductsResult { diff --git a/lib/bigcommerce/api/operations/get-product.ts b/lib/bigcommerce/api/operations/get-product.ts index 007959d1e..5761978c8 100644 --- a/lib/bigcommerce/api/operations/get-product.ts +++ b/lib/bigcommerce/api/operations/get-product.ts @@ -2,7 +2,8 @@ import type { GetProductQuery, GetProductQueryVariables, } from 'lib/bigcommerce/schema'; -import type { RecursivePartial, RecursiveRequired } from '../types'; +import type { RecursivePartial, RecursiveRequired } from '../utils/types'; +import { productInfoFragment } from '../fragments/product'; import { getConfig, Images, ProductImageVariables } from '..'; export const getProductQuery = /* GraphQL */ ` @@ -22,65 +23,14 @@ export const getProductQuery = /* GraphQL */ ` node { __typename ... on Product { - entityId - name - path - brand { - name - } - description - prices { - price { - currencyCode - value - } - salePrice { - currencyCode - value - } - } - images { - edges { - node { - urlSmall: url(width: $imgSmallWidth, height: $imgSmallHeight) - urlMedium: url( - width: $imgMediumWidth - height: $imgMediumHeight - ) - urlLarge: url(width: $imgLargeWidth, height: $imgLargeHeight) - urlXL: url(width: $imgXLWidth, height: $imgXLHeight) - } - } - } - variants { - edges { - node { - entityId - } - } - } - options { - edges { - node { - entityId - displayName - isRequired - values { - edges { - node { - entityId - label - } - } - } - } - } - } + ...productInfo } } } } } + + ${productInfoFragment} `; export interface GetProductResult { diff --git a/lib/bigcommerce/api/types/index.ts b/lib/bigcommerce/api/utils/types.ts similarity index 100% rename from lib/bigcommerce/api/types/index.ts rename to lib/bigcommerce/api/utils/types.ts diff --git a/lib/bigcommerce/schema.d.ts b/lib/bigcommerce/schema.d.ts index 5d8f5bd6c..5f25ff205 100644 --- a/lib/bigcommerce/schema.d.ts +++ b/lib/bigcommerce/schema.d.ts @@ -1649,6 +1649,70 @@ export enum CurrencyCode { +export type ResponsiveImageFragment = ( + { __typename?: 'Image' } + & { urlSmall: Image['url'], urlMedium: Image['url'], urlLarge: Image['url'], urlXL: Image['url'] } +); + +export type ProductInfoFragment = ( + { __typename?: 'Product' } + & Pick + & { brand?: Maybe<( + { __typename?: 'Brand' } + & Pick + )>, prices?: Maybe<( + { __typename?: 'Prices' } + & { price: ( + { __typename?: 'Money' } + & Pick + ), salePrice?: Maybe<( + { __typename?: 'Money' } + & Pick + )> } + )>, images: ( + { __typename?: 'ImageConnection' } + & { edges?: Maybe>> } + ), variants: ( + { __typename?: 'VariantConnection' } + & { edges?: Maybe + & { defaultImage?: Maybe<( + { __typename?: 'Image' } + & ResponsiveImageFragment + )> } + ) } + )>>> } + ), options: ( + { __typename?: 'OptionConnection' } + & { edges?: Maybe + & { values: ( + { __typename?: 'OptionValueConnection' } + & { edges?: Maybe + ) } + )>>> } + ) } + ) } + )>>> } + ) } +); + export type GetAllProductsQueryVariables = Exact<{ first?: Maybe; imgSmallWidth?: Maybe; @@ -1676,61 +1740,7 @@ export type GetAllProductsQuery = ( & Pick & { node: ( { __typename?: 'Product' } - & Pick - & { brand?: Maybe<( - { __typename?: 'Brand' } - & Pick - )>, prices?: Maybe<( - { __typename?: 'Prices' } - & { price: ( - { __typename?: 'Money' } - & Pick - ), salePrice?: Maybe<( - { __typename?: 'Money' } - & Pick - )> } - )>, images: ( - { __typename?: 'ImageConnection' } - & { edges?: Maybe>> } - ), variants: ( - { __typename?: 'VariantConnection' } - & { edges?: Maybe - & { defaultImage?: Maybe<( - { __typename?: 'Image' } - & { urlSmall: Image['url'], urlMedium: Image['url'], urlLarge: Image['url'], urlXL: Image['url'] } - )> } - ) } - )>>> } - ), options: ( - { __typename?: 'OptionConnection' } - & { edges?: Maybe - & { values: ( - { __typename?: 'OptionValueConnection' } - & { edges?: Maybe - ) } - )>>> } - ) } - ) } - )>>> } - ) } + & ProductInfoFragment ) } )>>> } ) } @@ -1758,57 +1768,7 @@ export type GetProductQuery = ( { __typename?: 'Route' } & { node?: Maybe<{ __typename: 'Brand' } | { __typename: 'Category' } | ( { __typename: 'Product' } - & Pick - & { brand?: Maybe<( - { __typename?: 'Brand' } - & Pick - )>, prices?: Maybe<( - { __typename?: 'Prices' } - & { price: ( - { __typename?: 'Money' } - & Pick - ), salePrice?: Maybe<( - { __typename?: 'Money' } - & Pick - )> } - )>, images: ( - { __typename?: 'ImageConnection' } - & { edges?: Maybe>> } - ), variants: ( - { __typename?: 'VariantConnection' } - & { edges?: Maybe - ) } - )>>> } - ), options: ( - { __typename?: 'OptionConnection' } - & { edges?: Maybe - & { values: ( - { __typename?: 'OptionValueConnection' } - & { edges?: Maybe - ) } - )>>> } - ) } - ) } - )>>> } - ) } + & ProductInfoFragment ) | { __typename: 'Variant' }> } ) } ) } From 5459c70fdeeefd81cc2f458212e6226d56e34068 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 19:04:31 -0500 Subject: [PATCH 03/12] Added config obj to operations --- lib/bigcommerce/api/operations/get-all-products.ts | 12 ++++++++++-- lib/bigcommerce/api/operations/get-product.ts | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/bigcommerce/api/operations/get-all-products.ts b/lib/bigcommerce/api/operations/get-all-products.ts index 5ba9c008f..cf761db87 100644 --- a/lib/bigcommerce/api/operations/get-all-products.ts +++ b/lib/bigcommerce/api/operations/get-all-products.ts @@ -4,7 +4,12 @@ import type { } from 'lib/bigcommerce/schema'; import type { RecursivePartial, RecursiveRequired } from '../utils/types'; import { productInfoFragment } from '../fragments/product'; -import { getConfig, Images, ProductImageVariables } from '..'; +import { + BigcommerceConfig, + getConfig, + Images, + ProductImageVariables, +} from '..'; export const getAllProductsQuery = /* GraphQL */ ` query getAllProducts( @@ -49,21 +54,24 @@ export type ProductVariables = Images & async function getAllProducts(opts?: { query?: string; variables?: ProductVariables; + config?: BigcommerceConfig; }): Promise>; async function getAllProducts(opts: { query: string; variables?: V; + config?: BigcommerceConfig; }): Promise>; async function getAllProducts({ query = getAllProductsQuery, variables: vars, + config = getConfig(), }: { query?: string; variables?: ProductVariables; + config?: BigcommerceConfig; } = {}): Promise> { - const config = getConfig(); const variables: GetAllProductsQueryVariables = { ...config.imageVariables, ...vars, diff --git a/lib/bigcommerce/api/operations/get-product.ts b/lib/bigcommerce/api/operations/get-product.ts index 5761978c8..c548f3873 100644 --- a/lib/bigcommerce/api/operations/get-product.ts +++ b/lib/bigcommerce/api/operations/get-product.ts @@ -4,7 +4,12 @@ import type { } from 'lib/bigcommerce/schema'; import type { RecursivePartial, RecursiveRequired } from '../utils/types'; import { productInfoFragment } from '../fragments/product'; -import { getConfig, Images, ProductImageVariables } from '..'; +import { + BigcommerceConfig, + getConfig, + Images, + ProductImageVariables, +} from '..'; export const getProductQuery = /* GraphQL */ ` query getProduct( @@ -45,21 +50,24 @@ export type ProductVariables = Images & async function getProduct(opts: { query?: string; variables: ProductVariables; + config?: BigcommerceConfig; }): Promise>; async function getProduct(opts: { query: string; variables: V; + config?: BigcommerceConfig; }): Promise>; async function getProduct({ query = getProductQuery, variables: vars, + config = getConfig(), }: { query?: string; variables: ProductVariables; + config?: BigcommerceConfig; }): Promise> { - const config = getConfig(); const variables: GetProductQueryVariables = { ...config.imageVariables, ...vars, From ca24a53cbfb5f78d6cd5adf18f7addcf46d24460 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 19:08:49 -0500 Subject: [PATCH 04/12] Updated yarn.lock --- yarn.lock | 458 +++++++++++++++++++++++++++--------------------------- 1 file changed, 230 insertions(+), 228 deletions(-) diff --git a/yarn.lock b/yarn.lock index 899db4c7f..12bafabc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,11 +3,11 @@ "@ampproject/toolbox-core@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.6.0.tgz#9824d5f133d82106a9bf0774920843c69fa5c869" - integrity sha512-sDMnHj8WaX3tqJS5VsIHkeW98nq5WQ0C9RoFc1PPS3rmYIlS0vhAfHbrjJw6wtuxBTQFxccje+Ew+2OJ2D15kA== + version "2.6.1" + resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.6.1.tgz#af97ec253bf39e5fe5121b8ec28f1f35d1878446" + integrity sha512-hTsd9J2yy3JPMClG8BuUhUfMDtd3oDhCuRe/SyZJYQfNMN8hQHt7LNXtdOzZr0Kw7nTepHmn7GODS68fZN4OQQ== dependencies: - cross-fetch "3.0.5" + cross-fetch "3.0.6" lru-cache "6.0.0" "@ampproject/toolbox-optimizer@2.6.0": @@ -1194,103 +1194,103 @@ tslib "~2.0.1" "@graphql-tools/apollo-engine-loader@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-6.2.3.tgz#769fb39e3ea63e036421705c711651cea0f21c44" - integrity sha512-KxBKk3nPAcTBjv+n8BM6t8L/xhlkvfgkonjRdbYN/PrjzshVS8T7ddI/7CwG6RARZHqKBQqp4uEmlmvC4oLPMg== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-6.2.4.tgz#bed59ccac654e36a62f736e035697e2e5de152ba" + integrity sha512-aYDyEs7Q0J0og7E/B7zj2+62Jf8QerkwV+hQ5wwGLSQlYnLDTB+hMNBG/3ga9qMQ5UVQ+d45ckXKN9nOl6LX7g== dependencies: - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/utils" "^6.2.4" cross-fetch "3.0.6" tslib "~2.0.1" "@graphql-tools/code-file-loader@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-6.2.3.tgz#65b0376224cc98a0c09ffcd925baf011c3d9f76f" - integrity sha512-Cvk9edruHSXhf0oFgdlVnGSUHg+X8OMwLiJwbMUc3cNT6w6JVef8yjn1mmEw9qHYakFwHSLMyJoghfXzP31Jww== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-6.2.4.tgz#ce194c19b2fcd714bffa4c0c529a4c65a6b0db4b" + integrity sha512-aDVI/JVUXIdqSJJKLjpBaqOAOCa5yUvsgQZu2Q9nVwV9faGlQi5MUuYAh1xp0LW80/5/unbiZ5/taRUyUY/6Eg== dependencies: - "@graphql-tools/graphql-tag-pluck" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/graphql-tag-pluck" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" fs-extra "9.0.1" tslib "~2.0.1" -"@graphql-tools/delegate@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-6.2.3.tgz#7776bfe8acf6f9a9aa0f6481a34ca8ab9fa87d1f" - integrity sha512-j4P7RaI5J9AvGcfBDITO6bZDeSvjMgDby2smn3L2dmXpPfMYh00KRRSZjzdMwSkLxi+0octh9buUAeCdvVMkKQ== +"@graphql-tools/delegate@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-6.2.4.tgz#db553b63eb9512d5eb5bbfdfcd8cb1e2b534699c" + integrity sha512-mXe6DfoWmq49kPcDrpKHgC2DSWcD5q0YCaHHoXYPAOlnLH8VMTY8BxcE8y/Do2eyg+GLcwAcrpffVszWMwqw0w== dependencies: "@ardatan/aggregate-error" "0.0.6" - "@graphql-tools/schema" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/schema" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" dataloader "2.0.0" is-promise "4.0.0" tslib "~2.0.1" "@graphql-tools/git-loader@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-6.2.3.tgz#a2a217064201adf109139e7a0784ac23926894bf" - integrity sha512-kWUsQ6rhFTSC6NhfNUxLJsMwtop4Es8e0xLz8IKqboDl+a3gRqv4bdGUVKXndNj98G7bt6DZRqH7LTS0dPmZwQ== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-6.2.4.tgz#2502d48cb1253bde7df3f3e1dfd2bdcf7ff72b82" + integrity sha512-urMwWhhsZUKnX9MDHXbMUfZd568pWwj1Bx1O2M7N8I25GqZDW54Fzj9DudlVKE5M9twMtoEyBTH7sH4tscliqg== dependencies: - "@graphql-tools/graphql-tag-pluck" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/graphql-tag-pluck" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" tslib "~2.0.1" "@graphql-tools/github-loader@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-6.2.3.tgz#b7d944616278d182d1187bbcace3b6b967a0ca7a" - integrity sha512-YDMcT59Jt2PO9Ork397BOjMCMvjNVFm4LVic7Llnl+3t5MnsBHsJ8fWEOx/p10/LXIBW5xjtKonz6QeY9QfB7w== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-6.2.4.tgz#38520b5964594a578dbb4a7693a76938a79877a1" + integrity sha512-p4peplm/Ot989bCD4XATK5NEXX7l39BXNw+YKaqgoEoHopyQ142I2Zb0GJiMRjW9yXGqIlDjG4reZazleiprgQ== dependencies: - "@graphql-tools/graphql-tag-pluck" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/graphql-tag-pluck" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" cross-fetch "3.0.6" tslib "~2.0.1" "@graphql-tools/graphql-file-loader@^6", "@graphql-tools/graphql-file-loader@^6.0.0": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-6.2.3.tgz#be82b56a7585c24b0d8fef7570707d6e7df7c0ee" - integrity sha512-9K+foDqfcJXf2jNNOWWZnV+PdxJkKmzAY58qlbFEFfUeRC6ZmOA9B3vTkcFadVdSwIsaWHhaxqHrNAD+OfkAyQ== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-6.2.4.tgz#1765b644cd621040f232f5c32321b45c187399a7" + integrity sha512-IcdUZoOlkCGr0KO8QCO8G031CDDv5dzHBZeN5H1gzE2AVFFwn2AexysrUXBxftm2DQIOuV+Knap7dC4Ol54kNA== dependencies: - "@graphql-tools/import" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/import" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" fs-extra "9.0.1" tslib "~2.0.1" -"@graphql-tools/graphql-tag-pluck@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-6.2.3.tgz#e60cb0159d6081f7743c7379ebeb5384552f93e6" - integrity sha512-GnZnFSGV71g4Za/fMlwLXKIIPbP7jBoeeSUbk2LPL3d58v9+n8GtbQewTKLKWFSFtF9qAfpHos+Ok2WC1+o1FA== +"@graphql-tools/graphql-tag-pluck@^6.2.4": + version "6.2.5" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-6.2.5.tgz#5c0c47362406a55aaf661c4af0209b542b8483dc" + integrity sha512-qvdIOTanBuKYLIMSYl9Tk+ej9dq00B4BqUnHqoCvYtSjD1n1UINGrqXgwMT+JXp66gUZWw8BU9Ke92mQ4UwTpg== dependencies: "@babel/parser" "7.11.5" "@babel/traverse" "7.11.5" "@babel/types" "7.11.5" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/utils" "^6.2.4" tslib "~2.0.1" optionalDependencies: vue-template-compiler "^2.6.12" -"@graphql-tools/import@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.2.3.tgz#c50677b4404bd3a8aa92c31dcd9919ec921bb86e" - integrity sha512-2ftXR84aPy2ueAEEGw/yFvYGPbvJYs2m18FEODhAq5z4P285ZlCMluxTUR9yNjumzgQP5Eer4fl64ztsdJvCyg== +"@graphql-tools/import@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.2.4.tgz#0547f6d4754a924e80439d6af013577cdb617194" + integrity sha512-Q6fk6hbtDevoEVcgwb3WRn7XOqGY4MnX3Mvc+x8/b8k4RZ4wT+0WSLRDXGAKiVKRxGhgouU2lZVnGE/LDrGSCg== dependencies: fs-extra "9.0.1" resolve-from "5.0.0" tslib "~2.0.1" "@graphql-tools/json-file-loader@^6", "@graphql-tools/json-file-loader@^6.0.0": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-6.2.3.tgz#5992ef57bfa29b3bfea07915cc50c59b6e656ab8" - integrity sha512-7v445KZLVB3owbibu2HsFmVSsdDOn0NzYSqIXaaIZ7saqoVtG8etSt699kLw5gJM3j0Kjm7XDz9tK60Apes/xg== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-6.2.4.tgz#0707fedfced73dd91b1dd81dfa02e83413e5aeaa" + integrity sha512-1iL6wwZrUt888hExlNEloSpNXuuUFYD2KV2FZ82t6yiq6bO9Iyg12SUuGd5xVXx9jUkdaHRZc0plMyuIA6gTGA== dependencies: - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/utils" "^6.2.4" fs-extra "9.0.1" tslib "~2.0.1" "@graphql-tools/load@^6", "@graphql-tools/load@^6.0.0": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-6.2.3.tgz#7a40d9767049941c704bff7300c46ae5ea647bac" - integrity sha512-3wmzrwf7tVY8rDRT2jxfQKlKgSB6P8OordFoOxpk1qNP2vmkUN9tWKxaI1ANkdm+et1D3ovUHeSoW6jKscnUAA== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-6.2.4.tgz#a1a860bdc9d9e0bd93e1dffdbd2cf8839a521c41" + integrity sha512-FlQC50VELwRxoWUbJMMMs5gG0Dl8BaQYMrXUHTsxwqR7UmksUYnysC21rdousvs6jVZ7pf4unZfZFtBjz+8Edg== dependencies: - "@graphql-tools/merge" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/merge" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" globby "11.0.1" import-from "3.0.0" is-glob "4.0.1" @@ -1299,22 +1299,22 @@ unixify "1.0.0" valid-url "1.0.9" -"@graphql-tools/merge@6.2.3", "@graphql-tools/merge@^6.0.0", "@graphql-tools/merge@^6.0.18": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-6.2.3.tgz#df6d84d9182bd289985da4cc3a45515a7c2135df" - integrity sha512-qSSxdM2AKjnAHuChcnxIfzsGej78B56EE6ZD3tXMtKJOMQMhk4T4yXnKRHEw8fw7ZtNk/KqCmb6LJHy8Ws8frg== +"@graphql-tools/merge@^6.0.0", "@graphql-tools/merge@^6.0.18", "@graphql-tools/merge@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-6.2.4.tgz#5b3b68083d55a38a7f3caac6e0adc46f428c2a3b" + integrity sha512-hQbiSzCJgzUYG1Aspj5EAUY9DsbTI2OK30GLBOjUI16DWkoLVXLXy4ljQYJxq6wDc4fqixMOmvxwf8FoJ9okmw== dependencies: - "@graphql-tools/schema" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/schema" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" tslib "~2.0.1" "@graphql-tools/prisma-loader@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-6.2.3.tgz#ee820c46ea94836c97adbc4ea4a34ac2740e0ca6" - integrity sha512-wjHg5SCJHsqI97/ct4G/B88VnPeTlaYYAAIgSvkpLWshuA3eZUuW28TlWlyRyjgUeGDaeNiO/UQSLE3pOAZUFw== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-6.2.4.tgz#3f902b9f1d36ae0c4731e1fe963178bea300af49" + integrity sha512-4S6j+7kNHKLDnK6mgVj+daW/7SkbdaZ7S8kkyKQzsY8hCh0B7RUkUBqkPCZ5+rbTyKCtFOyKyMYw+ebfLQ5QXg== dependencies: - "@graphql-tools/url-loader" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/url-loader" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" "@types/http-proxy-agent" "^2.0.2" "@types/js-yaml" "^3.12.5" "@types/json-stable-stringify" "^1.0.32" @@ -1322,13 +1322,13 @@ ajv "^6.12.5" bluebird "^3.7.2" chalk "^4.1.0" - debug "^4.1.1" + debug "^4.2.0" dotenv "^8.2.0" fs-extra "9.0.1" graphql-request "^3.1.0" http-proxy-agent "^4.0.1" https-proxy-agent "^5.0.0" - isomorphic-fetch "^2.2.1" + isomorphic-fetch "^3.0.0" js-yaml "^3.14.0" json-stable-stringify "^1.0.1" jsonwebtoken "^8.5.1" @@ -1339,30 +1339,30 @@ yaml-ast-parser "^0.0.43" "@graphql-tools/relay-operation-optimizer@^6": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.2.3.tgz#8f2bda200ae1eab53991f952f1e900c2bcc9b610" - integrity sha512-l7pVF1lC1fGNCXTSlPc1esGV5fEqru7HjWrcg5oF/DGIaWi8Drw6GLmexLBfkbmxatKlFkBjrVJ/q3RxSaj+eQ== + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.2.4.tgz#1cba2ea7ebc30aa28d1e5461a6079aca173fabd0" + integrity sha512-lvBCrRupmVpKfwgOmwz7epm28Nwmk9McddG1htRiAPRCg5MB7/52bYP/QgklDQgkRXWsaDEBXfxKyoGkvLvu0w== dependencies: - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/utils" "^6.2.4" relay-compiler "10.0.1" tslib "~2.0.1" -"@graphql-tools/schema@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-6.2.3.tgz#7ffc8e5f49d9a81f446fb8db87a6f5d07b1fba8e" - integrity sha512-CV5vDfQhXidssLK5hjT55FfwRAvBoGW53lVBl0rbXrbsSX7H9iVHdUf4UaDIlMc6WcnnzOrRiue/khHz3rzDEg== +"@graphql-tools/schema@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-6.2.4.tgz#cc4e9f5cab0f4ec48500e666719d99fc5042481d" + integrity sha512-rh+14lSY1q8IPbEv2J9x8UBFJ5NrDX9W5asXEUlPp+7vraLp/Tiox4GXdgyA92JhwpYco3nTf5Bo2JDMt1KnAQ== dependencies: - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/utils" "^6.2.4" tslib "~2.0.1" -"@graphql-tools/url-loader@6.2.3", "@graphql-tools/url-loader@^6", "@graphql-tools/url-loader@^6.0.0": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-6.2.3.tgz#3ecffd85c6efd89d9c260d9c4737aa87d0e5c7e9" - integrity sha512-cV/VR/lT1bHxwhrZlyG+sevl4zU0zZQHS7+TelTfAdKGrSswEozK98pPjkFP57+6ghitH6XoHUE91hFxtaODsA== +"@graphql-tools/url-loader@^6", "@graphql-tools/url-loader@^6.0.0", "@graphql-tools/url-loader@^6.2.4": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-6.3.0.tgz#75b82bdf0983d3e389c75948a7abff20fa45a630" + integrity sha512-lX6A22Rhbqj8FHmkCVSDflolOGy7UtCJGtGbfRuv8/VqD94JfJLnGVFxC1jODURFdj+yrs/97Wm/ntRcpy7nDA== dependencies: - "@graphql-tools/delegate" "6.2.3" - "@graphql-tools/utils" "6.2.3" - "@graphql-tools/wrap" "6.2.3" + "@graphql-tools/delegate" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" + "@graphql-tools/wrap" "^6.2.4" "@types/websocket" "1.0.1" cross-fetch "3.0.6" subscriptions-transport-ws "0.9.18" @@ -1370,35 +1370,40 @@ valid-url "1.0.9" websocket "1.0.32" -"@graphql-tools/utils@6.2.3", "@graphql-tools/utils@^6", "@graphql-tools/utils@^6.0.0", "@graphql-tools/utils@^6.0.18": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-6.2.3.tgz#235636b47a62f12f3dddbdd30b2986fc03f3a5fa" - integrity sha512-eOhZy4y23r6AddokBqvFpQybtHvhTyZCc3VFWn8eIqF92vre90UKHbCX6Cf6VBo6i7l0ZwChPPbUzEiHOk+HJQ== +"@graphql-tools/utils@^6", "@graphql-tools/utils@^6.0.0", "@graphql-tools/utils@^6.0.18", "@graphql-tools/utils@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-6.2.4.tgz#38a2314d2e5e229ad4f78cca44e1199e18d55856" + integrity sha512-ybgZ9EIJE3JMOtTrTd2VcIpTXtDrn2q6eiYkeYMKRVh3K41+LZa6YnR2zKERTXqTWqhobROwLt4BZbw2O3Aeeg== dependencies: "@ardatan/aggregate-error" "0.0.6" camel-case "4.1.1" tslib "~2.0.1" -"@graphql-tools/wrap@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-6.2.3.tgz#7e27ce75fefe4da4601e2ff4ba22ccf13a130e32" - integrity sha512-bxMXobcuKy8r7jKefQx5VH3FSyXVHKfDWfJ65Kq4oAC2+d7DUlpr3HZ6BWoMhfgUf6s6PPM26Us00TGsUQlAGg== +"@graphql-tools/wrap@^6.2.4": + version "6.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-6.2.4.tgz#2709817da6e469753735a9fe038c9e99736b2c57" + integrity sha512-cyQgpybolF9DjL2QNOvTS1WDCT/epgYoiA8/8b3nwv5xmMBQ6/6nYnZwityCZ7njb7MMyk7HBEDNNlP9qNJDcA== dependencies: - "@graphql-tools/delegate" "6.2.3" - "@graphql-tools/schema" "6.2.3" - "@graphql-tools/utils" "6.2.3" + "@graphql-tools/delegate" "^6.2.4" + "@graphql-tools/schema" "^6.2.4" + "@graphql-tools/utils" "^6.2.4" is-promise "4.0.0" tslib "~2.0.1" -"@next/polyfill-module@9.5.4-canary.20": - version "9.5.4-canary.20" - resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-9.5.4-canary.20.tgz#1de6f1a5924c6dc1998d8a3e0dbd685f413203bc" - integrity sha512-9C/RQIiXA62TheJLatVRR6UVOBZVIMZ5J7DJIn2WRxgT2srRI0Ku6C+tgPJekjHp9XjbWRzc0JCKG1mYwkmdtA== +"@next/env@9.5.4-canary.23": + version "9.5.4-canary.23" + resolved "https://registry.yarnpkg.com/@next/env/-/env-9.5.4-canary.23.tgz#2078ce80a1d9424bab7ec169dcf98b8d684bc845" + integrity sha512-uP9GV9QU+QODyYM9ueV1E4tocrAeAsvT1+x11mbQWYhC4lv9EXA85S5dUpJp4dbv1WwM+qJQaoEe7yL/exCkng== -"@next/react-dev-overlay@9.5.4-canary.20": - version "9.5.4-canary.20" - resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-9.5.4-canary.20.tgz#dd3dcd3898b8684e3768a1018822041e0e304fb7" - integrity sha512-Q8/iSvIJuLQnF3KQ4lV15wAm2j3ZFgT6Hn6y4+rj6p0DU9bB/Cp4XqDbVh3VIo+yyGNsw0cT/vmcimFe1MSqFg== +"@next/polyfill-module@9.5.4-canary.23": + version "9.5.4-canary.23" + resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-9.5.4-canary.23.tgz#5fd54f33889a6f605337168c94b0fbac779dc107" + integrity sha512-nyvVpt8mb2IGoAqsCucrOk88/nU2c+Xv/Iuaxfyex1qv2g1ZK1KUSojLVSIfqOPa5toP1gCgU+xsz8jXVgmpEg== + +"@next/react-dev-overlay@9.5.4-canary.23": + version "9.5.4-canary.23" + resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-9.5.4-canary.23.tgz#8f856f0b1db2fad6f7a2bdf6b15d487541484bdc" + integrity sha512-Ls00yEPvtTkXxipRfprMGJLn9mlmyDozYiIzvZqafkxuZ9KhII/aLu1Xx4W4o6muwEnxPBKW1knsHvWzStsjQA== dependencies: "@babel/code-frame" "7.10.4" ally.js "1.4.1" @@ -1411,10 +1416,10 @@ stacktrace-parser "0.1.10" strip-ansi "6.0.0" -"@next/react-refresh-utils@9.5.4-canary.20": - version "9.5.4-canary.20" - resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-9.5.4-canary.20.tgz#2eac9bbf1cb19303b6e9690ec49c6355ab055e2f" - integrity sha512-5B9/GLFqnv6/lx/7kySB8EiqB/R/mXWmH53pcbHKVNdXvoD4oi2fT7PWHXA05JQdr0P1cYIPA1ytrrnIf8F1EQ== +"@next/react-refresh-utils@9.5.4-canary.23": + version "9.5.4-canary.23" + resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-9.5.4-canary.23.tgz#a0a5c3b10108dc6ef1e17ff68e09bd7dcae76278" + integrity sha512-9Bne33O1uveH7YRjfX0UCJLfsUcP/lIZMc1JDmTkZuQOIFcTg8wuWOXC2mwQIAVtPZ8S9Lg37vK/c0ngZO9omw== "@nodelib/fs.scandir@2.1.3": version "2.1.3" @@ -1511,9 +1516,9 @@ "@types/estree" "*" "@types/eslint@*": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.2.tgz#c88426b896efeb0b2732a92431ce8aa7ec0dee61" - integrity sha512-psWuwNXuKR2e6vMU5d2qH0Kqzrb2Zxwk+uBCF2LsyEph+Nex3lFIPMJXwxfGesdtJM2qtjKoCYsyh76K3x9wLg== + version "7.2.3" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.3.tgz#a3731b7584fe1a847a34e67ac57a556afd9b0c0e" + integrity sha512-SPBkpC+awgFfyAn4sjt0JBZ3vzACoSp2zhGBJkkrs09EzPqLbxkzaE8kJs3EsRRgkZwWk9zyXT/swvhnJYX8pQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1552,12 +1557,7 @@ dependencies: "@types/node" "*" -"@types/node@*": - version "14.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.1.tgz#56af902ad157e763f9ba63d671c39cda3193c835" - integrity sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw== - -"@types/node@^14.11.2": +"@types/node@*", "@types/node@^14.11.2": version "14.11.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" integrity sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA== @@ -1573,9 +1573,9 @@ integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== "@types/react@^16.9.49": - version "16.9.49" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.49.tgz#09db021cf8089aba0cdb12a49f8021a69cce4872" - integrity sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g== + version "16.9.50" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.50.tgz#cb5f2c22d42de33ca1f5efc6a0959feb784a3a2d" + integrity sha512-kPx5YsNnKDJejTk1P+lqThwxN2PczrocwsvqXnjvVvKpFescoY62ZiM3TV7dH1T8lFhlHZF+PE5xUyimUwqEGA== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -2268,13 +2268,13 @@ browserslist@4.13.0: escalade "^3.0.1" node-releases "^1.1.58" -browserslist@^4.12.0, browserslist@^4.6.4, browserslist@^4.8.5: - version "4.14.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.3.tgz#381f9e7f13794b2eb17e1761b4f118e8ae665a53" - integrity sha512-GcZPC5+YqyPO4SFnz48/B0YaCwS47Q9iPChRGi6t7HhflKBcINzFrJvRfC+jp30sRMKxF+d4EHGs27Z0XP1NaQ== +browserslist@^4.12.0, browserslist@^4.14.3, browserslist@^4.6.4, browserslist@^4.8.5: + version "4.14.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.5.tgz#1c751461a102ddc60e40993639b709be7f2c4015" + integrity sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA== dependencies: - caniuse-lite "^1.0.30001131" - electron-to-chromium "^1.3.570" + caniuse-lite "^1.0.30001135" + electron-to-chromium "^1.3.571" escalade "^3.1.0" node-releases "^1.1.61" @@ -2404,10 +2404,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.0.0.tgz#5259f7c30e35e278f1bdc2a4d91230b37cad981e" integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w== -caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001113, caniuse-lite@^1.0.30001131: - version "1.0.30001133" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001133.tgz#ec564c5495311299eb05245e252d589a84acd95e" - integrity sha512-s3XAUFaC/ntDb1O3lcw9K8MPeOW7KO3z9+GzAoBxfz1B0VdacXPMKgFUtG4KIsgmnbexmi013s9miVu4h+qMHw== +caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001113, caniuse-lite@^1.0.30001135: + version "1.0.30001141" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001141.tgz#214a196d81aa938b268fb0cb6d8fab23fdf14378" + integrity sha512-EHfInJHoQTmlMdVZrEc5gmwPc0zyN/hVufmGHPbVNQwlk7tJfCmQ2ysRZMY2MeleBivALUTyyxXnQjK18XrVpA== caseless@~0.12.0: version "0.12.0" @@ -2964,7 +2964,7 @@ debounce@^1.2.0: resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131" integrity sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg== -debug@4, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@^4.1.0, debug@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== @@ -3049,6 +3049,11 @@ dependency-graph@^0.9.0: resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.9.0.tgz#11aed7e203bc8b00f48356d92db27b265c445318" integrity sha512-9YLIBURXj4DJMFALxXw9K3Y3rwb5Fk0X5/8ipCzaN84+gKxoHK43tVKRNakCQbiEx07E8Uwhuq21BpUagFhZ8w== +dequal@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.2.tgz#85ca22025e3a87e65ef75a7a437b35284a7e319d" + integrity sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug== + des.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" @@ -3118,13 +3123,20 @@ domelementtype@^2.0.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.2.tgz#f3b6e549201e46f588b59463dd77187131fe6971" integrity sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA== -domhandler@3.0.0, domhandler@^3.0.0: +domhandler@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.0.0.tgz#51cd13efca31da95bbb0c5bee3a48300e333b3e9" integrity sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw== dependencies: domelementtype "^2.0.1" +domhandler@^3.0.0, domhandler@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.2.0.tgz#41711ab2f48f42b692537bcf279bc7f1167c83cd" + integrity sha512-FnT5pxGpykNI10uuwyqae65Ysw7XBQJKDjDjlHgE/rsNtjr1FyGNVNQCVlM5hwcq9wkyWSqB+L5Z+Qa4khwLuA== + dependencies: + domelementtype "^2.0.1" + domutils@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.1.0.tgz#7ade3201af43703fde154952e3a868eb4b635f16" @@ -3135,13 +3147,13 @@ domutils@2.1.0: domhandler "^3.0.0" domutils@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.3.0.tgz#6469c63a3da2de0c3016f3a59e6a969e10705bce" - integrity sha512-xWC75PM3QF6MjE5e58OzwTX0B/rPQnlqH0YyXB/c056RtVJA+eu60da2I/bdnEHzEYC00g8QaZUlAbqOZVbOsw== + version "2.4.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.4.1.tgz#73f65c09eb17943dd752d4a6e5d07914e52dc541" + integrity sha512-AA5r2GD1Dljhxc+k4zD2HYQaDkDPBhTqmqF55wLNlxfhFQlqaYME8Jhmo2nKNBb+CNfPXE8SAjtF6SsZ0cza/w== dependencies: dom-serializer "^1.0.1" domelementtype "^2.0.1" - domhandler "^3.0.0" + domhandler "^3.2.0" dot-case@^3.0.3: version "3.0.3" @@ -3176,10 +3188,10 @@ ecdsa-sig-formatter@1.0.11: dependencies: safe-buffer "^5.0.1" -electron-to-chromium@^1.3.488, electron-to-chromium@^1.3.570: - version "1.3.570" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.570.tgz#3f5141cc39b4e3892a276b4889980dabf1d29c7f" - integrity sha512-Y6OCoVQgFQBP5py6A/06+yWxUZHDlNr/gNDGatjH8AZqXl8X0tE4LfjLJsXGz/JmWJz8a6K7bR1k+QzZ+k//fg== +electron-to-chromium@^1.3.488, electron-to-chromium@^1.3.571: + version "1.3.576" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.576.tgz#2e70234484e03d7c7e90310d7d79fd3775379c34" + integrity sha512-uSEI0XZ//5ic+0NdOqlxp0liCD44ck20OAGyLMSymIWTEAtHKVJi6JM18acOnRgUgX7Q65QqnI+sNncNvIy8ew== elegant-spinner@^1.0.1: version "1.0.1" @@ -3228,10 +3240,10 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.0.0.tgz#4737e6ebd4f2fd13fe23f4cec9d02146afc2c527" - integrity sha512-6F037vvK16tgLlRgUx6ZEZISMysNvnnk09SILFrx3bNa1UsSLpIXFzWOmtiDxf1ISPAG6/wHBI61PEkeuTLVNA== +enhanced-resolve@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.2.0.tgz#3db3307a608f236f33aeea79303d32915792cbab" + integrity sha512-NZlGLl8DxmZoq0uqPPtJfsCAir68uR047+Udsh1FH4+5ydGQdMurn/A430A1BtxASVmMEuS7/XiJ5OxJ9apAzQ== dependencies: graceful-fs "^4.2.4" tapable "^2.0.0" @@ -3249,37 +3261,37 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: - version "1.17.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" - integrity sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw== + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" has-symbols "^1.0.1" - is-callable "^1.2.0" - is-regex "^1.1.0" - object-inspect "^1.7.0" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" object-keys "^1.1.1" - object.assign "^4.1.0" + object.assign "^4.1.1" string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" es-abstract@^1.18.0-next.0: - version "1.18.0-next.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.0.tgz#b302834927e624d8e5837ed48224291f2c66e6fc" - integrity sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ== + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" has-symbols "^1.0.1" - is-callable "^1.2.0" + is-callable "^1.2.2" is-negative-zero "^2.0.0" is-regex "^1.1.1" object-inspect "^1.8.0" object-keys "^1.1.1" - object.assign "^4.1.0" + object.assign "^4.1.1" string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" @@ -3464,11 +3476,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -3906,12 +3913,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -he@^1.1.0: +he@1.2.0, he@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -4152,10 +4154,10 @@ is-buffer@^1.1.5: 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.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.1.tgz#4d1e21a4f437509d25ce55f8184350771421c96d" - integrity sha512-wliAfSzx6V+6WfMOmus1xy0XvSgf/dlStkvTfq7F0g4bOIW0PSUbnyse3NhDwdyYS1ozfUtAAySqTws3z9Eqgg== +is-callable@^1.1.4, is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== is-data-descriptor@^0.1.4: version "0.1.4" @@ -4283,7 +4285,7 @@ is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-regex@^1.1.0, is-regex@^1.1.1: +is-regex@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== @@ -4343,7 +4345,7 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1: +isomorphic-fetch@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= @@ -4351,6 +4353,14 @@ isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.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" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -4633,10 +4643,10 @@ listr@^0.14.3: p-map "^2.0.0" rxjs "^6.3.3" -loader-runner@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.0.0.tgz#02abcfd9fe6ff7a5aeb3547464746c4dc6ba333d" - integrity sha512-Rqf48ufrr48gFjnaqss04QesoXB7VenbpFFIV/0yOKGnpbejrVlOPqTsoX42FG5goXM5Ixekcs4DqDzHOX2z7Q== +loader-runner@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.1.0.tgz#f70bc0c29edbabdf2043e7ee73ccc3fe1c96b42d" + integrity sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA== loader-utils@1.2.3: version "1.2.3" @@ -5030,9 +5040,9 @@ next-tick@~1.0.0: integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= next@^9.5.4-canary.20: - version "9.5.4-canary.20" - resolved "https://registry.yarnpkg.com/next/-/next-9.5.4-canary.20.tgz#041ae6c400b8ab7b7aabba3d66bdcda428f241c3" - integrity sha512-rQvdk3NDYyrB1KvQv2SzAoZlcpOJV2GA93l7BVbByp0l006d3dkFDML7XKEqqtYcvtDlzdKS/V9hde0psKFkAg== + version "9.5.4-canary.23" + resolved "https://registry.yarnpkg.com/next/-/next-9.5.4-canary.23.tgz#ce0e7b9e284b5f9b718610ff5363827d3dfecd44" + integrity sha512-uNMIonQUZr5uZvmuMJ1Pq2akfzEQa60mQPVkMUUe12eHcE3efsA1M3W+SZfcSnSkCna53qU9Km1pNdGbVLe1Cg== dependencies: "@ampproject/toolbox-optimizer" "2.6.0" "@babel/code-frame" "7.10.4" @@ -5052,9 +5062,10 @@ next@^9.5.4-canary.20: "@babel/preset-typescript" "7.10.4" "@babel/runtime" "7.11.2" "@babel/types" "7.11.5" - "@next/polyfill-module" "9.5.4-canary.20" - "@next/react-dev-overlay" "9.5.4-canary.20" - "@next/react-refresh-utils" "9.5.4-canary.20" + "@next/env" "9.5.4-canary.23" + "@next/polyfill-module" "9.5.4-canary.23" + "@next/react-dev-overlay" "9.5.4-canary.23" + "@next/react-refresh-utils" "9.5.4-canary.23" ast-types "0.13.2" babel-plugin-transform-define "2.0.0" babel-plugin-transform-react-remove-prop-types "0.4.24" @@ -5113,7 +5124,7 @@ node-fetch@2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-fetch@2.6.1: +node-fetch@2.6.1, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -5132,11 +5143,11 @@ node-gyp-build@~3.7.0: integrity sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w== node-html-parser@^1.2.19: - version "1.2.20" - resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.2.20.tgz#37e9ebc627dbe3ff446eea4ac93e3d254b7c6ee4" - integrity sha512-1fUpYjAducDrrBSE0etRUV1tM+wSFTudmrslMXuk35wL/L29E7e1CLQn4CNzFLnqtYpmDlWhkD6VUloyHA0dwA== + version "1.2.21" + resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.2.21.tgz#93b074d877007c7148d594968a642cd65d254daa" + integrity sha512-6vDhgen6J332syN5HUmeT4FfBG7m6bFRrPN+FXY8Am7FGuVpsIxTASVbeoO5PF2IHbX2s+WEIudb1hgxOjllNQ== dependencies: - he "1.1.1" + he "1.2.0" node-int64@^0.4.0: version "0.4.0" @@ -5219,7 +5230,7 @@ object-hash@^2.0.3: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.0.3.tgz#d12db044e03cd2ca3d77c0570d87225b02e1e6ea" integrity sha512-JPKn0GMu+Fa3zt3Bmr66JhokJU5BaNBIh4ZeTlaCBzrBsOeXzwcKKAK1tbLiPKgvwmPXsDvvLHoWh5Bm7ofIYg== -object-inspect@^1.7.0, object-inspect@^1.8.0: +object-inspect@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== @@ -5241,7 +5252,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: +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#303867a666cdd41936ecdedfb1f8f3e32a478cdd" integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== @@ -5838,17 +5849,7 @@ postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: indexes-of "^1.0.1" uniq "^1.0.1" -postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.3.tgz#766d77728728817cc140fa1ac6da5e77f9fada98" - integrity sha512-0ClFaY4X1ra21LRqbW6y3rUbWcxnSVkDFG57R7Nxus9J9myPFlv+jYDMohzpkBx0RrjjiqjtycpchQ+PLGmZ9w== - dependencies: - cssesc "^3.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" - util-deprecate "^1.0.2" - -postcss-selector-parser@^6.0.4: +postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz#56075a1380a04604c38b063ea7767a129af5c2b3" integrity sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw== @@ -5905,9 +5906,9 @@ postcss@^6.0.9: supports-color "^5.4.0" postcss@^7.0.11, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.18, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.34" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.34.tgz#f2baf57c36010df7de4009940f21532c16d65c20" - integrity sha512-H/7V2VeNScX9KE83GDrDZNiGT1m2H+UTnlinIzhjlLX9hfMUn1mHNnGeX81a1c8JSBdBvqk7c2ZOG6ZPn5itGw== + version "7.0.35" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" + integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== dependencies: chalk "^2.4.2" source-map "^0.6.1" @@ -6579,7 +6580,7 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@~0.5.12: +source-map-support@~0.5.12, source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -6597,7 +6598,7 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@0.7.3: +source-map@0.7.3, source-map@~0.7.2: version "0.7.3" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== @@ -6833,11 +6834,11 @@ supports-color@^7.0.0, supports-color@^7.1.0: has-flag "^4.0.0" swr@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/swr/-/swr-0.3.3.tgz#8e820360e3fece26df6f30ca09c478f70bf1f880" - integrity sha512-UxjfbvLdk4CzdchQBKmthUc1rO7KaCXdNL69oW7V/I2BOMv905rsL+kJdpO19OYwOPOpWZPvffTEE7yACwXc8w== + version "0.3.5" + resolved "https://registry.yarnpkg.com/swr/-/swr-0.3.5.tgz#848a80e7b23b96d7221468555d8688d3efdecbc7" + integrity sha512-sZNed7JBEnFC42+XFWJ+aYGGVg5D3qNyISZOke3oL/gM1UNm0tsj9mbhTPT99SV9DzbKbT1NFTTRandPdhvpUA== dependencies: - fast-deep-equal "2.0.1" + dequal "2.0.2" symbol-observable@^1.0.4, symbol-observable@^1.1.0: version "1.2.0" @@ -6914,13 +6915,13 @@ terser@4.8.0: source-map-support "~0.5.12" terser@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.2.tgz#f4bea90eb92945b2a028ceef79181b9bb586e7af" - integrity sha512-H67sydwBz5jCUA32ZRL319ULu+Su1cAoZnnc+lXnenGRYWyLE3Scgkt8mNoAsMx0h5kdo758zdoS0LG9rYZXDQ== + version "5.3.3" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.3.tgz#2592a1cf079df55101fe2b2cb2330f951863860b" + integrity sha512-vRQDIlD+2Pg8YMwVK9kMM3yGylG95EIwzBai1Bw7Ot4OBfn3VP1TZn3EWx4ep2jERN/AmnVaTiGuelZSN7ds/A== dependencies: commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" + source-map "~0.7.2" + source-map-support "~0.5.19" through@^2.3.6: version "2.3.8" @@ -7275,18 +7276,18 @@ webpack-sources@1.4.3, webpack-sources@^1.4.3: source-list-map "^2.0.0" source-map "~0.6.1" -webpack-sources@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.0.tgz#602d4bc7ff2e630ceb753a09ef49f260fa4ae7f0" - integrity sha512-CpCkDjEKa5vYVRDFDRABBkBomz+82lz9bpXViN1LBc8L/WDXvSyELKcBvBnTeDEiRfMJCGAFG9+04406PLSsIA== +webpack-sources@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.1.tgz#1467f6e692ddce91e88b8044c44347b1087bbd4f" + integrity sha512-A9oYz7ANQBK5EN19rUXbvNgfdfZf5U2gP0769OXsj9CvYkCR6OHOsd6OKyEy4H38GGxpsQPKIL83NC64QY6Xmw== dependencies: source-list-map "^2.0.1" source-map "^0.6.1" webpack@4.44.1, webpack@^5.0.0-beta.30: - version "5.0.0-rc.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.0.0-rc.0.tgz#166f6d9cd65912ff021695d82256b2f1e6e858ee" - integrity sha512-tHUFu4vaZxJuyKYf8FKkDZmxnf0txy6twNewxUlviFo+GYjFoGW3szD71cOw0NtJBiyGAQ9zLGVzfb2pXBSKVA== + version "5.0.0-rc.3" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.0.0-rc.3.tgz#534afa7ef8b54c62ea393492dfa2e05b4491d773" + integrity sha512-z07btJiDKZjtbHz1d/jbWBw+cV+ZEAIDZx/rHGJIj2I1jC/zWg0TxH0wg33v9GSVGTkVo48KcQ4AM5QnpN0yYQ== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.45" @@ -7295,14 +7296,15 @@ webpack@4.44.1, webpack@^5.0.0-beta.30: "@webassemblyjs/wasm-edit" "1.9.0" "@webassemblyjs/wasm-parser" "1.9.0" acorn "^7.4.0" + browserslist "^4.14.3" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.0.0" + enhanced-resolve "^5.2.0" eslint-scope "^5.1.0" events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.4" json-parse-better-errors "^1.0.2" - loader-runner "^4.0.0" + loader-runner "^4.1.0" mime-types "^2.1.27" neo-async "^2.6.2" pkg-dir "^4.2.0" @@ -7310,7 +7312,7 @@ webpack@4.44.1, webpack@^5.0.0-beta.30: tapable "^2.0.0" terser-webpack-plugin "^4.1.0" watchpack "^2.0.0" - webpack-sources "^2.0.0" + webpack-sources "^2.0.1" websocket@1.0.32: version "1.0.32" @@ -7324,7 +7326,7 @@ websocket@1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" -whatwg-fetch@>=0.10.0: +whatwg-fetch@>=0.10.0, whatwg-fetch@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz#e5f871572d6879663fa5674c8f833f15a8425ab3" integrity sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ== @@ -7392,9 +7394,9 @@ y18n@^4.0.0: integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== y18n@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.1.tgz#1ad2a7eddfa8bce7caa2e1f6b5da96c39d99d571" - integrity sha512-/jJ831jEs4vGDbYPQp4yGKDYPSCCEQ45uZWJHE1AoYBzqdZi8+LDWas0z4HrmJXmKdpFsTiowSHXdxyFhpmdMg== + version "5.0.2" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.2.tgz#48218df5da2731b4403115c39a1af709c873f829" + integrity sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA== yaeti@^0.0.6: version "0.0.6" @@ -7425,9 +7427,9 @@ yargs-parser@^18.1.2: decamelize "^1.2.0" yargs-parser@^20.0.0: - version "20.2.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.0.tgz#944791ca2be2e08ddadd3d87e9de4c6484338605" - integrity sha512-2agPoRFPoIcFzOIp6656gcvsg2ohtscpw2OINr/q46+Sq41xz2OYLqx5HRHabmFU1OARIPAYH5uteICE7mn/5A== + version "20.2.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.1.tgz#28f3773c546cdd8a69ddae68116b48a5da328e77" + integrity sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA== yargs@^15.3.1: version "15.4.1" From 390b2c33032efb1b4a52fafd940a583fe2b4f49c Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 20:26:32 -0500 Subject: [PATCH 05/12] Added products paths to getStaticPaths --- .../api/operations/get-all-product-paths.ts | 54 +++++++++++++++++++ lib/bigcommerce/api/operations/get-product.ts | 16 +++--- lib/bigcommerce/schema.d.ts | 22 +++++++- pages/product/[slug].tsx | 35 +++++++----- 4 files changed, 102 insertions(+), 25 deletions(-) create mode 100644 lib/bigcommerce/api/operations/get-all-product-paths.ts diff --git a/lib/bigcommerce/api/operations/get-all-product-paths.ts b/lib/bigcommerce/api/operations/get-all-product-paths.ts new file mode 100644 index 000000000..6fea2401b --- /dev/null +++ b/lib/bigcommerce/api/operations/get-all-product-paths.ts @@ -0,0 +1,54 @@ +import type { GetAllProductPathsQuery } from 'lib/bigcommerce/schema'; +import type { RecursivePartial, RecursiveRequired } from '../utils/types'; +import { BigcommerceConfig, getConfig } from '..'; + +export const getAllProductPathsQuery = /* GraphQL */ ` + query getAllProductPaths { + site { + products { + edges { + node { + path + } + } + } + } + } +`; + +export interface GetAllProductPathsResult { + products: T extends GetAllProductPathsQuery + ? NonNullable + : unknown; +} + +async function getAllProductPaths(opts?: { + query?: string; + config?: BigcommerceConfig; +}): Promise>; + +async function getAllProductPaths(opts: { + query: string; + config?: BigcommerceConfig; +}): Promise>; + +async function getAllProductPaths({ + query = getAllProductPathsQuery, + config = getConfig(), +}: { + query?: string; + config?: BigcommerceConfig; +} = {}): Promise> { + // 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 + ); + const products = data.site?.products?.edges; + + return { + products: (products as RecursiveRequired) ?? [], + }; +} + +export default getAllProductPaths; diff --git a/lib/bigcommerce/api/operations/get-product.ts b/lib/bigcommerce/api/operations/get-product.ts index c548f3873..bbd705242 100644 --- a/lib/bigcommerce/api/operations/get-product.ts +++ b/lib/bigcommerce/api/operations/get-product.ts @@ -4,16 +4,11 @@ import type { } from 'lib/bigcommerce/schema'; import type { RecursivePartial, RecursiveRequired } from '../utils/types'; import { productInfoFragment } from '../fragments/product'; -import { - BigcommerceConfig, - getConfig, - Images, - ProductImageVariables, -} from '..'; +import { BigcommerceConfig, getConfig, Images } from '..'; export const getProductQuery = /* GraphQL */ ` query getProduct( - $slug: String! + $path: String! $imgSmallWidth: Int = 320 $imgSmallHeight: Int $imgMediumWidth: Int = 640 @@ -24,7 +19,7 @@ export const getProductQuery = /* GraphQL */ ` $imgXLHeight: Int ) { site { - route(path: $slug) { + route(path: $path) { node { __typename ... on Product { @@ -45,7 +40,7 @@ export interface GetProductResult { } export type ProductVariables = Images & - Omit; + ({ path: string; slug?: never } | { path?: never; slug: string }); async function getProduct(opts: { query?: string; @@ -61,7 +56,7 @@ async function getProduct(opts: { async function getProduct({ query = getProductQuery, - variables: vars, + variables: { slug, ...vars }, config = getConfig(), }: { query?: string; @@ -71,6 +66,7 @@ async function getProduct({ const variables: GetProductQueryVariables = { ...config.imageVariables, ...vars, + path: slug ? `/${slug}/` : vars.path!, }; const data = await config.fetch>(query, { variables, diff --git a/lib/bigcommerce/schema.d.ts b/lib/bigcommerce/schema.d.ts index 5f25ff205..638e34e44 100644 --- a/lib/bigcommerce/schema.d.ts +++ b/lib/bigcommerce/schema.d.ts @@ -1713,6 +1713,26 @@ export type ProductInfoFragment = ( ) } ); +export type GetAllProductPathsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetAllProductPathsQuery = ( + { __typename?: 'Query' } + & { site: ( + { __typename?: 'Site' } + & { products: ( + { __typename?: 'ProductConnection' } + & { edges?: Maybe + ) } + )>>> } + ) } + ) } +); + export type GetAllProductsQueryVariables = Exact<{ first?: Maybe; imgSmallWidth?: Maybe; @@ -1748,7 +1768,7 @@ export type GetAllProductsQuery = ( ); export type GetProductQueryVariables = Exact<{ - slug: Scalars['String']; + path: Scalars['String']; imgSmallWidth?: Maybe; imgSmallHeight?: Maybe; imgMediumWidth?: Maybe; diff --git a/pages/product/[slug].tsx b/pages/product/[slug].tsx index 3b333ec12..012c43368 100644 --- a/pages/product/[slug].tsx +++ b/pages/product/[slug].tsx @@ -1,18 +1,16 @@ -import { GetStaticPropsContext, InferGetStaticPropsType } from "next"; -import { useRouter } from "next/router"; -import getProduct from "lib/bigcommerce/api/operations/get-product"; -import { Layout } from "@components/core"; -import { ProductView } from "@components/product"; +import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'; +import { useRouter } from 'next/router'; +import getProduct from 'lib/bigcommerce/api/operations/get-product'; +import { Layout } from '@components/core'; +import { ProductView } from '@components/product'; +import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths'; export async function getStaticProps({ params, }: GetStaticPropsContext<{ slug: string }>) { const { product } = await getProduct({ variables: { slug: params!.slug } }); - - console.log("PRODUCT", product); - const productData = { - title: "T-Shirt", + title: 'T-Shirt', description: ` Nothing undercover about this tee. Nope. This is the official Bad Boys tee. Printed in white or black ink on Black, Brown, or Oatmeal. @@ -21,12 +19,13 @@ export async function getStaticProps({ run. Printing starts when the drop ends. Reminder: Bad Boys For Life. Shipping may take 10+ days due to COVID-19. `, - price: "$50", - colors: ["black", "white", "pink"], - sizes: ["s", "m", "l", "xl", "xxl"], + price: '$50', + colors: ['black', 'white', 'pink'], + sizes: ['s', 'm', 'l', 'xl', 'xxl'], }; return { props: { + product, productData, }, revalidate: 200, @@ -34,16 +33,24 @@ export async function getStaticProps({ } export async function getStaticPaths() { + const { products } = await getAllProductPaths(); + return { - paths: [], - fallback: "unstable_blocking", + paths: products.map((product) => ({ + params: { slug: product!.node.path }, + })), + fallback: 'unstable_blocking', }; } export default function Home({ + product, productData, }: InferGetStaticPropsType) { + console.log('PRODUCT', product); + const router = useRouter(); + return ( {router.isFallback ? ( From 2314ad760a380ab7060dae4241e555ef226ba4a3 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 20:38:40 -0500 Subject: [PATCH 06/12] Added prettier to devs and codegen --- .prettierignore | 2 + codegen.json | 3 + lib/bigcommerce/schema.d.ts | 1617 ++++++++++++++++---------------- lib/bigcommerce/schema.graphql | 1578 +++++++++++++++++++++++-------- package.json | 5 + yarn.lock | 5 + 6 files changed, 2014 insertions(+), 1196 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..1380c2e74 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +node_modules +.next \ No newline at end of file diff --git a/codegen.json b/codegen.json index c2f13e69b..cce0f4f8b 100644 --- a/codegen.json +++ b/codegen.json @@ -20,5 +20,8 @@ "./lib/bigcommerce/schema.graphql": { "plugins": ["schema-ast"] } + }, + "hooks": { + "afterAllFileWrite": ["prettier --write"] } } diff --git a/lib/bigcommerce/schema.d.ts b/lib/bigcommerce/schema.d.ts index 638e34e44..e281cdaea 100644 --- a/lib/bigcommerce/schema.d.ts +++ b/lib/bigcommerce/schema.d.ts @@ -1,1367 +1,1333 @@ -export type Maybe = T | null; -export type Exact = { [K in keyof T]: T[K] }; +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; + 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; + 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; -}; + Long: any +} /** Login result */ export type LoginResult = { - __typename?: 'LoginResult'; + __typename?: 'LoginResult' /** The result of a login */ - result: Scalars['String']; -}; + result: Scalars['String'] +} /** Logout result */ export type LogoutResult = { - __typename?: 'LogoutResult'; + __typename?: 'LogoutResult' /** The result of a logout */ - result: Scalars['String']; -}; + result: Scalars['String'] +} export type Mutation = { - __typename?: 'Mutation'; - login: LoginResult; - logout: LogoutResult; -}; - + __typename?: 'Mutation' + login: LoginResult + logout: LogoutResult +} export type MutationLoginArgs = { - email: Scalars['String']; - password: Scalars['String']; -}; + email: Scalars['String'] + password: Scalars['String'] +} /** Aggregated */ export type Aggregated = { - __typename?: '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']; + 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']; -}; + warningLevel: Scalars['Int'] +} /** Aggregated Product Inventory */ export type AggregatedInventory = { - __typename?: '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']; + 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']; -}; + warningLevel: Scalars['Int'] +} /** Brand */ export type Brand = Node & { - __typename?: 'Brand'; + __typename?: 'Brand' /** The ID of an object */ - id: Scalars['ID']; + id: Scalars['ID'] /** Id of the brand. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Name of the brand. */ - name: Scalars['String']; + name: Scalars['String'] /** Default image for brand. */ - defaultImage?: Maybe; + defaultImage?: Maybe /** Page title for the brand. */ - pageTitle: Scalars['String']; + pageTitle: Scalars['String'] /** Meta description for the brand. */ - metaDesc: Scalars['String']; + metaDesc: Scalars['String'] /** Meta keywords for the brand. */ - metaKeywords: Array; + metaKeywords: Array /** Search keywords for the brand. */ - searchKeywords: Array; + searchKeywords: Array /** Path for the brand page. */ - path: Scalars['String']; - products: ProductConnection; + path: Scalars['String'] + products: ProductConnection /** Metafield data related to a brand. */ - metafields: MetafieldConnection; -}; - + metafields: MetafieldConnection +} /** Brand */ export type BrandProductsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + 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; -}; + 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'; + __typename?: 'BrandConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type BrandEdge = { - __typename?: 'BrandEdge'; + __typename?: 'BrandEdge' /** The item at the end of the edge. */ - node: Brand; + node: Brand /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Bulk pricing tier that sets a fixed price for the product or variant. */ export type BulkPricingFixedPriceDiscount = BulkPricingTier & { - __typename?: 'BulkPricingFixedPriceDiscount'; + __typename?: 'BulkPricingFixedPriceDiscount' /** This price will override the current product price. */ - price: Scalars['BigDecimal']; + price: Scalars['BigDecimal'] /** Minimum item quantity that applies to this bulk pricing tier. */ - minimumQuantity: Scalars['Int']; + 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; -}; + maximumQuantity?: Maybe +} /** Bulk pricing tier that reduces the price of the product or variant by a percentage. */ export type BulkPricingPercentageDiscount = BulkPricingTier & { - __typename?: 'BulkPricingPercentageDiscount'; + __typename?: 'BulkPricingPercentageDiscount' /** The percentage that will be removed from the product price. */ - percentOff: Scalars['BigDecimal']; + percentOff: Scalars['BigDecimal'] /** Minimum item quantity that applies to this bulk pricing tier. */ - minimumQuantity: Scalars['Int']; + 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; -}; + maximumQuantity?: Maybe +} /** Bulk pricing tier that will subtract an amount from the price of the product or variant. */ export type BulkPricingRelativePriceDiscount = BulkPricingTier & { - __typename?: 'BulkPricingRelativePriceDiscount'; + __typename?: 'BulkPricingRelativePriceDiscount' /** The price of the product/variant will be reduced by this priceAdjustment. */ - priceAdjustment: Scalars['BigDecimal']; + priceAdjustment: Scalars['BigDecimal'] /** Minimum item quantity that applies to this bulk pricing tier. */ - minimumQuantity: Scalars['Int']; + 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; -}; + 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']; + 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; -}; + maximumQuantity?: Maybe +} /** Product Option */ export type CatalogProductOption = { /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** Product Option Value */ export type CatalogProductOptionValue = { /** Unique ID for the option value. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Label for the option value. */ - label: Scalars['String']; + label: Scalars['String'] /** Indicates whether this value is the chosen default selected value. */ - isDefault: Scalars['Boolean']; -}; + isDefault: Scalars['Boolean'] +} /** Category */ export type Category = Node & { - __typename?: 'Category'; + __typename?: 'Category' /** The ID of an object */ - id: Scalars['ID']; + id: Scalars['ID'] /** Unique ID for the category. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Category name. */ - name: Scalars['String']; + name: Scalars['String'] /** Category path. */ - path: Scalars['String']; + path: Scalars['String'] /** Default image for the category. */ - defaultImage?: Maybe; + defaultImage?: Maybe /** Category description. */ - description: Scalars['String']; - products: ProductConnection; + description: Scalars['String'] + products: ProductConnection /** Metafield data related to a category. */ - metafields: MetafieldConnection; -}; - + metafields: MetafieldConnection +} /** Category */ export type CategoryProductsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + 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; -}; + 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'; + __typename?: 'CategoryConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type CategoryEdge = { - __typename?: 'CategoryEdge'; + __typename?: 'CategoryEdge' /** The item at the end of the edge. */ - node: Category; + node: Category /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** An item in a tree of categories. */ export type CategoryTreeItem = { - __typename?: 'CategoryTreeItem'; + __typename?: 'CategoryTreeItem' /** The id category. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** The name of category. */ - name: Scalars['String']; + name: Scalars['String'] /** Path assigned to this category */ - path: Scalars['String']; + path: Scalars['String'] /** The description of this category. */ - description: Scalars['String']; + description: Scalars['String'] /** The number of products in this category. */ - productCount: Scalars['Int']; + productCount: Scalars['Int'] /** Subcategories of this category */ - children: Array; -}; + children: Array +} /** A simple yes/no question represented by a checkbox. */ export type CheckboxOption = CatalogProductOption & { - __typename?: 'CheckboxOption'; + __typename?: 'CheckboxOption' /** Indicates the default checked status. */ - checkedByDefault: Scalars['Boolean']; + checkedByDefault: Scalars['Boolean'] /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** Contact field */ export type ContactField = { - __typename?: 'ContactField'; + __typename?: 'ContactField' /** Store address line. */ - address: Scalars['String']; + address: Scalars['String'] /** Store country. */ - country: Scalars['String']; + country: Scalars['String'] /** Store address type. */ - addressType: Scalars['String']; + addressType: Scalars['String'] /** Store email. */ - email: Scalars['String']; + email: Scalars['String'] /** Store phone number. */ - phone: Scalars['String']; -}; + phone: Scalars['String'] +} /** Custom field */ export type CustomField = { - __typename?: 'CustomField'; + __typename?: 'CustomField' /** Custom field id. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Name of the custom field. */ - name: Scalars['String']; + name: Scalars['String'] /** Value of the custom field. */ - value: Scalars['String']; -}; + value: Scalars['String'] +} /** A connection to a list of items. */ export type CustomFieldConnection = { - __typename?: 'CustomFieldConnection'; + __typename?: 'CustomFieldConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type CustomFieldEdge = { - __typename?: 'CustomFieldEdge'; + __typename?: 'CustomFieldEdge' /** The item at the end of the edge. */ - node: CustomField; + node: CustomField /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** A customer that shops on a store */ export type Customer = { - __typename?: 'Customer'; + __typename?: 'Customer' /** The ID of the customer. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** The company name of the customer. */ - company: Scalars['String']; + company: Scalars['String'] /** The customer group id of the customer. */ - customerGroupId: Scalars['Int']; + customerGroupId: Scalars['Int'] /** The email address of the customer. */ - email: Scalars['String']; + email: Scalars['String'] /** The first name of the customer. */ - firstName: Scalars['String']; + firstName: Scalars['String'] /** The last name of the customer. */ - lastName: Scalars['String']; + lastName: Scalars['String'] /** The notes of the customer. */ - notes: Scalars['String']; + notes: Scalars['String'] /** The phone number of the customer. */ - phone: Scalars['String']; + phone: Scalars['String'] /** The tax exempt category of the customer. */ - taxExemptCategory: Scalars['String']; + taxExemptCategory: Scalars['String'] /** Customer addresses count. */ - addressCount: Scalars['Int']; + addressCount: Scalars['Int'] /** Customer attributes count. */ - attributeCount: Scalars['Int']; + attributeCount: Scalars['Int'] /** Customer store credit. */ - storeCredit: Array; + storeCredit: Array /** Customer attributes. */ - attributes: CustomerAttributes; -}; + attributes: CustomerAttributes +} /** A custom, store-specific attribute for a customer */ export type CustomerAttribute = { - __typename?: 'CustomerAttribute'; + __typename?: 'CustomerAttribute' /** The ID of the custom customer attribute */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** The value of the custom customer attribute */ - value?: Maybe; + value?: Maybe /** The name of the custom customer attribute */ - name: Scalars['String']; -}; + name: Scalars['String'] +} /** Custom, store-specific customer attributes */ export type CustomerAttributes = { - __typename?: 'CustomerAttributes'; - attribute: CustomerAttribute; -}; - + __typename?: 'CustomerAttributes' + attribute: CustomerAttribute +} /** Custom, store-specific customer attributes */ export type CustomerAttributesAttributeArgs = { - entityId: Scalars['Int']; -}; + entityId: Scalars['Int'] +} /** A calendar for allowing selection of a date. */ export type DateFieldOption = CatalogProductOption & { - __typename?: 'DateFieldOption'; + __typename?: 'DateFieldOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; - + isRequired: Scalars['Boolean'] +} /** Date Time Extended */ export type DateTimeExtended = { - __typename?: 'DateTimeExtended'; + __typename?: 'DateTimeExtended' /** ISO-8601 formatted date in UTC */ - utc: Scalars['DateTime']; -}; + utc: Scalars['DateTime'] +} /** Display field */ export type DisplayField = { - __typename?: 'DisplayField'; + __typename?: 'DisplayField' /** Short date format. */ - shortDateFormat: Scalars['String']; + shortDateFormat: Scalars['String'] /** Extended date format. */ - extendedDateFormat: Scalars['String']; -}; + extendedDateFormat: Scalars['String'] +} /** A form allowing selection and uploading of a file from the user's local computer. */ export type FileUploadFieldOption = CatalogProductOption & { - __typename?: 'FileUploadFieldOption'; + __typename?: 'FileUploadFieldOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** Image */ export type Image = { - __typename?: 'Image'; + __typename?: 'Image' /** Absolute path to image using store CDN. */ - url: Scalars['String']; + url: Scalars['String'] /** Text description of an image that can be used for SEO and/or accessibility purposes. */ - altText: Scalars['String']; + altText: Scalars['String'] /** Indicates whether this is the primary image. */ - isDefault: Scalars['Boolean']; -}; - + isDefault: Scalars['Boolean'] +} /** Image */ export type ImageUrlArgs = { - width: Scalars['Int']; - height?: Maybe; -}; + width: Scalars['Int'] + height?: Maybe +} /** A connection to a list of items. */ export type ImageConnection = { - __typename?: 'ImageConnection'; + __typename?: 'ImageConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type ImageEdge = { - __typename?: 'ImageEdge'; + __typename?: 'ImageEdge' /** The item at the end of the edge. */ - node: Image; + node: Image /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** An inventory */ export type Inventory = { - __typename?: 'Inventory'; + __typename?: 'Inventory' /** Locations */ - locations: LocationConnection; -}; - + locations: LocationConnection +} /** An inventory */ export type InventoryLocationsArgs = { - entityIds?: Maybe>; - codes?: Maybe>; - typeIds?: Maybe>; - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; + entityIds?: Maybe> + codes?: Maybe> + typeIds?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Inventory By Locations */ export type InventoryByLocations = { - __typename?: 'InventoryByLocations'; + __typename?: 'InventoryByLocations' /** Location id. */ - locationEntityId: Scalars['Long']; + locationEntityId: Scalars['Long'] /** Number of available products in stock. */ - availableToSell: Scalars['Long']; + availableToSell: Scalars['Long'] /** Indicates a threshold low-stock level. */ - warningLevel: Scalars['Int']; + warningLevel: Scalars['Int'] /** Indicates whether this product is in stock. */ - isInStock: Scalars['Boolean']; -}; + isInStock: Scalars['Boolean'] +} /** A connection to a list of items. */ export type LocationConnection = { - __typename?: 'LocationConnection'; + __typename?: 'LocationConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type LocationEdge = { - __typename?: 'LocationEdge'; + __typename?: 'LocationEdge' /** The item at the end of the edge. */ - node: InventoryByLocations; + node: InventoryByLocations /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Logo field */ export type LogoField = { - __typename?: 'LogoField'; + __typename?: 'LogoField' /** Logo title. */ - title: Scalars['String']; + title: Scalars['String'] /** Store logo image. */ - image: Image; -}; + image: Image +} /** Measurement */ export type Measurement = { - __typename?: 'Measurement'; + __typename?: 'Measurement' /** Unformatted weight measurement value. */ - value: Scalars['Float']; + value: Scalars['Float'] /** Unit of measurement. */ - unit: Scalars['String']; -}; + unit: Scalars['String'] +} /** A connection to a list of items. */ export type MetafieldConnection = { - __typename?: 'MetafieldConnection'; + __typename?: 'MetafieldConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type MetafieldEdge = { - __typename?: 'MetafieldEdge'; + __typename?: 'MetafieldEdge' /** The item at the end of the edge. */ - node: Metafields; + node: Metafields /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Key/Value pairs of data attached tied to a resource entity (product, brand, category, etc.) */ export type Metafields = { - __typename?: 'Metafields'; + __typename?: 'Metafields' /** The ID of an object */ - id: Scalars['ID']; + id: Scalars['ID'] /** The ID of the metafield when referencing via our backend API. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** A label for identifying a metafield data value. */ - key: Scalars['String']; + key: Scalars['String'] /** A metafield value. */ - value: Scalars['String']; -}; + value: Scalars['String'] +} /** A money object - includes currency code and a money amount */ export type Money = { - __typename?: 'Money'; + __typename?: 'Money' /** Currency code of the current money. */ - currencyCode: Scalars['String']; + currencyCode: Scalars['String'] /** The amount of money. */ - value: Scalars['BigDecimal']; -}; + value: Scalars['BigDecimal'] +} /** A min and max pair of money objects */ export type MoneyRange = { - __typename?: 'MoneyRange'; + __typename?: 'MoneyRange' /** Minimum money object. */ - min: Money; + min: Money /** Maximum money object. */ - max: Money; -}; + max: Money +} /** A multi-line text input field, aka a text box. */ export type MultiLineTextFieldOption = CatalogProductOption & { - __typename?: 'MultiLineTextFieldOption'; + __typename?: 'MultiLineTextFieldOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** An option type that has a fixed list of values. */ export type MultipleChoiceOption = CatalogProductOption & { - __typename?: 'MultipleChoiceOption'; + __typename?: 'MultipleChoiceOption' /** The chosen display style for this multiple choice option. */ - displayStyle: Scalars['String']; + displayStyle: Scalars['String'] /** List of option values. */ - values: ProductOptionValueConnection; + values: ProductOptionValueConnection /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; - + isRequired: Scalars['Boolean'] +} /** An option type that has a fixed list of values. */ export type MultipleChoiceOptionValuesArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; + 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'; + __typename?: 'MultipleChoiceOptionValue' /** Unique ID for the option value. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Label for the option value. */ - label: Scalars['String']; + label: Scalars['String'] /** Indicates whether this value is the chosen default selected value. */ - isDefault: Scalars['Boolean']; -}; + isDefault: Scalars['Boolean'] +} /** An object with an ID */ export type Node = { /** The id of the object. */ - id: Scalars['ID']; -}; + id: Scalars['ID'] +} /** A single line text input field that only accepts numbers. */ export type NumberFieldOption = CatalogProductOption & { - __typename?: 'NumberFieldOption'; + __typename?: 'NumberFieldOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** A connection to a list of items. */ export type OptionConnection = { - __typename?: 'OptionConnection'; + __typename?: 'OptionConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type OptionEdge = { - __typename?: 'OptionEdge'; + __typename?: 'OptionEdge' /** The item at the end of the edge. */ - node: ProductOption; + node: ProductOption /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** A connection to a list of items. */ export type OptionValueConnection = { - __typename?: 'OptionValueConnection'; + __typename?: 'OptionValueConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type OptionValueEdge = { - __typename?: 'OptionValueEdge'; + __typename?: 'OptionValueEdge' /** The item at the end of the edge. */ - node: ProductOptionValue; + node: ProductOptionValue /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} export type OptionValueId = { - optionEntityId: Scalars['Int']; - valueEntityId: Scalars['Int']; -}; + optionEntityId: Scalars['Int'] + valueEntityId: Scalars['Int'] +} /** Information about pagination in a connection. */ export type PageInfo = { - __typename?: 'PageInfo'; + __typename?: 'PageInfo' /** When paginating forwards, are there more items? */ - hasNextPage: Scalars['Boolean']; + hasNextPage: Scalars['Boolean'] /** When paginating backwards, are there more items? */ - hasPreviousPage: Scalars['Boolean']; + hasPreviousPage: Scalars['Boolean'] /** When paginating backwards, the cursor to continue. */ - startCursor?: Maybe; + startCursor?: Maybe /** When paginating forwards, the cursor to continue. */ - endCursor?: Maybe; -}; + endCursor?: Maybe +} /** The min and max range of prices that apply to this product. */ export type PriceRanges = { - __typename?: 'PriceRanges'; + __typename?: 'PriceRanges' /** Product price min/max range. */ - priceRange: MoneyRange; + priceRange: MoneyRange /** Product retail price min/max range. */ - retailPriceRange?: Maybe; -}; + retailPriceRange?: Maybe +} /** The various prices that can be set on a product. */ export type Prices = { - __typename?: 'Prices'; + __typename?: 'Prices' /** Calculated price of the product. */ - price: Money; + price: Money /** Sale price of the product. */ - salePrice?: Maybe; + salePrice?: Maybe /** Original price of the product. */ - basePrice?: Maybe; + basePrice?: Maybe /** Retail price of the product. */ - retailPrice?: Maybe; + retailPrice?: Maybe /** Minimum advertised price of the product. */ - mapPrice?: Maybe; + mapPrice?: Maybe /** Product price min/max range. */ - priceRange: MoneyRange; + priceRange: MoneyRange /** Product retail price min/max range. */ - retailPriceRange?: Maybe; + 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; + saved?: Maybe /** List of bulk pricing tiers applicable to a product or variant. */ - bulkPricing: Array; -}; + bulkPricing: Array +} /** Product */ export type Product = Node & { - __typename?: 'Product'; + __typename?: 'Product' /** The ID of an object */ - id: Scalars['ID']; + id: Scalars['ID'] /** Id of the product. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Default product variant when no options are selected. */ - sku: Scalars['String']; + sku: Scalars['String'] /** Relative URL path to product page. */ - path: Scalars['String']; + path: Scalars['String'] /** Name of the product. */ - name: Scalars['String']; + name: Scalars['String'] /** Description of the product. */ - description: Scalars['String']; + description: Scalars['String'] /** Description of the product in plain text. */ - plainTextDescription: Scalars['String']; + plainTextDescription: Scalars['String'] /** Warranty information of the product. */ - warranty: Scalars['String']; + warranty: Scalars['String'] /** Minimum purchasable quantity for this product in a single order. */ - minPurchaseQuantity?: Maybe; + minPurchaseQuantity?: Maybe /** Maximum purchasable quantity for this product in a single order. */ - maxPurchaseQuantity?: Maybe; + maxPurchaseQuantity?: Maybe /** Absolute URL path for adding a product to cart. */ - addToCartUrl: Scalars['String']; + addToCartUrl: Scalars['String'] /** Absolute URL path for adding a product to customer's wishlist. */ - addToWishlistUrl: Scalars['String']; + addToWishlistUrl: Scalars['String'] /** Prices object determined by supplied product ID, variant ID, and selected option IDs. */ - prices?: Maybe; + 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; + priceRanges?: Maybe /** Weight of the product. */ - weight?: Maybe; + weight?: Maybe /** Height of the product. */ - height?: Maybe; + height?: Maybe /** Width of the product. */ - width?: Maybe; + width?: Maybe /** Depth of the product. */ - depth?: Maybe; + depth?: Maybe /** Product options. */ - options: OptionConnection; + options: OptionConnection /** Product options. */ - productOptions: ProductOptionConnection; + 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; + reviewSummary: Reviews /** Type of product, ex: physical, digital */ - type: Scalars['String']; + type: Scalars['String'] /** * The availability state of the product. * @deprecated Use status inside availabilityV2 instead. */ - availability: Scalars['String']; + 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']; + availabilityDescription: Scalars['String'] /** The availability state of the product. */ - availabilityV2: ProductAvailability; + availabilityV2: ProductAvailability /** List of categories associated with the product. */ - categories: CategoryConnection; + categories: CategoryConnection /** Brand associated with the product. */ - brand?: Maybe; + brand?: Maybe /** Variants associated with the product. */ - variants: VariantConnection; + variants: VariantConnection /** Custom fields of the product. */ - customFields: CustomFieldConnection; + customFields: CustomFieldConnection /** A list of the images for a product. */ - images: ImageConnection; + images: ImageConnection /** Default image for a product. */ - defaultImage?: Maybe; + defaultImage?: Maybe /** Related products for this product. */ - relatedProducts: RelatedProductsConnection; + relatedProducts: RelatedProductsConnection /** Inventory information of the product. */ - inventory: ProductInventory; + inventory: ProductInventory /** Metafield data related to a product. */ - metafields: MetafieldConnection; + metafields: MetafieldConnection /** * Product creation date * @deprecated Alpha version. Do not use in production. */ - createdAt: DateTimeExtended; -}; - + createdAt: DateTimeExtended +} /** Product */ export type ProductPlainTextDescriptionArgs = { - characterLimit?: Maybe; -}; - + characterLimit?: Maybe +} /** Product */ export type ProductPricesArgs = { - includeTax?: Maybe; - currencyCode?: Maybe; -}; - + includeTax?: Maybe + currencyCode?: Maybe +} /** Product */ export type ProductPriceRangesArgs = { - includeTax?: Maybe; -}; - + includeTax?: Maybe +} /** Product */ export type ProductOptionsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Product */ export type ProductProductOptionsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Product */ export type ProductCategoriesArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Product */ export type ProductVariantsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; - entityIds?: Maybe>; - optionValueIds?: Maybe>; -}; - + 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; -}; - + names?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Product */ export type ProductImagesArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Product */ export type ProductRelatedProductsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + 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; -}; + 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; + 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']; -}; + description: Scalars['String'] +} /** Product availability status */ export enum ProductAvailabilityStatus { Available = 'Available', Preorder = 'Preorder', - Unavailable = 'Unavailable' + Unavailable = 'Unavailable', } /** Available Product */ export type ProductAvailable = ProductAvailability & { - __typename?: 'ProductAvailable'; + __typename?: 'ProductAvailable' /** The availability state of the product. */ - status: ProductAvailabilityStatus; + 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']; -}; + description: Scalars['String'] +} /** A connection to a list of items. */ export type ProductConnection = { - __typename?: 'ProductConnection'; + __typename?: 'ProductConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type ProductEdge = { - __typename?: 'ProductEdge'; + __typename?: 'ProductEdge' /** The item at the end of the edge. */ - node: Product; + node: Product /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Product Inventory Information */ export type ProductInventory = { - __typename?: 'ProductInventory'; + __typename?: 'ProductInventory' /** Indicates whether this product is in stock. */ - isInStock: Scalars['Boolean']; + 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']; + 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; -}; + aggregated?: Maybe +} /** Product Option */ export type ProductOption = { - __typename?: 'ProductOption'; + __typename?: 'ProductOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; + isRequired: Scalars['Boolean'] /** Option values. */ - values: OptionValueConnection; -}; - + values: OptionValueConnection +} /** Product Option */ export type ProductOptionValuesArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** A connection to a list of items. */ export type ProductOptionConnection = { - __typename?: 'ProductOptionConnection'; + __typename?: 'ProductOptionConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type ProductOptionEdge = { - __typename?: 'ProductOptionEdge'; + __typename?: 'ProductOptionEdge' /** The item at the end of the edge. */ - node: CatalogProductOption; + node: CatalogProductOption /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Product Option Value */ export type ProductOptionValue = { - __typename?: 'ProductOptionValue'; + __typename?: 'ProductOptionValue' /** Unique ID for the option value. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Label for the option value. */ - label: Scalars['String']; -}; + label: Scalars['String'] +} /** A connection to a list of items. */ export type ProductOptionValueConnection = { - __typename?: 'ProductOptionValueConnection'; + __typename?: 'ProductOptionValueConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type ProductOptionValueEdge = { - __typename?: 'ProductOptionValueEdge'; + __typename?: 'ProductOptionValueEdge' /** The item at the end of the edge. */ - node: CatalogProductOptionValue; + node: CatalogProductOptionValue /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** A Product PickList Value - a product to be mapped to the base product if selected. */ export type ProductPickListOptionValue = CatalogProductOptionValue & { - __typename?: 'ProductPickListOptionValue'; + __typename?: 'ProductPickListOptionValue' /** The ID of the product associated with this option value. */ - productId: Scalars['Int']; + productId: Scalars['Int'] /** Unique ID for the option value. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Label for the option value. */ - label: Scalars['String']; + label: Scalars['String'] /** Indicates whether this value is the chosen default selected value. */ - isDefault: Scalars['Boolean']; -}; + isDefault: Scalars['Boolean'] +} /** PreOrder Product */ export type ProductPreOrder = ProductAvailability & { - __typename?: 'ProductPreOrder'; + __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; + message?: Maybe /** Product release date */ - willBeReleasedAt?: Maybe; + willBeReleasedAt?: Maybe /** The availability state of the product. */ - status: ProductAvailabilityStatus; + 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']; -}; + description: Scalars['String'] +} /** Unavailable Product */ export type ProductUnavailable = ProductAvailability & { - __typename?: 'ProductUnavailable'; + __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; + message?: Maybe /** The availability state of the product. */ - status: ProductAvailabilityStatus; + 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']; -}; + description: Scalars['String'] +} export type Query = { - __typename?: 'Query'; - site: Site; + __typename?: 'Query' + site: Site /** The currently logged in customer. */ - customer?: Maybe; + customer?: Maybe /** Fetches an object given its ID */ - node?: Maybe; + node?: Maybe /** @deprecated Alpha version. Do not use in production. */ - inventory: Inventory; -}; - + inventory: Inventory +} export type QueryNodeArgs = { - id: Scalars['ID']; -}; + id: Scalars['ID'] +} /** A connection to a list of items. */ export type RelatedProductsConnection = { - __typename?: 'RelatedProductsConnection'; + __typename?: 'RelatedProductsConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type RelatedProductsEdge = { - __typename?: 'RelatedProductsEdge'; + __typename?: 'RelatedProductsEdge' /** The item at the end of the edge. */ - node: Product; + node: Product /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Review Rating Summary */ export type Reviews = { - __typename?: 'Reviews'; + __typename?: 'Reviews' /** Total number of reviews on product. */ - numberOfReviews: Scalars['Int']; + numberOfReviews: Scalars['Int'] /** Summation of rating scores from each review. */ - summationOfRatings: Scalars['Int']; -}; + summationOfRatings: Scalars['Int'] +} /** route */ export type Route = { - __typename?: 'Route'; + __typename?: 'Route' /** node */ - node?: Maybe; -}; + node?: Maybe +} /** Store settings information from the control panel. */ export type Settings = { - __typename?: 'Settings'; + __typename?: 'Settings' /** The name of the store. */ - storeName: Scalars['String']; + storeName: Scalars['String'] /** The hash of the store. */ - storeHash: Scalars['String']; + storeHash: Scalars['String'] /** The current store status. */ - status: StorefrontStatusType; + status: StorefrontStatusType /** Logo information for the store. */ - logo: LogoField; + logo: LogoField /** Contact information for the store. */ - contact?: Maybe; + contact?: Maybe /** Store urls. */ - url: UrlField; + url: UrlField /** Store display format information. */ - display: DisplayField; + display: DisplayField /** Channel ID. */ - channelId: Scalars['Long']; -}; + channelId: Scalars['Long'] +} /** A site */ export type Site = { - __typename?: 'Site'; - categoryTree: Array; + __typename?: 'Site' + categoryTree: Array /** Details of the brand. */ - brands: BrandConnection; + brands: BrandConnection /** Details of the products. */ - products: ProductConnection; + products: ProductConnection /** Details of the newest products. */ - newestProducts: ProductConnection; + newestProducts: ProductConnection /** Details of the best selling products. */ - bestSellingProducts: ProductConnection; + bestSellingProducts: ProductConnection /** Details of the featured products. */ - featuredProducts: ProductConnection; + featuredProducts: ProductConnection /** A single product object with variant pricing overlay capabilities. */ - product?: Maybe; + product?: Maybe /** Route for a node */ - route: Route; + route: Route /** Store settings. */ - settings?: Maybe; -}; - + settings?: Maybe +} /** A site */ export type SiteBrandsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; - productEntityIds?: Maybe>; -}; - + 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>; -}; - + 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; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** A site */ export type SiteBestSellingProductsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** A site */ export type SiteFeaturedProductsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** A site */ export type SiteProductArgs = { - id?: Maybe; - entityId?: Maybe; - variantEntityId?: Maybe; - optionValueIds?: Maybe>; - sku?: Maybe; -}; - + id?: Maybe + entityId?: Maybe + variantEntityId?: Maybe + optionValueIds?: Maybe> + sku?: Maybe +} /** A site */ export type SiteRouteArgs = { - path: Scalars['String']; -}; + path: Scalars['String'] +} /** Storefront Mode */ export enum StorefrontStatusType { Launched = 'LAUNCHED', Maintenance = 'MAINTENANCE', PreLaunch = 'PRE_LAUNCH', - Hibernation = 'HIBERNATION' + 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'; + __typename?: 'SwatchOptionValue' /** List of up to 3 hex encoded colors to associate with a swatch value. */ - hexColors: Array; + hexColors: Array /** Absolute path of a swatch texture image. */ - imageUrl?: Maybe; + imageUrl?: Maybe /** Unique ID for the option value. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Label for the option value. */ - label: Scalars['String']; + label: Scalars['String'] /** Indicates whether this value is the chosen default selected value. */ - isDefault: Scalars['Boolean']; -}; - + 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; -}; + width: Scalars['Int'] + height?: Maybe +} /** A single line text input field. */ export type TextFieldOption = CatalogProductOption & { - __typename?: 'TextFieldOption'; + __typename?: 'TextFieldOption' /** Unique ID for the option. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Display name for the option. */ - displayName: Scalars['String']; + displayName: Scalars['String'] /** One of the option values is required to be selected for the checkout. */ - isRequired: Scalars['Boolean']; -}; + isRequired: Scalars['Boolean'] +} /** Url field */ export type UrlField = { - __typename?: 'UrlField'; + __typename?: 'UrlField' /** Store url. */ - vanityUrl: Scalars['String']; + vanityUrl: Scalars['String'] /** CDN url to fetch assets. */ - cdnUrl: Scalars['String']; -}; + cdnUrl: Scalars['String'] +} /** Variant */ export type Variant = Node & { - __typename?: 'Variant'; + __typename?: 'Variant' /** The ID of an object */ - id: Scalars['ID']; + id: Scalars['ID'] /** Id of the variant. */ - entityId: Scalars['Int']; + entityId: Scalars['Int'] /** Sku of the variant. */ - sku: Scalars['String']; + 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; + 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; + 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; + 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; + depth?: Maybe /** The options which define a variant. */ - options: OptionConnection; + options: OptionConnection /** Product options that compose this variant. */ - productOptions: ProductOptionConnection; + productOptions: ProductOptionConnection /** Default image for a variant. */ - defaultImage?: Maybe; + defaultImage?: Maybe /** Variant prices */ - prices?: Maybe; + prices?: Maybe /** Variant inventory */ - inventory?: Maybe; + inventory?: Maybe /** Metafield data related to a variant. */ - metafields: MetafieldConnection; -}; - + metafields: MetafieldConnection +} /** Variant */ export type VariantOptionsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Variant */ export type VariantProductOptionsArgs = { - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; - + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Variant */ export type VariantPricesArgs = { - includeTax?: Maybe; - currencyCode?: Maybe; -}; - + includeTax?: Maybe + currencyCode?: Maybe +} /** Variant */ export type VariantMetafieldsArgs = { - namespace: Scalars['String']; - keys?: Maybe>; - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; + 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'; + __typename?: 'VariantConnection' /** Information to aid in pagination. */ - pageInfo: PageInfo; + pageInfo: PageInfo /** A list of edges. */ - edges?: Maybe>>; -}; + edges?: Maybe>> +} /** An edge in a connection. */ export type VariantEdge = { - __typename?: 'VariantEdge'; + __typename?: 'VariantEdge' /** The item at the end of the edge. */ - node: Variant; + node: Variant /** A cursor for use in pagination. */ - cursor: Scalars['String']; -}; + cursor: Scalars['String'] +} /** Variant Inventory */ export type VariantInventory = { - __typename?: '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; + aggregated?: Maybe /** Indicates whether this product is in stock. */ - isInStock: Scalars['Boolean']; + isInStock: Scalars['Boolean'] /** Inventory by locations. */ - byLocation?: Maybe; -}; - + byLocation?: Maybe +} /** Variant Inventory */ export type VariantInventoryByLocationArgs = { - locationEntityIds?: Maybe>; - before?: Maybe; - after?: Maybe; - first?: Maybe; - last?: Maybe; -}; + locationEntityIds?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} /** Please select a currency */ export enum CurrencyCode { @@ -1644,152 +1610,157 @@ export enum CurrencyCode { Zrz = 'ZRZ', Zwd = 'ZWD', Zwl = 'ZWL', - Zwr = 'ZWR' + Zwr = 'ZWR', } +export type ResponsiveImageFragment = { __typename?: 'Image' } & { + urlSmall: Image['url'] + urlMedium: Image['url'] + urlLarge: Image['url'] + urlXL: Image['url'] +} +export type ProductInfoFragment = { __typename?: 'Product' } & Pick< + Product, + 'entityId' | 'name' | 'path' | 'description' +> & { + brand?: Maybe<{ __typename?: 'Brand' } & Pick> + prices?: Maybe< + { __typename?: 'Prices' } & { + price: { __typename?: 'Money' } & Pick + salePrice?: Maybe< + { __typename?: 'Money' } & Pick + > + } + > + images: { __typename?: 'ImageConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ImageEdge' } & { + node: { __typename?: 'Image' } & ResponsiveImageFragment + } + > + > + > + } + variants: { __typename?: 'VariantConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'VariantEdge' } & { + node: { __typename?: 'Variant' } & Pick & { + defaultImage?: Maybe< + { __typename?: 'Image' } & ResponsiveImageFragment + > + } + } + > + > + > + } + options: { __typename?: 'OptionConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'OptionEdge' } & { + node: { __typename?: 'ProductOption' } & Pick< + ProductOption, + 'entityId' | 'displayName' | 'isRequired' + > & { + values: { __typename?: 'OptionValueConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'OptionValueEdge' } & { + node: { __typename?: 'ProductOptionValue' } & Pick< + ProductOptionValue, + 'entityId' | 'label' + > + } + > + > + > + } + } + } + > + > + > + } + } -export type ResponsiveImageFragment = ( - { __typename?: 'Image' } - & { urlSmall: Image['url'], urlMedium: Image['url'], urlLarge: Image['url'], urlXL: Image['url'] } -); +export type GetAllProductPathsQueryVariables = Exact<{ [key: string]: never }> -export type ProductInfoFragment = ( - { __typename?: 'Product' } - & Pick - & { brand?: Maybe<( - { __typename?: 'Brand' } - & Pick - )>, prices?: Maybe<( - { __typename?: 'Prices' } - & { price: ( - { __typename?: 'Money' } - & Pick - ), salePrice?: Maybe<( - { __typename?: 'Money' } - & Pick - )> } - )>, images: ( - { __typename?: 'ImageConnection' } - & { edges?: Maybe>> } - ), variants: ( - { __typename?: 'VariantConnection' } - & { edges?: Maybe - & { defaultImage?: Maybe<( - { __typename?: 'Image' } - & ResponsiveImageFragment - )> } - ) } - )>>> } - ), options: ( - { __typename?: 'OptionConnection' } - & { edges?: Maybe - & { values: ( - { __typename?: 'OptionValueConnection' } - & { edges?: Maybe - ) } - )>>> } - ) } - ) } - )>>> } - ) } -); - -export type GetAllProductPathsQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetAllProductPathsQuery = ( - { __typename?: 'Query' } - & { site: ( - { __typename?: 'Site' } - & { products: ( - { __typename?: 'ProductConnection' } - & { edges?: 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<{ - first?: Maybe; - imgSmallWidth?: Maybe; - imgSmallHeight?: Maybe; - imgMediumWidth?: Maybe; - imgMediumHeight?: Maybe; - imgLargeWidth?: Maybe; - imgLargeHeight?: Maybe; - imgXLWidth?: Maybe; - imgXLHeight?: Maybe; -}>; + first?: Maybe + imgSmallWidth?: Maybe + imgSmallHeight?: Maybe + imgMediumWidth?: Maybe + imgMediumHeight?: Maybe + imgLargeWidth?: Maybe + imgLargeHeight?: Maybe + imgXLWidth?: Maybe + imgXLHeight?: Maybe +}> - -export type GetAllProductsQuery = ( - { __typename?: 'Query' } - & { site: ( - { __typename?: 'Site' } - & { products: ( - { __typename?: 'ProductConnection' } - & { pageInfo: ( - { __typename?: 'PageInfo' } - & Pick - ), edges?: Maybe - & { node: ( - { __typename?: 'Product' } - & ProductInfoFragment - ) } - )>>> } - ) } - ) } -); +export type GetAllProductsQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + products: { __typename?: 'ProductConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'startCursor' | 'endCursor' + > + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductEdge' } & Pick & { + node: { __typename?: 'Product' } & ProductInfoFragment + } + > + > + > + } + } +} export type GetProductQueryVariables = Exact<{ - path: Scalars['String']; - imgSmallWidth?: Maybe; - imgSmallHeight?: Maybe; - imgMediumWidth?: Maybe; - imgMediumHeight?: Maybe; - imgLargeWidth?: Maybe; - imgLargeHeight?: Maybe; - imgXLWidth?: Maybe; - imgXLHeight?: Maybe; -}>; + path: Scalars['String'] + imgSmallWidth?: Maybe + imgSmallHeight?: Maybe + imgMediumWidth?: Maybe + imgMediumHeight?: Maybe + imgLargeWidth?: Maybe + imgLargeHeight?: Maybe + imgXLWidth?: Maybe + imgXLHeight?: Maybe +}> - -export type GetProductQuery = ( - { __typename?: 'Query' } - & { site: ( - { __typename?: 'Site' } - & { route: ( - { __typename?: 'Route' } - & { node?: Maybe<{ __typename: 'Brand' } | { __typename: 'Category' } | ( - { __typename: 'Product' } - & ProductInfoFragment - ) | { __typename: 'Variant' }> } - ) } - ) } -); +export type GetProductQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + route: { __typename?: 'Route' } & { + node?: Maybe< + | { __typename: 'Brand' } + | { __typename: 'Category' } + | ({ __typename: 'Product' } & ProductInfoFragment) + | { __typename: 'Variant' } + > + } + } +} diff --git a/lib/bigcommerce/schema.graphql b/lib/bigcommerce/schema.graphql index 09bf64f90..72a087b48 100644 --- a/lib/bigcommerce/schema.graphql +++ b/lib/bigcommerce/schema.graphql @@ -1,12 +1,20 @@ -"""Login result""" +""" +Login result +""" type LoginResult { - """The result of a login""" + """ + The result of a login + """ result: String! } -"""Logout result""" +""" +Logout result +""" type LogoutResult { - """The result of a logout""" + """ + The result of a logout + """ result: String! } @@ -15,7 +23,9 @@ type Mutation { logout: LogoutResult! } -"""Aggregated""" +""" +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. @@ -28,7 +38,9 @@ type Aggregated { warningLevel: Int! } -"""Aggregated Product Inventory""" +""" +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. @@ -41,64 +53,116 @@ type AggregatedInventory { warningLevel: Int! } -"""Brand""" +""" +Brand +""" type Brand implements Node { - """The ID of an object""" + """ + The ID of an object + """ id: ID! - """Id of the brand.""" + """ + Id of the brand. + """ entityId: Int! - """Name of the brand.""" + """ + Name of the brand. + """ name: String! - """Default image for brand.""" + """ + Default image for brand. + """ defaultImage: Image - """Page title for the brand.""" + """ + Page title for the brand. + """ pageTitle: String! - """Meta description for the brand.""" + """ + Meta description for the brand. + """ metaDesc: String! - """Meta keywords for the brand.""" + """ + Meta keywords for the brand. + """ metaKeywords: [String!]! - """Search keywords for the brand.""" + """ + Search keywords for the brand. + """ searchKeywords: [String!]! - """Path for the brand page.""" + """ + Path for the brand page. + """ path: String! - products(before: String, after: String, first: Int, last: Int): ProductConnection! + 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! + """ + 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.""" +""" +A connection to a list of items. +""" type BrandConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [BrandEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type BrandEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Brand! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Bulk pricing tier that sets a fixed price for the product or variant.""" +""" +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.""" + """ + This price will override the current product price. + """ price: BigDecimal! - """Minimum item quantity that applies to this bulk pricing tier.""" + """ + Minimum item quantity that applies to this bulk pricing tier. + """ minimumQuantity: Int! """ @@ -111,10 +175,14 @@ type BulkPricingFixedPriceDiscount implements BulkPricingTier { 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.""" + """ + The percentage that will be removed from the product price. + """ percentOff: BigDecimal! - """Minimum item quantity that applies to this bulk pricing tier.""" + """ + Minimum item quantity that applies to this bulk pricing tier. + """ minimumQuantity: Int! """ @@ -132,7 +200,9 @@ type BulkPricingRelativePriceDiscount implements BulkPricingTier { """ priceAdjustment: BigDecimal! - """Minimum item quantity that applies to this bulk pricing tier.""" + """ + Minimum item quantity that applies to this bulk pricing tier. + """ minimumQuantity: Int! """ @@ -145,7 +215,9 @@ type BulkPricingRelativePriceDiscount implements BulkPricingTier { 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.""" + """ + Minimum item quantity that applies to this bulk pricing tier. + """ minimumQuantity: Int! """ @@ -154,245 +226,415 @@ interface BulkPricingTier { maximumQuantity: Int } -"""Product Option""" +""" +Product Option +""" interface CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } -"""Product Option Value""" +""" +Product Option Value +""" interface CatalogProductOptionValue { - """Unique ID for the option value.""" + """ + Unique ID for the option value. + """ entityId: Int! - """Label for the option value.""" + """ + Label for the option value. + """ label: String! - """Indicates whether this value is the chosen default selected value.""" + """ + Indicates whether this value is the chosen default selected value. + """ isDefault: Boolean! } -"""Category""" +""" +Category +""" type Category implements Node { - """The ID of an object""" + """ + The ID of an object + """ id: ID! - """Unique ID for the category.""" + """ + Unique ID for the category. + """ entityId: Int! - """Category name.""" + """ + Category name. + """ name: String! - """Category path.""" + """ + Category path. + """ path: String! - """Default image for the category.""" + """ + Default image for the category. + """ defaultImage: Image - """Category description.""" + """ + Category description. + """ description: String! - products(before: String, after: String, first: Int, last: Int): ProductConnection! + 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! + """ + 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.""" +""" +A connection to a list of items. +""" type CategoryConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [CategoryEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type CategoryEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Category! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""An item in a tree of categories.""" +""" +An item in a tree of categories. +""" type CategoryTreeItem { - """The id category.""" + """ + The id category. + """ entityId: Int! - """The name of category.""" + """ + The name of category. + """ name: String! - """Path assigned to this category""" + """ + Path assigned to this category + """ path: String! - """The description of this category.""" + """ + The description of this category. + """ description: String! - """The number of products in this category.""" + """ + The number of products in this category. + """ productCount: Int! - """Subcategories of this category""" + """ + Subcategories of this category + """ children: [CategoryTreeItem!]! } -"""A simple yes/no question represented by a checkbox.""" +""" +A simple yes/no question represented by a checkbox. +""" type CheckboxOption implements CatalogProductOption { - """Indicates the default checked status.""" + """ + Indicates the default checked status. + """ checkedByDefault: Boolean! - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } -"""Contact field""" +""" +Contact field +""" type ContactField { - """Store address line.""" + """ + Store address line. + """ address: String! - """Store country.""" + """ + Store country. + """ country: String! - """Store address type.""" + """ + Store address type. + """ addressType: String! - """Store email.""" + """ + Store email. + """ email: String! - """Store phone number.""" + """ + Store phone number. + """ phone: String! } -"""Custom field""" +""" +Custom field +""" type CustomField { - """Custom field id.""" + """ + Custom field id. + """ entityId: Int! - """Name of the custom field.""" + """ + Name of the custom field. + """ name: String! - """Value of the custom field.""" + """ + Value of the custom field. + """ value: String! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type CustomFieldConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [CustomFieldEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type CustomFieldEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: CustomField! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""A customer that shops on a store""" +""" +A customer that shops on a store +""" type Customer { - """The ID of the customer.""" + """ + The ID of the customer. + """ entityId: Int! - """The company name of the customer.""" + """ + The company name of the customer. + """ company: String! - """The customer group id of the customer.""" + """ + The customer group id of the customer. + """ customerGroupId: Int! - """The email address of the customer.""" + """ + The email address of the customer. + """ email: String! - """The first name of the customer.""" + """ + The first name of the customer. + """ firstName: String! - """The last name of the customer.""" + """ + The last name of the customer. + """ lastName: String! - """The notes of the customer.""" + """ + The notes of the customer. + """ notes: String! - """The phone number of the customer.""" + """ + The phone number of the customer. + """ phone: String! - """The tax exempt category of the customer.""" + """ + The tax exempt category of the customer. + """ taxExemptCategory: String! - """Customer addresses count.""" + """ + Customer addresses count. + """ addressCount: Int! - """Customer attributes count.""" + """ + Customer attributes count. + """ attributeCount: Int! - """Customer store credit.""" + """ + Customer store credit. + """ storeCredit: [Money!]! - """Customer attributes.""" + """ + Customer attributes. + """ attributes: CustomerAttributes! } -"""A custom, store-specific attribute for a customer""" +""" +A custom, store-specific attribute for a customer +""" type CustomerAttribute { - """The ID of the custom customer attribute""" + """ + The ID of the custom customer attribute + """ entityId: Int! - """The value of the custom customer attribute""" + """ + The value of the custom customer attribute + """ value: String - """The name of the custom customer attribute""" + """ + The name of the custom customer attribute + """ name: String! } -"""Custom, store-specific customer attributes""" +""" +Custom, store-specific customer attributes +""" type CustomerAttributes { attribute( - """The ID of the customer attribute""" + """ + The ID of the customer attribute + """ entityId: Int! ): CustomerAttribute! } -"""A calendar for allowing selection of a date.""" +""" +A calendar for allowing selection of a date. +""" type DateFieldOption implements CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } scalar DateTime -"""Date Time Extended""" +""" +Date Time Extended +""" type DateTimeExtended { - """ISO-8601 formatted date in UTC""" + """ + ISO-8601 formatted date in UTC + """ utc: DateTime! } -"""Display field""" +""" +Display field +""" type DisplayField { - """Short date format.""" + """ + Short date format. + """ shortDateFormat: String! - """Extended date format.""" + """ + Extended date format. + """ extendedDateFormat: String! } @@ -400,19 +642,29 @@ type DisplayField { A form allowing selection and uploading of a file from the user's local computer. """ type FileUploadFieldOption implements CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } -"""Image""" +""" +Image +""" type Image { - """Absolute path to image using store CDN.""" + """ + Absolute path to image using store CDN. + """ url(width: Int!, height: Int): String! """ @@ -420,100 +672,172 @@ type Image { """ altText: String! - """Indicates whether this is the primary image.""" + """ + Indicates whether this is the primary image. + """ isDefault: Boolean! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type ImageConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [ImageEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type ImageEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Image! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""An inventory""" +""" +An inventory +""" type Inventory { - """Locations""" - locations(entityIds: [Int!], codes: [String!], typeIds: [String!], before: String, after: String, first: Int, last: Int): LocationConnection! + """ + Locations + """ + locations( + entityIds: [Int!] + codes: [String!] + typeIds: [String!] + before: String + after: String + first: Int + last: Int + ): LocationConnection! } -"""Inventory By Locations""" +""" +Inventory By Locations +""" type InventoryByLocations { - """Location id.""" + """ + Location id. + """ locationEntityId: Long! - """Number of available products in stock.""" + """ + Number of available products in stock. + """ availableToSell: Long! - """Indicates a threshold low-stock level.""" + """ + Indicates a threshold low-stock level. + """ warningLevel: Int! - """Indicates whether this product is in stock.""" + """ + Indicates whether this product is in stock. + """ isInStock: Boolean! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type LocationConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [LocationEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type LocationEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: InventoryByLocations! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Logo field""" +""" +Logo field +""" type LogoField { - """Logo title.""" + """ + Logo title. + """ title: String! - """Store logo image.""" + """ + Store logo image. + """ image: Image! } -"""Measurement""" +""" +Measurement +""" type Measurement { - """Unformatted weight measurement value.""" + """ + Unformatted weight measurement value. + """ value: Float! - """Unit of measurement.""" + """ + Unit of measurement. + """ unit: String! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type MetafieldConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [MetafieldEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type MetafieldEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Metafields! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } @@ -521,130 +845,219 @@ type MetafieldEdge { Key/Value pairs of data attached tied to a resource entity (product, brand, category, etc.) """ type Metafields { - """The ID of an object""" + """ + The ID of an object + """ id: ID! - """The ID of the metafield when referencing via our backend API.""" + """ + The ID of the metafield when referencing via our backend API. + """ entityId: Int! - """A label for identifying a metafield data value.""" + """ + A label for identifying a metafield data value. + """ key: String! - """A metafield value.""" + """ + A metafield value. + """ value: String! } -"""A money object - includes currency code and a money amount""" +""" +A money object - includes currency code and a money amount +""" type Money { - """Currency code of the current money.""" + """ + Currency code of the current money. + """ currencyCode: String! - """The amount of money.""" + """ + The amount of money. + """ value: BigDecimal! } -"""A min and max pair of money objects""" +""" +A min and max pair of money objects +""" type MoneyRange { - """Minimum money object.""" + """ + Minimum money object. + """ min: Money! - """Maximum money object.""" + """ + Maximum money object. + """ max: Money! } -"""A multi-line text input field, aka a text box.""" +""" +A multi-line text input field, aka a text box. +""" type MultiLineTextFieldOption implements CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + 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.""" +""" +An option type that has a fixed list of values. +""" type MultipleChoiceOption implements CatalogProductOption { - """The chosen display style for this multiple choice option.""" + """ + 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! + """ + List of option values. + """ + values( + before: String + after: String + first: Int + last: Int + ): ProductOptionValueConnection! - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + 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.""" +""" +A simple multiple choice value comprised of an id and a label. +""" type MultipleChoiceOptionValue implements CatalogProductOptionValue { - """Unique ID for the option value.""" + """ + Unique ID for the option value. + """ entityId: Int! - """Label for the option value.""" + """ + Label for the option value. + """ label: String! - """Indicates whether this value is the chosen default selected value.""" + """ + Indicates whether this value is the chosen default selected value. + """ isDefault: Boolean! } -"""An object with an ID""" +""" +An object with an ID +""" interface Node { - """The id of the object.""" + """ + The id of the object. + """ id: ID! } -"""A single line text input field that only accepts numbers.""" +""" +A single line text input field that only accepts numbers. +""" type NumberFieldOption implements CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type OptionConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [OptionEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type OptionEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: ProductOption! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type OptionValueConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [OptionValueEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type OptionValueEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: ProductOptionValue! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } @@ -653,51 +1066,83 @@ input OptionValueId { valueEntityId: Int! } -"""Information about pagination in a connection.""" +""" +Information about pagination in a connection. +""" type PageInfo { - """When paginating forwards, are there more items?""" + """ + When paginating forwards, are there more items? + """ hasNextPage: Boolean! - """When paginating backwards, are there more items?""" + """ + When paginating backwards, are there more items? + """ hasPreviousPage: Boolean! - """When paginating backwards, the cursor to continue.""" + """ + When paginating backwards, the cursor to continue. + """ startCursor: String - """When paginating forwards, the cursor to continue.""" + """ + When paginating forwards, the cursor to continue. + """ endCursor: String } -"""The min and max range of prices that apply to this product.""" +""" +The min and max range of prices that apply to this product. +""" type PriceRanges { - """Product price min/max range.""" + """ + Product price min/max range. + """ priceRange: MoneyRange! - """Product retail price min/max range.""" + """ + Product retail price min/max range. + """ retailPriceRange: MoneyRange } -"""The various prices that can be set on a product.""" +""" +The various prices that can be set on a product. +""" type Prices { - """Calculated price of the product.""" + """ + Calculated price of the product. + """ price: Money! - """Sale price of the product.""" + """ + Sale price of the product. + """ salePrice: Money - """Original price of the product.""" + """ + Original price of the product. + """ basePrice: Money - """Retail price of the product.""" + """ + Retail price of the product. + """ retailPrice: Money - """Minimum advertised price of the product.""" + """ + Minimum advertised price of the product. + """ mapPrice: Money - """Product price min/max range.""" + """ + Product price min/max range. + """ priceRange: MoneyRange! - """Product retail price min/max range.""" + """ + Product retail price min/max range. + """ retailPriceRange: MoneyRange """ @@ -705,46 +1150,74 @@ type Prices { """ saved: Money - """List of bulk pricing tiers applicable to a product or variant.""" + """ + List of bulk pricing tiers applicable to a product or variant. + """ bulkPricing: [BulkPricingTier!]! } -"""Product""" +""" +Product +""" type Product implements Node { - """The ID of an object""" + """ + The ID of an object + """ id: ID! - """Id of the product.""" + """ + Id of the product. + """ entityId: Int! - """Default product variant when no options are selected.""" + """ + Default product variant when no options are selected. + """ sku: String! - """Relative URL path to product page.""" + """ + Relative URL path to product page. + """ path: String! - """Name of the product.""" + """ + Name of the product. + """ name: String! - """Description of the product.""" + """ + Description of the product. + """ description: String! - """Description of the product in plain text.""" + """ + Description of the product in plain text. + """ plainTextDescription(characterLimit: Int = 120): String! - """Warranty information of the product.""" + """ + Warranty information of the product. + """ warranty: String! - """Minimum purchasable quantity for this product in a single order.""" + """ + Minimum purchasable quantity for this product in a single order. + """ minPurchaseQuantity: Int - """Maximum purchasable quantity for this product in a single order.""" + """ + Maximum purchasable quantity for this product in a single order. + """ maxPurchaseQuantity: Int - """Absolute URL path for adding a product to cart.""" + """ + Absolute URL path for adding a product to cart. + """ addToCartUrl: String! - """Absolute URL path for adding a product to customer's wishlist.""" + """ + Absolute URL path for adding a product to customer's wishlist. + """ addToWishlistUrl: String! """ @@ -755,79 +1228,165 @@ type Product implements Node { """ 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.") + priceRanges(includeTax: Boolean = false): PriceRanges + @deprecated(reason: "Use priceRanges inside prices node instead.") - """Weight of the product.""" + """ + Weight of the product. + """ weight: Measurement - """Height of the product.""" + """ + Height of the product. + """ height: Measurement - """Width of the product.""" + """ + Width of the product. + """ width: Measurement - """Depth of the product.""" + """ + Depth of the product. + """ depth: Measurement - """Product options.""" - options(before: String, after: String, first: Int, last: Int): OptionConnection! + """ + Product options. + """ + options( + before: String + after: String + first: Int + last: Int + ): OptionConnection! - """Product options.""" - productOptions(before: String, after: String, first: Int, last: Int): ProductOptionConnection! + """ + 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 of product, ex: physical, digital + """ type: String! - """The availability state of the product.""" - availability: String! @deprecated(reason: "Use status inside availabilityV2 instead.") + """ + 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.") + availabilityDescription: String! + @deprecated(reason: "Use description inside availabilityV2 instead.") - """The availability state of the product.""" + """ + 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! + """ + List of categories associated with the product. + """ + categories( + before: String + after: String + first: Int + last: Int + ): CategoryConnection! - """Brand associated with the product.""" + """ + 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! + """ + 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! + """ + 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.""" + """ + A list of the images for a product. + """ images(before: String, after: String, first: Int, last: Int): ImageConnection! - """Default image for a product.""" + """ + Default image for a product. + """ defaultImage: Image - """Related products for this product.""" - relatedProducts(before: String, after: String, first: Int, last: Int): RelatedProductsConnection! + """ + Related products for this product. + """ + relatedProducts( + before: String + after: String + first: Int + last: Int + ): RelatedProductsConnection! - """Inventory information of the product.""" + """ + 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! + """ + 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 creation date + """ + createdAt: DateTimeExtended! + @deprecated(reason: "Alpha version. Do not use in production.") } -"""Product availability""" +""" +Product availability +""" interface ProductAvailability { - """The availability state of the product.""" + """ + The availability state of the product. + """ status: ProductAvailabilityStatus! """ @@ -836,16 +1395,22 @@ interface ProductAvailability { description: String! } -"""Product availability status""" +""" +Product availability status +""" enum ProductAvailabilityStatus { Available Preorder Unavailable } -"""Available Product""" +""" +Available Product +""" type ProductAvailable implements ProductAvailability { - """The availability state of the product.""" + """ + The availability state of the product. + """ status: ProductAvailabilityStatus! """ @@ -854,27 +1419,43 @@ type ProductAvailable implements ProductAvailability { description: String! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type ProductConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [ProductEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type ProductEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Product! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Product Inventory Information""" +""" +Product Inventory Information +""" type ProductInventory { - """Indicates whether this product is in stock.""" + """ + Indicates whether this product is in stock. + """ isInStock: Boolean! """ @@ -888,63 +1469,108 @@ type ProductInventory { aggregated: AggregatedInventory } -"""Product Option""" +""" +Product Option +""" type ProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + 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! + """ + Option values. + """ + values( + before: String + after: String + first: Int + last: Int + ): OptionValueConnection! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type ProductOptionConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [ProductOptionEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type ProductOptionEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: CatalogProductOption! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Product Option Value""" +""" +Product Option Value +""" type ProductOptionValue { - """Unique ID for the option value.""" + """ + Unique ID for the option value. + """ entityId: Int! - """Label for the option value.""" + """ + Label for the option value. + """ label: String! } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type ProductOptionValueConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [ProductOptionValueEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type ProductOptionValueEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: CatalogProductOptionValue! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } @@ -952,30 +1578,44 @@ type ProductOptionValueEdge { 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.""" + """ + The ID of the product associated with this option value. + """ productId: Int! - """Unique ID for the option value.""" + """ + Unique ID for the option value. + """ entityId: Int! - """Label for the option value.""" + """ + Label for the option value. + """ label: String! - """Indicates whether this value is the chosen default selected value.""" + """ + Indicates whether this value is the chosen default selected value. + """ isDefault: Boolean! } -"""PreOrder Product""" +""" +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""" + """ + Product release date + """ willBeReleasedAt: DateTimeExtended - """The availability state of the product.""" + """ + The availability state of the product. + """ status: ProductAvailabilityStatus! """ @@ -984,14 +1624,18 @@ type ProductPreOrder implements ProductAvailability { description: String! } -"""Unavailable Product""" +""" +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.""" + """ + The availability state of the product. + """ status: ProductAvailabilityStatus! """ @@ -1003,107 +1647,208 @@ type ProductUnavailable implements ProductAvailability { type Query { site: Site! - """The currently logged in customer.""" + """ + The currently logged in customer. + """ customer: Customer - """Fetches an object given its ID""" + """ + Fetches an object given its ID + """ node( - """The ID of an object""" + """ + The ID of an object + """ id: ID! ): Node - inventory: Inventory! @deprecated(reason: "Alpha version. Do not use in production.") + inventory: Inventory! + @deprecated(reason: "Alpha version. Do not use in production.") } -"""A connection to a list of items.""" +""" +A connection to a list of items. +""" type RelatedProductsConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [RelatedProductsEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type RelatedProductsEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Product! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Review Rating Summary""" +""" +Review Rating Summary +""" type Reviews { - """Total number of reviews on product.""" + """ + Total number of reviews on product. + """ numberOfReviews: Int! - """Summation of rating scores from each review.""" + """ + Summation of rating scores from each review. + """ summationOfRatings: Int! } -"""route""" +""" +route +""" type Route { - """node""" + """ + node + """ node: Node } -"""Store settings information from the control panel.""" +""" +Store settings information from the control panel. +""" type Settings { - """The name of the store.""" + """ + The name of the store. + """ storeName: String! - """The hash of the store.""" + """ + The hash of the store. + """ storeHash: String! - """The current store status.""" + """ + The current store status. + """ status: StorefrontStatusType! - """Logo information for the store.""" + """ + Logo information for the store. + """ logo: LogoField! - """Contact information for the store.""" + """ + Contact information for the store. + """ contact: ContactField - """Store urls.""" + """ + Store urls. + """ url: UrlField! - """Store display format information.""" + """ + Store display format information. + """ display: DisplayField! - """Channel ID.""" + """ + Channel ID. + """ channelId: Long! } -"""A site""" +""" +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 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 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 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 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! + """ + 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 + """ + 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 for a node + """ route(path: String!): Route! - """Store settings.""" + """ + Store settings. + """ settings: Settings } -"""Storefront Mode""" +""" +Storefront Mode +""" enum StorefrontStatusType { LAUNCHED MAINTENANCE @@ -1115,52 +1860,84 @@ enum StorefrontStatusType { 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.""" + """ + List of up to 3 hex encoded colors to associate with a swatch value. + """ hexColors: [String!]! - """Absolute path of a swatch texture image.""" + """ + Absolute path of a swatch texture image. + """ imageUrl(width: Int!, height: Int): String - """Unique ID for the option value.""" + """ + Unique ID for the option value. + """ entityId: Int! - """Label for the option value.""" + """ + Label for the option value. + """ label: String! - """Indicates whether this value is the chosen default selected value.""" + """ + Indicates whether this value is the chosen default selected value. + """ isDefault: Boolean! } -"""A single line text input field.""" +""" +A single line text input field. +""" type TextFieldOption implements CatalogProductOption { - """Unique ID for the option.""" + """ + Unique ID for the option. + """ entityId: Int! - """Display name for the option.""" + """ + Display name for the option. + """ displayName: String! - """One of the option values is required to be selected for the checkout.""" + """ + One of the option values is required to be selected for the checkout. + """ isRequired: Boolean! } -"""Url field""" +""" +Url field +""" type UrlField { - """Store url.""" + """ + Store url. + """ vanityUrl: String! - """CDN url to fetch assets.""" + """ + CDN url to fetch assets. + """ cdnUrl: String! } -"""Variant""" +""" +Variant +""" type Variant implements Node { - """The ID of an object""" + """ + The ID of an object + """ id: ID! - """Id of the variant.""" + """ + Id of the variant. + """ entityId: Int! - """Sku of the variant.""" + """ + Sku of the variant. + """ sku: String! """ @@ -1183,58 +1960,113 @@ type Variant implements Node { """ depth: Measurement - """The options which define a variant.""" - options(before: String, after: String, first: Int, last: Int): OptionConnection! + """ + 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! + """ + Product options that compose this variant. + """ + productOptions( + before: String + after: String + first: Int + last: Int + ): ProductOptionConnection! - """Default image for a variant.""" + """ + Default image for a variant. + """ defaultImage: Image - """Variant prices""" + """ + Variant prices + """ prices(includeTax: Boolean = false, currencyCode: currencyCode): Prices - """Variant inventory""" + """ + Variant inventory + """ inventory: VariantInventory - """Metafield data related to a variant.""" - metafields(namespace: String!, keys: [String!] = [], before: String, after: String, first: Int, last: Int): MetafieldConnection! + """ + 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.""" +""" +A connection to a list of items. +""" type VariantConnection { - """Information to aid in pagination.""" + """ + Information to aid in pagination. + """ pageInfo: PageInfo! - """A list of edges.""" + """ + A list of edges. + """ edges: [VariantEdge] } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type VariantEdge { - """The item at the end of the edge.""" + """ + The item at the end of the edge. + """ node: Variant! - """A cursor for use in pagination.""" + """ + A cursor for use in pagination. + """ cursor: String! } -"""Variant Inventory""" +""" +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.""" + """ + Indicates whether this product is in stock. + """ isInStock: Boolean! - """Inventory by locations.""" - byLocation(locationEntityIds: [Int!] = [], before: String, after: String, first: Int, last: Int): LocationConnection + """ + Inventory by locations. + """ + byLocation( + locationEntityIds: [Int!] = [] + before: String + after: String + first: Int + last: Int + ): LocationConnection } -"""Please select a currency""" +""" +Please select a currency +""" enum currencyCode { ADP AED diff --git a/package.json b/package.json index 16b4994d4..952c17653 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,10 @@ "schema": "lib/bigcommerce/schema.graphql", "documents": "lib/bigcommerce/**/*.{graphql,js,ts,jsx,tsx}" }, + "prettier": { + "semi": false, + "singleQuote": true + }, "dependencies": { "@tailwindcss/ui": "^0.6.2", "@types/classnames": "^2.2.10", @@ -33,6 +37,7 @@ "graphql": "^15.3.0", "postcss-flexbugs-fixes": "^4.2.1", "postcss-preset-env": "^6.7.0", + "prettier": "^2.1.2", "tailwindcss": "^1.8.10", "typescript": "^4.0.3" }, diff --git a/yarn.lock b/yarn.lock index 12bafabc7..645b06847 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5919,6 +5919,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" + integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== + pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" From 0ef6449aff38e1c2545ffe497fe9e0a95557d221 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 20:40:40 -0500 Subject: [PATCH 07/12] Apply prettier over all files --- .prettierignore | 3 +- README.md | 2 +- assets/font.css | 252 +++++++++--------- assets/global.css | 8 +- .../cart/CartSidebarView/CartSidebarView.tsx | 18 +- components/cart/CartSidebarView/index.ts | 2 +- components/cart/index.ts | 2 +- components/core/Avatar/Avatar.tsx | 18 +- components/core/Avatar/index.ts | 2 +- .../core/Featurebar/Featurebar.module.css | 2 +- components/core/Featurebar/Featurebar.tsx | 20 +- components/core/Featurebar/index.ts | 2 +- components/core/Footer/Footer.tsx | 20 +- components/core/Footer/index.ts | 2 +- components/core/Layout/Layout.tsx | 28 +- components/core/Layout/index.ts | 2 +- components/core/Navbar/Navbar.tsx | 22 +- components/core/Navbar/index.ts | 2 +- components/core/Searchbar/Searchbar.tsx | 18 +- components/core/Searchbar/index.ts | 2 +- components/core/UserNav/UserNav.tsx | 24 +- components/core/UserNav/index.ts | 2 +- components/core/index.ts | 14 +- components/icon/Bag.tsx | 8 +- components/icon/Cross.tsx | 8 +- components/icon/Heart.tsx | 8 +- components/icon/Trash.tsx | 8 +- components/icon/index.ts | 8 +- .../product/ProductCard/ProductCard.tsx | 20 +- components/product/ProductCard/index.ts | 2 +- .../product/ProductGrid/ProductGrid.tsx | 22 +- components/product/ProductGrid/index.ts | 2 +- .../product/ProductView/ProductView.tsx | 26 +- components/product/ProductView/index.ts | 2 +- components/product/Swatch/Swatch.tsx | 34 +-- components/product/Swatch/index.ts | 2 +- components/product/index.ts | 8 +- components/product/types.ts | 4 +- components/ui/Button/Button.tsx | 28 +- components/ui/Button/index.ts | 2 +- components/ui/ClickOutside/ClickOutside.tsx | 34 +-- components/ui/ClickOutside/index.ts | 2 +- components/ui/Container/Container.tsx | 24 +- components/ui/Container/index.ts | 2 +- components/ui/Logo/Logo.tsx | 4 +- components/ui/Logo/index.ts | 2 +- components/ui/Sidebar/Sidebar.tsx | 18 +- components/ui/Sidebar/index.ts | 2 +- components/ui/_BLANK/Featurebar.tsx | 18 +- components/ui/_BLANK/index.ts | 2 +- components/ui/context.tsx | 42 +-- components/ui/index.ts | 8 +- components/ui/types.ts | 2 +- lib/bigcommerce/api/fragments/product.ts | 4 +- lib/bigcommerce/api/index.ts | 50 ++-- .../api/operations/get-all-product-paths.ts | 34 +-- .../api/operations/get-all-products.ts | 51 ++-- lib/bigcommerce/api/operations/get-product.ts | 48 ++-- lib/bigcommerce/api/utils/fetch-api.ts | 16 +- lib/bigcommerce/api/utils/types.ts | 8 +- lib/bigcommerce/cart.tsx | 8 +- lib/bigcommerce/index.tsx | 24 +- lib/cart.js | 84 +++--- lib/commerce/api/index.ts | 10 +- lib/commerce/cart.tsx | 30 +-- lib/commerce/index.tsx | 24 +- pages/_app.tsx | 8 +- pages/_document.tsx | 4 +- pages/index.tsx | 16 +- pages/product/[slug].tsx | 28 +- postcss.config.js | 12 +- tailwind.config.js | 22 +- 72 files changed, 648 insertions(+), 652 deletions(-) diff --git a/.prettierignore b/.prettierignore index 1380c2e74..105738ca9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ node_modules -.next \ No newline at end of file +.next +public \ No newline at end of file diff --git a/README.md b/README.md index e942c01d6..f6863fdbe 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# e-comm-example \ No newline at end of file +# e-comm-example diff --git a/assets/font.css b/assets/font.css index b9e1847f7..c4b605c34 100644 --- a/assets/font.css +++ b/assets/font.css @@ -1,99 +1,99 @@ /* latin */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587415301/fonts/2/inter-var-latin.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; @@ -104,525 +104,525 @@ in most cases, they are not downloaded at all */ /* latin-ext */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-latin-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* cyrillic */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-cyrillic.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } /* cyrillic-ext */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 100; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 200; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 300; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 400; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 500; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 600; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 700; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 800; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: swap; font-weight: 900; font-display: block; src: url(https://assets.vercel.com/raw/upload/v1587418127/fonts/2/inter-var-cyrillic-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } /* greek */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418276/fonts/2/inter-var-greek.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0370-03FF; } /* greek-ext */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-greek-ext.woff2) - format("woff2"); + format('woff2'); unicode-range: U+1F00-1FFF; } /* vietnamese */ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 100; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 200; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(https://assets.vercel.com/raw/upload/v1587418275/fonts/2/inter-var-vietnamese.woff2) - format("woff2"); + format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; } diff --git a/assets/global.css b/assets/global.css index 9d50fcd5e..f3579ae09 100644 --- a/assets/global.css +++ b/assets/global.css @@ -1,4 +1,4 @@ -@import "./font.css"; +@import './font.css'; @tailwind base; @tailwind components; @@ -61,8 +61,8 @@ --geist-marketing-radius: 8px; /* Fonts */ - --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", - "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', + 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; --font-mono: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; @@ -164,7 +164,7 @@ html { height: 100%; box-sizing: border-box; touch-action: manipulation; - font-feature-settings: "case" 1, "rlig" 1, "calt" 0; + font-feature-settings: 'case' 1, 'rlig' 1, 'calt' 0; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index 6de81cf61..53969dfc6 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -1,11 +1,11 @@ -import React, { FunctionComponent } from "react"; -import { UserNav } from "@components/core"; -import { Button } from "@components/ui"; -import { Trash, Cross } from "@components/icon"; -import { useUI } from "@components/ui/context"; +import React, { FunctionComponent } from 'react' +import { UserNav } from '@components/core' +import { Button } from '@components/ui' +import { Trash, Cross } from '@components/icon' +import { useUI } from '@components/ui/context' const CartSidebarView: FunctionComponent = () => { - const { closeSidebar } = useUI(); + const { closeSidebar } = useUI() return ( <>
@@ -57,7 +57,7 @@ const CartSidebarView: FunctionComponent = () => { - ); -}; + ) +} -export default CartSidebarView; +export default CartSidebarView diff --git a/components/cart/CartSidebarView/index.ts b/components/cart/CartSidebarView/index.ts index 5978c0194..0262e448e 100644 --- a/components/cart/CartSidebarView/index.ts +++ b/components/cart/CartSidebarView/index.ts @@ -1 +1 @@ -export { default } from "./CartSidebarView"; +export { default } from './CartSidebarView' diff --git a/components/cart/index.ts b/components/cart/index.ts index bc42bb259..0aff7cdfb 100644 --- a/components/cart/index.ts +++ b/components/cart/index.ts @@ -1 +1 @@ -export { default as CartSidebarView } from "./CartSidebarView"; +export { default as CartSidebarView } from './CartSidebarView' diff --git a/components/core/Avatar/Avatar.tsx b/components/core/Avatar/Avatar.tsx index 8e7e57c5d..c9cd9a029 100644 --- a/components/core/Avatar/Avatar.tsx +++ b/components/core/Avatar/Avatar.tsx @@ -1,14 +1,14 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Avatar.module.css"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Avatar.module.css' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Avatar: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
= ({ className }) => { alt="" >
- ); -}; + ) +} -export default Avatar; +export default Avatar diff --git a/components/core/Avatar/index.ts b/components/core/Avatar/index.ts index 279f4682f..a4600ec77 100644 --- a/components/core/Avatar/index.ts +++ b/components/core/Avatar/index.ts @@ -1 +1 @@ -export { default } from "./Avatar"; +export { default } from './Avatar' diff --git a/components/core/Featurebar/Featurebar.module.css b/components/core/Featurebar/Featurebar.module.css index 806d4a40c..54d8108bf 100644 --- a/components/core/Featurebar/Featurebar.module.css +++ b/components/core/Featurebar/Featurebar.module.css @@ -13,7 +13,7 @@ } .separator:before { - content: ""; + content: ''; } .description { diff --git a/components/core/Featurebar/Featurebar.tsx b/components/core/Featurebar/Featurebar.tsx index 56e3d9e22..714a9fceb 100644 --- a/components/core/Featurebar/Featurebar.tsx +++ b/components/core/Featurebar/Featurebar.tsx @@ -1,11 +1,11 @@ -import cn from "classnames"; -import { FunctionComponent } from "react"; -import s from "./Featurebar.module.css"; +import cn from 'classnames' +import { FunctionComponent } from 'react' +import s from './Featurebar.module.css' interface Props { - className?: string; - title: string; - description: string; + className?: string + title: string + description: string } const Featurebar: FunctionComponent = ({ @@ -13,14 +13,14 @@ const Featurebar: FunctionComponent = ({ description, className, }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
{title} {description}
- ); -}; + ) +} -export default Featurebar; +export default Featurebar diff --git a/components/core/Featurebar/index.ts b/components/core/Featurebar/index.ts index 158415285..44f51698d 100644 --- a/components/core/Featurebar/index.ts +++ b/components/core/Featurebar/index.ts @@ -1 +1 @@ -export { default } from "./Featurebar"; +export { default } from './Featurebar' diff --git a/components/core/Footer/Footer.tsx b/components/core/Footer/Footer.tsx index ef662e61b..977cbd787 100644 --- a/components/core/Footer/Footer.tsx +++ b/components/core/Footer/Footer.tsx @@ -1,20 +1,20 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Footer.module.css"; -import { Container } from "@components/ui"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Footer.module.css' +import { Container } from '@components/ui' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Footer: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
- ); -}; + ) +} -export default Footer; +export default Footer diff --git a/components/core/Footer/index.ts b/components/core/Footer/index.ts index 3738288b0..5d06e9b71 100644 --- a/components/core/Footer/index.ts +++ b/components/core/Footer/index.ts @@ -1 +1 @@ -export { default } from "./Footer"; +export { default } from './Footer' diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index fafc3b39a..f25244ec7 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -1,19 +1,19 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Layout.module.css"; -import { Navbar, Featurebar } from "@components/core"; -import { Container, Sidebar } from "@components/ui"; -import { CartSidebarView } from "@components/cart"; -import { useUI } from "@components/ui/context"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Layout.module.css' +import { Navbar, Featurebar } from '@components/core' +import { Container, Sidebar } from '@components/ui' +import { CartSidebarView } from '@components/cart' +import { useUI } from '@components/ui/context' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Layout: FunctionComponent = ({ className, children }) => { - const rootClassName = cn(s.root, className); - const { displaySidebar } = useUI(); + const rootClassName = cn(s.root, className) + const { displaySidebar } = useUI() return (
= ({ className, children }) => { )}
- ); -}; + ) +} -export default Layout; +export default Layout diff --git a/components/core/Layout/index.ts b/components/core/Layout/index.ts index d4dca0dc6..0e2737eee 100644 --- a/components/core/Layout/index.ts +++ b/components/core/Layout/index.ts @@ -1 +1 @@ -export { default } from "./Layout"; +export { default } from './Layout' diff --git a/components/core/Navbar/Navbar.tsx b/components/core/Navbar/Navbar.tsx index 4a8c2dd7b..4ef0f700b 100644 --- a/components/core/Navbar/Navbar.tsx +++ b/components/core/Navbar/Navbar.tsx @@ -1,15 +1,15 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Navbar.module.css"; -import { Logo, Container } from "@components/ui"; -import { Searchbar } from "@components/core"; -import { UserNav } from "@components/core"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Navbar.module.css' +import { Logo, Container } from '@components/ui' +import { Searchbar } from '@components/core' +import { UserNav } from '@components/core' interface Props { - className?: string; + className?: string } const Navbar: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return ( @@ -23,7 +23,7 @@ const Navbar: FunctionComponent = ({ className }) => { - ); -}; + ) +} -export default Navbar; +export default Navbar diff --git a/components/core/Navbar/index.ts b/components/core/Navbar/index.ts index 8d95d6656..e6400ae40 100644 --- a/components/core/Navbar/index.ts +++ b/components/core/Navbar/index.ts @@ -1 +1 @@ -export { default } from "./Navbar"; +export { default } from './Navbar' diff --git a/components/core/Searchbar/Searchbar.tsx b/components/core/Searchbar/Searchbar.tsx index 5b43ef09a..06068c905 100644 --- a/components/core/Searchbar/Searchbar.tsx +++ b/components/core/Searchbar/Searchbar.tsx @@ -1,14 +1,14 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Searchbar.module.css"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Searchbar.module.css' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Searchbar: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
@@ -26,7 +26,7 @@ const Searchbar: FunctionComponent = ({ className }) => {
- ); -}; + ) +} -export default Searchbar; +export default Searchbar diff --git a/components/core/Searchbar/index.ts b/components/core/Searchbar/index.ts index 94891f2fa..e6c0e36c8 100644 --- a/components/core/Searchbar/index.ts +++ b/components/core/Searchbar/index.ts @@ -1 +1 @@ -export { default } from "./Searchbar"; +export { default } from './Searchbar' diff --git a/components/core/UserNav/UserNav.tsx b/components/core/UserNav/UserNav.tsx index 71ba1cc9e..60ce8544a 100644 --- a/components/core/UserNav/UserNav.tsx +++ b/components/core/UserNav/UserNav.tsx @@ -1,17 +1,17 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./UserNav.module.css"; -import { Avatar } from "@components/core"; -import { Heart, Bag } from "@components/icon"; -import { useUI } from "@components/ui/context"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './UserNav.module.css' +import { Avatar } from '@components/core' +import { Heart, Bag } from '@components/icon' +import { useUI } from '@components/ui/context' interface Props { - className?: string; + className?: string } const UserNav: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); - const { openSidebar } = useUI(); + const rootClassName = cn(s.root, className) + const { openSidebar } = useUI() return ( - ); -}; + ) +} -export default UserNav; +export default UserNav diff --git a/components/core/UserNav/index.ts b/components/core/UserNav/index.ts index 68149bc0c..9e35ac018 100644 --- a/components/core/UserNav/index.ts +++ b/components/core/UserNav/index.ts @@ -1 +1 @@ -export { default } from "./UserNav"; +export { default } from './UserNav' diff --git a/components/core/index.ts b/components/core/index.ts index 57d076f79..e6672f4e5 100644 --- a/components/core/index.ts +++ b/components/core/index.ts @@ -1,7 +1,7 @@ -export { default as Avatar } from "./Avatar"; -export { default as Featurebar } from "./Featurebar"; -export { default as Footer } from "./Footer"; -export { default as Layout } from "./Layout"; -export { default as Navbar } from "./Navbar"; -export { default as Searchbar } from "./Searchbar"; -export { default as UserNav } from "./UserNav"; +export { default as Avatar } from './Avatar' +export { default as Featurebar } from './Featurebar' +export { default as Footer } from './Footer' +export { default as Layout } from './Layout' +export { default as Navbar } from './Navbar' +export { default as Searchbar } from './Searchbar' +export { default as UserNav } from './UserNav' diff --git a/components/icon/Bag.tsx b/components/icon/Bag.tsx index 6893fbac8..da8a9fe0e 100644 --- a/components/icon/Bag.tsx +++ b/components/icon/Bag.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react' const Bag = ({ ...props }) => { return ( @@ -32,7 +32,7 @@ const Bag = ({ ...props }) => { strokeLinejoin="round" /> - ); -}; + ) +} -export default Bag; +export default Bag diff --git a/components/icon/Cross.tsx b/components/icon/Cross.tsx index f47f3db16..4536dc2a1 100644 --- a/components/icon/Cross.tsx +++ b/components/icon/Cross.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react' const Cross = ({ ...props }) => { return ( @@ -10,7 +10,7 @@ const Cross = ({ ...props }) => { d="M6 18L18 6M6 6l12 12" /> - ); -}; + ) +} -export default Cross; +export default Cross diff --git a/components/icon/Heart.tsx b/components/icon/Heart.tsx index 051f57b01..3f2ff1302 100644 --- a/components/icon/Heart.tsx +++ b/components/icon/Heart.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react' const Heart = ({ ...props }) => { return ( @@ -18,7 +18,7 @@ const Heart = ({ ...props }) => { strokeLinejoin="round" /> - ); -}; + ) +} -export default Heart; +export default Heart diff --git a/components/icon/Trash.tsx b/components/icon/Trash.tsx index e1b6c8ce7..d843749ae 100644 --- a/components/icon/Trash.tsx +++ b/components/icon/Trash.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react' const Trash = ({ ...props }) => { return ( @@ -39,7 +39,7 @@ const Trash = ({ ...props }) => { strokeLinejoin="round" /> - ); -}; + ) +} -export default Trash; +export default Trash diff --git a/components/icon/index.ts b/components/icon/index.ts index 2dc7ced7c..2afd43898 100644 --- a/components/icon/index.ts +++ b/components/icon/index.ts @@ -1,4 +1,4 @@ -export { default as Bag } from "./Bag"; -export { default as Heart } from "./Heart"; -export { default as Trash } from "./Trash"; -export { default as Cross } from "./Cross"; +export { default as Bag } from './Bag' +export { default as Heart } from './Heart' +export { default as Trash } from './Trash' +export { default as Cross } from './Cross' diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index ae31d90cc..0bc361ed2 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -1,14 +1,14 @@ -import cn from "classnames"; -import s from "./ProductCard.module.css"; -import React, { FunctionComponent } from "react"; -import { Heart } from "@components/icon"; +import cn from 'classnames' +import s from './ProductCard.module.css' +import React, { FunctionComponent } from 'react' +import { Heart } from '@components/icon' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const ProductCard: FunctionComponent = ({ className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
@@ -26,7 +26,7 @@ const ProductCard: FunctionComponent = ({ className }) => {
- ); -}; + ) +} -export default ProductCard; +export default ProductCard diff --git a/components/product/ProductCard/index.ts b/components/product/ProductCard/index.ts index a8adb3f08..4559faa14 100644 --- a/components/product/ProductCard/index.ts +++ b/components/product/ProductCard/index.ts @@ -1 +1 @@ -export { default } from "./ProductCard"; +export { default } from './ProductCard' diff --git a/components/product/ProductGrid/ProductGrid.tsx b/components/product/ProductGrid/ProductGrid.tsx index f185022e8..af3d6748c 100644 --- a/components/product/ProductGrid/ProductGrid.tsx +++ b/components/product/ProductGrid/ProductGrid.tsx @@ -1,15 +1,15 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./ProductGrid.module.css"; -import ProductCard from "@components/ProductCard"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './ProductGrid.module.css' +import ProductCard from '@components/ProductCard' interface Props { - className?: string; - children?: any; - products: [any]; + className?: string + children?: any + products: [any] } const ProductView: FunctionComponent = ({ products, className }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
@@ -19,7 +19,7 @@ const ProductView: FunctionComponent = ({ products, className }) => {
- ); -}; + ) +} -export default ProductView; +export default ProductView diff --git a/components/product/ProductGrid/index.ts b/components/product/ProductGrid/index.ts index aa0f8fa43..eab5466a8 100644 --- a/components/product/ProductGrid/index.ts +++ b/components/product/ProductGrid/index.ts @@ -1 +1 @@ -export { default } from "./ProductGrid"; +export { default } from './ProductGrid' diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 64db792ca..f012b705b 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -1,18 +1,18 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./ProductView.module.css"; -import { Button } from "@components/ui"; -import { Swatch } from "@components/product"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './ProductView.module.css' +import { Button } from '@components/ui' +import { Swatch } from '@components/product' interface Props { - className?: string; - children?: any; - productData: ProductData; + className?: string + children?: any + productData: ProductData } const ProductView: FunctionComponent = ({ productData, className }) => { - const rootClassName = cn(s.root, className); - console.log(productData); + const rootClassName = cn(s.root, className) + console.log(productData) return (
@@ -53,7 +53,7 @@ const ProductView: FunctionComponent = ({ productData, className }) => {
- ); -}; + ) +} -export default ProductView; +export default ProductView diff --git a/components/product/ProductView/index.ts b/components/product/ProductView/index.ts index 0885bc92e..9ac144801 100644 --- a/components/product/ProductView/index.ts +++ b/components/product/ProductView/index.ts @@ -1 +1 @@ -export { default } from "./ProductView"; +export { default } from './ProductView' diff --git a/components/product/Swatch/Swatch.tsx b/components/product/Swatch/Swatch.tsx index 654c68dd4..02f9a2ef2 100644 --- a/components/product/Swatch/Swatch.tsx +++ b/components/product/Swatch/Swatch.tsx @@ -1,14 +1,14 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Swatch.module.css"; -import { Colors } from "@components/ui/types"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Swatch.module.css' +import { Colors } from '@components/ui/types' interface Props { - className?: string; - children?: any; - active?: boolean; - color?: Colors; - size?: string; + className?: string + children?: any + active?: boolean + color?: Colors + size?: string } const Swatch: FunctionComponent = ({ @@ -22,14 +22,14 @@ const Swatch: FunctionComponent = ({ { [s.active]: active, [s.size]: size, - [s.colorPink]: color === "pink", - [s.colorWhite]: color === "white", - [s.colorBlack]: color === "black", - [s.colorViolet]: color === "violet", + [s.colorPink]: color === 'pink', + [s.colorWhite]: color === 'white', + [s.colorBlack]: color === 'black', + [s.colorViolet]: color === 'violet', }, className - ); - return {size ? size : null}; -}; + ) + return {size ? size : null} +} -export default Swatch; +export default Swatch diff --git a/components/product/Swatch/index.ts b/components/product/Swatch/index.ts index b79dc0ff5..c8a795498 100644 --- a/components/product/Swatch/index.ts +++ b/components/product/Swatch/index.ts @@ -1 +1 @@ -export { default } from "./Swatch"; +export { default } from './Swatch' diff --git a/components/product/index.ts b/components/product/index.ts index ce920ba5d..1cef2a360 100644 --- a/components/product/index.ts +++ b/components/product/index.ts @@ -1,4 +1,4 @@ -export { default as Swatch } from "./Swatch"; -export { default as ProductView } from "./ProductView"; -export { default as ProductCard } from "./ProductCard"; -export { default as ProductGrid } from "./ProductGrid"; +export { default as Swatch } from './Swatch' +export { default as ProductView } from './ProductView' +export { default as ProductCard } from './ProductCard' +export { default as ProductGrid } from './ProductGrid' diff --git a/components/product/types.ts b/components/product/types.ts index 3a1477069..8ef292685 100644 --- a/components/product/types.ts +++ b/components/product/types.ts @@ -1,5 +1,5 @@ -import { Colors } from "@components/ui/types"; -export { Product } from "@lib/bigcommerce"; +import { Colors } from '@components/ui/types' +export { Product } from '@lib/bigcommerce' // export type ProductData = { // title: string; diff --git a/components/ui/Button/Button.tsx b/components/ui/Button/Button.tsx index 20103eae7..362ade2ae 100644 --- a/components/ui/Button/Button.tsx +++ b/components/ui/Button/Button.tsx @@ -1,43 +1,43 @@ -import cn from "classnames"; -import React, { ButtonHTMLAttributes } from "react"; -import s from "./Button.module.css"; +import cn from 'classnames' +import React, { ButtonHTMLAttributes } from 'react' +import s from './Button.module.css' interface Props extends ButtonHTMLAttributes { - href?: string; - className?: string; - variant?: "filled" | "outlined" | "flat" | "none"; - active?: boolean; - type?: "submit" | "reset" | "button"; + href?: string + className?: string + variant?: 'filled' | 'outlined' | 'flat' | 'none' + active?: boolean + type?: 'submit' | 'reset' | 'button' } export default class Button extends React.Component { public render() { const { className, - variant = "filled", + variant = 'filled', children, disabled = false, href, active, ...rest - } = this.props; + } = this.props let Component: React.ComponentType< React.AnchorHTMLAttributes< HTMLAnchorElement | HTMLButtonElement | HTMLDivElement > & React.ClassAttributes - > = "a" as any; + > = 'a' as any // Catch for buttons / span / stc. const rootClassName = cn( s.root, { - [s.filled]: variant === "filled", + [s.filled]: variant === 'filled', }, className - ); + ) return ( { > {children} - ); + ) } } diff --git a/components/ui/Button/index.ts b/components/ui/Button/index.ts index c4719be7c..3389ecb83 100644 --- a/components/ui/Button/index.ts +++ b/components/ui/Button/index.ts @@ -1 +1 @@ -export { default } from "./Button"; +export { default } from './Button' diff --git a/components/ui/ClickOutside/ClickOutside.tsx b/components/ui/ClickOutside/ClickOutside.tsx index 632718831..6986150a6 100644 --- a/components/ui/ClickOutside/ClickOutside.tsx +++ b/components/ui/ClickOutside/ClickOutside.tsx @@ -3,47 +3,47 @@ import React, { MutableRefObject, useEffect, useRef, -} from "react"; +} from 'react' -import { Component } from "react"; -import PropTypes from "prop-types"; +import { Component } from 'react' +import PropTypes from 'prop-types' export interface ClickOutsideProps { - onClickOutside: (e?: MouseEvent) => void; - children: React.ReactNode | any; - render: () => void; + onClickOutside: (e?: MouseEvent) => void + children: React.ReactNode | any + render: () => void } export default class ClickOutside extends Component { - public domNode: Element | null = null; + public domNode: Element | null = null handleRef = (element) => { - this.domNode = element; - }; + this.domNode = element + } public componentDidMount() { - document.addEventListener("click", this.handleClick, true); + document.addEventListener('click', this.handleClick, true) } public componentWillUnmount() { - document.removeEventListener("mousedown", this.handleClick, true); - document.removeEventListener("touchstart", this.handleClick, true); + document.removeEventListener('mousedown', this.handleClick, true) + document.removeEventListener('touchstart', this.handleClick, true) } public handleClick = (event) => { function hasParent(element, root) { - return root && root.contains(element); + return root && root.contains(element) } if (!hasParent(event.target, this.domNode)) { - if (typeof this.props.onClickOutside === "function") { - this.props.onClickOutside(event); + if (typeof this.props.onClickOutside === 'function') { + this.props.onClickOutside(event) } } - }; + } render() { - return null; + return null // return this.props.render({ // innerRef: this.handleRef, // }); diff --git a/components/ui/ClickOutside/index.ts b/components/ui/ClickOutside/index.ts index c0ce145a8..cfdac4296 100644 --- a/components/ui/ClickOutside/index.ts +++ b/components/ui/ClickOutside/index.ts @@ -1 +1 @@ -export { default } from "./ClickOutside"; +export { default } from './ClickOutside' diff --git a/components/ui/Container/Container.tsx b/components/ui/Container/Container.tsx index 9a8a05dd5..f1789ef20 100644 --- a/components/ui/Container/Container.tsx +++ b/components/ui/Container/Container.tsx @@ -1,25 +1,25 @@ -import cn from "classnames"; -import { FunctionComponent } from "react"; -import s from "./Container.module.css"; +import cn from 'classnames' +import { FunctionComponent } from 'react' +import s from './Container.module.css' interface Props { - className?: string; - children?: any; - el?: HTMLElement; + className?: string + children?: any + el?: HTMLElement } const Container: FunctionComponent = ({ children, className, - el = "div", + el = 'div', }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) let Component: React.ComponentType> = el as any; + >> = el as any - return {children}; -}; + return {children} +} -export default Container; +export default Container diff --git a/components/ui/Container/index.ts b/components/ui/Container/index.ts index c81c92aeb..9dbd596a8 100644 --- a/components/ui/Container/index.ts +++ b/components/ui/Container/index.ts @@ -1 +1 @@ -export { default } from "./Container"; +export { default } from './Container' diff --git a/components/ui/Logo/Logo.tsx b/components/ui/Logo/Logo.tsx index 96880c05b..16c819a3d 100644 --- a/components/ui/Logo/Logo.tsx +++ b/components/ui/Logo/Logo.tsx @@ -35,6 +35,6 @@ const Logo = () => ( strokeWidth="0.30634" /> -); +) -export default Logo; +export default Logo diff --git a/components/ui/Logo/index.ts b/components/ui/Logo/index.ts index f252704a4..93dce23b4 100644 --- a/components/ui/Logo/index.ts +++ b/components/ui/Logo/index.ts @@ -1 +1 @@ -export { default } from "./Logo"; +export { default } from './Logo' diff --git a/components/ui/Sidebar/Sidebar.tsx b/components/ui/Sidebar/Sidebar.tsx index 081198e3f..bf70e7fa5 100644 --- a/components/ui/Sidebar/Sidebar.tsx +++ b/components/ui/Sidebar/Sidebar.tsx @@ -1,14 +1,14 @@ -import cn from "classnames"; -import React, { FunctionComponent } from "react"; -import s from "./Sidebar.module.css"; +import cn from 'classnames' +import React, { FunctionComponent } from 'react' +import s from './Sidebar.module.css' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Sidebar: FunctionComponent = ({ className, children }) => { - const rootClassName = cn(s.root, className); + const rootClassName = cn(s.root, className) return (
@@ -23,7 +23,7 @@ const Sidebar: FunctionComponent = ({ className, children }) => {
- ); -}; + ) +} -export default Sidebar; +export default Sidebar diff --git a/components/ui/Sidebar/index.ts b/components/ui/Sidebar/index.ts index 123c2e4a1..877187ca3 100644 --- a/components/ui/Sidebar/index.ts +++ b/components/ui/Sidebar/index.ts @@ -1 +1 @@ -export { default } from "./Sidebar"; +export { default } from './Sidebar' diff --git a/components/ui/_BLANK/Featurebar.tsx b/components/ui/_BLANK/Featurebar.tsx index 3f1f9cd27..0195dd8f4 100644 --- a/components/ui/_BLANK/Featurebar.tsx +++ b/components/ui/_BLANK/Featurebar.tsx @@ -1,15 +1,15 @@ -import cn from "classnames"; -import { FunctionComponent } from "react"; -import s from "./Featurebar.module.css"; +import cn from 'classnames' +import { FunctionComponent } from 'react' +import s from './Featurebar.module.css' interface Props { - className?: string; - children?: any; + className?: string + children?: any } const Featurebar: FunctionComponent = ({ children, className }) => { - const rootClassName = cn(s.root, className); - return
{children}
; -}; + const rootClassName = cn(s.root, className) + return
{children}
+} -export default Featurebar; +export default Featurebar diff --git a/components/ui/_BLANK/index.ts b/components/ui/_BLANK/index.ts index 158415285..44f51698d 100644 --- a/components/ui/_BLANK/index.ts +++ b/components/ui/_BLANK/index.ts @@ -1 +1 @@ -export { default } from "./Featurebar"; +export { default } from './Featurebar' diff --git a/components/ui/context.tsx b/components/ui/context.tsx index 44dc1b587..0acf64ad7 100644 --- a/components/ui/context.tsx +++ b/components/ui/context.tsx @@ -1,56 +1,56 @@ -import React, { FunctionComponent } from "react"; +import React, { FunctionComponent } from 'react' export interface UIState { - displaySidebar: boolean; - openSidebar: () => {}; - closeSidebar: () => {}; + displaySidebar: boolean + openSidebar: () => {} + closeSidebar: () => {} } const initialState = { displaySidebar: false, openSidebar: null, closeSidebar: null, -}; +} -export const UIContext = React.createContext(initialState); -UIContext.displayName = "UIContext"; +export const UIContext = React.createContext(initialState) +UIContext.displayName = 'UIContext' export const UIProvider: FunctionComponent = (props) => { - const [state, dispatch] = React.useReducer(uiReducer, initialState); + const [state, dispatch] = React.useReducer(uiReducer, initialState) - const openSidebar = () => dispatch("OPEN_SIDEBAR"); - const closeSidebar = () => dispatch("CLOSE_SIDEBAR"); + const openSidebar = () => dispatch('OPEN_SIDEBAR') + const closeSidebar = () => dispatch('CLOSE_SIDEBAR') const value = { ...state, openSidebar, closeSidebar, - }; + } - return ; -}; + return +} export const useUI = () => { - const context = React.useContext(UIContext); + const context = React.useContext(UIContext) if (context === undefined) { - throw new Error(`useUI must be used within a UIProvider`); + throw new Error(`useUI must be used within a UIProvider`) } - return context; -}; + return context +} function uiReducer(state, action) { switch (action) { - case "OPEN_SIDEBAR": { + case 'OPEN_SIDEBAR': { return { ...state, displaySidebar: true, - }; + } } - case "CLOSE_SIDEBAR": { + case 'CLOSE_SIDEBAR': { return { ...state, displaySidebar: false, - }; + } } } } diff --git a/components/ui/index.ts b/components/ui/index.ts index 531a3bd28..6367c84a8 100644 --- a/components/ui/index.ts +++ b/components/ui/index.ts @@ -1,4 +1,4 @@ -export { default as Button } from "./Button"; -export { default as Container } from "./Container"; -export { default as Sidebar } from "./Sidebar"; -export { default as Logo } from "./Logo"; +export { default as Button } from './Button' +export { default as Container } from './Container' +export { default as Sidebar } from './Sidebar' +export { default as Logo } from './Logo' diff --git a/components/ui/types.ts b/components/ui/types.ts index 0ed566938..8b2c535b2 100644 --- a/components/ui/types.ts +++ b/components/ui/types.ts @@ -1 +1 @@ -export type Colors = "violet" | "black" | "pink" | "white"; +export type Colors = 'violet' | 'black' | 'pink' | 'white' diff --git a/lib/bigcommerce/api/fragments/product.ts b/lib/bigcommerce/api/fragments/product.ts index 48c0df36d..94753c948 100644 --- a/lib/bigcommerce/api/fragments/product.ts +++ b/lib/bigcommerce/api/fragments/product.ts @@ -5,7 +5,7 @@ export const responsiveImageFragment = /* GraphQL */ ` urlLarge: url(width: $imgLargeWidth, height: $imgLargeHeight) urlXL: url(width: $imgXLWidth, height: $imgXLHeight) } -`; +` export const productInfoFragment = /* GraphQL */ ` fragment productInfo on Product { @@ -63,4 +63,4 @@ export const productInfoFragment = /* GraphQL */ ` } ${responsiveImageFragment} -`; +` diff --git a/lib/bigcommerce/api/index.ts b/lib/bigcommerce/api/index.ts index 0cf0568c7..44d09d9a9 100644 --- a/lib/bigcommerce/api/index.ts +++ b/lib/bigcommerce/api/index.ts @@ -1,17 +1,17 @@ -import { CommerceAPIConfig } from 'lib/commerce/api'; -import { GetAllProductsQueryVariables } from '../schema'; -import fetchAPI from './utils/fetch-api'; +import { CommerceAPIConfig } from 'lib/commerce/api' +import { GetAllProductsQueryVariables } from '../schema' +import fetchAPI from './utils/fetch-api' export interface Images { - small?: ImageOptions; - medium?: ImageOptions; - large?: ImageOptions; - xl?: ImageOptions; + small?: ImageOptions + medium?: ImageOptions + large?: ImageOptions + xl?: ImageOptions } export interface ImageOptions { - width: number; - height?: number; + width: number + height?: number } export type ProductImageVariables = Pick< @@ -24,39 +24,39 @@ export type ProductImageVariables = Pick< | 'imgLargeHeight' | 'imgXLWidth' | 'imgXLHeight' ->; +> export interface BigcommerceConfigOptions extends CommerceAPIConfig { - images?: Images; + images?: Images } export interface BigcommerceConfig extends BigcommerceConfigOptions { - readonly imageVariables?: ProductImageVariables; + readonly imageVariables?: ProductImageVariables } -const API_URL = process.env.BIGCOMMERCE_STOREFRONT_API_URL; -const API_TOKEN = process.env.BIGCOMMERCE_STOREFRONT_API_TOKEN; +const API_URL = process.env.BIGCOMMERCE_STOREFRONT_API_URL +const API_TOKEN = process.env.BIGCOMMERCE_STOREFRONT_API_TOKEN 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` - ); + ) } export class Config { - private config: BigcommerceConfig; + private config: BigcommerceConfig constructor(config: BigcommerceConfigOptions) { this.config = { ...config, get imageVariables() { - const { images } = this; + const { images } = this return images ? { imgSmallWidth: images.small?.width, @@ -68,17 +68,17 @@ export class Config { imgXLWidth: images.xl?.height, imgXLHeight: images.xl?.height, } - : undefined; + : undefined }, - }; + } } getConfig() { - return this.config; + return this.config } setConfig(newConfig: Partial) { - Object.assign(this.config, newConfig); + Object.assign(this.config, newConfig) } } @@ -86,12 +86,12 @@ const config = new Config({ commerceUrl: API_URL, apiToken: API_TOKEN, fetch: fetchAPI, -}); +}) export function getConfig() { - return config.getConfig(); + return config.getConfig() } export function setConfig(newConfig: Partial) { - return config.setConfig(newConfig); + return config.setConfig(newConfig) } diff --git a/lib/bigcommerce/api/operations/get-all-product-paths.ts b/lib/bigcommerce/api/operations/get-all-product-paths.ts index 6fea2401b..ebb196eb2 100644 --- a/lib/bigcommerce/api/operations/get-all-product-paths.ts +++ b/lib/bigcommerce/api/operations/get-all-product-paths.ts @@ -1,6 +1,6 @@ -import type { GetAllProductPathsQuery } from 'lib/bigcommerce/schema'; -import type { RecursivePartial, RecursiveRequired } from '../utils/types'; -import { BigcommerceConfig, getConfig } from '..'; +import type { GetAllProductPathsQuery } from 'lib/bigcommerce/schema' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { BigcommerceConfig, getConfig } from '..' export const getAllProductPathsQuery = /* GraphQL */ ` query getAllProductPaths { @@ -14,41 +14,41 @@ export const getAllProductPathsQuery = /* GraphQL */ ` } } } -`; +` export interface GetAllProductPathsResult { products: T extends GetAllProductPathsQuery ? NonNullable - : unknown; + : unknown } async function getAllProductPaths(opts?: { - query?: string; - config?: BigcommerceConfig; -}): Promise>; + query?: string + config?: BigcommerceConfig +}): Promise> async function getAllProductPaths(opts: { - query: string; - config?: BigcommerceConfig; -}): Promise>; + query: string + config?: BigcommerceConfig +}): Promise> async function getAllProductPaths({ query = getAllProductPathsQuery, config = getConfig(), }: { - query?: string; - config?: BigcommerceConfig; + query?: string + config?: BigcommerceConfig } = {}): Promise> { // 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 - ); - const products = data.site?.products?.edges; + ) + const products = data.site?.products?.edges return { products: (products as RecursiveRequired) ?? [], - }; + } } -export default getAllProductPaths; +export default getAllProductPaths diff --git a/lib/bigcommerce/api/operations/get-all-products.ts b/lib/bigcommerce/api/operations/get-all-products.ts index cf761db87..a43a92747 100644 --- a/lib/bigcommerce/api/operations/get-all-products.ts +++ b/lib/bigcommerce/api/operations/get-all-products.ts @@ -1,15 +1,10 @@ import type { GetAllProductsQuery, GetAllProductsQueryVariables, -} from 'lib/bigcommerce/schema'; -import type { RecursivePartial, RecursiveRequired } from '../utils/types'; -import { productInfoFragment } from '../fragments/product'; -import { - BigcommerceConfig, - getConfig, - Images, - ProductImageVariables, -} from '..'; +} from 'lib/bigcommerce/schema' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { productInfoFragment } from '../fragments/product' +import { BigcommerceConfig, getConfig, Images, ProductImageVariables } from '..' export const getAllProductsQuery = /* GraphQL */ ` query getAllProducts( @@ -40,53 +35,53 @@ export const getAllProductsQuery = /* GraphQL */ ` } ${productInfoFragment} -`; +` export interface GetAllProductsResult { products: T extends GetAllProductsQuery ? NonNullable - : unknown; + : unknown } export type ProductVariables = Images & - Omit; + Omit async function getAllProducts(opts?: { - query?: string; - variables?: ProductVariables; - config?: BigcommerceConfig; -}): Promise>; + query?: string + variables?: ProductVariables + config?: BigcommerceConfig +}): Promise> async function getAllProducts(opts: { - query: string; - variables?: V; - config?: BigcommerceConfig; -}): Promise>; + query: string + variables?: V + config?: BigcommerceConfig +}): Promise> async function getAllProducts({ query = getAllProductsQuery, variables: vars, config = getConfig(), }: { - query?: string; - variables?: ProductVariables; - config?: BigcommerceConfig; + query?: string + variables?: ProductVariables + config?: BigcommerceConfig } = {}): Promise> { const variables: GetAllProductsQueryVariables = { ...config.imageVariables, ...vars, - }; + } // 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.site?.products?.edges; + ) + const products = data.site?.products?.edges return { products: (products as RecursiveRequired) ?? [], - }; + } } -export default getAllProducts; +export default getAllProducts diff --git a/lib/bigcommerce/api/operations/get-product.ts b/lib/bigcommerce/api/operations/get-product.ts index bbd705242..ae601d7c0 100644 --- a/lib/bigcommerce/api/operations/get-product.ts +++ b/lib/bigcommerce/api/operations/get-product.ts @@ -1,10 +1,10 @@ import type { GetProductQuery, GetProductQueryVariables, -} from 'lib/bigcommerce/schema'; -import type { RecursivePartial, RecursiveRequired } from '../utils/types'; -import { productInfoFragment } from '../fragments/product'; -import { BigcommerceConfig, getConfig, Images } from '..'; +} from 'lib/bigcommerce/schema' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { productInfoFragment } from '../fragments/product' +import { BigcommerceConfig, getConfig, Images } from '..' export const getProductQuery = /* GraphQL */ ` query getProduct( @@ -31,55 +31,55 @@ export const getProductQuery = /* GraphQL */ ` } ${productInfoFragment} -`; +` export interface GetProductResult { product?: T extends GetProductQuery ? Extract - : unknown; + : unknown } export type ProductVariables = Images & - ({ path: string; slug?: never } | { path?: never; slug: string }); + ({ path: string; slug?: never } | { path?: never; slug: string }) async function getProduct(opts: { - query?: string; - variables: ProductVariables; - config?: BigcommerceConfig; -}): Promise>; + query?: string + variables: ProductVariables + config?: BigcommerceConfig +}): Promise> async function getProduct(opts: { - query: string; - variables: V; - config?: BigcommerceConfig; -}): Promise>; + query: string + variables: V + config?: BigcommerceConfig +}): Promise> async function getProduct({ query = getProductQuery, variables: { slug, ...vars }, config = getConfig(), }: { - query?: string; - variables: ProductVariables; - config?: BigcommerceConfig; + query?: string + variables: ProductVariables + config?: BigcommerceConfig }): Promise> { const variables: GetProductQueryVariables = { ...config.imageVariables, ...vars, path: slug ? `/${slug}/` : vars.path!, - }; + } const data = await config.fetch>(query, { variables, - }); - const product = data.site?.route?.node; + }) + const product = data.site?.route?.node if (product?.__typename === 'Product') { return { product: product as RecursiveRequired, - }; + } } - return {}; + return {} } -export default getProduct; +export default getProduct diff --git a/lib/bigcommerce/api/utils/fetch-api.ts b/lib/bigcommerce/api/utils/fetch-api.ts index 86553a833..9b12700ab 100644 --- a/lib/bigcommerce/api/utils/fetch-api.ts +++ b/lib/bigcommerce/api/utils/fetch-api.ts @@ -1,11 +1,11 @@ -import { CommerceAPIFetchOptions } from 'lib/commerce/api'; -import { getConfig } from '..'; +import { CommerceAPIFetchOptions } from 'lib/commerce/api' +import { getConfig } from '..' export default async function fetchAPI( query: string, { variables, preview }: CommerceAPIFetchOptions = {} ): Promise { - const config = getConfig(); + const config = getConfig() const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), { method: 'POST', headers: { @@ -16,12 +16,12 @@ export default async function fetchAPI( query, variables, }), - }); + }) - const json = await res.json(); + const json = await res.json() if (json.errors) { - console.error(json.errors); - throw new Error('Failed to fetch API'); + console.error(json.errors) + throw new Error('Failed to fetch API') } - return json.data; + return json.data } diff --git a/lib/bigcommerce/api/utils/types.ts b/lib/bigcommerce/api/utils/types.ts index 74f310f68..56f9c1728 100644 --- a/lib/bigcommerce/api/utils/types.ts +++ b/lib/bigcommerce/api/utils/types.ts @@ -1,7 +1,7 @@ export type RecursivePartial = { - [P in keyof T]?: RecursivePartial; -}; + [P in keyof T]?: RecursivePartial +} export type RecursiveRequired = { - [P in keyof T]-?: RecursiveRequired; -}; + [P in keyof T]-?: RecursiveRequired +} diff --git a/lib/bigcommerce/cart.tsx b/lib/bigcommerce/cart.tsx index cbe5438c8..18c072bc8 100644 --- a/lib/bigcommerce/cart.tsx +++ b/lib/bigcommerce/cart.tsx @@ -1,14 +1,14 @@ import { CartProvider as CommerceCartProvider, useCart as useCommerceCart, -} from 'lib/commerce/cart'; +} from 'lib/commerce/cart' -export type Cart = any; +export type Cart = any export function CartProvider({ children }) { - return {children}; + return {children} } export function useCart() { - return useCommerceCart(); + return useCommerceCart() } diff --git a/lib/bigcommerce/index.tsx b/lib/bigcommerce/index.tsx index 4e10e09eb..0289f15d3 100644 --- a/lib/bigcommerce/index.tsx +++ b/lib/bigcommerce/index.tsx @@ -2,38 +2,38 @@ import { CommerceProvider as CoreCommerceProvider, Connector, useCommerce as useCoreCommerce, -} from 'lib/commerce'; +} from 'lib/commerce' async function getText(res: Response) { try { - return (await res.text()) || res.statusText; + return (await res.text()) || res.statusText } catch (error) { - return res.statusText; + return res.statusText } } async function getError(res: Response) { if (res.headers.get('Content-Type')?.includes('application/json')) { - const data = await res.json(); - return data.errors[0]; + const data = await res.json() + return data.errors[0] } - return { message: await getText(res) }; + return { message: await getText(res) } } async function fetcher(url: string, query: string) { - const res = await fetch(url); + const res = await fetch(url) if (res.ok) { - return res.json(); + return res.json() } - throw await getError(res); + throw await getError(res) } export const bigcommerce: Connector = { locale: 'en-us', fetcher, -}; +} // TODO: The connector should be extendable when a developer is using it export function CommerceProvider({ children }) { @@ -41,7 +41,7 @@ export function CommerceProvider({ children }) { {children} - ); + ) } -export const useCommerce = () => useCoreCommerce(); +export const useCommerce = () => useCoreCommerce() diff --git a/lib/cart.js b/lib/cart.js index 56ca447b1..5ac35a182 100644 --- a/lib/cart.js +++ b/lib/cart.js @@ -1,105 +1,105 @@ -import { useState, useCallback } from "react"; -import useSWR, { mutate } from "swr"; +import { useState, useCallback } from 'react' +import useSWR, { mutate } from 'swr' async function getText(res) { try { - return (await res.text()) || res.statusText; + return (await res.text()) || res.statusText } catch (error) { - return res.statusText; + return res.statusText } } async function getError(res) { - if (res.headers.get("Content-Type")?.includes("application/json")) { - const data = await res.json(); - return data.errors[0]; + if (res.headers.get('Content-Type')?.includes('application/json')) { + const data = await res.json() + return data.errors[0] } - return { message: await getText(res) }; + return { message: await getText(res) } } async function fetcher(url) { - const res = await fetch(url); + const res = await fetch(url) if (res.status === 200) { - return res.json(); + return res.json() } - throw await getError(res); + throw await getError(res) } export function useCart() { - return useSWR("/api/cart", fetcher); + return useSWR('/api/cart', fetcher) } export function useAddToCart() { const [{ addingToCart, error }, setStatus] = useState({ addingToCart: false, - }); + }) const addToCart = useCallback(async ({ product }) => { - setStatus({ addingToCart: true }); + setStatus({ addingToCart: true }) - const res = await fetch("/api/cart", { - method: "POST", + const res = await fetch('/api/cart', { + method: 'POST', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, body: JSON.stringify({ product }), - }); + }) // Product added as expected if (res.status === 200) { - setStatus({ addingToCart: false }); - return mutate("/api/cart"); + setStatus({ addingToCart: false }) + return mutate('/api/cart') } - const error = await getError(res); + const error = await getError(res) - console.error("Adding product to cart failed with:", res.status, error); - setStatus({ addingToCart: false, error }); - }, []); + console.error('Adding product to cart failed with:', res.status, error) + setStatus({ addingToCart: false, error }) + }, []) - return { addToCart, addingToCart, error }; + return { addToCart, addingToCart, error } } export function useUpdateCart() { const [{ updatingCart, error }, setStatus] = useState({ updatingCart: false, - }); + }) const updateCart = useCallback(async ({ product, item }) => { - setStatus({ updatingCart: true }); + setStatus({ updatingCart: true }) const res = await fetch( `/api/cart?itemId=${item.id}`, product.quantity < 1 - ? { method: "DELETE" } + ? { method: 'DELETE' } : { - method: "PUT", + method: 'PUT', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, body: JSON.stringify({ product }), } - ); + ) // Product updated as expected if (res.status === 200) { - setStatus({ updatingCart: false }); - return mutate("/api/cart"); + setStatus({ updatingCart: false }) + return mutate('/api/cart') } - const error = await getError(res); + const error = await getError(res) - console.error("Update to cart failed with:", res.status, error); - setStatus({ updatingCart: false, error }); - }, []); + console.error('Update to cart failed with:', res.status, error) + setStatus({ updatingCart: false, error }) + }, []) - return { updateCart, updatingCart, error }; + return { updateCart, updatingCart, error } } export function useRemoveFromCart() { - const { updateCart, updatingCart, error } = useUpdateCart(); + const { updateCart, updatingCart, error } = useUpdateCart() const removeFromCart = async ({ item }) => { - updateCart({ item, product: { quantity: 0 } }); - }; + updateCart({ item, product: { quantity: 0 } }) + } - return { removeFromCart, removingFromCart: updatingCart, error }; + return { removeFromCart, removingFromCart: updatingCart, error } } diff --git a/lib/commerce/api/index.ts b/lib/commerce/api/index.ts index 1cf50bc9a..49df4ccd0 100644 --- a/lib/commerce/api/index.ts +++ b/lib/commerce/api/index.ts @@ -1,15 +1,15 @@ export interface CommerceAPIConfig { - commerceUrl: string; - apiToken: string; + commerceUrl: string + apiToken: string fetch( query: string, queryData?: CommerceAPIFetchOptions - ): Promise; + ): Promise } export interface CommerceAPIFetchOptions { - variables?: V; - preview?: boolean; + variables?: V + preview?: boolean } // TODO: define interfaces for all the available operations diff --git a/lib/commerce/cart.tsx b/lib/commerce/cart.tsx index 509737fda..3577e1ae5 100644 --- a/lib/commerce/cart.tsx +++ b/lib/commerce/cart.tsx @@ -1,37 +1,37 @@ -import { createContext, useContext } from 'react'; -import useSWR, { responseInterface } from 'swr'; -import { useCommerce } from '.'; +import { createContext, useContext } from 'react' +import useSWR, { responseInterface } from 'swr' +import { useCommerce } from '.' -export type Cart = any; +export type Cart = any export type CartResponse = responseInterface & { - isEmpty: boolean; -}; + isEmpty: boolean +} -const CartContext = createContext>(null); +const CartContext = createContext>(null) function getCartCookie() { // TODO: Figure how the cart should be persisted - return null; + return null } export function CartProvider({ children }) { - const { hooks, fetcher } = useCommerce(); - const { useCart } = hooks; - const cartId = getCartCookie(); + const { hooks, fetcher } = useCommerce() + const { useCart } = hooks + const cartId = getCartCookie() const response = useSWR( () => (cartId ? [useCart.url, useCart.query, useCart.resolver] : null), fetcher - ); - const isEmpty = true; + ) + const isEmpty = true return ( {children} - ); + ) } export function useCart() { - return useContext(CartContext) as CartResponse; + return useContext(CartContext) as CartResponse } diff --git a/lib/commerce/index.tsx b/lib/commerce/index.tsx index 267d7dfd8..2552286a8 100644 --- a/lib/commerce/index.tsx +++ b/lib/commerce/index.tsx @@ -1,29 +1,29 @@ -import { createContext, ReactNode, useContext } from 'react'; +import { createContext, ReactNode, useContext } from 'react' -const Commerce = createContext(null); +const Commerce = createContext(null) export type CommerceProps = { - children?: ReactNode; - connector: Connector; -}; + children?: ReactNode + connector: Connector +} export type Connector = { - fetcher: Fetcher; - locale: string; -}; + fetcher: Fetcher + locale: string +} -export type Fetcher = (...args: any) => T | Promise; +export type Fetcher = (...args: any) => T | Promise export function CommerceProvider({ children, connector }: CommerceProps) { if (!connector) { throw new Error( 'CommerceProvider requires a valid headless commerce connector' - ); + ) } - return {children}; + return {children} } export function useCommerce() { - return useContext(Commerce) as T; + return useContext(Commerce) as T } diff --git a/pages/_app.tsx b/pages/_app.tsx index bca14e53a..d15b79d43 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,6 +1,6 @@ -import "@assets/global.css"; -import React from "react"; -import { UIProvider } from "@components/ui/context"; +import '@assets/global.css' +import React from 'react' +import { UIProvider } from '@components/ui/context' export default function MyApp({ Component, pageProps }) { return ( @@ -9,5 +9,5 @@ export default function MyApp({ Component, pageProps }) { - ); + ) } diff --git a/pages/_document.tsx b/pages/_document.tsx index 693a1c1ae..215662cd7 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,4 +1,4 @@ -import Document_, { Html, Head, Main, NextScript } from "next/document"; +import Document_, { Html, Head, Main, NextScript } from 'next/document' export default class Document extends Document_ { render() { @@ -13,6 +13,6 @@ export default class Document extends Document_ { */} - ); + ) } } diff --git a/pages/index.tsx b/pages/index.tsx index b0ffda896..6e5a6b5f5 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,22 +1,22 @@ -import { GetStaticPropsContext, InferGetStaticPropsType } from "next"; -import getAllProducts from "lib/bigcommerce/api/operations/get-all-products"; -import { Layout } from "@components/core"; -import { ProductGrid } from "@components/product"; +import { GetStaticPropsContext, InferGetStaticPropsType } from 'next' +import getAllProducts from 'lib/bigcommerce/api/operations/get-all-products' +import { Layout } from '@components/core' +import { ProductGrid } from '@components/product' export async function getStaticProps({ preview }: GetStaticPropsContext) { - const { products } = await getAllProducts(); + const { products } = await getAllProducts() return { props: { products }, - }; + } } export default function Home({ products, }: InferGetStaticPropsType) { - console.log("PRODUCTS", products); + console.log('PRODUCTS', products) return ( - ); + ) } diff --git a/pages/product/[slug].tsx b/pages/product/[slug].tsx index 012c43368..e362daa1f 100644 --- a/pages/product/[slug].tsx +++ b/pages/product/[slug].tsx @@ -1,14 +1,14 @@ -import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'; -import { useRouter } from 'next/router'; -import getProduct from 'lib/bigcommerce/api/operations/get-product'; -import { Layout } from '@components/core'; -import { ProductView } from '@components/product'; -import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths'; +import { GetStaticPropsContext, InferGetStaticPropsType } from 'next' +import { useRouter } from 'next/router' +import getProduct from 'lib/bigcommerce/api/operations/get-product' +import { Layout } from '@components/core' +import { ProductView } from '@components/product' +import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths' export async function getStaticProps({ params, }: GetStaticPropsContext<{ slug: string }>) { - const { product } = await getProduct({ variables: { slug: params!.slug } }); + const { product } = await getProduct({ variables: { slug: params!.slug } }) const productData = { title: 'T-Shirt', description: ` @@ -22,34 +22,34 @@ export async function getStaticProps({ price: '$50', colors: ['black', 'white', 'pink'], sizes: ['s', 'm', 'l', 'xl', 'xxl'], - }; + } return { props: { product, productData, }, revalidate: 200, - }; + } } export async function getStaticPaths() { - const { products } = await getAllProductPaths(); + const { products } = await getAllProductPaths() return { paths: products.map((product) => ({ params: { slug: product!.node.path }, })), fallback: 'unstable_blocking', - }; + } } export default function Home({ product, productData, }: InferGetStaticPropsType) { - console.log('PRODUCT', product); + console.log('PRODUCT', product) - const router = useRouter(); + const router = useRouter() return ( @@ -59,5 +59,5 @@ export default function Home({ )} - ); + ) } diff --git a/postcss.config.js b/postcss.config.js index 5bacd33fd..6f2d25c4e 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,18 +1,18 @@ module.exports = { plugins: [ - "tailwindcss", - "postcss-flexbugs-fixes", + 'tailwindcss', + 'postcss-flexbugs-fixes', [ - "postcss-preset-env", + 'postcss-preset-env', { autoprefixer: { - flexbox: "no-2009", + flexbox: 'no-2009', }, stage: 3, features: { - "custom-properties": false, + 'custom-properties': false, }, }, ], ], -}; +} diff --git a/tailwind.config.js b/tailwind.config.js index dfb08c05e..882b19d63 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,25 +3,25 @@ module.exports = { removeDeprecatedGapUtilities: true, }, purge: [ - "./components/**/*.{js,ts,jsx,tsx}", - "./pages/**/*.{js,ts,jsx,tsx}", - "./ui/**/*.{js,ts,jsx,tsx}", + './components/**/*.{js,ts,jsx,tsx}', + './pages/**/*.{js,ts,jsx,tsx}', + './ui/**/*.{js,ts,jsx,tsx}', ], theme: { extend: { colors: { - "accent-1": "#FAFAFA", - "accent-4": "#888", - violet: "#7928CA", - pink: "#FF0080", - cyan: "#50E3C2", - blue: "#0070F3", + 'accent-1': '#FAFAFA', + 'accent-4': '#888', + violet: '#7928CA', + pink: '#FF0080', + cyan: '#50E3C2', + blue: '#0070F3', }, }, }, variants: {}, - plugins: [require("@tailwindcss/ui")], + plugins: [require('@tailwindcss/ui')], experimental: { applyComplexClasses: true, }, -}; +} From 6587ab10ae429842c8daf460512a88055efc0f17 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 21:18:01 -0500 Subject: [PATCH 08/12] Moved UIProvider to the layout --- components/core/Layout/Layout.tsx | 12 +++++++++--- pages/_app.tsx | 13 +++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index f25244ec7..246028878 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -1,17 +1,17 @@ import cn from 'classnames' -import React, { FunctionComponent } from 'react' +import { FunctionComponent } from 'react' import s from './Layout.module.css' import { Navbar, Featurebar } from '@components/core' import { Container, Sidebar } from '@components/ui' import { CartSidebarView } from '@components/cart' -import { useUI } from '@components/ui/context' +import { UIProvider, useUI } from '@components/ui/context' interface Props { className?: string children?: any } -const Layout: FunctionComponent = ({ className, children }) => { +const CoreLayout: FunctionComponent = ({ className, children }) => { const rootClassName = cn(s.root, className) const { displaySidebar } = useUI() return ( @@ -33,4 +33,10 @@ const Layout: FunctionComponent = ({ className, children }) => { ) } +const Layout: FunctionComponent = (props) => ( + + + +) + export default Layout diff --git a/pages/_app.tsx b/pages/_app.tsx index d15b79d43..a5adb8f90 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,13 +1,6 @@ +import type { AppProps } from 'next/app' import '@assets/global.css' -import React from 'react' -import { UIProvider } from '@components/ui/context' -export default function MyApp({ Component, pageProps }) { - return ( - <> - - - - - ) +export default function MyApp({ Component, pageProps }: AppProps) { + return } From cf7c85e3bae4a8176e66f21b3d825e7b146e43d6 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 21:30:08 -0500 Subject: [PATCH 09/12] Added shared layout with _app --- components/core/Layout/Layout.tsx | 1 + pages/_app.tsx | 11 ++++++++++- pages/index.tsx | 8 +++----- pages/product/[slug].tsx | 16 +++++++--------- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index 246028878..8dec4a719 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -14,6 +14,7 @@ interface Props { const CoreLayout: FunctionComponent = ({ className, children }) => { const rootClassName = cn(s.root, className) const { displaySidebar } = useUI() + return (
<>{children} + export default function MyApp({ Component, pageProps }: AppProps) { - return + const Layout = (Component as any).Layout || Noop + + return ( + + + + ) } diff --git a/pages/index.tsx b/pages/index.tsx index 6e5a6b5f5..597943825 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -14,9 +14,7 @@ export default function Home({ products, }: InferGetStaticPropsType) { console.log('PRODUCTS', products) - return ( - - - - ) + return } + +Home.Layout = Layout diff --git a/pages/product/[slug].tsx b/pages/product/[slug].tsx index e362daa1f..ed06a97fa 100644 --- a/pages/product/[slug].tsx +++ b/pages/product/[slug].tsx @@ -43,7 +43,7 @@ export async function getStaticPaths() { } } -export default function Home({ +export default function Slug({ product, productData, }: InferGetStaticPropsType) { @@ -51,13 +51,11 @@ export default function Home({ const router = useRouter() - return ( - - {router.isFallback ? ( -

Loading...

- ) : ( - - )} -
+ return router.isFallback ? ( +

Loading...

+ ) : ( + ) } + +Slug.Layout = Layout From 44a41eb3e132f935e614db323466a516a2c7d40b Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 1 Oct 2020 21:30:52 -0500 Subject: [PATCH 10/12] use FC instead of FunctionalComponent --- components/cart/CartSidebarView/CartSidebarView.tsx | 4 ++-- components/core/Avatar/Avatar.tsx | 4 ++-- components/core/Featurebar/Featurebar.tsx | 8 ++------ components/core/Footer/Footer.tsx | 4 ++-- components/core/Layout/Layout.tsx | 6 +++--- components/core/Navbar/Navbar.tsx | 4 ++-- components/core/Searchbar/Searchbar.tsx | 4 ++-- components/core/UserNav/UserNav.tsx | 4 ++-- components/product/ProductCard/ProductCard.tsx | 4 ++-- components/product/ProductGrid/ProductGrid.tsx | 4 ++-- components/product/ProductView/ProductView.tsx | 4 ++-- components/product/Swatch/Swatch.tsx | 9 ++------- components/ui/ClickOutside/ClickOutside.tsx | 7 +------ components/ui/Container/Container.tsx | 8 ++------ components/ui/Sidebar/Sidebar.tsx | 4 ++-- components/ui/_BLANK/Featurebar.tsx | 4 ++-- components/ui/context.tsx | 4 ++-- 17 files changed, 34 insertions(+), 52 deletions(-) diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index 53969dfc6..5dbde0e93 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -1,10 +1,10 @@ -import React, { FunctionComponent } from 'react' +import React, { FC } from 'react' import { UserNav } from '@components/core' import { Button } from '@components/ui' import { Trash, Cross } from '@components/icon' import { useUI } from '@components/ui/context' -const CartSidebarView: FunctionComponent = () => { +const CartSidebarView: FC = () => { const { closeSidebar } = useUI() return ( <> diff --git a/components/core/Avatar/Avatar.tsx b/components/core/Avatar/Avatar.tsx index c9cd9a029..f1d61a054 100644 --- a/components/core/Avatar/Avatar.tsx +++ b/components/core/Avatar/Avatar.tsx @@ -1,5 +1,5 @@ import cn from 'classnames' -import React, { FunctionComponent } from 'react' +import React, { FC } from 'react' import s from './Avatar.module.css' interface Props { @@ -7,7 +7,7 @@ interface Props { children?: any } -const Avatar: FunctionComponent = ({ className }) => { +const Avatar: FC = ({ className }) => { const rootClassName = cn(s.root, className) return (
diff --git a/components/core/Featurebar/Featurebar.tsx b/components/core/Featurebar/Featurebar.tsx index 714a9fceb..7fa882d8a 100644 --- a/components/core/Featurebar/Featurebar.tsx +++ b/components/core/Featurebar/Featurebar.tsx @@ -1,5 +1,5 @@ import cn from 'classnames' -import { FunctionComponent } from 'react' +import { FC } from 'react' import s from './Featurebar.module.css' interface Props { @@ -8,11 +8,7 @@ interface Props { description: string } -const Featurebar: FunctionComponent = ({ - title, - description, - className, -}) => { +const Featurebar: FC = ({ title, description, className }) => { const rootClassName = cn(s.root, className) return (
diff --git a/components/core/Footer/Footer.tsx b/components/core/Footer/Footer.tsx index 977cbd787..7b58acf84 100644 --- a/components/core/Footer/Footer.tsx +++ b/components/core/Footer/Footer.tsx @@ -1,5 +1,5 @@ import cn from 'classnames' -import React, { FunctionComponent } from 'react' +import React, { FC } from 'react' import s from './Footer.module.css' import { Container } from '@components/ui' @@ -8,7 +8,7 @@ interface Props { children?: any } -const Footer: FunctionComponent = ({ className }) => { +const Footer: FC = ({ className }) => { const rootClassName = cn(s.root, className) return (