From 137c1bed4b49942febf28d207d7ce790bbfe5bf8 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Tue, 29 Mar 2022 12:04:34 +0300 Subject: [PATCH 001/192] Change JS to TS, create tsconfig and adjust package.json --- .../{jsconfig.json => mosaic.jsconfig} | 0 packages/scandipwa/package.json | 7 ++++- packages/scandipwa/src/react-app-env.d.ts | 1 + packages/scandipwa/tsconfig.json | 27 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) rename packages/scandipwa/{jsconfig.json => mosaic.jsconfig} (100%) create mode 100644 packages/scandipwa/src/react-app-env.d.ts create mode 100644 packages/scandipwa/tsconfig.json diff --git a/packages/scandipwa/jsconfig.json b/packages/scandipwa/mosaic.jsconfig similarity index 100% rename from packages/scandipwa/jsconfig.json rename to packages/scandipwa/mosaic.jsconfig diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 5ac84fd8be..2331ca9a32 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -17,6 +17,11 @@ "@scandipwa/service-worker": "0.0.17", "@scandipwa/stylelint-config": "0.0.5", "@scandipwa/webpack-i18n-runtime": "0.0.29", + "@tilework/opus": "^0.0.9", + "@types/react": "^17.0.19", + "@types/react-dom": "^17.0.9", + "@types/react-router": "^5.1.16", + "@types/react-router-dom": "^5.1.8", "history": "^4.9.0", "html-react-parser": "^0.13.0", "intersection-observer": "^0.12.0", @@ -119,7 +124,6 @@ "env": { "browser": true }, - "parser": "babel-eslint", "globals": { "window": true, "document": true, @@ -182,6 +186,7 @@ "@scandipwa/scandipwa-guidelines/create-config-files": "error", "@scandipwa/scandipwa-guidelines/no-duplicate-namespaces": "error", "@scandipwa/scandipwa-guidelines/use-license": "error", + "@typescript-eslint/no-unused-vars-experimental": "off", "simple-import-sort/sort": [ "error", { diff --git a/packages/scandipwa/src/react-app-env.d.ts b/packages/scandipwa/src/react-app-env.d.ts new file mode 100644 index 0000000000..6431bc5fc6 --- /dev/null +++ b/packages/scandipwa/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/scandipwa/tsconfig.json b/packages/scandipwa/tsconfig.json new file mode 100644 index 0000000000..87c36fd041 --- /dev/null +++ b/packages/scandipwa/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react" + }, + "include": [ + "./src/**/*" + ], + "extends": "./mosaic.jsconfig" +} From 9f2a2be015d8633a78eae331b49ce889008eccba Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Tue, 29 Mar 2022 12:09:24 +0300 Subject: [PATCH 002/192] Migrated some proptypes types and queries to TS --- ...Rewrites.query.js => UrlRewrites.query.ts} | 11 +- packages/scandipwa/src/type/Account.type.d.ts | 65 +++++++ .../scandipwa/src/type/Breadcrumbs.type.d.ts | 19 ++ packages/scandipwa/src/type/CMS.type.d.ts | 29 ++++ .../scandipwa/src/type/Category.type.d.ts | 58 +++++++ packages/scandipwa/src/type/Common.type.d.ts | 27 +++ .../scandipwa/src/type/Downloadable.type.d.ts | 21 +++ packages/scandipwa/src/type/Order.type.d.ts | 164 ++++++++++++++++++ packages/scandipwa/src/type/Price.type.d.ts | 67 +++++++ packages/scandipwa/src/type/Rating.type.d.ts | 47 +++++ packages/scandipwa/src/type/Router.type.d.ts | 44 +++++ packages/scandipwa/src/type/Slider.type.d.ts | 21 +++ 12 files changed, 568 insertions(+), 5 deletions(-) rename packages/scandipwa/src/query/{UrlRewrites.query.js => UrlRewrites.query.ts} (73%) create mode 100644 packages/scandipwa/src/type/Account.type.d.ts create mode 100644 packages/scandipwa/src/type/Breadcrumbs.type.d.ts create mode 100644 packages/scandipwa/src/type/CMS.type.d.ts create mode 100644 packages/scandipwa/src/type/Category.type.d.ts create mode 100644 packages/scandipwa/src/type/Common.type.d.ts create mode 100644 packages/scandipwa/src/type/Downloadable.type.d.ts create mode 100644 packages/scandipwa/src/type/Order.type.d.ts create mode 100644 packages/scandipwa/src/type/Price.type.d.ts create mode 100644 packages/scandipwa/src/type/Rating.type.d.ts create mode 100644 packages/scandipwa/src/type/Router.type.d.ts create mode 100644 packages/scandipwa/src/type/Slider.type.d.ts diff --git a/packages/scandipwa/src/query/UrlRewrites.query.js b/packages/scandipwa/src/query/UrlRewrites.query.ts similarity index 73% rename from packages/scandipwa/src/query/UrlRewrites.query.js rename to packages/scandipwa/src/query/UrlRewrites.query.ts index 8cbc051d44..a685e5f227 100644 --- a/packages/scandipwa/src/query/UrlRewrites.query.js +++ b/packages/scandipwa/src/query/UrlRewrites.query.ts @@ -8,22 +8,23 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; + +import { UrlRewriteType } from 'Type/Router.type'; -import { Field } from 'Util/Query'; /** * UrlRewrites Query * @class UrlRewritesQuery * @namespace Query/UrlRewrites/Query */ export class UrlRewritesQuery { - getQuery({ urlParam }) { - return new Field('urlResolver') + getQuery({ urlParam }: { urlParam: string }): UrlRewriteType { + return new Query('urlResolver') .addArgument('url', 'String!', urlParam) .addFieldList(this._getUrlResolverFields()); } - _getUrlResolverFields() { + _getUrlResolverFields(): string[] { return [ - 'id', 'sku', 'type' ]; diff --git a/packages/scandipwa/src/type/Account.type.d.ts b/packages/scandipwa/src/type/Account.type.d.ts new file mode 100644 index 0000000000..912637d099 --- /dev/null +++ b/packages/scandipwa/src/type/Account.type.d.ts @@ -0,0 +1,65 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export * from './Account.type'; + +export interface RegionType { + region_code: string | null + region: string | null + region_id: number +} + +export interface AddressType { + city: string + company: string | null + country_id: string + customer_id: number + default_billing: boolean + default_shipping: boolean + firstname: string + id: number + lastname: string + middlename: string + postcode: string + prefix: string + region?: RegionType + street: string | string[] + suffix: string + telephone: string + vat_id: number | null +} + +export type AddressesType = AddressType[]; + +export interface CustomerType { + addresses: AddressesType + created_at: string + default_billing: string + default_shipping: string + dob: Date + email: string + firstname: string + group_id: number + id: number + is_subscribed: boolean + lastname: string + middlename: string + prefix: string + suffix: string + taxvat: string +} + +export interface TabType { + url: string + name: string +} + +export type TabMapType = Record diff --git a/packages/scandipwa/src/type/Breadcrumbs.type.d.ts b/packages/scandipwa/src/type/Breadcrumbs.type.d.ts new file mode 100644 index 0000000000..0d9b81bb2d --- /dev/null +++ b/packages/scandipwa/src/type/Breadcrumbs.type.d.ts @@ -0,0 +1,19 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export * from './Breadcrumbs.type'; + +export interface Breadcrumb { + url: string + name: string +} + +export type Breadcrumbs = Breadcrumb[]; diff --git a/packages/scandipwa/src/type/CMS.type.d.ts b/packages/scandipwa/src/type/CMS.type.d.ts new file mode 100644 index 0000000000..b65ba06b43 --- /dev/null +++ b/packages/scandipwa/src/type/CMS.type.d.ts @@ -0,0 +1,29 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { MetaTitleType } from 'Type/Common.type'; + +export interface PageType { + title?: string; + content?: string; + meta_title?: MetaTitleType; + meta_description?: string; + meta_keywords?: string; +} + +export interface BlockType { + title?: string; + content?: string; +} + +export interface BlockListType { + items?: Record +} diff --git a/packages/scandipwa/src/type/Category.type.d.ts b/packages/scandipwa/src/type/Category.type.d.ts new file mode 100644 index 0000000000..69a85b4e75 --- /dev/null +++ b/packages/scandipwa/src/type/Category.type.d.ts @@ -0,0 +1,58 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { MetaTitleType } from 'Type/Common.type'; + +export type BreadcrumbsType = { + category_name?: string; + category_url?: string; + category_level?: number; +}[]; + +export interface CategoryFragment { + id: number, + breadcrumbs: BreadcrumbsType, + description: string, + image: string, + meta_description: string, + meta_title: MetaTitleType, + name: string, + product_count: number, + url_key: string, + url_path: string, + display_mode: string +} + +export interface CategoryTreeType extends CategoryFragment { + children?: CategoryFragment[]; +} + +export type SelectedFiltersType = Record; + +export type FilterType = Record; + +export interface FilterInputType { + categoryIds?: number; + categoryUrlPath?: string; + customFilters?: SelectedFiltersType; + priceRange?: { + min?: number; + max?: number; + }; + conditions?: string; +} + +export interface SortFieldsType { + options?: { + label?: string; + value?: string; + }[]; +} diff --git a/packages/scandipwa/src/type/Common.type.d.ts b/packages/scandipwa/src/type/Common.type.d.ts new file mode 100644 index 0000000000..c78c36fc95 --- /dev/null +++ b/packages/scandipwa/src/type/Common.type.d.ts @@ -0,0 +1,27 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { ReactNodeLike } from 'prop-types'; + +export type ModsType = Record; + +export interface MixType { + block?: string; + elem?: string; + mods?: ModsType; +} + +export type ChildrenType = ReactNodeLike[] | ReactNodeLike + +export type RefType = () => void | { current: Element } + +// TODO unknown +export type MetaTitleType = string | unknown diff --git a/packages/scandipwa/src/type/Downloadable.type.d.ts b/packages/scandipwa/src/type/Downloadable.type.d.ts new file mode 100644 index 0000000000..6588077e08 --- /dev/null +++ b/packages/scandipwa/src/type/Downloadable.type.d.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface DownloadableLinkType { + sample_url?: string; + sort_order?: number; + title?: string; + id?: number; + uid?: string; + price?: number; +} + +export type DownloadableLinksType = [DownloadableLinkType | string]; diff --git a/packages/scandipwa/src/type/Order.type.d.ts b/packages/scandipwa/src/type/Order.type.d.ts new file mode 100644 index 0000000000..bbe78cf16f --- /dev/null +++ b/packages/scandipwa/src/type/Order.type.d.ts @@ -0,0 +1,164 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface OrderGrandTotalType { + value?: number; + currency?: string; +} + +export interface OrderTotalType { + grand_total?: OrderGrandTotalType; +} + +export interface OrderInfoType { + id?: number; + increment_id?: string; + created_at?: string; + status_label?: string; + grand_total?: number; + subtotal?: string; +} + +export interface OrderPaymentInfo { + name?: string; + type?: string; + additional_data?: { + name: string + value: string + }; +} + +export type OrderPaymentsInfo = OrderPaymentInfo[]; + +export interface OrderAddressType { + city?: string; + country_code?: string; + firstname?: string; + lastname?: string; + postcode?: string; + region?: string; + region_id?: string; + street?: string[]; + telephone?: string; +} + +export interface orderItemQtyType { + quantity_ordered?: number; + quantity_canceled?: number; + quantity_invoiced?: number; + quantity_refunded?: number; + quantity_returned?: number; + quantity_shipped?: number; +} + +export interface MoneyType { + currency?: string; + value?: number; +} + +export interface DiscountType { + amount?: MoneyType; + value?: number; +} + +export interface OptionItemType { + title?: string; + qty?: number; + price?: number; +} + +export type OptionItemsType = OptionItemType[]; + +export interface OptionType { + label?: string; + value?: string; + items?: OptionItemsType; + linkItems?: string[]; +} + +export type OptionsType = OptionType[]; + +export interface OrderProductType { + discounts?: DiscountType[]; + id?: string; + selected_options?: OptionsType; + entered_options?: OptionsType; + product_name?: string; + product_sale_price?: MoneyType; + product_sku?: string; + product_type?: string; + product_url_key?: string; + quantity_ordered?: number; + quantity_canceled?: number; + quantity_invoiced?: number; + quantity_refunded?: number; + quantity_returned?: number; + quantity_shipped?: number; +} + +export type OrderProductsType = OrderProductType[]; + +export interface OrderTabType { + items?: OrderProductsType; + id?: string | number; + number?: string; + total?: OrderTotalType; + quantity_ordered?: number; + quantity_canceled?: number; + quantity_invoiced?: number; + quantity_refunded?: number; + quantity_returned?: number; + quantity_shipped?: number; +} + +export type OrderTabsType = OrderTabType[]; + +export interface OrderType { + can_reorder?: boolean; + carrier?: string; + id?: string; + order_date?: string; + credit_memos?: string; + invoices?: string; + items?: OrderProductsType; + shipments?: string; + payment_methods?: OrderPaymentsInfo; + rss_link?: string; + shipping_address?: OrderAddressType; + billing_address?: OrderAddressType; + shipping_method?: string; + status?: string; + total?: OrderTotalType; +} + +export interface DownloadableType { + id?: number; + order_id?: number; + order_increment_id?: string; + status_label?: string; + downloads?: string; + download_url?: string; + created_at?: string; + title?: string; +} + +export interface PageInfoType { + current_page?: number; + page_size?: number; + total_pages?: number; +} + +export type OrdersType = OrderType[]; + +export interface OrdersListType { + items?: OrdersType; + pageInfo?: PageInfoType; +} diff --git a/packages/scandipwa/src/type/Price.type.d.ts b/packages/scandipwa/src/type/Price.type.d.ts new file mode 100644 index 0000000000..4043c36170 --- /dev/null +++ b/packages/scandipwa/src/type/Price.type.d.ts @@ -0,0 +1,67 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface PriceItemType { + currency: string; + value: number; + valueFormatted: string; +} + +export interface DiscountType { + amount_off: number; + percent_off: number; +} + +export interface PriceVariantType { + discount?: DiscountType; + final_price?: PriceItemType; + regular_price?: PriceItemType; +} + +export interface PriceType { + minimum_price?: PriceVariantType; + maximal_price?: PriceVariantType; +} + +export interface OriginalPriceType { + minRegularPrice?: PriceItemType; + minFinalPrice?: PriceItemType; + minFinalPriceExclTax?: PriceItemType; + maxRegularPrice?: PriceItemType; + maxFinalPrice?: PriceItemType; + maxFinalPriceExclTax?: PriceItemType; +} + +export interface ProductPriceType { + price?: { + finalPrice?: PriceItemType; + finalPriceExclTax?: PriceItemType; + originalPrice?: PriceItemType; + originalPriceExclTax?: PriceItemType; + discount?: DiscountType; + }; + originalPrice?: OriginalPriceType; + configuration?: { + containsOptions?: false; + containsOptionsWithPrice?: false; + containsRequiredOptions?: false; + containsRequiredOptionsWithPrice?: false; + }; +} + +export type TierPricesType = { + discount?: DiscountType; + final_price?: { + currency?: string; + value?: number; + }; + quantity?: number; +}[]; diff --git a/packages/scandipwa/src/type/Rating.type.d.ts b/packages/scandipwa/src/type/Rating.type.d.ts new file mode 100644 index 0000000000..cac0b68bdb --- /dev/null +++ b/packages/scandipwa/src/type/Rating.type.d.ts @@ -0,0 +1,47 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export interface RatingOptionItemType { + option_id?: string; + value?: string; +} + +export type RatingItemsType = { + rating_id?: string; + rating_code?: string; + rating_options?: RatingOptionItemType[]; +}[]; + +export interface VoteType { + rating_code?: string; + value?: string; + percent?: number; +} + +export interface ReviewItemType { + average_rating?: number; + nickname?: string; + title?: string; + detail?: string; + created_at?: string; + rating_votes?: VoteType[]; +} + +export interface CreateProductReviewInput { + nickname: string; + sku: string; + summary: string; + text: string; + ratings: { + id: string; + value_id: string; + }[]; +} diff --git a/packages/scandipwa/src/type/Router.type.d.ts b/packages/scandipwa/src/type/Router.type.d.ts new file mode 100644 index 0000000000..8f5804d682 --- /dev/null +++ b/packages/scandipwa/src/type/Router.type.d.ts @@ -0,0 +1,44 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { LocationState } from 'history'; + +export interface LocationType { + pathname?: string; + search?: string; + state?: LocationState; + hash?: string; + key?: string; +} + +// TODO use HistoryType +export interface HistoryType { + length?: number; + action?: string; + location?: LocationType; +} + +// TODO use match from react-router +export interface MatchType { + path?: string; + url?: string; + params?: any; + isExact?: boolean; +} + +export interface UrlRewriteType { + id?: number; + type?: string; + sku?: string; + notFound?: boolean; +} + +export type LinkType = [string | unknown] diff --git a/packages/scandipwa/src/type/Slider.type.d.ts b/packages/scandipwa/src/type/Slider.type.d.ts new file mode 100644 index 0000000000..d35d1d1dd0 --- /dev/null +++ b/packages/scandipwa/src/type/Slider.type.d.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export interface SlideType { + slide_id?: string; + image?: string; + slide_text?: string; +} + +export interface SliderType { + slider_id?: string; + slides?: SlideType[]; +} From 26bccb769dd2a4cd2a4e2eb32aff0b04d149a2a2 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Wed, 30 Mar 2022 04:37:35 +0300 Subject: [PATCH 003/192] Add dependencies for development --- packages/scandipwa/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 2331ca9a32..cb629d9048 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -22,6 +22,8 @@ "@types/react-dom": "^17.0.9", "@types/react-router": "^5.1.16", "@types/react-router-dom": "^5.1.8", + "get-graphql-schema": "^2.1.2", + "graphql-schema-typescript": "^1.5.2", "history": "^4.9.0", "html-react-parser": "^0.13.0", "intersection-observer": "^0.12.0", From b6d25c7a7d987f1e7a97a70023df7003bb2ded75 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Wed, 30 Mar 2022 14:32:24 +0300 Subject: [PATCH 004/192] Added opus to scandipwa --- lerna.json | 3 +- package.json | 3 +- packages/scandipwa/package.json | 2 +- .../scandipwa/src/query/UrlRewrites.query.ts | 7 +- packages/scandipwa/src/react-app-env.d.ts | 10 + tilework-packages/opus/.editorconfig | 12 + tilework-packages/opus/.eslintrc.json | 36 + tilework-packages/opus/.gitignore | 9 + tilework-packages/opus/.vscode/launch.json | 23 + tilework-packages/opus/README.md | 172 + tilework-packages/opus/jest.config.js | 5 + tilework-packages/opus/package.json | 41 + tilework-packages/opus/rollup.config.js | 41 + .../opus/src/__tests__/Calculated.test.ts | 65 + .../opus/src/__tests__/Client.test.ts | 101 + .../opus/src/__tests__/Client2.test.ts | 66 + .../opus/src/__tests__/CombinedField.test.ts | 36 + .../opus/src/__tests__/DataType.test.ts | 80 + .../opus/src/__tests__/Field.test.ts | 70 + .../opus/src/__tests__/InlineFragment.test.ts | 11 + .../opus/src/__tests__/Mutation.test.ts | 12 + .../opus/src/__tests__/Query.test.ts | 12 + .../opus/src/builder/AbstractField.ts | 211 + .../opus/src/builder/CombinedField.ts | 31 + .../opus/src/builder/InlineFragment.ts | 12 + .../opus/src/builder/Mutation.ts | 13 + tilework-packages/opus/src/builder/Query.ts | 13 + tilework-packages/opus/src/builder/hkt.ts | 23 + tilework-packages/opus/src/builder/index.ts | 7 + .../src/builder/interface/IRequestable.ts | 5 + .../opus/src/builder/interface/index.ts | 1 + tilework-packages/opus/src/client/client.ts | 132 + tilework-packages/opus/src/client/index.ts | 4 + .../opus/src/client/parse-response.ts | 40 + tilework-packages/opus/src/client/post.ts | 41 + .../opus/src/client/prepare-document.ts | 84 + tilework-packages/opus/src/index.ts | 6 + tilework-packages/opus/src/util/data-type.ts | 11 + tilework-packages/opus/src/util/deep-apply.ts | 11 + .../opus/src/util/deep-readonly.ts | 11 + tilework-packages/opus/src/util/index.ts | 3 + tilework-packages/opus/tsconfig.json | 34 + yarn.lock | 3728 +++++++++-------- 43 files changed, 3535 insertions(+), 1703 deletions(-) create mode 100644 tilework-packages/opus/.editorconfig create mode 100644 tilework-packages/opus/.eslintrc.json create mode 100644 tilework-packages/opus/.gitignore create mode 100644 tilework-packages/opus/.vscode/launch.json create mode 100644 tilework-packages/opus/README.md create mode 100644 tilework-packages/opus/jest.config.js create mode 100644 tilework-packages/opus/package.json create mode 100644 tilework-packages/opus/rollup.config.js create mode 100644 tilework-packages/opus/src/__tests__/Calculated.test.ts create mode 100644 tilework-packages/opus/src/__tests__/Client.test.ts create mode 100644 tilework-packages/opus/src/__tests__/Client2.test.ts create mode 100644 tilework-packages/opus/src/__tests__/CombinedField.test.ts create mode 100644 tilework-packages/opus/src/__tests__/DataType.test.ts create mode 100644 tilework-packages/opus/src/__tests__/Field.test.ts create mode 100644 tilework-packages/opus/src/__tests__/InlineFragment.test.ts create mode 100644 tilework-packages/opus/src/__tests__/Mutation.test.ts create mode 100644 tilework-packages/opus/src/__tests__/Query.test.ts create mode 100644 tilework-packages/opus/src/builder/AbstractField.ts create mode 100644 tilework-packages/opus/src/builder/CombinedField.ts create mode 100644 tilework-packages/opus/src/builder/InlineFragment.ts create mode 100644 tilework-packages/opus/src/builder/Mutation.ts create mode 100644 tilework-packages/opus/src/builder/Query.ts create mode 100644 tilework-packages/opus/src/builder/hkt.ts create mode 100644 tilework-packages/opus/src/builder/index.ts create mode 100644 tilework-packages/opus/src/builder/interface/IRequestable.ts create mode 100644 tilework-packages/opus/src/builder/interface/index.ts create mode 100644 tilework-packages/opus/src/client/client.ts create mode 100644 tilework-packages/opus/src/client/index.ts create mode 100644 tilework-packages/opus/src/client/parse-response.ts create mode 100644 tilework-packages/opus/src/client/post.ts create mode 100644 tilework-packages/opus/src/client/prepare-document.ts create mode 100644 tilework-packages/opus/src/index.ts create mode 100644 tilework-packages/opus/src/util/data-type.ts create mode 100644 tilework-packages/opus/src/util/deep-apply.ts create mode 100644 tilework-packages/opus/src/util/deep-readonly.ts create mode 100644 tilework-packages/opus/src/util/index.ts create mode 100644 tilework-packages/opus/tsconfig.json diff --git a/lerna.json b/lerna.json index ff3f31289e..9a215fac82 100644 --- a/lerna.json +++ b/lerna.json @@ -5,6 +5,7 @@ "packages": [ "packages/*", "runtime-packages/*", - "build-packages/*" + "build-packages/*", + "tilework-packages/opus" ] } diff --git a/package.json b/package.json index 8fa0cdeb5d..220941c46f 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "workspaces": [ "packages/*", "build-packages/*", - "runtime-packages/*" + "runtime-packages/*", + "tilework-packages/opus" ] } diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 2331ca9a32..8841661384 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -17,7 +17,7 @@ "@scandipwa/service-worker": "0.0.17", "@scandipwa/stylelint-config": "0.0.5", "@scandipwa/webpack-i18n-runtime": "0.0.29", - "@tilework/opus": "^0.0.9", + "@tilework/opus": "file:../../tilework-packages/opus", "@types/react": "^17.0.19", "@types/react-dom": "^17.0.9", "@types/react-router": "^5.1.16", diff --git a/packages/scandipwa/src/query/UrlRewrites.query.ts b/packages/scandipwa/src/query/UrlRewrites.query.ts index a685e5f227..5071db9ae3 100644 --- a/packages/scandipwa/src/query/UrlRewrites.query.ts +++ b/packages/scandipwa/src/query/UrlRewrites.query.ts @@ -8,7 +8,7 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Query } from '@tilework/opus'; +import { Field, Query } from '@tilework/opus'; import { UrlRewriteType } from 'Type/Router.type'; @@ -23,10 +23,11 @@ export class UrlRewritesQuery { .addFieldList(this._getUrlResolverFields()); } - _getUrlResolverFields(): string[] { + _getUrlResolverFields(): Array> { return [ 'sku', - 'type' + 'type', + new Field('dsfdsf') ]; } } diff --git a/packages/scandipwa/src/react-app-env.d.ts b/packages/scandipwa/src/react-app-env.d.ts index 6431bc5fc6..88e3b0a765 100644 --- a/packages/scandipwa/src/react-app-env.d.ts +++ b/packages/scandipwa/src/react-app-env.d.ts @@ -1 +1,11 @@ /// +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ diff --git a/tilework-packages/opus/.editorconfig b/tilework-packages/opus/.editorconfig new file mode 100644 index 0000000000..c1e2c64351 --- /dev/null +++ b/tilework-packages/opus/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/tilework-packages/opus/.eslintrc.json b/tilework-packages/opus/.eslintrc.json new file mode 100644 index 0000000000..67b8d7e192 --- /dev/null +++ b/tilework-packages/opus/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "airbnb-base" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 12, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "indent": [ + "error", + 4 + ], + "max-len": [ + "error", + { + "code": 120 + } + ], + "max-classes-per-file": "off", + "@scandipwa/scandipwa-guidelines/export-level-one": "off", + "@typescript-eslint/no-explicit-any": "off", + "@scandipwa/scandipwa-guidelines/use-namespace": "off", + "@scandipwa/scandipwa-guidelines/only-one-class": "off", + "comma-dangle": "off", + "import/prefer-default-export": "off" + } +} diff --git a/tilework-packages/opus/.gitignore b/tilework-packages/opus/.gitignore new file mode 100644 index 0000000000..a2350f8212 --- /dev/null +++ b/tilework-packages/opus/.gitignore @@ -0,0 +1,9 @@ +/node_modules +/dist + +# misc +.DS_Store + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/tilework-packages/opus/.vscode/launch.json b/tilework-packages/opus/.vscode/launch.json new file mode 100644 index 0000000000..e62366fe53 --- /dev/null +++ b/tilework-packages/opus/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "configurations": [ + { + "name": "Debug Jest Tests", + "type": "node", + "request": "launch", + "protocol":"auto", + "runtimeArgs": [ + "--inspect-brk", + "${workspaceRoot}/node_modules/.bin/jest", + "--runInBand" + ], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": [ + "/**", + "node_modules/**/*.js" + ], + "port": 9229 + } + ] + } \ No newline at end of file diff --git a/tilework-packages/opus/README.md b/tilework-packages/opus/README.md new file mode 100644 index 0000000000..f833868691 --- /dev/null +++ b/tilework-packages/opus/README.md @@ -0,0 +1,172 @@ +

+ + Opus +

+ + +*Opus*, the Latin for ‘work’, is the way in which the pieces of a tilework are cut and placed. + +## Why + +

+ + Make your requests extensible +

+ +The GraphQL requests generated by this library are easily extensible by [the plugin system](https://github.com/tilework/mosaic), because they are generated procedurally, as opposed to the commonly-used generation from strings. + + +

+ + Stay lightweight +

+ +This library is TINY and still provides all of the basic functionality of GraphQL interactions. Additional features are planned to get implemented on-demand. + +

+ + Definitely typed +

+ +Generate GraphQL requests with Builder pattern and receive properly structurally typed responses upon fetching! + +![Hnet com-image](https://user-images.githubusercontent.com/46347627/113285078-304d1b80-92f3-11eb-91f4-c7a491a39996.gif) + +## What + +

+ + Building fields +

+ +Almost every aspect of GraphQL functionality is supported: fields, nested fields, inline fragments, arguments. +The only thing not yet supported are non-inline Fragments. Although, apart from slightly increased request size, this will not impact your development experience in any way. + +```js +import { Query, Field, InlineFragment } from '@tilework/opus'; + +const dragonFields = ['name', 'neck_length', 'age'] as const; + +const dragonsQuery = new Query('dragons', true) // `true` means 'expect array' + .addArgument('limit', 'Int', 5) + .addFieldList(dragonFields) + .addField(new Field('children', true) + .addFieldList(dragonFields) + ) + .addField(new InlineFragment('Fire') + .addField('fire_temperature') + ) + .addField(new InlineFragment('Ice') + .addField('ice_density') + ) +``` + +

+ + Getting data type from a field +

+ +Sometimes it is necessary to explicitly reference the type, which the fetched data will have upon retrieval. A utility type is provided in order to make this possible! + +```js +import { Query } from '@tilework/opus'; +import type { DataType } from '@tilework/opus'; + +const query = new Query('person', true) + .addFieldList(['name', 'surname']); + +let result: DataType; + +result = await client.post(query); +``` + +

+ + Calculated fields +

+ +An opportunity to derive additional data from the fetched information is provided with calculated fields. A calculated field can be added on any instance of `Field`, `Query` or `Mutation`. + +Such fields get calculated once, when the request is post-processed upon fetching. They are calculated starting with the deepest child and going up to the root node (post-visit). + +```js +import { Query, Field } from '@tilework/opus'; + +const query = new Query('dragons', true) + .addField('active') + .addField(new Field('launch_payload_mass') + .addField('kg') + .addCalculatedField('lb', (result) => result.kg * ONE_KG_IN_LBS) + ) + .addField(new Field('return_payload_mass') + .addField('kg') + ) + .addCalculatedField('payload_delta_kg', (result) => { + return result.launch_payload_mass.kg - result.return_payload_mass.kg; + }); +``` + +

+ + Client-side transformations +

+ +> **Note:** Attempts to add fields to the result via this API will throw due to the processable object being sealed at the time of processing. Use calculated fields to add additional fields. + +Sometimes it's necessary to modify the data you have received, e.g. in order to reduce nesting of some fields. In order to achieve that, this functionality should be used! + +In the example below, the property `launch_payload_mass` becomes `launch_payload_mass.kg`, just to make everything a bit more convenient. + +```js +import { Query, Field } from '@tilework/opus'; + +const query = new Query('dragons', true) + .addField('active') + .addField(new Field('launch_payload_mass') + .addField('kg') + .addTransformation((launchPayload) => launchPayload.kg) + ) + .addField(new Field('return_payload_mass') + .addField('kg') + .addTransformation((returnPayload) => returnPayload.kg) + ); + +... + +typeof result.dragons[0].launch_payload_mass; // number +``` + +

+ + Fetching some requests! +

+ +The `client` provides an opportunity to fetch queries and mutations, as well as fetch combined queries and combined mutations. + +```js +import { client, CombinedField } from '@tilework/opus'; + +// Single requests +const queryResult = await client.post(someQuery); +const mutationResult = await client.post(someMutation); + +// Combined queries and mutations work the same +const combinedQueryResult = await client.post(new CombinedField + .add(firstQuery) + .add(secondQuery) +); +``` + +

+ + Configuring the client +

+ +It is necessary to set up the client before fetching any data. See the required configuration steps below. + +- Endpoint + - `client.setEndpoint(endpoint: string)` allows to configure this in runtime + - Setting `GRAPHQL_ENDPOINT` in `process.env` will also set the endpoint + - It defaults to `/graphql` +- Headers + - `client.setHeaders(headers: any)` will set the headers to use for fetching requests \ No newline at end of file diff --git a/tilework-packages/opus/jest.config.js b/tilework-packages/opus/jest.config.js new file mode 100644 index 0000000000..1ab566adb9 --- /dev/null +++ b/tilework-packages/opus/jest.config.js @@ -0,0 +1,5 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + modulePathIgnorePatterns: ['dist'] +}; \ No newline at end of file diff --git a/tilework-packages/opus/package.json b/tilework-packages/opus/package.json new file mode 100644 index 0000000000..21dfe11e83 --- /dev/null +++ b/tilework-packages/opus/package.json @@ -0,0 +1,41 @@ +{ + "name": "@tilework/opus", + "repository": { + "type": "git", + "url": "https://github.com/tilework/opus" + }, + "version": "0.0.10", + "license": "MIT", + "files": [ + "dist/**/*" + ], + "main": "dist/opus.js", + "typings": "dist/opus.d.ts", + "scripts": { + "build": "rm -rf dist && rollup -c", + "prepublishOnly": "npm run build && npm run test", + "test": "jest" + }, + "dependencies": { + "node-fetch": "^2.6.2", + "tslib": "^2.2.0" + }, + "devDependencies": { + "@babel/core": "^7.13.15", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "@types/jest": "^26.0.22", + "@types/node": "^14.14.37", + "@types/node-fetch": "2.5.12", + "jest": "^26.6.3", + "rollup": "^2.45.2", + "rollup-plugin-dts": "^3.0.1", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-typescript2": "^0.30.0", + "ts-jest": "^26.5.4", + "typescript": "^4.2.3" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/tilework-packages/opus/rollup.config.js b/tilework-packages/opus/rollup.config.js new file mode 100644 index 0000000000..01fa2c3b88 --- /dev/null +++ b/tilework-packages/opus/rollup.config.js @@ -0,0 +1,41 @@ +import dts from 'rollup-plugin-dts'; +import { nodeResolve } from "@rollup/plugin-node-resolve"; +import { terser } from "rollup-plugin-terser"; +import babel from "@rollup/plugin-babel"; +import typescript from 'rollup-plugin-typescript2'; + +const pkg = require('./package.json'); + +const bundle = config => ({ + ...config, + input: 'src/index.ts', + external: id => !/^[./]/.test(id) +}); + +export default [ + bundle({ + plugins: [ + nodeResolve(), + babel(), + terser(), + typescript({ + target: "es5" + }), + ], + output: [ + { + file: pkg.main, + format: 'umd', + name: 'Opus', + sourcemap: false + } + ] + }), + bundle({ + plugins: [dts()], + output: { + file: pkg.typings, + format: 'es' + } + }) +]; \ No newline at end of file diff --git a/tilework-packages/opus/src/__tests__/Calculated.test.ts b/tilework-packages/opus/src/__tests__/Calculated.test.ts new file mode 100644 index 0000000000..aa89a77ece --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Calculated.test.ts @@ -0,0 +1,65 @@ +import { client, Field, Query } from '../..'; + +const ONE_KG_IN_LBS = 2.20462; + +client.setEndpoint('https://api.spacex.land/graphql/'); + +describe('calculated fields are working OK', () => { + it('calculates fields', async () => { + const query = new Query('dragons', true) + .addField('active') + .addField(new Field('launch_payload_mass') + .addField('kg') + .addField('lb') + .addCalculatedField('lb_calculated', (result) => result.kg * ONE_KG_IN_LBS)) + .addField(new Field('return_payload_mass') + .addField('kg')) + .addCalculatedField('payload_delta', (result) => result.launch_payload_mass.kg - result.return_payload_mass.kg); + + const result = await client.post(query); + + for (const dragon of result.dragons) { + expect(dragon.payload_delta).toBeDefined(); + expect(dragon.payload_delta).toBeGreaterThan(0); + expect(dragon.payload_delta).toBe(dragon.launch_payload_mass.kg - dragon.return_payload_mass.kg); + + expect(dragon.launch_payload_mass.lb_calculated).toBeDefined(); + expect(dragon.launch_payload_mass.lb_calculated).toBeCloseTo(dragon.launch_payload_mass.lb, 0); + } + }, 3000); + + it('transforms fields', async () => { + const query = new Query('dragons', true) + .addField('active') + .addField(new Field('launch_payload_mass') + .addField('kg') + .addTransformation((launchPayload) => launchPayload.kg)) + .addField(new Field('return_payload_mass') + .addField('kg') + .addTransformation((returnPayload) => returnPayload.kg)); + + const result = await client.post(query); + + for (const dragon of result.dragons) { + expect(typeof dragon.launch_payload_mass).toBe('number'); + expect(typeof dragon.return_payload_mass).toBe('number'); + } + }, 3000); + + it('does not allow adding props through processors', async () => { + const query = new Query('dragons', true) + .addField('active') + .addField(new Field('launch_payload_mass') + .addField('kg') + .addTransformation((launchPayload) => { + // @ts-expect-error + launchPayload.lbs = launchPayload.kg * 2.20462; + + return launchPayload; + })); + + await expect(async () => { + const result = await client.post(query); + }).rejects.toThrowError(TypeError); + }, 3000); +}); diff --git a/tilework-packages/opus/src/__tests__/Client.test.ts b/tilework-packages/opus/src/__tests__/Client.test.ts new file mode 100644 index 0000000000..0009aeeeb8 --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Client.test.ts @@ -0,0 +1,101 @@ +import { + client, + CombinedField, + Field, + InlineFragment, + Mutation, + Query +} from '../../src'; + +client.setEndpoint('https://api.spacex.land/graphql/'); + +const dragonsQuery = new Query('dragons', true) + .addArgument('limit', 'Int', 5) + .addFieldList(['name', 'active']) + .addField(new Field('thrusters', true) + .addField(new Field('thrust') + .addField('kN'))); + +const capsulesQuery = new Query('capsules', true) + .addArgument('limit', 'Int', 5) + .addFieldList(['status', 'id']); + +const combinedQuery = new CombinedField() + .add(dragonsQuery) + .add(capsulesQuery); + +const insertUserMutation = new Mutation('insert_users') + .addArgument('objects', '[users_insert_input!]!', { + name: 'Yegor', + rocket: 'SomeRocket' + }) + .addField('affected_rows') + .addField(new Field('returning', true) + .addFieldList([ + 'id', + 'name', + 'rocket', + // @ts-ignore + new InlineFragment('users').addField('timestamp') + ])); + +describe('data is fetched correctly', () => { + it('is able to fetch queries', async () => { + const result = await client.post(dragonsQuery); + expect(result).toBeDefined(); + + for (const dragon of result.dragons) { + expect(dragon).toHaveProperty('name'); + expect(dragon).toHaveProperty('active'); + expect(dragon.thrusters).toBeInstanceOf(Array); + expect(dragon.thrusters[0].thrust).toBeDefined(); + } + }); + + it('is able to fetch mutations', async () => { + const result = await client.post(insertUserMutation); + expect(result).toBeDefined(); + + expect(result.insert_users.affected_rows).toBeGreaterThan(0); + + expect(result.insert_users.returning).toBeInstanceOf(Array); + expect(result.insert_users.returning[0].name).toBe('Yegor'); + expect(result.insert_users.returning[0].rocket).toBe('SomeRocket'); + }, 15000); + + it('is able to fetch combined queries', async () => { + const result = await client.post(combinedQuery); + expect(result).toBeDefined(); + + expect(result.capsules.length).toBeLessThanOrEqual(5); + for (const capsule of result.capsules) { + expect(capsule).toHaveProperty('status'); + expect(capsule).toHaveProperty('id'); + } + + expect(result.dragons.length).toBeLessThanOrEqual(5); + for (const dragon of result.dragons) { + expect(dragon).toHaveProperty('name'); + expect(dragon).toHaveProperty('active'); + } + }); + + it('ensures data immutability', async () => { + const result = await client.post(dragonsQuery); + + expect(() => { + // @ts-expect-error + result.dragons = 0; + }).toThrow(); + + expect(() => { + // @ts-expect-error + result.dragons[0] = {}; + }).toThrow(); + + expect(() => { + // @ts-expect-error + result.dragons[0].active = !result.dragons[0].active; + }).toThrow(); + }); +}); diff --git a/tilework-packages/opus/src/__tests__/Client2.test.ts b/tilework-packages/opus/src/__tests__/Client2.test.ts new file mode 100644 index 0000000000..3cfe13eff3 --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Client2.test.ts @@ -0,0 +1,66 @@ +import { + client, + Field, + Query, +} from '../../src'; + +/** + * +query { + allStarships { + starships { + name + pilotConnection { + pilots { + name + species { + name + } + } + } + } + } +} + */ + +const allStarshipsQuery = new Query('allStarships') + .addField( + new Field('starships', true) + .addFieldList(['name']) + .addField( + new Field('pilotConnection') + .addField( + new Field('pilots', true) + .addFieldList(['name']) + .addField( + new Field('species') + .addFieldList(['name']) + ) + ) + ) + ); + +// https://graphql.org/swapi-graphql/ +client.setEndpoint('https://swapi-graphql.netlify.app/.netlify/functions/index'); + +describe('data is fetched correctly from sw api', () => { + it('should be able to fetch query with nullable fields', async () => { + const result = await client.post(allStarshipsQuery); + expect(result).toBeDefined(); + + for (const starship of result.allStarships.starships) { + expect(starship).toHaveProperty('name'); + expect(starship.pilotConnection.pilots).toBeInstanceOf(Array); + + starship.pilotConnection.pilots.forEach((pilot) => { + expect(pilot).toHaveProperty('name'); + expect(typeof pilot.species === 'object').toBeTruthy(); + if (pilot.species === null) { + expect(pilot.species).toBeNull(); + } else { + expect(pilot.species).toHaveProperty('name'); + } + }); + } + }); +}); diff --git a/tilework-packages/opus/src/__tests__/CombinedField.test.ts b/tilework-packages/opus/src/__tests__/CombinedField.test.ts new file mode 100644 index 0000000000..0f18208f7b --- /dev/null +++ b/tilework-packages/opus/src/__tests__/CombinedField.test.ts @@ -0,0 +1,36 @@ +import { CombinedField, Mutation, Query } from '../..'; + +describe('combined fields are built', () => { + it('builds combined queries', () => { + const firstQuery = new Query('first').addField('one'); + const secondQuery = new Query('second').addField('two'); + + const combinedField = new CombinedField() + .add(firstQuery) + .add(secondQuery); + + expect(combinedField.getFields()).toHaveLength(2); + }); + + it('builds combined mutations', () => { + const firstMutation = new Mutation('first').addField('one'); + const secondMutation = new Mutation('second').addField('two'); + + const combinedField = new CombinedField() + .add(firstMutation) + .add(secondMutation); + + expect(combinedField.getFields()).toHaveLength(2); + }); + + it('throws on mixed combinations', () => { + const mutation = new Mutation('mut').addField('one'); + const query = new Query('que').addField('two'); + + expect(() => { + const combinedField = new CombinedField() + .add(mutation) + .add(query); + }).toThrow(); + }); +}); diff --git a/tilework-packages/opus/src/__tests__/DataType.test.ts b/tilework-packages/opus/src/__tests__/DataType.test.ts new file mode 100644 index 0000000000..6c44f340cb --- /dev/null +++ b/tilework-packages/opus/src/__tests__/DataType.test.ts @@ -0,0 +1,80 @@ +import { + CombinedField, DataType, Field, Mutation, Query +} from '../..'; + +const query = new Query('person') + .addField('name') + .addField('surname') + .addField(new Field('mother') + .addField('name') + .addField('surname')); + +const anotherQuery = new Query('car') + .addField('maxSpeed') + .addField('brand'); + +const mutation = new Mutation('someMutation') + .addField('some') + .addField('other'); + +const combinedRequest = new CombinedField() + .add(query) + .add(anotherQuery); + +const fieldRequest = new Field('currencyData') + .addField( + new Field('available_currencies_data') + .addFieldList([ + 'id', + 'label', + 'value' + ]) + ) + .addField('current_currency_code'); + +describe('type is properly extracted', () => { + it('extracts type from query', () => { + const returned: DataType = {} as any; + + try { + returned.person; + returned.person.name; + returned.person.mother; + returned.person.mother.name; + } catch {} + }); + + it('extracts type from a mutation', () => { + const returned: DataType = {} as any; + + try { + returned.someMutation; + returned.someMutation.some; + returned.someMutation.other; + } catch {} + }); + + it('extracts type from a combined request', () => { + const returned: DataType = {} as any; + + try { + returned.car; + returned.car.brand; + returned.person; + returned.person.name; + } catch {} + }); + + it('extracts type from a field request', () => { + const returned: DataType = {} as any; + + try { + returned.currencyData; + returned.currencyData.available_currencies_data; + returned.currencyData.available_currencies_data.id; + returned.currencyData.available_currencies_data.label; + returned.currencyData.available_currencies_data.value; + returned.currencyData.current_currency_code; + } catch {} + }); +}); diff --git a/tilework-packages/opus/src/__tests__/Field.test.ts b/tilework-packages/opus/src/__tests__/Field.test.ts new file mode 100644 index 0000000000..3d5f444dc0 --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Field.test.ts @@ -0,0 +1,70 @@ +import { Field, InlineFragment } from '../..'; + +describe('field is built', () => { + it('adds array fields', () => { + const field = new Field('person') + .addField('friends', true); + + field.resultTypeHolder.friends; + }); + + it('adds non-array fields', () => { + const field = new Field('person') + .addField('a', false) + .addField('b'); + + field.resultTypeHolder.a; + field.resultTypeHolder.b; + }); + + it('adds child fields one by one', () => { + const field = new Field('some') + .addField('one') + .addField('two'); + + field.resultTypeHolder.two; + + expect(field.children).toHaveLength(2); + expect(field).toBeInstanceOf(Field); + }); + + it('adds childs fields as lists', () => { + const field = new Field('some') + .addFieldList([ + 'one', + 'two' + ]); + + field.resultTypeHolder.two; + + expect(field.children).toHaveLength(2); + expect(field).toBeInstanceOf(Field); + }); + + it('adds nested fields', () => { + const field = new Field('parent') + .addField(new Field('child') + .addField('age')); + + expect(field.children[0].children[0].name).toBe('age'); + expect(field).toBeInstanceOf(Field); + }); + + it('adds inline fragments', () => { + const field = new Field('some') + .addField(new InlineFragment('optional') + .addField('thing')); + + field.resultTypeHolder; + + expect(field.children[0]).toBeInstanceOf(InlineFragment); + expect(field.children[0].children[0].name).toBe('thing'); + expect(field).toBeInstanceOf(Field); + }); + + it('adds a transformer to the field', () => { + const field = new Field('some') + .addField('thing') + .addTransformation((some) => 123 as const); + }); +}); diff --git a/tilework-packages/opus/src/__tests__/InlineFragment.test.ts b/tilework-packages/opus/src/__tests__/InlineFragment.test.ts new file mode 100644 index 0000000000..32ef6f56de --- /dev/null +++ b/tilework-packages/opus/src/__tests__/InlineFragment.test.ts @@ -0,0 +1,11 @@ +import { InlineFragment } from '../..'; + +describe('inline fragment is built', () => { + it('builds inline fragments', () => { + const inlineFragment = new InlineFragment('optional') + .addField('firstThing') + .addField('secondThing'); + + expect(inlineFragment.children).toHaveLength(2); + }); +}); diff --git a/tilework-packages/opus/src/__tests__/Mutation.test.ts b/tilework-packages/opus/src/__tests__/Mutation.test.ts new file mode 100644 index 0000000000..7c96d7c185 --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Mutation.test.ts @@ -0,0 +1,12 @@ +import { Mutation } from '../..'; + +describe('mutations are built', () => { + it('builds a mutation', () => { + const mutation = new Mutation('someMutation') + .addField('some') + .addField('other'); + + expect(mutation.children).toHaveLength(2); + expect(mutation).toBeInstanceOf(Mutation); + }); +}); diff --git a/tilework-packages/opus/src/__tests__/Query.test.ts b/tilework-packages/opus/src/__tests__/Query.test.ts new file mode 100644 index 0000000000..8ba7031530 --- /dev/null +++ b/tilework-packages/opus/src/__tests__/Query.test.ts @@ -0,0 +1,12 @@ +import { Query } from '../..'; + +describe('queries are built', () => { + it('builds a query', () => { + const query = new Query('someQuery') + .addField('some') + .addField('other'); + + expect(query.children).toHaveLength(2); + expect(query).toBeInstanceOf(Query); + }); +}); diff --git a/tilework-packages/opus/src/builder/AbstractField.ts b/tilework-packages/opus/src/builder/AbstractField.ts new file mode 100644 index 0000000000..e96ce2d2e9 --- /dev/null +++ b/tilework-packages/opus/src/builder/AbstractField.ts @@ -0,0 +1,211 @@ +/* eslint-disable no-dupe-class-members */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-use-before-define */ +import type { FieldDescendantStore, HigherKindType } from './hkt'; +import type { InlineFragment } from './InlineFragment'; + +// Importing InlineFragment as class here causes severe circular dependency issues +// Prefer importing as type and using this helper function +const isInlineFragment = (thing: any): thing is InlineFragment => { + if (typeof thing !== 'object' || !thing.tag) { + return false; + } + + if (thing.tag === 'InlineFragment') { + return true; + } + + return false; +}; + +export interface Argument { + name: string; + type: string; + value: string; +} + +// Workaround. Should be improved when partial type inference is supported by TS. +export type FetchedFieldItemType = any; // string | number | null; + +export abstract class AbstractField< + Name extends string, + FieldReturnType, + ArrayExpected extends boolean +> { + /** + * Type of name is changeable by setting an alias onto it. + * The actual value of name is immutable. + */ + readonly name: Name; + + readonly isArray?: ArrayExpected; + + readonly tag: keyof FieldDescendantStore = 'AbstractField'; + + alias = ''; + + children: Array | Field> = []; + + args: Argument[] = []; + + resultTypeHolder: FieldReturnType = {} as FieldReturnType; + + calculators: Record any> = {}; + + transformer?: (result: FieldReturnType) => any; + + constructor( + name: Name, + isArray?: ArrayExpected + ) { + this.name = name; + this.isArray = isArray; + } + + /** + * This function will change type of the Field + * such way that it'll seem that the name has changed. + * The name is immutable and therefore will not actually get changed. + * This illusion is implemented so that you have proper typings for the queries' return values + */ + setAlias(alias: Alias): HigherKindType< + this['tag'], + Alias, + FieldReturnType, + ArrayExpected + > { + this.alias = `${alias}:`; + + return this as any; + } + + addArgument(name: ArgName, type: string, value: any): HigherKindType< + this['tag'], + ArgName, + FieldReturnType, + ArrayExpected + > { + if (value === undefined) { + return this as any; + } + + this.args.push({ name, type, value }); + + return this as any; + } + + addCalculatedField< + NewFieldName extends string, + NewFieldType extends any + >( + field: NewFieldName, + calculator: (result: FieldReturnType) => NewFieldType + ): HigherKindType< + this['tag'], + Name, + FieldReturnType & { [k in NewFieldName]: NewFieldType }, + ArrayExpected + > { + this.calculators[field] = calculator; + + return this as any; + } + + addTransformation(transformer: (result: FieldReturnType) => RT): HigherKindType< + this['tag'], + Name, + RT, + ArrayExpected + > { + this.transformer = transformer; + + return this as any; + } + + // ! DO NOT REORDER THESE OVERLOADS + // ! IT WILL MAKE ME MIX UP INLINE FRAGMENTS WITH FIELDS + // ERROR + addField(arg: never): never; + + // STRING + addField< + NewFieldName extends string, + IsArray extends boolean = false + >( + field: NewFieldName, + isArray?: IsArray + ): HigherKindType< + this['tag'], + Name, + FieldReturnType & { + [k in NewFieldName]: IsArray extends true + ? FetchedFieldItemType[] + : FetchedFieldItemType + }, + ArrayExpected + > + + // INLINE FRAGMENT + addField>( + field: NewField + ): HigherKindType< + this['tag'], + Name, + FieldReturnType & Partial + >; + + // FIELD + addField< + F extends Field + >( + field: F + ): HigherKindType< + this['tag'], + Name, + FieldReturnType & { + [k in F['name']]: F extends Field + ? F['resultTypeHolder'][] + : F['resultTypeHolder'] + }, + ArrayExpected + >; + // ! + + addField(field: unknown): unknown { + if (typeof field === 'string') { + this.children.push(new Field(field)); + } else if (field instanceof Field || isInlineFragment(field)) { + this.children.push(field); + } else { + throw new Error('Unknown field type!'); + } + + return this; + } + + addFieldList< + NewField extends string + >( + fieldList: readonly (NewField | Field)[] + ): HigherKindType< + this['tag'], + Name, + FieldReturnType & { [K in NewField]: FetchedFieldItemType }, + ArrayExpected + > { + fieldList.forEach(this.addField.bind(this)); + + return this as any; + } +} + +// Declaring Field here to prevent circular dependency issues + +export class Field< + Name extends string, + FieldReturnType, + IsArray extends boolean = false +> extends AbstractField { + readonly tag = 'Field'; +} diff --git a/tilework-packages/opus/src/builder/CombinedField.ts b/tilework-packages/opus/src/builder/CombinedField.ts new file mode 100644 index 0000000000..4088d6f54d --- /dev/null +++ b/tilework-packages/opus/src/builder/CombinedField.ts @@ -0,0 +1,31 @@ +import { GraphQlRequestType } from '../client/prepare-document'; +import { AbstractField } from './AbstractField'; +import { Mutation } from './Mutation'; +import { Query } from './Query'; + +export class CombinedField { + type?: GraphQlRequestType; + + resultTypeHolder?: ReturnType; + + protected fields: AbstractField[] = []; + + add( + field: Query | Mutation + ): CombinedField { + // Handle first field + if (!this.type) { + this.type = field.type; + + // Handle attempt to combine queries together with mutations + } else if (this.type !== field.type) { + throw new Error('Cannot combine queries and mutations together!'); + } + + this.fields.push(field); + + return this as any; + } + + getFields = () => this.fields; +} diff --git a/tilework-packages/opus/src/builder/InlineFragment.ts b/tilework-packages/opus/src/builder/InlineFragment.ts new file mode 100644 index 0000000000..39901ee160 --- /dev/null +++ b/tilework-packages/opus/src/builder/InlineFragment.ts @@ -0,0 +1,12 @@ +import { AbstractField } from './AbstractField'; + +export class InlineFragment< + N extends string, + RT +> extends AbstractField { + readonly tag = 'InlineFragment'; + + constructor(name: N) { + super(`... on ${name}` as N); + } +} diff --git a/tilework-packages/opus/src/builder/Mutation.ts b/tilework-packages/opus/src/builder/Mutation.ts new file mode 100644 index 0000000000..c3a0c53e0b --- /dev/null +++ b/tilework-packages/opus/src/builder/Mutation.ts @@ -0,0 +1,13 @@ +import { GraphQlRequestType } from '../client/prepare-document'; +import { AbstractField } from './AbstractField'; +import { IRequestable } from './interface/IRequestable'; + +export class Mutation< + Name extends string, + FieldReturnType, + IsArray extends boolean = false +> extends AbstractField implements IRequestable { + readonly tag = 'Mutation'; + + readonly type = GraphQlRequestType.Mutation; +} diff --git a/tilework-packages/opus/src/builder/Query.ts b/tilework-packages/opus/src/builder/Query.ts new file mode 100644 index 0000000000..6a0e7d8a5f --- /dev/null +++ b/tilework-packages/opus/src/builder/Query.ts @@ -0,0 +1,13 @@ +import { GraphQlRequestType } from '../client/prepare-document'; +import { AbstractField } from './AbstractField'; +import { IRequestable } from './interface/IRequestable'; + +export class Query< + Name extends string, + FieldReturnType, + IsArray extends boolean = false +> extends AbstractField implements IRequestable { + readonly tag = 'Query'; + + readonly type = GraphQlRequestType.Query; +} diff --git a/tilework-packages/opus/src/builder/hkt.ts b/tilework-packages/opus/src/builder/hkt.ts new file mode 100644 index 0000000000..918bfb33c6 --- /dev/null +++ b/tilework-packages/opus/src/builder/hkt.ts @@ -0,0 +1,23 @@ +import type { AbstractField, Field } from './AbstractField'; +import type { InlineFragment } from './InlineFragment'; +import type { Mutation } from './Mutation'; +import type { Query } from './Query'; + +export interface FieldDescendantStore< + N extends string, + RT, + A extends boolean +> { + Query: Query, + Mutation: Mutation, + Field: Field, + AbstractField: AbstractField, + InlineFragment: InlineFragment +} + +export type HigherKindType< + $ extends keyof FieldDescendantStore, + N extends string, + RT, + A extends boolean = false +> = FieldDescendantStore[$] diff --git a/tilework-packages/opus/src/builder/index.ts b/tilework-packages/opus/src/builder/index.ts new file mode 100644 index 0000000000..76999458fb --- /dev/null +++ b/tilework-packages/opus/src/builder/index.ts @@ -0,0 +1,7 @@ +export * from './AbstractField'; +export * from './CombinedField'; +export * from './InlineFragment'; +export * from './Mutation'; +export * from './Query'; +export * from './hkt'; +export * from './interface'; diff --git a/tilework-packages/opus/src/builder/interface/IRequestable.ts b/tilework-packages/opus/src/builder/interface/IRequestable.ts new file mode 100644 index 0000000000..c76ca48d65 --- /dev/null +++ b/tilework-packages/opus/src/builder/interface/IRequestable.ts @@ -0,0 +1,5 @@ +import { GraphQlRequestType } from '../../client/prepare-document'; + +export interface IRequestable { + readonly type: GraphQlRequestType +} diff --git a/tilework-packages/opus/src/builder/interface/index.ts b/tilework-packages/opus/src/builder/interface/index.ts new file mode 100644 index 0000000000..420033de0f --- /dev/null +++ b/tilework-packages/opus/src/builder/interface/index.ts @@ -0,0 +1 @@ +export * from './IRequestable'; diff --git a/tilework-packages/opus/src/client/client.ts b/tilework-packages/opus/src/client/client.ts new file mode 100644 index 0000000000..9f56b2b5f3 --- /dev/null +++ b/tilework-packages/opus/src/client/client.ts @@ -0,0 +1,132 @@ +import { AbstractField } from '../builder/AbstractField'; +import { CombinedField } from '../builder/CombinedField'; +import { Mutation } from '../builder/Mutation'; +import { Query } from '../builder/Query'; +import { DataType } from '../util/data-type'; +import { deepApply } from '../util/deep-apply'; +import { parseResponse } from './parse-response'; +import { executePost } from './post'; +import { prepareRequest } from './prepare-document'; + +export interface GraphQlResponse { + errors: string | Error | Error[], + data: unknown +} + +export type Middleware = (response: GraphQlResponse) => unknown; + +export type RequestOptions = { + endpoint: string, + headers?: Record +} & Omit; + +export const defaultOptions: RequestOptions = { + endpoint: process.env.GRAPHQL_ENDPOINT || '/graphql' +}; + +export class Client { + protected options: RequestOptions = defaultOptions; + + setEndpoint = (endpoint: string): void => { + this.options.endpoint = endpoint; + }; + + setHeaders = (headers: Record): void => { + this.options.headers = headers; + }; + + getOptions = (): RequestOptions => this.options; + + async post( + rawField: Query | Mutation, + overrideOptions?: Partial + ): Promise>; + + async post( + rawField: CombinedField, + overrideOptions?: Partial + ): Promise>; + + async post( + rawField: any, + overrideOptions?: Partial + ) { + const fieldArray = rawField instanceof CombinedField ? rawField.getFields() : [rawField]; + + if (!fieldArray.length) { + throw new Error('Attempting to post empty field!'); + } + + const response = await executePost( + prepareRequest(fieldArray, rawField.type!), + // TODO deep merge + { + ...this.options, + ...(overrideOptions || {}) + } + ); + + const parsedResponse = parseResponse(await response.json()); + + if (rawField instanceof CombinedField) { + for (const field of rawField.getFields()) { + await this.process(field, parsedResponse[field.name], parsedResponse); + } + } else { + await this.process(rawField, parsedResponse[rawField.name], parsedResponse); + } + + deepApply(Object.freeze, parsedResponse); + + return parsedResponse; + } + + /** + * Handles calculating and transforming fields on result + */ + protected async process(field: AbstractField, result: any, parentResult: any) { + // Prevent calculating for non-object fields from the result + if (!field.children.length) { + return; + } + + // If array - process each separately + if (Array.isArray(result)) { + for (const item of result) { + await this.process(field, item, parentResult); + } + } else { + // If has children - process children first + for (const child of field.children) { + if (child.tag === 'InlineFragment') { + for (const fragmentChild of child.children) { + if (result === null || !Object.hasOwnProperty.call(result, fragmentChild.name)) { + continue; + } + + await this.process(fragmentChild, result[fragmentChild.name], result); + } + } else { + if (result === null || !Object.hasOwnProperty.call(result, child.name)) { + continue; + } + await this.process(child, result[child.name], result); + } + } + + // POSTVISIT - calculate the actual fields + for (const [fieldName, calculator] of Object.entries(field.calculators)) { + result[fieldName] = await calculator(result); + } + + // Prevent adding new properties from now on + deepApply(Object.seal, result); + + if (field.transformer) { + parentResult[field.name] = await field.transformer(result); + } + + // TODO in dev mode we can compare own props to prevent extending in improper ways + } + } +} diff --git a/tilework-packages/opus/src/client/index.ts b/tilework-packages/opus/src/client/index.ts new file mode 100644 index 0000000000..e9f3078dcc --- /dev/null +++ b/tilework-packages/opus/src/client/index.ts @@ -0,0 +1,4 @@ +export * from './client'; +export * from './parse-response'; +export * from './post'; +export * from './prepare-document'; diff --git a/tilework-packages/opus/src/client/parse-response.ts b/tilework-packages/opus/src/client/parse-response.ts new file mode 100644 index 0000000000..32d201de21 --- /dev/null +++ b/tilework-packages/opus/src/client/parse-response.ts @@ -0,0 +1,40 @@ +import { GraphQlResponse } from '.'; + +export const checkForErrors = (res: GraphQlResponse): unknown | never => { + const { errors, data } = res; + + if (errors) { + throw errors; + } + + return data; +}; + +interface IError { + message: string +} + +export const parseError = (error: string | IError | IError[]): string => { + if (typeof error === 'string') { + return error; + } + + if (Array.isArray(error)) { + return error[0].message; + } + + if (error.message) { + return error.message; + } + + return 'Something went wrong'; +}; + +export const parseResponse = (response: GraphQlResponse): any => { + try { + return checkForErrors(response); + } catch (e) { + // throw new, formatted error instead + throw new Error(parseError(e as Error)); + } +}; diff --git a/tilework-packages/opus/src/client/post.ts b/tilework-packages/opus/src/client/post.ts new file mode 100644 index 0000000000..aa5a0e0f4f --- /dev/null +++ b/tilework-packages/opus/src/client/post.ts @@ -0,0 +1,41 @@ +import { RequestOptions } from '.'; +import { GraphQLDocument } from './prepare-document'; + +const envAgnosticFetch: typeof window.fetch = typeof window === 'undefined' + ? require('node-fetch') + : window.fetch; + +export const processHeaders = (headers: any, options: RequestOptions): any => { + const { headers: additionalHeaders = {} } = options; + + return { + ...headers, + ...additionalHeaders + }; +}; + +export const postFetch = ( + query: string, + variables: GraphQLDocument['variables'], + options: RequestOptions +): Promise => envAgnosticFetch( + options.endpoint, + { + ...options, + method: 'POST', + body: JSON.stringify({ query, variables }), + headers: processHeaders({ + 'Content-Type': 'application/json', + Accept: 'application/json' + }, options) + } +); + +export const executePost = ( + queryObject: GraphQLDocument, + options: RequestOptions +) => { + const { query, variables } = queryObject; + + return postFetch(query, variables, options); +}; diff --git a/tilework-packages/opus/src/client/prepare-document.ts b/tilework-packages/opus/src/client/prepare-document.ts new file mode 100644 index 0000000000..c8d9f4d987 --- /dev/null +++ b/tilework-packages/opus/src/client/prepare-document.ts @@ -0,0 +1,84 @@ +import { AbstractField, Argument } from '../builder/AbstractField'; + +export enum GraphQlRequestType { + Mutation = 'mutation', + Query = 'query' +} +interface AccArgs { + [name: string]: Array<[string, string]> +} + +export interface GraphQLDocument { + query: string, + variables: {[name: string]: string} +} + +export const prepareFieldString = ( + rootField: AbstractField, + accArgs: AccArgs = {} +): string => { + const { + alias, name, args, children + } = rootField; + + const resolvedArgs = args.reduce((acc: Array, arg: Argument) => { + const { name, type, value } = arg; + + if (!accArgs[name]) { + accArgs[name] = []; + } + + // add type and value of the argument into argument accumulator, + // we will need this value when building the query doc and variables + const index = accArgs[name].push([type, value]); + + // join each argument as "name:$var_1" + return [...acc, `${name}:$${name}_${index}`]; + }, []); + + // join arguments, wrap into "()" and join with "," + const formattedArgs = resolvedArgs.length ? `(${resolvedArgs.join(',')})` : ''; + + // join child fields with "," + const formattedChildren = children.map((field) => prepareFieldString(field, accArgs)).join(','); + + // wrap body with "{}" + const body = children.length ? `{${formattedChildren}}` : ''; + + // format like "alias:name(arg: $var){field1,field2}" + return `${alias}${name}${formattedArgs}${body}`; +}; + +export const prepareRequest = ( + fields: AbstractField | AbstractField[], + type: GraphQlRequestType +): GraphQLDocument => { + const fieldsArray = Array.isArray(fields) ? fields : [fields]; + + const variables: {[name: string]: string} = {}; + const accArgs: AccArgs = {}; + + // prepare fields from each field passed + const fieldStrings = fieldsArray.map((field) => prepareFieldString(field, accArgs)).join(','); + + // go through argument accumulator collected in "prepareFieldString", join values + // into the format "$var:Type" and append variable value to variables field + const resolvedArgs = Object.entries(accArgs).reduce((acc: Array, [name, dataArray]) => { + dataArray.forEach(([type, value], i) => { + const variable = `${name}_${i + 1}`; + acc.push(`$${variable}:${type}`); + variables[variable] = value; + }); + + return acc; + }, []); + + // Wrap arguments with "()" and join using "," + const formattedArgs = resolvedArgs.length ? `(${resolvedArgs.join(',')})` : ''; + + return { + // format like "query($var_1:String){test(arg: $var_1){id}}" + query: `${type}${formattedArgs}{${fieldStrings}}`, + variables + }; +}; diff --git a/tilework-packages/opus/src/index.ts b/tilework-packages/opus/src/index.ts new file mode 100644 index 0000000000..02b9bdd6b9 --- /dev/null +++ b/tilework-packages/opus/src/index.ts @@ -0,0 +1,6 @@ +import { Client } from './client'; + +export * from './builder'; +export * from './client'; +export * from './util'; +export const client = new Client(); diff --git a/tilework-packages/opus/src/util/data-type.ts b/tilework-packages/opus/src/util/data-type.ts new file mode 100644 index 0000000000..04a2223657 --- /dev/null +++ b/tilework-packages/opus/src/util/data-type.ts @@ -0,0 +1,11 @@ +import { AbstractField } from '../builder/AbstractField'; +import { CombinedField } from '../builder/CombinedField'; +import { DeepReadonly } from './deep-readonly'; + +export type DataType< + T extends AbstractField | CombinedField +> = T extends AbstractField + ? DeepReadonly<{[k in N]: A extends true ? RT[] : RT}> + : T extends CombinedField + ? DeepReadonly + : never; diff --git a/tilework-packages/opus/src/util/deep-apply.ts b/tilework-packages/opus/src/util/deep-apply.ts new file mode 100644 index 0000000000..7bfe0a33f3 --- /dev/null +++ b/tilework-packages/opus/src/util/deep-apply.ts @@ -0,0 +1,11 @@ +export const deepApply = (fn: (obj: any) => any, obj: any): void => { + if (typeof obj !== 'object') { + return; + } + + fn(obj); + + for (const key in obj) { + deepApply(fn, obj[key]); + } +}; diff --git a/tilework-packages/opus/src/util/deep-readonly.ts b/tilework-packages/opus/src/util/deep-readonly.ts new file mode 100644 index 0000000000..78f38f754d --- /dev/null +++ b/tilework-packages/opus/src/util/deep-readonly.ts @@ -0,0 +1,11 @@ +export type DeepReadonlyArray = ReadonlyArray> + +export type DeepReadonlyObject = { + readonly [P in keyof T]: DeepReadonly; +}; + +export type DeepReadonly = + T extends (infer R)[] ? DeepReadonlyArray : + T extends Function ? T : + T extends object ? DeepReadonlyObject : + T; diff --git a/tilework-packages/opus/src/util/index.ts b/tilework-packages/opus/src/util/index.ts new file mode 100644 index 0000000000..b2c9124b0f --- /dev/null +++ b/tilework-packages/opus/src/util/index.ts @@ -0,0 +1,3 @@ +export * from './data-type'; +export * from './deep-apply'; +export * from './deep-readonly'; diff --git a/tilework-packages/opus/tsconfig.json b/tilework-packages/opus/tsconfig.json new file mode 100644 index 0000000000..3e49573181 --- /dev/null +++ b/tilework-packages/opus/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "esnext", + "moduleResolution": "Node", + "lib": [ + "esnext", + "dom", + "dom.iterable" + ], + "checkJs": true, + "declaration": true, + "outDir": "./dist", + "rootDir": "./src", + "removeComments": false, + "isolatedModules": true, + + "strict": true, + + /* Module Resolution Options */ + "esModuleInterop": true, + "preserveSymlinks": false, + + /* Experimental Options */ + // "experimentalDecorators": true, + // "emitDecoratorMetadata": true, + + /* Advanced Options */ + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src"], + "exclude": ["**/__tests__/**"] +} diff --git a/yarn.lock b/yarn.lock index ddc6e9df93..2b3dd21e2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@ampproject/remapping@^2.1.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" + integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.0" + "@ampproject/toolbox-core@^2.7.1-alpha.0", "@ampproject/toolbox-core@^2.8.0": version "2.8.0" resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.8.0.tgz#4c291c470fa30c0c2f3c7952dbcd6df2a4ec0df9" @@ -74,17 +81,17 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.5.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.5.5": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: - "@babel/highlight" "^7.14.5" + "@babel/highlight" "^7.16.7" -"@babel/compat-data@^7.12.1", "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== +"@babel/compat-data@^7.12.1", "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.8", "@babel/compat-data@^7.17.0", "@babel/compat-data@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" + integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== "@babel/core@7.12.3": version "7.12.3" @@ -108,85 +115,86 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.7.5", "@babel/core@^7.8.4": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.13.15", "@babel/core@^7.14.0", "@babel/core@^7.16.0", "@babel/core@^7.7.5", "@babel/core@^7.8.4": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" + integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.7" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.8" + "@babel/parser" "^7.17.8" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.1.2" semver "^6.3.0" - source-map "^0.5.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.15.4", "@babel/generator@^7.9.6": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== +"@babel/generator@^7.12.1", "@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.9.6": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" + integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.14.5", "@babel/helper-annotate-as-pure@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz#3d0e43b00c5e49fdb6c57e421601a7a658d5f835" - integrity sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA== +"@babel/helper-annotate-as-pure@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" + integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.7" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz#21ad815f609b84ee0e3058676c33cf6d1670525f" - integrity sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz#38d138561ea207f0f69eb1626a418e4f7e6a580b" + integrity sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA== dependencies: - "@babel/helper-explode-assignable-expression" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-explode-assignable-expression" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helper-compilation-targets@^7.12.1", "@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-compilation-targets@^7.12.1", "@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" + integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + "@babel/compat-data" "^7.17.7" + "@babel/helper-validator-option" "^7.16.7" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz#7f977c17bd12a5fba363cb19bea090394bf37d2e" - integrity sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw== +"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.6": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9" + integrity sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== +"@babel/helper-create-regexp-features-plugin@^7.16.7": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz#1dcc7d40ba0c6b6b25618997c5dbfd310f186fe1" + integrity sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - regexpu-core "^4.7.1" + "@babel/helper-annotate-as-pure" "^7.16.7" + regexpu-core "^5.0.1" -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== +"@babel/helper-define-polyfill-provider@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665" + integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -197,175 +205,190 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz#f9aec9d219f271eaf92b9f561598ca6b2682600c" - integrity sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-function-name@^7.14.5", "@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== - dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== - dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-remap-async-to-generator@^7.13.0", "@babel/helper-remap-async-to-generator@^7.14.5", "@babel/helper-remap-async-to-generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz#2637c0731e4c90fbf58ac58b50b2b5a192fc970f" - integrity sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-wrap-function" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-skip-transparent-expression-wrappers@^7.12.1", "@babel/helper-skip-transparent-expression-wrappers@^7.14.5", "@babel/helper-skip-transparent-expression-wrappers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz#707dbdba1f4ad0fa34f9114fc8197aec7d5da2eb" - integrity sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A== + "@babel/types" "^7.16.7" + +"@babel/helper-explode-assignable-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz#12a6d8522fdd834f194e868af6354e8650242b7a" + integrity sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ== dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + "@babel/types" "^7.16.7" -"@babel/helper-wrap-function@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz#6f754b2446cfaf3d612523e6ab8d79c27c3a3de7" - integrity sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw== +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== dependencies: - "@babel/helper-function-name" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helpers@^7.12.1", "@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.7" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5", "@babel/highlight@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-member-expression-to-functions@^7.16.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz#a34013b57d8542a8c4ff8ba3f747c02452a4d8c4" + integrity sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw== + dependencies: + "@babel/types" "^7.17.0" + +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" + integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.16.7", "@babel/helper-module-transforms@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" + integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" + +"@babel/helper-optimise-call-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" + integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" + integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== + +"@babel/helper-remap-async-to-generator@^7.13.0", "@babel/helper-remap-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz#29ffaade68a367e2ed09c90901986918d25e57e3" + integrity sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-wrap-function" "^7.16.8" + "@babel/types" "^7.16.8" + +"@babel/helper-replace-supers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz#e9f5f5f32ac90429c1a4bdec0f231ef0c2838ab1" + integrity sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-simple-access@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" + integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== + dependencies: + "@babel/types" "^7.17.0" + +"@babel/helper-skip-transparent-expression-wrappers@^7.12.1", "@babel/helper-skip-transparent-expression-wrappers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" + integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + +"@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== + +"@babel/helper-wrap-function@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz#58afda087c4cd235de92f7ceedebca2c41274200" + integrity sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw== + dependencies: + "@babel/helper-function-name" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" + +"@babel/helpers@^7.12.1", "@babel/helpers@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" + integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7", "@babel/highlight@^7.8.3": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.3", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.0", "@babel/parser@^7.9.6": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.3", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8", "@babel/parser@^7.7.0", "@babel/parser@^7.9.6": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" + integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz#dbdeabb1e80f622d9f0b583efb2999605e0a567e" - integrity sha512-eBnpsl9tlhPhpI10kU06JHnrYXwg3+V6CaP2idsCXNef0aeslpqyITXQ74Vfk5uHgY7IG7XP0yIH8b42KSzHog== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz#4eda6d6c2a0aa79c70fa7b6da67763dfe2141050" + integrity sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-proposal-async-generator-functions@^7.12.1", "@babel/plugin-proposal-async-generator-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.4.tgz#f82aabe96c135d2ceaa917feb9f5fca31635277e" - integrity sha512-2zt2g5vTXpMC3OmK6uyjvdXptbhBXfA77XGrd3gh93zwG8lZYBLOBImiGBEG0RANu3JqKEACCz5CGk73OJROBw== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz#cc001234dfc139ac45f6bcf801866198c8c72ff9" + integrity sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.15.4" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.7" + +"@babel/plugin-proposal-async-generator-functions@^7.12.1", "@babel/plugin-proposal-async-generator-functions@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz#3bdd1ebbe620804ea9416706cd67d60787504bc8" + integrity sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-proposal-class-properties@7.12.1": @@ -376,21 +399,21 @@ "@babel/helper-create-class-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== +"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.16.0", "@babel/plugin-proposal-class-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz#925cad7b3b1a2fcea7e59ecc8eb5954f961f91b0" + integrity sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-proposal-class-static-block@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.15.4.tgz#3e7ca6128453c089e8b477a99f970c63fc1cb8d7" - integrity sha512-M682XWrrLNk3chXCjoPUQWOyYsB93B9z3mRyjtqqYJWDf2mfCdIYgDrA11cgNVhAQieaq6F2fn2f3wI0U4aTjA== +"@babel/plugin-proposal-class-static-block@^7.16.7": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz#164e8fd25f0d80fa48c5a4d1438a6629325ad83c" + integrity sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.17.6" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-proposal-decorators@7.12.1": @@ -402,36 +425,47 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-decorators" "^7.12.1" -"@babel/plugin-proposal-dynamic-import@^7.12.1", "@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== +"@babel/plugin-proposal-decorators@^7.16.4": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.17.8.tgz#4f0444e896bee85d35cf714a006fc5418f87ff00" + integrity sha512-U69odN4Umyyx1xO1rTII0IDkAEC+RNlcKXtqOblfpzqy1C+aOplb76BQNq0+XdpVkOaPlpEDwd++joY8FNFJKA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.17.6" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/plugin-syntax-decorators" "^7.17.0" + charcodes "^0.2.0" + +"@babel/plugin-proposal-dynamic-import@^7.12.1", "@babel/plugin-proposal-dynamic-import@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz#c19c897eaa46b27634a00fee9fb7d829158704b2" + integrity sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.12.1", "@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== +"@babel/plugin-proposal-export-namespace-from@^7.12.1", "@babel/plugin-proposal-export-namespace-from@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz#09de09df18445a5786a305681423ae63507a6163" + integrity sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.12.1", "@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== +"@babel/plugin-proposal-json-strings@^7.12.1", "@babel/plugin-proposal-json-strings@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz#9732cb1d17d9a2626a08c5be25186c195b6fa6e8" + integrity sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.12.1", "@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== +"@babel/plugin-proposal-logical-assignment-operators@^7.12.1", "@babel/plugin-proposal-logical-assignment-operators@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz#be23c0ba74deec1922e639832904be0bea73cdea" + integrity sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-proposal-nullish-coalescing-operator@7.12.1": @@ -442,12 +476,12 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1", "@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1", "@babel/plugin-proposal-nullish-coalescing-operator@^7.16.0", "@babel/plugin-proposal-nullish-coalescing-operator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz#141fc20b6857e59459d430c850a0011e36561d99" + integrity sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-proposal-numeric-separator@7.12.1": @@ -458,31 +492,31 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-numeric-separator@^7.12.1", "@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== +"@babel/plugin-proposal-numeric-separator@^7.12.1", "@babel/plugin-proposal-numeric-separator@^7.16.0", "@babel/plugin-proposal-numeric-separator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz#d6b69f4af63fb38b6ca2558442a7fb191236eba9" + integrity sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz#ef68050c8703d07b25af402cb96cf7f34a68ed11" - integrity sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg== +"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.16.7": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz#d9eb649a54628a51701aef7e0ea3d17e2b9dd390" + integrity sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/compat-data" "^7.17.0" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.15.4" + "@babel/plugin-transform-parameters" "^7.16.7" -"@babel/plugin-proposal-optional-catch-binding@^7.12.1", "@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== +"@babel/plugin-proposal-optional-catch-binding@^7.12.1", "@babel/plugin-proposal-optional-catch-binding@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz#c623a430674ffc4ab732fd0a0ae7722b67cb74cf" + integrity sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-proposal-optional-chaining@7.12.1": @@ -494,40 +528,40 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.12.1", "@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== +"@babel/plugin-proposal-optional-chaining@^7.12.1", "@babel/plugin-proposal-optional-chaining@^7.16.0", "@babel/plugin-proposal-optional-chaining@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz#7cd629564724816c0e8a969535551f943c64c39a" + integrity sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.12.1", "@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== +"@babel/plugin-proposal-private-methods@^7.12.1", "@babel/plugin-proposal-private-methods@^7.16.0", "@babel/plugin-proposal-private-methods@^7.16.11": + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz#e8df108288555ff259f4527dbe84813aac3a1c50" + integrity sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.10" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-proposal-private-property-in-object@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.15.4.tgz#55c5e3b4d0261fd44fe637e3f624cfb0f484e3e5" - integrity sha512-X0UTixkLf0PCCffxgu5/1RQyGGbgZuKoI+vXP4iSbJSYwPb7hu06omsFGBvQ9lJEvwgrxHdS8B5nbfcd8GyUNA== +"@babel/plugin-proposal-private-property-in-object@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz#b0b8cef543c2c3d57e59e2c611994861d46a3fce" + integrity sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-create-class-features-plugin" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== +"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.16.7", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz#635d18eb10c6214210ffc5ff4932552de08188a2" + integrity sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-async-generators@^7.8.0", "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -557,12 +591,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-decorators@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.14.5.tgz#eafb9c0cbe09c8afeb964ba3a7bbd63945a72f20" - integrity sha512-c4sZMRWL4GSvP1EXy0woIP7m4jkVcEuG8R1TOZxPBPtp4FSM/kiPZub9UIs/Jrb5ZAOzvTUSGYrWsrSu1JvoPw== +"@babel/plugin-syntax-decorators@^7.12.1", "@babel/plugin-syntax-decorators@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.17.0.tgz#a2be3b2c9fe7d78bd4994e790896bc411e2f166d" + integrity sha512-qWe85yCXsvDEluNP0OyeQjH63DlhAR3W7K9BxxU1MvbDb48tgBG+Ao6IJJ6smPDrrVzSQZrbF6donpkFBMcs3A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" @@ -578,12 +612,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" - integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== +"@babel/plugin-syntax-flow@^7.12.1", "@babel/plugin-syntax-flow@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz#202b147e5892b8452bbb0bb269c7ed2539ab8832" + integrity sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" @@ -599,12 +633,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz#000e2e25d8673cce49300517a3eda44c263e4201" - integrity sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw== +"@babel/plugin-syntax-jsx@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz#50b6571d13f764266a113d77c82b4a6508bbe665" + integrity sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" @@ -662,12 +696,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== +"@babel/plugin-syntax-typescript@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" + integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-arrow-functions@7.13.0": version "7.13.0" @@ -676,12 +710,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-arrow-functions@^7.12.1", "@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== +"@babel/plugin-transform-arrow-functions@^7.12.1", "@babel/plugin-transform-arrow-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz#44125e653d94b98db76369de9c396dc14bef4154" + integrity sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-async-to-generator@7.13.0": version "7.13.0" @@ -692,78 +726,79 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-remap-async-to-generator" "^7.13.0" -"@babel/plugin-transform-async-to-generator@^7.12.1", "@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== - dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" - -"@babel/plugin-transform-block-scoped-functions@^7.12.1", "@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.15.3": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz#94c81a6e2fc230bcce6ef537ac96a1e4d2b3afaf" - integrity sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz#50aee17aaf7f332ae44e3bce4c2e10534d5d3bf1" - integrity sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" +"@babel/plugin-transform-async-to-generator@^7.12.1", "@babel/plugin-transform-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz#b83dff4b970cf41f1b819f8b49cc0cfbaa53a808" + integrity sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg== + dependencies: + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" + +"@babel/plugin-transform-block-scoped-functions@^7.12.1", "@babel/plugin-transform-block-scoped-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz#4d0d57d9632ef6062cdf354bb717102ee042a620" + integrity sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz#f50664ab99ddeaee5bc681b8f3a6ea9d72ab4f87" + integrity sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz#8f4b9562850cd973de3b498f1218796eb181ce00" + integrity sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.12.1", "@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== +"@babel/plugin-transform-computed-properties@^7.12.1", "@babel/plugin-transform-computed-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz#66dee12e46f61d2aae7a73710f591eb3df616470" + integrity sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== +"@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.16.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz#49dc2675a7afa9a5e4c6bdee636061136c3408d1" + integrity sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-dotall-regex@^7.12.1", "@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== +"@babel/plugin-transform-dotall-regex@^7.12.1", "@babel/plugin-transform-dotall-regex@^7.16.7", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz#6b2d67686fab15fb6a7fd4bd895d5982cfc81241" + integrity sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-duplicate-keys@^7.12.1", "@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== +"@babel/plugin-transform-duplicate-keys@^7.12.1", "@babel/plugin-transform-duplicate-keys@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz#2207e9ca8f82a0d36a5a67b6536e7ef8b08823c9" + integrity sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-exponentiation-operator@^7.12.1", "@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== +"@babel/plugin-transform-exponentiation-operator@^7.12.1", "@babel/plugin-transform-exponentiation-operator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz#efa9862ef97e9e9e5f653f6ddc7b665e8536fe9b" + integrity sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-flow-strip-types@7.12.1": version "7.12.1" @@ -773,115 +808,124 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-flow" "^7.12.1" -"@babel/plugin-transform-for-of@^7.12.1", "@babel/plugin-transform-for-of@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz#25c62cce2718cfb29715f416e75d5263fb36a8c2" - integrity sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA== +"@babel/plugin-transform-flow-strip-types@^7.16.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.7.tgz#291fb140c78dabbf87f2427e7c7c332b126964b8" + integrity sha512-mzmCq3cNsDpZZu9FADYYyfZJIOrSONmHcop2XEKPdBNMa4PDC4eEvcOvzZaCNcjKu72v0XQlA5y1g58aLRXdYg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-flow" "^7.16.7" -"@babel/plugin-transform-function-name@^7.12.1", "@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== +"@babel/plugin-transform-for-of@^7.12.1", "@babel/plugin-transform-for-of@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz#649d639d4617dff502a9a158c479b3b556728d8c" + integrity sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg== dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-literals@^7.12.1", "@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== +"@babel/plugin-transform-function-name@^7.12.1", "@babel/plugin-transform-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz#5ab34375c64d61d083d7d2f05c38d90b97ec65cf" + integrity sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-member-expression-literals@^7.12.1", "@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== +"@babel/plugin-transform-literals@^7.12.1", "@babel/plugin-transform-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz#254c9618c5ff749e87cb0c0cef1a0a050c0bdab1" + integrity sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-modules-amd@^7.12.1", "@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== +"@babel/plugin-transform-member-expression-literals@^7.12.1", "@babel/plugin-transform-member-expression-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz#6e5dcf906ef8a098e630149d14c867dd28f92384" + integrity sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-modules-amd@^7.12.1", "@babel/plugin-transform-modules-amd@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz#b28d323016a7daaae8609781d1f8c9da42b13186" + integrity sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g== + dependencies: + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz#8201101240eabb5a76c08ef61b2954f767b6b4c1" - integrity sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA== +"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.16.8": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.7.tgz#d86b217c8e45bb5f2dbc11eefc8eab62cf980d19" + integrity sha512-ITPmR2V7MqioMJyrxUo2onHNC3e+MvfFiFIR0RP21d3PtlVb6sfzoxNKiphSZUOM9hEIdzCcZe83ieX3yoqjUA== dependencies: - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.12.1", "@babel/plugin-transform-modules-systemjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz#b42890c7349a78c827719f1d2d0cd38c7d268132" - integrity sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw== +"@babel/plugin-transform-modules-systemjs@^7.12.1", "@babel/plugin-transform-modules-systemjs@^7.16.7": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz#81fd834024fae14ea78fbe34168b042f38703859" + integrity sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw== dependencies: - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.12.1", "@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== +"@babel/plugin-transform-modules-umd@^7.12.1", "@babel/plugin-transform-modules-umd@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz#23dad479fa585283dbd22215bff12719171e7618" + integrity sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-named-capturing-groups-regex@^7.12.1", "@babel/plugin-transform-named-capturing-groups-regex@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz#c68f5c5d12d2ebaba3762e57c2c4f6347a46e7b2" - integrity sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.12.1", "@babel/plugin-transform-named-capturing-groups-regex@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz#7f860e0e40d844a02c9dcf9d84965e7dfd666252" + integrity sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" -"@babel/plugin-transform-new-target@^7.12.1", "@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== +"@babel/plugin-transform-new-target@^7.12.1", "@babel/plugin-transform-new-target@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz#9967d89a5c243818e0800fdad89db22c5f514244" + integrity sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-object-super@^7.12.1", "@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== +"@babel/plugin-transform-object-super@^7.12.1", "@babel/plugin-transform-object-super@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz#ac359cf8d32cf4354d27a46867999490b6c32a94" + integrity sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" -"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz#5f2285cc3160bf48c8502432716b48504d29ed62" - integrity sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ== +"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz#a1721f55b99b736511cb7e0152f61f17688f331f" + integrity sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-property-literals@^7.12.1", "@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== +"@babel/plugin-transform-property-literals@^7.12.1", "@babel/plugin-transform-property-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz#2dadac85155436f22c696c4827730e0fe1057a55" + integrity sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-react-constant-elements@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.14.5.tgz#41790d856f7c5cec82d2bcf5d0e5064d682522ed" - integrity sha512-NBqLEx1GxllIOXJInJAQbrnwwYJsV3WaMHIcOwD8rhYS0AabTWn7kHdHgPgu5RmHLU0q4DMxhAMu8ue/KampgQ== + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.17.6.tgz#6cc273c2f612a6a50cb657e63ee1303e5e68d10a" + integrity sha512-OBv9VkyyKtsHZiHLoSfCn+h6yU7YKX8nrs32xUmOa1SRSk+t03FosB6fBZ0Yz4BpD1WV7l73Nsad+2Tz7APpqw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-react-display-name@7.12.1": version "7.12.1" @@ -890,66 +934,66 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-react-display-name@^7.12.1", "@babel/plugin-transform-react-display-name@^7.14.5": - version "7.15.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.15.1.tgz#6aaac6099f1fcf6589d35ae6be1b6e10c8c602b9" - integrity sha512-yQZ/i/pUCJAHI/LbtZr413S3VT26qNrEm0M5RRxQJA947/YNYwbZbBaXGDrq6CG5QsZycI1VIP6d7pQaBfP+8Q== +"@babel/plugin-transform-react-display-name@^7.12.1", "@babel/plugin-transform-react-display-name@^7.16.0", "@babel/plugin-transform-react-display-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.7.tgz#7b6d40d232f4c0f550ea348593db3b21e2404340" + integrity sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-react-jsx-development@^7.12.1", "@babel/plugin-transform-react-jsx-development@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.14.5.tgz#1a6c73e2f7ed2c42eebc3d2ad60b0c7494fcb9af" - integrity sha512-rdwG/9jC6QybWxVe2UVOa7q6cnTpw8JRRHOxntG/h6g/guAOe6AhtQHJuJh5FwmnXIT1bdm5vC2/5huV8ZOorQ== +"@babel/plugin-transform-react-jsx-development@^7.12.1", "@babel/plugin-transform-react-jsx-development@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.7.tgz#43a00724a3ed2557ed3f276a01a929e6686ac7b8" + integrity sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A== dependencies: - "@babel/plugin-transform-react-jsx" "^7.14.5" + "@babel/plugin-transform-react-jsx" "^7.16.7" "@babel/plugin-transform-react-jsx-self@^7.12.1": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.14.9.tgz#33041e665453391eb6ee54a2ecf3ba1d46bd30f4" - integrity sha512-Fqqu0f8zv9W+RyOnx29BX/RlEsBRANbOf5xs5oxb2aHP4FKbLXxIaVPUiCti56LAR1IixMH4EyaixhUsKqoBHw== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.16.7.tgz#f432ad0cba14c4a1faf44f0076c69e42a4d4479e" + integrity sha512-oe5VuWs7J9ilH3BCCApGoYjHoSO48vkjX2CbA5bFVhIuO2HKxA3vyF7rleA4o6/4rTDbk6r8hBW7Ul8E+UZrpA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-react-jsx-source@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.14.5.tgz#79f728e60e6dbd31a2b860b0bf6c9765918acf1d" - integrity sha512-1TpSDnD9XR/rQ2tzunBVPThF5poaYT9GqP+of8fAtguYuI/dm2RkrMBDemsxtY0XBzvW7nXjYM0hRyKX9QYj7Q== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.16.7.tgz#1879c3f23629d287cc6186a6c683154509ec70c0" + integrity sha512-rONFiQz9vgbsnaMtQlZCjIRwhJvlrPET8TabIUK2hzlXw9B9s2Ieaxte1SCOOXMbWRHodbKixNf3BLcWVOQ8Bw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.14.5": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz#3314b2163033abac5200a869c4de242cd50a914c" - integrity sha512-30PeETvS+AeD1f58i1OVyoDlVYQhap/K20ZrMjLmmzmC2AYR/G43D4sdJAaDAqCD3MYpSWbmrz3kES158QSLjw== +"@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.16.7": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.17.3.tgz#eac1565da176ccb1a715dae0b4609858808008c1" + integrity sha512-9tjBm4O07f7mzKSIlEmPdiE6ub7kfIe6Cd+w+oQebpATfTQMAgW+YOuWxogbKVTulA+MEO7byMeIUtQ1z+z+ZQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-jsx" "^7.14.5" - "@babel/types" "^7.14.9" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-jsx" "^7.16.7" + "@babel/types" "^7.17.0" -"@babel/plugin-transform-react-pure-annotations@^7.12.1", "@babel/plugin-transform-react-pure-annotations@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.14.5.tgz#18de612b84021e3a9802cbc212c9d9f46d0d11fc" - integrity sha512-3X4HpBJimNxW4rhUy/SONPyNQHp5YRr0HhJdT2OH1BRp0of7u3Dkirc7x9FRJMKMqTBI079VZ1hzv7Ouuz///g== +"@babel/plugin-transform-react-pure-annotations@^7.12.1", "@babel/plugin-transform-react-pure-annotations@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.16.7.tgz#232bfd2f12eb551d6d7d01d13fe3f86b45eb9c67" + integrity sha512-hs71ToC97k3QWxswh2ElzMFABXHvGiJ01IB1TbYQDGeWRKWz/MPUTh5jGExdHvosYKpnJW5Pm3S4+TA3FyX+GA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-regenerator@^7.12.1", "@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== +"@babel/plugin-transform-regenerator@^7.12.1", "@babel/plugin-transform-regenerator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz#9e7576dc476cb89ccc5096fff7af659243b4adeb" + integrity sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.12.1", "@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== +"@babel/plugin-transform-reserved-words@^7.12.1", "@babel/plugin-transform-reserved-words@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz#1d798e078f7c5958eec952059c460b220a63f586" + integrity sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-runtime@7.12.1": version "7.12.1" @@ -961,65 +1005,77 @@ resolve "^1.8.1" semver "^5.5.1" -"@babel/plugin-transform-shorthand-properties@^7.12.1", "@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== +"@babel/plugin-transform-runtime@^7.16.4": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.17.0.tgz#0a2e08b5e2b2d95c4b1d3b3371a2180617455b70" + integrity sha512-fr7zPWnKXNc1xoHfrIU9mN/4XKX4VLZ45Q+oMhfsYIaHvg7mHgmhfOy/ckRWqDK7XF3QDigRpkh5DKq6+clE8A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.5.0" + babel-plugin-polyfill-regenerator "^0.3.0" + semver "^6.3.0" -"@babel/plugin-transform-spread@^7.12.1", "@babel/plugin-transform-spread@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== +"@babel/plugin-transform-shorthand-properties@^7.12.1", "@babel/plugin-transform-shorthand-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz#e8549ae4afcf8382f711794c0c7b6b934c5fbd2a" + integrity sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-sticky-regex@^7.12.1", "@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== +"@babel/plugin-transform-spread@^7.12.1", "@babel/plugin-transform-spread@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz#a303e2122f9f12e0105daeedd0f30fb197d8ff44" + integrity sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" -"@babel/plugin-transform-template-literals@^7.12.1", "@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== +"@babel/plugin-transform-sticky-regex@^7.12.1", "@babel/plugin-transform-sticky-regex@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz#c84741d4f4a38072b9a1e2e3fd56d359552e8660" + integrity sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-typeof-symbol@^7.12.1", "@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== +"@babel/plugin-transform-template-literals@^7.12.1", "@babel/plugin-transform-template-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz#f3d1c45d28967c8e80f53666fc9c3e50618217ab" + integrity sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-typescript@^7.12.1": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.4.tgz#db7a062dcf8be5fc096bc0eeb40a13fbfa1fa251" - integrity sha512-sM1/FEjwYjXvMwu1PJStH11kJ154zd/lpY56NQJ5qH2D0mabMv1CAy/kdvS9RP4Xgfj9fBBA3JiSLdDHgXdzOA== +"@babel/plugin-transform-typeof-symbol@^7.12.1", "@babel/plugin-transform-typeof-symbol@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz#9cdbe622582c21368bd482b660ba87d5545d4f7e" + integrity sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-typescript" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-unicode-escapes@^7.12.1", "@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== +"@babel/plugin-transform-typescript@^7.12.1", "@babel/plugin-transform-typescript@^7.16.7": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz#591ce9b6b83504903fa9dd3652c357c2ba7a1ee0" + integrity sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-typescript" "^7.16.7" -"@babel/plugin-transform-unicode-regex@^7.12.1", "@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== +"@babel/plugin-transform-unicode-escapes@^7.12.1", "@babel/plugin-transform-unicode-escapes@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz#da8717de7b3287a2c6d659750c964f302b31ece3" + integrity sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-unicode-regex@^7.12.1", "@babel/plugin-transform-unicode-regex@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz#0f7aa4a501198976e25e82702574c34cfebe9ef2" + integrity sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/preset-env@7.12.1": version "7.12.1" @@ -1093,31 +1149,32 @@ core-js-compat "^3.6.2" semver "^5.5.0" -"@babel/preset-env@^7.12.1", "@babel/preset-env@^7.8.4": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.6.tgz#0f3898db9d63d320f21b17380d8462779de57659" - integrity sha512-L+6jcGn7EWu7zqaO2uoTDjjMBW+88FXzV8KvrBl2z6MtRNxlsmUNRlZPaNNPUTgqhyC5DHNFk/2Jmra+ublZWw== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.15.4" - "@babel/plugin-proposal-async-generator-functions" "^7.15.4" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.15.4" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.15.6" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.15.4" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" +"@babel/preset-env@^7.12.1", "@babel/preset-env@^7.16.4", "@babel/preset-env@^7.8.4": + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.11.tgz#5dd88fd885fae36f88fd7c8342475c9f0abe2982" + integrity sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g== + dependencies: + "@babel/compat-data" "^7.16.8" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.7" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.7" + "@babel/plugin-proposal-async-generator-functions" "^7.16.8" + "@babel/plugin-proposal-class-properties" "^7.16.7" + "@babel/plugin-proposal-class-static-block" "^7.16.7" + "@babel/plugin-proposal-dynamic-import" "^7.16.7" + "@babel/plugin-proposal-export-namespace-from" "^7.16.7" + "@babel/plugin-proposal-json-strings" "^7.16.7" + "@babel/plugin-proposal-logical-assignment-operators" "^7.16.7" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.7" + "@babel/plugin-proposal-numeric-separator" "^7.16.7" + "@babel/plugin-proposal-object-rest-spread" "^7.16.7" + "@babel/plugin-proposal-optional-catch-binding" "^7.16.7" + "@babel/plugin-proposal-optional-chaining" "^7.16.7" + "@babel/plugin-proposal-private-methods" "^7.16.11" + "@babel/plugin-proposal-private-property-in-object" "^7.16.7" + "@babel/plugin-proposal-unicode-property-regex" "^7.16.7" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" @@ -1132,50 +1189,50 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.15.3" - "@babel/plugin-transform-classes" "^7.15.4" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.15.4" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.15.4" - "@babel/plugin-transform-modules-systemjs" "^7.15.4" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.9" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.15.4" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.6" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.15.6" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.2" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.16.0" + "@babel/plugin-transform-arrow-functions" "^7.16.7" + "@babel/plugin-transform-async-to-generator" "^7.16.8" + "@babel/plugin-transform-block-scoped-functions" "^7.16.7" + "@babel/plugin-transform-block-scoping" "^7.16.7" + "@babel/plugin-transform-classes" "^7.16.7" + "@babel/plugin-transform-computed-properties" "^7.16.7" + "@babel/plugin-transform-destructuring" "^7.16.7" + "@babel/plugin-transform-dotall-regex" "^7.16.7" + "@babel/plugin-transform-duplicate-keys" "^7.16.7" + "@babel/plugin-transform-exponentiation-operator" "^7.16.7" + "@babel/plugin-transform-for-of" "^7.16.7" + "@babel/plugin-transform-function-name" "^7.16.7" + "@babel/plugin-transform-literals" "^7.16.7" + "@babel/plugin-transform-member-expression-literals" "^7.16.7" + "@babel/plugin-transform-modules-amd" "^7.16.7" + "@babel/plugin-transform-modules-commonjs" "^7.16.8" + "@babel/plugin-transform-modules-systemjs" "^7.16.7" + "@babel/plugin-transform-modules-umd" "^7.16.7" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.8" + "@babel/plugin-transform-new-target" "^7.16.7" + "@babel/plugin-transform-object-super" "^7.16.7" + "@babel/plugin-transform-parameters" "^7.16.7" + "@babel/plugin-transform-property-literals" "^7.16.7" + "@babel/plugin-transform-regenerator" "^7.16.7" + "@babel/plugin-transform-reserved-words" "^7.16.7" + "@babel/plugin-transform-shorthand-properties" "^7.16.7" + "@babel/plugin-transform-spread" "^7.16.7" + "@babel/plugin-transform-sticky-regex" "^7.16.7" + "@babel/plugin-transform-template-literals" "^7.16.7" + "@babel/plugin-transform-typeof-symbol" "^7.16.7" + "@babel/plugin-transform-unicode-escapes" "^7.16.7" + "@babel/plugin-transform-unicode-regex" "^7.16.7" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.16.8" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.5.0" + babel-plugin-polyfill-regenerator "^0.3.0" + core-js-compat "^3.20.2" semver "^6.3.0" -"@babel/preset-modules@^0.1.3", "@babel/preset-modules@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== +"@babel/preset-modules@^0.1.3", "@babel/preset-modules@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" + integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -1196,17 +1253,17 @@ "@babel/plugin-transform-react-jsx-source" "^7.12.1" "@babel/plugin-transform-react-pure-annotations" "^7.12.1" -"@babel/preset-react@^7.12.5", "@babel/preset-react@^7.13.13": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.14.5.tgz#0fbb769513f899c2c56f3a882fa79673c2d4ab3c" - integrity sha512-XFxBkjyObLvBaAvkx1Ie95Iaq4S/GUEIrejyrntQ/VCMKUYvKLoyKxOBzJ2kjA3b6rC9/KL6KXfDC2GqvLiNqQ== +"@babel/preset-react@^7.12.5", "@babel/preset-react@^7.13.13", "@babel/preset-react@^7.16.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.16.7.tgz#4c18150491edc69c183ff818f9f2aecbe5d93852" + integrity sha512-fWpyI8UM/HE6DfPBzD8LnhQ/OcH8AgTaqcqP2nGOXEUV+VKBR5JRN9hCk9ai+zQQ57vtm9oWeXguBCPNUjytgA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-react-display-name" "^7.14.5" - "@babel/plugin-transform-react-jsx" "^7.14.5" - "@babel/plugin-transform-react-jsx-development" "^7.14.5" - "@babel/plugin-transform-react-pure-annotations" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-transform-react-display-name" "^7.16.7" + "@babel/plugin-transform-react-jsx" "^7.16.7" + "@babel/plugin-transform-react-jsx-development" "^7.16.7" + "@babel/plugin-transform-react-pure-annotations" "^7.16.7" "@babel/preset-typescript@7.12.1": version "7.12.1" @@ -1216,12 +1273,21 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-transform-typescript" "^7.12.1" +"@babel/preset-typescript@^7.16.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz#ab114d68bb2020afc069cd51b37ff98a046a70b9" + integrity sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-transform-typescript" "^7.16.7" + "@babel/runtime-corejs3@^7.10.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz#403139af262b9a6e8f9ba04a6fdcebf8de692bf1" - integrity sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.8.tgz#d7dd49fb812f29c61c59126da3792d8740d4e284" + integrity sha512-ZbYSUvoSF6dXZmMl/CYTMOvzIFnbGfv4W3SEHYgMvNsFTeLaF2gkGAF4K2ddmtSK4Emej+0aYcnSC6N5dPCXUQ== dependencies: - core-js-pure "^3.16.0" + core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" "@babel/runtime@7.12.1": @@ -1238,34 +1304,35 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" - integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2" + integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.15.4", "@babel/template@^7.3.3": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.6": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/template@^7.10.4", "@babel/template@^7.16.7", "@babel/template@^7.3.3": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.6": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" + integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.3" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.3" + "@babel/types" "^7.17.0" debug "^4.1.0" globals "^11.1.0" @@ -1278,12 +1345,12 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.6", "@babel/types@^7.14.9", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.6": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" + integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1399,9 +1466,9 @@ which "^1.3.1" "@gar/promisify@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" - integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== + version "1.1.3" + resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" + integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== "@hapi/accept@5.0.1": version "5.0.1" @@ -1434,9 +1501,9 @@ integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== "@hapi/hoek@9.x.x": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131" - integrity sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug== + version "9.2.1" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.1.tgz#9551142a1980503752536b5050fd99f4a7f13b17" + integrity sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw== "@hapi/joi@^15.1.0": version "15.1.1" @@ -1465,9 +1532,9 @@ minimatch "^3.0.4" "@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -1656,16 +1723,23 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" - integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== +"@jridgewell/resolve-uri@^3.0.3": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" + integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.11" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" + integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== + +"@jridgewell/trace-mapping@^0.3.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" + integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" "@lerna/add@3.21.0": version "3.21.0" @@ -2419,9 +2493,9 @@ fastq "^1.6.0" "@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== + version "1.1.1" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" + integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== dependencies: "@gar/promisify" "^1.0.1" semver "^7.3.5" @@ -2450,10 +2524,10 @@ is-plain-object "^5.0.0" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^10.5.0": - version "10.5.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.5.0.tgz#9deea593663677febd07d93d31ab6882ba5e5748" - integrity sha512-yt8GpYL0s1bLZR7602l0Im5zfmB3UdHYCfcrv3ZGRX95BjX66UQeH4asXjXo8xBit9HneCctVhTMN0On/duukQ== +"@octokit/openapi-types@^11.2.0": + version "11.2.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" + integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -2499,15 +2573,15 @@ once "^1.4.0" "@octokit/request@^5.2.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.1.tgz#f97aff075c37ab1d427c49082fefeef0dba2d8ce" - integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== + version "5.6.3" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.16.1" is-plain-object "^5.0.0" - node-fetch "^2.6.1" + node-fetch "^2.6.7" universal-user-agent "^6.0.0" "@octokit/rest@^16.28.4": @@ -2540,11 +2614,11 @@ "@types/node" ">= 8" "@octokit/types@^6.0.3", "@octokit/types@^6.16.1": - version "6.31.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.31.0.tgz#b444852100090d1c5d0015614860c6131dc217e8" - integrity sha512-xobpvYmMYoFSxZB6jL1TPTMMZkxZIBlY145ZKibBJDKCczP1FrLLougtuVOZywGVZdcYs8oq2Bxb3aMjqIFeiw== + version "6.34.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" + integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== dependencies: - "@octokit/openapi-types" "^10.5.0" + "@octokit/openapi-types" "^11.2.0" "@opentelemetry/api@0.14.0": version "0.14.0" @@ -2571,14 +2645,34 @@ source-map "^0.7.3" "@polka/url@^1.0.0-next.20": - version "1.0.0-next.20" - resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.20.tgz#111b5db0f501aa89b05076fa31f0ea0e0c292cd3" - integrity sha512-88p7+M0QGxKpmnkfXjS4V26AnoC/eiqZutE8GLdaI5X12NY75bXSdTY9NkmYb2Xyk1O+MmkuO6Frmsj84V6I8Q== + version "1.0.0-next.21" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" + integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== "@popperjs/core@^2.9.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590" - integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ== + version "2.11.4" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.4.tgz#d8c7b8db9226d2d7664553a0741ad7d0397ee503" + integrity sha512-q/ytXxO5NKvyT37pmisQAItCFqA7FD/vNb8dgaJy3/630Fsc+Mz9/9f2SziBoIZ30TJooXyTwZmhi1zjXmObYg== + +"@rollup/plugin-babel@^5.3.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" + integrity sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q== + dependencies: + "@babel/helper-module-imports" "^7.10.4" + "@rollup/pluginutils" "^3.1.0" + +"@rollup/plugin-node-resolve@^11.2.1": + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" "@rollup/plugin-node-resolve@^7.1.1": version "7.1.3" @@ -2608,6 +2702,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^4.1.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.0.tgz#a14bbd058fdbba0a5647143b16ed0d86fb60bd08" + integrity sha512-2WUyJNRkyH5p487pGnn4tWAsxhEFKN/pT8CMgHshd5H+IXkOnKvKZwsz5ZWz+YCXkleZRAU5kwbfgF8CPfDRqA== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + "@scandipwa/craco@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@scandipwa/craco/-/craco-0.1.1.tgz#a010ed86fb6905b2e6fe4683eb502ad58c14f8f5" @@ -2779,13 +2881,13 @@ pretty-format "^26.6.2" "@testing-library/jest-dom@^5.11.4": - version "5.14.1" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.14.1.tgz#8501e16f1e55a55d675fe73eecee32cdaddb9766" - integrity sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ== + version "5.16.3" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.3.tgz#b76851a909586113c20486f1679ffb4d8ec27bfa" + integrity sha512-u5DfKj4wfSt6akfndfu1eG06jsdyA/IUrlX2n3pyq5UXgXMhXY+NJb8eNK/7pqPWAhCKsCGWDdDO0zKMKAYkEA== dependencies: "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" - aria-query "^4.2.2" + aria-query "^5.0.0" chalk "^3.0.0" css "^3.0.0" css.escape "^1.5.1" @@ -2971,6 +3073,12 @@ resolved "https://registry.yarnpkg.com/@tilework/mosaic/-/mosaic-0.1.4.tgz#90b6f504abd0131fc5d4db315878a871e00988b0" integrity sha512-r4oIG5JC/hmI48l4FJB8O23jLB0eDlUtp1HMIEVpfihFLZTUqQcfPpZjftl/4Yd/CJS/Hx5Ca1RF7/cKlqvT7Q== +"@tilework/opus@file:tilework-packages/opus": + version "0.0.10" + dependencies: + node-fetch "^2.6.2" + tslib "^2.2.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2982,9 +3090,9 @@ integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" - integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== + version "7.1.19" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" + integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -2993,9 +3101,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*", "@types/babel__generator@^7.6.1": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" - integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== + version "7.6.4" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" + integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== dependencies: "@babel/types" "^7.0.0" @@ -3036,18 +3144,18 @@ resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== -"@types/eslint@^7.2.6": - version "7.28.0" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.28.0.tgz#7e41f2481d301c68e14f483fe10b017753ce8d5a" - integrity sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A== +"@types/eslint@^7.2.6", "@types/eslint@^7.28.2": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.29.0.tgz#e56ddc8e542815272720bb0b4ccc2aff9c3e1c78" + integrity sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng== dependencies: "@types/estree" "*" "@types/json-schema" "*" "@types/estree@*": - version "0.0.50" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== "@types/estree@0.0.39": version "0.0.39" @@ -3062,9 +3170,9 @@ "@types/node" "*" "@types/glob@^7.1.1": - version "7.1.4" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672" - integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== dependencies: "@types/minimatch" "*" "@types/node" "*" @@ -3076,6 +3184,11 @@ dependencies: "@types/node" "*" +"@types/history@^4.7.11": + version "4.7.11" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" + integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA== + "@types/hoist-non-react-statics@^3.3.0": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -3099,9 +3212,9 @@ "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== "@types/istanbul-lib-report@*": version "3.0.0" @@ -3118,17 +3231,25 @@ "@types/istanbul-lib-report" "*" "@types/jest@*": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" - integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== + version "27.4.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.1.tgz#185cbe2926eaaf9662d340cc02e548ce9e11ab6d" + integrity sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw== dependencies: - jest-diff "^27.0.0" + jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/jest@^26.0.22": + version "26.0.24" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" + integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w== + dependencies: + jest-diff "^26.0.0" + pretty-format "^26.0.0" + +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/json5@^0.0.29": version "0.0.29" @@ -3150,20 +3271,28 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz#b17f16cf933597e10d6d78eae3251e692ce8b0ce" integrity sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== +"@types/node-fetch@2.5.12": + version "2.5.12" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66" + integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + "@types/node@*", "@types/node@>= 8": - version "16.9.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" - integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== + version "17.0.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" + integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== "@types/node@^12.11.0": - version "12.20.26" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.26.tgz#a6db0d0577e40844f0b28c2a9289c09e5b44b541" - integrity sha512-gIt+h4u2uTho2bsH1K250fUv5fHU71ET1yWT7bM4523zV/XrFb9jlWBOV4DO8FpscY+Sz/WEr1EEjIP2H4yumQ== + version "12.20.47" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.47.tgz#ca9237d51f2a2557419688511dab1c8daf475188" + integrity sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg== -"@types/node@^14.14.35": - version "14.17.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.18.tgz#0198489a751005f71217744aa966cd1f29447c81" - integrity sha512-haYyibw4pbteEhkSg0xdDLAI3679L75EJ799ymVrPxOA922bPx3ML59SoDsQ//rHlvqpu+e36kcbR3XRQtFblA== +"@types/node@^14.14.35", "@types/node@^14.14.37": + version "14.18.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.12.tgz#0d4557fd3b94497d793efd4e7d92df2f83b4ef24" + integrity sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -3176,9 +3305,9 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@^2.0.0": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" - integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" + integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== "@types/prop-types@*": version "15.7.4" @@ -3190,20 +3319,44 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df" integrity sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ== -"@types/react-redux@^7.1.16": - version "7.1.18" - resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.18.tgz#2bf8fd56ebaae679a90ebffe48ff73717c438e04" - integrity sha512-9iwAsPyJ9DLTRH+OFeIrm9cAbIj1i2ANL3sKQFATqnPWRbg+jEFXyZOKHiQK/N86pNRXbb4HRxAxo0SIX1XwzQ== +"@types/react-dom@^17.0.9": + version "17.0.14" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.14.tgz#c8f917156b652ddf807711f5becbd2ab018dea9f" + integrity sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ== + dependencies: + "@types/react" "*" + +"@types/react-redux@^7.1.20": + version "7.1.23" + resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.23.tgz#3c2bb1bcc698ae69d70735f33c5a8e95f41ac528" + integrity sha512-D02o3FPfqQlfu2WeEYwh3x2otYd2Dk1o8wAfsA0B1C2AJEFxE663Ozu7JzuWbznGgW248NaOF6wsqCGNq9d3qw== dependencies: "@types/hoist-non-react-statics" "^3.3.0" "@types/react" "*" hoist-non-react-statics "^3.3.0" redux "^4.0.0" -"@types/react@*": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.24.tgz#7e1b3f78d0fc53782543f9bce6d949959a5880bd" - integrity sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg== +"@types/react-router-dom@^5.1.8": + version "5.3.3" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83" + integrity sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw== + dependencies: + "@types/history" "^4.7.11" + "@types/react" "*" + "@types/react-router" "*" + +"@types/react-router@*", "@types/react-router@^5.1.16": + version "5.1.18" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.18.tgz#c8851884b60bc23733500d86c1266e1cfbbd9ef3" + integrity sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g== + dependencies: + "@types/history" "^4.7.11" + "@types/react" "*" + +"@types/react@*", "@types/react@^17.0.19": + version "17.0.43" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.43.tgz#4adc142887dd4a2601ce730bc56c3436fdb07a55" + integrity sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -3216,6 +3369,13 @@ dependencies: "@types/node" "*" +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -3231,23 +3391,15 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/stylelint@^13.13.3": - version "13.13.3" - resolved "https://registry.yarnpkg.com/@types/stylelint/-/stylelint-13.13.3.tgz#29ba9b7179e5632b12853252da191443607d32fc" - integrity sha512-xvYwobi9L69FXbJTimKYRNHyMwtmcJxMd1woI3U822rkW/f7wcZ6fsV1DqYPT+sNaO0qUtngiBhTQfMeItUvUA== - dependencies: - globby "11.x.x" - postcss "7.x.x" - "@types/tapable@^1", "@types/tapable@^1.0.5": version "1.0.8" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ== "@types/testing-library__jest-dom@^5.9.1": - version "5.14.1" - resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.1.tgz#014162a5cee6571819d48e999980694e2f657c3c" - integrity sha512-Gk9vaXfbzc5zCXI9eYE9BI5BNHEp4D3FWjgqBE/ePGYElLAP+KvxBcsdkwfIVvezs605oiyd/VrpiHe3Oeg+Aw== + version "5.14.3" + resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.3.tgz#ee6c7ffe9f8595882ee7bda8af33ae7b8789ef17" + integrity sha512-oKZe+Mf4ioWlMuzVBaXQ9WDnEm1+umLx0InILg+yvZVBBDmzV5KfZyLrCvadtWcx8+916jLmHafcmqqffl+iIw== dependencies: "@types/jest" "*" @@ -3259,9 +3411,9 @@ source-map "^0.6.1" "@types/vscode@^1.45.0": - version "1.60.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.60.0.tgz#9330c317691b4f53441a18b598768faeeb71618a" - integrity sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow== + version "1.65.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.65.0.tgz#042dd8d93c32ac62cb826cd0fa12376069d1f448" + integrity sha512-wQhExnh2nEzpjDMSKhUvnNmz3ucpd3E+R7wJkOhBNK3No6fG3VUdmVmMOKD0A8NDZDDDiQcLNxe3oGmX5SjJ5w== "@types/webpack-sources@*": version "3.2.0" @@ -3273,9 +3425,9 @@ source-map "^0.7.3" "@types/webpack@^4.41.8": - version "4.41.31" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.31.tgz#c35f252a3559ddf9c85c0d8b0b42019025e581aa" - integrity sha512-/i0J7sepXFIp1ZT7FjUGi1eXMCg8HCCzLJEQkKsOtbJFontsJLolBcDC+3qxn5pPwiCt1G0ZdRmYRzNBtvpuGQ== + version "4.41.32" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.32.tgz#a7bab03b72904070162b2f169415492209e94212" + integrity sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg== dependencies: "@types/node" "*" "@types/tapable" "^1" @@ -3285,9 +3437,9 @@ source-map "^0.6.0" "@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^15.0.0": version "15.0.14" @@ -3296,13 +3448,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - "@typescript-eslint/eslint-plugin@^2.30.0": version "2.34.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" @@ -3314,14 +3459,15 @@ tsutils "^3.17.1" "@typescript-eslint/eslint-plugin@^4.5.0": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" - integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== dependencies: - "@typescript-eslint/experimental-utils" "4.31.2" - "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" + ignore "^5.1.8" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" @@ -3336,15 +3482,15 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/experimental-utils@4.31.2", "@typescript-eslint/experimental-utils@^4.0.1": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" - integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== +"@typescript-eslint/experimental-utils@4.33.0", "@typescript-eslint/experimental-utils@^4.0.1": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -3379,32 +3525,32 @@ eslint-visitor-keys "^1.1.0" "@typescript-eslint/parser@^4.5.0": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" - integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" - integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" "@typescript-eslint/types@3.10.1": version "3.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== -"@typescript-eslint/types@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" - integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== "@typescript-eslint/typescript-estree@1.13.0": version "1.13.0" @@ -3441,13 +3587,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" - integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" @@ -3461,12 +3607,12 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@typescript-eslint/visitor-keys@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" - integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== dependencies: - "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" "@webassemblyjs/ast@1.9.0": @@ -3658,13 +3804,13 @@ abort-controller@3.0.0: dependencies: event-target-shim "^5.0.0" -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" + mime-types "~2.1.34" + negotiator "0.6.3" acorn-globals@^6.0.0: version "6.0.0" @@ -3699,10 +3845,10 @@ acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.2.4: - version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.5.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== address@1.1.2, address@^1.0.1: version "1.1.2" @@ -3758,11 +3904,25 @@ ajv-errors@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== +ajv-keywords@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -3773,10 +3933,10 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== +ajv@^8.0.0, ajv@^8.0.1, ajv@^8.8.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" + integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -3836,14 +3996,14 @@ ansi-regex@^2.0.0: integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" @@ -3957,6 +4117,11 @@ aria-query@^4.2.2: "@babel/runtime" "^7.10.2" "@babel/runtime-corejs3" "^7.10.2" +aria-query@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.0.0.tgz#210c21aaf469613ee8c9a62c7f86525e058db52c" + integrity sha512-V+SM7AbUwJ+EBnB8+DXs0hPZHO0W6pqBcc0dW90OwtVG02PswOu/teuARoLQjdDOH+t9pJgGnW5/Qmouf3gPJg== + arity-n@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/arity-n/-/arity-n-1.0.4.tgz#d9e76b11733e08569c0847ae7b39b2860b30b745" @@ -4012,16 +4177,16 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= -array-includes@^3.1.1, array-includes@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== +array-includes@^3.1.3, array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" - is-string "^1.0.5" + is-string "^1.0.7" array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" @@ -4045,24 +4210,23 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" - integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== +array.prototype.flat@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" + integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + es-abstract "^1.19.0" -array.prototype.flatmap@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== +array.prototype.flatmap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446" + integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA== dependencies: call-bind "^1.0.0" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" + es-abstract "^1.19.0" arrify@^1.0.1: version "1.0.1" @@ -4090,9 +4254,9 @@ asn1.js@^5.2.0: safer-buffer "^2.1.0" asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" @@ -4162,9 +4326,9 @@ async@^2.6.2: lodash "^4.17.14" async@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" - integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== + version "3.2.3" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" + integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== asynckit@^0.4.0: version "0.4.0" @@ -4192,15 +4356,15 @@ autobind-decorator@^1.3.4: integrity sha1-TJb/p3sQYi7eJPEQ9du/VmkUF9E= autoprefixer@^9.6.1: - version "9.8.6" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f" - integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg== + version "9.8.8" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.8.tgz#fd4bd4595385fa6f06599de749a4d5f7a474957a" + integrity sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA== dependencies: browserslist "^4.12.0" caniuse-lite "^1.0.30001109" - colorette "^1.2.1" normalize-range "^0.1.2" num2fraction "^1.2.2" + picocolors "^0.2.1" postcss "^7.0.32" postcss-value-parser "^4.1.0" @@ -4214,10 +4378,10 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axe-core@^4.0.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325" - integrity sha512-/lqqLAmuIPi79WYfRpy2i8z+x+vxU3zX2uAm0gs1q52qTuKwolOj1P8XbufpXcsydrpKx2yGn2wzAnxCMV86QA== +axe-core@^4.3.5: + version "4.4.1" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.1.tgz#7dbdc25989298f9ad006645cd396782443757413" + integrity sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw== axobject-query@^2.2.0: version "2.2.0" @@ -4285,14 +4449,14 @@ babel-plugin-dynamic-import-node@^2.3.3: object.assign "^4.1.0" babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@istanbuljs/load-nyc-config" "^1.0.0" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" + istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" babel-plugin-jest-hoist@^26.6.2: @@ -4314,6 +4478,15 @@ babel-plugin-macros@2.8.0: cosmiconfig "^6.0.0" resolve "^1.12.0" +babel-plugin-macros@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" + integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== + dependencies: + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" + babel-plugin-module-resolver@^4.0.0, babel-plugin-module-resolver@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.1.0.tgz#22a4f32f7441727ec1fbf4967b863e1e3e9f33e2" @@ -4326,33 +4499,33 @@ babel-plugin-module-resolver@^4.0.0, babel-plugin-module-resolver@^4.1.0: resolve "^1.13.1" babel-plugin-named-asset-import@^0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.7.tgz#156cd55d3f1228a5765774340937afc8398067dd" - integrity sha512-squySRkf+6JGnvjoUtDEjSREJEBirnXi9NqP6rjSYsylxQxqBTz+pkmf395i9E2zsvmYUaI40BHo6SqZUdydlw== + version "0.3.8" + resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.8.tgz#6b7fa43c59229685368683c28bc9734f24524cc2" + integrity sha512-WXiAc++qo7XcJ1ZnTYGtLxmBCVbddAml3CEXgWaBzNzLNoxtQ8AiGEFDMOhot9XjTCQbvP5E77Fj9Gk924f00Q== -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== +babel-plugin-polyfill-corejs2@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz#440f1b70ccfaabc6b676d196239b138f8a2cfba5" + integrity sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.3.1" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.2: - version "0.2.5" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.5.tgz#2779846a16a1652244ae268b1e906ada107faf92" - integrity sha512-ninF5MQNwAX9Z7c9ED+H2pGt1mXdP4TqzlHKyPIYmJIYz0N+++uwdM7RnJukklhzJ54Q84vA4ZJkgs7lu5vqcw== +babel-plugin-polyfill-corejs3@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz#aabe4b2fa04a6e038b688c5e55d44e78cd3a5f72" + integrity sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.16.2" + "@babel/helper-define-polyfill-provider" "^0.3.1" + core-js-compat "^3.21.0" -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== +babel-plugin-polyfill-regenerator@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990" + integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.3.1" babel-plugin-syntax-jsx@6.18.0: version "6.18.0" @@ -4380,7 +4553,7 @@ babel-plugin-transform-object-rest-spread@^6.26.0: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.26.0" -babel-plugin-transform-react-remove-prop-types@0.4.24: +babel-plugin-transform-react-remove-prop-types@0.4.24, babel-plugin-transform-react-remove-prop-types@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== @@ -4418,7 +4591,7 @@ babel-preset-jest@^26.6.2: babel-plugin-jest-hoist "^26.6.2" babel-preset-current-node-syntax "^1.0.0" -babel-preset-react-app@10.0.0, babel-preset-react-app@^10.0.0: +babel-preset-react-app@10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-10.0.0.tgz#689b60edc705f8a70ce87f47ab0e560a317d7045" integrity sha512-itL2z8v16khpuKutx5IH8UdCdSTuzrOhRFTEdIhveZ2i1iBKDrVE0ATa4sFVy+02GLucZNVBWtoarXBy0Msdpg== @@ -4439,6 +4612,28 @@ babel-preset-react-app@10.0.0, babel-preset-react-app@^10.0.0: babel-plugin-macros "2.8.0" babel-plugin-transform-react-remove-prop-types "0.4.24" +babel-preset-react-app@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-10.0.1.tgz#ed6005a20a24f2c88521809fa9aea99903751584" + integrity sha512-b0D9IZ1WhhCWkrTXyFuIIgqGzSkRIH5D5AmB0bXbzYAB1OBAwHcUeyWW2LorutLWF5btNo/N7r/cIdmvvKJlYg== + dependencies: + "@babel/core" "^7.16.0" + "@babel/plugin-proposal-class-properties" "^7.16.0" + "@babel/plugin-proposal-decorators" "^7.16.4" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.0" + "@babel/plugin-proposal-numeric-separator" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-private-methods" "^7.16.0" + "@babel/plugin-transform-flow-strip-types" "^7.16.0" + "@babel/plugin-transform-react-display-name" "^7.16.0" + "@babel/plugin-transform-runtime" "^7.16.4" + "@babel/preset-env" "^7.16.4" + "@babel/preset-react" "^7.16.0" + "@babel/preset-typescript" "^7.16.0" + "@babel/runtime" "^7.16.3" + babel-plugin-macros "^3.1.0" + babel-plugin-transform-react-remove-prop-types "^0.4.24" + babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -4508,9 +4703,9 @@ bfj@^7.0.2: tryer "^1.0.1" big-integer@^1.6.17: - version "1.6.49" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.49.tgz#f6817d3ea5d4f3fb19e24df9f4b1b4471a8328ce" - integrity sha512-KJ7VhqH+f/BOt9a3yMwJNmcZjG53ijWMTjSAGMveQWyLwqIiwkjNP5PFgDob3Snnx86SjDj6I89fIbv0dkQeNw== + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== big.js@^5.2.2: version "5.2.2" @@ -4578,21 +4773,21 @@ bn.js@^5.0.0, bn.js@^5.1.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== +body-parser@1.19.2: + version "1.19.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.2.tgz#4714ccd9c157d44797b8b5607d72c0b89952f26e" + integrity sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw== dependencies: - bytes "3.1.0" + bytes "3.1.2" content-type "~1.0.4" debug "2.6.9" depd "~1.1.2" - http-errors "1.7.2" + http-errors "1.8.1" iconv-lite "0.4.24" on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" + qs "6.9.7" + raw-body "2.4.3" + type-is "~1.6.18" bonjour@^3.5.0: version "3.5.0" @@ -4635,7 +4830,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1, braces@~3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -4753,16 +4948,23 @@ browserslist@4.14.6: escalade "^3.1.1" node-releases "^1.1.65" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.16.6, browserslist@^4.17.0, browserslist@^4.6.2, browserslist@^4.6.4: - version "4.17.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" - integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.17.5, browserslist@^4.19.1, browserslist@^4.6.2, browserslist@^4.6.4: + version "4.20.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" + integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== dependencies: - caniuse-lite "^1.0.30001259" - electron-to-chromium "^1.3.846" + caniuse-lite "^1.0.30001317" + electron-to-chromium "^1.4.84" escalade "^3.1.1" - nanocolors "^0.1.5" - node-releases "^1.1.76" + node-releases "^2.0.2" + picocolors "^1.0.0" + +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" bser@2.1.1: version "2.1.1" @@ -4781,7 +4983,7 @@ buffer-crc32@^0.2.1, buffer-crc32@^0.2.13: resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= -buffer-from@^1.0.0: +buffer-from@1.x, buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== @@ -4866,6 +5068,11 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + cacache@^12.0.0, cacache@^12.0.2, cacache@^12.0.3: version "12.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" @@ -5013,9 +5220,9 @@ camelcase@^4.1.0: integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= camelcase@^6.0.0, camelcase@^6.1.0, camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-api@^3.0.0: version "3.0.0" @@ -5027,12 +5234,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001113, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001154, caniuse-lite@^1.0.30001259: - version "1.0.30001260" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270" - integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg== - dependencies: - nanocolors "^0.1.0" +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001113, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001154, caniuse-lite@^1.0.30001317: + version "1.0.30001322" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001322.tgz#2e4c09d11e1e8f852767dab287069a8d0c29d623" + integrity sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew== capture-exit@^2.0.0: version "2.0.0" @@ -5094,7 +5299,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -5107,6 +5312,11 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +charcodes@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/charcodes/-/charcodes-0.2.0.tgz#5208d327e6cc05f99eb80ffc814707572d1f14e4" + integrity sha512-Y4kiDb+AM4Ecy58YkuZrrSRJBDQdQ2L+NyS1vHHFtNtUjgutcZfx3yp1dAONI/oPaPmyGfCLx5CxL+zauIMyKQ== + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -5167,9 +5377,9 @@ chokidar@^2.1.8: fsevents "^1.2.7" chokidar@^3.3.0, chokidar@^3.4.1, chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -5235,9 +5445,9 @@ classnames@^2.2.6: integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== clean-css@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78" - integrity sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA== + version "4.2.4" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.4.tgz#733bf46eba4e607c6891ea57c24a989356831178" + integrity sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A== dependencies: source-map "~0.6.0" @@ -5399,9 +5609,9 @@ color-name@^1.0.0, color-name@~1.1.4: integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== color-string@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.6.0.tgz#c3915f61fe267672cb7e1e064c9d692219f6c312" - integrity sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA== + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.0.tgz#63b6ebd1bec11999d1df3a79a7569451ac2be8aa" + integrity sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" @@ -5425,11 +5635,11 @@ colorette@^1.2.1: integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== columnify@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" - integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= + version "1.6.0" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" + integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== dependencies: - strip-ansi "^3.0.0" + strip-ansi "^6.0.1" wcwidth "^1.0.0" combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: @@ -5456,15 +5666,15 @@ commander@^4.1.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== common-tags@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" - integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== + version "1.8.2" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" + integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== commondir@^1.0.1: version "1.0.1" @@ -5560,9 +5770,9 @@ config-chain@^1.1.11: proto-list "~1.2.1" confusing-browser-globals@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59" - integrity sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA== + version "1.0.11" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" + integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== connect-history-api-fallback@^1.6.0: version "1.6.0" @@ -5584,12 +5794,12 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: - safe-buffer "5.1.2" + safe-buffer "5.2.1" content-type@~1.0.4: version "1.0.4" @@ -5653,9 +5863,9 @@ conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.7: modify-values "^1.0.0" conventional-commits-parser@^3.0.3: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz#190fb9900c6e02be0c0bca9b03d57e24982639fd" - integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== + version "3.2.4" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" + integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" @@ -5702,10 +5912,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +cookie@0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== copy-concurrently@^1.0.0: version "1.0.5" @@ -5724,18 +5934,18 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.16.0, core-js-compat@^3.16.2, core-js-compat@^3.6.2: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.0.tgz#fb360652201e8ac8da812718c008cd0482ed9b42" - integrity sha512-tRVjOJu4PxdXjRMEgbP7lqWy1TWJu9a01oBkn8d+dNrhgmBwdTkzhHZpVJnEmhISLdoJI1lX08rcBcHi3TZIWg== +core-js-compat@^3.20.2, core-js-compat@^3.21.0, core-js-compat@^3.6.2: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.21.1.tgz#cac369f67c8d134ff8f9bd1623e3bc2c42068c82" + integrity sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g== dependencies: - browserslist "^4.17.0" + browserslist "^4.19.1" semver "7.0.0" -core-js-pure@^3.16.0: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.18.0.tgz#e5187347bae66448c9e2d67c01c34c4df3261dc5" - integrity sha512-ZnK+9vyuMhKulIGqT/7RHGRok8RtkHMEX/BGPHkHx+ouDkq+MUvf9mfIgdqhpmPDu8+V5UtRn/CbCRc9I4lX4w== +core-js-pure@^3.20.2: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" + integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== core-js@^2.4.0: version "2.6.12" @@ -5743,9 +5953,9 @@ core-js@^2.4.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.6.5: - version "3.18.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.0.tgz#9af3f4a6df9ba3428a3fb1b171f1503b3f40cc49" - integrity sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w== + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.1.tgz#f2e0ddc1fc43da6f904706e8e955bc19d06a0d94" + integrity sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig== core-util-is@1.0.2: version "1.0.2" @@ -5797,12 +6007,12 @@ craco-sass-resources-loader@^1.1.0: sass-resources-loader "^2.0.0" crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.1.tgz#436d2bcaad27bcb6bd073a2587139d3024a16460" + integrity sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w== dependencies: exit-on-epipe "~1.0.1" - printj "~1.1.0" + printj "~1.3.1" crc32-stream@^4.0.2: version "4.0.2" @@ -5948,6 +6158,11 @@ css-declaration-sorter@^4.0.1: postcss "^7.0.1" timsort "^0.3.0" +css-functions-list@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/css-functions-list/-/css-functions-list-3.0.1.tgz#1460df7fb584d1692c30b105151dbb988c8094f9" + integrity sha512-PriDuifDt4u4rkDgnqRCLnjfMatufLmWNfQnGCq34xZwpY3oabwhB9SqRBmuvWUgndbemCFlKqg+nO7C2q0SBw== + css-has-pseudo@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz#3c642ab34ca242c59c41a125df9105841f6966ee" @@ -5997,15 +6212,15 @@ css-select@^2.0.0: nth-check "^1.0.2" css-select@^4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067" - integrity sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA== + version "4.3.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" + integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== dependencies: boolbase "^1.0.0" - css-what "^5.0.0" - domhandler "^4.2.0" - domutils "^2.6.0" - nth-check "^2.0.0" + css-what "^6.0.1" + domhandler "^4.3.1" + domutils "^2.8.0" + nth-check "^2.0.1" css-tree@1.0.0-alpha.37: version "1.0.0-alpha.37" @@ -6028,10 +6243,10 @@ css-what@^3.2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== -css-what@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad" - integrity sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg== +css-what@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.0.1.tgz#3be33be55b9f302f710ba3a9c3abc1e2a63fc7eb" + integrity sha512-z93ZGFLNc6yaoXAmVhqoSIb+BduplteCt1fepvwhBUQK6MNE4g6fgjpuZKJKp0esUe+vXWlIkwZZjNWoOKw0ZA== css.escape@1.5.1, css.escape@^1.5.1: version "1.5.1" @@ -6181,9 +6396,9 @@ cssstyle@^2.3.0: cssom "~0.3.6" csstype@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" - integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== + version "3.0.11" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33" + integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw== currently-unhandled@^0.4.1: version "0.4.1" @@ -6205,10 +6420,10 @@ d@1, d@^1.0.1: es5-ext "^0.10.50" type "^1.0.1" -damerau-levenshtein@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz#64368003512a1a6992593741a09a9d31a836f55d" - integrity sha512-VvdQIPGdWP0SqFXghj79Wf/5LArmreyMsGLa6FG6iC4t3j7j5s71TrwWmT/4akbDQIqjfACkLZmjXhA7g2oUZw== +damerau-levenshtein@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== dargs@^4.0.1: version "4.1.0" @@ -6239,9 +6454,9 @@ data-urls@^2.0.0: whatwg-url "^8.0.0" date-fns@^2.24.0: - version "2.26.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.26.0.tgz#fa45305543c392c4f914e50775fd2a4461e60fbd" - integrity sha512-VQI812dRi3cusdY/fhoBKvc6l2W8BPWU1FNVnFH9Nttjx4AFBRzfSVb/Eyc7jBT6e9sg1XtAGsYpBQ6c/jygbg== + version "2.28.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" + integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== dateformat@^3.0.0: version "3.0.3" @@ -6281,27 +6496,20 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7: +debug@^3.1.0, debug@^3.1.1, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" -debug@^4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -6507,10 +6715,10 @@ diff-sequences@^26.6.2: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff-sequences@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" + integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== diff@3.2.0: version "3.2.0" @@ -6588,9 +6796,9 @@ doctrine@^3.0.0: esutils "^2.0.2" dom-accessibility-api@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.7.tgz#8c2aa6325968f2933160a0b7dbb380893ddf3e7d" - integrity sha512-ml3lJIq9YjUfM9TUnEPvEYWFSwivwIGBPKpewX7tii7fwCazA8yCioGdqQcNsItPpfFvSJ3VIdMQPj60LJhcQA== + version "0.5.13" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.13.tgz#102ee5f25eacce09bdf1cfa5a298f86da473be4b" + integrity sha512-R305kwb5CcMDIpSHUnLyIAp7SrSPBx6F0VfQFB3M75xVMHhXJJIdePYgbPPh1o57vCHNu5QztokWUPsLjWzFqw== dom-converter@^0.2.0: version "0.2.0" @@ -6661,10 +6869,10 @@ domhandler@3.3.0, domhandler@^3.0.0, domhandler@^3.3.0: dependencies: domelementtype "^2.0.1" -domhandler@^4.0.0, domhandler@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.2.tgz#e825d721d19a86b8c201a35264e226c678ee755f" - integrity sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w== +domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" + integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== dependencies: domelementtype "^2.2.0" @@ -6685,7 +6893,7 @@ domutils@^1.5.1, domutils@^1.7.0: dom-serializer "0" domelementtype "1" -domutils@^2.4.2, domutils@^2.5.2, domutils@^2.6.0: +domutils@^2.4.2, domutils@^2.5.2, domutils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== @@ -6773,10 +6981,10 @@ ejs@^3.1.5: dependencies: jake "^10.6.1" -electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.585, electron-to-chromium@^1.3.846: - version "1.3.848" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.848.tgz#94cc196e496f33c0d71cd98561448f10018584cc" - integrity sha512-wchRyBcdcmibioggdO7CbMT5QQ4lXlN/g7Mkpf1K2zINidnqij6EVu94UIZ+h5nB2S9XD4bykqFv9LonAWLFyw== +electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.585, electron-to-chromium@^1.4.84: + version "1.4.100" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.100.tgz#da82de8a19a47ea3dcdf141dde85355942fbc4e7" + integrity sha512-pNrSE2naf8fizl6/Uxq8UbKb8hU9EiYW4OzCYswosXoLV5NTMOUVKECNzDaHiUubsPq/kAckOzZd7zd8S8CHVw== elliptic@^6.5.3: version "6.5.4" @@ -6806,7 +7014,7 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emoji-regex@^9.0.0: +emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== @@ -6896,16 +7104,16 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" error-stack-parser@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.6.tgz#5a99a707bd7a4c58a797902d48d82803ede6aad8" - integrity sha512-d51brTeqC+BHlwF0BhPtcYgF5nlzf9ZZ0ZIUQNZpc9ZB9qw5IJ2diTrBY9jlCJkTLITYPjmiX6OWCwH+fuyNgQ== + version "2.0.7" + resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.7.tgz#b0c6e2ce27d0495cf78ad98715e0cad1219abb57" + integrity sha512-chLOW0ZGRf4s8raLrDxa5sdkvPec5YdvwbFnqJme4rk0rFajP8mPtrDL1+I+CwrQDCjswDA5sREX7jYQDQs9vA== dependencies: stackframe "^1.1.1" -es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es-abstract@^1.18.2: - version "1.18.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.6.tgz#2c44e3ea7a6255039164d26559777a6d978cb456" - integrity sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ== +es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.2.tgz#8f7b696d8f15b167ae3640b4060670f3d054143f" + integrity sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -6913,13 +7121,15 @@ es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es- get-intrinsic "^1.1.1" get-symbol-description "^1.0.0" has "^1.0.3" - has-symbols "^1.0.2" + has-symbols "^1.0.3" internal-slot "^1.0.3" is-callable "^1.2.4" - is-negative-zero "^2.0.1" + is-negative-zero "^2.0.2" is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" is-string "^1.0.7" - object-inspect "^1.11.0" + is-weakref "^1.0.2" + object-inspect "^1.12.0" object-keys "^1.1.1" object.assign "^4.1.2" string.prototype.trimend "^1.0.4" @@ -6936,15 +7146,15 @@ es-to-primitive@^1.2.1: is-symbol "^1.0.2" es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== + version "0.10.59" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.59.tgz#71038939730eb6f4f165f1421308fb60be363bc6" + integrity sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw== dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" -es6-iterator@2.0.3, es6-iterator@^2.0.3, es6-iterator@~2.0.3: +es6-iterator@2.0.3, es6-iterator@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= @@ -6965,7 +7175,7 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -es6-symbol@^3.1.1, es6-symbol@~3.1.3: +es6-symbol@^3.1.1, es6-symbol@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== @@ -7061,13 +7271,13 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534" - integrity sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q== +eslint-module-utils@^2.7.2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" + integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== dependencies: debug "^3.2.7" - pkg-dir "^2.0.0" + find-up "^2.1.0" eslint-plugin-array-func@^3.1.7: version "3.1.7" @@ -7100,25 +7310,23 @@ eslint-plugin-fp@^2.3.0: req-all "^0.1.0" eslint-plugin-import@^2.22.1: - version "2.24.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da" - integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q== + version "2.25.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" + integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== dependencies: - array-includes "^3.1.3" - array.prototype.flat "^1.2.4" + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.6.2" - find-up "^2.0.0" + eslint-module-utils "^2.7.2" has "^1.0.3" - is-core-module "^2.6.0" + is-core-module "^2.8.0" + is-glob "^4.0.3" minimatch "^3.0.4" - object.values "^1.1.4" - pkg-up "^2.0.0" - read-pkg-up "^3.0.0" + object.values "^1.1.5" resolve "^1.20.0" - tsconfig-paths "^3.11.0" + tsconfig-paths "^3.12.0" eslint-plugin-jest@^22.1.3: version "22.21.0" @@ -7128,53 +7336,54 @@ eslint-plugin-jest@^22.1.3: "@typescript-eslint/experimental-utils" "^1.13.0" eslint-plugin-jest@^24.1.0: - version "24.4.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.4.2.tgz#9e8cf05ee6a0e3025e6149df2f36950abfa8d5bf" - integrity sha512-jNMnqwX75z0RXRMXkxwb/+9ylKJYJLJ8nT8nBT0XFM5qx4IQGxP4edMawa0qGkSbHae0BDPBmi8I2QF0/F04XQ== + version "24.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.7.0.tgz#206ac0833841e59e375170b15f8d0955219c4889" + integrity sha512-wUxdF2bAZiYSKBclsUMrYHH6WxiBreNjyDxbRv345TIvPeoCEgPNEn3Sa+ZrSqsf1Dl9SqqSREXMHExlMMu1DA== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" eslint-plugin-jsx-a11y@^6.3.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd" - integrity sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg== + version "6.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz#cdbf2df901040ca140b6ec14715c988889c2a6d8" + integrity sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g== dependencies: - "@babel/runtime" "^7.11.2" + "@babel/runtime" "^7.16.3" aria-query "^4.2.2" - array-includes "^3.1.1" + array-includes "^3.1.4" ast-types-flow "^0.0.7" - axe-core "^4.0.2" + axe-core "^4.3.5" axobject-query "^2.2.0" - damerau-levenshtein "^1.0.6" - emoji-regex "^9.0.0" + damerau-levenshtein "^1.0.7" + emoji-regex "^9.2.2" has "^1.0.3" - jsx-ast-utils "^3.1.0" + jsx-ast-utils "^3.2.1" language-tags "^1.0.5" + minimatch "^3.0.4" eslint-plugin-react-hooks@^4.0.0, eslint-plugin-react-hooks@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" - integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== + version "4.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.4.0.tgz#71c39e528764c848d8253e1aa2c7024ed505f6c4" + integrity sha512-U3RVIfdzJaeKDQKEJbz5p3NW8/L80PCATJAfuojwbaEL+gBjfGdhUcGde+WGUW46Q5sr/NgxevsIiDtNXrvZaQ== eslint-plugin-react@^7.21.5: - version "7.26.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.0.tgz#3ae019a35d542b98e5af9e2f96b89c232c74b55b" - integrity sha512-dceliS5itjk4EZdQYtLMz6GulcsasguIs+VTXuiC7Q5IPIdGTkyfXVdmsQOqEhlD9MciofH4cMcT1bw1WWNxCQ== + version "7.29.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.4.tgz#4717de5227f55f3801a5fd51a16a4fa22b5914d2" + integrity sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ== dependencies: - array-includes "^3.1.3" - array.prototype.flatmap "^1.2.4" + array-includes "^3.1.4" + array.prototype.flatmap "^1.2.5" doctrine "^2.1.0" - estraverse "^5.2.0" + estraverse "^5.3.0" jsx-ast-utils "^2.4.1 || ^3.0.0" - minimatch "^3.0.4" - object.entries "^1.1.4" - object.fromentries "^2.0.4" - object.hasown "^1.0.0" - object.values "^1.1.4" - prop-types "^15.7.2" + minimatch "^3.1.2" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.0" + object.values "^1.1.5" + prop-types "^15.8.1" resolve "^2.0.0-next.3" semver "^6.3.0" - string.prototype.matchall "^4.0.5" + string.prototype.matchall "^4.0.6" eslint-plugin-simple-import-sort@^5.0.3: version "5.0.3" @@ -7246,16 +7455,16 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint-webpack-plugin@^2.5.2: - version "2.5.4" - resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-2.5.4.tgz#473b84932f1a8e2c2b8e66a402d0497bf440b986" - integrity sha512-7rYh0m76KyKSDE+B+2PUQrlNS4HJ51t3WKpkJg6vo2jFMbEPTG99cBV0Dm7LXSHucN4WGCG65wQcRiTFrj7iWw== + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-2.6.0.tgz#3bd4ada4e539cb1f6687d2f619073dbb509361cd" + integrity sha512-V+LPY/T3kur5QO3u+1s34VDTcRxjXWPUGM4hlmTb5DwVD0OQz631yGTxJZf4SpAqAjdbBVe978S8BJeHpAdOhQ== dependencies: - "@types/eslint" "^7.2.6" + "@types/eslint" "^7.28.2" arrify "^2.0.1" - jest-worker "^26.6.2" - micromatch "^4.0.2" + jest-worker "^27.3.1" + micromatch "^4.0.4" normalize-path "^3.0.0" - schema-utils "^3.0.0" + schema-utils "^3.1.1" eslint@^6.8.0: version "6.8.0" @@ -7388,10 +7597,10 @@ estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== estree-walker@^0.6.1: version "0.6.1" @@ -7403,6 +7612,11 @@ estree-walker@^1.0.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -7441,7 +7655,7 @@ events@^3.0.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -eventsource@^1.0.7: +eventsource@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf" integrity sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg== @@ -7537,16 +7751,16 @@ expect@^26.6.0, expect@^26.6.2: jest-regex-util "^26.0.0" express@^4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + version "4.17.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.3.tgz#f6c7302194a4fb54271b73a1fe7a06478c8f85a1" + integrity sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg== dependencies: - accepts "~1.3.7" + accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" + body-parser "1.19.2" + content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.0" + cookie "0.4.2" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.2" @@ -7560,22 +7774,22 @@ express@^4.17.1: on-finished "~2.3.0" parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" + proxy-addr "~2.0.7" + qs "6.9.7" range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" + safe-buffer "5.2.1" + send "0.17.2" + serve-static "1.14.2" + setprototypeof "1.2.0" statuses "~1.5.0" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" ext@^1.1.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.5.0.tgz#e93b97ae0cb23f8370380f6107d2d2b7887687ad" - integrity sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q== + version "1.6.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" + integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== dependencies: type "^2.5.0" @@ -7628,9 +7842,9 @@ extsprintf@1.3.0: integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== fast-deep-equal@3.1.3, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -7649,10 +7863,10 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.1.1, fast-glob@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== +fast-glob@^3.1.1, fast-glob@^3.2.11, fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -7660,7 +7874,7 @@ fast-glob@^3.1.1, fast-glob@^3.2.7: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -7682,7 +7896,7 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -faye-websocket@^0.11.3: +faye-websocket@^0.11.3, faye-websocket@^0.11.4: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== @@ -7911,9 +8125,9 @@ flatted@^2.0.0: integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + version "3.2.5" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" + integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== flatten@^1.0.2: version "1.0.3" @@ -7929,9 +8143,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.14.8" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" - integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== + version "1.14.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" + integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== for-in@^1.0.2: version "1.0.2" @@ -8018,10 +8232,19 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-extra@8.1.0, fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + version "10.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8" + integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -8036,15 +8259,6 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^9.0.1: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -8393,9 +8607,9 @@ globals@^12.1.0: type-fest "^0.8.1" globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== + version "13.13.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" + integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== dependencies: type-fest "^0.20.2" @@ -8411,18 +8625,6 @@ globby@11.0.1: merge2 "^1.3.0" slash "^3.0.0" -globby@11.x.x, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - globby@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -8436,6 +8638,18 @@ globby@8.0.2: pify "^3.0.0" slash "^1.0.0" +globby@^11.0.2, globby@^11.0.3, globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -8476,9 +8690,9 @@ globule@^1.0.0: minimatch "~3.0.2" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -8582,10 +8796,10 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== has-tostringtag@^1.0.0: version "1.0.0" @@ -8708,9 +8922,9 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== dependencies: lru-cache "^6.0.0" @@ -8845,27 +9059,27 @@ http-deceiver@^1.2.7: resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== +http-errors@1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== dependencies: depd "~1.1.2" - inherits "2.0.3" + inherits "2.0.4" setprototypeof "1.1.1" statuses ">= 1.5.0 < 2" toidentifier "1.0.0" -http-errors@1.7.3, http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== +http-errors@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== dependencies: depd "~1.1.2" inherits "2.0.4" - setprototypeof "1.1.1" + setprototypeof "1.2.0" statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" + toidentifier "1.0.1" http-errors@~1.6.2: version "1.6.3" @@ -8878,9 +9092,9 @@ http-errors@~1.6.2: statuses ">= 1.4.0 < 2" http-parser-js@>=0.5.1: - version "0.5.3" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" - integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== + version "0.5.6" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.6.tgz#2e02406ab2df8af8a7abfba62e0da01c62b95afd" + integrity sha512-vDlkRPDJn93swjcjqMSaGSPABbIarsr1TLAui/gLDXzV5VsJNdXNzMYDyNBLQkjWQCJ1uizu8T2oDMhmGt0PRA== http-proxy-agent@^2.1.0: version "2.1.0" @@ -9031,12 +9245,7 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -ignore@^5.2.0: +ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -9095,9 +9304,9 @@ import-local@^2.0.0: resolve-cwd "^2.0.0" import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -9385,10 +9594,10 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" -is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== +is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.0, is-core-module@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== dependencies: has "^1.0.3" @@ -9492,10 +9701,10 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -9504,10 +9713,10 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.6" @@ -9612,6 +9821,11 @@ is-root@2.1.0: resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + is-ssh@^1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.3.tgz#7f133285ccd7f2c2c7fc897b771b53d95a2b2c7e" @@ -9660,6 +9874,13 @@ is-utf8@^0.2.0, is-utf8@^0.2.1: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + is-windows@^1.0.0, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -9688,9 +9909,9 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isbinaryfile@^4.0.0: - version "4.0.8" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" - integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== + version "4.0.10" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== isexe@^2.0.0: version "2.0.0" @@ -9714,12 +9935,12 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz#e8900b3ed6069759229cf30f7067388d148aeb5e" - integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: +istanbul-lib-instrument@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== @@ -9729,6 +9950,17 @@ istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" +istanbul-lib-instrument@^5.0.4: + version "5.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" + integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -9739,29 +9971,29 @@ istanbul-lib-report@^3.0.0: supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + version "3.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" + integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" jake@^10.6.1: - version "10.8.2" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" - integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== + version "10.8.4" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.4.tgz#f6a8b7bf90c6306f768aa82bb7b98bf4ca15e84a" + integrity sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA== dependencies: async "0.9.x" - chalk "^2.4.2" + chalk "^4.0.2" filelist "^1.0.1" minimatch "^3.0.4" @@ -9844,7 +10076,7 @@ jest-config@^26.6.3: micromatch "^4.0.2" pretty-format "^26.6.2" -jest-diff@^26.6.2: +jest-diff@^26.0.0, jest-diff@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== @@ -9854,15 +10086,15 @@ jest-diff@^26.6.2: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-diff@^27.0.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.0.tgz#bda761c360f751bab1e7a2fe2fc2b0a35ce8518c" - integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== +jest-diff@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" + integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== dependencies: chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.0" + diff-sequences "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" jest-docblock@^26.0.0: version "26.0.0" @@ -9912,10 +10144,10 @@ jest-get-type@^26.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== +jest-get-type@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" + integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== jest-haste-map@^26.6.2: version "26.6.2" @@ -9980,6 +10212,16 @@ jest-matcher-utils@^26.6.0, jest-matcher-utils@^26.6.2: jest-get-type "^26.3.0" pretty-format "^26.6.2" +jest-matcher-utils@^27.0.0: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" + integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== + dependencies: + chalk "^4.0.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" + jest-message-util@^26.6.0, jest-message-util@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" @@ -10139,7 +10381,7 @@ jest-snapshot@^26.6.0, jest-snapshot@^26.6.2: pretty-format "^26.6.2" semver "^7.3.2" -jest-util@^26.6.0, jest-util@^26.6.2: +jest-util@^26.1.0, jest-util@^26.6.0, jest-util@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== @@ -10197,7 +10439,7 @@ jest-worker@24.9.0, jest-worker@^24.9.0: merge-stream "^2.0.0" supports-color "^6.1.0" -jest-worker@^26.5.0, jest-worker@^26.6.2: +jest-worker@^26.2.1, jest-worker@^26.5.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -10206,10 +10448,10 @@ jest-worker@^26.5.0, jest-worker@^26.6.2: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^27.3.1: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.5.tgz#d696e3e46ae0f24cff3fa7195ffba22889262242" - integrity sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg== +jest-worker@^27.3.1, jest-worker@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" @@ -10332,10 +10574,10 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" @@ -10352,10 +10594,10 @@ json3@3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= -json3@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" - integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== +json5@2.x, json5@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== json5@^0.5.1: version "0.5.1" @@ -10369,13 +10611,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -10405,16 +10640,16 @@ jsonparse@^1.2.0: integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" -"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.1.0: +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" integrity sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA== @@ -10462,9 +10697,9 @@ kleur@^3.0.3: integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== klona@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" - integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== + version "2.0.5" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" + integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== known-css-properties@^0.24.0: version "0.24.0" @@ -10492,9 +10727,9 @@ last-call-webpack-plugin@^3.0.0: webpack-sources "^1.1.0" lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= + version "1.0.1" + resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.1.tgz#494c831062f1f9408251ec44db1cba29242a2638" + integrity sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw== dependencies: readable-stream "^2.0.5" @@ -10552,9 +10787,9 @@ line-column@^1.0.2: isobject "^2.0.0" lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== listenercount@~1.0.1: version "1.0.1" @@ -10612,7 +10847,7 @@ loader-utils@1.2.3: emojis-list "^2.0.0" json5 "^1.0.1" -loader-utils@2.0.0, loader-utils@^2.0.0: +loader-utils@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== @@ -10630,6 +10865,15 @@ loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: emojis-list "^3.0.0" json5 "^1.0.1" +loader-utils@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" + integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -10821,7 +11065,7 @@ lodash.zip@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA= -"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.7.0, lodash@~4.17.10: +lodash@4.x, "lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.7.0, lodash@~4.17.10: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -10834,9 +11078,9 @@ log-symbols@3.0.0: chalk "^2.4.2" loglevel@^1.6.8: - version "1.7.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" - integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== + version "1.8.0" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" + integrity sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA== loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" @@ -10900,11 +11144,11 @@ macos-release@^2.2.0: integrity sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g== magic-string@^0.25.0, magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + version "0.25.9" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: - sourcemap-codec "^1.4.4" + sourcemap-codec "^1.4.8" make-dir@^1.0.0: version "1.3.0" @@ -10928,6 +11172,11 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" +make-error@1.x: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" @@ -10945,12 +11194,12 @@ make-fetch-happen@^5.0.0: socks-proxy-agent "^4.0.0" ssri "^6.0.0" -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: - tmpl "1.0.x" + tmpl "1.0.5" map-cache@^0.2.2: version "0.2.2" @@ -11140,7 +11389,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0: +merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -11175,12 +11424,12 @@ micromatch@^3.1.10, micromatch@^3.1.4: to-regex "^3.0.2" micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== dependencies: - braces "^3.0.1" - picomatch "^2.2.3" + braces "^3.0.2" + picomatch "^2.3.1" miller-rabin@^4.0.0: version "4.0.1" @@ -11190,32 +11439,27 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== - -"mime-db@>= 1.43.0 < 2": - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== +mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.49.0" + mime-db "1.52.0" mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.3.1, mime@^2.4.4: - version "2.5.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== +mime@^2.4.4: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== mimic-fn@^1.0.0: version "1.2.0" @@ -11270,13 +11514,27 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@~3.0.2: + version "3.0.8" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" + integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q== + dependencies: + brace-expansion "^1.1.7" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -11299,10 +11557,10 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minipass-collect@^1.0.2: version "1.0.2" @@ -11334,9 +11592,9 @@ minipass@^2.3.5, minipass@^2.6.0, minipass@^2.9.0: yallist "^3.0.0" minipass@^3.0.0, minipass@^3.1.1: - version "3.1.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732" - integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw== + version "3.1.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" + integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== dependencies: yallist "^4.0.0" @@ -11391,7 +11649,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@^1.0.0, mkdirp@^1.0.3, mkdirp@^1.0.4: +mkdirp@*, mkdirp@1.x, mkdirp@^1.0.0, mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -11403,13 +11661,20 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@0.5.5, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: +mkdirp@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + mocha@^3.1.2: version "3.5.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" @@ -11475,6 +11740,11 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" +mrmime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.0.tgz#14d387f0585a5233d291baba339b063752a2398b" + integrity sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -11490,7 +11760,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -11553,15 +11823,10 @@ nan@^2.12.1, nan@^2.13.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== -nanocolors@^0.1.0, nanocolors@^0.1.5: - version "0.1.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" - integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== - -nanoid@^3.1.16, nanoid@^3.1.25, nanoid@^3.1.30: - version "3.2.0" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" - integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== +nanoid@^3.1.16, nanoid@^3.1.30, nanoid@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.2.tgz#c89622fafb4381cd221421c69ec58547a1eec557" + integrity sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA== nanomatch@^1.2.9: version "1.2.13" @@ -11604,10 +11869,10 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1, neo-async@^2.6.2: version "2.6.2" @@ -11619,11 +11884,6 @@ next-tick@1, next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - next@10.0.5: version "10.0.5" resolved "https://registry.yarnpkg.com/next/-/next-10.0.5.tgz#8071e0aa1883266c91943aa7c6b73deadb064793" @@ -11725,7 +11985,7 @@ node-fetch@2.6.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-fetch@^2.5.0, node-fetch@^2.6.1: +node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.6.2, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -11813,11 +12073,6 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - node-notifier@^8.0.0: version "8.0.2" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" @@ -11830,10 +12085,15 @@ node-notifier@^8.0.0: uuid "^8.3.0" which "^2.0.2" -node-releases@^1.1.52, node-releases@^1.1.61, node-releases@^1.1.65, node-releases@^1.1.76: - version "1.1.76" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" - integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== +node-releases@^1.1.52, node-releases@^1.1.61, node-releases@^1.1.65: + version "1.1.77" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" + integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== + +node-releases@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== node-sass@4.14.1: version "4.14.1" @@ -12025,7 +12285,7 @@ nth-check@^1.0.2: dependencies: boolbase "~1.0.0" -nth-check@^2.0.0: +nth-check@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w== @@ -12066,10 +12326,10 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== +object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== object-is@^1.0.1: version "1.1.5" @@ -12111,41 +12371,40 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.0, object.entries@^1.1.2, object.entries@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" - integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== +object.entries@^1.1.0, object.entries@^1.1.2, object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" -object.fromentries@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" - integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has "^1.0.3" + es-abstract "^1.19.1" object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" - integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + version "2.1.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" + integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" -object.hasown@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.0.0.tgz#bdbade33cfacfb25d7f26ae2b6cb870bf99905c2" - integrity sha512-qYMF2CLIjxxLGleeM0jrcB4kiv3loGVAjKQKvH8pSU/i2VcRRvUNmxbD+nEMmrXRfORhuVJuH8OtSYCZoue3zA== +object.hasown@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5" + integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg== dependencies: define-properties "^1.1.3" - es-abstract "^1.18.1" + es-abstract "^1.19.1" object.pick@^1.3.0: version "1.3.0" @@ -12154,14 +12413,14 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0, object.values@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" - integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== +object.values@^1.1.0, object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" @@ -12585,7 +12844,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -12649,10 +12908,10 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^2.0.0, pify@^2.3.0: version "2.3.0" @@ -12682,18 +12941,9 @@ pinkie@^2.0.0: integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^3.0.0: version "3.0.0" @@ -12723,13 +12973,6 @@ pkg-up@3.1.0, pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - platform@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" @@ -13354,9 +13597,9 @@ postcss-safe-parser@^6.0.0: integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== postcss-scss@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.2.tgz#39ddcc0ab32f155d5ab328ee91353d67a52d537b" - integrity sha512-xfdkU128CkKKKVAwkyt0M8OdnelJ3MRcIRAPPQkRpoPeuzWY3RIeg7piRCpZ79MK7Q16diLXMMAD9dN5mauPlQ== + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.3.tgz#36c23c19a804274e722e83a54d20b838ab4767ac" + integrity sha512-j4KxzWovfdHsyxwl1BxkUal/O4uirvHgdzMKS1aWJBAV0qh2qj5qAZqpeBfVUYGWv+4iK9Az7SPyZ4fyNju1uA== postcss-selector-matches@^4.0.0: version "4.0.0" @@ -13392,18 +13635,10 @@ 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.6" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz#2c5bba8174ac2f6981ab631a42ab0ee54af332ea" - integrity sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg== - dependencies: - cssesc "^3.0.0" - util-deprecate "^1.0.2" - -postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.7: - version "6.0.8" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz#f023ed7a9ea736cd7ef70342996e8e78645a7914" - integrity sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ== +postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.9: + version "6.0.9" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f" + integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -13431,10 +13666,10 @@ postcss-value-parser@^3.0.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== -postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" - integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== +postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: version "2.0.1" @@ -13463,7 +13698,7 @@ postcss@7.0.32: source-map "^0.6.1" supports-color "^6.1.0" -postcss@7.0.36, postcss@^7, postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: +postcss@7.0.36: version "7.0.36" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb" integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== @@ -13472,14 +13707,6 @@ postcss@7.0.36, postcss@^7, postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, pos source-map "^0.6.1" supports-color "^6.1.0" -postcss@7.x.x: - version "7.0.39" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" - integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== - dependencies: - picocolors "^0.2.1" - source-map "^0.6.1" - postcss@8.1.7: version "8.1.7" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.1.7.tgz#ff6a82691bd861f3354fd9b17b2332f88171233f" @@ -13490,7 +13717,7 @@ postcss@8.1.7: nanoid "^3.1.16" source-map "^0.6.1" -postcss@8.4.5, postcss@^8.3.11, postcss@^8.4.4: +postcss@8.4.5: version "8.4.5" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95" integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg== @@ -13499,14 +13726,22 @@ postcss@8.4.5, postcss@^8.3.11, postcss@^8.4.4: picocolors "^1.0.0" source-map-js "^1.0.1" -postcss@^8.1.0: - version "8.3.7" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.7.tgz#ec88563588c8da8e58e7226f7633b51ae221eeda" - integrity sha512-9SaY7nnyQ63/WittqZYAvkkYPyKxchMKH71UDzeTmWuLSvxTRpeEeABZAzlCi55cuGcoFyoV/amX2BdsafQidQ== +postcss@^7, postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: + version "7.0.39" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" + integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== + dependencies: + picocolors "^0.2.1" + source-map "^0.6.1" + +postcss@^8.1.0, postcss@^8.4.12, postcss@^8.4.4: + version "8.4.12" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.12.tgz#1e7de78733b28970fa4743f7da6f3763648b1905" + integrity sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg== dependencies: - nanocolors "^0.1.5" - nanoid "^3.1.25" - source-map-js "^0.6.2" + nanoid "^3.3.1" + picocolors "^1.0.0" + source-map-js "^1.0.2" prebuild-install@^6.0.0: version "6.1.4" @@ -13555,7 +13790,7 @@ pretty-error@^2.1.1: lodash "^4.17.20" renderkid "^2.0.4" -pretty-format@^26.6.0, pretty-format@^26.6.2: +pretty-format@^26.0.0, pretty-format@^26.6.0, pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== @@ -13565,20 +13800,19 @@ pretty-format@^26.6.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-format@^27.0.0, pretty-format@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.0.tgz#ee37a94ce2a79765791a8649ae374d468c18ef19" - integrity sha512-KyJdmgBkMscLqo8A7K77omgLx5PWPiXJswtTtFV7XgVZv2+qPk6UivpXXO+5k6ZEbWIbLoKdx1pZ6ldINzbwTA== +pretty-format@^27.0.0, pretty-format@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== dependencies: - "@jest/types" "^27.1.1" - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== +printj@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/printj/-/printj-1.3.1.tgz#9af6b1d55647a1587ac44f4c1654a4b95b8e12cb" + integrity sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg== process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" @@ -13632,9 +13866,9 @@ prompts@2.4.0: sisteransi "^1.0.5" prompts@^2.0.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" - integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" sisteransi "^1.0.5" @@ -13646,7 +13880,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@15.7.2, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -13655,6 +13889,15 @@ prop-types@15.7.2, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -13672,7 +13915,7 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" -proxy-addr@~2.0.5: +proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== @@ -13752,22 +13995,22 @@ q@^1.1.2, q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@6.9.7: + version "6.9.7" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe" + integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw== qs@^6.9.4: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== + version "6.10.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" + integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== dependencies: side-channel "^1.0.4" qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== query-string@^4.1.0: version "4.3.4" @@ -13849,16 +14092,6 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - raw-body@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" @@ -13869,6 +14102,16 @@ raw-body@2.4.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.3.tgz#8f80305d11c2a0a545c2d9d89d7a0286fcead43c" + integrity sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g== + dependencies: + bytes "3.1.2" + http-errors "1.8.1" + iconv-lite "0.4.24" + unpipe "1.0.0" + rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -13892,9 +14135,9 @@ react-app-polyfill@^2.0.0: whatwg-fetch "^3.4.1" react-datepicker@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-4.3.0.tgz#f2e2fc652b7ed3c231663d858da4a3c67f470784" - integrity sha512-cg+gp4YnPcZc6iZ0+v7VuRgcFG22KL7izHYrCxXeSLOn5VGkyxTfcu5qA/cGIsngurCt/u0NtgVTlHB1Fwap1g== + version "4.7.0" + resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-4.7.0.tgz#75e03b0a6718b97b84287933307faf2ed5f03cf4" + integrity sha512-FS8KgbwqpxmJBv/bUdA42MYqYZa+fEYcpc746DZiHvVE2nhjrW/dg7c5B5fIUuI8gZET6FOzuDgezNcj568Czw== dependencies: "@popperjs/core" "^2.9.2" classnames "^2.2.6" @@ -13974,9 +14217,9 @@ react-dom@^16.13.1: scheduler "^0.19.1" react-error-overlay@^6.0.7, react-error-overlay@^6.0.9: - version "6.0.9" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" - integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== + version "6.0.10" + resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.10.tgz#0fe26db4fa85d9dbb8624729580e90e7159a59a6" + integrity sha512-mKR90fX7Pm5seCOfz8q9F+66VCc1PGsWSBxKbITjfKVQHMNF2zudxHnMdJiB1fRCb+XsbQV9sO9DCkgsMQgBIA== react-fast-compare@^3.0.1: version "3.2.0" @@ -13992,16 +14235,16 @@ react-input-range@^1.3.0: prop-types "^15.5.8" react-intersection-observer@^8.31.0: - version "8.32.1" - resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-8.32.1.tgz#9b949871eb35eb1fc730732bbf8fcfaaaf3f5b02" - integrity sha512-FOmMkMw7MeJ8FkuADpU8TRcvGuTvPB+DRkaikS1QXcWArYLCWC3mjRorq2XeRGBuqmaueOBd27PUazTu9AgInw== + version "8.33.1" + resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-8.33.1.tgz#8e6442cac7052ed63056e191b7539e423e7d5c64" + integrity sha512-3v+qaJvp3D1MlGHyM+KISVg/CMhPiOlO6FgPHcluqHkx4YFCLuyXNlQ/LE6UkbODXlQcLOppfX6UMxCEkUhDLw== react-is@16.13.1, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-is@^17.0.1: +react-is@^17.0.1, react-is@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== @@ -14025,16 +14268,16 @@ react-property@1.0.1: integrity sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ== react-redux@^7.2.0: - version "7.2.5" - resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.5.tgz#213c1b05aa1187d9c940ddfc0b29450957f6a3b8" - integrity sha512-Dt29bNyBsbQaysp6s/dN0gUodcq+dVKKER8Qv82UrpeygwYeX1raTtil7O/fftw/rFqzaf6gJhDZRkkZnn6bjg== + version "7.2.6" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.6.tgz#49633a24fe552b5f9caf58feb8a138936ddfe9aa" + integrity sha512-10RPdsz0UUrRL1NZE0ejTkucnclYSgXp5q+tB5SWx2qeG2ZJQJyymgAhwKy73yiL/13btfB6fPr+rgbMAaZIAQ== dependencies: - "@babel/runtime" "^7.12.1" - "@types/react-redux" "^7.1.16" + "@babel/runtime" "^7.15.4" + "@types/react-redux" "^7.1.20" hoist-non-react-statics "^3.3.2" loose-envify "^1.4.0" prop-types "^15.7.2" - react-is "^16.13.1" + react-is "^17.0.2" react-refresh@0.8.3, react-refresh@^0.8.3: version "0.8.3" @@ -14153,9 +14396,9 @@ react-vimeo@^2.0.0: keymirror "^0.1.1" react-youtube@^7.11.2: - version "7.13.1" - resolved "https://registry.yarnpkg.com/react-youtube/-/react-youtube-7.13.1.tgz#3b327599a687bf22e071468818522920b36bcb57" - integrity sha512-b++TLHmHDpd0ZBS1wcbYabbuchU+W4jtx5A2MUQX0BINNKKsaIQX29sn/aLvZ9v5luwAoceia3VGtyz9blaB9w== + version "7.14.0" + resolved "https://registry.yarnpkg.com/react-youtube/-/react-youtube-7.14.0.tgz#0505d86491521ca94ef0afb74af3f7936dc7bc86" + integrity sha512-SUHZ4F4pd1EHmQu0CV0KSQvAs5KHOT5cfYaq4WLCcDbU8fBo1ouTXaAOIASWbrz8fHwg+G1evfoSIYpV2AwSAg== dependencies: fast-deep-equal "3.1.3" prop-types "15.7.2" @@ -14375,16 +14618,16 @@ redent@^3.0.0: strip-indent "^3.0.0" redux@^4.0.0, redux@^4.0.5: - version "4.1.1" - resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.1.tgz#76f1c439bb42043f985fbd9bf21990e60bd67f47" - integrity sha512-hZQZdDEM25UY2P493kPYuKqviVwZ58lEmGQNeQ+gXa+U0gYPUBf7NKYazbe3m+bs/DzM/ahN12DbF+NG8i0CWw== + version "4.1.2" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.2.tgz#140f35426d99bb4729af760afcf79eaaac407104" + integrity sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw== dependencies: "@babel/runtime" "^7.9.2" -regenerate-unicode-properties@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326" - integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA== +regenerate-unicode-properties@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56" + integrity sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw== dependencies: regenerate "^1.4.2" @@ -14423,10 +14666,10 @@ regex-parser@^2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== -regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== +regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz#b3f4c0059af9e47eca9f3f660e51d81307e72307" + integrity sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" @@ -14441,27 +14684,27 @@ regexpp@^3.0.0, regexpp@^3.1.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -regexpu-core@^4.7.1: - version "4.8.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" - integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg== +regexpu-core@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.0.1.tgz#c531122a7840de743dcf9c83e923b5560323ced3" + integrity sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw== dependencies: regenerate "^1.4.2" - regenerate-unicode-properties "^9.0.0" - regjsgen "^0.5.2" - regjsparser "^0.7.0" + regenerate-unicode-properties "^10.0.1" + regjsgen "^0.6.0" + regjsparser "^0.8.2" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.0.0" -regjsgen@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" - integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== +regjsgen@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.6.0.tgz#83414c5354afd7d6627b16af5f10f41c4e71808d" + integrity sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA== -regjsparser@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968" - integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ== +regjsparser@^0.8.2: + version "0.8.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.8.4.tgz#8a14285ffcc5de78c5b95d62bbf413b6bc132d5f" + integrity sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA== dependencies: jsesc "~0.5.0" @@ -14565,9 +14808,9 @@ requires-port@^1.0.0: integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= reselect@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7" - integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA== + version "4.1.5" + resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.5.tgz#852c361247198da6756d07d9296c2b51eddb79f6" + integrity sha512-uVdlz8J7OO+ASpBYoz1Zypgx0KasCY20H+N8JD13oUMtPvSHQuscrHop4KbXrbsBcdB9Ds7lVK7eRkBIfO43vQ== resolve-cwd@^2.0.0: version "2.0.0" @@ -14648,7 +14891,7 @@ resolve@1.18.1: is-core-module "^2.0.0" path-parse "^1.0.6" -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -14656,6 +14899,15 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.1 is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.8.1: + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + dependencies: + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.3: version "2.0.0-next.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" @@ -14760,6 +15012,15 @@ rollup-plugin-babel@^4.3.3: "@babel/helper-module-imports" "^7.0.0" rollup-pluginutils "^2.8.1" +rollup-plugin-dts@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-3.0.2.tgz#2b628d88f864d271d6eaec2e4c2a60ae4e944c5c" + integrity sha512-hswlsdWu/x7k5pXzaLP6OvKRKcx8Bzprksz9i9mUe72zvt8LvqAb/AZpzs6FkLgmyRaN8B6rUQOVtzA3yEt9Yw== + dependencies: + magic-string "^0.25.7" + optionalDependencies: + "@babel/code-frame" "^7.12.13" + rollup-plugin-terser@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.1.tgz#8c650062c22a8426c64268548957463bf981b413" @@ -14771,6 +15032,27 @@ rollup-plugin-terser@^5.3.1: serialize-javascript "^4.0.0" terser "^4.6.2" +rollup-plugin-terser@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" + integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + +rollup-plugin-typescript2@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz#1cc99ac2309bf4b9d0a3ebdbc2002aecd56083d3" + integrity sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ== + dependencies: + "@rollup/pluginutils" "^4.1.0" + find-cache-dir "^3.3.1" + fs-extra "8.1.0" + resolve "1.20.0" + tslib "2.1.0" + rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" @@ -14787,6 +15069,13 @@ rollup@^1.31.1: "@types/node" "*" acorn "^7.1.0" +rollup@^2.45.2: + version "2.70.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.70.1.tgz#824b1f1f879ea396db30b0fc3ae8d2fead93523e" + integrity sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA== + optionalDependencies: + fsevents "~2.3.2" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -14823,7 +15112,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -14882,9 +15171,9 @@ sass-loader@10.0.5: semver "^7.3.2" sass-loader@^10.0.5: - version "10.2.0" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.2.0.tgz#3d64c1590f911013b3fa48a0b22a83d5e1494716" - integrity sha512-kUceLzC1gIHz0zNJPpqRsJyisWatGYNFRmv2CKZK2/ngMJgLqxTbXwe/hJ85luyvZkgqU3VlJ33UVF2T/0g6mw== + version "10.2.1" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.2.1.tgz#17e51df313f1a7a203889ce8ff91be362651276e" + integrity sha512-RRvWl+3K2LSMezIsd008ErK4rk6CulIMSwrcc2aZvjymUgKo/vjXGp1rSWmfTUX7bblEOz8tst4wBwWtCGBqKA== dependencies: klona "^2.0.4" loader-utils "^2.0.0" @@ -14949,6 +15238,16 @@ schema-utils@^3.0.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" + integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.8.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.0.0" + scss-tokenizer@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" @@ -14963,9 +15262,9 @@ select-hose@^2.0.0: integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= selfsigned@^1.10.8: - version "1.10.11" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.11.tgz#24929cd906fe0f44b6d01fb23999a739537acbe9" - integrity sha512-aVmbPOfViZqOZPgRBT0+3u4yZFHpmnIghLMlAcb5/xhp5ZtB/RVnKhz5vl2M32CLXAqR4kha9zfhNg0Lf/sxKA== + version "1.10.14" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.14.tgz#ee51d84d9dcecc61e07e4aba34f229ab525c1574" + integrity sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA== dependencies: node-forge "^0.10.0" @@ -14999,27 +15298,27 @@ semver@7.3.2: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== +send@0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" + integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== dependencies: debug "2.6.9" depd "~1.1.2" @@ -15028,9 +15327,9 @@ send@0.17.1: escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "~1.7.2" + http-errors "1.8.1" mime "1.6.0" - ms "2.1.1" + ms "2.1.3" on-finished "~2.3.0" range-parser "~1.2.1" statuses "~1.5.0" @@ -15062,15 +15361,15 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== +serve-static@1.14.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" + integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.1" + send "0.17.2" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -15102,6 +15401,11 @@ setprototypeof@1.1.1: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -15176,10 +15480,10 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" - integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== simple-concat@^1.0.0: version "1.0.1" @@ -15196,9 +15500,9 @@ simple-get@^3.0.3: simple-concat "^1.0.0" simple-get@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.0.tgz#73fa628278d21de83dadd5512d2cc1f4872bd675" - integrity sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ== + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== dependencies: decompress-response "^6.0.0" once "^1.3.1" @@ -15212,12 +15516,12 @@ simple-swizzle@^0.2.2: is-arrayish "^0.3.1" sirv@^1.0.7: - version "1.0.17" - resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.17.tgz#86e2c63c612da5a1dace1c16c46f524aaa26ac45" - integrity sha512-qx9go5yraB7ekT7bCMqUHJ5jEaOC/GXBxUWv+jeWnb7WzHUFdcQPGWk7YmAwFBaQBrogpuSqd/azbC2lZRqqmw== + version "1.0.19" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49" + integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ== dependencies: "@polka/url" "^1.0.0-next.20" - mime "^2.3.1" + mrmime "^1.0.0" totalist "^1.0.0" sister@^3.0.0: @@ -15304,24 +15608,23 @@ snapdragon@^0.8.1: use "^3.1.0" sockjs-client@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.5.2.tgz#4bc48c2da9ce4769f19dc723396b50f5c12330a3" - integrity sha512-ZzRxPBISQE7RpzlH4tKJMQbHM9pabHluk0WBaxAQ+wm/UieeBVBou0p4wVnSQGN9QmpAZygQ0cDIypWuqOFmFQ== + version "1.6.0" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.6.0.tgz#e0277b8974558edcb557eafc7d3027ef6128d865" + integrity sha512-qVHJlyfdHFht3eBFZdKEXKTlb7I4IV41xnVNo8yUKA1UHcPJwgW2SvTq9LhnjjCywSkSK7c/e4nghU0GOoMCRQ== dependencies: - debug "^3.2.6" - eventsource "^1.0.7" - faye-websocket "^0.11.3" + debug "^3.2.7" + eventsource "^1.1.0" + faye-websocket "^0.11.4" inherits "^2.0.4" - json3 "^3.3.3" - url-parse "^1.5.3" + url-parse "^1.5.10" sockjs@^0.3.21: - version "0.3.21" - resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.21.tgz#b34ffb98e796930b60a0cfa11904d6a339a7d417" - integrity sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw== + version "0.3.24" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" + integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== dependencies: faye-websocket "^0.11.3" - uuid "^3.4.0" + uuid "^8.3.2" websocket-driver "^0.7.4" socks-proxy-agent@^4.0.0: @@ -15359,15 +15662,10 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== - -source-map-js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" - integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== +source-map-js@^1.0.1, source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.3" @@ -15389,9 +15687,9 @@ source-map-resolve@^0.6.0: decode-uri-component "^0.2.0" source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.19, source-map-support@~0.5.20: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -15430,7 +15728,7 @@ source-map@^0.5.0, source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -sourcemap-codec@^1.4.4: +sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== @@ -15457,9 +15755,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + version "3.0.11" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" + integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== spdy-transport@^3.0.0: version "3.0.0" @@ -15528,9 +15826,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -15569,9 +15867,9 @@ stack-utils@^2.0.2: escape-string-regexp "^2.0.0" stackframe@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.0.tgz#52429492d63c62eb989804c11552e3d22e779303" - integrity sha512-GrdeshiRmS1YLMYgzF16olf2jJ/IzxXY9lhKOskuVziubpTYcYqyOwYeJKzQkwy7uN0fYSsbsC4RQaXf9LCrYA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.1.tgz#1033a3473ee67f08e2f2fc8eba6aef4f845124e1" + integrity sha512-h88QkzREN/hy8eRdyNhhsO7RSJ5oyTqxxmmn0dzBIMUclZsjpfmrsg81vp8mjjAs2vAZ72nyWxRUwSwmh0e4xg== stacktrace-parser@0.1.10: version "0.1.10" @@ -15685,6 +15983,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -15694,27 +16001,18 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string.prototype.matchall@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.5.tgz#59370644e1db7e4c0c045277690cf7b01203c4da" - integrity sha512-Z5ZaXO0svs0M2xd/6By3qpeKpLKd9mO4v4q3oMEQrk8Ck4xOD5d5XeBOOjGrmVZZ/AHB1S0CgG4N5r1G9N3E2Q== +string.prototype.matchall@^4.0.6: + version "4.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" + integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" - has-symbols "^1.0.2" + has-symbols "^1.0.3" internal-slot "^1.0.3" - regexp.prototype.flags "^1.3.1" + regexp.prototype.flags "^1.4.1" side-channel "^1.0.4" string.prototype.trimend@^1.0.4: @@ -15945,9 +16243,9 @@ stylelint-config-recommended@^6.0.0: integrity sha512-ZorSSdyMcxWpROYUvLEMm0vSZud2uB7tX1hzBZwvVY9SV/uly4AvvJPPhCcymZL3fcQhEQG5AELmrxWqtmzacw== stylelint-scss@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-4.1.0.tgz#39b808696f8152081163d970449257ff80b5c041" - integrity sha512-BNYTo7MMamhFOlcaAWp2dMpjg6hPyM/FFqfDIYzmYVLMmQJqc8lWRIiTqP4UX5bresj9Vo0dKC6odSh43VP2NA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-4.2.0.tgz#e25fd390ee38a7e89fcfaec2a8f9dce2ec6ddee8" + integrity sha512-HHHMVKJJ5RM9pPIbgJ/XA67h9H0407G68Rm69H4fzFbFkyDMcTV1Byep3qdze5+fJ3c0U7mJrbj6S0Fg072uZA== dependencies: lodash "^4.17.21" postcss-media-query-parser "^0.2.3" @@ -15961,33 +16259,33 @@ stylelint-use-logical@^1.1.0: integrity sha512-WwYAEoUNXxu4A9tZ+mPnvFSf3wKG9mY9+ZqnNjVHikfOQA4MTO6XeSC8BGCsY7LOG0GnDfmxMrRUJXFZRtaCmg== stylelint-webpack-plugin@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/stylelint-webpack-plugin/-/stylelint-webpack-plugin-3.1.0.tgz#97cf140c0973515a13e2db970e3f94a8f13e9c56" - integrity sha512-qKBj9s2BVnxwQXdqRKd637gtASYel6FA/a9PfyfsplUqiBmBjJeeTrcJPp9v/HEN4FRw2CJDNbO2xuYUF7DsuA== + version "3.2.0" + resolved "https://registry.yarnpkg.com/stylelint-webpack-plugin/-/stylelint-webpack-plugin-3.2.0.tgz#432f519e87b5f272279a707690e700277826f4ae" + integrity sha512-KY4P+0wrs5G680LzNLt8UZDiX3j+UNNDt1BBEdlhZUiUUYAI0j9Lumf5QH9eRHx/uMZcpKbboiYWba0F+jMWTg== dependencies: - "@types/stylelint" "^13.13.3" - globby "^11.0.4" - jest-worker "^27.3.1" + globby "^11.1.0" + jest-worker "^27.5.1" micromatch "^4.0.4" normalize-path "^3.0.0" - schema-utils "^3.1.1" + schema-utils "^4.0.0" stylelint@^14.1.0: - version "14.2.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-14.2.0.tgz#da4f0f4580e66911c38c376ed82447b78e32b0fb" - integrity sha512-i0DrmDXFNpDsWiwx6SPRs4/pyw4kvZgqpDGvsTslQMY7hpUl6r33aQvNSn6cnTg2wtZ9rreFElI7XAKpOWi1vQ== + version "14.6.1" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-14.6.1.tgz#aff137b0254515fc36b91921d88a3eb2edc194bf" + integrity sha512-FfNdvZUZdzh9KDQxDnO7Opp+prKh8OQVuSW8S13cBtxrooCbm6J6royhUeb++53WPMt04VB+ZbOz/QmzAijs6Q== dependencies: balanced-match "^2.0.0" colord "^2.9.2" cosmiconfig "^7.0.1" - debug "^4.3.3" + css-functions-list "^3.0.1" + debug "^4.3.4" execall "^2.0.0" - fast-glob "^3.2.7" + fast-glob "^3.2.11" fastest-levenshtein "^1.0.12" file-entry-cache "^6.0.1" get-stdin "^8.0.0" global-modules "^2.0.0" - globby "^11.0.4" + globby "^11.1.0" globjoin "^0.1.4" html-tags "^3.1.0" ignore "^5.2.0" @@ -16001,21 +16299,22 @@ stylelint@^14.1.0: normalize-path "^3.0.0" normalize-selector "^0.2.0" picocolors "^1.0.0" - postcss "^8.3.11" + postcss "^8.4.12" postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" postcss-safe-parser "^6.0.0" - postcss-selector-parser "^6.0.7" - postcss-value-parser "^4.1.0" + postcss-selector-parser "^6.0.9" + postcss-value-parser "^4.2.0" resolve-from "^5.0.0" specificity "^0.4.1" string-width "^4.2.3" strip-ansi "^6.0.1" style-search "^0.1.0" + supports-hyperlinks "^2.2.0" svg-tags "^1.0.0" - table "^6.7.5" + table "^6.8.0" v8-compile-cache "^2.3.0" - write-file-atomic "^3.0.3" + write-file-atomic "^4.0.1" stylis-rule-sheet@0.0.10: version "0.0.10" @@ -16074,7 +16373,7 @@ supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.0.0: +supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== @@ -16082,6 +16381,11 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + svg-parser@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5" @@ -16126,22 +16430,10 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" - -table@^6.7.5: - version "6.7.5" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.5.tgz#f04478c351ef3d8c7904f0e8be90a1b62417d238" - integrity sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw== +table@^6.0.9, table@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" + integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== dependencies: ajv "^8.0.1" lodash.truncate "^4.4.2" @@ -16291,11 +16583,12 @@ terser@^4.1.2, terser@^4.6.2, terser@^4.6.3: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.3.4: - version "5.9.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" - integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== +terser@^5.0.0, terser@^5.3.4: + version "5.12.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.1.tgz#4cf2ebed1f5bceef5c83b9f60104ac4a78b49e9c" + integrity sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ== dependencies: + acorn "^8.5.0" commander "^2.20.0" source-map "~0.7.2" source-map-support "~0.5.20" @@ -16392,9 +16685,9 @@ timsort@^0.3.0: integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= tiny-invariant@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" - integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9" + integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg== tiny-warning@^1.0.0, tiny-warning@^1.0.3: version "1.0.3" @@ -16408,7 +16701,7 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmpl@1.0.x: +tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== @@ -16460,6 +16753,11 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + totalist@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" @@ -16543,27 +16841,48 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== +ts-jest@^26.5.4: + version "26.5.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" + integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + jest-util "^26.1.0" + json5 "2.x" + lodash "4.x" + make-error "1.x" + mkdirp "1.x" + semver "7.x" + yargs-parser "20.x" + ts-pnp@1.2.0, ts-pnp@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== -tsconfig-paths@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" - integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== +tsconfig-paths@^3.12.0: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.1" - minimist "^1.2.0" + minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== + tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3: +tslib@^2.0.3, tslib@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -16646,7 +16965,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-is@~1.6.17, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -16660,9 +16979,9 @@ type@^1.0.1: integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== type@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== + version "2.6.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f" + integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== typedarray-to-buffer@^3.1.5: version "3.1.5" @@ -16681,15 +17000,15 @@ typescript@^3.8.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== -typescript@^4.0.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== +typescript@^4.0.3, typescript@^4.2.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" + integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== uglify-js@^3.1.4: - version "3.14.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" - integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== + version "3.15.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.3.tgz#9aa82ca22419ba4c0137642ba0df800cb06e0471" + integrity sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg== uid-number@0.0.6: version "0.0.6" @@ -16864,7 +17183,7 @@ url-loader@4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" -url-parse@^1.4.3, url-parse@^1.5.3: +url-parse@^1.4.3, url-parse@^1.5.10: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== @@ -16946,12 +17265,12 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.0.1, uuid@^3.3.2, uuid@^3.4.0: +uuid@^3.0.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uuid@^8.3.0: +uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -17062,11 +17381,11 @@ w3c-xmlserializer@^2.0.0: xml-name-validator "^3.0.0" walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: - makeerror "1.0.x" + makeerror "1.0.12" warning@^4.0.2: version "4.0.3" @@ -17136,14 +17455,14 @@ webidl-conversions@^6.1.0: integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== webpack-bundle-analyzer@^4.1.0: - version "4.4.2" - resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.4.2.tgz#39898cf6200178240910d629705f0f3493f7d666" - integrity sha512-PIagMYhlEzFfhMYOzs5gFT55DkUdkyrJi/SxJp8EF3YMWhS+T9vvs2EoTetpk5qb6VsCq02eXTlRDOydRhDFAQ== + version "4.5.0" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz#1b0eea2947e73528754a6f9af3e91b2b6e0f79d5" + integrity sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ== dependencies: acorn "^8.0.4" acorn-walk "^8.0.0" chalk "^4.1.0" - commander "^6.2.0" + commander "^7.2.0" gzip-size "^6.0.0" lodash "^4.17.20" opener "^1.5.2" @@ -17365,9 +17684,9 @@ which-module@^2.0.0: integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which-pm-runs@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" - integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + version "1.1.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.1.0.tgz#35ccf7b1a0fce87bd8b92a478c9d045785d3bf35" + integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA== which@1, which@1.3.1, which@^1.2.9, which@^1.3.1: version "1.3.1" @@ -17383,13 +17702,20 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wide-align@1.1.3, wide-align@^1.1.0: +wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" +wide-align@^1.1.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== + dependencies: + string-width "^1.0.2 || 2 || 3 || 4" + windows-release@^3.1.0: version "3.3.3" resolved "https://registry.yarnpkg.com/windows-release/-/windows-release-3.3.3.tgz#1c10027c7225743eec6b89df160d64c2e0293999" @@ -17615,7 +17941,7 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: +write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -17625,6 +17951,14 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" + integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + write-json-file@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" @@ -17672,9 +18006,9 @@ ws@^6.2.1: async-limiter "~1.0.0" ws@^7.3.1, ws@^7.4.6: - version "7.5.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + version "7.5.7" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" + integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== xml-name-validator@^3.0.0: version "3.0.0" @@ -17734,6 +18068,11 @@ yargs-parser@13.1.2, yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^15.0.1: version "15.0.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.3.tgz#316e263d5febe8b38eef61ac092b33dfcc9b1115" @@ -17750,11 +18089,6 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-unparser@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" From 14d132484b9c9b3b42ef70cda7ed71b20d001bea Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Wed, 30 Mar 2022 18:13:49 +0300 Subject: [PATCH 005/192] Fixed translations --- packages/scandipwa/i18n/da_DK.json | 15 +-------------- packages/scandipwa/i18n/de_DE.json | 15 +-------------- packages/scandipwa/i18n/es_ES.json | 15 +-------------- packages/scandipwa/i18n/fa_IR.json | 15 +-------------- packages/scandipwa/i18n/fi_FI.json | 15 +-------------- packages/scandipwa/i18n/fr_FR.json | 15 +-------------- packages/scandipwa/i18n/it_IT.json | 15 +-------------- packages/scandipwa/i18n/lv_LV.json | 15 +-------------- packages/scandipwa/i18n/nb_NO.json | 15 +-------------- packages/scandipwa/i18n/nl_NL.json | 15 +-------------- packages/scandipwa/i18n/pl_PL.json | 15 +-------------- packages/scandipwa/i18n/pt_BR.json | 15 +-------------- packages/scandipwa/i18n/ru_RU.json | 15 +-------------- packages/scandipwa/i18n/sl_SI.json | 15 +-------------- packages/scandipwa/i18n/sv_SE.json | 15 +-------------- packages/scandipwa/i18n/tr_TR.json | 15 +-------------- packages/scandipwa/i18n/zh_TW.json | 15 +-------------- 17 files changed, 17 insertions(+), 238 deletions(-) diff --git a/packages/scandipwa/i18n/da_DK.json b/packages/scandipwa/i18n/da_DK.json index d8ca368c88..4d52b3be6d 100644 --- a/packages/scandipwa/i18n/da_DK.json +++ b/packages/scandipwa/i18n/da_DK.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/de_DE.json b/packages/scandipwa/i18n/de_DE.json index 412d35c914..0939d88e29 100644 --- a/packages/scandipwa/i18n/de_DE.json +++ b/packages/scandipwa/i18n/de_DE.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/es_ES.json b/packages/scandipwa/i18n/es_ES.json index c7cabd3652..9683aeddaf 100644 --- a/packages/scandipwa/i18n/es_ES.json +++ b/packages/scandipwa/i18n/es_ES.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/fa_IR.json b/packages/scandipwa/i18n/fa_IR.json index 1e511b8853..0110460fa1 100644 --- a/packages/scandipwa/i18n/fa_IR.json +++ b/packages/scandipwa/i18n/fa_IR.json @@ -451,7 +451,6 @@ "Up to %s": null, "From %s": null, "From %s to %s": null, - "Please fill in all rating fields": null, "Product %s thumbnail.": null, "County": null, "State/Province": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/fi_FI.json b/packages/scandipwa/i18n/fi_FI.json index 7c0eb7891d..19fa3ea3d2 100644 --- a/packages/scandipwa/i18n/fi_FI.json +++ b/packages/scandipwa/i18n/fi_FI.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/fr_FR.json b/packages/scandipwa/i18n/fr_FR.json index e494bd28b5..105a7aaaac 100644 --- a/packages/scandipwa/i18n/fr_FR.json +++ b/packages/scandipwa/i18n/fr_FR.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/it_IT.json b/packages/scandipwa/i18n/it_IT.json index 82d7c04e83..91f87ec1f2 100644 --- a/packages/scandipwa/i18n/it_IT.json +++ b/packages/scandipwa/i18n/it_IT.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/lv_LV.json b/packages/scandipwa/i18n/lv_LV.json index fc26d2f764..a213587f46 100644 --- a/packages/scandipwa/i18n/lv_LV.json +++ b/packages/scandipwa/i18n/lv_LV.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/nb_NO.json b/packages/scandipwa/i18n/nb_NO.json index 1dc9a1ae8f..644b7159e5 100644 --- a/packages/scandipwa/i18n/nb_NO.json +++ b/packages/scandipwa/i18n/nb_NO.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/nl_NL.json b/packages/scandipwa/i18n/nl_NL.json index 2bb7fa4bd8..8db797c052 100644 --- a/packages/scandipwa/i18n/nl_NL.json +++ b/packages/scandipwa/i18n/nl_NL.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/pl_PL.json b/packages/scandipwa/i18n/pl_PL.json index 7136afb1a8..7171d8e889 100644 --- a/packages/scandipwa/i18n/pl_PL.json +++ b/packages/scandipwa/i18n/pl_PL.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/pt_BR.json b/packages/scandipwa/i18n/pt_BR.json index d60ed77347..50d11c84ca 100644 --- a/packages/scandipwa/i18n/pt_BR.json +++ b/packages/scandipwa/i18n/pt_BR.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/ru_RU.json b/packages/scandipwa/i18n/ru_RU.json index 6634dc7f2e..35b99864ef 100644 --- a/packages/scandipwa/i18n/ru_RU.json +++ b/packages/scandipwa/i18n/ru_RU.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/sl_SI.json b/packages/scandipwa/i18n/sl_SI.json index ba20c15347..8498a8f9ed 100644 --- a/packages/scandipwa/i18n/sl_SI.json +++ b/packages/scandipwa/i18n/sl_SI.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/sv_SE.json b/packages/scandipwa/i18n/sv_SE.json index 5ca267ca61..c86a3945ad 100644 --- a/packages/scandipwa/i18n/sv_SE.json +++ b/packages/scandipwa/i18n/sv_SE.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/tr_TR.json b/packages/scandipwa/i18n/tr_TR.json index 1489304896..5c80f09edc 100644 --- a/packages/scandipwa/i18n/tr_TR.json +++ b/packages/scandipwa/i18n/tr_TR.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} diff --git a/packages/scandipwa/i18n/zh_TW.json b/packages/scandipwa/i18n/zh_TW.json index 624ac1713a..a5bdf774f9 100644 --- a/packages/scandipwa/i18n/zh_TW.json +++ b/packages/scandipwa/i18n/zh_TW.json @@ -516,7 +516,6 @@ "Checkbox": null, "Radio": null, "Breadcrumbs": null, - "Please fill in all rating fields": null, "My Orders": null, "My Downloadable": null, "My Wish List": null, @@ -582,21 +581,9 @@ "List navigation": null, "Not possible to fetch while offline": null, "Buy %s with ": null, - "%s% discount each": null, - "Product list navigation": null, - "Maximum %s characters. Field required": null, "Maximum %s characters (%s remaining)": null, - "Maximum %s characters (%s too many!)": null, "Maximum %s characters": null, - "Field required": null, "Maximum %s characters (%s too many)": null, - "Field Required": null, - "Maximum %s characters.": null, - "\nField Required": null, - "Maximum %s characters.\nField required": null, - "Field required\nMaximum %s characters.": null, - "If there is an account associated with %s the provided address you will receive an email with a link to reset your password": null, - "If there is an account associated with %s you will receive an email with a link to reset your password.": null, "If there is an account associated with %s you will receive an email with a link to reset your password": null, " discount each": null, "Sort by": null, @@ -606,4 +593,4 @@ "You saved the account information.": null, "Minimum of different classes of characters in password is %s. ": null, "Classes of characters: Lower Case, Upper Case, Digits, Special Characters.": null -} \ No newline at end of file +} From 71e46732e3191376865aeddf143d8393a91c5681 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Thu, 31 Mar 2022 00:13:00 +0300 Subject: [PATCH 006/192] Migrated proptypes from types to TypeScript --- ...onIcon.config.js => ChevronIcon.config.ts} | 8 + .../{Stock.config.js => Stock.config.ts} | 6 + ...yPage.config.js => CategoryPage.config.ts} | 6 + ...{Checkout.config.js => Checkout.config.ts} | 7 + .../{Account.type.d.ts => Account.type.ts} | 40 ++- ...adcrumbs.type.d.ts => Breadcrumbs.type.ts} | 4 +- .../src/type/{CMS.type.d.ts => CMS.type.ts} | 12 +- .../{Category.type.d.ts => Category.type.ts} | 22 +- packages/scandipwa/src/type/Checkout.type.ts | 44 +++ .../type/{Common.type.d.ts => Common.type.ts} | 14 +- packages/scandipwa/src/type/Config.type.ts | 39 +++ packages/scandipwa/src/type/Device.type.ts | 21 ++ ...oadable.type.d.ts => Downloadable.type.ts} | 4 +- packages/scandipwa/src/type/Error.type.ts | 18 + packages/scandipwa/src/type/Field.type.ts | 74 ++++ packages/scandipwa/src/type/Menu.type.ts | 32 ++ packages/scandipwa/src/type/MiniCart.type.ts | 57 ++++ .../src/type/NotificationList.type.ts | 28 ++ .../type/{Order.type.d.ts => Order.type.ts} | 72 ++-- packages/scandipwa/src/type/Price.type.d.ts | 67 ---- packages/scandipwa/src/type/Price.type.ts | 67 ++++ .../scandipwa/src/type/ProductList.type.ts | 316 ++++++++++++++++++ .../type/{Rating.type.d.ts => Rating.type.ts} | 14 +- .../type/{Router.type.d.ts => Router.type.ts} | 14 +- .../type/{Slider.type.d.ts => Slider.type.ts} | 6 +- .../util/Validator/{Config.js => Config.ts} | 9 + 26 files changed, 842 insertions(+), 159 deletions(-) rename packages/scandipwa/src/component/ChevronIcon/{ChevronIcon.config.js => ChevronIcon.config.ts} (74%) rename packages/scandipwa/src/component/Product/{Stock.config.js => Stock.config.ts} (77%) rename packages/scandipwa/src/route/CategoryPage/{CategoryPage.config.js => CategoryPage.config.ts} (87%) rename packages/scandipwa/src/route/Checkout/{Checkout.config.js => Checkout.config.ts} (79%) rename packages/scandipwa/src/type/{Account.type.d.ts => Account.type.ts} (57%) rename packages/scandipwa/src/type/{Breadcrumbs.type.d.ts => Breadcrumbs.type.ts} (84%) rename packages/scandipwa/src/type/{CMS.type.d.ts => CMS.type.ts} (67%) rename packages/scandipwa/src/type/{Category.type.d.ts => Category.type.ts} (64%) create mode 100644 packages/scandipwa/src/type/Checkout.type.ts rename packages/scandipwa/src/type/{Common.type.d.ts => Common.type.ts} (53%) create mode 100644 packages/scandipwa/src/type/Config.type.ts create mode 100644 packages/scandipwa/src/type/Device.type.ts rename packages/scandipwa/src/type/{Downloadable.type.d.ts => Downloadable.type.ts} (79%) create mode 100644 packages/scandipwa/src/type/Error.type.ts create mode 100644 packages/scandipwa/src/type/Field.type.ts create mode 100644 packages/scandipwa/src/type/Menu.type.ts create mode 100644 packages/scandipwa/src/type/MiniCart.type.ts create mode 100644 packages/scandipwa/src/type/NotificationList.type.ts rename packages/scandipwa/src/type/{Order.type.d.ts => Order.type.ts} (65%) delete mode 100644 packages/scandipwa/src/type/Price.type.d.ts create mode 100644 packages/scandipwa/src/type/Price.type.ts create mode 100644 packages/scandipwa/src/type/ProductList.type.ts rename packages/scandipwa/src/type/{Rating.type.d.ts => Rating.type.ts} (74%) rename packages/scandipwa/src/type/{Router.type.d.ts => Router.type.ts} (75%) rename packages/scandipwa/src/type/{Slider.type.d.ts => Slider.type.ts} (82%) rename packages/scandipwa/src/util/Validator/{Config.js => Config.ts} (95%) diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.js b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts similarity index 74% rename from packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.js rename to packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts index d6789c23fd..f0266738ae 100644 --- a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.js +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -13,3 +14,10 @@ export const LEFT = 'left'; export const RIGHT = 'right'; export const TOP = 'top'; export const BOTTOM = 'bottom'; + +export enum Directions { + LEFT = 'left', + RIGHT = 'right', + TOP = 'top', + BOTTOM = 'bottom' +} diff --git a/packages/scandipwa/src/component/Product/Stock.config.js b/packages/scandipwa/src/component/Product/Stock.config.ts similarity index 77% rename from packages/scandipwa/src/component/Product/Stock.config.js rename to packages/scandipwa/src/component/Product/Stock.config.ts index 860fe50dfd..9637db8b2b 100644 --- a/packages/scandipwa/src/component/Product/Stock.config.js +++ b/packages/scandipwa/src/component/Product/Stock.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -14,3 +15,8 @@ export const STOCK_TYPE = { IN_STOCK: 'IN_STOCK', OUT_OF_STOCK: 'OUT_OF_STOCK' }; + +export enum StockStatus { + IN_STOCK = 'IN_STOCK', + OUT_OF_STOCK = 'OUT_OF_STOCK' +} diff --git a/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.js b/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts similarity index 87% rename from packages/scandipwa/src/route/CategoryPage/CategoryPage.config.js rename to packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts index 5647feabee..f52b8768ad 100644 --- a/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.js +++ b/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento @@ -26,3 +27,8 @@ export const SORT_DIRECTION_TYPE = { asc: 'ASC', desc: 'DESC' }; + +export enum SortDirections { + ASC = 'ASC', + DESC = 'DESC' +} diff --git a/packages/scandipwa/src/route/Checkout/Checkout.config.js b/packages/scandipwa/src/route/Checkout/Checkout.config.ts similarity index 79% rename from packages/scandipwa/src/route/Checkout/Checkout.config.js rename to packages/scandipwa/src/route/Checkout/Checkout.config.ts index bc259addfd..9d4457eaef 100644 --- a/packages/scandipwa/src/route/Checkout/Checkout.config.js +++ b/packages/scandipwa/src/route/Checkout/Checkout.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -13,6 +14,12 @@ export const SHIPPING_STEP = 'SHIPPING_STEP'; export const BILLING_STEP = 'BILLING_STEP'; export const DETAILS_STEP = 'DETAILS_STEP'; +export enum CheckoutSteps { + SHIPPING_STEP = 'SHIPPING_STEP', + BILLING_STEP = 'BILLING_STEP', + DETAILS_STEP = 'DETAILS_STEP' +} + export const CHECKOUT_URL = '/checkout'; export const BILLING_URL = '/checkout/billing'; export const SHIPPING_URL = '/checkout/shipping'; diff --git a/packages/scandipwa/src/type/Account.type.d.ts b/packages/scandipwa/src/type/Account.type.ts similarity index 57% rename from packages/scandipwa/src/type/Account.type.d.ts rename to packages/scandipwa/src/type/Account.type.ts index 912637d099..a00750830d 100644 --- a/packages/scandipwa/src/type/Account.type.d.ts +++ b/packages/scandipwa/src/type/Account.type.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,15 +10,36 @@ * @link https://github.com/scandipwa/scandipwa */ -export * from './Account.type'; +export enum MyAccountTabs { + MY_ACCOUNT = 'my-account', + MY_ORDERS = 'my-orders', + MY_ORDER = 'my-order', + MY_DOWNLOADABLE = 'my-downloadable', + MY_WISHLIST = 'my-wishlist', + ADDRESS_BOOK = 'address', + NEWSLETTER_SUBSCRIPTION = 'newsletter-subscription', + ACCOUNT_INFORMATION = 'edit', +} + +export enum MyAccountTabsSection { + FIRST_SECTION = 1, + SECOND_SECTION, + THIRD_SECTION +} + +export enum MyAccountEditTabs { + INFORMATION_EDIT = 'information_edit', + PASSWORD_EDIT = 'password_edit', + EMAIL_EDIT = 'email_edit' +} -export interface RegionType { +export type Region = { region_code: string | null region: string | null region_id: number } -export interface AddressType { +export type Address = { city: string company: string | null country_id: string @@ -30,17 +52,17 @@ export interface AddressType { middlename: string postcode: string prefix: string - region?: RegionType + region?: Region street: string | string[] suffix: string telephone: string vat_id: number | null } -export type AddressesType = AddressType[]; +export type Addresses = Address[]; -export interface CustomerType { - addresses: AddressesType +export type Customer = { + addresses: Addresses created_at: string default_billing: string default_shipping: string @@ -57,9 +79,9 @@ export interface CustomerType { taxvat: string } -export interface TabType { +export type Tab = { url: string name: string } -export type TabMapType = Record +export type TabMap = Record diff --git a/packages/scandipwa/src/type/Breadcrumbs.type.d.ts b/packages/scandipwa/src/type/Breadcrumbs.type.ts similarity index 84% rename from packages/scandipwa/src/type/Breadcrumbs.type.d.ts rename to packages/scandipwa/src/type/Breadcrumbs.type.ts index 0d9b81bb2d..fbcaa09fa7 100644 --- a/packages/scandipwa/src/type/Breadcrumbs.type.d.ts +++ b/packages/scandipwa/src/type/Breadcrumbs.type.ts @@ -9,9 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -export * from './Breadcrumbs.type'; - -export interface Breadcrumb { +export type Breadcrumb = { url: string name: string } diff --git a/packages/scandipwa/src/type/CMS.type.d.ts b/packages/scandipwa/src/type/CMS.type.ts similarity index 67% rename from packages/scandipwa/src/type/CMS.type.d.ts rename to packages/scandipwa/src/type/CMS.type.ts index b65ba06b43..5cd5176aa6 100644 --- a/packages/scandipwa/src/type/CMS.type.d.ts +++ b/packages/scandipwa/src/type/CMS.type.ts @@ -9,21 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ -import { MetaTitleType } from 'Type/Common.type'; +import { MetaTitle } from 'Type/Common.type'; -export interface PageType { +export type Page = { title?: string; content?: string; - meta_title?: MetaTitleType; + meta_title?: MetaTitle; meta_description?: string; meta_keywords?: string; } -export interface BlockType { +export type Block = { title?: string; content?: string; } -export interface BlockListType { - items?: Record +export type BlockList = { + items?: Record } diff --git a/packages/scandipwa/src/type/Category.type.d.ts b/packages/scandipwa/src/type/Category.type.ts similarity index 64% rename from packages/scandipwa/src/type/Category.type.d.ts rename to packages/scandipwa/src/type/Category.type.ts index 69a85b4e75..a90521a837 100644 --- a/packages/scandipwa/src/type/Category.type.d.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -9,21 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ -import { MetaTitleType } from 'Type/Common.type'; +import { MetaTitle } from 'Type/Common.type'; -export type BreadcrumbsType = { +export type Breadcrumbs = { category_name?: string; category_url?: string; category_level?: number; }[]; -export interface CategoryFragment { +export type CategoryFragment = { id: number, - breadcrumbs: BreadcrumbsType, + breadcrumbs: Breadcrumbs, description: string, image: string, meta_description: string, - meta_title: MetaTitleType, + meta_title: MetaTitle, name: string, product_count: number, url_key: string, @@ -31,18 +31,18 @@ export interface CategoryFragment { display_mode: string } -export interface CategoryTreeType extends CategoryFragment { +export type CategoryTree = CategoryFragment & { children?: CategoryFragment[]; } -export type SelectedFiltersType = Record; +export type SelectedFilters = Record; -export type FilterType = Record; +export type Filter = Record; -export interface FilterInputType { +export type FilterInput = { categoryIds?: number; categoryUrlPath?: string; - customFilters?: SelectedFiltersType; + customFilters?: SelectedFilters; priceRange?: { min?: number; max?: number; @@ -50,7 +50,7 @@ export interface FilterInputType { conditions?: string; } -export interface SortFieldsType { +export type SortFields = { options?: { label?: string; value?: string; diff --git a/packages/scandipwa/src/type/Checkout.type.ts b/packages/scandipwa/src/type/Checkout.type.ts new file mode 100644 index 0000000000..c52091d365 --- /dev/null +++ b/packages/scandipwa/src/type/Checkout.type.ts @@ -0,0 +1,44 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export type PaymentMethod = { + code: string + title: string +} + +export type PaymentMethods = PaymentMethod[] + +export type ShippingMethod = { + amount: number + available: boolean + base_amount: number + carrier_code: string + carrier_title: string + error_message: string + method_code: string + method_title: string + price_excl_tax: number + price_incl_tax: number +} + +export type ShippingMethods = ShippingMethod[] + +export type CheckoutStore = { + city: string + country: string + description: string + name: string + phone: string + pickup_location_code: string + postcode: string + region: string + street: string +} diff --git a/packages/scandipwa/src/type/Common.type.d.ts b/packages/scandipwa/src/type/Common.type.ts similarity index 53% rename from packages/scandipwa/src/type/Common.type.d.ts rename to packages/scandipwa/src/type/Common.type.ts index c78c36fc95..555c74bc8f 100644 --- a/packages/scandipwa/src/type/Common.type.d.ts +++ b/packages/scandipwa/src/type/Common.type.ts @@ -9,19 +9,17 @@ * @link https://github.com/scandipwa/base-theme */ -import { ReactNodeLike } from 'prop-types'; +export type Mods = Record; -export type ModsType = Record; - -export interface MixType { +export type Mix = { block?: string; elem?: string; - mods?: ModsType; + mods?: Mods; } -export type ChildrenType = ReactNodeLike[] | ReactNodeLike +export type Children = React.ReactNode[] | React.ReactNode -export type RefType = () => void | { current: Element } +export type Ref = () => void | { current: Element } // TODO unknown -export type MetaTitleType = string | unknown +export type MetaTitle = string | unknown diff --git a/packages/scandipwa/src/type/Config.type.ts b/packages/scandipwa/src/type/Config.type.ts new file mode 100644 index 0000000000..630fbb4254 --- /dev/null +++ b/packages/scandipwa/src/type/Config.type.ts @@ -0,0 +1,39 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export type Region = { + code?: string; + name?: string; + id?: number; +} + +export type Countries = { + label?: string; + id?: string; + available_regions?: Region[]; +}[]; + +export type CartConfig = { + display_tax_in_price?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_PRICE)) + display_tax_in_subtotal?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_SUBTOTAL)) + display_tax_in_shipping_amount?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_SHIPPING)) + include_tax_in_order_total: boolean; + display_full_tax_summary: boolean; + display_zero_tax_subtotal: boolean; +} + +export type StoreItem = { + id?: string; + value?: string; + storeUrl?: string; + storeLinkUrl?: string; + label?: string; +} diff --git a/packages/scandipwa/src/type/Device.type.ts b/packages/scandipwa/src/type/Device.type.ts new file mode 100644 index 0000000000..79791e8048 --- /dev/null +++ b/packages/scandipwa/src/type/Device.type.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export type Device = { + isMobile?: boolean; + android?: boolean; + ios?: boolean; + blackberry?: boolean; + opera?: boolean; + safari?: boolean; + windows?: boolean; + standaloneMode?: boolean; +} diff --git a/packages/scandipwa/src/type/Downloadable.type.d.ts b/packages/scandipwa/src/type/Downloadable.type.ts similarity index 79% rename from packages/scandipwa/src/type/Downloadable.type.d.ts rename to packages/scandipwa/src/type/Downloadable.type.ts index 6588077e08..21d6cd9f4c 100644 --- a/packages/scandipwa/src/type/Downloadable.type.d.ts +++ b/packages/scandipwa/src/type/Downloadable.type.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/scandipwa */ -export interface DownloadableLinkType { +export type DownloadableLink = { sample_url?: string; sort_order?: number; title?: string; @@ -18,4 +18,4 @@ export interface DownloadableLinkType { price?: number; } -export type DownloadableLinksType = [DownloadableLinkType | string]; +export type DownloadableLinks = DownloadableLink | string; diff --git a/packages/scandipwa/src/type/Error.type.ts b/packages/scandipwa/src/type/Error.type.ts new file mode 100644 index 0000000000..ee29f14797 --- /dev/null +++ b/packages/scandipwa/src/type/Error.type.ts @@ -0,0 +1,18 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +// TODO fix any +export type ErrorDetails = { + err?: any; + info?: { + componentStack?: string; + }; +} diff --git a/packages/scandipwa/src/type/Field.type.ts b/packages/scandipwa/src/type/Field.type.ts new file mode 100644 index 0000000000..03fadda761 --- /dev/null +++ b/packages/scandipwa/src/type/Field.type.ts @@ -0,0 +1,74 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { ValidationInputTypeText } from 'Util/Validator/Config'; + +export type Label = string | React.ReactNode + +export type Option = { + id?: string | number; + label?: Label; + value?: string | number; +} + +export type CustomErrorMessages = { + onRequirementFail?: string; + onInputTypeFail?: string; + onMatchFail?: any | string; // TODO: Remove any + onRangeFailMin?: string; + onRangeFailMax?: string; + onExtensionFail?: string; +} + +export type ValidationRule = { + isRequired?: boolean; + inputType?: ValidationInputTypeText; + match?: () => void // TODO: Check argument types + customErrorMessages?: CustomErrorMessages; +} + +// TODO +export type Events = () => void + +// TODO +export type FieldAttr = any; + +export type FieldOptions = { + id?: string | number; + label?: Label + value?: string | number; +}[]; + +export type ValuesShape = { + value?: string | boolean; + type?: string | boolean; + name?: string | boolean; +} + +export type ErrorMessageShape = { + injectables?: string[]; + value?: string; +} + +export type ErrorFieldShape = { + errorMessages?: ErrorMessageShape[]; + value?: string | boolean; + type?: string | boolean; + name?: string | boolean; +} + +export type FieldGroupValidationResponse = { + errorFields: ErrorFieldShape; + errorMessages: ErrorMessageShape + values: ValuesShape +} | boolean + +export type Date = number | string; diff --git a/packages/scandipwa/src/type/Menu.type.ts b/packages/scandipwa/src/type/Menu.type.ts new file mode 100644 index 0000000000..c4b0e3ae78 --- /dev/null +++ b/packages/scandipwa/src/type/Menu.type.ts @@ -0,0 +1,32 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { Location } from 'Type/Router.type'; + +export type MenuItem = { + item_id?: string; + is_active?: boolean; + parent_id?: number; + position?: number; + title?: string; + item_class?: string; + icon?: string; + url?: Location; + cms_page_identifier?: string; + category_id?: number; +} + +export type Menu = { + menu_id?: string; + is_active?: boolean; + css_class?: string; + items?: MenuItem[]; +} diff --git a/packages/scandipwa/src/type/MiniCart.type.ts b/packages/scandipwa/src/type/MiniCart.type.ts new file mode 100644 index 0000000000..9c3eb353a8 --- /dev/null +++ b/packages/scandipwa/src/type/MiniCart.type.ts @@ -0,0 +1,57 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { MetaTitle } from 'Type/Common.type'; + +import { Product } from './ProductList.type'; + +export type Page = { + title?: string; + content?: string; + meta_title?: MetaTitle; + meta_description?: string; + meta_keywords?: string; +} + +export type QuantitySelector = { + increase?: () => void // TODO + decrease?: () => void // TODO + quantity?: number; +} + +export type Totals = { + count?: number; + subTotalPrice?: string; + taxPrice?: string; + grandTotalPrice?: string; +} + +export type CartItem = { + discount_amount?: number; + discount_percent?: number; + item_id?: number; + price?: number; + product?: Product; + qty?: number; + row_total?: number; + sku?: string; + tax_amount?: number; + tax_percent?: number; +} + +export type CartDisplay = { + display_tax_in_price?: string; + display_tax_in_subtotal?: string; + display_tax_in_shipping_amount?: string; + include_tax_in_order_total?: boolean; + display_full_tax_summary?: boolean; + display_zero_tax_subtotal?: boolean; +} diff --git a/packages/scandipwa/src/type/NotificationList.type.ts b/packages/scandipwa/src/type/NotificationList.type.ts new file mode 100644 index 0000000000..e618915c6a --- /dev/null +++ b/packages/scandipwa/src/type/NotificationList.type.ts @@ -0,0 +1,28 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export type Notification = { + msgText?: string; + msgType?: string; + msgDebug?: { + message?: string; + extensions?: { + category?: string; + }; + locations?: { + line?: number; + column?: number; + }[]; + path?: string[]; + }[]; +}; + +export type NotificationList = Record; diff --git a/packages/scandipwa/src/type/Order.type.d.ts b/packages/scandipwa/src/type/Order.type.ts similarity index 65% rename from packages/scandipwa/src/type/Order.type.d.ts rename to packages/scandipwa/src/type/Order.type.ts index bbe78cf16f..fa6d2754d6 100644 --- a/packages/scandipwa/src/type/Order.type.d.ts +++ b/packages/scandipwa/src/type/Order.type.ts @@ -9,16 +9,16 @@ * @link https://github.com/scandipwa/scandipwa */ -export interface OrderGrandTotalType { +export type OrderGrandTotal= { value?: number; currency?: string; } -export interface OrderTotalType { - grand_total?: OrderGrandTotalType; +export type OrderTotal= { + grand_total?: OrderGrandTotal; } -export interface OrderInfoType { +export type OrderInfo= { id?: number; increment_id?: string; created_at?: string; @@ -27,7 +27,7 @@ export interface OrderInfoType { subtotal?: string; } -export interface OrderPaymentInfo { +export type OrderPaymentInfo= { name?: string; type?: string; additional_data?: { @@ -38,7 +38,7 @@ export interface OrderPaymentInfo { export type OrderPaymentsInfo = OrderPaymentInfo[]; -export interface OrderAddressType { +export type OrderAddress= { city?: string; country_code?: string; firstname?: string; @@ -50,7 +50,7 @@ export interface OrderAddressType { telephone?: string; } -export interface orderItemQtyType { +export type orderItemQty= { quantity_ordered?: number; quantity_canceled?: number; quantity_invoiced?: number; @@ -59,40 +59,40 @@ export interface orderItemQtyType { quantity_shipped?: number; } -export interface MoneyType { +export type Money= { currency?: string; value?: number; } -export interface DiscountType { - amount?: MoneyType; +export type Discount= { + amount?: Money; value?: number; } -export interface OptionItemType { +export type OptionItem= { title?: string; qty?: number; price?: number; } -export type OptionItemsType = OptionItemType[]; +export type OptionItems = OptionItem[]; -export interface OptionType { +export type Option= { label?: string; value?: string; - items?: OptionItemsType; + items?: OptionItems; linkItems?: string[]; } -export type OptionsType = OptionType[]; +export type Options = Option[]; -export interface OrderProductType { - discounts?: DiscountType[]; +export type OrderProduct= { + discounts?: Discount[]; id?: string; - selected_options?: OptionsType; - entered_options?: OptionsType; + selected_options?: Options; + entered_options?: Options; product_name?: string; - product_sale_price?: MoneyType; + product_sale_price?: Money; product_sku?: string; product_type?: string; product_url_key?: string; @@ -104,13 +104,13 @@ export interface OrderProductType { quantity_shipped?: number; } -export type OrderProductsType = OrderProductType[]; +export type OrderProducts = OrderProduct[]; -export interface OrderTabType { - items?: OrderProductsType; +export type OrderTab= { + items?: OrderProducts; id?: string | number; number?: string; - total?: OrderTotalType; + total?: OrderTotal; quantity_ordered?: number; quantity_canceled?: number; quantity_invoiced?: number; @@ -119,27 +119,27 @@ export interface OrderTabType { quantity_shipped?: number; } -export type OrderTabsType = OrderTabType[]; +export type OrderTabs = OrderTab[]; -export interface OrderType { +export type Order= { can_reorder?: boolean; carrier?: string; id?: string; order_date?: string; credit_memos?: string; invoices?: string; - items?: OrderProductsType; + items?: OrderProducts; shipments?: string; payment_methods?: OrderPaymentsInfo; rss_link?: string; - shipping_address?: OrderAddressType; - billing_address?: OrderAddressType; + shipping_address?: OrderAddress; + billing_address?: OrderAddress; shipping_method?: string; status?: string; - total?: OrderTotalType; + total?: OrderTotal; } -export interface DownloadableType { +export type Downloadable= { id?: number; order_id?: number; order_increment_id?: string; @@ -150,15 +150,15 @@ export interface DownloadableType { title?: string; } -export interface PageInfoType { +export type PageInfo= { current_page?: number; page_size?: number; total_pages?: number; } -export type OrdersType = OrderType[]; +export type Orders = Order[]; -export interface OrdersListType { - items?: OrdersType; - pageInfo?: PageInfoType; +export type OrdersList= { + items?: Orders; + pageInfo?: PageInfo; } diff --git a/packages/scandipwa/src/type/Price.type.d.ts b/packages/scandipwa/src/type/Price.type.d.ts deleted file mode 100644 index 4043c36170..0000000000 --- a/packages/scandipwa/src/type/Price.type.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/scandipwa - */ - -export interface PriceItemType { - currency: string; - value: number; - valueFormatted: string; -} - -export interface DiscountType { - amount_off: number; - percent_off: number; -} - -export interface PriceVariantType { - discount?: DiscountType; - final_price?: PriceItemType; - regular_price?: PriceItemType; -} - -export interface PriceType { - minimum_price?: PriceVariantType; - maximal_price?: PriceVariantType; -} - -export interface OriginalPriceType { - minRegularPrice?: PriceItemType; - minFinalPrice?: PriceItemType; - minFinalPriceExclTax?: PriceItemType; - maxRegularPrice?: PriceItemType; - maxFinalPrice?: PriceItemType; - maxFinalPriceExclTax?: PriceItemType; -} - -export interface ProductPriceType { - price?: { - finalPrice?: PriceItemType; - finalPriceExclTax?: PriceItemType; - originalPrice?: PriceItemType; - originalPriceExclTax?: PriceItemType; - discount?: DiscountType; - }; - originalPrice?: OriginalPriceType; - configuration?: { - containsOptions?: false; - containsOptionsWithPrice?: false; - containsRequiredOptions?: false; - containsRequiredOptionsWithPrice?: false; - }; -} - -export type TierPricesType = { - discount?: DiscountType; - final_price?: { - currency?: string; - value?: number; - }; - quantity?: number; -}[]; diff --git a/packages/scandipwa/src/type/Price.type.ts b/packages/scandipwa/src/type/Price.type.ts new file mode 100644 index 0000000000..012dca2fcf --- /dev/null +++ b/packages/scandipwa/src/type/Price.type.ts @@ -0,0 +1,67 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type PriceItem = { + currency: string; + value: number; + valueFormatted: string; +} + +export type Discount = { + amount_off: number; + percent_off: number; +} + +export type PriceVariant = { + discount?: Discount; + final_price?: PriceItem; + regular_price?: PriceItem; +} + +export type Price = { + minimum_price?: PriceVariant; + maximal_price?: PriceVariant; +} + +export type OriginalPrice = { + minRegularPrice?: PriceItem; + minFinalPrice?: PriceItem; + minFinalPriceExclTax?: PriceItem; + maxRegularPrice?: PriceItem; + maxFinalPrice?: PriceItem; + maxFinalPriceExclTax?: PriceItem; +} + +export type ProductPrice = { + price?: { + finalPrice?: PriceItem; + finalPriceExclTax?: PriceItem; + originalPrice?: PriceItem; + originalPriceExclTax?: PriceItem; + discount?: Discount; + }; + originalPrice?: OriginalPrice; + configuration?: { + containsOptions?: false; + containsOptionsWithPrice?: false; + containsRequiredOptions?: false; + containsRequiredOptionsWithPrice?: false; + }; +} + +export type TierPrices = { + discount?: Discount; + final_price?: { + currency?: string; + value?: number; + }; + quantity?: number; +}[]; diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts new file mode 100644 index 0000000000..51120802da --- /dev/null +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -0,0 +1,316 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { StockStatus } from 'Component/Product/Stock.config'; +import { MetaTitle } from 'Type/Common.type'; +import { Price } from 'Type/Price.type'; +import { UrlRewrite } from 'Type/Router.type'; + +export type Attribute = { + attribute_code?: string; + attribute_type?: string; + attribute_value?: string; + attribute_label?: string; + attribute_options?: Record + has_swatch?: boolean; + is_boolean?: boolean; +} + +export type Attributes = Attribute | Attribute[]; + +export type AttributeOption = { + label?: string; + count?: number; + value_string?: string; + swatch_data?: { + type?: string; + value?: string; + } +} + +export type FilterAttribute = { + attribute_code?: string; + attribute_label?: string; + attribute_position?: number; + attribute_values?: string[]; + attribute_type?: string; + attribute_options?: Record + is_boolean?: boolean; + has_swatch?: boolean; +}; + +export type Breadcrumbs = { + name?: string; + url_path?: string; +}[]; + +export type Image = { + path?: string; + url?: string; +}; + +export type ProductCategory = { + name?: string; + url_path?: string; + breadcrumbs?: Breadcrumbs; +}; + +export type ProductCategories = ProductCategory[]; + +export type Thumbnail = { + height?: string; + type?: string; + url?: string; + width?: string; +}; + +export type MediaItem = { + thumbnail?: Thumbnail; + file?: string; + video_content?: { + media_type?: string; + video_description?: string; + video_metadata?: string; + video_provider?: string; + video_title?: string; + video_url?: string; + }; + id?: number; + media_type?: string; + label?: string; +}; + +export type Media = MediaItem[]; + +export type ProductLinks = { + link_type?: string; + linked_product_sku?: string; + position?: number; +}[]; + +export type ReviewSummaryShape = { + rating_summary: number; + review_count: number +} + +export type RatingVote = { + vote_id?: number; + rating_code?: string; + percent?: number; +}; + +export type Reviews = { + review_id?: number; + nickname?: string; + title?: string; + detail?: string; + created_at?: string; + rating_votes?: RatingVote[]; +}[]; + +export type DescriptionType = { + html?: string; +}; + +export type StockItem = { + in_stock?: boolean; + min_sale_qty?: number; + max_sale_qty?: number; + qty_increments?: number; +}; + +export type OptionValue = { + option_type_id?: number; + price?: number; + price_type?: string; + sku?: string; + sort_order?: number; + title?: string; +}; + +export type Options = { + option_id?: number; + required?: boolean; + sort_order?: number; + title?: string; + values?: OptionValue[]; +}[]; + +export type Value = { + uid?: string; + option_type_id?: number; + price?: number; + priceInclTax?: number; + priceExclTax?: number; + price_type?: string; + currency?: string; + sku?: string; + title?: string; + sort_order?: number; +}; + +export type PriceTier = { + discount?: { + amount_off?: number; + percent_off?: number; + }; + final_price?: { + currency?: string; + value?: number; + }; + quantity?: number; +}; + +export type CustomizableOptionShape = { + price: number; + priceInclTax: number; + priceExclTax: number; + price_type: string; + currency: string; + sku: string; +} + +export type CustomizableOption = CustomizableOptionShape & { + uid?: string; + option_type_id?: number; + title?: string; + sort_order?: number; +} + +export type InputOption = CustomizableOptionShape & { + max_characters?: number; +} + +export type FileOption = CustomizableOptionShape & { + file_extension?: string; +} + +export type CustomizableOptions = FileOption | InputOption | CustomizableOption[] + +export type ItemShape = ReviewSummaryShape & { + attributes: Attributes; + configurable_options: Attributes, + id: number, + image: Image, + name: string, + options: CustomizableOptions, + price_range: Price, + price_tiers: PriceTier, + review_summary: ReviewSummaryShape, + short_description: DescriptionType, + sku: string, + small_image: Image, + special_from_date: string, + special_to_date: string, + stock_item: StockItem, + stock_status: StockStatus, + thumbnail: Image, + type_id: string, + uid: string, + url: string, + url_rewrites: UrlRewrite[] +} + +export type Item = ItemShape; + +export type Items = ItemShape[]; + +export type Pages = Record; + +export type Quantity = number | Record; + +export type ItemOptionsType = { + can_change_quantity?: boolean; + id?: number; + is_default?: boolean; + label?: string; + position?: number; + price?: number; + price_type?: string; + quantity?: Quantity; + uid?: string; + product?: { + name?: string; + stock_status?: string; + price_range?: Price; + }; + regularOptionPrice?: number; + regularOptionPriceExclTax?: number; + finalOptionPrice?: number; + finalOptionPriceExclTax?: number; +}[]; + +export type ProductItemsType = { + option_id?: number; + options?: ItemOptionsType; + position?: number; + required?: boolean; + sku?: string; + title?: string; + type?: string; +}[]; + +export type Product = ItemShape & { + canonical_url?: string; + categories?: ProductCategories; + description?: DescriptionType; + media_gallery_entries?: Media; + meta_description?: string; + meta_keyword?: string; + meta_title?: MetaTitle; + product_links?: ProductLinks; + special_price?: number; + url_key?: string; + quantity?: number; + items?: ProductItemsType; + reviews?: Reviews; +}; + +export type DownloadableSamples = { + sample_url?: Product | string; + sort_order?: number; + title?: string; +}[]; + +export type PriceConfiguration = { + containsOptions?: boolean; + containsOptionsWithPrice?: boolean; + containsRequiredOptions?: boolean; + containsRequiredOptionsWithPrice?: boolean; +}; + +export type MagentoProduct = { + entered_options?: { + uid?: string; + value?: string; + }[]; + quantity?: Quantity; + selected_options?: string[]; + sku?: string; +}; + +export type ProductCardProps = { + siblingsHaveBrands?: boolean; + siblingsHavePriceBadge?: boolean; + siblingsHaveTierPrice?: boolean; + siblingsHaveConfigurableOptions?: boolean; +}; + +export type OptionsList = { + value?: CustomizableOptions; + title?: string; + required?: boolean; + sort_order?: number; + type?: string; + uid?: string; +}[]; + +export type LinkedProducts = Record diff --git a/packages/scandipwa/src/type/Rating.type.d.ts b/packages/scandipwa/src/type/Rating.type.ts similarity index 74% rename from packages/scandipwa/src/type/Rating.type.d.ts rename to packages/scandipwa/src/type/Rating.type.ts index cac0b68bdb..4c33a1c8ed 100644 --- a/packages/scandipwa/src/type/Rating.type.d.ts +++ b/packages/scandipwa/src/type/Rating.type.ts @@ -9,33 +9,33 @@ * @link https://github.com/scandipwa/base-theme */ -export interface RatingOptionItemType { +export type RatingOptionItem = { option_id?: string; value?: string; } -export type RatingItemsType = { +export type RatingItems = { rating_id?: string; rating_code?: string; - rating_options?: RatingOptionItemType[]; + rating_options?: RatingOptionItem[]; }[]; -export interface VoteType { +export type Vote = { rating_code?: string; value?: string; percent?: number; } -export interface ReviewItemType { +export type ReviewItem = { average_rating?: number; nickname?: string; title?: string; detail?: string; created_at?: string; - rating_votes?: VoteType[]; + rating_votes?: Vote[]; } -export interface CreateProductReviewInput { +export type CreateProductReviewInput = { nickname: string; sku: string; summary: string; diff --git a/packages/scandipwa/src/type/Router.type.d.ts b/packages/scandipwa/src/type/Router.type.ts similarity index 75% rename from packages/scandipwa/src/type/Router.type.d.ts rename to packages/scandipwa/src/type/Router.type.ts index 8f5804d682..9cfdec3041 100644 --- a/packages/scandipwa/src/type/Router.type.d.ts +++ b/packages/scandipwa/src/type/Router.type.ts @@ -11,7 +11,7 @@ import { LocationState } from 'history'; -export interface LocationType { +export type Location = { pathname?: string; search?: string; state?: LocationState; @@ -19,26 +19,26 @@ export interface LocationType { key?: string; } -// TODO use HistoryType -export interface HistoryType { +// TODO use History +export type History = { length?: number; action?: string; - location?: LocationType; + location?: Location; } // TODO use match from react-router -export interface MatchType { +export type Match = { path?: string; url?: string; params?: any; isExact?: boolean; } -export interface UrlRewriteType { +export type UrlRewrite = { id?: number; type?: string; sku?: string; notFound?: boolean; } -export type LinkType = [string | unknown] +export type Link = [string | unknown] diff --git a/packages/scandipwa/src/type/Slider.type.d.ts b/packages/scandipwa/src/type/Slider.type.ts similarity index 82% rename from packages/scandipwa/src/type/Slider.type.d.ts rename to packages/scandipwa/src/type/Slider.type.ts index d35d1d1dd0..a27e0fe15d 100644 --- a/packages/scandipwa/src/type/Slider.type.d.ts +++ b/packages/scandipwa/src/type/Slider.type.ts @@ -9,13 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -export interface SlideType { +export type Slide = { slide_id?: string; image?: string; slide_text?: string; } -export interface SliderType { +export type Slider = { slider_id?: string; - slides?: SlideType[]; + slides?: Slide[]; } diff --git a/packages/scandipwa/src/util/Validator/Config.js b/packages/scandipwa/src/util/Validator/Config.ts similarity index 95% rename from packages/scandipwa/src/util/Validator/Config.js rename to packages/scandipwa/src/util/Validator/Config.ts index 2da8f8e6f0..2ff934e526 100644 --- a/packages/scandipwa/src/util/Validator/Config.js +++ b/packages/scandipwa/src/util/Validator/Config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable spaced-comment */ /** * ScandiPWA - Progressive Web App for Magento @@ -18,6 +19,14 @@ export const VALIDATION_INPUT_TYPE_TEXT = { url: 'url' }; +export enum ValidationInputTypeText { + ALPHA = 'alpha', + ALPHASPACE = 'alphaSpace', + ALPHANUMERIC = 'alphaNumeric', + ALPHADASH = 'alphaDash', + URL = 'url' +} + export const VALIDATION_INPUT_TYPE_NUMBER = { numeric: 'numeric', numericDash: 'numericDash', From 91f467857d7169c8a987ce1555ded64c76dabd75 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Thu, 31 Mar 2022 00:16:51 +0300 Subject: [PATCH 007/192] Migrated utils related to queries. --- packages/scandipwa/bin/gen-graphql-types.js | 16 + packages/scandipwa/package.json | 33 +- packages/scandipwa/schema.graphql | 10013 ++++++ .../query/{Cart.query.js => Cart.query.ts} | 63 +- .../scandipwa/src/query/UrlRewrites.query.ts | 3 +- packages/scandipwa/src/type/Graphql.type.ts | 27556 ++++++++++++++++ .../src/util/Auth/{Token.js => Token.ts} | 18 +- .../src/util/Auth/{index.js => index.ts} | 0 ...{BrowserDatabase.js => BrowserDatabase.ts} | 12 +- .../BrowserDatabase/{index.js => index.ts} | 0 .../src/util/Query/{Field.js => Field.ts} | 23 +- .../util/Query/{Fragment.js => Fragment.ts} | 2 +- ...{PrepareDocument.js => PrepareDocument.ts} | 43 +- .../scandipwa/src/util/Query/Query.type.ts | 26 + .../src/util/Query/{index.js => index.ts} | 0 packages/scandipwa/tsconfig.json | 2 +- yarn.lock | 51 +- 17 files changed, 37777 insertions(+), 84 deletions(-) create mode 100644 packages/scandipwa/bin/gen-graphql-types.js create mode 100644 packages/scandipwa/schema.graphql rename packages/scandipwa/src/query/{Cart.query.js => Cart.query.ts} (79%) create mode 100644 packages/scandipwa/src/type/Graphql.type.ts rename packages/scandipwa/src/util/Auth/{Token.js => Token.ts} (79%) rename packages/scandipwa/src/util/Auth/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/BrowserDatabase/{BrowserDatabase.js => BrowserDatabase.ts} (86%) rename packages/scandipwa/src/util/BrowserDatabase/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Query/{Field.js => Field.ts} (66%) rename packages/scandipwa/src/util/Query/{Fragment.js => Fragment.ts} (93%) rename packages/scandipwa/src/util/Query/{PrepareDocument.js => PrepareDocument.ts} (70%) create mode 100644 packages/scandipwa/src/util/Query/Query.type.ts rename packages/scandipwa/src/util/Query/{index.js => index.ts} (100%) diff --git a/packages/scandipwa/bin/gen-graphql-types.js b/packages/scandipwa/bin/gen-graphql-types.js new file mode 100644 index 0000000000..11d9d00963 --- /dev/null +++ b/packages/scandipwa/bin/gen-graphql-types.js @@ -0,0 +1,16 @@ +const { generateTypeScriptTypes } = require('graphql-schema-typescript'); + +const options = {}; + +const schemaPath = process.argv[2]; +const outputPath = process.argv[3]; + +generateTypeScriptTypes(schemaPath, outputPath, options) + .then(() => { + console.info('GraphQL types are generated'); + process.exit(0); + }) + .catch(err => { + console.error(err); + process.exit(1); + }); diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 197118a936..9e3121d687 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -6,7 +6,9 @@ "start": "scandipwa-scripts start", "start:magento": "BUILD_MODE=magento scandipwa-scripts start", "build": "scandipwa-scripts build", - "build:magento": "BUILD_MODE=magento scandipwa-scripts build" + "build:magento": "BUILD_MODE=magento scandipwa-scripts build", + "graphql:fetch": "get-graphql-schema $1 > schema.graphql", + "graphql:gen": "node bin/gen-graphql-types schema.graphql ./src/type/Graphql.type.ts" }, "dependencies": { "@scandipwa/chunk-optimizer": "0.0.6", @@ -22,6 +24,7 @@ "@types/react-dom": "^17.0.9", "@types/react-router": "^5.1.16", "@types/react-router-dom": "^5.1.8", + "eslint-config-airbnb-typescript": "^16.1.4", "get-graphql-schema": "^2.1.2", "graphql-schema-typescript": "^1.5.2", "history": "^4.9.0", @@ -121,8 +124,13 @@ "eslintConfig": { "extends": [ "airbnb", + "airbnb-typescript", "plugin:array-func/recommended" ], + "parserOptions": { + "project": "./tsconfig.json" + }, + "ignorePatterns": ["package.json"], "env": { "browser": true }, @@ -155,6 +163,7 @@ { "files": [ "*.config.js", + "*.config.ts", "src/config/**" ], "rules": { @@ -392,7 +401,8 @@ ] } ], - "indent": [ + "indent": "off", + "@typescript-eslint/indent": [ "error", 4, { @@ -413,7 +423,8 @@ ] } ], - "comma-dangle": [ + "comma-dangle": "off", + "@typescript-eslint/comma-dangle": [ "error", "never" ], @@ -485,7 +496,21 @@ "error", "always" ], - "no-extra-semi": "error" + "no-extra-semi": "error", + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "default", + "format": ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"], + "leadingUnderscore": "allow" + }, + { + "selector": "classMethod", + "format": null, + "filter": "__construct", + "leadingUnderscore": "allow" + } + ] } }, "license": "OSL-3.0", diff --git a/packages/scandipwa/schema.graphql b/packages/scandipwa/schema.graphql new file mode 100644 index 0000000000..64139c0927 --- /dev/null +++ b/packages/scandipwa/schema.graphql @@ -0,0 +1,10013 @@ +input AddBundleProductsToCartInput { + cart_id: String! + cart_items: [BundleProductCartItemInput]! +} + +type AddBundleProductsToCartOutput { + cart: Cart! +} + +input AddConfigurableProductsToCartInput { + cart_id: String! + cart_items: [ConfigurableProductCartItemInput]! +} + +type AddConfigurableProductsToCartOutput { + cart: Cart! +} + +input AddDownloadableProductsToCartInput { + cart_id: String! + cart_items: [DownloadableProductCartItemInput]! +} + +type AddDownloadableProductsToCartOutput { + cart: Cart! +} + +type AdditionalCustomerInfo { + bank: String + credit_type: String + customer_info: CreditCustomerInfo + method_title: String + month: Int +} + +type AddProductsToCartOutput { + """The cart after products have been added""" + cart: Cart! + + """An error encountered while adding an item to the cart.""" + user_errors: [CartUserInputError]! +} + +input AddProductsToCompareListInput { + """An array of product IDs to add to the compare list""" + products: [ID]! + + """The unique identifier of the compare list to modify""" + uid: ID! +} + +"""Contains the customer's wish list and any errors encountered""" +type AddProductsToWishlistOutput { + """An array of errors encountered while adding products to a wish list""" + user_errors: [WishListUserInputError]! + + """Contains the wish list with all items that were successfully added""" + wishlist: Wishlist! +} + +input AddressExtensionAttributes { + attribute_code: String + value: String +} + +input AddressInput { + city: String + company: String + country_id: String + email: String + extension_attributes: [AddressExtensionAttributes] + firstname: String + lastname: String + method: String + postcode: String + region: String + region_code: String + region_id: Int + street: [String] + telephone: String + vat_id: String +} + +input AddSimpleProductsToCartInput { + cart_id: String! + cart_items: [SimpleProductCartItemInput]! +} + +type AddSimpleProductsToCartOutput { + cart: Cart! +} + +input AddVirtualProductsToCartInput { + cart_id: String! + cart_items: [VirtualProductCartItemInput]! +} + +type AddVirtualProductsToCartOutput { + cart: Cart! +} + +type AddWishlistItemsToCartOutput { + """ + An array of errors encountered while adding products to the customer's cart + """ + add_wishlist_items_to_cart_user_errors: [WishlistCartUserInputError]! + + """ + Indicates whether the attempt to add items to the customer's cart was successful + """ + status: Boolean! + + """Contains the wish list with all items that were successfully added""" + wishlist: Wishlist! +} + +""" +A bucket that contains information for each filterable option (such as price, category `UID`, and custom attributes). +""" +type Aggregation { + """Attribute code of the aggregation group.""" + attribute_code: String! + + """The number of options in the aggregation group.""" + count: Int + + """ + Flag to indicate that aggregated attribute uses swatch to select value. + """ + has_swatch: Boolean + + """Flag to indicate that aggregated attribute has boolean type.""" + is_boolean: Boolean + + """The aggregation display name.""" + label: String + + """Array of options for the aggregation.""" + options: [AggregationOption] + + """Attribute position in filter menu.""" + position: Int +} + +type AggregationOption implements AggregationOptionInterface { + """The number of items that match the aggregation option.""" + count: Int + + """Aggregation option display label.""" + label: String + + """Swatch data""" + swatch_data: SwatchData + + """The internal ID that represents the value of the option.""" + value: String! +} + +interface AggregationOptionInterface { + """The number of items that match the aggregation option.""" + count: Int + + """Aggregation option display label.""" + label: String + + """Swatch data""" + swatch_data: SwatchData + + """The internal ID that represents the value of the option.""" + value: String! +} + +type AppliedCoupon { + code: String! +} + +type AppliedTaxItem { + amount: Float + percent: Float + rates: [AppliedTaxItemRate] +} + +type AppliedTaxItemRate { + percent: Float + title: String +} + +input ApplyCouponToCartInput { + cart_id: String! + coupon_code: String! +} + +type ApplyCouponToCartOutput { + cart: Cart! +} + +""" +AreaInput defines the parameters which will be used for filter by specified location. +""" +input AreaInput { + """The radius for the search in KM.""" + radius: Int! + + """ + The country code where search must be performed. Required parameter together with region, city or postcode. + """ + search_term: String! +} + +type Assets { + """The payment method logo url (descriptive)""" + descriptive: String + + """The payment method logo url (standard)""" + standard: String +} + +type AssignCompareListToCustomerOutput { + """The contents of the customer's compare list""" + compare_list: CompareList + result: Boolean! +} + +""" +Attribute contains the attribute_type of the specified attribute_code and entity_type +""" +type Attribute { + """ + The unique identifier for an attribute code. This value should be in lowercase letters without spaces. + """ + attribute_code: String + + """Attribute options list.""" + attribute_options: [AttributeOption] + + """The data type of the attribute""" + attribute_type: String + + """The type of entity that defines the attribute""" + entity_type: String + + """The frontend input type of the attribute""" + input_type: String + + """ + Contains details about the storefront properties configured for the attribute + """ + storefront_properties: StorefrontProperties +} + +"""AttributeInput specifies the attribute_code and entity_type to search""" +input AttributeInput { + """ + The unique identifier for an attribute code. This value should be in lowercase letters without spaces. + """ + attribute_code: String + + """The type of entity that defines the attribute""" + entity_type: String +} + +"""Attribute option.""" +type AttributeOption { + """Attribute option label.""" + label: String + + """Attribute option value.""" + value: String +} + +type AttributeWithValue { + attribute_code: String + attribute_group_code: String + attribute_group_id: String + attribute_group_name: String + attribute_id: Int + attribute_label: String + attribute_options: [AttributeWithValueOption] + attribute_type: String + attribute_value: String + entity_type: String + used_in_product_listing: Boolean +} + +type AttributeWithValueOption { + label: String + swatch_data: AttributeWithValueSwatchData + value: String +} + +type AttributeWithValueSwatchData { + type: String + value: String +} + +type AvailabilityResponseType { + isAvailable: Boolean +} + +type AvailablePaymentMethod { + """The payment method code""" + code: String! + + """The payment method title.""" + title: String! +} + +type AvailableShippingMethod { + amount: Money! + available: Boolean! + base_amount: Money @deprecated(reason: "The field should not be used on the storefront") + carrier_code: String! + carrier_title: String! + error_message: String + + """Could be null if method is not available""" + method_code: String + + """Could be null if method is not available""" + method_title: String + price_excl_tax: Money! + price_incl_tax: Money! +} + +type BaseOrderInfo { + created_at: String + currency_code: String + grand_total: Float + id: Int + increment_id: String + status: String + status_label: String + sub_total: Float + total_qty_ordered: Int +} + +input BillingAddressInput { + address: CartAddressInput + customer_address_id: Int + + """Set billing address same as shipping""" + same_as_shipping: Boolean + + """Deprecated: use `same_as_shipping` field instead""" + use_for_shipping: Boolean +} + +type BillingCartAddress implements CartAddressInterface { + city: String! + company: String + country: CartAddressCountry! + customer_notes: String @deprecated(reason: "The field is used only in shipping address") + firstname: String! + lastname: String! + postcode: String + region: CartAddressRegion + street: [String]! + telephone: String! +} + +type Braintree { + is_three_d_secure: Boolean +} + +input BraintreeCcVaultInput { + device_data: String + public_hash: String! +} + +input BraintreeInput { + """ + Contains a fingerprint provided by Braintree JS SDK and should be sent with + sale transaction details to the Braintree payment gateway. Should be specified + only in a case if Kount (advanced fraud protection) is enabled for Braintree + payment integration. + """ + device_data: String + + """ + States whether an entered by a customer credit/debit card should be tokenized + for later usage. Required only if Vault is enabled for Braintree payment integration. + """ + is_active_payment_token_enabler: Boolean! + + """ + The one-time payment token generated by Braintree payment gateway based on + card details. Required field to make sale transaction. + """ + payment_method_nonce: String! +} + +"""Breadcrumb item.""" +type Breadcrumb { + """Category ID.""" + category_id: Int @deprecated(reason: "Use the `category_uid` argument instead.") + + """Is category active""" + category_is_active: Boolean + + """Category level.""" + category_level: Int + + """Category name.""" + category_name: String + + """The unique ID for a `Breadcrumb` object.""" + category_uid: ID! + + """Trimmed URL rewrite""" + category_url: String + + """Category URL key.""" + category_url_key: String + + """Category URL path.""" + category_url_path: String +} + +type BundleCartItem implements CartItemInterface { + bundle_options: [SelectedBundleOption]! + customizable_options: [SelectedCustomizableOption]! + + """The entered gift message for the cart item""" + gift_message: GiftMessage + id: String! @deprecated(reason: "Use `uid` instead") + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +type BundleCreditMemoItem implements CreditMemoItemInterface { + """A list of bundle options that are assigned to the bundle product""" + bundle_options: [ItemSelectedBundleOption] + + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `CreditMemoItemInterface` object""" + id: ID! + + """The order item the credit memo is applied to""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product, including selected options""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """The number of refunded items""" + quantity_refunded: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +type BundleInvoiceItem implements InvoiceItemInterface { + """A list of bundle options that are assigned to the bundle product""" + bundle_options: [ItemSelectedBundleOption] + + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `InvoiceItemInterface` object""" + id: ID! + + """Contains details about an individual order item""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The number of invoiced items""" + quantity_invoiced: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +"""BundleItem defines an individual item in a bundle product.""" +type BundleItem { + """An ID assigned to each type of item in a bundle product.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """An array of additional options for this bundle item.""" + options: [BundleItemOption] + + """he relative position of this item compared to the other bundle items.""" + position: Int + + """Indicates whether the item must be included in the bundle.""" + required: Boolean + + """The SKU of the bundle product.""" + sku: String + + """The display name of the item.""" + title: String + + """ + The input type that the customer uses to select the item. Examples include radio button and checkbox. + """ + type: String + + """The unique ID for a `BundleItem` object.""" + uid: ID +} + +""" +BundleItemOption defines characteristics and options for a specific bundle item. +""" +type BundleItemOption { + """ + Indicates whether the customer can change the number of items for this option. + """ + can_change_quantity: Boolean + + """The ID assigned to the bundled item option.""" + id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether this option is the default option.""" + is_default: Boolean + + """The text that identifies the bundled item option.""" + label: String + + """ + When a bundle item contains multiple options, the relative position of this option compared to the other options. + """ + position: Int + + """The price of the selected option.""" + price: Float + + """One of FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """Contains details about this product option.""" + product: ProductInterface + + """Indicates the quantity of this specific bundle item.""" + qty: Float @deprecated(reason: "The `qty` is deprecated. Use `quantity` instead.") + + """Indicates the quantity of this specific bundle item.""" + quantity: Float + + """The unique ID for a `BundleItemOption` object.""" + uid: ID! +} + +type BundleOption { + option_id: Int + price: Float + qty: Int + selection_details: [BundleOptionSelection] + title: String +} + +input BundleOptionInput { + id: Int! + quantity: Float! + value: [String]! +} + +"""Represents order bundle item options""" +type BundleOptions { + items: [BundleOption] + + """Describes type of bundle option (radio, checkbox and etc)""" + type: String! +} + +type BundleOptionSelection { + final_option_price: Float + final_option_price_excl_tax: Float + name: String + regular_option_price: Float + regular_option_price_excl_tax: Float + selection_id: Int +} + +type BundleOrderItem implements OrderItemInterface { + """A list of bundle options that are assigned to the bundle product""" + bundle_options: [ItemSelectedBundleOption] + + """The final discount information for the product""" + discounts: [Discount] + + """The entered option for the base product, such as a logo or image""" + entered_options: [OrderItemOption] + + """The unique ID for a `OrderItemInterface` object""" + id: ID! + + """The name of the base product""" + product_name: String + + """The sale price of the base product, including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The type of product, such as simple, configurable, etc.""" + product_type: String + + """URL key of the base product""" + product_url_key: String + + """The number of canceled items""" + quantity_canceled: Float + + """The number of invoiced items""" + quantity_invoiced: Float + + """The number of units ordered for this item""" + quantity_ordered: Float + + """The number of refunded items""" + quantity_refunded: Float + + """The number of returned items""" + quantity_returned: Float + + """The number of shipped items""" + quantity_shipped: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! + + """The selected options for the base product, such as color or size""" + selected_options: [OrderItemOption] + + """The status of the order item""" + status: String +} + +""" +Defines basic features of a bundle product and contains multiple BundleItems +""" +type BundleProduct implements ProductInterface & RoutableInterface & PhysicalProductInterface & CustomizableProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """Additional pricing info specific for bundle products""" + bundle_options: [BundleOption] + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + + """Indicates whether the bundle product has a dynamic price.""" + dynamic_price: Boolean + + """Indicates whether the bundle product has a dynamic SK.""" + dynamic_sku: Boolean + + """ + Indicates whether the bundle product has a dynamically calculated weight. + """ + dynamic_weight: Boolean + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + + """An array containing information about individual bundle items.""" + items: [BundleItem] + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """One of PRICE_RANGE or AS_LOW_AS.""" + price_view: PriceViewEnum + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + + """Indicates whether to ship bundle items together or individually.""" + ship_bundle_items: ShipBundleItemsEnum + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + + """The weight of the item, in units defined by the store.""" + weight: Float + yes_no: Int +} + +input BundleProductCartItemInput { + bundle_options: [BundleOptionInput]! + customizable_options: [CustomizableOptionInput] + data: CartItemInput! +} + +type BundleShipmentItem implements ShipmentItemInterface { + """A list of bundle options that are assigned to the bundle product""" + bundle_options: [ItemSelectedBundleOption] + + """The unique ID for a `ShipmentItemInterface` object""" + id: ID! + + """Associated order item""" + order_item: OrderItemInterface + + """Name of the base product""" + product_name: String + + """Sale price for the base product""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """Number of shipped items""" + quantity_shipped: Float! +} + +type BundleWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """An array containing information about the selected bundle items""" + bundle_options: [SelectedBundleOption] + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +type Cart { + """An array of coupons that have been applied to the cart""" + applied_coupon: AppliedCoupon @deprecated(reason: "Use applied_coupons instead") + + """ + An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code + """ + applied_coupons: [AppliedCoupon] + + """Available payment methods""" + available_payment_methods: [AvailablePaymentMethod] + billing_address: BillingCartAddress + email: String + + """The entered gift message for the cart""" + gift_message: GiftMessage + + """The unique ID for a `Cart` object""" + id: ID! + is_virtual: Boolean! + items: [CartItemInterface] + prices: CartPrices + selected_payment_method: SelectedPaymentMethod + shipping_addresses: [ShippingCartAddress]! + total_quantity: Float! +} + +type CartAddressCountry { + code: String! + label: String! +} + +input CartAddressInput { + city: String! + company: String + country_code: String! + firstname: String! + lastname: String! + postcode: String + region: String + region_id: Int + + """ + Determines whether to save the address in the customer's address book. The default value is true + """ + save_in_address_book: Boolean + street: [String]! + telephone: String! + vat_id: String +} + +interface CartAddressInterface { + city: String! + company: String + country: CartAddressCountry! + firstname: String! + lastname: String! + postcode: String + region: CartAddressRegion + street: [String]! + telephone: String! +} + +type CartAddressRegion { + code: String + label: String + region_id: Int +} + +type CartDiscount { + amount: Money! + label: [String]! +} + +type CartDisplayConfig { + display_full_tax_summary: Boolean + display_tax_in_price: String + display_tax_in_shipping_amount: String + display_tax_in_subtotal: String + display_zero_tax_subtotal: Boolean + include_tax_in_order_total: Boolean +} + +input CartItemId { + item_id: Int + sku: String +} + +input CartItemInput { + """ + An array of entered options for the base product, such as personalization text + """ + entered_options: [EnteredOptionInput] + id: CartItemId + item_id: Int + + """For child products, the SKU of its parent product""" + parent_sku: String + product_option: ProductOptionInput + product_type: String + quantity: Float! + quote_id: String + + """ + The selected options for the base product, such as color or size with unique + ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, + `ConfigurableProductOptionsValues`, etc. objects + """ + selected_options: [ID] + sku: String +} + +interface CartItemInterface { + id: String! @deprecated(reason: "Use `uid` instead") + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +type CartItemPrices { + """An array of discounts to be applied to the cart item""" + discounts: [Discount] + + """Applied FPT to the cart item.""" + fixed_product_taxes: [FixedProductTax] + price: Money! + row_total: Money! + row_total_including_tax: Money! + + """The total of all discounts applied to the item""" + total_item_discount: Money +} + +""" +Deprecated: `cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity` +""" +type CartItemQuantity { + cart_item_id: Int! @deprecated(reason: "`cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity`") + quantity: Float! @deprecated(reason: "`cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity`") +} + +type CartItemSelectedOptionValuePrice { + type: PriceTypeEnum! + units: String! + value: Float! +} + +input CartItemUpdateInput { + """Deprecated. Use `cart_item_uid` instead.""" + cart_item_id: Int + + """The unique ID for a `CartItemInterface` object""" + cart_item_uid: ID + customizable_options: [CustomizableOptionInput] + + """Gift message details for the cart item""" + gift_message: GiftMessageInput + quantity: Float +} + +type CartPrices { + applied_taxes: [CartTaxItem] + discount: CartDiscount @deprecated(reason: "Use discounts instead ") + + """An array of applied discounts""" + discounts: [Discount] + grand_total: Money + subtotal_excluding_tax: Money + subtotal_including_tax: Money + subtotal_with_discount_excluding_tax: Money +} + +type CartTaxItem { + amount: Money! + label: String! +} + +"""An error encountered while adding an item to the the cart.""" +type CartUserInputError { + """Cart-specific error code""" + code: CartUserInputErrorType! + + """A localized error message""" + message: String! +} + +enum CartUserInputErrorType { + PRODUCT_NOT_FOUND + NOT_SALABLE + INSUFFICIENT_STOCK + UNDEFINED +} + +type Categories { + """The payment method assets""" + asset_urls: [Assets] + + """The payment method identifier""" + identifier: String! + + """The payment method name""" + name: String! +} + +""" +CategoryFilterInput defines the filters to be used in the search. A filter +contains at least one attribute, a comparison operator, and the value that is +being searched for. +""" +input CategoryFilterInput { + """Filter by the unique category ID for a `CategoryInterface` object.""" + category_uid: FilterEqualTypeInput + + """ + Deprecated: use 'category_uid' to filter uniquely identifiers of categories. + """ + ids: FilterEqualTypeInput + + """Filter by the display name of the category.""" + name: FilterMatchTypeInput + + """ + Filter by the unique parent category ID for a `CategoryInterface` object. + """ + parent_category_uid: FilterEqualTypeInput + + """ + Filter by the unique parent category ID for a `CategoryInterface` object. + """ + parent_id: FilterEqualTypeInput + + """Filter by the part of the URL that identifies the category.""" + url_key: FilterEqualTypeInput + + """Filter by the URL path for the category.""" + url_path: FilterEqualTypeInput +} + +""" +CategoryInterface contains the full set of attributes that can be returned in a category search. +""" +interface CategoryInterface { + available_sort_by: [String] + + """Breadcrumbs, parent categories info.""" + breadcrumbs: [Breadcrumb] + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Categories' is enabled + """ + canonical_url: String + children_count: String + + """Category CMS Block.""" + cms_block: CmsBlock + + """Timestamp indicating when the category was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + custom_layout_update_file: String + + """The attribute to use for sorting.""" + default_sort_by: String + + """An optional description of the category.""" + description: String + + """Category display mode (products only, static block only, both)""" + display_mode: String + filter_price_range: Float + + """An ID that uniquely identifies the category.""" + id: Int @deprecated(reason: "Use the `uid` argument instead.") + image: String + include_in_menu: Int + is_anchor: Int + landing_page: Int + + """Indicates the depth of the category within the tree.""" + level: Int + meta_description: String + meta_keywords: String + meta_title: String + + """The display name of the category.""" + name: String + + """Category Path.""" + path: String + + """Category path in store.""" + path_in_store: String + + """ + The position of the category relative to other categories at the same level in tree. + """ + position: Int + + """ + The number of products in the category that are marked as visible. By default, + in complex products, parent products are visible, but their child products are not. + """ + product_count: Int + + """The list of products assigned to the category.""" + products( + """ + Specifies the maximum number of results to return at once. This attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + + """ + Specifies which attributes to sort on, and whether to return the results in ascending or descending order. + """ + sort: ProductAttributeSortInput + ): CategoryProducts + + """The unique ID for a `CategoryInterface` object.""" + uid: ID! + + """Timestamp indicating when the category was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + url: String + + """The url key assigned to the category.""" + url_key: String + + """The url path assigned to the category.""" + url_path: String + + """The part of the category URL that is appended after the url key""" + url_suffix: String +} + +"""The category products object returned in the Category query.""" +type CategoryProducts { + """An array of products that are assigned to the category.""" + items: [ProductInterface] + + """ + An object that includes the page_info and currentPage values specified in the query. + """ + page_info: SearchResultPageInfo + + """ + The number of products in the category that are marked as visible. By default, + in complex products, parent products are visible, but their child products are not. + """ + total_count: Int +} + +"""A collection of CategoryTree objects and pagination information.""" +type CategoryResult { + """A list of categories that match the filter criteria.""" + items: [CategoryTree] + + """ + An object that includes the page_info and currentPage values specified in the query. + """ + page_info: SearchResultPageInfo + + """The total number of categories that match the criteria.""" + total_count: Int +} + +"""Category tree implementation""" +type CategoryTree implements CategoryInterface & RoutableInterface { + available_sort_by: [String] + + """Breadcrumbs, parent categories info.""" + breadcrumbs: [Breadcrumb] + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Categories' is enabled + """ + canonical_url: String + + """Child categories tree.""" + children: [CategoryTree] + children_count: String + + """Category CMS Block.""" + cms_block: CmsBlock + + """Timestamp indicating when the category was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + custom_layout_update_file: String + + """The attribute to use for sorting.""" + default_sort_by: String + + """An optional description of the category.""" + description: String + + """Category display mode (products only, static block only, both)""" + display_mode: String + filter_price_range: Float + + """An ID that uniquely identifies the category.""" + id: Int @deprecated(reason: "Use the `uid` argument instead.") + image: String + include_in_menu: Int + + """Category is enabled""" + is_active: Boolean + is_anchor: Int + landing_page: Int + + """Indicates the depth of the category within the tree.""" + level: Int + meta_description: String + meta_keywords: String + meta_title: String + + """The display name of the category.""" + name: String + + """Category Path.""" + path: String + + """Category path in store.""" + path_in_store: String + + """ + The position of the category relative to other categories at the same level in tree. + """ + position: Int + + """ + The number of products in the category that are marked as visible. By default, + in complex products, parent products are visible, but their child products are not. + """ + product_count: Int + + """The list of products assigned to the category.""" + products( + """ + Specifies the maximum number of results to return at once. This attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + + """ + Specifies which attributes to sort on, and whether to return the results in ascending or descending order. + """ + sort: ProductAttributeSortInput + ): CategoryProducts + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """The unique ID for a `CategoryInterface` object.""" + uid: ID! + + """Timestamp indicating when the category was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + url: String + + """The url key assigned to the category.""" + url_key: String + + """The url path assigned to the category.""" + url_path: String + + """The part of the category URL that is appended after the url key""" + url_suffix: String +} + +type ChatData { + """API space id""" + api_space_id: String + + """Cookie name""" + cookie_name: String + + """Is chat enabled""" + is_enabled: Boolean +} + +"""Defines all Checkout Agreement information""" +type CheckoutAgreement { + """Checkout Agreement identifier""" + agreement_id: Int! + + """Checkout Agreement checkbox text""" + checkbox_text: String! + + """Checkout Agreement content""" + content: String! + + """Checkout Agreement content height""" + content_height: String + + """Is Checkout Agreement content in HTML format""" + is_html: Boolean! + mode: CheckoutAgreementMode! + + """Checkout Agreement name""" + name: String! +} + +enum CheckoutAgreementMode { + AUTO + MANUAL +} + +"""An error encountered while adding an item the the cart.""" +type CheckoutUserInputError { + """Checkout-specific error code""" + code: CheckoutUserInputErrorCodes! + + """Localized error message""" + message: String! + + """ + Path to the input field that caused an error. See the GraphQL specification + about path errors for details: http://spec.graphql.org/draft/#sec-Errors + """ + path: [String]! +} + +enum CheckoutUserInputErrorCodes { + REORDER_NOT_AVAILABLE + PRODUCT_NOT_FOUND + NOT_SALABLE + INSUFFICIENT_STOCK + UNDEFINED +} + +"""CMS block defines all CMS block information""" +type CmsBlock { + """CMS block content""" + content: String + + """CMS block is disabled""" + disabled: Boolean + + """CMS block identifier""" + identifier: String + + """CMS block title""" + title: String +} + +"""CMS blocks information""" +type CmsBlocks { + """An array of CMS blocks""" + items: [CmsBlock] +} + +"""CMS page defines all CMS page information""" +type CmsPage implements RoutableInterface { + """CMS page content""" + content: String + + """CMS page content heading""" + content_heading: String + + """Identifier of the CMS page""" + identifier: String + + """CMS page meta description""" + meta_description: String + + """CMS page meta keywords""" + meta_keywords: String + + """CMS page meta title""" + meta_title: String + + """CMS page content heading""" + page_layout: String + + """CMS page width""" + page_width: String + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """CMS page title""" + title: String + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """URL key of CMS page""" + url_key: String +} + +type ColorSwatchData implements SwatchDataInterface { + """Value of swatch item (HEX color code, image link or textual value)""" + value: String +} + +type ComparableAttribute { + """An attribute code that is enabled for product comparisons""" + code: String! + + """The label of the attribute code""" + label: String! +} + +type ComparableItem { + """An array of product attributes that can be used to compare products""" + attributes: [ProductAttribute]! + + """Contains details about a product in a compare list""" + product: ProductInterface! + + """The unique ID of an item in a compare list""" + uid: ID! +} + +type CompareList { + """An array of attributes that can be used for comparing products""" + attributes: [ComparableAttribute] + + """The number of items in the compare list""" + item_count: Int! + + """An array of products to compare""" + items: [ComparableItem] + + """The unique ID assigned to the compare list""" + uid: ID! +} + +type ComplexTextValue { + """HTML format""" + html: String! +} + +""" +ConfigurableAttributeOption contains the value_index (and other related +information) assigned to a configurable product option +""" +type ConfigurableAttributeOption { + """The ID assigned to the attribute""" + code: String + + """A string that describes the configurable attribute option""" + label: String + + """The unique ID for a `ConfigurableAttributeOption` object""" + uid: ID! + + """A unique index number assigned to the configurable product option""" + value_index: Int +} + +type ConfigurableCartItem implements CartItemInterface { + configurable_options: [SelectedConfigurableOption]! + + """Product details of the cart item""" + configured_variant: ProductInterface! + customizable_options: [SelectedCustomizableOption] + + """The entered gift message for the cart item""" + gift_message: GiftMessage + id: String! @deprecated(reason: "Use `uid` instead") + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +input ConfigurableItemOptionsInput { + option_id: String + option_value: Int +} + +""" +Configurable option available for further selection based on current selection. +""" +type ConfigurableOptionAvailableForSelection { + """Attribute code that uniquely identifies configurable option.""" + attribute_code: String! + + """Configurable option values available for further selection.""" + option_value_uids: [ID]! +} + +""" +ConfigurableProduct defines basic features of a configurable product and its simple product variants +""" +type ConfigurableProduct implements ProductInterface & RoutableInterface & PhysicalProductInterface & CustomizableProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """An array of linked simple product items""" + configurable_options: [ConfigurableProductOptions] + + """Specified configurable product options selection""" + configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of variants of products""" + variants: [ConfigurableVariant] + + """An array of variants of products, optimized version for PLP""" + variants_plp: [ConfigurableVariant] + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + + """The weight of the item, in units defined by the store.""" + weight: Float + yes_no: Int +} + +input ConfigurableProductCartItemInput { + customizable_options: [CustomizableOptionInput] + data: CartItemInput! + + """Configurable product SKU.""" + parent_sku: String + + """Deprecated. Use CartItemInput.sku instead.""" + variant_sku: String +} + +type ConfigurableProductOption { + attribute_code: String! + label: String! + uid: ID! + values: [ConfigurableProductOptionValue] +} + +""" +ConfigurableProductOptions defines configurable attributes for the specified product +""" +type ConfigurableProductOptions { + """A string that identifies the attribute""" + attribute_code: String + + """The ID assigned to the attribute""" + attribute_id: String @deprecated(reason: "Use attribute_uid instead") + + """The ID assigned to the attribute""" + attribute_id_v2: Int @deprecated(reason: "Use attribute_uid instead") + + """The unique ID for a `Attribute` object""" + attribute_uid: ID! + + """The configurable option ID number assigned by the system""" + id: Int @deprecated(reason: "Use uid instead") + + """ + A string that describes the configurable product option, which is displayed on the UI + """ + label: String + + """A number that indicates the order in which the attribute is displayed""" + position: Int + + """This is the same as a product's id field""" + product_id: Int @deprecated(reason: "`product_id` is not needed and can be obtained from it's parent") + + """The unique ID for a `ConfigurableProductOptions` object""" + uid: ID! + + """Indicates whether the option is the default""" + use_default: Boolean + + """ + An array that defines the value_index codes assigned to the configurable product + """ + values: [ConfigurableProductOptionsValues] +} + +"""Metadata corresponding to the configurable options selection.""" +type ConfigurableProductOptionsSelection { + """ + Configurable options available for further selection based on current selection. + """ + configurable_options: [ConfigurableProductOption] + + """ + Product images and videos corresponding to the specified configurable options selection. + """ + media_gallery: [MediaGalleryInterface] + + """ + Configurable options available for further selection based on current selection. + """ + options_available_for_selection: [ConfigurableOptionAvailableForSelection] + + """ + Variant represented by the specified configurable options selection. It is + expected to be null, until selections are made for each configurable option. + """ + variant: SimpleProduct +} + +""" +ConfigurableProductOptionsValues contains the index number assigned to a configurable product option +""" +type ConfigurableProductOptionsValues { + """The label of the product on the default store""" + default_label: String + + """The label of the product""" + label: String + + """The label of the product on the current store""" + store_label: String + + """Swatch data for configurable product option""" + swatch_data: SwatchDataInterface + + """The unique ID for a `ConfigurableProductOptionsValues` object""" + uid: ID + + """Indicates whether to use the default_label""" + use_default_value: Boolean + + """A unique index number assigned to the configurable product option""" + value_index: Int @deprecated(reason: "Use `uid` instead") +} + +type ConfigurableProductOptionValue { + is_available: Boolean! + is_use_default: Boolean! + label: String! + swatch: SwatchDataInterface + uid: ID! +} + +""" +An array containing all the simple product variants of a configurable product +""" +type ConfigurableVariant { + attributes: [ConfigurableAttributeOption] + product: SimpleProduct +} + +"""A configurable product wish list item""" +type ConfigurableWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """ + The SKU of the simple product corresponding to a set of selected configurable options + """ + child_sku: String! + + """An array of selected configurable options""" + configurable_options: [SelectedConfigurableOption] + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +input ContactForm { + email: String + message: String + name: String + telephone: String +} + +type ContactFormResponse { + message: String +} + +type ContactPageConfig { + enabled: Boolean +} + +type Country { + available_regions: [Region] + full_name_english: String + full_name_locale: String + + """The unique ID for a `Country` object.""" + id: String + is_state_required: Boolean + three_letter_abbreviation: String + two_letter_abbreviation: String +} + +"""The list of countries codes""" +enum CountryCodeEnum { + """Afghanistan""" + AF + + """Åland Islands""" + AX + + """Albania""" + AL + + """Algeria""" + DZ + + """American Samoa""" + AS + + """Andorra""" + AD + + """Angola""" + AO + + """Anguilla""" + AI + + """Antarctica""" + AQ + + """Antigua & Barbuda""" + AG + + """Argentina""" + AR + + """Armenia""" + AM + + """Aruba""" + AW + + """Australia""" + AU + + """Austria""" + AT + + """Azerbaijan""" + AZ + + """Bahamas""" + BS + + """Bahrain""" + BH + + """Bangladesh""" + BD + + """Barbados""" + BB + + """Belarus""" + BY + + """Belgium""" + BE + + """Belize""" + BZ + + """Benin""" + BJ + + """Bermuda""" + BM + + """Bhutan""" + BT + + """Bolivia""" + BO + + """Bosnia & Herzegovina""" + BA + + """Botswana""" + BW + + """Bouvet Island""" + BV + + """Brazil""" + BR + + """British Indian Ocean Territory""" + IO + + """British Virgin Islands""" + VG + + """Brunei""" + BN + + """Bulgaria""" + BG + + """Burkina Faso""" + BF + + """Burundi""" + BI + + """Cambodia""" + KH + + """Cameroon""" + CM + + """Canada""" + CA + + """Cape Verde""" + CV + + """Cayman Islands""" + KY + + """Central African Republic""" + CF + + """Chad""" + TD + + """Chile""" + CL + + """China""" + CN + + """Christmas Island""" + CX + + """Cocos (Keeling) Islands""" + CC + + """Colombia""" + CO + + """Comoros""" + KM + + """Congo-Brazzaville""" + CG + + """Congo-Kinshasa""" + CD + + """Cook Islands""" + CK + + """Costa Rica""" + CR + + """Côte d’Ivoire""" + CI + + """Croatia""" + HR + + """Cuba""" + CU + + """Cyprus""" + CY + + """Czech Republic""" + CZ + + """Denmark""" + DK + + """Djibouti""" + DJ + + """Dominica""" + DM + + """Dominican Republic""" + DO + + """Ecuador""" + EC + + """Egypt""" + EG + + """El Salvador""" + SV + + """Equatorial Guinea""" + GQ + + """Eritrea""" + ER + + """Estonia""" + EE + + """Ethiopia""" + ET + + """Falkland Islands""" + FK + + """Faroe Islands""" + FO + + """Fiji""" + FJ + + """Finland""" + FI + + """France""" + FR + + """French Guiana""" + GF + + """French Polynesia""" + PF + + """French Southern Territories""" + TF + + """Gabon""" + GA + + """Gambia""" + GM + + """Georgia""" + GE + + """Germany""" + DE + + """Ghana""" + GH + + """Gibraltar""" + GI + + """Greece""" + GR + + """Greenland""" + GL + + """Grenada""" + GD + + """Guadeloupe""" + GP + + """Guam""" + GU + + """Guatemala""" + GT + + """Guernsey""" + GG + + """Guinea""" + GN + + """Guinea-Bissau""" + GW + + """Guyana""" + GY + + """Haiti""" + HT + + """Heard & McDonald Islands""" + HM + + """Honduras""" + HN + + """Hong Kong SAR China""" + HK + + """Hungary""" + HU + + """Iceland""" + IS + + """India""" + IN + + """Indonesia""" + ID + + """Iran""" + IR + + """Iraq""" + IQ + + """Ireland""" + IE + + """Isle of Man""" + IM + + """Israel""" + IL + + """Italy""" + IT + + """Jamaica""" + JM + + """Japan""" + JP + + """Jersey""" + JE + + """Jordan""" + JO + + """Kazakhstan""" + KZ + + """Kenya""" + KE + + """Kiribati""" + KI + + """Kuwait""" + KW + + """Kyrgyzstan""" + KG + + """Laos""" + LA + + """Latvia""" + LV + + """Lebanon""" + LB + + """Lesotho""" + LS + + """Liberia""" + LR + + """Libya""" + LY + + """Liechtenstein""" + LI + + """Lithuania""" + LT + + """Luxembourg""" + LU + + """Macau SAR China""" + MO + + """Macedonia""" + MK + + """Madagascar""" + MG + + """Malawi""" + MW + + """Malaysia""" + MY + + """Maldives""" + MV + + """Mali""" + ML + + """Malta""" + MT + + """Marshall Islands""" + MH + + """Martinique""" + MQ + + """Mauritania""" + MR + + """Mauritius""" + MU + + """Mayotte""" + YT + + """Mexico""" + MX + + """Micronesia""" + FM + + """Moldova""" + MD + + """Monaco""" + MC + + """Mongolia""" + MN + + """Montenegro""" + ME + + """Montserrat""" + MS + + """Morocco""" + MA + + """Mozambique""" + MZ + + """Myanmar (Burma)""" + MM + + """Namibia""" + NA + + """Nauru""" + NR + + """Nepal""" + NP + + """Netherlands""" + NL + + """Netherlands Antilles""" + AN + + """New Caledonia""" + NC + + """New Zealand""" + NZ + + """Nicaragua""" + NI + + """Niger""" + NE + + """Nigeria""" + NG + + """Niue""" + NU + + """Norfolk Island""" + NF + + """Northern Mariana Islands""" + MP + + """North Korea""" + KP + + """Norway""" + NO + + """Oman""" + OM + + """Pakistan""" + PK + + """Palau""" + PW + + """Palestinian Territories""" + PS + + """Panama""" + PA + + """Papua New Guinea""" + PG + + """Paraguay""" + PY + + """Peru""" + PE + + """Philippines""" + PH + + """Pitcairn Islands""" + PN + + """Poland""" + PL + + """Portugal""" + PT + + """Qatar""" + QA + + """Réunion""" + RE + + """Romania""" + RO + + """Russia""" + RU + + """Rwanda""" + RW + + """Samoa""" + WS + + """San Marino""" + SM + + """São Tomé & Príncipe""" + ST + + """Saudi Arabia""" + SA + + """Senegal""" + SN + + """Serbia""" + RS + + """Seychelles""" + SC + + """Sierra Leone""" + SL + + """Singapore""" + SG + + """Slovakia""" + SK + + """Slovenia""" + SI + + """Solomon Islands""" + SB + + """Somalia""" + SO + + """South Africa""" + ZA + + """South Georgia & South Sandwich Islands""" + GS + + """South Korea""" + KR + + """Spain""" + ES + + """Sri Lanka""" + LK + + """St. Barthélemy""" + BL + + """St. Helena""" + SH + + """St. Kitts & Nevis""" + KN + + """St. Lucia""" + LC + + """St. Martin""" + MF + + """St. Pierre & Miquelon""" + PM + + """St. Vincent & Grenadines""" + VC + + """Sudan""" + SD + + """Suriname""" + SR + + """Svalbard & Jan Mayen""" + SJ + + """Swaziland""" + SZ + + """Sweden""" + SE + + """Switzerland""" + CH + + """Syria""" + SY + + """Taiwan""" + TW + + """Tajikistan""" + TJ + + """Tanzania""" + TZ + + """Thailand""" + TH + + """Timor-Leste""" + TL + + """Togo""" + TG + + """Tokelau""" + TK + + """Tonga""" + TO + + """Trinidad & Tobago""" + TT + + """Tunisia""" + TN + + """Turkey""" + TR + + """Turkmenistan""" + TM + + """Turks & Caicos Islands""" + TC + + """Tuvalu""" + TV + + """Uganda""" + UG + + """Ukraine""" + UA + + """United Arab Emirates""" + AE + + """United Kingdom""" + GB + + """United States""" + US + + """Uruguay""" + UY + + """U.S. Outlying Islands""" + UM + + """U.S. Virgin Islands""" + VI + + """Uzbekistan""" + UZ + + """Vanuatu""" + VU + + """Vatican City""" + VA + + """Venezuela""" + VE + + """Vietnam""" + VN + + """Wallis & Futuna""" + WF + + """Western Sahara""" + EH + + """Yemen""" + YE + + """Zambia""" + ZM + + """Zimbabwe""" + ZW +} + +input CreateCompareListInput { + """An array of product IDs to add to the compare list""" + products: [ID] +} + +type CreateCustomerType { + customer: Customer + + """Customer creation status""" + status: String + + """The customer token""" + token: String +} + +input createEmptyCartInput { + cart_id: String +} + +input createKlarnaPaymentsSessionInput { + cart_id: String! +} + +type createKlarnaPaymentsSessionOutput { + """The payment method client token""" + client_token: String + + """The payment method categories""" + payment_method_categories: [Categories] +} + +""" +Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods. +""" +type CreatePayflowProTokenOutput { + response_message: String! + result: Int! + result_code: Int! + secure_token: String! + secure_token_id: String! +} + +input CreateProductReviewInput { + """The customer's nickname. Defaults to the customer name, if logged in""" + nickname: String! + + """Ratings details by category. e.g price: 5, quality: 4 etc""" + ratings: [ProductReviewRatingInput]! + + """The SKU of the reviewed product""" + sku: String! + + """The summary (title) of the review""" + summary: String! + + """The review text.""" + text: String! +} + +type CreateProductReviewOutput { + """Contains the completed product review""" + review: ProductReview! +} + +"""Required fields for Payflow Pro and Payments Pro credit card payments""" +input CreditCardDetailsInput { + """Credit card expiration month""" + cc_exp_month: Int! + + """Credit card expiration year""" + cc_exp_year: Int! + + """Last 4 digits of the credit card""" + cc_last_4: Int! + + """Credit card type""" + cc_type: String! +} + +type CreditCustomerInfo { + first_name: String + iin_number: String + last_name: String + middle_name: String + phone: String +} + +"""Credit memo details""" +type CreditMemo { + """Comments on the credit memo""" + comments: [SalesCommentItem] + + """The unique ID for a `CreditMemo` object""" + id: ID! + + """An array containing details about refunded items""" + items: [CreditMemoItemInterface] + + """The sequential credit memo number""" + number: String! + + """Contains details about the total refunded amount""" + total: CreditMemoTotal +} + +type CreditMemoItem implements CreditMemoItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `CreditMemoItemInterface` object""" + id: ID! + + """The order item the credit memo is applied to""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product, including selected options""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """The number of refunded items""" + quantity_refunded: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +"""Credit memo item details""" +interface CreditMemoItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `CreditMemoItemInterface` object""" + id: ID! + + """The order item the credit memo is applied to""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product, including selected options""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """The number of refunded items""" + quantity_refunded: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +"""Credit memo price details""" +type CreditMemoTotal { + """An adjustment manually applied to the order""" + adjustment: Money! + + """The final base grand total amount in the base currency""" + base_grand_total: Money! + + """The applied discounts to the credit memo""" + discounts: [Discount] + + """The final total amount, including shipping, discounts, and taxes""" + grand_total: Money! + + """ + Contains details about the shipping and handling costs for the credit memo + """ + shipping_handling: ShippingHandling + + """The subtotal of the invoice, excluding shipping, discounts, and taxes""" + subtotal: Money! + + """The credit memo tax details""" + taxes: [TaxItem] + + """The shipping amount for the credit memo""" + total_shipping: Money! + + """The amount of tax applied to the credit memo""" + total_tax: Money! +} + +type Currency { + available_currency_codes: [String] + base_currency_code: String + base_currency_symbol: String + default_display_currecy_code: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_code`.") + default_display_currecy_symbol: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_symbol`.") + default_display_currency_code: String + default_display_currency_symbol: String + exchange_rates: [ExchangeRate] + id: String + label: String + value: String +} + +type CurrencyConfig { + available_currencies_data: [Currency] + current_currency_code: String +} + +"""The list of available currency codes""" +enum CurrencyEnum { + AFN + ALL + AZN + DZD + AOA + ARS + AMD + AWG + AUD + BSD + BHD + BDT + BBD + BYN + BZD + BMD + BTN + BOB + BAM + BWP + BRL + GBP + BND + BGN + BUK + BIF + KHR + CAD + CVE + CZK + KYD + GQE + CLP + CNY + COP + KMF + CDF + CRC + HRK + CUP + DKK + DJF + DOP + XCD + EGP + SVC + ERN + EEK + ETB + EUR + FKP + FJD + GMD + GEK + GEL + GHS + GIP + GTQ + GNF + GYD + HTG + HNL + HKD + HUF + ISK + INR + IDR + IRR + IQD + ILS + JMD + JPY + JOD + KZT + KES + KWD + KGS + LAK + LVL + LBP + LSL + LRD + LYD + LTL + MOP + MKD + MGA + MWK + MYR + MVR + LSM + MRO + MUR + MXN + MDL + MNT + MAD + MZN + MMK + NAD + NPR + ANG + YTL + NZD + NIC + NGN + KPW + NOK + OMR + PKR + PAB + PGK + PYG + PEN + PHP + PLN + QAR + RHD + RON + RUB + RWF + SHP + STD + SAR + RSD + SCR + SLL + SGD + SKK + SBD + SOS + ZAR + KRW + LKR + SDG + SRD + SZL + SEK + CHF + SYP + TWD + TJS + TZS + THB + TOP + TTD + TND + TMM + USD + UGX + UAH + AED + UYU + UZS + VUV + VEB + VEF + VND + CHE + CHW + XOF + WST + YER + ZMK + ZWD + TRY + AZM + ROL + TRL + XPF +} + +""" +CustomAttributeMetadata defines an array of attribute_codes and entity_types +""" +type CustomAttributeMetadata { + """An array of attributes""" + items: [Attribute] +} + +"""Customer defines the customer name and address and other details""" +type Customer { + """An array containing the customer's shipping and billing addresses""" + addresses: [CustomerAddress] + + """Indicates whether the customer has enabled remote shopping assistance""" + allow_remote_shopping_assistance: Boolean! + + """The contents of the customer's compare list""" + compare_list: CompareList + + """Email confirmation is required""" + confirmation_required: Boolean + + """Timestamp indicating when the account was created""" + created_at: String + + """The customer's date of birth""" + date_of_birth: String + + """The ID assigned to the billing address""" + default_billing: String + + """The ID assigned to the shipping address""" + default_shipping: String + + """The customer's date of birth""" + dob: String @deprecated(reason: "Use `date_of_birth` instead") + + """The customer's email address. Required""" + email: String + + """The customer's first name""" + firstname: String + + """The customer's gender (Male - 1, Female - 2)""" + gender: Int + group_id: Int @deprecated(reason: "Customer group should not be exposed in the storefront scenarios") + + """The ID assigned to the customer""" + id: Int @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") + + """ + Indicates whether the customer is subscribed to the company's newsletter + """ + is_subscribed: Boolean + + """The customer's family name""" + lastname: String + + """The customer's middle name""" + middlename: String + orders( + """Defines the filter to use for searching customer orders""" + filter: CustomerOrdersFilterInput + + """Specifies which page of results to return. The default value is 1""" + currentPage: Int = 1 + + """ + Specifies the maximum number of results to return at once. The default value is 20 + """ + pageSize: Int = 20 + ): CustomerOrders + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """Contains the customer's product reviews""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + + """A value such as Sr., Jr., or III""" + suffix: String + + """The customer's Value-added tax (VAT) number (for corporate customers)""" + taxvat: String + + """Contains a customer's wish lists""" + wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2`") + + """ + Retrieve the specified wish list identified by the unique ID for a `Wishlist` object + """ + wishlist_v2(id: ID!): Wishlist + + """ + An array of wishlists. In Magento Open Source, customers are limited to one + wish list. The number of wish lists is configurable for Magento Commerce + """ + wishlists( + """ + Specifies the maximum number of results to return at once. This attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + ): [Wishlist]! +} + +type CustomerActionConfirmationType { + """Customer email verification status""" + status: String +} + +""" +CustomerAddress contains detailed information about a customer's billing and shipping addresses +""" +type CustomerAddress { + """The city or town""" + city: String + + """The customer's company""" + company: String + + """The customer's country""" + country_code: CountryCodeEnum + + """The customer's country""" + country_id: String @deprecated(reason: "Use `country_code` instead.") + custom_attributes: [CustomerAddressAttribute] @deprecated(reason: "Custom attributes should not be put into container") + + """The customer ID""" + customer_id: Int @deprecated(reason: "customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses.") + + """Indicates whether the address is the default billing address""" + default_billing: Boolean + + """Indicates whether the address is the default shipping address""" + default_shipping: Boolean + + """Address extension attributes""" + extension_attributes: [CustomerAddressAttribute] + + """The fax number""" + fax: String + + """ + The first name of the person associated with the shipping/billing address + """ + firstname: String + + """The ID assigned to the address object""" + id: Int + + """ + The family name of the person associated with the shipping/billing address + """ + lastname: String + + """ + The middle name of the person associated with the shipping/billing address + """ + middlename: String + + """The customer's ZIP or postal code""" + postcode: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """An object containing the region name, region code, and region ID""" + region: CustomerAddressRegion + + """The unique ID for a pre-defined region""" + region_id: Int + + """An array of strings that define the street number and name""" + street: [String] + + """A value such as Sr., Jr., or III""" + suffix: String + + """The telephone number""" + telephone: String + + """The customer's Value-added tax (VAT) number (for corporate customers)""" + vat_id: String +} + +type CustomerAddressAttribute { + """Attribute code""" + attribute_code: String + + """Attribute value""" + value: String +} + +input CustomerAddressAttributeInput { + """Attribute code""" + attribute_code: String! + + """Attribute value""" + value: String! +} + +input CustomerAddressInput { + """The city or town""" + city: String + + """The customer's company""" + company: String + + """The customer's country""" + country_code: CountryCodeEnum + + """Deprecated: use `country_code` instead.""" + country_id: CountryCodeEnum + + """Deprecated: Custom attributes should not be put into container.""" + custom_attributes: [CustomerAddressAttributeInput] + + """Indicates whether the address is the default billing address""" + default_billing: Boolean + + """Indicates whether the address is the default shipping address""" + default_shipping: Boolean + + """The fax number""" + fax: String + + """ + The first name of the person associated with the shipping/billing address + """ + firstname: String + + """ + The family name of the person associated with the shipping/billing address + """ + lastname: String + + """ + The middle name of the person associated with the shipping/billing address + """ + middlename: String + + """The customer's ZIP or postal code""" + postcode: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """An object containing the region name, region code, and region ID""" + region: CustomerAddressRegionInput + + """An array of strings that define the street number and name""" + street: [String] + + """A value such as Sr., Jr., or III""" + suffix: String + + """The telephone number""" + telephone: String + + """The customer's Tax/VAT number (for corporate customers)""" + vat_id: String +} + +"""CustomerAddressRegion defines the customer's state or province""" +type CustomerAddressRegion { + """The state or province name""" + region: String + + """The address region code""" + region_code: String + + """The unique ID for a pre-defined region""" + region_id: Int +} + +"""CustomerAddressRegionInput defines the customer's state or province""" +input CustomerAddressRegionInput { + """The state or province name""" + region: String + + """The address region code""" + region_code: String + + """The unique ID for a pre-defined region""" + region_id: Int +} + +input CustomerCreateInput { + """Indicates whether the customer has enabled remote shopping assistance""" + allow_remote_shopping_assistance: Boolean + + """The customer's date of birth""" + date_of_birth: String + + """Deprecated: Use `date_of_birth` instead""" + dob: String + + """The customer's email address. Required for customer creation""" + email: String! + + """The customer's first name""" + firstname: String! + + """The customer's gender (Male - 1, Female - 2)""" + gender: Int + + """ + Indicates whether the customer is subscribed to the company's newsletter + """ + is_subscribed: Boolean + + """The customer's family name""" + lastname: String! + + """The customer's middle name""" + middlename: String + + """The customer's password""" + password: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """A value such as Sr., Jr., or III""" + suffix: String + + """The customer's Tax/VAT number (for corporate customers)""" + taxvat: String +} + +type CustomerDownloadableProduct { + date: String + download_url: String + link_title: String + order_id: Int + order_increment_id: String + remaining_downloads: String + status: String + title: String +} + +type CustomerDownloadableProducts { + """List of purchased downloadable items""" + items: [CustomerDownloadableProduct] +} + +input CustomerInput { + """The customer's date of birth""" + date_of_birth: String + + """Deprecated: Use `date_of_birth` instead""" + dob: String + + """The customer's email address. Required for customer creation""" + email: String + + """The customer's first name""" + firstname: String + + """The customer's gender (Male - 1, Female - 2)""" + gender: Int + + """ + Indicates whether the customer is subscribed to the company's newsletter + """ + is_subscribed: Boolean + + """The customer's family name""" + lastname: String + + """The customer's middle name""" + middlename: String + + """The customer's password""" + password: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """A value such as Sr., Jr., or III""" + suffix: String + + """The customer's Tax/VAT number (for corporate customers)""" + taxvat: String +} + +"""Contains details about each of the customer's orders""" +type CustomerOrder { + """The billing address for the order""" + billing_address: OrderAddress + + """Defines if order can be reordered""" + can_reorder: Boolean! + + """The shipping carrier for the order delivery""" + carrier: String + + """Comments about the order""" + comments: [SalesCommentItem] + created_at: String @deprecated(reason: "Use the order_date attribute instead") + + """A list of credit memos""" + credit_memos: [CreditMemo] + + """The entered gift message for the order""" + gift_message: GiftMessage + grand_total: Float @deprecated(reason: "Use the totals.grand_total attribute instead") + + """The unique ID for a `CustomerOrder` object""" + id: ID! + increment_id: String @deprecated(reason: "Use the id attribute instead") + + """A list of invoices for the order""" + invoices: [Invoice]! + + """An array containing the items purchased in this order""" + items: [OrderItemInterface] + + """The order number""" + number: String! + + """The date the order was placed""" + order_date: String! + order_number: String! @deprecated(reason: "Use the number attribute instead") + + """Payment details for the order""" + payment_methods: [OrderPaymentMethod] + + """Represents rss link to subscribe on order status""" + rss_link: String + + """A list of shipments for the order""" + shipments: [OrderShipment] + + """The shipping address for the order""" + shipping_address: OrderAddress + + """The delivery method for the order""" + shipping_method: String + + """The current status of the order""" + status: String! + + """Contains details about the calculated totals for this order""" + total: OrderTotal +} + +""" +The collection of orders that match the conditions defined in the filter +""" +type CustomerOrders { + """An array of customer orders""" + items: [CustomerOrder]! + + """ + An object that includes the current_page, page_info, and page_size values specified in the query + """ + page_info: SearchResultPageInfo + + """The total count of customer orders""" + total_count: Int +} + +"""Identifies the filter to use for filtering orders.""" +input CustomerOrdersFilterInput { + """Filters by order entity id.""" + entity_id: FilterStringTypeInput + + """Filters by order number.""" + number: FilterStringTypeInput +} + +type CustomerOutput { + customer: Customer! +} + +type CustomerPaymentTokens { + """An array of payment tokens""" + items: [PaymentToken]! +} + +type CustomerToken { + """The customer token""" + token: String +} + +input CustomerUpdateInput { + """Indicates whether the customer has enabled remote shopping assistance""" + allow_remote_shopping_assistance: Boolean + + """The customer's date of birth""" + date_of_birth: String + + """Deprecated: Use `date_of_birth` instead""" + dob: String + + """The customer's first name""" + firstname: String + + """The customer's gender (Male - 1, Female - 2)""" + gender: Int + + """ + Indicates whether the customer is subscribed to the company's newsletter + """ + is_subscribed: Boolean + + """The customer's family name""" + lastname: String + + """The customer's middle name""" + middlename: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """A value such as Sr., Jr., or III""" + suffix: String + + """The customer's Tax/VAT number (for corporate customers)""" + taxvat: String +} + +""" +CustomizableAreaOption contains information about a text area that is defined as part of a customizable option. +""" +type CustomizableAreaOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """The Stock Keeping Unit of the base product.""" + product_sku: String + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An object that defines a text area.""" + value: CustomizableAreaValue +} + +""" +CustomizableAreaValue defines the price and sku of a product whose page contains a customized text area. +""" +type CustomizableAreaValue { + """Currency code for the option.""" + currency: String + + """ + The maximum number of characters that can be entered for this customizable option. + """ + max_characters: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The unique ID for a `CustomizableAreaValue` object.""" + uid: ID! +} + +""" +CustomizableCheckbbixOption contains information about a set of checkbox values +that are defined as part of a customizable option. +""" +type CustomizableCheckboxOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An array that defines a set of checkbox values.""" + value: [CustomizableCheckboxValue] +} + +""" +CustomizableCheckboxValue defines the price and sku of a product whose page contains a customized set of checkbox values. +""" +type CustomizableCheckboxValue { + """Currency code for the option.""" + currency: String + + """The ID assigned to the value.""" + option_type_id: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The order in which the checkbox value is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + + """The unique ID for a `CustomizableCheckboxValue` object.""" + uid: ID! +} + +""" +CustomizableDateOption contains information about a date picker that is defined as part of a customizable option. +""" +type CustomizableDateOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """The Stock Keeping Unit of the base product.""" + product_sku: String + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An object that defines a date field in a customizable option.""" + value: CustomizableDateValue +} + +"""This enumeration customizable date type.""" +enum CustomizableDateTypeEnum { + DATE + DATE_TIME + TIME +} + +""" +CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker. +""" +type CustomizableDateValue { + """Currency code for the option.""" + currency: String + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """DATE, DATE_TIME or TIME""" + type: CustomizableDateTypeEnum + + """The unique ID for a `CustomizableDateValue` object.""" + uid: ID! +} + +""" +CustomizableDropDownOption contains information about a drop down menu that is defined as part of a customizable option. +""" +type CustomizableDropDownOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An array that defines the set of options for a drop down menu.""" + value: [CustomizableDropDownValue] +} + +""" +CustomizableDropDownValue defines the price and sku of a product whose page contains a customized drop down menu. +""" +type CustomizableDropDownValue { + """Currency code for the option.""" + currency: String + + """The ID assigned to the value.""" + option_type_id: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + + """The unique ID for a `CustomizableDropDownValue` object.""" + uid: ID! +} + +""" +CustomizableFieldOption contains information about a text field that is defined as part of a customizable option. +""" +type CustomizableFieldOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """The Stock Keeping Unit of the base product.""" + product_sku: String + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An object that defines a text field.""" + value: CustomizableFieldValue +} + +""" +CustomizableFieldValue defines the price and sku of a product whose page contains a customized text field. +""" +type CustomizableFieldValue { + """Currency code for the option.""" + currency: String + + """Option file extensions (If type file).""" + file_extension: String + + """ + The maximum number of characters that can be entered for this customizable option. + """ + max_characters: Int + + """The price of the custom value.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The unique ID for a `CustomizableFieldValue` object.""" + uid: ID! +} + +""" +CustomizableFileOption contains information about a file picker that is defined as part of a customizable option. +""" +type CustomizableFileOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """The Stock Keeping Unit of the base product.""" + product_sku: String + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An object that defines a file value.""" + value: CustomizableFileValue +} + +""" +CustomizableFileValue defines the price and sku of a product whose page contains a customized file picker. +""" +type CustomizableFileValue { + """Currency code for the option.""" + currency: String + + """The file extension to accept.""" + file_extension: String + + """The maximum width of an image.""" + image_size_x: Int + + """The maximum height of an image.""" + image_size_y: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The unique ID for a `CustomizableFileValue` object.""" + uid: ID! +} + +""" +CustomizableMultipleOption contains information about a multiselect that is defined as part of a customizable option. +""" +type CustomizableMultipleOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An array that defines the set of options for a multiselect.""" + value: [CustomizableMultipleValue] +} + +""" +CustomizableMultipleValue defines the price and sku of a product whose page contains a customized multiselect. +""" +type CustomizableMultipleValue { + """Currency code for the option.""" + currency: String + + """The ID assigned to the value.""" + option_type_id: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + + """The unique ID for a `CustomizableMultipleValue` object.""" + uid: ID! +} + +input CustomizableOptionInput { + """The customizable option id of the product""" + id: Int + + """The string value of the option""" + value_string: String! +} + +""" +The CustomizableOptionInterface contains basic information about a customizable +option. It can be implemented by several types of configurable options. +""" +interface CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! +} + +input CustomizableOptionsInput { + option_filename: String + option_id: String! + option_value: String +} + +""" +CustomizableProductInterface contains information about customizable product options. +""" +interface CustomizableProductInterface { + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] +} + +""" +CustomizableRadioOption contains information about a set of radio buttons that are defined as part of a customizable option. +""" +type CustomizableRadioOption implements CustomizableOptionInterface { + """Option ID.""" + option_id: Int @deprecated(reason: "Use `uid` instead") + + """Indicates whether the option is required.""" + required: Boolean + + """The order in which the option is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + type: String + + """The unique ID for a `CustomizableOptionInterface` object.""" + uid: ID! + + """An array that defines a set of radio buttons.""" + value: [CustomizableRadioValue] +} + +""" +CustomizableRadioValue defines the price and sku of a product whose page contains a customized set of radio buttons. +""" +type CustomizableRadioValue { + """Currency code for the option.""" + currency: String + + """The ID assigned to the value.""" + option_type_id: Int + + """The price assigned to this option.""" + price: Float + + """Option value price excluding tax.""" + priceExclTax: Float + + """Option value price including tax.""" + priceInclTax: Float + + """FIXED, PERCENT, or DYNAMIC.""" + price_type: PriceTypeEnum + + """The Stock Keeping Unit for this option.""" + sku: String + + """The order in which the radio button is displayed.""" + sort_order: Int + + """The display name for this option.""" + title: String + + """The unique ID for a `CustomizableRadioValue` object.""" + uid: ID! +} + +type DeleteCompareListOutput { + """Indicates whether the compare list was successfully deleted""" + result: Boolean! +} + +type DeletePaymentTokenOutput { + customerPaymentTokens: CustomerPaymentTokens + result: Boolean! +} + +""" +Defines an individual discount. A discount can be applied to the cart as a whole or to an item. +""" +type Discount { + """The amount of the discount""" + amount: Money! + + """A description of the discount""" + label: String! +} + +"""Downloadable Cart Item""" +type DownloadableCartItem implements CartItemInterface { + customizable_options: [SelectedCustomizableOption]! + id: String! @deprecated(reason: "Use `uid` instead") + + """ + An array containing information about the links for the added to cart downloadable product + """ + links: [DownloadableProductLinks] + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """ + DownloadableProductSamples defines characteristics of a downloadable product + """ + samples: [DownloadableProductSamples] + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +type DownloadableCreditMemoItem implements CreditMemoItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """ + A list of downloadable links that are refunded from the downloadable product + """ + downloadable_links: [DownloadableItemsLinks] + + """The unique ID for a `CreditMemoItemInterface` object""" + id: ID! + + """The order item the credit memo is applied to""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product, including selected options""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """The number of refunded items""" + quantity_refunded: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +enum DownloadableFileTypeEnum { + FILE @deprecated(reason: "`sample_url` serves to get the downloadable sample") + URL @deprecated(reason: "`sample_url` serves to get the downloadable sample") +} + +type DownloadableInvoiceItem implements InvoiceItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """ + A list of downloadable links that are invoiced from the downloadable product + """ + downloadable_links: [DownloadableItemsLinks] + + """The unique ID for a `InvoiceItemInterface` object""" + id: ID! + + """Contains details about an individual order item""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The number of invoiced items""" + quantity_invoiced: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +""" +DownloadableProductLinks defines characteristics of a downloadable product +""" +type DownloadableItemsLinks { + """A number indicating the sort order""" + sort_order: Int + + """The display name of the link""" + title: String + + """The unique ID for a `DownloadableItemsLinks` object.""" + uid: ID! +} + +type DownloadableOrderItem implements OrderItemInterface { + """The final discount information for the product""" + discounts: [Discount] + + """ + A list of downloadable links that are ordered from the downloadable product + """ + downloadable_links: [DownloadableItemsLinks] + + """The entered option for the base product, such as a logo or image""" + entered_options: [OrderItemOption] + + """The unique ID for a `OrderItemInterface` object""" + id: ID! + + """The name of the base product""" + product_name: String + + """The sale price of the base product, including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The type of product, such as simple, configurable, etc.""" + product_type: String + + """URL key of the base product""" + product_url_key: String + + """The number of canceled items""" + quantity_canceled: Float + + """The number of invoiced items""" + quantity_invoiced: Float + + """The number of units ordered for this item""" + quantity_ordered: Float + + """The number of refunded items""" + quantity_refunded: Float + + """The number of returned items""" + quantity_returned: Float + + """The number of shipped items""" + quantity_shipped: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! + + """The selected options for the base product, such as color or size""" + selected_options: [OrderItemOption] + + """The status of the order item""" + status: String +} + +"""DownloadableProduct defines a product that the shopper downloads""" +type DownloadableProduct implements ProductInterface & RoutableInterface & CustomizableProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + + """ + An array containing information about the links for this downloadable product + """ + downloadable_product_links: [DownloadableProductLinks] + + """ + An array containing information about samples of this downloadable product. + """ + downloadable_product_samples: [DownloadableProductSamples] + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + license_key: String + + """ + A value of 1 indicates that each link in the array must be purchased separately + """ + links_purchased_separately: Int + + """The heading above the list of downloadable products""" + links_title: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + samples_title: String + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + yes_no: Int +} + +input DownloadableProductCartItemInput { + customizable_options: [CustomizableOptionInput] + data: CartItemInput! + downloadable_product_links: [DownloadableProductLinksInput] +} + +""" +DownloadableProductLinks defines characteristics of a downloadable product +""" +type DownloadableProductLinks { + id: Int @deprecated(reason: "This information should not be exposed on frontend") + is_shareable: Boolean @deprecated(reason: "This information should not be exposed on frontend") + link_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") + number_of_downloads: Int @deprecated(reason: "This information should not be exposed on frontend") + + """The price of the downloadable product""" + price: Float + sample_file: String @deprecated(reason: "`sample_url` serves to get the downloadable sample") + sample_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") + + """URL to the downloadable sample""" + sample_url: String + + """A number indicating the sort order""" + sort_order: Int + + """The display name of the link""" + title: String + + """The unique ID for a `DownloadableProductLinks` object.""" + uid: ID! +} + +input DownloadableProductLinksInput { + link_id: Int +} + +""" +DownloadableProductSamples defines characteristics of a downloadable product +""" +type DownloadableProductSamples { + id: Int @deprecated(reason: "This information should not be exposed on frontend") + sample_file: String @deprecated(reason: "`sample_url` serves to get the downloadable sample") + sample_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") + + """URL to the downloadable sample""" + sample_url: String + + """A number indicating the sort order""" + sort_order: Int + + """The display name of the sample""" + title: String +} + +"""A downloadable product wish list item""" +type DownloadableWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """An array containing information about the selected links""" + links_v2: [DownloadableProductLinks] + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! + + """An array containing information about the selected samples""" + samples: [DownloadableProductSamples] +} + +"""Defines a customer-entered option""" +input EnteredOptionInput { + """ + The unique ID for a `CustomizableFieldOption`, `CustomizableFileOption`, + `CustomizableAreaOption`, etc. of `CustomizableOptionInterface` objects + """ + uid: ID! + + """Text the customer entered""" + value: String! +} + +""" +EntityUrl is an output object containing the `id`, `canonical_url`, and `type` attributes +""" +type EntityUrl { + """ + The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original. + """ + canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.") + + """ + The unique ID for a `ProductInterface`, `CategoryInterface`, `CmsPage`, etc. + object associated with the specified url. This could be a product UID, + category UID, or cms page UID. + """ + entity_uid: ID + + """ + The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID. + """ + id: Int @deprecated(reason: "Use `entity_uid` instead.") + + """ + 301 or 302 HTTP code for url permanent or temporary redirect or 0 for the 200 no redirect + """ + redirectCode: Int + + """ + The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original. + """ + relative_url: String + + """If URL rewrite is of type PRODUCT - it will return SKU here""" + sku: String + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum +} + +input EstimateShippingCostsAddress { + city: String + country_id: String + customer_id: Int + email: String + firstname: String + lastname: String + postcode: String + region: String + region_code: String + region_id: Int + same_as_billing: Int + street: [String] + telephone: String +} + +type ExchangeRate { + currency_to: String + rate: Float +} + +type ExtensionAttributes { + tax_grandtotal_details: [TaxGrandTotalDetails] +} + +input ExtensionsAttributeInput { + bundle_options: [BundleOptionInput] + configurable_item_options: [ConfigurableItemOptionsInput] + customizable_options: [CustomizableOptionsInput] + customizable_options_multi: [CustomizableOptionsInput] + downloadable_product_links: [DownloadableProductLinksInput] + grouped_product_options: [CustomizableOptionsInput] +} + +"""Defines a filter that matches the input exactly.""" +input FilterEqualTypeInput { + """A string to filter on""" + eq: String + + """An array of values to filter on""" + in: [String] +} + +"""Defines a filter that performs a fuzzy search.""" +input FilterMatchTypeInput { + """One or more words to filter on""" + match: String +} + +""" +Defines a filter that matches a range of values, such as prices or dates. +""" +input FilterRangeTypeInput { + """The beginning of the range""" + from: String + + """The end of the range""" + to: String +} + +"""Defines a filter for an input string.""" +input FilterStringTypeInput { + """Filters items that are exactly the same as the specified string.""" + eq: String + + """ + Filters items that are exactly the same as entries specified in an array of strings. + """ + in: [String] + + """ + Defines a filter that performs a fuzzy search using the specified string. + """ + match: String +} + +"""FilterTypeInput specifies which action will be performed in a query """ +input FilterTypeInput { + """Equals""" + eq: String + finset: [String] + + """From. Must be used with 'to'""" + from: String + + """Greater than""" + gt: String + + """Greater than or equal to""" + gteq: String + + """In. The value can contain a set of comma-separated values""" + in: [String] + + """ + Like. The specified value can contain % (percent signs) to allow matching of 0 or more characters + """ + like: String + + """Less than""" + lt: String + + """Less than or equal to""" + lteq: String + + """More than or equal to""" + moreq: String + + """Not equal to""" + neq: String + + """Not in. The value can contain a set of comma-separated values""" + nin: [String] + + """Not null""" + notnull: String + + """Is null""" + null: String + + """To. Must be used with 'from'""" + to: String +} + +"""A single FPT that can be applied to a product price.""" +type FixedProductTax { + """Amount of the FPT as a money object.""" + amount: Money + + """The label assigned to the FPT to be displayed on the frontend.""" + label: String +} + +"""This enumeration display settings for the fixed product tax""" +enum FixedProductTaxDisplaySettings { + """ + The displayed price includes the FPT amount without displaying the + ProductPrice.fixed_product_taxes values. This value corresponds to 'Including FPT only' + """ + INCLUDE_FPT_WITHOUT_DETAILS + + """ + The displayed price includes the FPT amount while displaying the values of + ProductPrice.fixed_product_taxes separately. This value corresponds to + 'Including FPT and FPT description' + """ + INCLUDE_FPT_WITH_DETAILS + + """ + The displayed price does not include the FPT amount. The values of + ProductPrice.fixed_product_taxes and the price including the FPT are displayed + separately. This value corresponds to 'Excluding FPT, Including FPT + description and final price' + """ + EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS + + """ + The displayed price does not include the FPT amount. The values from + ProductPrice.fixed_product_taxes are not displayed. This value corresponds to + 'Excluding FPT' + """ + EXCLUDE_FPT_WITHOUT_DETAILS + + """ + The FPT feature is not enabled. You can omit ProductPrice.fixed_product_taxes from your query + """ + FPT_DISABLED +} + +input GenerateCustomerTokenAsAdminInput { + """ + The email address of the customer requesting remote shopping assistance + """ + customer_email: String! +} + +type GenerateCustomerTokenAsAdminOutput { + """The generated customer token""" + customer_token: String! +} + +"""Contains the text of a gift message, its sender, and recipient""" +type GiftMessage { + """Sender name""" + from: String! + + """Gift message text""" + message: String! + + """Recipient name""" + to: String! +} + +"""Contains the text of a gift message, its sender, and recipient""" +input GiftMessageInput { + """Sender name""" + from: String! + + """Gift message text""" + message: String! + + """Recipient name""" + to: String! +} + +""" +A grouped product consists of simple standalone products that are presented as a group +""" +type GroupedProduct implements ProductInterface & RoutableInterface & PhysicalProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + + """An array containing grouped product items""" + items: [GroupedProductItem] + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + + """The weight of the item, in units defined by the store.""" + weight: Float + yes_no: Int +} + +""" +GroupedProductItem contains information about an individual grouped product item +""" +type GroupedProductItem { + """The relative position of this item compared to the other group items""" + position: Int + + """ + The ProductInterface object, which contains details about this product option + """ + product: ProductInterface + + """The quantity of this grouped product item""" + qty: Float +} + +"""A grouped product wish list item""" +type GroupedProductWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +""" +A set of relative URLs that PayPal will use in response to various actions +during the authorization process. Magento prepends the base URL to this value to +create a full URL. For example, if the full URL is +https://www.example.com/path/to/page.html, the relative URL is +path/to/page.html. Use this input for Payments Pro Hosted Solution payment method. +""" +input HostedProInput { + """ + The relative URL of the page that PayPal will redirect to when the buyer + cancels the transaction in order to choose a different payment method. If the + full URL to this page is https://www.example.com/paypal/action/cancel.html, + the relative URL is paypal/action/cancel.html. + """ + cancel_url: String! + + """ + The relative URL of the final confirmation page that PayPal will redirect to + upon payment success. If the full URL to this page is + https://www.example.com/paypal/action/return.html, the relative URL is + paypal/action/return.html. + """ + return_url: String! +} + +""" +Contains secure URL used for Payments Pro Hosted Solution payment method. +""" +type HostedProUrl { + """Secure Url generated by PayPal""" + secure_form_url: String +} + +""" +The required input to request the secure URL for Payments Pro Hosted Solution payment. +""" +input HostedProUrlInput { + """The unique ID that identifies the customer's cart""" + cart_id: String! +} + +"""The object details of target path parameters""" +type HttpQueryParameter { + """Parameter name""" + name: String + + """Parameter value""" + value: String +} + +type ImageSwatchData implements SwatchDataInterface { + """Thumbnail swatch image URL""" + thumbnail: String + + """Value of swatch item (HEX color code, image link or textual value)""" + value: String +} + +"""Invoice details""" +type Invoice { + """Comments on the invoice""" + comments: [SalesCommentItem] + + """The unique ID for a `Invoice` object""" + id: ID! + + """Invoiced product details""" + items: [InvoiceItemInterface] + + """Sequential invoice number""" + number: String! + + """Invoice total amount details""" + total: InvoiceTotal +} + +type InvoiceItem implements InvoiceItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `InvoiceItemInterface` object""" + id: ID! + + """Contains details about an individual order item""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The number of invoiced items""" + quantity_invoiced: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +"""Invoice item details""" +interface InvoiceItemInterface { + """ + Contains information about the final discount amount for the base product, including discounts on options + """ + discounts: [Discount] + + """The unique ID for a `InvoiceItemInterface` object""" + id: ID! + + """Contains details about an individual order item""" + order_item: OrderItemInterface + + """The name of the base product""" + product_name: String + + """The sale price for the base product including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The number of invoiced items""" + quantity_invoiced: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! +} + +"""Contains price details from an invoice""" +type InvoiceTotal { + """The final base grand total amount in the base currency""" + base_grand_total: Money! + + """The applied discounts to the invoice""" + discounts: [Discount] + + """The final total amount, including shipping, discounts, and taxes""" + grand_total: Money! + + """Contains details about the shipping and handling costs for the invoice""" + shipping_handling: ShippingHandling + + """The subtotal of the invoice, excluding shipping, discounts, and taxes""" + subtotal: Money! + + """The invoice tax details""" + taxes: [TaxItem] + + """The shipping amount for the invoice""" + total_shipping: Money! + + """The amount of tax applied to the invoice""" + total_tax: Money! +} + +type IsConfigSettingEnabledOutput { + """Is config setting enabled""" + is_enabled: Boolean +} + +type IsEmailAvailableOutput { + """Is email availabel value""" + is_email_available: Boolean +} + +type Item { + """Category id""" + category_id: Int + cms_page_identifier: String + + """Category icon""" + icon: String + is_active: Boolean + + """Boolean if category is promotional category""" + is_promo: Int + + """CSS class of the item""" + item_class: String + item_id: ID + parent_id: Int + position: Int + + """Promo category image background""" + promo_image: String + title: String + url: String + + """0 - regular link, 1 - cms page, 2 - category""" + url_type: Int +} + +"""A list of options of the selected bundle product""" +type ItemSelectedBundleOption { + """The unique ID for a `ItemSelectedBundleOption` object""" + id: ID! @deprecated(reason: "Use `uid` instead") + + """The label of the option""" + label: String! + + """The unique ID for a `ItemSelectedBundleOption` object""" + uid: ID! + + """A list of products that represent the values of the parent option""" + values: [ItemSelectedBundleOptionValue] +} + +"""A list of values for the selected bundle product""" +type ItemSelectedBundleOptionValue { + """The unique ID for a `ItemSelectedBundleOptionValue` object""" + id: ID! @deprecated(reason: "Use `uid` instead") + + """The price of the child bundle product""" + price: Money! + + """The name of the child bundle product""" + product_name: String! + + """The SKU of the child bundle product""" + product_sku: String! + + """Indicates how many of this bundle product were ordered""" + quantity: Float! + + """The unique ID for a `ItemSelectedBundleOptionValue` object""" + uid: ID! +} + +"""The key-value type""" +type KeyValue { + """The name part of the name/value pair""" + name: String + + """The value part of the name/value pair""" + value: String +} + +input KlarnaInput { + """ + The authorization token must be provided to set any Klarna Payments method + """ + authorization_token: ID! +} + +""" +Defines the attributes required to receive a payment token for Klarna payment method +""" +input KlarnaTokenInput { + """The unique ID that identifies the guest customer's cart""" + guest_cart_id: String +} + +type LayerFilter { + """Array of filter items.""" + filter_items: [LayerFilterItemInterface] @deprecated(reason: "Use Aggregation.options instead.") + + """Count of filter items in filter group.""" + filter_items_count: Int @deprecated(reason: "Use Aggregation.count instead.") + + """Layered navigation filter name.""" + name: String @deprecated(reason: "Use Aggregation.label instead.") + + """Request variable name for filter query.""" + request_var: String @deprecated(reason: "Use Aggregation.attribute_code instead.") +} + +type LayerFilterItem implements LayerFilterItemInterface { + """Count of items by filter.""" + items_count: Int @deprecated(reason: "Use AggregationOption.count instead.") + + """Filter label.""" + label: String @deprecated(reason: "Use AggregationOption.label instead.") + + """Value for filter request variable to be used in query.""" + value_string: String @deprecated(reason: "Use AggregationOption.value instead.") +} + +interface LayerFilterItemInterface { + """Count of items by filter.""" + items_count: Int @deprecated(reason: "Use AggregationOption.count instead.") + + """Filter label.""" + label: String @deprecated(reason: "Use AggregationOption.label instead.") + + """Value for filter request variable to be used in query.""" + value_string: String @deprecated(reason: "Use AggregationOption.value instead.") +} + +type Map { + coordinates: String + is_active: Boolean + map_id: ID + product_id: Int + title: String +} + +""" +MediaGalleryEntry defines characteristics about images and videos associated with a specific product +""" +type MediaGalleryEntry { + """The path of the base image on the server""" + base: MediaGalleryImageOfType + + """Contains a ProductMediaGalleryEntriesContent object.""" + content: ProductMediaGalleryEntriesContent + + """Whether the image is hidden from view.""" + disabled: Boolean + + """The path of the image on the server.""" + file: String + + """The identifier assigned to the object.""" + id: Int @deprecated(reason: "Use `uid` instead.") + + """The alt text displayed on the UI when the user points to the image.""" + label: String + + """The path of the large image on the server""" + large: MediaGalleryImageOfType + + """image or video.""" + media_type: String + + """The media item's position after it has been sorted.""" + position: Int + + """The path of the thumbnail image on the server""" + thumbnail: MediaGalleryImageOfType + + """ + Array of image types. It can have the following values: image, small_image, thumbnail. + """ + types: [String] + + """The unique ID for a `MediaGalleryEntry` object.""" + uid: ID! + + """Contains a ProductMediaGalleryEntriesVideoContent object.""" + video_content: ProductMediaGalleryEntriesVideoContent +} + +"""Products thumbnail image""" +type MediaGalleryImageOfType { + """Product image type""" + type: String + + """Product image url""" + url: String +} + +"""Contains basic information about a product image or video.""" +interface MediaGalleryInterface { + """Whether the image is hidden from view.""" + disabled: Boolean + + """The label of the product image or video.""" + label: String + + """The media item's position after it has been sorted.""" + position: Int + + """The URL of the product image or video.""" + url: String +} + +type Menu { + css_class: String + is_active: Boolean + items: [Item] + menu_id: ID + title: String +} + +""" +A Money object defines a monetary value, including a numeric value and a currency code. +""" +type Money { + """A three-letter currency code, such as USD or EUR""" + currency: CurrencyEnum + + """A number expressing a monetary value""" + value: Float +} + +type Mutation { + addBundleProductsToCart(input: AddBundleProductsToCartInput): AddBundleProductsToCartOutput + addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput + addDownloadableProductsToCart(input: AddDownloadableProductsToCartInput): AddDownloadableProductsToCartOutput + + """Add any type of product to the cart""" + addProductsToCart(cartId: String!, cartItems: [CartItemInput!]!): AddProductsToCartOutput + + """Add products to the specified compare list""" + addProductsToCompareList(input: AddProductsToCompareListInput): CompareList + + """ + Adds one or more products to the specified wish list. This mutation supports all product types + """ + addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput + addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput + addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput + + """Add items in the specified wishlist to the customer's cart""" + addWishlistItemsToCart( + """The unique ID of the wish list""" + wishlistId: ID! + + """ + An array of IDs representing products to be added to the cart. If no IDs are + specified, all items in the wishlist will be added to the cart + """ + wishlistItemIds: [ID!] + ): AddWishlistItemsToCartOutput + applyCoupon(guestCartId: String, coupon_code: String!): Query + applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput + + """Assign the specified compare list to the logged in customer""" + assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput + + """Changes the password for the logged-in customer""" + changeCustomerPassword(currentPassword: String!, newPassword: String!): Customer + + """Confirm customer account""" + confirmCustomerEmail(key: String!, email: String!, password: String!): CreateCustomerType + + """Send contact form""" + contactForm(contact: ContactForm!): ContactFormResponse + + """Creates Client Token for Braintree Javascript SDK initialization.""" + createBraintreeClientToken: String! + + """ + Creates a new compare list. The compare list is saved for logged in customers + """ + createCompareList(input: CreateCompareListInput): CompareList + + """Create customer account""" + createCustomer(input: CustomerInput!): CustomerOutput + + """Create customer address""" + createCustomerAddress(input: CustomerAddressInput!): CustomerAddress + + """Create customer account""" + createCustomerV2(input: CustomerCreateInput!): CustomerOutput + + """Creates an empty shopping cart for a guest or logged in user""" + createEmptyCart(input: createEmptyCartInput): String + + """Creates a Klarna Payments Session.""" + createKlarnaPaymentsSession(input: createKlarnaPaymentsSessionInput): createKlarnaPaymentsSessionOutput + + """Returns Klarna session token""" + createKlarnaToken(input: KlarnaTokenInput!): String + + """ + Initiates a transaction and receives a token. Use this mutation for Payflow Pro and Payments Pro payment methods + """ + createPayflowProToken(input: PayflowProTokenInput!): CreatePayflowProTokenOutput + + """ + Initiates an Express Checkout transaction and receives a token. Use this + mutation for Express Checkout and Payments Standard payment methods. + """ + createPaypalExpressToken(input: PaypalExpressTokenInput!): PaypalExpressTokenOutput + + """Creates a product review for the specified SKU""" + createProductReview(input: CreateProductReviewInput!): CreateProductReviewOutput! + + """Delete the specified compare list""" + deleteCompareList(uid: ID!): DeleteCompareListOutput + + """Delete customer address""" + deleteCustomerAddress(id: Int!): Boolean + + """Delete a customer payment token""" + deletePaymentToken(public_hash: String!): DeletePaymentTokenOutput + estimateShippingCosts(address: EstimateShippingCostsAddress!, guestCartId: String): [ShippingMethod] + + """Resend customer confirmation""" + forgotPassword(email: String!): CustomerActionConfirmationType + + """Retrieve the customer token""" + generateCustomerToken(email: String!, password: String!): CustomerToken + + """ + Request a customer token so that an administrator can perform remote shopping assistance + """ + generateCustomerTokenAsAdmin(input: GenerateCustomerTokenAsAdminInput!): GenerateCustomerTokenAsAdminOutput + + """ + Handles payment response and saves payment in Quote. Use this mutations for Payflow Pro and Payments Pro payment methods. + """ + handlePayflowProResponse(input: PayflowProResponseInput!): PayflowProResponseOutput + linkOrder(customer_email: String!): Boolean + + """Merges the source cart into the destination cart""" + mergeCarts(source_cart_id: String!, destination_cart_id: String): Cart! + placeOrder(input: PlaceOrderInput): PlaceOrderOutput + + """Customer subsribe for product alert""" + productAlertSubscribe(productId: ID!, type: String!): Boolean + removeCartItem(guestCartId: String, item_id: Int!): Query + removeCoupon(guestCartId: String): Query + removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput + removeItemFromCart(input: RemoveItemFromCartInput): RemoveItemFromCartOutput + + """Remove products from the specified compare list""" + removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList + + """Removes one or more products from the specified wish list""" + removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput + + """Adds all products from a customer's previous order to the cart.""" + reorderItems(orderNumber: String!): ReorderItemsOutput + + """ + Request an email with a reset password token for the registered customer identified by the specified email. + """ + requestPasswordResetEmail(email: String!): Boolean + + """Resend customer confirmation""" + resendConfirmationEmail(email: String!): CustomerActionConfirmationType + + """ + Reset a customer's password using the reset password token that the customer + received in an email after requesting it using requestPasswordResetEmail. + """ + resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean + + """Revoke the customer token""" + revokeCustomerToken: RevokeCustomerTokenOutput + + """Clears wishlist""" + s_clearWishlist: Boolean + + """ + Initiates an Express Checkout transaction and receives a token using + session-based cart_id. Use this mutation for Express Checkout and Payments + Standard payment methods. + """ + s_createPaypalExpressToken(input: S_PaypalExpressTokenInput!): PaypalExpressToken + + """Moves items from wishlist to cart""" + s_moveWishlistToCart(guestCartId: ID, sharingCode: ID): Boolean + s_placeOrder(guestCartId: String): PlaceOrderOutput + + """Removes product from wishlist""" + s_removeProductFromWishlist(itemId: ID!): Boolean + + """Resend customer confirmation""" + s_resetPassword(password: String!, token: String!, password_confirmation: String!): ResetPasswordType + + """Saves wishlist item""" + s_saveWishlistItem(wishlistItem: WishlistItemInput!): WishlistItem + s_setBillingAddressOnCart(input: S_SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput + s_setPaymentMethodOnCart(input: S_SetPaymentMethodOnCartInput!): SetPaymentMethodOnCartOutput + + """Shares wishlist""" + s_shareWishlist(input: ShareWishlistInput!): Boolean + saveAddressInformation(addressInformation: SaveAddressInformation!, guestCartId: String): PaymentDetails + saveCartItem(cartItem: CartItemInput!, guestCartId: String): Query + saveSelectedCurrency(currency: String): Query + + """Recommends Product by Sending Single/Multiple Email""" + sendEmailToFriend(input: SendEmailToFriendInput): SendEmailToFriendOutput + setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput + setGuestEmailOnCart(input: SetGuestEmailOnCartInput): SetGuestEmailOnCartOutput + setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") + setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput + setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput + setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput + + """Subscribes the specified email to a newsletter""" + subscribeEmailToNewsletter(email: String!): SubscribeEmailToNewsletterOutput + updateCartItems(input: UpdateCartItemsInput): UpdateCartItemsOutput + + """Sends chat profile data to Engagement Cloud.""" + updateChatProfile(profileId: String!, email: String, firstname: String, lastname: String): Boolean + + """Deprecated. Use UpdateCustomerV2 instead.""" + updateCustomer(input: CustomerInput!): CustomerOutput + + """Update customer address""" + updateCustomerAddress(id: Int!, input: CustomerAddressInput): CustomerAddress + updateCustomerEmail(email: String!, password: String!): CustomerOutput + + """Update the customer's personal information""" + updateCustomerV2(input: CustomerUpdateInput!): CustomerOutput + + """Updates one or more products in the specified wish list""" + updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput + + """Updates the email address of a quote.""" + updateQuoteEmail(email: String!, cartId: String!): Boolean +} + +type OptimizedProductImage { + label: String + path: String + url: String +} + +"""Contains details about the requested order""" +type Order { + base_order_info: BaseOrderInfo + + """An array containing the items purchased in this order""" + items: [String] + order_id: String @deprecated(reason: "The order_id field is deprecated, use order_number instead.") + + """The unique ID for a `Order` object.""" + order_number: String! + order_products: [ProductInterface] + payment_info: PaymentInfo + shipping_info: ShippingInfo + + """Contains the calculated total for this order""" + total: String +} + +""" +OrderAddress contains detailed information about an order's billing and shipping addresses +""" +type OrderAddress { + """The city or town""" + city: String! + + """The customer's company""" + company: String + + """The customer's country""" + country_code: CountryCodeEnum + + """The customer's country""" + country_id: CountryCodeEnum + + """The fax number""" + fax: String + + """ + The first name of the person associated with the shipping/billing address + """ + firstname: String! + + """ + The family name of the person associated with the shipping/billing address + """ + lastname: String! + + """ + The middle name of the person associated with the shipping/billing address + """ + middlename: String + + """The customer's order ZIP or postal code""" + postcode: String + + """An honorific, such as Dr., Mr., or Mrs.""" + prefix: String + + """The state or province name""" + region: String + + """The unique ID for a `Region` object of a pre-defined region""" + region_id: ID + + """An array of strings that define the street number and name""" + street: [String]! + + """A value such as Sr., Jr., or III""" + suffix: String + + """The telephone number""" + telephone: String! + + """The customer's Value-added tax (VAT) number (for corporate customers)""" + vat_id: String +} + +type OrderCustomerAddress { + apartment_number: String + city: String + company: String + country_id: String + customer_id: Int + district: String + firstname: String + house_number: String + id: Int + is_b2b: String + lastname: String + middlename: String + organizationaddress: String + organizationbik: String + organizationbin: String + organizationiic: String + organizationname: String + post_office_code: String + postcode: String + postomat_code: String + prefix: String + region: String + store_pickup_code: String + street: String + telephone: String +} + +type OrderItem implements OrderItemInterface { + """The final discount information for the product""" + discounts: [Discount] + + """The entered option for the base product, such as a logo or image""" + entered_options: [OrderItemOption] + + """The unique ID for a `OrderItemInterface` object""" + id: ID! + + """The name of the base product""" + product_name: String + + """The sale price of the base product, including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The type of product, such as simple, configurable, etc.""" + product_type: String + + """URL key of the base product""" + product_url_key: String + + """The number of canceled items""" + quantity_canceled: Float + + """The number of invoiced items""" + quantity_invoiced: Float + + """The number of units ordered for this item""" + quantity_ordered: Float + + """The number of refunded items""" + quantity_refunded: Float + + """The number of returned items""" + quantity_returned: Float + + """The number of shipped items""" + quantity_shipped: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! + + """The selected options for the base product, such as color or size""" + selected_options: [OrderItemOption] + + """The status of the order item""" + status: String +} + +"""Order item details""" +interface OrderItemInterface { + """The final discount information for the product""" + discounts: [Discount] + + """The entered option for the base product, such as a logo or image""" + entered_options: [OrderItemOption] + + """The unique ID for a `OrderItemInterface` object""" + id: ID! + + """The name of the base product""" + product_name: String + + """The sale price of the base product, including selected options""" + product_sale_price: Money! + + """The SKU of the base product""" + product_sku: String! + + """The type of product, such as simple, configurable, etc.""" + product_type: String + + """URL key of the base product""" + product_url_key: String + + """The number of canceled items""" + quantity_canceled: Float + + """The number of invoiced items""" + quantity_invoiced: Float + + """The number of units ordered for this item""" + quantity_ordered: Float + + """The number of refunded items""" + quantity_refunded: Float + + """The number of returned items""" + quantity_returned: Float + + """The number of shipped items""" + quantity_shipped: Float + + """The row subtotal price, including selected options""" + row_subtotal: Money! + + """The selected options for the base product, such as color or size""" + selected_options: [OrderItemOption] + + """The status of the order item""" + status: String +} + +"""Represents order item options like selected or entered""" +type OrderItemOption { + items: [BundleOption] + + """The name of the option""" + label: String! + linkItems: [String] + + """The value of the option""" + value: String +} + +type OrderList { + items: [Order] +} + +"""Contains details about the payment method used to pay for the order""" +type OrderPaymentMethod { + """Additional data per payment method type""" + additional_data: [KeyValue] + + """The label that describes the payment method""" + name: String! + + """Defines order purchase number""" + purchase_number: String + + """The payment method code that indicates how the order was paid for""" + type: String! +} + +"""Order shipment details""" +type OrderShipment { + """Comments added to the shipment""" + comments: [SalesCommentItem] + + """The unique ID for a `OrderShipment` object""" + id: ID! + + """Contains items included in the shipment""" + items: [ShipmentItemInterface] + + """The sequential credit shipment number""" + number: String! + + """Contains shipment tracking details""" + tracking: [ShipmentTracking] +} + +""" +Contains details about the sales total amounts used to calculate the final price +""" +type OrderTotal { + """The final base grand total amount in the base currency""" + base_grand_total: Money! + + """The applied discounts to the order""" + discounts: [Discount] + + """The final total amount, including shipping, discounts, and taxes""" + grand_total: Money! + + """Contains details about the shipping and handling costs for the order""" + shipping_handling: ShippingHandling + + """The subtotal of the order, excluding shipping, discounts, and taxes""" + subtotal: Money! + + """The order tax details""" + taxes: [TaxItem] + + """The shipping amount for the order""" + total_shipping: Money! + + """The amount of tax applied to the order""" + total_tax: Money! +} + +"""Required input for Payflow Express Checkout payments""" +input PayflowExpressInput { + """The unique ID of the PayPal user""" + payer_id: String! + + """The token returned by the createPaypalExpressToken mutation""" + token: String! +} + +""" +A set of relative URLs that PayPal will use in response to various actions +during the authorization process. Magento prepends the base URL to this value to +create a full URL. For example, if the full URL is +https://www.example.com/path/to/page.html, the relative URL is +path/to/page.html. Use this input for Payflow Link and Payments Advanced payment methods. +""" +input PayflowLinkInput { + """ + The relative URL of the page that PayPal will redirect to when the buyer + cancels the transaction in order to choose a different payment method. If the + full URL to this page is https://www.example.com/paypal/action/cancel.html, + the relative URL is paypal/action/cancel.html. + """ + cancel_url: String! + + """ + The relative URL of the transaction error page that PayPal will redirect to + upon payment error. If the full URL to this page is + https://www.example.com/paypal/action/error.html, the relative URL is + paypal/action/error.html. + """ + error_url: String! + + """ + The relative URL of the order confirmation page that PayPal will redirect to + when the payment is successful and additional confirmation is not needed. If + the full URL to this page is + https://www.example.com/paypal/action/return.html, the relative URL is + paypal/action/return.html. + """ + return_url: String! +} + +""" +Mode for payment: TEST or LIVE. Applies to Payflow Link and Payments Advanced payment methods. +""" +enum PayflowLinkMode { + TEST + LIVE +} + +""" +Contains information used to generate PayPal iframe for transaction. Applies to +Payflow Link and Payments Advanced payment methods. +""" +type PayflowLinkToken { + """Mode for Payflow transaction""" + mode: PayflowLinkMode + + """PayPal URL used for requesting Payflow form""" + paypal_url: String + + """Secure token generated by PayPal""" + secure_token: String + + """Secure token ID generated by PayPal""" + secure_token_id: String +} + +""" +Input required to fetch payment token information for Payflow Link and Payments Advanced payment methods. +""" +input PayflowLinkTokenInput { + """The unique ID that identifies the customer's cart""" + cart_id: String! +} + +"""Required input for Payflow Pro and Payments Pro payment methods.""" +input PayflowProInput { + """Required input for credit card related information""" + cc_details: CreditCardDetailsInput! + + """ + States whether details about the customer's credit/debit card should be + tokenized for later usage. Required only if Vault is enabled for PayPal + Payflow Pro payment integration. + """ + is_active_payment_token_enabler: Boolean +} + +""" +Input required to complete payment. Applies to Payflow Pro and Payments Pro payment methods. +""" +input PayflowProResponseInput { + cart_id: String! + paypal_payload: String! +} + +type PayflowProResponseOutput { + cart: Cart! +} + +""" +Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods. +""" +type PayflowProToken { + response_message: String! + result: Int! + result_code: Int! + secure_token: String! + secure_token_id: String! +} + +""" +Input required to fetch payment token information for Payflow Pro and Payments Pro payment methods. +""" +input PayflowProTokenInput { + """The unique ID that identifies the customer's cart""" + cart_id: String! + + """A set of relative URLs that PayPal uses for callback.""" + urls: PayflowProUrlInput! +} + +""" +A set of relative URLs that PayPal will use in response to various actions +during the authorization process. Magento prepends the base URL to this value to +create a full URL. For example, if the full URL is +https://www.example.com/path/to/page.html, the relative URL is +path/to/page.html. Use this input for Payflow Pro and Payment Pro payment methods. +""" +input PayflowProUrlInput { + """ + The relative URL of the page that PayPal will redirect to when the buyer + cancels the transaction in order to choose a different payment method. If the + full URL to this page is https://www.example.com/paypal/action/cancel.html, + the relative URL is paypal/action/cancel.html. + """ + cancel_url: String! + + """ + The relative URL of the transaction error page that PayPal will redirect to + upon payment error. If the full URL to this page is + https://www.example.com/paypal/action/error.html, the relative URL is + paypal/action/error.html. + """ + error_url: String! + + """ + The relative URL of the final confirmation page that PayPal will redirect to + upon payment success. If the full URL to this page is + https://www.example.com/paypal/action/return.html, the relative URL is + paypal/action/return.html. + """ + return_url: String! +} + +type PaymentDetails { + payment_methods: [PaymentMethod] + totals: PaymentTotals +} + +type PaymentInfo { + additional_information: AdditionalCustomerInfo + cc_last_4: String + cc_owner: String + cc_type: String + method: String +} + +input PaymentInformation { + billing_address: AddressInput! + paymentMethod: PaymentMethodInput! +} + +type PaymentMethod { + code: String + title: String +} + +input PaymentMethodAdditionalData { + cc_save: Boolean + cc_stripejs_token: String + payment_method_nonce: String +} + +input PaymentMethodInput { + additional_data: PaymentMethodAdditionalData + braintree: BraintreeInput + braintree_cc_vault: BraintreeCcVaultInput + + """Payment method code""" + code: String! + + """Required input for PayPal Hosted pro payments""" + hosted_pro: HostedProInput + klarna: KlarnaInput + klarna_kp: KlarnaInput + method: String + + """Required input for Payflow Express Checkout payments""" + payflow_express: PayflowExpressInput + + """Required input for PayPal Payflow Link and Payments Advanced payments""" + payflow_link: PayflowLinkInput + + """Required input type for PayPal Payflow Pro and Payment Pro payments""" + payflowpro: PayflowProInput + + """Required input type for PayPal Payflow Pro vault payments""" + payflowpro_cc_vault: VaultTokenInput + + """Required input for Express Checkout and Payments Standard payments""" + paypal_express: PaypalExpressInput + + """Purchase order number""" + purchase_order_number: String +} + +"""The stored payment method available to the customer""" +type PaymentToken { + """Stored account details""" + details: String + + """The payment method code associated with the token""" + payment_method_code: String! + + """The public hash of the token""" + public_hash: String! + type: PaymentTokenTypeEnum! +} + +"""The list of available payment token types""" +enum PaymentTokenTypeEnum { + card + account +} + +type PaymentTotals implements TotalsObject { + applied_rule_ids: String + base_currency_code: String + base_discount_amount: Float + base_grand_total: Float + base_shipping_amount: Float + base_shipping_discount_amount: Float + base_shipping_incl_tax: Float + base_shipping_tax_amount: Float + base_subtotal: Float + base_subtotal_with_discount: Float + base_tax_amount: Float + coupon_code: String + customer_is_guest: Boolean + customer_tax_class_id: Int + discount_amount: Float + grand_total: Float + is_in_store_pickup_available: Boolean + items: [TotalsItem] + items_count: Int + items_qty: Float + quote_currency_code: String + shipping_amount: Float + shipping_discount_amount: Float + shipping_incl_tax: Float + shipping_method: String + shipping_tax_amount: Float + store_id: Int + subtotal: Float + subtotal_incl_tax: Float + subtotal_with_discount: Float + tax_amount: Float + weee_tax_applied_amount: Float +} + +"""Required input for Express Checkout and Payments Standard payments""" +input PaypalExpressInput { + """The unique ID of the PayPal user""" + payer_id: String! + + """The token returned by the createPaypalExpressToken mutation""" + token: String! +} + +"""Deprecated: use type `PaypalExpressTokenOutput` instead""" +type PaypalExpressToken { + """ + A set of URLs that allow the buyer to authorize payment and adjust checkout details + """ + paypal_urls: PaypalExpressUrlList @deprecated(reason: "Use field `paypal_urls` of type `PaypalExpressTokenOutput` instead") + + """The token returned by PayPal""" + token: String @deprecated(reason: "Use field `token` of type `PaypalExpressTokenOutput` instead") +} + +""" +Defines the attributes required to receive a payment token for Express Checkout and Payments Standard payment methods. +""" +input PaypalExpressTokenInput { + """The unique ID that identifies the customer's cart""" + cart_id: String! + + """Payment method code""" + code: String! + + """ + Indicates whether the buyer selected the quick checkout button. The default value is false + """ + express_button: Boolean + + """ + A set of relative URLs that PayPal uses in response to various actions during the authorization process + """ + urls: PaypalExpressUrlsInput! + + """ + Indicates whether the buyer clicked the PayPal credit button. The default value is false + """ + use_paypal_credit: Boolean +} + +""" +Contains the token returned by PayPal and a set of URLs that allow the buyer to +authorize payment and adjust checkout details. Applies to Express Checkout and +Payments Standard payment methods. +""" +type PaypalExpressTokenOutput { + """ + A set of URLs that allow the buyer to authorize payment and adjust checkout details + """ + paypal_urls: PaypalExpressUrlList + + """The token returned by PayPal""" + token: String +} + +""" +A set of URLs that allow the buyer to authorize payment and adjust checkout +details for Express Checkout and Payments Standard transactions. +""" +type PaypalExpressUrlList { + """The PayPal URL that allows the buyer to edit their checkout details""" + edit: String + + """The URL to the PayPal login page""" + start: String +} + +""" +A set of relative URLs that PayPal will use in response to various actions +during the authorization process. Magento prepends the base URL to this value to +create a full URL. For example, if the full URL is +https://www.example.com/path/to/page.html, the relative URL is +path/to/page.html. Use this input for Express Checkout and Payments Standard +payment methods. +""" +input PaypalExpressUrlsInput { + """ + The relative URL of the page that PayPal will redirect to when the buyer + cancels the transaction in order to choose a different payment method. If the + full URL to this page is https://www.example.com/paypal/action/cancel.html, + the relative URL is paypal/action/cancel.html. + """ + cancel_url: String! + + """ + The relative URL of the page that PayPal will redirect to when the payment has + been put on hold for additional review. This condition mostly applies to ACH + transactions, and is not applicable to most PayPal solutions. If the full URL + to this page is https://www.example.com/paypal/action/success_pending.html, + the relative URL is paypal/action/success_pending.html. + """ + pending_url: String + + """ + The relative URL of the final confirmation page that PayPal will redirect to + upon payment success. If the full URL to this page is + https://www.example.com/paypal/action/return.html, the relative URL is + paypal/action/return.html. + """ + return_url: String! + + """ + The relative URL of the order confirmation page that PayPal will redirect to + when the payment is successful and additional confirmation is not needed. Not + applicable to most PayPal solutions. If the full URL to this page is + https://www.example.com/paypal/action/success.html, the relative URL is + paypal/action/success.html. + """ + success_url: String +} + +""" +PhysicalProductInterface contains attributes specific to tangible products. +""" +interface PhysicalProductInterface { + """The weight of the item, in units defined by the store.""" + weight: Float +} + +"""Defines Pickup Location information.""" +type PickupLocation { + city: String + contact_name: String + country_id: String + description: String + email: String + fax: String + latitude: Float + longitude: Float + name: String + phone: String + pickup_location_code: String + postcode: String + region: String + region_id: Int + street: String +} + +""" +PickupLocationFilterInput defines the list of attributes and filters for the search. +""" +input PickupLocationFilterInput { + """Filter by city.""" + city: FilterTypeInput + + """Filter by country.""" + country_id: FilterTypeInput + + """Filter by pickup location name.""" + name: FilterTypeInput + + """Filter by pickup location code.""" + pickup_location_code: FilterTypeInput + + """Filter by postcode.""" + postcode: FilterTypeInput + + """Filter by region.""" + region: FilterTypeInput + + """Filter by region id.""" + region_id: FilterTypeInput + + """Filter by street.""" + street: FilterTypeInput +} + +"""Top level object returned in a pickup locations search.""" +type PickupLocations { + """An array of pickup locations that match the specific search request.""" + items: [PickupLocation] + + """ + An object that includes the page_info and currentPage values specified in the query. + """ + page_info: SearchResultPageInfo + + """The number of products returned.""" + total_count: Int +} + +""" +PickupLocationSortInput specifies attribute to use for sorting search results +and indicates whether the results are sorted in ascending or descending order. +""" +input PickupLocationSortInput { + """City where pickup location is placed.""" + city: SortEnum + + """Name of the contact person.""" + contact_name: SortEnum + + """Id of the country in two letters.""" + country_id: SortEnum + + """Description of the pickup location.""" + description: SortEnum + + """ + Distance to the address, requested by distance filter. Applicable only with + distance filter. If distance sort order is present, all other sort orders will be ignored. + """ + distance: SortEnum + + """Contact email of the pickup location.""" + email: SortEnum + + """Contact fax of the pickup location.""" + fax: SortEnum + + """Geographic latitude where pickup location is placed.""" + latitude: SortEnum + + """Geographic longitude where pickup location is placed.""" + longitude: SortEnum + + """ + The pickup location name. Customer use this to identify the pickup location. + """ + name: SortEnum + + """Contact phone number of the pickup location.""" + phone: SortEnum + + """A code assigned to pickup location to identify the source.""" + pickup_location_code: SortEnum + + """Postcode where pickup location is placed.""" + postcode: SortEnum + + """Name of the region.""" + region: SortEnum + + """Id of the region.""" + region_id: SortEnum + + """Street where pickup location is placed.""" + street: SortEnum +} + +input PlaceOrderInput { + cart_id: String! +} + +type PlaceOrderOutput { + order: Order! +} + +""" +Price is deprecated, replaced by ProductPrice. The Price object defines the +price of a product as well as any tax-related adjustments. +""" +type Price { + """ + An array that provides information about tax, weee, or weee_tax adjustments. + """ + adjustments: [PriceAdjustment] @deprecated(reason: "Price is deprecated, use ProductPrice.") + + """The price of a product plus a three-letter currency code.""" + amount: Money @deprecated(reason: "Price is deprecated, use ProductPrice.") +} + +""" +PriceAdjustment is deprecated. Taxes will be included or excluded in the price. +The PricedAdjustment object defines the amount of money to apply as an +adjustment, the type of adjustment to apply, and whether the item is included or +excluded from the adjustment. +""" +type PriceAdjustment { + """The amount of the price adjustment and its currency code.""" + amount: Money + + """Indicates whether the adjustment involves tax, weee, or weee_tax.""" + code: PriceAdjustmentCodesEnum @deprecated(reason: "PriceAdjustment is deprecated.") + + """ + Indicates whether the entity described by the code attribute is included or excluded from the adjustment. + """ + description: PriceAdjustmentDescriptionEnum @deprecated(reason: "PriceAdjustment is deprecated.") +} + +""" +PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module. +""" +enum PriceAdjustmentCodesEnum { + TAX @deprecated(reason: "PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog") + WEEE @deprecated(reason: "WEEE code is deprecated, use fixed_product_taxes.label") + WEEE_TAX @deprecated(reason: "Use fixed_product_taxes. PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog") +} + +""" +PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded. +""" +enum PriceAdjustmentDescriptionEnum { + INCLUDED + EXCLUDED +} + +""" +Price range for a product. If the product has a single price, the minimum and maximum price will be the same. +""" +type PriceRange { + """The highest possible price for the product.""" + maximum_price: ProductPrice + + """The lowest possible price for the product.""" + minimum_price: ProductPrice! +} + +type PriceTaxDisplay { + """Defines if product price will include/exclude tax or both in catalog""" + product_price_display_type: String + + """Defines if shipping price will include/exclude tax or both""" + shipping_price_display_type: String +} + +"""This enumeration the price type.""" +enum PriceTypeEnum { + FIXED + PERCENT + DYNAMIC +} + +""" +This enumeration defines whether a bundle product's price is displayed as the lowest possible value or as a range. +""" +enum PriceViewEnum { + PRICE_RANGE + AS_LOW_AS +} + +type ProductAttribute { + """The unique identifier for a product attribute code.""" + code: String! + + """The display value of the attribute""" + value: String! +} + +""" +ProductAttributeFilterInput defines the filters to be used in the search. A +filter contains at least one attribute, a comparison operator, and the value +that is being searched for. +""" +input ProductAttributeFilterInput { + """Attribute label: New Multiple attribute""" + New_multiple_attribute: FilterEqualTypeInput + + """Attribute label: Test_Ainars""" + Test_Ainars: FilterEqualTypeInput + + """Attribute label: Attribute allows html""" + attribute_allows_html: FilterMatchTypeInput + + """Deprecated: use `category_uid` to filter product by category id.""" + category_id: FilterEqualTypeInput + + """Filter product by the unique ID for a `CategoryInterface` object.""" + category_uid: FilterEqualTypeInput + + """Attribute label: clothing colour""" + clothing_colour: FilterEqualTypeInput + + """Attribute label: clothing gender""" + clothing_gender: FilterEqualTypeInput + + """Attribute label: clothing size""" + clothing_size: FilterEqualTypeInput + + """Attribute label: Color""" + color: FilterEqualTypeInput + + """Attribute label: 1Color Elena""" + color_elena: FilterEqualTypeInput + + """Attribute label: Colors with images!""" + colors_with_images: FilterEqualTypeInput + + """Searches products by JSON formatted conditions""" + conditions: FilterTypeInput + + """Modifies product prices based on customer group""" + customer_group_id: FilterTypeInput + + """Attribute label: Description""" + description: FilterMatchTypeInput + + """Attribute label: Fit""" + fit: FilterEqualTypeInput + + """Entity id filter for products""" + id: FilterTypeInput + + """Attribute label: Images Type Map""" + images_type_map: FilterEqualTypeInput + + """Attribute label: memory""" + memory: FilterEqualTypeInput + + """Attribute label: Multiple attribute""" + multiple_attribute: FilterEqualTypeInput + + """Attribute label: Product Name""" + name: FilterMatchTypeInput + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + news_from_date: FilterTypeInput + + """The end date for new product listings.""" + news_to_date: FilterTypeInput + + """Attribute label: Price""" + price: FilterRangeTypeInput + + """Attribute label: Ranking""" + ranking: FilterEqualTypeInput + + """Attribute label: Shoes size""" + shoes_size: FilterEqualTypeInput + + """Attribute label: Short Description""" + short_description: FilterMatchTypeInput + + """Attribute label: Size""" + size: FilterEqualTypeInput + + """Attribute label: SKU""" + sku: FilterEqualTypeInput + + """Attribute label: test""" + test: FilterEqualTypeInput + + """Attribute label: texture""" + texture: FilterEqualTypeInput + + """The part of the URL that identifies the product""" + url_key: FilterEqualTypeInput + + """Attribute label: Valuesss""" + valuesss: FilterEqualTypeInput + + """Attribute label: yes/no""" + yes_no: FilterEqualTypeInput +} + +""" +ProductAttributeSortInput specifies the attribute to use for sorting search +results and indicates whether the results are sorted in ascending or descending +order. It's possible to sort products using searchable attributes with enabled +'Use in Filter Options' option +""" +input ProductAttributeSortInput { + """Attribute label: New attribute size!""" + New_attribute_size: SortEnum + + """Attribute label: Attribute allows html""" + attribute_allows_html: SortEnum + + """Attribute label: Product Name""" + name: SortEnum + + """Sort by the position assigned to each product.""" + position: SortEnum + + """Attribute label: Price""" + price: SortEnum + + """Sort by the search relevance score (default).""" + relevance: SortEnum +} + +"""A discount applied to a product price.""" +type ProductDiscount { + """The actual value of the discount.""" + amount_off: Float + + """The discount expressed a percentage.""" + percent_off: Float +} + +""" +ProductFilterInput is deprecated, use @ProductAttributeFilterInput instead. +ProductFilterInput defines the filters to be used in the search. A filter +contains at least one attribute, a comparison operator, and the value that is +being searched for. +""" +input ProductFilterInput { + """Category ID the product belongs to.""" + category_id: FilterTypeInput + + """The product's country of origin.""" + country_of_manufacture: FilterTypeInput + + """Timestamp indicating when the product was created.""" + created_at: FilterTypeInput + + """The name of a custom layout.""" + custom_layout: FilterTypeInput + + """XML code that is applied as a layout update to the product page.""" + custom_layout_update: FilterTypeInput + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: FilterTypeInput + + """Indicates whether a gift message is available.""" + gift_message_available: FilterTypeInput + + """ + Indicates whether additional attributes have been created for the product. + """ + has_options: FilterTypeInput + + """The relative path to the main image on the product page.""" + image: FilterTypeInput + + """The label assigned to a product image.""" + image_label: FilterTypeInput + + """A number representing the product's manufacturer.""" + manufacturer: FilterTypeInput + + """ + The numeric maximal price of the product. Do not include the currency code. + """ + max_price: FilterTypeInput + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: FilterTypeInput + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: FilterTypeInput + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: FilterTypeInput + + """ + The numeric minimal price of the product. Do not include the currency code. + """ + min_price: FilterTypeInput + + """The product name. Customers use this name to identify the product.""" + name: FilterTypeInput + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + news_from_date: FilterTypeInput + + """The end date for new product listings.""" + news_to_date: FilterTypeInput + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: FilterTypeInput + + """The keyword required to perform a logical OR comparison.""" + or: ProductFilterInput + + """The price of an item.""" + price: FilterTypeInput + + """Indicates whether the product has required options.""" + required_options: FilterTypeInput + + """A short description of the product. Its use depends on the theme.""" + short_description: FilterTypeInput + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: FilterTypeInput + + """The relative path to the small image, which is used on catalog pages.""" + small_image: FilterTypeInput + + """The label assigned to a product's small image.""" + small_image_label: FilterTypeInput + + """The beginning date that a product has a special price.""" + special_from_date: FilterTypeInput + + """The discounted price of the product. Do not include the currency code.""" + special_price: FilterTypeInput + + """The end date that a product has a special price.""" + special_to_date: FilterTypeInput + + """The file name of a swatch image""" + swatch_image: FilterTypeInput + + """The relative path to the product's thumbnail image.""" + thumbnail: FilterTypeInput + + """The label assigned to a product's thumbnail image.""" + thumbnail_label: FilterTypeInput + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: FilterTypeInput + + """Timestamp indicating when the product was updated.""" + updated_at: FilterTypeInput + + """The part of the URL that identifies the product""" + url_key: FilterTypeInput + url_path: FilterTypeInput + + """The weight of the item, in units defined by the store.""" + weight: FilterTypeInput +} + +"""Extend product Image fields for frontend-driven loading mechanism""" +type ProductImage implements MediaGalleryInterface { + """Whether the image is hidden from view.""" + disabled: Boolean + + """The label of the product image or video.""" + label: String + + """Relative path to origin image""" + path: String + + """The media item's position after it has been sorted.""" + position: Int + + """The URL of the product image or video.""" + url: String +} + +"""Product Information used for Pickup Locations search.""" +input ProductInfoInput { + """Product SKU.""" + sku: String! +} + +""" +The ProductInterface contains attributes that are common to all types of +products. Note that descriptions may not be available for custom and EAV attributes. +""" +interface ProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """Related Products""" + related_products: [ProductInterface] + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + yes_no: Int +} + +"""ProductLinks is an implementation of ProductLinksInterface.""" +type ProductLinks implements ProductLinksInterface { + """One of related, associated, upsell, or crosssell.""" + link_type: String + + """The SKU of the linked product.""" + linked_product_sku: String + + """ + The type of linked product (simple, virtual, bundle, downloadable, grouped, configurable). + """ + linked_product_type: String + + """The position within the list of product links.""" + position: Int + + """The identifier of the linked product.""" + sku: String +} + +""" +ProductLinks contains information about linked products, including the link type and product type of each item. +""" +interface ProductLinksInterface { + """One of related, associated, upsell, or crosssell.""" + link_type: String + + """The SKU of the linked product.""" + linked_product_sku: String + + """ + The type of linked product (simple, virtual, bundle, downloadable, grouped, configurable). + """ + linked_product_type: String + + """The position within the list of product links.""" + position: Int + + """The identifier of the linked product.""" + sku: String +} + +""" +ProductMediaGalleryEntriesContent contains an image in base64 format and basic information about the image. +""" +type ProductMediaGalleryEntriesContent { + """The image in base64 format.""" + base64_encoded_data: String + + """The file name of the image.""" + name: String + + """The MIME type of the file, such as image/png.""" + type: String +} + +""" +ProductMediaGalleryEntriesVideoContent contains a link to a video file and basic information about the video. +""" +type ProductMediaGalleryEntriesVideoContent { + """Must be external-video.""" + media_type: String + + """A description of the video.""" + video_description: String + + """Optional data about the video.""" + video_metadata: String + + """Describes the video source.""" + video_provider: String + + """The title of the video.""" + video_title: String + + """The URL to the video.""" + video_url: String +} + +input ProductOptionInput { + buy_request: String + extension_attributes: ExtensionsAttributeInput +} + +"""Represents a product price.""" +type ProductPrice { + """The base price of the product after discounts applied.""" + default_final_price: Money! + + """The base price of the product after discounts applied excluding taxes.""" + default_final_price_excl_tax: Money! + + """The base price of the product.""" + default_price: Money! + + """ + The price discount. Represents the difference between the regular and final price. + """ + discount: ProductDiscount + + """The final price of the product after discounts applied.""" + final_price: Money! + + """ + The final price of the product after discounts applied excluding taxes. + """ + final_price_excl_tax: Money! + + """The multiple FPTs that can be applied to a product price.""" + fixed_product_taxes: [FixedProductTax] + + """The regular price of the product.""" + regular_price: Money! + + """The regular price of the product excluding taxes.""" + regular_price_excl_tax: Money! +} + +""" +ProductPrices is deprecated, replaced by PriceRange. The ProductPrices object +contains the regular price of an item, as well as its minimum and maximum +prices. Only composite products, which include bundle, configurable, and grouped +products, can contain a minimum and maximum price. +""" +type ProductPrices { + """ + The highest possible final price for all the options defined within a + composite product. If you are specifying a price range, this would be the to value. + """ + maximalPrice: Price @deprecated(reason: "Use PriceRange.maximum_price.") + + """ + The lowest possible final price for all the options defined within a composite + product. If you are specifying a price range, this would be the from value. + """ + minimalPrice: Price @deprecated(reason: "Use PriceRange.minimum_price.") + + """The base price of a product.""" + regularPrice: Price @deprecated(reason: "Use regular_price from PriceRange.minimum_price or PriceRange.maximum_price.") +} + +"""Details of a product review""" +type ProductReview { + """The average rating for product review.""" + average_rating: Float! + + """Date indicating when the review was created.""" + created_at: String! + + """The customer's nickname. Defaults to the customer name, if logged in""" + nickname: String! + + """Contains details about the reviewed product""" + product: ProductInterface! + + """ + An array of ratings by rating category, such as quality, price, and value + """ + ratings_breakdown: [ProductReviewRating]! + + """The summary (title) of the review""" + summary: String! + + """The review text.""" + text: String! +} + +type ProductReviewRating { + """ + The label assigned to an aspect of a product that is being rated, such as quality or price + """ + name: String! + + """ + The rating value given by customer. By default, possible values range from 1 to 5. + """ + value: String! +} + +input ProductReviewRatingInput { + """An encoded rating ID.""" + id: String! + + """An encoded rating value id.""" + value_id: String! +} + +type ProductReviewRatingMetadata { + """An encoded rating ID.""" + id: String! + + """ + The label assigned to an aspect of a product that is being rated, such as quality or price + """ + name: String! + + """List of product review ratings sorted by position.""" + values: [ProductReviewRatingValueMetadata]! +} + +type ProductReviewRatingsMetadata { + """List of product reviews sorted by position""" + items: [ProductReviewRatingMetadata]! +} + +type ProductReviewRatingValueMetadata { + """A ratings scale, such as the number of stars awarded""" + value: String! + + """An encoded rating value id.""" + value_id: String! +} + +type ProductReviews { + """An array of product reviews.""" + items: [ProductReview]! + + """Metadata for pagination rendering.""" + page_info: SearchResultPageInfo! +} + +""" +The Products object is the top-level object returned in a product search. +""" +type Products { + """Layered navigation aggregations.""" + aggregations: [Aggregation] + + """Layered navigation filters array.""" + filters: [LayerFilter] @deprecated(reason: "Use aggregations instead") + + """An array of products that match the specified search criteria.""" + items: [ProductInterface] + + """ + An object that includes the page_info and currentPage values specified in the query. + """ + page_info: SearchResultPageInfo + + """ + An object that includes the default sort field and all available sort fields. + """ + sort_fields: SortFields + + """ + The number of products that are marked as visible. By default, in complex + products, parent products are visible, but their child products are not. + """ + total_count: Int +} + +""" +ProductSortInput is deprecated, use @ProductAttributeSortInput instead. +ProductSortInput specifies the attribute to use for sorting search results and +indicates whether the results are sorted in ascending or descending order. +""" +input ProductSortInput { + """The product's country of origin.""" + country_of_manufacture: SortEnum + + """Timestamp indicating when the product was created.""" + created_at: SortEnum + + """The name of a custom layout.""" + custom_layout: SortEnum + + """XML code that is applied as a layout update to the product page.""" + custom_layout_update: SortEnum + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: SortEnum + + """Indicates whether a gift message is available.""" + gift_message_available: SortEnum + + """ + Indicates whether additional attributes have been created for the product. + """ + has_options: SortEnum + + """The relative path to the main image on the product page.""" + image: SortEnum + + """The label assigned to a product image.""" + image_label: SortEnum + + """A number representing the product's manufacturer.""" + manufacturer: SortEnum + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: SortEnum + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: SortEnum + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: SortEnum + + """The product name. Customers use this name to identify the product.""" + name: SortEnum + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + news_from_date: SortEnum + + """The end date for new product listings.""" + news_to_date: SortEnum + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: SortEnum + + """The price of the item.""" + price: SortEnum + + """Indicates whether the product has required options.""" + required_options: SortEnum + + """A short description of the product. Its use depends on the theme.""" + short_description: SortEnum + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: SortEnum + + """The relative path to the small image, which is used on catalog pages.""" + small_image: SortEnum + + """The label assigned to a product's small image.""" + small_image_label: SortEnum + + """The beginning date that a product has a special price.""" + special_from_date: SortEnum + + """The discounted price of the product.""" + special_price: SortEnum + + """The end date that a product has a special price.""" + special_to_date: SortEnum + + """The file name of a swatch image""" + swatch_image: SortEnum + + """The relative path to the product's thumbnail image.""" + thumbnail: SortEnum + + """The label assigned to a product's thumbnail image.""" + thumbnail_label: SortEnum + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: SortEnum + + """Timestamp indicating when the product was updated.""" + updated_at: SortEnum + + """The part of the URL that identifies the product""" + url_key: SortEnum + url_path: SortEnum + + """The weight of the item, in units defined by the store.""" + weight: SortEnum +} + +type ProductStockItem { + """Product in stock status""" + in_stock: Boolean + + """Maximal amount of item that can be bought""" + max_sale_qty: Int + + """Minimal amount of item that can be bought""" + min_sale_qty: Int + + """Product quantity available in stock""" + qty: Float + + """Increment for number of items that can be bought""" + qty_increments: Int +} + +""" +This enumeration states whether a product stock status is in stock or out of stock +""" +enum ProductStockStatus { + IN_STOCK + OUT_OF_STOCK +} + +""" +ProductTierPrices is deprecated and has been replaced by TierPrice. The +ProductTierPrices object defines a tier price, which is a quantity discount +offered to a specific customer group. +""" +type ProductTierPrices { + """The ID of the customer group.""" + customer_group_id: String @deprecated(reason: "customer_group_id is not relevant for storefront.") + + """The percentage discount of the item.""" + percentage_value: Float @deprecated(reason: "ProductTierPrices is deprecated. Use TierPrice.discount.") + + """ + The number of items that must be purchased to qualify for tier pricing. + """ + qty: Float @deprecated(reason: "ProductTierPrices is deprecated, use TierPrice.quantity.") + + """The price of the fixed price item.""" + value: Float @deprecated(reason: "ProductTierPrices is deprecated. Use TierPrice.final_price") + + """The ID assigned to the website.""" + website_id: Float @deprecated(reason: "website_id is not relevant for storefront.") +} + +"""Contains information about a product video.""" +type ProductVideo implements MediaGalleryInterface { + """Whether the image is hidden from view.""" + disabled: Boolean + + """The label of the product image or video.""" + label: String + + """The media item's position after it has been sorted.""" + position: Int + + """The URL of the product image or video.""" + url: String + + """Contains a ProductMediaGalleryEntriesVideoContent object.""" + video_content: ProductMediaGalleryEntriesVideoContent +} + +type Query { + """Get a list of available store views and their config information.""" + availableStores( + """Filter store views by current store group""" + useCurrentGroup: Boolean + ): [StoreConfig] + + """Returns information about shopping cart""" + cart(cart_id: String!): Cart + categories( + """Identifies which Category filter inputs to search for and return.""" + filters: CategoryFilterInput + + """ + Specifies the maximum number of results to return at once. This attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + ): CategoryResult + + """ + The category query searches for categories that match the criteria specified in the search and filter attributes. + """ + category( + """Id of the category.""" + id: Int + ): CategoryTree @deprecated(reason: "Use 'categoryList' query instead of 'category' query") + + """Returns an array of categories based on the specified filters.""" + categoryList( + """Identifies which Category filter inputs to search for and return.""" + filters: CategoryFilterInput + ): [CategoryTree] + + """Retrieves an array of configuration data for the chat widget.""" + chatData: ChatData + + """The Checkout Agreements information""" + checkoutAgreements: [CheckoutAgreement] + + """The CMS block query returns information about CMS blocks""" + cmsBlocks( + """Identifiers of the CMS blocks""" + identifiers: [String] + ): CmsBlocks + + """The CMS page query returns information about a CMS page""" + cmsPage( + """Id of the CMS page""" + id: Int + + """Identifier of the CMS page""" + identifier: String + + """Url key of the CMS page""" + url_key: String + ): CmsPage + + """Return products that have been added to the specified compare list""" + compareList(uid: ID!): CompareList + + """Contact Us page config""" + contactPageConfig: ContactPageConfig + + """The countries query provides information for all countries.""" + countries: [Country] + + """The countries query provides information for a single country.""" + country(id: String): Country + + """The currency query returns information about store currency.""" + currency: Currency + + """The currency data query""" + currencyData: CurrencyConfig + + """ + The customAttributeMetadata query returns the attribute type, given an attribute code and entity type + """ + customAttributeMetadata(attributes: [AttributeInput!]!): CustomAttributeMetadata + + """The customer query returns information about a customer account""" + customer: Customer + + """Returns information about the customer shopping cart""" + customerCart: Cart! + + """The query returns the contents of a customer's downloadable products""" + customerDownloadableProducts: CustomerDownloadableProducts + customerOrders: CustomerOrders @deprecated(reason: "Use orders from customer instead") + + """Return a list of customer payment tokens""" + customerPaymentTokens: CustomerPaymentTokens + + """Returns status of Easy Email Capture for Checkout.""" + emailCaptureCheckout: IsConfigSettingEnabledOutput + + """Returns status of Easy Email Capture for Newsletter.""" + emailCaptureNewsletter: IsConfigSettingEnabledOutput + getBraintreeConfig: Braintree + + """Get cart display settings""" + getCartDisplayConfig: CartDisplayConfig + getCartForCustomer(guestCartId: String): QuoteData + + """ + Retrieve secure PayPal url for Payments Pro Hosted Solution transaction. + """ + getHostedProUrl(input: HostedProUrlInput!): HostedProUrl + + """The Sales Order query returns information about a Sales order""" + getOrderById(id: Int!): Order + + """The Sales Order query returns information about a Sales order""" + getOrderList: OrderList + + """ + Retrieve payment credentials for transaction. Use this query for Payflow Link and Payments Advanced payment methods. + """ + getPayflowLinkToken(input: PayflowLinkTokenInput!): PayflowLinkToken + getPaymentMethods(guestCartId: String): [PaymentMethod] + getStores(search: String, country: String, productsInfo: [ProductInfoInput]): Stores + isEmailAvailable( + """The new customer email""" + email: String! + ): IsEmailAvailableOutput + orderByInvoice(invoiceId: Int!): CustomerOrder + orderByRefund(refundId: Int!): CustomerOrder + orderByShipment(shipmentId: Int!): CustomerOrder + + """Retrieves information about an order by order id.""" + orderData(orderId: String!): Order + + """ + The pickup locations query searches for locations that match the search request requirements. + """ + pickupLocations( + """Perform search by location using radius and search term.""" + area: AreaInput + + """Apply filters by attributes.""" + filters: PickupLocationFilterInput + + """ + Specifies which attribute to sort on, and whether to return the results in ascending or descending order. + """ + sort: PickupLocationSortInput + + """ + The maximum number of pickup locations to return at once. The attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + + """Information about products which should be delivered.""" + productsInfo: [ProductInfoInput] + ): PickupLocations + + """Retrieves metadata required by clients to render the Reviews section.""" + productReviewRatingsMetadata: ProductReviewRatingsMetadata! + + """ + The products query searches for products that match the criteria specified in the search and filter attributes. + """ + products( + """Performs a full-text search using the specified key words.""" + search: String + + """Identifies which product attributes to search for and return.""" + filter: ProductAttributeFilterInput + + """ + Specifies the maximum number of results to return at once. This attribute is optional. + """ + pageSize: Int = 20 + + """Specifies which page of results to return. The default value is 1.""" + currentPage: Int = 1 + + """ + Specifies which attributes to sort on, and whether to return the results in ascending or descending order. + """ + sort: ProductAttributeSortInput + ): Products + + """ + Return the full details for a specified product, category, or CMS page given + the specified url_key, appended by the url_suffix, if one exists + """ + route(url: String!): RoutableInterface + s_wishlist(sharing_code: ID): WishlistOutput + + """Returns Scandiweb Menu Manager menu data""" + scandiwebMenu(identifier: String!): Menu + + """The scandiwebSlider entity returns slider data""" + scandiwebSlider(id: ID!): Slider + + """The store config query""" + storeConfig: StoreConfig + + """The store list query""" + storeList: [StoreConfig] + + """ + Retrieves an array of configuration data for different types of tracking. + """ + trackingData: TrackingData + + """ + The urlResolver query returns the relative URL for a specified product, category or CMS page + """ + urlResolver(url: String!): EntityUrl @deprecated(reason: "Use the 'route' query instead") + + """The wishlist query returns the contents of a customer's wish list""" + wishlist: WishlistOutput @deprecated(reason: "Moved under `Customer` `wishlist`") +} + +type QuoteData implements TotalsObject { + applied_rule_ids: String + applied_taxes: [AppliedTaxItem] + base_currency_code: String + base_discount_amount: Float + base_grand_total: Float + base_shipping_amount: Float + base_shipping_discount_amount: Float + base_shipping_incl_tax: Float + base_shipping_tax_amount: Float + base_subtotal: Float + base_subtotal_with_discount: Float + base_tax_amount: Float + coupon_code: String + customer_is_guest: Boolean + customer_tax_class_id: Int + discount_amount: Float + grand_total: Float + id: String + is_in_store_pickup_available: Boolean + is_virtual: Boolean + items: [TotalsItem] + items_count: Int + items_qty: Float + quote_currency_code: String + shipping_amount: Float + shipping_discount_amount: Float + shipping_incl_tax: Float + shipping_method: String + shipping_tax_amount: Float + store_id: Int + subtotal: Float + subtotal_incl_tax: Float + subtotal_with_discount: Float + tax_amount: Float + weee_tax_applied_amount: Float +} + +type Region { + code: String + + """The unique ID for a `Region` object.""" + id: Int + name: String +} + +input RemoveCouponFromCartInput { + cart_id: String! +} + +type RemoveCouponFromCartOutput { + cart: Cart +} + +input RemoveItemFromCartInput { + cart_id: String! + + """Deprecated. Use `cart_item_uid` instead.""" + cart_item_id: Int + + """Required field. The unique ID for a `CartItemInterface` object""" + cart_item_uid: ID +} + +type RemoveItemFromCartOutput { + cart: Cart! +} + +input RemoveProductsFromCompareListInput { + """An array of product IDs to remove from the compare list""" + products: [ID]! + + """The unique identifier of the compare list to modify""" + uid: ID! +} + +"""Contains the customer's wish list and any errors encountered""" +type RemoveProductsFromWishlistOutput { + """ + An array of errors encountered while deleting products from a wish list + """ + user_errors: [WishListUserInputError]! + + """Contains the wish list with after items were successfully deleted""" + wishlist: Wishlist! +} + +type ReorderItemsOutput { + """Contains detailed information about the customer's cart.""" + cart: Cart! + + """An array of reordering errors.""" + userInputErrors: [CheckoutUserInputError]! +} + +type ResetPasswordType { + """Customer reset status""" + status: String + + """The customer token""" + token: String +} + +type RevokeCustomerTokenOutput { + result: Boolean! +} + +"""Routable entities serve as the model for a rendered page""" +interface RoutableInterface { + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum +} + +""" +Defines the attributes required to receive a payment token for Express Checkout and Payments Standard payment methods. +""" +input S_PaypalExpressTokenInput { + """Payment method code""" + code: String! + + """ + Indicates whether the buyer selected the quick checkout button. The default value is false + """ + express_button: Boolean + + """The unique ID that identifies the guest customer's cart""" + guest_cart_id: String + + """ + A set of relative URLs that PayPal uses in response to various actions during the authorization process + """ + urls: PaypalExpressUrlsInput! + + """ + Indicates whether the buyer clicked the PayPal credit button. The default value is false + """ + use_paypal_credit: Boolean +} + +input S_SetBillingAddressOnCartInput { + billing_address: BillingAddressInput! + guest_cart_id: String + same_as_shipping: Boolean +} + +input S_SetPaymentMethodOnCartInput { + guest_cart_id: String + payment_method: PaymentMethodInput! +} + +"""Comment item details""" +type SalesCommentItem { + """The text of the message""" + message: String! + + """The timestamp of the comment""" + timestamp: String! +} + +type SalesItemInterface { + """The entered gift message for the order item""" + gift_message: GiftMessage +} + +input SaveAddressInformation { + billing_address: AddressInput! + shipping_address: AddressInput! + shipping_carrier_code: String + shipping_method_code: String +} + +"""SearchResultPageInfo provides navigation for the query response""" +type SearchResultPageInfo { + """Specifies which page of results to return""" + current_page: Int + + """Specifies the maximum number of items to return""" + page_size: Int + + """Total pages""" + total_pages: Int +} + +type SelectedBundleOption { + id: Int! @deprecated(reason: "Use `uid` instead") + label: String! + type: String! + + """The unique ID for a `SelectedBundleOption` object""" + uid: ID! + values: [SelectedBundleOptionValue]! +} + +type SelectedBundleOptionValue { + """Use `uid` instead""" + id: Int! + label: String! + price: Float! + quantity: Float! + + """The unique ID for a `SelectedBundleOptionValue` object""" + uid: ID! +} + +type SelectedConfigurableOption { + """The unique ID for a `ConfigurableProductOptions` object""" + configurable_product_option_uid: ID! + + """The unique ID for a `ConfigurableProductOptionsValues` object""" + configurable_product_option_value_uid: ID! + id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_uid instead") + option_label: String! + value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_value_uid instead") + value_label: String! +} + +type SelectedCustomizableOption { + """ + The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, + `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects + """ + customizable_option_uid: ID! + id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") + is_required: Boolean! + label: String! + sort_order: Int! + type: String! + values: [SelectedCustomizableOptionValue]! +} + +type SelectedCustomizableOptionValue { + """ + The unique ID for a `CustomizableMultipleValue`, `CustomizableRadioValue`, + `CustomizableCheckboxValue`, `CustomizableDropDownValue`, etc. objects + """ + customizable_option_value_uid: ID! + id: Int! @deprecated(reason: "Use SelectedCustomizableOptionValue.customizable_option_value_uid instead") + label: String! + price: CartItemSelectedOptionValuePrice! + value: String! +} + +type SelectedDownloadableLinks { + id: Int + label: String +} + +type SelectedPaymentMethod { + """The payment method code""" + code: String! + + """The purchase order number.""" + purchase_order_number: String + + """The payment method title.""" + title: String! +} + +type SelectedShippingMethod { + amount: Money! + base_amount: Money @deprecated(reason: "The field should not be used on the storefront") + carrier_code: String! + carrier_title: String! + method_code: String! + method_title: String! +} + +input SendEmailToFriendInput { + product_id: Int! + recipients: [SendEmailToFriendRecipientInput]! + sender: SendEmailToFriendSenderInput! +} + +type SendEmailToFriendOutput { + recipients: [SendEmailToFriendRecipient] + sender: SendEmailToFriendSender +} + +type SendEmailToFriendRecipient { + email: String! + name: String! +} + +input SendEmailToFriendRecipientInput { + email: String! + name: String! +} + +type SendEmailToFriendSender { + email: String! + message: String! + name: String! +} + +input SendEmailToFriendSenderInput { + email: String! + message: String! + name: String! +} + +type SendFriendConfiguration { + """Indicates whether the Email to a Friend feature is enabled.""" + enabled_for_customers: Boolean! + + """Indicates whether the Email to a Friend feature is enabled for guests.""" + enabled_for_guests: Boolean! +} + +input SetBillingAddressOnCartInput { + billing_address: BillingAddressInput! + cart_id: String! +} + +type SetBillingAddressOnCartOutput { + cart: Cart! +} + +input SetGuestEmailOnCartInput { + cart_id: String! + email: String! +} + +type SetGuestEmailOnCartOutput { + cart: Cart! +} + +input SetPaymentMethodAndPlaceOrderInput { + cart_id: String! + payment_method: PaymentMethodInput! +} + +input SetPaymentMethodOnCartInput { + cart_id: String! + payment_method: PaymentMethodInput! +} + +type SetPaymentMethodOnCartOutput { + cart: Cart! +} + +input SetShippingAddressesOnCartInput { + cart_id: String! + shipping_addresses: [ShippingAddressInput]! +} + +type SetShippingAddressesOnCartOutput { + cart: Cart! +} + +input SetShippingMethodsOnCartInput { + cart_id: String! + shipping_methods: [ShippingMethodInput]! +} + +type SetShippingMethodsOnCartOutput { + cart: Cart! +} + +input ShareWishlistInput { + """Receiver emails""" + emails: [ID]! + + """Sharing message""" + message: String +} + +""" +This enumeration defines whether bundle items must be shipped together. +""" +enum ShipBundleItemsEnum { + TOGETHER + SEPARATELY +} + +type ShipmentItem implements ShipmentItemInterface { + """The unique ID for a `ShipmentItemInterface` object""" + id: ID! + + """Associated order item""" + order_item: OrderItemInterface + + """Name of the base product""" + product_name: String + + """Sale price for the base product""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """Number of shipped items""" + quantity_shipped: Float! +} + +"""Order shipment item details""" +interface ShipmentItemInterface { + """The unique ID for a `ShipmentItemInterface` object""" + id: ID! + + """Associated order item""" + order_item: OrderItemInterface + + """Name of the base product""" + product_name: String + + """Sale price for the base product""" + product_sale_price: Money! + + """SKU of the base product""" + product_sku: String! + + """Number of shipped items""" + quantity_shipped: Float! +} + +"""Order shipment tracking details""" +type ShipmentTracking { + """The shipping carrier for the order delivery""" + carrier: String! + + """The tracking number of the order shipment""" + number: String + + """The shipment tracking title""" + title: String! +} + +input ShippingAddressInput { + address: CartAddressInput + customer_address_id: Int + customer_notes: String + + """The code of Pickup Location which will be used for In-Store Pickup.""" + pickup_location_code: String +} + +type ShippingCartAddress implements CartAddressInterface { + available_shipping_methods: [AvailableShippingMethod] + cart_items: [CartItemQuantity] @deprecated(reason: "`cart_items_v2` should be used instead") + cart_items_v2: [CartItemInterface] + city: String! + company: String + country: CartAddressCountry! + customer_notes: String + firstname: String! + items_weight: Float @deprecated(reason: "This information shoud not be exposed on frontend") + lastname: String! + pickup_location_code: String + postcode: String + region: CartAddressRegion + selected_shipping_method: SelectedShippingMethod + street: [String]! + telephone: String! +} + +""" +Defines an individual shipping discount. This discount can be applied to shipping. +""" +type ShippingDiscount { + """The amount of the discount""" + amount: Money! +} + +"""The Shipping handling details""" +type ShippingHandling { + """The shipping amount, excluding tax""" + amount_excluding_tax: Money + + """The shipping amount, including tax""" + amount_including_tax: Money + + """The applied discounts to the shipping""" + discounts: [ShippingDiscount] + + """Contains details about taxes applied for shipping""" + taxes: [TaxItem] + + """The total amount for shipping""" + total_amount: Money! +} + +type ShippingInfo { + shipping_address: OrderCustomerAddress + shipping_amount: Float + shipping_description: String + shipping_incl_tax: Float + shipping_method: String + tracking_numbers: [String] +} + +type ShippingMethod { + amount: Float + available: Boolean + base_amount: Float + carrier_code: String + carrier_title: String + error_message: String + method_code: String + method_title: String + price_excl_tax: Float + price_incl_tax: Float +} + +input ShippingMethodInput { + carrier_code: String! + method_code: String! +} + +"""Simple Cart Item""" +type SimpleCartItem implements CartItemInterface { + customizable_options: [SelectedCustomizableOption]! + + """The entered gift message for the cart item""" + gift_message: GiftMessage + id: String! @deprecated(reason: "Use `uid` instead") + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +""" +A simple product is tangible and is usually sold in single units or in fixed quantities +""" +type SimpleProduct implements ProductInterface & RoutableInterface & PhysicalProductInterface & CustomizableProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + + """The weight of the item, in units defined by the store.""" + weight: Float + yes_no: Int +} + +input SimpleProductCartItemInput { + customizable_options: [CustomizableOptionInput] + data: CartItemInput! +} + +"""A simple product wish list Item""" +type SimpleWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +type Slide { + desktop_image: String + desktop_image_2: String + desktop_image_3: String + display_title: String + display_title_2: String + display_title_3: String + embed_code: String + embed_code_2: String + embed_code_3: String + end_time: String + is_active: Boolean + maps: [Map] + mobile_image: String + mobile_image_2: String + mobile_image_3: String + position: Int + slide_id: ID + slide_link: String + slide_link_2: String + slide_link_3: String + slide_link_text: String + slide_text: String + slide_text_2: String + slide_text_3: String + slide_text_position: Int + slide_text_position_2: Int + slide_text_position_3: Int + slide_width_class: String + start_time: String + title: String +} + +"""foo defines bar""" +type Slider { + animation_speed: Int + is_active: Boolean + lazy_load: Boolean + position: Int + show_menu: Boolean + show_navigation: Boolean + slide_speed: Int + slider_id: ID + slides: [Slide] + slides_to_display: Int + slides_to_display_mobile: Int + slides_to_display_tablet: Int + slides_to_scroll: Int + slides_to_scroll_mobile: Int + slides_to_scroll_tablet: Int + title: String +} + +""" +This enumeration indicates whether to return results in ascending or descending order +""" +enum SortEnum { + ASC + DESC +} + +type SortField { + """Label of sort field.""" + label: String + + """Attribute code of sort field.""" + value: String +} + +""" +SortFields contains a default value for sort fields and all available sort fields. +""" +type SortFields { + """Default value of sort fields.""" + default: String + + """Available sort fields.""" + options: [SortField] +} + +type Store { + city: String + country: String + description: String + name: String + phone: String + pickup_location_code: String + postcode: String + region: String + street: String +} + +"""The type contains information about a store config""" +type StoreConfig { + """Footer Miscellaneous HTML""" + absolute_footer: String + + """Defines OAuth customer token lifetime""" + access_token_lifetime: String + + """Number of address lines in forms""" + address_lines_quantity: Int + + """ + Indicates whether guest users can write product reviews. Possible values: 1 (Yes) and 0 (No) + """ + allow_guests_to_write_product_reviews: String + + """The value of the Allow Gift Messages for Order Items option""" + allow_items: String + + """The value of the Allow Gift Messages on Order Level option""" + allow_order: String + + """Alternative text for the next pages link in the pagination menu""" + anchor_text_for_next: String + + """Alternative text for the previous pages link in the pagination menu""" + anchor_text_for_previous: String + + """Enable autocomplete on login and forgot password forms""" + autocomplete_on_storefront: Boolean + + """Base currency code""" + base_currency_code: String + + """Base link URL for the store""" + base_link_url: String + + """Base media URL for the store""" + base_media_url: String + + """Base static URL for the store""" + base_static_url: String + + """Base URL for the store""" + base_url: String + + """Braintree cc vault status.""" + braintree_cc_vault_active: String + + """Default Sort By.""" + catalog_default_sort_by: String + + """ + Corresponds to the 'Display Prices In Product Lists' field. It indicates how + FPT information is displayed on category pages + """ + category_fixed_product_tax_display_setting: FixedProductTaxDisplaySettings + + """Category URL Suffix""" + category_url_suffix: String + + """CMS Home Page""" + cms_home_page: String + + """CMS No Cookies Page""" + cms_no_cookies: String + + """CMS No Route Page""" + cms_no_route: String + + """A code assigned to the store to identify it""" + code: String @deprecated(reason: "Use `store_code` instead.") + + """ + The configuration setting determines which thumbnail should be used in the cart for configurable products. + """ + configurable_thumbnail_source: String + + """Cookie lifetime in seconds""" + cookie_lifetime: String + + """Cookie popup - Cookie Privacy Page Link""" + cookie_link: String + + """Cookie popup - Text""" + cookie_text: String + + """Copyright""" + copyright: String + + """Day, month and year order in date fields""" + date_fields_order: String + default_country: String + + """Default Meta Description""" + default_description: String + + """Default display currency code""" + default_display_currency_code: String + + """Default Meta Keywords""" + default_keywords: String + + """Default Page Title""" + default_title: String + + """Defines if instore delivery method actived""" + delivery_instore_active: Boolean + + """Demo notice enabled for store""" + demo_notice: Boolean + + """Display Demo Store Notice""" + demonotice: Int + + """Is product stock status displayed""" + display_product_stock_status: Boolean + + """Defines if guest can enter checkout with downloadable product in cart""" + downloadable_disable_guest_checkout: Boolean + + """Defines if downloadable links should be opened in new tab""" + downloadable_links_target_new_window: Boolean + + """Default Web URL""" + front: String + + """Products per Page on Grid Default Value.""" + grid_per_page: Int + + """Products per Page on Grid Allowed Values.""" + grid_per_page_values: String + + """Is guest checkout enabled""" + guest_checkout: Boolean + + """Scripts and Style Sheets""" + head_includes: String + + """Favicon Icon""" + head_shortcut_icon: String + + """Logo Image""" + header_logo_src: String + + """The ID number assigned to the store""" + id: Int @deprecated(reason: "Use `store_code` instead.") + is_active: Boolean + is_allowed_reorder: Boolean + + """ + Indicates whether the store view has been designated as the default within the store group + """ + is_default_store: Boolean + + """ + Indicates whether the store group has been designated as the default within the website + """ + is_default_store_group: Boolean + + """Is customer email confirmation enabled""" + is_email_confirmation_required: Boolean + + """Should layered navigation display product count""" + layered_navigation_product_count_enabled: Boolean + + """List Mode.""" + list_mode: String + + """Products per Page on List Default Value.""" + list_per_page: Int + + """Products per Page on List Allowed Values.""" + list_per_page_values: String + + """Store locale""" + locale: String + + """Logo Image Alt""" + logo_alt: String + + """Logo Attribute Height""" + logo_height: Int + + """Logo Attribute Width""" + logo_width: Int + + """Indicates whether wishlists are enabled (1) or disabled (0)""" + magento_wishlist_general_is_enabled: String + + """The minimum number of characters required for a valid password.""" + minimum_password_length: String + + """Defines password minimun length for customer""" + minimun_password_length: Int + name: String + + """Is newsletter subscription enabled""" + newsletter_general_active: Boolean + + """Is newsletter subscription allowed for not authentificated users""" + newsletter_subscription_allow_guest_subscribe: Boolean + + """Is moderation of newsletter subscription required""" + newsletter_subscription_confirm: Boolean + + """Default No-route URL""" + no_route: String + + """How many pagination links to display""" + pagination_frame: Int + + """ + Number of links that are skipped ahead before showing the next set of links in the pagination + """ + pagination_frame_skip: Int + + """Payflow Pro vault status.""" + payment_payflowpro_cc_vault_active: String + + """PayPal client ID""" + paypal_client_id: ID + + """PayPal sandbox mode""" + paypal_sandbox_flag: Boolean + + """PLP list mode""" + plp_list_mode: String + + """The price tax display mode""" + priceTaxDisplay: PriceTaxDisplay + + """Defines if product drop price alert is enabled""" + product_alert_allow_price: Boolean + + """Defines if product in stock alert is enabled""" + product_alert_allow_stock: Boolean + + """ + Corresponds to the 'Display Prices On Product View Page' field. It indicates + how FPT information is displayed on product pages + """ + product_fixed_product_tax_display_setting: FixedProductTaxDisplaySettings + + """ + Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No) + """ + product_reviews_enabled: String + + """Product URL Suffix.""" + product_url_suffix: String + + """Use Categories Path for Product URLs""" + product_use_categories: Boolean + + """Allows to decide whether to redirect user after login""" + redirect_dashboard: Boolean + + """ + Defines if state field is displayed for countries that doesn't require state + """ + region_display_all: Boolean + + """ + The number of different character classes required in a password (lowercase, uppercase, digits, special characters). + """ + required_character_classes_number: String + + """Are guest reviews enabled""" + reviews_allow_guest: Boolean + + """Are reviews enabled""" + reviews_are_enabled: Boolean + + """The ID of the root category""" + root_category_id: Int @deprecated(reason: "Use `root_category_uid` instead") + + """The unique ID for a `CategoryInterface` object.""" + root_category_uid: ID + + """Defines if customer is allowed to subscribe to order status""" + rss_order_subscribe_allow: Boolean + + """ + Corresponds to the 'Display Prices In Sales Modules' field. It indicates how + FPT information is displayed on cart, checkout, and order pages + """ + sales_fixed_product_tax_display_setting: FixedProductTaxDisplaySettings + + """Secure base link URL for the store""" + secure_base_link_url: String + + """Secure base media URL for the store""" + secure_base_media_url: String + + """Secure base static URL for the store""" + secure_base_static_url: String + + """Secure base URL for the store""" + secure_base_url: String + + """Email to a Friend configuration.""" + send_friend: SendFriendConfiguration + + """Show Breadcrumbs for CMS Pages""" + show_cms_breadcrumbs: Int + + """ + Allows to control the visibility and validation of VAT/TAX Number at customer details / signup forms + """ + show_tax_vat_number: String + + """Displays VAT Number field at address form""" + show_vat_number_on_storefront: Boolean + + """ + The unique ID of the store view. In the Admin, this is called the Store View + Code. When making a GraphQL call, assign this value to the `Store` header to + provide the scope + """ + store_code: ID + + """ + The unique ID assigned to the store group. In the Admin, this is called the Store Name + """ + store_group_code: ID + + """The label assigned to the store group""" + store_group_name: String + + """The label assigned to the store view""" + store_name: String + + """The store view sort order""" + store_sort_order: Int + + """Terms and conditions are enabled for checkout""" + terms_are_enabled: Boolean + + """24h or 12h + AM/PM format""" + time_format: String + + """Timezone of the store""" + timezone: String + + """Page Title Prefix""" + title_prefix: String + + """Page Title Separator.""" + title_separator: String + + """Page Title Suffix""" + title_suffix: String + + """Use a popup calendar as input control for date fields""" + use_calendar: Boolean + + """ + The configuration determines if the store code should be used in the URL + """ + use_store_in_url: Boolean + + """The unique ID for the website""" + website_code: ID + + """The ID number assigned to the website store""" + website_id: Int @deprecated(reason: "The field should not be used on the storefront") + + """The label assigned to the website""" + website_name: String + + """The unit of weight""" + weight_unit: String + + """Welcome Text""" + welcome: String + + """Is wishlist enabled""" + wishlist_general_active: Boolean + + """Min and max years allowed""" + year_range: String +} + +type StorefrontProperties { + """The relative position of the attribute in the layered navigation block""" + position: Int + + """ + Indicates whether the attribute is filterable with results, without results, or not at all + """ + use_in_layered_navigation: UseInLayeredNavigationOptions + + """Indicates whether the attribute is displayed in product listings""" + use_in_product_listing: Boolean + + """ + Indicates whether the attribute can be used in layered navigation on search results pages + """ + use_in_search_results_layered_navigation: Boolean + + """Indicates whether the attribute is displayed on product pages""" + visible_on_catalog_pages: Boolean +} + +type Stores { + stores: [Store] +} + +type SubscribeEmailToNewsletterOutput { + """Returns the status of the subscription request""" + status: SubscriptionStatusesEnum +} + +enum SubscriptionStatusesEnum { + NOT_ACTIVE + SUBSCRIBED + UNSUBSCRIBED + UNCONFIRMED +} + +type SwatchData { + """Type of swatch filter item: 1 - text, 2 - image""" + type: String + + """Value for swatch item (text or image link)""" + value: String +} + +interface SwatchDataInterface { + """Value of swatch item (HEX color code, image link or textual value)""" + value: String +} + +type SwatchLayerFilterItem implements LayerFilterItemInterface & SwatchLayerFilterItemInterface { + """Count of items by filter.""" + items_count: Int @deprecated(reason: "Use AggregationOption.count instead.") + + """Filter label.""" + label: String @deprecated(reason: "Use AggregationOption.label instead.") + + """Data required to render swatch filter item""" + swatch_data: SwatchData + + """Value for filter request variable to be used in query.""" + value_string: String @deprecated(reason: "Use AggregationOption.value instead.") +} + +interface SwatchLayerFilterItemInterface { + """Data required to render swatch filter item""" + swatch_data: SwatchData +} + +type TaxGrandTotalDetails { + amount: Float + group_id: Int +} + +"""The tax item details""" +type TaxItem { + """The amount of tax applied to the item""" + amount: Money! + + """The rate used to calculate the tax""" + rate: Float! + + """A title that describes the tax""" + title: String! +} + +type TextSwatchData implements SwatchDataInterface { + """Value of swatch item (HEX color code, image link or textual value)""" + value: String +} + +"""A price based on the quantity purchased.""" +type TierPrice { + """The price discount that this tier represents.""" + discount: ProductDiscount + final_price: Money + + """ + The minimum number of items that must be purchased to qualify for this price tier. + """ + quantity: Float +} + +type TotalsItem { + base_discount_amount: Float + base_price: Float + base_price_incl_tax: Float + base_row_total: Float + base_row_total_incl_tax: Float + base_tax_amount: Float + bundle_options: [SelectedBundleOption] + customizable_options: [SelectedCustomizableOption] + discount_amount: Float + discount_percent: Float + downloadable_links: [SelectedDownloadableLinks] + item_id: Int + name: String + options: String + price: Float + price_incl_tax: Float + product: ProductInterface + qty: Float + row_total: Float + row_total_incl_tax: Float + row_total_with_discount: Float + sku: String + tax_amount: Float + tax_percent: Float + weee_tax_applied: Float + weee_tax_applied_amount: Float +} + +interface TotalsObject { + applied_rule_ids: String + base_currency_code: String + base_discount_amount: Float + base_grand_total: Float + base_shipping_amount: Float + base_shipping_discount_amount: Float + base_shipping_incl_tax: Float + base_shipping_tax_amount: Float + base_subtotal: Float + base_subtotal_with_discount: Float + base_tax_amount: Float + coupon_code: String + customer_is_guest: Boolean + customer_tax_class_id: Int + discount_amount: Float + grand_total: Float + is_in_store_pickup_available: Boolean + items: [TotalsItem] + items_count: Int + items_qty: Float + quote_currency_code: String + shipping_amount: Float + shipping_discount_amount: Float + shipping_incl_tax: Float + shipping_method: String + shipping_tax_amount: Float + store_id: Int + subtotal: Float + subtotal_incl_tax: Float + subtotal_with_discount: Float + tax_amount: Float + weee_tax_applied_amount: Float +} + +type TotalsSegment { + code: String + extension_attributes: ExtensionAttributes + title: String + value: Float +} + +type TrackingData { + """Is Page Tracking enabled""" + page_tracking_enabled: Boolean + + """dotdigital region prefix""" + region_prefix: String + + """Is ROI Tracking enabled""" + roi_tracking_enabled: Boolean + + """Web Behaviour Tracking profile ID""" + wbt_profile_id: String +} + +input UpdateCartItemsInput { + cart_id: String! + cart_items: [CartItemUpdateInput]! +} + +type UpdateCartItemsOutput { + cart: Cart! +} + +"""Contains the customer's wish list and any errors encountered""" +type UpdateProductsInWishlistOutput { + """An array of errors encountered while updating products in a wish list""" + user_errors: [WishListUserInputError]! + + """Contains the wish list with all items that were successfully updated""" + wishlist: Wishlist! +} + +"""The object contains URL rewrite details""" +type UrlRewrite { + """Request parameters""" + parameters: [HttpQueryParameter] + + """Request URL""" + url: String +} + +"""This enumeration defines the entity type.""" +enum UrlRewriteEntityTypeEnum { + CMS_PAGE + PRODUCT + CATEGORY +} + +enum UseInLayeredNavigationOptions { + NO + FILTERABLE_WITH_RESULTS + FILTERABLE_NO_RESULT +} + +"""Required input for payment methods with Vault support.""" +input VaultTokenInput { + """The public hash of the payment token""" + public_hash: String! +} + +"""Virtual Cart Item""" +type VirtualCartItem implements CartItemInterface { + customizable_options: [SelectedCustomizableOption]! + id: String! @deprecated(reason: "Use `uid` instead") + prices: CartItemPrices + product: ProductInterface! + quantity: Float! + + """The unique ID for a `CartItemInterface` object""" + uid: ID! +} + +""" +A virtual product is a non-tangible product that does not require shipping and is not kept in inventory +""" +type VirtualProduct implements ProductInterface & RoutableInterface & CustomizableProductInterface { + New_attribute_size: Int + New_multiple_attribute: String + Test_Ainars: Int + attribute_allows_html: String + + """The attribute set assigned to the product.""" + attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") + brand: String + + """ + Relative canonical URL. This value is returned only if the system setting 'Use + Canonical Link Meta Tag For Products' is enabled + """ + canonical_url: String + + """The categories assigned to a product.""" + categories: [CategoryInterface] + clothing_colour: Int + clothing_gender: Int + clothing_size: Int + clothing_type: Int + color: Int + color_elena: Int + colors_with_images: Int + + """The product's country of origin.""" + country_of_manufacture: String + + """Timestamp indicating when the product was created.""" + created_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Crosssell Products""" + crosssell_products: [ProductInterface] + + """ + Detailed information about the product. The value can include simple HTML tags. + """ + description: ComplexTextValue + fit: Int + + """Indicates whether a gift message is available.""" + gift_message_available: String + + """The ID number assigned to the product.""" + id: Int @deprecated(reason: "Use the `uid` field instead.") + + """The relative path to the main image on the product page.""" + image: OptimizedProductImage + images_type_map: Int + license_key: String + + """A number representing the product's manufacturer.""" + manufacturer: Int + material: String + + """An array of Media Gallery objects.""" + media_gallery: [MediaGalleryInterface] + + """An array of MediaGalleryEntry objects.""" + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") + memory: Int + + """ + A brief overview of the product for search results listings, maximum 255 characters. + """ + meta_description: String + + """ + A comma-separated list of keywords that are visible only to search engines. + """ + meta_keyword: String + + """ + A string that is displayed in the title bar and tab of the browser and in search results lists. + """ + meta_title: String + multiple_attribute: String + + """The product name. Customers use this name to identify the product.""" + name: String + + """ + The beginning date for new product listings, and determines if the product is featured as a new product. + """ + new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The end date for new product listings.""" + new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """Product stock only x left count""" + only_x_left_in_stock: Float + + """An array of options for a customizable product.""" + options: [CustomizableOptionInterface] + + """ + If the product has multiple options, determines where they appear on the product page. + """ + options_container: String + original_price: Float + + """A ProductPrices object, indicating the price of an item.""" + price: ProductPrices @deprecated(reason: "Use price_range for product price information.") + + """A PriceRange object, indicating the range of prices for the product""" + price_range: PriceRange! + + """An array of TierPrice objects.""" + price_tiers: [TierPrice] + + """An array of ProductLinks objects.""" + product_links: [ProductLinksInterface] + + """Qty field for checkout order view""" + qty: Float + quantity: Float + ranking: Int + + """The average of all the ratings given to the product.""" + rating_summary: Float! + + """ + Contains 0 when there is no redirect error. A value of 301 indicates the URL + of the requested resource has been changed permanently, while a value of 302 + indicates a temporary redirect + """ + redirect_code: Int! + + """Related Products""" + related_products: [ProductInterface] + + """ + The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + """ + relative_url: String + + """The total count of all the reviews given to the product.""" + review_count: Int! + + """The list of products reviews.""" + reviews( + """Specifies the maximum number of results to return at once.""" + pageSize: Int = 20 + + """Specifies which page of results to return.""" + currentPage: Int = 1 + ): ProductReviews! + row_total: Float + s_attributes: [AttributeWithValue] + salable_qty: Float + shoes_size: Int + + """A short description of the product. Its use depends on the theme.""" + short_description: ComplexTextValue + size: Int + + """ + A number or code assigned to a product to identify the product, options, price, and manufacturer. + """ + sku: String + + """The relative path to the small image, which is used on catalog pages.""" + small_image: OptimizedProductImage + + """The beginning date that a product has a special price.""" + special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") + + """The discounted price of the product.""" + special_price: Float + + """The end date that a product has a special price.""" + special_to_date: String + stock_item: ProductStockItem + + """Stock status of the product""" + stock_status: ProductStockStatus + + """The file name of a swatch image""" + swatch_image: String + test: Int + texture: Int + + """The relative path to the product's thumbnail image.""" + thumbnail: OptimizedProductImage + + """ + The price when tier pricing is in effect and the items purchased threshold has been reached. + """ + tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") + + """An array of ProductTierPrices objects.""" + tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") + + """One of PRODUCT, CATEGORY, or CMS_PAGE.""" + type: UrlRewriteEntityTypeEnum + + """ + One of simple, virtual, bundle, downloadable, grouped, or configurable. + """ + type_id: String @deprecated(reason: "Use __typename instead.") + + """The unique ID for a `ProductInterface` object.""" + uid: ID! + + """Timestamp indicating when the product was updated.""" + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") + + """Upsell Products""" + upsell_products: [ProductInterface] + url: String + + """The part of the URL that identifies the product""" + url_key: String + url_path: String @deprecated(reason: "Use product's `canonical_url` or url rewrites instead") + + """URL rewrites list""" + url_rewrites: [UrlRewrite] + + """The part of the product URL that is appended after the url key""" + url_suffix: String + valuesss: Int + + """An array of websites in which the product is available.""" + websites: [Website] @deprecated(reason: "The field should not be used on the storefront.") + yes_no: Int +} + +input VirtualProductCartItemInput { + customizable_options: [CustomizableOptionInput] + data: CartItemInput! +} + +"""A virtual product wish list item""" +type VirtualWishlistItem implements WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +""" +Website is deprecated because it is should not be used on storefront. The type contains information about a website +""" +type Website { + """A code assigned to the website to identify it""" + code: String @deprecated(reason: "The field should not be used on the storefront.") + + """The default group ID that the website has""" + default_group_id: String @deprecated(reason: "The field should not be used on the storefront.") + + """The ID number assigned to the website""" + id: Int @deprecated(reason: "The field should not be used on the storefront.") + + """Specifies if this is the default website""" + is_default: Boolean @deprecated(reason: "The field should not be used on the storefront.") + + """The website name. Websites use this name to identify it easier.""" + name: String @deprecated(reason: "The field should not be used on the storefront.") + + """The attribute to use for sorting websites""" + sort_order: Int @deprecated(reason: "The field should not be used on the storefront.") +} + +type Wishlist { + """The unique ID for a `Wishlist` object""" + id: ID + items: [WishlistItem] @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") + + """The number of items in the wish list""" + items_count: Int + + """An array of items in the customer's wish list""" + items_v2(currentPage: Int = 1, pageSize: Int = 20): WishlistItems + + """An encrypted code that Magento uses to link to the wish list""" + sharing_code: String + + """The time of the last modification to the wish list""" + updated_at: String +} + +type WishlistCartUserInputError { + """An error code that describes the error encountered""" + code: WishlistCartUserInputErrorType! + + """A localized error message""" + message: String! + + """The unique ID of the `Wishlist` object containing an error""" + wishlistId: ID! + + """The unique ID of the wish list item containing an error""" + wishlistItemId: ID! +} + +enum WishlistCartUserInputErrorType { + PRODUCT_NOT_FOUND + NOT_SALABLE + INSUFFICIENT_STOCK + UNDEFINED +} + +type WishlistItem { + """The time when the customer added the item to the wish list""" + added_at: String + + """Configurations to place order with selected options""" + buy_request: String + + """The customer's comment about this item""" + description: String + + """The unique ID for a `WishlistItem` object""" + id: Int + options: [WishlistItemOption] + + """Product price based on selected options""" + price: Float + + """Product price without tax based on selected options""" + price_without_tax: Float + product: ProductInterface + + """The quantity of this wish list item""" + qty: Float + + """The wish list item's SKU""" + sku: ID +} + +"""Defines the items to add to a wish list""" +input WishlistItemInput { + """User description of wish list item""" + description: String + + """An array of options that the customer entered""" + entered_options: [EnteredOptionInput] + + """Id of the wishlist item""" + item_id: ID + + """For complex product types, the SKU of the parent product""" + parent_sku: String + + """Configurable product options""" + product_option: ProductOptionInput + + """Quantity of the product""" + quantity: Int + + """An array of strings corresponding to options the customer selected""" + selected_options: [ID] + + """Sku of the product""" + sku: ID +} + +interface WishlistItemInterface { + """The date and time the item was added to the wish list""" + added_at: String! + + """Custom options selected for the wish list item""" + customizable_options: [SelectedCustomizableOption]! + + """The description of the item""" + description: String + + """The unique ID for a `WishlistItemInterface` object""" + id: ID! + + """Product details of the wish list item""" + product: ProductInterface + + """The quantity of this wish list item""" + quantity: Float! +} + +type WishlistItemOption { + label: String + value: String +} + +type WishlistItems { + """A list of items in the wish list""" + items: [WishlistItemInterface]! + + """Contains pagination metadata""" + page_info: SearchResultPageInfo +} + +"""Defines updates to items in a wish list""" +input WishlistItemUpdateInput { + """Customer-entered comments about the item""" + description: String + + """An array of options that the customer entered""" + entered_options: [EnteredOptionInput] + + """The new amount or number of this item""" + quantity: Float + + """An array of strings corresponding to options the customer selected""" + selected_options: [ID] + + """The unique ID for a `WishlistItemInterface` object""" + wishlist_item_id: ID! +} + +"""Deprecated: `Wishlist` type should be used instead""" +type WishlistOutput { + """Name of wishlist creator""" + creators_name: String + id: ID + + """An array of items in the customer's wish list""" + items: [WishlistItem] @deprecated(reason: "Use field `items` from type `Wishlist` instead") + + """The number of items in the wish list""" + items_count: Int @deprecated(reason: "Use field `items_count` from type `Wishlist` instead") + + """ + When multiple wish lists are enabled, the name the customer assigns to the wishlist + """ + name: String @deprecated(reason: "This field is related to Commerce functionality and is always `null` in Open Source edition") + + """An encrypted code that Magento uses to link to the wish list""" + sharing_code: String @deprecated(reason: "Use field `sharing_code` from type `Wishlist` instead") + + """The time of the last modification to the wish list""" + updated_at: String @deprecated(reason: "Use field `updated_at` from type `Wishlist` instead") +} + +"""An error encountered while performing operations with WishList.""" +type WishListUserInputError { + """Wishlist-specific error code""" + code: WishListUserInputErrorType! + + """A localized error message""" + message: String! +} + +enum WishListUserInputErrorType { + PRODUCT_NOT_FOUND + UNDEFINED +} + diff --git a/packages/scandipwa/src/query/Cart.query.js b/packages/scandipwa/src/query/Cart.query.ts similarity index 79% rename from packages/scandipwa/src/query/Cart.query.js rename to packages/scandipwa/src/query/Cart.query.ts index 324588906a..3563720819 100644 --- a/packages/scandipwa/src/query/Cart.query.js +++ b/packages/scandipwa/src/query/Cart.query.ts @@ -11,32 +11,33 @@ */ import ProductListQuery from 'Query/ProductList.query'; +import { GQLCartItemInput, GQLUpdateCartItemsInput } from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; import { Field } from 'Util/Query'; /** @namespace Query/Cart/Query */ export class CartQuery { //#region MUTATIONS - getAddProductToCartMutation(cartId, cartItems) { + getAddProductToCartMutation(cartId: string, cartItems: GQLCartItemInput): Field { return new Field('addProductsToCart') .addArgument('cartId', 'String!', cartId) .addArgument('cartItems', '[CartItemInput!]!', cartItems) .addField(this._getUserErrorsField()); } - getUpdateCartItemsMutation(input) { + getUpdateCartItemsMutation(input: GQLUpdateCartItemsInput): Field { return new Field('updateCartItems') .addArgument('input', 'UpdateCartItemsInput', input) .addField(this._getCartUpdateField()); } - getCreateEmptyCartMutation() { + getCreateEmptyCartMutation(): Field { return new Field('createEmptyCart'); } //#endregion //#region QUERIES - getCartQuery(quoteId) { + getCartQuery(quoteId: string): Field { const query = new Field('getCartForCustomer') .addFieldList(this._getCartTotalsFields()) .setAlias('cartData'); @@ -50,25 +51,25 @@ export class CartQuery { //#endregion //#region ERROR - _getUserErrorsFields() { + _getUserErrorsFields(): string[] { return [ 'message', 'code' ]; } - _getUserErrorsField() { + _getUserErrorsField(): Field { return new Field('user_errors') .addFieldList(this._getUserErrorsFields()); } //#endregion - _getCartUpdateField() { + _getCartUpdateField(): Field { return new Field('cart') .addField('id'); } - getRemoveCartItemMutation(item_id, quoteId) { + getRemoveCartItemMutation(item_id: number, quoteId: string): Field { const mutation = new Field('removeCartItem') .addArgument('item_id', 'Int!', item_id) .addFieldList(this._getRemoveCartItemFields(quoteId)); @@ -80,7 +81,7 @@ export class CartQuery { return mutation; } - getApplyCouponMutation(couponCode, quoteId) { + getApplyCouponMutation(couponCode: string, quoteId: string): Field { const mutation = new Field('applyCoupon') .addArgument('coupon_code', 'String!', couponCode) .addField(this.getCartQuery(quoteId)); @@ -92,7 +93,7 @@ export class CartQuery { return mutation; } - getRemoveCouponMutation(quoteId) { + getRemoveCouponMutation(quoteId: string): Field { const mutation = new Field('removeCoupon') .addField(this.getCartQuery(quoteId)); @@ -103,32 +104,32 @@ export class CartQuery { return mutation; } - getCartDisplayConfig() { + getCartDisplayConfig(): Field { return new Field('getCartDisplayConfig') .setAlias('cartDisplayConfig') .addFieldList(this._getCartDisplayConfigFields()); } - getMergeCartQuery(sourceCartId, destinationCartId) { + getMergeCartQuery(sourceCartId: string, destinationCartId: string): Field { return new Field('mergeCarts') .addArgument('source_cart_id', 'String!', sourceCartId) .addArgument('destination_cart_id', 'String!', destinationCartId) .addField('id'); } - _getSaveCartItemFields(quoteId) { + _getSaveCartItemFields(quoteId: string): Field[] { return [ this.getCartQuery(quoteId) ]; } - _getRemoveCartItemFields(quoteId) { + _getRemoveCartItemFields(quoteId: string): Field[] { return [ this.getCartQuery(quoteId) ]; } - _getCartTotalsFields() { + _getCartTotalsFields(): Array { return [ 'id', 'subtotal', @@ -155,7 +156,7 @@ export class CartQuery { ]; } - _getBundleOptionValuesFields() { + _getBundleOptionValuesFields(): string[] { return [ 'id', 'label', @@ -164,12 +165,12 @@ export class CartQuery { ]; } - _getBundleOptionValuesField() { + _getBundleOptionValuesField(): Field { return new Field('values') .addFieldList(this._getBundleOptionValuesFields()); } - _getBundleOptionsFields() { + _getBundleOptionsFields(): Array { return [ 'id', 'label', @@ -177,12 +178,12 @@ export class CartQuery { ]; } - _getBundleOptionsField() { + _getBundleOptionsField(): Field { return new Field('bundle_options') .addFieldList(this._getBundleOptionsFields()); } - _getCustomizableOptionValueFields() { + _getCustomizableOptionValueFields(): string[] { return [ 'id', 'label', @@ -190,12 +191,12 @@ export class CartQuery { ]; } - _getCustomizableOptionValueField() { + _getCustomizableOptionValueField(): Field { return new Field('values') .addFieldList(this._getCustomizableOptionValueFields()); } - _getCustomizableOptionsFields() { + _getCustomizableOptionsFields(): Field { return new Field('customizable_options') .addFieldList([ 'id', @@ -204,19 +205,19 @@ export class CartQuery { ]); } - _getDownloadableLinksField() { + _getDownloadableLinksField(): Field { return new Field('downloadable_links') .addFieldList(this._getDownloadableLinksFields()); } - _getDownloadableLinksFields() { + _getDownloadableLinksFields(): string[] { return [ 'id', 'label' ]; } - _getCartItemFields() { + _getCartItemFields(): Array { return [ 'qty', 'sku', @@ -235,17 +236,17 @@ export class CartQuery { ]; } - _getProductField() { + _getProductField(): Field { return new Field('product') .addFieldList(ProductListQuery._getCartProductInterfaceFields()); } - _getCartItemsField() { + _getCartItemsField(): Field { return new Field('items') .addFieldList(this._getCartItemFields()); } - _getCartDisplayConfigFields() { + _getCartDisplayConfigFields(): string[] { return [ 'display_tax_in_price', 'display_tax_in_subtotal', @@ -256,17 +257,17 @@ export class CartQuery { ]; } - _getAppliedTaxesField() { + _getAppliedTaxesField(): Field { return new Field('applied_taxes') .addField(this._getAppliedTaxesRatesField()); } - _getAppliedTaxesRatesField() { + _getAppliedTaxesRatesField(): Field { return new Field('rates') .addFieldList(this._getAppliedTaxesRatesFields()); } - _getAppliedTaxesRatesFields() { + _getAppliedTaxesRatesFields(): string[] { return [ 'percent', 'title' diff --git a/packages/scandipwa/src/query/UrlRewrites.query.ts b/packages/scandipwa/src/query/UrlRewrites.query.ts index 5071db9ae3..b58a4c814d 100644 --- a/packages/scandipwa/src/query/UrlRewrites.query.ts +++ b/packages/scandipwa/src/query/UrlRewrites.query.ts @@ -26,8 +26,7 @@ export class UrlRewritesQuery { _getUrlResolverFields(): Array> { return [ 'sku', - 'type', - new Field('dsfdsf') + 'type' ]; } } diff --git a/packages/scandipwa/src/type/Graphql.type.ts b/packages/scandipwa/src/type/Graphql.type.ts new file mode 100644 index 0000000000..69ba6aaad8 --- /dev/null +++ b/packages/scandipwa/src/type/Graphql.type.ts @@ -0,0 +1,27556 @@ +/* tslint:disable */ +/* eslint-disable */ +import { GraphQLResolveInfo } from 'graphql'; +/** + * This file is auto-generated by graphql-schema-typescript + * Please note that any changes in this file may be overwritten + */ + + +/******************************* + * * + * TYPE DEFS * + * * + *******************************/ +export interface GQLQuery { + + /** + * Get a list of available store views and their config information. + */ + availableStores?: Array; + + /** + * Returns information about shopping cart + */ + cart?: GQLCart; + categories?: GQLCategoryResult; + + /** + * The category query searches for categories that match the criteria specified in the search and filter attributes. + * @deprecated Use 'categoryList' query instead of 'category' query + */ + category?: GQLCategoryTree; + + /** + * Returns an array of categories based on the specified filters. + */ + categoryList?: Array; + + /** + * Retrieves an array of configuration data for the chat widget. + */ + chatData?: GQLChatData; + + /** + * The Checkout Agreements information + */ + checkoutAgreements?: Array; + + /** + * The CMS block query returns information about CMS blocks + */ + cmsBlocks?: GQLCmsBlocks; + + /** + * The CMS page query returns information about a CMS page + */ + cmsPage?: GQLCmsPage; + + /** + * Return products that have been added to the specified compare list + */ + compareList?: GQLCompareList; + + /** + * Contact Us page config + */ + contactPageConfig?: GQLContactPageConfig; + + /** + * The countries query provides information for all countries. + */ + countries?: Array; + + /** + * The countries query provides information for a single country. + */ + country?: GQLCountry; + + /** + * The currency query returns information about store currency. + */ + currency?: GQLCurrency; + + /** + * The currency data query + */ + currencyData?: GQLCurrencyConfig; + + /** + * The customAttributeMetadata query returns the attribute type, given an attribute code and entity type + */ + customAttributeMetadata?: GQLCustomAttributeMetadata; + + /** + * The customer query returns information about a customer account + */ + customer?: GQLCustomer; + + /** + * Returns information about the customer shopping cart + */ + customerCart: GQLCart; + + /** + * The query returns the contents of a customer's downloadable products + */ + customerDownloadableProducts?: GQLCustomerDownloadableProducts; + + /** + * + * @deprecated Use orders from customer instead + */ + customerOrders?: GQLCustomerOrders; + + /** + * Return a list of customer payment tokens + */ + customerPaymentTokens?: GQLCustomerPaymentTokens; + + /** + * Returns status of Easy Email Capture for Checkout. + */ + emailCaptureCheckout?: GQLIsConfigSettingEnabledOutput; + + /** + * Returns status of Easy Email Capture for Newsletter. + */ + emailCaptureNewsletter?: GQLIsConfigSettingEnabledOutput; + getBraintreeConfig?: GQLBraintree; + + /** + * Get cart display settings + */ + getCartDisplayConfig?: GQLCartDisplayConfig; + getCartForCustomer?: GQLQuoteData; + + /** + * Retrieve secure PayPal url for Payments Pro Hosted Solution transaction. + */ + getHostedProUrl?: GQLHostedProUrl; + + /** + * The Sales Order query returns information about a Sales order + */ + getOrderById?: GQLOrder; + + /** + * The Sales Order query returns information about a Sales order + */ + getOrderList?: GQLOrderList; + + /** + * Retrieve payment credentials for transaction. Use this query for Payflow Link and Payments Advanced payment methods. + */ + getPayflowLinkToken?: GQLPayflowLinkToken; + getPaymentMethods?: Array; + getStores?: GQLStores; + isEmailAvailable?: GQLIsEmailAvailableOutput; + orderByInvoice?: GQLCustomerOrder; + orderByRefund?: GQLCustomerOrder; + orderByShipment?: GQLCustomerOrder; + + /** + * Retrieves information about an order by order id. + */ + orderData?: GQLOrder; + + /** + * The pickup locations query searches for locations that match the search request requirements. + */ + pickupLocations?: GQLPickupLocations; + + /** + * Retrieves metadata required by clients to render the Reviews section. + */ + productReviewRatingsMetadata: GQLProductReviewRatingsMetadata; + + /** + * The products query searches for products that match the criteria specified in the search and filter attributes. + */ + products?: GQLProducts; + + /** + * Return the full details for a specified product, category, or CMS page given + * the specified url_key, appended by the url_suffix, if one exists + */ + route?: GQLRoutableInterface; + s_wishlist?: GQLWishlistOutput; + + /** + * Returns Scandiweb Menu Manager menu data + */ + scandiwebMenu?: GQLMenu; + + /** + * The scandiwebSlider entity returns slider data + */ + scandiwebSlider?: GQLSlider; + + /** + * The store config query + */ + storeConfig?: GQLStoreConfig; + + /** + * The store list query + */ + storeList?: Array; + + /** + * Retrieves an array of configuration data for different types of tracking. + */ + trackingData?: GQLTrackingData; + + /** + * The urlResolver query returns the relative URL for a specified product, category or CMS page + * @deprecated Use the 'route' query instead + */ + urlResolver?: GQLEntityUrl; + + /** + * The wishlist query returns the contents of a customer's wish list + * @deprecated Moved under `Customer` `wishlist` + */ + wishlist?: GQLWishlistOutput; +} + +/** + * The type contains information about a store config + */ +export interface GQLStoreConfig { + + /** + * Footer Miscellaneous HTML + */ + absolute_footer?: string; + + /** + * Defines OAuth customer token lifetime + */ + access_token_lifetime?: string; + + /** + * Number of address lines in forms + */ + address_lines_quantity?: number; + + /** + * Indicates whether guest users can write product reviews. Possible values: 1 (Yes) and 0 (No) + */ + allow_guests_to_write_product_reviews?: string; + + /** + * The value of the Allow Gift Messages for Order Items option + */ + allow_items?: string; + + /** + * The value of the Allow Gift Messages on Order Level option + */ + allow_order?: string; + + /** + * Alternative text for the next pages link in the pagination menu + */ + anchor_text_for_next?: string; + + /** + * Alternative text for the previous pages link in the pagination menu + */ + anchor_text_for_previous?: string; + + /** + * Enable autocomplete on login and forgot password forms + */ + autocomplete_on_storefront?: boolean; + + /** + * Base currency code + */ + base_currency_code?: string; + + /** + * Base link URL for the store + */ + base_link_url?: string; + + /** + * Base media URL for the store + */ + base_media_url?: string; + + /** + * Base static URL for the store + */ + base_static_url?: string; + + /** + * Base URL for the store + */ + base_url?: string; + + /** + * Braintree cc vault status. + */ + braintree_cc_vault_active?: string; + + /** + * Default Sort By. + */ + catalog_default_sort_by?: string; + + /** + * Corresponds to the 'Display Prices In Product Lists' field. It indicates how + * FPT information is displayed on category pages + */ + category_fixed_product_tax_display_setting?: GQLFixedProductTaxDisplaySettings; + + /** + * Category URL Suffix + */ + category_url_suffix?: string; + + /** + * CMS Home Page + */ + cms_home_page?: string; + + /** + * CMS No Cookies Page + */ + cms_no_cookies?: string; + + /** + * CMS No Route Page + */ + cms_no_route?: string; + + /** + * A code assigned to the store to identify it + * @deprecated Use `store_code` instead. + */ + code?: string; + + /** + * The configuration setting determines which thumbnail should be used in the cart for configurable products. + */ + configurable_thumbnail_source?: string; + + /** + * Cookie lifetime in seconds + */ + cookie_lifetime?: string; + + /** + * Cookie popup - Cookie Privacy Page Link + */ + cookie_link?: string; + + /** + * Cookie popup - Text + */ + cookie_text?: string; + + /** + * Copyright + */ + copyright?: string; + + /** + * Day, month and year order in date fields + */ + date_fields_order?: string; + default_country?: string; + + /** + * Default Meta Description + */ + default_description?: string; + + /** + * Default display currency code + */ + default_display_currency_code?: string; + + /** + * Default Meta Keywords + */ + default_keywords?: string; + + /** + * Default Page Title + */ + default_title?: string; + + /** + * Defines if instore delivery method actived + */ + delivery_instore_active?: boolean; + + /** + * Demo notice enabled for store + */ + demo_notice?: boolean; + + /** + * Display Demo Store Notice + */ + demonotice?: number; + + /** + * Is product stock status displayed + */ + display_product_stock_status?: boolean; + + /** + * Defines if guest can enter checkout with downloadable product in cart + */ + downloadable_disable_guest_checkout?: boolean; + + /** + * Defines if downloadable links should be opened in new tab + */ + downloadable_links_target_new_window?: boolean; + + /** + * Default Web URL + */ + front?: string; + + /** + * Products per Page on Grid Default Value. + */ + grid_per_page?: number; + + /** + * Products per Page on Grid Allowed Values. + */ + grid_per_page_values?: string; + + /** + * Is guest checkout enabled + */ + guest_checkout?: boolean; + + /** + * Scripts and Style Sheets + */ + head_includes?: string; + + /** + * Favicon Icon + */ + head_shortcut_icon?: string; + + /** + * Logo Image + */ + header_logo_src?: string; + + /** + * The ID number assigned to the store + * @deprecated Use `store_code` instead. + */ + id?: number; + is_active?: boolean; + is_allowed_reorder?: boolean; + + /** + * Indicates whether the store view has been designated as the default within the store group + */ + is_default_store?: boolean; + + /** + * Indicates whether the store group has been designated as the default within the website + */ + is_default_store_group?: boolean; + + /** + * Is customer email confirmation enabled + */ + is_email_confirmation_required?: boolean; + + /** + * Should layered navigation display product count + */ + layered_navigation_product_count_enabled?: boolean; + + /** + * List Mode. + */ + list_mode?: string; + + /** + * Products per Page on List Default Value. + */ + list_per_page?: number; + + /** + * Products per Page on List Allowed Values. + */ + list_per_page_values?: string; + + /** + * Store locale + */ + locale?: string; + + /** + * Logo Image Alt + */ + logo_alt?: string; + + /** + * Logo Attribute Height + */ + logo_height?: number; + + /** + * Logo Attribute Width + */ + logo_width?: number; + + /** + * Indicates whether wishlists are enabled (1) or disabled (0) + */ + magento_wishlist_general_is_enabled?: string; + + /** + * The minimum number of characters required for a valid password. + */ + minimum_password_length?: string; + + /** + * Defines password minimun length for customer + */ + minimun_password_length?: number; + name?: string; + + /** + * Is newsletter subscription enabled + */ + newsletter_general_active?: boolean; + + /** + * Is newsletter subscription allowed for not authentificated users + */ + newsletter_subscription_allow_guest_subscribe?: boolean; + + /** + * Is moderation of newsletter subscription required + */ + newsletter_subscription_confirm?: boolean; + + /** + * Default No-route URL + */ + no_route?: string; + + /** + * How many pagination links to display + */ + pagination_frame?: number; + + /** + * Number of links that are skipped ahead before showing the next set of links in the pagination + */ + pagination_frame_skip?: number; + + /** + * Payflow Pro vault status. + */ + payment_payflowpro_cc_vault_active?: string; + + /** + * PayPal client ID + */ + paypal_client_id?: string; + + /** + * PayPal sandbox mode + */ + paypal_sandbox_flag?: boolean; + + /** + * PLP list mode + */ + plp_list_mode?: string; + + /** + * The price tax display mode + */ + priceTaxDisplay?: GQLPriceTaxDisplay; + + /** + * Defines if product drop price alert is enabled + */ + product_alert_allow_price?: boolean; + + /** + * Defines if product in stock alert is enabled + */ + product_alert_allow_stock?: boolean; + + /** + * Corresponds to the 'Display Prices On Product View Page' field. It indicates + * how FPT information is displayed on product pages + */ + product_fixed_product_tax_display_setting?: GQLFixedProductTaxDisplaySettings; + + /** + * Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No) + */ + product_reviews_enabled?: string; + + /** + * Product URL Suffix. + */ + product_url_suffix?: string; + + /** + * Use Categories Path for Product URLs + */ + product_use_categories?: boolean; + + /** + * Allows to decide whether to redirect user after login + */ + redirect_dashboard?: boolean; + + /** + * Defines if state field is displayed for countries that doesn't require state + */ + region_display_all?: boolean; + + /** + * The number of different character classes required in a password (lowercase, uppercase, digits, special characters). + */ + required_character_classes_number?: string; + + /** + * Are guest reviews enabled + */ + reviews_allow_guest?: boolean; + + /** + * Are reviews enabled + */ + reviews_are_enabled?: boolean; + + /** + * The ID of the root category + * @deprecated Use `root_category_uid` instead + */ + root_category_id?: number; + + /** + * The unique ID for a `CategoryInterface` object. + */ + root_category_uid?: string; + + /** + * Defines if customer is allowed to subscribe to order status + */ + rss_order_subscribe_allow?: boolean; + + /** + * Corresponds to the 'Display Prices In Sales Modules' field. It indicates how + * FPT information is displayed on cart, checkout, and order pages + */ + sales_fixed_product_tax_display_setting?: GQLFixedProductTaxDisplaySettings; + + /** + * Secure base link URL for the store + */ + secure_base_link_url?: string; + + /** + * Secure base media URL for the store + */ + secure_base_media_url?: string; + + /** + * Secure base static URL for the store + */ + secure_base_static_url?: string; + + /** + * Secure base URL for the store + */ + secure_base_url?: string; + + /** + * Email to a Friend configuration. + */ + send_friend?: GQLSendFriendConfiguration; + + /** + * Show Breadcrumbs for CMS Pages + */ + show_cms_breadcrumbs?: number; + + /** + * Allows to control the visibility and validation of VAT/TAX Number at customer details / signup forms + */ + show_tax_vat_number?: string; + + /** + * Displays VAT Number field at address form + */ + show_vat_number_on_storefront?: boolean; + + /** + * The unique ID of the store view. In the Admin, this is called the Store View + * Code. When making a GraphQL call, assign this value to the `Store` header to + * provide the scope + */ + store_code?: string; + + /** + * The unique ID assigned to the store group. In the Admin, this is called the Store Name + */ + store_group_code?: string; + + /** + * The label assigned to the store group + */ + store_group_name?: string; + + /** + * The label assigned to the store view + */ + store_name?: string; + + /** + * The store view sort order + */ + store_sort_order?: number; + + /** + * Terms and conditions are enabled for checkout + */ + terms_are_enabled?: boolean; + + /** + * 24h or 12h + AM/PM format + */ + time_format?: string; + + /** + * Timezone of the store + */ + timezone?: string; + + /** + * Page Title Prefix + */ + title_prefix?: string; + + /** + * Page Title Separator. + */ + title_separator?: string; + + /** + * Page Title Suffix + */ + title_suffix?: string; + + /** + * Use a popup calendar as input control for date fields + */ + use_calendar?: boolean; + + /** + * The configuration determines if the store code should be used in the URL + */ + use_store_in_url?: boolean; + + /** + * The unique ID for the website + */ + website_code?: string; + + /** + * The ID number assigned to the website store + * @deprecated The field should not be used on the storefront + */ + website_id?: number; + + /** + * The label assigned to the website + */ + website_name?: string; + + /** + * The unit of weight + */ + weight_unit?: string; + + /** + * Welcome Text + */ + welcome?: string; + + /** + * Is wishlist enabled + */ + wishlist_general_active?: boolean; + + /** + * Min and max years allowed + */ + year_range?: string; +} + +/** + * This enumeration display settings for the fixed product tax + */ +export enum GQLFixedProductTaxDisplaySettings { + + /** + * The displayed price includes the FPT amount without displaying the + * ProductPrice.fixed_product_taxes values. This value corresponds to 'Including FPT only' + */ + INCLUDE_FPT_WITHOUT_DETAILS = 'INCLUDE_FPT_WITHOUT_DETAILS', + + /** + * The displayed price includes the FPT amount while displaying the values of + * ProductPrice.fixed_product_taxes separately. This value corresponds to + * 'Including FPT and FPT description' + */ + INCLUDE_FPT_WITH_DETAILS = 'INCLUDE_FPT_WITH_DETAILS', + + /** + * The displayed price does not include the FPT amount. The values of + * ProductPrice.fixed_product_taxes and the price including the FPT are displayed + * separately. This value corresponds to 'Excluding FPT, Including FPT + * description and final price' + */ + EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS = 'EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS', + + /** + * The displayed price does not include the FPT amount. The values from + * ProductPrice.fixed_product_taxes are not displayed. This value corresponds to + * 'Excluding FPT' + */ + EXCLUDE_FPT_WITHOUT_DETAILS = 'EXCLUDE_FPT_WITHOUT_DETAILS', + + /** + * The FPT feature is not enabled. You can omit ProductPrice.fixed_product_taxes from your query + */ + FPT_DISABLED = 'FPT_DISABLED' +} + +export interface GQLPriceTaxDisplay { + + /** + * Defines if product price will include/exclude tax or both in catalog + */ + product_price_display_type?: string; + + /** + * Defines if shipping price will include/exclude tax or both + */ + shipping_price_display_type?: string; +} + +export interface GQLSendFriendConfiguration { + + /** + * Indicates whether the Email to a Friend feature is enabled. + */ + enabled_for_customers: boolean; + + /** + * Indicates whether the Email to a Friend feature is enabled for guests. + */ + enabled_for_guests: boolean; +} + +export interface GQLCart { + + /** + * An array of coupons that have been applied to the cart + * @deprecated Use applied_coupons instead + */ + applied_coupon?: GQLAppliedCoupon; + + /** + * An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code + */ + applied_coupons?: Array; + + /** + * Available payment methods + */ + available_payment_methods?: Array; + billing_address?: GQLBillingCartAddress; + email?: string; + + /** + * The entered gift message for the cart + */ + gift_message?: GQLGiftMessage; + + /** + * The unique ID for a `Cart` object + */ + id: string; + is_virtual: boolean; + items?: Array; + prices?: GQLCartPrices; + selected_payment_method?: GQLSelectedPaymentMethod; + shipping_addresses: Array; + total_quantity: number; +} + +export interface GQLAppliedCoupon { + code: string; +} + +export interface GQLAvailablePaymentMethod { + + /** + * The payment method code + */ + code: string; + + /** + * The payment method title. + */ + title: string; +} + +export interface GQLBillingCartAddress extends GQLCartAddressInterface { + city: string; + company?: string; + country: GQLCartAddressCountry; + + /** + * + * @deprecated The field is used only in shipping address + */ + customer_notes?: string; + firstname: string; + lastname: string; + postcode?: string; + region?: GQLCartAddressRegion; + street: Array; + telephone: string; +} + +export interface GQLCartAddressInterface { + city: string; + company?: string; + country: GQLCartAddressCountry; + firstname: string; + lastname: string; + postcode?: string; + region?: GQLCartAddressRegion; + street: Array; + telephone: string; +} + +/** Use this to resolve interface type CartAddressInterface */ +export type GQLPossibleCartAddressInterfaceTypeNames = +'BillingCartAddress' | +'ShippingCartAddress'; + +export interface GQLCartAddressInterfaceNameMap { + CartAddressInterface: GQLCartAddressInterface; + BillingCartAddress: GQLBillingCartAddress; + ShippingCartAddress: GQLShippingCartAddress; +} + +export interface GQLCartAddressCountry { + code: string; + label: string; +} + +export interface GQLCartAddressRegion { + code?: string; + label?: string; + region_id?: number; +} + +/** + * Contains the text of a gift message, its sender, and recipient + */ +export interface GQLGiftMessage { + + /** + * Sender name + */ + from: string; + + /** + * Gift message text + */ + message: string; + + /** + * Recipient name + */ + to: string; +} + +export interface GQLCartItemInterface { + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +/** Use this to resolve interface type CartItemInterface */ +export type GQLPossibleCartItemInterfaceTypeNames = +'BundleCartItem' | +'ConfigurableCartItem' | +'DownloadableCartItem' | +'SimpleCartItem' | +'VirtualCartItem'; + +export interface GQLCartItemInterfaceNameMap { + CartItemInterface: GQLCartItemInterface; + BundleCartItem: GQLBundleCartItem; + ConfigurableCartItem: GQLConfigurableCartItem; + DownloadableCartItem: GQLDownloadableCartItem; + SimpleCartItem: GQLSimpleCartItem; + VirtualCartItem: GQLVirtualCartItem; +} + +export interface GQLCartItemPrices { + + /** + * An array of discounts to be applied to the cart item + */ + discounts?: Array; + + /** + * Applied FPT to the cart item. + */ + fixed_product_taxes?: Array; + price: GQLMoney; + row_total: GQLMoney; + row_total_including_tax: GQLMoney; + + /** + * The total of all discounts applied to the item + */ + total_item_discount?: GQLMoney; +} + +/** + * Defines an individual discount. A discount can be applied to the cart as a whole or to an item. + */ +export interface GQLDiscount { + + /** + * The amount of the discount + */ + amount: GQLMoney; + + /** + * A description of the discount + */ + label: string; +} + +/** + * A Money object defines a monetary value, including a numeric value and a currency code. + */ +export interface GQLMoney { + + /** + * A three-letter currency code, such as USD or EUR + */ + currency?: GQLCurrencyEnum; + + /** + * A number expressing a monetary value + */ + value?: number; +} + +/** + * The list of available currency codes + */ +export enum GQLCurrencyEnum { + AFN = 'AFN', + ALL = 'ALL', + AZN = 'AZN', + DZD = 'DZD', + AOA = 'AOA', + ARS = 'ARS', + AMD = 'AMD', + AWG = 'AWG', + AUD = 'AUD', + BSD = 'BSD', + BHD = 'BHD', + BDT = 'BDT', + BBD = 'BBD', + BYN = 'BYN', + BZD = 'BZD', + BMD = 'BMD', + BTN = 'BTN', + BOB = 'BOB', + BAM = 'BAM', + BWP = 'BWP', + BRL = 'BRL', + GBP = 'GBP', + BND = 'BND', + BGN = 'BGN', + BUK = 'BUK', + BIF = 'BIF', + KHR = 'KHR', + CAD = 'CAD', + CVE = 'CVE', + CZK = 'CZK', + KYD = 'KYD', + GQE = 'GQE', + CLP = 'CLP', + CNY = 'CNY', + COP = 'COP', + KMF = 'KMF', + CDF = 'CDF', + CRC = 'CRC', + HRK = 'HRK', + CUP = 'CUP', + DKK = 'DKK', + DJF = 'DJF', + DOP = 'DOP', + XCD = 'XCD', + EGP = 'EGP', + SVC = 'SVC', + ERN = 'ERN', + EEK = 'EEK', + ETB = 'ETB', + EUR = 'EUR', + FKP = 'FKP', + FJD = 'FJD', + GMD = 'GMD', + GEK = 'GEK', + GEL = 'GEL', + GHS = 'GHS', + GIP = 'GIP', + GTQ = 'GTQ', + GNF = 'GNF', + GYD = 'GYD', + HTG = 'HTG', + HNL = 'HNL', + HKD = 'HKD', + HUF = 'HUF', + ISK = 'ISK', + INR = 'INR', + IDR = 'IDR', + IRR = 'IRR', + IQD = 'IQD', + ILS = 'ILS', + JMD = 'JMD', + JPY = 'JPY', + JOD = 'JOD', + KZT = 'KZT', + KES = 'KES', + KWD = 'KWD', + KGS = 'KGS', + LAK = 'LAK', + LVL = 'LVL', + LBP = 'LBP', + LSL = 'LSL', + LRD = 'LRD', + LYD = 'LYD', + LTL = 'LTL', + MOP = 'MOP', + MKD = 'MKD', + MGA = 'MGA', + MWK = 'MWK', + MYR = 'MYR', + MVR = 'MVR', + LSM = 'LSM', + MRO = 'MRO', + MUR = 'MUR', + MXN = 'MXN', + MDL = 'MDL', + MNT = 'MNT', + MAD = 'MAD', + MZN = 'MZN', + MMK = 'MMK', + NAD = 'NAD', + NPR = 'NPR', + ANG = 'ANG', + YTL = 'YTL', + NZD = 'NZD', + NIC = 'NIC', + NGN = 'NGN', + KPW = 'KPW', + NOK = 'NOK', + OMR = 'OMR', + PKR = 'PKR', + PAB = 'PAB', + PGK = 'PGK', + PYG = 'PYG', + PEN = 'PEN', + PHP = 'PHP', + PLN = 'PLN', + QAR = 'QAR', + RHD = 'RHD', + RON = 'RON', + RUB = 'RUB', + RWF = 'RWF', + SHP = 'SHP', + STD = 'STD', + SAR = 'SAR', + RSD = 'RSD', + SCR = 'SCR', + SLL = 'SLL', + SGD = 'SGD', + SKK = 'SKK', + SBD = 'SBD', + SOS = 'SOS', + ZAR = 'ZAR', + KRW = 'KRW', + LKR = 'LKR', + SDG = 'SDG', + SRD = 'SRD', + SZL = 'SZL', + SEK = 'SEK', + CHF = 'CHF', + SYP = 'SYP', + TWD = 'TWD', + TJS = 'TJS', + TZS = 'TZS', + THB = 'THB', + TOP = 'TOP', + TTD = 'TTD', + TND = 'TND', + TMM = 'TMM', + USD = 'USD', + UGX = 'UGX', + UAH = 'UAH', + AED = 'AED', + UYU = 'UYU', + UZS = 'UZS', + VUV = 'VUV', + VEB = 'VEB', + VEF = 'VEF', + VND = 'VND', + CHE = 'CHE', + CHW = 'CHW', + XOF = 'XOF', + WST = 'WST', + YER = 'YER', + ZMK = 'ZMK', + ZWD = 'ZWD', + TRY = 'TRY', + AZM = 'AZM', + ROL = 'ROL', + TRL = 'TRL', + XPF = 'XPF' +} + +/** + * A single FPT that can be applied to a product price. + */ +export interface GQLFixedProductTax { + + /** + * Amount of the FPT as a money object. + */ + amount?: GQLMoney; + + /** + * The label assigned to the FPT to be displayed on the frontend. + */ + label?: string; +} + +/** + * The ProductInterface contains attributes that are common to all types of + * products. Note that descriptions may not be available for custom and EAV attributes. + */ +export interface GQLProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + yes_no?: number; +} + +/** Use this to resolve interface type ProductInterface */ +export type GQLPossibleProductInterfaceTypeNames = +'BundleProduct' | +'ConfigurableProduct' | +'SimpleProduct' | +'DownloadableProduct' | +'GroupedProduct' | +'VirtualProduct'; + +export interface GQLProductInterfaceNameMap { + ProductInterface: GQLProductInterface; + BundleProduct: GQLBundleProduct; + ConfigurableProduct: GQLConfigurableProduct; + SimpleProduct: GQLSimpleProduct; + DownloadableProduct: GQLDownloadableProduct; + GroupedProduct: GQLGroupedProduct; + VirtualProduct: GQLVirtualProduct; +} + +/** + * CategoryInterface contains the full set of attributes that can be returned in a category search. + */ +export interface GQLCategoryInterface { + available_sort_by?: Array; + + /** + * Breadcrumbs, parent categories info. + */ + breadcrumbs?: Array; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Categories' is enabled + */ + canonical_url?: string; + children_count?: string; + + /** + * Category CMS Block. + */ + cms_block?: GQLCmsBlock; + + /** + * Timestamp indicating when the category was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + custom_layout_update_file?: string; + + /** + * The attribute to use for sorting. + */ + default_sort_by?: string; + + /** + * An optional description of the category. + */ + description?: string; + + /** + * Category display mode (products only, static block only, both) + */ + display_mode?: string; + filter_price_range?: number; + + /** + * An ID that uniquely identifies the category. + * @deprecated Use the `uid` argument instead. + */ + id?: number; + image?: string; + include_in_menu?: number; + is_anchor?: number; + landing_page?: number; + + /** + * Indicates the depth of the category within the tree. + */ + level?: number; + meta_description?: string; + meta_keywords?: string; + meta_title?: string; + + /** + * The display name of the category. + */ + name?: string; + + /** + * Category Path. + */ + path?: string; + + /** + * Category path in store. + */ + path_in_store?: string; + + /** + * The position of the category relative to other categories at the same level in tree. + */ + position?: number; + + /** + * The number of products in the category that are marked as visible. By default, + * in complex products, parent products are visible, but their child products are not. + */ + product_count?: number; + + /** + * The list of products assigned to the category. + */ + products?: GQLCategoryProducts; + + /** + * The unique ID for a `CategoryInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the category was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + url?: string; + + /** + * The url key assigned to the category. + */ + url_key?: string; + + /** + * The url path assigned to the category. + */ + url_path?: string; + + /** + * The part of the category URL that is appended after the url key + */ + url_suffix?: string; +} + +/** Use this to resolve interface type CategoryInterface */ +export type GQLPossibleCategoryInterfaceTypeNames = 'CategoryTree'; + +export interface GQLCategoryInterfaceNameMap { + CategoryInterface: GQLCategoryInterface; + CategoryTree: GQLCategoryTree; +} + +/** + * Breadcrumb item. + */ +export interface GQLBreadcrumb { + + /** + * Category ID. + * @deprecated Use the `category_uid` argument instead. + */ + category_id?: number; + + /** + * Is category active + */ + category_is_active?: boolean; + + /** + * Category level. + */ + category_level?: number; + + /** + * Category name. + */ + category_name?: string; + + /** + * The unique ID for a `Breadcrumb` object. + */ + category_uid: string; + + /** + * Trimmed URL rewrite + */ + category_url?: string; + + /** + * Category URL key. + */ + category_url_key?: string; + + /** + * Category URL path. + */ + category_url_path?: string; +} + +/** + * CMS block defines all CMS block information + */ +export interface GQLCmsBlock { + + /** + * CMS block content + */ + content?: string; + + /** + * CMS block is disabled + */ + disabled?: boolean; + + /** + * CMS block identifier + */ + identifier?: string; + + /** + * CMS block title + */ + title?: string; +} + +/** + * ProductAttributeSortInput specifies the attribute to use for sorting search + * results and indicates whether the results are sorted in ascending or descending + * order. It's possible to sort products using searchable attributes with enabled + * 'Use in Filter Options' option + */ +export interface GQLProductAttributeSortInput { + + /** + * Attribute label: New attribute size! + */ + New_attribute_size?: GQLSortEnum; + + /** + * Attribute label: Attribute allows html + */ + attribute_allows_html?: GQLSortEnum; + + /** + * Attribute label: Product Name + */ + name?: GQLSortEnum; + + /** + * Sort by the position assigned to each product. + */ + position?: GQLSortEnum; + + /** + * Attribute label: Price + */ + price?: GQLSortEnum; + + /** + * Sort by the search relevance score (default). + */ + relevance?: GQLSortEnum; +} + +/** + * This enumeration indicates whether to return results in ascending or descending order + */ +export enum GQLSortEnum { + ASC = 'ASC', + DESC = 'DESC' +} + +/** + * The category products object returned in the Category query. + */ +export interface GQLCategoryProducts { + + /** + * An array of products that are assigned to the category. + */ + items?: Array; + + /** + * An object that includes the page_info and currentPage values specified in the query. + */ + page_info?: GQLSearchResultPageInfo; + + /** + * The number of products in the category that are marked as visible. By default, + * in complex products, parent products are visible, but their child products are not. + */ + total_count?: number; +} + +/** + * SearchResultPageInfo provides navigation for the query response + */ +export interface GQLSearchResultPageInfo { + + /** + * Specifies which page of results to return + */ + current_page?: number; + + /** + * Specifies the maximum number of items to return + */ + page_size?: number; + + /** + * Total pages + */ + total_pages?: number; +} + +export interface GQLComplexTextValue { + + /** + * HTML format + */ + html: string; +} + +export interface GQLOptimizedProductImage { + label?: string; + path?: string; + url?: string; +} + +/** + * Contains basic information about a product image or video. + */ +export interface GQLMediaGalleryInterface { + + /** + * Whether the image is hidden from view. + */ + disabled?: boolean; + + /** + * The label of the product image or video. + */ + label?: string; + + /** + * The media item's position after it has been sorted. + */ + position?: number; + + /** + * The URL of the product image or video. + */ + url?: string; +} + +/** Use this to resolve interface type MediaGalleryInterface */ +export type GQLPossibleMediaGalleryInterfaceTypeNames = +'ProductImage' | +'ProductVideo'; + +export interface GQLMediaGalleryInterfaceNameMap { + MediaGalleryInterface: GQLMediaGalleryInterface; + ProductImage: GQLProductImage; + ProductVideo: GQLProductVideo; +} + +/** + * MediaGalleryEntry defines characteristics about images and videos associated with a specific product + */ +export interface GQLMediaGalleryEntry { + + /** + * The path of the base image on the server + */ + base?: GQLMediaGalleryImageOfType; + + /** + * Contains a ProductMediaGalleryEntriesContent object. + */ + content?: GQLProductMediaGalleryEntriesContent; + + /** + * Whether the image is hidden from view. + */ + disabled?: boolean; + + /** + * The path of the image on the server. + */ + file?: string; + + /** + * The identifier assigned to the object. + * @deprecated Use `uid` instead. + */ + id?: number; + + /** + * The alt text displayed on the UI when the user points to the image. + */ + label?: string; + + /** + * The path of the large image on the server + */ + large?: GQLMediaGalleryImageOfType; + + /** + * image or video. + */ + media_type?: string; + + /** + * The media item's position after it has been sorted. + */ + position?: number; + + /** + * The path of the thumbnail image on the server + */ + thumbnail?: GQLMediaGalleryImageOfType; + + /** + * Array of image types. It can have the following values: image, small_image, thumbnail. + */ + types?: Array; + + /** + * The unique ID for a `MediaGalleryEntry` object. + */ + uid: string; + + /** + * Contains a ProductMediaGalleryEntriesVideoContent object. + */ + video_content?: GQLProductMediaGalleryEntriesVideoContent; +} + +/** + * Products thumbnail image + */ +export interface GQLMediaGalleryImageOfType { + + /** + * Product image type + */ + type?: string; + + /** + * Product image url + */ + url?: string; +} + +/** + * ProductMediaGalleryEntriesContent contains an image in base64 format and basic information about the image. + */ +export interface GQLProductMediaGalleryEntriesContent { + + /** + * The image in base64 format. + */ + base64_encoded_data?: string; + + /** + * The file name of the image. + */ + name?: string; + + /** + * The MIME type of the file, such as image/png. + */ + type?: string; +} + +/** + * ProductMediaGalleryEntriesVideoContent contains a link to a video file and basic information about the video. + */ +export interface GQLProductMediaGalleryEntriesVideoContent { + + /** + * Must be external-video. + */ + media_type?: string; + + /** + * A description of the video. + */ + video_description?: string; + + /** + * Optional data about the video. + */ + video_metadata?: string; + + /** + * Describes the video source. + */ + video_provider?: string; + + /** + * The title of the video. + */ + video_title?: string; + + /** + * The URL to the video. + */ + video_url?: string; +} + +/** + * ProductPrices is deprecated, replaced by PriceRange. The ProductPrices object + * contains the regular price of an item, as well as its minimum and maximum + * prices. Only composite products, which include bundle, configurable, and grouped + * products, can contain a minimum and maximum price. + */ +export interface GQLProductPrices { + + /** + * The highest possible final price for all the options defined within a + * composite product. If you are specifying a price range, this would be the to value. + * @deprecated Use PriceRange.maximum_price. + */ + maximalPrice?: GQLPrice; + + /** + * The lowest possible final price for all the options defined within a composite + * product. If you are specifying a price range, this would be the from value. + * @deprecated Use PriceRange.minimum_price. + */ + minimalPrice?: GQLPrice; + + /** + * The base price of a product. + * @deprecated Use regular_price from PriceRange.minimum_price or PriceRange.maximum_price. + */ + regularPrice?: GQLPrice; +} + +/** + * Price is deprecated, replaced by ProductPrice. The Price object defines the + * price of a product as well as any tax-related adjustments. + */ +export interface GQLPrice { + + /** + * An array that provides information about tax, weee, or weee_tax adjustments. + * @deprecated Price is deprecated, use ProductPrice. + */ + adjustments?: Array; + + /** + * The price of a product plus a three-letter currency code. + * @deprecated Price is deprecated, use ProductPrice. + */ + amount?: GQLMoney; +} + +/** + * PriceAdjustment is deprecated. Taxes will be included or excluded in the price. + * The PricedAdjustment object defines the amount of money to apply as an + * adjustment, the type of adjustment to apply, and whether the item is included or + * excluded from the adjustment. + */ +export interface GQLPriceAdjustment { + + /** + * The amount of the price adjustment and its currency code. + */ + amount?: GQLMoney; + + /** + * Indicates whether the adjustment involves tax, weee, or weee_tax. + * @deprecated PriceAdjustment is deprecated. + */ + code?: GQLPriceAdjustmentCodesEnum; + + /** + * Indicates whether the entity described by the code attribute is included or excluded from the adjustment. + * @deprecated PriceAdjustment is deprecated. + */ + description?: GQLPriceAdjustmentDescriptionEnum; +} + +/** + * PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module. + */ +export enum GQLPriceAdjustmentCodesEnum { + + /** + * + * @deprecated PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog + */ + TAX = 'TAX', + + /** + * + * @deprecated WEEE code is deprecated, use fixed_product_taxes.label + */ + WEEE = 'WEEE', + + /** + * + * @deprecated Use fixed_product_taxes. PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog + */ + WEEE_TAX = 'WEEE_TAX' +} + +/** + * PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded. + */ +export enum GQLPriceAdjustmentDescriptionEnum { + INCLUDED = 'INCLUDED', + EXCLUDED = 'EXCLUDED' +} + +/** + * Price range for a product. If the product has a single price, the minimum and maximum price will be the same. + */ +export interface GQLPriceRange { + + /** + * The highest possible price for the product. + */ + maximum_price?: GQLProductPrice; + + /** + * The lowest possible price for the product. + */ + minimum_price: GQLProductPrice; +} + +/** + * Represents a product price. + */ +export interface GQLProductPrice { + + /** + * The base price of the product after discounts applied. + */ + default_final_price: GQLMoney; + + /** + * The base price of the product after discounts applied excluding taxes. + */ + default_final_price_excl_tax: GQLMoney; + + /** + * The base price of the product. + */ + default_price: GQLMoney; + + /** + * The price discount. Represents the difference between the regular and final price. + */ + discount?: GQLProductDiscount; + + /** + * The final price of the product after discounts applied. + */ + final_price: GQLMoney; + + /** + * The final price of the product after discounts applied excluding taxes. + */ + final_price_excl_tax: GQLMoney; + + /** + * The multiple FPTs that can be applied to a product price. + */ + fixed_product_taxes?: Array; + + /** + * The regular price of the product. + */ + regular_price: GQLMoney; + + /** + * The regular price of the product excluding taxes. + */ + regular_price_excl_tax: GQLMoney; +} + +/** + * A discount applied to a product price. + */ +export interface GQLProductDiscount { + + /** + * The actual value of the discount. + */ + amount_off?: number; + + /** + * The discount expressed a percentage. + */ + percent_off?: number; +} + +/** + * A price based on the quantity purchased. + */ +export interface GQLTierPrice { + + /** + * The price discount that this tier represents. + */ + discount?: GQLProductDiscount; + final_price?: GQLMoney; + + /** + * The minimum number of items that must be purchased to qualify for this price tier. + */ + quantity?: number; +} + +/** + * ProductLinks contains information about linked products, including the link type and product type of each item. + */ +export interface GQLProductLinksInterface { + + /** + * One of related, associated, upsell, or crosssell. + */ + link_type?: string; + + /** + * The SKU of the linked product. + */ + linked_product_sku?: string; + + /** + * The type of linked product (simple, virtual, bundle, downloadable, grouped, configurable). + */ + linked_product_type?: string; + + /** + * The position within the list of product links. + */ + position?: number; + + /** + * The identifier of the linked product. + */ + sku?: string; +} + +/** Use this to resolve interface type ProductLinksInterface */ +export type GQLPossibleProductLinksInterfaceTypeNames = 'ProductLinks'; + +export interface GQLProductLinksInterfaceNameMap { + ProductLinksInterface: GQLProductLinksInterface; + ProductLinks: GQLProductLinks; +} + +export interface GQLProductReviews { + + /** + * An array of product reviews. + */ + items: Array; + + /** + * Metadata for pagination rendering. + */ + page_info: GQLSearchResultPageInfo; +} + +/** + * Details of a product review + */ +export interface GQLProductReview { + + /** + * The average rating for product review. + */ + average_rating: number; + + /** + * Date indicating when the review was created. + */ + created_at: string; + + /** + * The customer's nickname. Defaults to the customer name, if logged in + */ + nickname: string; + + /** + * Contains details about the reviewed product + */ + product: GQLProductInterface; + + /** + * An array of ratings by rating category, such as quality, price, and value + */ + ratings_breakdown: Array; + + /** + * The summary (title) of the review + */ + summary: string; + + /** + * The review text. + */ + text: string; +} + +export interface GQLProductReviewRating { + + /** + * The label assigned to an aspect of a product that is being rated, such as quality or price + */ + name: string; + + /** + * The rating value given by customer. By default, possible values range from 1 to 5. + */ + value: string; +} + +export interface GQLAttributeWithValue { + attribute_code?: string; + attribute_group_code?: string; + attribute_group_id?: string; + attribute_group_name?: string; + attribute_id?: number; + attribute_label?: string; + attribute_options?: Array; + attribute_type?: string; + attribute_value?: string; + entity_type?: string; + used_in_product_listing?: boolean; +} + +export interface GQLAttributeWithValueOption { + label?: string; + swatch_data?: GQLAttributeWithValueSwatchData; + value?: string; +} + +export interface GQLAttributeWithValueSwatchData { + type?: string; + value?: string; +} + +export interface GQLProductStockItem { + + /** + * Product in stock status + */ + in_stock?: boolean; + + /** + * Maximal amount of item that can be bought + */ + max_sale_qty?: number; + + /** + * Minimal amount of item that can be bought + */ + min_sale_qty?: number; + + /** + * Product quantity available in stock + */ + qty?: number; + + /** + * Increment for number of items that can be bought + */ + qty_increments?: number; +} + +/** + * This enumeration states whether a product stock status is in stock or out of stock + */ +export enum GQLProductStockStatus { + IN_STOCK = 'IN_STOCK', + OUT_OF_STOCK = 'OUT_OF_STOCK' +} + +/** + * ProductTierPrices is deprecated and has been replaced by TierPrice. The + * ProductTierPrices object defines a tier price, which is a quantity discount + * offered to a specific customer group. + */ +export interface GQLProductTierPrices { + + /** + * The ID of the customer group. + * @deprecated customer_group_id is not relevant for storefront. + */ + customer_group_id?: string; + + /** + * The percentage discount of the item. + * @deprecated ProductTierPrices is deprecated. Use TierPrice.discount. + */ + percentage_value?: number; + + /** + * The number of items that must be purchased to qualify for tier pricing. + * @deprecated ProductTierPrices is deprecated, use TierPrice.quantity. + */ + qty?: number; + + /** + * The price of the fixed price item. + * @deprecated ProductTierPrices is deprecated. Use TierPrice.final_price + */ + value?: number; + + /** + * The ID assigned to the website. + * @deprecated website_id is not relevant for storefront. + */ + website_id?: number; +} + +/** + * The object contains URL rewrite details + */ +export interface GQLUrlRewrite { + + /** + * Request parameters + */ + parameters?: Array; + + /** + * Request URL + */ + url?: string; +} + +/** + * The object details of target path parameters + */ +export interface GQLHttpQueryParameter { + + /** + * Parameter name + */ + name?: string; + + /** + * Parameter value + */ + value?: string; +} + +/** + * Website is deprecated because it is should not be used on storefront. The type contains information about a website + */ +export interface GQLWebsite { + + /** + * A code assigned to the website to identify it + * @deprecated The field should not be used on the storefront. + */ + code?: string; + + /** + * The default group ID that the website has + * @deprecated The field should not be used on the storefront. + */ + default_group_id?: string; + + /** + * The ID number assigned to the website + * @deprecated The field should not be used on the storefront. + */ + id?: number; + + /** + * Specifies if this is the default website + * @deprecated The field should not be used on the storefront. + */ + is_default?: boolean; + + /** + * The website name. Websites use this name to identify it easier. + * @deprecated The field should not be used on the storefront. + */ + name?: string; + + /** + * The attribute to use for sorting websites + * @deprecated The field should not be used on the storefront. + */ + sort_order?: number; +} + +export interface GQLCartPrices { + applied_taxes?: Array; + + /** + * + * @deprecated Use discounts instead + */ + discount?: GQLCartDiscount; + + /** + * An array of applied discounts + */ + discounts?: Array; + grand_total?: GQLMoney; + subtotal_excluding_tax?: GQLMoney; + subtotal_including_tax?: GQLMoney; + subtotal_with_discount_excluding_tax?: GQLMoney; +} + +export interface GQLCartTaxItem { + amount: GQLMoney; + label: string; +} + +export interface GQLCartDiscount { + amount: GQLMoney; + label: Array; +} + +export interface GQLSelectedPaymentMethod { + + /** + * The payment method code + */ + code: string; + + /** + * The purchase order number. + */ + purchase_order_number?: string; + + /** + * The payment method title. + */ + title: string; +} + +export interface GQLShippingCartAddress extends GQLCartAddressInterface { + available_shipping_methods?: Array; + + /** + * + * @deprecated `cart_items_v2` should be used instead + */ + cart_items?: Array; + cart_items_v2?: Array; + city: string; + company?: string; + country: GQLCartAddressCountry; + customer_notes?: string; + firstname: string; + + /** + * + * @deprecated This information shoud not be exposed on frontend + */ + items_weight?: number; + lastname: string; + pickup_location_code?: string; + postcode?: string; + region?: GQLCartAddressRegion; + selected_shipping_method?: GQLSelectedShippingMethod; + street: Array; + telephone: string; +} + +export interface GQLAvailableShippingMethod { + amount: GQLMoney; + available: boolean; + + /** + * + * @deprecated The field should not be used on the storefront + */ + base_amount?: GQLMoney; + carrier_code: string; + carrier_title: string; + error_message?: string; + + /** + * Could be null if method is not available + */ + method_code?: string; + + /** + * Could be null if method is not available + */ + method_title?: string; + price_excl_tax: GQLMoney; + price_incl_tax: GQLMoney; +} + +/** + * Deprecated: `cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity` + */ +export interface GQLCartItemQuantity { + + /** + * + * @deprecated `cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity` + */ + cart_item_id: number; + + /** + * + * @deprecated `cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity` + */ + quantity: number; +} + +export interface GQLSelectedShippingMethod { + amount: GQLMoney; + + /** + * + * @deprecated The field should not be used on the storefront + */ + base_amount?: GQLMoney; + carrier_code: string; + carrier_title: string; + method_code: string; + method_title: string; +} + +/** + * CategoryFilterInput defines the filters to be used in the search. A filter + * contains at least one attribute, a comparison operator, and the value that is + * being searched for. + */ +export interface GQLCategoryFilterInput { + + /** + * Filter by the unique category ID for a `CategoryInterface` object. + */ + category_uid?: GQLFilterEqualTypeInput; + + /** + * Deprecated: use 'category_uid' to filter uniquely identifiers of categories. + */ + ids?: GQLFilterEqualTypeInput; + + /** + * Filter by the display name of the category. + */ + name?: GQLFilterMatchTypeInput; + + /** + * Filter by the unique parent category ID for a `CategoryInterface` object. + */ + parent_category_uid?: GQLFilterEqualTypeInput; + + /** + * Filter by the unique parent category ID for a `CategoryInterface` object. + */ + parent_id?: GQLFilterEqualTypeInput; + + /** + * Filter by the part of the URL that identifies the category. + */ + url_key?: GQLFilterEqualTypeInput; + + /** + * Filter by the URL path for the category. + */ + url_path?: GQLFilterEqualTypeInput; +} + +/** + * Defines a filter that matches the input exactly. + */ +export interface GQLFilterEqualTypeInput { + + /** + * A string to filter on + */ + eq?: string; + + /** + * An array of values to filter on + */ + in?: Array; +} + +/** + * Defines a filter that performs a fuzzy search. + */ +export interface GQLFilterMatchTypeInput { + + /** + * One or more words to filter on + */ + match?: string; +} + +/** + * A collection of CategoryTree objects and pagination information. + */ +export interface GQLCategoryResult { + + /** + * A list of categories that match the filter criteria. + */ + items?: Array; + + /** + * An object that includes the page_info and currentPage values specified in the query. + */ + page_info?: GQLSearchResultPageInfo; + + /** + * The total number of categories that match the criteria. + */ + total_count?: number; +} + +/** + * Category tree implementation + */ +export interface GQLCategoryTree extends GQLCategoryInterface, GQLRoutableInterface { + available_sort_by?: Array; + + /** + * Breadcrumbs, parent categories info. + */ + breadcrumbs?: Array; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Categories' is enabled + */ + canonical_url?: string; + + /** + * Child categories tree. + */ + children?: Array; + children_count?: string; + + /** + * Category CMS Block. + */ + cms_block?: GQLCmsBlock; + + /** + * Timestamp indicating when the category was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + custom_layout_update_file?: string; + + /** + * The attribute to use for sorting. + */ + default_sort_by?: string; + + /** + * An optional description of the category. + */ + description?: string; + + /** + * Category display mode (products only, static block only, both) + */ + display_mode?: string; + filter_price_range?: number; + + /** + * An ID that uniquely identifies the category. + * @deprecated Use the `uid` argument instead. + */ + id?: number; + image?: string; + include_in_menu?: number; + + /** + * Category is enabled + */ + is_active?: boolean; + is_anchor?: number; + landing_page?: number; + + /** + * Indicates the depth of the category within the tree. + */ + level?: number; + meta_description?: string; + meta_keywords?: string; + meta_title?: string; + + /** + * The display name of the category. + */ + name?: string; + + /** + * Category Path. + */ + path?: string; + + /** + * Category path in store. + */ + path_in_store?: string; + + /** + * The position of the category relative to other categories at the same level in tree. + */ + position?: number; + + /** + * The number of products in the category that are marked as visible. By default, + * in complex products, parent products are visible, but their child products are not. + */ + product_count?: number; + + /** + * The list of products assigned to the category. + */ + products?: GQLCategoryProducts; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * The unique ID for a `CategoryInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the category was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + url?: string; + + /** + * The url key assigned to the category. + */ + url_key?: string; + + /** + * The url path assigned to the category. + */ + url_path?: string; + + /** + * The part of the category URL that is appended after the url key + */ + url_suffix?: string; +} + +/** + * Routable entities serve as the model for a rendered page + */ +export interface GQLRoutableInterface { + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; +} + +/** Use this to resolve interface type RoutableInterface */ +export type GQLPossibleRoutableInterfaceTypeNames = +'CategoryTree' | +'CmsPage' | +'BundleProduct' | +'ConfigurableProduct' | +'SimpleProduct' | +'DownloadableProduct' | +'GroupedProduct' | +'VirtualProduct'; + +export interface GQLRoutableInterfaceNameMap { + RoutableInterface: GQLRoutableInterface; + CategoryTree: GQLCategoryTree; + CmsPage: GQLCmsPage; + BundleProduct: GQLBundleProduct; + ConfigurableProduct: GQLConfigurableProduct; + SimpleProduct: GQLSimpleProduct; + DownloadableProduct: GQLDownloadableProduct; + GroupedProduct: GQLGroupedProduct; + VirtualProduct: GQLVirtualProduct; +} + +/** + * This enumeration defines the entity type. + */ +export enum GQLUrlRewriteEntityTypeEnum { + CMS_PAGE = 'CMS_PAGE', + PRODUCT = 'PRODUCT', + CATEGORY = 'CATEGORY' +} + +export interface GQLChatData { + + /** + * API space id + */ + api_space_id?: string; + + /** + * Cookie name + */ + cookie_name?: string; + + /** + * Is chat enabled + */ + is_enabled?: boolean; +} + +/** + * Defines all Checkout Agreement information + */ +export interface GQLCheckoutAgreement { + + /** + * Checkout Agreement identifier + */ + agreement_id: number; + + /** + * Checkout Agreement checkbox text + */ + checkbox_text: string; + + /** + * Checkout Agreement content + */ + content: string; + + /** + * Checkout Agreement content height + */ + content_height?: string; + + /** + * Is Checkout Agreement content in HTML format + */ + is_html: boolean; + mode: GQLCheckoutAgreementMode; + + /** + * Checkout Agreement name + */ + name: string; +} + +export enum GQLCheckoutAgreementMode { + AUTO = 'AUTO', + MANUAL = 'MANUAL' +} + +/** + * CMS blocks information + */ +export interface GQLCmsBlocks { + + /** + * An array of CMS blocks + */ + items?: Array; +} + +/** + * CMS page defines all CMS page information + */ +export interface GQLCmsPage extends GQLRoutableInterface { + + /** + * CMS page content + */ + content?: string; + + /** + * CMS page content heading + */ + content_heading?: string; + + /** + * Identifier of the CMS page + */ + identifier?: string; + + /** + * CMS page meta description + */ + meta_description?: string; + + /** + * CMS page meta keywords + */ + meta_keywords?: string; + + /** + * CMS page meta title + */ + meta_title?: string; + + /** + * CMS page content heading + */ + page_layout?: string; + + /** + * CMS page width + */ + page_width?: string; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * CMS page title + */ + title?: string; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * URL key of CMS page + */ + url_key?: string; +} + +export interface GQLCompareList { + + /** + * An array of attributes that can be used for comparing products + */ + attributes?: Array; + + /** + * The number of items in the compare list + */ + item_count: number; + + /** + * An array of products to compare + */ + items?: Array; + + /** + * The unique ID assigned to the compare list + */ + uid: string; +} + +export interface GQLComparableAttribute { + + /** + * An attribute code that is enabled for product comparisons + */ + code: string; + + /** + * The label of the attribute code + */ + label: string; +} + +export interface GQLComparableItem { + + /** + * An array of product attributes that can be used to compare products + */ + attributes: Array; + + /** + * Contains details about a product in a compare list + */ + product: GQLProductInterface; + + /** + * The unique ID of an item in a compare list + */ + uid: string; +} + +export interface GQLProductAttribute { + + /** + * The unique identifier for a product attribute code. + */ + code: string; + + /** + * The display value of the attribute + */ + value: string; +} + +export interface GQLContactPageConfig { + enabled?: boolean; +} + +export interface GQLCountry { + available_regions?: Array; + full_name_english?: string; + full_name_locale?: string; + + /** + * The unique ID for a `Country` object. + */ + id?: string; + is_state_required?: boolean; + three_letter_abbreviation?: string; + two_letter_abbreviation?: string; +} + +export interface GQLRegion { + code?: string; + + /** + * The unique ID for a `Region` object. + */ + id?: number; + name?: string; +} + +export interface GQLCurrency { + available_currency_codes?: Array; + base_currency_code?: string; + base_currency_symbol?: string; + + /** + * + * @deprecated Symbol was missed. Use `default_display_currency_code`. + */ + default_display_currecy_code?: string; + + /** + * + * @deprecated Symbol was missed. Use `default_display_currency_symbol`. + */ + default_display_currecy_symbol?: string; + default_display_currency_code?: string; + default_display_currency_symbol?: string; + exchange_rates?: Array; + id?: string; + label?: string; + value?: string; +} + +export interface GQLExchangeRate { + currency_to?: string; + rate?: number; +} + +export interface GQLCurrencyConfig { + available_currencies_data?: Array; + current_currency_code?: string; +} + +/** + * AttributeInput specifies the attribute_code and entity_type to search + */ +export interface GQLAttributeInput { + + /** + * The unique identifier for an attribute code. This value should be in lowercase letters without spaces. + */ + attribute_code?: string; + + /** + * The type of entity that defines the attribute + */ + entity_type?: string; +} + +/** + * CustomAttributeMetadata defines an array of attribute_codes and entity_types + */ +export interface GQLCustomAttributeMetadata { + + /** + * An array of attributes + */ + items?: Array; +} + +/** + * Attribute contains the attribute_type of the specified attribute_code and entity_type + */ +export interface GQLAttribute { + + /** + * The unique identifier for an attribute code. This value should be in lowercase letters without spaces. + */ + attribute_code?: string; + + /** + * Attribute options list. + */ + attribute_options?: Array; + + /** + * The data type of the attribute + */ + attribute_type?: string; + + /** + * The type of entity that defines the attribute + */ + entity_type?: string; + + /** + * The frontend input type of the attribute + */ + input_type?: string; + + /** + * Contains details about the storefront properties configured for the attribute + */ + storefront_properties?: GQLStorefrontProperties; +} + +/** + * Attribute option. + */ +export interface GQLAttributeOption { + + /** + * Attribute option label. + */ + label?: string; + + /** + * Attribute option value. + */ + value?: string; +} + +export interface GQLStorefrontProperties { + + /** + * The relative position of the attribute in the layered navigation block + */ + position?: number; + + /** + * Indicates whether the attribute is filterable with results, without results, or not at all + */ + use_in_layered_navigation?: GQLUseInLayeredNavigationOptions; + + /** + * Indicates whether the attribute is displayed in product listings + */ + use_in_product_listing?: boolean; + + /** + * Indicates whether the attribute can be used in layered navigation on search results pages + */ + use_in_search_results_layered_navigation?: boolean; + + /** + * Indicates whether the attribute is displayed on product pages + */ + visible_on_catalog_pages?: boolean; +} + +export enum GQLUseInLayeredNavigationOptions { + NO = 'NO', + FILTERABLE_WITH_RESULTS = 'FILTERABLE_WITH_RESULTS', + FILTERABLE_NO_RESULT = 'FILTERABLE_NO_RESULT' +} + +/** + * Customer defines the customer name and address and other details + */ +export interface GQLCustomer { + + /** + * An array containing the customer's shipping and billing addresses + */ + addresses?: Array; + + /** + * Indicates whether the customer has enabled remote shopping assistance + */ + allow_remote_shopping_assistance: boolean; + + /** + * The contents of the customer's compare list + */ + compare_list?: GQLCompareList; + + /** + * Email confirmation is required + */ + confirmation_required?: boolean; + + /** + * Timestamp indicating when the account was created + */ + created_at?: string; + + /** + * The customer's date of birth + */ + date_of_birth?: string; + + /** + * The ID assigned to the billing address + */ + default_billing?: string; + + /** + * The ID assigned to the shipping address + */ + default_shipping?: string; + + /** + * The customer's date of birth + * @deprecated Use `date_of_birth` instead + */ + dob?: string; + + /** + * The customer's email address. Required + */ + email?: string; + + /** + * The customer's first name + */ + firstname?: string; + + /** + * The customer's gender (Male - 1, Female - 2) + */ + gender?: number; + + /** + * + * @deprecated Customer group should not be exposed in the storefront scenarios + */ + group_id?: number; + + /** + * The ID assigned to the customer + * @deprecated id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side. + */ + id?: number; + + /** + * Indicates whether the customer is subscribed to the company's newsletter + */ + is_subscribed?: boolean; + + /** + * The customer's family name + */ + lastname?: string; + + /** + * The customer's middle name + */ + middlename?: string; + orders?: GQLCustomerOrders; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * Contains the customer's product reviews + */ + reviews: GQLProductReviews; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The customer's Value-added tax (VAT) number (for corporate customers) + */ + taxvat?: string; + + /** + * Contains a customer's wish lists + * @deprecated Use `Customer.wishlists` or `Customer.wishlist_v2` + */ + wishlist: GQLWishlist; + + /** + * Retrieve the specified wish list identified by the unique ID for a `Wishlist` object + */ + wishlist_v2?: GQLWishlist; + + /** + * An array of wishlists. In Magento Open Source, customers are limited to one + * wish list. The number of wish lists is configurable for Magento Commerce + */ + wishlists: Array; +} + +/** + * CustomerAddress contains detailed information about a customer's billing and shipping addresses + */ +export interface GQLCustomerAddress { + + /** + * The city or town + */ + city?: string; + + /** + * The customer's company + */ + company?: string; + + /** + * The customer's country + */ + country_code?: GQLCountryCodeEnum; + + /** + * The customer's country + * @deprecated Use `country_code` instead. + */ + country_id?: string; + + /** + * + * @deprecated Custom attributes should not be put into container + */ + custom_attributes?: Array; + + /** + * The customer ID + * @deprecated customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses. + */ + customer_id?: number; + + /** + * Indicates whether the address is the default billing address + */ + default_billing?: boolean; + + /** + * Indicates whether the address is the default shipping address + */ + default_shipping?: boolean; + + /** + * Address extension attributes + */ + extension_attributes?: Array; + + /** + * The fax number + */ + fax?: string; + + /** + * The first name of the person associated with the shipping/billing address + */ + firstname?: string; + + /** + * The ID assigned to the address object + */ + id?: number; + + /** + * The family name of the person associated with the shipping/billing address + */ + lastname?: string; + + /** + * The middle name of the person associated with the shipping/billing address + */ + middlename?: string; + + /** + * The customer's ZIP or postal code + */ + postcode?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * An object containing the region name, region code, and region ID + */ + region?: GQLCustomerAddressRegion; + + /** + * The unique ID for a pre-defined region + */ + region_id?: number; + + /** + * An array of strings that define the street number and name + */ + street?: Array; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The telephone number + */ + telephone?: string; + + /** + * The customer's Value-added tax (VAT) number (for corporate customers) + */ + vat_id?: string; +} + +/** + * The list of countries codes + */ +export enum GQLCountryCodeEnum { + + /** + * Afghanistan + */ + AF = 'AF', + + /** + * Åland Islands + */ + AX = 'AX', + + /** + * Albania + */ + AL = 'AL', + + /** + * Algeria + */ + DZ = 'DZ', + + /** + * American Samoa + */ + AS = 'AS', + + /** + * Andorra + */ + AD = 'AD', + + /** + * Angola + */ + AO = 'AO', + + /** + * Anguilla + */ + AI = 'AI', + + /** + * Antarctica + */ + AQ = 'AQ', + + /** + * Antigua & Barbuda + */ + AG = 'AG', + + /** + * Argentina + */ + AR = 'AR', + + /** + * Armenia + */ + AM = 'AM', + + /** + * Aruba + */ + AW = 'AW', + + /** + * Australia + */ + AU = 'AU', + + /** + * Austria + */ + AT = 'AT', + + /** + * Azerbaijan + */ + AZ = 'AZ', + + /** + * Bahamas + */ + BS = 'BS', + + /** + * Bahrain + */ + BH = 'BH', + + /** + * Bangladesh + */ + BD = 'BD', + + /** + * Barbados + */ + BB = 'BB', + + /** + * Belarus + */ + BY = 'BY', + + /** + * Belgium + */ + BE = 'BE', + + /** + * Belize + */ + BZ = 'BZ', + + /** + * Benin + */ + BJ = 'BJ', + + /** + * Bermuda + */ + BM = 'BM', + + /** + * Bhutan + */ + BT = 'BT', + + /** + * Bolivia + */ + BO = 'BO', + + /** + * Bosnia & Herzegovina + */ + BA = 'BA', + + /** + * Botswana + */ + BW = 'BW', + + /** + * Bouvet Island + */ + BV = 'BV', + + /** + * Brazil + */ + BR = 'BR', + + /** + * British Indian Ocean Territory + */ + IO = 'IO', + + /** + * British Virgin Islands + */ + VG = 'VG', + + /** + * Brunei + */ + BN = 'BN', + + /** + * Bulgaria + */ + BG = 'BG', + + /** + * Burkina Faso + */ + BF = 'BF', + + /** + * Burundi + */ + BI = 'BI', + + /** + * Cambodia + */ + KH = 'KH', + + /** + * Cameroon + */ + CM = 'CM', + + /** + * Canada + */ + CA = 'CA', + + /** + * Cape Verde + */ + CV = 'CV', + + /** + * Cayman Islands + */ + KY = 'KY', + + /** + * Central African Republic + */ + CF = 'CF', + + /** + * Chad + */ + TD = 'TD', + + /** + * Chile + */ + CL = 'CL', + + /** + * China + */ + CN = 'CN', + + /** + * Christmas Island + */ + CX = 'CX', + + /** + * Cocos (Keeling) Islands + */ + CC = 'CC', + + /** + * Colombia + */ + CO = 'CO', + + /** + * Comoros + */ + KM = 'KM', + + /** + * Congo-Brazzaville + */ + CG = 'CG', + + /** + * Congo-Kinshasa + */ + CD = 'CD', + + /** + * Cook Islands + */ + CK = 'CK', + + /** + * Costa Rica + */ + CR = 'CR', + + /** + * Côte d’Ivoire + */ + CI = 'CI', + + /** + * Croatia + */ + HR = 'HR', + + /** + * Cuba + */ + CU = 'CU', + + /** + * Cyprus + */ + CY = 'CY', + + /** + * Czech Republic + */ + CZ = 'CZ', + + /** + * Denmark + */ + DK = 'DK', + + /** + * Djibouti + */ + DJ = 'DJ', + + /** + * Dominica + */ + DM = 'DM', + + /** + * Dominican Republic + */ + DO = 'DO', + + /** + * Ecuador + */ + EC = 'EC', + + /** + * Egypt + */ + EG = 'EG', + + /** + * El Salvador + */ + SV = 'SV', + + /** + * Equatorial Guinea + */ + GQ = 'GQ', + + /** + * Eritrea + */ + ER = 'ER', + + /** + * Estonia + */ + EE = 'EE', + + /** + * Ethiopia + */ + ET = 'ET', + + /** + * Falkland Islands + */ + FK = 'FK', + + /** + * Faroe Islands + */ + FO = 'FO', + + /** + * Fiji + */ + FJ = 'FJ', + + /** + * Finland + */ + FI = 'FI', + + /** + * France + */ + FR = 'FR', + + /** + * French Guiana + */ + GF = 'GF', + + /** + * French Polynesia + */ + PF = 'PF', + + /** + * French Southern Territories + */ + TF = 'TF', + + /** + * Gabon + */ + GA = 'GA', + + /** + * Gambia + */ + GM = 'GM', + + /** + * Georgia + */ + GE = 'GE', + + /** + * Germany + */ + DE = 'DE', + + /** + * Ghana + */ + GH = 'GH', + + /** + * Gibraltar + */ + GI = 'GI', + + /** + * Greece + */ + GR = 'GR', + + /** + * Greenland + */ + GL = 'GL', + + /** + * Grenada + */ + GD = 'GD', + + /** + * Guadeloupe + */ + GP = 'GP', + + /** + * Guam + */ + GU = 'GU', + + /** + * Guatemala + */ + GT = 'GT', + + /** + * Guernsey + */ + GG = 'GG', + + /** + * Guinea + */ + GN = 'GN', + + /** + * Guinea-Bissau + */ + GW = 'GW', + + /** + * Guyana + */ + GY = 'GY', + + /** + * Haiti + */ + HT = 'HT', + + /** + * Heard & McDonald Islands + */ + HM = 'HM', + + /** + * Honduras + */ + HN = 'HN', + + /** + * Hong Kong SAR China + */ + HK = 'HK', + + /** + * Hungary + */ + HU = 'HU', + + /** + * Iceland + */ + IS = 'IS', + + /** + * India + */ + IN = 'IN', + + /** + * Indonesia + */ + ID = 'ID', + + /** + * Iran + */ + IR = 'IR', + + /** + * Iraq + */ + IQ = 'IQ', + + /** + * Ireland + */ + IE = 'IE', + + /** + * Isle of Man + */ + IM = 'IM', + + /** + * Israel + */ + IL = 'IL', + + /** + * Italy + */ + IT = 'IT', + + /** + * Jamaica + */ + JM = 'JM', + + /** + * Japan + */ + JP = 'JP', + + /** + * Jersey + */ + JE = 'JE', + + /** + * Jordan + */ + JO = 'JO', + + /** + * Kazakhstan + */ + KZ = 'KZ', + + /** + * Kenya + */ + KE = 'KE', + + /** + * Kiribati + */ + KI = 'KI', + + /** + * Kuwait + */ + KW = 'KW', + + /** + * Kyrgyzstan + */ + KG = 'KG', + + /** + * Laos + */ + LA = 'LA', + + /** + * Latvia + */ + LV = 'LV', + + /** + * Lebanon + */ + LB = 'LB', + + /** + * Lesotho + */ + LS = 'LS', + + /** + * Liberia + */ + LR = 'LR', + + /** + * Libya + */ + LY = 'LY', + + /** + * Liechtenstein + */ + LI = 'LI', + + /** + * Lithuania + */ + LT = 'LT', + + /** + * Luxembourg + */ + LU = 'LU', + + /** + * Macau SAR China + */ + MO = 'MO', + + /** + * Macedonia + */ + MK = 'MK', + + /** + * Madagascar + */ + MG = 'MG', + + /** + * Malawi + */ + MW = 'MW', + + /** + * Malaysia + */ + MY = 'MY', + + /** + * Maldives + */ + MV = 'MV', + + /** + * Mali + */ + ML = 'ML', + + /** + * Malta + */ + MT = 'MT', + + /** + * Marshall Islands + */ + MH = 'MH', + + /** + * Martinique + */ + MQ = 'MQ', + + /** + * Mauritania + */ + MR = 'MR', + + /** + * Mauritius + */ + MU = 'MU', + + /** + * Mayotte + */ + YT = 'YT', + + /** + * Mexico + */ + MX = 'MX', + + /** + * Micronesia + */ + FM = 'FM', + + /** + * Moldova + */ + MD = 'MD', + + /** + * Monaco + */ + MC = 'MC', + + /** + * Mongolia + */ + MN = 'MN', + + /** + * Montenegro + */ + ME = 'ME', + + /** + * Montserrat + */ + MS = 'MS', + + /** + * Morocco + */ + MA = 'MA', + + /** + * Mozambique + */ + MZ = 'MZ', + + /** + * Myanmar (Burma) + */ + MM = 'MM', + + /** + * Namibia + */ + NA = 'NA', + + /** + * Nauru + */ + NR = 'NR', + + /** + * Nepal + */ + NP = 'NP', + + /** + * Netherlands + */ + NL = 'NL', + + /** + * Netherlands Antilles + */ + AN = 'AN', + + /** + * New Caledonia + */ + NC = 'NC', + + /** + * New Zealand + */ + NZ = 'NZ', + + /** + * Nicaragua + */ + NI = 'NI', + + /** + * Niger + */ + NE = 'NE', + + /** + * Nigeria + */ + NG = 'NG', + + /** + * Niue + */ + NU = 'NU', + + /** + * Norfolk Island + */ + NF = 'NF', + + /** + * Northern Mariana Islands + */ + MP = 'MP', + + /** + * North Korea + */ + KP = 'KP', + + /** + * Norway + */ + NO = 'NO', + + /** + * Oman + */ + OM = 'OM', + + /** + * Pakistan + */ + PK = 'PK', + + /** + * Palau + */ + PW = 'PW', + + /** + * Palestinian Territories + */ + PS = 'PS', + + /** + * Panama + */ + PA = 'PA', + + /** + * Papua New Guinea + */ + PG = 'PG', + + /** + * Paraguay + */ + PY = 'PY', + + /** + * Peru + */ + PE = 'PE', + + /** + * Philippines + */ + PH = 'PH', + + /** + * Pitcairn Islands + */ + PN = 'PN', + + /** + * Poland + */ + PL = 'PL', + + /** + * Portugal + */ + PT = 'PT', + + /** + * Qatar + */ + QA = 'QA', + + /** + * Réunion + */ + RE = 'RE', + + /** + * Romania + */ + RO = 'RO', + + /** + * Russia + */ + RU = 'RU', + + /** + * Rwanda + */ + RW = 'RW', + + /** + * Samoa + */ + WS = 'WS', + + /** + * San Marino + */ + SM = 'SM', + + /** + * São Tomé & Príncipe + */ + ST = 'ST', + + /** + * Saudi Arabia + */ + SA = 'SA', + + /** + * Senegal + */ + SN = 'SN', + + /** + * Serbia + */ + RS = 'RS', + + /** + * Seychelles + */ + SC = 'SC', + + /** + * Sierra Leone + */ + SL = 'SL', + + /** + * Singapore + */ + SG = 'SG', + + /** + * Slovakia + */ + SK = 'SK', + + /** + * Slovenia + */ + SI = 'SI', + + /** + * Solomon Islands + */ + SB = 'SB', + + /** + * Somalia + */ + SO = 'SO', + + /** + * South Africa + */ + ZA = 'ZA', + + /** + * South Georgia & South Sandwich Islands + */ + GS = 'GS', + + /** + * South Korea + */ + KR = 'KR', + + /** + * Spain + */ + ES = 'ES', + + /** + * Sri Lanka + */ + LK = 'LK', + + /** + * St. Barthélemy + */ + BL = 'BL', + + /** + * St. Helena + */ + SH = 'SH', + + /** + * St. Kitts & Nevis + */ + KN = 'KN', + + /** + * St. Lucia + */ + LC = 'LC', + + /** + * St. Martin + */ + MF = 'MF', + + /** + * St. Pierre & Miquelon + */ + PM = 'PM', + + /** + * St. Vincent & Grenadines + */ + VC = 'VC', + + /** + * Sudan + */ + SD = 'SD', + + /** + * Suriname + */ + SR = 'SR', + + /** + * Svalbard & Jan Mayen + */ + SJ = 'SJ', + + /** + * Swaziland + */ + SZ = 'SZ', + + /** + * Sweden + */ + SE = 'SE', + + /** + * Switzerland + */ + CH = 'CH', + + /** + * Syria + */ + SY = 'SY', + + /** + * Taiwan + */ + TW = 'TW', + + /** + * Tajikistan + */ + TJ = 'TJ', + + /** + * Tanzania + */ + TZ = 'TZ', + + /** + * Thailand + */ + TH = 'TH', + + /** + * Timor-Leste + */ + TL = 'TL', + + /** + * Togo + */ + TG = 'TG', + + /** + * Tokelau + */ + TK = 'TK', + + /** + * Tonga + */ + TO = 'TO', + + /** + * Trinidad & Tobago + */ + TT = 'TT', + + /** + * Tunisia + */ + TN = 'TN', + + /** + * Turkey + */ + TR = 'TR', + + /** + * Turkmenistan + */ + TM = 'TM', + + /** + * Turks & Caicos Islands + */ + TC = 'TC', + + /** + * Tuvalu + */ + TV = 'TV', + + /** + * Uganda + */ + UG = 'UG', + + /** + * Ukraine + */ + UA = 'UA', + + /** + * United Arab Emirates + */ + AE = 'AE', + + /** + * United Kingdom + */ + GB = 'GB', + + /** + * United States + */ + US = 'US', + + /** + * Uruguay + */ + UY = 'UY', + + /** + * U.S. Outlying Islands + */ + UM = 'UM', + + /** + * U.S. Virgin Islands + */ + VI = 'VI', + + /** + * Uzbekistan + */ + UZ = 'UZ', + + /** + * Vanuatu + */ + VU = 'VU', + + /** + * Vatican City + */ + VA = 'VA', + + /** + * Venezuela + */ + VE = 'VE', + + /** + * Vietnam + */ + VN = 'VN', + + /** + * Wallis & Futuna + */ + WF = 'WF', + + /** + * Western Sahara + */ + EH = 'EH', + + /** + * Yemen + */ + YE = 'YE', + + /** + * Zambia + */ + ZM = 'ZM', + + /** + * Zimbabwe + */ + ZW = 'ZW' +} + +export interface GQLCustomerAddressAttribute { + + /** + * Attribute code + */ + attribute_code?: string; + + /** + * Attribute value + */ + value?: string; +} + +/** + * CustomerAddressRegion defines the customer's state or province + */ +export interface GQLCustomerAddressRegion { + + /** + * The state or province name + */ + region?: string; + + /** + * The address region code + */ + region_code?: string; + + /** + * The unique ID for a pre-defined region + */ + region_id?: number; +} + +/** + * Identifies the filter to use for filtering orders. + */ +export interface GQLCustomerOrdersFilterInput { + + /** + * Filters by order entity id. + */ + entity_id?: GQLFilterStringTypeInput; + + /** + * Filters by order number. + */ + number?: GQLFilterStringTypeInput; +} + +/** + * Defines a filter for an input string. + */ +export interface GQLFilterStringTypeInput { + + /** + * Filters items that are exactly the same as the specified string. + */ + eq?: string; + + /** + * Filters items that are exactly the same as entries specified in an array of strings. + */ + in?: Array; + + /** + * Defines a filter that performs a fuzzy search using the specified string. + */ + match?: string; +} + +/** + * The collection of orders that match the conditions defined in the filter + */ +export interface GQLCustomerOrders { + + /** + * An array of customer orders + */ + items: Array; + + /** + * An object that includes the current_page, page_info, and page_size values specified in the query + */ + page_info?: GQLSearchResultPageInfo; + + /** + * The total count of customer orders + */ + total_count?: number; +} + +/** + * Contains details about each of the customer's orders + */ +export interface GQLCustomerOrder { + + /** + * The billing address for the order + */ + billing_address?: GQLOrderAddress; + + /** + * Defines if order can be reordered + */ + can_reorder: boolean; + + /** + * The shipping carrier for the order delivery + */ + carrier?: string; + + /** + * Comments about the order + */ + comments?: Array; + + /** + * + * @deprecated Use the order_date attribute instead + */ + created_at?: string; + + /** + * A list of credit memos + */ + credit_memos?: Array; + + /** + * The entered gift message for the order + */ + gift_message?: GQLGiftMessage; + + /** + * + * @deprecated Use the totals.grand_total attribute instead + */ + grand_total?: number; + + /** + * The unique ID for a `CustomerOrder` object + */ + id: string; + + /** + * + * @deprecated Use the id attribute instead + */ + increment_id?: string; + + /** + * A list of invoices for the order + */ + invoices: Array; + + /** + * An array containing the items purchased in this order + */ + items?: Array; + + /** + * The order number + */ + number: string; + + /** + * The date the order was placed + */ + order_date: string; + + /** + * + * @deprecated Use the number attribute instead + */ + order_number: string; + + /** + * Payment details for the order + */ + payment_methods?: Array; + + /** + * Represents rss link to subscribe on order status + */ + rss_link?: string; + + /** + * A list of shipments for the order + */ + shipments?: Array; + + /** + * The shipping address for the order + */ + shipping_address?: GQLOrderAddress; + + /** + * The delivery method for the order + */ + shipping_method?: string; + + /** + * The current status of the order + */ + status: string; + + /** + * Contains details about the calculated totals for this order + */ + total?: GQLOrderTotal; +} + +/** + * OrderAddress contains detailed information about an order's billing and shipping addresses + */ +export interface GQLOrderAddress { + + /** + * The city or town + */ + city: string; + + /** + * The customer's company + */ + company?: string; + + /** + * The customer's country + */ + country_code?: GQLCountryCodeEnum; + + /** + * The customer's country + */ + country_id?: GQLCountryCodeEnum; + + /** + * The fax number + */ + fax?: string; + + /** + * The first name of the person associated with the shipping/billing address + */ + firstname: string; + + /** + * The family name of the person associated with the shipping/billing address + */ + lastname: string; + + /** + * The middle name of the person associated with the shipping/billing address + */ + middlename?: string; + + /** + * The customer's order ZIP or postal code + */ + postcode?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * The state or province name + */ + region?: string; + + /** + * The unique ID for a `Region` object of a pre-defined region + */ + region_id?: string; + + /** + * An array of strings that define the street number and name + */ + street: Array; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The telephone number + */ + telephone: string; + + /** + * The customer's Value-added tax (VAT) number (for corporate customers) + */ + vat_id?: string; +} + +/** + * Comment item details + */ +export interface GQLSalesCommentItem { + + /** + * The text of the message + */ + message: string; + + /** + * The timestamp of the comment + */ + timestamp: string; +} + +/** + * Credit memo details + */ +export interface GQLCreditMemo { + + /** + * Comments on the credit memo + */ + comments?: Array; + + /** + * The unique ID for a `CreditMemo` object + */ + id: string; + + /** + * An array containing details about refunded items + */ + items?: Array; + + /** + * The sequential credit memo number + */ + number: string; + + /** + * Contains details about the total refunded amount + */ + total?: GQLCreditMemoTotal; +} + +/** + * Credit memo item details + */ +export interface GQLCreditMemoItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `CreditMemoItemInterface` object + */ + id: string; + + /** + * The order item the credit memo is applied to + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** Use this to resolve interface type CreditMemoItemInterface */ +export type GQLPossibleCreditMemoItemInterfaceTypeNames = +'BundleCreditMemoItem' | +'CreditMemoItem' | +'DownloadableCreditMemoItem'; + +export interface GQLCreditMemoItemInterfaceNameMap { + CreditMemoItemInterface: GQLCreditMemoItemInterface; + BundleCreditMemoItem: GQLBundleCreditMemoItem; + CreditMemoItem: GQLCreditMemoItem; + DownloadableCreditMemoItem: GQLDownloadableCreditMemoItem; +} + +/** + * Order item details + */ +export interface GQLOrderItemInterface { + + /** + * The final discount information for the product + */ + discounts?: Array; + + /** + * The entered option for the base product, such as a logo or image + */ + entered_options?: Array; + + /** + * The unique ID for a `OrderItemInterface` object + */ + id: string; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price of the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The type of product, such as simple, configurable, etc. + */ + product_type?: string; + + /** + * URL key of the base product + */ + product_url_key?: string; + + /** + * The number of canceled items + */ + quantity_canceled?: number; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The number of units ordered for this item + */ + quantity_ordered?: number; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The number of returned items + */ + quantity_returned?: number; + + /** + * The number of shipped items + */ + quantity_shipped?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; + + /** + * The selected options for the base product, such as color or size + */ + selected_options?: Array; + + /** + * The status of the order item + */ + status?: string; +} + +/** Use this to resolve interface type OrderItemInterface */ +export type GQLPossibleOrderItemInterfaceTypeNames = +'BundleOrderItem' | +'DownloadableOrderItem' | +'OrderItem'; + +export interface GQLOrderItemInterfaceNameMap { + OrderItemInterface: GQLOrderItemInterface; + BundleOrderItem: GQLBundleOrderItem; + DownloadableOrderItem: GQLDownloadableOrderItem; + OrderItem: GQLOrderItem; +} + +/** + * Represents order item options like selected or entered + */ +export interface GQLOrderItemOption { + items?: Array; + + /** + * The name of the option + */ + label: string; + linkItems?: Array; + + /** + * The value of the option + */ + value?: string; +} + +export interface GQLBundleOption { + option_id?: number; + price?: number; + qty?: number; + selection_details?: Array; + title?: string; +} + +export interface GQLBundleOptionSelection { + final_option_price?: number; + final_option_price_excl_tax?: number; + name?: string; + regular_option_price?: number; + regular_option_price_excl_tax?: number; + selection_id?: number; +} + +/** + * Credit memo price details + */ +export interface GQLCreditMemoTotal { + + /** + * An adjustment manually applied to the order + */ + adjustment: GQLMoney; + + /** + * The final base grand total amount in the base currency + */ + base_grand_total: GQLMoney; + + /** + * The applied discounts to the credit memo + */ + discounts?: Array; + + /** + * The final total amount, including shipping, discounts, and taxes + */ + grand_total: GQLMoney; + + /** + * Contains details about the shipping and handling costs for the credit memo + */ + shipping_handling?: GQLShippingHandling; + + /** + * The subtotal of the invoice, excluding shipping, discounts, and taxes + */ + subtotal: GQLMoney; + + /** + * The credit memo tax details + */ + taxes?: Array; + + /** + * The shipping amount for the credit memo + */ + total_shipping: GQLMoney; + + /** + * The amount of tax applied to the credit memo + */ + total_tax: GQLMoney; +} + +/** + * The Shipping handling details + */ +export interface GQLShippingHandling { + + /** + * The shipping amount, excluding tax + */ + amount_excluding_tax?: GQLMoney; + + /** + * The shipping amount, including tax + */ + amount_including_tax?: GQLMoney; + + /** + * The applied discounts to the shipping + */ + discounts?: Array; + + /** + * Contains details about taxes applied for shipping + */ + taxes?: Array; + + /** + * The total amount for shipping + */ + total_amount: GQLMoney; +} + +/** + * Defines an individual shipping discount. This discount can be applied to shipping. + */ +export interface GQLShippingDiscount { + + /** + * The amount of the discount + */ + amount: GQLMoney; +} + +/** + * The tax item details + */ +export interface GQLTaxItem { + + /** + * The amount of tax applied to the item + */ + amount: GQLMoney; + + /** + * The rate used to calculate the tax + */ + rate: number; + + /** + * A title that describes the tax + */ + title: string; +} + +/** + * Invoice details + */ +export interface GQLInvoice { + + /** + * Comments on the invoice + */ + comments?: Array; + + /** + * The unique ID for a `Invoice` object + */ + id: string; + + /** + * Invoiced product details + */ + items?: Array; + + /** + * Sequential invoice number + */ + number: string; + + /** + * Invoice total amount details + */ + total?: GQLInvoiceTotal; +} + +/** + * Invoice item details + */ +export interface GQLInvoiceItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `InvoiceItemInterface` object + */ + id: string; + + /** + * Contains details about an individual order item + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** Use this to resolve interface type InvoiceItemInterface */ +export type GQLPossibleInvoiceItemInterfaceTypeNames = +'BundleInvoiceItem' | +'DownloadableInvoiceItem' | +'InvoiceItem'; + +export interface GQLInvoiceItemInterfaceNameMap { + InvoiceItemInterface: GQLInvoiceItemInterface; + BundleInvoiceItem: GQLBundleInvoiceItem; + DownloadableInvoiceItem: GQLDownloadableInvoiceItem; + InvoiceItem: GQLInvoiceItem; +} + +/** + * Contains price details from an invoice + */ +export interface GQLInvoiceTotal { + + /** + * The final base grand total amount in the base currency + */ + base_grand_total: GQLMoney; + + /** + * The applied discounts to the invoice + */ + discounts?: Array; + + /** + * The final total amount, including shipping, discounts, and taxes + */ + grand_total: GQLMoney; + + /** + * Contains details about the shipping and handling costs for the invoice + */ + shipping_handling?: GQLShippingHandling; + + /** + * The subtotal of the invoice, excluding shipping, discounts, and taxes + */ + subtotal: GQLMoney; + + /** + * The invoice tax details + */ + taxes?: Array; + + /** + * The shipping amount for the invoice + */ + total_shipping: GQLMoney; + + /** + * The amount of tax applied to the invoice + */ + total_tax: GQLMoney; +} + +/** + * Contains details about the payment method used to pay for the order + */ +export interface GQLOrderPaymentMethod { + + /** + * Additional data per payment method type + */ + additional_data?: Array; + + /** + * The label that describes the payment method + */ + name: string; + + /** + * Defines order purchase number + */ + purchase_number?: string; + + /** + * The payment method code that indicates how the order was paid for + */ + type: string; +} + +/** + * The key-value type + */ +export interface GQLKeyValue { + + /** + * The name part of the name/value pair + */ + name?: string; + + /** + * The value part of the name/value pair + */ + value?: string; +} + +/** + * Order shipment details + */ +export interface GQLOrderShipment { + + /** + * Comments added to the shipment + */ + comments?: Array; + + /** + * The unique ID for a `OrderShipment` object + */ + id: string; + + /** + * Contains items included in the shipment + */ + items?: Array; + + /** + * The sequential credit shipment number + */ + number: string; + + /** + * Contains shipment tracking details + */ + tracking?: Array; +} + +/** + * Order shipment item details + */ +export interface GQLShipmentItemInterface { + + /** + * The unique ID for a `ShipmentItemInterface` object + */ + id: string; + + /** + * Associated order item + */ + order_item?: GQLOrderItemInterface; + + /** + * Name of the base product + */ + product_name?: string; + + /** + * Sale price for the base product + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * Number of shipped items + */ + quantity_shipped: number; +} + +/** Use this to resolve interface type ShipmentItemInterface */ +export type GQLPossibleShipmentItemInterfaceTypeNames = +'BundleShipmentItem' | +'ShipmentItem'; + +export interface GQLShipmentItemInterfaceNameMap { + ShipmentItemInterface: GQLShipmentItemInterface; + BundleShipmentItem: GQLBundleShipmentItem; + ShipmentItem: GQLShipmentItem; +} + +/** + * Order shipment tracking details + */ +export interface GQLShipmentTracking { + + /** + * The shipping carrier for the order delivery + */ + carrier: string; + + /** + * The tracking number of the order shipment + */ + number?: string; + + /** + * The shipment tracking title + */ + title: string; +} + +/** + * Contains details about the sales total amounts used to calculate the final price + */ +export interface GQLOrderTotal { + + /** + * The final base grand total amount in the base currency + */ + base_grand_total: GQLMoney; + + /** + * The applied discounts to the order + */ + discounts?: Array; + + /** + * The final total amount, including shipping, discounts, and taxes + */ + grand_total: GQLMoney; + + /** + * Contains details about the shipping and handling costs for the order + */ + shipping_handling?: GQLShippingHandling; + + /** + * The subtotal of the order, excluding shipping, discounts, and taxes + */ + subtotal: GQLMoney; + + /** + * The order tax details + */ + taxes?: Array; + + /** + * The shipping amount for the order + */ + total_shipping: GQLMoney; + + /** + * The amount of tax applied to the order + */ + total_tax: GQLMoney; +} + +export interface GQLWishlist { + + /** + * The unique ID for a `Wishlist` object + */ + id?: string; + + /** + * + * @deprecated Use field `items_v2` from type `Wishlist` instead + */ + items?: Array; + + /** + * The number of items in the wish list + */ + items_count?: number; + + /** + * An array of items in the customer's wish list + */ + items_v2?: GQLWishlistItems; + + /** + * An encrypted code that Magento uses to link to the wish list + */ + sharing_code?: string; + + /** + * The time of the last modification to the wish list + */ + updated_at?: string; +} + +export interface GQLWishlistItem { + + /** + * The time when the customer added the item to the wish list + */ + added_at?: string; + + /** + * Configurations to place order with selected options + */ + buy_request?: string; + + /** + * The customer's comment about this item + */ + description?: string; + + /** + * The unique ID for a `WishlistItem` object + */ + id?: number; + options?: Array; + + /** + * Product price based on selected options + */ + price?: number; + + /** + * Product price without tax based on selected options + */ + price_without_tax?: number; + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + qty?: number; + + /** + * The wish list item's SKU + */ + sku?: string; +} + +export interface GQLWishlistItemOption { + label?: string; + value?: string; +} + +export interface GQLWishlistItems { + + /** + * A list of items in the wish list + */ + items: Array; + + /** + * Contains pagination metadata + */ + page_info?: GQLSearchResultPageInfo; +} + +export interface GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +/** Use this to resolve interface type WishlistItemInterface */ +export type GQLPossibleWishlistItemInterfaceTypeNames = +'BundleWishlistItem' | +'ConfigurableWishlistItem' | +'DownloadableWishlistItem' | +'GroupedProductWishlistItem' | +'SimpleWishlistItem' | +'VirtualWishlistItem'; + +export interface GQLWishlistItemInterfaceNameMap { + WishlistItemInterface: GQLWishlistItemInterface; + BundleWishlistItem: GQLBundleWishlistItem; + ConfigurableWishlistItem: GQLConfigurableWishlistItem; + DownloadableWishlistItem: GQLDownloadableWishlistItem; + GroupedProductWishlistItem: GQLGroupedProductWishlistItem; + SimpleWishlistItem: GQLSimpleWishlistItem; + VirtualWishlistItem: GQLVirtualWishlistItem; +} + +export interface GQLSelectedCustomizableOption { + + /** + * The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, + * `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects + */ + customizable_option_uid: string; + + /** + * + * @deprecated Use SelectedCustomizableOption.customizable_option_uid instead + */ + id: number; + is_required: boolean; + label: string; + sort_order: number; + type: string; + values: Array; +} + +export interface GQLSelectedCustomizableOptionValue { + + /** + * The unique ID for a `CustomizableMultipleValue`, `CustomizableRadioValue`, + * `CustomizableCheckboxValue`, `CustomizableDropDownValue`, etc. objects + */ + customizable_option_value_uid: string; + + /** + * + * @deprecated Use SelectedCustomizableOptionValue.customizable_option_value_uid instead + */ + id: number; + label: string; + price: GQLCartItemSelectedOptionValuePrice; + value: string; +} + +export interface GQLCartItemSelectedOptionValuePrice { + type: GQLPriceTypeEnum; + units: string; + value: number; +} + +/** + * This enumeration the price type. + */ +export enum GQLPriceTypeEnum { + FIXED = 'FIXED', + PERCENT = 'PERCENT', + DYNAMIC = 'DYNAMIC' +} + +export interface GQLCustomerDownloadableProducts { + + /** + * List of purchased downloadable items + */ + items?: Array; +} + +export interface GQLCustomerDownloadableProduct { + date?: string; + download_url?: string; + link_title?: string; + order_id?: number; + order_increment_id?: string; + remaining_downloads?: string; + status?: string; + title?: string; +} + +export interface GQLCustomerPaymentTokens { + + /** + * An array of payment tokens + */ + items: Array; +} + +/** + * The stored payment method available to the customer + */ +export interface GQLPaymentToken { + + /** + * Stored account details + */ + details?: string; + + /** + * The payment method code associated with the token + */ + payment_method_code: string; + + /** + * The public hash of the token + */ + public_hash: string; + type: GQLPaymentTokenTypeEnum; +} + +/** + * The list of available payment token types + */ +export enum GQLPaymentTokenTypeEnum { + card = 'card', + account = 'account' +} + +export interface GQLIsConfigSettingEnabledOutput { + + /** + * Is config setting enabled + */ + is_enabled?: boolean; +} + +export interface GQLBraintree { + is_three_d_secure?: boolean; +} + +export interface GQLCartDisplayConfig { + display_full_tax_summary?: boolean; + display_tax_in_price?: string; + display_tax_in_shipping_amount?: string; + display_tax_in_subtotal?: string; + display_zero_tax_subtotal?: boolean; + include_tax_in_order_total?: boolean; +} + +export interface GQLQuoteData extends GQLTotalsObject { + applied_rule_ids?: string; + applied_taxes?: Array; + base_currency_code?: string; + base_discount_amount?: number; + base_grand_total?: number; + base_shipping_amount?: number; + base_shipping_discount_amount?: number; + base_shipping_incl_tax?: number; + base_shipping_tax_amount?: number; + base_subtotal?: number; + base_subtotal_with_discount?: number; + base_tax_amount?: number; + coupon_code?: string; + customer_is_guest?: boolean; + customer_tax_class_id?: number; + discount_amount?: number; + grand_total?: number; + id?: string; + is_in_store_pickup_available?: boolean; + is_virtual?: boolean; + items?: Array; + items_count?: number; + items_qty?: number; + quote_currency_code?: string; + shipping_amount?: number; + shipping_discount_amount?: number; + shipping_incl_tax?: number; + shipping_method?: string; + shipping_tax_amount?: number; + store_id?: number; + subtotal?: number; + subtotal_incl_tax?: number; + subtotal_with_discount?: number; + tax_amount?: number; + weee_tax_applied_amount?: number; +} + +export interface GQLTotalsObject { + applied_rule_ids?: string; + base_currency_code?: string; + base_discount_amount?: number; + base_grand_total?: number; + base_shipping_amount?: number; + base_shipping_discount_amount?: number; + base_shipping_incl_tax?: number; + base_shipping_tax_amount?: number; + base_subtotal?: number; + base_subtotal_with_discount?: number; + base_tax_amount?: number; + coupon_code?: string; + customer_is_guest?: boolean; + customer_tax_class_id?: number; + discount_amount?: number; + grand_total?: number; + is_in_store_pickup_available?: boolean; + items?: Array; + items_count?: number; + items_qty?: number; + quote_currency_code?: string; + shipping_amount?: number; + shipping_discount_amount?: number; + shipping_incl_tax?: number; + shipping_method?: string; + shipping_tax_amount?: number; + store_id?: number; + subtotal?: number; + subtotal_incl_tax?: number; + subtotal_with_discount?: number; + tax_amount?: number; + weee_tax_applied_amount?: number; +} + +/** Use this to resolve interface type TotalsObject */ +export type GQLPossibleTotalsObjectTypeNames = 'QuoteData' | 'PaymentTotals'; + +export interface GQLTotalsObjectNameMap { + TotalsObject: GQLTotalsObject; + QuoteData: GQLQuoteData; + PaymentTotals: GQLPaymentTotals; +} + +export interface GQLTotalsItem { + base_discount_amount?: number; + base_price?: number; + base_price_incl_tax?: number; + base_row_total?: number; + base_row_total_incl_tax?: number; + base_tax_amount?: number; + bundle_options?: Array; + customizable_options?: Array; + discount_amount?: number; + discount_percent?: number; + downloadable_links?: Array; + item_id?: number; + name?: string; + options?: string; + price?: number; + price_incl_tax?: number; + product?: GQLProductInterface; + qty?: number; + row_total?: number; + row_total_incl_tax?: number; + row_total_with_discount?: number; + sku?: string; + tax_amount?: number; + tax_percent?: number; + weee_tax_applied?: number; + weee_tax_applied_amount?: number; +} + +export interface GQLSelectedBundleOption { + + /** + * + * @deprecated Use `uid` instead + */ + id: number; + label: string; + type: string; + + /** + * The unique ID for a `SelectedBundleOption` object + */ + uid: string; + values: Array; +} + +export interface GQLSelectedBundleOptionValue { + + /** + * Use `uid` instead + */ + id: number; + label: string; + price: number; + quantity: number; + + /** + * The unique ID for a `SelectedBundleOptionValue` object + */ + uid: string; +} + +export interface GQLSelectedDownloadableLinks { + id?: number; + label?: string; +} + +export interface GQLAppliedTaxItem { + amount?: number; + percent?: number; + rates?: Array; +} + +export interface GQLAppliedTaxItemRate { + percent?: number; + title?: string; +} + +/** + * The required input to request the secure URL for Payments Pro Hosted Solution payment. + */ +export interface GQLHostedProUrlInput { + + /** + * The unique ID that identifies the customer's cart + */ + cart_id: string; +} + +/** + * Contains secure URL used for Payments Pro Hosted Solution payment method. + */ +export interface GQLHostedProUrl { + + /** + * Secure Url generated by PayPal + */ + secure_form_url?: string; +} + +/** + * Contains details about the requested order + */ +export interface GQLOrder { + base_order_info?: GQLBaseOrderInfo; + + /** + * An array containing the items purchased in this order + */ + items?: Array; + + /** + * + * @deprecated The order_id field is deprecated, use order_number instead. + */ + order_id?: string; + + /** + * The unique ID for a `Order` object. + */ + order_number: string; + order_products?: Array; + payment_info?: GQLPaymentInfo; + shipping_info?: GQLShippingInfo; + + /** + * Contains the calculated total for this order + */ + total?: string; +} + +export interface GQLBaseOrderInfo { + created_at?: string; + currency_code?: string; + grand_total?: number; + id?: number; + increment_id?: string; + status?: string; + status_label?: string; + sub_total?: number; + total_qty_ordered?: number; +} + +export interface GQLPaymentInfo { + additional_information?: GQLAdditionalCustomerInfo; + cc_last_4?: string; + cc_owner?: string; + cc_type?: string; + method?: string; +} + +export interface GQLAdditionalCustomerInfo { + bank?: string; + credit_type?: string; + customer_info?: GQLCreditCustomerInfo; + method_title?: string; + month?: number; +} + +export interface GQLCreditCustomerInfo { + first_name?: string; + iin_number?: string; + last_name?: string; + middle_name?: string; + phone?: string; +} + +export interface GQLShippingInfo { + shipping_address?: GQLOrderCustomerAddress; + shipping_amount?: number; + shipping_description?: string; + shipping_incl_tax?: number; + shipping_method?: string; + tracking_numbers?: Array; +} + +export interface GQLOrderCustomerAddress { + apartment_number?: string; + city?: string; + company?: string; + country_id?: string; + customer_id?: number; + district?: string; + firstname?: string; + house_number?: string; + id?: number; + is_b2b?: string; + lastname?: string; + middlename?: string; + organizationaddress?: string; + organizationbik?: string; + organizationbin?: string; + organizationiic?: string; + organizationname?: string; + post_office_code?: string; + postcode?: string; + postomat_code?: string; + prefix?: string; + region?: string; + store_pickup_code?: string; + street?: string; + telephone?: string; +} + +export interface GQLOrderList { + items?: Array; +} + +/** + * Input required to fetch payment token information for Payflow Link and Payments Advanced payment methods. + */ +export interface GQLPayflowLinkTokenInput { + + /** + * The unique ID that identifies the customer's cart + */ + cart_id: string; +} + +/** + * Contains information used to generate PayPal iframe for transaction. Applies to + * Payflow Link and Payments Advanced payment methods. + */ +export interface GQLPayflowLinkToken { + + /** + * Mode for Payflow transaction + */ + mode?: GQLPayflowLinkMode; + + /** + * PayPal URL used for requesting Payflow form + */ + paypal_url?: string; + + /** + * Secure token generated by PayPal + */ + secure_token?: string; + + /** + * Secure token ID generated by PayPal + */ + secure_token_id?: string; +} + +/** + * Mode for payment: TEST or LIVE. Applies to Payflow Link and Payments Advanced payment methods. + */ +export enum GQLPayflowLinkMode { + TEST = 'TEST', + LIVE = 'LIVE' +} + +export interface GQLPaymentMethod { + code?: string; + title?: string; +} + +/** + * Product Information used for Pickup Locations search. + */ +export interface GQLProductInfoInput { + + /** + * Product SKU. + */ + sku: string; +} + +export interface GQLStores { + stores?: Array; +} + +export interface GQLStore { + city?: string; + country?: string; + description?: string; + name?: string; + phone?: string; + pickup_location_code?: string; + postcode?: string; + region?: string; + street?: string; +} + +export interface GQLIsEmailAvailableOutput { + + /** + * Is email availabel value + */ + is_email_available?: boolean; +} + +/** + * AreaInput defines the parameters which will be used for filter by specified location. + */ +export interface GQLAreaInput { + + /** + * The radius for the search in KM. + */ + radius: number; + + /** + * The country code where search must be performed. Required parameter together with region, city or postcode. + */ + search_term: string; +} + +/** + * PickupLocationFilterInput defines the list of attributes and filters for the search. + */ +export interface GQLPickupLocationFilterInput { + + /** + * Filter by city. + */ + city?: GQLFilterTypeInput; + + /** + * Filter by country. + */ + country_id?: GQLFilterTypeInput; + + /** + * Filter by pickup location name. + */ + name?: GQLFilterTypeInput; + + /** + * Filter by pickup location code. + */ + pickup_location_code?: GQLFilterTypeInput; + + /** + * Filter by postcode. + */ + postcode?: GQLFilterTypeInput; + + /** + * Filter by region. + */ + region?: GQLFilterTypeInput; + + /** + * Filter by region id. + */ + region_id?: GQLFilterTypeInput; + + /** + * Filter by street. + */ + street?: GQLFilterTypeInput; +} + +/** + * FilterTypeInput specifies which action will be performed in a query + */ +export interface GQLFilterTypeInput { + + /** + * Equals + */ + eq?: string; + finset?: Array; + + /** + * From. Must be used with 'to' + */ + from?: string; + + /** + * Greater than + */ + gt?: string; + + /** + * Greater than or equal to + */ + gteq?: string; + + /** + * In. The value can contain a set of comma-separated values + */ + in?: Array; + + /** + * Like. The specified value can contain % (percent signs) to allow matching of 0 or more characters + */ + like?: string; + + /** + * Less than + */ + lt?: string; + + /** + * Less than or equal to + */ + lteq?: string; + + /** + * More than or equal to + */ + moreq?: string; + + /** + * Not equal to + */ + neq?: string; + + /** + * Not in. The value can contain a set of comma-separated values + */ + nin?: Array; + + /** + * Not null + */ + notnull?: string; + + /** + * Is null + */ + null?: string; + + /** + * To. Must be used with 'from' + */ + to?: string; +} + +/** + * PickupLocationSortInput specifies attribute to use for sorting search results + * and indicates whether the results are sorted in ascending or descending order. + */ +export interface GQLPickupLocationSortInput { + + /** + * City where pickup location is placed. + */ + city?: GQLSortEnum; + + /** + * Name of the contact person. + */ + contact_name?: GQLSortEnum; + + /** + * Id of the country in two letters. + */ + country_id?: GQLSortEnum; + + /** + * Description of the pickup location. + */ + description?: GQLSortEnum; + + /** + * Distance to the address, requested by distance filter. Applicable only with + * distance filter. If distance sort order is present, all other sort orders will be ignored. + */ + distance?: GQLSortEnum; + + /** + * Contact email of the pickup location. + */ + email?: GQLSortEnum; + + /** + * Contact fax of the pickup location. + */ + fax?: GQLSortEnum; + + /** + * Geographic latitude where pickup location is placed. + */ + latitude?: GQLSortEnum; + + /** + * Geographic longitude where pickup location is placed. + */ + longitude?: GQLSortEnum; + + /** + * The pickup location name. Customer use this to identify the pickup location. + */ + name?: GQLSortEnum; + + /** + * Contact phone number of the pickup location. + */ + phone?: GQLSortEnum; + + /** + * A code assigned to pickup location to identify the source. + */ + pickup_location_code?: GQLSortEnum; + + /** + * Postcode where pickup location is placed. + */ + postcode?: GQLSortEnum; + + /** + * Name of the region. + */ + region?: GQLSortEnum; + + /** + * Id of the region. + */ + region_id?: GQLSortEnum; + + /** + * Street where pickup location is placed. + */ + street?: GQLSortEnum; +} + +/** + * Top level object returned in a pickup locations search. + */ +export interface GQLPickupLocations { + + /** + * An array of pickup locations that match the specific search request. + */ + items?: Array; + + /** + * An object that includes the page_info and currentPage values specified in the query. + */ + page_info?: GQLSearchResultPageInfo; + + /** + * The number of products returned. + */ + total_count?: number; +} + +/** + * Defines Pickup Location information. + */ +export interface GQLPickupLocation { + city?: string; + contact_name?: string; + country_id?: string; + description?: string; + email?: string; + fax?: string; + latitude?: number; + longitude?: number; + name?: string; + phone?: string; + pickup_location_code?: string; + postcode?: string; + region?: string; + region_id?: number; + street?: string; +} + +export interface GQLProductReviewRatingsMetadata { + + /** + * List of product reviews sorted by position + */ + items: Array; +} + +export interface GQLProductReviewRatingMetadata { + + /** + * An encoded rating ID. + */ + id: string; + + /** + * The label assigned to an aspect of a product that is being rated, such as quality or price + */ + name: string; + + /** + * List of product review ratings sorted by position. + */ + values: Array; +} + +export interface GQLProductReviewRatingValueMetadata { + + /** + * A ratings scale, such as the number of stars awarded + */ + value: string; + + /** + * An encoded rating value id. + */ + value_id: string; +} + +/** + * ProductAttributeFilterInput defines the filters to be used in the search. A + * filter contains at least one attribute, a comparison operator, and the value + * that is being searched for. + */ +export interface GQLProductAttributeFilterInput { + + /** + * Attribute label: New Multiple attribute + */ + New_multiple_attribute?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Test_Ainars + */ + Test_Ainars?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Attribute allows html + */ + attribute_allows_html?: GQLFilterMatchTypeInput; + + /** + * Deprecated: use `category_uid` to filter product by category id. + */ + category_id?: GQLFilterEqualTypeInput; + + /** + * Filter product by the unique ID for a `CategoryInterface` object. + */ + category_uid?: GQLFilterEqualTypeInput; + + /** + * Attribute label: clothing colour + */ + clothing_colour?: GQLFilterEqualTypeInput; + + /** + * Attribute label: clothing gender + */ + clothing_gender?: GQLFilterEqualTypeInput; + + /** + * Attribute label: clothing size + */ + clothing_size?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Color + */ + color?: GQLFilterEqualTypeInput; + + /** + * Attribute label: 1Color Elena + */ + color_elena?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Colors with images! + */ + colors_with_images?: GQLFilterEqualTypeInput; + + /** + * Searches products by JSON formatted conditions + */ + conditions?: GQLFilterTypeInput; + + /** + * Modifies product prices based on customer group + */ + customer_group_id?: GQLFilterTypeInput; + + /** + * Attribute label: Description + */ + description?: GQLFilterMatchTypeInput; + + /** + * Attribute label: Fit + */ + fit?: GQLFilterEqualTypeInput; + + /** + * Entity id filter for products + */ + id?: GQLFilterTypeInput; + + /** + * Attribute label: Images Type Map + */ + images_type_map?: GQLFilterEqualTypeInput; + + /** + * Attribute label: memory + */ + memory?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Multiple attribute + */ + multiple_attribute?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Product Name + */ + name?: GQLFilterMatchTypeInput; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + */ + news_from_date?: GQLFilterTypeInput; + + /** + * The end date for new product listings. + */ + news_to_date?: GQLFilterTypeInput; + + /** + * Attribute label: Price + */ + price?: GQLFilterRangeTypeInput; + + /** + * Attribute label: Ranking + */ + ranking?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Shoes size + */ + shoes_size?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Short Description + */ + short_description?: GQLFilterMatchTypeInput; + + /** + * Attribute label: Size + */ + size?: GQLFilterEqualTypeInput; + + /** + * Attribute label: SKU + */ + sku?: GQLFilterEqualTypeInput; + + /** + * Attribute label: test + */ + test?: GQLFilterEqualTypeInput; + + /** + * Attribute label: texture + */ + texture?: GQLFilterEqualTypeInput; + + /** + * The part of the URL that identifies the product + */ + url_key?: GQLFilterEqualTypeInput; + + /** + * Attribute label: Valuesss + */ + valuesss?: GQLFilterEqualTypeInput; + + /** + * Attribute label: yes/no + */ + yes_no?: GQLFilterEqualTypeInput; +} + +/** + * Defines a filter that matches a range of values, such as prices or dates. + */ +export interface GQLFilterRangeTypeInput { + + /** + * The beginning of the range + */ + from?: string; + + /** + * The end of the range + */ + to?: string; +} + +/** + * The Products object is the top-level object returned in a product search. + */ +export interface GQLProducts { + + /** + * Layered navigation aggregations. + */ + aggregations?: Array; + + /** + * Layered navigation filters array. + * @deprecated Use aggregations instead + */ + filters?: Array; + + /** + * An array of products that match the specified search criteria. + */ + items?: Array; + + /** + * An object that includes the page_info and currentPage values specified in the query. + */ + page_info?: GQLSearchResultPageInfo; + + /** + * An object that includes the default sort field and all available sort fields. + */ + sort_fields?: GQLSortFields; + + /** + * The number of products that are marked as visible. By default, in complex + * products, parent products are visible, but their child products are not. + */ + total_count?: number; +} + +/** + * A bucket that contains information for each filterable option (such as price, category `UID`, and custom attributes). + */ +export interface GQLAggregation { + + /** + * Attribute code of the aggregation group. + */ + attribute_code: string; + + /** + * The number of options in the aggregation group. + */ + count?: number; + + /** + * Flag to indicate that aggregated attribute uses swatch to select value. + */ + has_swatch?: boolean; + + /** + * Flag to indicate that aggregated attribute has boolean type. + */ + is_boolean?: boolean; + + /** + * The aggregation display name. + */ + label?: string; + + /** + * Array of options for the aggregation. + */ + options?: Array; + + /** + * Attribute position in filter menu. + */ + position?: number; +} + +export interface GQLAggregationOption extends GQLAggregationOptionInterface { + + /** + * The number of items that match the aggregation option. + */ + count?: number; + + /** + * Aggregation option display label. + */ + label?: string; + + /** + * Swatch data + */ + swatch_data?: GQLSwatchData; + + /** + * The internal ID that represents the value of the option. + */ + value: string; +} + +export interface GQLAggregationOptionInterface { + + /** + * The number of items that match the aggregation option. + */ + count?: number; + + /** + * Aggregation option display label. + */ + label?: string; + + /** + * Swatch data + */ + swatch_data?: GQLSwatchData; + + /** + * The internal ID that represents the value of the option. + */ + value: string; +} + +/** Use this to resolve interface type AggregationOptionInterface */ +export type GQLPossibleAggregationOptionInterfaceTypeNames = +'AggregationOption'; + +export interface GQLAggregationOptionInterfaceNameMap { + AggregationOptionInterface: GQLAggregationOptionInterface; + AggregationOption: GQLAggregationOption; +} + +export interface GQLSwatchData { + + /** + * Type of swatch filter item: 1 - text, 2 - image + */ + type?: string; + + /** + * Value for swatch item (text or image link) + */ + value?: string; +} + +export interface GQLLayerFilter { + + /** + * Array of filter items. + * @deprecated Use Aggregation.options instead. + */ + filter_items?: Array; + + /** + * Count of filter items in filter group. + * @deprecated Use Aggregation.count instead. + */ + filter_items_count?: number; + + /** + * Layered navigation filter name. + * @deprecated Use Aggregation.label instead. + */ + name?: string; + + /** + * Request variable name for filter query. + * @deprecated Use Aggregation.attribute_code instead. + */ + request_var?: string; +} + +export interface GQLLayerFilterItemInterface { + + /** + * Count of items by filter. + * @deprecated Use AggregationOption.count instead. + */ + items_count?: number; + + /** + * Filter label. + * @deprecated Use AggregationOption.label instead. + */ + label?: string; + + /** + * Value for filter request variable to be used in query. + * @deprecated Use AggregationOption.value instead. + */ + value_string?: string; +} + +/** Use this to resolve interface type LayerFilterItemInterface */ +export type GQLPossibleLayerFilterItemInterfaceTypeNames = +'LayerFilterItem' | +'SwatchLayerFilterItem'; + +export interface GQLLayerFilterItemInterfaceNameMap { + LayerFilterItemInterface: GQLLayerFilterItemInterface; + LayerFilterItem: GQLLayerFilterItem; + SwatchLayerFilterItem: GQLSwatchLayerFilterItem; +} + +/** + * SortFields contains a default value for sort fields and all available sort fields. + */ +export interface GQLSortFields { + + /** + * Default value of sort fields. + */ + default?: string; + + /** + * Available sort fields. + */ + options?: Array; +} + +export interface GQLSortField { + + /** + * Label of sort field. + */ + label?: string; + + /** + * Attribute code of sort field. + */ + value?: string; +} + +/** + * Deprecated: `Wishlist` type should be used instead + */ +export interface GQLWishlistOutput { + + /** + * Name of wishlist creator + */ + creators_name?: string; + id?: string; + + /** + * An array of items in the customer's wish list + * @deprecated Use field `items` from type `Wishlist` instead + */ + items?: Array; + + /** + * The number of items in the wish list + * @deprecated Use field `items_count` from type `Wishlist` instead + */ + items_count?: number; + + /** + * When multiple wish lists are enabled, the name the customer assigns to the wishlist + * @deprecated This field is related to Commerce functionality and is always `null` in Open Source edition + */ + name?: string; + + /** + * An encrypted code that Magento uses to link to the wish list + * @deprecated Use field `sharing_code` from type `Wishlist` instead + */ + sharing_code?: string; + + /** + * The time of the last modification to the wish list + * @deprecated Use field `updated_at` from type `Wishlist` instead + */ + updated_at?: string; +} + +export interface GQLMenu { + css_class?: string; + is_active?: boolean; + items?: Array; + menu_id?: string; + title?: string; +} + +export interface GQLItem { + + /** + * Category id + */ + category_id?: number; + cms_page_identifier?: string; + + /** + * Category icon + */ + icon?: string; + is_active?: boolean; + + /** + * Boolean if category is promotional category + */ + is_promo?: number; + + /** + * CSS class of the item + */ + item_class?: string; + item_id?: string; + parent_id?: number; + position?: number; + + /** + * Promo category image background + */ + promo_image?: string; + title?: string; + url?: string; + + /** + * 0 - regular link, 1 - cms page, 2 - category + */ + url_type?: number; +} + +/** + * foo defines bar + */ +export interface GQLSlider { + animation_speed?: number; + is_active?: boolean; + lazy_load?: boolean; + position?: number; + show_menu?: boolean; + show_navigation?: boolean; + slide_speed?: number; + slider_id?: string; + slides?: Array; + slides_to_display?: number; + slides_to_display_mobile?: number; + slides_to_display_tablet?: number; + slides_to_scroll?: number; + slides_to_scroll_mobile?: number; + slides_to_scroll_tablet?: number; + title?: string; +} + +export interface GQLSlide { + desktop_image?: string; + desktop_image_2?: string; + desktop_image_3?: string; + display_title?: string; + display_title_2?: string; + display_title_3?: string; + embed_code?: string; + embed_code_2?: string; + embed_code_3?: string; + end_time?: string; + is_active?: boolean; + maps?: Array; + mobile_image?: string; + mobile_image_2?: string; + mobile_image_3?: string; + position?: number; + slide_id?: string; + slide_link?: string; + slide_link_2?: string; + slide_link_3?: string; + slide_link_text?: string; + slide_text?: string; + slide_text_2?: string; + slide_text_3?: string; + slide_text_position?: number; + slide_text_position_2?: number; + slide_text_position_3?: number; + slide_width_class?: string; + start_time?: string; + title?: string; +} + +export interface GQLMap { + coordinates?: string; + is_active?: boolean; + map_id?: string; + product_id?: number; + title?: string; +} + +export interface GQLTrackingData { + + /** + * Is Page Tracking enabled + */ + page_tracking_enabled?: boolean; + + /** + * dotdigital region prefix + */ + region_prefix?: string; + + /** + * Is ROI Tracking enabled + */ + roi_tracking_enabled?: boolean; + + /** + * Web Behaviour Tracking profile ID + */ + wbt_profile_id?: string; +} + +/** + * EntityUrl is an output object containing the `id`, `canonical_url`, and `type` attributes + */ +export interface GQLEntityUrl { + + /** + * The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original. + * @deprecated The canonical_url field is deprecated, use relative_url instead. + */ + canonical_url?: string; + + /** + * The unique ID for a `ProductInterface`, `CategoryInterface`, `CmsPage`, etc. + * object associated with the specified url. This could be a product UID, + * category UID, or cms page UID. + */ + entity_uid?: string; + + /** + * The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID. + * @deprecated Use `entity_uid` instead. + */ + id?: number; + + /** + * 301 or 302 HTTP code for url permanent or temporary redirect or 0 for the 200 no redirect + */ + redirectCode?: number; + + /** + * The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original. + */ + relative_url?: string; + + /** + * If URL rewrite is of type PRODUCT - it will return SKU here + */ + sku?: string; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; +} + +export interface GQLMutation { + addBundleProductsToCart?: GQLAddBundleProductsToCartOutput; + addConfigurableProductsToCart?: GQLAddConfigurableProductsToCartOutput; + addDownloadableProductsToCart?: GQLAddDownloadableProductsToCartOutput; + + /** + * Add any type of product to the cart + */ + addProductsToCart?: GQLAddProductsToCartOutput; + + /** + * Add products to the specified compare list + */ + addProductsToCompareList?: GQLCompareList; + + /** + * Adds one or more products to the specified wish list. This mutation supports all product types + */ + addProductsToWishlist?: GQLAddProductsToWishlistOutput; + addSimpleProductsToCart?: GQLAddSimpleProductsToCartOutput; + addVirtualProductsToCart?: GQLAddVirtualProductsToCartOutput; + + /** + * Add items in the specified wishlist to the customer's cart + */ + addWishlistItemsToCart?: GQLAddWishlistItemsToCartOutput; + applyCoupon?: GQLQuery; + applyCouponToCart?: GQLApplyCouponToCartOutput; + + /** + * Assign the specified compare list to the logged in customer + */ + assignCompareListToCustomer?: GQLAssignCompareListToCustomerOutput; + + /** + * Changes the password for the logged-in customer + */ + changeCustomerPassword?: GQLCustomer; + + /** + * Confirm customer account + */ + confirmCustomerEmail?: GQLCreateCustomerType; + + /** + * Send contact form + */ + contactForm?: GQLContactFormResponse; + + /** + * Creates Client Token for Braintree Javascript SDK initialization. + */ + createBraintreeClientToken: string; + + /** + * Creates a new compare list. The compare list is saved for logged in customers + */ + createCompareList?: GQLCompareList; + + /** + * Create customer account + */ + createCustomer?: GQLCustomerOutput; + + /** + * Create customer address + */ + createCustomerAddress?: GQLCustomerAddress; + + /** + * Create customer account + */ + createCustomerV2?: GQLCustomerOutput; + + /** + * Creates an empty shopping cart for a guest or logged in user + */ + createEmptyCart?: string; + + /** + * Creates a Klarna Payments Session. + */ + createKlarnaPaymentsSession?: GQLcreateKlarnaPaymentsSessionOutput; + + /** + * Returns Klarna session token + */ + createKlarnaToken?: string; + + /** + * Initiates a transaction and receives a token. Use this mutation for Payflow Pro and Payments Pro payment methods + */ + createPayflowProToken?: GQLCreatePayflowProTokenOutput; + + /** + * Initiates an Express Checkout transaction and receives a token. Use this + * mutation for Express Checkout and Payments Standard payment methods. + */ + createPaypalExpressToken?: GQLPaypalExpressTokenOutput; + + /** + * Creates a product review for the specified SKU + */ + createProductReview: GQLCreateProductReviewOutput; + + /** + * Delete the specified compare list + */ + deleteCompareList?: GQLDeleteCompareListOutput; + + /** + * Delete customer address + */ + deleteCustomerAddress?: boolean; + + /** + * Delete a customer payment token + */ + deletePaymentToken?: GQLDeletePaymentTokenOutput; + estimateShippingCosts?: Array; + + /** + * Resend customer confirmation + */ + forgotPassword?: GQLCustomerActionConfirmationType; + + /** + * Retrieve the customer token + */ + generateCustomerToken?: GQLCustomerToken; + + /** + * Request a customer token so that an administrator can perform remote shopping assistance + */ + generateCustomerTokenAsAdmin?: GQLGenerateCustomerTokenAsAdminOutput; + + /** + * Handles payment response and saves payment in Quote. Use this mutations for Payflow Pro and Payments Pro payment methods. + */ + handlePayflowProResponse?: GQLPayflowProResponseOutput; + linkOrder?: boolean; + + /** + * Merges the source cart into the destination cart + */ + mergeCarts: GQLCart; + placeOrder?: GQLPlaceOrderOutput; + + /** + * Customer subsribe for product alert + */ + productAlertSubscribe?: boolean; + removeCartItem?: GQLQuery; + removeCoupon?: GQLQuery; + removeCouponFromCart?: GQLRemoveCouponFromCartOutput; + removeItemFromCart?: GQLRemoveItemFromCartOutput; + + /** + * Remove products from the specified compare list + */ + removeProductsFromCompareList?: GQLCompareList; + + /** + * Removes one or more products from the specified wish list + */ + removeProductsFromWishlist?: GQLRemoveProductsFromWishlistOutput; + + /** + * Adds all products from a customer's previous order to the cart. + */ + reorderItems?: GQLReorderItemsOutput; + + /** + * Request an email with a reset password token for the registered customer identified by the specified email. + */ + requestPasswordResetEmail?: boolean; + + /** + * Resend customer confirmation + */ + resendConfirmationEmail?: GQLCustomerActionConfirmationType; + + /** + * Reset a customer's password using the reset password token that the customer + * received in an email after requesting it using requestPasswordResetEmail. + */ + resetPassword?: boolean; + + /** + * Revoke the customer token + */ + revokeCustomerToken?: GQLRevokeCustomerTokenOutput; + + /** + * Clears wishlist + */ + s_clearWishlist?: boolean; + + /** + * Initiates an Express Checkout transaction and receives a token using + * session-based cart_id. Use this mutation for Express Checkout and Payments + * Standard payment methods. + */ + s_createPaypalExpressToken?: GQLPaypalExpressToken; + + /** + * Moves items from wishlist to cart + */ + s_moveWishlistToCart?: boolean; + s_placeOrder?: GQLPlaceOrderOutput; + + /** + * Removes product from wishlist + */ + s_removeProductFromWishlist?: boolean; + + /** + * Resend customer confirmation + */ + s_resetPassword?: GQLResetPasswordType; + + /** + * Saves wishlist item + */ + s_saveWishlistItem?: GQLWishlistItem; + s_setBillingAddressOnCart?: GQLSetBillingAddressOnCartOutput; + s_setPaymentMethodOnCart?: GQLSetPaymentMethodOnCartOutput; + + /** + * Shares wishlist + */ + s_shareWishlist?: boolean; + saveAddressInformation?: GQLPaymentDetails; + saveCartItem?: GQLQuery; + saveSelectedCurrency?: GQLQuery; + + /** + * Recommends Product by Sending Single/Multiple Email + */ + sendEmailToFriend?: GQLSendEmailToFriendOutput; + setBillingAddressOnCart?: GQLSetBillingAddressOnCartOutput; + setGuestEmailOnCart?: GQLSetGuestEmailOnCartOutput; + + /** + * + * @deprecated Should use setPaymentMethodOnCart and placeOrder mutations in single request. + */ + setPaymentMethodAndPlaceOrder?: GQLPlaceOrderOutput; + setPaymentMethodOnCart?: GQLSetPaymentMethodOnCartOutput; + setShippingAddressesOnCart?: GQLSetShippingAddressesOnCartOutput; + setShippingMethodsOnCart?: GQLSetShippingMethodsOnCartOutput; + + /** + * Subscribes the specified email to a newsletter + */ + subscribeEmailToNewsletter?: GQLSubscribeEmailToNewsletterOutput; + updateCartItems?: GQLUpdateCartItemsOutput; + + /** + * Sends chat profile data to Engagement Cloud. + */ + updateChatProfile?: boolean; + + /** + * Deprecated. Use UpdateCustomerV2 instead. + */ + updateCustomer?: GQLCustomerOutput; + + /** + * Update customer address + */ + updateCustomerAddress?: GQLCustomerAddress; + updateCustomerEmail?: GQLCustomerOutput; + + /** + * Update the customer's personal information + */ + updateCustomerV2?: GQLCustomerOutput; + + /** + * Updates one or more products in the specified wish list + */ + updateProductsInWishlist?: GQLUpdateProductsInWishlistOutput; + + /** + * Updates the email address of a quote. + */ + updateQuoteEmail?: boolean; +} + +export interface GQLAddBundleProductsToCartInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLBundleProductCartItemInput { + bundle_options: Array; + customizable_options?: Array; + data: GQLCartItemInput; +} + +export interface GQLBundleOptionInput { + id: number; + quantity: number; + value: Array; +} + +export interface GQLCustomizableOptionInput { + + /** + * The customizable option id of the product + */ + id?: number; + + /** + * The string value of the option + */ + value_string: string; +} + +export interface GQLCartItemInput { + + /** + * An array of entered options for the base product, such as personalization text + */ + entered_options?: Array; + id?: GQLCartItemId; + item_id?: number; + + /** + * For child products, the SKU of its parent product + */ + parent_sku?: string; + product_option?: GQLProductOptionInput; + product_type?: string; + quantity: number; + quote_id?: string; + + /** + * The selected options for the base product, such as color or size with unique + * ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, + * `ConfigurableProductOptionsValues`, etc. objects + */ + selected_options?: Array; + sku?: string; +} + +/** + * Defines a customer-entered option + */ +export interface GQLEnteredOptionInput { + + /** + * The unique ID for a `CustomizableFieldOption`, `CustomizableFileOption`, + * `CustomizableAreaOption`, etc. of `CustomizableOptionInterface` objects + */ + uid: string; + + /** + * Text the customer entered + */ + value: string; +} + +export interface GQLCartItemId { + item_id?: number; + sku?: string; +} + +export interface GQLProductOptionInput { + buy_request?: string; + extension_attributes?: GQLExtensionsAttributeInput; +} + +export interface GQLExtensionsAttributeInput { + bundle_options?: Array; + configurable_item_options?: Array; + customizable_options?: Array; + customizable_options_multi?: Array; + downloadable_product_links?: Array; + grouped_product_options?: Array; +} + +export interface GQLConfigurableItemOptionsInput { + option_id?: string; + option_value?: number; +} + +export interface GQLCustomizableOptionsInput { + option_filename?: string; + option_id: string; + option_value?: string; +} + +export interface GQLDownloadableProductLinksInput { + link_id?: number; +} + +export interface GQLAddBundleProductsToCartOutput { + cart: GQLCart; +} + +export interface GQLAddConfigurableProductsToCartInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLConfigurableProductCartItemInput { + customizable_options?: Array; + data: GQLCartItemInput; + + /** + * Configurable product SKU. + */ + parent_sku?: string; + + /** + * Deprecated. Use CartItemInput.sku instead. + */ + variant_sku?: string; +} + +export interface GQLAddConfigurableProductsToCartOutput { + cart: GQLCart; +} + +export interface GQLAddDownloadableProductsToCartInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLDownloadableProductCartItemInput { + customizable_options?: Array; + data: GQLCartItemInput; + downloadable_product_links?: Array; +} + +export interface GQLAddDownloadableProductsToCartOutput { + cart: GQLCart; +} + +export interface GQLAddProductsToCartOutput { + + /** + * The cart after products have been added + */ + cart: GQLCart; + + /** + * An error encountered while adding an item to the cart. + */ + user_errors: Array; +} + +/** + * An error encountered while adding an item to the the cart. + */ +export interface GQLCartUserInputError { + + /** + * Cart-specific error code + */ + code: GQLCartUserInputErrorType; + + /** + * A localized error message + */ + message: string; +} + +export enum GQLCartUserInputErrorType { + PRODUCT_NOT_FOUND = 'PRODUCT_NOT_FOUND', + NOT_SALABLE = 'NOT_SALABLE', + INSUFFICIENT_STOCK = 'INSUFFICIENT_STOCK', + UNDEFINED = 'UNDEFINED' +} + +export interface GQLAddProductsToCompareListInput { + + /** + * An array of product IDs to add to the compare list + */ + products: Array; + + /** + * The unique identifier of the compare list to modify + */ + uid: string; +} + +/** + * Defines the items to add to a wish list + */ +export interface GQLWishlistItemInput { + + /** + * User description of wish list item + */ + description?: string; + + /** + * An array of options that the customer entered + */ + entered_options?: Array; + + /** + * Id of the wishlist item + */ + item_id?: string; + + /** + * For complex product types, the SKU of the parent product + */ + parent_sku?: string; + + /** + * Configurable product options + */ + product_option?: GQLProductOptionInput; + + /** + * Quantity of the product + */ + quantity?: number; + + /** + * An array of strings corresponding to options the customer selected + */ + selected_options?: Array; + + /** + * Sku of the product + */ + sku?: string; +} + +/** + * Contains the customer's wish list and any errors encountered + */ +export interface GQLAddProductsToWishlistOutput { + + /** + * An array of errors encountered while adding products to a wish list + */ + user_errors: Array; + + /** + * Contains the wish list with all items that were successfully added + */ + wishlist: GQLWishlist; +} + +/** + * An error encountered while performing operations with WishList. + */ +export interface GQLWishListUserInputError { + + /** + * Wishlist-specific error code + */ + code: GQLWishListUserInputErrorType; + + /** + * A localized error message + */ + message: string; +} + +export enum GQLWishListUserInputErrorType { + PRODUCT_NOT_FOUND = 'PRODUCT_NOT_FOUND', + UNDEFINED = 'UNDEFINED' +} + +export interface GQLAddSimpleProductsToCartInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLSimpleProductCartItemInput { + customizable_options?: Array; + data: GQLCartItemInput; +} + +export interface GQLAddSimpleProductsToCartOutput { + cart: GQLCart; +} + +export interface GQLAddVirtualProductsToCartInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLVirtualProductCartItemInput { + customizable_options?: Array; + data: GQLCartItemInput; +} + +export interface GQLAddVirtualProductsToCartOutput { + cart: GQLCart; +} + +export interface GQLAddWishlistItemsToCartOutput { + + /** + * An array of errors encountered while adding products to the customer's cart + */ + add_wishlist_items_to_cart_user_errors: Array; + + /** + * Indicates whether the attempt to add items to the customer's cart was successful + */ + status: boolean; + + /** + * Contains the wish list with all items that were successfully added + */ + wishlist: GQLWishlist; +} + +export interface GQLWishlistCartUserInputError { + + /** + * An error code that describes the error encountered + */ + code: GQLWishlistCartUserInputErrorType; + + /** + * A localized error message + */ + message: string; + + /** + * The unique ID of the `Wishlist` object containing an error + */ + wishlistId: string; + + /** + * The unique ID of the wish list item containing an error + */ + wishlistItemId: string; +} + +export enum GQLWishlistCartUserInputErrorType { + PRODUCT_NOT_FOUND = 'PRODUCT_NOT_FOUND', + NOT_SALABLE = 'NOT_SALABLE', + INSUFFICIENT_STOCK = 'INSUFFICIENT_STOCK', + UNDEFINED = 'UNDEFINED' +} + +export interface GQLApplyCouponToCartInput { + cart_id: string; + coupon_code: string; +} + +export interface GQLApplyCouponToCartOutput { + cart: GQLCart; +} + +export interface GQLAssignCompareListToCustomerOutput { + + /** + * The contents of the customer's compare list + */ + compare_list?: GQLCompareList; + result: boolean; +} + +export interface GQLCreateCustomerType { + customer?: GQLCustomer; + + /** + * Customer creation status + */ + status?: string; + + /** + * The customer token + */ + token?: string; +} + +export interface GQLContactForm { + email?: string; + message?: string; + name?: string; + telephone?: string; +} + +export interface GQLContactFormResponse { + message?: string; +} + +export interface GQLCreateCompareListInput { + + /** + * An array of product IDs to add to the compare list + */ + products?: Array; +} + +export interface GQLCustomerInput { + + /** + * The customer's date of birth + */ + date_of_birth?: string; + + /** + * Deprecated: Use `date_of_birth` instead + */ + dob?: string; + + /** + * The customer's email address. Required for customer creation + */ + email?: string; + + /** + * The customer's first name + */ + firstname?: string; + + /** + * The customer's gender (Male - 1, Female - 2) + */ + gender?: number; + + /** + * Indicates whether the customer is subscribed to the company's newsletter + */ + is_subscribed?: boolean; + + /** + * The customer's family name + */ + lastname?: string; + + /** + * The customer's middle name + */ + middlename?: string; + + /** + * The customer's password + */ + password?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The customer's Tax/VAT number (for corporate customers) + */ + taxvat?: string; +} + +export interface GQLCustomerOutput { + customer: GQLCustomer; +} + +export interface GQLCustomerAddressInput { + + /** + * The city or town + */ + city?: string; + + /** + * The customer's company + */ + company?: string; + + /** + * The customer's country + */ + country_code?: GQLCountryCodeEnum; + + /** + * Deprecated: use `country_code` instead. + */ + country_id?: GQLCountryCodeEnum; + + /** + * Deprecated: Custom attributes should not be put into container. + */ + custom_attributes?: Array; + + /** + * Indicates whether the address is the default billing address + */ + default_billing?: boolean; + + /** + * Indicates whether the address is the default shipping address + */ + default_shipping?: boolean; + + /** + * The fax number + */ + fax?: string; + + /** + * The first name of the person associated with the shipping/billing address + */ + firstname?: string; + + /** + * The family name of the person associated with the shipping/billing address + */ + lastname?: string; + + /** + * The middle name of the person associated with the shipping/billing address + */ + middlename?: string; + + /** + * The customer's ZIP or postal code + */ + postcode?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * An object containing the region name, region code, and region ID + */ + region?: GQLCustomerAddressRegionInput; + + /** + * An array of strings that define the street number and name + */ + street?: Array; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The telephone number + */ + telephone?: string; + + /** + * The customer's Tax/VAT number (for corporate customers) + */ + vat_id?: string; +} + +export interface GQLCustomerAddressAttributeInput { + + /** + * Attribute code + */ + attribute_code: string; + + /** + * Attribute value + */ + value: string; +} + +/** + * CustomerAddressRegionInput defines the customer's state or province + */ +export interface GQLCustomerAddressRegionInput { + + /** + * The state or province name + */ + region?: string; + + /** + * The address region code + */ + region_code?: string; + + /** + * The unique ID for a pre-defined region + */ + region_id?: number; +} + +export interface GQLCustomerCreateInput { + + /** + * Indicates whether the customer has enabled remote shopping assistance + */ + allow_remote_shopping_assistance?: boolean; + + /** + * The customer's date of birth + */ + date_of_birth?: string; + + /** + * Deprecated: Use `date_of_birth` instead + */ + dob?: string; + + /** + * The customer's email address. Required for customer creation + */ + email: string; + + /** + * The customer's first name + */ + firstname: string; + + /** + * The customer's gender (Male - 1, Female - 2) + */ + gender?: number; + + /** + * Indicates whether the customer is subscribed to the company's newsletter + */ + is_subscribed?: boolean; + + /** + * The customer's family name + */ + lastname: string; + + /** + * The customer's middle name + */ + middlename?: string; + + /** + * The customer's password + */ + password?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The customer's Tax/VAT number (for corporate customers) + */ + taxvat?: string; +} + +export interface GQLcreateEmptyCartInput { + cart_id?: string; +} + +export interface GQLcreateKlarnaPaymentsSessionInput { + cart_id: string; +} + +export interface GQLcreateKlarnaPaymentsSessionOutput { + + /** + * The payment method client token + */ + client_token?: string; + + /** + * The payment method categories + */ + payment_method_categories?: Array; +} + +export interface GQLCategories { + + /** + * The payment method assets + */ + asset_urls?: Array; + + /** + * The payment method identifier + */ + identifier: string; + + /** + * The payment method name + */ + name: string; +} + +export interface GQLAssets { + + /** + * The payment method logo url (descriptive) + */ + descriptive?: string; + + /** + * The payment method logo url (standard) + */ + standard?: string; +} + +/** + * Defines the attributes required to receive a payment token for Klarna payment method + */ +export interface GQLKlarnaTokenInput { + + /** + * The unique ID that identifies the guest customer's cart + */ + guest_cart_id?: string; +} + +/** + * Input required to fetch payment token information for Payflow Pro and Payments Pro payment methods. + */ +export interface GQLPayflowProTokenInput { + + /** + * The unique ID that identifies the customer's cart + */ + cart_id: string; + + /** + * A set of relative URLs that PayPal uses for callback. + */ + urls: GQLPayflowProUrlInput; +} + +/** + * A set of relative URLs that PayPal will use in response to various actions + * during the authorization process. Magento prepends the base URL to this value to + * create a full URL. For example, if the full URL is + * https://www.example.com/path/to/page.html, the relative URL is + * path/to/page.html. Use this input for Payflow Pro and Payment Pro payment methods. + */ +export interface GQLPayflowProUrlInput { + + /** + * The relative URL of the page that PayPal will redirect to when the buyer + * cancels the transaction in order to choose a different payment method. If the + * full URL to this page is https://www.example.com/paypal/action/cancel.html, + * the relative URL is paypal/action/cancel.html. + */ + cancel_url: string; + + /** + * The relative URL of the transaction error page that PayPal will redirect to + * upon payment error. If the full URL to this page is + * https://www.example.com/paypal/action/error.html, the relative URL is + * paypal/action/error.html. + */ + error_url: string; + + /** + * The relative URL of the final confirmation page that PayPal will redirect to + * upon payment success. If the full URL to this page is + * https://www.example.com/paypal/action/return.html, the relative URL is + * paypal/action/return.html. + */ + return_url: string; +} + +/** + * Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods. + */ +export interface GQLCreatePayflowProTokenOutput { + response_message: string; + result: number; + result_code: number; + secure_token: string; + secure_token_id: string; +} + +/** + * Defines the attributes required to receive a payment token for Express Checkout and Payments Standard payment methods. + */ +export interface GQLPaypalExpressTokenInput { + + /** + * The unique ID that identifies the customer's cart + */ + cart_id: string; + + /** + * Payment method code + */ + code: string; + + /** + * Indicates whether the buyer selected the quick checkout button. The default value is false + */ + express_button?: boolean; + + /** + * A set of relative URLs that PayPal uses in response to various actions during the authorization process + */ + urls: GQLPaypalExpressUrlsInput; + + /** + * Indicates whether the buyer clicked the PayPal credit button. The default value is false + */ + use_paypal_credit?: boolean; +} + +/** + * A set of relative URLs that PayPal will use in response to various actions + * during the authorization process. Magento prepends the base URL to this value to + * create a full URL. For example, if the full URL is + * https://www.example.com/path/to/page.html, the relative URL is + * path/to/page.html. Use this input for Express Checkout and Payments Standard + * payment methods. + */ +export interface GQLPaypalExpressUrlsInput { + + /** + * The relative URL of the page that PayPal will redirect to when the buyer + * cancels the transaction in order to choose a different payment method. If the + * full URL to this page is https://www.example.com/paypal/action/cancel.html, + * the relative URL is paypal/action/cancel.html. + */ + cancel_url: string; + + /** + * The relative URL of the page that PayPal will redirect to when the payment has + * been put on hold for additional review. This condition mostly applies to ACH + * transactions, and is not applicable to most PayPal solutions. If the full URL + * to this page is https://www.example.com/paypal/action/success_pending.html, + * the relative URL is paypal/action/success_pending.html. + */ + pending_url?: string; + + /** + * The relative URL of the final confirmation page that PayPal will redirect to + * upon payment success. If the full URL to this page is + * https://www.example.com/paypal/action/return.html, the relative URL is + * paypal/action/return.html. + */ + return_url: string; + + /** + * The relative URL of the order confirmation page that PayPal will redirect to + * when the payment is successful and additional confirmation is not needed. Not + * applicable to most PayPal solutions. If the full URL to this page is + * https://www.example.com/paypal/action/success.html, the relative URL is + * paypal/action/success.html. + */ + success_url?: string; +} + +/** + * Contains the token returned by PayPal and a set of URLs that allow the buyer to + * authorize payment and adjust checkout details. Applies to Express Checkout and + * Payments Standard payment methods. + */ +export interface GQLPaypalExpressTokenOutput { + + /** + * A set of URLs that allow the buyer to authorize payment and adjust checkout details + */ + paypal_urls?: GQLPaypalExpressUrlList; + + /** + * The token returned by PayPal + */ + token?: string; +} + +/** + * A set of URLs that allow the buyer to authorize payment and adjust checkout + * details for Express Checkout and Payments Standard transactions. + */ +export interface GQLPaypalExpressUrlList { + + /** + * The PayPal URL that allows the buyer to edit their checkout details + */ + edit?: string; + + /** + * The URL to the PayPal login page + */ + start?: string; +} + +export interface GQLCreateProductReviewInput { + + /** + * The customer's nickname. Defaults to the customer name, if logged in + */ + nickname: string; + + /** + * Ratings details by category. e.g price: 5, quality: 4 etc + */ + ratings: Array; + + /** + * The SKU of the reviewed product + */ + sku: string; + + /** + * The summary (title) of the review + */ + summary: string; + + /** + * The review text. + */ + text: string; +} + +export interface GQLProductReviewRatingInput { + + /** + * An encoded rating ID. + */ + id: string; + + /** + * An encoded rating value id. + */ + value_id: string; +} + +export interface GQLCreateProductReviewOutput { + + /** + * Contains the completed product review + */ + review: GQLProductReview; +} + +export interface GQLDeleteCompareListOutput { + + /** + * Indicates whether the compare list was successfully deleted + */ + result: boolean; +} + +export interface GQLDeletePaymentTokenOutput { + customerPaymentTokens?: GQLCustomerPaymentTokens; + result: boolean; +} + +export interface GQLEstimateShippingCostsAddress { + city?: string; + country_id?: string; + customer_id?: number; + email?: string; + firstname?: string; + lastname?: string; + postcode?: string; + region?: string; + region_code?: string; + region_id?: number; + same_as_billing?: number; + street?: Array; + telephone?: string; +} + +export interface GQLShippingMethod { + amount?: number; + available?: boolean; + base_amount?: number; + carrier_code?: string; + carrier_title?: string; + error_message?: string; + method_code?: string; + method_title?: string; + price_excl_tax?: number; + price_incl_tax?: number; +} + +export interface GQLCustomerActionConfirmationType { + + /** + * Customer email verification status + */ + status?: string; +} + +export interface GQLCustomerToken { + + /** + * The customer token + */ + token?: string; +} + +export interface GQLGenerateCustomerTokenAsAdminInput { + + /** + * The email address of the customer requesting remote shopping assistance + */ + customer_email: string; +} + +export interface GQLGenerateCustomerTokenAsAdminOutput { + + /** + * The generated customer token + */ + customer_token: string; +} + +/** + * Input required to complete payment. Applies to Payflow Pro and Payments Pro payment methods. + */ +export interface GQLPayflowProResponseInput { + cart_id: string; + paypal_payload: string; +} + +export interface GQLPayflowProResponseOutput { + cart: GQLCart; +} + +export interface GQLPlaceOrderInput { + cart_id: string; +} + +export interface GQLPlaceOrderOutput { + order: GQLOrder; +} + +export interface GQLRemoveCouponFromCartInput { + cart_id: string; +} + +export interface GQLRemoveCouponFromCartOutput { + cart?: GQLCart; +} + +export interface GQLRemoveItemFromCartInput { + cart_id: string; + + /** + * Deprecated. Use `cart_item_uid` instead. + */ + cart_item_id?: number; + + /** + * Required field. The unique ID for a `CartItemInterface` object + */ + cart_item_uid?: string; +} + +export interface GQLRemoveItemFromCartOutput { + cart: GQLCart; +} + +export interface GQLRemoveProductsFromCompareListInput { + + /** + * An array of product IDs to remove from the compare list + */ + products: Array; + + /** + * The unique identifier of the compare list to modify + */ + uid: string; +} + +/** + * Contains the customer's wish list and any errors encountered + */ +export interface GQLRemoveProductsFromWishlistOutput { + + /** + * An array of errors encountered while deleting products from a wish list + */ + user_errors: Array; + + /** + * Contains the wish list with after items were successfully deleted + */ + wishlist: GQLWishlist; +} + +export interface GQLReorderItemsOutput { + + /** + * Contains detailed information about the customer's cart. + */ + cart: GQLCart; + + /** + * An array of reordering errors. + */ + userInputErrors: Array; +} + +/** + * An error encountered while adding an item the the cart. + */ +export interface GQLCheckoutUserInputError { + + /** + * Checkout-specific error code + */ + code: GQLCheckoutUserInputErrorCodes; + + /** + * Localized error message + */ + message: string; + + /** + * Path to the input field that caused an error. See the GraphQL specification + * about path errors for details: http://spec.graphql.org/draft/#sec-Errors + */ + path: Array; +} + +export enum GQLCheckoutUserInputErrorCodes { + REORDER_NOT_AVAILABLE = 'REORDER_NOT_AVAILABLE', + PRODUCT_NOT_FOUND = 'PRODUCT_NOT_FOUND', + NOT_SALABLE = 'NOT_SALABLE', + INSUFFICIENT_STOCK = 'INSUFFICIENT_STOCK', + UNDEFINED = 'UNDEFINED' +} + +export interface GQLRevokeCustomerTokenOutput { + result: boolean; +} + +/** + * Defines the attributes required to receive a payment token for Express Checkout and Payments Standard payment methods. + */ +export interface GQLS_PaypalExpressTokenInput { + + /** + * Payment method code + */ + code: string; + + /** + * Indicates whether the buyer selected the quick checkout button. The default value is false + */ + express_button?: boolean; + + /** + * The unique ID that identifies the guest customer's cart + */ + guest_cart_id?: string; + + /** + * A set of relative URLs that PayPal uses in response to various actions during the authorization process + */ + urls: GQLPaypalExpressUrlsInput; + + /** + * Indicates whether the buyer clicked the PayPal credit button. The default value is false + */ + use_paypal_credit?: boolean; +} + +/** + * Deprecated: use type `PaypalExpressTokenOutput` instead + */ +export interface GQLPaypalExpressToken { + + /** + * A set of URLs that allow the buyer to authorize payment and adjust checkout details + * @deprecated Use field `paypal_urls` of type `PaypalExpressTokenOutput` instead + */ + paypal_urls?: GQLPaypalExpressUrlList; + + /** + * The token returned by PayPal + * @deprecated Use field `token` of type `PaypalExpressTokenOutput` instead + */ + token?: string; +} + +export interface GQLResetPasswordType { + + /** + * Customer reset status + */ + status?: string; + + /** + * The customer token + */ + token?: string; +} + +export interface GQLS_SetBillingAddressOnCartInput { + billing_address: GQLBillingAddressInput; + guest_cart_id?: string; + same_as_shipping?: boolean; +} + +export interface GQLBillingAddressInput { + address?: GQLCartAddressInput; + customer_address_id?: number; + + /** + * Set billing address same as shipping + */ + same_as_shipping?: boolean; + + /** + * Deprecated: use `same_as_shipping` field instead + */ + use_for_shipping?: boolean; +} + +export interface GQLCartAddressInput { + city: string; + company?: string; + country_code: string; + firstname: string; + lastname: string; + postcode?: string; + region?: string; + region_id?: number; + + /** + * Determines whether to save the address in the customer's address book. The default value is true + */ + save_in_address_book?: boolean; + street: Array; + telephone: string; + vat_id?: string; +} + +export interface GQLSetBillingAddressOnCartOutput { + cart: GQLCart; +} + +export interface GQLS_SetPaymentMethodOnCartInput { + guest_cart_id?: string; + payment_method: GQLPaymentMethodInput; +} + +export interface GQLPaymentMethodInput { + additional_data?: GQLPaymentMethodAdditionalData; + braintree?: GQLBraintreeInput; + braintree_cc_vault?: GQLBraintreeCcVaultInput; + + /** + * Payment method code + */ + code: string; + + /** + * Required input for PayPal Hosted pro payments + */ + hosted_pro?: GQLHostedProInput; + klarna?: GQLKlarnaInput; + klarna_kp?: GQLKlarnaInput; + method?: string; + + /** + * Required input for Payflow Express Checkout payments + */ + payflow_express?: GQLPayflowExpressInput; + + /** + * Required input for PayPal Payflow Link and Payments Advanced payments + */ + payflow_link?: GQLPayflowLinkInput; + + /** + * Required input type for PayPal Payflow Pro and Payment Pro payments + */ + payflowpro?: GQLPayflowProInput; + + /** + * Required input type for PayPal Payflow Pro vault payments + */ + payflowpro_cc_vault?: GQLVaultTokenInput; + + /** + * Required input for Express Checkout and Payments Standard payments + */ + paypal_express?: GQLPaypalExpressInput; + + /** + * Purchase order number + */ + purchase_order_number?: string; +} + +export interface GQLPaymentMethodAdditionalData { + cc_save?: boolean; + cc_stripejs_token?: string; + payment_method_nonce?: string; +} + +export interface GQLBraintreeInput { + + /** + * Contains a fingerprint provided by Braintree JS SDK and should be sent with + * sale transaction details to the Braintree payment gateway. Should be specified + * only in a case if Kount (advanced fraud protection) is enabled for Braintree + * payment integration. + */ + device_data?: string; + + /** + * States whether an entered by a customer credit/debit card should be tokenized + * for later usage. Required only if Vault is enabled for Braintree payment integration. + */ + is_active_payment_token_enabler: boolean; + + /** + * The one-time payment token generated by Braintree payment gateway based on + * card details. Required field to make sale transaction. + */ + payment_method_nonce: string; +} + +export interface GQLBraintreeCcVaultInput { + device_data?: string; + public_hash: string; +} + +/** + * A set of relative URLs that PayPal will use in response to various actions + * during the authorization process. Magento prepends the base URL to this value to + * create a full URL. For example, if the full URL is + * https://www.example.com/path/to/page.html, the relative URL is + * path/to/page.html. Use this input for Payments Pro Hosted Solution payment method. + */ +export interface GQLHostedProInput { + + /** + * The relative URL of the page that PayPal will redirect to when the buyer + * cancels the transaction in order to choose a different payment method. If the + * full URL to this page is https://www.example.com/paypal/action/cancel.html, + * the relative URL is paypal/action/cancel.html. + */ + cancel_url: string; + + /** + * The relative URL of the final confirmation page that PayPal will redirect to + * upon payment success. If the full URL to this page is + * https://www.example.com/paypal/action/return.html, the relative URL is + * paypal/action/return.html. + */ + return_url: string; +} + +export interface GQLKlarnaInput { + + /** + * The authorization token must be provided to set any Klarna Payments method + */ + authorization_token: string; +} + +/** + * Required input for Payflow Express Checkout payments + */ +export interface GQLPayflowExpressInput { + + /** + * The unique ID of the PayPal user + */ + payer_id: string; + + /** + * The token returned by the createPaypalExpressToken mutation + */ + token: string; +} + +/** + * A set of relative URLs that PayPal will use in response to various actions + * during the authorization process. Magento prepends the base URL to this value to + * create a full URL. For example, if the full URL is + * https://www.example.com/path/to/page.html, the relative URL is + * path/to/page.html. Use this input for Payflow Link and Payments Advanced payment methods. + */ +export interface GQLPayflowLinkInput { + + /** + * The relative URL of the page that PayPal will redirect to when the buyer + * cancels the transaction in order to choose a different payment method. If the + * full URL to this page is https://www.example.com/paypal/action/cancel.html, + * the relative URL is paypal/action/cancel.html. + */ + cancel_url: string; + + /** + * The relative URL of the transaction error page that PayPal will redirect to + * upon payment error. If the full URL to this page is + * https://www.example.com/paypal/action/error.html, the relative URL is + * paypal/action/error.html. + */ + error_url: string; + + /** + * The relative URL of the order confirmation page that PayPal will redirect to + * when the payment is successful and additional confirmation is not needed. If + * the full URL to this page is + * https://www.example.com/paypal/action/return.html, the relative URL is + * paypal/action/return.html. + */ + return_url: string; +} + +/** + * Required input for Payflow Pro and Payments Pro payment methods. + */ +export interface GQLPayflowProInput { + + /** + * Required input for credit card related information + */ + cc_details: GQLCreditCardDetailsInput; + + /** + * States whether details about the customer's credit/debit card should be + * tokenized for later usage. Required only if Vault is enabled for PayPal + * Payflow Pro payment integration. + */ + is_active_payment_token_enabler?: boolean; +} + +/** + * Required fields for Payflow Pro and Payments Pro credit card payments + */ +export interface GQLCreditCardDetailsInput { + + /** + * Credit card expiration month + */ + cc_exp_month: number; + + /** + * Credit card expiration year + */ + cc_exp_year: number; + + /** + * Last 4 digits of the credit card + */ + cc_last_4: number; + + /** + * Credit card type + */ + cc_type: string; +} + +/** + * Required input for payment methods with Vault support. + */ +export interface GQLVaultTokenInput { + + /** + * The public hash of the payment token + */ + public_hash: string; +} + +/** + * Required input for Express Checkout and Payments Standard payments + */ +export interface GQLPaypalExpressInput { + + /** + * The unique ID of the PayPal user + */ + payer_id: string; + + /** + * The token returned by the createPaypalExpressToken mutation + */ + token: string; +} + +export interface GQLSetPaymentMethodOnCartOutput { + cart: GQLCart; +} + +export interface GQLShareWishlistInput { + + /** + * Receiver emails + */ + emails: Array; + + /** + * Sharing message + */ + message?: string; +} + +export interface GQLSaveAddressInformation { + billing_address: GQLAddressInput; + shipping_address: GQLAddressInput; + shipping_carrier_code?: string; + shipping_method_code?: string; +} + +export interface GQLAddressInput { + city?: string; + company?: string; + country_id?: string; + email?: string; + extension_attributes?: Array; + firstname?: string; + lastname?: string; + method?: string; + postcode?: string; + region?: string; + region_code?: string; + region_id?: number; + street?: Array; + telephone?: string; + vat_id?: string; +} + +export interface GQLAddressExtensionAttributes { + attribute_code?: string; + value?: string; +} + +export interface GQLPaymentDetails { + payment_methods?: Array; + totals?: GQLPaymentTotals; +} + +export interface GQLPaymentTotals extends GQLTotalsObject { + applied_rule_ids?: string; + base_currency_code?: string; + base_discount_amount?: number; + base_grand_total?: number; + base_shipping_amount?: number; + base_shipping_discount_amount?: number; + base_shipping_incl_tax?: number; + base_shipping_tax_amount?: number; + base_subtotal?: number; + base_subtotal_with_discount?: number; + base_tax_amount?: number; + coupon_code?: string; + customer_is_guest?: boolean; + customer_tax_class_id?: number; + discount_amount?: number; + grand_total?: number; + is_in_store_pickup_available?: boolean; + items?: Array; + items_count?: number; + items_qty?: number; + quote_currency_code?: string; + shipping_amount?: number; + shipping_discount_amount?: number; + shipping_incl_tax?: number; + shipping_method?: string; + shipping_tax_amount?: number; + store_id?: number; + subtotal?: number; + subtotal_incl_tax?: number; + subtotal_with_discount?: number; + tax_amount?: number; + weee_tax_applied_amount?: number; +} + +export interface GQLSendEmailToFriendInput { + product_id: number; + recipients: Array; + sender: GQLSendEmailToFriendSenderInput; +} + +export interface GQLSendEmailToFriendRecipientInput { + email: string; + name: string; +} + +export interface GQLSendEmailToFriendSenderInput { + email: string; + message: string; + name: string; +} + +export interface GQLSendEmailToFriendOutput { + recipients?: Array; + sender?: GQLSendEmailToFriendSender; +} + +export interface GQLSendEmailToFriendRecipient { + email: string; + name: string; +} + +export interface GQLSendEmailToFriendSender { + email: string; + message: string; + name: string; +} + +export interface GQLSetBillingAddressOnCartInput { + billing_address: GQLBillingAddressInput; + cart_id: string; +} + +export interface GQLSetGuestEmailOnCartInput { + cart_id: string; + email: string; +} + +export interface GQLSetGuestEmailOnCartOutput { + cart: GQLCart; +} + +export interface GQLSetPaymentMethodAndPlaceOrderInput { + cart_id: string; + payment_method: GQLPaymentMethodInput; +} + +export interface GQLSetPaymentMethodOnCartInput { + cart_id: string; + payment_method: GQLPaymentMethodInput; +} + +export interface GQLSetShippingAddressesOnCartInput { + cart_id: string; + shipping_addresses: Array; +} + +export interface GQLShippingAddressInput { + address?: GQLCartAddressInput; + customer_address_id?: number; + customer_notes?: string; + + /** + * The code of Pickup Location which will be used for In-Store Pickup. + */ + pickup_location_code?: string; +} + +export interface GQLSetShippingAddressesOnCartOutput { + cart: GQLCart; +} + +export interface GQLSetShippingMethodsOnCartInput { + cart_id: string; + shipping_methods: Array; +} + +export interface GQLShippingMethodInput { + carrier_code: string; + method_code: string; +} + +export interface GQLSetShippingMethodsOnCartOutput { + cart: GQLCart; +} + +export interface GQLSubscribeEmailToNewsletterOutput { + + /** + * Returns the status of the subscription request + */ + status?: GQLSubscriptionStatusesEnum; +} + +export enum GQLSubscriptionStatusesEnum { + NOT_ACTIVE = 'NOT_ACTIVE', + SUBSCRIBED = 'SUBSCRIBED', + UNSUBSCRIBED = 'UNSUBSCRIBED', + UNCONFIRMED = 'UNCONFIRMED' +} + +export interface GQLUpdateCartItemsInput { + cart_id: string; + cart_items: Array; +} + +export interface GQLCartItemUpdateInput { + + /** + * Deprecated. Use `cart_item_uid` instead. + */ + cart_item_id?: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + cart_item_uid?: string; + customizable_options?: Array; + + /** + * Gift message details for the cart item + */ + gift_message?: GQLGiftMessageInput; + quantity?: number; +} + +/** + * Contains the text of a gift message, its sender, and recipient + */ +export interface GQLGiftMessageInput { + + /** + * Sender name + */ + from: string; + + /** + * Gift message text + */ + message: string; + + /** + * Recipient name + */ + to: string; +} + +export interface GQLUpdateCartItemsOutput { + cart: GQLCart; +} + +export interface GQLCustomerUpdateInput { + + /** + * Indicates whether the customer has enabled remote shopping assistance + */ + allow_remote_shopping_assistance?: boolean; + + /** + * The customer's date of birth + */ + date_of_birth?: string; + + /** + * Deprecated: Use `date_of_birth` instead + */ + dob?: string; + + /** + * The customer's first name + */ + firstname?: string; + + /** + * The customer's gender (Male - 1, Female - 2) + */ + gender?: number; + + /** + * Indicates whether the customer is subscribed to the company's newsletter + */ + is_subscribed?: boolean; + + /** + * The customer's family name + */ + lastname?: string; + + /** + * The customer's middle name + */ + middlename?: string; + + /** + * An honorific, such as Dr., Mr., or Mrs. + */ + prefix?: string; + + /** + * A value such as Sr., Jr., or III + */ + suffix?: string; + + /** + * The customer's Tax/VAT number (for corporate customers) + */ + taxvat?: string; +} + +/** + * Defines updates to items in a wish list + */ +export interface GQLWishlistItemUpdateInput { + + /** + * Customer-entered comments about the item + */ + description?: string; + + /** + * An array of options that the customer entered + */ + entered_options?: Array; + + /** + * The new amount or number of this item + */ + quantity?: number; + + /** + * An array of strings corresponding to options the customer selected + */ + selected_options?: Array; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + wishlist_item_id: string; +} + +/** + * Contains the customer's wish list and any errors encountered + */ +export interface GQLUpdateProductsInWishlistOutput { + + /** + * An array of errors encountered while updating products in a wish list + */ + user_errors: Array; + + /** + * Contains the wish list with all items that were successfully updated + */ + wishlist: GQLWishlist; +} + +export interface GQLAvailabilityResponseType { + isAvailable?: boolean; +} + +export interface GQLBundleCartItem extends GQLCartItemInterface { + bundle_options: Array; + customizable_options: Array; + + /** + * The entered gift message for the cart item + */ + gift_message?: GQLGiftMessage; + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +export interface GQLBundleCreditMemoItem extends GQLCreditMemoItemInterface { + + /** + * A list of bundle options that are assigned to the bundle product + */ + bundle_options?: Array; + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `CreditMemoItemInterface` object + */ + id: string; + + /** + * The order item the credit memo is applied to + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** + * A list of options of the selected bundle product + */ +export interface GQLItemSelectedBundleOption { + + /** + * The unique ID for a `ItemSelectedBundleOption` object + * @deprecated Use `uid` instead + */ + id: string; + + /** + * The label of the option + */ + label: string; + + /** + * The unique ID for a `ItemSelectedBundleOption` object + */ + uid: string; + + /** + * A list of products that represent the values of the parent option + */ + values?: Array; +} + +/** + * A list of values for the selected bundle product + */ +export interface GQLItemSelectedBundleOptionValue { + + /** + * The unique ID for a `ItemSelectedBundleOptionValue` object + * @deprecated Use `uid` instead + */ + id: string; + + /** + * The price of the child bundle product + */ + price: GQLMoney; + + /** + * The name of the child bundle product + */ + product_name: string; + + /** + * The SKU of the child bundle product + */ + product_sku: string; + + /** + * Indicates how many of this bundle product were ordered + */ + quantity: number; + + /** + * The unique ID for a `ItemSelectedBundleOptionValue` object + */ + uid: string; +} + +export interface GQLBundleInvoiceItem extends GQLInvoiceItemInterface { + + /** + * A list of bundle options that are assigned to the bundle product + */ + bundle_options?: Array; + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `InvoiceItemInterface` object + */ + id: string; + + /** + * Contains details about an individual order item + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** + * BundleItem defines an individual item in a bundle product. + */ +export interface GQLBundleItem { + + /** + * An ID assigned to each type of item in a bundle product. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * An array of additional options for this bundle item. + */ + options?: Array; + + /** + * he relative position of this item compared to the other bundle items. + */ + position?: number; + + /** + * Indicates whether the item must be included in the bundle. + */ + required?: boolean; + + /** + * The SKU of the bundle product. + */ + sku?: string; + + /** + * The display name of the item. + */ + title?: string; + + /** + * The input type that the customer uses to select the item. Examples include radio button and checkbox. + */ + type?: string; + + /** + * The unique ID for a `BundleItem` object. + */ + uid?: string; +} + +/** + * BundleItemOption defines characteristics and options for a specific bundle item. + */ +export interface GQLBundleItemOption { + + /** + * Indicates whether the customer can change the number of items for this option. + */ + can_change_quantity?: boolean; + + /** + * The ID assigned to the bundled item option. + * @deprecated Use `uid` instead + */ + id?: number; + + /** + * Indicates whether this option is the default option. + */ + is_default?: boolean; + + /** + * The text that identifies the bundled item option. + */ + label?: string; + + /** + * When a bundle item contains multiple options, the relative position of this option compared to the other options. + */ + position?: number; + + /** + * The price of the selected option. + */ + price?: number; + + /** + * One of FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * Contains details about this product option. + */ + product?: GQLProductInterface; + + /** + * Indicates the quantity of this specific bundle item. + * @deprecated The `qty` is deprecated. Use `quantity` instead. + */ + qty?: number; + + /** + * Indicates the quantity of this specific bundle item. + */ + quantity?: number; + + /** + * The unique ID for a `BundleItemOption` object. + */ + uid: string; +} + +/** + * Represents order bundle item options + */ +export interface GQLBundleOptions { + items?: Array; + + /** + * Describes type of bundle option (radio, checkbox and etc) + */ + type: string; +} + +export interface GQLBundleOrderItem extends GQLOrderItemInterface { + + /** + * A list of bundle options that are assigned to the bundle product + */ + bundle_options?: Array; + + /** + * The final discount information for the product + */ + discounts?: Array; + + /** + * The entered option for the base product, such as a logo or image + */ + entered_options?: Array; + + /** + * The unique ID for a `OrderItemInterface` object + */ + id: string; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price of the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The type of product, such as simple, configurable, etc. + */ + product_type?: string; + + /** + * URL key of the base product + */ + product_url_key?: string; + + /** + * The number of canceled items + */ + quantity_canceled?: number; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The number of units ordered for this item + */ + quantity_ordered?: number; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The number of returned items + */ + quantity_returned?: number; + + /** + * The number of shipped items + */ + quantity_shipped?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; + + /** + * The selected options for the base product, such as color or size + */ + selected_options?: Array; + + /** + * The status of the order item + */ + status?: string; +} + +/** + * Defines basic features of a bundle product and contains multiple BundleItems + */ +export interface GQLBundleProduct extends GQLProductInterface, GQLRoutableInterface, GQLPhysicalProductInterface, GQLCustomizableProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Additional pricing info specific for bundle products + */ + bundle_options?: Array; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + + /** + * Indicates whether the bundle product has a dynamic price. + */ + dynamic_price?: boolean; + + /** + * Indicates whether the bundle product has a dynamic SK. + */ + dynamic_sku?: boolean; + + /** + * Indicates whether the bundle product has a dynamically calculated weight. + */ + dynamic_weight?: boolean; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + + /** + * An array containing information about individual bundle items. + */ + items?: Array; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * An array of options for a customizable product. + */ + options?: Array; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * One of PRICE_RANGE or AS_LOW_AS. + */ + price_view?: GQLPriceViewEnum; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + + /** + * Indicates whether to ship bundle items together or individually. + */ + ship_bundle_items?: GQLShipBundleItemsEnum; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: number; + yes_no?: number; +} + +/** + * PhysicalProductInterface contains attributes specific to tangible products. + */ +export interface GQLPhysicalProductInterface { + + /** + * The weight of the item, in units defined by the store. + */ + weight?: number; +} + +/** Use this to resolve interface type PhysicalProductInterface */ +export type GQLPossiblePhysicalProductInterfaceTypeNames = +'BundleProduct' | +'ConfigurableProduct' | +'SimpleProduct' | +'GroupedProduct'; + +export interface GQLPhysicalProductInterfaceNameMap { + PhysicalProductInterface: GQLPhysicalProductInterface; + BundleProduct: GQLBundleProduct; + ConfigurableProduct: GQLConfigurableProduct; + SimpleProduct: GQLSimpleProduct; + GroupedProduct: GQLGroupedProduct; +} + +/** + * CustomizableProductInterface contains information about customizable product options. + */ +export interface GQLCustomizableProductInterface { + + /** + * An array of options for a customizable product. + */ + options?: Array; +} + +/** Use this to resolve interface type CustomizableProductInterface */ +export type GQLPossibleCustomizableProductInterfaceTypeNames = +'BundleProduct' | +'ConfigurableProduct' | +'SimpleProduct' | +'DownloadableProduct' | +'VirtualProduct'; + +export interface GQLCustomizableProductInterfaceNameMap { + CustomizableProductInterface: GQLCustomizableProductInterface; + BundleProduct: GQLBundleProduct; + ConfigurableProduct: GQLConfigurableProduct; + SimpleProduct: GQLSimpleProduct; + DownloadableProduct: GQLDownloadableProduct; + VirtualProduct: GQLVirtualProduct; +} + +/** + * The CustomizableOptionInterface contains basic information about a customizable + * option. It can be implemented by several types of configurable options. + */ +export interface GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; +} + +/** Use this to resolve interface type CustomizableOptionInterface */ +export type GQLPossibleCustomizableOptionInterfaceTypeNames = +'CustomizableAreaOption' | +'CustomizableCheckboxOption' | +'CustomizableDateOption' | +'CustomizableDropDownOption' | +'CustomizableFieldOption' | +'CustomizableFileOption' | +'CustomizableMultipleOption' | +'CustomizableRadioOption'; + +export interface GQLCustomizableOptionInterfaceNameMap { + CustomizableOptionInterface: GQLCustomizableOptionInterface; + CustomizableAreaOption: GQLCustomizableAreaOption; + CustomizableCheckboxOption: GQLCustomizableCheckboxOption; + CustomizableDateOption: GQLCustomizableDateOption; + CustomizableDropDownOption: GQLCustomizableDropDownOption; + CustomizableFieldOption: GQLCustomizableFieldOption; + CustomizableFileOption: GQLCustomizableFileOption; + CustomizableMultipleOption: GQLCustomizableMultipleOption; + CustomizableRadioOption: GQLCustomizableRadioOption; +} + +/** + * This enumeration defines whether a bundle product's price is displayed as the lowest possible value or as a range. + */ +export enum GQLPriceViewEnum { + PRICE_RANGE = 'PRICE_RANGE', + AS_LOW_AS = 'AS_LOW_AS' +} + +/** + * This enumeration defines whether bundle items must be shipped together. + */ +export enum GQLShipBundleItemsEnum { + TOGETHER = 'TOGETHER', + SEPARATELY = 'SEPARATELY' +} + +export interface GQLBundleShipmentItem extends GQLShipmentItemInterface { + + /** + * A list of bundle options that are assigned to the bundle product + */ + bundle_options?: Array; + + /** + * The unique ID for a `ShipmentItemInterface` object + */ + id: string; + + /** + * Associated order item + */ + order_item?: GQLOrderItemInterface; + + /** + * Name of the base product + */ + product_name?: string; + + /** + * Sale price for the base product + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * Number of shipped items + */ + quantity_shipped: number; +} + +export interface GQLBundleWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * An array containing information about the selected bundle items + */ + bundle_options?: Array; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +export interface GQLColorSwatchData extends GQLSwatchDataInterface { + + /** + * Value of swatch item (HEX color code, image link or textual value) + */ + value?: string; +} + +export interface GQLSwatchDataInterface { + + /** + * Value of swatch item (HEX color code, image link or textual value) + */ + value?: string; +} + +/** Use this to resolve interface type SwatchDataInterface */ +export type GQLPossibleSwatchDataInterfaceTypeNames = +'ColorSwatchData' | +'ImageSwatchData' | +'TextSwatchData'; + +export interface GQLSwatchDataInterfaceNameMap { + SwatchDataInterface: GQLSwatchDataInterface; + ColorSwatchData: GQLColorSwatchData; + ImageSwatchData: GQLImageSwatchData; + TextSwatchData: GQLTextSwatchData; +} + +/** + * ConfigurableAttributeOption contains the value_index (and other related + * information) assigned to a configurable product option + */ +export interface GQLConfigurableAttributeOption { + + /** + * The ID assigned to the attribute + */ + code?: string; + + /** + * A string that describes the configurable attribute option + */ + label?: string; + + /** + * The unique ID for a `ConfigurableAttributeOption` object + */ + uid: string; + + /** + * A unique index number assigned to the configurable product option + */ + value_index?: number; +} + +export interface GQLConfigurableCartItem extends GQLCartItemInterface { + configurable_options: Array; + + /** + * Product details of the cart item + */ + configured_variant: GQLProductInterface; + customizable_options?: Array; + + /** + * The entered gift message for the cart item + */ + gift_message?: GQLGiftMessage; + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +export interface GQLSelectedConfigurableOption { + + /** + * The unique ID for a `ConfigurableProductOptions` object + */ + configurable_product_option_uid: string; + + /** + * The unique ID for a `ConfigurableProductOptionsValues` object + */ + configurable_product_option_value_uid: string; + + /** + * + * @deprecated Use SelectedConfigurableOption.configurable_product_option_uid instead + */ + id: number; + option_label: string; + + /** + * + * @deprecated Use SelectedConfigurableOption.configurable_product_option_value_uid instead + */ + value_id: number; + value_label: string; +} + +/** + * Configurable option available for further selection based on current selection. + */ +export interface GQLConfigurableOptionAvailableForSelection { + + /** + * Attribute code that uniquely identifies configurable option. + */ + attribute_code: string; + + /** + * Configurable option values available for further selection. + */ + option_value_uids: Array; +} + +/** + * ConfigurableProduct defines basic features of a configurable product and its simple product variants + */ +export interface GQLConfigurableProduct extends GQLProductInterface, GQLRoutableInterface, GQLPhysicalProductInterface, GQLCustomizableProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * An array of linked simple product items + */ + configurable_options?: Array; + + /** + * Specified configurable product options selection + */ + configurable_product_options_selection?: GQLConfigurableProductOptionsSelection; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * An array of options for a customizable product. + */ + options?: Array; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of variants of products + */ + variants?: Array; + + /** + * An array of variants of products, optimized version for PLP + */ + variants_plp?: Array; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: number; + yes_no?: number; +} + +/** + * ConfigurableProductOptions defines configurable attributes for the specified product + */ +export interface GQLConfigurableProductOptions { + + /** + * A string that identifies the attribute + */ + attribute_code?: string; + + /** + * The ID assigned to the attribute + * @deprecated Use attribute_uid instead + */ + attribute_id?: string; + + /** + * The ID assigned to the attribute + * @deprecated Use attribute_uid instead + */ + attribute_id_v2?: number; + + /** + * The unique ID for a `Attribute` object + */ + attribute_uid: string; + + /** + * The configurable option ID number assigned by the system + * @deprecated Use uid instead + */ + id?: number; + + /** + * A string that describes the configurable product option, which is displayed on the UI + */ + label?: string; + + /** + * A number that indicates the order in which the attribute is displayed + */ + position?: number; + + /** + * This is the same as a product's id field + * @deprecated `product_id` is not needed and can be obtained from it's parent + */ + product_id?: number; + + /** + * The unique ID for a `ConfigurableProductOptions` object + */ + uid: string; + + /** + * Indicates whether the option is the default + */ + use_default?: boolean; + + /** + * An array that defines the value_index codes assigned to the configurable product + */ + values?: Array; +} + +/** + * ConfigurableProductOptionsValues contains the index number assigned to a configurable product option + */ +export interface GQLConfigurableProductOptionsValues { + + /** + * The label of the product on the default store + */ + default_label?: string; + + /** + * The label of the product + */ + label?: string; + + /** + * The label of the product on the current store + */ + store_label?: string; + + /** + * Swatch data for configurable product option + */ + swatch_data?: GQLSwatchDataInterface; + + /** + * The unique ID for a `ConfigurableProductOptionsValues` object + */ + uid?: string; + + /** + * Indicates whether to use the default_label + */ + use_default_value?: boolean; + + /** + * A unique index number assigned to the configurable product option + * @deprecated Use `uid` instead + */ + value_index?: number; +} + +/** + * Metadata corresponding to the configurable options selection. + */ +export interface GQLConfigurableProductOptionsSelection { + + /** + * Configurable options available for further selection based on current selection. + */ + configurable_options?: Array; + + /** + * Product images and videos corresponding to the specified configurable options selection. + */ + media_gallery?: Array; + + /** + * Configurable options available for further selection based on current selection. + */ + options_available_for_selection?: Array; + + /** + * Variant represented by the specified configurable options selection. It is + * expected to be null, until selections are made for each configurable option. + */ + variant?: GQLSimpleProduct; +} + +export interface GQLConfigurableProductOption { + attribute_code: string; + label: string; + uid: string; + values?: Array; +} + +export interface GQLConfigurableProductOptionValue { + is_available: boolean; + is_use_default: boolean; + label: string; + swatch?: GQLSwatchDataInterface; + uid: string; +} + +/** + * A simple product is tangible and is usually sold in single units or in fixed quantities + */ +export interface GQLSimpleProduct extends GQLProductInterface, GQLRoutableInterface, GQLPhysicalProductInterface, GQLCustomizableProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * An array of options for a customizable product. + */ + options?: Array; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: number; + yes_no?: number; +} + +/** + * An array containing all the simple product variants of a configurable product + */ +export interface GQLConfigurableVariant { + attributes?: Array; + product?: GQLSimpleProduct; +} + +/** + * A configurable product wish list item + */ +export interface GQLConfigurableWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * The SKU of the simple product corresponding to a set of selected configurable options + */ + child_sku: string; + + /** + * An array of selected configurable options + */ + configurable_options?: Array; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +export interface GQLCreditMemoItem extends GQLCreditMemoItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `CreditMemoItemInterface` object + */ + id: string; + + /** + * The order item the credit memo is applied to + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** + * CustomizableAreaOption contains information about a text area that is defined as part of a customizable option. + */ +export interface GQLCustomizableAreaOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * The Stock Keeping Unit of the base product. + */ + product_sku?: string; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An object that defines a text area. + */ + value?: GQLCustomizableAreaValue; +} + +/** + * CustomizableAreaValue defines the price and sku of a product whose page contains a customized text area. + */ +export interface GQLCustomizableAreaValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The maximum number of characters that can be entered for this customizable option. + */ + max_characters?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The unique ID for a `CustomizableAreaValue` object. + */ + uid: string; +} + +/** + * CustomizableCheckbbixOption contains information about a set of checkbox values + * that are defined as part of a customizable option. + */ +export interface GQLCustomizableCheckboxOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An array that defines a set of checkbox values. + */ + value?: Array; +} + +/** + * CustomizableCheckboxValue defines the price and sku of a product whose page contains a customized set of checkbox values. + */ +export interface GQLCustomizableCheckboxValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The ID assigned to the value. + */ + option_type_id?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The order in which the checkbox value is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + + /** + * The unique ID for a `CustomizableCheckboxValue` object. + */ + uid: string; +} + +/** + * CustomizableDateOption contains information about a date picker that is defined as part of a customizable option. + */ +export interface GQLCustomizableDateOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * The Stock Keeping Unit of the base product. + */ + product_sku?: string; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An object that defines a date field in a customizable option. + */ + value?: GQLCustomizableDateValue; +} + +/** + * CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker. + */ +export interface GQLCustomizableDateValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * DATE, DATE_TIME or TIME + */ + type?: GQLCustomizableDateTypeEnum; + + /** + * The unique ID for a `CustomizableDateValue` object. + */ + uid: string; +} + +/** + * This enumeration customizable date type. + */ +export enum GQLCustomizableDateTypeEnum { + DATE = 'DATE', + DATE_TIME = 'DATE_TIME', + TIME = 'TIME' +} + +/** + * CustomizableDropDownOption contains information about a drop down menu that is defined as part of a customizable option. + */ +export interface GQLCustomizableDropDownOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An array that defines the set of options for a drop down menu. + */ + value?: Array; +} + +/** + * CustomizableDropDownValue defines the price and sku of a product whose page contains a customized drop down menu. + */ +export interface GQLCustomizableDropDownValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The ID assigned to the value. + */ + option_type_id?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + + /** + * The unique ID for a `CustomizableDropDownValue` object. + */ + uid: string; +} + +/** + * CustomizableFieldOption contains information about a text field that is defined as part of a customizable option. + */ +export interface GQLCustomizableFieldOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * The Stock Keeping Unit of the base product. + */ + product_sku?: string; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An object that defines a text field. + */ + value?: GQLCustomizableFieldValue; +} + +/** + * CustomizableFieldValue defines the price and sku of a product whose page contains a customized text field. + */ +export interface GQLCustomizableFieldValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * Option file extensions (If type file). + */ + file_extension?: string; + + /** + * The maximum number of characters that can be entered for this customizable option. + */ + max_characters?: number; + + /** + * The price of the custom value. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The unique ID for a `CustomizableFieldValue` object. + */ + uid: string; +} + +/** + * CustomizableFileOption contains information about a file picker that is defined as part of a customizable option. + */ +export interface GQLCustomizableFileOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * The Stock Keeping Unit of the base product. + */ + product_sku?: string; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An object that defines a file value. + */ + value?: GQLCustomizableFileValue; +} + +/** + * CustomizableFileValue defines the price and sku of a product whose page contains a customized file picker. + */ +export interface GQLCustomizableFileValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The file extension to accept. + */ + file_extension?: string; + + /** + * The maximum width of an image. + */ + image_size_x?: number; + + /** + * The maximum height of an image. + */ + image_size_y?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The unique ID for a `CustomizableFileValue` object. + */ + uid: string; +} + +/** + * CustomizableMultipleOption contains information about a multiselect that is defined as part of a customizable option. + */ +export interface GQLCustomizableMultipleOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An array that defines the set of options for a multiselect. + */ + value?: Array; +} + +/** + * CustomizableMultipleValue defines the price and sku of a product whose page contains a customized multiselect. + */ +export interface GQLCustomizableMultipleValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The ID assigned to the value. + */ + option_type_id?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + + /** + * The unique ID for a `CustomizableMultipleValue` object. + */ + uid: string; +} + +/** + * CustomizableRadioOption contains information about a set of radio buttons that are defined as part of a customizable option. + */ +export interface GQLCustomizableRadioOption extends GQLCustomizableOptionInterface { + + /** + * Option ID. + * @deprecated Use `uid` instead + */ + option_id?: number; + + /** + * Indicates whether the option is required. + */ + required?: boolean; + + /** + * The order in which the option is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + type?: string; + + /** + * The unique ID for a `CustomizableOptionInterface` object. + */ + uid: string; + + /** + * An array that defines a set of radio buttons. + */ + value?: Array; +} + +/** + * CustomizableRadioValue defines the price and sku of a product whose page contains a customized set of radio buttons. + */ +export interface GQLCustomizableRadioValue { + + /** + * Currency code for the option. + */ + currency?: string; + + /** + * The ID assigned to the value. + */ + option_type_id?: number; + + /** + * The price assigned to this option. + */ + price?: number; + + /** + * Option value price excluding tax. + */ + priceExclTax?: number; + + /** + * Option value price including tax. + */ + priceInclTax?: number; + + /** + * FIXED, PERCENT, or DYNAMIC. + */ + price_type?: GQLPriceTypeEnum; + + /** + * The Stock Keeping Unit for this option. + */ + sku?: string; + + /** + * The order in which the radio button is displayed. + */ + sort_order?: number; + + /** + * The display name for this option. + */ + title?: string; + + /** + * The unique ID for a `CustomizableRadioValue` object. + */ + uid: string; +} + +/** + * Downloadable Cart Item + */ +export interface GQLDownloadableCartItem extends GQLCartItemInterface { + customizable_options: Array; + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + + /** + * An array containing information about the links for the added to cart downloadable product + */ + links?: Array; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * DownloadableProductSamples defines characteristics of a downloadable product + */ + samples?: Array; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +/** + * DownloadableProductLinks defines characteristics of a downloadable product + */ +export interface GQLDownloadableProductLinks { + + /** + * + * @deprecated This information should not be exposed on frontend + */ + id?: number; + + /** + * + * @deprecated This information should not be exposed on frontend + */ + is_shareable?: boolean; + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + link_type?: GQLDownloadableFileTypeEnum; + + /** + * + * @deprecated This information should not be exposed on frontend + */ + number_of_downloads?: number; + + /** + * The price of the downloadable product + */ + price?: number; + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + sample_file?: string; + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + sample_type?: GQLDownloadableFileTypeEnum; + + /** + * URL to the downloadable sample + */ + sample_url?: string; + + /** + * A number indicating the sort order + */ + sort_order?: number; + + /** + * The display name of the link + */ + title?: string; + + /** + * The unique ID for a `DownloadableProductLinks` object. + */ + uid: string; +} + +export enum GQLDownloadableFileTypeEnum { + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + FILE = 'FILE', + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + URL = 'URL' +} + +/** + * DownloadableProductSamples defines characteristics of a downloadable product + */ +export interface GQLDownloadableProductSamples { + + /** + * + * @deprecated This information should not be exposed on frontend + */ + id?: number; + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + sample_file?: string; + + /** + * + * @deprecated `sample_url` serves to get the downloadable sample + */ + sample_type?: GQLDownloadableFileTypeEnum; + + /** + * URL to the downloadable sample + */ + sample_url?: string; + + /** + * A number indicating the sort order + */ + sort_order?: number; + + /** + * The display name of the sample + */ + title?: string; +} + +export interface GQLDownloadableCreditMemoItem extends GQLCreditMemoItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * A list of downloadable links that are refunded from the downloadable product + */ + downloadable_links?: Array; + + /** + * The unique ID for a `CreditMemoItemInterface` object + */ + id: string; + + /** + * The order item the credit memo is applied to + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +/** + * DownloadableProductLinks defines characteristics of a downloadable product + */ +export interface GQLDownloadableItemsLinks { + + /** + * A number indicating the sort order + */ + sort_order?: number; + + /** + * The display name of the link + */ + title?: string; + + /** + * The unique ID for a `DownloadableItemsLinks` object. + */ + uid: string; +} + +export interface GQLDownloadableInvoiceItem extends GQLInvoiceItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * A list of downloadable links that are invoiced from the downloadable product + */ + downloadable_links?: Array; + + /** + * The unique ID for a `InvoiceItemInterface` object + */ + id: string; + + /** + * Contains details about an individual order item + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +export interface GQLDownloadableOrderItem extends GQLOrderItemInterface { + + /** + * The final discount information for the product + */ + discounts?: Array; + + /** + * A list of downloadable links that are ordered from the downloadable product + */ + downloadable_links?: Array; + + /** + * The entered option for the base product, such as a logo or image + */ + entered_options?: Array; + + /** + * The unique ID for a `OrderItemInterface` object + */ + id: string; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price of the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The type of product, such as simple, configurable, etc. + */ + product_type?: string; + + /** + * URL key of the base product + */ + product_url_key?: string; + + /** + * The number of canceled items + */ + quantity_canceled?: number; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The number of units ordered for this item + */ + quantity_ordered?: number; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The number of returned items + */ + quantity_returned?: number; + + /** + * The number of shipped items + */ + quantity_shipped?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; + + /** + * The selected options for the base product, such as color or size + */ + selected_options?: Array; + + /** + * The status of the order item + */ + status?: string; +} + +/** + * DownloadableProduct defines a product that the shopper downloads + */ +export interface GQLDownloadableProduct extends GQLProductInterface, GQLRoutableInterface, GQLCustomizableProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + + /** + * An array containing information about the links for this downloadable product + */ + downloadable_product_links?: Array; + + /** + * An array containing information about samples of this downloadable product. + */ + downloadable_product_samples?: Array; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + license_key?: string; + + /** + * A value of 1 indicates that each link in the array must be purchased separately + */ + links_purchased_separately?: number; + + /** + * The heading above the list of downloadable products + */ + links_title?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * An array of options for a customizable product. + */ + options?: Array; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + samples_title?: string; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + yes_no?: number; +} + +/** + * A downloadable product wish list item + */ +export interface GQLDownloadableWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * An array containing information about the selected links + */ + links_v2?: Array; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; + + /** + * An array containing information about the selected samples + */ + samples?: Array; +} + +export interface GQLExtensionAttributes { + tax_grandtotal_details?: Array; +} + +export interface GQLTaxGrandTotalDetails { + amount?: number; + group_id?: number; +} + +/** + * A grouped product consists of simple standalone products that are presented as a group + */ +export interface GQLGroupedProduct extends GQLProductInterface, GQLRoutableInterface, GQLPhysicalProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + + /** + * An array containing grouped product items + */ + items?: Array; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: number; + yes_no?: number; +} + +/** + * GroupedProductItem contains information about an individual grouped product item + */ +export interface GQLGroupedProductItem { + + /** + * The relative position of this item compared to the other group items + */ + position?: number; + + /** + * The ProductInterface object, which contains details about this product option + */ + product?: GQLProductInterface; + + /** + * The quantity of this grouped product item + */ + qty?: number; +} + +/** + * A grouped product wish list item + */ +export interface GQLGroupedProductWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +export interface GQLImageSwatchData extends GQLSwatchDataInterface { + + /** + * Thumbnail swatch image URL + */ + thumbnail?: string; + + /** + * Value of swatch item (HEX color code, image link or textual value) + */ + value?: string; +} + +export interface GQLInvoiceItem extends GQLInvoiceItemInterface { + + /** + * Contains information about the final discount amount for the base product, including discounts on options + */ + discounts?: Array; + + /** + * The unique ID for a `InvoiceItemInterface` object + */ + id: string; + + /** + * Contains details about an individual order item + */ + order_item?: GQLOrderItemInterface; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price for the base product including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; +} + +export interface GQLLayerFilterItem extends GQLLayerFilterItemInterface { + + /** + * Count of items by filter. + * @deprecated Use AggregationOption.count instead. + */ + items_count?: number; + + /** + * Filter label. + * @deprecated Use AggregationOption.label instead. + */ + label?: string; + + /** + * Value for filter request variable to be used in query. + * @deprecated Use AggregationOption.value instead. + */ + value_string?: string; +} + +export interface GQLOrderItem extends GQLOrderItemInterface { + + /** + * The final discount information for the product + */ + discounts?: Array; + + /** + * The entered option for the base product, such as a logo or image + */ + entered_options?: Array; + + /** + * The unique ID for a `OrderItemInterface` object + */ + id: string; + + /** + * The name of the base product + */ + product_name?: string; + + /** + * The sale price of the base product, including selected options + */ + product_sale_price: GQLMoney; + + /** + * The SKU of the base product + */ + product_sku: string; + + /** + * The type of product, such as simple, configurable, etc. + */ + product_type?: string; + + /** + * URL key of the base product + */ + product_url_key?: string; + + /** + * The number of canceled items + */ + quantity_canceled?: number; + + /** + * The number of invoiced items + */ + quantity_invoiced?: number; + + /** + * The number of units ordered for this item + */ + quantity_ordered?: number; + + /** + * The number of refunded items + */ + quantity_refunded?: number; + + /** + * The number of returned items + */ + quantity_returned?: number; + + /** + * The number of shipped items + */ + quantity_shipped?: number; + + /** + * The row subtotal price, including selected options + */ + row_subtotal: GQLMoney; + + /** + * The selected options for the base product, such as color or size + */ + selected_options?: Array; + + /** + * The status of the order item + */ + status?: string; +} + +/** + * Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods. + */ +export interface GQLPayflowProToken { + response_message: string; + result: number; + result_code: number; + secure_token: string; + secure_token_id: string; +} + +export interface GQLPaymentInformation { + billing_address: GQLAddressInput; + paymentMethod: GQLPaymentMethodInput; +} + +/** + * ProductFilterInput is deprecated, use @ProductAttributeFilterInput instead. + * ProductFilterInput defines the filters to be used in the search. A filter + * contains at least one attribute, a comparison operator, and the value that is + * being searched for. + */ +export interface GQLProductFilterInput { + + /** + * Category ID the product belongs to. + */ + category_id?: GQLFilterTypeInput; + + /** + * The product's country of origin. + */ + country_of_manufacture?: GQLFilterTypeInput; + + /** + * Timestamp indicating when the product was created. + */ + created_at?: GQLFilterTypeInput; + + /** + * The name of a custom layout. + */ + custom_layout?: GQLFilterTypeInput; + + /** + * XML code that is applied as a layout update to the product page. + */ + custom_layout_update?: GQLFilterTypeInput; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLFilterTypeInput; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: GQLFilterTypeInput; + + /** + * Indicates whether additional attributes have been created for the product. + */ + has_options?: GQLFilterTypeInput; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLFilterTypeInput; + + /** + * The label assigned to a product image. + */ + image_label?: GQLFilterTypeInput; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: GQLFilterTypeInput; + + /** + * The numeric maximal price of the product. Do not include the currency code. + */ + max_price?: GQLFilterTypeInput; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: GQLFilterTypeInput; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: GQLFilterTypeInput; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: GQLFilterTypeInput; + + /** + * The numeric minimal price of the product. Do not include the currency code. + */ + min_price?: GQLFilterTypeInput; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: GQLFilterTypeInput; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + */ + news_from_date?: GQLFilterTypeInput; + + /** + * The end date for new product listings. + */ + news_to_date?: GQLFilterTypeInput; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: GQLFilterTypeInput; + + /** + * The keyword required to perform a logical OR comparison. + */ + or?: GQLProductFilterInput; + + /** + * The price of an item. + */ + price?: GQLFilterTypeInput; + + /** + * Indicates whether the product has required options. + */ + required_options?: GQLFilterTypeInput; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLFilterTypeInput; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: GQLFilterTypeInput; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLFilterTypeInput; + + /** + * The label assigned to a product's small image. + */ + small_image_label?: GQLFilterTypeInput; + + /** + * The beginning date that a product has a special price. + */ + special_from_date?: GQLFilterTypeInput; + + /** + * The discounted price of the product. Do not include the currency code. + */ + special_price?: GQLFilterTypeInput; + + /** + * The end date that a product has a special price. + */ + special_to_date?: GQLFilterTypeInput; + + /** + * The file name of a swatch image + */ + swatch_image?: GQLFilterTypeInput; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLFilterTypeInput; + + /** + * The label assigned to a product's thumbnail image. + */ + thumbnail_label?: GQLFilterTypeInput; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + */ + tier_price?: GQLFilterTypeInput; + + /** + * Timestamp indicating when the product was updated. + */ + updated_at?: GQLFilterTypeInput; + + /** + * The part of the URL that identifies the product + */ + url_key?: GQLFilterTypeInput; + url_path?: GQLFilterTypeInput; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: GQLFilterTypeInput; +} + +/** + * Extend product Image fields for frontend-driven loading mechanism + */ +export interface GQLProductImage extends GQLMediaGalleryInterface { + + /** + * Whether the image is hidden from view. + */ + disabled?: boolean; + + /** + * The label of the product image or video. + */ + label?: string; + + /** + * Relative path to origin image + */ + path?: string; + + /** + * The media item's position after it has been sorted. + */ + position?: number; + + /** + * The URL of the product image or video. + */ + url?: string; +} + +/** + * ProductLinks is an implementation of ProductLinksInterface. + */ +export interface GQLProductLinks extends GQLProductLinksInterface { + + /** + * One of related, associated, upsell, or crosssell. + */ + link_type?: string; + + /** + * The SKU of the linked product. + */ + linked_product_sku?: string; + + /** + * The type of linked product (simple, virtual, bundle, downloadable, grouped, configurable). + */ + linked_product_type?: string; + + /** + * The position within the list of product links. + */ + position?: number; + + /** + * The identifier of the linked product. + */ + sku?: string; +} + +/** + * ProductSortInput is deprecated, use @ProductAttributeSortInput instead. + * ProductSortInput specifies the attribute to use for sorting search results and + * indicates whether the results are sorted in ascending or descending order. + */ +export interface GQLProductSortInput { + + /** + * The product's country of origin. + */ + country_of_manufacture?: GQLSortEnum; + + /** + * Timestamp indicating when the product was created. + */ + created_at?: GQLSortEnum; + + /** + * The name of a custom layout. + */ + custom_layout?: GQLSortEnum; + + /** + * XML code that is applied as a layout update to the product page. + */ + custom_layout_update?: GQLSortEnum; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLSortEnum; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: GQLSortEnum; + + /** + * Indicates whether additional attributes have been created for the product. + */ + has_options?: GQLSortEnum; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLSortEnum; + + /** + * The label assigned to a product image. + */ + image_label?: GQLSortEnum; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: GQLSortEnum; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: GQLSortEnum; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: GQLSortEnum; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: GQLSortEnum; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: GQLSortEnum; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + */ + news_from_date?: GQLSortEnum; + + /** + * The end date for new product listings. + */ + news_to_date?: GQLSortEnum; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: GQLSortEnum; + + /** + * The price of the item. + */ + price?: GQLSortEnum; + + /** + * Indicates whether the product has required options. + */ + required_options?: GQLSortEnum; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLSortEnum; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: GQLSortEnum; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLSortEnum; + + /** + * The label assigned to a product's small image. + */ + small_image_label?: GQLSortEnum; + + /** + * The beginning date that a product has a special price. + */ + special_from_date?: GQLSortEnum; + + /** + * The discounted price of the product. + */ + special_price?: GQLSortEnum; + + /** + * The end date that a product has a special price. + */ + special_to_date?: GQLSortEnum; + + /** + * The file name of a swatch image + */ + swatch_image?: GQLSortEnum; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLSortEnum; + + /** + * The label assigned to a product's thumbnail image. + */ + thumbnail_label?: GQLSortEnum; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + */ + tier_price?: GQLSortEnum; + + /** + * Timestamp indicating when the product was updated. + */ + updated_at?: GQLSortEnum; + + /** + * The part of the URL that identifies the product + */ + url_key?: GQLSortEnum; + url_path?: GQLSortEnum; + + /** + * The weight of the item, in units defined by the store. + */ + weight?: GQLSortEnum; +} + +/** + * Contains information about a product video. + */ +export interface GQLProductVideo extends GQLMediaGalleryInterface { + + /** + * Whether the image is hidden from view. + */ + disabled?: boolean; + + /** + * The label of the product image or video. + */ + label?: string; + + /** + * The media item's position after it has been sorted. + */ + position?: number; + + /** + * The URL of the product image or video. + */ + url?: string; + + /** + * Contains a ProductMediaGalleryEntriesVideoContent object. + */ + video_content?: GQLProductMediaGalleryEntriesVideoContent; +} + +export interface GQLSalesItemInterface { + + /** + * The entered gift message for the order item + */ + gift_message?: GQLGiftMessage; +} + +export interface GQLShipmentItem extends GQLShipmentItemInterface { + + /** + * The unique ID for a `ShipmentItemInterface` object + */ + id: string; + + /** + * Associated order item + */ + order_item?: GQLOrderItemInterface; + + /** + * Name of the base product + */ + product_name?: string; + + /** + * Sale price for the base product + */ + product_sale_price: GQLMoney; + + /** + * SKU of the base product + */ + product_sku: string; + + /** + * Number of shipped items + */ + quantity_shipped: number; +} + +/** + * Simple Cart Item + */ +export interface GQLSimpleCartItem extends GQLCartItemInterface { + customizable_options: Array; + + /** + * The entered gift message for the cart item + */ + gift_message?: GQLGiftMessage; + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +/** + * A simple product wish list Item + */ +export interface GQLSimpleWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +export interface GQLSwatchLayerFilterItem extends GQLLayerFilterItemInterface, GQLSwatchLayerFilterItemInterface { + + /** + * Count of items by filter. + * @deprecated Use AggregationOption.count instead. + */ + items_count?: number; + + /** + * Filter label. + * @deprecated Use AggregationOption.label instead. + */ + label?: string; + + /** + * Data required to render swatch filter item + */ + swatch_data?: GQLSwatchData; + + /** + * Value for filter request variable to be used in query. + * @deprecated Use AggregationOption.value instead. + */ + value_string?: string; +} + +export interface GQLSwatchLayerFilterItemInterface { + + /** + * Data required to render swatch filter item + */ + swatch_data?: GQLSwatchData; +} + +/** Use this to resolve interface type SwatchLayerFilterItemInterface */ +export type GQLPossibleSwatchLayerFilterItemInterfaceTypeNames = +'SwatchLayerFilterItem'; + +export interface GQLSwatchLayerFilterItemInterfaceNameMap { + SwatchLayerFilterItemInterface: GQLSwatchLayerFilterItemInterface; + SwatchLayerFilterItem: GQLSwatchLayerFilterItem; +} + +export interface GQLTextSwatchData extends GQLSwatchDataInterface { + + /** + * Value of swatch item (HEX color code, image link or textual value) + */ + value?: string; +} + +export interface GQLTotalsSegment { + code?: string; + extension_attributes?: GQLExtensionAttributes; + title?: string; + value?: number; +} + +/** + * Virtual Cart Item + */ +export interface GQLVirtualCartItem extends GQLCartItemInterface { + customizable_options: Array; + + /** + * + * @deprecated Use `uid` instead + */ + id: string; + prices?: GQLCartItemPrices; + product: GQLProductInterface; + quantity: number; + + /** + * The unique ID for a `CartItemInterface` object + */ + uid: string; +} + +/** + * A virtual product is a non-tangible product that does not require shipping and is not kept in inventory + */ +export interface GQLVirtualProduct extends GQLProductInterface, GQLRoutableInterface, GQLCustomizableProductInterface { + New_attribute_size?: number; + New_multiple_attribute?: string; + Test_Ainars?: number; + attribute_allows_html?: string; + + /** + * The attribute set assigned to the product. + * @deprecated The field should not be used on the storefront. + */ + attribute_set_id?: number; + brand?: string; + + /** + * Relative canonical URL. This value is returned only if the system setting 'Use + * Canonical Link Meta Tag For Products' is enabled + */ + canonical_url?: string; + + /** + * The categories assigned to a product. + */ + categories?: Array; + clothing_colour?: number; + clothing_gender?: number; + clothing_size?: number; + clothing_type?: number; + color?: number; + color_elena?: number; + colors_with_images?: number; + + /** + * The product's country of origin. + */ + country_of_manufacture?: string; + + /** + * Timestamp indicating when the product was created. + * @deprecated The field should not be used on the storefront. + */ + created_at?: string; + + /** + * Crosssell Products + */ + crosssell_products?: Array; + + /** + * Detailed information about the product. The value can include simple HTML tags. + */ + description?: GQLComplexTextValue; + fit?: number; + + /** + * Indicates whether a gift message is available. + */ + gift_message_available?: string; + + /** + * The ID number assigned to the product. + * @deprecated Use the `uid` field instead. + */ + id?: number; + + /** + * The relative path to the main image on the product page. + */ + image?: GQLOptimizedProductImage; + images_type_map?: number; + license_key?: string; + + /** + * A number representing the product's manufacturer. + */ + manufacturer?: number; + material?: string; + + /** + * An array of Media Gallery objects. + */ + media_gallery?: Array; + + /** + * An array of MediaGalleryEntry objects. + * @deprecated Use product's `media_gallery` instead + */ + media_gallery_entries?: Array; + memory?: number; + + /** + * A brief overview of the product for search results listings, maximum 255 characters. + */ + meta_description?: string; + + /** + * A comma-separated list of keywords that are visible only to search engines. + */ + meta_keyword?: string; + + /** + * A string that is displayed in the title bar and tab of the browser and in search results lists. + */ + meta_title?: string; + multiple_attribute?: string; + + /** + * The product name. Customers use this name to identify the product. + */ + name?: string; + + /** + * The beginning date for new product listings, and determines if the product is featured as a new product. + * @deprecated The field should not be used on the storefront. + */ + new_from_date?: string; + + /** + * The end date for new product listings. + * @deprecated The field should not be used on the storefront. + */ + new_to_date?: string; + + /** + * Product stock only x left count + */ + only_x_left_in_stock?: number; + + /** + * An array of options for a customizable product. + */ + options?: Array; + + /** + * If the product has multiple options, determines where they appear on the product page. + */ + options_container?: string; + original_price?: number; + + /** + * A ProductPrices object, indicating the price of an item. + * @deprecated Use price_range for product price information. + */ + price?: GQLProductPrices; + + /** + * A PriceRange object, indicating the range of prices for the product + */ + price_range: GQLPriceRange; + + /** + * An array of TierPrice objects. + */ + price_tiers?: Array; + + /** + * An array of ProductLinks objects. + */ + product_links?: Array; + + /** + * Qty field for checkout order view + */ + qty?: number; + quantity?: number; + ranking?: number; + + /** + * The average of all the ratings given to the product. + */ + rating_summary: number; + + /** + * Contains 0 when there is no redirect error. A value of 301 indicates the URL + * of the requested resource has been changed permanently, while a value of 302 + * indicates a temporary redirect + */ + redirect_code: number; + + /** + * Related Products + */ + related_products?: Array; + + /** + * The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original + */ + relative_url?: string; + + /** + * The total count of all the reviews given to the product. + */ + review_count: number; + + /** + * The list of products reviews. + */ + reviews: GQLProductReviews; + row_total?: number; + s_attributes?: Array; + salable_qty?: number; + shoes_size?: number; + + /** + * A short description of the product. Its use depends on the theme. + */ + short_description?: GQLComplexTextValue; + size?: number; + + /** + * A number or code assigned to a product to identify the product, options, price, and manufacturer. + */ + sku?: string; + + /** + * The relative path to the small image, which is used on catalog pages. + */ + small_image?: GQLOptimizedProductImage; + + /** + * The beginning date that a product has a special price. + * @deprecated The field should not be used on the storefront. + */ + special_from_date?: string; + + /** + * The discounted price of the product. + */ + special_price?: number; + + /** + * The end date that a product has a special price. + */ + special_to_date?: string; + stock_item?: GQLProductStockItem; + + /** + * Stock status of the product + */ + stock_status?: GQLProductStockStatus; + + /** + * The file name of a swatch image + */ + swatch_image?: string; + test?: number; + texture?: number; + + /** + * The relative path to the product's thumbnail image. + */ + thumbnail?: GQLOptimizedProductImage; + + /** + * The price when tier pricing is in effect and the items purchased threshold has been reached. + * @deprecated Use price_tiers for product tier price information. + */ + tier_price?: number; + + /** + * An array of ProductTierPrices objects. + * @deprecated Use price_tiers for product tier price information. + */ + tier_prices?: Array; + + /** + * One of PRODUCT, CATEGORY, or CMS_PAGE. + */ + type?: GQLUrlRewriteEntityTypeEnum; + + /** + * One of simple, virtual, bundle, downloadable, grouped, or configurable. + * @deprecated Use __typename instead. + */ + type_id?: string; + + /** + * The unique ID for a `ProductInterface` object. + */ + uid: string; + + /** + * Timestamp indicating when the product was updated. + * @deprecated The field should not be used on the storefront. + */ + updated_at?: string; + + /** + * Upsell Products + */ + upsell_products?: Array; + url?: string; + + /** + * The part of the URL that identifies the product + */ + url_key?: string; + + /** + * + * @deprecated Use product's `canonical_url` or url rewrites instead + */ + url_path?: string; + + /** + * URL rewrites list + */ + url_rewrites?: Array; + + /** + * The part of the product URL that is appended after the url key + */ + url_suffix?: string; + valuesss?: number; + + /** + * An array of websites in which the product is available. + * @deprecated The field should not be used on the storefront. + */ + websites?: Array; + yes_no?: number; +} + +/** + * A virtual product wish list item + */ +export interface GQLVirtualWishlistItem extends GQLWishlistItemInterface { + + /** + * The date and time the item was added to the wish list + */ + added_at: string; + + /** + * Custom options selected for the wish list item + */ + customizable_options: Array; + + /** + * The description of the item + */ + description?: string; + + /** + * The unique ID for a `WishlistItemInterface` object + */ + id: string; + + /** + * Product details of the wish list item + */ + product?: GQLProductInterface; + + /** + * The quantity of this wish list item + */ + quantity: number; +} + +/********************************* + * * + * TYPE RESOLVERS * + * * + *********************************/ +/** + * This interface define the shape of your resolver + * Note that this type is designed to be compatible with graphql-tools resolvers + * However, you can still use other generated interfaces to make your resolver type-safed + */ +export interface GQLResolver { + Query?: GQLQueryTypeResolver; + StoreConfig?: GQLStoreConfigTypeResolver; + PriceTaxDisplay?: GQLPriceTaxDisplayTypeResolver; + SendFriendConfiguration?: GQLSendFriendConfigurationTypeResolver; + Cart?: GQLCartTypeResolver; + AppliedCoupon?: GQLAppliedCouponTypeResolver; + AvailablePaymentMethod?: GQLAvailablePaymentMethodTypeResolver; + BillingCartAddress?: GQLBillingCartAddressTypeResolver; + CartAddressInterface?: { + __resolveType: GQLCartAddressInterfaceTypeResolver + }; + + CartAddressCountry?: GQLCartAddressCountryTypeResolver; + CartAddressRegion?: GQLCartAddressRegionTypeResolver; + GiftMessage?: GQLGiftMessageTypeResolver; + CartItemInterface?: { + __resolveType: GQLCartItemInterfaceTypeResolver + }; + + CartItemPrices?: GQLCartItemPricesTypeResolver; + Discount?: GQLDiscountTypeResolver; + Money?: GQLMoneyTypeResolver; + FixedProductTax?: GQLFixedProductTaxTypeResolver; + ProductInterface?: { + __resolveType: GQLProductInterfaceTypeResolver + }; + + CategoryInterface?: { + __resolveType: GQLCategoryInterfaceTypeResolver + }; + + Breadcrumb?: GQLBreadcrumbTypeResolver; + CmsBlock?: GQLCmsBlockTypeResolver; + CategoryProducts?: GQLCategoryProductsTypeResolver; + SearchResultPageInfo?: GQLSearchResultPageInfoTypeResolver; + ComplexTextValue?: GQLComplexTextValueTypeResolver; + OptimizedProductImage?: GQLOptimizedProductImageTypeResolver; + MediaGalleryInterface?: { + __resolveType: GQLMediaGalleryInterfaceTypeResolver + }; + + MediaGalleryEntry?: GQLMediaGalleryEntryTypeResolver; + MediaGalleryImageOfType?: GQLMediaGalleryImageOfTypeTypeResolver; + ProductMediaGalleryEntriesContent?: GQLProductMediaGalleryEntriesContentTypeResolver; + ProductMediaGalleryEntriesVideoContent?: GQLProductMediaGalleryEntriesVideoContentTypeResolver; + ProductPrices?: GQLProductPricesTypeResolver; + Price?: GQLPriceTypeResolver; + PriceAdjustment?: GQLPriceAdjustmentTypeResolver; + PriceRange?: GQLPriceRangeTypeResolver; + ProductPrice?: GQLProductPriceTypeResolver; + ProductDiscount?: GQLProductDiscountTypeResolver; + TierPrice?: GQLTierPriceTypeResolver; + ProductLinksInterface?: { + __resolveType: GQLProductLinksInterfaceTypeResolver + }; + + ProductReviews?: GQLProductReviewsTypeResolver; + ProductReview?: GQLProductReviewTypeResolver; + ProductReviewRating?: GQLProductReviewRatingTypeResolver; + AttributeWithValue?: GQLAttributeWithValueTypeResolver; + AttributeWithValueOption?: GQLAttributeWithValueOptionTypeResolver; + AttributeWithValueSwatchData?: GQLAttributeWithValueSwatchDataTypeResolver; + ProductStockItem?: GQLProductStockItemTypeResolver; + ProductTierPrices?: GQLProductTierPricesTypeResolver; + UrlRewrite?: GQLUrlRewriteTypeResolver; + HttpQueryParameter?: GQLHttpQueryParameterTypeResolver; + Website?: GQLWebsiteTypeResolver; + CartPrices?: GQLCartPricesTypeResolver; + CartTaxItem?: GQLCartTaxItemTypeResolver; + CartDiscount?: GQLCartDiscountTypeResolver; + SelectedPaymentMethod?: GQLSelectedPaymentMethodTypeResolver; + ShippingCartAddress?: GQLShippingCartAddressTypeResolver; + AvailableShippingMethod?: GQLAvailableShippingMethodTypeResolver; + CartItemQuantity?: GQLCartItemQuantityTypeResolver; + SelectedShippingMethod?: GQLSelectedShippingMethodTypeResolver; + CategoryResult?: GQLCategoryResultTypeResolver; + CategoryTree?: GQLCategoryTreeTypeResolver; + RoutableInterface?: { + __resolveType: GQLRoutableInterfaceTypeResolver + }; + + ChatData?: GQLChatDataTypeResolver; + CheckoutAgreement?: GQLCheckoutAgreementTypeResolver; + CmsBlocks?: GQLCmsBlocksTypeResolver; + CmsPage?: GQLCmsPageTypeResolver; + CompareList?: GQLCompareListTypeResolver; + ComparableAttribute?: GQLComparableAttributeTypeResolver; + ComparableItem?: GQLComparableItemTypeResolver; + ProductAttribute?: GQLProductAttributeTypeResolver; + ContactPageConfig?: GQLContactPageConfigTypeResolver; + Country?: GQLCountryTypeResolver; + Region?: GQLRegionTypeResolver; + Currency?: GQLCurrencyTypeResolver; + ExchangeRate?: GQLExchangeRateTypeResolver; + CurrencyConfig?: GQLCurrencyConfigTypeResolver; + CustomAttributeMetadata?: GQLCustomAttributeMetadataTypeResolver; + Attribute?: GQLAttributeTypeResolver; + AttributeOption?: GQLAttributeOptionTypeResolver; + StorefrontProperties?: GQLStorefrontPropertiesTypeResolver; + Customer?: GQLCustomerTypeResolver; + CustomerAddress?: GQLCustomerAddressTypeResolver; + CustomerAddressAttribute?: GQLCustomerAddressAttributeTypeResolver; + CustomerAddressRegion?: GQLCustomerAddressRegionTypeResolver; + CustomerOrders?: GQLCustomerOrdersTypeResolver; + CustomerOrder?: GQLCustomerOrderTypeResolver; + OrderAddress?: GQLOrderAddressTypeResolver; + SalesCommentItem?: GQLSalesCommentItemTypeResolver; + CreditMemo?: GQLCreditMemoTypeResolver; + CreditMemoItemInterface?: { + __resolveType: GQLCreditMemoItemInterfaceTypeResolver + }; + + OrderItemInterface?: { + __resolveType: GQLOrderItemInterfaceTypeResolver + }; + + OrderItemOption?: GQLOrderItemOptionTypeResolver; + BundleOption?: GQLBundleOptionTypeResolver; + BundleOptionSelection?: GQLBundleOptionSelectionTypeResolver; + CreditMemoTotal?: GQLCreditMemoTotalTypeResolver; + ShippingHandling?: GQLShippingHandlingTypeResolver; + ShippingDiscount?: GQLShippingDiscountTypeResolver; + TaxItem?: GQLTaxItemTypeResolver; + Invoice?: GQLInvoiceTypeResolver; + InvoiceItemInterface?: { + __resolveType: GQLInvoiceItemInterfaceTypeResolver + }; + + InvoiceTotal?: GQLInvoiceTotalTypeResolver; + OrderPaymentMethod?: GQLOrderPaymentMethodTypeResolver; + KeyValue?: GQLKeyValueTypeResolver; + OrderShipment?: GQLOrderShipmentTypeResolver; + ShipmentItemInterface?: { + __resolveType: GQLShipmentItemInterfaceTypeResolver + }; + + ShipmentTracking?: GQLShipmentTrackingTypeResolver; + OrderTotal?: GQLOrderTotalTypeResolver; + Wishlist?: GQLWishlistTypeResolver; + WishlistItem?: GQLWishlistItemTypeResolver; + WishlistItemOption?: GQLWishlistItemOptionTypeResolver; + WishlistItems?: GQLWishlistItemsTypeResolver; + WishlistItemInterface?: { + __resolveType: GQLWishlistItemInterfaceTypeResolver + }; + + SelectedCustomizableOption?: GQLSelectedCustomizableOptionTypeResolver; + SelectedCustomizableOptionValue?: GQLSelectedCustomizableOptionValueTypeResolver; + CartItemSelectedOptionValuePrice?: GQLCartItemSelectedOptionValuePriceTypeResolver; + CustomerDownloadableProducts?: GQLCustomerDownloadableProductsTypeResolver; + CustomerDownloadableProduct?: GQLCustomerDownloadableProductTypeResolver; + CustomerPaymentTokens?: GQLCustomerPaymentTokensTypeResolver; + PaymentToken?: GQLPaymentTokenTypeResolver; + IsConfigSettingEnabledOutput?: GQLIsConfigSettingEnabledOutputTypeResolver; + Braintree?: GQLBraintreeTypeResolver; + CartDisplayConfig?: GQLCartDisplayConfigTypeResolver; + QuoteData?: GQLQuoteDataTypeResolver; + TotalsObject?: { + __resolveType: GQLTotalsObjectTypeResolver + }; + + TotalsItem?: GQLTotalsItemTypeResolver; + SelectedBundleOption?: GQLSelectedBundleOptionTypeResolver; + SelectedBundleOptionValue?: GQLSelectedBundleOptionValueTypeResolver; + SelectedDownloadableLinks?: GQLSelectedDownloadableLinksTypeResolver; + AppliedTaxItem?: GQLAppliedTaxItemTypeResolver; + AppliedTaxItemRate?: GQLAppliedTaxItemRateTypeResolver; + HostedProUrl?: GQLHostedProUrlTypeResolver; + Order?: GQLOrderTypeResolver; + BaseOrderInfo?: GQLBaseOrderInfoTypeResolver; + PaymentInfo?: GQLPaymentInfoTypeResolver; + AdditionalCustomerInfo?: GQLAdditionalCustomerInfoTypeResolver; + CreditCustomerInfo?: GQLCreditCustomerInfoTypeResolver; + ShippingInfo?: GQLShippingInfoTypeResolver; + OrderCustomerAddress?: GQLOrderCustomerAddressTypeResolver; + OrderList?: GQLOrderListTypeResolver; + PayflowLinkToken?: GQLPayflowLinkTokenTypeResolver; + PaymentMethod?: GQLPaymentMethodTypeResolver; + Stores?: GQLStoresTypeResolver; + Store?: GQLStoreTypeResolver; + IsEmailAvailableOutput?: GQLIsEmailAvailableOutputTypeResolver; + PickupLocations?: GQLPickupLocationsTypeResolver; + PickupLocation?: GQLPickupLocationTypeResolver; + ProductReviewRatingsMetadata?: GQLProductReviewRatingsMetadataTypeResolver; + ProductReviewRatingMetadata?: GQLProductReviewRatingMetadataTypeResolver; + ProductReviewRatingValueMetadata?: GQLProductReviewRatingValueMetadataTypeResolver; + Products?: GQLProductsTypeResolver; + Aggregation?: GQLAggregationTypeResolver; + AggregationOption?: GQLAggregationOptionTypeResolver; + AggregationOptionInterface?: { + __resolveType: GQLAggregationOptionInterfaceTypeResolver + }; + + SwatchData?: GQLSwatchDataTypeResolver; + LayerFilter?: GQLLayerFilterTypeResolver; + LayerFilterItemInterface?: { + __resolveType: GQLLayerFilterItemInterfaceTypeResolver + }; + + SortFields?: GQLSortFieldsTypeResolver; + SortField?: GQLSortFieldTypeResolver; + WishlistOutput?: GQLWishlistOutputTypeResolver; + Menu?: GQLMenuTypeResolver; + Item?: GQLItemTypeResolver; + Slider?: GQLSliderTypeResolver; + Slide?: GQLSlideTypeResolver; + Map?: GQLMapTypeResolver; + TrackingData?: GQLTrackingDataTypeResolver; + EntityUrl?: GQLEntityUrlTypeResolver; + Mutation?: GQLMutationTypeResolver; + AddBundleProductsToCartOutput?: GQLAddBundleProductsToCartOutputTypeResolver; + AddConfigurableProductsToCartOutput?: GQLAddConfigurableProductsToCartOutputTypeResolver; + AddDownloadableProductsToCartOutput?: GQLAddDownloadableProductsToCartOutputTypeResolver; + AddProductsToCartOutput?: GQLAddProductsToCartOutputTypeResolver; + CartUserInputError?: GQLCartUserInputErrorTypeResolver; + AddProductsToWishlistOutput?: GQLAddProductsToWishlistOutputTypeResolver; + WishListUserInputError?: GQLWishListUserInputErrorTypeResolver; + AddSimpleProductsToCartOutput?: GQLAddSimpleProductsToCartOutputTypeResolver; + AddVirtualProductsToCartOutput?: GQLAddVirtualProductsToCartOutputTypeResolver; + AddWishlistItemsToCartOutput?: GQLAddWishlistItemsToCartOutputTypeResolver; + WishlistCartUserInputError?: GQLWishlistCartUserInputErrorTypeResolver; + ApplyCouponToCartOutput?: GQLApplyCouponToCartOutputTypeResolver; + AssignCompareListToCustomerOutput?: GQLAssignCompareListToCustomerOutputTypeResolver; + CreateCustomerType?: GQLCreateCustomerTypeTypeResolver; + ContactFormResponse?: GQLContactFormResponseTypeResolver; + CustomerOutput?: GQLCustomerOutputTypeResolver; + createKlarnaPaymentsSessionOutput?: GQLcreateKlarnaPaymentsSessionOutputTypeResolver; + Categories?: GQLCategoriesTypeResolver; + Assets?: GQLAssetsTypeResolver; + CreatePayflowProTokenOutput?: GQLCreatePayflowProTokenOutputTypeResolver; + PaypalExpressTokenOutput?: GQLPaypalExpressTokenOutputTypeResolver; + PaypalExpressUrlList?: GQLPaypalExpressUrlListTypeResolver; + CreateProductReviewOutput?: GQLCreateProductReviewOutputTypeResolver; + DeleteCompareListOutput?: GQLDeleteCompareListOutputTypeResolver; + DeletePaymentTokenOutput?: GQLDeletePaymentTokenOutputTypeResolver; + ShippingMethod?: GQLShippingMethodTypeResolver; + CustomerActionConfirmationType?: GQLCustomerActionConfirmationTypeTypeResolver; + CustomerToken?: GQLCustomerTokenTypeResolver; + GenerateCustomerTokenAsAdminOutput?: GQLGenerateCustomerTokenAsAdminOutputTypeResolver; + PayflowProResponseOutput?: GQLPayflowProResponseOutputTypeResolver; + PlaceOrderOutput?: GQLPlaceOrderOutputTypeResolver; + RemoveCouponFromCartOutput?: GQLRemoveCouponFromCartOutputTypeResolver; + RemoveItemFromCartOutput?: GQLRemoveItemFromCartOutputTypeResolver; + RemoveProductsFromWishlistOutput?: GQLRemoveProductsFromWishlistOutputTypeResolver; + ReorderItemsOutput?: GQLReorderItemsOutputTypeResolver; + CheckoutUserInputError?: GQLCheckoutUserInputErrorTypeResolver; + RevokeCustomerTokenOutput?: GQLRevokeCustomerTokenOutputTypeResolver; + PaypalExpressToken?: GQLPaypalExpressTokenTypeResolver; + ResetPasswordType?: GQLResetPasswordTypeTypeResolver; + SetBillingAddressOnCartOutput?: GQLSetBillingAddressOnCartOutputTypeResolver; + SetPaymentMethodOnCartOutput?: GQLSetPaymentMethodOnCartOutputTypeResolver; + PaymentDetails?: GQLPaymentDetailsTypeResolver; + PaymentTotals?: GQLPaymentTotalsTypeResolver; + SendEmailToFriendOutput?: GQLSendEmailToFriendOutputTypeResolver; + SendEmailToFriendRecipient?: GQLSendEmailToFriendRecipientTypeResolver; + SendEmailToFriendSender?: GQLSendEmailToFriendSenderTypeResolver; + SetGuestEmailOnCartOutput?: GQLSetGuestEmailOnCartOutputTypeResolver; + SetShippingAddressesOnCartOutput?: GQLSetShippingAddressesOnCartOutputTypeResolver; + SetShippingMethodsOnCartOutput?: GQLSetShippingMethodsOnCartOutputTypeResolver; + SubscribeEmailToNewsletterOutput?: GQLSubscribeEmailToNewsletterOutputTypeResolver; + UpdateCartItemsOutput?: GQLUpdateCartItemsOutputTypeResolver; + UpdateProductsInWishlistOutput?: GQLUpdateProductsInWishlistOutputTypeResolver; + AvailabilityResponseType?: GQLAvailabilityResponseTypeTypeResolver; + BundleCartItem?: GQLBundleCartItemTypeResolver; + BundleCreditMemoItem?: GQLBundleCreditMemoItemTypeResolver; + ItemSelectedBundleOption?: GQLItemSelectedBundleOptionTypeResolver; + ItemSelectedBundleOptionValue?: GQLItemSelectedBundleOptionValueTypeResolver; + BundleInvoiceItem?: GQLBundleInvoiceItemTypeResolver; + BundleItem?: GQLBundleItemTypeResolver; + BundleItemOption?: GQLBundleItemOptionTypeResolver; + BundleOptions?: GQLBundleOptionsTypeResolver; + BundleOrderItem?: GQLBundleOrderItemTypeResolver; + BundleProduct?: GQLBundleProductTypeResolver; + PhysicalProductInterface?: { + __resolveType: GQLPhysicalProductInterfaceTypeResolver + }; + + CustomizableProductInterface?: { + __resolveType: GQLCustomizableProductInterfaceTypeResolver + }; + + CustomizableOptionInterface?: { + __resolveType: GQLCustomizableOptionInterfaceTypeResolver + }; + + BundleShipmentItem?: GQLBundleShipmentItemTypeResolver; + BundleWishlistItem?: GQLBundleWishlistItemTypeResolver; + ColorSwatchData?: GQLColorSwatchDataTypeResolver; + SwatchDataInterface?: { + __resolveType: GQLSwatchDataInterfaceTypeResolver + }; + + ConfigurableAttributeOption?: GQLConfigurableAttributeOptionTypeResolver; + ConfigurableCartItem?: GQLConfigurableCartItemTypeResolver; + SelectedConfigurableOption?: GQLSelectedConfigurableOptionTypeResolver; + ConfigurableOptionAvailableForSelection?: GQLConfigurableOptionAvailableForSelectionTypeResolver; + ConfigurableProduct?: GQLConfigurableProductTypeResolver; + ConfigurableProductOptions?: GQLConfigurableProductOptionsTypeResolver; + ConfigurableProductOptionsValues?: GQLConfigurableProductOptionsValuesTypeResolver; + ConfigurableProductOptionsSelection?: GQLConfigurableProductOptionsSelectionTypeResolver; + ConfigurableProductOption?: GQLConfigurableProductOptionTypeResolver; + ConfigurableProductOptionValue?: GQLConfigurableProductOptionValueTypeResolver; + SimpleProduct?: GQLSimpleProductTypeResolver; + ConfigurableVariant?: GQLConfigurableVariantTypeResolver; + ConfigurableWishlistItem?: GQLConfigurableWishlistItemTypeResolver; + CreditMemoItem?: GQLCreditMemoItemTypeResolver; + CustomizableAreaOption?: GQLCustomizableAreaOptionTypeResolver; + CustomizableAreaValue?: GQLCustomizableAreaValueTypeResolver; + CustomizableCheckboxOption?: GQLCustomizableCheckboxOptionTypeResolver; + CustomizableCheckboxValue?: GQLCustomizableCheckboxValueTypeResolver; + CustomizableDateOption?: GQLCustomizableDateOptionTypeResolver; + CustomizableDateValue?: GQLCustomizableDateValueTypeResolver; + CustomizableDropDownOption?: GQLCustomizableDropDownOptionTypeResolver; + CustomizableDropDownValue?: GQLCustomizableDropDownValueTypeResolver; + CustomizableFieldOption?: GQLCustomizableFieldOptionTypeResolver; + CustomizableFieldValue?: GQLCustomizableFieldValueTypeResolver; + CustomizableFileOption?: GQLCustomizableFileOptionTypeResolver; + CustomizableFileValue?: GQLCustomizableFileValueTypeResolver; + CustomizableMultipleOption?: GQLCustomizableMultipleOptionTypeResolver; + CustomizableMultipleValue?: GQLCustomizableMultipleValueTypeResolver; + CustomizableRadioOption?: GQLCustomizableRadioOptionTypeResolver; + CustomizableRadioValue?: GQLCustomizableRadioValueTypeResolver; + DownloadableCartItem?: GQLDownloadableCartItemTypeResolver; + DownloadableProductLinks?: GQLDownloadableProductLinksTypeResolver; + DownloadableProductSamples?: GQLDownloadableProductSamplesTypeResolver; + DownloadableCreditMemoItem?: GQLDownloadableCreditMemoItemTypeResolver; + DownloadableItemsLinks?: GQLDownloadableItemsLinksTypeResolver; + DownloadableInvoiceItem?: GQLDownloadableInvoiceItemTypeResolver; + DownloadableOrderItem?: GQLDownloadableOrderItemTypeResolver; + DownloadableProduct?: GQLDownloadableProductTypeResolver; + DownloadableWishlistItem?: GQLDownloadableWishlistItemTypeResolver; + ExtensionAttributes?: GQLExtensionAttributesTypeResolver; + TaxGrandTotalDetails?: GQLTaxGrandTotalDetailsTypeResolver; + GroupedProduct?: GQLGroupedProductTypeResolver; + GroupedProductItem?: GQLGroupedProductItemTypeResolver; + GroupedProductWishlistItem?: GQLGroupedProductWishlistItemTypeResolver; + ImageSwatchData?: GQLImageSwatchDataTypeResolver; + InvoiceItem?: GQLInvoiceItemTypeResolver; + LayerFilterItem?: GQLLayerFilterItemTypeResolver; + OrderItem?: GQLOrderItemTypeResolver; + PayflowProToken?: GQLPayflowProTokenTypeResolver; + ProductImage?: GQLProductImageTypeResolver; + ProductLinks?: GQLProductLinksTypeResolver; + ProductVideo?: GQLProductVideoTypeResolver; + SalesItemInterface?: GQLSalesItemInterfaceTypeResolver; + ShipmentItem?: GQLShipmentItemTypeResolver; + SimpleCartItem?: GQLSimpleCartItemTypeResolver; + SimpleWishlistItem?: GQLSimpleWishlistItemTypeResolver; + SwatchLayerFilterItem?: GQLSwatchLayerFilterItemTypeResolver; + SwatchLayerFilterItemInterface?: { + __resolveType: GQLSwatchLayerFilterItemInterfaceTypeResolver + }; + + TextSwatchData?: GQLTextSwatchDataTypeResolver; + TotalsSegment?: GQLTotalsSegmentTypeResolver; + VirtualCartItem?: GQLVirtualCartItemTypeResolver; + VirtualProduct?: GQLVirtualProductTypeResolver; + VirtualWishlistItem?: GQLVirtualWishlistItemTypeResolver; +} +export interface GQLQueryTypeResolver { + availableStores?: QueryToAvailableStoresResolver; + cart?: QueryToCartResolver; + categories?: QueryToCategoriesResolver; + category?: QueryToCategoryResolver; + categoryList?: QueryToCategoryListResolver; + chatData?: QueryToChatDataResolver; + checkoutAgreements?: QueryToCheckoutAgreementsResolver; + cmsBlocks?: QueryToCmsBlocksResolver; + cmsPage?: QueryToCmsPageResolver; + compareList?: QueryToCompareListResolver; + contactPageConfig?: QueryToContactPageConfigResolver; + countries?: QueryToCountriesResolver; + country?: QueryToCountryResolver; + currency?: QueryToCurrencyResolver; + currencyData?: QueryToCurrencyDataResolver; + customAttributeMetadata?: QueryToCustomAttributeMetadataResolver; + customer?: QueryToCustomerResolver; + customerCart?: QueryToCustomerCartResolver; + customerDownloadableProducts?: QueryToCustomerDownloadableProductsResolver; + customerOrders?: QueryToCustomerOrdersResolver; + customerPaymentTokens?: QueryToCustomerPaymentTokensResolver; + emailCaptureCheckout?: QueryToEmailCaptureCheckoutResolver; + emailCaptureNewsletter?: QueryToEmailCaptureNewsletterResolver; + getBraintreeConfig?: QueryToGetBraintreeConfigResolver; + getCartDisplayConfig?: QueryToGetCartDisplayConfigResolver; + getCartForCustomer?: QueryToGetCartForCustomerResolver; + getHostedProUrl?: QueryToGetHostedProUrlResolver; + getOrderById?: QueryToGetOrderByIdResolver; + getOrderList?: QueryToGetOrderListResolver; + getPayflowLinkToken?: QueryToGetPayflowLinkTokenResolver; + getPaymentMethods?: QueryToGetPaymentMethodsResolver; + getStores?: QueryToGetStoresResolver; + isEmailAvailable?: QueryToIsEmailAvailableResolver; + orderByInvoice?: QueryToOrderByInvoiceResolver; + orderByRefund?: QueryToOrderByRefundResolver; + orderByShipment?: QueryToOrderByShipmentResolver; + orderData?: QueryToOrderDataResolver; + pickupLocations?: QueryToPickupLocationsResolver; + productReviewRatingsMetadata?: QueryToProductReviewRatingsMetadataResolver; + products?: QueryToProductsResolver; + route?: QueryToRouteResolver; + s_wishlist?: QueryToS_wishlistResolver; + scandiwebMenu?: QueryToScandiwebMenuResolver; + scandiwebSlider?: QueryToScandiwebSliderResolver; + storeConfig?: QueryToStoreConfigResolver; + storeList?: QueryToStoreListResolver; + trackingData?: QueryToTrackingDataResolver; + urlResolver?: QueryToUrlResolverResolver; + wishlist?: QueryToWishlistResolver; +} + +export interface QueryToAvailableStoresArgs { + useCurrentGroup?: boolean; +} +export interface QueryToAvailableStoresResolver { + (parent: TParent, args: QueryToAvailableStoresArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCartArgs { + cart_id: string; +} +export interface QueryToCartResolver { + (parent: TParent, args: QueryToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCategoriesArgs { + filters?: GQLCategoryFilterInput; + pageSize?: number; + currentPage?: number; +} +export interface QueryToCategoriesResolver { + (parent: TParent, args: QueryToCategoriesArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCategoryArgs { + id?: number; +} +export interface QueryToCategoryResolver { + (parent: TParent, args: QueryToCategoryArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCategoryListArgs { + filters?: GQLCategoryFilterInput; +} +export interface QueryToCategoryListResolver { + (parent: TParent, args: QueryToCategoryListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToChatDataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCheckoutAgreementsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCmsBlocksArgs { + identifiers?: Array; +} +export interface QueryToCmsBlocksResolver { + (parent: TParent, args: QueryToCmsBlocksArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCmsPageArgs { + id?: number; + identifier?: string; + url_key?: string; +} +export interface QueryToCmsPageResolver { + (parent: TParent, args: QueryToCmsPageArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCompareListArgs { + uid: string; +} +export interface QueryToCompareListResolver { + (parent: TParent, args: QueryToCompareListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToContactPageConfigResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCountriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCountryArgs { + id?: string; +} +export interface QueryToCountryResolver { + (parent: TParent, args: QueryToCountryArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCurrencyDataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomAttributeMetadataArgs { + attributes: Array; +} +export interface QueryToCustomAttributeMetadataResolver { + (parent: TParent, args: QueryToCustomAttributeMetadataArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomerCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomerDownloadableProductsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomerOrdersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToCustomerPaymentTokensResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToEmailCaptureCheckoutResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToEmailCaptureNewsletterResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetBraintreeConfigResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetCartDisplayConfigResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetCartForCustomerArgs { + guestCartId?: string; +} +export interface QueryToGetCartForCustomerResolver { + (parent: TParent, args: QueryToGetCartForCustomerArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetHostedProUrlArgs { + input: GQLHostedProUrlInput; +} +export interface QueryToGetHostedProUrlResolver { + (parent: TParent, args: QueryToGetHostedProUrlArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetOrderByIdArgs { + id: number; +} +export interface QueryToGetOrderByIdResolver { + (parent: TParent, args: QueryToGetOrderByIdArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetOrderListResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetPayflowLinkTokenArgs { + input: GQLPayflowLinkTokenInput; +} +export interface QueryToGetPayflowLinkTokenResolver { + (parent: TParent, args: QueryToGetPayflowLinkTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetPaymentMethodsArgs { + guestCartId?: string; +} +export interface QueryToGetPaymentMethodsResolver { + (parent: TParent, args: QueryToGetPaymentMethodsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToGetStoresArgs { + search?: string; + country?: string; + productsInfo?: Array; +} +export interface QueryToGetStoresResolver { + (parent: TParent, args: QueryToGetStoresArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToIsEmailAvailableArgs { + email: string; +} +export interface QueryToIsEmailAvailableResolver { + (parent: TParent, args: QueryToIsEmailAvailableArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToOrderByInvoiceArgs { + invoiceId: number; +} +export interface QueryToOrderByInvoiceResolver { + (parent: TParent, args: QueryToOrderByInvoiceArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToOrderByRefundArgs { + refundId: number; +} +export interface QueryToOrderByRefundResolver { + (parent: TParent, args: QueryToOrderByRefundArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToOrderByShipmentArgs { + shipmentId: number; +} +export interface QueryToOrderByShipmentResolver { + (parent: TParent, args: QueryToOrderByShipmentArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToOrderDataArgs { + orderId: string; +} +export interface QueryToOrderDataResolver { + (parent: TParent, args: QueryToOrderDataArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToPickupLocationsArgs { + area?: GQLAreaInput; + filters?: GQLPickupLocationFilterInput; + sort?: GQLPickupLocationSortInput; + pageSize?: number; + currentPage?: number; + productsInfo?: Array; +} +export interface QueryToPickupLocationsResolver { + (parent: TParent, args: QueryToPickupLocationsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToProductReviewRatingsMetadataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToProductsArgs { + search?: string; + filter?: GQLProductAttributeFilterInput; + pageSize?: number; + currentPage?: number; + sort?: GQLProductAttributeSortInput; +} +export interface QueryToProductsResolver { + (parent: TParent, args: QueryToProductsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToRouteArgs { + url: string; +} +export interface QueryToRouteResolver { + (parent: TParent, args: QueryToRouteArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToS_wishlistArgs { + sharing_code?: string; +} +export interface QueryToS_wishlistResolver { + (parent: TParent, args: QueryToS_wishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToScandiwebMenuArgs { + identifier: string; +} +export interface QueryToScandiwebMenuResolver { + (parent: TParent, args: QueryToScandiwebMenuArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToScandiwebSliderArgs { + id: string; +} +export interface QueryToScandiwebSliderResolver { + (parent: TParent, args: QueryToScandiwebSliderArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToStoreConfigResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToStoreListResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToTrackingDataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToUrlResolverArgs { + url: string; +} +export interface QueryToUrlResolverResolver { + (parent: TParent, args: QueryToUrlResolverArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QueryToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLStoreConfigTypeResolver { + absolute_footer?: StoreConfigToAbsolute_footerResolver; + access_token_lifetime?: StoreConfigToAccess_token_lifetimeResolver; + address_lines_quantity?: StoreConfigToAddress_lines_quantityResolver; + allow_guests_to_write_product_reviews?: StoreConfigToAllow_guests_to_write_product_reviewsResolver; + allow_items?: StoreConfigToAllow_itemsResolver; + allow_order?: StoreConfigToAllow_orderResolver; + anchor_text_for_next?: StoreConfigToAnchor_text_for_nextResolver; + anchor_text_for_previous?: StoreConfigToAnchor_text_for_previousResolver; + autocomplete_on_storefront?: StoreConfigToAutocomplete_on_storefrontResolver; + base_currency_code?: StoreConfigToBase_currency_codeResolver; + base_link_url?: StoreConfigToBase_link_urlResolver; + base_media_url?: StoreConfigToBase_media_urlResolver; + base_static_url?: StoreConfigToBase_static_urlResolver; + base_url?: StoreConfigToBase_urlResolver; + braintree_cc_vault_active?: StoreConfigToBraintree_cc_vault_activeResolver; + catalog_default_sort_by?: StoreConfigToCatalog_default_sort_byResolver; + category_fixed_product_tax_display_setting?: StoreConfigToCategory_fixed_product_tax_display_settingResolver; + category_url_suffix?: StoreConfigToCategory_url_suffixResolver; + cms_home_page?: StoreConfigToCms_home_pageResolver; + cms_no_cookies?: StoreConfigToCms_no_cookiesResolver; + cms_no_route?: StoreConfigToCms_no_routeResolver; + code?: StoreConfigToCodeResolver; + configurable_thumbnail_source?: StoreConfigToConfigurable_thumbnail_sourceResolver; + cookie_lifetime?: StoreConfigToCookie_lifetimeResolver; + cookie_link?: StoreConfigToCookie_linkResolver; + cookie_text?: StoreConfigToCookie_textResolver; + copyright?: StoreConfigToCopyrightResolver; + date_fields_order?: StoreConfigToDate_fields_orderResolver; + default_country?: StoreConfigToDefault_countryResolver; + default_description?: StoreConfigToDefault_descriptionResolver; + default_display_currency_code?: StoreConfigToDefault_display_currency_codeResolver; + default_keywords?: StoreConfigToDefault_keywordsResolver; + default_title?: StoreConfigToDefault_titleResolver; + delivery_instore_active?: StoreConfigToDelivery_instore_activeResolver; + demo_notice?: StoreConfigToDemo_noticeResolver; + demonotice?: StoreConfigToDemonoticeResolver; + display_product_stock_status?: StoreConfigToDisplay_product_stock_statusResolver; + downloadable_disable_guest_checkout?: StoreConfigToDownloadable_disable_guest_checkoutResolver; + downloadable_links_target_new_window?: StoreConfigToDownloadable_links_target_new_windowResolver; + front?: StoreConfigToFrontResolver; + grid_per_page?: StoreConfigToGrid_per_pageResolver; + grid_per_page_values?: StoreConfigToGrid_per_page_valuesResolver; + guest_checkout?: StoreConfigToGuest_checkoutResolver; + head_includes?: StoreConfigToHead_includesResolver; + head_shortcut_icon?: StoreConfigToHead_shortcut_iconResolver; + header_logo_src?: StoreConfigToHeader_logo_srcResolver; + id?: StoreConfigToIdResolver; + is_active?: StoreConfigToIs_activeResolver; + is_allowed_reorder?: StoreConfigToIs_allowed_reorderResolver; + is_default_store?: StoreConfigToIs_default_storeResolver; + is_default_store_group?: StoreConfigToIs_default_store_groupResolver; + is_email_confirmation_required?: StoreConfigToIs_email_confirmation_requiredResolver; + layered_navigation_product_count_enabled?: StoreConfigToLayered_navigation_product_count_enabledResolver; + list_mode?: StoreConfigToList_modeResolver; + list_per_page?: StoreConfigToList_per_pageResolver; + list_per_page_values?: StoreConfigToList_per_page_valuesResolver; + locale?: StoreConfigToLocaleResolver; + logo_alt?: StoreConfigToLogo_altResolver; + logo_height?: StoreConfigToLogo_heightResolver; + logo_width?: StoreConfigToLogo_widthResolver; + magento_wishlist_general_is_enabled?: StoreConfigToMagento_wishlist_general_is_enabledResolver; + minimum_password_length?: StoreConfigToMinimum_password_lengthResolver; + minimun_password_length?: StoreConfigToMinimun_password_lengthResolver; + name?: StoreConfigToNameResolver; + newsletter_general_active?: StoreConfigToNewsletter_general_activeResolver; + newsletter_subscription_allow_guest_subscribe?: StoreConfigToNewsletter_subscription_allow_guest_subscribeResolver; + newsletter_subscription_confirm?: StoreConfigToNewsletter_subscription_confirmResolver; + no_route?: StoreConfigToNo_routeResolver; + pagination_frame?: StoreConfigToPagination_frameResolver; + pagination_frame_skip?: StoreConfigToPagination_frame_skipResolver; + payment_payflowpro_cc_vault_active?: StoreConfigToPayment_payflowpro_cc_vault_activeResolver; + paypal_client_id?: StoreConfigToPaypal_client_idResolver; + paypal_sandbox_flag?: StoreConfigToPaypal_sandbox_flagResolver; + plp_list_mode?: StoreConfigToPlp_list_modeResolver; + priceTaxDisplay?: StoreConfigToPriceTaxDisplayResolver; + product_alert_allow_price?: StoreConfigToProduct_alert_allow_priceResolver; + product_alert_allow_stock?: StoreConfigToProduct_alert_allow_stockResolver; + product_fixed_product_tax_display_setting?: StoreConfigToProduct_fixed_product_tax_display_settingResolver; + product_reviews_enabled?: StoreConfigToProduct_reviews_enabledResolver; + product_url_suffix?: StoreConfigToProduct_url_suffixResolver; + product_use_categories?: StoreConfigToProduct_use_categoriesResolver; + redirect_dashboard?: StoreConfigToRedirect_dashboardResolver; + region_display_all?: StoreConfigToRegion_display_allResolver; + required_character_classes_number?: StoreConfigToRequired_character_classes_numberResolver; + reviews_allow_guest?: StoreConfigToReviews_allow_guestResolver; + reviews_are_enabled?: StoreConfigToReviews_are_enabledResolver; + root_category_id?: StoreConfigToRoot_category_idResolver; + root_category_uid?: StoreConfigToRoot_category_uidResolver; + rss_order_subscribe_allow?: StoreConfigToRss_order_subscribe_allowResolver; + sales_fixed_product_tax_display_setting?: StoreConfigToSales_fixed_product_tax_display_settingResolver; + secure_base_link_url?: StoreConfigToSecure_base_link_urlResolver; + secure_base_media_url?: StoreConfigToSecure_base_media_urlResolver; + secure_base_static_url?: StoreConfigToSecure_base_static_urlResolver; + secure_base_url?: StoreConfigToSecure_base_urlResolver; + send_friend?: StoreConfigToSend_friendResolver; + show_cms_breadcrumbs?: StoreConfigToShow_cms_breadcrumbsResolver; + show_tax_vat_number?: StoreConfigToShow_tax_vat_numberResolver; + show_vat_number_on_storefront?: StoreConfigToShow_vat_number_on_storefrontResolver; + store_code?: StoreConfigToStore_codeResolver; + store_group_code?: StoreConfigToStore_group_codeResolver; + store_group_name?: StoreConfigToStore_group_nameResolver; + store_name?: StoreConfigToStore_nameResolver; + store_sort_order?: StoreConfigToStore_sort_orderResolver; + terms_are_enabled?: StoreConfigToTerms_are_enabledResolver; + time_format?: StoreConfigToTime_formatResolver; + timezone?: StoreConfigToTimezoneResolver; + title_prefix?: StoreConfigToTitle_prefixResolver; + title_separator?: StoreConfigToTitle_separatorResolver; + title_suffix?: StoreConfigToTitle_suffixResolver; + use_calendar?: StoreConfigToUse_calendarResolver; + use_store_in_url?: StoreConfigToUse_store_in_urlResolver; + website_code?: StoreConfigToWebsite_codeResolver; + website_id?: StoreConfigToWebsite_idResolver; + website_name?: StoreConfigToWebsite_nameResolver; + weight_unit?: StoreConfigToWeight_unitResolver; + welcome?: StoreConfigToWelcomeResolver; + wishlist_general_active?: StoreConfigToWishlist_general_activeResolver; + year_range?: StoreConfigToYear_rangeResolver; +} + +export interface StoreConfigToAbsolute_footerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAccess_token_lifetimeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAddress_lines_quantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAllow_guests_to_write_product_reviewsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAllow_itemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAllow_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAnchor_text_for_nextResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAnchor_text_for_previousResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToAutocomplete_on_storefrontResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBase_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBase_link_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBase_media_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBase_static_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBase_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToBraintree_cc_vault_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCatalog_default_sort_byResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCategory_fixed_product_tax_display_settingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCategory_url_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCms_home_pageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCms_no_cookiesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCms_no_routeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToConfigurable_thumbnail_sourceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCookie_lifetimeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCookie_linkResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCookie_textResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToCopyrightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDate_fields_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDefault_countryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDefault_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDefault_display_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDefault_keywordsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDefault_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDelivery_instore_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDemo_noticeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDemonoticeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDisplay_product_stock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDownloadable_disable_guest_checkoutResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToDownloadable_links_target_new_windowResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToFrontResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToGrid_per_pageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToGrid_per_page_valuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToGuest_checkoutResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToHead_includesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToHead_shortcut_iconResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToHeader_logo_srcResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIs_allowed_reorderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIs_default_storeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIs_default_store_groupResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToIs_email_confirmation_requiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToLayered_navigation_product_count_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToList_modeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToList_per_pageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToList_per_page_valuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToLocaleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToLogo_altResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToLogo_heightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToLogo_widthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToMagento_wishlist_general_is_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToMinimum_password_lengthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToMinimun_password_lengthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToNewsletter_general_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToNewsletter_subscription_allow_guest_subscribeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToNewsletter_subscription_confirmResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToNo_routeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPagination_frameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPagination_frame_skipResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPayment_payflowpro_cc_vault_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPaypal_client_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPaypal_sandbox_flagResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPlp_list_modeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToPriceTaxDisplayResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_alert_allow_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_alert_allow_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_fixed_product_tax_display_settingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_reviews_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_url_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToProduct_use_categoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRedirect_dashboardResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRegion_display_allResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRequired_character_classes_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToReviews_allow_guestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToReviews_are_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRoot_category_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRoot_category_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToRss_order_subscribe_allowResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSales_fixed_product_tax_display_settingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSecure_base_link_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSecure_base_media_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSecure_base_static_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSecure_base_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToSend_friendResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToShow_cms_breadcrumbsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToShow_tax_vat_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToShow_vat_number_on_storefrontResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToStore_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToStore_group_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToStore_group_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToStore_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToStore_sort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTerms_are_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTime_formatResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTimezoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTitle_prefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTitle_separatorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToTitle_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToUse_calendarResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToUse_store_in_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWebsite_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWebsite_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWebsite_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWeight_unitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWelcomeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToWishlist_general_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreConfigToYear_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPriceTaxDisplayTypeResolver { + product_price_display_type?: PriceTaxDisplayToProduct_price_display_typeResolver; + shipping_price_display_type?: PriceTaxDisplayToShipping_price_display_typeResolver; +} + +export interface PriceTaxDisplayToProduct_price_display_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PriceTaxDisplayToShipping_price_display_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSendFriendConfigurationTypeResolver { + enabled_for_customers?: SendFriendConfigurationToEnabled_for_customersResolver; + enabled_for_guests?: SendFriendConfigurationToEnabled_for_guestsResolver; +} + +export interface SendFriendConfigurationToEnabled_for_customersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SendFriendConfigurationToEnabled_for_guestsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartTypeResolver { + applied_coupon?: CartToApplied_couponResolver; + applied_coupons?: CartToApplied_couponsResolver; + available_payment_methods?: CartToAvailable_payment_methodsResolver; + billing_address?: CartToBilling_addressResolver; + email?: CartToEmailResolver; + gift_message?: CartToGift_messageResolver; + id?: CartToIdResolver; + is_virtual?: CartToIs_virtualResolver; + items?: CartToItemsResolver; + prices?: CartToPricesResolver; + selected_payment_method?: CartToSelected_payment_methodResolver; + shipping_addresses?: CartToShipping_addressesResolver; + total_quantity?: CartToTotal_quantityResolver; +} + +export interface CartToApplied_couponResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToApplied_couponsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToAvailable_payment_methodsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToBilling_addressResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToEmailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToIs_virtualResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToSelected_payment_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToShipping_addressesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartToTotal_quantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAppliedCouponTypeResolver { + code?: AppliedCouponToCodeResolver; +} + +export interface AppliedCouponToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAvailablePaymentMethodTypeResolver { + code?: AvailablePaymentMethodToCodeResolver; + title?: AvailablePaymentMethodToTitleResolver; +} + +export interface AvailablePaymentMethodToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailablePaymentMethodToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBillingCartAddressTypeResolver { + city?: BillingCartAddressToCityResolver; + company?: BillingCartAddressToCompanyResolver; + country?: BillingCartAddressToCountryResolver; + customer_notes?: BillingCartAddressToCustomer_notesResolver; + firstname?: BillingCartAddressToFirstnameResolver; + lastname?: BillingCartAddressToLastnameResolver; + postcode?: BillingCartAddressToPostcodeResolver; + region?: BillingCartAddressToRegionResolver; + street?: BillingCartAddressToStreetResolver; + telephone?: BillingCartAddressToTelephoneResolver; +} + +export interface BillingCartAddressToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToCompanyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToCountryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToCustomer_notesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BillingCartAddressToTelephoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartAddressInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BillingCartAddress' | 'ShippingCartAddress' | Promise<'BillingCartAddress' | 'ShippingCartAddress'>; +} +export interface GQLCartAddressCountryTypeResolver { + code?: CartAddressCountryToCodeResolver; + label?: CartAddressCountryToLabelResolver; +} + +export interface CartAddressCountryToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartAddressCountryToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartAddressRegionTypeResolver { + code?: CartAddressRegionToCodeResolver; + label?: CartAddressRegionToLabelResolver; + region_id?: CartAddressRegionToRegion_idResolver; +} + +export interface CartAddressRegionToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartAddressRegionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartAddressRegionToRegion_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLGiftMessageTypeResolver { + from?: GiftMessageToFromResolver; + message?: GiftMessageToMessageResolver; + to?: GiftMessageToToResolver; +} + +export interface GiftMessageToFromResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GiftMessageToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GiftMessageToToResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleCartItem' | 'ConfigurableCartItem' | 'DownloadableCartItem' | 'SimpleCartItem' | 'VirtualCartItem' | Promise<'BundleCartItem' | 'ConfigurableCartItem' | 'DownloadableCartItem' | 'SimpleCartItem' | 'VirtualCartItem'>; +} +export interface GQLCartItemPricesTypeResolver { + discounts?: CartItemPricesToDiscountsResolver; + fixed_product_taxes?: CartItemPricesToFixed_product_taxesResolver; + price?: CartItemPricesToPriceResolver; + row_total?: CartItemPricesToRow_totalResolver; + row_total_including_tax?: CartItemPricesToRow_total_including_taxResolver; + total_item_discount?: CartItemPricesToTotal_item_discountResolver; +} + +export interface CartItemPricesToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemPricesToFixed_product_taxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemPricesToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemPricesToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemPricesToRow_total_including_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemPricesToTotal_item_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDiscountTypeResolver { + amount?: DiscountToAmountResolver; + label?: DiscountToLabelResolver; +} + +export interface DiscountToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DiscountToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMoneyTypeResolver { + currency?: MoneyToCurrencyResolver; + value?: MoneyToValueResolver; +} + +export interface MoneyToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MoneyToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLFixedProductTaxTypeResolver { + amount?: FixedProductTaxToAmountResolver; + label?: FixedProductTaxToLabelResolver; +} + +export interface FixedProductTaxToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface FixedProductTaxToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'GroupedProduct' | 'VirtualProduct' | Promise<'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'GroupedProduct' | 'VirtualProduct'>; +} +export interface GQLCategoryInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'CategoryTree' | Promise<'CategoryTree'>; +} +export interface GQLBreadcrumbTypeResolver { + category_id?: BreadcrumbToCategory_idResolver; + category_is_active?: BreadcrumbToCategory_is_activeResolver; + category_level?: BreadcrumbToCategory_levelResolver; + category_name?: BreadcrumbToCategory_nameResolver; + category_uid?: BreadcrumbToCategory_uidResolver; + category_url?: BreadcrumbToCategory_urlResolver; + category_url_key?: BreadcrumbToCategory_url_keyResolver; + category_url_path?: BreadcrumbToCategory_url_pathResolver; +} + +export interface BreadcrumbToCategory_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_is_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_levelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_url_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BreadcrumbToCategory_url_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCmsBlockTypeResolver { + content?: CmsBlockToContentResolver; + disabled?: CmsBlockToDisabledResolver; + identifier?: CmsBlockToIdentifierResolver; + title?: CmsBlockToTitleResolver; +} + +export interface CmsBlockToContentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsBlockToDisabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsBlockToIdentifierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsBlockToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCategoryProductsTypeResolver { + items?: CategoryProductsToItemsResolver; + page_info?: CategoryProductsToPage_infoResolver; + total_count?: CategoryProductsToTotal_countResolver; +} + +export interface CategoryProductsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryProductsToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryProductsToTotal_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSearchResultPageInfoTypeResolver { + current_page?: SearchResultPageInfoToCurrent_pageResolver; + page_size?: SearchResultPageInfoToPage_sizeResolver; + total_pages?: SearchResultPageInfoToTotal_pagesResolver; +} + +export interface SearchResultPageInfoToCurrent_pageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SearchResultPageInfoToPage_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SearchResultPageInfoToTotal_pagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLComplexTextValueTypeResolver { + html?: ComplexTextValueToHtmlResolver; +} + +export interface ComplexTextValueToHtmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOptimizedProductImageTypeResolver { + label?: OptimizedProductImageToLabelResolver; + path?: OptimizedProductImageToPathResolver; + url?: OptimizedProductImageToUrlResolver; +} + +export interface OptimizedProductImageToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OptimizedProductImageToPathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OptimizedProductImageToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMediaGalleryInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductImage' | 'ProductVideo' | Promise<'ProductImage' | 'ProductVideo'>; +} +export interface GQLMediaGalleryEntryTypeResolver { + base?: MediaGalleryEntryToBaseResolver; + content?: MediaGalleryEntryToContentResolver; + disabled?: MediaGalleryEntryToDisabledResolver; + file?: MediaGalleryEntryToFileResolver; + id?: MediaGalleryEntryToIdResolver; + label?: MediaGalleryEntryToLabelResolver; + large?: MediaGalleryEntryToLargeResolver; + media_type?: MediaGalleryEntryToMedia_typeResolver; + position?: MediaGalleryEntryToPositionResolver; + thumbnail?: MediaGalleryEntryToThumbnailResolver; + types?: MediaGalleryEntryToTypesResolver; + uid?: MediaGalleryEntryToUidResolver; + video_content?: MediaGalleryEntryToVideo_contentResolver; +} + +export interface MediaGalleryEntryToBaseResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToContentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToDisabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToFileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToLargeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToMedia_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToTypesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryEntryToVideo_contentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMediaGalleryImageOfTypeTypeResolver { + type?: MediaGalleryImageOfTypeToTypeResolver; + url?: MediaGalleryImageOfTypeToUrlResolver; +} + +export interface MediaGalleryImageOfTypeToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MediaGalleryImageOfTypeToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductMediaGalleryEntriesContentTypeResolver { + base64_encoded_data?: ProductMediaGalleryEntriesContentToBase64_encoded_dataResolver; + name?: ProductMediaGalleryEntriesContentToNameResolver; + type?: ProductMediaGalleryEntriesContentToTypeResolver; +} + +export interface ProductMediaGalleryEntriesContentToBase64_encoded_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesContentToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesContentToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductMediaGalleryEntriesVideoContentTypeResolver { + media_type?: ProductMediaGalleryEntriesVideoContentToMedia_typeResolver; + video_description?: ProductMediaGalleryEntriesVideoContentToVideo_descriptionResolver; + video_metadata?: ProductMediaGalleryEntriesVideoContentToVideo_metadataResolver; + video_provider?: ProductMediaGalleryEntriesVideoContentToVideo_providerResolver; + video_title?: ProductMediaGalleryEntriesVideoContentToVideo_titleResolver; + video_url?: ProductMediaGalleryEntriesVideoContentToVideo_urlResolver; +} + +export interface ProductMediaGalleryEntriesVideoContentToMedia_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesVideoContentToVideo_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesVideoContentToVideo_metadataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesVideoContentToVideo_providerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesVideoContentToVideo_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductMediaGalleryEntriesVideoContentToVideo_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductPricesTypeResolver { + maximalPrice?: ProductPricesToMaximalPriceResolver; + minimalPrice?: ProductPricesToMinimalPriceResolver; + regularPrice?: ProductPricesToRegularPriceResolver; +} + +export interface ProductPricesToMaximalPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPricesToMinimalPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPricesToRegularPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPriceTypeResolver { + adjustments?: PriceToAdjustmentsResolver; + amount?: PriceToAmountResolver; +} + +export interface PriceToAdjustmentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PriceToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPriceAdjustmentTypeResolver { + amount?: PriceAdjustmentToAmountResolver; + code?: PriceAdjustmentToCodeResolver; + description?: PriceAdjustmentToDescriptionResolver; +} + +export interface PriceAdjustmentToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PriceAdjustmentToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PriceAdjustmentToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPriceRangeTypeResolver { + maximum_price?: PriceRangeToMaximum_priceResolver; + minimum_price?: PriceRangeToMinimum_priceResolver; +} + +export interface PriceRangeToMaximum_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PriceRangeToMinimum_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductPriceTypeResolver { + default_final_price?: ProductPriceToDefault_final_priceResolver; + default_final_price_excl_tax?: ProductPriceToDefault_final_price_excl_taxResolver; + default_price?: ProductPriceToDefault_priceResolver; + discount?: ProductPriceToDiscountResolver; + final_price?: ProductPriceToFinal_priceResolver; + final_price_excl_tax?: ProductPriceToFinal_price_excl_taxResolver; + fixed_product_taxes?: ProductPriceToFixed_product_taxesResolver; + regular_price?: ProductPriceToRegular_priceResolver; + regular_price_excl_tax?: ProductPriceToRegular_price_excl_taxResolver; +} + +export interface ProductPriceToDefault_final_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToDefault_final_price_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToDefault_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToDiscountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToFinal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToFinal_price_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToFixed_product_taxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToRegular_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductPriceToRegular_price_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductDiscountTypeResolver { + amount_off?: ProductDiscountToAmount_offResolver; + percent_off?: ProductDiscountToPercent_offResolver; +} + +export interface ProductDiscountToAmount_offResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductDiscountToPercent_offResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTierPriceTypeResolver { + discount?: TierPriceToDiscountResolver; + final_price?: TierPriceToFinal_priceResolver; + quantity?: TierPriceToQuantityResolver; +} + +export interface TierPriceToDiscountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TierPriceToFinal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TierPriceToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductLinksInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductLinks' | Promise<'ProductLinks'>; +} +export interface GQLProductReviewsTypeResolver { + items?: ProductReviewsToItemsResolver; + page_info?: ProductReviewsToPage_infoResolver; +} + +export interface ProductReviewsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewsToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductReviewTypeResolver { + average_rating?: ProductReviewToAverage_ratingResolver; + created_at?: ProductReviewToCreated_atResolver; + nickname?: ProductReviewToNicknameResolver; + product?: ProductReviewToProductResolver; + ratings_breakdown?: ProductReviewToRatings_breakdownResolver; + summary?: ProductReviewToSummaryResolver; + text?: ProductReviewToTextResolver; +} + +export interface ProductReviewToAverage_ratingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToNicknameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToRatings_breakdownResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToSummaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewToTextResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductReviewRatingTypeResolver { + name?: ProductReviewRatingToNameResolver; + value?: ProductReviewRatingToValueResolver; +} + +export interface ProductReviewRatingToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewRatingToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAttributeWithValueTypeResolver { + attribute_code?: AttributeWithValueToAttribute_codeResolver; + attribute_group_code?: AttributeWithValueToAttribute_group_codeResolver; + attribute_group_id?: AttributeWithValueToAttribute_group_idResolver; + attribute_group_name?: AttributeWithValueToAttribute_group_nameResolver; + attribute_id?: AttributeWithValueToAttribute_idResolver; + attribute_label?: AttributeWithValueToAttribute_labelResolver; + attribute_options?: AttributeWithValueToAttribute_optionsResolver; + attribute_type?: AttributeWithValueToAttribute_typeResolver; + attribute_value?: AttributeWithValueToAttribute_valueResolver; + entity_type?: AttributeWithValueToEntity_typeResolver; + used_in_product_listing?: AttributeWithValueToUsed_in_product_listingResolver; +} + +export interface AttributeWithValueToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_group_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_group_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_group_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToAttribute_valueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToEntity_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueToUsed_in_product_listingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAttributeWithValueOptionTypeResolver { + label?: AttributeWithValueOptionToLabelResolver; + swatch_data?: AttributeWithValueOptionToSwatch_dataResolver; + value?: AttributeWithValueOptionToValueResolver; +} + +export interface AttributeWithValueOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueOptionToSwatch_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAttributeWithValueSwatchDataTypeResolver { + type?: AttributeWithValueSwatchDataToTypeResolver; + value?: AttributeWithValueSwatchDataToValueResolver; +} + +export interface AttributeWithValueSwatchDataToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeWithValueSwatchDataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductStockItemTypeResolver { + in_stock?: ProductStockItemToIn_stockResolver; + max_sale_qty?: ProductStockItemToMax_sale_qtyResolver; + min_sale_qty?: ProductStockItemToMin_sale_qtyResolver; + qty?: ProductStockItemToQtyResolver; + qty_increments?: ProductStockItemToQty_incrementsResolver; +} + +export interface ProductStockItemToIn_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductStockItemToMax_sale_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductStockItemToMin_sale_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductStockItemToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductStockItemToQty_incrementsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductTierPricesTypeResolver { + customer_group_id?: ProductTierPricesToCustomer_group_idResolver; + percentage_value?: ProductTierPricesToPercentage_valueResolver; + qty?: ProductTierPricesToQtyResolver; + value?: ProductTierPricesToValueResolver; + website_id?: ProductTierPricesToWebsite_idResolver; +} + +export interface ProductTierPricesToCustomer_group_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductTierPricesToPercentage_valueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductTierPricesToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductTierPricesToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductTierPricesToWebsite_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLUrlRewriteTypeResolver { + parameters?: UrlRewriteToParametersResolver; + url?: UrlRewriteToUrlResolver; +} + +export interface UrlRewriteToParametersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface UrlRewriteToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLHttpQueryParameterTypeResolver { + name?: HttpQueryParameterToNameResolver; + value?: HttpQueryParameterToValueResolver; +} + +export interface HttpQueryParameterToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface HttpQueryParameterToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWebsiteTypeResolver { + code?: WebsiteToCodeResolver; + default_group_id?: WebsiteToDefault_group_idResolver; + id?: WebsiteToIdResolver; + is_default?: WebsiteToIs_defaultResolver; + name?: WebsiteToNameResolver; + sort_order?: WebsiteToSort_orderResolver; +} + +export interface WebsiteToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WebsiteToDefault_group_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WebsiteToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WebsiteToIs_defaultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WebsiteToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WebsiteToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartPricesTypeResolver { + applied_taxes?: CartPricesToApplied_taxesResolver; + discount?: CartPricesToDiscountResolver; + discounts?: CartPricesToDiscountsResolver; + grand_total?: CartPricesToGrand_totalResolver; + subtotal_excluding_tax?: CartPricesToSubtotal_excluding_taxResolver; + subtotal_including_tax?: CartPricesToSubtotal_including_taxResolver; + subtotal_with_discount_excluding_tax?: CartPricesToSubtotal_with_discount_excluding_taxResolver; +} + +export interface CartPricesToApplied_taxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToDiscountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToSubtotal_excluding_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToSubtotal_including_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartPricesToSubtotal_with_discount_excluding_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartTaxItemTypeResolver { + amount?: CartTaxItemToAmountResolver; + label?: CartTaxItemToLabelResolver; +} + +export interface CartTaxItemToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartTaxItemToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartDiscountTypeResolver { + amount?: CartDiscountToAmountResolver; + label?: CartDiscountToLabelResolver; +} + +export interface CartDiscountToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDiscountToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedPaymentMethodTypeResolver { + code?: SelectedPaymentMethodToCodeResolver; + purchase_order_number?: SelectedPaymentMethodToPurchase_order_numberResolver; + title?: SelectedPaymentMethodToTitleResolver; +} + +export interface SelectedPaymentMethodToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedPaymentMethodToPurchase_order_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedPaymentMethodToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShippingCartAddressTypeResolver { + available_shipping_methods?: ShippingCartAddressToAvailable_shipping_methodsResolver; + cart_items?: ShippingCartAddressToCart_itemsResolver; + cart_items_v2?: ShippingCartAddressToCart_items_v2Resolver; + city?: ShippingCartAddressToCityResolver; + company?: ShippingCartAddressToCompanyResolver; + country?: ShippingCartAddressToCountryResolver; + customer_notes?: ShippingCartAddressToCustomer_notesResolver; + firstname?: ShippingCartAddressToFirstnameResolver; + items_weight?: ShippingCartAddressToItems_weightResolver; + lastname?: ShippingCartAddressToLastnameResolver; + pickup_location_code?: ShippingCartAddressToPickup_location_codeResolver; + postcode?: ShippingCartAddressToPostcodeResolver; + region?: ShippingCartAddressToRegionResolver; + selected_shipping_method?: ShippingCartAddressToSelected_shipping_methodResolver; + street?: ShippingCartAddressToStreetResolver; + telephone?: ShippingCartAddressToTelephoneResolver; +} + +export interface ShippingCartAddressToAvailable_shipping_methodsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCart_itemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCart_items_v2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCompanyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCountryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToCustomer_notesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToItems_weightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToPickup_location_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToSelected_shipping_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingCartAddressToTelephoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAvailableShippingMethodTypeResolver { + amount?: AvailableShippingMethodToAmountResolver; + available?: AvailableShippingMethodToAvailableResolver; + base_amount?: AvailableShippingMethodToBase_amountResolver; + carrier_code?: AvailableShippingMethodToCarrier_codeResolver; + carrier_title?: AvailableShippingMethodToCarrier_titleResolver; + error_message?: AvailableShippingMethodToError_messageResolver; + method_code?: AvailableShippingMethodToMethod_codeResolver; + method_title?: AvailableShippingMethodToMethod_titleResolver; + price_excl_tax?: AvailableShippingMethodToPrice_excl_taxResolver; + price_incl_tax?: AvailableShippingMethodToPrice_incl_taxResolver; +} + +export interface AvailableShippingMethodToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToAvailableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToBase_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToCarrier_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToCarrier_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToError_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToMethod_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToMethod_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToPrice_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AvailableShippingMethodToPrice_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartItemQuantityTypeResolver { + cart_item_id?: CartItemQuantityToCart_item_idResolver; + quantity?: CartItemQuantityToQuantityResolver; +} + +export interface CartItemQuantityToCart_item_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemQuantityToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedShippingMethodTypeResolver { + amount?: SelectedShippingMethodToAmountResolver; + base_amount?: SelectedShippingMethodToBase_amountResolver; + carrier_code?: SelectedShippingMethodToCarrier_codeResolver; + carrier_title?: SelectedShippingMethodToCarrier_titleResolver; + method_code?: SelectedShippingMethodToMethod_codeResolver; + method_title?: SelectedShippingMethodToMethod_titleResolver; +} + +export interface SelectedShippingMethodToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedShippingMethodToBase_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedShippingMethodToCarrier_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedShippingMethodToCarrier_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedShippingMethodToMethod_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedShippingMethodToMethod_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCategoryResultTypeResolver { + items?: CategoryResultToItemsResolver; + page_info?: CategoryResultToPage_infoResolver; + total_count?: CategoryResultToTotal_countResolver; +} + +export interface CategoryResultToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryResultToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryResultToTotal_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCategoryTreeTypeResolver { + available_sort_by?: CategoryTreeToAvailable_sort_byResolver; + breadcrumbs?: CategoryTreeToBreadcrumbsResolver; + canonical_url?: CategoryTreeToCanonical_urlResolver; + children?: CategoryTreeToChildrenResolver; + children_count?: CategoryTreeToChildren_countResolver; + cms_block?: CategoryTreeToCms_blockResolver; + created_at?: CategoryTreeToCreated_atResolver; + custom_layout_update_file?: CategoryTreeToCustom_layout_update_fileResolver; + default_sort_by?: CategoryTreeToDefault_sort_byResolver; + description?: CategoryTreeToDescriptionResolver; + display_mode?: CategoryTreeToDisplay_modeResolver; + filter_price_range?: CategoryTreeToFilter_price_rangeResolver; + id?: CategoryTreeToIdResolver; + image?: CategoryTreeToImageResolver; + include_in_menu?: CategoryTreeToInclude_in_menuResolver; + is_active?: CategoryTreeToIs_activeResolver; + is_anchor?: CategoryTreeToIs_anchorResolver; + landing_page?: CategoryTreeToLanding_pageResolver; + level?: CategoryTreeToLevelResolver; + meta_description?: CategoryTreeToMeta_descriptionResolver; + meta_keywords?: CategoryTreeToMeta_keywordsResolver; + meta_title?: CategoryTreeToMeta_titleResolver; + name?: CategoryTreeToNameResolver; + path?: CategoryTreeToPathResolver; + path_in_store?: CategoryTreeToPath_in_storeResolver; + position?: CategoryTreeToPositionResolver; + product_count?: CategoryTreeToProduct_countResolver; + products?: CategoryTreeToProductsResolver; + redirect_code?: CategoryTreeToRedirect_codeResolver; + relative_url?: CategoryTreeToRelative_urlResolver; + type?: CategoryTreeToTypeResolver; + uid?: CategoryTreeToUidResolver; + updated_at?: CategoryTreeToUpdated_atResolver; + url?: CategoryTreeToUrlResolver; + url_key?: CategoryTreeToUrl_keyResolver; + url_path?: CategoryTreeToUrl_pathResolver; + url_suffix?: CategoryTreeToUrl_suffixResolver; +} + +export interface CategoryTreeToAvailable_sort_byResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToBreadcrumbsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToChildrenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToChildren_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToCms_blockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToCustom_layout_update_fileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToDefault_sort_byResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToDisplay_modeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToFilter_price_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToInclude_in_menuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToIs_anchorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToLanding_pageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToLevelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToMeta_keywordsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToPathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToPath_in_storeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToProduct_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToProductsArgs { + pageSize?: number; + currentPage?: number; + sort?: GQLProductAttributeSortInput; +} +export interface CategoryTreeToProductsResolver { + (parent: TParent, args: CategoryTreeToProductsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoryTreeToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRoutableInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'CategoryTree' | 'CmsPage' | 'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'GroupedProduct' | 'VirtualProduct' | Promise<'CategoryTree' | 'CmsPage' | 'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'GroupedProduct' | 'VirtualProduct'>; +} +export interface GQLChatDataTypeResolver { + api_space_id?: ChatDataToApi_space_idResolver; + cookie_name?: ChatDataToCookie_nameResolver; + is_enabled?: ChatDataToIs_enabledResolver; +} + +export interface ChatDataToApi_space_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ChatDataToCookie_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ChatDataToIs_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCheckoutAgreementTypeResolver { + agreement_id?: CheckoutAgreementToAgreement_idResolver; + checkbox_text?: CheckoutAgreementToCheckbox_textResolver; + content?: CheckoutAgreementToContentResolver; + content_height?: CheckoutAgreementToContent_heightResolver; + is_html?: CheckoutAgreementToIs_htmlResolver; + mode?: CheckoutAgreementToModeResolver; + name?: CheckoutAgreementToNameResolver; +} + +export interface CheckoutAgreementToAgreement_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToCheckbox_textResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToContentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToContent_heightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToIs_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToModeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutAgreementToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCmsBlocksTypeResolver { + items?: CmsBlocksToItemsResolver; +} + +export interface CmsBlocksToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCmsPageTypeResolver { + content?: CmsPageToContentResolver; + content_heading?: CmsPageToContent_headingResolver; + identifier?: CmsPageToIdentifierResolver; + meta_description?: CmsPageToMeta_descriptionResolver; + meta_keywords?: CmsPageToMeta_keywordsResolver; + meta_title?: CmsPageToMeta_titleResolver; + page_layout?: CmsPageToPage_layoutResolver; + page_width?: CmsPageToPage_widthResolver; + redirect_code?: CmsPageToRedirect_codeResolver; + relative_url?: CmsPageToRelative_urlResolver; + title?: CmsPageToTitleResolver; + type?: CmsPageToTypeResolver; + url_key?: CmsPageToUrl_keyResolver; +} + +export interface CmsPageToContentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToContent_headingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToIdentifierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToMeta_keywordsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToPage_layoutResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToPage_widthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CmsPageToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCompareListTypeResolver { + attributes?: CompareListToAttributesResolver; + item_count?: CompareListToItem_countResolver; + items?: CompareListToItemsResolver; + uid?: CompareListToUidResolver; +} + +export interface CompareListToAttributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CompareListToItem_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CompareListToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CompareListToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLComparableAttributeTypeResolver { + code?: ComparableAttributeToCodeResolver; + label?: ComparableAttributeToLabelResolver; +} + +export interface ComparableAttributeToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ComparableAttributeToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLComparableItemTypeResolver { + attributes?: ComparableItemToAttributesResolver; + product?: ComparableItemToProductResolver; + uid?: ComparableItemToUidResolver; +} + +export interface ComparableItemToAttributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ComparableItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ComparableItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductAttributeTypeResolver { + code?: ProductAttributeToCodeResolver; + value?: ProductAttributeToValueResolver; +} + +export interface ProductAttributeToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductAttributeToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLContactPageConfigTypeResolver { + enabled?: ContactPageConfigToEnabledResolver; +} + +export interface ContactPageConfigToEnabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCountryTypeResolver { + available_regions?: CountryToAvailable_regionsResolver; + full_name_english?: CountryToFull_name_englishResolver; + full_name_locale?: CountryToFull_name_localeResolver; + id?: CountryToIdResolver; + is_state_required?: CountryToIs_state_requiredResolver; + three_letter_abbreviation?: CountryToThree_letter_abbreviationResolver; + two_letter_abbreviation?: CountryToTwo_letter_abbreviationResolver; +} + +export interface CountryToAvailable_regionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToFull_name_englishResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToFull_name_localeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToIs_state_requiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToThree_letter_abbreviationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CountryToTwo_letter_abbreviationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRegionTypeResolver { + code?: RegionToCodeResolver; + id?: RegionToIdResolver; + name?: RegionToNameResolver; +} + +export interface RegionToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface RegionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface RegionToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCurrencyTypeResolver { + available_currency_codes?: CurrencyToAvailable_currency_codesResolver; + base_currency_code?: CurrencyToBase_currency_codeResolver; + base_currency_symbol?: CurrencyToBase_currency_symbolResolver; + default_display_currecy_code?: CurrencyToDefault_display_currecy_codeResolver; + default_display_currecy_symbol?: CurrencyToDefault_display_currecy_symbolResolver; + default_display_currency_code?: CurrencyToDefault_display_currency_codeResolver; + default_display_currency_symbol?: CurrencyToDefault_display_currency_symbolResolver; + exchange_rates?: CurrencyToExchange_ratesResolver; + id?: CurrencyToIdResolver; + label?: CurrencyToLabelResolver; + value?: CurrencyToValueResolver; +} + +export interface CurrencyToAvailable_currency_codesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToBase_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToBase_currency_symbolResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToDefault_display_currecy_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToDefault_display_currecy_symbolResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToDefault_display_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToDefault_display_currency_symbolResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToExchange_ratesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLExchangeRateTypeResolver { + currency_to?: ExchangeRateToCurrency_toResolver; + rate?: ExchangeRateToRateResolver; +} + +export interface ExchangeRateToCurrency_toResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ExchangeRateToRateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCurrencyConfigTypeResolver { + available_currencies_data?: CurrencyConfigToAvailable_currencies_dataResolver; + current_currency_code?: CurrencyConfigToCurrent_currency_codeResolver; +} + +export interface CurrencyConfigToAvailable_currencies_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CurrencyConfigToCurrent_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomAttributeMetadataTypeResolver { + items?: CustomAttributeMetadataToItemsResolver; +} + +export interface CustomAttributeMetadataToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAttributeTypeResolver { + attribute_code?: AttributeToAttribute_codeResolver; + attribute_options?: AttributeToAttribute_optionsResolver; + attribute_type?: AttributeToAttribute_typeResolver; + entity_type?: AttributeToEntity_typeResolver; + input_type?: AttributeToInput_typeResolver; + storefront_properties?: AttributeToStorefront_propertiesResolver; +} + +export interface AttributeToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeToAttribute_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeToAttribute_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeToEntity_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeToInput_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeToStorefront_propertiesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAttributeOptionTypeResolver { + label?: AttributeOptionToLabelResolver; + value?: AttributeOptionToValueResolver; +} + +export interface AttributeOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AttributeOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLStorefrontPropertiesTypeResolver { + position?: StorefrontPropertiesToPositionResolver; + use_in_layered_navigation?: StorefrontPropertiesToUse_in_layered_navigationResolver; + use_in_product_listing?: StorefrontPropertiesToUse_in_product_listingResolver; + use_in_search_results_layered_navigation?: StorefrontPropertiesToUse_in_search_results_layered_navigationResolver; + visible_on_catalog_pages?: StorefrontPropertiesToVisible_on_catalog_pagesResolver; +} + +export interface StorefrontPropertiesToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StorefrontPropertiesToUse_in_layered_navigationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StorefrontPropertiesToUse_in_product_listingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StorefrontPropertiesToUse_in_search_results_layered_navigationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StorefrontPropertiesToVisible_on_catalog_pagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerTypeResolver { + addresses?: CustomerToAddressesResolver; + allow_remote_shopping_assistance?: CustomerToAllow_remote_shopping_assistanceResolver; + compare_list?: CustomerToCompare_listResolver; + confirmation_required?: CustomerToConfirmation_requiredResolver; + created_at?: CustomerToCreated_atResolver; + date_of_birth?: CustomerToDate_of_birthResolver; + default_billing?: CustomerToDefault_billingResolver; + default_shipping?: CustomerToDefault_shippingResolver; + dob?: CustomerToDobResolver; + email?: CustomerToEmailResolver; + firstname?: CustomerToFirstnameResolver; + gender?: CustomerToGenderResolver; + group_id?: CustomerToGroup_idResolver; + id?: CustomerToIdResolver; + is_subscribed?: CustomerToIs_subscribedResolver; + lastname?: CustomerToLastnameResolver; + middlename?: CustomerToMiddlenameResolver; + orders?: CustomerToOrdersResolver; + prefix?: CustomerToPrefixResolver; + reviews?: CustomerToReviewsResolver; + suffix?: CustomerToSuffixResolver; + taxvat?: CustomerToTaxvatResolver; + wishlist?: CustomerToWishlistResolver; + wishlist_v2?: CustomerToWishlist_v2Resolver; + wishlists?: CustomerToWishlistsResolver; +} + +export interface CustomerToAddressesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToAllow_remote_shopping_assistanceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToCompare_listResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToConfirmation_requiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToDate_of_birthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToDefault_billingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToDefault_shippingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToDobResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToEmailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToGenderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToGroup_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToIs_subscribedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToMiddlenameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToOrdersArgs { + filter?: GQLCustomerOrdersFilterInput; + currentPage?: number; + pageSize?: number; +} +export interface CustomerToOrdersResolver { + (parent: TParent, args: CustomerToOrdersArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToPrefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface CustomerToReviewsResolver { + (parent: TParent, args: CustomerToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToSuffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToTaxvatResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToWishlist_v2Args { + id: string; +} +export interface CustomerToWishlist_v2Resolver { + (parent: TParent, args: CustomerToWishlist_v2Args, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerToWishlistsArgs { + pageSize?: number; + currentPage?: number; +} +export interface CustomerToWishlistsResolver { + (parent: TParent, args: CustomerToWishlistsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerAddressTypeResolver { + city?: CustomerAddressToCityResolver; + company?: CustomerAddressToCompanyResolver; + country_code?: CustomerAddressToCountry_codeResolver; + country_id?: CustomerAddressToCountry_idResolver; + custom_attributes?: CustomerAddressToCustom_attributesResolver; + customer_id?: CustomerAddressToCustomer_idResolver; + default_billing?: CustomerAddressToDefault_billingResolver; + default_shipping?: CustomerAddressToDefault_shippingResolver; + extension_attributes?: CustomerAddressToExtension_attributesResolver; + fax?: CustomerAddressToFaxResolver; + firstname?: CustomerAddressToFirstnameResolver; + id?: CustomerAddressToIdResolver; + lastname?: CustomerAddressToLastnameResolver; + middlename?: CustomerAddressToMiddlenameResolver; + postcode?: CustomerAddressToPostcodeResolver; + prefix?: CustomerAddressToPrefixResolver; + region?: CustomerAddressToRegionResolver; + region_id?: CustomerAddressToRegion_idResolver; + street?: CustomerAddressToStreetResolver; + suffix?: CustomerAddressToSuffixResolver; + telephone?: CustomerAddressToTelephoneResolver; + vat_id?: CustomerAddressToVat_idResolver; +} + +export interface CustomerAddressToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToCompanyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToCountry_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToCountry_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToCustom_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToCustomer_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToDefault_billingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToDefault_shippingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToExtension_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToFaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToMiddlenameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToPrefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToRegion_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToSuffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToTelephoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressToVat_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerAddressAttributeTypeResolver { + attribute_code?: CustomerAddressAttributeToAttribute_codeResolver; + value?: CustomerAddressAttributeToValueResolver; +} + +export interface CustomerAddressAttributeToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressAttributeToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerAddressRegionTypeResolver { + region?: CustomerAddressRegionToRegionResolver; + region_code?: CustomerAddressRegionToRegion_codeResolver; + region_id?: CustomerAddressRegionToRegion_idResolver; +} + +export interface CustomerAddressRegionToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressRegionToRegion_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerAddressRegionToRegion_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerOrdersTypeResolver { + items?: CustomerOrdersToItemsResolver; + page_info?: CustomerOrdersToPage_infoResolver; + total_count?: CustomerOrdersToTotal_countResolver; +} + +export interface CustomerOrdersToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrdersToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrdersToTotal_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerOrderTypeResolver { + billing_address?: CustomerOrderToBilling_addressResolver; + can_reorder?: CustomerOrderToCan_reorderResolver; + carrier?: CustomerOrderToCarrierResolver; + comments?: CustomerOrderToCommentsResolver; + created_at?: CustomerOrderToCreated_atResolver; + credit_memos?: CustomerOrderToCredit_memosResolver; + gift_message?: CustomerOrderToGift_messageResolver; + grand_total?: CustomerOrderToGrand_totalResolver; + id?: CustomerOrderToIdResolver; + increment_id?: CustomerOrderToIncrement_idResolver; + invoices?: CustomerOrderToInvoicesResolver; + items?: CustomerOrderToItemsResolver; + number?: CustomerOrderToNumberResolver; + order_date?: CustomerOrderToOrder_dateResolver; + order_number?: CustomerOrderToOrder_numberResolver; + payment_methods?: CustomerOrderToPayment_methodsResolver; + rss_link?: CustomerOrderToRss_linkResolver; + shipments?: CustomerOrderToShipmentsResolver; + shipping_address?: CustomerOrderToShipping_addressResolver; + shipping_method?: CustomerOrderToShipping_methodResolver; + status?: CustomerOrderToStatusResolver; + total?: CustomerOrderToTotalResolver; +} + +export interface CustomerOrderToBilling_addressResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToCan_reorderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToCarrierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToCommentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToCredit_memosResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToIncrement_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToInvoicesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToNumberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToOrder_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToOrder_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToPayment_methodsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToRss_linkResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToShipmentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToShipping_addressResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToShipping_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerOrderToTotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderAddressTypeResolver { + city?: OrderAddressToCityResolver; + company?: OrderAddressToCompanyResolver; + country_code?: OrderAddressToCountry_codeResolver; + country_id?: OrderAddressToCountry_idResolver; + fax?: OrderAddressToFaxResolver; + firstname?: OrderAddressToFirstnameResolver; + lastname?: OrderAddressToLastnameResolver; + middlename?: OrderAddressToMiddlenameResolver; + postcode?: OrderAddressToPostcodeResolver; + prefix?: OrderAddressToPrefixResolver; + region?: OrderAddressToRegionResolver; + region_id?: OrderAddressToRegion_idResolver; + street?: OrderAddressToStreetResolver; + suffix?: OrderAddressToSuffixResolver; + telephone?: OrderAddressToTelephoneResolver; + vat_id?: OrderAddressToVat_idResolver; +} + +export interface OrderAddressToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToCompanyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToCountry_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToCountry_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToFaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToMiddlenameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToPrefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToRegion_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToSuffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToTelephoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderAddressToVat_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSalesCommentItemTypeResolver { + message?: SalesCommentItemToMessageResolver; + timestamp?: SalesCommentItemToTimestampResolver; +} + +export interface SalesCommentItemToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SalesCommentItemToTimestampResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreditMemoTypeResolver { + comments?: CreditMemoToCommentsResolver; + id?: CreditMemoToIdResolver; + items?: CreditMemoToItemsResolver; + number?: CreditMemoToNumberResolver; + total?: CreditMemoToTotalResolver; +} + +export interface CreditMemoToCommentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoToNumberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoToTotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreditMemoItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleCreditMemoItem' | 'CreditMemoItem' | 'DownloadableCreditMemoItem' | Promise<'BundleCreditMemoItem' | 'CreditMemoItem' | 'DownloadableCreditMemoItem'>; +} +export interface GQLOrderItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleOrderItem' | 'DownloadableOrderItem' | 'OrderItem' | Promise<'BundleOrderItem' | 'DownloadableOrderItem' | 'OrderItem'>; +} +export interface GQLOrderItemOptionTypeResolver { + items?: OrderItemOptionToItemsResolver; + label?: OrderItemOptionToLabelResolver; + linkItems?: OrderItemOptionToLinkItemsResolver; + value?: OrderItemOptionToValueResolver; +} + +export interface OrderItemOptionToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemOptionToLinkItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleOptionTypeResolver { + option_id?: BundleOptionToOption_idResolver; + price?: BundleOptionToPriceResolver; + qty?: BundleOptionToQtyResolver; + selection_details?: BundleOptionToSelection_detailsResolver; + title?: BundleOptionToTitleResolver; +} + +export interface BundleOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionToSelection_detailsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleOptionSelectionTypeResolver { + final_option_price?: BundleOptionSelectionToFinal_option_priceResolver; + final_option_price_excl_tax?: BundleOptionSelectionToFinal_option_price_excl_taxResolver; + name?: BundleOptionSelectionToNameResolver; + regular_option_price?: BundleOptionSelectionToRegular_option_priceResolver; + regular_option_price_excl_tax?: BundleOptionSelectionToRegular_option_price_excl_taxResolver; + selection_id?: BundleOptionSelectionToSelection_idResolver; +} + +export interface BundleOptionSelectionToFinal_option_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionSelectionToFinal_option_price_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionSelectionToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionSelectionToRegular_option_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionSelectionToRegular_option_price_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionSelectionToSelection_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreditMemoTotalTypeResolver { + adjustment?: CreditMemoTotalToAdjustmentResolver; + base_grand_total?: CreditMemoTotalToBase_grand_totalResolver; + discounts?: CreditMemoTotalToDiscountsResolver; + grand_total?: CreditMemoTotalToGrand_totalResolver; + shipping_handling?: CreditMemoTotalToShipping_handlingResolver; + subtotal?: CreditMemoTotalToSubtotalResolver; + taxes?: CreditMemoTotalToTaxesResolver; + total_shipping?: CreditMemoTotalToTotal_shippingResolver; + total_tax?: CreditMemoTotalToTotal_taxResolver; +} + +export interface CreditMemoTotalToAdjustmentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToBase_grand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToShipping_handlingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToSubtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToTaxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToTotal_shippingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoTotalToTotal_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShippingHandlingTypeResolver { + amount_excluding_tax?: ShippingHandlingToAmount_excluding_taxResolver; + amount_including_tax?: ShippingHandlingToAmount_including_taxResolver; + discounts?: ShippingHandlingToDiscountsResolver; + taxes?: ShippingHandlingToTaxesResolver; + total_amount?: ShippingHandlingToTotal_amountResolver; +} + +export interface ShippingHandlingToAmount_excluding_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingHandlingToAmount_including_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingHandlingToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingHandlingToTaxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingHandlingToTotal_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShippingDiscountTypeResolver { + amount?: ShippingDiscountToAmountResolver; +} + +export interface ShippingDiscountToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTaxItemTypeResolver { + amount?: TaxItemToAmountResolver; + rate?: TaxItemToRateResolver; + title?: TaxItemToTitleResolver; +} + +export interface TaxItemToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TaxItemToRateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TaxItemToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLInvoiceTypeResolver { + comments?: InvoiceToCommentsResolver; + id?: InvoiceToIdResolver; + items?: InvoiceToItemsResolver; + number?: InvoiceToNumberResolver; + total?: InvoiceToTotalResolver; +} + +export interface InvoiceToCommentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceToNumberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceToTotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLInvoiceItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleInvoiceItem' | 'DownloadableInvoiceItem' | 'InvoiceItem' | Promise<'BundleInvoiceItem' | 'DownloadableInvoiceItem' | 'InvoiceItem'>; +} +export interface GQLInvoiceTotalTypeResolver { + base_grand_total?: InvoiceTotalToBase_grand_totalResolver; + discounts?: InvoiceTotalToDiscountsResolver; + grand_total?: InvoiceTotalToGrand_totalResolver; + shipping_handling?: InvoiceTotalToShipping_handlingResolver; + subtotal?: InvoiceTotalToSubtotalResolver; + taxes?: InvoiceTotalToTaxesResolver; + total_shipping?: InvoiceTotalToTotal_shippingResolver; + total_tax?: InvoiceTotalToTotal_taxResolver; +} + +export interface InvoiceTotalToBase_grand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToShipping_handlingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToSubtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToTaxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToTotal_shippingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceTotalToTotal_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderPaymentMethodTypeResolver { + additional_data?: OrderPaymentMethodToAdditional_dataResolver; + name?: OrderPaymentMethodToNameResolver; + purchase_number?: OrderPaymentMethodToPurchase_numberResolver; + type?: OrderPaymentMethodToTypeResolver; +} + +export interface OrderPaymentMethodToAdditional_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderPaymentMethodToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderPaymentMethodToPurchase_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderPaymentMethodToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLKeyValueTypeResolver { + name?: KeyValueToNameResolver; + value?: KeyValueToValueResolver; +} + +export interface KeyValueToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface KeyValueToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderShipmentTypeResolver { + comments?: OrderShipmentToCommentsResolver; + id?: OrderShipmentToIdResolver; + items?: OrderShipmentToItemsResolver; + number?: OrderShipmentToNumberResolver; + tracking?: OrderShipmentToTrackingResolver; +} + +export interface OrderShipmentToCommentsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderShipmentToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderShipmentToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderShipmentToNumberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderShipmentToTrackingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShipmentItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleShipmentItem' | 'ShipmentItem' | Promise<'BundleShipmentItem' | 'ShipmentItem'>; +} +export interface GQLShipmentTrackingTypeResolver { + carrier?: ShipmentTrackingToCarrierResolver; + number?: ShipmentTrackingToNumberResolver; + title?: ShipmentTrackingToTitleResolver; +} + +export interface ShipmentTrackingToCarrierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentTrackingToNumberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentTrackingToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderTotalTypeResolver { + base_grand_total?: OrderTotalToBase_grand_totalResolver; + discounts?: OrderTotalToDiscountsResolver; + grand_total?: OrderTotalToGrand_totalResolver; + shipping_handling?: OrderTotalToShipping_handlingResolver; + subtotal?: OrderTotalToSubtotalResolver; + taxes?: OrderTotalToTaxesResolver; + total_shipping?: OrderTotalToTotal_shippingResolver; + total_tax?: OrderTotalToTotal_taxResolver; +} + +export interface OrderTotalToBase_grand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToShipping_handlingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToSubtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToTaxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToTotal_shippingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderTotalToTotal_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistTypeResolver { + id?: WishlistToIdResolver; + items?: WishlistToItemsResolver; + items_count?: WishlistToItems_countResolver; + items_v2?: WishlistToItems_v2Resolver; + sharing_code?: WishlistToSharing_codeResolver; + updated_at?: WishlistToUpdated_atResolver; +} + +export interface WishlistToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistToItems_v2Args { + currentPage?: number; + pageSize?: number; +} +export interface WishlistToItems_v2Resolver { + (parent: TParent, args: WishlistToItems_v2Args, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistToSharing_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistItemTypeResolver { + added_at?: WishlistItemToAdded_atResolver; + buy_request?: WishlistItemToBuy_requestResolver; + description?: WishlistItemToDescriptionResolver; + id?: WishlistItemToIdResolver; + options?: WishlistItemToOptionsResolver; + price?: WishlistItemToPriceResolver; + price_without_tax?: WishlistItemToPrice_without_taxResolver; + product?: WishlistItemToProductResolver; + qty?: WishlistItemToQtyResolver; + sku?: WishlistItemToSkuResolver; +} + +export interface WishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToBuy_requestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToPrice_without_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistItemOptionTypeResolver { + label?: WishlistItemOptionToLabelResolver; + value?: WishlistItemOptionToValueResolver; +} + +export interface WishlistItemOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistItemsTypeResolver { + items?: WishlistItemsToItemsResolver; + page_info?: WishlistItemsToPage_infoResolver; +} + +export interface WishlistItemsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistItemsToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleWishlistItem' | 'ConfigurableWishlistItem' | 'DownloadableWishlistItem' | 'GroupedProductWishlistItem' | 'SimpleWishlistItem' | 'VirtualWishlistItem' | Promise<'BundleWishlistItem' | 'ConfigurableWishlistItem' | 'DownloadableWishlistItem' | 'GroupedProductWishlistItem' | 'SimpleWishlistItem' | 'VirtualWishlistItem'>; +} +export interface GQLSelectedCustomizableOptionTypeResolver { + customizable_option_uid?: SelectedCustomizableOptionToCustomizable_option_uidResolver; + id?: SelectedCustomizableOptionToIdResolver; + is_required?: SelectedCustomizableOptionToIs_requiredResolver; + label?: SelectedCustomizableOptionToLabelResolver; + sort_order?: SelectedCustomizableOptionToSort_orderResolver; + type?: SelectedCustomizableOptionToTypeResolver; + values?: SelectedCustomizableOptionToValuesResolver; +} + +export interface SelectedCustomizableOptionToCustomizable_option_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToIs_requiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedCustomizableOptionValueTypeResolver { + customizable_option_value_uid?: SelectedCustomizableOptionValueToCustomizable_option_value_uidResolver; + id?: SelectedCustomizableOptionValueToIdResolver; + label?: SelectedCustomizableOptionValueToLabelResolver; + price?: SelectedCustomizableOptionValueToPriceResolver; + value?: SelectedCustomizableOptionValueToValueResolver; +} + +export interface SelectedCustomizableOptionValueToCustomizable_option_value_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionValueToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionValueToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedCustomizableOptionValueToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartItemSelectedOptionValuePriceTypeResolver { + type?: CartItemSelectedOptionValuePriceToTypeResolver; + units?: CartItemSelectedOptionValuePriceToUnitsResolver; + value?: CartItemSelectedOptionValuePriceToValueResolver; +} + +export interface CartItemSelectedOptionValuePriceToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemSelectedOptionValuePriceToUnitsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartItemSelectedOptionValuePriceToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerDownloadableProductsTypeResolver { + items?: CustomerDownloadableProductsToItemsResolver; +} + +export interface CustomerDownloadableProductsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerDownloadableProductTypeResolver { + date?: CustomerDownloadableProductToDateResolver; + download_url?: CustomerDownloadableProductToDownload_urlResolver; + link_title?: CustomerDownloadableProductToLink_titleResolver; + order_id?: CustomerDownloadableProductToOrder_idResolver; + order_increment_id?: CustomerDownloadableProductToOrder_increment_idResolver; + remaining_downloads?: CustomerDownloadableProductToRemaining_downloadsResolver; + status?: CustomerDownloadableProductToStatusResolver; + title?: CustomerDownloadableProductToTitleResolver; +} + +export interface CustomerDownloadableProductToDateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToDownload_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToLink_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToOrder_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToOrder_increment_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToRemaining_downloadsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomerDownloadableProductToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerPaymentTokensTypeResolver { + items?: CustomerPaymentTokensToItemsResolver; +} + +export interface CustomerPaymentTokensToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaymentTokenTypeResolver { + details?: PaymentTokenToDetailsResolver; + payment_method_code?: PaymentTokenToPayment_method_codeResolver; + public_hash?: PaymentTokenToPublic_hashResolver; + type?: PaymentTokenToTypeResolver; +} + +export interface PaymentTokenToDetailsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTokenToPayment_method_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTokenToPublic_hashResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTokenToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLIsConfigSettingEnabledOutputTypeResolver { + is_enabled?: IsConfigSettingEnabledOutputToIs_enabledResolver; +} + +export interface IsConfigSettingEnabledOutputToIs_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBraintreeTypeResolver { + is_three_d_secure?: BraintreeToIs_three_d_secureResolver; +} + +export interface BraintreeToIs_three_d_secureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartDisplayConfigTypeResolver { + display_full_tax_summary?: CartDisplayConfigToDisplay_full_tax_summaryResolver; + display_tax_in_price?: CartDisplayConfigToDisplay_tax_in_priceResolver; + display_tax_in_shipping_amount?: CartDisplayConfigToDisplay_tax_in_shipping_amountResolver; + display_tax_in_subtotal?: CartDisplayConfigToDisplay_tax_in_subtotalResolver; + display_zero_tax_subtotal?: CartDisplayConfigToDisplay_zero_tax_subtotalResolver; + include_tax_in_order_total?: CartDisplayConfigToInclude_tax_in_order_totalResolver; +} + +export interface CartDisplayConfigToDisplay_full_tax_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDisplayConfigToDisplay_tax_in_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDisplayConfigToDisplay_tax_in_shipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDisplayConfigToDisplay_tax_in_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDisplayConfigToDisplay_zero_tax_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartDisplayConfigToInclude_tax_in_order_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLQuoteDataTypeResolver { + applied_rule_ids?: QuoteDataToApplied_rule_idsResolver; + applied_taxes?: QuoteDataToApplied_taxesResolver; + base_currency_code?: QuoteDataToBase_currency_codeResolver; + base_discount_amount?: QuoteDataToBase_discount_amountResolver; + base_grand_total?: QuoteDataToBase_grand_totalResolver; + base_shipping_amount?: QuoteDataToBase_shipping_amountResolver; + base_shipping_discount_amount?: QuoteDataToBase_shipping_discount_amountResolver; + base_shipping_incl_tax?: QuoteDataToBase_shipping_incl_taxResolver; + base_shipping_tax_amount?: QuoteDataToBase_shipping_tax_amountResolver; + base_subtotal?: QuoteDataToBase_subtotalResolver; + base_subtotal_with_discount?: QuoteDataToBase_subtotal_with_discountResolver; + base_tax_amount?: QuoteDataToBase_tax_amountResolver; + coupon_code?: QuoteDataToCoupon_codeResolver; + customer_is_guest?: QuoteDataToCustomer_is_guestResolver; + customer_tax_class_id?: QuoteDataToCustomer_tax_class_idResolver; + discount_amount?: QuoteDataToDiscount_amountResolver; + grand_total?: QuoteDataToGrand_totalResolver; + id?: QuoteDataToIdResolver; + is_in_store_pickup_available?: QuoteDataToIs_in_store_pickup_availableResolver; + is_virtual?: QuoteDataToIs_virtualResolver; + items?: QuoteDataToItemsResolver; + items_count?: QuoteDataToItems_countResolver; + items_qty?: QuoteDataToItems_qtyResolver; + quote_currency_code?: QuoteDataToQuote_currency_codeResolver; + shipping_amount?: QuoteDataToShipping_amountResolver; + shipping_discount_amount?: QuoteDataToShipping_discount_amountResolver; + shipping_incl_tax?: QuoteDataToShipping_incl_taxResolver; + shipping_method?: QuoteDataToShipping_methodResolver; + shipping_tax_amount?: QuoteDataToShipping_tax_amountResolver; + store_id?: QuoteDataToStore_idResolver; + subtotal?: QuoteDataToSubtotalResolver; + subtotal_incl_tax?: QuoteDataToSubtotal_incl_taxResolver; + subtotal_with_discount?: QuoteDataToSubtotal_with_discountResolver; + tax_amount?: QuoteDataToTax_amountResolver; + weee_tax_applied_amount?: QuoteDataToWeee_tax_applied_amountResolver; +} + +export interface QuoteDataToApplied_rule_idsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToApplied_taxesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_grand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_shipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_shipping_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_shipping_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_shipping_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_subtotal_with_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToBase_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToCoupon_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToCustomer_is_guestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToCustomer_tax_class_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToDiscount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToIs_in_store_pickup_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToIs_virtualResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToItems_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToQuote_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToShipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToShipping_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToShipping_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToShipping_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToShipping_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToStore_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToSubtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToSubtotal_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToSubtotal_with_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToTax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface QuoteDataToWeee_tax_applied_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTotalsObjectTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'QuoteData' | 'PaymentTotals' | Promise<'QuoteData' | 'PaymentTotals'>; +} +export interface GQLTotalsItemTypeResolver { + base_discount_amount?: TotalsItemToBase_discount_amountResolver; + base_price?: TotalsItemToBase_priceResolver; + base_price_incl_tax?: TotalsItemToBase_price_incl_taxResolver; + base_row_total?: TotalsItemToBase_row_totalResolver; + base_row_total_incl_tax?: TotalsItemToBase_row_total_incl_taxResolver; + base_tax_amount?: TotalsItemToBase_tax_amountResolver; + bundle_options?: TotalsItemToBundle_optionsResolver; + customizable_options?: TotalsItemToCustomizable_optionsResolver; + discount_amount?: TotalsItemToDiscount_amountResolver; + discount_percent?: TotalsItemToDiscount_percentResolver; + downloadable_links?: TotalsItemToDownloadable_linksResolver; + item_id?: TotalsItemToItem_idResolver; + name?: TotalsItemToNameResolver; + options?: TotalsItemToOptionsResolver; + price?: TotalsItemToPriceResolver; + price_incl_tax?: TotalsItemToPrice_incl_taxResolver; + product?: TotalsItemToProductResolver; + qty?: TotalsItemToQtyResolver; + row_total?: TotalsItemToRow_totalResolver; + row_total_incl_tax?: TotalsItemToRow_total_incl_taxResolver; + row_total_with_discount?: TotalsItemToRow_total_with_discountResolver; + sku?: TotalsItemToSkuResolver; + tax_amount?: TotalsItemToTax_amountResolver; + tax_percent?: TotalsItemToTax_percentResolver; + weee_tax_applied?: TotalsItemToWeee_tax_appliedResolver; + weee_tax_applied_amount?: TotalsItemToWeee_tax_applied_amountResolver; +} + +export interface TotalsItemToBase_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBase_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBase_price_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBase_row_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBase_row_total_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBase_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToDiscount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToDiscount_percentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToDownloadable_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToItem_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToPrice_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToRow_total_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToRow_total_with_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToTax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToTax_percentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToWeee_tax_appliedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsItemToWeee_tax_applied_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedBundleOptionTypeResolver { + id?: SelectedBundleOptionToIdResolver; + label?: SelectedBundleOptionToLabelResolver; + type?: SelectedBundleOptionToTypeResolver; + uid?: SelectedBundleOptionToUidResolver; + values?: SelectedBundleOptionToValuesResolver; +} + +export interface SelectedBundleOptionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedBundleOptionValueTypeResolver { + id?: SelectedBundleOptionValueToIdResolver; + label?: SelectedBundleOptionValueToLabelResolver; + price?: SelectedBundleOptionValueToPriceResolver; + quantity?: SelectedBundleOptionValueToQuantityResolver; + uid?: SelectedBundleOptionValueToUidResolver; +} + +export interface SelectedBundleOptionValueToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionValueToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionValueToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedBundleOptionValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedDownloadableLinksTypeResolver { + id?: SelectedDownloadableLinksToIdResolver; + label?: SelectedDownloadableLinksToLabelResolver; +} + +export interface SelectedDownloadableLinksToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedDownloadableLinksToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAppliedTaxItemTypeResolver { + amount?: AppliedTaxItemToAmountResolver; + percent?: AppliedTaxItemToPercentResolver; + rates?: AppliedTaxItemToRatesResolver; +} + +export interface AppliedTaxItemToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AppliedTaxItemToPercentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AppliedTaxItemToRatesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAppliedTaxItemRateTypeResolver { + percent?: AppliedTaxItemRateToPercentResolver; + title?: AppliedTaxItemRateToTitleResolver; +} + +export interface AppliedTaxItemRateToPercentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AppliedTaxItemRateToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLHostedProUrlTypeResolver { + secure_form_url?: HostedProUrlToSecure_form_urlResolver; +} + +export interface HostedProUrlToSecure_form_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderTypeResolver { + base_order_info?: OrderToBase_order_infoResolver; + items?: OrderToItemsResolver; + order_id?: OrderToOrder_idResolver; + order_number?: OrderToOrder_numberResolver; + order_products?: OrderToOrder_productsResolver; + payment_info?: OrderToPayment_infoResolver; + shipping_info?: OrderToShipping_infoResolver; + total?: OrderToTotalResolver; +} + +export interface OrderToBase_order_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToOrder_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToOrder_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToOrder_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToPayment_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToShipping_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderToTotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBaseOrderInfoTypeResolver { + created_at?: BaseOrderInfoToCreated_atResolver; + currency_code?: BaseOrderInfoToCurrency_codeResolver; + grand_total?: BaseOrderInfoToGrand_totalResolver; + id?: BaseOrderInfoToIdResolver; + increment_id?: BaseOrderInfoToIncrement_idResolver; + status?: BaseOrderInfoToStatusResolver; + status_label?: BaseOrderInfoToStatus_labelResolver; + sub_total?: BaseOrderInfoToSub_totalResolver; + total_qty_ordered?: BaseOrderInfoToTotal_qty_orderedResolver; +} + +export interface BaseOrderInfoToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToCurrency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToIncrement_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToStatus_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToSub_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BaseOrderInfoToTotal_qty_orderedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaymentInfoTypeResolver { + additional_information?: PaymentInfoToAdditional_informationResolver; + cc_last_4?: PaymentInfoToCc_last_4Resolver; + cc_owner?: PaymentInfoToCc_ownerResolver; + cc_type?: PaymentInfoToCc_typeResolver; + method?: PaymentInfoToMethodResolver; +} + +export interface PaymentInfoToAdditional_informationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentInfoToCc_last_4Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentInfoToCc_ownerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentInfoToCc_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentInfoToMethodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAdditionalCustomerInfoTypeResolver { + bank?: AdditionalCustomerInfoToBankResolver; + credit_type?: AdditionalCustomerInfoToCredit_typeResolver; + customer_info?: AdditionalCustomerInfoToCustomer_infoResolver; + method_title?: AdditionalCustomerInfoToMethod_titleResolver; + month?: AdditionalCustomerInfoToMonthResolver; +} + +export interface AdditionalCustomerInfoToBankResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AdditionalCustomerInfoToCredit_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AdditionalCustomerInfoToCustomer_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AdditionalCustomerInfoToMethod_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AdditionalCustomerInfoToMonthResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreditCustomerInfoTypeResolver { + first_name?: CreditCustomerInfoToFirst_nameResolver; + iin_number?: CreditCustomerInfoToIin_numberResolver; + last_name?: CreditCustomerInfoToLast_nameResolver; + middle_name?: CreditCustomerInfoToMiddle_nameResolver; + phone?: CreditCustomerInfoToPhoneResolver; +} + +export interface CreditCustomerInfoToFirst_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditCustomerInfoToIin_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditCustomerInfoToLast_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditCustomerInfoToMiddle_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditCustomerInfoToPhoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShippingInfoTypeResolver { + shipping_address?: ShippingInfoToShipping_addressResolver; + shipping_amount?: ShippingInfoToShipping_amountResolver; + shipping_description?: ShippingInfoToShipping_descriptionResolver; + shipping_incl_tax?: ShippingInfoToShipping_incl_taxResolver; + shipping_method?: ShippingInfoToShipping_methodResolver; + tracking_numbers?: ShippingInfoToTracking_numbersResolver; +} + +export interface ShippingInfoToShipping_addressResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingInfoToShipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingInfoToShipping_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingInfoToShipping_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingInfoToShipping_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingInfoToTracking_numbersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderCustomerAddressTypeResolver { + apartment_number?: OrderCustomerAddressToApartment_numberResolver; + city?: OrderCustomerAddressToCityResolver; + company?: OrderCustomerAddressToCompanyResolver; + country_id?: OrderCustomerAddressToCountry_idResolver; + customer_id?: OrderCustomerAddressToCustomer_idResolver; + district?: OrderCustomerAddressToDistrictResolver; + firstname?: OrderCustomerAddressToFirstnameResolver; + house_number?: OrderCustomerAddressToHouse_numberResolver; + id?: OrderCustomerAddressToIdResolver; + is_b2b?: OrderCustomerAddressToIs_b2bResolver; + lastname?: OrderCustomerAddressToLastnameResolver; + middlename?: OrderCustomerAddressToMiddlenameResolver; + organizationaddress?: OrderCustomerAddressToOrganizationaddressResolver; + organizationbik?: OrderCustomerAddressToOrganizationbikResolver; + organizationbin?: OrderCustomerAddressToOrganizationbinResolver; + organizationiic?: OrderCustomerAddressToOrganizationiicResolver; + organizationname?: OrderCustomerAddressToOrganizationnameResolver; + post_office_code?: OrderCustomerAddressToPost_office_codeResolver; + postcode?: OrderCustomerAddressToPostcodeResolver; + postomat_code?: OrderCustomerAddressToPostomat_codeResolver; + prefix?: OrderCustomerAddressToPrefixResolver; + region?: OrderCustomerAddressToRegionResolver; + store_pickup_code?: OrderCustomerAddressToStore_pickup_codeResolver; + street?: OrderCustomerAddressToStreetResolver; + telephone?: OrderCustomerAddressToTelephoneResolver; +} + +export interface OrderCustomerAddressToApartment_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToCompanyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToCountry_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToCustomer_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToDistrictResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToFirstnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToHouse_numberResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToIs_b2bResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToLastnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToMiddlenameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToOrganizationaddressResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToOrganizationbikResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToOrganizationbinResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToOrganizationiicResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToOrganizationnameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToPost_office_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToPostomat_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToPrefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToStore_pickup_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderCustomerAddressToTelephoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderListTypeResolver { + items?: OrderListToItemsResolver; +} + +export interface OrderListToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPayflowLinkTokenTypeResolver { + mode?: PayflowLinkTokenToModeResolver; + paypal_url?: PayflowLinkTokenToPaypal_urlResolver; + secure_token?: PayflowLinkTokenToSecure_tokenResolver; + secure_token_id?: PayflowLinkTokenToSecure_token_idResolver; +} + +export interface PayflowLinkTokenToModeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowLinkTokenToPaypal_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowLinkTokenToSecure_tokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowLinkTokenToSecure_token_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaymentMethodTypeResolver { + code?: PaymentMethodToCodeResolver; + title?: PaymentMethodToTitleResolver; +} + +export interface PaymentMethodToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentMethodToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLStoresTypeResolver { + stores?: StoresToStoresResolver; +} + +export interface StoresToStoresResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLStoreTypeResolver { + city?: StoreToCityResolver; + country?: StoreToCountryResolver; + description?: StoreToDescriptionResolver; + name?: StoreToNameResolver; + phone?: StoreToPhoneResolver; + pickup_location_code?: StoreToPickup_location_codeResolver; + postcode?: StoreToPostcodeResolver; + region?: StoreToRegionResolver; + street?: StoreToStreetResolver; +} + +export interface StoreToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToCountryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToPhoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToPickup_location_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface StoreToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLIsEmailAvailableOutputTypeResolver { + is_email_available?: IsEmailAvailableOutputToIs_email_availableResolver; +} + +export interface IsEmailAvailableOutputToIs_email_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPickupLocationsTypeResolver { + items?: PickupLocationsToItemsResolver; + page_info?: PickupLocationsToPage_infoResolver; + total_count?: PickupLocationsToTotal_countResolver; +} + +export interface PickupLocationsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationsToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationsToTotal_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPickupLocationTypeResolver { + city?: PickupLocationToCityResolver; + contact_name?: PickupLocationToContact_nameResolver; + country_id?: PickupLocationToCountry_idResolver; + description?: PickupLocationToDescriptionResolver; + email?: PickupLocationToEmailResolver; + fax?: PickupLocationToFaxResolver; + latitude?: PickupLocationToLatitudeResolver; + longitude?: PickupLocationToLongitudeResolver; + name?: PickupLocationToNameResolver; + phone?: PickupLocationToPhoneResolver; + pickup_location_code?: PickupLocationToPickup_location_codeResolver; + postcode?: PickupLocationToPostcodeResolver; + region?: PickupLocationToRegionResolver; + region_id?: PickupLocationToRegion_idResolver; + street?: PickupLocationToStreetResolver; +} + +export interface PickupLocationToCityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToContact_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToCountry_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToEmailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToFaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToLatitudeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToLongitudeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToPhoneResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToPickup_location_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToPostcodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToRegionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToRegion_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PickupLocationToStreetResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductReviewRatingsMetadataTypeResolver { + items?: ProductReviewRatingsMetadataToItemsResolver; +} + +export interface ProductReviewRatingsMetadataToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductReviewRatingMetadataTypeResolver { + id?: ProductReviewRatingMetadataToIdResolver; + name?: ProductReviewRatingMetadataToNameResolver; + values?: ProductReviewRatingMetadataToValuesResolver; +} + +export interface ProductReviewRatingMetadataToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewRatingMetadataToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewRatingMetadataToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductReviewRatingValueMetadataTypeResolver { + value?: ProductReviewRatingValueMetadataToValueResolver; + value_id?: ProductReviewRatingValueMetadataToValue_idResolver; +} + +export interface ProductReviewRatingValueMetadataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductReviewRatingValueMetadataToValue_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductsTypeResolver { + aggregations?: ProductsToAggregationsResolver; + filters?: ProductsToFiltersResolver; + items?: ProductsToItemsResolver; + page_info?: ProductsToPage_infoResolver; + sort_fields?: ProductsToSort_fieldsResolver; + total_count?: ProductsToTotal_countResolver; +} + +export interface ProductsToAggregationsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductsToFiltersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductsToPage_infoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductsToSort_fieldsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductsToTotal_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAggregationTypeResolver { + attribute_code?: AggregationToAttribute_codeResolver; + count?: AggregationToCountResolver; + has_swatch?: AggregationToHas_swatchResolver; + is_boolean?: AggregationToIs_booleanResolver; + label?: AggregationToLabelResolver; + options?: AggregationToOptionsResolver; + position?: AggregationToPositionResolver; +} + +export interface AggregationToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToCountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToHas_swatchResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToIs_booleanResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAggregationOptionTypeResolver { + count?: AggregationOptionToCountResolver; + label?: AggregationOptionToLabelResolver; + swatch_data?: AggregationOptionToSwatch_dataResolver; + value?: AggregationOptionToValueResolver; +} + +export interface AggregationOptionToCountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationOptionToSwatch_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AggregationOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAggregationOptionInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'AggregationOption' | Promise<'AggregationOption'>; +} +export interface GQLSwatchDataTypeResolver { + type?: SwatchDataToTypeResolver; + value?: SwatchDataToValueResolver; +} + +export interface SwatchDataToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SwatchDataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLLayerFilterTypeResolver { + filter_items?: LayerFilterToFilter_itemsResolver; + filter_items_count?: LayerFilterToFilter_items_countResolver; + name?: LayerFilterToNameResolver; + request_var?: LayerFilterToRequest_varResolver; +} + +export interface LayerFilterToFilter_itemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface LayerFilterToFilter_items_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface LayerFilterToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface LayerFilterToRequest_varResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLLayerFilterItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'LayerFilterItem' | 'SwatchLayerFilterItem' | Promise<'LayerFilterItem' | 'SwatchLayerFilterItem'>; +} +export interface GQLSortFieldsTypeResolver { + default?: SortFieldsToDefaultResolver; + options?: SortFieldsToOptionsResolver; +} + +export interface SortFieldsToDefaultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SortFieldsToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSortFieldTypeResolver { + label?: SortFieldToLabelResolver; + value?: SortFieldToValueResolver; +} + +export interface SortFieldToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SortFieldToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistOutputTypeResolver { + creators_name?: WishlistOutputToCreators_nameResolver; + id?: WishlistOutputToIdResolver; + items?: WishlistOutputToItemsResolver; + items_count?: WishlistOutputToItems_countResolver; + name?: WishlistOutputToNameResolver; + sharing_code?: WishlistOutputToSharing_codeResolver; + updated_at?: WishlistOutputToUpdated_atResolver; +} + +export interface WishlistOutputToCreators_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToSharing_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistOutputToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMenuTypeResolver { + css_class?: MenuToCss_classResolver; + is_active?: MenuToIs_activeResolver; + items?: MenuToItemsResolver; + menu_id?: MenuToMenu_idResolver; + title?: MenuToTitleResolver; +} + +export interface MenuToCss_classResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MenuToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MenuToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MenuToMenu_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MenuToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLItemTypeResolver { + category_id?: ItemToCategory_idResolver; + cms_page_identifier?: ItemToCms_page_identifierResolver; + icon?: ItemToIconResolver; + is_active?: ItemToIs_activeResolver; + is_promo?: ItemToIs_promoResolver; + item_class?: ItemToItem_classResolver; + item_id?: ItemToItem_idResolver; + parent_id?: ItemToParent_idResolver; + position?: ItemToPositionResolver; + promo_image?: ItemToPromo_imageResolver; + title?: ItemToTitleResolver; + url?: ItemToUrlResolver; + url_type?: ItemToUrl_typeResolver; +} + +export interface ItemToCategory_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToCms_page_identifierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToIconResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToIs_promoResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToItem_classResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToItem_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToParent_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToPromo_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemToUrl_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSliderTypeResolver { + animation_speed?: SliderToAnimation_speedResolver; + is_active?: SliderToIs_activeResolver; + lazy_load?: SliderToLazy_loadResolver; + position?: SliderToPositionResolver; + show_menu?: SliderToShow_menuResolver; + show_navigation?: SliderToShow_navigationResolver; + slide_speed?: SliderToSlide_speedResolver; + slider_id?: SliderToSlider_idResolver; + slides?: SliderToSlidesResolver; + slides_to_display?: SliderToSlides_to_displayResolver; + slides_to_display_mobile?: SliderToSlides_to_display_mobileResolver; + slides_to_display_tablet?: SliderToSlides_to_display_tabletResolver; + slides_to_scroll?: SliderToSlides_to_scrollResolver; + slides_to_scroll_mobile?: SliderToSlides_to_scroll_mobileResolver; + slides_to_scroll_tablet?: SliderToSlides_to_scroll_tabletResolver; + title?: SliderToTitleResolver; +} + +export interface SliderToAnimation_speedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToLazy_loadResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToShow_menuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToShow_navigationResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlide_speedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlider_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlidesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_displayResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_display_mobileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_display_tabletResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_scrollResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_scroll_mobileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToSlides_to_scroll_tabletResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SliderToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSlideTypeResolver { + desktop_image?: SlideToDesktop_imageResolver; + desktop_image_2?: SlideToDesktop_image_2Resolver; + desktop_image_3?: SlideToDesktop_image_3Resolver; + display_title?: SlideToDisplay_titleResolver; + display_title_2?: SlideToDisplay_title_2Resolver; + display_title_3?: SlideToDisplay_title_3Resolver; + embed_code?: SlideToEmbed_codeResolver; + embed_code_2?: SlideToEmbed_code_2Resolver; + embed_code_3?: SlideToEmbed_code_3Resolver; + end_time?: SlideToEnd_timeResolver; + is_active?: SlideToIs_activeResolver; + maps?: SlideToMapsResolver; + mobile_image?: SlideToMobile_imageResolver; + mobile_image_2?: SlideToMobile_image_2Resolver; + mobile_image_3?: SlideToMobile_image_3Resolver; + position?: SlideToPositionResolver; + slide_id?: SlideToSlide_idResolver; + slide_link?: SlideToSlide_linkResolver; + slide_link_2?: SlideToSlide_link_2Resolver; + slide_link_3?: SlideToSlide_link_3Resolver; + slide_link_text?: SlideToSlide_link_textResolver; + slide_text?: SlideToSlide_textResolver; + slide_text_2?: SlideToSlide_text_2Resolver; + slide_text_3?: SlideToSlide_text_3Resolver; + slide_text_position?: SlideToSlide_text_positionResolver; + slide_text_position_2?: SlideToSlide_text_position_2Resolver; + slide_text_position_3?: SlideToSlide_text_position_3Resolver; + slide_width_class?: SlideToSlide_width_classResolver; + start_time?: SlideToStart_timeResolver; + title?: SlideToTitleResolver; +} + +export interface SlideToDesktop_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToDesktop_image_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToDesktop_image_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToDisplay_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToDisplay_title_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToDisplay_title_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToEmbed_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToEmbed_code_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToEmbed_code_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToEnd_timeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToMapsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToMobile_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToMobile_image_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToMobile_image_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_linkResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_link_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_link_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_link_textResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_textResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_text_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_text_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_text_positionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_text_position_2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_text_position_3Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToSlide_width_classResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToStart_timeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SlideToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMapTypeResolver { + coordinates?: MapToCoordinatesResolver; + is_active?: MapToIs_activeResolver; + map_id?: MapToMap_idResolver; + product_id?: MapToProduct_idResolver; + title?: MapToTitleResolver; +} + +export interface MapToCoordinatesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MapToIs_activeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MapToMap_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MapToProduct_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MapToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTrackingDataTypeResolver { + page_tracking_enabled?: TrackingDataToPage_tracking_enabledResolver; + region_prefix?: TrackingDataToRegion_prefixResolver; + roi_tracking_enabled?: TrackingDataToRoi_tracking_enabledResolver; + wbt_profile_id?: TrackingDataToWbt_profile_idResolver; +} + +export interface TrackingDataToPage_tracking_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TrackingDataToRegion_prefixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TrackingDataToRoi_tracking_enabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TrackingDataToWbt_profile_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLEntityUrlTypeResolver { + canonical_url?: EntityUrlToCanonical_urlResolver; + entity_uid?: EntityUrlToEntity_uidResolver; + id?: EntityUrlToIdResolver; + redirectCode?: EntityUrlToRedirectCodeResolver; + relative_url?: EntityUrlToRelative_urlResolver; + sku?: EntityUrlToSkuResolver; + type?: EntityUrlToTypeResolver; +} + +export interface EntityUrlToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToEntity_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToRedirectCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface EntityUrlToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLMutationTypeResolver { + addBundleProductsToCart?: MutationToAddBundleProductsToCartResolver; + addConfigurableProductsToCart?: MutationToAddConfigurableProductsToCartResolver; + addDownloadableProductsToCart?: MutationToAddDownloadableProductsToCartResolver; + addProductsToCart?: MutationToAddProductsToCartResolver; + addProductsToCompareList?: MutationToAddProductsToCompareListResolver; + addProductsToWishlist?: MutationToAddProductsToWishlistResolver; + addSimpleProductsToCart?: MutationToAddSimpleProductsToCartResolver; + addVirtualProductsToCart?: MutationToAddVirtualProductsToCartResolver; + addWishlistItemsToCart?: MutationToAddWishlistItemsToCartResolver; + applyCoupon?: MutationToApplyCouponResolver; + applyCouponToCart?: MutationToApplyCouponToCartResolver; + assignCompareListToCustomer?: MutationToAssignCompareListToCustomerResolver; + changeCustomerPassword?: MutationToChangeCustomerPasswordResolver; + confirmCustomerEmail?: MutationToConfirmCustomerEmailResolver; + contactForm?: MutationToContactFormResolver; + createBraintreeClientToken?: MutationToCreateBraintreeClientTokenResolver; + createCompareList?: MutationToCreateCompareListResolver; + createCustomer?: MutationToCreateCustomerResolver; + createCustomerAddress?: MutationToCreateCustomerAddressResolver; + createCustomerV2?: MutationToCreateCustomerV2Resolver; + createEmptyCart?: MutationToCreateEmptyCartResolver; + createKlarnaPaymentsSession?: MutationToCreateKlarnaPaymentsSessionResolver; + createKlarnaToken?: MutationToCreateKlarnaTokenResolver; + createPayflowProToken?: MutationToCreatePayflowProTokenResolver; + createPaypalExpressToken?: MutationToCreatePaypalExpressTokenResolver; + createProductReview?: MutationToCreateProductReviewResolver; + deleteCompareList?: MutationToDeleteCompareListResolver; + deleteCustomerAddress?: MutationToDeleteCustomerAddressResolver; + deletePaymentToken?: MutationToDeletePaymentTokenResolver; + estimateShippingCosts?: MutationToEstimateShippingCostsResolver; + forgotPassword?: MutationToForgotPasswordResolver; + generateCustomerToken?: MutationToGenerateCustomerTokenResolver; + generateCustomerTokenAsAdmin?: MutationToGenerateCustomerTokenAsAdminResolver; + handlePayflowProResponse?: MutationToHandlePayflowProResponseResolver; + linkOrder?: MutationToLinkOrderResolver; + mergeCarts?: MutationToMergeCartsResolver; + placeOrder?: MutationToPlaceOrderResolver; + productAlertSubscribe?: MutationToProductAlertSubscribeResolver; + removeCartItem?: MutationToRemoveCartItemResolver; + removeCoupon?: MutationToRemoveCouponResolver; + removeCouponFromCart?: MutationToRemoveCouponFromCartResolver; + removeItemFromCart?: MutationToRemoveItemFromCartResolver; + removeProductsFromCompareList?: MutationToRemoveProductsFromCompareListResolver; + removeProductsFromWishlist?: MutationToRemoveProductsFromWishlistResolver; + reorderItems?: MutationToReorderItemsResolver; + requestPasswordResetEmail?: MutationToRequestPasswordResetEmailResolver; + resendConfirmationEmail?: MutationToResendConfirmationEmailResolver; + resetPassword?: MutationToResetPasswordResolver; + revokeCustomerToken?: MutationToRevokeCustomerTokenResolver; + s_clearWishlist?: MutationToS_clearWishlistResolver; + s_createPaypalExpressToken?: MutationToS_createPaypalExpressTokenResolver; + s_moveWishlistToCart?: MutationToS_moveWishlistToCartResolver; + s_placeOrder?: MutationToS_placeOrderResolver; + s_removeProductFromWishlist?: MutationToS_removeProductFromWishlistResolver; + s_resetPassword?: MutationToS_resetPasswordResolver; + s_saveWishlistItem?: MutationToS_saveWishlistItemResolver; + s_setBillingAddressOnCart?: MutationToS_setBillingAddressOnCartResolver; + s_setPaymentMethodOnCart?: MutationToS_setPaymentMethodOnCartResolver; + s_shareWishlist?: MutationToS_shareWishlistResolver; + saveAddressInformation?: MutationToSaveAddressInformationResolver; + saveCartItem?: MutationToSaveCartItemResolver; + saveSelectedCurrency?: MutationToSaveSelectedCurrencyResolver; + sendEmailToFriend?: MutationToSendEmailToFriendResolver; + setBillingAddressOnCart?: MutationToSetBillingAddressOnCartResolver; + setGuestEmailOnCart?: MutationToSetGuestEmailOnCartResolver; + setPaymentMethodAndPlaceOrder?: MutationToSetPaymentMethodAndPlaceOrderResolver; + setPaymentMethodOnCart?: MutationToSetPaymentMethodOnCartResolver; + setShippingAddressesOnCart?: MutationToSetShippingAddressesOnCartResolver; + setShippingMethodsOnCart?: MutationToSetShippingMethodsOnCartResolver; + subscribeEmailToNewsletter?: MutationToSubscribeEmailToNewsletterResolver; + updateCartItems?: MutationToUpdateCartItemsResolver; + updateChatProfile?: MutationToUpdateChatProfileResolver; + updateCustomer?: MutationToUpdateCustomerResolver; + updateCustomerAddress?: MutationToUpdateCustomerAddressResolver; + updateCustomerEmail?: MutationToUpdateCustomerEmailResolver; + updateCustomerV2?: MutationToUpdateCustomerV2Resolver; + updateProductsInWishlist?: MutationToUpdateProductsInWishlistResolver; + updateQuoteEmail?: MutationToUpdateQuoteEmailResolver; +} + +export interface MutationToAddBundleProductsToCartArgs { + input?: GQLAddBundleProductsToCartInput; +} +export interface MutationToAddBundleProductsToCartResolver { + (parent: TParent, args: MutationToAddBundleProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddConfigurableProductsToCartArgs { + input?: GQLAddConfigurableProductsToCartInput; +} +export interface MutationToAddConfigurableProductsToCartResolver { + (parent: TParent, args: MutationToAddConfigurableProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddDownloadableProductsToCartArgs { + input?: GQLAddDownloadableProductsToCartInput; +} +export interface MutationToAddDownloadableProductsToCartResolver { + (parent: TParent, args: MutationToAddDownloadableProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddProductsToCartArgs { + cartId: string; + cartItems: Array; +} +export interface MutationToAddProductsToCartResolver { + (parent: TParent, args: MutationToAddProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddProductsToCompareListArgs { + input?: GQLAddProductsToCompareListInput; +} +export interface MutationToAddProductsToCompareListResolver { + (parent: TParent, args: MutationToAddProductsToCompareListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddProductsToWishlistArgs { + wishlistId: string; + wishlistItems: Array; +} +export interface MutationToAddProductsToWishlistResolver { + (parent: TParent, args: MutationToAddProductsToWishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddSimpleProductsToCartArgs { + input?: GQLAddSimpleProductsToCartInput; +} +export interface MutationToAddSimpleProductsToCartResolver { + (parent: TParent, args: MutationToAddSimpleProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddVirtualProductsToCartArgs { + input?: GQLAddVirtualProductsToCartInput; +} +export interface MutationToAddVirtualProductsToCartResolver { + (parent: TParent, args: MutationToAddVirtualProductsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAddWishlistItemsToCartArgs { + wishlistId: string; + wishlistItemIds?: Array; +} +export interface MutationToAddWishlistItemsToCartResolver { + (parent: TParent, args: MutationToAddWishlistItemsToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToApplyCouponArgs { + guestCartId?: string; + coupon_code: string; +} +export interface MutationToApplyCouponResolver { + (parent: TParent, args: MutationToApplyCouponArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToApplyCouponToCartArgs { + input?: GQLApplyCouponToCartInput; +} +export interface MutationToApplyCouponToCartResolver { + (parent: TParent, args: MutationToApplyCouponToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToAssignCompareListToCustomerArgs { + uid: string; +} +export interface MutationToAssignCompareListToCustomerResolver { + (parent: TParent, args: MutationToAssignCompareListToCustomerArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToChangeCustomerPasswordArgs { + currentPassword: string; + newPassword: string; +} +export interface MutationToChangeCustomerPasswordResolver { + (parent: TParent, args: MutationToChangeCustomerPasswordArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToConfirmCustomerEmailArgs { + key: string; + email: string; + password: string; +} +export interface MutationToConfirmCustomerEmailResolver { + (parent: TParent, args: MutationToConfirmCustomerEmailArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToContactFormArgs { + contact: GQLContactForm; +} +export interface MutationToContactFormResolver { + (parent: TParent, args: MutationToContactFormArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateBraintreeClientTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateCompareListArgs { + input?: GQLCreateCompareListInput; +} +export interface MutationToCreateCompareListResolver { + (parent: TParent, args: MutationToCreateCompareListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateCustomerArgs { + input: GQLCustomerInput; +} +export interface MutationToCreateCustomerResolver { + (parent: TParent, args: MutationToCreateCustomerArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateCustomerAddressArgs { + input: GQLCustomerAddressInput; +} +export interface MutationToCreateCustomerAddressResolver { + (parent: TParent, args: MutationToCreateCustomerAddressArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateCustomerV2Args { + input: GQLCustomerCreateInput; +} +export interface MutationToCreateCustomerV2Resolver { + (parent: TParent, args: MutationToCreateCustomerV2Args, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateEmptyCartArgs { + input?: GQLcreateEmptyCartInput; +} +export interface MutationToCreateEmptyCartResolver { + (parent: TParent, args: MutationToCreateEmptyCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateKlarnaPaymentsSessionArgs { + input?: GQLcreateKlarnaPaymentsSessionInput; +} +export interface MutationToCreateKlarnaPaymentsSessionResolver { + (parent: TParent, args: MutationToCreateKlarnaPaymentsSessionArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateKlarnaTokenArgs { + input: GQLKlarnaTokenInput; +} +export interface MutationToCreateKlarnaTokenResolver { + (parent: TParent, args: MutationToCreateKlarnaTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreatePayflowProTokenArgs { + input: GQLPayflowProTokenInput; +} +export interface MutationToCreatePayflowProTokenResolver { + (parent: TParent, args: MutationToCreatePayflowProTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreatePaypalExpressTokenArgs { + input: GQLPaypalExpressTokenInput; +} +export interface MutationToCreatePaypalExpressTokenResolver { + (parent: TParent, args: MutationToCreatePaypalExpressTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToCreateProductReviewArgs { + input: GQLCreateProductReviewInput; +} +export interface MutationToCreateProductReviewResolver { + (parent: TParent, args: MutationToCreateProductReviewArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToDeleteCompareListArgs { + uid: string; +} +export interface MutationToDeleteCompareListResolver { + (parent: TParent, args: MutationToDeleteCompareListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToDeleteCustomerAddressArgs { + id: number; +} +export interface MutationToDeleteCustomerAddressResolver { + (parent: TParent, args: MutationToDeleteCustomerAddressArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToDeletePaymentTokenArgs { + public_hash: string; +} +export interface MutationToDeletePaymentTokenResolver { + (parent: TParent, args: MutationToDeletePaymentTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToEstimateShippingCostsArgs { + address: GQLEstimateShippingCostsAddress; + guestCartId?: string; +} +export interface MutationToEstimateShippingCostsResolver { + (parent: TParent, args: MutationToEstimateShippingCostsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToForgotPasswordArgs { + email: string; +} +export interface MutationToForgotPasswordResolver { + (parent: TParent, args: MutationToForgotPasswordArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToGenerateCustomerTokenArgs { + email: string; + password: string; +} +export interface MutationToGenerateCustomerTokenResolver { + (parent: TParent, args: MutationToGenerateCustomerTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToGenerateCustomerTokenAsAdminArgs { + input: GQLGenerateCustomerTokenAsAdminInput; +} +export interface MutationToGenerateCustomerTokenAsAdminResolver { + (parent: TParent, args: MutationToGenerateCustomerTokenAsAdminArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToHandlePayflowProResponseArgs { + input: GQLPayflowProResponseInput; +} +export interface MutationToHandlePayflowProResponseResolver { + (parent: TParent, args: MutationToHandlePayflowProResponseArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToLinkOrderArgs { + customer_email: string; +} +export interface MutationToLinkOrderResolver { + (parent: TParent, args: MutationToLinkOrderArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToMergeCartsArgs { + source_cart_id: string; + destination_cart_id?: string; +} +export interface MutationToMergeCartsResolver { + (parent: TParent, args: MutationToMergeCartsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToPlaceOrderArgs { + input?: GQLPlaceOrderInput; +} +export interface MutationToPlaceOrderResolver { + (parent: TParent, args: MutationToPlaceOrderArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToProductAlertSubscribeArgs { + productId: string; + type: string; +} +export interface MutationToProductAlertSubscribeResolver { + (parent: TParent, args: MutationToProductAlertSubscribeArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveCartItemArgs { + guestCartId?: string; + item_id: number; +} +export interface MutationToRemoveCartItemResolver { + (parent: TParent, args: MutationToRemoveCartItemArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveCouponArgs { + guestCartId?: string; +} +export interface MutationToRemoveCouponResolver { + (parent: TParent, args: MutationToRemoveCouponArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveCouponFromCartArgs { + input?: GQLRemoveCouponFromCartInput; +} +export interface MutationToRemoveCouponFromCartResolver { + (parent: TParent, args: MutationToRemoveCouponFromCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveItemFromCartArgs { + input?: GQLRemoveItemFromCartInput; +} +export interface MutationToRemoveItemFromCartResolver { + (parent: TParent, args: MutationToRemoveItemFromCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveProductsFromCompareListArgs { + input?: GQLRemoveProductsFromCompareListInput; +} +export interface MutationToRemoveProductsFromCompareListResolver { + (parent: TParent, args: MutationToRemoveProductsFromCompareListArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRemoveProductsFromWishlistArgs { + wishlistId: string; + wishlistItemsIds: Array; +} +export interface MutationToRemoveProductsFromWishlistResolver { + (parent: TParent, args: MutationToRemoveProductsFromWishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToReorderItemsArgs { + orderNumber: string; +} +export interface MutationToReorderItemsResolver { + (parent: TParent, args: MutationToReorderItemsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRequestPasswordResetEmailArgs { + email: string; +} +export interface MutationToRequestPasswordResetEmailResolver { + (parent: TParent, args: MutationToRequestPasswordResetEmailArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToResendConfirmationEmailArgs { + email: string; +} +export interface MutationToResendConfirmationEmailResolver { + (parent: TParent, args: MutationToResendConfirmationEmailArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToResetPasswordArgs { + email: string; + resetPasswordToken: string; + newPassword: string; +} +export interface MutationToResetPasswordResolver { + (parent: TParent, args: MutationToResetPasswordArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToRevokeCustomerTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_clearWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_createPaypalExpressTokenArgs { + input: GQLS_PaypalExpressTokenInput; +} +export interface MutationToS_createPaypalExpressTokenResolver { + (parent: TParent, args: MutationToS_createPaypalExpressTokenArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_moveWishlistToCartArgs { + guestCartId?: string; + sharingCode?: string; +} +export interface MutationToS_moveWishlistToCartResolver { + (parent: TParent, args: MutationToS_moveWishlistToCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_placeOrderArgs { + guestCartId?: string; +} +export interface MutationToS_placeOrderResolver { + (parent: TParent, args: MutationToS_placeOrderArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_removeProductFromWishlistArgs { + itemId: string; +} +export interface MutationToS_removeProductFromWishlistResolver { + (parent: TParent, args: MutationToS_removeProductFromWishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_resetPasswordArgs { + password: string; + token: string; + password_confirmation: string; +} +export interface MutationToS_resetPasswordResolver { + (parent: TParent, args: MutationToS_resetPasswordArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_saveWishlistItemArgs { + wishlistItem: GQLWishlistItemInput; +} +export interface MutationToS_saveWishlistItemResolver { + (parent: TParent, args: MutationToS_saveWishlistItemArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_setBillingAddressOnCartArgs { + input?: GQLS_SetBillingAddressOnCartInput; +} +export interface MutationToS_setBillingAddressOnCartResolver { + (parent: TParent, args: MutationToS_setBillingAddressOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_setPaymentMethodOnCartArgs { + input: GQLS_SetPaymentMethodOnCartInput; +} +export interface MutationToS_setPaymentMethodOnCartResolver { + (parent: TParent, args: MutationToS_setPaymentMethodOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToS_shareWishlistArgs { + input: GQLShareWishlistInput; +} +export interface MutationToS_shareWishlistResolver { + (parent: TParent, args: MutationToS_shareWishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSaveAddressInformationArgs { + addressInformation: GQLSaveAddressInformation; + guestCartId?: string; +} +export interface MutationToSaveAddressInformationResolver { + (parent: TParent, args: MutationToSaveAddressInformationArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSaveCartItemArgs { + cartItem: GQLCartItemInput; + guestCartId?: string; +} +export interface MutationToSaveCartItemResolver { + (parent: TParent, args: MutationToSaveCartItemArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSaveSelectedCurrencyArgs { + currency?: string; +} +export interface MutationToSaveSelectedCurrencyResolver { + (parent: TParent, args: MutationToSaveSelectedCurrencyArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSendEmailToFriendArgs { + input?: GQLSendEmailToFriendInput; +} +export interface MutationToSendEmailToFriendResolver { + (parent: TParent, args: MutationToSendEmailToFriendArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetBillingAddressOnCartArgs { + input?: GQLSetBillingAddressOnCartInput; +} +export interface MutationToSetBillingAddressOnCartResolver { + (parent: TParent, args: MutationToSetBillingAddressOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetGuestEmailOnCartArgs { + input?: GQLSetGuestEmailOnCartInput; +} +export interface MutationToSetGuestEmailOnCartResolver { + (parent: TParent, args: MutationToSetGuestEmailOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetPaymentMethodAndPlaceOrderArgs { + input?: GQLSetPaymentMethodAndPlaceOrderInput; +} +export interface MutationToSetPaymentMethodAndPlaceOrderResolver { + (parent: TParent, args: MutationToSetPaymentMethodAndPlaceOrderArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetPaymentMethodOnCartArgs { + input?: GQLSetPaymentMethodOnCartInput; +} +export interface MutationToSetPaymentMethodOnCartResolver { + (parent: TParent, args: MutationToSetPaymentMethodOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetShippingAddressesOnCartArgs { + input?: GQLSetShippingAddressesOnCartInput; +} +export interface MutationToSetShippingAddressesOnCartResolver { + (parent: TParent, args: MutationToSetShippingAddressesOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSetShippingMethodsOnCartArgs { + input?: GQLSetShippingMethodsOnCartInput; +} +export interface MutationToSetShippingMethodsOnCartResolver { + (parent: TParent, args: MutationToSetShippingMethodsOnCartArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToSubscribeEmailToNewsletterArgs { + email: string; +} +export interface MutationToSubscribeEmailToNewsletterResolver { + (parent: TParent, args: MutationToSubscribeEmailToNewsletterArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateCartItemsArgs { + input?: GQLUpdateCartItemsInput; +} +export interface MutationToUpdateCartItemsResolver { + (parent: TParent, args: MutationToUpdateCartItemsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateChatProfileArgs { + profileId: string; + email?: string; + firstname?: string; + lastname?: string; +} +export interface MutationToUpdateChatProfileResolver { + (parent: TParent, args: MutationToUpdateChatProfileArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateCustomerArgs { + input: GQLCustomerInput; +} +export interface MutationToUpdateCustomerResolver { + (parent: TParent, args: MutationToUpdateCustomerArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateCustomerAddressArgs { + id: number; + input?: GQLCustomerAddressInput; +} +export interface MutationToUpdateCustomerAddressResolver { + (parent: TParent, args: MutationToUpdateCustomerAddressArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateCustomerEmailArgs { + email: string; + password: string; +} +export interface MutationToUpdateCustomerEmailResolver { + (parent: TParent, args: MutationToUpdateCustomerEmailArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateCustomerV2Args { + input: GQLCustomerUpdateInput; +} +export interface MutationToUpdateCustomerV2Resolver { + (parent: TParent, args: MutationToUpdateCustomerV2Args, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateProductsInWishlistArgs { + wishlistId: string; + wishlistItems: Array; +} +export interface MutationToUpdateProductsInWishlistResolver { + (parent: TParent, args: MutationToUpdateProductsInWishlistArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface MutationToUpdateQuoteEmailArgs { + email: string; + cartId: string; +} +export interface MutationToUpdateQuoteEmailResolver { + (parent: TParent, args: MutationToUpdateQuoteEmailArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddBundleProductsToCartOutputTypeResolver { + cart?: AddBundleProductsToCartOutputToCartResolver; +} + +export interface AddBundleProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddConfigurableProductsToCartOutputTypeResolver { + cart?: AddConfigurableProductsToCartOutputToCartResolver; +} + +export interface AddConfigurableProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddDownloadableProductsToCartOutputTypeResolver { + cart?: AddDownloadableProductsToCartOutputToCartResolver; +} + +export interface AddDownloadableProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddProductsToCartOutputTypeResolver { + cart?: AddProductsToCartOutputToCartResolver; + user_errors?: AddProductsToCartOutputToUser_errorsResolver; +} + +export interface AddProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AddProductsToCartOutputToUser_errorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCartUserInputErrorTypeResolver { + code?: CartUserInputErrorToCodeResolver; + message?: CartUserInputErrorToMessageResolver; +} + +export interface CartUserInputErrorToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CartUserInputErrorToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddProductsToWishlistOutputTypeResolver { + user_errors?: AddProductsToWishlistOutputToUser_errorsResolver; + wishlist?: AddProductsToWishlistOutputToWishlistResolver; +} + +export interface AddProductsToWishlistOutputToUser_errorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AddProductsToWishlistOutputToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishListUserInputErrorTypeResolver { + code?: WishListUserInputErrorToCodeResolver; + message?: WishListUserInputErrorToMessageResolver; +} + +export interface WishListUserInputErrorToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishListUserInputErrorToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddSimpleProductsToCartOutputTypeResolver { + cart?: AddSimpleProductsToCartOutputToCartResolver; +} + +export interface AddSimpleProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddVirtualProductsToCartOutputTypeResolver { + cart?: AddVirtualProductsToCartOutputToCartResolver; +} + +export interface AddVirtualProductsToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAddWishlistItemsToCartOutputTypeResolver { + add_wishlist_items_to_cart_user_errors?: AddWishlistItemsToCartOutputToAdd_wishlist_items_to_cart_user_errorsResolver; + status?: AddWishlistItemsToCartOutputToStatusResolver; + wishlist?: AddWishlistItemsToCartOutputToWishlistResolver; +} + +export interface AddWishlistItemsToCartOutputToAdd_wishlist_items_to_cart_user_errorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AddWishlistItemsToCartOutputToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AddWishlistItemsToCartOutputToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLWishlistCartUserInputErrorTypeResolver { + code?: WishlistCartUserInputErrorToCodeResolver; + message?: WishlistCartUserInputErrorToMessageResolver; + wishlistId?: WishlistCartUserInputErrorToWishlistIdResolver; + wishlistItemId?: WishlistCartUserInputErrorToWishlistItemIdResolver; +} + +export interface WishlistCartUserInputErrorToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistCartUserInputErrorToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistCartUserInputErrorToWishlistIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface WishlistCartUserInputErrorToWishlistItemIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLApplyCouponToCartOutputTypeResolver { + cart?: ApplyCouponToCartOutputToCartResolver; +} + +export interface ApplyCouponToCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAssignCompareListToCustomerOutputTypeResolver { + compare_list?: AssignCompareListToCustomerOutputToCompare_listResolver; + result?: AssignCompareListToCustomerOutputToResultResolver; +} + +export interface AssignCompareListToCustomerOutputToCompare_listResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AssignCompareListToCustomerOutputToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreateCustomerTypeTypeResolver { + customer?: CreateCustomerTypeToCustomerResolver; + status?: CreateCustomerTypeToStatusResolver; + token?: CreateCustomerTypeToTokenResolver; +} + +export interface CreateCustomerTypeToCustomerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreateCustomerTypeToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreateCustomerTypeToTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLContactFormResponseTypeResolver { + message?: ContactFormResponseToMessageResolver; +} + +export interface ContactFormResponseToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerOutputTypeResolver { + customer?: CustomerOutputToCustomerResolver; +} + +export interface CustomerOutputToCustomerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLcreateKlarnaPaymentsSessionOutputTypeResolver { + client_token?: createKlarnaPaymentsSessionOutputToClient_tokenResolver; + payment_method_categories?: createKlarnaPaymentsSessionOutputToPayment_method_categoriesResolver; +} + +export interface createKlarnaPaymentsSessionOutputToClient_tokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface createKlarnaPaymentsSessionOutputToPayment_method_categoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCategoriesTypeResolver { + asset_urls?: CategoriesToAsset_urlsResolver; + identifier?: CategoriesToIdentifierResolver; + name?: CategoriesToNameResolver; +} + +export interface CategoriesToAsset_urlsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoriesToIdentifierResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CategoriesToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAssetsTypeResolver { + descriptive?: AssetsToDescriptiveResolver; + standard?: AssetsToStandardResolver; +} + +export interface AssetsToDescriptiveResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface AssetsToStandardResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreatePayflowProTokenOutputTypeResolver { + response_message?: CreatePayflowProTokenOutputToResponse_messageResolver; + result?: CreatePayflowProTokenOutputToResultResolver; + result_code?: CreatePayflowProTokenOutputToResult_codeResolver; + secure_token?: CreatePayflowProTokenOutputToSecure_tokenResolver; + secure_token_id?: CreatePayflowProTokenOutputToSecure_token_idResolver; +} + +export interface CreatePayflowProTokenOutputToResponse_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreatePayflowProTokenOutputToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreatePayflowProTokenOutputToResult_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreatePayflowProTokenOutputToSecure_tokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreatePayflowProTokenOutputToSecure_token_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaypalExpressTokenOutputTypeResolver { + paypal_urls?: PaypalExpressTokenOutputToPaypal_urlsResolver; + token?: PaypalExpressTokenOutputToTokenResolver; +} + +export interface PaypalExpressTokenOutputToPaypal_urlsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaypalExpressTokenOutputToTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaypalExpressUrlListTypeResolver { + edit?: PaypalExpressUrlListToEditResolver; + start?: PaypalExpressUrlListToStartResolver; +} + +export interface PaypalExpressUrlListToEditResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaypalExpressUrlListToStartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreateProductReviewOutputTypeResolver { + review?: CreateProductReviewOutputToReviewResolver; +} + +export interface CreateProductReviewOutputToReviewResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDeleteCompareListOutputTypeResolver { + result?: DeleteCompareListOutputToResultResolver; +} + +export interface DeleteCompareListOutputToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDeletePaymentTokenOutputTypeResolver { + customerPaymentTokens?: DeletePaymentTokenOutputToCustomerPaymentTokensResolver; + result?: DeletePaymentTokenOutputToResultResolver; +} + +export interface DeletePaymentTokenOutputToCustomerPaymentTokensResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DeletePaymentTokenOutputToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShippingMethodTypeResolver { + amount?: ShippingMethodToAmountResolver; + available?: ShippingMethodToAvailableResolver; + base_amount?: ShippingMethodToBase_amountResolver; + carrier_code?: ShippingMethodToCarrier_codeResolver; + carrier_title?: ShippingMethodToCarrier_titleResolver; + error_message?: ShippingMethodToError_messageResolver; + method_code?: ShippingMethodToMethod_codeResolver; + method_title?: ShippingMethodToMethod_titleResolver; + price_excl_tax?: ShippingMethodToPrice_excl_taxResolver; + price_incl_tax?: ShippingMethodToPrice_incl_taxResolver; +} + +export interface ShippingMethodToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToAvailableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToBase_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToCarrier_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToCarrier_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToError_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToMethod_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToMethod_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToPrice_excl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShippingMethodToPrice_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerActionConfirmationTypeTypeResolver { + status?: CustomerActionConfirmationTypeToStatusResolver; +} + +export interface CustomerActionConfirmationTypeToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomerTokenTypeResolver { + token?: CustomerTokenToTokenResolver; +} + +export interface CustomerTokenToTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLGenerateCustomerTokenAsAdminOutputTypeResolver { + customer_token?: GenerateCustomerTokenAsAdminOutputToCustomer_tokenResolver; +} + +export interface GenerateCustomerTokenAsAdminOutputToCustomer_tokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPayflowProResponseOutputTypeResolver { + cart?: PayflowProResponseOutputToCartResolver; +} + +export interface PayflowProResponseOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPlaceOrderOutputTypeResolver { + order?: PlaceOrderOutputToOrderResolver; +} + +export interface PlaceOrderOutputToOrderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRemoveCouponFromCartOutputTypeResolver { + cart?: RemoveCouponFromCartOutputToCartResolver; +} + +export interface RemoveCouponFromCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRemoveItemFromCartOutputTypeResolver { + cart?: RemoveItemFromCartOutputToCartResolver; +} + +export interface RemoveItemFromCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRemoveProductsFromWishlistOutputTypeResolver { + user_errors?: RemoveProductsFromWishlistOutputToUser_errorsResolver; + wishlist?: RemoveProductsFromWishlistOutputToWishlistResolver; +} + +export interface RemoveProductsFromWishlistOutputToUser_errorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface RemoveProductsFromWishlistOutputToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLReorderItemsOutputTypeResolver { + cart?: ReorderItemsOutputToCartResolver; + userInputErrors?: ReorderItemsOutputToUserInputErrorsResolver; +} + +export interface ReorderItemsOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ReorderItemsOutputToUserInputErrorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCheckoutUserInputErrorTypeResolver { + code?: CheckoutUserInputErrorToCodeResolver; + message?: CheckoutUserInputErrorToMessageResolver; + path?: CheckoutUserInputErrorToPathResolver; +} + +export interface CheckoutUserInputErrorToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutUserInputErrorToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CheckoutUserInputErrorToPathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLRevokeCustomerTokenOutputTypeResolver { + result?: RevokeCustomerTokenOutputToResultResolver; +} + +export interface RevokeCustomerTokenOutputToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaypalExpressTokenTypeResolver { + paypal_urls?: PaypalExpressTokenToPaypal_urlsResolver; + token?: PaypalExpressTokenToTokenResolver; +} + +export interface PaypalExpressTokenToPaypal_urlsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaypalExpressTokenToTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLResetPasswordTypeTypeResolver { + status?: ResetPasswordTypeToStatusResolver; + token?: ResetPasswordTypeToTokenResolver; +} + +export interface ResetPasswordTypeToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ResetPasswordTypeToTokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSetBillingAddressOnCartOutputTypeResolver { + cart?: SetBillingAddressOnCartOutputToCartResolver; +} + +export interface SetBillingAddressOnCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSetPaymentMethodOnCartOutputTypeResolver { + cart?: SetPaymentMethodOnCartOutputToCartResolver; +} + +export interface SetPaymentMethodOnCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaymentDetailsTypeResolver { + payment_methods?: PaymentDetailsToPayment_methodsResolver; + totals?: PaymentDetailsToTotalsResolver; +} + +export interface PaymentDetailsToPayment_methodsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentDetailsToTotalsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPaymentTotalsTypeResolver { + applied_rule_ids?: PaymentTotalsToApplied_rule_idsResolver; + base_currency_code?: PaymentTotalsToBase_currency_codeResolver; + base_discount_amount?: PaymentTotalsToBase_discount_amountResolver; + base_grand_total?: PaymentTotalsToBase_grand_totalResolver; + base_shipping_amount?: PaymentTotalsToBase_shipping_amountResolver; + base_shipping_discount_amount?: PaymentTotalsToBase_shipping_discount_amountResolver; + base_shipping_incl_tax?: PaymentTotalsToBase_shipping_incl_taxResolver; + base_shipping_tax_amount?: PaymentTotalsToBase_shipping_tax_amountResolver; + base_subtotal?: PaymentTotalsToBase_subtotalResolver; + base_subtotal_with_discount?: PaymentTotalsToBase_subtotal_with_discountResolver; + base_tax_amount?: PaymentTotalsToBase_tax_amountResolver; + coupon_code?: PaymentTotalsToCoupon_codeResolver; + customer_is_guest?: PaymentTotalsToCustomer_is_guestResolver; + customer_tax_class_id?: PaymentTotalsToCustomer_tax_class_idResolver; + discount_amount?: PaymentTotalsToDiscount_amountResolver; + grand_total?: PaymentTotalsToGrand_totalResolver; + is_in_store_pickup_available?: PaymentTotalsToIs_in_store_pickup_availableResolver; + items?: PaymentTotalsToItemsResolver; + items_count?: PaymentTotalsToItems_countResolver; + items_qty?: PaymentTotalsToItems_qtyResolver; + quote_currency_code?: PaymentTotalsToQuote_currency_codeResolver; + shipping_amount?: PaymentTotalsToShipping_amountResolver; + shipping_discount_amount?: PaymentTotalsToShipping_discount_amountResolver; + shipping_incl_tax?: PaymentTotalsToShipping_incl_taxResolver; + shipping_method?: PaymentTotalsToShipping_methodResolver; + shipping_tax_amount?: PaymentTotalsToShipping_tax_amountResolver; + store_id?: PaymentTotalsToStore_idResolver; + subtotal?: PaymentTotalsToSubtotalResolver; + subtotal_incl_tax?: PaymentTotalsToSubtotal_incl_taxResolver; + subtotal_with_discount?: PaymentTotalsToSubtotal_with_discountResolver; + tax_amount?: PaymentTotalsToTax_amountResolver; + weee_tax_applied_amount?: PaymentTotalsToWeee_tax_applied_amountResolver; +} + +export interface PaymentTotalsToApplied_rule_idsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_grand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_shipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_shipping_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_shipping_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_shipping_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_subtotal_with_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToBase_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToCoupon_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToCustomer_is_guestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToCustomer_tax_class_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToDiscount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToGrand_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToIs_in_store_pickup_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToItems_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToQuote_currency_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToShipping_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToShipping_discount_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToShipping_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToShipping_methodResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToShipping_tax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToStore_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToSubtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToSubtotal_incl_taxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToSubtotal_with_discountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToTax_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PaymentTotalsToWeee_tax_applied_amountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSendEmailToFriendOutputTypeResolver { + recipients?: SendEmailToFriendOutputToRecipientsResolver; + sender?: SendEmailToFriendOutputToSenderResolver; +} + +export interface SendEmailToFriendOutputToRecipientsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SendEmailToFriendOutputToSenderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSendEmailToFriendRecipientTypeResolver { + email?: SendEmailToFriendRecipientToEmailResolver; + name?: SendEmailToFriendRecipientToNameResolver; +} + +export interface SendEmailToFriendRecipientToEmailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SendEmailToFriendRecipientToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSendEmailToFriendSenderTypeResolver { + email?: SendEmailToFriendSenderToEmailResolver; + message?: SendEmailToFriendSenderToMessageResolver; + name?: SendEmailToFriendSenderToNameResolver; +} + +export interface SendEmailToFriendSenderToEmailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SendEmailToFriendSenderToMessageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SendEmailToFriendSenderToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSetGuestEmailOnCartOutputTypeResolver { + cart?: SetGuestEmailOnCartOutputToCartResolver; +} + +export interface SetGuestEmailOnCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSetShippingAddressesOnCartOutputTypeResolver { + cart?: SetShippingAddressesOnCartOutputToCartResolver; +} + +export interface SetShippingAddressesOnCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSetShippingMethodsOnCartOutputTypeResolver { + cart?: SetShippingMethodsOnCartOutputToCartResolver; +} + +export interface SetShippingMethodsOnCartOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSubscribeEmailToNewsletterOutputTypeResolver { + status?: SubscribeEmailToNewsletterOutputToStatusResolver; +} + +export interface SubscribeEmailToNewsletterOutputToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLUpdateCartItemsOutputTypeResolver { + cart?: UpdateCartItemsOutputToCartResolver; +} + +export interface UpdateCartItemsOutputToCartResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLUpdateProductsInWishlistOutputTypeResolver { + user_errors?: UpdateProductsInWishlistOutputToUser_errorsResolver; + wishlist?: UpdateProductsInWishlistOutputToWishlistResolver; +} + +export interface UpdateProductsInWishlistOutputToUser_errorsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface UpdateProductsInWishlistOutputToWishlistResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLAvailabilityResponseTypeTypeResolver { + isAvailable?: AvailabilityResponseTypeToIsAvailableResolver; +} + +export interface AvailabilityResponseTypeToIsAvailableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleCartItemTypeResolver { + bundle_options?: BundleCartItemToBundle_optionsResolver; + customizable_options?: BundleCartItemToCustomizable_optionsResolver; + gift_message?: BundleCartItemToGift_messageResolver; + id?: BundleCartItemToIdResolver; + prices?: BundleCartItemToPricesResolver; + product?: BundleCartItemToProductResolver; + quantity?: BundleCartItemToQuantityResolver; + uid?: BundleCartItemToUidResolver; +} + +export interface BundleCartItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCartItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleCreditMemoItemTypeResolver { + bundle_options?: BundleCreditMemoItemToBundle_optionsResolver; + discounts?: BundleCreditMemoItemToDiscountsResolver; + id?: BundleCreditMemoItemToIdResolver; + order_item?: BundleCreditMemoItemToOrder_itemResolver; + product_name?: BundleCreditMemoItemToProduct_nameResolver; + product_sale_price?: BundleCreditMemoItemToProduct_sale_priceResolver; + product_sku?: BundleCreditMemoItemToProduct_skuResolver; + quantity_refunded?: BundleCreditMemoItemToQuantity_refundedResolver; + row_subtotal?: BundleCreditMemoItemToRow_subtotalResolver; +} + +export interface BundleCreditMemoItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleCreditMemoItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLItemSelectedBundleOptionTypeResolver { + id?: ItemSelectedBundleOptionToIdResolver; + label?: ItemSelectedBundleOptionToLabelResolver; + uid?: ItemSelectedBundleOptionToUidResolver; + values?: ItemSelectedBundleOptionToValuesResolver; +} + +export interface ItemSelectedBundleOptionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLItemSelectedBundleOptionValueTypeResolver { + id?: ItemSelectedBundleOptionValueToIdResolver; + price?: ItemSelectedBundleOptionValueToPriceResolver; + product_name?: ItemSelectedBundleOptionValueToProduct_nameResolver; + product_sku?: ItemSelectedBundleOptionValueToProduct_skuResolver; + quantity?: ItemSelectedBundleOptionValueToQuantityResolver; + uid?: ItemSelectedBundleOptionValueToUidResolver; +} + +export interface ItemSelectedBundleOptionValueToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionValueToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionValueToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionValueToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ItemSelectedBundleOptionValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleInvoiceItemTypeResolver { + bundle_options?: BundleInvoiceItemToBundle_optionsResolver; + discounts?: BundleInvoiceItemToDiscountsResolver; + id?: BundleInvoiceItemToIdResolver; + order_item?: BundleInvoiceItemToOrder_itemResolver; + product_name?: BundleInvoiceItemToProduct_nameResolver; + product_sale_price?: BundleInvoiceItemToProduct_sale_priceResolver; + product_sku?: BundleInvoiceItemToProduct_skuResolver; + quantity_invoiced?: BundleInvoiceItemToQuantity_invoicedResolver; + row_subtotal?: BundleInvoiceItemToRow_subtotalResolver; +} + +export interface BundleInvoiceItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleInvoiceItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleItemTypeResolver { + option_id?: BundleItemToOption_idResolver; + options?: BundleItemToOptionsResolver; + position?: BundleItemToPositionResolver; + required?: BundleItemToRequiredResolver; + sku?: BundleItemToSkuResolver; + title?: BundleItemToTitleResolver; + type?: BundleItemToTypeResolver; + uid?: BundleItemToUidResolver; +} + +export interface BundleItemToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleItemOptionTypeResolver { + can_change_quantity?: BundleItemOptionToCan_change_quantityResolver; + id?: BundleItemOptionToIdResolver; + is_default?: BundleItemOptionToIs_defaultResolver; + label?: BundleItemOptionToLabelResolver; + position?: BundleItemOptionToPositionResolver; + price?: BundleItemOptionToPriceResolver; + price_type?: BundleItemOptionToPrice_typeResolver; + product?: BundleItemOptionToProductResolver; + qty?: BundleItemOptionToQtyResolver; + quantity?: BundleItemOptionToQuantityResolver; + uid?: BundleItemOptionToUidResolver; +} + +export interface BundleItemOptionToCan_change_quantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToIs_defaultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleItemOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleOptionsTypeResolver { + items?: BundleOptionsToItemsResolver; + type?: BundleOptionsToTypeResolver; +} + +export interface BundleOptionsToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOptionsToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleOrderItemTypeResolver { + bundle_options?: BundleOrderItemToBundle_optionsResolver; + discounts?: BundleOrderItemToDiscountsResolver; + entered_options?: BundleOrderItemToEntered_optionsResolver; + id?: BundleOrderItemToIdResolver; + product_name?: BundleOrderItemToProduct_nameResolver; + product_sale_price?: BundleOrderItemToProduct_sale_priceResolver; + product_sku?: BundleOrderItemToProduct_skuResolver; + product_type?: BundleOrderItemToProduct_typeResolver; + product_url_key?: BundleOrderItemToProduct_url_keyResolver; + quantity_canceled?: BundleOrderItemToQuantity_canceledResolver; + quantity_invoiced?: BundleOrderItemToQuantity_invoicedResolver; + quantity_ordered?: BundleOrderItemToQuantity_orderedResolver; + quantity_refunded?: BundleOrderItemToQuantity_refundedResolver; + quantity_returned?: BundleOrderItemToQuantity_returnedResolver; + quantity_shipped?: BundleOrderItemToQuantity_shippedResolver; + row_subtotal?: BundleOrderItemToRow_subtotalResolver; + selected_options?: BundleOrderItemToSelected_optionsResolver; + status?: BundleOrderItemToStatusResolver; +} + +export interface BundleOrderItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToEntered_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToProduct_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToProduct_url_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_canceledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_orderedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_returnedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToQuantity_shippedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToSelected_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleOrderItemToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleProductTypeResolver { + New_attribute_size?: BundleProductToNew_attribute_sizeResolver; + New_multiple_attribute?: BundleProductToNew_multiple_attributeResolver; + Test_Ainars?: BundleProductToTest_AinarsResolver; + attribute_allows_html?: BundleProductToAttribute_allows_htmlResolver; + attribute_set_id?: BundleProductToAttribute_set_idResolver; + brand?: BundleProductToBrandResolver; + bundle_options?: BundleProductToBundle_optionsResolver; + canonical_url?: BundleProductToCanonical_urlResolver; + categories?: BundleProductToCategoriesResolver; + clothing_colour?: BundleProductToClothing_colourResolver; + clothing_gender?: BundleProductToClothing_genderResolver; + clothing_size?: BundleProductToClothing_sizeResolver; + clothing_type?: BundleProductToClothing_typeResolver; + color?: BundleProductToColorResolver; + color_elena?: BundleProductToColor_elenaResolver; + colors_with_images?: BundleProductToColors_with_imagesResolver; + country_of_manufacture?: BundleProductToCountry_of_manufactureResolver; + created_at?: BundleProductToCreated_atResolver; + crosssell_products?: BundleProductToCrosssell_productsResolver; + description?: BundleProductToDescriptionResolver; + dynamic_price?: BundleProductToDynamic_priceResolver; + dynamic_sku?: BundleProductToDynamic_skuResolver; + dynamic_weight?: BundleProductToDynamic_weightResolver; + fit?: BundleProductToFitResolver; + gift_message_available?: BundleProductToGift_message_availableResolver; + id?: BundleProductToIdResolver; + image?: BundleProductToImageResolver; + images_type_map?: BundleProductToImages_type_mapResolver; + items?: BundleProductToItemsResolver; + license_key?: BundleProductToLicense_keyResolver; + manufacturer?: BundleProductToManufacturerResolver; + material?: BundleProductToMaterialResolver; + media_gallery?: BundleProductToMedia_galleryResolver; + media_gallery_entries?: BundleProductToMedia_gallery_entriesResolver; + memory?: BundleProductToMemoryResolver; + meta_description?: BundleProductToMeta_descriptionResolver; + meta_keyword?: BundleProductToMeta_keywordResolver; + meta_title?: BundleProductToMeta_titleResolver; + multiple_attribute?: BundleProductToMultiple_attributeResolver; + name?: BundleProductToNameResolver; + new_from_date?: BundleProductToNew_from_dateResolver; + new_to_date?: BundleProductToNew_to_dateResolver; + only_x_left_in_stock?: BundleProductToOnly_x_left_in_stockResolver; + options?: BundleProductToOptionsResolver; + options_container?: BundleProductToOptions_containerResolver; + original_price?: BundleProductToOriginal_priceResolver; + price?: BundleProductToPriceResolver; + price_range?: BundleProductToPrice_rangeResolver; + price_tiers?: BundleProductToPrice_tiersResolver; + price_view?: BundleProductToPrice_viewResolver; + product_links?: BundleProductToProduct_linksResolver; + qty?: BundleProductToQtyResolver; + quantity?: BundleProductToQuantityResolver; + ranking?: BundleProductToRankingResolver; + rating_summary?: BundleProductToRating_summaryResolver; + redirect_code?: BundleProductToRedirect_codeResolver; + related_products?: BundleProductToRelated_productsResolver; + relative_url?: BundleProductToRelative_urlResolver; + review_count?: BundleProductToReview_countResolver; + reviews?: BundleProductToReviewsResolver; + row_total?: BundleProductToRow_totalResolver; + s_attributes?: BundleProductToS_attributesResolver; + salable_qty?: BundleProductToSalable_qtyResolver; + ship_bundle_items?: BundleProductToShip_bundle_itemsResolver; + shoes_size?: BundleProductToShoes_sizeResolver; + short_description?: BundleProductToShort_descriptionResolver; + size?: BundleProductToSizeResolver; + sku?: BundleProductToSkuResolver; + small_image?: BundleProductToSmall_imageResolver; + special_from_date?: BundleProductToSpecial_from_dateResolver; + special_price?: BundleProductToSpecial_priceResolver; + special_to_date?: BundleProductToSpecial_to_dateResolver; + stock_item?: BundleProductToStock_itemResolver; + stock_status?: BundleProductToStock_statusResolver; + swatch_image?: BundleProductToSwatch_imageResolver; + test?: BundleProductToTestResolver; + texture?: BundleProductToTextureResolver; + thumbnail?: BundleProductToThumbnailResolver; + tier_price?: BundleProductToTier_priceResolver; + tier_prices?: BundleProductToTier_pricesResolver; + type?: BundleProductToTypeResolver; + type_id?: BundleProductToType_idResolver; + uid?: BundleProductToUidResolver; + updated_at?: BundleProductToUpdated_atResolver; + upsell_products?: BundleProductToUpsell_productsResolver; + url?: BundleProductToUrlResolver; + url_key?: BundleProductToUrl_keyResolver; + url_path?: BundleProductToUrl_pathResolver; + url_rewrites?: BundleProductToUrl_rewritesResolver; + url_suffix?: BundleProductToUrl_suffixResolver; + valuesss?: BundleProductToValuesssResolver; + websites?: BundleProductToWebsitesResolver; + weight?: BundleProductToWeightResolver; + yes_no?: BundleProductToYes_noResolver; +} + +export interface BundleProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToDynamic_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToDynamic_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToDynamic_weightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToPrice_viewResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface BundleProductToReviewsResolver { + (parent: TParent, args: BundleProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToShip_bundle_itemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToWeightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPhysicalProductInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'GroupedProduct' | Promise<'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'GroupedProduct'>; +} +export interface GQLCustomizableProductInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'VirtualProduct' | Promise<'BundleProduct' | 'ConfigurableProduct' | 'SimpleProduct' | 'DownloadableProduct' | 'VirtualProduct'>; +} +export interface GQLCustomizableOptionInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'CustomizableAreaOption' | 'CustomizableCheckboxOption' | 'CustomizableDateOption' | 'CustomizableDropDownOption' | 'CustomizableFieldOption' | 'CustomizableFileOption' | 'CustomizableMultipleOption' | 'CustomizableRadioOption' | Promise<'CustomizableAreaOption' | 'CustomizableCheckboxOption' | 'CustomizableDateOption' | 'CustomizableDropDownOption' | 'CustomizableFieldOption' | 'CustomizableFileOption' | 'CustomizableMultipleOption' | 'CustomizableRadioOption'>; +} +export interface GQLBundleShipmentItemTypeResolver { + bundle_options?: BundleShipmentItemToBundle_optionsResolver; + id?: BundleShipmentItemToIdResolver; + order_item?: BundleShipmentItemToOrder_itemResolver; + product_name?: BundleShipmentItemToProduct_nameResolver; + product_sale_price?: BundleShipmentItemToProduct_sale_priceResolver; + product_sku?: BundleShipmentItemToProduct_skuResolver; + quantity_shipped?: BundleShipmentItemToQuantity_shippedResolver; +} + +export interface BundleShipmentItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleShipmentItemToQuantity_shippedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLBundleWishlistItemTypeResolver { + added_at?: BundleWishlistItemToAdded_atResolver; + bundle_options?: BundleWishlistItemToBundle_optionsResolver; + customizable_options?: BundleWishlistItemToCustomizable_optionsResolver; + description?: BundleWishlistItemToDescriptionResolver; + id?: BundleWishlistItemToIdResolver; + product?: BundleWishlistItemToProductResolver; + quantity?: BundleWishlistItemToQuantityResolver; +} + +export interface BundleWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToBundle_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface BundleWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLColorSwatchDataTypeResolver { + value?: ColorSwatchDataToValueResolver; +} + +export interface ColorSwatchDataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSwatchDataInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'ColorSwatchData' | 'ImageSwatchData' | 'TextSwatchData' | Promise<'ColorSwatchData' | 'ImageSwatchData' | 'TextSwatchData'>; +} +export interface GQLConfigurableAttributeOptionTypeResolver { + code?: ConfigurableAttributeOptionToCodeResolver; + label?: ConfigurableAttributeOptionToLabelResolver; + uid?: ConfigurableAttributeOptionToUidResolver; + value_index?: ConfigurableAttributeOptionToValue_indexResolver; +} + +export interface ConfigurableAttributeOptionToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableAttributeOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableAttributeOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableAttributeOptionToValue_indexResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableCartItemTypeResolver { + configurable_options?: ConfigurableCartItemToConfigurable_optionsResolver; + configured_variant?: ConfigurableCartItemToConfigured_variantResolver; + customizable_options?: ConfigurableCartItemToCustomizable_optionsResolver; + gift_message?: ConfigurableCartItemToGift_messageResolver; + id?: ConfigurableCartItemToIdResolver; + prices?: ConfigurableCartItemToPricesResolver; + product?: ConfigurableCartItemToProductResolver; + quantity?: ConfigurableCartItemToQuantityResolver; + uid?: ConfigurableCartItemToUidResolver; +} + +export interface ConfigurableCartItemToConfigurable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToConfigured_variantResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableCartItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSelectedConfigurableOptionTypeResolver { + configurable_product_option_uid?: SelectedConfigurableOptionToConfigurable_product_option_uidResolver; + configurable_product_option_value_uid?: SelectedConfigurableOptionToConfigurable_product_option_value_uidResolver; + id?: SelectedConfigurableOptionToIdResolver; + option_label?: SelectedConfigurableOptionToOption_labelResolver; + value_id?: SelectedConfigurableOptionToValue_idResolver; + value_label?: SelectedConfigurableOptionToValue_labelResolver; +} + +export interface SelectedConfigurableOptionToConfigurable_product_option_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedConfigurableOptionToConfigurable_product_option_value_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedConfigurableOptionToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedConfigurableOptionToOption_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedConfigurableOptionToValue_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SelectedConfigurableOptionToValue_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableOptionAvailableForSelectionTypeResolver { + attribute_code?: ConfigurableOptionAvailableForSelectionToAttribute_codeResolver; + option_value_uids?: ConfigurableOptionAvailableForSelectionToOption_value_uidsResolver; +} + +export interface ConfigurableOptionAvailableForSelectionToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableOptionAvailableForSelectionToOption_value_uidsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductTypeResolver { + New_attribute_size?: ConfigurableProductToNew_attribute_sizeResolver; + New_multiple_attribute?: ConfigurableProductToNew_multiple_attributeResolver; + Test_Ainars?: ConfigurableProductToTest_AinarsResolver; + attribute_allows_html?: ConfigurableProductToAttribute_allows_htmlResolver; + attribute_set_id?: ConfigurableProductToAttribute_set_idResolver; + brand?: ConfigurableProductToBrandResolver; + canonical_url?: ConfigurableProductToCanonical_urlResolver; + categories?: ConfigurableProductToCategoriesResolver; + clothing_colour?: ConfigurableProductToClothing_colourResolver; + clothing_gender?: ConfigurableProductToClothing_genderResolver; + clothing_size?: ConfigurableProductToClothing_sizeResolver; + clothing_type?: ConfigurableProductToClothing_typeResolver; + color?: ConfigurableProductToColorResolver; + color_elena?: ConfigurableProductToColor_elenaResolver; + colors_with_images?: ConfigurableProductToColors_with_imagesResolver; + configurable_options?: ConfigurableProductToConfigurable_optionsResolver; + configurable_product_options_selection?: ConfigurableProductToConfigurable_product_options_selectionResolver; + country_of_manufacture?: ConfigurableProductToCountry_of_manufactureResolver; + created_at?: ConfigurableProductToCreated_atResolver; + crosssell_products?: ConfigurableProductToCrosssell_productsResolver; + description?: ConfigurableProductToDescriptionResolver; + fit?: ConfigurableProductToFitResolver; + gift_message_available?: ConfigurableProductToGift_message_availableResolver; + id?: ConfigurableProductToIdResolver; + image?: ConfigurableProductToImageResolver; + images_type_map?: ConfigurableProductToImages_type_mapResolver; + license_key?: ConfigurableProductToLicense_keyResolver; + manufacturer?: ConfigurableProductToManufacturerResolver; + material?: ConfigurableProductToMaterialResolver; + media_gallery?: ConfigurableProductToMedia_galleryResolver; + media_gallery_entries?: ConfigurableProductToMedia_gallery_entriesResolver; + memory?: ConfigurableProductToMemoryResolver; + meta_description?: ConfigurableProductToMeta_descriptionResolver; + meta_keyword?: ConfigurableProductToMeta_keywordResolver; + meta_title?: ConfigurableProductToMeta_titleResolver; + multiple_attribute?: ConfigurableProductToMultiple_attributeResolver; + name?: ConfigurableProductToNameResolver; + new_from_date?: ConfigurableProductToNew_from_dateResolver; + new_to_date?: ConfigurableProductToNew_to_dateResolver; + only_x_left_in_stock?: ConfigurableProductToOnly_x_left_in_stockResolver; + options?: ConfigurableProductToOptionsResolver; + options_container?: ConfigurableProductToOptions_containerResolver; + original_price?: ConfigurableProductToOriginal_priceResolver; + price?: ConfigurableProductToPriceResolver; + price_range?: ConfigurableProductToPrice_rangeResolver; + price_tiers?: ConfigurableProductToPrice_tiersResolver; + product_links?: ConfigurableProductToProduct_linksResolver; + qty?: ConfigurableProductToQtyResolver; + quantity?: ConfigurableProductToQuantityResolver; + ranking?: ConfigurableProductToRankingResolver; + rating_summary?: ConfigurableProductToRating_summaryResolver; + redirect_code?: ConfigurableProductToRedirect_codeResolver; + related_products?: ConfigurableProductToRelated_productsResolver; + relative_url?: ConfigurableProductToRelative_urlResolver; + review_count?: ConfigurableProductToReview_countResolver; + reviews?: ConfigurableProductToReviewsResolver; + row_total?: ConfigurableProductToRow_totalResolver; + s_attributes?: ConfigurableProductToS_attributesResolver; + salable_qty?: ConfigurableProductToSalable_qtyResolver; + shoes_size?: ConfigurableProductToShoes_sizeResolver; + short_description?: ConfigurableProductToShort_descriptionResolver; + size?: ConfigurableProductToSizeResolver; + sku?: ConfigurableProductToSkuResolver; + small_image?: ConfigurableProductToSmall_imageResolver; + special_from_date?: ConfigurableProductToSpecial_from_dateResolver; + special_price?: ConfigurableProductToSpecial_priceResolver; + special_to_date?: ConfigurableProductToSpecial_to_dateResolver; + stock_item?: ConfigurableProductToStock_itemResolver; + stock_status?: ConfigurableProductToStock_statusResolver; + swatch_image?: ConfigurableProductToSwatch_imageResolver; + test?: ConfigurableProductToTestResolver; + texture?: ConfigurableProductToTextureResolver; + thumbnail?: ConfigurableProductToThumbnailResolver; + tier_price?: ConfigurableProductToTier_priceResolver; + tier_prices?: ConfigurableProductToTier_pricesResolver; + type?: ConfigurableProductToTypeResolver; + type_id?: ConfigurableProductToType_idResolver; + uid?: ConfigurableProductToUidResolver; + updated_at?: ConfigurableProductToUpdated_atResolver; + upsell_products?: ConfigurableProductToUpsell_productsResolver; + url?: ConfigurableProductToUrlResolver; + url_key?: ConfigurableProductToUrl_keyResolver; + url_path?: ConfigurableProductToUrl_pathResolver; + url_rewrites?: ConfigurableProductToUrl_rewritesResolver; + url_suffix?: ConfigurableProductToUrl_suffixResolver; + valuesss?: ConfigurableProductToValuesssResolver; + variants?: ConfigurableProductToVariantsResolver; + variants_plp?: ConfigurableProductToVariants_plpResolver; + websites?: ConfigurableProductToWebsitesResolver; + weight?: ConfigurableProductToWeightResolver; + yes_no?: ConfigurableProductToYes_noResolver; +} + +export interface ConfigurableProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToConfigurable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToConfigurable_product_options_selectionArgs { + configurableOptionValueUids?: Array; +} +export interface ConfigurableProductToConfigurable_product_options_selectionResolver { + (parent: TParent, args: ConfigurableProductToConfigurable_product_options_selectionArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface ConfigurableProductToReviewsResolver { + (parent: TParent, args: ConfigurableProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToVariantsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToVariants_plpResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToWeightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductOptionsTypeResolver { + attribute_code?: ConfigurableProductOptionsToAttribute_codeResolver; + attribute_id?: ConfigurableProductOptionsToAttribute_idResolver; + attribute_id_v2?: ConfigurableProductOptionsToAttribute_id_v2Resolver; + attribute_uid?: ConfigurableProductOptionsToAttribute_uidResolver; + id?: ConfigurableProductOptionsToIdResolver; + label?: ConfigurableProductOptionsToLabelResolver; + position?: ConfigurableProductOptionsToPositionResolver; + product_id?: ConfigurableProductOptionsToProduct_idResolver; + uid?: ConfigurableProductOptionsToUidResolver; + use_default?: ConfigurableProductOptionsToUse_defaultResolver; + values?: ConfigurableProductOptionsToValuesResolver; +} + +export interface ConfigurableProductOptionsToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToAttribute_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToAttribute_id_v2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToAttribute_uidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToProduct_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToUse_defaultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductOptionsValuesTypeResolver { + default_label?: ConfigurableProductOptionsValuesToDefault_labelResolver; + label?: ConfigurableProductOptionsValuesToLabelResolver; + store_label?: ConfigurableProductOptionsValuesToStore_labelResolver; + swatch_data?: ConfigurableProductOptionsValuesToSwatch_dataResolver; + uid?: ConfigurableProductOptionsValuesToUidResolver; + use_default_value?: ConfigurableProductOptionsValuesToUse_default_valueResolver; + value_index?: ConfigurableProductOptionsValuesToValue_indexResolver; +} + +export interface ConfigurableProductOptionsValuesToDefault_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToStore_labelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToSwatch_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToUse_default_valueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsValuesToValue_indexResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductOptionsSelectionTypeResolver { + configurable_options?: ConfigurableProductOptionsSelectionToConfigurable_optionsResolver; + media_gallery?: ConfigurableProductOptionsSelectionToMedia_galleryResolver; + options_available_for_selection?: ConfigurableProductOptionsSelectionToOptions_available_for_selectionResolver; + variant?: ConfigurableProductOptionsSelectionToVariantResolver; +} + +export interface ConfigurableProductOptionsSelectionToConfigurable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsSelectionToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsSelectionToOptions_available_for_selectionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionsSelectionToVariantResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductOptionTypeResolver { + attribute_code?: ConfigurableProductOptionToAttribute_codeResolver; + label?: ConfigurableProductOptionToLabelResolver; + uid?: ConfigurableProductOptionToUidResolver; + values?: ConfigurableProductOptionToValuesResolver; +} + +export interface ConfigurableProductOptionToAttribute_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionToValuesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableProductOptionValueTypeResolver { + is_available?: ConfigurableProductOptionValueToIs_availableResolver; + is_use_default?: ConfigurableProductOptionValueToIs_use_defaultResolver; + label?: ConfigurableProductOptionValueToLabelResolver; + swatch?: ConfigurableProductOptionValueToSwatchResolver; + uid?: ConfigurableProductOptionValueToUidResolver; +} + +export interface ConfigurableProductOptionValueToIs_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionValueToIs_use_defaultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionValueToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionValueToSwatchResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableProductOptionValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSimpleProductTypeResolver { + New_attribute_size?: SimpleProductToNew_attribute_sizeResolver; + New_multiple_attribute?: SimpleProductToNew_multiple_attributeResolver; + Test_Ainars?: SimpleProductToTest_AinarsResolver; + attribute_allows_html?: SimpleProductToAttribute_allows_htmlResolver; + attribute_set_id?: SimpleProductToAttribute_set_idResolver; + brand?: SimpleProductToBrandResolver; + canonical_url?: SimpleProductToCanonical_urlResolver; + categories?: SimpleProductToCategoriesResolver; + clothing_colour?: SimpleProductToClothing_colourResolver; + clothing_gender?: SimpleProductToClothing_genderResolver; + clothing_size?: SimpleProductToClothing_sizeResolver; + clothing_type?: SimpleProductToClothing_typeResolver; + color?: SimpleProductToColorResolver; + color_elena?: SimpleProductToColor_elenaResolver; + colors_with_images?: SimpleProductToColors_with_imagesResolver; + country_of_manufacture?: SimpleProductToCountry_of_manufactureResolver; + created_at?: SimpleProductToCreated_atResolver; + crosssell_products?: SimpleProductToCrosssell_productsResolver; + description?: SimpleProductToDescriptionResolver; + fit?: SimpleProductToFitResolver; + gift_message_available?: SimpleProductToGift_message_availableResolver; + id?: SimpleProductToIdResolver; + image?: SimpleProductToImageResolver; + images_type_map?: SimpleProductToImages_type_mapResolver; + license_key?: SimpleProductToLicense_keyResolver; + manufacturer?: SimpleProductToManufacturerResolver; + material?: SimpleProductToMaterialResolver; + media_gallery?: SimpleProductToMedia_galleryResolver; + media_gallery_entries?: SimpleProductToMedia_gallery_entriesResolver; + memory?: SimpleProductToMemoryResolver; + meta_description?: SimpleProductToMeta_descriptionResolver; + meta_keyword?: SimpleProductToMeta_keywordResolver; + meta_title?: SimpleProductToMeta_titleResolver; + multiple_attribute?: SimpleProductToMultiple_attributeResolver; + name?: SimpleProductToNameResolver; + new_from_date?: SimpleProductToNew_from_dateResolver; + new_to_date?: SimpleProductToNew_to_dateResolver; + only_x_left_in_stock?: SimpleProductToOnly_x_left_in_stockResolver; + options?: SimpleProductToOptionsResolver; + options_container?: SimpleProductToOptions_containerResolver; + original_price?: SimpleProductToOriginal_priceResolver; + price?: SimpleProductToPriceResolver; + price_range?: SimpleProductToPrice_rangeResolver; + price_tiers?: SimpleProductToPrice_tiersResolver; + product_links?: SimpleProductToProduct_linksResolver; + qty?: SimpleProductToQtyResolver; + quantity?: SimpleProductToQuantityResolver; + ranking?: SimpleProductToRankingResolver; + rating_summary?: SimpleProductToRating_summaryResolver; + redirect_code?: SimpleProductToRedirect_codeResolver; + related_products?: SimpleProductToRelated_productsResolver; + relative_url?: SimpleProductToRelative_urlResolver; + review_count?: SimpleProductToReview_countResolver; + reviews?: SimpleProductToReviewsResolver; + row_total?: SimpleProductToRow_totalResolver; + s_attributes?: SimpleProductToS_attributesResolver; + salable_qty?: SimpleProductToSalable_qtyResolver; + shoes_size?: SimpleProductToShoes_sizeResolver; + short_description?: SimpleProductToShort_descriptionResolver; + size?: SimpleProductToSizeResolver; + sku?: SimpleProductToSkuResolver; + small_image?: SimpleProductToSmall_imageResolver; + special_from_date?: SimpleProductToSpecial_from_dateResolver; + special_price?: SimpleProductToSpecial_priceResolver; + special_to_date?: SimpleProductToSpecial_to_dateResolver; + stock_item?: SimpleProductToStock_itemResolver; + stock_status?: SimpleProductToStock_statusResolver; + swatch_image?: SimpleProductToSwatch_imageResolver; + test?: SimpleProductToTestResolver; + texture?: SimpleProductToTextureResolver; + thumbnail?: SimpleProductToThumbnailResolver; + tier_price?: SimpleProductToTier_priceResolver; + tier_prices?: SimpleProductToTier_pricesResolver; + type?: SimpleProductToTypeResolver; + type_id?: SimpleProductToType_idResolver; + uid?: SimpleProductToUidResolver; + updated_at?: SimpleProductToUpdated_atResolver; + upsell_products?: SimpleProductToUpsell_productsResolver; + url?: SimpleProductToUrlResolver; + url_key?: SimpleProductToUrl_keyResolver; + url_path?: SimpleProductToUrl_pathResolver; + url_rewrites?: SimpleProductToUrl_rewritesResolver; + url_suffix?: SimpleProductToUrl_suffixResolver; + valuesss?: SimpleProductToValuesssResolver; + websites?: SimpleProductToWebsitesResolver; + weight?: SimpleProductToWeightResolver; + yes_no?: SimpleProductToYes_noResolver; +} + +export interface SimpleProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface SimpleProductToReviewsResolver { + (parent: TParent, args: SimpleProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToWeightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableVariantTypeResolver { + attributes?: ConfigurableVariantToAttributesResolver; + product?: ConfigurableVariantToProductResolver; +} + +export interface ConfigurableVariantToAttributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableVariantToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLConfigurableWishlistItemTypeResolver { + added_at?: ConfigurableWishlistItemToAdded_atResolver; + child_sku?: ConfigurableWishlistItemToChild_skuResolver; + configurable_options?: ConfigurableWishlistItemToConfigurable_optionsResolver; + customizable_options?: ConfigurableWishlistItemToCustomizable_optionsResolver; + description?: ConfigurableWishlistItemToDescriptionResolver; + id?: ConfigurableWishlistItemToIdResolver; + product?: ConfigurableWishlistItemToProductResolver; + quantity?: ConfigurableWishlistItemToQuantityResolver; +} + +export interface ConfigurableWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToChild_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToConfigurable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ConfigurableWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCreditMemoItemTypeResolver { + discounts?: CreditMemoItemToDiscountsResolver; + id?: CreditMemoItemToIdResolver; + order_item?: CreditMemoItemToOrder_itemResolver; + product_name?: CreditMemoItemToProduct_nameResolver; + product_sale_price?: CreditMemoItemToProduct_sale_priceResolver; + product_sku?: CreditMemoItemToProduct_skuResolver; + quantity_refunded?: CreditMemoItemToQuantity_refundedResolver; + row_subtotal?: CreditMemoItemToRow_subtotalResolver; +} + +export interface CreditMemoItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CreditMemoItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableAreaOptionTypeResolver { + option_id?: CustomizableAreaOptionToOption_idResolver; + product_sku?: CustomizableAreaOptionToProduct_skuResolver; + required?: CustomizableAreaOptionToRequiredResolver; + sort_order?: CustomizableAreaOptionToSort_orderResolver; + title?: CustomizableAreaOptionToTitleResolver; + type?: CustomizableAreaOptionToTypeResolver; + uid?: CustomizableAreaOptionToUidResolver; + value?: CustomizableAreaOptionToValueResolver; +} + +export interface CustomizableAreaOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableAreaValueTypeResolver { + currency?: CustomizableAreaValueToCurrencyResolver; + max_characters?: CustomizableAreaValueToMax_charactersResolver; + price?: CustomizableAreaValueToPriceResolver; + priceExclTax?: CustomizableAreaValueToPriceExclTaxResolver; + priceInclTax?: CustomizableAreaValueToPriceInclTaxResolver; + price_type?: CustomizableAreaValueToPrice_typeResolver; + sku?: CustomizableAreaValueToSkuResolver; + uid?: CustomizableAreaValueToUidResolver; +} + +export interface CustomizableAreaValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToMax_charactersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableAreaValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableCheckboxOptionTypeResolver { + option_id?: CustomizableCheckboxOptionToOption_idResolver; + required?: CustomizableCheckboxOptionToRequiredResolver; + sort_order?: CustomizableCheckboxOptionToSort_orderResolver; + title?: CustomizableCheckboxOptionToTitleResolver; + type?: CustomizableCheckboxOptionToTypeResolver; + uid?: CustomizableCheckboxOptionToUidResolver; + value?: CustomizableCheckboxOptionToValueResolver; +} + +export interface CustomizableCheckboxOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableCheckboxValueTypeResolver { + currency?: CustomizableCheckboxValueToCurrencyResolver; + option_type_id?: CustomizableCheckboxValueToOption_type_idResolver; + price?: CustomizableCheckboxValueToPriceResolver; + priceExclTax?: CustomizableCheckboxValueToPriceExclTaxResolver; + priceInclTax?: CustomizableCheckboxValueToPriceInclTaxResolver; + price_type?: CustomizableCheckboxValueToPrice_typeResolver; + sku?: CustomizableCheckboxValueToSkuResolver; + sort_order?: CustomizableCheckboxValueToSort_orderResolver; + title?: CustomizableCheckboxValueToTitleResolver; + uid?: CustomizableCheckboxValueToUidResolver; +} + +export interface CustomizableCheckboxValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToOption_type_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableCheckboxValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableDateOptionTypeResolver { + option_id?: CustomizableDateOptionToOption_idResolver; + product_sku?: CustomizableDateOptionToProduct_skuResolver; + required?: CustomizableDateOptionToRequiredResolver; + sort_order?: CustomizableDateOptionToSort_orderResolver; + title?: CustomizableDateOptionToTitleResolver; + type?: CustomizableDateOptionToTypeResolver; + uid?: CustomizableDateOptionToUidResolver; + value?: CustomizableDateOptionToValueResolver; +} + +export interface CustomizableDateOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableDateValueTypeResolver { + currency?: CustomizableDateValueToCurrencyResolver; + price?: CustomizableDateValueToPriceResolver; + priceExclTax?: CustomizableDateValueToPriceExclTaxResolver; + priceInclTax?: CustomizableDateValueToPriceInclTaxResolver; + price_type?: CustomizableDateValueToPrice_typeResolver; + sku?: CustomizableDateValueToSkuResolver; + type?: CustomizableDateValueToTypeResolver; + uid?: CustomizableDateValueToUidResolver; +} + +export interface CustomizableDateValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDateValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableDropDownOptionTypeResolver { + option_id?: CustomizableDropDownOptionToOption_idResolver; + required?: CustomizableDropDownOptionToRequiredResolver; + sort_order?: CustomizableDropDownOptionToSort_orderResolver; + title?: CustomizableDropDownOptionToTitleResolver; + type?: CustomizableDropDownOptionToTypeResolver; + uid?: CustomizableDropDownOptionToUidResolver; + value?: CustomizableDropDownOptionToValueResolver; +} + +export interface CustomizableDropDownOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableDropDownValueTypeResolver { + currency?: CustomizableDropDownValueToCurrencyResolver; + option_type_id?: CustomizableDropDownValueToOption_type_idResolver; + price?: CustomizableDropDownValueToPriceResolver; + priceExclTax?: CustomizableDropDownValueToPriceExclTaxResolver; + priceInclTax?: CustomizableDropDownValueToPriceInclTaxResolver; + price_type?: CustomizableDropDownValueToPrice_typeResolver; + sku?: CustomizableDropDownValueToSkuResolver; + sort_order?: CustomizableDropDownValueToSort_orderResolver; + title?: CustomizableDropDownValueToTitleResolver; + uid?: CustomizableDropDownValueToUidResolver; +} + +export interface CustomizableDropDownValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToOption_type_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableDropDownValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableFieldOptionTypeResolver { + option_id?: CustomizableFieldOptionToOption_idResolver; + product_sku?: CustomizableFieldOptionToProduct_skuResolver; + required?: CustomizableFieldOptionToRequiredResolver; + sort_order?: CustomizableFieldOptionToSort_orderResolver; + title?: CustomizableFieldOptionToTitleResolver; + type?: CustomizableFieldOptionToTypeResolver; + uid?: CustomizableFieldOptionToUidResolver; + value?: CustomizableFieldOptionToValueResolver; +} + +export interface CustomizableFieldOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableFieldValueTypeResolver { + currency?: CustomizableFieldValueToCurrencyResolver; + file_extension?: CustomizableFieldValueToFile_extensionResolver; + max_characters?: CustomizableFieldValueToMax_charactersResolver; + price?: CustomizableFieldValueToPriceResolver; + priceExclTax?: CustomizableFieldValueToPriceExclTaxResolver; + priceInclTax?: CustomizableFieldValueToPriceInclTaxResolver; + price_type?: CustomizableFieldValueToPrice_typeResolver; + sku?: CustomizableFieldValueToSkuResolver; + uid?: CustomizableFieldValueToUidResolver; +} + +export interface CustomizableFieldValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToFile_extensionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToMax_charactersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFieldValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableFileOptionTypeResolver { + option_id?: CustomizableFileOptionToOption_idResolver; + product_sku?: CustomizableFileOptionToProduct_skuResolver; + required?: CustomizableFileOptionToRequiredResolver; + sort_order?: CustomizableFileOptionToSort_orderResolver; + title?: CustomizableFileOptionToTitleResolver; + type?: CustomizableFileOptionToTypeResolver; + uid?: CustomizableFileOptionToUidResolver; + value?: CustomizableFileOptionToValueResolver; +} + +export interface CustomizableFileOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableFileValueTypeResolver { + currency?: CustomizableFileValueToCurrencyResolver; + file_extension?: CustomizableFileValueToFile_extensionResolver; + image_size_x?: CustomizableFileValueToImage_size_xResolver; + image_size_y?: CustomizableFileValueToImage_size_yResolver; + price?: CustomizableFileValueToPriceResolver; + priceExclTax?: CustomizableFileValueToPriceExclTaxResolver; + priceInclTax?: CustomizableFileValueToPriceInclTaxResolver; + price_type?: CustomizableFileValueToPrice_typeResolver; + sku?: CustomizableFileValueToSkuResolver; + uid?: CustomizableFileValueToUidResolver; +} + +export interface CustomizableFileValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToFile_extensionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToImage_size_xResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToImage_size_yResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableFileValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableMultipleOptionTypeResolver { + option_id?: CustomizableMultipleOptionToOption_idResolver; + required?: CustomizableMultipleOptionToRequiredResolver; + sort_order?: CustomizableMultipleOptionToSort_orderResolver; + title?: CustomizableMultipleOptionToTitleResolver; + type?: CustomizableMultipleOptionToTypeResolver; + uid?: CustomizableMultipleOptionToUidResolver; + value?: CustomizableMultipleOptionToValueResolver; +} + +export interface CustomizableMultipleOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableMultipleValueTypeResolver { + currency?: CustomizableMultipleValueToCurrencyResolver; + option_type_id?: CustomizableMultipleValueToOption_type_idResolver; + price?: CustomizableMultipleValueToPriceResolver; + priceExclTax?: CustomizableMultipleValueToPriceExclTaxResolver; + priceInclTax?: CustomizableMultipleValueToPriceInclTaxResolver; + price_type?: CustomizableMultipleValueToPrice_typeResolver; + sku?: CustomizableMultipleValueToSkuResolver; + sort_order?: CustomizableMultipleValueToSort_orderResolver; + title?: CustomizableMultipleValueToTitleResolver; + uid?: CustomizableMultipleValueToUidResolver; +} + +export interface CustomizableMultipleValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToOption_type_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableMultipleValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableRadioOptionTypeResolver { + option_id?: CustomizableRadioOptionToOption_idResolver; + required?: CustomizableRadioOptionToRequiredResolver; + sort_order?: CustomizableRadioOptionToSort_orderResolver; + title?: CustomizableRadioOptionToTitleResolver; + type?: CustomizableRadioOptionToTypeResolver; + uid?: CustomizableRadioOptionToUidResolver; + value?: CustomizableRadioOptionToValueResolver; +} + +export interface CustomizableRadioOptionToOption_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToRequiredResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioOptionToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLCustomizableRadioValueTypeResolver { + currency?: CustomizableRadioValueToCurrencyResolver; + option_type_id?: CustomizableRadioValueToOption_type_idResolver; + price?: CustomizableRadioValueToPriceResolver; + priceExclTax?: CustomizableRadioValueToPriceExclTaxResolver; + priceInclTax?: CustomizableRadioValueToPriceInclTaxResolver; + price_type?: CustomizableRadioValueToPrice_typeResolver; + sku?: CustomizableRadioValueToSkuResolver; + sort_order?: CustomizableRadioValueToSort_orderResolver; + title?: CustomizableRadioValueToTitleResolver; + uid?: CustomizableRadioValueToUidResolver; +} + +export interface CustomizableRadioValueToCurrencyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToOption_type_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToPriceExclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToPriceInclTaxResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToPrice_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface CustomizableRadioValueToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableCartItemTypeResolver { + customizable_options?: DownloadableCartItemToCustomizable_optionsResolver; + id?: DownloadableCartItemToIdResolver; + links?: DownloadableCartItemToLinksResolver; + prices?: DownloadableCartItemToPricesResolver; + product?: DownloadableCartItemToProductResolver; + quantity?: DownloadableCartItemToQuantityResolver; + samples?: DownloadableCartItemToSamplesResolver; + uid?: DownloadableCartItemToUidResolver; +} + +export interface DownloadableCartItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToLinksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToSamplesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCartItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableProductLinksTypeResolver { + id?: DownloadableProductLinksToIdResolver; + is_shareable?: DownloadableProductLinksToIs_shareableResolver; + link_type?: DownloadableProductLinksToLink_typeResolver; + number_of_downloads?: DownloadableProductLinksToNumber_of_downloadsResolver; + price?: DownloadableProductLinksToPriceResolver; + sample_file?: DownloadableProductLinksToSample_fileResolver; + sample_type?: DownloadableProductLinksToSample_typeResolver; + sample_url?: DownloadableProductLinksToSample_urlResolver; + sort_order?: DownloadableProductLinksToSort_orderResolver; + title?: DownloadableProductLinksToTitleResolver; + uid?: DownloadableProductLinksToUidResolver; +} + +export interface DownloadableProductLinksToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToIs_shareableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToLink_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToNumber_of_downloadsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToSample_fileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToSample_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToSample_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductLinksToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableProductSamplesTypeResolver { + id?: DownloadableProductSamplesToIdResolver; + sample_file?: DownloadableProductSamplesToSample_fileResolver; + sample_type?: DownloadableProductSamplesToSample_typeResolver; + sample_url?: DownloadableProductSamplesToSample_urlResolver; + sort_order?: DownloadableProductSamplesToSort_orderResolver; + title?: DownloadableProductSamplesToTitleResolver; +} + +export interface DownloadableProductSamplesToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductSamplesToSample_fileResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductSamplesToSample_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductSamplesToSample_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductSamplesToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductSamplesToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableCreditMemoItemTypeResolver { + discounts?: DownloadableCreditMemoItemToDiscountsResolver; + downloadable_links?: DownloadableCreditMemoItemToDownloadable_linksResolver; + id?: DownloadableCreditMemoItemToIdResolver; + order_item?: DownloadableCreditMemoItemToOrder_itemResolver; + product_name?: DownloadableCreditMemoItemToProduct_nameResolver; + product_sale_price?: DownloadableCreditMemoItemToProduct_sale_priceResolver; + product_sku?: DownloadableCreditMemoItemToProduct_skuResolver; + quantity_refunded?: DownloadableCreditMemoItemToQuantity_refundedResolver; + row_subtotal?: DownloadableCreditMemoItemToRow_subtotalResolver; +} + +export interface DownloadableCreditMemoItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToDownloadable_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableCreditMemoItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableItemsLinksTypeResolver { + sort_order?: DownloadableItemsLinksToSort_orderResolver; + title?: DownloadableItemsLinksToTitleResolver; + uid?: DownloadableItemsLinksToUidResolver; +} + +export interface DownloadableItemsLinksToSort_orderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableItemsLinksToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableItemsLinksToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableInvoiceItemTypeResolver { + discounts?: DownloadableInvoiceItemToDiscountsResolver; + downloadable_links?: DownloadableInvoiceItemToDownloadable_linksResolver; + id?: DownloadableInvoiceItemToIdResolver; + order_item?: DownloadableInvoiceItemToOrder_itemResolver; + product_name?: DownloadableInvoiceItemToProduct_nameResolver; + product_sale_price?: DownloadableInvoiceItemToProduct_sale_priceResolver; + product_sku?: DownloadableInvoiceItemToProduct_skuResolver; + quantity_invoiced?: DownloadableInvoiceItemToQuantity_invoicedResolver; + row_subtotal?: DownloadableInvoiceItemToRow_subtotalResolver; +} + +export interface DownloadableInvoiceItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToDownloadable_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableInvoiceItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableOrderItemTypeResolver { + discounts?: DownloadableOrderItemToDiscountsResolver; + downloadable_links?: DownloadableOrderItemToDownloadable_linksResolver; + entered_options?: DownloadableOrderItemToEntered_optionsResolver; + id?: DownloadableOrderItemToIdResolver; + product_name?: DownloadableOrderItemToProduct_nameResolver; + product_sale_price?: DownloadableOrderItemToProduct_sale_priceResolver; + product_sku?: DownloadableOrderItemToProduct_skuResolver; + product_type?: DownloadableOrderItemToProduct_typeResolver; + product_url_key?: DownloadableOrderItemToProduct_url_keyResolver; + quantity_canceled?: DownloadableOrderItemToQuantity_canceledResolver; + quantity_invoiced?: DownloadableOrderItemToQuantity_invoicedResolver; + quantity_ordered?: DownloadableOrderItemToQuantity_orderedResolver; + quantity_refunded?: DownloadableOrderItemToQuantity_refundedResolver; + quantity_returned?: DownloadableOrderItemToQuantity_returnedResolver; + quantity_shipped?: DownloadableOrderItemToQuantity_shippedResolver; + row_subtotal?: DownloadableOrderItemToRow_subtotalResolver; + selected_options?: DownloadableOrderItemToSelected_optionsResolver; + status?: DownloadableOrderItemToStatusResolver; +} + +export interface DownloadableOrderItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToDownloadable_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToEntered_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToProduct_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToProduct_url_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_canceledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_orderedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_returnedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToQuantity_shippedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToSelected_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableOrderItemToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableProductTypeResolver { + New_attribute_size?: DownloadableProductToNew_attribute_sizeResolver; + New_multiple_attribute?: DownloadableProductToNew_multiple_attributeResolver; + Test_Ainars?: DownloadableProductToTest_AinarsResolver; + attribute_allows_html?: DownloadableProductToAttribute_allows_htmlResolver; + attribute_set_id?: DownloadableProductToAttribute_set_idResolver; + brand?: DownloadableProductToBrandResolver; + canonical_url?: DownloadableProductToCanonical_urlResolver; + categories?: DownloadableProductToCategoriesResolver; + clothing_colour?: DownloadableProductToClothing_colourResolver; + clothing_gender?: DownloadableProductToClothing_genderResolver; + clothing_size?: DownloadableProductToClothing_sizeResolver; + clothing_type?: DownloadableProductToClothing_typeResolver; + color?: DownloadableProductToColorResolver; + color_elena?: DownloadableProductToColor_elenaResolver; + colors_with_images?: DownloadableProductToColors_with_imagesResolver; + country_of_manufacture?: DownloadableProductToCountry_of_manufactureResolver; + created_at?: DownloadableProductToCreated_atResolver; + crosssell_products?: DownloadableProductToCrosssell_productsResolver; + description?: DownloadableProductToDescriptionResolver; + downloadable_product_links?: DownloadableProductToDownloadable_product_linksResolver; + downloadable_product_samples?: DownloadableProductToDownloadable_product_samplesResolver; + fit?: DownloadableProductToFitResolver; + gift_message_available?: DownloadableProductToGift_message_availableResolver; + id?: DownloadableProductToIdResolver; + image?: DownloadableProductToImageResolver; + images_type_map?: DownloadableProductToImages_type_mapResolver; + license_key?: DownloadableProductToLicense_keyResolver; + links_purchased_separately?: DownloadableProductToLinks_purchased_separatelyResolver; + links_title?: DownloadableProductToLinks_titleResolver; + manufacturer?: DownloadableProductToManufacturerResolver; + material?: DownloadableProductToMaterialResolver; + media_gallery?: DownloadableProductToMedia_galleryResolver; + media_gallery_entries?: DownloadableProductToMedia_gallery_entriesResolver; + memory?: DownloadableProductToMemoryResolver; + meta_description?: DownloadableProductToMeta_descriptionResolver; + meta_keyword?: DownloadableProductToMeta_keywordResolver; + meta_title?: DownloadableProductToMeta_titleResolver; + multiple_attribute?: DownloadableProductToMultiple_attributeResolver; + name?: DownloadableProductToNameResolver; + new_from_date?: DownloadableProductToNew_from_dateResolver; + new_to_date?: DownloadableProductToNew_to_dateResolver; + only_x_left_in_stock?: DownloadableProductToOnly_x_left_in_stockResolver; + options?: DownloadableProductToOptionsResolver; + options_container?: DownloadableProductToOptions_containerResolver; + original_price?: DownloadableProductToOriginal_priceResolver; + price?: DownloadableProductToPriceResolver; + price_range?: DownloadableProductToPrice_rangeResolver; + price_tiers?: DownloadableProductToPrice_tiersResolver; + product_links?: DownloadableProductToProduct_linksResolver; + qty?: DownloadableProductToQtyResolver; + quantity?: DownloadableProductToQuantityResolver; + ranking?: DownloadableProductToRankingResolver; + rating_summary?: DownloadableProductToRating_summaryResolver; + redirect_code?: DownloadableProductToRedirect_codeResolver; + related_products?: DownloadableProductToRelated_productsResolver; + relative_url?: DownloadableProductToRelative_urlResolver; + review_count?: DownloadableProductToReview_countResolver; + reviews?: DownloadableProductToReviewsResolver; + row_total?: DownloadableProductToRow_totalResolver; + s_attributes?: DownloadableProductToS_attributesResolver; + salable_qty?: DownloadableProductToSalable_qtyResolver; + samples_title?: DownloadableProductToSamples_titleResolver; + shoes_size?: DownloadableProductToShoes_sizeResolver; + short_description?: DownloadableProductToShort_descriptionResolver; + size?: DownloadableProductToSizeResolver; + sku?: DownloadableProductToSkuResolver; + small_image?: DownloadableProductToSmall_imageResolver; + special_from_date?: DownloadableProductToSpecial_from_dateResolver; + special_price?: DownloadableProductToSpecial_priceResolver; + special_to_date?: DownloadableProductToSpecial_to_dateResolver; + stock_item?: DownloadableProductToStock_itemResolver; + stock_status?: DownloadableProductToStock_statusResolver; + swatch_image?: DownloadableProductToSwatch_imageResolver; + test?: DownloadableProductToTestResolver; + texture?: DownloadableProductToTextureResolver; + thumbnail?: DownloadableProductToThumbnailResolver; + tier_price?: DownloadableProductToTier_priceResolver; + tier_prices?: DownloadableProductToTier_pricesResolver; + type?: DownloadableProductToTypeResolver; + type_id?: DownloadableProductToType_idResolver; + uid?: DownloadableProductToUidResolver; + updated_at?: DownloadableProductToUpdated_atResolver; + upsell_products?: DownloadableProductToUpsell_productsResolver; + url?: DownloadableProductToUrlResolver; + url_key?: DownloadableProductToUrl_keyResolver; + url_path?: DownloadableProductToUrl_pathResolver; + url_rewrites?: DownloadableProductToUrl_rewritesResolver; + url_suffix?: DownloadableProductToUrl_suffixResolver; + valuesss?: DownloadableProductToValuesssResolver; + websites?: DownloadableProductToWebsitesResolver; + yes_no?: DownloadableProductToYes_noResolver; +} + +export interface DownloadableProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToDownloadable_product_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToDownloadable_product_samplesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToLinks_purchased_separatelyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToLinks_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface DownloadableProductToReviewsResolver { + (parent: TParent, args: DownloadableProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSamples_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLDownloadableWishlistItemTypeResolver { + added_at?: DownloadableWishlistItemToAdded_atResolver; + customizable_options?: DownloadableWishlistItemToCustomizable_optionsResolver; + description?: DownloadableWishlistItemToDescriptionResolver; + id?: DownloadableWishlistItemToIdResolver; + links_v2?: DownloadableWishlistItemToLinks_v2Resolver; + product?: DownloadableWishlistItemToProductResolver; + quantity?: DownloadableWishlistItemToQuantityResolver; + samples?: DownloadableWishlistItemToSamplesResolver; +} + +export interface DownloadableWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToLinks_v2Resolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface DownloadableWishlistItemToSamplesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLExtensionAttributesTypeResolver { + tax_grandtotal_details?: ExtensionAttributesToTax_grandtotal_detailsResolver; +} + +export interface ExtensionAttributesToTax_grandtotal_detailsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTaxGrandTotalDetailsTypeResolver { + amount?: TaxGrandTotalDetailsToAmountResolver; + group_id?: TaxGrandTotalDetailsToGroup_idResolver; +} + +export interface TaxGrandTotalDetailsToAmountResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TaxGrandTotalDetailsToGroup_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLGroupedProductTypeResolver { + New_attribute_size?: GroupedProductToNew_attribute_sizeResolver; + New_multiple_attribute?: GroupedProductToNew_multiple_attributeResolver; + Test_Ainars?: GroupedProductToTest_AinarsResolver; + attribute_allows_html?: GroupedProductToAttribute_allows_htmlResolver; + attribute_set_id?: GroupedProductToAttribute_set_idResolver; + brand?: GroupedProductToBrandResolver; + canonical_url?: GroupedProductToCanonical_urlResolver; + categories?: GroupedProductToCategoriesResolver; + clothing_colour?: GroupedProductToClothing_colourResolver; + clothing_gender?: GroupedProductToClothing_genderResolver; + clothing_size?: GroupedProductToClothing_sizeResolver; + clothing_type?: GroupedProductToClothing_typeResolver; + color?: GroupedProductToColorResolver; + color_elena?: GroupedProductToColor_elenaResolver; + colors_with_images?: GroupedProductToColors_with_imagesResolver; + country_of_manufacture?: GroupedProductToCountry_of_manufactureResolver; + created_at?: GroupedProductToCreated_atResolver; + crosssell_products?: GroupedProductToCrosssell_productsResolver; + description?: GroupedProductToDescriptionResolver; + fit?: GroupedProductToFitResolver; + gift_message_available?: GroupedProductToGift_message_availableResolver; + id?: GroupedProductToIdResolver; + image?: GroupedProductToImageResolver; + images_type_map?: GroupedProductToImages_type_mapResolver; + items?: GroupedProductToItemsResolver; + license_key?: GroupedProductToLicense_keyResolver; + manufacturer?: GroupedProductToManufacturerResolver; + material?: GroupedProductToMaterialResolver; + media_gallery?: GroupedProductToMedia_galleryResolver; + media_gallery_entries?: GroupedProductToMedia_gallery_entriesResolver; + memory?: GroupedProductToMemoryResolver; + meta_description?: GroupedProductToMeta_descriptionResolver; + meta_keyword?: GroupedProductToMeta_keywordResolver; + meta_title?: GroupedProductToMeta_titleResolver; + multiple_attribute?: GroupedProductToMultiple_attributeResolver; + name?: GroupedProductToNameResolver; + new_from_date?: GroupedProductToNew_from_dateResolver; + new_to_date?: GroupedProductToNew_to_dateResolver; + only_x_left_in_stock?: GroupedProductToOnly_x_left_in_stockResolver; + options_container?: GroupedProductToOptions_containerResolver; + original_price?: GroupedProductToOriginal_priceResolver; + price?: GroupedProductToPriceResolver; + price_range?: GroupedProductToPrice_rangeResolver; + price_tiers?: GroupedProductToPrice_tiersResolver; + product_links?: GroupedProductToProduct_linksResolver; + qty?: GroupedProductToQtyResolver; + quantity?: GroupedProductToQuantityResolver; + ranking?: GroupedProductToRankingResolver; + rating_summary?: GroupedProductToRating_summaryResolver; + redirect_code?: GroupedProductToRedirect_codeResolver; + related_products?: GroupedProductToRelated_productsResolver; + relative_url?: GroupedProductToRelative_urlResolver; + review_count?: GroupedProductToReview_countResolver; + reviews?: GroupedProductToReviewsResolver; + row_total?: GroupedProductToRow_totalResolver; + s_attributes?: GroupedProductToS_attributesResolver; + salable_qty?: GroupedProductToSalable_qtyResolver; + shoes_size?: GroupedProductToShoes_sizeResolver; + short_description?: GroupedProductToShort_descriptionResolver; + size?: GroupedProductToSizeResolver; + sku?: GroupedProductToSkuResolver; + small_image?: GroupedProductToSmall_imageResolver; + special_from_date?: GroupedProductToSpecial_from_dateResolver; + special_price?: GroupedProductToSpecial_priceResolver; + special_to_date?: GroupedProductToSpecial_to_dateResolver; + stock_item?: GroupedProductToStock_itemResolver; + stock_status?: GroupedProductToStock_statusResolver; + swatch_image?: GroupedProductToSwatch_imageResolver; + test?: GroupedProductToTestResolver; + texture?: GroupedProductToTextureResolver; + thumbnail?: GroupedProductToThumbnailResolver; + tier_price?: GroupedProductToTier_priceResolver; + tier_prices?: GroupedProductToTier_pricesResolver; + type?: GroupedProductToTypeResolver; + type_id?: GroupedProductToType_idResolver; + uid?: GroupedProductToUidResolver; + updated_at?: GroupedProductToUpdated_atResolver; + upsell_products?: GroupedProductToUpsell_productsResolver; + url?: GroupedProductToUrlResolver; + url_key?: GroupedProductToUrl_keyResolver; + url_path?: GroupedProductToUrl_pathResolver; + url_rewrites?: GroupedProductToUrl_rewritesResolver; + url_suffix?: GroupedProductToUrl_suffixResolver; + valuesss?: GroupedProductToValuesssResolver; + websites?: GroupedProductToWebsitesResolver; + weight?: GroupedProductToWeightResolver; + yes_no?: GroupedProductToYes_noResolver; +} + +export interface GroupedProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToItemsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface GroupedProductToReviewsResolver { + (parent: TParent, args: GroupedProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToWeightResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLGroupedProductItemTypeResolver { + position?: GroupedProductItemToPositionResolver; + product?: GroupedProductItemToProductResolver; + qty?: GroupedProductItemToQtyResolver; +} + +export interface GroupedProductItemToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductItemToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLGroupedProductWishlistItemTypeResolver { + added_at?: GroupedProductWishlistItemToAdded_atResolver; + customizable_options?: GroupedProductWishlistItemToCustomizable_optionsResolver; + description?: GroupedProductWishlistItemToDescriptionResolver; + id?: GroupedProductWishlistItemToIdResolver; + product?: GroupedProductWishlistItemToProductResolver; + quantity?: GroupedProductWishlistItemToQuantityResolver; +} + +export interface GroupedProductWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GroupedProductWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLImageSwatchDataTypeResolver { + thumbnail?: ImageSwatchDataToThumbnailResolver; + value?: ImageSwatchDataToValueResolver; +} + +export interface ImageSwatchDataToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ImageSwatchDataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLInvoiceItemTypeResolver { + discounts?: InvoiceItemToDiscountsResolver; + id?: InvoiceItemToIdResolver; + order_item?: InvoiceItemToOrder_itemResolver; + product_name?: InvoiceItemToProduct_nameResolver; + product_sale_price?: InvoiceItemToProduct_sale_priceResolver; + product_sku?: InvoiceItemToProduct_skuResolver; + quantity_invoiced?: InvoiceItemToQuantity_invoicedResolver; + row_subtotal?: InvoiceItemToRow_subtotalResolver; +} + +export interface InvoiceItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface InvoiceItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLLayerFilterItemTypeResolver { + items_count?: LayerFilterItemToItems_countResolver; + label?: LayerFilterItemToLabelResolver; + value_string?: LayerFilterItemToValue_stringResolver; +} + +export interface LayerFilterItemToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface LayerFilterItemToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface LayerFilterItemToValue_stringResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLOrderItemTypeResolver { + discounts?: OrderItemToDiscountsResolver; + entered_options?: OrderItemToEntered_optionsResolver; + id?: OrderItemToIdResolver; + product_name?: OrderItemToProduct_nameResolver; + product_sale_price?: OrderItemToProduct_sale_priceResolver; + product_sku?: OrderItemToProduct_skuResolver; + product_type?: OrderItemToProduct_typeResolver; + product_url_key?: OrderItemToProduct_url_keyResolver; + quantity_canceled?: OrderItemToQuantity_canceledResolver; + quantity_invoiced?: OrderItemToQuantity_invoicedResolver; + quantity_ordered?: OrderItemToQuantity_orderedResolver; + quantity_refunded?: OrderItemToQuantity_refundedResolver; + quantity_returned?: OrderItemToQuantity_returnedResolver; + quantity_shipped?: OrderItemToQuantity_shippedResolver; + row_subtotal?: OrderItemToRow_subtotalResolver; + selected_options?: OrderItemToSelected_optionsResolver; + status?: OrderItemToStatusResolver; +} + +export interface OrderItemToDiscountsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToEntered_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToProduct_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToProduct_url_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_canceledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_invoicedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_orderedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_refundedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_returnedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToQuantity_shippedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToRow_subtotalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToSelected_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface OrderItemToStatusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLPayflowProTokenTypeResolver { + response_message?: PayflowProTokenToResponse_messageResolver; + result?: PayflowProTokenToResultResolver; + result_code?: PayflowProTokenToResult_codeResolver; + secure_token?: PayflowProTokenToSecure_tokenResolver; + secure_token_id?: PayflowProTokenToSecure_token_idResolver; +} + +export interface PayflowProTokenToResponse_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowProTokenToResultResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowProTokenToResult_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowProTokenToSecure_tokenResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface PayflowProTokenToSecure_token_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductImageTypeResolver { + disabled?: ProductImageToDisabledResolver; + label?: ProductImageToLabelResolver; + path?: ProductImageToPathResolver; + position?: ProductImageToPositionResolver; + url?: ProductImageToUrlResolver; +} + +export interface ProductImageToDisabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductImageToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductImageToPathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductImageToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductImageToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductLinksTypeResolver { + link_type?: ProductLinksToLink_typeResolver; + linked_product_sku?: ProductLinksToLinked_product_skuResolver; + linked_product_type?: ProductLinksToLinked_product_typeResolver; + position?: ProductLinksToPositionResolver; + sku?: ProductLinksToSkuResolver; +} + +export interface ProductLinksToLink_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductLinksToLinked_product_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductLinksToLinked_product_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductLinksToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductLinksToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLProductVideoTypeResolver { + disabled?: ProductVideoToDisabledResolver; + label?: ProductVideoToLabelResolver; + position?: ProductVideoToPositionResolver; + url?: ProductVideoToUrlResolver; + video_content?: ProductVideoToVideo_contentResolver; +} + +export interface ProductVideoToDisabledResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductVideoToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductVideoToPositionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductVideoToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ProductVideoToVideo_contentResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSalesItemInterfaceTypeResolver { + gift_message?: SalesItemInterfaceToGift_messageResolver; +} + +export interface SalesItemInterfaceToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLShipmentItemTypeResolver { + id?: ShipmentItemToIdResolver; + order_item?: ShipmentItemToOrder_itemResolver; + product_name?: ShipmentItemToProduct_nameResolver; + product_sale_price?: ShipmentItemToProduct_sale_priceResolver; + product_sku?: ShipmentItemToProduct_skuResolver; + quantity_shipped?: ShipmentItemToQuantity_shippedResolver; +} + +export interface ShipmentItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentItemToOrder_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentItemToProduct_nameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentItemToProduct_sale_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentItemToProduct_skuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface ShipmentItemToQuantity_shippedResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSimpleCartItemTypeResolver { + customizable_options?: SimpleCartItemToCustomizable_optionsResolver; + gift_message?: SimpleCartItemToGift_messageResolver; + id?: SimpleCartItemToIdResolver; + prices?: SimpleCartItemToPricesResolver; + product?: SimpleCartItemToProductResolver; + quantity?: SimpleCartItemToQuantityResolver; + uid?: SimpleCartItemToUidResolver; +} + +export interface SimpleCartItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToGift_messageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleCartItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSimpleWishlistItemTypeResolver { + added_at?: SimpleWishlistItemToAdded_atResolver; + customizable_options?: SimpleWishlistItemToCustomizable_optionsResolver; + description?: SimpleWishlistItemToDescriptionResolver; + id?: SimpleWishlistItemToIdResolver; + product?: SimpleWishlistItemToProductResolver; + quantity?: SimpleWishlistItemToQuantityResolver; +} + +export interface SimpleWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SimpleWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSwatchLayerFilterItemTypeResolver { + items_count?: SwatchLayerFilterItemToItems_countResolver; + label?: SwatchLayerFilterItemToLabelResolver; + swatch_data?: SwatchLayerFilterItemToSwatch_dataResolver; + value_string?: SwatchLayerFilterItemToValue_stringResolver; +} + +export interface SwatchLayerFilterItemToItems_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SwatchLayerFilterItemToLabelResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SwatchLayerFilterItemToSwatch_dataResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface SwatchLayerFilterItemToValue_stringResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLSwatchLayerFilterItemInterfaceTypeResolver { + (parent: TParent, context: any, info: GraphQLResolveInfo): 'SwatchLayerFilterItem' | Promise<'SwatchLayerFilterItem'>; +} +export interface GQLTextSwatchDataTypeResolver { + value?: TextSwatchDataToValueResolver; +} + +export interface TextSwatchDataToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLTotalsSegmentTypeResolver { + code?: TotalsSegmentToCodeResolver; + extension_attributes?: TotalsSegmentToExtension_attributesResolver; + title?: TotalsSegmentToTitleResolver; + value?: TotalsSegmentToValueResolver; +} + +export interface TotalsSegmentToCodeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsSegmentToExtension_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsSegmentToTitleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface TotalsSegmentToValueResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLVirtualCartItemTypeResolver { + customizable_options?: VirtualCartItemToCustomizable_optionsResolver; + id?: VirtualCartItemToIdResolver; + prices?: VirtualCartItemToPricesResolver; + product?: VirtualCartItemToProductResolver; + quantity?: VirtualCartItemToQuantityResolver; + uid?: VirtualCartItemToUidResolver; +} + +export interface VirtualCartItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualCartItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualCartItemToPricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualCartItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualCartItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualCartItemToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLVirtualProductTypeResolver { + New_attribute_size?: VirtualProductToNew_attribute_sizeResolver; + New_multiple_attribute?: VirtualProductToNew_multiple_attributeResolver; + Test_Ainars?: VirtualProductToTest_AinarsResolver; + attribute_allows_html?: VirtualProductToAttribute_allows_htmlResolver; + attribute_set_id?: VirtualProductToAttribute_set_idResolver; + brand?: VirtualProductToBrandResolver; + canonical_url?: VirtualProductToCanonical_urlResolver; + categories?: VirtualProductToCategoriesResolver; + clothing_colour?: VirtualProductToClothing_colourResolver; + clothing_gender?: VirtualProductToClothing_genderResolver; + clothing_size?: VirtualProductToClothing_sizeResolver; + clothing_type?: VirtualProductToClothing_typeResolver; + color?: VirtualProductToColorResolver; + color_elena?: VirtualProductToColor_elenaResolver; + colors_with_images?: VirtualProductToColors_with_imagesResolver; + country_of_manufacture?: VirtualProductToCountry_of_manufactureResolver; + created_at?: VirtualProductToCreated_atResolver; + crosssell_products?: VirtualProductToCrosssell_productsResolver; + description?: VirtualProductToDescriptionResolver; + fit?: VirtualProductToFitResolver; + gift_message_available?: VirtualProductToGift_message_availableResolver; + id?: VirtualProductToIdResolver; + image?: VirtualProductToImageResolver; + images_type_map?: VirtualProductToImages_type_mapResolver; + license_key?: VirtualProductToLicense_keyResolver; + manufacturer?: VirtualProductToManufacturerResolver; + material?: VirtualProductToMaterialResolver; + media_gallery?: VirtualProductToMedia_galleryResolver; + media_gallery_entries?: VirtualProductToMedia_gallery_entriesResolver; + memory?: VirtualProductToMemoryResolver; + meta_description?: VirtualProductToMeta_descriptionResolver; + meta_keyword?: VirtualProductToMeta_keywordResolver; + meta_title?: VirtualProductToMeta_titleResolver; + multiple_attribute?: VirtualProductToMultiple_attributeResolver; + name?: VirtualProductToNameResolver; + new_from_date?: VirtualProductToNew_from_dateResolver; + new_to_date?: VirtualProductToNew_to_dateResolver; + only_x_left_in_stock?: VirtualProductToOnly_x_left_in_stockResolver; + options?: VirtualProductToOptionsResolver; + options_container?: VirtualProductToOptions_containerResolver; + original_price?: VirtualProductToOriginal_priceResolver; + price?: VirtualProductToPriceResolver; + price_range?: VirtualProductToPrice_rangeResolver; + price_tiers?: VirtualProductToPrice_tiersResolver; + product_links?: VirtualProductToProduct_linksResolver; + qty?: VirtualProductToQtyResolver; + quantity?: VirtualProductToQuantityResolver; + ranking?: VirtualProductToRankingResolver; + rating_summary?: VirtualProductToRating_summaryResolver; + redirect_code?: VirtualProductToRedirect_codeResolver; + related_products?: VirtualProductToRelated_productsResolver; + relative_url?: VirtualProductToRelative_urlResolver; + review_count?: VirtualProductToReview_countResolver; + reviews?: VirtualProductToReviewsResolver; + row_total?: VirtualProductToRow_totalResolver; + s_attributes?: VirtualProductToS_attributesResolver; + salable_qty?: VirtualProductToSalable_qtyResolver; + shoes_size?: VirtualProductToShoes_sizeResolver; + short_description?: VirtualProductToShort_descriptionResolver; + size?: VirtualProductToSizeResolver; + sku?: VirtualProductToSkuResolver; + small_image?: VirtualProductToSmall_imageResolver; + special_from_date?: VirtualProductToSpecial_from_dateResolver; + special_price?: VirtualProductToSpecial_priceResolver; + special_to_date?: VirtualProductToSpecial_to_dateResolver; + stock_item?: VirtualProductToStock_itemResolver; + stock_status?: VirtualProductToStock_statusResolver; + swatch_image?: VirtualProductToSwatch_imageResolver; + test?: VirtualProductToTestResolver; + texture?: VirtualProductToTextureResolver; + thumbnail?: VirtualProductToThumbnailResolver; + tier_price?: VirtualProductToTier_priceResolver; + tier_prices?: VirtualProductToTier_pricesResolver; + type?: VirtualProductToTypeResolver; + type_id?: VirtualProductToType_idResolver; + uid?: VirtualProductToUidResolver; + updated_at?: VirtualProductToUpdated_atResolver; + upsell_products?: VirtualProductToUpsell_productsResolver; + url?: VirtualProductToUrlResolver; + url_key?: VirtualProductToUrl_keyResolver; + url_path?: VirtualProductToUrl_pathResolver; + url_rewrites?: VirtualProductToUrl_rewritesResolver; + url_suffix?: VirtualProductToUrl_suffixResolver; + valuesss?: VirtualProductToValuesssResolver; + websites?: VirtualProductToWebsitesResolver; + yes_no?: VirtualProductToYes_noResolver; +} + +export interface VirtualProductToNew_attribute_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToNew_multiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTest_AinarsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToAttribute_allows_htmlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToAttribute_set_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToBrandResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToCanonical_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToCategoriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToClothing_colourResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToClothing_genderResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToClothing_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToClothing_typeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToColorResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToColor_elenaResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToColors_with_imagesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToCountry_of_manufactureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToCreated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToCrosssell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToFitResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToGift_message_availableResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToImageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToImages_type_mapResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToLicense_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToManufacturerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMaterialResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMedia_galleryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMedia_gallery_entriesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMemoryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMeta_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMeta_keywordResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMeta_titleResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToMultiple_attributeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToNameResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToNew_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToNew_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToOnly_x_left_in_stockResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToOptionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToOptions_containerResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToOriginal_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToPriceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToPrice_rangeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToPrice_tiersResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToProduct_linksResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToQtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRankingResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRating_summaryResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRedirect_codeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRelated_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRelative_urlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToReview_countResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToReviewsArgs { + pageSize?: number; + currentPage?: number; +} +export interface VirtualProductToReviewsResolver { + (parent: TParent, args: VirtualProductToReviewsArgs, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToRow_totalResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToS_attributesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSalable_qtyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToShoes_sizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToShort_descriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSizeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSkuResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSmall_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSpecial_from_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSpecial_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSpecial_to_dateResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToStock_itemResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToStock_statusResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToSwatch_imageResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTestResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTextureResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToThumbnailResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTier_priceResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTier_pricesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToTypeResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToType_idResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUidResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUpdated_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUpsell_productsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUrlResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUrl_keyResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUrl_pathResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUrl_rewritesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToUrl_suffixResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToValuesssResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToWebsitesResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualProductToYes_noResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface GQLVirtualWishlistItemTypeResolver { + added_at?: VirtualWishlistItemToAdded_atResolver; + customizable_options?: VirtualWishlistItemToCustomizable_optionsResolver; + description?: VirtualWishlistItemToDescriptionResolver; + id?: VirtualWishlistItemToIdResolver; + product?: VirtualWishlistItemToProductResolver; + quantity?: VirtualWishlistItemToQuantityResolver; +} + +export interface VirtualWishlistItemToAdded_atResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualWishlistItemToCustomizable_optionsResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualWishlistItemToDescriptionResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualWishlistItemToIdResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualWishlistItemToProductResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} + +export interface VirtualWishlistItemToQuantityResolver { + (parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult; +} diff --git a/packages/scandipwa/src/util/Auth/Token.js b/packages/scandipwa/src/util/Auth/Token.ts similarity index 79% rename from packages/scandipwa/src/util/Auth/Token.js rename to packages/scandipwa/src/util/Auth/Token.ts index 4df66fc1a4..56bb687915 100644 --- a/packages/scandipwa/src/util/Auth/Token.js +++ b/packages/scandipwa/src/util/Auth/Token.ts @@ -23,7 +23,7 @@ export const ONE_HOUR = 1; export const TOKEN_REFRESH_DELAY = 2000; /** @namespace Util/Auth/Token/setAuthorizationToken */ -export const setAuthorizationToken = (token) => { +export const setAuthorizationToken = (token: string | null): void => { if (!token) { return; } @@ -37,10 +37,10 @@ export const setAuthorizationToken = (token) => { }; /** @namespace Util/Auth/Token/deleteAuthorizationToken */ -export const deleteAuthorizationToken = () => BrowserDatabase.deleteItem(AUTH_TOKEN); +export const deleteAuthorizationToken = (): void => BrowserDatabase.deleteItem(AUTH_TOKEN); /** @namespace Util/Auth/Token/getAuthorizationToken */ -export const getAuthorizationToken = () => BrowserDatabase.getItem(AUTH_TOKEN); +export const getAuthorizationToken = (): string | null => BrowserDatabase.getItem(AUTH_TOKEN); /** @namespace Util/Auth/Token/refreshAuthorizationToken */ export const refreshAuthorizationToken = debounce( @@ -49,20 +49,20 @@ export const refreshAuthorizationToken = debounce( ); /** @namespace Util/Auth/Token/isInitiallySignedIn */ -export const isInitiallySignedIn = () => !!getAuthorizationToken(); +export const isInitiallySignedIn = (): boolean => !!getAuthorizationToken(); /** @namespace Util/Auth/Token/isSignedIn */ -export const isSignedIn = () => { - const _isSignedIn = !!getAuthorizationToken(); +export const isSignedIn = (): boolean => { + const hasAuthToken = !!getAuthorizationToken(); const store = getStore(); const { MyAccountReducer: { - isSignedIn: isCustomerSignedIn + isSignedIn: isCustomerSignedIn = false } = {} } = store.getState(); const { dispatch } = store; - if (!_isSignedIn && isCustomerSignedIn) { + if (!hasAuthToken && isCustomerSignedIn) { // since logout is async and slow, remove cart id / compare uid // and set customer sign in status here on auth token expiration deleteGuestQuoteId(); @@ -75,5 +75,5 @@ export const isSignedIn = () => { ); } - return _isSignedIn; + return hasAuthToken; }; diff --git a/packages/scandipwa/src/util/Auth/index.js b/packages/scandipwa/src/util/Auth/index.ts similarity index 100% rename from packages/scandipwa/src/util/Auth/index.js rename to packages/scandipwa/src/util/Auth/index.ts diff --git a/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.js b/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts similarity index 86% rename from packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.js rename to packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts index 97c9fa0cd5..8121c2e0c5 100644 --- a/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.js +++ b/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -// TODO: maybe consider moving to IndexedDB insead of localStorage +// TODO: maybe consider moving to IndexedDB instead of localStorage /** * Set of helpers related to Browser Database @@ -23,9 +23,9 @@ export class BrowserDatabase { * @return {Object} Object stored in a specified path * @memberof BrowserDatabase */ - getItem(location) { + getItem(location: string): T | null { try { - const entryObject = JSON.parse(localStorage.getItem(location)); + const entryObject = JSON.parse(localStorage.getItem(location) || ''); const { data, expiration, createdAt } = entryObject; const MILLISECONDS_TO_SECONDS = 1000; @@ -35,7 +35,7 @@ export class BrowserDatabase { return null; } - return data; + return data as T; } catch { return null; } @@ -49,7 +49,7 @@ export class BrowserDatabase { * @return {Void} * @memberof BrowserDatabase */ - setItem(data, location, expiration) { + setItem(data: T, location: string, expiration: number): void { localStorage.setItem(location, JSON.stringify({ data, expiration, @@ -62,7 +62,7 @@ export class BrowserDatabase { * @param {String} location * @memberof BrowserDatabase */ - deleteItem(location) { + deleteItem(location: string): void { localStorage.removeItem(location); } } diff --git a/packages/scandipwa/src/util/BrowserDatabase/index.js b/packages/scandipwa/src/util/BrowserDatabase/index.ts similarity index 100% rename from packages/scandipwa/src/util/BrowserDatabase/index.js rename to packages/scandipwa/src/util/BrowserDatabase/index.ts diff --git a/packages/scandipwa/src/util/Query/Field.js b/packages/scandipwa/src/util/Query/Field.ts similarity index 66% rename from packages/scandipwa/src/util/Query/Field.js rename to packages/scandipwa/src/util/Query/Field.ts index 8348e3c33b..b6ee0734c1 100644 --- a/packages/scandipwa/src/util/Query/Field.js +++ b/packages/scandipwa/src/util/Query/Field.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { FieldArgument } from './Query.type'; + /** * Builds GraphQL query according to https://graphql.org/learn/queries/ documentation * @class Query @@ -16,17 +18,24 @@ * @namespace Util/Query/Field */ export class Field { + name = ''; + alias = ''; - children = []; + children: Field[] = []; - args = []; + args: FieldArgument[] = []; + + // eslint-disable-next-line @scandipwa/scandipwa-guidelines/use-magic-construct + constructor(name: string) { + this.__construct(name); + } - __construct(name) { + __construct(name: string): void { this.name = name; } - addField(field) { + addField(field: string | Field): this { if (typeof field === 'string') { this.children.push(new Field(field)); } else if (field instanceof Field) { @@ -36,19 +45,19 @@ export class Field { return this; } - setAlias(alias) { + setAlias(alias: string): this { this.alias = `${alias}:`; return this; } - addFieldList(fieldList) { + addFieldList(fieldList: Array): this { fieldList.forEach(this.addField.bind(this)); return this; } - addArgument(name, type, value) { + addArgument(name: string, type: string, value: T): this { this.args.push({ name, type, diff --git a/packages/scandipwa/src/util/Query/Fragment.js b/packages/scandipwa/src/util/Query/Fragment.ts similarity index 93% rename from packages/scandipwa/src/util/Query/Fragment.js rename to packages/scandipwa/src/util/Query/Fragment.ts index 7e15191f47..d85ccaa71d 100644 --- a/packages/scandipwa/src/util/Query/Fragment.js +++ b/packages/scandipwa/src/util/Query/Fragment.ts @@ -13,7 +13,7 @@ import Field from 'Util/Query/Field'; /** @namespace Util/Query/Fragment */ export class Fragment extends Field { - __construct(name) { + __construct(name: string): void { super.__construct(name); this.name = `... on ${name}`; } diff --git a/packages/scandipwa/src/util/Query/PrepareDocument.js b/packages/scandipwa/src/util/Query/PrepareDocument.ts similarity index 70% rename from packages/scandipwa/src/util/Query/PrepareDocument.js rename to packages/scandipwa/src/util/Query/PrepareDocument.ts index c02c35329e..9862ceb70c 100644 --- a/packages/scandipwa/src/util/Query/PrepareDocument.js +++ b/packages/scandipwa/src/util/Query/PrepareDocument.ts @@ -9,34 +9,35 @@ * @link https://github.com/scandipwa/base-theme */ -export const MUTATION_TYPE = 'mutation'; -export const QUERY_TYPE = 'query'; +import { Field } from './Field'; +import { FieldArgument, FieldType, PreparedRequest } from './Query.type'; /** * Prepare request body string from query list (all entries must be instances of Query). * @param {Array} queries * @return {String} JSON String, format: `{"query":"{alias: queryName (attr:key) { field1, field2 }}"}` * @namespace Util/Query/PrepareDocument/prepareFieldString */ -export const prepareFieldString = (rootField, accArgs = {}) => { +export const prepareFieldString = ( + rootField: Field, + accArgs: Record = {} +): string => { const { alias, name, args, children } = rootField; - const resolvedArgs = args.reduce((acc, arg) => { - const { name, type, value } = arg; - - if (!accArgs[name]) { + const resolvedArgs = args.reduce((acc, arg): string[] => { + if (!accArgs[arg.name]) { // eslint-disable-next-line no-param-reassign - accArgs[name] = []; + accArgs[arg.name] = [] as unknown as [string, unknown]; } // add type and value of the argument into argument accumulator, // we will need this value when building the query doc and variables - const index = accArgs[name].push([type, value]); + const index = accArgs[arg.name].push([arg.type, arg.value]); // join each argument as "name:$var_1" - return [...acc, `${name}:$${name}_${index}`]; - }, []); + return [...acc, `${arg.name}:$${arg.name}_${index}`]; + }, [] as string[]); // join arguments, wrap into "()" and join with "," const formattedArgs = resolvedArgs.length ? `(${resolvedArgs.join(',')})` : ''; @@ -52,15 +53,15 @@ export const prepareFieldString = (rootField, accArgs = {}) => { }; /** @namespace Util/Query/PrepareDocument/prepareRequest */ -export const prepareRequest = (fields, type) => { +export const prepareRequest = (fields: Field[], type: FieldType): PreparedRequest => { const fieldsArray = Array.isArray(fields) ? fields : [fields]; - if (type !== MUTATION_TYPE && type !== QUERY_TYPE) { + if (type !== FieldType.MUTATION && type !== FieldType.QUERY) { // we only support Mutation and Query types throw new Error(`GraphQL document type "${type}" is not supported.`); } - const variables = {}; + const variables: Record = {}; const accArgs = {}; // prepare fields from each field passed @@ -68,15 +69,15 @@ export const prepareRequest = (fields, type) => { // go through argument accumulator collected in "prepareFieldString", join values // into the format "$var:Type" and append variable value to variables field - const resolvedArgs = Object.entries(accArgs).reduce((acc, [name, dataArray]) => { - dataArray.forEach(([type, value], i) => { + const resolvedArgs = Object.entries(accArgs).reduce((acc, [name, dataArray]): string[] => { + (dataArray as Array>).forEach((item, i: number) => { const variable = `${name}_${i + 1}`; - acc.push(`$${variable}:${type}`); - variables[variable] = value; + acc.push(`$${variable}:${item.type}`); + variables[variable] = item.value; }); return acc; - }, []); + }, [] as string[]); // Wrap arguments with "()" and join using "," const formattedArgs = resolvedArgs.length ? `(${resolvedArgs.join(',')})` : ''; @@ -101,7 +102,7 @@ export const prepareRequest = (fields, type) => { }; /** @namespace Util/Query/PrepareDocument/prepareMutation */ -export const prepareMutation = (mutations) => prepareRequest(mutations, MUTATION_TYPE); +export const prepareMutation = (mutations: Field[]): PreparedRequest => prepareRequest(mutations, FieldType.MUTATION); /** @namespace Util/Query/PrepareDocument/prepareQuery */ -export const prepareQuery = (queries) => prepareRequest(queries, QUERY_TYPE); +export const prepareQuery = (queries: Field[]): PreparedRequest => prepareRequest(queries, FieldType.QUERY); diff --git a/packages/scandipwa/src/util/Query/Query.type.ts b/packages/scandipwa/src/util/Query/Query.type.ts new file mode 100644 index 0000000000..8677f71f92 --- /dev/null +++ b/packages/scandipwa/src/util/Query/Query.type.ts @@ -0,0 +1,26 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export enum FieldType { + MUTATION = 'mutation', + QUERY = 'query' +} + +export type FieldArgument = { + name: string; + type: string; + value: unknown; +}; + +export type PreparedRequest = { + query: string, + variables: unknown +}; diff --git a/packages/scandipwa/src/util/Query/index.js b/packages/scandipwa/src/util/Query/index.ts similarity index 100% rename from packages/scandipwa/src/util/Query/index.js rename to packages/scandipwa/src/util/Query/index.ts diff --git a/packages/scandipwa/tsconfig.json b/packages/scandipwa/tsconfig.json index 87c36fd041..1769ee87e1 100644 --- a/packages/scandipwa/tsconfig.json +++ b/packages/scandipwa/tsconfig.json @@ -18,7 +18,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react" + "jsx": "react-jsx" }, "include": [ "./src/**/*" diff --git a/yarn.lock b/yarn.lock index 2b3dd21e2f..b647528f48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7247,6 +7247,23 @@ eslint-config-airbnb-base@^14.2.1: object.assign "^4.1.2" object.entries "^1.1.2" +eslint-config-airbnb-base@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" + integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== + dependencies: + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.5" + semver "^6.3.0" + +eslint-config-airbnb-typescript@^16.1.4: + version "16.1.4" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.1.4.tgz#ac8553a55080cce34aa1ab5625564b4faf5a5f1c" + integrity sha512-dfm2cEaYXh4mCYd+RyJO8+PQfd5/zp8WwrCeRznly5qD9W5tal3KTjgdInYWuEAdwWnNJxWcmQ/HFiA4bfkM1g== + dependencies: + eslint-config-airbnb-base "^15.0.0" + eslint-config-airbnb@^18.2.0: version "18.2.1" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9" @@ -8372,6 +8389,16 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-graphql-schema@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/get-graphql-schema/-/get-graphql-schema-2.1.2.tgz#ffa418534224a75cd7afc8f87b70109ca9ec3fe9" + integrity sha512-1z5Hw91VrE3GrpCZE6lE8Dy+jz4kXWesLS7rCSjwOxf5BOcIedAZeTUJRIeIzmmR+PA9CKOkPTYFRJbdgUtrxA== + dependencies: + chalk "^2.4.1" + graphql "^14.0.2" + minimist "^1.2.0" + node-fetch "^2.2.0" + get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" @@ -8699,6 +8726,21 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= +graphql-schema-typescript@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/graphql-schema-typescript/-/graphql-schema-typescript-1.5.2.tgz#04433236617689825842e45ccfe2fd384c01d8f2" + integrity sha512-r09ycu9BLSeRg8VcEB1Jg2kHeBxeDOdz1iyhA/rja3IcZoau3MRie0203piWI8j+N/KIv60OBPquiEgq1snYAQ== + dependencies: + camelcase "^6.2.0" + yargs "^16.0.0" + +graphql@^14.0.2: + version "14.7.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.7.0.tgz#7fa79a80a69be4a31c27dda824dc04dac2035a72" + integrity sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA== + dependencies: + iterall "^1.2.2" + growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" @@ -9987,6 +10029,11 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +iterall@^1.2.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" + integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== + jake@^10.6.1: version "10.8.4" resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.4.tgz#f6a8b7bf90c6306f768aa82bb7b98bf4ca15e84a" @@ -11985,7 +12032,7 @@ node-fetch@2.6.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.6.2, node-fetch@^2.6.7: +node-fetch@^2.2.0, node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.6.2, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -18148,7 +18195,7 @@ yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.1.0: +yargs@^16.0.0, yargs@^16.1.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From e152c3a4e5c0ae27fe78a9db21982691e6d20aea Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Thu, 31 Mar 2022 00:47:48 +0300 Subject: [PATCH 008/192] Migrated some queries --- packages/scandipwa/package.json | 10 +++- .../{Category.query.js => Category.query.ts} | 41 +++++++++------ ...heckEmail.query.js => CheckEmail.query.ts} | 2 +- .../{Checkout.query.js => Checkout.query.ts} | 39 ++++++++------- .../{CmsBlock.query.js => CmsBlock.query.ts} | 6 +-- packages/scandipwa/src/type/Global.type.ts | 50 +++++++++++++++++++ packages/scandipwa/src/util/Query/index.ts | 1 + 7 files changed, 109 insertions(+), 40 deletions(-) rename packages/scandipwa/src/query/{Category.query.js => Category.query.ts} (69%) rename packages/scandipwa/src/query/{CheckEmail.query.js => CheckEmail.query.ts} (92%) rename packages/scandipwa/src/query/{Checkout.query.js => Checkout.query.ts} (78%) rename packages/scandipwa/src/query/{CmsBlock.query.js => CmsBlock.query.ts} (90%) create mode 100644 packages/scandipwa/src/type/Global.type.ts diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 9e3121d687..a2f9b35510 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -505,9 +505,15 @@ "leadingUnderscore": "allow" }, { - "selector": "classMethod", + "selector": "method", "format": null, - "filter": "__construct", + "filter": "^__construct$", + "leadingUnderscore": "allow" + }, + { + "selector": "function", + "format": null, + "filter": "^__$", "leadingUnderscore": "allow" } ] diff --git a/packages/scandipwa/src/query/Category.query.js b/packages/scandipwa/src/query/Category.query.ts similarity index 69% rename from packages/scandipwa/src/query/Category.query.js rename to packages/scandipwa/src/query/Category.query.ts index 724127c6de..5257f6512e 100644 --- a/packages/scandipwa/src/query/Category.query.js +++ b/packages/scandipwa/src/query/Category.query.ts @@ -9,7 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, FieldArgument } from 'Util/Query'; + +type CategoryQueryOptions = { + categoryIds: number +}; /** * Category Query @@ -17,41 +21,48 @@ import { Field } from 'Util/Query'; * @namespace Query/Category/Query */ export class CategoryQuery { - __construct() { - super.__construct(); - this.options = {}; - } + options = {} as CategoryQueryOptions; - getQuery(options = {}) { + getQuery(options: CategoryQueryOptions = {} as CategoryQueryOptions): Field { this.options = options; + const { + name, + type, + value + } = this._getConditionalArguments(); return new Field('category') - .addArgument(...this._getConditionalArguments()) + .addArgument(name, type, value) .addFieldList(this._getDefaultFields()) .addField(this._getChildrenFields()); } - _getConditionalArguments() { + _getConditionalArguments(): FieldArgument { const { categoryIds } = this.options; if (categoryIds) { - return ['id', 'Int!', categoryIds]; + // return ['id', 'Int!', categoryIds]; + return { + name: 'id', + type: 'Int!', + value: categoryIds + }; } throw new Error(__('There was an error requesting the category')); } - _getChildrenFields() { + _getChildrenFields(): Field { return new Field('children') .addFieldList(this._getDefaultFields()); } - _getBreadcrumbsField() { + _getBreadcrumbsField(): Field { return new Field('breadcrumbs') .addFieldList(this._getBreadcrumbFields()); } - _getBreadcrumbFields() { + _getBreadcrumbFields(): string[] { return [ 'category_name', 'category_level', @@ -60,7 +71,7 @@ export class CategoryQuery { ]; } - _getCmsBlockFields() { + _getCmsBlockFields(): string[] { return [ 'content', 'disabled', @@ -69,12 +80,12 @@ export class CategoryQuery { ]; } - _getCmsBlockField() { + _getCmsBlockField(): Field { return new Field('cms_block') .addFieldList(this._getCmsBlockFields()); } - _getDefaultFields() { + _getDefaultFields(): Array { return [ 'id', 'url', diff --git a/packages/scandipwa/src/query/CheckEmail.query.js b/packages/scandipwa/src/query/CheckEmail.query.ts similarity index 92% rename from packages/scandipwa/src/query/CheckEmail.query.js rename to packages/scandipwa/src/query/CheckEmail.query.ts index 151d0b8cb0..1e542de00d 100644 --- a/packages/scandipwa/src/query/CheckEmail.query.js +++ b/packages/scandipwa/src/query/CheckEmail.query.ts @@ -16,7 +16,7 @@ import { Field } from 'Util/Query'; * @class CheckEmailQuery * @namespace Query/CheckEmail/Query */ export class CheckEmailQuery { - getIsEmailAvailableQuery(email) { + getIsEmailAvailableQuery(email: string): Field { const query = new Field('isEmailAvailable') .addArgument('email', 'String!', email) .addField('is_email_available'); diff --git a/packages/scandipwa/src/query/Checkout.query.js b/packages/scandipwa/src/query/Checkout.query.ts similarity index 78% rename from packages/scandipwa/src/query/Checkout.query.js rename to packages/scandipwa/src/query/Checkout.query.ts index 59509bfff2..e4e6608922 100644 --- a/packages/scandipwa/src/query/Checkout.query.js +++ b/packages/scandipwa/src/query/Checkout.query.ts @@ -9,12 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLS_SetBillingAddressOnCartInput, GQLS_SetPaymentMethodOnCartInput } from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; import { Field } from 'Util/Query'; /** @namespace Query/Checkout/Query */ export class CheckoutQuery { - getPaymentMethodsQuery(guestCartId) { + getPaymentMethodsQuery(guestCartId: string): Field { const query = new Field('getPaymentMethods') .addFieldList(this._getPaymentMethodFields()); @@ -23,7 +24,7 @@ export class CheckoutQuery { return query; } - getSaveGuestEmailMutation(email, cart_id) { + getSaveGuestEmailMutation(email: string, cart_id: string): Field { const input = { email, cart_id }; const mutation = new Field('setGuestEmailOnCart') .addArgument('input', 'SetGuestEmailOnCartInput', input) @@ -32,7 +33,7 @@ export class CheckoutQuery { return mutation; } - getEstimateShippingCosts(address, guestCartId) { + getEstimateShippingCosts(address: string, guestCartId: string): Field { const mutation = new Field('estimateShippingCosts') .addArgument('address', 'EstimateShippingCostsAddress!', address) .addFieldList(this._getEstimatedShippingFields()); @@ -42,7 +43,7 @@ export class CheckoutQuery { return mutation; } - getSaveAddressInformation(addressInformation, guestCartId) { + getSaveAddressInformation(addressInformation: string, guestCartId: string): Field { const mutation = new Field('saveAddressInformation') .addArgument('addressInformation', 'SaveAddressInformation!', addressInformation) .addFieldList(this._getSaveAddressInformationFields()); @@ -52,21 +53,21 @@ export class CheckoutQuery { return mutation; } - getSetBillingAddressOnCart(input) { + getSetBillingAddressOnCart(input: GQLS_SetBillingAddressOnCartInput): Field { return new Field('s_setBillingAddressOnCart') .addArgument('input', 'S_SetBillingAddressOnCartInput!', input) .addField(this._getCartField()) .setAlias('billingAddress'); } - getSetPaymentMethodOnCartMutation(input) { + getSetPaymentMethodOnCartMutation(input: GQLS_SetPaymentMethodOnCartInput): Field { return new Field('s_setPaymentMethodOnCart') .addArgument('input', 'S_SetPaymentMethodOnCartInput!', input) .addField(this._getCartField()) .setAlias('paymentMethod'); } - getPlaceOrderMutation(guestCartId) { + getPlaceOrderMutation(guestCartId: string): Field { const mutation = new Field('s_placeOrder') .setAlias('placeOrder') .addField(this._getOrderField()); @@ -78,25 +79,25 @@ export class CheckoutQuery { return mutation; } - _addGuestCartId(guestCartId, mutation) { + _addGuestCartId(guestCartId: string, mutation: Field): void { if (guestCartId && !isSignedIn()) { mutation.addArgument('guestCartId', 'String!', guestCartId); } } - _getOrderField() { + _getOrderField(): Field { return new Field('order') .addFieldList(['order_id']); } - _getSaveAddressInformationFields() { + _getSaveAddressInformationFields(): Field[] { return [ this._getPaymentMethodsField(), this._getTotalsField() ]; } - _getEstimatedShippingFields() { + _getEstimatedShippingFields(): string[] { return [ 'amount', 'available', @@ -111,16 +112,16 @@ export class CheckoutQuery { ]; } - _getPaymentMethodsField() { + _getPaymentMethodsField(): Field { return new Field('payment_methods') .addFieldList(this._getPaymentMethodFields()); } - _getPaymentMethodFields() { + _getPaymentMethodFields(): string[] { return ['code', 'title']; } - _getTotalItemFields() { + _getTotalItemFields(): string[] { return [ 'qty', 'name', @@ -135,12 +136,12 @@ export class CheckoutQuery { ]; } - _getTotalItemField() { + _getTotalItemField(): Field { return new Field('items') .addFieldList(this._getTotalItemFields()); } - _getTotalsFields() { + _getTotalsFields(): Array { return [ 'subtotal', 'tax_amount', @@ -158,17 +159,17 @@ export class CheckoutQuery { ]; } - _getTotalsField() { + _getTotalsField(): Field { return new Field('totals') .addFieldList(this._getTotalsFields()); } - _getCartField() { + _getCartField(): Field { return new Field('cart') .addFieldList(this._getCartFieldList()); } - _getCartFieldList() { + _getCartFieldList(): string[] { return [ 'id' ]; diff --git a/packages/scandipwa/src/query/CmsBlock.query.js b/packages/scandipwa/src/query/CmsBlock.query.ts similarity index 90% rename from packages/scandipwa/src/query/CmsBlock.query.js rename to packages/scandipwa/src/query/CmsBlock.query.ts index b6b538d015..84bf29f587 100644 --- a/packages/scandipwa/src/query/CmsBlock.query.js +++ b/packages/scandipwa/src/query/CmsBlock.query.ts @@ -22,7 +22,7 @@ export class CmsBlockQuery { * @return {Field} CMS Block query * @memberof CmsBlocksQuery */ - getQuery({ identifiers }) { + getQuery({ identifiers }: { identifiers: string[] }): Field { if (!identifiers) { throw new Error('Missing argument `options`'); } @@ -33,7 +33,7 @@ export class CmsBlockQuery { .setAlias('cmsBlocks'); } - _getItemFields() { + _getItemFields(): string[] { return [ 'title', 'content', @@ -42,7 +42,7 @@ export class CmsBlockQuery { ]; } - _getItemsField() { + _getItemsField(): Field { return new Field('items') .addFieldList(this._getItemFields()); } diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts new file mode 100644 index 0000000000..d1847f167b --- /dev/null +++ b/packages/scandipwa/src/type/Global.type.ts @@ -0,0 +1,50 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { StoreEnhancer } from 'redux'; + +// import { ValidationData } from 'Util/Validator'; + +declare global { + interface Window { + // eslint-disable-next-line @typescript-eslint/naming-convention + '__REACT_DEVTOOLS_GLOBAL_HOOK__'?: Record + // eslint-disable-next-line @typescript-eslint/naming-convention + '__REDUX_DEVTOOLS_EXTENSION__'?: (options: unknown) => StoreEnhancer + storeRegexText: string + actionName?: { + type?: string + } + secure_base_media_url?: string + // dataCache?: Record> + } + + function __(message: string, ...args: unknown[]): string; + + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace React { + interface Component { + __construct?(props: unknown): void + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface ClassAttributes { + block?: string + elem?: string + mods?: Record + mix?: Record + } + } + + // interface HTMLElementEventMap { + // validate: ValidationData + // } +} diff --git a/packages/scandipwa/src/util/Query/index.ts b/packages/scandipwa/src/util/Query/index.ts index 4de72d7a31..7f818c056a 100644 --- a/packages/scandipwa/src/util/Query/index.ts +++ b/packages/scandipwa/src/util/Query/index.ts @@ -10,5 +10,6 @@ */ export * from './PrepareDocument'; +export * from './Query.type'; export { default as Field } from './Field'; export { default as Fragment } from './Fragment'; From 893cd5f15fd2065d3d3580f4c91c76d3dd8d82ec Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Thu, 31 Mar 2022 03:48:14 +0300 Subject: [PATCH 009/192] Migrated some queries --- packages/scandipwa/package.json | 13 ++ .../scandipwa/src/query/Category.query.ts | 4 +- .../{CmsPage.query.js => CmsPage.query.ts} | 12 +- .../{Config.query.js => Config.query.ts} | 22 ++-- ...tactForm.query.js => ContactForm.query.ts} | 11 +- .../{Klarna.query.js => Klarna.query.ts} | 3 +- .../query/{Menu.query.js => Menu.query.ts} | 8 +- ...ery.js => NewsletterSubscription.query.ts} | 4 +- ...Alerts.query.js => ProductAlerts.query.ts} | 2 +- ...mpare.query.js => ProductCompare.query.ts} | 44 +++---- packages/scandipwa/src/query/Query.type.ts | 20 +++ .../{Region.query.js => Region.query.ts} | 8 +- .../{Review.query.js => Review.query.ts} | 15 +-- .../{Slider.query.js => Slider.query.ts} | 10 +- ...PickUp.query.js => StoreInPickUp.query.ts} | 5 +- .../scandipwa/src/query/UrlRewrites.query.ts | 4 +- .../{Wishlist.query.js => Wishlist.query.ts} | 33 ++--- .../util/BrowserDatabase/BrowserDatabase.ts | 2 +- .../src/util/Cart/{Cart.js => Cart.ts} | 119 +++++++++++------- packages/scandipwa/src/util/Cart/Cart.type.ts | 66 ++++++++++ .../src/util/Cart/{Token.js => Token.ts} | 6 +- .../src/util/Cart/{index.js => index.ts} | 0 22 files changed, 266 insertions(+), 145 deletions(-) rename packages/scandipwa/src/query/{CmsPage.query.js => CmsPage.query.ts} (72%) rename packages/scandipwa/src/query/{Config.query.js => Config.query.ts} (90%) rename packages/scandipwa/src/query/{ContactForm.query.js => ContactForm.query.ts} (72%) rename packages/scandipwa/src/query/{Klarna.query.js => Klarna.query.ts} (82%) rename packages/scandipwa/src/query/{Menu.query.js => Menu.query.ts} (88%) rename packages/scandipwa/src/query/{NewsletterSubscription.query.js => NewsletterSubscription.query.ts} (89%) rename packages/scandipwa/src/query/{ProductAlerts.query.js => ProductAlerts.query.ts} (88%) rename packages/scandipwa/src/query/{ProductCompare.query.js => ProductCompare.query.ts} (77%) create mode 100644 packages/scandipwa/src/query/Query.type.ts rename packages/scandipwa/src/query/{Region.query.js => Region.query.ts} (85%) rename packages/scandipwa/src/query/{Review.query.js => Review.query.ts} (79%) rename packages/scandipwa/src/query/{Slider.query.js => Slider.query.ts} (85%) rename packages/scandipwa/src/query/{StoreInPickUp.query.js => StoreInPickUp.query.ts} (85%) rename packages/scandipwa/src/query/{Wishlist.query.js => Wishlist.query.ts} (78%) rename packages/scandipwa/src/util/Cart/{Cart.js => Cart.ts} (55%) create mode 100644 packages/scandipwa/src/util/Cart/Cart.type.ts rename packages/scandipwa/src/util/Cart/{Token.js => Token.ts} (81%) rename packages/scandipwa/src/util/Cart/{index.js => index.ts} (100%) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index a2f9b35510..f5c11ffbd2 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -516,6 +516,19 @@ "filter": "^__$", "leadingUnderscore": "allow" } + ], + "@typescript-eslint/member-delimiter-style": [ + "warn", + { + "multiline": { + "delimiter": "semi", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } + } ] } }, diff --git a/packages/scandipwa/src/query/Category.query.ts b/packages/scandipwa/src/query/Category.query.ts index 5257f6512e..9799d17ae1 100644 --- a/packages/scandipwa/src/query/Category.query.ts +++ b/packages/scandipwa/src/query/Category.query.ts @@ -11,9 +11,7 @@ import { Field, FieldArgument } from 'Util/Query'; -type CategoryQueryOptions = { - categoryIds: number -}; +import { CategoryQueryOptions } from './Query.type'; /** * Category Query diff --git a/packages/scandipwa/src/query/CmsPage.query.js b/packages/scandipwa/src/query/CmsPage.query.ts similarity index 72% rename from packages/scandipwa/src/query/CmsPage.query.js rename to packages/scandipwa/src/query/CmsPage.query.ts index b78a6dd36b..d0a5c825de 100644 --- a/packages/scandipwa/src/query/CmsPage.query.js +++ b/packages/scandipwa/src/query/CmsPage.query.ts @@ -11,18 +11,14 @@ import { Field } from 'Util/Query'; +import { CmsPage } from './Query.type'; + /** * CMS Page Query * @class CmsPageQuery * @namespace Query/CmsPage/Query */ export class CmsPageQuery { - /** - * get CMS Page query - * @param {{url_key: String, title: Int, content: String, content_heading: String, page_layout: String, meta_title: String, meta_description: String, meta_keywords, string}} options A object containing different aspects of query, each item can be omitted - * @return {Query} CMS Page query - * @memberof CmsPageQuery - */ - getQuery({ id, url_key, identifier }) { + getQuery({ id, url_key, identifier }: CmsPage): Field { if (!id && !url_key && !identifier) { throw new Error('Missing argument `id` or `url_key`!'); } @@ -39,7 +35,7 @@ export class CmsPageQuery { return cmsPage; } - _getPageFields() { + _getPageFields(): string[] { return [ 'title', 'content', diff --git a/packages/scandipwa/src/query/Config.query.js b/packages/scandipwa/src/query/Config.query.ts similarity index 90% rename from packages/scandipwa/src/query/Config.query.js rename to packages/scandipwa/src/query/Config.query.ts index eea4ec6dcb..2042846a18 100644 --- a/packages/scandipwa/src/query/Config.query.js +++ b/packages/scandipwa/src/query/Config.query.ts @@ -13,17 +13,17 @@ import { Field } from 'Util/Query'; /** @namespace Query/Config/Query */ export class ConfigQuery { - getStoreListField() { + getStoreListField(): Field { return new Field('storeList') .addFieldList(this._getStoreListFields()); } - getCheckoutAgreements() { + getCheckoutAgreements(): Field { return new Field('checkoutAgreements') .addFieldList(this._getCheckoutAgreementFields()); } - getCurrencyField() { + getCurrencyField(): Field { return new Field('available_currencies_data') .addFieldList([ 'id', @@ -32,7 +32,7 @@ export class ConfigQuery { ]); } - getCurrencyData() { + getCurrencyData(): Field { return new Field('currencyData') .addFieldList([ this.getCurrencyField(), @@ -40,7 +40,7 @@ export class ConfigQuery { ]); } - getPriceDisplayTypeField() { + getPriceDisplayTypeField(): Field { return new Field('priceTaxDisplay') .addFieldList([ 'product_price_display_type', @@ -48,7 +48,7 @@ export class ConfigQuery { ]); } - getSaveSelectedCurrencyMutation(newCurrency) { + getSaveSelectedCurrencyMutation(newCurrency: string): Field { return new Field('saveSelectedCurrency') .addArgument('currency', 'String', newCurrency) .addFieldList([ @@ -56,7 +56,7 @@ export class ConfigQuery { ]); } - _getCheckoutAgreementFields() { + _getCheckoutAgreementFields(): string[] { return [ 'agreement_id', 'checkbox_text', @@ -68,7 +68,7 @@ export class ConfigQuery { ]; } - _getStoreListFields() { + _getStoreListFields(): string[] { return [ 'name', 'is_active', @@ -78,12 +78,12 @@ export class ConfigQuery { ]; } - getQuery() { + getQuery(): Field { return new Field('storeConfig') .addFieldList(this._getStoreConfigFields()); } - _getTimeDateFormatFields() { + _getTimeDateFormatFields(): string[] { return [ 'use_calendar', 'year_range', @@ -92,7 +92,7 @@ export class ConfigQuery { ]; } - _getStoreConfigFields() { + _getStoreConfigFields(): Array { return [ 'code', 'is_active', diff --git a/packages/scandipwa/src/query/ContactForm.query.js b/packages/scandipwa/src/query/ContactForm.query.ts similarity index 72% rename from packages/scandipwa/src/query/ContactForm.query.js rename to packages/scandipwa/src/query/ContactForm.query.ts index f5021ebeba..f5520d0de7 100644 --- a/packages/scandipwa/src/query/ContactForm.query.js +++ b/packages/scandipwa/src/query/ContactForm.query.ts @@ -9,11 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLContactForm } from 'Type/Graphql.type'; import { Field } from 'Util/Query'; /** @namespace Query/ContactForm/Query */ export class ContactFormQuery { - getSendContactFormMutation(options) { + getSendContactFormMutation(options: GQLContactForm): Field { const mutation = new Field('contactForm'); this._addSendContactFormMutationArguments(mutation, options); mutation.addFieldList(this._getSendContactFormMutationResponse()); @@ -21,20 +22,20 @@ export class ContactFormQuery { return mutation; } - getContactPageConfigQuery() { + getContactPageConfigQuery(): Field { return new Field('contactPageConfig') .addFieldList(this._getContactPageConfigFields()); } - _addSendContactFormMutationArguments(mutation, options) { + _addSendContactFormMutationArguments(mutation: Field, options: GQLContactForm): Field { return mutation.addArgument('contact', 'ContactForm!', options); } - _getSendContactFormMutationResponse() { + _getSendContactFormMutationResponse(): string[] { return ['message']; } - _getContactPageConfigFields() { + _getContactPageConfigFields(): string[] { return ['enabled']; } } diff --git a/packages/scandipwa/src/query/Klarna.query.js b/packages/scandipwa/src/query/Klarna.query.ts similarity index 82% rename from packages/scandipwa/src/query/Klarna.query.js rename to packages/scandipwa/src/query/Klarna.query.ts index 95f17890d3..9f5bfbe696 100644 --- a/packages/scandipwa/src/query/Klarna.query.js +++ b/packages/scandipwa/src/query/Klarna.query.ts @@ -9,11 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLKlarnaTokenInput } from 'Type/Graphql.type'; import { Field } from 'Util/Query'; /** @namespace Query/Klarna/Query */ export class KlarnaQuery { - getCreateKlarnaTokenMutation(input) { + getCreateKlarnaTokenMutation(input: GQLKlarnaTokenInput): Field { return new Field('createKlarnaToken') .addArgument('input', 'KlarnaTokenInput!', input) .setAlias('klarnaToken'); diff --git a/packages/scandipwa/src/query/Menu.query.js b/packages/scandipwa/src/query/Menu.query.ts similarity index 88% rename from packages/scandipwa/src/query/Menu.query.js rename to packages/scandipwa/src/query/Menu.query.ts index b4d2d063c0..215b59f444 100644 --- a/packages/scandipwa/src/query/Menu.query.js +++ b/packages/scandipwa/src/query/Menu.query.ts @@ -21,25 +21,25 @@ export class MenuQuery { * @return {Field} Menu query * @memberof MenuQuery */ - getQuery({ identifier }) { + getQuery({ identifier }: { identifier: string }): Field { return new Field('scandiwebMenu') .addArgument('identifier', 'String!', identifier) .addFieldList(this._getMenuFields()) .setAlias('menu'); } - _getMenuFields() { + _getMenuFields(): Array { return [ 'menu_id', 'is_active', 'css_class', this._getMenuItemsField() ]; } - _getMenuItemsField() { + _getMenuItemsField(): Field { return new Field('items') .addFieldList(this._getMenuItemFields()); } - _getMenuItemFields() { + _getMenuItemFields(): string[] { return [ 'url', 'icon', diff --git a/packages/scandipwa/src/query/NewsletterSubscription.query.js b/packages/scandipwa/src/query/NewsletterSubscription.query.ts similarity index 89% rename from packages/scandipwa/src/query/NewsletterSubscription.query.js rename to packages/scandipwa/src/query/NewsletterSubscription.query.ts index 697989f586..812179cee3 100644 --- a/packages/scandipwa/src/query/NewsletterSubscription.query.js +++ b/packages/scandipwa/src/query/NewsletterSubscription.query.ts @@ -16,13 +16,13 @@ import { Field } from 'Util/Query'; * @class NewsletterSubscriptionQuery * @namespace Query/NewsletterSubscription/Query */ export class NewsletterSubscriptionQuery { - getSubscribeToNewsletterMutation(email) { + getSubscribeToNewsletterMutation(email: string): Field { return new Field('subscribeEmailToNewsletter') .addArgument('email', 'String!', email) .addFieldList(this._getPageFields()); } - _getPageFields() { + _getPageFields(): string[] { return [ 'status' ]; diff --git a/packages/scandipwa/src/query/ProductAlerts.query.js b/packages/scandipwa/src/query/ProductAlerts.query.ts similarity index 88% rename from packages/scandipwa/src/query/ProductAlerts.query.js rename to packages/scandipwa/src/query/ProductAlerts.query.ts index f3d01481ab..134a464f37 100644 --- a/packages/scandipwa/src/query/ProductAlerts.query.js +++ b/packages/scandipwa/src/query/ProductAlerts.query.ts @@ -13,7 +13,7 @@ import { Field } from 'Util/Query'; /** @namespace Query/ProductAlerts/Query */ export class ProductAlertsQuery { - getProductAlertSubscribeMutation(productId, type) { + getProductAlertSubscribeMutation(productId: string, type: string): Field { return new Field('productAlertSubscribe') .addArgument('productId', 'ID!', productId) .addArgument('type', 'String!', type); diff --git a/packages/scandipwa/src/query/ProductCompare.query.js b/packages/scandipwa/src/query/ProductCompare.query.ts similarity index 77% rename from packages/scandipwa/src/query/ProductCompare.query.js rename to packages/scandipwa/src/query/ProductCompare.query.ts index 13771db855..f4942769de 100644 --- a/packages/scandipwa/src/query/ProductCompare.query.js +++ b/packages/scandipwa/src/query/ProductCompare.query.ts @@ -14,67 +14,67 @@ import { Field } from 'Util/Query'; /** @namespace Query/ProductCompare/Query */ export class ProductCompareQuery extends ProductListQuery { - getCreateEmptyCompareList() { + getCreateEmptyCompareList(): Field { return new Field('createCompareList') .addArgument('input', 'CreateCompareListInput', {}) .addFieldList(this._getCompareListFields()); } - getCreateCompareList(products) { + getCreateCompareList(products: string[]): Field { return new Field('createCompareList') .addArgument('input', 'CreateCompareListInput', { products }) .addFieldList(this._getCompareListFields()); } - getDeleteCompareList(uid) { + getDeleteCompareList(uid: string): Field { return new Field('deleteCompareList') .addArgument('uid', 'ID!', uid) .addField('result'); } - getAddProductsToCompareList(uid, products) { + getAddProductsToCompareList(uid: string, products: string[]): Field { return new Field('addProductsToCompareList') .addArgument('input', 'AddProductsToCompareListInput', { uid, products }) .addFieldList(this._getCompareListFields()); } - getRemoveProductsFromCompareList(uid, products) { + getRemoveProductsFromCompareList(uid: string, products: string[]): Field { return new Field('removeProductsFromCompareList') .addArgument('input', 'RemoveProductsFromCompareListInput', { uid, products }) .addFieldList(this._getCompareListFields()); } - getAssignCompareList(uid) { + getAssignCompareList(uid: string): Field { return new Field('assignCompareListToCustomer') .addArgument('uid', 'ID!', uid) .addFieldList(this._getAssignFields()); } - _getAssignFields() { + _getAssignFields(): Array { return [ 'result', this._getAssignCompareListField() ]; } - _getAssignCompareListField() { + _getAssignCompareListField(): Field { return new Field('compare_list') .addFieldList(this._getCompareListFields()); } - getCompareList(uid) { + getCompareList(uid: string): Field { return new Field('compareList') .addArgument('uid', 'ID!', uid) .addFieldList(this._getCompareListFields()); } - getCompareListIds(uid) { + getCompareListIds(uid: string): Field { return new Field('compareList') .addArgument('uid', 'ID!', uid) .addField(this._getComparableItemIdsField()); } - _getCompareListFields() { + _getCompareListFields(): Array { return [ 'uid', 'item_count', @@ -85,44 +85,44 @@ export class ProductCompareQuery extends ProductListQuery { ]; } - _getCompareAttributeField() { + _getCompareAttributeField(): Field { return new Field('attributes') .addFieldList(this._getCompareAttributeFields()); } - _getCompareAttributeFields() { + _getCompareAttributeFields(): string[] { return [ 'label', 'code' ]; } - _getComparableItemAttributeField() { + _getComparableItemAttributeField(): Field { return new Field('attributes') .addFieldList(this._getComparableItemAttributeFields()); } - _getComparableItemAttributeFields() { + _getComparableItemAttributeFields(): string[] { return [ 'value', 'code' ]; } - _getComparableItemFields() { + _getComparableItemFields(): Field[] { return [ this._getCompareProductField(), this._getComparableItemAttributeField() ]; } - _getComparableItemIdsFields() { + _getComparableItemIdsFields(): Field[] { return [ this._getProductIdsField() ]; } - _getCompareProductField() { + _getCompareProductField(): Field { return new Field('product') .addFieldList(this._getProductInterfaceFields(true, false)) .addFieldList(['url']) @@ -132,22 +132,22 @@ export class ProductCompareQuery extends ProductListQuery { .addField(this._getGroupedProductItems()); } - _getProductIdsField() { + _getProductIdsField(): Field { return new Field('product') .addFieldList(this._getProductIdsFields()); } - _getComparableItemField() { + _getComparableItemField(): Field { return new Field('items') .addFieldList(this._getComparableItemFields()); } - _getComparableItemIdsField() { + _getComparableItemIdsField(): Field { return new Field('items') .addFieldList(this._getComparableItemIdsFields()); } - _getProductIdsFields() { + _getProductIdsFields(): string[] { return [ 'id' ]; diff --git a/packages/scandipwa/src/query/Query.type.ts b/packages/scandipwa/src/query/Query.type.ts new file mode 100644 index 0000000000..539e4f9bb3 --- /dev/null +++ b/packages/scandipwa/src/query/Query.type.ts @@ -0,0 +1,20 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type CategoryQueryOptions = { + categoryIds: number; +}; + +export type CmsPage = { + id: number; + url_key: string; + identifier: string; +}; diff --git a/packages/scandipwa/src/query/Region.query.js b/packages/scandipwa/src/query/Region.query.ts similarity index 85% rename from packages/scandipwa/src/query/Region.query.js rename to packages/scandipwa/src/query/Region.query.ts index de74727876..a4c43435b5 100644 --- a/packages/scandipwa/src/query/Region.query.js +++ b/packages/scandipwa/src/query/Region.query.ts @@ -16,12 +16,12 @@ import { Field } from 'Util/Query'; * @class RegionQuery * @namespace Query/Region/Query */ export class RegionQuery { - getCountriesQuery() { + getCountriesQuery(): Field { return new Field('countries') .addFieldList(this._getCountryFields()); } - _getCountryFields() { + _getCountryFields(): Array { return [ 'id', 'is_state_required', @@ -30,7 +30,7 @@ export class RegionQuery { ]; } - _getAvailableRegionFields() { + _getAvailableRegionFields(): string[] { return [ 'code', 'name', @@ -38,7 +38,7 @@ export class RegionQuery { ]; } - _getAvailableRegionsField() { + _getAvailableRegionsField(): Field { return new Field('available_regions') .addFieldList(this._getAvailableRegionFields()); } diff --git a/packages/scandipwa/src/query/Review.query.js b/packages/scandipwa/src/query/Review.query.ts similarity index 79% rename from packages/scandipwa/src/query/Review.query.js rename to packages/scandipwa/src/query/Review.query.ts index fc1d72d423..1df2bd8189 100644 --- a/packages/scandipwa/src/query/Review.query.js +++ b/packages/scandipwa/src/query/Review.query.ts @@ -9,35 +9,36 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLCreateProductReviewInput } from 'Type/Graphql.type'; import { Field } from 'Util/Query'; /** @namespace Query/Review/Query */ export class ReviewQuery { - getAddProductReviewMutation(reviewItem) { + getAddProductReviewMutation(reviewItem: GQLCreateProductReviewInput): Field { return new Field('createProductReview') .setAlias('addProductReview') .addArgument('input', 'CreateProductReviewInput!', reviewItem) .addField(new Field('review').addField('nickname')); } - getRatingQuery() { + getRatingQuery(): Field { return new Field('productReviewRatingsMetadata') .setAlias('reviewRatings') .addFieldList(this._getRatingFields()); } - _getRatingFields() { + _getRatingFields(): Field[] { return [ this._getRatingItemsField() ]; } - _getRatingItemsField() { + _getRatingItemsField(): Field { return new Field('items') .addFieldList(this._getRatingItemsFields()); } - _getRatingItemsFields() { + _getRatingItemsFields(): Field[] { return [ new Field('id').setAlias('rating_id'), new Field('name').setAlias('rating_code'), @@ -45,14 +46,14 @@ export class ReviewQuery { ]; } - _getRatingOptionFields() { + _getRatingOptionFields(): Array { return [ new Field('value_id').setAlias('option_id'), 'value' ]; } - _getRatingOptionsField() { + _getRatingOptionsField(): Field { return new Field('values') .setAlias('rating_options') .addFieldList(this._getRatingOptionFields()); diff --git a/packages/scandipwa/src/query/Slider.query.js b/packages/scandipwa/src/query/Slider.query.ts similarity index 85% rename from packages/scandipwa/src/query/Slider.query.js rename to packages/scandipwa/src/query/Slider.query.ts index 6c0ac1fc9b..d64ca169e4 100644 --- a/packages/scandipwa/src/query/Slider.query.js +++ b/packages/scandipwa/src/query/Slider.query.ts @@ -16,7 +16,7 @@ import { Field } from 'Util/Query'; * @class Slider * @namespace Query/Slider/Query */ export class SliderQuery { - getQuery(options) { + getQuery(options: { sliderId: string }): Field { const { sliderId } = options; return new Field('scandiwebSlider') @@ -25,7 +25,7 @@ export class SliderQuery { .setAlias('slider'); } - _getSliderFields() { + _getSliderFields(): Array { return [ this._getSlidesField(), this._getSlideSpeedField(), @@ -34,7 +34,7 @@ export class SliderQuery { ]; } - _getSlideFields() { + _getSlideFields(): string[] { return [ 'slide_text', 'slide_id', @@ -45,12 +45,12 @@ export class SliderQuery { ]; } - _getSlidesField() { + _getSlidesField(): Field { return new Field('slides') .addFieldList(this._getSlideFields()); } - _getSlideSpeedField() { + _getSlideSpeedField(): Field { return new Field('slide_speed').setAlias('slideSpeed'); } } diff --git a/packages/scandipwa/src/query/StoreInPickUp.query.js b/packages/scandipwa/src/query/StoreInPickUp.query.ts similarity index 85% rename from packages/scandipwa/src/query/StoreInPickUp.query.js rename to packages/scandipwa/src/query/StoreInPickUp.query.ts index 1787da279c..bc8e93afe1 100755 --- a/packages/scandipwa/src/query/StoreInPickUp.query.js +++ b/packages/scandipwa/src/query/StoreInPickUp.query.ts @@ -9,11 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLProductInfoInput } from 'Type/Graphql.type'; import { Field } from 'Util/Query'; /** @namespace Query/StoreInPickUp/Query */ export class StoreInPickUpQuery { - getStores(country, search = '', productsInfo) { + getStores(country: string, search = '', productsInfo?: GQLProductInfoInput): Field { return new Field('getStores') .addFieldList([this.getStoreFields()]) .addArgument('search', 'String', search) @@ -21,7 +22,7 @@ export class StoreInPickUpQuery { .addArgument('productsInfo', '[ProductInfoInput]', productsInfo); } - getStoreFields() { + getStoreFields(): Field { return new Field('stores') .addFieldList([ 'city', diff --git a/packages/scandipwa/src/query/UrlRewrites.query.ts b/packages/scandipwa/src/query/UrlRewrites.query.ts index b58a4c814d..abe9767464 100644 --- a/packages/scandipwa/src/query/UrlRewrites.query.ts +++ b/packages/scandipwa/src/query/UrlRewrites.query.ts @@ -10,14 +10,14 @@ */ import { Field, Query } from '@tilework/opus'; -import { UrlRewriteType } from 'Type/Router.type'; +import { UrlRewrite } from 'Type/Router.type'; /** * UrlRewrites Query * @class UrlRewritesQuery * @namespace Query/UrlRewrites/Query */ export class UrlRewritesQuery { - getQuery({ urlParam }: { urlParam: string }): UrlRewriteType { + getQuery({ urlParam }: { urlParam: string }): UrlRewrite { return new Query('urlResolver') .addArgument('url', 'String!', urlParam) .addFieldList(this._getUrlResolverFields()); diff --git a/packages/scandipwa/src/query/Wishlist.query.js b/packages/scandipwa/src/query/Wishlist.query.ts similarity index 78% rename from packages/scandipwa/src/query/Wishlist.query.js rename to packages/scandipwa/src/query/Wishlist.query.ts index 84c59ed7e7..340c3af5af 100644 --- a/packages/scandipwa/src/query/Wishlist.query.js +++ b/packages/scandipwa/src/query/Wishlist.query.ts @@ -11,6 +11,7 @@ */ import ProductListQuery from 'Query/ProductList.query'; +import { GQLShareWishlistInput, GQLWishlistItemInput, GQLWishlistItemUpdateInput } from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; import { getGuestQuoteId } from 'Util/Cart'; import { Field } from 'Util/Query'; @@ -18,14 +19,14 @@ import { Field } from 'Util/Query'; /** @namespace Query/Wishlist/Query */ export class WishlistQuery { //#region MUTATION - addProductsToWishlist(wishlistId, wishlistItems) { + addProductsToWishlist(wishlistId: string, wishlistItems: GQLWishlistItemInput[]): Field { return new Field('addProductsToWishlist') .addArgument('wishlistId', 'ID!', wishlistId) .addArgument('wishlistItems', '[WishlistItemInput!]!', wishlistItems) .addField(this._getWishlistErrorsField()); } - updateProductsInWishlist(wishlistId, wishlistItems) { + updateProductsInWishlist(wishlistId: string, wishlistItems: GQLWishlistItemUpdateInput): Field { return new Field('updateProductsInWishlist') .addArgument('wishlistId', 'ID!', wishlistId) .addArgument('wishlistItems', '[WishlistItemUpdateInput!]!', wishlistItems) @@ -34,20 +35,20 @@ export class WishlistQuery { //#endregion //#region ERROR - _getWishlistErrorsFields() { + _getWishlistErrorsFields(): string[] { return [ 'message', 'code' ]; } - _getWishlistErrorsField() { + _getWishlistErrorsField(): Field { return new Field('user_errors') .addFieldList(this._getWishlistErrorsFields()); } //#endregion - getWishlistQuery(sharingCode) { + getWishlistQuery(sharingCode: string): Field { const field = new Field('s_wishlist') .setAlias('wishlist') .addFieldList(this._getWishlistFields()); @@ -59,18 +60,18 @@ export class WishlistQuery { return field; } - getShareWishlistMutation(input) { + getShareWishlistMutation(input: GQLShareWishlistInput): Field { return new Field('s_shareWishlist') .setAlias('shareWishlist') .addArgument('input', 'ShareWishlistInput!', input); } - getClearWishlist() { + getClearWishlist(): Field { return new Field('s_clearWishlist') .setAlias('clearWishlist'); } - getMoveWishlistToCart(sharingCode) { + getMoveWishlistToCart(sharingCode: string): Field { const field = new Field('s_moveWishlistToCart') .setAlias('moveWishlistToCart'); @@ -86,13 +87,13 @@ export class WishlistQuery { return field; } - getRemoveProductFromWishlistMutation(item_id) { + getRemoveProductFromWishlistMutation(item_id: string): Field { return new Field('s_removeProductFromWishlist') .setAlias('removeProductFromWishlist') .addArgument('itemId', 'ID!', item_id); } - _getWishlistFields() { + _getWishlistFields(): Array { return [ 'id', 'updated_at', @@ -102,19 +103,19 @@ export class WishlistQuery { ]; } - _getItemOptionsFields() { + _getItemOptionsFields(): string[] { return [ 'label', 'value' ]; } - _getItemOptionsField() { + _getItemOptionsField(): Field { return new Field('options') .addFieldList(this._getItemOptionsFields()); } - _getWishlistItemsFields() { + _getWishlistItemsFields(): Array { return [ 'id', 'sku', @@ -127,19 +128,19 @@ export class WishlistQuery { ]; } - _getItemsFields() { + _getItemsFields(): Array { return [ ...this._getWishlistItemsFields(), this._getProductField() ]; } - _getProductField() { + _getProductField(): Field { return new Field('product') .addFieldList(ProductListQuery._getProductInterfaceFields(false, false, true)); } - _getItemsField() { + _getItemsField(): Field { return new Field('items') .addFieldList(this._getItemsFields()); } diff --git a/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts b/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts index 8121c2e0c5..854c6a6a5e 100644 --- a/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts +++ b/packages/scandipwa/src/util/BrowserDatabase/BrowserDatabase.ts @@ -49,7 +49,7 @@ export class BrowserDatabase { * @return {Void} * @memberof BrowserDatabase */ - setItem(data: T, location: string, expiration: number): void { + setItem(data: T, location: string, expiration?: number): void { localStorage.setItem(location, JSON.stringify({ data, expiration, diff --git a/packages/scandipwa/src/util/Cart/Cart.js b/packages/scandipwa/src/util/Cart/Cart.ts similarity index 55% rename from packages/scandipwa/src/util/Cart/Cart.js rename to packages/scandipwa/src/util/Cart/Cart.ts index 17ca7ffcc3..31264a08bb 100644 --- a/packages/scandipwa/src/util/Cart/Cart.js +++ b/packages/scandipwa/src/util/Cart/Cart.ts @@ -10,34 +10,42 @@ */ import { - DISPLAY_SHIPPING_PRICES_BOTH, - DISPLAY_SHIPPING_PRICES_EXCL_TAX -} from 'Component/CheckoutDeliveryOption/CheckoutDeliveryOption.config'; - + CartItem, + CartItemPriceProps, + CartState, + DisplayCartTaxInPrice, + DisplayCartTaxInShipping, + DisplayCartTaxInSubTotal, + DisplayShippingPrices +} from './Cart.type'; + +// ! TODO remove this when migrate components to TS export const DISPLAY_CART_TAX_IN_SUBTOTAL = { - INCL_TAX: 'DISPLAY_CART_TAX_IN_SUBTOTAL_INCL_TAX', - EXCL_TAX: 'DISPLAY_CART_TAX_IN_SUBTOTAL_EXL_TAX', - BOTH: 'DISPLAY_CART_TAX_IN_SUBTOTAL_BOTH' + INCL_TAX: DisplayCartTaxInSubTotal.INCL_TAX, + EXCL_TAX: DisplayCartTaxInSubTotal.EXCL_TAX, + BOTH: DisplayCartTaxInSubTotal.BOTH }; +// ! TODO remove this when migrate components to TS export const DISPLAY_CART_TAX_IN_SHIPPING = { - INCL_TAX: 'DISPLAY_CART_TAX_IN_SHIPPING_INCL_TAX', - EXCL_TAX: 'DISPLAY_CART_TAX_IN_SHIPPING_EXL_TAX', - BOTH: 'DISPLAY_CART_TAX_IN_SHIPPING_BOTH' + INCL_TAX: DisplayCartTaxInShipping.INCL_TAX, + EXCL_TAX: DisplayCartTaxInShipping.EXCL_TAX, + BOTH: DisplayCartTaxInShipping.BOTH }; +// ! TODO remove this when migrate components to TS export const DISPLAY_CART_TAX_IN_PRICE = { - INCL_TAX: 'DISPLAY_CART_TAX_IN_PRICE_INCL_TAX', - EXCL_TAX: 'DISPLAY_CART_TAX_IN_PRICE_EXL_TAX', - BOTH: 'DISPLAY_CART_TAX_IN_PRICE_BOTH' + INCL_TAX: DisplayCartTaxInPrice.INCL_TAX, + EXCL_TAX: DisplayCartTaxInPrice.EXCL_TAX, + BOTH: DisplayCartTaxInPrice.BOTH }; /** @namespace Util/Cart/getCartSubtotal */ -export const getCartSubtotal = (state) => { +export const getCartSubtotal = (state: CartState): number => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_subtotal + display_tax_in_subtotal = '' } = {} } = {}, CartReducer: { @@ -48,7 +56,7 @@ export const getCartSubtotal = (state) => { } = {} } = state; - if (display_tax_in_subtotal === DISPLAY_CART_TAX_IN_SUBTOTAL.EXCL_TAX) { + if (display_tax_in_subtotal === DisplayCartTaxInSubTotal.EXCL_TAX) { return subtotal; } @@ -56,11 +64,11 @@ export const getCartSubtotal = (state) => { }; /** @namespace Util/Cart/getCartSubtotalSubPrice */ -export const getCartSubtotalSubPrice = (state) => { +export const getCartSubtotalSubPrice = (state: CartState): number | null => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_subtotal + display_tax_in_subtotal = '' } = {} } = {}, CartReducer: { @@ -70,7 +78,7 @@ export const getCartSubtotalSubPrice = (state) => { } = {} } = state; - if (display_tax_in_subtotal === DISPLAY_CART_TAX_IN_SUBTOTAL.BOTH) { + if (display_tax_in_subtotal === DisplayCartTaxInSubTotal.BOTH) { return subtotal; } @@ -78,11 +86,11 @@ export const getCartSubtotalSubPrice = (state) => { }; /** @namespace Util/Cart/getCartItemPrice */ -export const getCartItemPrice = (state) => (props) => { +export const getCartItemPrice = (state: CartState) => (props: CartItemPriceProps): number => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_price + display_tax_in_price = '' } = {} } = {} } = state; @@ -92,7 +100,7 @@ export const getCartItemPrice = (state) => (props) => { row_total_incl_tax = 0 } = props; - if (display_tax_in_price === DISPLAY_CART_TAX_IN_PRICE.EXCL_TAX) { + if (display_tax_in_price === DisplayCartTaxInPrice.EXCL_TAX) { return row_total; } @@ -100,11 +108,11 @@ export const getCartItemPrice = (state) => (props) => { }; /** @namespace Util/Cart/getCartItemSubPrice */ -export const getCartItemSubPrice = (state) => (props) => { +export const getCartItemSubPrice = (state: CartState) => (props: CartItemPriceProps): number | null => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_price + display_tax_in_price = '' } = {} } = {} } = state; @@ -113,7 +121,7 @@ export const getCartItemSubPrice = (state) => (props) => { row_total = 0 } = props; - if (display_tax_in_price === DISPLAY_CART_TAX_IN_PRICE.BOTH) { + if (display_tax_in_price === DisplayCartTaxInPrice.BOTH) { return row_total; } @@ -121,11 +129,11 @@ export const getCartItemSubPrice = (state) => (props) => { }; /** @namespace Util/Cart/getCartShippingPrice */ -export const getCartShippingPrice = (state) => { +export const getCartShippingPrice = (state: CartState): number => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_shipping_amount + display_tax_in_shipping_amount = '' } = {} } = {}, CartReducer: { @@ -136,7 +144,7 @@ export const getCartShippingPrice = (state) => { } = {} } = state; - if (display_tax_in_shipping_amount === DISPLAY_CART_TAX_IN_SHIPPING.EXCL_TAX) { + if (display_tax_in_shipping_amount === DisplayCartTaxInShipping.EXCL_TAX) { return shipping_amount; } @@ -144,11 +152,11 @@ export const getCartShippingPrice = (state) => { }; /** @namespace Util/Cart/getCartShippingSubPrice */ -export const getCartShippingSubPrice = (state) => { +export const getCartShippingSubPrice = (state: CartState): number | null => { const { ConfigReducer: { cartDisplayConfig: { - display_tax_in_shipping_amount + display_tax_in_shipping_amount = '' } = {} } = {}, CartReducer: { @@ -158,7 +166,7 @@ export const getCartShippingSubPrice = (state) => { } = {} } = state; - if (display_tax_in_shipping_amount === DISPLAY_CART_TAX_IN_SHIPPING.BOTH) { + if (display_tax_in_shipping_amount === DisplayCartTaxInShipping.BOTH) { return shipping_amount; } @@ -166,11 +174,11 @@ export const getCartShippingSubPrice = (state) => { }; /** @namespace Util/Cart/getCartShippingItemPrice */ -export const getCartShippingItemPrice = (state) => (props) => { +export const getCartShippingItemPrice = (state: CartState) => (props: CartItemPriceProps): number => { const { ConfigReducer: { priceTaxDisplay: { - shipping_price_display_type + shipping_price_display_type = '' } = {} } = {} } = state; @@ -180,7 +188,7 @@ export const getCartShippingItemPrice = (state) => (props) => { price_excl_tax = 0 } = props; - if (shipping_price_display_type === DISPLAY_SHIPPING_PRICES_EXCL_TAX) { + if (shipping_price_display_type === DisplayShippingPrices.EXCL_TAX) { return price_excl_tax; } @@ -188,11 +196,11 @@ export const getCartShippingItemPrice = (state) => (props) => { }; /** @namespace Util/Cart/getCartShippingItemSubPrice */ -export const getCartShippingItemSubPrice = (state) => (props) => { +export const getCartShippingItemSubPrice = (state: CartState) => (props: CartItemPriceProps): number | null => { const { ConfigReducer: { priceTaxDisplay: { - shipping_price_display_type + shipping_price_display_type = '' } = {} } = {} } = state; @@ -201,7 +209,7 @@ export const getCartShippingItemSubPrice = (state) => (props) => { price_excl_tax = 0 } = props; - if (shipping_price_display_type === DISPLAY_SHIPPING_PRICES_BOTH) { + if (shipping_price_display_type === DisplayShippingPrices.BOTH) { return price_excl_tax; } @@ -209,11 +217,11 @@ export const getCartShippingItemSubPrice = (state) => (props) => { }; /** @namespace Util/Cart/getCartTotalSubPrice */ -export const getCartTotalSubPrice = (state) => { +export const getCartTotalSubPrice = (state: CartState): number | null => { const { ConfigReducer: { cartDisplayConfig: { - include_tax_in_order_total + include_tax_in_order_total = '' } = {} } = {}, CartReducer: { @@ -232,29 +240,44 @@ export const getCartTotalSubPrice = (state) => { }; /** @namespace Util/Cart/getItemsCountLabel */ -export const getItemsCountLabel = (items_qty) => (items_qty === 1 ? __('1 item') : __('%s items', items_qty || 0)); +export const getItemsCountLabel = (items_qty: number): string => ( + items_qty === 1 + ? __('1 item') + : __('%s items', items_qty || 0) +); /** @namespace Util/Cart/getAllCartItemsSku */ -export const getAllCartItemsSku = (cartItems) => cartItems.reduce((acc, item) => { - acc.push({ sku: item.sku }); - - return acc; -}, []); +export const getAllCartItemsSku = ( + cartItems: CartItem[] +): Array<{ sku: string }> => cartItems.reduce( + (acc, item) => { + acc.push({ sku: item.sku || '' }); + + return acc; + }, + [] as Array<{ sku: string }> +); /** @namespace Util/Cart/trimCrossSellDuplicateItems */ -export const trimCrossSellDuplicateItems = (items) => items.filter( +export const trimCrossSellDuplicateItems = (items: CartItem[]): CartItem[] => items.filter( ({ sku: itemSku, product: { variants: itemVariants, id: itemId } }, index, array) => { - if (!index || !itemVariants.length) { + if (!index || !itemVariants?.length) { return true; } + const foundItem = array.find(({ product: { id: elementId } }) => elementId === itemId); + + if (!foundItem) { + return false; + } + const { sku: duplicateSku, product: { id: duplicateId } - } = array.find(({ product: { id: elementId } }) => elementId === itemId); + } = foundItem; return (duplicateId === itemId && duplicateSku === itemSku); } diff --git a/packages/scandipwa/src/util/Cart/Cart.type.ts b/packages/scandipwa/src/util/Cart/Cart.type.ts new file mode 100644 index 0000000000..ef9263f780 --- /dev/null +++ b/packages/scandipwa/src/util/Cart/Cart.type.ts @@ -0,0 +1,66 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { + GQLCartDisplayConfig, GQLConfigurableProduct, GQLPriceTaxDisplay, GQLQuoteData +} from 'Type/Graphql.type'; + +// ! TODO move reducer types when we start work with redux! + +export type ConfigReducerState = { + cartDisplayConfig: GQLCartDisplayConfig; + priceTaxDisplay: GQLPriceTaxDisplay; +}; + +export type CartReducerState = { + cartTotals: GQLQuoteData; +}; + +export type CartState = { + ConfigReducer: ConfigReducerState; + CartReducer: CartReducerState; +}; + +export type CartItem = { + sku: string; + product: GQLConfigurableProduct; +}; + +export type CartItemPriceProps = { + row_total: number; + row_total_incl_tax: number; + price_incl_tax: number; + price_excl_tax: number; +}; + +export enum DisplayCartTaxInSubTotal { + INCL_TAX = 'DISPLAY_CART_TAX_IN_SUBTOTAL_INCL_TAX', + EXCL_TAX = 'DISPLAY_CART_TAX_IN_SUBTOTAL_EXL_TAX', + BOTH = 'DISPLAY_CART_TAX_IN_SUBTOTAL_BOTH' +} + +export enum DisplayCartTaxInShipping { + INCL_TAX = 'DISPLAY_CART_TAX_IN_SHIPPING_INCL_TAX', + EXCL_TAX = 'DISPLAY_CART_TAX_IN_SHIPPING_EXL_TAX', + BOTH = 'DISPLAY_CART_TAX_IN_SHIPPING_BOTH' +} + +export enum DisplayCartTaxInPrice { + INCL_TAX = 'DISPLAY_CART_TAX_IN_PRICE_INCL_TAX', + EXCL_TAX = 'DISPLAY_CART_TAX_IN_PRICE_EXL_TAX', + BOTH = 'DISPLAY_CART_TAX_IN_PRICE_BOTH' +} + +export enum DisplayShippingPrices { + INCL_TAX = 'DISPLAY_SHIPPING_PRICES_INCL_TAX', + EXCL_TAX = 'DISPLAY_SHIPPING_PRICES_EXCL_TAX', + BOTH = 'DISPLAY_SHIPPING_PRICES_BOTH' +} diff --git a/packages/scandipwa/src/util/Cart/Token.js b/packages/scandipwa/src/util/Cart/Token.ts similarity index 81% rename from packages/scandipwa/src/util/Cart/Token.js rename to packages/scandipwa/src/util/Cart/Token.ts index a68469b478..11b1897eab 100644 --- a/packages/scandipwa/src/util/Cart/Token.js +++ b/packages/scandipwa/src/util/Cart/Token.ts @@ -15,7 +15,7 @@ import BrowserDatabase from 'Util/BrowserDatabase'; export const GUEST_QUOTE_ID = 'guest_quote_id'; /** @namespace Util/Cart/Token/setGuestQuoteId */ -export const setGuestQuoteId = (token) => { +export const setGuestQuoteId = (token: string): void => { BrowserDatabase.setItem({ token, isCustomerToken: isSignedIn() @@ -23,7 +23,7 @@ export const setGuestQuoteId = (token) => { }; /** @namespace Util/Cart/Token/getGuestQuoteId */ -export const getGuestQuoteId = () => { +export const getGuestQuoteId = (): string | null => { const { token, isCustomerToken @@ -37,4 +37,4 @@ export const getGuestQuoteId = () => { }; /** @namespace Util/Cart/Token/deleteGuestQuoteId */ -export const deleteGuestQuoteId = () => BrowserDatabase.deleteItem(GUEST_QUOTE_ID); +export const deleteGuestQuoteId = (): void => BrowserDatabase.deleteItem(GUEST_QUOTE_ID); diff --git a/packages/scandipwa/src/util/Cart/index.js b/packages/scandipwa/src/util/Cart/index.ts similarity index 100% rename from packages/scandipwa/src/util/Cart/index.js rename to packages/scandipwa/src/util/Cart/index.ts From 659dcec61f89169a8a9e692894d5f141dce68958 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Fri, 1 Apr 2022 00:47:33 +0300 Subject: [PATCH 010/192] Migrated some utils to TypesScript --- .../MyAccountAddressForm.component.js | 5 +- .../scandipwa/src/query/ProductList.query.js | 2 +- packages/scandipwa/src/type/Account.type.ts | 20 ++++- packages/scandipwa/src/type/Category.type.ts | 21 +++++ packages/scandipwa/src/type/Config.type.ts | 4 + packages/scandipwa/src/type/Global.type.ts | 31 +++++++ packages/scandipwa/src/type/Menu.type.ts | 10 ++- .../src/util/Address/{index.js => index.ts} | 84 ++++++------------- .../util/Browser/{Browser.js => Browser.ts} | 10 +-- .../src/util/Browser/{index.js => index.ts} | 0 .../scandipwa/src/util/CSS/{CSS.js => CSS.ts} | 10 +-- .../src/util/CSS/{index.js => index.ts} | 0 .../src/util/Cache/{Cache.js => Cache.ts} | 2 +- .../util/Category/{Filters.js => Filters.ts} | 4 +- .../src/util/Category/{index.js => index.ts} | 0 .../src/util/Common/{index.js => index.ts} | 4 +- .../util/Compare/{Compare.js => Compare.ts} | 6 +- .../src/util/Compare/{index.js => index.ts} | 0 .../Currency/{Currency.js => Currency.ts} | 4 +- .../src/util/Currency/{index.js => index.ts} | 0 .../src/util/DynamicReducer/index.js | 1 - .../{index.js => index.ts} | 6 +- .../src/util/History/{index.js => index.ts} | 0 .../util/Manipulations/{Array.js => Array.ts} | 2 +- .../util/Manipulations/{Date.js => Date.ts} | 8 +- .../util/Manipulations/{index.js => index.ts} | 0 .../src/util/Media/{Media.js => Media.ts} | 2 +- .../src/util/Media/{index.js => index.ts} | 0 .../src/util/Menu/{index.js => index.ts} | 0 .../src/util/Mobile/{index.js => index.ts} | 0 .../util/Mobile/{isMobile.js => isMobile.ts} | 0 31 files changed, 136 insertions(+), 100 deletions(-) rename packages/scandipwa/src/util/Address/{index.js => index.ts} (74%) rename packages/scandipwa/src/util/Browser/{Browser.js => Browser.ts} (83%) rename packages/scandipwa/src/util/Browser/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/CSS/{CSS.js => CSS.ts} (77%) rename packages/scandipwa/src/util/CSS/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Cache/{Cache.js => Cache.ts} (97%) rename packages/scandipwa/src/util/Category/{Filters.js => Filters.ts} (74%) rename packages/scandipwa/src/util/Category/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Common/{index.js => index.ts} (88%) rename packages/scandipwa/src/util/Compare/{Compare.js => Compare.ts} (91%) rename packages/scandipwa/src/util/Compare/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Currency/{Currency.js => Currency.ts} (89%) rename packages/scandipwa/src/util/Currency/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/FormPortalCollector/{index.js => index.ts} (87%) rename packages/scandipwa/src/util/History/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Manipulations/{Array.js => Array.ts} (87%) rename packages/scandipwa/src/util/Manipulations/{Date.js => Date.ts} (82%) rename packages/scandipwa/src/util/Manipulations/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Media/{Media.js => Media.ts} (89%) rename packages/scandipwa/src/util/Media/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Menu/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Mobile/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Mobile/{isMobile.js => isMobile.ts} (100%) diff --git a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js index 93ed4ca0e1..6fae4bd548 100644 --- a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js +++ b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js @@ -16,9 +16,6 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import FieldForm from 'Component/FieldForm'; import { Addresstype } from 'Type/Account.type'; import { CountriesType } from 'Type/Config.type'; -import { - trimCustomerAddress -} from 'Util/Address'; import transformToNameValuePair from 'Util/Form/Transform'; import myAccountAddressForm from './MyAccountAddressForm.form'; @@ -131,7 +128,7 @@ export class MyAccountAddressForm extends FieldForm { newAddress.region = { region_id: +region_id, region }; // Filters out non-required options and save address - onSave(trimCustomerAddress(newAddress)); + onSave(newAddress); } //#region RENDERERS diff --git a/packages/scandipwa/src/query/ProductList.query.js b/packages/scandipwa/src/query/ProductList.query.js index f808a37841..ea0a57ca52 100644 --- a/packages/scandipwa/src/query/ProductList.query.js +++ b/packages/scandipwa/src/query/ProductList.query.js @@ -380,7 +380,7 @@ export class ProductListQuery { /** * A GroupedProduct-specific field that queries the products that are grouped under this product * @returns {Field} - * @private + * @protected */ _getGroupedProductItems() { return new Fragment('GroupedProduct').addField( diff --git a/packages/scandipwa/src/type/Account.type.ts b/packages/scandipwa/src/type/Account.type.ts index a00750830d..8cf68f8824 100644 --- a/packages/scandipwa/src/type/Account.type.ts +++ b/packages/scandipwa/src/type/Account.type.ts @@ -43,11 +43,11 @@ export type Address = { city: string company: string | null country_id: string - customer_id: number + customer_id?: number default_billing: boolean default_shipping: boolean firstname: string - id: number + id?: number lastname: string middlename: string postcode: string @@ -61,6 +61,22 @@ export type Address = { export type Addresses = Address[]; +export type TrimmedAddress = { + city: string + company: string | null + country_id: string | number + firstname: string + lastname: string + postcode: string + region?: string | null + region_string?: string | null + region_id: number | string + region_code: string | null + street: string | string[] + telephone: string + vat_id: number | null +} + export type Customer = { addresses: Addresses created_at: string diff --git a/packages/scandipwa/src/type/Category.type.ts b/packages/scandipwa/src/type/Category.type.ts index a90521a837..beb6bfdf4c 100644 --- a/packages/scandipwa/src/type/Category.type.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -56,3 +56,24 @@ export type SortFields = { value?: string; }[]; } + +export type FilterItems = { + count?: number; + label?: string; + swatch_data?: { + type?: string; + value?: string + } + value: string +} + +export type CategoryFilter = { + has_swatch?: boolean; + is_boolean?: boolean; + name?: string; + position?: number + request_var?: string + filter_items?: FilterItems[] +} + +export type CategoryFilters = CategoryFilter[] \ No newline at end of file diff --git a/packages/scandipwa/src/type/Config.type.ts b/packages/scandipwa/src/type/Config.type.ts index 630fbb4254..a78a0f9b0f 100644 --- a/packages/scandipwa/src/type/Config.type.ts +++ b/packages/scandipwa/src/type/Config.type.ts @@ -15,6 +15,8 @@ export type Region = { id?: number; } +export type Regions = Region[] + export type Countries = { label?: string; id?: string; @@ -37,3 +39,5 @@ export type StoreItem = { storeLinkUrl?: string; label?: string; } + +export type Stores = StoreItem[]; \ No newline at end of file diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index d1847f167b..dca06fdef4 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -24,6 +24,7 @@ declare global { type?: string } secure_base_media_url?: string + prefetchedImages: Record // dataCache?: Record> } @@ -44,6 +45,36 @@ declare global { } } + interface Navigator { + userAgentData: NavigatorUAData; + } + + interface NavigatorUABrandVersion { + brand: string; + version: string; + } + + interface UADataValues { + brands?: NavigatorUABrandVersion[]; + mobile?: boolean; + platform?: string; + architecture?: string; + bitness?: string; + model?: string; + platformVersion?: string; + uaFullVersion?: string; + } + interface UALowEntropyJSON { + brands: NavigatorUABrandVersion[]; + mobile: boolean; + platform: string; + } + + interface NavigatorUAData extends UALowEntropyJSON { + getHighEntropyValues(hints: string[]): Promise; + toJSON(): UALowEntropyJSON; + } + // interface HTMLElementEventMap { // validate: ValidationData // } diff --git a/packages/scandipwa/src/type/Menu.type.ts b/packages/scandipwa/src/type/Menu.type.ts index c4b0e3ae78..dc925f339c 100644 --- a/packages/scandipwa/src/type/Menu.type.ts +++ b/packages/scandipwa/src/type/Menu.type.ts @@ -12,10 +12,10 @@ import { Location } from 'Type/Router.type'; export type MenuItem = { - item_id?: string; + item_id: string; is_active?: boolean; - parent_id?: number; - position?: number; + parent_id: number; + position: number; title?: string; item_class?: string; icon?: string; @@ -24,9 +24,11 @@ export type MenuItem = { category_id?: number; } +export type MenuItems = MenuItem[]; + export type Menu = { menu_id?: string; is_active?: boolean; css_class?: string; - items?: MenuItem[]; + items?: MenuItems; } diff --git a/packages/scandipwa/src/util/Address/index.js b/packages/scandipwa/src/util/Address/index.ts similarity index 74% rename from packages/scandipwa/src/util/Address/index.js rename to packages/scandipwa/src/util/Address/index.ts index a5a3335165..8a274c6658 100644 --- a/packages/scandipwa/src/util/Address/index.js +++ b/packages/scandipwa/src/util/Address/index.ts @@ -9,55 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -/** @namespace Util/Address/Index/trimCustomerAddress */ -export const trimCustomerAddress = (customerAddress) => { - const { - default_shipping = false, - default_billing = false, - company = null, - city = '', - country_id = 1, - firstname = '', - lastname = '', - middlename = '', - postcode = '', - street = [''], - telephone = '', - region: { - region_code = null, - region = null, - region_id = 1 - } = {}, - prefix = '', - suffix = '', - vat_id = null - } = customerAddress; - - return { - company, - default_shipping, - default_billing, - city, - country_id, - firstname, - lastname, - middlename, - postcode, - street, - telephone, - region: { - region_code, - region, - region_id - }, - prefix, - suffix, - vat_id - }; -}; +import StoreItem from 'Component/StoreItem'; +import { Address, TrimmedAddress } from 'Type/Account.type'; +import { Countries, Regions, Stores } from 'Type/Config.type'; /** @namespace Util/Address/Index/trimCheckoutCustomerAddress */ -export const trimCheckoutCustomerAddress = (customerAddress) => { +export const trimCheckoutCustomerAddress = (customerAddress: Address): TrimmedAddress => { const { company = null, city = '', @@ -92,11 +49,11 @@ export const trimCheckoutCustomerAddress = (customerAddress) => { }; /** @namespace Util/Address/Index/trimCheckoutAddress */ -export const trimCheckoutAddress = (customerAddress) => { +export const trimCheckoutAddress = (customerAddress: TrimmedAddress): TrimmedAddress => { const { company = null, city = '', - country_id = 1, + country_id = '1', firstname = '', lastname = '', postcode = '', @@ -130,14 +87,15 @@ export const trimCheckoutAddress = (customerAddress) => { * @returns {*} * @namespace Util/Address/Index/removeEmptyStreets */ -export const removeEmptyStreets = (street) => ( +export const removeEmptyStreets = (street: T | T[]): T | T[] => ( Array.isArray(street) ? street.filter((line) => line) : street ); +// TODO /** transforming "street[index]" entries into a single "street" object for checkout/billing/myAccoutAddress form fields object */ /** @namespace Util/Address/Index/setAddressesInFormObject */ -export const setAddressesInFormObject = (fields, numberOfLines, prefix = 'street') => { +export const setAddressesInFormObject = (fields: T, numberOfLines: number, prefix: string = 'street'): T => { const addressKeys = new Array(numberOfLines) .fill('') .map((_, index) => `${prefix}${index}`); @@ -158,12 +116,12 @@ export const setAddressesInFormObject = (fields, numberOfLines, prefix = 'street // setting single street entry to the form object newFields.street = removeEmptyStreets(addressValues); - return newFields; + return newFields as ; }; // get Form Fields object depending on addressLinesQty /** @namespace Util/Address/Index/getFormFields */ -export const getFormFields = (fields, addressLinesQty) => { +export const getFormFields = (fields: T, addressLinesQty: number): T => { if (addressLinesQty === 1) { return fields; } @@ -171,8 +129,14 @@ export const getFormFields = (fields, addressLinesQty) => { return setAddressesInFormObject(fields, addressLinesQty); }; +export type ZippopotamResponseResult = { + city: string, + region: string, + regionAbbr: string +} + /** @namespace Util/Address/Index/getCityAndRegionFromZipcode */ -export const getCityAndRegionFromZipcode = async (countryId, value) => { +export const getCityAndRegionFromZipcode = async (countryId: string, value: string): Promise => { const response = await fetch(`https://api.zippopotam.us/${countryId}/${value}`); const data = await response.json(); @@ -186,7 +150,7 @@ export const getCityAndRegionFromZipcode = async (countryId, value) => { }; /** @namespace Util/Address/Index/getDefaultAddressLabel */ -export const getDefaultAddressLabel = (address) => { +export const getDefaultAddressLabel = (address: Address): string => { const { default_billing, default_shipping } = address; if (!default_billing && !default_shipping) { @@ -205,7 +169,7 @@ export const getDefaultAddressLabel = (address) => { }; /** @namespace Util/Address/Index/getAvailableRegions */ -export const getAvailableRegions = (country_id, countries) => { +export const getAvailableRegions = (country_id: string, countries: Countries) => { const country = countries.find(({ id }) => id === country_id) || {}; const { available_regions } = country; @@ -214,7 +178,7 @@ export const getAvailableRegions = (country_id, countries) => { }; /** @namespace Util/Address/Index/getFormattedRegion */ -export const getFormattedRegion = (address, countries) => { +export const getFormattedRegion = (address: Address, countries: Countries) => { const { country_id, region: regionData } = address; if (!regionData) { @@ -247,7 +211,7 @@ export const getFormattedRegion = (address, countries) => { }; /** @namespace Util/Address/Index/getRegionIdFromAvailableRegions */ -export const getRegionIdFromAvailableRegions = (availableRegions, cityAndRegion) => { +export const getRegionIdFromAvailableRegions = (availableRegions: Regions, cityAndRegion: ZippopotamResponseResult): number => { const { region, regionAbbr } = cityAndRegion; const { id: regionId = 1 } = availableRegions.find( ({ name, code }) => name === region || code === regionAbbr @@ -257,8 +221,8 @@ export const getRegionIdFromAvailableRegions = (availableRegions, cityAndRegion) }; /** @namespace Util/Address/Index/checkIfStoreIncluded */ -export const checkIfStoreIncluded = (stores, selectedStore) => { +export const checkIfStoreIncluded = (stores: Stores, selectedStore: StoreItem): boolean => { const selectedStoreInString = JSON.stringify(selectedStore); - return stores.find((store) => JSON.stringify(store) === selectedStoreInString); + return !!stores.find((store) => JSON.stringify(store) === selectedStoreInString); }; diff --git a/packages/scandipwa/src/util/Browser/Browser.js b/packages/scandipwa/src/util/Browser/Browser.ts similarity index 83% rename from packages/scandipwa/src/util/Browser/Browser.js rename to packages/scandipwa/src/util/Browser/Browser.ts index c94bbb6659..33a06643a2 100644 --- a/packages/scandipwa/src/util/Browser/Browser.js +++ b/packages/scandipwa/src/util/Browser/Browser.ts @@ -13,16 +13,16 @@ export const crawlerRegEx = /(googlebot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis|HeadlessChrome|render|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|scandibot)/i; /** @namespace Util/Browser/isSSR */ -export const isSSR = () => !globalThis.window || !globalThis.window.document; +export const isSSR = (): boolean => !globalThis.window || !globalThis.window.document; /** @namespace Util/Browser/isCrawler */ -export const isCrawler = () => crawlerRegEx.test(navigator.userAgent); +export const isCrawler = (): boolean => crawlerRegEx.test(navigator.userAgent); /** @namespace Util/Browser/toggleScroll */ -export const toggleScroll = (state) => document.documentElement.classList.toggle('scrollDisabled', !state); +export const toggleScroll = (state: boolean): boolean => document.documentElement.classList.toggle('scrollDisabled', !state); /** @namespace Util/Browser/isScrollDisabled */ -export const isScrollDisabled = () => document.documentElement.classList.contains('scrollDisabled'); +export const isScrollDisabled = (): boolean => document.documentElement.classList.contains('scrollDisabled'); /** @namespace Util/Browser/scrollToTop */ -export const scrollToTop = (options = {}) => window.scrollTo({ ...options, top: 0 }); +export const scrollToTop = (options: ScrollToOptions = {}): void => window.scrollTo({ ...options, top: 0 }); diff --git a/packages/scandipwa/src/util/Browser/index.js b/packages/scandipwa/src/util/Browser/index.ts similarity index 100% rename from packages/scandipwa/src/util/Browser/index.js rename to packages/scandipwa/src/util/Browser/index.ts diff --git a/packages/scandipwa/src/util/CSS/CSS.js b/packages/scandipwa/src/util/CSS/CSS.ts similarity index 77% rename from packages/scandipwa/src/util/CSS/CSS.js rename to packages/scandipwa/src/util/CSS/CSS.ts index 9ed03d0d09..81ac291c88 100644 --- a/packages/scandipwa/src/util/CSS/CSS.js +++ b/packages/scandipwa/src/util/CSS/CSS.ts @@ -24,7 +24,7 @@ export class CSS { * @return {void} * @memberof CSS */ - static setVariable(ref, name, value) { + static setVariable(ref: React.RefObject, name: string, value: string): void { if (ref && ref.current) { ref.current.style.setProperty(`--${name}`, value); } @@ -32,16 +32,16 @@ export class CSS { } /** @namespace Util/CSS/getElementHeight */ -export const getElementHeight = (id) => Array.from( +export const getElementHeight = (id: string): number => Array.from( document.getElementsByClassName(id) ).reduce((acc, item) => { - const { offsetHeight } = item; + const { offsetHeight } = item as HTMLElement; return acc + offsetHeight; }, 0); /** @namespace Util/CSS/getFixedElementHeight */ -export const getFixedElementHeight = () => { +export const getFixedElementHeight = (): Record => { const top = getElementHeight('FixedElement-Top'); const bottom = getElementHeight('FixedElement-Bottom'); @@ -53,6 +53,6 @@ export const getFixedElementHeight = () => { }; /** @namespace Util/CSS/isRtl */ -export const isRtl = () => document.documentElement.getAttribute('dir') === 'rtl'; +export const isRtl = (): boolean => document.documentElement.getAttribute('dir') === 'rtl'; export default CSS; diff --git a/packages/scandipwa/src/util/CSS/index.js b/packages/scandipwa/src/util/CSS/index.ts similarity index 100% rename from packages/scandipwa/src/util/CSS/index.js rename to packages/scandipwa/src/util/CSS/index.ts diff --git a/packages/scandipwa/src/util/Cache/Cache.js b/packages/scandipwa/src/util/Cache/Cache.ts similarity index 97% rename from packages/scandipwa/src/util/Cache/Cache.js rename to packages/scandipwa/src/util/Cache/Cache.ts index a3067a81bf..43c9ea79fa 100644 --- a/packages/scandipwa/src/util/Cache/Cache.js +++ b/packages/scandipwa/src/util/Cache/Cache.ts @@ -15,7 +15,7 @@ * @returns {Promise} * @namespace Util/Cache/cacheImages */ -export const cacheImages = (urls = []) => { +export const cacheImages = (urls: string[] = []) => { if (!Array.isArray(urls) || urls.length === 0) { return; } diff --git a/packages/scandipwa/src/util/Category/Filters.js b/packages/scandipwa/src/util/Category/Filters.ts similarity index 74% rename from packages/scandipwa/src/util/Category/Filters.js rename to packages/scandipwa/src/util/Category/Filters.ts index 14d7b2b984..b1c662bf02 100644 --- a/packages/scandipwa/src/util/Category/Filters.js +++ b/packages/scandipwa/src/util/Category/Filters.ts @@ -12,7 +12,7 @@ import { formatPrice } from 'Util/Price'; /** @namespace Util/Category/Filters/getPriceFilterLabel */ -export const getPriceFilterLabel = (from, to, currencyCode) => { +export const getPriceFilterLabel = (from: number | string, to: number | string, currencyCode: string): string => { const priceFrom = formatPrice(from, currencyCode); const priceTo = formatPrice(to, currencyCode); @@ -28,4 +28,4 @@ export const getPriceFilterLabel = (from, to, currencyCode) => { }; /** @namespace Util/Category/Filters/getFiltersCount */ -export const getFiltersCount = (filters) => Object.values(filters).reduce((prev, next) => prev + next.length, 0); +export const getFiltersCount = (filters: Array): number => Object.values(filters).reduce((prev, next) => prev + next.length, 0); diff --git a/packages/scandipwa/src/util/Category/index.js b/packages/scandipwa/src/util/Category/index.ts similarity index 100% rename from packages/scandipwa/src/util/Category/index.js rename to packages/scandipwa/src/util/Category/index.ts diff --git a/packages/scandipwa/src/util/Common/index.js b/packages/scandipwa/src/util/Common/index.ts similarity index 88% rename from packages/scandipwa/src/util/Common/index.js rename to packages/scandipwa/src/util/Common/index.ts index 2bcb2186dd..a928bbfac6 100644 --- a/packages/scandipwa/src/util/Common/index.js +++ b/packages/scandipwa/src/util/Common/index.ts @@ -17,10 +17,10 @@ * Examples: default props, argument default values. * @namespace Util/Common/Index/noopFn */ -export const noopFn = () => {}; +export const noopFn = (): void => {}; /** @namespace Util/Common/Index/decodeString */ -export const decodeString = (string) => { +export const decodeString = (string: string): string => { try { return decodeURIComponent(string); } catch (e) { diff --git a/packages/scandipwa/src/util/Compare/Compare.js b/packages/scandipwa/src/util/Compare/Compare.ts similarity index 91% rename from packages/scandipwa/src/util/Compare/Compare.js rename to packages/scandipwa/src/util/Compare/Compare.ts index e666235ffb..f9190a630b 100644 --- a/packages/scandipwa/src/util/Compare/Compare.js +++ b/packages/scandipwa/src/util/Compare/Compare.ts @@ -34,7 +34,7 @@ export const ONE_DAY = 86400; * @returns {void} * @namespace Util/Compare/setUid */ -export const setUid = (uid) => { +export const setUid = (uid: string | boolean): void => { const state = getStore().getState(); const { access_token_lifetime = ONE_HOUR @@ -50,7 +50,7 @@ export const setUid = (uid) => { * @returns {string|boolean} uid * @namespace Util/Compare/getUid */ -export const getUid = () => { +export const getUid = (): string | boolean => { const uid = BrowserDatabase.getItem(COMPARE_UID); return (typeof uid === 'string') ? uid : false; @@ -60,7 +60,7 @@ export const getUid = () => { * * @namespace Util/Compare/removeUid */ -export const removeUid = () => { +export const removeUid = (): void => { BrowserDatabase.deleteItem(COMPARE_UID); }; diff --git a/packages/scandipwa/src/util/Compare/index.js b/packages/scandipwa/src/util/Compare/index.ts similarity index 100% rename from packages/scandipwa/src/util/Compare/index.js rename to packages/scandipwa/src/util/Compare/index.ts diff --git a/packages/scandipwa/src/util/Currency/Currency.js b/packages/scandipwa/src/util/Currency/Currency.ts similarity index 89% rename from packages/scandipwa/src/util/Currency/Currency.js rename to packages/scandipwa/src/util/Currency/Currency.ts index 85bac06306..5ad3f07cc9 100644 --- a/packages/scandipwa/src/util/Currency/Currency.js +++ b/packages/scandipwa/src/util/Currency/Currency.ts @@ -29,7 +29,7 @@ export const ONE_HOUR = 3600; * @returns {void} * @namespace Util/Currency/setCurrency */ -export const setCurrency = (currency) => { +export const setCurrency = (currency: string): void => { BrowserDatabase.setItem(currency, CUR_CURRENCY, ONE_HOUR); }; @@ -38,7 +38,7 @@ export const setCurrency = (currency) => { * @returns {String} currency * @namespace Util/Currency/getCurrency */ -export const getCurrency = () => { +export const getCurrency = (): string => { const currency = BrowserDatabase.getItem(CUR_CURRENCY); return (typeof currency === 'string') ? currency : ''; diff --git a/packages/scandipwa/src/util/Currency/index.js b/packages/scandipwa/src/util/Currency/index.ts similarity index 100% rename from packages/scandipwa/src/util/Currency/index.js rename to packages/scandipwa/src/util/Currency/index.ts diff --git a/packages/scandipwa/src/util/DynamicReducer/index.js b/packages/scandipwa/src/util/DynamicReducer/index.js index 1939dbf163..5f0cb240f9 100644 --- a/packages/scandipwa/src/util/DynamicReducer/index.js +++ b/packages/scandipwa/src/util/DynamicReducer/index.js @@ -8,7 +8,6 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import React from 'react'; import injectReducers from 'Util/DynamicReducer/Helper'; import getStore from 'Util/Store'; diff --git a/packages/scandipwa/src/util/FormPortalCollector/index.js b/packages/scandipwa/src/util/FormPortalCollector/index.ts similarity index 87% rename from packages/scandipwa/src/util/FormPortalCollector/index.js rename to packages/scandipwa/src/util/FormPortalCollector/index.ts index fdb882c77f..7ce0757498 100644 --- a/packages/scandipwa/src/util/FormPortalCollector/index.js +++ b/packages/scandipwa/src/util/FormPortalCollector/index.ts @@ -13,7 +13,7 @@ export class FormPortalCollector { portalsObservers = {}; - subscribe(id, f, name) { + subscribe(id:string, f: T, name: string): void { if (this.portalsObservers[id]) { this.portalsObservers[id][name] = f; @@ -23,7 +23,7 @@ export class FormPortalCollector { this.portalsObservers[id] = { [name]: f }; } - unsubscribe(id, name) { + unsubscribe(id:string, name:string): void { if (!this.portalsObservers[id]) { return; } @@ -31,7 +31,7 @@ export class FormPortalCollector { delete this.portalsObservers[id][name]; } - collect(id) { + collect(id:string) { const portals = this.portalsObservers[id] || {}; return Object.values(portals).map((portal) => portal()); diff --git a/packages/scandipwa/src/util/History/index.js b/packages/scandipwa/src/util/History/index.ts similarity index 100% rename from packages/scandipwa/src/util/History/index.js rename to packages/scandipwa/src/util/History/index.ts diff --git a/packages/scandipwa/src/util/Manipulations/Array.js b/packages/scandipwa/src/util/Manipulations/Array.ts similarity index 87% rename from packages/scandipwa/src/util/Manipulations/Array.js rename to packages/scandipwa/src/util/Manipulations/Array.ts index 20abc76e07..086e50c063 100644 --- a/packages/scandipwa/src/util/Manipulations/Array.js +++ b/packages/scandipwa/src/util/Manipulations/Array.ts @@ -11,7 +11,7 @@ */ /** @namespace Util/Manipulations/Array/range */ -export const range = (start, end) => { +export const range = (start: number, end: number): Array => { const length = end - start + 1; return Array.from({ length }, (_, i) => start + i); }; diff --git a/packages/scandipwa/src/util/Manipulations/Date.js b/packages/scandipwa/src/util/Manipulations/Date.ts similarity index 82% rename from packages/scandipwa/src/util/Manipulations/Date.js rename to packages/scandipwa/src/util/Manipulations/Date.ts index 87cba62fc0..ae55680fac 100644 --- a/packages/scandipwa/src/util/Manipulations/Date.js +++ b/packages/scandipwa/src/util/Manipulations/Date.ts @@ -14,7 +14,7 @@ import { getDateValue } from 'Util/Form/Extract'; export const MILLISECONDS_PER_MINUTE = 60000; /** @namespace Util/Manipulations/Date/convertStringToDate */ -export const convertStringToDate = (stringDate, options) => { +export const convertStringToDate = (stringDate: string, options: Intl.DateTimeFormatOptions): string => { const defaultOptions = { year: 'numeric', month: 'long', @@ -27,10 +27,12 @@ export const convertStringToDate = (stringDate, options) => { }; /** @namespace Util/Manipulations/Date/getTimeInCurrentTimezone */ -export const getTimeInCurrentTimezone = (timestamp) => { +export const getTimeInCurrentTimezone = (timestamp: string): string => { const currentDate = new Date(); const timezone = currentDate.getTimezoneOffset() * MILLISECONDS_PER_MINUTE; - const timeInCurrentTimezone = new Date(timestamp.replace(/-/g, '/')) - new Date(timezone); + const timeInCurrentTimezone = new Date(timestamp.replace(/-/g, '/')).getTime() - new Date(timezone).getTime(); return getDateValue(timeInCurrentTimezone); }; + + diff --git a/packages/scandipwa/src/util/Manipulations/index.js b/packages/scandipwa/src/util/Manipulations/index.ts similarity index 100% rename from packages/scandipwa/src/util/Manipulations/index.js rename to packages/scandipwa/src/util/Manipulations/index.ts diff --git a/packages/scandipwa/src/util/Media/Media.js b/packages/scandipwa/src/util/Media/Media.ts similarity index 89% rename from packages/scandipwa/src/util/Media/Media.js rename to packages/scandipwa/src/util/Media/Media.ts index 8bef21ed76..2895791ce3 100644 --- a/packages/scandipwa/src/util/Media/Media.js +++ b/packages/scandipwa/src/util/Media/Media.ts @@ -15,7 +15,7 @@ export const CATEGORY_MEDIA = 'catalog/category/'; export const PRODUCT_MEDIA = 'catalog/product'; export const LOGO_MEDIA = 'logo/'; -export default (src, subPath = '', isMediaPath = true) => { +export default (src: string, subPath: string = '', isMediaPath: boolean = true): string => { // If isMediaPath is passed return local media path const { ConfigReducer: { secure_base_media_url, base_url } } = getStore().getState(); diff --git a/packages/scandipwa/src/util/Media/index.js b/packages/scandipwa/src/util/Media/index.ts similarity index 100% rename from packages/scandipwa/src/util/Media/index.js rename to packages/scandipwa/src/util/Media/index.ts diff --git a/packages/scandipwa/src/util/Menu/index.js b/packages/scandipwa/src/util/Menu/index.ts similarity index 100% rename from packages/scandipwa/src/util/Menu/index.js rename to packages/scandipwa/src/util/Menu/index.ts diff --git a/packages/scandipwa/src/util/Mobile/index.js b/packages/scandipwa/src/util/Mobile/index.ts similarity index 100% rename from packages/scandipwa/src/util/Mobile/index.js rename to packages/scandipwa/src/util/Mobile/index.ts diff --git a/packages/scandipwa/src/util/Mobile/isMobile.js b/packages/scandipwa/src/util/Mobile/isMobile.ts similarity index 100% rename from packages/scandipwa/src/util/Mobile/isMobile.js rename to packages/scandipwa/src/util/Mobile/isMobile.ts From fcf5a26127b34c76a4327c2eacb70f3ab00840d7 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 1 Apr 2022 03:51:58 +0300 Subject: [PATCH 011/192] Migrated some queries --- ...{MyAccount.query.js => MyAccount.query.ts} | 47 ++- .../query/{Order.query.js => Order.query.ts} | 160 ++++---- ...ductList.query.js => ProductList.query.ts} | 367 ++++++++++-------- packages/scandipwa/src/query/Query.type.ts | 46 +++ 4 files changed, 350 insertions(+), 270 deletions(-) rename packages/scandipwa/src/query/{MyAccount.query.js => MyAccount.query.ts} (79%) rename packages/scandipwa/src/query/{Order.query.js => Order.query.ts} (74%) rename packages/scandipwa/src/query/{ProductList.query.js => ProductList.query.ts} (74%) diff --git a/packages/scandipwa/src/query/MyAccount.query.js b/packages/scandipwa/src/query/MyAccount.query.ts similarity index 79% rename from packages/scandipwa/src/query/MyAccount.query.js rename to packages/scandipwa/src/query/MyAccount.query.ts index b9ab66d6c0..34b8346411 100644 --- a/packages/scandipwa/src/query/MyAccount.query.js +++ b/packages/scandipwa/src/query/MyAccount.query.ts @@ -9,8 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLCustomerAddressInput, GQLCustomerUpdateInput } from 'Type/Graphql.type'; import { Field } from 'Util/Query'; +import { + ChangeCustomerPasswordOptions, ConfirmAccountOptions, CreateAccountOptions, ResetPasswordOptions, SignInOptions +} from './Query.type'; + /** * MyAccount Mutations * @class MyAccount @@ -22,7 +27,7 @@ export class MyAccountQuery { * @return {Field} * @memberof MyAccount */ - getResetPasswordMutation(options) { + getResetPasswordMutation(options: ResetPasswordOptions): Field { const { token, password, password_confirmation } = options; return new Field('s_resetPassword') @@ -38,7 +43,7 @@ export class MyAccountQuery { * @return {Field} * @memberof MyAccount */ - getSignInMutation(options) { + getSignInMutation(options: SignInOptions): Field { const { email, password } = options; return new Field('generateCustomerToken') @@ -47,13 +52,13 @@ export class MyAccountQuery { .addField('token'); } - getUpdateInformationMutation(options) { + getUpdateInformationMutation(options: GQLCustomerUpdateInput): Field { return new Field('updateCustomerV2') .addArgument('input', 'CustomerUpdateInput!', options) .addField(this._getCustomerField()); } - getUpdateEmailMutation(options) { + getUpdateEmailMutation(options: SignInOptions): Field { const { email, password } = options; return new Field('updateCustomerEmail') @@ -62,7 +67,7 @@ export class MyAccountQuery { .addField(this._getCustomerField()); } - getChangeCustomerPasswordMutation(options) { + getChangeCustomerPasswordMutation(options: ChangeCustomerPasswordOptions): Field { const { password, newPassword } = options; return new Field('changeCustomerPassword') @@ -72,25 +77,25 @@ export class MyAccountQuery { .addField('email'); } - getCreateAddressMutation(options) { + getCreateAddressMutation(options: GQLCustomerAddressInput): Field { return new Field('createCustomerAddress') .addArgument('input', 'CustomerAddressInput!', options) .addFieldList(this._getAddressFields()); } - getDeleteAddressMutation(id) { + getDeleteAddressMutation(id: number): Field { return new Field('deleteCustomerAddress') .addArgument('id', 'Int!', id); } - getUpdateAddressMutation(id, options) { + getUpdateAddressMutation(id: number, options: GQLCustomerAddressInput): Field { return new Field('updateCustomerAddress') .addArgument('id', 'Int!', id) .addArgument('input', 'CustomerAddressInput!', options) .addFieldList(this._getAddressFields()); } - getCreateAccountMutation(options) { + getCreateAccountMutation(options: CreateAccountOptions): Field { const { customer, password } = options; return new Field('createCustomer') @@ -98,7 +103,7 @@ export class MyAccountQuery { .addField(this._getCustomerField()); } - getConfirmAccountMutation(options) { + getConfirmAccountMutation(options: ConfirmAccountOptions): Field { const { key, email, password } = options; return new Field('confirmCustomerEmail') @@ -108,16 +113,16 @@ export class MyAccountQuery { .addFieldList(this._getConfirmAccountFields()); } - getRevokeAccountToken() { + getRevokeAccountToken(): Field { return new Field('revokeCustomerToken') .addFieldList(this.getRevokeAccountTokenFields()); } - getCustomerQuery() { + getCustomerQuery(): Field { return this._getCustomerField(); } - _getConfirmAccountFields() { + _getConfirmAccountFields(): Array { return [ 'status', 'token', @@ -125,18 +130,18 @@ export class MyAccountQuery { ]; } - getRevokeAccountTokenFields() { + getRevokeAccountTokenFields(): string[] { return [ 'result' ]; } - _getCustomerField() { + _getCustomerField(): Field { return new Field('customer') .addFieldList(this._getCustomerFields()); } - _getCustomerFields() { + _getCustomerFields(): Array { return [ 'created_at', 'confirmation_required', @@ -157,17 +162,17 @@ export class MyAccountQuery { ]; } - _getAddressesField() { + _getAddressesField(): Field { return new Field('addresses') .addFieldList(this._getAddressFields()); } - _getRegionField() { + _getRegionField(): Field { return new Field('region') .addFieldList(this._getRegionFields()); } - _getRegionFields() { + _getRegionFields(): string[] { return [ 'region_code', 'region', @@ -175,7 +180,7 @@ export class MyAccountQuery { ]; } - _getAddressFields() { + _getAddressFields(): Array { return [ 'id', 'customer_id', @@ -202,7 +207,7 @@ export class MyAccountQuery { * @returns {Field} * @memberof MyAccount */ - getForgotPasswordMutation(options) { + getForgotPasswordMutation(options: { email: string }): Field { const { email } = options; return new Field('forgotPassword') diff --git a/packages/scandipwa/src/query/Order.query.js b/packages/scandipwa/src/query/Order.query.ts similarity index 74% rename from packages/scandipwa/src/query/Order.query.js rename to packages/scandipwa/src/query/Order.query.ts index eecf776c46..af11d70322 100644 --- a/packages/scandipwa/src/query/Order.query.js +++ b/packages/scandipwa/src/query/Order.query.ts @@ -11,35 +11,31 @@ import { Field } from 'Util/Query'; +import { OrdersOptions } from './Query.type'; + /** * Order Query * @class OrderQuery * @namespace Query/Order/Query */ export class OrderQuery { - getReorder(incrementId) { + getReorder(incrementId: string): Field { return new Field('reorderItems') .addArgument('orderNumber', 'String!', incrementId) .addField(this._getReorderField()); } - getSubscribeToOrderStatus(incrementId) { - return new Field('subscribeToOrderStatus') - .addArgument('orderNumber', 'String!', incrementId) - .addFieldList(this._getSubscribeToOrderStatusOutputFields()); - } - - getOrderListQuery(options) { + getOrderListQuery(options: OrdersOptions): Field { return new Field('customer') .addFieldList(this._getOrderListFields(options)); } - _getOrderListFields(options) { + _getOrderListFields(options: OrdersOptions): Field[] { return [ this._getOrdersField(options) ]; } - _getOrdersField(options) { + _getOrdersField(options: OrdersOptions): Field { const { orderId, page = 1 } = options || {}; const ordersField = new Field('orders'); @@ -54,7 +50,7 @@ export class OrderQuery { .addFieldList(this._getOrdersFields()); } - _getOrdersFields(isSingleOrder = false) { + _getOrdersFields(isSingleOrder = false): Array { return [ 'total_count', this._getOrderItemsField(isSingleOrder), @@ -62,12 +58,12 @@ export class OrderQuery { ]; } - _getSearchResultPageInfoField() { + _getSearchResultPageInfoField(): Field { return new Field('page_info') .addFieldList(this._getSearchResultPageInfoFields()); } - _getSearchResultPageInfoFields() { + _getSearchResultPageInfoFields(): string[] { return [ 'current_page', 'page_size', @@ -75,12 +71,12 @@ export class OrderQuery { ]; } - _getOrderItemsField(isSingleOrder) { + _getOrderItemsField(isSingleOrder: boolean): Field { return new Field('items') .addFieldList(this._getOrderItemsFields(isSingleOrder)); } - _getOrderItemsFields(isSingleOrder) { + _getOrderItemsFields(isSingleOrder: boolean): Array { const basicFields = [ 'id', 'increment_id', @@ -98,7 +94,7 @@ export class OrderQuery { return basicFields; } - _getSingleOrderFields() { + _getSingleOrderFields(): Array { return [ 'carrier', this._getOrderShipmentsField(), @@ -113,24 +109,24 @@ export class OrderQuery { ]; } - _getOrderCommentsField() { + _getOrderCommentsField(): Field { return new Field('comments') .addFieldList(this._getOrderCommentsFields()); } - _getOrderCommentsFields() { + _getOrderCommentsFields(): string[] { return [ 'timestamp', 'message' ]; } - _getOrderItemTotalField() { + _getOrderItemTotalField(): Field { return new Field('total') .addFieldList(this._getOrderItemTotalFields()); } - _getOrderItemTotalFields() { + _getOrderItemTotalFields(): Field[] { return [ this._getOrderGrandTotalField(), this._getOrderDiscountsField(), @@ -143,12 +139,12 @@ export class OrderQuery { ]; } - _getOrderTaxesField() { + _getOrderTaxesField(): Field { return new Field('taxes') .addFieldList(this._getOrderTaxesFields()); } - _getOrderTaxesFields() { + _getOrderTaxesFields(): Array { return [ 'rate', 'title', @@ -156,12 +152,12 @@ export class OrderQuery { ]; } - _getOrderShippingHandlingField() { + _getOrderShippingHandlingField(): Field { return new Field('shipping_handling') .addFieldList(this._getOrderShippingHandlingFields()); } - _getOrderShippingHandlingFields() { + _getOrderShippingHandlingFields(): Field[] { return [ this._getOrderShippingAmountExclTaxField(), this._getOrderShippingAmountInclTaxField(), @@ -171,70 +167,70 @@ export class OrderQuery { ]; } - _getOrderShippingDiscountsField() { + _getOrderShippingDiscountsField(): Field { return new Field('discounts') .addFieldList(this._getOrderShippingDiscountsFields()); } - _getOrderShippingDiscountsFields() { + _getOrderShippingDiscountsFields(): Field[] { return [ this._getOrderAmountField() ]; } - _getOrderShippingAmountExclTaxField() { + _getOrderShippingAmountExclTaxField(): Field { return new Field('amount_excluding_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingAmountInclTaxField() { + _getOrderShippingAmountInclTaxField(): Field { return new Field('amount_including_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingHandlingTotalField() { + _getOrderShippingHandlingTotalField(): Field { return new Field('total_amount') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalTaxField() { + _getOrderTotalTaxField(): Field { return new Field('total_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalShippingField() { + _getOrderTotalShippingField(): Field { return new Field('total_shipping') .addFieldList(this._getOrderPriceFields()); } - _getOrderBaseGrantTotalField() { + _getOrderBaseGrantTotalField(): Field { return new Field('base_grand_total') .addFieldList(this._getOrderPriceFields()); } - _getOrderSubtotalField() { + _getOrderSubtotalField(): Field { return new Field('subtotal') .addFieldList(this._getOrderPriceFields()); } - _getOrderGrandTotalField() { + _getOrderGrandTotalField(): Field { return new Field('grand_total') .addFieldList(this._getOrderPriceFields()); } - _getOrderPriceFields() { + _getOrderPriceFields(): string[] { return [ 'value', 'currency' ]; } - _getOrderShipmentsField() { + _getOrderShipmentsField(): Field { return new Field('shipments') .addFieldList(this._getOrderShipmentsFields()); } - _getOrderShipmentsFields() { + _getOrderShipmentsFields(): Array { return [ 'id', 'number', @@ -244,24 +240,24 @@ export class OrderQuery { ]; } - _getShipmentsItemsProductsField() { + _getShipmentsItemsProductsField(): Field { return new Field('items') .addFieldList(this._getShipmentsItemsProductsFields()); } - _getShipmentsItemsProductsFields() { + _getShipmentsItemsProductsFields(): Array { return [ 'quantity_shipped', ...this._getBaseOrderItemProductsFields() ]; } - _getOrderShipmentTrackingField() { + _getOrderShipmentTrackingField(): Field { return new Field('tracking') .addFieldList(this._getOrderShipmentTrackingFields()); } - _getOrderShipmentTrackingFields() { + _getOrderShipmentTrackingFields(): string[] { return [ 'carrier', 'number', @@ -269,12 +265,12 @@ export class OrderQuery { ]; } - _getOrderRefundsField() { + _getOrderRefundsField(): Field { return new Field('credit_memos') .addFieldList(this._getOrderRefundsFields()); } - _getOrderRefundsFields() { + _getOrderRefundsFields(): Array { return [ 'id', 'number', @@ -284,29 +280,29 @@ export class OrderQuery { ]; } - _getOrderDiscountsField() { + _getOrderDiscountsField(): Field { return new Field('discounts') .addFieldList(this._getOrderDiscountsFields()); } - _getOrderDiscountsFields() { + _getOrderDiscountsFields(): Array { return [ 'label', this._getOrderAmountField() ]; } - _getOrderAmountField() { + _getOrderAmountField(): Field { return new Field('amount') .addFieldList(this._getOrderPriceFields()); } - _getRefundsItemsProductsField() { + _getRefundsItemsProductsField(): Field { return new Field('items') .addFieldList(this._getRefundsItemsProductsFields()); } - _getRefundsItemsProductsFields() { + _getRefundsItemsProductsFields(): Array { return [ 'quantity_refunded', ...this._getBaseOrderItemProductsFields(), @@ -316,17 +312,17 @@ export class OrderQuery { ]; } - _getRefundsItemInformationField() { + _getRefundsItemInformationField(): Field { return new Field('order_item') .addFieldList(this._getOrderItemProductsFields()); } - _getOrderInvoicesField() { + _getOrderInvoicesField(): Field { return new Field('invoices') .addFieldList(this._getOrderInvoicesFields()); } - _getOrderInvoicesFields() { + _getOrderInvoicesFields(): Array { return [ 'id', 'number', @@ -336,12 +332,12 @@ export class OrderQuery { ]; } - _getInvoiceItemsProductsField() { + _getInvoiceItemsProductsField(): Field { return new Field('items') .addFieldList(this._getInvoiceItemProductsFields()); } - _getInvoiceItemProductsFields() { + _getInvoiceItemProductsFields(): Array { return [ 'quantity_invoiced', this._getOrderProductRowSubtotalField(), @@ -349,12 +345,12 @@ export class OrderQuery { ]; } - _getOrderItemsProductsField() { + _getOrderItemsProductsField(): Field { return new Field('items') .addFieldList(this._getOrderItemProductsFields()); } - _getOrderItemProductsFields() { + _getOrderItemProductsFields(): Array { return [ 'product_url_key', 'quantity_ordered', @@ -368,7 +364,7 @@ export class OrderQuery { ]; } - _getBaseOrderItemProductsFields() { + _getBaseOrderItemProductsFields(): Array { return [ 'product_name', 'product_sku', @@ -376,27 +372,27 @@ export class OrderQuery { ]; } - _getOrderProductRowSubtotalField() { + _getOrderProductRowSubtotalField(): Field { return new Field('row_subtotal') .addFieldList(this._getOrderPriceFields()); } - _getOrderProductRowSubtotalInclTaxField() { + _getOrderProductRowSubtotalInclTaxField(): Field { return new Field('row_subtotal_incl_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderProductEnteredOptionsField() { + _getOrderProductEnteredOptionsField(): Field { return new Field('entered_options') .addFieldList(this._getOrderProductOptionsFields()); } - _getOrderProductSelectedOptionsField() { + _getOrderProductSelectedOptionsField(): Field { return new Field('selected_options') .addFieldList(this._getOrderProductOptionsFields()); } - _getOrderProductOptionsFields() { + _getOrderProductOptionsFields(): Array { return [ 'label', 'value', @@ -405,12 +401,12 @@ export class OrderQuery { ]; } - _getOrderProductBundleOptionItemsField() { + _getOrderProductBundleOptionItemsField(): Field { return new Field('items') .addFieldList(this._getOrderProductBundleOptionItemsFields()); } - _getOrderProductBundleOptionItemsFields() { + _getOrderProductBundleOptionItemsFields(): string[] { return [ 'title', 'qty', @@ -418,17 +414,17 @@ export class OrderQuery { ]; } - _getOrderProductSalePriceField() { + _getOrderProductSalePriceField(): Field { return new Field('product_sale_price') .addFieldList(this._getOrderPriceFields()); } - _getReorderField() { + _getReorderField(): Field { return new Field('userInputErrors') .addFieldList(this._getReorderFields()); } - _getReorderFields() { + _getReorderFields(): string[] { return [ 'code', 'message', @@ -436,17 +432,17 @@ export class OrderQuery { ]; } - _getOrderShippingAddressField() { + _getOrderShippingAddressField(): Field { return new Field('shipping_address') .addFieldList(this._getOrderAddressFields()); } - _getOrderBillingAddressField() { + _getOrderBillingAddressField(): Field { return new Field('billing_address') .addFieldList(this._getOrderAddressFields()); } - _getOrderAddressFields() { + _getOrderAddressFields(): Array { return [ 'city', 'country_id', @@ -461,16 +457,16 @@ export class OrderQuery { ]; } - _getOrderAddressStreetField() { + _getOrderAddressStreetField(): Field { return new Field('street'); } - _getOrderPaymentMethodsField() { + _getOrderPaymentMethodsField(): Field { return new Field('payment_methods') .addFieldList(this._getOrderPaymentMethodsFields()); } - _getOrderPaymentMethodsFields() { + _getOrderPaymentMethodsFields(): Array { return [ 'name', 'type', @@ -479,48 +475,48 @@ export class OrderQuery { ]; } - _getOrderPaymentMethodAdditionalField() { + _getOrderPaymentMethodAdditionalField(): Field { return new Field('additional_data') .addFieldList(this._getOrderPaymentMethodAdditionalFields()); } - _getOrderPaymentMethodAdditionalFields() { + _getOrderPaymentMethodAdditionalFields(): string[] { return [ 'name', 'value' ]; } - _getOrderShippingMethodField() { + _getOrderShippingMethodField(): Field { return new Field('shipping_method'); } - getDownloadableQuery() { + getDownloadableQuery(): Field { return new Field('customerDownloadableProducts') .addField(this._getDownloadableField()); } - getOrderByIdQuery(orderId) { + getOrderByIdQuery(orderId: number): Field { return this._getOrderByIdField(orderId); } - linkOrderMutation(customerEmail) { + linkOrderMutation(customerEmail: string): Field { return new Field('linkOrder') .addArgument('customer_email', 'String!', customerEmail); } - _getOrderByIdField(orderId) { + _getOrderByIdField(orderId: number): Field { return new Field('Customer') .addArgument('id', 'Int!', orderId) - .addFieldList(this._getOrderItemsFields()); + .addFieldList(this._getOrderItemsFields(false)); } - _getDownloadableField() { + _getDownloadableField(): Field { return new Field('items') .addFieldList(this._getDownloadableFields()); } - _getDownloadableFields() { + _getDownloadableFields(): string[] { return [ 'order_id', 'order_increment_id', diff --git a/packages/scandipwa/src/query/ProductList.query.js b/packages/scandipwa/src/query/ProductList.query.ts similarity index 74% rename from packages/scandipwa/src/query/ProductList.query.js rename to packages/scandipwa/src/query/ProductList.query.ts index ea0a57ca52..bef74ce696 100644 --- a/packages/scandipwa/src/query/ProductList.query.js +++ b/packages/scandipwa/src/query/ProductList.query.ts @@ -15,17 +15,16 @@ import { CUSTOMER } from 'Store/MyAccount/MyAccount.dispatcher'; import BrowserDatabase from 'Util/BrowserDatabase'; import { Field, Fragment } from 'Util/Query'; +import { ProductListOptions } from './Query.type'; + /** * Product List Query * @class ProductListQuery * @namespace Query/ProductList/Query */ export class ProductListQuery { - __construct() { - super.__construct(); - this.options = {}; - } + options = {} as ProductListOptions; - getQuery(options) { + getQuery(options: ProductListOptions): Field { if (!options) { throw new Error('Missing argument `options`'); } @@ -35,7 +34,7 @@ export class ProductListQuery { return this._getProductsField(); } - _getProductsField() { + _getProductsField(): Field { const products = new Field('products') .addFieldList(this._getProductFields()); @@ -44,7 +43,7 @@ export class ProductListQuery { return products; } - _getPriceFilter(key, value) { + _getPriceFilter(key: string, value: string): Record { const [from, to] = value[0].split('_'); if (from === '*') { @@ -60,9 +59,11 @@ export class ProductListQuery { }; } - _getCustomFilters(filters = {}) { + _getCustomFilters( + filters: Record = {} + ): Record { return Object.entries(filters) - .reduce((acc, [key, attribute]) => { + .reduce((acc, [key, attribute]: [string, string]) => { if (!attribute.length) { return acc; } @@ -78,15 +79,16 @@ export class ProductListQuery { ...acc, [key]: { in: attribute } }; - }, {}); + }, {} as Record); } + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types _getFilterArgumentMap() { return { - categoryIds: (id) => ({ category_id: { eq: id } }), - categoryUrlPath: (url) => ({ category_url_path: { eq: url } }), - priceRange: ({ min, max }) => { - const price = {}; + categoryIds: (id: number) => ({ category_id: { eq: id } }), + categoryUrlPath: (url: string) => ({ category_url_path: { eq: url } }), + priceRange: ({ min, max }: { min: number; max: number }) => { + const price = {} as { from?: number; to?: number }; if (min) { price.from = min; @@ -98,17 +100,18 @@ export class ProductListQuery { return { price }; }, - productsSkuArray: (sku) => ({ sku: { in: sku } }), - productSKU: (sku) => ({ sku: { eq: sku } }), - productID: (id) => ({ id: { eq: id } }), - productUrlPath: (url) => ({ url_key: { eq: url } }), + productsSkuArray: (sku: string) => ({ sku: { in: sku } }), + productSKU: (sku: string) => ({ sku: { eq: sku } }), + productID: (id: number) => ({ id: { eq: id } }), + productUrlPath: (url: string) => ({ url_key: { eq: url } }), customFilters: this._getCustomFilters.bind(this), - newToDate: (date) => ({ news_to_date: { gteq: date } }), - conditions: (conditions) => ({ conditions: { eq: conditions } }), - customerGroupId: (id) => ({ customer_group_id: { eq: id } }) + newToDate: (date: string) => ({ news_to_date: { gteq: date } }), + conditions: (conditions: string) => ({ conditions: { eq: conditions } }), + customerGroupId: (id: number) => ({ customer_group_id: { eq: id } }) }; } + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types _getArgumentsMap() { const { requireInfo } = this.options; const filterArgumentMap = this._getFilterArgumentMap(); @@ -117,15 +120,16 @@ export class ProductListQuery { currentPage: { type: 'Int!' }, pageSize: { type: 'Int!', - handler: (option) => (requireInfo ? 1 : option) + handler: (option: number) => (requireInfo ? 1 : option) }, search: { type: 'String!', - handler: (option) => option.replace(/\+/g, ' ') + handler: (option: string) => option.replace(/\+/g, ' ') }, sort: { type: 'ProductAttributeSortInput!', - handler: ({ sortKey, sortDirection }) => { + // ! Convert both strings to enums! + handler: ({ sortKey, sortDirection }: { sortKey: string; sortDirection: string }) => { if (sortKey === NONE_SORT_OPTION_VALUE) { return {}; } @@ -142,6 +146,10 @@ export class ProductListQuery { const options = { ...initialOptions, customerGroupId: group_id || '0' + } as { + customerGroupId: number; + customFilters?: { category_id: number }; + categoryIds?: number[]; }; const { @@ -157,16 +165,22 @@ export class ProductListQuery { options.categoryIds = undefined; } - const parsedOptions = Object.entries(options).reduce( - (acc, [key, option]) => { + const parsedOptions = (Object.entries(options) as Array<[string, unknown]>).reduce( + ( + acc: Record, + [key, option]: [string, unknown] + ) => { // if there is no value, or if the key is just not present in options object - if (!option || !filterArgumentMap[key]) { + if (!option || !filterArgumentMap[key as keyof typeof filterArgumentMap]) { return acc; } - return { ...acc, ...filterArgumentMap[key](option) }; + return { + ...acc, + ...filterArgumentMap[key as keyof typeof filterArgumentMap](option as never) + }; }, - {} + {} as Record ); return parsedOptions; @@ -175,21 +189,31 @@ export class ProductListQuery { }; } - _getProductArguments() { + _getProductArguments(): Array<[string, string, unknown]> { const { args } = this.options; const argumentMap = this._getArgumentsMap(); - return Object.entries(args).reduce((acc, [key, arg]) => { + return Object.entries(args).reduce(( + acc: Array<[string, string, unknown]>, + [key, arg]: [string, unknown] + ) => { if (!arg) { return acc; } - const { type, handler = (option) => option } = argumentMap[key]; - return [...acc, [key, type, handler(arg)]]; - }, []); + const { + type, + handler = (option) => option + } = argumentMap[key as keyof typeof argumentMap] as { + type: string; + handler: (x: T) => T; + }; + + return [...acc, [key, type, handler(arg)]] as Array<[string, string, unknown]>; + }, [] as Array<[string, string, unknown]>); } - _getProductFields() { + _getProductFields(): Array { const { requireInfo, isSingleProduct, notRequireInfo } = this.options; // do not request total count for PDP @@ -214,7 +238,7 @@ export class ProductListQuery { ]; } - _getCartProductInterfaceFields() { + _getCartProductInterfaceFields(): Array { return [ 'uid', 'id', @@ -232,7 +256,7 @@ export class ProductListQuery { ]; } - _getCartConfigurableProductFragment() { + _getCartConfigurableProductFragment(): Fragment { return new Fragment('ConfigurableProduct') .addFieldList([ this._getConfigurableOptionsField(), @@ -240,19 +264,19 @@ export class ProductListQuery { ]); } - _getCartVariantsField() { + _getCartVariantsField(): Field { return new Field('variants') .setAlias('variants') .addFieldList(this._getCartVariantFields()); } - _getCartVariantFields() { + _getCartVariantFields(): Field[] { return [ this._getCartProductField() ]; } - _getCartProductField() { + _getCartProductField(): Field { return new Field('product') .addFieldList([ 'id', @@ -265,7 +289,11 @@ export class ProductListQuery { ]); } - _getProductInterfaceFields(isVariant, isForLinkedProducts = false, isForWishlist = false) { + _getProductInterfaceFields( + isVariant: boolean, + isForLinkedProducts = false, + isForWishlist = false + ): Array { const { isPlp = false, isSingleProduct, @@ -308,7 +336,7 @@ export class ProductListQuery { // if it is normal product and we need attributes // or if, it is variant, but we need variant attributes or variants them-self if ((!isVariant && !noAttributes) || (isVariant && !noVariantAttributes && !noVariants)) { - fields.push(this._getAttributesField(isVariant)); + fields.push(this._getAttributesField(isVariant, false)); } // to all products (non-variants) @@ -369,7 +397,7 @@ export class ProductListQuery { * @returns {*[]} * @private */ - _getGroupedProductItemFields() { + _getGroupedProductItemFields(): Array { return [ this._getProductField(), 'position', @@ -382,7 +410,7 @@ export class ProductListQuery { * @returns {Field} * @protected */ - _getGroupedProductItems() { + _getGroupedProductItems(): Field { return new Fragment('GroupedProduct').addField( new Field('items') .addFieldList(this._getGroupedProductItemFields()) @@ -394,12 +422,12 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getDownloadableProductFields() { + _getDownloadableProductFields(): Fragment { return new Fragment('DownloadableProduct') .addFieldList(this._getDownloadableProductLinks()); } - _getDownloadableProductLinks() { + _getDownloadableProductLinks(): Array { return [ 'links_title', 'samples_title', @@ -409,23 +437,23 @@ export class ProductListQuery { ]; } - _getDownloadableProductLinksRequired() { + _getDownloadableProductLinksRequired(): Field { return new Fragment('DownloadableProduct') .addFieldList(this._getDownloadableProductLinksRequiredFields()); } - _getDownloadableProductLinksRequiredFields() { + _getDownloadableProductLinksRequiredFields(): string[] { return [ 'links_purchased_separately' ]; } - _getDownloadableProductLinkField() { + _getDownloadableProductLinkField(): Field { return new Field('downloadable_product_links') .addFieldList(this._getDownloadableProductLinkFields()); } - _getDownloadableProductLinkFields() { + _getDownloadableProductLinkFields(): string[] { return [ 'sample_url', 'sort_order', @@ -436,12 +464,12 @@ export class ProductListQuery { ]; } - _getDownloadableProductSampleField() { + _getDownloadableProductSampleField(): Field { return new Field('downloadable_product_samples') .addFieldList(this._getDownloadableProductSampleFields()); } - _getDownloadableProductSampleFields() { + _getDownloadableProductSampleFields(): string[] { return [ 'title', 'sort_order', @@ -449,11 +477,11 @@ export class ProductListQuery { ]; } - _getItemsField() { + _getItemsField(): Field { const { isSingleProduct } = this.options; const items = new Field('items') - .addFieldList(this._getProductInterfaceFields()); + .addFieldList(this._getProductInterfaceFields(false)); if (isSingleProduct) { // items.addField(this._getGroupedProductItems()); @@ -465,30 +493,30 @@ export class ProductListQuery { return items; } - _getProductField() { + _getProductField(): Field { const { isForLinkedProducts, isForWishlist = false } = this.options; return new Field('product') .addFieldList(this._getProductInterfaceFields(true, isForLinkedProducts, isForWishlist)); } - _getShortDescriptionFields() { + _getShortDescriptionFields(): string[] { return [ 'html' ]; } - _getShortDescriptionField() { + _getShortDescriptionField(): Field { return new Field('short_description') .addFieldList(this._getShortDescriptionFields()); } - _getStockItemField() { + _getStockItemField(): Field { return new Field('stock_item') .addFieldList(this._getStockItemFields()); } - _getStockItemFields() { + _getStockItemFields(): string[] { return [ 'in_stock', 'min_sale_qty', @@ -497,7 +525,7 @@ export class ProductListQuery { ]; } - _getBreadcrumbFields() { + _getBreadcrumbFields(): string[] { return [ 'category_id', 'category_name', @@ -507,12 +535,12 @@ export class ProductListQuery { ]; } - _getBreadcrumbsField() { + _getBreadcrumbsField(): Field { return new Field('breadcrumbs') .addFieldList(this._getBreadcrumbFields()); } - _getCategoryFields() { + _getCategoryFields(): Array { return [ 'id', 'name', @@ -521,12 +549,12 @@ export class ProductListQuery { ]; } - _getCategoriesField() { + _getCategoriesField(): Field { return new Field('categories') .addFieldList(this._getCategoryFields()); } - _getMinimalPriceFields() { + _getMinimalPriceFields(): Field[] { return [ this._getDiscountField(), this._getFinalPriceField(), @@ -539,17 +567,17 @@ export class ProductListQuery { ]; } - _getMinimalPriceField() { + _getMinimalPriceField(): Field { return new Field('minimum_price') .addFieldList(this._getMinimalPriceFields()); } - _getMaximalPriceField() { + _getMaximalPriceField(): Field { return new Field('maximum_price') .addFieldList(this._getMinimalPriceFields()); } - _getPriceRangeFields() { + _getPriceRangeFields(): Field[] { // Using an array as potentially would want to add maximum price return [ this._getMinimalPriceField(), @@ -557,7 +585,7 @@ export class ProductListQuery { ]; } - _getPriceRangeField() { + _getPriceRangeField(): Field { return new Field('price_range') .addFieldList(this._getPriceRangeFields()); } @@ -566,14 +594,14 @@ export class ProductListQuery { * @returns {[string]} an array representing the subfields of the product thumbnail * @private */ - _getProductThumbnailFields() { + _getProductThumbnailFields(): string[] { return [ 'path', 'url' ]; } - _getProductSmallFields() { + _getProductSmallFields(): string[] { return this._getProductThumbnailFields(); } @@ -583,35 +611,40 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getProductThumbnailField() { + _getProductThumbnailField(): Field { return new Field('thumbnail') .addFieldList(this._getProductThumbnailFields()); } - _getProductSmallField() { + _getProductSmallField(): Field { return new Field('small_image') .addFieldList(this._getProductSmallFields()); } - _getProductImageField() { + _getProductImageField(): Field { return new Field('image') .addFieldList(this._getProductThumbnailFields()); } - _getAttributeOptionField(noSwatches) { - return [ + _getAttributeOptionField(noSwatches: boolean): Array { + const fields: Array = [ 'label', - 'value', - !noSwatches && this._getSwatchDataField() + 'value' ]; + + if (!noSwatches) { + fields.push(this._getSwatchDataField()); + } + + return fields; } - _getAttributeOptionsField(noSwatches) { + _getAttributeOptionsField(noSwatches: boolean): Field { return new Field('attribute_options') .addFieldList(this._getAttributeOptionField(noSwatches)); } - _getAdditionalAttributeFields(isCart) { + _getAdditionalAttributeFields(isCart: boolean): string[] { if (isCart) { return []; } @@ -623,17 +656,17 @@ export class ProductListQuery { ]; } - _getAttributeOptionsFields(isVariant) { + _getAttributeOptionsFields(isVariant: boolean): Field[] { if (isVariant) { return []; } return [ - this._getAttributeOptionsField() + this._getAttributeOptionsField(false) ]; } - _getAttributeFields(isVariant = false, isCart = false) { + _getAttributeFields(isVariant = false, isCart = false): Array { return [ 'attribute_id', 'attribute_value', @@ -644,13 +677,13 @@ export class ProductListQuery { ]; } - _getAttributesField(isVariant, isCart) { + _getAttributesField(isVariant: boolean, isCart: boolean): Field { return new Field('s_attributes') .setAlias('attributes') .addFieldList(this._getAttributeFields(isVariant, isCart)); } - _getMediaGalleryFields() { + _getMediaGalleryFields(): Array { return [ 'id', 'file', @@ -671,7 +704,7 @@ export class ProductListQuery { * @returns {Field} the video_content field * @private */ - _getVideoContentField() { + _getVideoContentField(): Field { return new Field('video_content').addFieldList([ 'media_type', 'video_description', @@ -688,45 +721,45 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getMediaThumbnailField() { + _getMediaThumbnailField(): Field { return new Field('thumbnail').addField('url'); } - _getMediaBaseField() { + _getMediaBaseField(): Field { return new Field('base').addField('url'); } - _getMediaLargeField() { + _getMediaLargeField(): Field { return new Field('large').addField('url'); } - _getMediaGalleryField() { + _getMediaGalleryField(): Field { return new Field('media_gallery_entries') .addFieldList(this._getMediaGalleryFields()); } - _getProductLinksField() { + _getProductLinksField(): Field { return new Field('product_links') .addFieldList(this._getProductLinkFields()); } - _getDescriptionFields() { + _getDescriptionFields(): string[] { return [ 'html' ]; } - _getDescriptionField() { + _getDescriptionField(): Field { return new Field('description') .addFieldList(this._getDescriptionFields()); } - _getUrlRewritesFields() { + _getUrlRewritesFields(): Field { return new Field('url_rewrites') .addFieldList(['url']); } - _getProductLinkFields() { + _getProductLinkFields(): string[] { return [ 'position', 'link_type', @@ -734,20 +767,20 @@ export class ProductListQuery { ]; } - _getRatingsBreakdownFields() { + _getRatingsBreakdownFields(): Array { return [ new Field('name').setAlias('rating_code'), 'value' ]; } - _getRatingsBreakdownField() { + _getRatingsBreakdownField(): Field { return new Field('ratings_breakdown') .setAlias('rating_votes') .addFieldList(this._getRatingsBreakdownFields()); } - _getReviewItemsFields() { + _getReviewItemsFields(): Array { return [ 'average_rating', 'nickname', @@ -758,18 +791,18 @@ export class ProductListQuery { ]; } - _getReviewItemsField() { + _getReviewItemsField(): Field { return new Field('items') .addFieldList(this._getReviewItemsFields()); } - _getReviewsFields() { + _getReviewsFields(): Field[] { return [ this._getReviewItemsField() ]; } - _getReviewsField() { + _getReviewsField(): Field { return new Field('reviews') // Hard-coded pages, it will be very hard to // paginate using current implementation @@ -779,15 +812,15 @@ export class ProductListQuery { .addFieldList(this._getReviewsFields()); } - _getReviewCountField() { + _getReviewCountField(): Field { return new Field('review_count'); } - _getRatingSummaryField() { + _getRatingSummaryField(): Field { return new Field('rating_summary'); } - _getBundleOptionsFields() { + _getBundleOptionsFields(): Array { return [ 'uid', 'label', @@ -801,12 +834,12 @@ export class ProductListQuery { ]; } - _getProductBundleOptionField() { + _getProductBundleOptionField(): Field { return new Field('product') .addFieldList(this._getProductBundleOptionFields()); } - _getProductBundleOptionFields() { + _getProductBundleOptionFields(): Array { return [ 'name', 'stock_status', @@ -814,12 +847,12 @@ export class ProductListQuery { ]; } - _getBundleOptionsField() { + _getBundleOptionsField(): Field { return new Field('options') .addFieldList(this._getBundleOptionsFields()); } - _getBundleItemsFields() { + _getBundleItemsFields(): Array { return [ 'uid', 'option_id', @@ -832,12 +865,12 @@ export class ProductListQuery { ]; } - _getBundleItemsField() { + _getBundleItemsField(): Field { return new Field('items') .addFieldList(this._getBundleItemsFields()); } - _getBundlePriceOptionSelectionFields() { + _getBundlePriceOptionSelectionFields(): string[] { return [ 'selection_id', 'final_option_price', @@ -847,7 +880,7 @@ export class ProductListQuery { ]; } - _getBundlePriceOptionFields() { + _getBundlePriceOptionFields(): Array { return [ 'option_id', new Field('selection_details') @@ -855,12 +888,12 @@ export class ProductListQuery { ]; } - _getBundlePriceOptionsField() { + _getBundlePriceOptionsField(): Field { return new Field('bundle_options') .addFieldList(this._getBundlePriceOptionFields()); } - _getBundleProductFragmentFields() { + _getBundleProductFragmentFields(): Array { return [ 'dynamic_price', 'dynamic_sku', @@ -871,36 +904,36 @@ export class ProductListQuery { ]; } - _getValueFields() { + _getValueFields(): string[] { return [ 'value_index' ]; } - _getValuesField() { + _getValuesField(): Field { return new Field('values') .addFieldList(this._getValueFields()); } - _getConfigurableOptionFields() { + _getConfigurableOptionFields(): Array { return [ 'attribute_code', this._getValuesField() ]; } - _getConfigurableOptionsField() { + _getConfigurableOptionsField(): Field { return new Field('configurable_options') .addFieldList(this._getConfigurableOptionFields()); } - _getVariantFields() { + _getVariantFields(): Field[] { return [ this._getProductField() ]; } - _getVariantsField() { + _getVariantsField(): Field { const { isPlp = false, isForWishlist = false } = this.options; // For PLP page we have optimized variants graphql field @@ -911,14 +944,14 @@ export class ProductListQuery { .addFieldList(this._getVariantFields()); } - _getConfigurableProductFragmentFields() { + _getConfigurableProductFragmentFields(): Field[] { return [ this._getConfigurableOptionsField(), this._getVariantsField() ]; } - _getCustomizableTextValueFields() { + _getCustomizableTextValueFields(): string[] { return [ 'price', 'priceInclTax', @@ -930,20 +963,20 @@ export class ProductListQuery { ]; } - _getCustomizableTextValueField(alias) { + _getCustomizableTextValueField(alias: string): Field { return new Field('value') .addFieldList(this._getCustomizableTextValueFields()) .setAlias(alias); } - _getCustomizableTextFields(alias) { + _getCustomizableTextFields(alias: string): Array { return [ this._getCustomizableTextValueField(alias), 'product_sku' ]; } - _getCustomizableFileValueField(alias) { + _getCustomizableFileValueField(alias: string): Field { return new Field('value') .addFieldList([ 'price', @@ -957,22 +990,22 @@ export class ProductListQuery { .setAlias(alias); } - _getCustomizableAreaOption() { + _getCustomizableAreaOption(): Field { return new Fragment('CustomizableAreaOption') .addFieldList(this._getCustomizableTextFields('areaValues')); } - _getCustomizableFieldOption() { + _getCustomizableFieldOption(): Field { return new Fragment('CustomizableFieldOption') .addFieldList(this._getCustomizableTextFields('fieldValues')); } - _getCustomizableFileOption() { + _getCustomizableFileOption(): Field { return new Fragment('CustomizableFileOption') .addFieldList([this._getCustomizableFileValueField('fileValues')]); } - _getCustomizableDateValueFields() { + _getCustomizableDateValueFields(): string[] { return [ 'price', 'priceInclTax', @@ -983,24 +1016,24 @@ export class ProductListQuery { ]; } - _getCustomizableDateValueField() { + _getCustomizableDateValueField(): Field { return new Field('value') .addFieldList(this._getCustomizableDateValueFields()); } - _getCustomizableDateFields(alias) { + _getCustomizableDateFields(): Array { return [ - this._getCustomizableDateValueField(alias), + this._getCustomizableDateValueField(), 'product_sku' ]; } - _getCustomizableDateOption() { + _getCustomizableDateOption(): Field { return new Fragment('CustomizableDateOption') .addFieldList(this._getCustomizableDateFields()); } - _getCustomizableSelectionValueFields() { + _getCustomizableSelectionValueFields(): string[] { return [ 'uid', 'option_type_id', @@ -1015,33 +1048,33 @@ export class ProductListQuery { ]; } - _getCustomizableSelectionValueField(alias) { + _getCustomizableSelectionValueField(alias: string): Field { return new Field('value') .addFieldList(this._getCustomizableSelectionValueFields()) .setAlias(alias); } - _getCustomizableCheckboxOption() { + _getCustomizableCheckboxOption(): Field { return new Fragment('CustomizableCheckboxOption') .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); } - _getCustomizableMultiOption() { + _getCustomizableMultiOption(): Field { return new Fragment('CustomizableMultipleOption') .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); // same as checkbox } - _getCustomizableDropdownOption() { + _getCustomizableDropdownOption(): Field { return new Fragment('CustomizableDropDownOption') .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); } - _getCustomizableRadioOption() { + _getCustomizableRadioOption(): Field { return new Fragment('CustomizableRadioOption') .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); // same as dropdown } - _getCustomizableProductFragmentOptionsFields() { + _getCustomizableProductFragmentOptionsFields(): Array { return [ this._getCustomizableDropdownOption(), this._getCustomizableRadioOption(), @@ -1059,34 +1092,34 @@ export class ProductListQuery { ]; } - _getCustomizableProductFragmentOptionsField() { + _getCustomizableProductFragmentOptionsField(): Field { return new Field('options') .addFieldList(this._getCustomizableProductFragmentOptionsFields()); } - _getCustomizableProductFragment() { + _getCustomizableProductFragment(): Field { return new Fragment('CustomizableProductInterface') .addFieldList([this._getCustomizableProductFragmentOptionsField()]); } - _getSimpleProductFragmentFields() { + _getSimpleProductFragmentFields(): Field[] { return [ this._getTierPricesField() ]; } - _getVirtualProductFragmentFields() { + _getVirtualProductFragmentFields(): Field[] { return [ this._getTierPricesField() ]; } - _getTierPricesField() { + _getTierPricesField(): Field { return new Field('price_tiers') .addFieldList(this._getTierPricesFields()); } - _getTierPricesFields() { + _getTierPricesFields(): Array { return [ this._getDiscountField(), this._getFinalPriceField(), @@ -1094,116 +1127,116 @@ export class ProductListQuery { ]; } - _getDiscountField() { + _getDiscountField(): Field { return new Field('discount') .addField('amount_off') .addField('percent_off'); } - _getFinalPriceField() { + _getFinalPriceField(): Field { return new Field('final_price') .addField('currency') .addField('value'); } - _getFinalPriceExclTaxField() { + _getFinalPriceExclTaxField(): Field { return new Field('final_price_excl_tax') .addField('currency') .addField('value'); } - _getRegularPriceField() { + _getRegularPriceField(): Field { return new Field('regular_price') .addField('currency') .addField('value'); } - _getRegularPriceExclTaxField() { + _getRegularPriceExclTaxField(): Field { return new Field('regular_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultFinalPriceExclTaxField() { + _getDefaultFinalPriceExclTaxField(): Field { return new Field('default_final_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultPriceField() { + _getDefaultPriceField(): Field { return new Field('default_price') .addField('currency') .addField('value'); } - _getDefaultFinalPriceField() { + _getDefaultFinalPriceField(): Field { return new Field('default_final_price') .addField('currency') .addField('value'); } - _getBundleProductFragment() { + _getBundleProductFragment(): Field { return new Fragment('BundleProduct') .addFieldList(this._getBundleProductFragmentFields()); } - _getConfigurableProductFragment() { + _getConfigurableProductFragment(): Field { return new Fragment('ConfigurableProduct') .addFieldList(this._getConfigurableProductFragmentFields()); } - _getSimpleProductFragment() { + _getSimpleProductFragment(): Field { return new Fragment('SimpleProduct') .addFieldList(this._getSimpleProductFragmentFields()); } - _getVirtualProductFragment() { + _getVirtualProductFragment(): Field { return new Fragment('VirtualProduct') .addFieldList(this._getVirtualProductFragmentFields()); } - _getSortOptionFields() { + _getSortOptionFields(): string[] { return [ 'value', 'label' ]; } - _getSortOptionsField() { + _getSortOptionsField(): Field { return new Field('options') .addFieldList(this._getSortOptionFields()); } - _getSortFields() { + _getSortFields(): Field[] { return [ this._getSortOptionsField() ]; } - _getSortField() { + _getSortField(): Field { return new Field('sort_fields') .addFieldList(this._getSortFields()); } - _getSwatchDataFields() { + _getSwatchDataFields(): string[] { return [ 'type', 'value' ]; } - _getSwatchDataField() { + _getSwatchDataField(): Field { return new Field('swatch_data') .addFieldList(this._getSwatchDataFields()); } - _getAggregationsField() { + _getAggregationsField(): Field { return new Field('aggregations') .setAlias('filters') .addFieldList(this._getAggregationsFields()); } - _getAggregationsFields() { + _getAggregationsFields(): Array { return [ new Field('label').setAlias('name'), new Field('attribute_code').setAlias('request_var'), @@ -1214,13 +1247,13 @@ export class ProductListQuery { ]; } - _getAggregationsOptionsField() { + _getAggregationsOptionsField(): Field { return new Field('options') .setAlias('filter_items') .addFieldList(this._getAggregationsOptionsFields()); } - _getAggregationsOptionsFields() { + _getAggregationsOptionsFields(): Array { return [ 'label', 'count', @@ -1229,7 +1262,7 @@ export class ProductListQuery { ]; } - _getPageInfoField() { + _getPageInfoField(): Field { return new Field('page_info') .addField('current_page') .addField('total_pages'); diff --git a/packages/scandipwa/src/query/Query.type.ts b/packages/scandipwa/src/query/Query.type.ts index 539e4f9bb3..e1cc93a359 100644 --- a/packages/scandipwa/src/query/Query.type.ts +++ b/packages/scandipwa/src/query/Query.type.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/scandipwa */ +import { GQLCustomerInput } from 'Type/Graphql.type'; + export type CategoryQueryOptions = { categoryIds: number; }; @@ -18,3 +20,47 @@ export type CmsPage = { url_key: string; identifier: string; }; + +export type ResetPasswordOptions = { + token: string; + password: string; + password_confirmation: string; +}; + +export type SignInOptions = { + email: string; + password: string; +}; + +export type ConfirmAccountOptions = SignInOptions & { + key: string; +}; + +export type ChangeCustomerPasswordOptions = { + password: string; + newPassword: string; +}; + +export type CreateAccountOptions = { + customer: Omit; + password: string; +}; + +export type OrdersOptions = { + orderId: number; + page: number; +}; + +export type ProductListOptions = { + isSingleProduct: boolean; + isPlp: boolean; + isForWishlist: boolean; + isForLinkedProducts: boolean; + noAttributes: boolean; + noVariants: boolean; + noVariantAttributes: boolean; + requireInfo: boolean; + notRequireInfo: boolean; + categoryIds: number[]; + args: Record; +}; From 23bb1f437703270d9ae1086f354be0d0f5ee2917 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Mon, 4 Apr 2022 17:13:45 +0300 Subject: [PATCH 012/192] Migrated most of utils --- packages/scandipwa/package.json | 3 +- ...ery.config.js => ProductGallery.config.ts} | 7 + packages/scandipwa/src/type/Config.type.ts | 8 +- packages/scandipwa/src/type/Global.type.ts | 22 +- packages/scandipwa/src/type/Menu.type.ts | 3 +- packages/scandipwa/src/type/Order.type.ts | 11 +- packages/scandipwa/src/type/Price.type.ts | 19 +- .../scandipwa/src/type/ProductList.type.ts | 105 ++++++---- packages/scandipwa/src/type/Router.type.ts | 27 +-- packages/scandipwa/src/util/Address/index.ts | 18 +- .../scandipwa/src/util/Category/Filters.ts | 4 +- .../DynamicReducer/{Helper.js => Helper.ts} | 6 +- .../DynamicReducer/{index.js => index.tsx} | 8 +- .../src/util/Form/{Extract.js => Extract.ts} | 93 ++++++--- .../src/util/Form/{Form.js => Form.ts} | 4 +- .../util/Form/{Transform.js => Transform.ts} | 6 +- .../src/util/FormPortalCollector/index.ts | 16 +- .../src/util/Menu/{Menu.js => Menu.ts} | 41 +++- .../src/util/Orders/{Orders.js => Orders.ts} | 16 +- .../src/util/Orders/{index.js => index.ts} | 0 .../scandipwa/src/util/Price/Price.config.js | 189 ------------------ .../scandipwa/src/util/Price/Price.config.ts | 189 ++++++++++++++++++ .../src/util/Price/{Price.js => Price.ts} | 15 +- .../src/util/Price/{index.js => index.ts} | 0 .../util/Product/{Extract.js => Extract.ts} | 130 +++++++----- .../Product/{Transform.js => Transform.ts} | 113 +++++++---- .../src/util/Product/{index.js => index.ts} | 0 .../{MakeCancelable.js => MakeCancelable.ts} | 4 +- .../src/util/Promise/{index.js => index.ts} | 0 .../src/util/Query/PrepareDocument.ts | 13 +- .../src/util/Request/{Error.js => Error.ts} | 0 .../src/util/Request/{Hash.js => Hash.ts} | 4 +- .../util/Request/{Mutation.js => Mutation.ts} | 5 +- .../src/util/Request/{Query.js => Query.ts} | 5 +- .../util/Request/{Request.js => Request.ts} | 70 ++++--- .../src/util/Request/{index.js => index.ts} | 0 .../util/Store/{Transform.js => Transform.ts} | 4 +- .../src/util/Store/{index.js => index.ts} | 39 ++-- .../scandipwa/src/util/Url/{Url.js => Url.ts} | 44 ++-- .../src/util/Url/{index.js => index.ts} | 0 .../scandipwa/src/util/Validator/Config.ts | 17 ++ .../Validator/{Validator.js => Validator.ts} | 54 +++-- .../src/util/Validator/{index.js => index.ts} | 0 .../Wishlist/{Wishlist.js => Wishlist.ts} | 5 +- .../src/util/Wishlist/{index.js => index.ts} | 0 yarn.lock | 10 + 46 files changed, 807 insertions(+), 520 deletions(-) rename packages/scandipwa/src/component/ProductGallery/{ProductGallery.config.js => ProductGallery.config.ts} (84%) rename packages/scandipwa/src/util/DynamicReducer/{Helper.js => Helper.ts} (67%) rename packages/scandipwa/src/util/DynamicReducer/{index.js => index.tsx} (71%) rename packages/scandipwa/src/util/Form/{Extract.js => Extract.ts} (70%) rename packages/scandipwa/src/util/Form/{Form.js => Form.ts} (85%) rename packages/scandipwa/src/util/Form/{Transform.js => Transform.ts} (79%) rename packages/scandipwa/src/util/Menu/{Menu.js => Menu.ts} (69%) rename packages/scandipwa/src/util/Orders/{Orders.js => Orders.ts} (73%) rename packages/scandipwa/src/util/Orders/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/util/Price/Price.config.js create mode 100644 packages/scandipwa/src/util/Price/Price.config.ts rename packages/scandipwa/src/util/Price/{Price.js => Price.ts} (67%) rename packages/scandipwa/src/util/Price/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Product/{Extract.js => Extract.ts} (79%) rename packages/scandipwa/src/util/Product/{Transform.js => Transform.ts} (74%) rename packages/scandipwa/src/util/Product/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Promise/{MakeCancelable.js => MakeCancelable.ts} (90%) rename packages/scandipwa/src/util/Promise/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Request/{Error.js => Error.ts} (100%) rename packages/scandipwa/src/util/Request/{Hash.js => Hash.ts} (96%) rename packages/scandipwa/src/util/Request/{Mutation.js => Mutation.ts} (82%) rename packages/scandipwa/src/util/Request/{Query.js => Query.ts} (83%) rename packages/scandipwa/src/util/Request/{Request.js => Request.ts} (78%) rename packages/scandipwa/src/util/Request/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Store/{Transform.js => Transform.ts} (87%) rename packages/scandipwa/src/util/Store/{index.js => index.ts} (52%) rename packages/scandipwa/src/util/Url/{Url.js => Url.ts} (79%) rename packages/scandipwa/src/util/Url/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Validator/{Validator.js => Validator.ts} (80%) rename packages/scandipwa/src/util/Validator/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Wishlist/{Wishlist.js => Wishlist.ts} (85%) rename packages/scandipwa/src/util/Wishlist/{index.js => index.ts} (100%) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index f5c11ffbd2..33c2d89f5e 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -24,6 +24,7 @@ "@types/react-dom": "^17.0.9", "@types/react-router": "^5.1.16", "@types/react-router-dom": "^5.1.8", + "@types/react-redux": "7.1.16", "eslint-config-airbnb-typescript": "^16.1.4", "get-graphql-schema": "^2.1.2", "graphql-schema-typescript": "^1.5.2", @@ -130,7 +131,7 @@ "parserOptions": { "project": "./tsconfig.json" }, - "ignorePatterns": ["package.json"], + "ignorePatterns": ["package.json", "src/*"], "env": { "browser": true }, diff --git a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.js b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts similarity index 84% rename from packages/scandipwa/src/component/ProductGallery/ProductGallery.config.js rename to packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts index 6cd06b2748..1927d11931 100644 --- a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.js +++ b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts @@ -21,3 +21,10 @@ export const THUMBNAIL_KEY = 'small_image'; export const AMOUNT_OF_PLACEHOLDERS = 0; export const PRODUCT_GALERY_POPUP_ID = 'ProductGalleryPopup'; + + +export enum ImageTypes { + SMALL_KEY = 'small_image', + THUMBNAIL_KEY = 'thumbnail', + IMAGE_KEY = 'image' +} \ No newline at end of file diff --git a/packages/scandipwa/src/type/Config.type.ts b/packages/scandipwa/src/type/Config.type.ts index a78a0f9b0f..b4dc03d777 100644 --- a/packages/scandipwa/src/type/Config.type.ts +++ b/packages/scandipwa/src/type/Config.type.ts @@ -17,11 +17,11 @@ export type Region = { export type Regions = Region[] -export type Countries = { - label?: string; - id?: string; +export type Country = { + label: string; + id: string; available_regions?: Region[]; -}[]; +}; export type CartConfig = { display_tax_in_price?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_PRICE)) diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index dca06fdef4..7bc1cd5d6a 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -9,7 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import { StoreEnhancer } from 'redux'; +import { + Action, + Reducer, + ReducersMapObject, + Store, + StoreEnhancer +} from 'redux'; // import { ValidationData } from 'Util/Validator'; @@ -25,6 +31,7 @@ declare global { } secure_base_media_url?: string prefetchedImages: Record + storeList: Array // dataCache?: Record> } @@ -69,12 +76,23 @@ declare global { mobile: boolean; platform: string; } - + interface NavigatorUAData extends UALowEntropyJSON { getHighEntropyValues(hints: string[]): Promise; toJSON(): UALowEntropyJSON; } + interface HTMLInputElement { + fileData?: string + } + + export type InjectReducer = (key: string, asyncReducer: Reducer>) => void; + + export type ModifiedReduxStore = (Store> & { + asyncReducers?: ReducersMapObject + injectReducer?: InjectReducer + }) + // interface HTMLElementEventMap { // validate: ValidationData // } diff --git a/packages/scandipwa/src/type/Menu.type.ts b/packages/scandipwa/src/type/Menu.type.ts index dc925f339c..3becabd4a1 100644 --- a/packages/scandipwa/src/type/Menu.type.ts +++ b/packages/scandipwa/src/type/Menu.type.ts @@ -19,9 +19,10 @@ export type MenuItem = { title?: string; item_class?: string; icon?: string; - url?: Location; + url: string; cms_page_identifier?: string; category_id?: number; + url_type: number } export type MenuItems = MenuItem[]; diff --git a/packages/scandipwa/src/type/Order.type.ts b/packages/scandipwa/src/type/Order.type.ts index fa6d2754d6..9528bbc6c6 100644 --- a/packages/scandipwa/src/type/Order.type.ts +++ b/packages/scandipwa/src/type/Order.type.ts @@ -60,13 +60,13 @@ export type orderItemQty= { } export type Money= { - currency?: string; - value?: number; + currency: string; + value: number; } export type Discount= { - amount?: Money; - value?: number; + amount: Money; + value: number; } export type OptionItem= { @@ -124,7 +124,8 @@ export type OrderTabs = OrderTab[]; export type Order= { can_reorder?: boolean; carrier?: string; - id?: string; + id: string; + uid: string; order_date?: string; credit_memos?: string; invoices?: string; diff --git a/packages/scandipwa/src/type/Price.type.ts b/packages/scandipwa/src/type/Price.type.ts index 012dca2fcf..9134179268 100644 --- a/packages/scandipwa/src/type/Price.type.ts +++ b/packages/scandipwa/src/type/Price.type.ts @@ -12,7 +12,7 @@ export type PriceItem = { currency: string; value: number; - valueFormatted: string; + valueFormatted?: string; } export type Discount = { @@ -21,14 +21,19 @@ export type Discount = { } export type PriceVariant = { - discount?: Discount; - final_price?: PriceItem; - regular_price?: PriceItem; + discount: Discount; + final_price: PriceItem; + final_price_excl_tax: PriceItem; + regular_price: PriceItem; + regular_price_excl_tax: PriceItem; + default_final_price: PriceItem; + default_final_price_excl_tax: PriceItem; + default_price: PriceItem; } -export type Price = { - minimum_price?: PriceVariant; - maximal_price?: PriceVariant; +export type PriceRange = { + minimum_price: PriceVariant; + maximum_price: PriceVariant; } export type OriginalPrice = { diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 51120802da..6e371a4c05 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -11,10 +11,11 @@ import { StockStatus } from 'Component/Product/Stock.config'; import { MetaTitle } from 'Type/Common.type'; -import { Price } from 'Type/Price.type'; +import { PriceRange } from 'Type/Price.type'; import { UrlRewrite } from 'Type/Router.type'; export type Attribute = { + attribute_id?: number; attribute_code?: string; attribute_type?: string; attribute_value?: string; @@ -121,10 +122,10 @@ export type DescriptionType = { }; export type StockItem = { - in_stock?: boolean; + in_stock: boolean; min_sale_qty?: number; max_sale_qty?: number; - qty_increments?: number; + qty_increments: number; }; export type OptionValue = { @@ -162,9 +163,9 @@ export type PriceTier = { amount_off?: number; percent_off?: number; }; - final_price?: { - currency?: string; - value?: number; + final_price: { + currency: string; + value: number; }; quantity?: number; }; @@ -179,10 +180,15 @@ export type CustomizableOptionShape = { } export type CustomizableOption = CustomizableOptionShape & { - uid?: string; - option_type_id?: number; - title?: string; + uid: string; + option_type_id: number; + title: string; sort_order?: number; + position: number; + value?: { + priceExclTax: number; + priceInclTax: number; + } } export type InputOption = CustomizableOptionShape & { @@ -201,8 +207,8 @@ export type ItemShape = ReviewSummaryShape & { id: number, image: Image, name: string, - options: CustomizableOptions, - price_range: Price, + options: CustomizableOption[], + price_range: PriceRange, price_tiers: PriceTier, review_summary: ReviewSummaryShape, short_description: DescriptionType, @@ -217,6 +223,7 @@ export type ItemShape = ReviewSummaryShape & { uid: string, url: string, url_rewrites: UrlRewrite[] + salable_qty: number } export type Item = ItemShape; @@ -227,30 +234,34 @@ export type Pages = Record; export type Quantity = number | Record; -export type ItemOptionsType = { +export type ItemOptionProduct = { + name: string; + stock_status: string; + price_range: PriceRange; + dynamic_price: boolean; + type_id: string; +} + +export type ItemOption = { can_change_quantity?: boolean; id?: number; - is_default?: boolean; + is_default: boolean; label?: string; - position?: number; + position: number; price?: number; price_type?: string; - quantity?: Quantity; - uid?: string; - product?: { - name?: string; - stock_status?: string; - price_range?: Price; - }; + quantity: Quantity; + uid: string; + product: Product; regularOptionPrice?: number; regularOptionPriceExclTax?: number; - finalOptionPrice?: number; - finalOptionPriceExclTax?: number; -}[]; + finalOptionPrice: number; + finalOptionPriceExclTax: number; +}; -export type ProductItemsType = { +export type ProductBundleItems = { option_id?: number; - options?: ItemOptionsType; + options: ItemOption[]; position?: number; required?: boolean; sku?: string; @@ -258,7 +269,13 @@ export type ProductItemsType = { type?: string; }[]; -export type Product = ItemShape & { +export type ProductGroupedItems = { + position: number; + qty: number; + product: ItemShape +}[]; + +export interface Product extends ItemShape{ canonical_url?: string; categories?: ProductCategories; description?: DescriptionType; @@ -270,15 +287,35 @@ export type Product = ItemShape & { special_price?: number; url_key?: string; quantity?: number; - items?: ProductItemsType; reviews?: Reviews; + variants?: ProductVariant[] + items?: unknown[]; + downloadable_product_links?: ProductDownloadableLink[] + dynamic_price?: boolean }; -export type DownloadableSamples = { - sample_url?: Product | string; - sort_order?: number; - title?: string; -}[]; +export interface ProductGrouped extends Product { + items: ProductGroupedItems; +} + +export interface ProductBundle extends Product { + items: ProductBundleItems; + dynamic_price: boolean +} + +export type ProductDownloadable = Product & { + downloadable_product_links: ProductDownloadableLink[] +} + +export type ProductDownloadableLink = { + price: number; + sample_url?: string; + sort_order?: number; + title?: string; + uid: string; +} + +export type ProductVariant = ItemShape export type PriceConfiguration = { containsOptions?: boolean; @@ -313,4 +350,4 @@ export type OptionsList = { uid?: string; }[]; -export type LinkedProducts = Record +export type LinkedProducts = Record \ No newline at end of file diff --git a/packages/scandipwa/src/type/Router.type.ts b/packages/scandipwa/src/type/Router.type.ts index 9cfdec3041..12663a2b58 100644 --- a/packages/scandipwa/src/type/Router.type.ts +++ b/packages/scandipwa/src/type/Router.type.ts @@ -9,30 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ -import { LocationState } from 'history'; +import { RouteComponentProps } from 'react-router-dom'; -export type Location = { - pathname?: string; - search?: string; - state?: LocationState; - hash?: string; - key?: string; -} +// TODO -// TODO use History -export type History = { - length?: number; - action?: string; - location?: Location; -} +export type History = RouteComponentProps['history'] & {} -// TODO use match from react-router -export type Match = { - path?: string; - url?: string; - params?: any; - isExact?: boolean; -} +export type Location = RouteComponentProps['location'] & {} + +export type Match = RouteComponentProps['match'] & {} export type UrlRewrite = { id?: number; diff --git a/packages/scandipwa/src/util/Address/index.ts b/packages/scandipwa/src/util/Address/index.ts index 8a274c6658..84ac660995 100644 --- a/packages/scandipwa/src/util/Address/index.ts +++ b/packages/scandipwa/src/util/Address/index.ts @@ -11,7 +11,7 @@ import StoreItem from 'Component/StoreItem'; import { Address, TrimmedAddress } from 'Type/Account.type'; -import { Countries, Regions, Stores } from 'Type/Config.type'; +import { Country, Regions, Stores } from 'Type/Config.type'; /** @namespace Util/Address/Index/trimCheckoutCustomerAddress */ export const trimCheckoutCustomerAddress = (customerAddress: Address): TrimmedAddress => { @@ -95,7 +95,7 @@ export const removeEmptyStreets = (street: T | T[]): T | T[] => ( /** transforming "street[index]" entries into a single "street" object for checkout/billing/myAccoutAddress form fields object */ /** @namespace Util/Address/Index/setAddressesInFormObject */ -export const setAddressesInFormObject = (fields: T, numberOfLines: number, prefix: string = 'street'): T => { +export const setAddressesInFormObject = (fields: Record, numberOfLines: number, prefix: string = 'street'): Record => { const addressKeys = new Array(numberOfLines) .fill('') .map((_, index) => `${prefix}${index}`); @@ -103,25 +103,25 @@ export const setAddressesInFormObject = (fields: T, numberOfLines: number, pr const addressValues = addressKeys.map((key) => fields[key]); // removing street related fields from the form object - const newFields = Object.keys(fields) + const newFields:Record = Object.keys(fields) .filter((key) => !addressKeys.includes(key)) .reduce( (acc, key) => { acc[key] = fields[key]; return acc; - }, {} + }, {} as Record ); // setting single street entry to the form object newFields.street = removeEmptyStreets(addressValues); - return newFields as ; + return newFields; }; // get Form Fields object depending on addressLinesQty /** @namespace Util/Address/Index/getFormFields */ -export const getFormFields = (fields: T, addressLinesQty: number): T => { +export const getFormFields = (fields: Record, addressLinesQty: number): T | Record => { if (addressLinesQty === 1) { return fields; } @@ -169,16 +169,16 @@ export const getDefaultAddressLabel = (address: Address): string => { }; /** @namespace Util/Address/Index/getAvailableRegions */ -export const getAvailableRegions = (country_id: string, countries: Countries) => { +export const getAvailableRegions = (country_id: string, countries: Country[]) => { const country = countries.find(({ id }) => id === country_id) || {}; - const { available_regions } = country; + const { available_regions } = country as Country; // need to handle null value return available_regions || []; }; /** @namespace Util/Address/Index/getFormattedRegion */ -export const getFormattedRegion = (address: Address, countries: Countries) => { +export const getFormattedRegion = (address: Address, countries: Country[]) => { const { country_id, region: regionData } = address; if (!regionData) { diff --git a/packages/scandipwa/src/util/Category/Filters.ts b/packages/scandipwa/src/util/Category/Filters.ts index b1c662bf02..fbeb3b7e1f 100644 --- a/packages/scandipwa/src/util/Category/Filters.ts +++ b/packages/scandipwa/src/util/Category/Filters.ts @@ -13,8 +13,8 @@ import { formatPrice } from 'Util/Price'; /** @namespace Util/Category/Filters/getPriceFilterLabel */ export const getPriceFilterLabel = (from: number | string, to: number | string, currencyCode: string): string => { - const priceFrom = formatPrice(from, currencyCode); - const priceTo = formatPrice(to, currencyCode); + const priceFrom = formatPrice(Number(from), currencyCode); + const priceTo = formatPrice(Number(to), currencyCode); if (from === '*') { return __('Up to %s', priceTo); diff --git a/packages/scandipwa/src/util/DynamicReducer/Helper.js b/packages/scandipwa/src/util/DynamicReducer/Helper.ts similarity index 67% rename from packages/scandipwa/src/util/DynamicReducer/Helper.js rename to packages/scandipwa/src/util/DynamicReducer/Helper.ts index 97256b447c..c9ce073001 100644 --- a/packages/scandipwa/src/util/DynamicReducer/Helper.js +++ b/packages/scandipwa/src/util/DynamicReducer/Helper.ts @@ -9,13 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ +import { ReducersMapObject } from "redux"; + /** * @param store * @param reducers */ -export default function injectToReducers(store, reducers) { + export default function injectToReducers >(store: T, reducers: ReducersMapObject) { Object.keys(reducers).forEach((key) => { - if (!Reflect.has(store.asyncReducers, key)) { + if (store.asyncReducers && store.injectReducer && !Reflect.has(store.asyncReducers, key)) { // eslint-disable-next-line no-param-reassign store.asyncReducers[key] = reducers[key]; store.injectReducer(key, reducers[key]); diff --git a/packages/scandipwa/src/util/DynamicReducer/index.js b/packages/scandipwa/src/util/DynamicReducer/index.tsx similarity index 71% rename from packages/scandipwa/src/util/DynamicReducer/index.js rename to packages/scandipwa/src/util/DynamicReducer/index.tsx index 5f0cb240f9..70d092feae 100644 --- a/packages/scandipwa/src/util/DynamicReducer/index.js +++ b/packages/scandipwa/src/util/DynamicReducer/index.tsx @@ -9,12 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ +import { ElementType } from 'react'; +import { ReducersMapObject } from 'redux'; import injectReducers from 'Util/DynamicReducer/Helper'; -import getStore from 'Util/Store'; +import { getStore } from 'Util/Store'; /** @namespace Util/DynamicReducer/Index/withReducers */ -export const withReducers = (reducers) => (WrappedComponent) => { - const injectAndExecute = (props) => { +export const withReducers = (reducers: ReducersMapObject) => (WrappedComponent: ElementType ) => { + const injectAndExecute = (props: T) => { injectReducers(getStore(), reducers); // eslint-disable-next-line @scandipwa/scandipwa-guidelines/jsx-no-props-destruction diff --git a/packages/scandipwa/src/util/Form/Extract.js b/packages/scandipwa/src/util/Form/Extract.ts similarity index 70% rename from packages/scandipwa/src/util/Form/Extract.js rename to packages/scandipwa/src/util/Form/Extract.ts index 95434947f7..2c332f251e 100644 --- a/packages/scandipwa/src/util/Form/Extract.js +++ b/packages/scandipwa/src/util/Form/Extract.ts @@ -21,12 +21,12 @@ import { DATE_FIELDS_COUNT, FIELD_DATE_TYPE, TIME_FORMAT } from 'Component/Field * @namespace Util/Form/Extract/zeroBasedValue */ // eslint-disable-next-line no-magic-numbers -export const zeroBasedValue = (value, lessThan = 10) => ( +export const zeroBasedValue = (value: T, lessThan: number = 10): string | T => ( (+value < lessThan) ? `0${value}` : value ); /** @namespace Util/Form/Extract/adjustHours */ -export const adjustHours = (hours, timeFormat) => { +export const adjustHours = (hours: number, timeFormat: string): number => { if (timeFormat === TIME_FORMAT.H12) { if (hours > HOURS_12H_COUNT) { return hours % HOURS_12H_COUNT; @@ -45,7 +45,7 @@ export const adjustHours = (hours, timeFormat) => { * @returns {string|*} * @namespace Util/Form/Extract/getDateValue */ -export const getDateValue = (dateValue) => { +export const getDateValue = (dateValue: number | string | Date): number | string | Date => { try { const date = new Date(dateValue); const day = zeroBasedValue(date.getDate()); @@ -61,8 +61,18 @@ export const getDateValue = (dateValue) => { } }; +export type YearRangeAttribute = { + minYear: number; + maxYear: number; +} + +export type DatRangeAttribute = { + minDate: Date; + maxDate: Date; +} + /** @namespace Util/Form/Extract/calcYearRangeAttributes */ -export const calcYearRangeAttributes = (startYear, endYear) => { +export const calcYearRangeAttributes = (startYear: number, endYear: number): YearRangeAttribute => { const currentYear = new Date().getFullYear(); // https://docs.magento.com/user-guide/stores/attribute-date-time-options.html @@ -81,10 +91,10 @@ export const calcYearRangeAttributes = (startYear, endYear) => { }; /** @namespace Util/Form/Extract/getYearRangeAttributes */ -export const getYearRangeAttributes = (yearRange = ',', isYear = false) => { +export const getYearRangeAttributes = (yearRange: string = ',', isYear: boolean = false): YearRangeAttribute | DatRangeAttribute => { const [startYear, endYear] = yearRange.split(','); - const { minYear, maxYear } = calcYearRangeAttributes(startYear, endYear); + const { minYear, maxYear } = calcYearRangeAttributes(Number(startYear), Number(endYear)); if (isYear) { return { minYear, maxYear }; @@ -97,15 +107,21 @@ export const getYearRangeAttributes = (yearRange = ',', isYear = false) => { }; /** @namespace Util/Form/Extract/isMagentoDateFormatValid */ -export const isMagentoDateFormatValid = (dateFieldsOrder) => new RegExp(Array(DATE_FIELDS_COUNT) +export const isMagentoDateFormatValid = (dateFieldsOrder: string): boolean => new RegExp(Array(DATE_FIELDS_COUNT) .fill('[dmy]').join(',')) .test(dateFieldsOrder); /** @namespace Util/Form/Extract/getTimeFormat */ -export const getTimeFormat = (timeFormat) => (timeFormat === TIME_FORMAT.H12 ? 'h:mm aa' : 'HH:mm'); +export const getTimeFormat = (timeFormat: string): string => (timeFormat === TIME_FORMAT.H12 ? 'h:mm aa' : 'HH:mm'); + +export type DateMap = { + d: string; + m: string; + y: string; +} /** @namespace Util/Form/Extract/getDateFormat */ -export const getDateFormat = (dateFieldsOrder) => { +export const getDateFormat = (dateFieldsOrder: string): string => { if (!isMagentoDateFormatValid(dateFieldsOrder)) { return 'dd/MM/yyyy'; } @@ -114,13 +130,13 @@ export const getDateFormat = (dateFieldsOrder) => { d: 'dd', m: 'MM', y: 'yyyy' - }; + } as DateMap; - return dateFieldsOrder.split(',').map((field) => dateMap[field]).join('/'); + return dateFieldsOrder.split(',').map((field) => dateMap[field as keyof DateMap]).join('/'); }; /** @namespace Util/Form/Extract/getDateTimeFormat */ -export const getDateTimeFormat = (type, dateFieldsOrder, timeFormat) => { +export const getDateTimeFormat = (type: string, dateFieldsOrder: string, timeFormat: string): string => { const timePart = type === FIELD_DATE_TYPE.time || type === FIELD_DATE_TYPE.dateTime ? getTimeFormat(timeFormat) : ''; @@ -133,7 +149,7 @@ export const getDateTimeFormat = (type, dateFieldsOrder, timeFormat) => { }; /** @namespace Util/Form/Extract/adjustAmpmHours */ -export const adjustAmpmHours = (hours, ampm) => { +export const adjustAmpmHours = (hours: number, ampm: string): number => { if (ampm === 'PM') { return (hours % HOURS_12H_COUNT) + HOURS_12H_COUNT; } @@ -145,8 +161,24 @@ export const adjustAmpmHours = (hours, ampm) => { return hours; }; +export type DatesData = { + type?: string; + year?: string; + month?: string; + day?: string; + hours?: string; + minutes?: string; + ampm: string; +}; + +export type DateObject = { + name: string; + value: string; + type: string; +} + /** @namespace Util/Form/Extract/transformDateFieldsData */ -export const transformDateFieldsData = (datesData) => Object.entries(datesData).reduce((prev, [name, data]) => { +export const transformDateFieldsData = (datesData: Record) => Object.entries(datesData).reduce((prev, [name, data]) => { const { type, year, @@ -184,30 +216,31 @@ export const transformDateFieldsData = (datesData) => Object.entries(datesData). } return prev; -}, []); +}, [] as Record[]); /** @namespace Util/Form/Extract/groupDateFieldsData */ -export const groupDateFieldsData = (fields) => Array.from(fields) +export const groupDateFieldsData = (fields: NodeListOf) => Array.from(fields) .reduce((prev, field) => { - const dataType = field.getAttribute(FIELD_TYPE_ATTR); + const dataType = field.getAttribute(FIELD_TYPE_ATTR) || ''; if (!Object.values(FIELD_DATE_TYPE).includes(dataType)) { return prev; } - const { name, value } = field; + const { name, value } = field as HTMLSelectElement; const fieldName = field.getAttribute(FIELD_NAME_ATTR); - const { [name]: prevData } = prev; + const { [name as keyof DatesData]: prevData } = prev; return { ...prev, [name]: { ...prevData, type: dataType, - [fieldName]: value + [fieldName as keyof DatesData]: value } }; - }, {}); + }, {} as Record); + /** * Returns fields values from DOM/Form @@ -218,15 +251,15 @@ export const groupDateFieldsData = (fields) => Array.from(fields) * @returns {{}|*[]} * @namespace Util/Form/Extract/getFieldsData */ -export const getFieldsData = (DOM, excludeEmpty = false, ignoreTypes = [], asObject = false) => { - const fields = DOM.querySelectorAll('input, textarea, select'); +export const getFieldsData = (DOM: Document, excludeEmpty: boolean = false, ignoreTypes: string[] = [], asObject: boolean = false) => { + const fields: NodeListOf = DOM.querySelectorAll('input, textarea, select'); const output = []; - const dateFieldsGrouped = groupDateFieldsData(fields); + const dateFieldsGrouped = groupDateFieldsData(fields) output.push(...transformDateFieldsData(dateFieldsGrouped)); fields.forEach((field) => { - if (Object.values(FIELD_DATE_TYPE).includes(field.getAttribute(FIELD_TYPE_ATTR))) { + if (Object.values(FIELD_DATE_TYPE).includes(field.getAttribute(FIELD_TYPE_ATTR) || '')) { return; } @@ -240,10 +273,10 @@ export const getFieldsData = (DOM, excludeEmpty = false, ignoreTypes = [], asObj } // eslint-disable-next-line no-nested-ternary - const value = type === FIELD_TYPE.checkbox || type === FIELD_TYPE.radio + const value = field instanceof HTMLInputElement && (type === FIELD_TYPE.checkbox || type === FIELD_TYPE.radio) // eslint-disable-next-line no-nested-ternary ? (field.checked ? field.value === 'on' ? true : field.value : false) - : type === FIELD_TYPE.file + : field instanceof HTMLInputElement && type === FIELD_TYPE.file ? field.fileData : field.value; @@ -261,10 +294,10 @@ export const getFieldsData = (DOM, excludeEmpty = false, ignoreTypes = [], asObj }); if (asObject) { - const objectOutput = {}; + const objectOutput: Record = {}; output.forEach((field) => { - const { name } = field; - objectOutput[name] = field; + const { name } = field as DateObject; + objectOutput[name] = field as DateObject; }); return objectOutput; diff --git a/packages/scandipwa/src/util/Form/Form.js b/packages/scandipwa/src/util/Form/Form.ts similarity index 85% rename from packages/scandipwa/src/util/Form/Form.js rename to packages/scandipwa/src/util/Form/Form.ts index 39b0de0307..7d647a5082 100644 --- a/packages/scandipwa/src/util/Form/Form.js +++ b/packages/scandipwa/src/util/Form/Form.ts @@ -9,13 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ +import { ValidationDOMOutput } from 'Util/Validator'; + /** * Returns name: value pair object for form output. * @param fields (Array) * @param validation ({}) * @namespace Util/Form/scrollToError */ -export const scrollToError = (fields = [], validation = {}) => { +export const scrollToError = (fields: any[] = [], validation: ValidationDOMOutput | any = {}): void => { if (!validation || !Array.isArray(fields) || fields.length === 0) { return; } diff --git a/packages/scandipwa/src/util/Form/Transform.js b/packages/scandipwa/src/util/Form/Transform.ts similarity index 79% rename from packages/scandipwa/src/util/Form/Transform.js rename to packages/scandipwa/src/util/Form/Transform.ts index 23568793cc..94de762e38 100644 --- a/packages/scandipwa/src/util/Form/Transform.js +++ b/packages/scandipwa/src/util/Form/Transform.ts @@ -15,15 +15,15 @@ * @returns {{}} * @namespace Util/Form/Transform/transformToNameValuePair */ -export const transformToNameValuePair = (fields) => { - const filteredFields = {}; +export const transformToNameValuePair = (fields: any | any[]): T => { + const filteredFields: Record = {}; const arrayFormat = !Array.isArray(fields) ? Object.values(fields) : fields; arrayFormat.forEach(({ value, name }) => { filteredFields[name] = value; }); - return filteredFields; + return filteredFields as unknown as T;; }; export default transformToNameValuePair; diff --git a/packages/scandipwa/src/util/FormPortalCollector/index.ts b/packages/scandipwa/src/util/FormPortalCollector/index.ts index 7ce0757498..1d9ce5d010 100644 --- a/packages/scandipwa/src/util/FormPortalCollector/index.ts +++ b/packages/scandipwa/src/util/FormPortalCollector/index.ts @@ -10,10 +10,14 @@ */ /** @namespace Util/FormPortalCollector/Index */ -export class FormPortalCollector { - portalsObservers = {}; - - subscribe(id:string, f: T, name: string): void { +export class FormPortalCollector < + T extends string, + U extends () => void, + S extends string +> { + portalsObservers: Record> = {}; + + subscribe(id: T, f: U, name: S) { if (this.portalsObservers[id]) { this.portalsObservers[id][name] = f; @@ -23,7 +27,7 @@ export class FormPortalCollector { this.portalsObservers[id] = { [name]: f }; } - unsubscribe(id:string, name:string): void { + unsubscribe(id: T, name: S) { if (!this.portalsObservers[id]) { return; } @@ -31,7 +35,7 @@ export class FormPortalCollector { delete this.portalsObservers[id][name]; } - collect(id:string) { + collect(id: S) { const portals = this.portalsObservers[id] || {}; return Object.values(portals).map((portal) => portal()); diff --git a/packages/scandipwa/src/util/Menu/Menu.js b/packages/scandipwa/src/util/Menu/Menu.ts similarity index 69% rename from packages/scandipwa/src/util/Menu/Menu.js rename to packages/scandipwa/src/util/Menu/Menu.ts index c9ba52798f..7d2d999599 100644 --- a/packages/scandipwa/src/util/Menu/Menu.js +++ b/packages/scandipwa/src/util/Menu/Menu.ts @@ -9,12 +9,28 @@ * @link https://github.com/scandipwa/base-theme */ +import { MenuItem } from "Type/Menu.type"; + /* eslint-disable no-param-reassign */ export const TYPE_CUSTOM_URL = 0; export const TYPE_CMS_PAGE = 1; export const TYPE_CATEGORY = 2; +type MenuLocation = { + pathname: string; + search: string; + state: { + category?: number; + page?: boolean; + } +} | string; + +export type FormattedMenuItem = Omit & { + url: MenuLocation + children: Record +} + /** * Given an array of menu items, returns a copy of the array, sorted by their parent ID, then by their sort order (position) * @@ -22,14 +38,17 @@ export const TYPE_CATEGORY = 2; * @returns {array} the sorted array * @namespace Util/Menu/getSortedItems */ -export const getSortedItems = (unsortedItems) => Array.from(unsortedItems).sort(( +export const getSortedItems = (unsortedItems: MenuItem[]): MenuItem[] => Array.from(unsortedItems).sort(( { parent_id: PID, position: P }, { parent_id: prevPID, position: prevP } ) => (PID - prevPID) || (P - prevP)); /** @namespace Util/Menu */ export class Menu { - getMenuUrl({ url, url_type, category_id }) { + menu: Record = {}; + menuPositionReference: Record = {}; + + getMenuUrl({ url, url_type, category_id }: Pick): MenuLocation { switch (url_type) { case TYPE_CATEGORY: return { @@ -54,7 +73,7 @@ export class Menu { url_type, category_id, ...item - }) { + }: MenuItem ): FormattedMenuItem { return { ...item, url: this.getMenuUrl({ url, url_type, category_id }), @@ -62,18 +81,20 @@ export class Menu { }; } - setToValue(obj, path, value) { + // TODO from child to menu item ??? Any + setToValue (obj: Record | any, path: string, value: FormattedMenuItem) { // eslint-disable-next-line fp/no-let let i; - path = path.split('.'); + const pathArray = path.split('.'); // eslint-disable-next-line fp/no-loops - for (i = 0; i < path.length - 1; i++) { - obj = obj[path[i]]; + for (i = 0; i < pathArray.length - 1; i++) { + obj = obj[pathArray[i]]; } - obj[path[i]] = value; + + obj[pathArray[i]] = value; } - createItem(data) { + createItem(data: MenuItem) { const { parent_id, item_id } = data; if (parent_id === 0) { @@ -93,7 +114,7 @@ export class Menu { } } - reduce({ items: unsortedItems }) { + reduce({ items: unsortedItems }: Record) { this.menu = {}; this.menuPositionReference = {}; diff --git a/packages/scandipwa/src/util/Orders/Orders.js b/packages/scandipwa/src/util/Orders/Orders.ts similarity index 73% rename from packages/scandipwa/src/util/Orders/Orders.js rename to packages/scandipwa/src/util/Orders/Orders.ts index 2fa9abe4a7..554f18e072 100644 --- a/packages/scandipwa/src/util/Orders/Orders.js +++ b/packages/scandipwa/src/util/Orders/Orders.ts @@ -10,12 +10,14 @@ * @link https://github.com/scandipwa/scandipwa */ +import { Orders, OrderProduct, OrderProducts, Discount } from "Type/Order.type"; + /** @namespace Util/Orders/getFormattedDate */ -export const getFormattedDate = (rawDate = '') => { +export const getFormattedDate = (rawDate: string = '') => { const date = new Date(rawDate.replace(/\s/, 'T')); const RADIX = 10; - const addLeadingZero = (value) => (value < RADIX ? `0${value}` : value); + const addLeadingZero = (value: number) => (value < RADIX ? `0${value}` : value); const day = addLeadingZero(date.getDate()); const month = addLeadingZero(date.getMonth() + 1); @@ -24,7 +26,7 @@ export const getFormattedDate = (rawDate = '') => { }; /** @namespace Util/Orders/formatOrders */ -export const formatOrders = (orders) => orders.reduceRight((acc, order) => { +export const formatOrders = (orders: Orders) => orders.reduceRight((acc, order) => { const { order_date, id: uid } = order; const formattedDate = getFormattedDate(order_date); @@ -36,10 +38,10 @@ export const formatOrders = (orders) => orders.reduceRight((acc, order) => { created_at: formattedDate } ]; -}, []); +}, [] as Orders); /** @namespace Util/Orders/getOrderItemQtyToArray */ -export const getOrderItemQtyToArray = (product) => { +export const getOrderItemQtyToArray = (product: OrderProduct) => { const { quantity_ordered = 0, quantity_canceled = 0, @@ -60,9 +62,9 @@ export const getOrderItemQtyToArray = (product) => { }; /** @namespace Util/Orders/getProductFromOrder */ -export const getProductFromOrder = (allProducts, requiredProductSku) => allProducts +export const getProductFromOrder = (allProducts: OrderProducts, requiredProductSku: string) => allProducts .find(({ product_sku }) => product_sku === requiredProductSku); /** @namespace Util/Orders/getOrderItemRowDiscount */ -export const getOrderItemRowDiscount = (discounts) => discounts +export const getOrderItemRowDiscount = (discounts: Discount[]) => discounts .reduce((currentValue, { amount: { value } }) => value + currentValue, 0); diff --git a/packages/scandipwa/src/util/Orders/index.js b/packages/scandipwa/src/util/Orders/index.ts similarity index 100% rename from packages/scandipwa/src/util/Orders/index.js rename to packages/scandipwa/src/util/Orders/index.ts diff --git a/packages/scandipwa/src/util/Price/Price.config.js b/packages/scandipwa/src/util/Price/Price.config.js deleted file mode 100644 index a85287a73d..0000000000 --- a/packages/scandipwa/src/util/Price/Price.config.js +++ /dev/null @@ -1,189 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -export const TIER_PRICES = 'TIER_PRICES'; - -export const HUNDRED_PERCENT = 100; - -export default { - AED: 'د.إ', - AFN: '؋', - ALL: 'L', - AMD: '֏', - ANG: 'ƒ', - AOA: 'Kz', - ARS: '$', - AUD: '$', - AWG: 'ƒ', - AZN: '₼', - BAM: 'KM', - BBD: 'Bds$', - BDT: '৳', - BGN: 'лв', - BHD: '.د.ب', - BIF: 'FBu', - BMD: '$', - BND: 'B$', - BOB: '$b', - BRL: 'R$', - BSD: 'B$', - BTC: '฿', - BTN: 'Nu.', - BWP: 'P', - BYR: 'Br', - BYN: 'Br', - BZD: 'BZ$', - CAD: 'CA$', - CDF: 'FC', - CHF: 'CHF', - CLP: '$', - CNY: '¥', - COP: '$', - CRC: '₡', - CUC: 'CUC$', - CUP: '₱', - CVE: '$', - CZK: 'Kč', - DJF: 'Fdj', - DKK: 'kr', - DOP: 'RD$', - DZD: 'دج', - EEK: 'kr', - EGP: '£', - ERN: 'Nfk', - ETB: 'Br', - ETH: 'Ξ', - EUR: '€', - FJD: 'FJ$', - FKP: '£', - GBP: '£', - GEL: '₾', - GGP: '£', - GHC: '₵', - GHS: 'GH₵', - GIP: '£', - GMD: 'D', - GNF: 'FG', - GTQ: 'Q', - GYD: 'G$', - HKD: 'HK$', - HNL: 'L', - HRK: 'kn', - HTG: 'G', - HUF: 'Ft', - IDR: 'Rp', - ILS: '₪', - IMP: '£', - INR: '₹', - IQD: 'ع.د', - IRR: '﷼', - ISK: 'kr', - JEP: '£', - JMD: 'J$', - JOD: 'JD', - JPY: '¥', - KES: 'KSh', - KGS: 'лв', - KHR: '៛', - KMF: 'CF', - KPW: '₩', - KRW: '₩', - KWD: 'KD', - KYD: '$', - KZT: 'лв', - LAK: '₭', - LBP: '£', - LKR: '₨', - LRD: 'L$', - LSL: 'M', - LTC: 'Ł', - LTL: 'Lt', - LVL: 'Ls', - LYD: 'LD', - MAD: 'MAD', - MDL: 'lei', - MGA: 'Ar', - MKD: 'ден', - MMK: 'K', - MNT: '₮', - MOP: 'MOP$', - MRO: 'UM', - MRU: 'UM', - MUR: '₨', - MVR: 'Rf', - MWK: 'MK', - MXN: 'Mex$', - MYR: 'RM', - MZN: 'MT', - NAD: '$', - NGN: '₦', - NIO: 'C$', - NOK: 'kr', - NPR: '₨', - NZD: '$', - OMR: '﷼', - PAB: 'B/.', - PEN: 'S/.', - PGK: 'K', - PHP: '₱', - PKR: '₨', - PLN: 'zł', - PYG: 'Gs', - QAR: '﷼', - RMB: '¥', - RON: 'lei', - RSD: 'Дин.', - RUB: '₽', - RWF: 'R₣', - SAR: '﷼', - SBD: 'Si$', - SCR: '₨', - SDG: 'ج.س.', - SEK: 'kr', - SGD: '$', - SHP: '£', - SLL: 'Le', - SOS: 'S', - SRD: '$', - SSP: '£', - STD: 'Db', - STN: 'Db', - SVC: '₡', - SYP: '£', - SZL: 'E', - THB: '฿', - TJS: 'SM', - TMT: 'T', - TND: 'د.ت', - TOP: 'T$', - TRL: '₤', - TRY: '₺', - TTD: 'TT$', - TVD: '$', - TWD: 'NT$', - TZS: 'TSh', - UAH: '₴', - UGX: 'USh', - USD: '$', - UYU: '$U', - UZS: 'лв', - VEF: 'Bs', - VND: '₫', - VUV: 'VT', - WST: 'WS$', - XAF: 'FCFA', - XBT: 'Ƀ', - XCD: '$', - XOF: 'CFA', - XPF: '₣', - YER: '﷼', - ZAR: 'R', - ZWD: 'Z$' -}; diff --git a/packages/scandipwa/src/util/Price/Price.config.ts b/packages/scandipwa/src/util/Price/Price.config.ts new file mode 100644 index 0000000000..528002759b --- /dev/null +++ b/packages/scandipwa/src/util/Price/Price.config.ts @@ -0,0 +1,189 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +export const TIER_PRICES = 'TIER_PRICES'; + +export const HUNDRED_PERCENT = 100; + +export enum currencyMap { + AED = 'د.إ', + AFN = '؋', + ALL = 'L', + AMD = '֏', + ANG = 'ƒ', + AOA = 'Kz', + ARS = '$', + AUD = '$', + AWG = 'ƒ', + AZN = '₼', + BAM = 'KM', + BBD = 'Bds$', + BDT = '৳', + BGN = 'лв', + BHD = '.د.ب', + BIF = 'FBu', + BMD = '$', + BND = 'B$', + BOB = '$b', + BRL = 'R$', + BSD = 'B$', + BTC = '฿', + BTN = 'Nu.', + BWP = 'P', + BYR = 'Br', + BYN = 'Br', + BZD = 'BZ$', + CAD = 'CA$', + CDF = 'FC', + CHF = 'CHF', + CLP = '$', + CNY = '¥', + COP = '$', + CRC = '₡', + CUC = 'CUC$', + CUP = '₱', + CVE = '$', + CZK = 'Kč', + DJF = 'Fdj', + DKK = 'kr', + DOP = 'RD$', + DZD = 'دج', + EEK = 'kr', + EGP = '£', + ERN = 'Nfk', + ETB = 'Br', + ETH = 'Ξ', + EUR = '€', + FJD = 'FJ$', + FKP = '£', + GBP = '£', + GEL = '₾', + GGP = '£', + GHC = '₵', + GHS = 'GH₵', + GIP = '£', + GMD = 'D', + GNF = 'FG', + GTQ = 'Q', + GYD = 'G$', + HKD = 'HK$', + HNL = 'L', + HRK = 'kn', + HTG = 'G', + HUF = 'Ft', + IDR = 'Rp', + ILS = '₪', + IMP = '£', + INR = '₹', + IQD = 'ع.د', + IRR = '﷼', + ISK = 'kr', + JEP = '£', + JMD = 'J$', + JOD = 'JD', + JPY = '¥', + KES = 'KSh', + KGS = 'лв', + KHR = '៛', + KMF = 'CF', + KPW = '₩', + KRW = '₩', + KWD = 'KD', + KYD = '$', + KZT = 'лв', + LAK = '₭', + LBP = '£', + LKR = '₨', + LRD = 'L$', + LSL = 'M', + LTC = 'Ł', + LTL = 'Lt', + LVL = 'Ls', + LYD = 'LD', + MAD = 'MAD', + MDL = 'lei', + MGA = 'Ar', + MKD = 'ден', + MMK = 'K', + MNT = '₮', + MOP = 'MOP$', + MRO = 'UM', + MRU = 'UM', + MUR = '₨', + MVR = 'Rf', + MWK = 'MK', + MXN = 'Mex$', + MYR = 'RM', + MZN = 'MT', + NAD = '$', + NGN = '₦', + NIO = 'C$', + NOK = 'kr', + NPR = '₨', + NZD = '$', + OMR = '﷼', + PAB = 'B/.', + PEN = 'S/.', + PGK = 'K', + PHP = '₱', + PKR = '₨', + PLN = 'zł', + PYG = 'Gs', + QAR = '﷼', + RMB = '¥', + RON = 'lei', + RSD = 'Дин.', + RUB = '₽', + RWF = 'R₣', + SAR = '﷼', + SBD = 'Si$', + SCR = '₨', + SDG = 'ج.س.', + SEK = 'kr', + SGD = '$', + SHP = '£', + SLL = 'Le', + SOS = 'S', + SRD = '$', + SSP = '£', + STD = 'Db', + STN = 'Db', + SVC = '₡', + SYP = '£', + SZL = 'E', + THB = '฿', + TJS = 'SM', + TMT = 'T', + TND = 'د.ت', + TOP = 'T$', + TRL = '₤', + TRY = '₺', + TTD = 'TT$', + TVD = '$', + TWD = 'NT$', + TZS = 'TSh', + UAH = '₴', + UGX = 'USh', + USD = '$', + UYU = '$U', + UZS = 'лв', + VEF = 'Bs', + VND = '₫', + VUV = 'VT', + WST = 'WS$', + XAF = 'FCFA', + XBT = 'Ƀ', + XCD = '$', + XOF = 'CFA', + XPF = '₣', + YER = '﷼', + ZAR = 'R', + ZWD = 'Z$' +} diff --git a/packages/scandipwa/src/util/Price/Price.js b/packages/scandipwa/src/util/Price/Price.ts similarity index 67% rename from packages/scandipwa/src/util/Price/Price.js rename to packages/scandipwa/src/util/Price/Price.ts index 92a982cc70..12480596d5 100644 --- a/packages/scandipwa/src/util/Price/Price.js +++ b/packages/scandipwa/src/util/Price/Price.ts @@ -9,13 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ -import currencyMap, { HUNDRED_PERCENT } from './Price.config'; +import { PriceTier } from 'Type/ProductList.type'; +import { currencyMap, HUNDRED_PERCENT } from './Price.config'; /** @namespace Util/Price/formatCurrency */ -export const formatCurrency = (currency = 'USD') => currencyMap[currency]; +export const formatCurrency = (currency: string = 'USD'): string | null => Object.keys(currencyMap).includes(currency) ? currency : null ; /** @namespace Util/Price/formatPrice */ -export const formatPrice = (price, currency = 'USD') => { +export const formatPrice = (price: number, currency: string = 'USD') : string => { const language = navigator.languages ? navigator.languages[0] : navigator.language; return new Intl.NumberFormat(language, { style: 'currency', currency }).format(price); @@ -29,7 +30,7 @@ export const formatPrice = (price, currency = 'USD') => { * @return {Number} final price * @namespace Util/Price/calculateFinalPrice */ -export const calculateFinalPrice = (discount, min, reg) => (discount ? min : reg); +export const calculateFinalPrice = (discount: number, min: number, reg: number): number => (discount ? min : reg); /** * Calculate final price @@ -37,7 +38,7 @@ export const calculateFinalPrice = (discount, min, reg) => (discount ? min : reg * @param {Number} spec special price * @return {Number} final discount * @namespace Util/Price/calculateTierDiscountOverSpecialPrice */ -export const calculateTierDiscountOverSpecialPrice = (spec, tier) => ( +export const calculateTierDiscountOverSpecialPrice = (spec: number, tier: number): number => ( Math.round(HUNDRED_PERCENT - (tier / spec) * HUNDRED_PERCENT) ); @@ -47,10 +48,10 @@ export const calculateTierDiscountOverSpecialPrice = (spec, tier) => ( * @return {Number} price rounded to 2 digits * @namespace Util/Price/roundPrice */ -export const roundPrice = (price) => parseFloat(price).toFixed(2); +export const roundPrice = (price: number): string => price.toFixed(2); /** @namespace Util/Price/getLowestPriceTiersPrice */ -export const getLowestPriceTiersPrice = (price_tiers, currency) => { +export const getLowestPriceTiersPrice = (price_tiers: PriceTier[], currency: string) => { const lowestValue = price_tiers .reduce((acc, { final_price: { value } }) => (acc < value ? acc : value), price_tiers[0].final_price.value); diff --git a/packages/scandipwa/src/util/Price/index.js b/packages/scandipwa/src/util/Price/index.ts similarity index 100% rename from packages/scandipwa/src/util/Price/index.js rename to packages/scandipwa/src/util/Price/index.ts diff --git a/packages/scandipwa/src/util/Product/Extract.js b/packages/scandipwa/src/util/Product/Extract.ts similarity index 79% rename from packages/scandipwa/src/util/Product/Extract.js rename to packages/scandipwa/src/util/Product/Extract.ts index d1ee8f3b06..40b3c0e116 100644 --- a/packages/scandipwa/src/util/Product/Extract.js +++ b/packages/scandipwa/src/util/Product/Extract.ts @@ -12,23 +12,40 @@ import { PRODUCT_TYPE } from 'Component/Product/Product.config'; import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { ImageTypes } from 'Component/ProductGallery/ProductGallery.config'; +import { PriceRange } from 'Type/Price.type'; +import { ProductGrouped, ProductBundle, ItemOption, Product, ProductBundleItems, ProductVariant, StockItem, ProductDownloadable, ItemOptionProduct } from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; export const DEFAULT_MIN_PRODUCTS = 1; export const DEFAULT_MAX_PRODUCTS = 999; +export enum QtyDefault { + DEFAULT_MIN_PRODUCTS = 1, + DEFAULT_MAX_PRODUCTS = 999 +} + export const MIN_SALE_QTY = 'min_sale_qty'; export const MAX_SALE_QTY = 'max_sale_qty'; export const SALABLE_QTY = 'salable_qty'; +export enum QtyFields { + SALABLE_QTY = 'salable_qty', + MIN_SALE_QTY = 'min_sale_qty', + MAX_SALE_QTY = 'max_sale_qty' +} + +// TODO unify keyof product and stockitem. /** @namespace Util/Product/Extract/getFieldQty */ -export const getFieldQty = (product, field) => { - if (field === MIN_SALE_QTY || field === MAX_SALE_QTY) { +export const getFieldQty = (product: Product | ProductVariant, field: keyof Product | keyof StockItem): number | undefined => { + if (field === QtyFields.MIN_SALE_QTY || field === QtyFields.MAX_SALE_QTY) { const { stock_item: { [field]: qty } = {} } = product; + return qty; } - const { [field]: qty } = product; + const { [field as QtyFields.SALABLE_QTY]: qty } = product; + return qty; }; @@ -41,7 +58,7 @@ export const getFieldQty = (product, field) => { * @returns {*} * @namespace Util/Product/Extract/getQuantity */ -export const getQuantity = (product, defaultValue, field, configIndex = -1) => { +export const getQuantity = (product: Product, defaultValue: number, field: keyof Product | keyof StockItem , configIndex: number = -1): number => { if (!product) { return defaultValue; } @@ -58,7 +75,7 @@ export const getQuantity = (product, defaultValue, field, configIndex = -1) => { return qty; } - const variantQty = getFieldQty(variants[configIndex] || {}, field); + const variantQty = getFieldQty(variants![configIndex], field); return variantQty || qty; }; @@ -70,8 +87,8 @@ export const getQuantity = (product, defaultValue, field, configIndex = -1) => { * @returns {*} * @namespace Util/Product/Extract/getMinQuantity */ -export const getMinQuantity = (product, configIndex = -1) => ( - getQuantity(product, DEFAULT_MIN_PRODUCTS, MIN_SALE_QTY, configIndex) +export const getMinQuantity = (product: Product, configIndex = -1): number => ( + getQuantity(product, DEFAULT_MIN_PRODUCTS, QtyFields.MIN_SALE_QTY, configIndex) ); /** @@ -81,9 +98,9 @@ export const getMinQuantity = (product, configIndex = -1) => ( * @returns {*} * @namespace Util/Product/Extract/getMaxQuantity */ -export const getMaxQuantity = (product, configIndex = -1) => { - const maxQuantity = getQuantity(product, DEFAULT_MAX_PRODUCTS, MAX_SALE_QTY, configIndex); - const salableQuantity = getQuantity(product, DEFAULT_MAX_PRODUCTS, SALABLE_QTY, configIndex); +export const getMaxQuantity = (product: Product, configIndex = -1) => { + const maxQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, MAX_SALE_QTY, configIndex); + const salableQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, QtyFields.SALABLE_QTY, configIndex); return Math.min(maxQuantity, salableQuantity); }; @@ -94,7 +111,7 @@ export const getMaxQuantity = (product, configIndex = -1) => { * @returns {*} * @namespace Util/Product/Extract/getName */ -export const getName = (product, configIndex = -1) => { +export const getName = (product: Product, configIndex: number = -1): string => { const { variants = [] } = product; const { @@ -111,35 +128,35 @@ export const getName = (product, configIndex = -1) => { * @returns {boolean} * @namespace Util/Product/Extract/getProductInStock */ -export const getProductInStock = (product, parentProduct = {}) => { +export const getProductInStock = (product: Product, parentProduct?: Product): boolean => { if (!product) { return false; } const { type_id: type, - variants = [], - items = [], stock_item: { in_stock: inStock = true } = {} } = product; if (type === PRODUCT_TYPE.bundle) { - const { items = [] } = product; + const { items = [] } = product as ProductBundle; const requiredItems = items.filter(({ required }) => required); const requiredItemsInStock = requiredItems.filter( - ({ options }) => options.some(({ product }) => getProductInStock(product)) + ({ options } ) => options.some(({ product }) => getProductOptionInStock(product)) ); return inStock && requiredItemsInStock.length === requiredItems.length; } if (type === PRODUCT_TYPE.configurable && parentProduct === product) { + const { variants = [] } = product as Product; + return inStock && !!variants.some((variant) => getProductInStock(variant, product)); } - const { type_id: parentTypeId = false } = parentProduct; + const { type_id: parentTypeId = false } = parentProduct || {}; if (parentTypeId === PRODUCT_TYPE.configurable && parentProduct !== product) { const { @@ -147,12 +164,14 @@ export const getProductInStock = (product, parentProduct = {}) => { in_stock: parentInStock = true } = {}, stock_status: parentStockStatus - } = parentProduct; + } = parentProduct || {}; return parentInStock && parentStockStatus !== STOCK_TYPE.OUT_OF_STOCK && getProductInStock(product); } if (type === PRODUCT_TYPE.grouped) { + const { items = [] } = product as ProductGrouped; + return inStock && !!items.some(({ product }) => getProductInStock(product)); } @@ -161,13 +180,19 @@ export const getProductInStock = (product, parentProduct = {}) => { return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && (inStock || stockStatus === STOCK_TYPE.IN_STOCK); }; +export const getProductOptionInStock = (product: Product): boolean => { + const { stock_status: stockStatus } = product; + + return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && stockStatus === STOCK_TYPE.IN_STOCK; +} + /** * Checks if items in Grouped Product are in stock * @param product: productGroup * @param products: products in stock * @namespace Util/Product/Extract/getGroupedProductsInStockQuantity */ -export const getGroupedProductsInStockQuantity = ({ items = [] }) => items.reduce((acc, { +export const getGroupedProductsInStockQuantity = ({ items = [] }: ProductGrouped): Record => items.reduce((acc, { product, product: { id }, qty = 1 }) => (getProductInStock(product) ? { ...acc, [id]: qty } : acc), {}); @@ -177,7 +202,7 @@ export const getGroupedProductsInStockQuantity = ({ items = [] }) => items.reduc * @param options * @namespace Util/Product/Extract/getBundleOption */ -export const getBundleOption = (uid, options = []) => { +export const getBundleOption = (uid: string, options: ItemOption[] = []): ItemOption | undefined => { const uidParts = atob(uid).split('/'); return options.find(({ uid: linkedUid }) => { const linkedUidParts = atob(linkedUid).split('/'); @@ -197,6 +222,15 @@ export const getBundleOption = (uid, options = []) => { }); }; +export type AdjustedPrice = { + exclTax: number; + inclTax: number; + hasDiscountCalculated: boolean; + requiresDiscountCalculations: boolean; +} + +export type AdjustedPrices = Record; + /** * Returns price object for product. * @param priceRange @@ -208,9 +242,9 @@ export const getBundleOption = (uid, options = []) => { * @namespace Util/Product/Extract/getPrice */ export const getPrice = ( - priceRange, - dynamicPrice = false, - adjustedPrice = {}, + priceRange: PriceRange, + dynamicPrice: boolean = false, + adjustedPrice: AdjustedPrices = {}, type = PRODUCT_TYPE.simple, options = [] ) => { @@ -234,15 +268,15 @@ export const getPrice = ( } = {} } = {}, minimum_price: { - regular_price: minRegularPrice = {}, - final_price: minFinalPrice = {}, - final_price_excl_tax: minFinalPriceExclTax = {} - } = {}, + regular_price: minRegularPrice, + final_price: minFinalPrice, + final_price_excl_tax: minFinalPriceExclTax + }, maximum_price: { - regular_price: maxRegularPrice = {}, - final_price: maxFinalPrice = {}, - final_price_excl_tax: maxFinalPriceExclTax = {} - } = {} + regular_price: maxRegularPrice, + final_price: maxFinalPrice, + final_price_excl_tax: maxFinalPriceExclTax + } } = priceRange || {}; // Fixes decimal misplacement for discount @@ -265,10 +299,10 @@ export const getPrice = ( ? basePriceExclTax / discountValueRevert : basePriceExclTax; - const priceValue = { value: dynamicPrice ? 0 : basePriceExclDiscount * discountValue, currency }; - const priceValueExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax * discountValue, currency }; - const priceValueExclDiscount = { value: dynamicPrice ? 0 : basePriceExclDiscount, currency }; - const priceValueExclDiscountExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax, currency }; + const priceValue = { value: dynamicPrice ? 0 : basePriceExclDiscount * discountValue, currency, valueFormatted: '0' }; + const priceValueExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax * discountValue, currency, valueFormatted: '0' }; + const priceValueExclDiscount = { value: dynamicPrice ? 0 : basePriceExclDiscount, currency, valueFormatted: '0' }; + const priceValueExclDiscountExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax, currency, valueFormatted: '0' }; // Adds adjusted price Object.keys(adjustedPrice || {}).forEach((key) => { @@ -367,6 +401,12 @@ export const getPrice = ( }; }; +// TODO move +export type EnteredOption = { + uid: string; + value: string; +} + /** * Generates adjusted price from entered product options * @@ -376,12 +416,9 @@ export const getPrice = ( * @param selectedOptions * @namespace Util/Product/Extract/getAdjustedPrice */ -export const getAdjustedPrice = (product, downloadableLinks, enteredOptions, selectedOptions) => { +export const getAdjustedPrice = (product: Product, downloadableLinks: string[], enteredOptions: EnteredOption[], selectedOptions: string[]) => { const { - downloadable_product_links = [], options = [], - items = [], - dynamic_price: dynamicPrice = false, type_id: typeId } = product; @@ -407,6 +444,7 @@ export const getAdjustedPrice = (product, downloadableLinks, enteredOptions, sel //#region DOWNLOADABLE if (typeId === PRODUCT_TYPE.downloadable) { + const { downloadable_product_links = [] } = product as ProductDownloadable; downloadableLinks.forEach((uid) => { const link = downloadable_product_links.find(({ uid: linkUid }) => linkUid === uid); @@ -421,6 +459,8 @@ export const getAdjustedPrice = (product, downloadableLinks, enteredOptions, sel //#region BUNDLE if (typeId === PRODUCT_TYPE.bundle) { + const { items = [], dynamic_price: dynamicPrice = false } = product as ProductBundle; + selectedOptions.forEach((uid) => { items.forEach(({ options = [] }) => { const uidParts = atob(uid).split('/'); @@ -432,7 +472,7 @@ export const getAdjustedPrice = (product, downloadableLinks, enteredOptions, sel finalOptionPrice, finalOptionPriceExclTax, product: { - price_range: optionProductPriceRange = {}, + price_range: optionProductPriceRange, type_id: optionProductType, dynamic_price: optionProductDynamic }, @@ -496,7 +536,7 @@ export const getAdjustedPrice = (product, downloadableLinks, enteredOptions, sel * @param value * @namespace Util/Product/Extract/getSubLabelFromMaxCharacters */ -export const getSubLabelFromMaxCharacters = (maxCharacters, value = '') => { +export const getSubLabelFromMaxCharacters = (maxCharacters: number, value: string = ''): string | null => { const valueLength = value.length; const remainingCharacters = maxCharacters - valueLength; @@ -523,7 +563,7 @@ export const getSubLabelFromMaxCharacters = (maxCharacters, value = '') => { * @param field * @namespace Util/Product/Extract/getImage */ -export const getImage = (product, field) => { +export const getImage = (product: Product, field: ImageTypes) => { const { [field]: { url = 'no_selection' } = {} } = product; return url && url !== 'no_selection' ? url : ''; }; @@ -533,19 +573,19 @@ export const getImage = (product, field) => { * @param product * @namespace Util/Product/Extract/getThumbnailImage */ -export const getThumbnailImage = (product) => getImage(product, 'thumbnail'); +export const getThumbnailImage = (product: Product): string => getImage(product, ImageTypes.THUMBNAIL_KEY); /** * Returns products small image * @param product * @namespace Util/Product/Extract/getSmallImage */ -export const getSmallImage = (product) => getImage(product, 'small_image'); +export const getSmallImage = (product: Product): string => getImage(product, ImageTypes.SMALL_KEY); /** * Returns products base image * @param product * @namespace Util/Product/Extract/getBaseImage */ -export const getBaseImage = (product) => getImage(product, 'image'); +export const getBaseImage = (product: Product): string => getImage(product, ImageTypes.IMAGE_KEY); //#endregion diff --git a/packages/scandipwa/src/util/Product/Transform.js b/packages/scandipwa/src/util/Product/Transform.ts similarity index 74% rename from packages/scandipwa/src/util/Product/Transform.js rename to packages/scandipwa/src/util/Product/Transform.ts index e77ffaebe8..8be5588d96 100644 --- a/packages/scandipwa/src/util/Product/Transform.js +++ b/packages/scandipwa/src/util/Product/Transform.ts @@ -12,13 +12,30 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import PRODUCT_TYPE from 'Component/Product/Product.config'; import { NONE_RADIO_OPTION } from 'Component/ProductCustomizableOption/ProductCustomizableOption.config'; +import { Attribute, CustomizableOption, Item, ItemOption, Product, ProductGrouped, Quantity } from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; -import { getProductInStock } from './Extract'; +import { EnteredOption, getProductInStock } from './Extract'; import { ADD_TO_CART } from './Product'; export const PRICE_TYPE_PERCENT = 'PERCENT'; +export type BuyRequest = { + qty: number; + bundle_option_qty: Record; + bundle_option: Record; + action: string; + options?: Record; + links?: string[]; + super_attribute?: Record +} + +export interface Variant { + date_internal: string; + date: string; + type: string; +} + /** * Generates correct UID for bundle with changed quantity * UID is encoded in base64, original value is bundle/option_id/item_id/quantity @@ -27,7 +44,7 @@ export const PRICE_TYPE_PERCENT = 'PERCENT'; * @param quantity * @namespace Util/Product/Transform/getEncodedBundleUid */ -export const getEncodedBundleUid = (uid, quantity) => { +export const getEncodedBundleUid = (uid: string, quantity: number): string => { const decoded = atob(uid); const parts = decoded.split('/'); // eslint-disable-next-line no-magic-numbers @@ -39,8 +56,8 @@ export const getEncodedBundleUid = (uid, quantity) => { }; /** @namespace Util/Product/Transform/getBundleOptions */ -export const getBundleOptions = (buyRequest) => { - const { bundle_option = {}, bundle_option_qty = {} } = JSON.parse(buyRequest); +export const getBundleOptions = (buyRequest: string): string[] => { + const { bundle_option = {}, bundle_option_qty = {} }: BuyRequest = JSON.parse(buyRequest); if (!bundle_option) { return []; @@ -54,19 +71,19 @@ export const getBundleOptions = (buyRequest) => { } return [...prev, ...Object.keys(variant).map((id) => btoa(`bundle/${option}/${id}/${qty}`))]; - }, []); + }, [] as string[]); }; /** @namespace Util/Product/Transform/getCustomizableOptions */ -export const getCustomizableOptions = (buyRequest) => { - const { options = {} } = JSON.parse(buyRequest); +export const getCustomizableOptions = (buyRequest: string): string[] => { + const { options = {} }: BuyRequest = JSON.parse(buyRequest); // handle null if (!options) { return []; } - return Object.entries(options).reduce((prev, [option, variant]) => { + return Object.entries(options).reduce((prev, [option, variant ]) => { if (typeof variant === 'string') { return [...prev, btoa(`custom-option/${option}/${variant}`)]; } @@ -89,29 +106,23 @@ export const getCustomizableOptions = (buyRequest) => { return prev; }, - []); + [] as string[]); }; /** @namespace Util/Product/Transform/getDownloadableOptions */ -export const getDownloadableOptions = (buyRequest) => { - const { links } = JSON.parse(buyRequest); +export const getDownloadableOptions = (buyRequest: string): string[] => { + const { links }: BuyRequest = JSON.parse(buyRequest); if (!links) { return []; } - const linksData = Object.entries(links); - - if (typeof linksData === 'string') { - return btoa(`downloadable/${links}`); - } - return links.map((link) => btoa(`downloadable/${link}`)); }; /** @namespace Util/Product/Transform/getConfigurableOptions */ -export const getConfigurableOptions = (buyRequest) => { - const { super_attribute } = JSON.parse(buyRequest); +export const getConfigurableOptions = (buyRequest: string): string[] => { + const { super_attribute }: BuyRequest = JSON.parse(buyRequest); if (!super_attribute) { return []; @@ -121,7 +132,7 @@ export const getConfigurableOptions = (buyRequest) => { }; /** @namespace Util/Product/Transform/getSelectedOptions */ -export const getSelectedOptions = (buyRequest) => [ +export const getSelectedOptions = (buyRequest: string): string[] => [ ...getBundleOptions(buyRequest), ...getCustomizableOptions(buyRequest), ...getDownloadableOptions(buyRequest), @@ -129,13 +140,19 @@ export const getSelectedOptions = (buyRequest) => [ ]; /** @namespace Util/Product/Transform/transformParameters */ -export const transformParameters = (parameters = [], attributes = {}) => Object.entries(parameters) +export const transformParameters = (parameters: string[] = [], attributes: Record = {}): string[] => Object.entries(parameters) .map(([attrCode, selectedValue]) => { const attrId = attributes[attrCode]?.attribute_id; return btoa(`configurable/${attrId}/${selectedValue}`); }); +// TODO move +export type PriceLabels = { + baseLabel?: string; + priceLabel: string; +} + /** * Generates label for bundle option * @@ -144,7 +161,7 @@ export const transformParameters = (parameters = [], attributes = {}) => Object. * @returns {{baseLabel: string, priceLabel: string}} * @namespace Util/Product/Transform/bundleOptionToLabel */ -export const bundleOptionToLabel = (option, currencyCode = 'USD') => { +export const bundleOptionToLabel = (option: ItemOption, currencyCode: string = 'USD'): PriceLabels => { const { price, finalOptionPrice, @@ -169,6 +186,17 @@ export const bundleOptionToLabel = (option, currencyCode = 'USD') => { }; }; +export type OptionTransformResult = { + id: string; + name: string; + value: string; + label?: string; + subLabel: string; + sort_order: number; + isAvailable?: boolean; + isDefault?: boolean; +} + /** * Converts bundle products options into select field options, * meaning into [uid:label] pair @@ -176,7 +204,7 @@ export const bundleOptionToLabel = (option, currencyCode = 'USD') => { * @param options * @namespace Util/Product/Transform/bundleOptionsToSelectTransform */ -export const bundleOptionsToSelectTransform = (options, currencyCode = 'USD', quantity = {}) => ( +export const bundleOptionsToSelectTransform = (options: ItemOption[], currencyCode = 'USD', quantity = {}): OptionTransformResult[] => ( options.reduce((result = [], option) => { const { uid: sourceUid = '', @@ -193,7 +221,7 @@ export const bundleOptionsToSelectTransform = (options, currencyCode = 'USD', qu baseLabel } = bundleOptionToLabel(option, currencyCode); - const { [sourceUid]: currentQty = defaultQuantity } = quantity; + const { [sourceUid]: currentQty = defaultQuantity } = quantity as any; const uid = getEncodedBundleUid(sourceUid, currentQty); result.push({ @@ -208,7 +236,7 @@ export const bundleOptionsToSelectTransform = (options, currencyCode = 'USD', qu }); return result; - }, []) + }, [] as OptionTransformResult[]) ); /** @@ -219,7 +247,7 @@ export const bundleOptionsToSelectTransform = (options, currencyCode = 'USD', qu * @returns {{baseLabel: string, priceLabel: string}} * @namespace Util/Product/Transform/customizableOptionToLabel */ -export const customizableOptionToLabel = (option, currencyCode = 'USD') => { +export const customizableOptionToLabel = (option: CustomizableOption, currencyCode: string = 'USD'): PriceLabels => { const { price, priceInclTax, @@ -243,7 +271,7 @@ export const customizableOptionToLabel = (option, currencyCode = 'USD') => { * @param options * @namespace Util/Product/Transform/customizableOptionsToSelectTransform */ -export const customizableOptionsToSelectTransform = (options, currencyCode = 'USD') => ( +export const customizableOptionsToSelectTransform = (options: CustomizableOption[], currencyCode: string = 'USD'): OptionTransformResult[] => ( options.reduce((result = [], option) => { const { uid, @@ -267,9 +295,16 @@ export const customizableOptionsToSelectTransform = (options, currencyCode = 'US }); return result; - }, []) + }, [] as OptionTransformResult[]) ); +export type ProductTransformData = { + sku: string; + quantity: number | Record; + selected_options: string[]; + entered_options: EnteredOption[]; +} + /** * Generates Magento type product interface for performing * actions (add to cart, wishlist, exc.) @@ -281,26 +316,26 @@ export const customizableOptionsToSelectTransform = (options, currencyCode = 'US * @namespace Util/Product/Transform/magentoProductTransform */ export const magentoProductTransform = ( - action = ADD_TO_CART, - product, - quantity = 1, - enteredOptions = [], - selectedOptions = [] + action: string = ADD_TO_CART, + product: Product, + quantity: number | Record = 1, + enteredOptions: EnteredOption[] = [], + selectedOptions: string[] = [] ) => { const { sku, type_id: typeId } = product; - const productData = []; + const productData: ProductTransformData[] = []; if (typeId === PRODUCT_TYPE.grouped && action === ADD_TO_CART) { if (Object.keys(quantity).length === 0) { return productData; } - const { items } = product; - const groupedProducts = []; + const { items } = product as ProductGrouped; + const groupedProducts: string[] = []; items.forEach(({ product: { id } }) => { - const { [id]: groupedQuantity = 0 } = quantity; + const { [id]: groupedQuantity = 0 } = quantity as Record; groupedProducts.push(btoa(`grouped/${id}/${groupedQuantity}`)); }); @@ -311,7 +346,7 @@ export const magentoProductTransform = ( entered_options: enteredOptions }); } else { - const baseProductToAdd = { + const baseProductToAdd: ProductTransformData = { sku, quantity, selected_options: selectedOptions, @@ -333,7 +368,7 @@ export const magentoProductTransform = ( * @namespace Util/Product/Transform/nonRequiredRadioOptions */ export const nonRequiredRadioOptions = ( - options, isRequired = false, type = FIELD_TYPE.radio + options: ItemOption[], isRequired: boolean = false, type: string = FIELD_TYPE.radio ) => { if (isRequired || type !== FIELD_TYPE.radio) { return options; diff --git a/packages/scandipwa/src/util/Product/index.js b/packages/scandipwa/src/util/Product/index.ts similarity index 100% rename from packages/scandipwa/src/util/Product/index.js rename to packages/scandipwa/src/util/Product/index.ts diff --git a/packages/scandipwa/src/util/Promise/MakeCancelable.js b/packages/scandipwa/src/util/Promise/MakeCancelable.ts similarity index 90% rename from packages/scandipwa/src/util/Promise/MakeCancelable.js rename to packages/scandipwa/src/util/Promise/MakeCancelable.ts index 5edc248617..0bca96b52b 100644 --- a/packages/scandipwa/src/util/Promise/MakeCancelable.js +++ b/packages/scandipwa/src/util/Promise/MakeCancelable.ts @@ -18,11 +18,11 @@ * @param {Promise} promise promise which has to be cancelable * @return {Promise} Cancelable promise * @namespace Util/Promise/MakeCancelable/makeCancelable */ -export const makeCancelable = (promise) => { +export const makeCancelable = (promise: Promise) => { // eslint-disable-next-line fp/no-let let hasCanceled_ = false; - const wrappedPromise = new Promise((resolve, reject) => { + const wrappedPromise: Promise = new Promise((resolve, reject) => { promise.then( /** @namespace Util/Promise/MakeCancelable/makeCancelable/wrappedPromise/promise/then */ (val) => (!hasCanceled_ && resolve(val)), diff --git a/packages/scandipwa/src/util/Promise/index.js b/packages/scandipwa/src/util/Promise/index.ts similarity index 100% rename from packages/scandipwa/src/util/Promise/index.js rename to packages/scandipwa/src/util/Promise/index.ts diff --git a/packages/scandipwa/src/util/Query/PrepareDocument.ts b/packages/scandipwa/src/util/Query/PrepareDocument.ts index 9862ceb70c..5c2f065657 100644 --- a/packages/scandipwa/src/util/Query/PrepareDocument.ts +++ b/packages/scandipwa/src/util/Query/PrepareDocument.ts @@ -9,6 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ +import { QueryObject, QueryVariables } from 'Util/Request'; import { Field } from './Field'; import { FieldArgument, FieldType, PreparedRequest } from './Query.type'; @@ -53,7 +54,7 @@ export const prepareFieldString = ( }; /** @namespace Util/Query/PrepareDocument/prepareRequest */ -export const prepareRequest = (fields: Field[], type: FieldType): PreparedRequest => { +export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => { const fieldsArray = Array.isArray(fields) ? fields : [fields]; if (type !== FieldType.MUTATION && type !== FieldType.QUERY) { @@ -61,7 +62,7 @@ export const prepareRequest = (fields: Field[], type: FieldType): PreparedReques throw new Error(`GraphQL document type "${type}" is not supported.`); } - const variables: Record = {}; + const variables: QueryVariables = {}; const accArgs = {}; // prepare fields from each field passed @@ -71,9 +72,9 @@ export const prepareRequest = (fields: Field[], type: FieldType): PreparedReques // into the format "$var:Type" and append variable value to variables field const resolvedArgs = Object.entries(accArgs).reduce((acc, [name, dataArray]): string[] => { (dataArray as Array>).forEach((item, i: number) => { - const variable = `${name}_${i + 1}`; + const variable: string = `${name}_${i + 1}`; acc.push(`$${variable}:${item.type}`); - variables[variable] = item.value; + variables[variable] = item.value as any; }); return acc; @@ -102,7 +103,7 @@ export const prepareRequest = (fields: Field[], type: FieldType): PreparedReques }; /** @namespace Util/Query/PrepareDocument/prepareMutation */ -export const prepareMutation = (mutations: Field[]): PreparedRequest => prepareRequest(mutations, FieldType.MUTATION); +export const prepareMutation = (mutations: Field[]): QueryObject => prepareRequest(mutations, FieldType.MUTATION); /** @namespace Util/Query/PrepareDocument/prepareQuery */ -export const prepareQuery = (queries: Field[]): PreparedRequest => prepareRequest(queries, FieldType.QUERY); +export const prepareQuery = (queries: Field[]): QueryObject => prepareRequest(queries, FieldType.QUERY); diff --git a/packages/scandipwa/src/util/Request/Error.js b/packages/scandipwa/src/util/Request/Error.ts similarity index 100% rename from packages/scandipwa/src/util/Request/Error.js rename to packages/scandipwa/src/util/Request/Error.ts diff --git a/packages/scandipwa/src/util/Request/Hash.js b/packages/scandipwa/src/util/Request/Hash.ts similarity index 96% rename from packages/scandipwa/src/util/Request/Hash.js rename to packages/scandipwa/src/util/Request/Hash.ts index 8ce4c9d121..e9ed94259b 100644 --- a/packages/scandipwa/src/util/Request/Hash.js +++ b/packages/scandipwa/src/util/Request/Hash.ts @@ -14,6 +14,8 @@ * @link https://github.com/scandipwa/base-theme */ + +// TODO seed is always undefined! Why ? /** * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011) * @@ -26,7 +28,7 @@ * @param {number} seed Positive integer only * @return {number} 32-bit positive integer hash * @namespace Util/Request/Hash/hash */ -export const hash = (key, seed) => { +export const hash = (key: string, seed: number = 1): number => { // eslint-disable-next-line one-var, fp/no-let let h1, h1b, diff --git a/packages/scandipwa/src/util/Request/Mutation.js b/packages/scandipwa/src/util/Request/Mutation.ts similarity index 82% rename from packages/scandipwa/src/util/Request/Mutation.js rename to packages/scandipwa/src/util/Request/Mutation.ts index 6386dd4b1a..02ed3dc456 100644 --- a/packages/scandipwa/src/util/Request/Mutation.js +++ b/packages/scandipwa/src/util/Request/Mutation.ts @@ -12,10 +12,11 @@ import { Field, prepareMutation } from 'Util/Query'; import { executePost } from 'Util/Request/Request'; +// TODO Field or ?? /** @namespace Util/Request/Mutation/fetchMutation */ // eslint-disable-next-line import/prefer-default-export -export const fetchMutation = (rawMutations) => { +export const fetchMutation = (rawMutations: Field) => { const queries = rawMutations instanceof Field ? [rawMutations] : rawMutations; - return executePost(prepareMutation(queries, true)); + return executePost(prepareMutation(queries)); }; diff --git a/packages/scandipwa/src/util/Request/Query.js b/packages/scandipwa/src/util/Request/Query.ts similarity index 83% rename from packages/scandipwa/src/util/Request/Query.js rename to packages/scandipwa/src/util/Request/Query.ts index 13217a8988..a9d4c0ef2e 100644 --- a/packages/scandipwa/src/util/Request/Query.js +++ b/packages/scandipwa/src/util/Request/Query.ts @@ -12,10 +12,11 @@ import { Field, prepareQuery } from 'Util/Query'; import { executePost } from 'Util/Request/Request'; +// TODO Field or ?? /** @namespace Util/Request/Query/fetchQuery */ // eslint-disable-next-line import/prefer-default-export -export const fetchQuery = (rawQueries) => { +export const fetchQuery = (rawQueries: Field) => { const queries = rawQueries instanceof Field ? [rawQueries] : rawQueries; - return executePost(prepareQuery(queries, true)); + return executePost(prepareQuery(queries)); }; diff --git a/packages/scandipwa/src/util/Request/Request.js b/packages/scandipwa/src/util/Request/Request.ts similarity index 78% rename from packages/scandipwa/src/util/Request/Request.js rename to packages/scandipwa/src/util/Request/Request.ts index 53c92d93a0..eaa807c5c8 100644 --- a/packages/scandipwa/src/util/Request/Request.js +++ b/packages/scandipwa/src/util/Request/Request.ts @@ -21,11 +21,11 @@ export const GRAPHQL_URI = '/graphql'; export const WINDOW_ID = 'WINDOW_ID'; /** @namespace Util/Request/getWindowId */ -export const getWindowId = () => { +export const getWindowId = (): string => { const result = sessionStorage.getItem(WINDOW_ID); if (!result) { - const id = Date.now(); + const id = String(Date.now()); sessionStorage.setItem(WINDOW_ID, id); return id; @@ -35,7 +35,7 @@ export const getWindowId = () => { }; /** @namespace Util/Request/getStoreCodePath */ -export const getStoreCodePath = () => { +export const getStoreCodePath = (): string => { const path = location.pathname; // eslint-disable-next-line no-undef const firstPathPart = path.split('/')[1]; @@ -48,7 +48,7 @@ export const getStoreCodePath = () => { }; /** @namespace Util/Request/getGraphqlEndpoint */ -export const getGraphqlEndpoint = () => getStoreCodePath().concat(GRAPHQL_URI); +export const getGraphqlEndpoint = (): string => getStoreCodePath().concat(GRAPHQL_URI); /** * Append authorization token to header object @@ -56,7 +56,7 @@ export const getGraphqlEndpoint = () => getStoreCodePath().concat(GRAPHQL_URI); * @returns {Object} Headers with appended authorization * @namespace Util/Request/appendTokenToHeaders */ -export const appendTokenToHeaders = (headers) => { +export const appendTokenToHeaders = (headers: HeadersInit): HeadersInit => { const token = getAuthorizationToken(); return { @@ -73,7 +73,7 @@ export const appendTokenToHeaders = (headers) => { * @returns {*} * @namespace Util/Request/formatURI */ -export const formatURI = (query, variables, url) => { +export const formatURI = (query: string, variables: Record, url: string): string => { // eslint-disable-next-line no-param-reassign variables._currency = getCurrency(); @@ -92,7 +92,7 @@ export const formatURI = (query, variables, url) => { * @returns {Promise} * @namespace Util/Request/getFetch */ -export const getFetch = (uri, name) => fetch(uri, +export const getFetch = (uri: string, name: string): Promise => fetch(uri, { method: 'GET', headers: appendTokenToHeaders({ @@ -102,6 +102,7 @@ export const getFetch = (uri, name) => fetch(uri, }) }); +// TODO CacheTTL number or string? /** * * @param {String} graphQlURI @@ -109,13 +110,13 @@ export const getFetch = (uri, name) => fetch(uri, * @param {Int} cacheTTL * @namespace Util/Request/putPersistedQuery */ -export const putPersistedQuery = (graphQlURI, query, cacheTTL) => fetch(`${ graphQlURI }?hash=${ hash(query) }`, +export const putPersistedQuery = (graphQlURI: string, query: string, cacheTTL: number): Promise => fetch(`${ graphQlURI }?hash=${ hash(query) }`, { method: 'PUT', body: JSON.stringify(query), headers: { 'Content-Type': 'application/json', - 'SW-Cache-Age': Number.isInteger(cacheTTL) ? cacheTTL : ONE_MONTH_IN_SECONDS + 'SW-Cache-Age': String(Number.isInteger(cacheTTL) ? cacheTTL : ONE_MONTH_IN_SECONDS) } }); @@ -127,7 +128,7 @@ export const putPersistedQuery = (graphQlURI, query, cacheTTL) => fetch(`${ grap * @returns {Promise} * @namespace Util/Request/postFetch */ -export const postFetch = (graphQlURI, query, variables) => fetch(graphQlURI, +export const postFetch = (graphQlURI: string, query: string, variables: Record): Promise => fetch(graphQlURI, { method: 'POST', body: JSON.stringify({ query, variables }), @@ -137,13 +138,19 @@ export const postFetch = (graphQlURI, query, variables) => fetch(graphQlURI, }) }); +// TODO +export type ResponseBody = { + errors: any; + data: any; +} + /** * Checks for errors in response, if they exist, rejects promise * @param {Object} res Response from GraphQL endpoint * @return {Promise} Handled GraphqlQL results promise * @namespace Util/Request/checkForErrors */ -export const checkForErrors = (res) => new Promise((resolve, reject) => { +export const checkForErrors = (res: ResponseBody): Promise => new Promise((resolve, reject) => { const { errors, data } = res; return errors ? reject(errors) : resolve(data); @@ -156,7 +163,7 @@ export const checkForErrors = (res) => new Promise((resolve, reject) => { * @namespace Util/Request/handleConnectionError */ // eslint-disable-next-line no-console -export const handleConnectionError = (err) => console.error(err); // TODO: Add to logs pool +export const handleConnectionError = (err: unknown): void => console.error(err); // TODO: Add to logs pool /** * Parse response and check wether it contains errors @@ -164,7 +171,7 @@ export const handleConnectionError = (err) => console.error(err); // TODO: Add t * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/parseResponse */ -export const parseResponse = (promise) => new Promise((resolve, reject) => { +export const parseResponse = (promise: Promise): Promise => new Promise((resolve, reject) => { promise.then( /** @namespace Util/Request/parseResponse/Promise/promise/then */ (res) => res.json().then( @@ -188,6 +195,14 @@ export const HTTP_503_SERVICE_UNAVAILABLE = 503; export const HTTP_410_GONE = 410; export const HTTP_201_CREATED = 201; +// TODO +export type QueryObject = { + query: string; + variables: Record; +} + +export type QueryVariables = Record; + /** * Make GET request to endpoint (via ServiceWorker) * @param {{}} queryObject prepared with `prepareDocument()` from `Util/Query` request body object @@ -196,7 +211,7 @@ export const HTTP_201_CREATED = 201; * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/executeGet */ -export const executeGet = (queryObject, name, cacheTTL) => { +export const executeGet = (queryObject: QueryObject, name: string, cacheTTL: number) => { const { query, variables } = queryObject; const uri = formatURI(query, variables, getGraphqlEndpoint()); @@ -205,7 +220,7 @@ export const executeGet = (queryObject, name, cacheTTL) => { refreshUid(); } - return parseResponse(new Promise((resolve, reject) => { + return parseResponse(new Promise((resolve, reject): void => { getFetch(uri, name).then( /** @namespace Util/Request/executeGet/parseResponse/getFetch/then */ (res) => { @@ -237,7 +252,7 @@ export const executeGet = (queryObject, name, cacheTTL) => { * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/executePost */ -export const executePost = (queryObject) => { +export const executePost = (queryObject: QueryObject): Promise => { const { query, variables } = queryObject; if (isSignedIn()) { @@ -254,7 +269,7 @@ export const executePost = (queryObject) => { * @return {Promise} Broadcast message promise * @namespace Util/Request/listenForBroadCast */ -export const listenForBroadCast = (name) => new Promise((resolve) => { +export const listenForBroadCast = (name: string): Promise => new Promise((resolve) => { const { BroadcastChannel } = window; const windowId = getWindowId(); @@ -267,28 +282,33 @@ export const listenForBroadCast = (name) => new Promise((resolve) => { } }); +// TODO /** @namespace Util/Request/debounce */ -export const debounce = (callback, delay) => { +export const debounce = (callback: () => void, delay: number) => { // eslint-disable-next-line fp/no-let - let timeout; + let timeout: NodeJS.Timeout; - return (...args) => { + return (...args: T[]) => { const context = this; clearTimeout(timeout); - timeout = setTimeout(() => callback.apply(context, args), delay); + timeout = setTimeout(() => callback.apply(context, args as any), delay); }; }; /** @namespace Util/Request */ -export class Debouncer { - timeout; +export class Debouncer < + T extends () => void, + U extends number, + S +> { + timeout!: NodeJS.Timeout; handler = () => {}; - startDebounce = (callback, delay) => (...args) => { + startDebounce = (callback:T, delay: U) => (...args: S[]) => { const context = this; clearTimeout(this.timeout); - this.handler = () => callback.apply(context, args); + this.handler = () => callback.apply(context, args as any); this.timeout = setTimeout(this.handler, delay); }; diff --git a/packages/scandipwa/src/util/Request/index.js b/packages/scandipwa/src/util/Request/index.ts similarity index 100% rename from packages/scandipwa/src/util/Request/index.js rename to packages/scandipwa/src/util/Request/index.ts diff --git a/packages/scandipwa/src/util/Store/Transform.js b/packages/scandipwa/src/util/Store/Transform.ts similarity index 87% rename from packages/scandipwa/src/util/Store/Transform.js rename to packages/scandipwa/src/util/Store/Transform.ts index 5e447d2078..7bf9877664 100644 --- a/packages/scandipwa/src/util/Store/Transform.js +++ b/packages/scandipwa/src/util/Store/Transform.ts @@ -9,12 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ +import { Countries } from "Type/Config.type"; + /** * Transforms countries list into select options * @param countries * @namespace Util/Store/Transform/transformCountriesToOptions */ -export const transformCountriesToOptions = (countries) => { +export const transformCountriesToOptions = (countries: Countries): Countries => { const options = countries.map((country) => { const { id } = country; diff --git a/packages/scandipwa/src/util/Store/index.js b/packages/scandipwa/src/util/Store/index.ts similarity index 52% rename from packages/scandipwa/src/util/Store/index.js rename to packages/scandipwa/src/util/Store/index.ts index fcb275613d..822d24745d 100644 --- a/packages/scandipwa/src/util/Store/index.js +++ b/packages/scandipwa/src/util/Store/index.ts @@ -15,15 +15,17 @@ import { combineReducers, createStore } from 'redux'; * Configure the store * @namespace Util/Store/Index/configureStore */ -export function configureStore(store) { + export function configureStore>(store: T): T { // Add a dictionary to keep track of the registered async reducers store.asyncReducers = {}; // Create an inject reducer function // This function adds the async reducer, and creates a new combined reducer store.injectReducer = (key, asyncReducer) => { - store.asyncReducers[key] = asyncReducer; - store.replaceReducer(combineReducers(store.asyncReducers)); + if (store.asyncReducers) { + store.asyncReducers[key] = asyncReducer; + store.replaceReducer(combineReducers(store.asyncReducers)); + } }; // Return the modified store @@ -31,23 +33,20 @@ export function configureStore(store) { } /** @namespace Util/Store/Index/noopReducer */ -export const noopReducer = (state) => state; +export const noopReducer = (state: T): T => state; -export const getStore = (() => { - // Initialize the store - const store = configureStore(createStore( - noopReducer, - ( // enable Redux dev-tools only in development - process.env.NODE_ENV === 'development' - && window.__REDUX_DEVTOOLS_EXTENSION__ - ) && window.__REDUX_DEVTOOLS_EXTENSION__({ - trace: true - }) - )); +// Initialize the store +export const store = configureStore(createStore( + noopReducer, + (( // enable Redux dev-tools only in development + process.env.NODE_ENV === 'development' + && window.__REDUX_DEVTOOLS_EXTENSION__ + ) && window.__REDUX_DEVTOOLS_EXTENSION__({ + trace: true + })) || undefined +)); - return function storeGetter() { - return store; - }; -})(); +/** @namespace Util/Store/Index/getStore */ +export const getStore = (): typeof store => store; -export default getStore; +export default getStore; \ No newline at end of file diff --git a/packages/scandipwa/src/util/Url/Url.js b/packages/scandipwa/src/util/Url/Url.ts similarity index 79% rename from packages/scandipwa/src/util/Url/Url.js rename to packages/scandipwa/src/util/Url/Url.ts index a2c205c317..55da6039d3 100644 --- a/packages/scandipwa/src/util/Url/Url.js +++ b/packages/scandipwa/src/util/Url/Url.ts @@ -11,6 +11,12 @@ import { decodeString } from 'Util/Common'; import getStore from 'Util/Store'; +import { History, Location, Match } from 'Type/Router.type'; + +// TODO move +export type KeyValuePairs = Record; + +export type KeyValuePairsArray = Record; /** * Update query params without adding to history @@ -18,7 +24,7 @@ import getStore from 'Util/Store'; * @param {String} value * @namespace Util/Url/updateQueryParamWithoutHistory */ -export const updateQueryParamWithoutHistory = (name, value, history, location) => { +export const updateQueryParamWithoutHistory = (name: string, value: string, history: History, location: Location): void => { const { search, pathname } = location; const params = new URLSearchParams(search); @@ -31,7 +37,7 @@ export const updateQueryParamWithoutHistory = (name, value, history, location) = * @param {String} name * @namespace Util/Url/removeQueryParamWithoutHistory */ -export const removeQueryParamWithoutHistory = (name, history, location) => { +export const removeQueryParamWithoutHistory = (name: string, history: History, location: Location): void => { const { search, pathname } = location; const params = new URLSearchParams(search); @@ -45,7 +51,7 @@ export const removeQueryParamWithoutHistory = (name, history, location) => { * @param {Object} location location object from react-router * @namespace Util/Url/getUrlParam */ -export const getUrlParam = (match, location) => { +export const getUrlParam = (match: Match, location: Location) => { const baseUrl = match.path.replace(window.storeRegexText, '').replace('/', ''); const currentUrl = location.pathname.replace(new RegExp(`^${window.storeRegexText}`, 'i'), ''); @@ -57,7 +63,7 @@ export const getUrlParam = (match, location) => { }; /** @namespace Util/Url/trimEndSlash */ -export const trimEndSlash = (str) => (str.endsWith('/') ? str.slice(0, -1) : str); +export const trimEndSlash = (str: string): string => (str.endsWith('/') ? str.slice(0, -1) : str); /** * Replaces section of URL with passed path value @@ -66,7 +72,7 @@ export const trimEndSlash = (str) => (str.endsWith('/') ? str.slice(0, -1) : str * @returns {*} * @namespace Util/Url/replace */ -export const replace = (regex, path) => { +export const replace = (regex: RegExp, path: string): string => { const { pathname = '' } = new URL(window.location.href); return pathname.replace(regex, path); }; @@ -76,7 +82,7 @@ export const replace = (regex, path) => { * @param {String} pathname the URL to append store code to * @namespace Util/Url/appendWithStoreCode */ -export const appendWithStoreCode = (pathname) => { +export const appendWithStoreCode = (pathname: string): string => { const { ConfigReducer: { base_link_url = window.location.href } = {} } = getStore().getState() || {}; const { pathname: storePrefix } = new URL(base_link_url); @@ -100,11 +106,11 @@ export const appendWithStoreCode = (pathname) => { * @return {String|false} Variable value * @namespace Util/Url/getQueryParam */ -export const getQueryParam = (variable, location) => { +export const getQueryParam = (variable: string, location: Location): boolean | string => { const query = decodeString(location.search.substring(1)); const vars = query.split('&'); - return vars.reduce((acc, item) => { + return vars.reduce((acc: boolean | string, item: string) => { const splitIdx = item.indexOf('='); const [k, v] = [item.slice(0, splitIdx), item.slice(splitIdx + 1)]; @@ -118,13 +124,13 @@ export const getQueryParam = (variable, location) => { * @return {Object} Key-Value pairs * @namespace Util/Url/convertQueryStringToKeyValuePairs */ -export const convertQueryStringToKeyValuePairs = (queryString) => { - const keyValuePairs = {}; +export const convertQueryStringToKeyValuePairs = (queryString: string): KeyValuePairs => { + const keyValuePairs: KeyValuePairs = {}; const params = queryString.substring(1).split('&'); params.forEach((param) => { const pair = param.split('='); - const [keyPair, valuePair = []] = pair; + const [keyPair, valuePair] = pair; if (keyPair.length > 0 && valuePair.length > 0) { keyValuePairs[keyPair] = decodeURIComponent(valuePair); @@ -142,8 +148,8 @@ export const convertQueryStringToKeyValuePairs = (queryString) => { * @return {Object} Key-Value pairs * @namespace Util/Url/updateKeyValuePairs */ -export const updateKeyValuePairs = (keyValuePairs, currentKey, currentValue) => { - const updatedKeyValuePairs = {}; +export const updateKeyValuePairs = (keyValuePairs: KeyValuePairs, currentKey: string, currentValue: string | number): KeyValuePairs => { + const updatedKeyValuePairs: KeyValuePairs = {}; Object.entries(keyValuePairs).forEach((pair) => { const [key, value] = pair; @@ -164,7 +170,7 @@ export const updateKeyValuePairs = (keyValuePairs, currentKey, currentValue) => * @return {String} Converted query string * @namespace Util/Url/convertKeyValuesToQueryString */ -export const convertKeyValuesToQueryString = (keyValuePairs) => Object.entries(keyValuePairs) +export const convertKeyValuesToQueryString = (keyValuePairs: KeyValuePairsArray): string => Object.entries(keyValuePairs) .map((pair) => { const [key, value] = pair; const keyExists = key !== ''; @@ -180,7 +186,7 @@ export const convertKeyValuesToQueryString = (keyValuePairs) => Object.entries(k .join('&'); /** @namespace Util/Url/generateQuery */ -export const generateQuery = (keyValueObject, location, history) => Object.entries(keyValueObject) +export const generateQuery = (keyValueObject: KeyValuePairs, location: Location, history: History): string => Object.entries(keyValueObject) .reduce((acc, pair) => { const [key, value] = pair; @@ -213,7 +219,7 @@ export const generateQuery = (keyValueObject, location, history) => Object.entri * @param {Object} variable is url flush required * @namespace Util/Url/setQueryParams */ -export const setQueryParams = (keyValueObject, location, history) => { +export const setQueryParams = (keyValueObject: KeyValuePairs, location: Location, history: History): void => { const { state } = location; const query = generateQuery(keyValueObject, location, history); @@ -225,7 +231,7 @@ export const setQueryParams = (keyValueObject, location, history) => { * @param {Object} variable react router history object * @namespace Util/Url/clearQueriesFromUrl */ -export const clearQueriesFromUrl = (history) => { +export const clearQueriesFromUrl = (history: History): void => { history.push({ search: '' }); }; @@ -235,7 +241,7 @@ export const clearQueriesFromUrl = (history) => { * @return {String} Converted query string * @namespace Util/Url/objectToUri */ -export const objectToUri = (keyValueObject = {}) => { +export const objectToUri = (keyValueObject: KeyValuePairs = {}): string => { const paramString = Object.entries(keyValueObject).sort() .reduce((acc, [key, value]) => `${acc}&${key}=${value}`, '') .replace('&', ''); @@ -244,7 +250,7 @@ export const objectToUri = (keyValueObject = {}) => { }; /** @namespace Util/Url/isHomePageUrl */ -export const isHomePageUrl = (pathname) => { +export const isHomePageUrl = (pathname: string): boolean => { const isHomePage = pathname === appendWithStoreCode('/') || pathname === '/' || pathname === appendWithStoreCode('') diff --git a/packages/scandipwa/src/util/Url/index.js b/packages/scandipwa/src/util/Url/index.ts similarity index 100% rename from packages/scandipwa/src/util/Url/index.js rename to packages/scandipwa/src/util/Url/index.ts diff --git a/packages/scandipwa/src/util/Validator/Config.ts b/packages/scandipwa/src/util/Validator/Config.ts index 2ff934e526..6536993dd5 100644 --- a/packages/scandipwa/src/util/Validator/Config.ts +++ b/packages/scandipwa/src/util/Validator/Config.ts @@ -36,6 +36,15 @@ export const VALIDATION_INPUT_TYPE_NUMBER = { naturalNoZero: 'naturalNoZero' }; +export enum ValidationInputTypeNumber { + NUMERIC = 'numeric', + NUMERICDASH = 'numericDash', + INTEGER = 'integer', + DECIMAL = 'decimal', + NATURAL = 'natural', + NATURALNOZERO = 'naturalNoZero' +} + export const VALIDATION_INPUT_TYPE_INPUT = { email: 'email', password: 'password', @@ -44,6 +53,14 @@ export const VALIDATION_INPUT_TYPE_INPUT = { emailList: 'emailList' }; +export enum ValidationInputTypeInput { + EMAIL = 'email', + PASSWORD = 'password', + DATE = 'date', + PHONE = 'phone', + EMAILLIST = 'emailList' +} + export const VALIDATION_INPUT_TYPE = { ...VALIDATION_INPUT_TYPE_TEXT, ...VALIDATION_INPUT_TYPE_NUMBER, diff --git a/packages/scandipwa/src/util/Validator/Validator.js b/packages/scandipwa/src/util/Validator/Validator.ts similarity index 80% rename from packages/scandipwa/src/util/Validator/Validator.js rename to packages/scandipwa/src/util/Validator/Validator.ts index 49731ed912..7167f35ce7 100644 --- a/packages/scandipwa/src/util/Validator/Validator.js +++ b/packages/scandipwa/src/util/Validator/Validator.ts @@ -10,7 +10,34 @@ * @link https://github.com/scandipwa/base-theme */ import FIELD_TYPE from 'Component/Field/Field.config'; -import { VALIDATION_INPUT_TYPE_NUMBER, VALIDATION_MESSAGES, VALIDATION_RULES } from 'Util/Validator/Config'; +import { ValidationInputTypeNumber, VALIDATION_MESSAGES, VALIDATION_RULES } from 'Util/Validator/Config'; + +//TODO Move to Types + +export type ValidationRule = { + isRequired: boolean, + inputType: string; + selector?: string; + match: string | ((args: string | Record[]) => boolean); + range: Record; + fileExtension: Record + customErrorMessages: Record +} + +export type ValidationOutput = { + value: string, + errorMessages: string[] +} + +export type ValidationDOMOutput = { + values: { + name: string; + value: string; + type: string; + }[]; + errorFields: unknown[] + errorMessages: string[] +} /** * Validates parameter based on rules @@ -19,7 +46,7 @@ import { VALIDATION_INPUT_TYPE_NUMBER, VALIDATION_MESSAGES, VALIDATION_RULES } f * @returns {boolean|{errorMessages: *[], value}} * @namespace Util/Validator/validate */ -export const validate = (value, rule) => { +export const validate = (value: string, rule: ValidationRule): boolean | ValidationOutput => { const { isRequired, inputType, @@ -31,12 +58,12 @@ export const validate = (value, rule) => { onInputTypeFail, onMatchFail, onRangeFailMin, - onRangeFailMax, + onRangeFailMax, onExtensionFail } = {} } = rule; - const output = { + const output: ValidationOutput = { value, errorMessages: [] }; @@ -68,7 +95,7 @@ export const validate = (value, rule) => { //#region RANGE if (range) { const { min, max, showLengthError } = range; - const isNumber = !!VALIDATION_INPUT_TYPE_NUMBER[inputType]; + const isNumber = inputType in ValidationInputTypeNumber; if (isNumber) { if (min && +value < min) { @@ -97,7 +124,7 @@ export const validate = (value, rule) => { if (fileExtension && value !== '') { const { accept } = fileExtension; const acceptedExtensions = accept.split(', '); - const currentFileExtension = value.split('.').pop(); + const currentFileExtension = value.split('.').pop() as string; if (!acceptedExtensions.includes(currentFileExtension)) { output.errorMessages.push(onExtensionFail || VALIDATION_MESSAGES.fileExtension); @@ -116,7 +143,7 @@ export const validate = (value, rule) => { * @returns {boolean|{errorMessages: *[], values: *[], errorFields: *[]}} * @namespace Util/Validator/validateGroup */ -export const validateGroup = (DOM, rule = null) => { +export const validateGroup = (DOM: Document, rule: ValidationRule): boolean | ValidationDOMOutput => { if (typeof DOM.querySelectorAll !== 'function') { return true; } @@ -124,9 +151,9 @@ export const validateGroup = (DOM, rule = null) => { const { selector = 'select, input, textarea, .js-validatabale, form, .FieldGroup' } = rule || {}; - const fields = DOM?.querySelectorAll(selector); + const fields = DOM?.querySelectorAll(selector) as NodeListOf; - const output = { + const output: ValidationDOMOutput = { values: [], errorFields: [], errorMessages: [] @@ -139,10 +166,11 @@ export const validateGroup = (DOM, rule = null) => { value, tagName = FIELD_TYPE.select, type = FIELD_TYPE.select - } = field; + } = field as HTMLInputElement; const fieldType = tagName.toLowerCase() === FIELD_TYPE.textarea ? FIELD_TYPE.textarea : type; - const fieldValue = fieldType === FIELD_TYPE.checkbox || fieldType === FIELD_TYPE.radio ? field.checked : value; + // TODO change logic so that checked won't fill as value + const fieldValue = fieldType === (FIELD_TYPE.checkbox || fieldType === FIELD_TYPE.radio) && field.checked ? '' : value; output.values.push({ name, value: fieldValue, type: fieldType }); // Invokes validation event for all fields @@ -206,7 +234,7 @@ export const validateGroup = (DOM, rule = null) => { * @return {Number} * @namespace Util/Validator/getNumberOfCharacterClasses */ -export const getNumberOfCharacterClasses = (value) => Number(/\d+/.test(value)) +export const getNumberOfCharacterClasses = (value: string) => Number(/\d+/.test(value)) + Number(/[a-z]+/.test(value)) + Number(/[A-Z]+/.test(value)) + Number(/[^a-zA-Z0-9]+/.test(value)); @@ -221,7 +249,7 @@ export default validate; * @returns {String|Boolean} * @namespace Util/Validator/validatePassword */ -export const validatePassword = (value, range, minCharacter) => { +export const validatePassword = (value: string, range: Record, minCharacter: number): string | boolean => { if (value.length === 0) { return true; } diff --git a/packages/scandipwa/src/util/Validator/index.js b/packages/scandipwa/src/util/Validator/index.ts similarity index 100% rename from packages/scandipwa/src/util/Validator/index.js rename to packages/scandipwa/src/util/Validator/index.ts diff --git a/packages/scandipwa/src/util/Wishlist/Wishlist.js b/packages/scandipwa/src/util/Wishlist/Wishlist.ts similarity index 85% rename from packages/scandipwa/src/util/Wishlist/Wishlist.js rename to packages/scandipwa/src/util/Wishlist/Wishlist.ts index cf5aff661b..5b7abee128 100644 --- a/packages/scandipwa/src/util/Wishlist/Wishlist.js +++ b/packages/scandipwa/src/util/Wishlist/Wishlist.ts @@ -9,12 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ +import { PriceRange } from "Type/Price.type"; +import { Product } from "Type/ProductList.type"; + /** * Updates wishlist item price for option based products * @param {Object} product * @namespace Util/Wishlist/getPriceRange */ -export const getPriceRange = (product, price, priceWithoutTax) => { +export const getPriceRange = (product: Product, price: number, priceWithoutTax: number): PriceRange | {} => { if (!price) { return {}; } diff --git a/packages/scandipwa/src/util/Wishlist/index.js b/packages/scandipwa/src/util/Wishlist/index.ts similarity index 100% rename from packages/scandipwa/src/util/Wishlist/index.js rename to packages/scandipwa/src/util/Wishlist/index.ts diff --git a/yarn.lock b/yarn.lock index b647528f48..00cf94a38a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3326,6 +3326,16 @@ dependencies: "@types/react" "*" +"@types/react-redux@7.1.16": + version "7.1.16" + resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.16.tgz#0fbd04c2500c12105494c83d4a3e45c084e3cb21" + integrity sha512-f/FKzIrZwZk7YEO9E1yoxIuDNRiDducxkFlkw/GNMGEnK9n4K8wJzlJBghpSuOVDgEUHoDkDF7Gi9lHNQR4siw== + dependencies: + "@types/hoist-non-react-statics" "^3.3.0" + "@types/react" "*" + hoist-non-react-statics "^3.3.0" + redux "^4.0.0" + "@types/react-redux@^7.1.20": version "7.1.23" resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.23.tgz#3c2bb1bcc698ae69d70735f33c5a8e95f41ac528" From f44cba497b5ac019eacc7ea0ca9dcd969bf51fdd Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 4 Apr 2022 17:22:31 +0300 Subject: [PATCH 013/192] Migrated queries to opus --- packages/scandipwa/package.json | 11 +- packages/scandipwa/src/query/Cart.query.ts | 101 +++--- .../scandipwa/src/query/Category.query.ts | 26 +- .../scandipwa/src/query/CheckEmail.query.ts | 10 +- .../scandipwa/src/query/Checkout.query.ts | 105 ++++-- .../scandipwa/src/query/CmsBlock.query.ts | 17 +- packages/scandipwa/src/query/CmsPage.query.ts | 8 +- packages/scandipwa/src/query/Config.query.ts | 43 ++- .../scandipwa/src/query/ContactForm.query.ts | 20 +- packages/scandipwa/src/query/Klarna.query.ts | 7 +- packages/scandipwa/src/query/Menu.query.ts | 16 +- .../scandipwa/src/query/MyAccount.query.ts | 106 +++--- .../src/query/NewsletterSubscription.query.ts | 12 +- packages/scandipwa/src/query/Order.query.ts | 184 +++++----- .../src/query/ProductAlerts.query.ts | 6 +- .../src/query/ProductCompare.query.ts | 98 ++++-- .../scandipwa/src/query/ProductList.query.ts | 313 ++++++++++-------- packages/scandipwa/src/query/Query.type.ts | 7 + packages/scandipwa/src/query/Region.query.ts | 18 +- packages/scandipwa/src/query/Review.query.ts | 39 ++- packages/scandipwa/src/query/Slider.query.ts | 20 +- .../src/query/StoreInPickUp.query.ts | 15 +- .../scandipwa/src/query/UrlRewrites.query.ts | 8 +- .../scandipwa/src/query/Wishlist.query.ts | 71 ++-- .../opus/src/builder/AbstractField.ts | 6 +- 25 files changed, 770 insertions(+), 497 deletions(-) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index f5c11ffbd2..92f9cf597e 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -130,7 +130,9 @@ "parserOptions": { "project": "./tsconfig.json" }, - "ignorePatterns": ["package.json"], + "ignorePatterns": [ + "package.json" + ], "env": { "browser": true }, @@ -501,7 +503,12 @@ "error", { "selector": "default", - "format": ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"], + "format": [ + "camelCase", + "PascalCase", + "snake_case", + "UPPER_CASE" + ], "leadingUnderscore": "allow" }, { diff --git a/packages/scandipwa/src/query/Cart.query.ts b/packages/scandipwa/src/query/Cart.query.ts index 3563720819..88b9195eb6 100644 --- a/packages/scandipwa/src/query/Cart.query.ts +++ b/packages/scandipwa/src/query/Cart.query.ts @@ -10,35 +10,56 @@ * @link https://github.com/scandipwa/base-theme */ +import { Field, Mutation, Query } from '@tilework/opus'; + import ProductListQuery from 'Query/ProductList.query'; -import { GQLCartItemInput, GQLUpdateCartItemsInput } from 'Type/Graphql.type'; +import { + GQLAddProductsToCartOutput, + GQLAppliedTaxItemRate, + GQLCart, + GQLCartDisplayConfig, + GQLCartItemInput, + GQLQuery, + GQLQuoteData, + GQLUpdateCartItemsInput, + GQLUpdateCartItemsOutput, + GQLWishListUserInputError +} from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; -import { Field } from 'Util/Query'; + +import { CommonField } from './Query.type'; /** @namespace Query/Cart/Query */ export class CartQuery { //#region MUTATIONS - getAddProductToCartMutation(cartId: string, cartItems: GQLCartItemInput): Field { - return new Field('addProductsToCart') + getAddProductToCartMutation( + cartId: string, + cartItems: GQLCartItemInput + ): Mutation<'addProductsToCart', GQLAddProductsToCartOutput & { + user_errors: GQLWishListUserInputError[]; + }> { + return new Mutation<'addProductsToCart', GQLAddProductsToCartOutput>('addProductsToCart') .addArgument('cartId', 'String!', cartId) .addArgument('cartItems', '[CartItemInput!]!', cartItems) .addField(this._getUserErrorsField()); } - getUpdateCartItemsMutation(input: GQLUpdateCartItemsInput): Field { - return new Field('updateCartItems') + getUpdateCartItemsMutation( + input: GQLUpdateCartItemsInput + ): Mutation<'updateCartItems', GQLUpdateCartItemsOutput> { + return new Mutation<'updateCartItems', GQLUpdateCartItemsOutput>('updateCartItems') .addArgument('input', 'UpdateCartItemsInput', input) .addField(this._getCartUpdateField()); } - getCreateEmptyCartMutation(): Field { - return new Field('createEmptyCart'); + getCreateEmptyCartMutation(): Mutation<'createEmptyCart', string> { + return new Mutation<'createEmptyCart', string>('createEmptyCart'); } //#endregion //#region QUERIES - getCartQuery(quoteId: string): Field { - const query = new Field('getCartForCustomer') + getCartQuery(quoteId: string): Query<'cartData', GQLQuoteData> { + const query = new Query<'getCartForCustomer', GQLQuoteData>('getCartForCustomer') .addFieldList(this._getCartTotalsFields()) .setAlias('cartData'); @@ -58,19 +79,21 @@ export class CartQuery { ]; } - _getUserErrorsField(): Field { - return new Field('user_errors') + _getUserErrorsField(): Field<'user_errors', GQLWishListUserInputError, true> { + return new Field<'user_errors', GQLWishListUserInputError, true>('user_errors') .addFieldList(this._getUserErrorsFields()); } //#endregion - _getCartUpdateField(): Field { - return new Field('cart') + _getCartUpdateField(): Field<'cart', GQLCart & { + id: string; + }> { + return new Field<'cart', GQLCart>('cart') .addField('id'); } - getRemoveCartItemMutation(item_id: number, quoteId: string): Field { - const mutation = new Field('removeCartItem') + getRemoveCartItemMutation(item_id: number, quoteId: string): Mutation<'removeCartItem', GQLQuery> { + const mutation = new Mutation<'removeCartItem', GQLQuery>('removeCartItem') .addArgument('item_id', 'Int!', item_id) .addFieldList(this._getRemoveCartItemFields(quoteId)); @@ -81,8 +104,8 @@ export class CartQuery { return mutation; } - getApplyCouponMutation(couponCode: string, quoteId: string): Field { - const mutation = new Field('applyCoupon') + getApplyCouponMutation(couponCode: string, quoteId: string): Mutation<'applyCoupon', GQLQuery> { + const mutation = new Mutation<'applyCoupon', GQLQuery>('applyCoupon') .addArgument('coupon_code', 'String!', couponCode) .addField(this.getCartQuery(quoteId)); @@ -93,8 +116,8 @@ export class CartQuery { return mutation; } - getRemoveCouponMutation(quoteId: string): Field { - const mutation = new Field('removeCoupon') + getRemoveCouponMutation(quoteId: string): Mutation<'removeCoupon', GQLQuery> { + const mutation = new Mutation<'removeCoupon', GQLQuery>('removeCoupon') .addField(this.getCartQuery(quoteId)); if (!isSignedIn()) { @@ -104,32 +127,32 @@ export class CartQuery { return mutation; } - getCartDisplayConfig(): Field { - return new Field('getCartDisplayConfig') + getCartDisplayConfig(): Field<'cartDisplayConfig', GQLCartDisplayConfig> { + return new Field<'getCartDisplayConfig', GQLCartDisplayConfig>('getCartDisplayConfig') .setAlias('cartDisplayConfig') .addFieldList(this._getCartDisplayConfigFields()); } - getMergeCartQuery(sourceCartId: string, destinationCartId: string): Field { - return new Field('mergeCarts') + getMergeCartQuery(sourceCartId: string, destinationCartId: string): Field<'mergeCarts', GQLCart> { + return new Field<'mergeCarts', GQLCart>('mergeCarts') .addArgument('source_cart_id', 'String!', sourceCartId) .addArgument('destination_cart_id', 'String!', destinationCartId) .addField('id'); } - _getSaveCartItemFields(quoteId: string): Field[] { + _getSaveCartItemFields(quoteId: string): Query<'cartData', GQLQuoteData, false>[] { return [ this.getCartQuery(quoteId) ]; } - _getRemoveCartItemFields(quoteId: string): Field[] { + _getRemoveCartItemFields(quoteId: string): Query<'cartData', GQLQuoteData, false>[] { return [ this.getCartQuery(quoteId) ]; } - _getCartTotalsFields(): Array { + _getCartTotalsFields(): CommonField[] { return [ 'id', 'subtotal', @@ -165,12 +188,12 @@ export class CartQuery { ]; } - _getBundleOptionValuesField(): Field { + _getBundleOptionValuesField(): CommonField { return new Field('values') .addFieldList(this._getBundleOptionValuesFields()); } - _getBundleOptionsFields(): Array { + _getBundleOptionsFields(): CommonField[] { return [ 'id', 'label', @@ -178,7 +201,7 @@ export class CartQuery { ]; } - _getBundleOptionsField(): Field { + _getBundleOptionsField(): CommonField { return new Field('bundle_options') .addFieldList(this._getBundleOptionsFields()); } @@ -191,12 +214,12 @@ export class CartQuery { ]; } - _getCustomizableOptionValueField(): Field { + _getCustomizableOptionValueField(): CommonField { return new Field('values') .addFieldList(this._getCustomizableOptionValueFields()); } - _getCustomizableOptionsFields(): Field { + _getCustomizableOptionsFields(): CommonField { return new Field('customizable_options') .addFieldList([ 'id', @@ -205,7 +228,7 @@ export class CartQuery { ]); } - _getDownloadableLinksField(): Field { + _getDownloadableLinksField(): CommonField { return new Field('downloadable_links') .addFieldList(this._getDownloadableLinksFields()); } @@ -217,7 +240,7 @@ export class CartQuery { ]; } - _getCartItemFields(): Array { + _getCartItemFields(): CommonField[] { return [ 'qty', 'sku', @@ -236,12 +259,12 @@ export class CartQuery { ]; } - _getProductField(): Field { + _getProductField(): CommonField { return new Field('product') .addFieldList(ProductListQuery._getCartProductInterfaceFields()); } - _getCartItemsField(): Field { + _getCartItemsField(): CommonField { return new Field('items') .addFieldList(this._getCartItemFields()); } @@ -257,13 +280,13 @@ export class CartQuery { ]; } - _getAppliedTaxesField(): Field { + _getAppliedTaxesField(): CommonField { return new Field('applied_taxes') .addField(this._getAppliedTaxesRatesField()); } - _getAppliedTaxesRatesField(): Field { - return new Field('rates') + _getAppliedTaxesRatesField(): Field<'rates', GQLAppliedTaxItemRate, true> { + return new Field<'rates', GQLAppliedTaxItemRate, true>('rates', true) .addFieldList(this._getAppliedTaxesRatesFields()); } diff --git a/packages/scandipwa/src/query/Category.query.ts b/packages/scandipwa/src/query/Category.query.ts index 9799d17ae1..3b138ab871 100644 --- a/packages/scandipwa/src/query/Category.query.ts +++ b/packages/scandipwa/src/query/Category.query.ts @@ -9,9 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field, FieldArgument } from 'Util/Query'; +import { Argument, Field, Query } from '@tilework/opus'; -import { CategoryQueryOptions } from './Query.type'; +import { GQLCategoryTree } from 'Type/Graphql.type'; + +import { CategoryQueryOptions, CommonField } from './Query.type'; /** * Category Query @@ -21,7 +23,9 @@ import { CategoryQueryOptions } from './Query.type'; export class CategoryQuery { options = {} as CategoryQueryOptions; - getQuery(options: CategoryQueryOptions = {} as CategoryQueryOptions): Field { + getQuery(options: CategoryQueryOptions = {} as CategoryQueryOptions): Query<'category', GQLCategoryTree & { + children: GQLCategoryTree[]; + }, false> { this.options = options; const { name, @@ -29,13 +33,13 @@ export class CategoryQuery { value } = this._getConditionalArguments(); - return new Field('category') + return new Query<'category', GQLCategoryTree>('category') .addArgument(name, type, value) .addFieldList(this._getDefaultFields()) .addField(this._getChildrenFields()); } - _getConditionalArguments(): FieldArgument { + _getConditionalArguments(): Argument { const { categoryIds } = this.options; if (categoryIds) { @@ -43,19 +47,19 @@ export class CategoryQuery { return { name: 'id', type: 'Int!', - value: categoryIds + value: String(categoryIds) }; } throw new Error(__('There was an error requesting the category')); } - _getChildrenFields(): Field { - return new Field('children') + _getChildrenFields(): Field<'children', GQLCategoryTree, true> { + return new Field<'children', GQLCategoryTree, true>('children') .addFieldList(this._getDefaultFields()); } - _getBreadcrumbsField(): Field { + _getBreadcrumbsField(): CommonField { return new Field('breadcrumbs') .addFieldList(this._getBreadcrumbFields()); } @@ -78,12 +82,12 @@ export class CategoryQuery { ]; } - _getCmsBlockField(): Field { + _getCmsBlockField(): CommonField { return new Field('cms_block') .addFieldList(this._getCmsBlockFields()); } - _getDefaultFields(): Array { + _getDefaultFields(): CommonField[] { return [ 'id', 'url', diff --git a/packages/scandipwa/src/query/CheckEmail.query.ts b/packages/scandipwa/src/query/CheckEmail.query.ts index 1e542de00d..a133c9a662 100644 --- a/packages/scandipwa/src/query/CheckEmail.query.ts +++ b/packages/scandipwa/src/query/CheckEmail.query.ts @@ -9,15 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Query } from '@tilework/opus'; + +import { GQLIsEmailAvailableOutput } from 'Type/Graphql.type'; /** * Email availability check Query * @class CheckEmailQuery * @namespace Query/CheckEmail/Query */ export class CheckEmailQuery { - getIsEmailAvailableQuery(email: string): Field { - const query = new Field('isEmailAvailable') + getIsEmailAvailableQuery(email: string): Query<'isEmailAvailable', GQLIsEmailAvailableOutput & { + is_email_available: boolean; + }> { + const query = new Query<'isEmailAvailable', GQLIsEmailAvailableOutput>('isEmailAvailable') .addArgument('email', 'String!', email) .addField('is_email_available'); diff --git a/packages/scandipwa/src/query/Checkout.query.ts b/packages/scandipwa/src/query/Checkout.query.ts index e4e6608922..87c9a4f913 100644 --- a/packages/scandipwa/src/query/Checkout.query.ts +++ b/packages/scandipwa/src/query/Checkout.query.ts @@ -9,66 +9,106 @@ * @link https://github.com/scandipwa/base-theme */ -import { GQLS_SetBillingAddressOnCartInput, GQLS_SetPaymentMethodOnCartInput } from 'Type/Graphql.type'; +import { Field, Mutation, Query } from '@tilework/opus'; + +import { + GQLCart, + GQLOrder, + GQLPaymentDetails, + GQLPaymentMethod, + GQLPaymentTotals, + GQLPlaceOrderOutput, + GQLS_SetBillingAddressOnCartInput, + GQLS_SetPaymentMethodOnCartInput, + GQLSetBillingAddressOnCartOutput, + GQLSetGuestEmailOnCartOutput, + GQLSetPaymentMethodOnCartOutput, + GQLShippingMethod, + GQLTotalsItem +} from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; -import { Field } from 'Util/Query'; + +import { CommonField } from './Query.type'; /** @namespace Query/Checkout/Query */ export class CheckoutQuery { - getPaymentMethodsQuery(guestCartId: string): Field { - const query = new Field('getPaymentMethods') + getPaymentMethodsQuery(guestCartId: string): Query<'getPaymentMethods', GQLPaymentMethod, true> { + const query = new Query<'getPaymentMethods', GQLPaymentMethod, true>('getPaymentMethods') .addFieldList(this._getPaymentMethodFields()); - this._addGuestCartId(guestCartId, query); + this._addGuestCartId(guestCartId, query as Query); return query; } - getSaveGuestEmailMutation(email: string, cart_id: string): Field { + getSaveGuestEmailMutation( + email: string, + cart_id: string + ): Mutation<'setGuestEmailOnCart', GQLSetGuestEmailOnCartOutput & { + cart: { + email: string; + }; + }, false> { const input = { email, cart_id }; - const mutation = new Field('setGuestEmailOnCart') + const mutation = new Mutation<'setGuestEmailOnCart', GQLSetGuestEmailOnCartOutput>('setGuestEmailOnCart') .addArgument('input', 'SetGuestEmailOnCartInput', input) .addField(((new Field('cart')).addField('email'))); return mutation; } - getEstimateShippingCosts(address: string, guestCartId: string): Field { - const mutation = new Field('estimateShippingCosts') + getEstimateShippingCosts( + address: string, + guestCartId: string + ): Mutation<'estimateShippingCosts', GQLShippingMethod, true> { + const mutation = new Mutation<'estimateShippingCosts', GQLShippingMethod, true>('estimateShippingCosts', true) .addArgument('address', 'EstimateShippingCostsAddress!', address) .addFieldList(this._getEstimatedShippingFields()); - this._addGuestCartId(guestCartId, mutation); + this._addGuestCartId(guestCartId, mutation as Mutation); return mutation; } - getSaveAddressInformation(addressInformation: string, guestCartId: string): Field { - const mutation = new Field('saveAddressInformation') + getSaveAddressInformation( + addressInformation: string, + guestCartId: string + ): Mutation<'saveAddressInformation', GQLPaymentDetails & { + [x: string]: unknown; + }> { + const mutation = new Mutation<'saveAddressInformation', GQLPaymentDetails>('saveAddressInformation') .addArgument('addressInformation', 'SaveAddressInformation!', addressInformation) .addFieldList(this._getSaveAddressInformationFields()); - this._addGuestCartId(guestCartId, mutation); + this._addGuestCartId(guestCartId, mutation as Mutation); return mutation; } - getSetBillingAddressOnCart(input: GQLS_SetBillingAddressOnCartInput): Field { - return new Field('s_setBillingAddressOnCart') + getSetBillingAddressOnCart( + input: GQLS_SetBillingAddressOnCartInput + ): Mutation<'billingAddress', GQLSetBillingAddressOnCartOutput> { + return new Mutation<'s_setBillingAddressOnCart', GQLSetBillingAddressOnCartOutput>('s_setBillingAddressOnCart') .addArgument('input', 'S_SetBillingAddressOnCartInput!', input) .addField(this._getCartField()) .setAlias('billingAddress'); } - getSetPaymentMethodOnCartMutation(input: GQLS_SetPaymentMethodOnCartInput): Field { - return new Field('s_setPaymentMethodOnCart') + getSetPaymentMethodOnCartMutation( + input: GQLS_SetPaymentMethodOnCartInput + ): Mutation<'paymentMethod', GQLSetPaymentMethodOnCartOutput> { + return new Mutation<'s_setPaymentMethodOnCart', GQLSetPaymentMethodOnCartOutput>('s_setPaymentMethodOnCart') .addArgument('input', 'S_SetPaymentMethodOnCartInput!', input) .addField(this._getCartField()) .setAlias('paymentMethod'); } - getPlaceOrderMutation(guestCartId: string): Field { - const mutation = new Field('s_placeOrder') + getPlaceOrderMutation(guestCartId: string): Mutation<'placeOrder', GQLPlaceOrderOutput & { + order: GQLOrder & { + order_id: string; + }; + }> { + const mutation = new Mutation<'s_placeOrder', GQLPlaceOrderOutput>('s_placeOrder') .setAlias('placeOrder') .addField(this._getOrderField()); @@ -79,18 +119,23 @@ export class CheckoutQuery { return mutation; } - _addGuestCartId(guestCartId: string, mutation: Field): void { + _addGuestCartId( + guestCartId: string, + mutation: Mutation | Query + ): void { if (guestCartId && !isSignedIn()) { mutation.addArgument('guestCartId', 'String!', guestCartId); } } - _getOrderField(): Field { - return new Field('order') + _getOrderField(): Field<'order', GQLOrder & { + order_id: string; + }, false> { + return new Field<'order', GQLOrder>('order') .addFieldList(['order_id']); } - _getSaveAddressInformationFields(): Field[] { + _getSaveAddressInformationFields(): CommonField[] { return [ this._getPaymentMethodsField(), this._getTotalsField() @@ -112,8 +157,8 @@ export class CheckoutQuery { ]; } - _getPaymentMethodsField(): Field { - return new Field('payment_methods') + _getPaymentMethodsField(): Field<'payment_methods', GQLPaymentMethod, true> { + return new Field<'payment_methods', GQLPaymentMethod, true>('payment_methods', true) .addFieldList(this._getPaymentMethodFields()); } @@ -136,12 +181,12 @@ export class CheckoutQuery { ]; } - _getTotalItemField(): Field { + _getTotalItemField(): Field<'items', GQLTotalsItem> { return new Field('items') .addFieldList(this._getTotalItemFields()); } - _getTotalsFields(): Array { + _getTotalsFields(): CommonField[] { return [ 'subtotal', 'tax_amount', @@ -159,13 +204,13 @@ export class CheckoutQuery { ]; } - _getTotalsField(): Field { + _getTotalsField(): Field<'totals', GQLPaymentTotals> { return new Field('totals') .addFieldList(this._getTotalsFields()); } - _getCartField(): Field { - return new Field('cart') + _getCartField(): Field<'cart', GQLCart> { + return new Field<'cart', GQLCart>('cart') .addFieldList(this._getCartFieldList()); } diff --git a/packages/scandipwa/src/query/CmsBlock.query.ts b/packages/scandipwa/src/query/CmsBlock.query.ts index 84bf29f587..fb337ddf82 100644 --- a/packages/scandipwa/src/query/CmsBlock.query.ts +++ b/packages/scandipwa/src/query/CmsBlock.query.ts @@ -9,7 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; + +import { GQLCmsBlock, GQLCmsBlocks } from 'Type/Graphql.type'; /** * CMS Blocks Query @@ -22,15 +24,16 @@ export class CmsBlockQuery { * @return {Field} CMS Block query * @memberof CmsBlocksQuery */ - getQuery({ identifiers }: { identifiers: string[] }): Field { + getQuery({ identifiers }: { identifiers: string[] }): Query<'cmsBlocks', GQLCmsBlocks & { + items: GQLCmsBlock[]; + }> { if (!identifiers) { throw new Error('Missing argument `options`'); } - return new Field('cmsBlocks') + return new Query<'cmsBlocks', GQLCmsBlocks>('cmsBlocks') .addArgument('identifiers', '[String]', identifiers) - .addField(this._getItemsField()) - .setAlias('cmsBlocks'); + .addField(this._getItemsField()); } _getItemFields(): string[] { @@ -42,8 +45,8 @@ export class CmsBlockQuery { ]; } - _getItemsField(): Field { - return new Field('items') + _getItemsField(): Field<'items', GQLCmsBlock, true> { + return new Field<'items', GQLCmsBlock, true>('items', true) .addFieldList(this._getItemFields()); } } diff --git a/packages/scandipwa/src/query/CmsPage.query.ts b/packages/scandipwa/src/query/CmsPage.query.ts index d0a5c825de..13ee5c20fd 100644 --- a/packages/scandipwa/src/query/CmsPage.query.ts +++ b/packages/scandipwa/src/query/CmsPage.query.ts @@ -9,7 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Query } from '@tilework/opus'; + +import { GQLCmsPage } from 'Type/Graphql.type'; import { CmsPage } from './Query.type'; @@ -18,12 +20,12 @@ import { CmsPage } from './Query.type'; * @class CmsPageQuery * @namespace Query/CmsPage/Query */ export class CmsPageQuery { - getQuery({ id, url_key, identifier }: CmsPage): Field { + getQuery({ id, url_key, identifier }: CmsPage): Query<'cmsPage', GQLCmsPage> { if (!id && !url_key && !identifier) { throw new Error('Missing argument `id` or `url_key`!'); } - const cmsPage = new Field('cmsPage') + const cmsPage = new Query<'cmsPage', GQLCmsPage>('cmsPage') .addFieldList(this._getPageFields()); if (identifier) { diff --git a/packages/scandipwa/src/query/Config.query.ts b/packages/scandipwa/src/query/Config.query.ts index 2042846a18..df1a2737ff 100644 --- a/packages/scandipwa/src/query/Config.query.ts +++ b/packages/scandipwa/src/query/Config.query.ts @@ -9,22 +9,30 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Mutation, Query } from '@tilework/opus'; + +import { + GQLCheckoutAgreement, + GQLCurrency, + GQLCurrencyConfig, GQLPriceTaxDisplay, GQLQuery, GQLStoreConfig +} from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** @namespace Query/Config/Query */ export class ConfigQuery { - getStoreListField(): Field { - return new Field('storeList') + getStoreListField(): Query<'storeList', GQLStoreConfig, true> { + return new Query<'storeList', GQLStoreConfig, true>('storeList', true) .addFieldList(this._getStoreListFields()); } - getCheckoutAgreements(): Field { - return new Field('checkoutAgreements') + getCheckoutAgreements(): Query<'checkoutAgreements', GQLCheckoutAgreement, true> { + return new Query<'checkoutAgreements', GQLCheckoutAgreement, true>('checkoutAgreements', true) .addFieldList(this._getCheckoutAgreementFields()); } - getCurrencyField(): Field { - return new Field('available_currencies_data') + getCurrencyField(): Query<'available_currencies_data', { id: string; label: string; value: string }, true> { + return new Query<'available_currencies_data', GQLCurrency, true>('available_currencies_data', true) .addFieldList([ 'id', 'label', @@ -32,24 +40,27 @@ export class ConfigQuery { ]); } - getCurrencyData(): Field { - return new Field('currencyData') + getCurrencyData(): Query<'currencyData', GQLCurrencyConfig> { + return new Query<'currencyData', GQLCurrencyConfig>('currencyData') .addFieldList([ this.getCurrencyField(), 'current_currency_code' ]); } - getPriceDisplayTypeField(): Field { - return new Field('priceTaxDisplay') + _getPriceDisplayTypeField(): Field<'priceTaxDisplay', GQLPriceTaxDisplay & { + product_price_display_type: string; + shipping_price_display_type: string; + }> { + return new Field<'priceTaxDisplay', GQLPriceTaxDisplay>('priceTaxDisplay') .addFieldList([ 'product_price_display_type', 'shipping_price_display_type' ]); } - getSaveSelectedCurrencyMutation(newCurrency: string): Field { - return new Field('saveSelectedCurrency') + getSaveSelectedCurrencyMutation(newCurrency: string): Mutation<'saveSelectedCurrency', GQLQuery> { + return new Mutation<'saveSelectedCurrency', GQLQuery>('saveSelectedCurrency') .addArgument('currency', 'String', newCurrency) .addFieldList([ this.getCurrencyData() @@ -78,7 +89,7 @@ export class ConfigQuery { ]; } - getQuery(): Field { + getQuery(): Field<'storeConfig', GQLStoreConfig> { return new Field('storeConfig') .addFieldList(this._getStoreConfigFields()); } @@ -92,7 +103,7 @@ export class ConfigQuery { ]; } - _getStoreConfigFields(): Array { + _getStoreConfigFields(): CommonField[] { return [ 'code', 'is_active', @@ -153,7 +164,7 @@ export class ConfigQuery { 'minimun_password_length', 'required_character_classes_number', ...this._getTimeDateFormatFields(), - this.getPriceDisplayTypeField() + this._getPriceDisplayTypeField() ]; } } diff --git a/packages/scandipwa/src/query/ContactForm.query.ts b/packages/scandipwa/src/query/ContactForm.query.ts index f5520d0de7..993367084a 100644 --- a/packages/scandipwa/src/query/ContactForm.query.ts +++ b/packages/scandipwa/src/query/ContactForm.query.ts @@ -9,25 +9,29 @@ * @link https://github.com/scandipwa/base-theme */ -import { GQLContactForm } from 'Type/Graphql.type'; -import { Field } from 'Util/Query'; +import { Mutation, Query } from '@tilework/opus'; + +import { GQLContactForm, GQLContactFormResponse, GQLContactPageConfig } from 'Type/Graphql.type'; /** @namespace Query/ContactForm/Query */ export class ContactFormQuery { - getSendContactFormMutation(options: GQLContactForm): Field { - const mutation = new Field('contactForm'); - this._addSendContactFormMutationArguments(mutation, options); + getSendContactFormMutation(options: GQLContactForm): Mutation<'contactForm', GQLContactFormResponse> { + const mutation = new Mutation<'contactForm', GQLContactFormResponse>('contactForm'); + this._addSendContactFormMutationArguments(mutation as Mutation, options); mutation.addFieldList(this._getSendContactFormMutationResponse()); return mutation; } - getContactPageConfigQuery(): Field { - return new Field('contactPageConfig') + getContactPageConfigQuery(): Query<'contactPageConfig', GQLContactPageConfig> { + return new Query<'contactPageConfig', GQLContactPageConfig>('contactPageConfig') .addFieldList(this._getContactPageConfigFields()); } - _addSendContactFormMutationArguments(mutation: Field, options: GQLContactForm): Field { + _addSendContactFormMutationArguments( + mutation: Mutation, + options: GQLContactForm + ): Mutation { return mutation.addArgument('contact', 'ContactForm!', options); } diff --git a/packages/scandipwa/src/query/Klarna.query.ts b/packages/scandipwa/src/query/Klarna.query.ts index 9f5bfbe696..b568504cfa 100644 --- a/packages/scandipwa/src/query/Klarna.query.ts +++ b/packages/scandipwa/src/query/Klarna.query.ts @@ -9,13 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ +import { Mutation } from '@tilework/opus'; + import { GQLKlarnaTokenInput } from 'Type/Graphql.type'; -import { Field } from 'Util/Query'; /** @namespace Query/Klarna/Query */ export class KlarnaQuery { - getCreateKlarnaTokenMutation(input: GQLKlarnaTokenInput): Field { - return new Field('createKlarnaToken') + getCreateKlarnaTokenMutation(input: GQLKlarnaTokenInput): Mutation<'klarnaToken', string> { + return new Mutation<'createKlarnaToken', string>('createKlarnaToken') .addArgument('input', 'KlarnaTokenInput!', input) .setAlias('klarnaToken'); } diff --git a/packages/scandipwa/src/query/Menu.query.ts b/packages/scandipwa/src/query/Menu.query.ts index 215b59f444..9e7d26c193 100644 --- a/packages/scandipwa/src/query/Menu.query.ts +++ b/packages/scandipwa/src/query/Menu.query.ts @@ -9,7 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; + +import { GQLItem, GQLMenu } from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** * Menu Query * @class MenuQuery @@ -21,21 +25,21 @@ export class MenuQuery { * @return {Field} Menu query * @memberof MenuQuery */ - getQuery({ identifier }: { identifier: string }): Field { - return new Field('scandiwebMenu') + getQuery({ identifier }: { identifier: string }): Query<'menu', GQLMenu> { + return new Query<'scandiwebMenu', GQLMenu>('scandiwebMenu') .addArgument('identifier', 'String!', identifier) .addFieldList(this._getMenuFields()) .setAlias('menu'); } - _getMenuFields(): Array { + _getMenuFields(): CommonField[] { return [ 'menu_id', 'is_active', 'css_class', this._getMenuItemsField() ]; } - _getMenuItemsField(): Field { - return new Field('items') + _getMenuItemsField(): Field<'items', GQLItem, true> { + return new Field<'items', GQLItem, true>('items', true) .addFieldList(this._getMenuItemFields()); } diff --git a/packages/scandipwa/src/query/MyAccount.query.ts b/packages/scandipwa/src/query/MyAccount.query.ts index 34b8346411..10bde33914 100644 --- a/packages/scandipwa/src/query/MyAccount.query.ts +++ b/packages/scandipwa/src/query/MyAccount.query.ts @@ -9,11 +9,29 @@ * @link https://github.com/scandipwa/base-theme */ -import { GQLCustomerAddressInput, GQLCustomerUpdateInput } from 'Type/Graphql.type'; -import { Field } from 'Util/Query'; +import { Field, Mutation } from '@tilework/opus'; import { - ChangeCustomerPasswordOptions, ConfirmAccountOptions, CreateAccountOptions, ResetPasswordOptions, SignInOptions + GQLCreateCustomerType, + GQLCustomer, + GQLCustomerActionConfirmationType, + GQLCustomerAddress, + GQLCustomerAddressInput, + GQLCustomerAddressRegion, + GQLCustomerOutput, + GQLCustomerToken, + GQLCustomerUpdateInput, + GQLResetPasswordType, + GQLRevokeCustomerTokenOutput +} from 'Type/Graphql.type'; + +import { + ChangeCustomerPasswordOptions, + CommonField, + ConfirmAccountOptions, + CreateAccountOptions, + ResetPasswordOptions, + SignInOptions } from './Query.type'; /** @@ -27,10 +45,12 @@ export class MyAccountQuery { * @return {Field} * @memberof MyAccount */ - getResetPasswordMutation(options: ResetPasswordOptions): Field { + getResetPasswordMutation(options: ResetPasswordOptions): Mutation<'s_resetPassword', GQLResetPasswordType & { + status: string; + }> { const { token, password, password_confirmation } = options; - return new Field('s_resetPassword') + return new Mutation<'s_resetPassword', GQLResetPasswordType>('s_resetPassword') .addArgument('token', 'String!', token) .addArgument('password', 'String!', password) .addArgument('password_confirmation', 'String!', password_confirmation) @@ -43,86 +63,96 @@ export class MyAccountQuery { * @return {Field} * @memberof MyAccount */ - getSignInMutation(options: SignInOptions): Field { + getSignInMutation(options: SignInOptions): Mutation<'generateCustomerToken', GQLCustomerToken & { + token: string; + }> { const { email, password } = options; - return new Field('generateCustomerToken') + return new Mutation<'generateCustomerToken', GQLCustomerToken>('generateCustomerToken') .addArgument('email', 'String!', email) .addArgument('password', 'String!', password) .addField('token'); } - getUpdateInformationMutation(options: GQLCustomerUpdateInput): Field { - return new Field('updateCustomerV2') + getUpdateInformationMutation(options: GQLCustomerUpdateInput): Mutation<'updateCustomerV2', GQLCustomerOutput> { + return new Mutation<'updateCustomerV2', GQLCustomerOutput>('updateCustomerV2') .addArgument('input', 'CustomerUpdateInput!', options) .addField(this._getCustomerField()); } - getUpdateEmailMutation(options: SignInOptions): Field { + getUpdateEmailMutation(options: SignInOptions): Mutation<'updateCustomerEmail', GQLCustomerOutput> { const { email, password } = options; - return new Field('updateCustomerEmail') + return new Mutation<'updateCustomerEmail', GQLCustomerOutput>('updateCustomerEmail') .addArgument('email', 'String!', email) .addArgument('password', 'String!', password) .addField(this._getCustomerField()); } - getChangeCustomerPasswordMutation(options: ChangeCustomerPasswordOptions): Field { + getChangeCustomerPasswordMutation( + options: ChangeCustomerPasswordOptions + ): Mutation<'changeCustomerPassword', GQLCustomer & { + id: string; + email: string; + }> { const { password, newPassword } = options; - return new Field('changeCustomerPassword') + return new Mutation<'changeCustomerPassword', GQLCustomer>('changeCustomerPassword') .addArgument('currentPassword', 'String!', password) .addArgument('newPassword', 'String!', newPassword) .addField('id') .addField('email'); } - getCreateAddressMutation(options: GQLCustomerAddressInput): Field { - return new Field('createCustomerAddress') + getCreateAddressMutation(options: GQLCustomerAddressInput): Field<'createCustomerAddress', GQLCustomerAddress> { + return new Field<'createCustomerAddress', GQLCustomerAddress>('createCustomerAddress') .addArgument('input', 'CustomerAddressInput!', options) .addFieldList(this._getAddressFields()); } - getDeleteAddressMutation(id: number): Field { - return new Field('deleteCustomerAddress') + getDeleteAddressMutation(id: number): Field<'deleteCustomerAddress', boolean> { + return new Field<'deleteCustomerAddress', boolean>('deleteCustomerAddress') .addArgument('id', 'Int!', id); } - getUpdateAddressMutation(id: number, options: GQLCustomerAddressInput): Field { - return new Field('updateCustomerAddress') + getUpdateAddressMutation( + id: number, + options: GQLCustomerAddressInput + ): Field<'updateCustomerAddress', GQLCustomerAddress> { + return new Field<'updateCustomerAddress', GQLCustomerAddress>('updateCustomerAddress') .addArgument('id', 'Int!', id) .addArgument('input', 'CustomerAddressInput!', options) .addFieldList(this._getAddressFields()); } - getCreateAccountMutation(options: CreateAccountOptions): Field { + getCreateAccountMutation(options: CreateAccountOptions): Field<'createCustomer', GQLCustomerOutput> { const { customer, password } = options; - return new Field('createCustomer') + return new Field<'createCustomer', GQLCustomerOutput>('createCustomer') .addArgument('input', 'CustomerInput!', { ...customer, password }) .addField(this._getCustomerField()); } - getConfirmAccountMutation(options: ConfirmAccountOptions): Field { + getConfirmAccountMutation(options: ConfirmAccountOptions): Field<'confirmCustomerEmail', GQLCreateCustomerType> { const { key, email, password } = options; - return new Field('confirmCustomerEmail') + return new Field<'confirmCustomerEmail', GQLCreateCustomerType>('confirmCustomerEmail') .addArgument('key', 'String!', key) .addArgument('email', 'String!', email) .addArgument('password', 'String!', password) .addFieldList(this._getConfirmAccountFields()); } - getRevokeAccountToken(): Field { - return new Field('revokeCustomerToken') + getRevokeAccountToken(): Field<'revokeCustomerToken', GQLRevokeCustomerTokenOutput> { + return new Field<'revokeCustomerToken', GQLRevokeCustomerTokenOutput>('revokeCustomerToken') .addFieldList(this.getRevokeAccountTokenFields()); } - getCustomerQuery(): Field { + getCustomerQuery(): Field<'customer', GQLCustomer> { return this._getCustomerField(); } - _getConfirmAccountFields(): Array { + _getConfirmAccountFields(): CommonField[] { return [ 'status', 'token', @@ -136,12 +166,12 @@ export class MyAccountQuery { ]; } - _getCustomerField(): Field { - return new Field('customer') + _getCustomerField(): Field<'customer', GQLCustomer> { + return new Field<'customer', GQLCustomer>('customer') .addFieldList(this._getCustomerFields()); } - _getCustomerFields(): Array { + _getCustomerFields(): CommonField[] { return [ 'created_at', 'confirmation_required', @@ -162,13 +192,13 @@ export class MyAccountQuery { ]; } - _getAddressesField(): Field { - return new Field('addresses') + _getAddressesField(): Field<'addresses', GQLCustomerAddress, true> { + return new Field<'addresses', GQLCustomerAddress, true>('addresses', true) .addFieldList(this._getAddressFields()); } - _getRegionField(): Field { - return new Field('region') + _getRegionField(): Field<'region', GQLCustomerAddressRegion> { + return new Field<'region', GQLCustomerAddressRegion>('region') .addFieldList(this._getRegionFields()); } @@ -180,7 +210,7 @@ export class MyAccountQuery { ]; } - _getAddressFields(): Array { + _getAddressFields(): CommonField[] { return [ 'id', 'customer_id', @@ -207,10 +237,12 @@ export class MyAccountQuery { * @returns {Field} * @memberof MyAccount */ - getForgotPasswordMutation(options: { email: string }): Field { + getForgotPasswordMutation(options: { email: string }): Field<'forgotPassword', GQLCustomerActionConfirmationType & { + status: string; + }> { const { email } = options; - return new Field('forgotPassword') + return new Field<'forgotPassword', GQLCustomerActionConfirmationType>('forgotPassword') .addArgument('email', 'String!', email) .addField('status'); } diff --git a/packages/scandipwa/src/query/NewsletterSubscription.query.ts b/packages/scandipwa/src/query/NewsletterSubscription.query.ts index 812179cee3..450b143f12 100644 --- a/packages/scandipwa/src/query/NewsletterSubscription.query.ts +++ b/packages/scandipwa/src/query/NewsletterSubscription.query.ts @@ -9,15 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Mutation } from '@tilework/opus'; + +import { GQLSubscribeEmailToNewsletterOutput } from 'Type/Graphql.type'; /** * NewsletterSubscription Mutations * @class NewsletterSubscriptionQuery * @namespace Query/NewsletterSubscription/Query */ export class NewsletterSubscriptionQuery { - getSubscribeToNewsletterMutation(email: string): Field { - return new Field('subscribeEmailToNewsletter') + getSubscribeToNewsletterMutation( + email: string + ): Mutation<'subscribeEmailToNewsletter', GQLSubscribeEmailToNewsletterOutput> { + return new Mutation<'subscribeEmailToNewsletter', GQLSubscribeEmailToNewsletterOutput>( + 'subscribeEmailToNewsletter' + ) .addArgument('email', 'String!', email) .addFieldList(this._getPageFields()); } diff --git a/packages/scandipwa/src/query/Order.query.ts b/packages/scandipwa/src/query/Order.query.ts index af11d70322..67c5cca2f7 100644 --- a/packages/scandipwa/src/query/Order.query.ts +++ b/packages/scandipwa/src/query/Order.query.ts @@ -9,33 +9,39 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; -import { OrdersOptions } from './Query.type'; +import { + GQLBundleOption, + GQLCheckoutUserInputError, + GQLCustomerDownloadableProduct, GQLCustomerDownloadableProducts, GQLEnteredOptionInput, GQLInvoice, GQLInvoiceItemInterface, GQLMoney, GQLOrderAddress, GQLOrderItemOption, GQLOrderPaymentMethod, GQLPaymentMethodAdditionalData +} from 'Type/Graphql.type'; + +import { CommonField, OrdersOptions } from './Query.type'; /** * Order Query * @class OrderQuery * @namespace Query/Order/Query */ export class OrderQuery { - getReorder(incrementId: string): Field { + getReorder(incrementId: string) { return new Field('reorderItems') .addArgument('orderNumber', 'String!', incrementId) .addField(this._getReorderField()); } - getOrderListQuery(options: OrdersOptions): Field { + getOrderListQuery(options: OrdersOptions) { return new Field('customer') .addFieldList(this._getOrderListFields(options)); } - _getOrderListFields(options: OrdersOptions): Field[] { + _getOrderListFields(options: OrdersOptions) { return [ this._getOrdersField(options) ]; } - _getOrdersField(options: OrdersOptions): Field { + _getOrdersField(options: OrdersOptions) { const { orderId, page = 1 } = options || {}; const ordersField = new Field('orders'); @@ -50,7 +56,7 @@ export class OrderQuery { .addFieldList(this._getOrdersFields()); } - _getOrdersFields(isSingleOrder = false): Array { + _getOrdersFields(isSingleOrder = false): CommonField[] { return [ 'total_count', this._getOrderItemsField(isSingleOrder), @@ -58,7 +64,7 @@ export class OrderQuery { ]; } - _getSearchResultPageInfoField(): Field { + _getSearchResultPageInfoField() { return new Field('page_info') .addFieldList(this._getSearchResultPageInfoFields()); } @@ -71,12 +77,12 @@ export class OrderQuery { ]; } - _getOrderItemsField(isSingleOrder: boolean): Field { + _getOrderItemsField(isSingleOrder: boolean) { return new Field('items') .addFieldList(this._getOrderItemsFields(isSingleOrder)); } - _getOrderItemsFields(isSingleOrder: boolean): Array { + _getOrderItemsFields(isSingleOrder: boolean): CommonField[] { const basicFields = [ 'id', 'increment_id', @@ -94,7 +100,7 @@ export class OrderQuery { return basicFields; } - _getSingleOrderFields(): Array { + _getSingleOrderFields(): CommonField[] { return [ 'carrier', this._getOrderShipmentsField(), @@ -109,7 +115,7 @@ export class OrderQuery { ]; } - _getOrderCommentsField(): Field { + _getOrderCommentsField() { return new Field('comments') .addFieldList(this._getOrderCommentsFields()); } @@ -121,12 +127,12 @@ export class OrderQuery { ]; } - _getOrderItemTotalField(): Field { + _getOrderItemTotalField() { return new Field('total') .addFieldList(this._getOrderItemTotalFields()); } - _getOrderItemTotalFields(): Field[] { + _getOrderItemTotalFields() { return [ this._getOrderGrandTotalField(), this._getOrderDiscountsField(), @@ -139,12 +145,12 @@ export class OrderQuery { ]; } - _getOrderTaxesField(): Field { + _getOrderTaxesField() { return new Field('taxes') .addFieldList(this._getOrderTaxesFields()); } - _getOrderTaxesFields(): Array { + _getOrderTaxesFields(): CommonField[] { return [ 'rate', 'title', @@ -152,12 +158,12 @@ export class OrderQuery { ]; } - _getOrderShippingHandlingField(): Field { + _getOrderShippingHandlingField() { return new Field('shipping_handling') .addFieldList(this._getOrderShippingHandlingFields()); } - _getOrderShippingHandlingFields(): Field[] { + _getOrderShippingHandlingFields() { return [ this._getOrderShippingAmountExclTaxField(), this._getOrderShippingAmountInclTaxField(), @@ -167,53 +173,53 @@ export class OrderQuery { ]; } - _getOrderShippingDiscountsField(): Field { + _getOrderShippingDiscountsField() { return new Field('discounts') .addFieldList(this._getOrderShippingDiscountsFields()); } - _getOrderShippingDiscountsFields(): Field[] { + _getOrderShippingDiscountsFields() { return [ this._getOrderAmountField() ]; } - _getOrderShippingAmountExclTaxField(): Field { + _getOrderShippingAmountExclTaxField() { return new Field('amount_excluding_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingAmountInclTaxField(): Field { + _getOrderShippingAmountInclTaxField() { return new Field('amount_including_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingHandlingTotalField(): Field { + _getOrderShippingHandlingTotalField() { return new Field('total_amount') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalTaxField(): Field { + _getOrderTotalTaxField() { return new Field('total_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalShippingField(): Field { + _getOrderTotalShippingField() { return new Field('total_shipping') .addFieldList(this._getOrderPriceFields()); } - _getOrderBaseGrantTotalField(): Field { + _getOrderBaseGrantTotalField() { return new Field('base_grand_total') .addFieldList(this._getOrderPriceFields()); } - _getOrderSubtotalField(): Field { + _getOrderSubtotalField() { return new Field('subtotal') .addFieldList(this._getOrderPriceFields()); } - _getOrderGrandTotalField(): Field { + _getOrderGrandTotalField() { return new Field('grand_total') .addFieldList(this._getOrderPriceFields()); } @@ -225,12 +231,12 @@ export class OrderQuery { ]; } - _getOrderShipmentsField(): Field { + _getOrderShipmentsField() { return new Field('shipments') .addFieldList(this._getOrderShipmentsFields()); } - _getOrderShipmentsFields(): Array { + _getOrderShipmentsFields(): CommonField[] { return [ 'id', 'number', @@ -240,19 +246,19 @@ export class OrderQuery { ]; } - _getShipmentsItemsProductsField(): Field { + _getShipmentsItemsProductsField() { return new Field('items') .addFieldList(this._getShipmentsItemsProductsFields()); } - _getShipmentsItemsProductsFields(): Array { + _getShipmentsItemsProductsFields(): CommonField[] { return [ 'quantity_shipped', ...this._getBaseOrderItemProductsFields() ]; } - _getOrderShipmentTrackingField(): Field { + _getOrderShipmentTrackingField() { return new Field('tracking') .addFieldList(this._getOrderShipmentTrackingFields()); } @@ -265,12 +271,12 @@ export class OrderQuery { ]; } - _getOrderRefundsField(): Field { + _getOrderRefundsField() { return new Field('credit_memos') .addFieldList(this._getOrderRefundsFields()); } - _getOrderRefundsFields(): Array { + _getOrderRefundsFields(): CommonField[] { return [ 'id', 'number', @@ -280,29 +286,29 @@ export class OrderQuery { ]; } - _getOrderDiscountsField(): Field { + _getOrderDiscountsField() { return new Field('discounts') .addFieldList(this._getOrderDiscountsFields()); } - _getOrderDiscountsFields(): Array { + _getOrderDiscountsFields(): CommonField[] { return [ 'label', this._getOrderAmountField() ]; } - _getOrderAmountField(): Field { + _getOrderAmountField() { return new Field('amount') .addFieldList(this._getOrderPriceFields()); } - _getRefundsItemsProductsField(): Field { + _getRefundsItemsProductsField() { return new Field('items') .addFieldList(this._getRefundsItemsProductsFields()); } - _getRefundsItemsProductsFields(): Array { + _getRefundsItemsProductsFields(): CommonField[] { return [ 'quantity_refunded', ...this._getBaseOrderItemProductsFields(), @@ -312,17 +318,17 @@ export class OrderQuery { ]; } - _getRefundsItemInformationField(): Field { + _getRefundsItemInformationField() { return new Field('order_item') .addFieldList(this._getOrderItemProductsFields()); } - _getOrderInvoicesField(): Field { - return new Field('invoices') + _getOrderInvoicesField(): Field<'invoices', GQLInvoice, true> { + return new Field<'invoices', GQLInvoice, true>('invoices', true) .addFieldList(this._getOrderInvoicesFields()); } - _getOrderInvoicesFields(): Array { + _getOrderInvoicesFields(): CommonField[] { return [ 'id', 'number', @@ -332,12 +338,12 @@ export class OrderQuery { ]; } - _getInvoiceItemsProductsField(): Field { - return new Field('items') + _getInvoiceItemsProductsField(): Field<'items', GQLInvoiceItemInterface, true> { + return new Field<'items', GQLInvoiceItemInterface, true>('items', true) .addFieldList(this._getInvoiceItemProductsFields()); } - _getInvoiceItemProductsFields(): Array { + _getInvoiceItemProductsFields(): CommonField[] { return [ 'quantity_invoiced', this._getOrderProductRowSubtotalField(), @@ -345,12 +351,12 @@ export class OrderQuery { ]; } - _getOrderItemsProductsField(): Field { + _getOrderItemsProductsField() { return new Field('items') .addFieldList(this._getOrderItemProductsFields()); } - _getOrderItemProductsFields(): Array { + _getOrderItemProductsFields(): CommonField[] { return [ 'product_url_key', 'quantity_ordered', @@ -364,7 +370,7 @@ export class OrderQuery { ]; } - _getBaseOrderItemProductsFields(): Array { + _getBaseOrderItemProductsFields(): CommonField[] { return [ 'product_name', 'product_sku', @@ -372,27 +378,27 @@ export class OrderQuery { ]; } - _getOrderProductRowSubtotalField(): Field { - return new Field('row_subtotal') + _getOrderProductRowSubtotalField(): Field<'row_subtotal', GQLMoney> { + return new Field<'row_subtotal', GQLMoney>('row_subtotal') .addFieldList(this._getOrderPriceFields()); } - _getOrderProductRowSubtotalInclTaxField(): Field { - return new Field('row_subtotal_incl_tax') + _getOrderProductRowSubtotalInclTaxField(): Field<'row_subtotal_incl_tax', GQLMoney> { + return new Field<'row_subtotal_incl_tax', GQLMoney>('row_subtotal_incl_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderProductEnteredOptionsField(): Field { - return new Field('entered_options') + _getOrderProductEnteredOptionsField(): Field<'entered_options', GQLEnteredOptionInput, true> { + return new Field<'entered_options', GQLEnteredOptionInput, true>('entered_options', true) .addFieldList(this._getOrderProductOptionsFields()); } - _getOrderProductSelectedOptionsField(): Field { - return new Field('selected_options') + _getOrderProductSelectedOptionsField(): Field<'selected_options', GQLOrderItemOption, true> { + return new Field<'selected_options', GQLOrderItemOption, true>('selected_options', true) .addFieldList(this._getOrderProductOptionsFields()); } - _getOrderProductOptionsFields(): Array { + _getOrderProductOptionsFields(): CommonField[] { return [ 'label', 'value', @@ -401,8 +407,8 @@ export class OrderQuery { ]; } - _getOrderProductBundleOptionItemsField(): Field { - return new Field('items') + _getOrderProductBundleOptionItemsField(): Field<'items', GQLBundleOption, true> { + return new Field<'items', GQLBundleOption, true>('items', true) .addFieldList(this._getOrderProductBundleOptionItemsFields()); } @@ -414,13 +420,13 @@ export class OrderQuery { ]; } - _getOrderProductSalePriceField(): Field { - return new Field('product_sale_price') + _getOrderProductSalePriceField(): Field<'product_sale_price', GQLMoney> { + return new Field<'product_sale_price', GQLMoney>('product_sale_price') .addFieldList(this._getOrderPriceFields()); } - _getReorderField(): Field { - return new Field('userInputErrors') + _getReorderField(): Field<'userInputErrors', GQLCheckoutUserInputError, true> { + return new Field<'userInputErrors', GQLCheckoutUserInputError, true>('userInputErrors', true) .addFieldList(this._getReorderFields()); } @@ -432,17 +438,17 @@ export class OrderQuery { ]; } - _getOrderShippingAddressField(): Field { - return new Field('shipping_address') + _getOrderShippingAddressField(): Field<'shipping_address', GQLOrderAddress> { + return new Field<'shipping_address', GQLOrderAddress>('shipping_address') .addFieldList(this._getOrderAddressFields()); } - _getOrderBillingAddressField(): Field { - return new Field('billing_address') + _getOrderBillingAddressField(): Field<'billing_address', GQLOrderAddress> { + return new Field<'billing_address', GQLOrderAddress>('billing_address') .addFieldList(this._getOrderAddressFields()); } - _getOrderAddressFields(): Array { + _getOrderAddressFields(): CommonField[] { return [ 'city', 'country_id', @@ -457,16 +463,16 @@ export class OrderQuery { ]; } - _getOrderAddressStreetField(): Field { - return new Field('street'); + _getOrderAddressStreetField(): Field<'street', string, true> { + return new Field<'street', string, true>('street', true); } - _getOrderPaymentMethodsField(): Field { - return new Field('payment_methods') + _getOrderPaymentMethodsField(): Field<'payment_methods', GQLOrderPaymentMethod, true> { + return new Field<'payment_methods', GQLOrderPaymentMethod, true>('payment_methods', true) .addFieldList(this._getOrderPaymentMethodsFields()); } - _getOrderPaymentMethodsFields(): Array { + _getOrderPaymentMethodsFields(): CommonField[] { return [ 'name', 'type', @@ -475,8 +481,8 @@ export class OrderQuery { ]; } - _getOrderPaymentMethodAdditionalField(): Field { - return new Field('additional_data') + _getOrderPaymentMethodAdditionalField(): Field<'additional_data', GQLPaymentMethodAdditionalData> { + return new Field<'additional_data', GQLPaymentMethodAdditionalData>('additional_data') .addFieldList(this._getOrderPaymentMethodAdditionalFields()); } @@ -487,32 +493,36 @@ export class OrderQuery { ]; } - _getOrderShippingMethodField(): Field { - return new Field('shipping_method'); + _getOrderShippingMethodField(): Field<'shipping_method', string> { + return new Field<'shipping_method', string>('shipping_method'); } - getDownloadableQuery(): Field { - return new Field('customerDownloadableProducts') + getDownloadableQuery(): Query<'customerDownloadableProducts', GQLCustomerDownloadableProducts & { + items: GQLCustomerDownloadableProduct[]; + }> { + return new Query<'customerDownloadableProducts', GQLCustomerDownloadableProducts>( + 'customerDownloadableProducts' + ) .addField(this._getDownloadableField()); } - getOrderByIdQuery(orderId: number): Field { + getOrderByIdQuery(orderId: number) { return this._getOrderByIdField(orderId); } - linkOrderMutation(customerEmail: string): Field { - return new Field('linkOrder') + linkOrderMutation(customerEmail: string): Field<'linkOrder', boolean> { + return new Field<'linkOrder', boolean>('linkOrder') .addArgument('customer_email', 'String!', customerEmail); } - _getOrderByIdField(orderId: number): Field { + _getOrderByIdField(orderId: number) { return new Field('Customer') .addArgument('id', 'Int!', orderId) .addFieldList(this._getOrderItemsFields(false)); } - _getDownloadableField(): Field { - return new Field('items') + _getDownloadableField(): Field<'items', GQLCustomerDownloadableProduct, true> { + return new Field<'items', GQLCustomerDownloadableProduct, true>('items', true) .addFieldList(this._getDownloadableFields()); } diff --git a/packages/scandipwa/src/query/ProductAlerts.query.ts b/packages/scandipwa/src/query/ProductAlerts.query.ts index 134a464f37..0952bd1023 100644 --- a/packages/scandipwa/src/query/ProductAlerts.query.ts +++ b/packages/scandipwa/src/query/ProductAlerts.query.ts @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Mutation } from '@tilework/opus'; /** @namespace Query/ProductAlerts/Query */ export class ProductAlertsQuery { - getProductAlertSubscribeMutation(productId: string, type: string): Field { - return new Field('productAlertSubscribe') + getProductAlertSubscribeMutation(productId: string, type: string): Mutation<'productAlertSubscribe', boolean> { + return new Mutation<'productAlertSubscribe', boolean>('productAlertSubscribe') .addArgument('productId', 'ID!', productId) .addArgument('type', 'String!', type); } diff --git a/packages/scandipwa/src/query/ProductCompare.query.ts b/packages/scandipwa/src/query/ProductCompare.query.ts index f4942769de..ff05650fa2 100644 --- a/packages/scandipwa/src/query/ProductCompare.query.ts +++ b/packages/scandipwa/src/query/ProductCompare.query.ts @@ -9,72 +9,90 @@ * @link https://github.com/scandipwa/base-theme */ +import { Field, Mutation } from '@tilework/opus'; + import { ProductListQuery } from 'Query/ProductList.query'; -import { Field } from 'Util/Query'; +import { + GQLAssignCompareListToCustomerOutput, + GQLComparableAttribute, + GQLComparableItem, + GQLCompareList, + GQLDeleteCompareListOutput, + GQLGroupedProduct, + GQLProductAttribute, + GQLProductInterface +} from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** @namespace Query/ProductCompare/Query */ export class ProductCompareQuery extends ProductListQuery { - getCreateEmptyCompareList(): Field { - return new Field('createCompareList') + getCreateEmptyCompareList(): Mutation<'createCompareList', GQLCompareList> { + return new Mutation<'createCompareList', GQLCompareList>('createCompareList') .addArgument('input', 'CreateCompareListInput', {}) .addFieldList(this._getCompareListFields()); } - getCreateCompareList(products: string[]): Field { - return new Field('createCompareList') + getCreateCompareList(products: string[]): Mutation<'createCompareList', GQLCompareList> { + return new Mutation<'createCompareList', GQLCompareList>('createCompareList') .addArgument('input', 'CreateCompareListInput', { products }) .addFieldList(this._getCompareListFields()); } - getDeleteCompareList(uid: string): Field { - return new Field('deleteCompareList') + getDeleteCompareList(uid: string): Mutation<'deleteCompareList', GQLDeleteCompareListOutput> { + return new Mutation<'deleteCompareList', GQLDeleteCompareListOutput>('deleteCompareList') .addArgument('uid', 'ID!', uid) .addField('result'); } - getAddProductsToCompareList(uid: string, products: string[]): Field { - return new Field('addProductsToCompareList') + getAddProductsToCompareList(uid: string, products: string[]): Mutation<'addProductsToCompareList', GQLCompareList> { + return new Mutation<'addProductsToCompareList', GQLCompareList>('addProductsToCompareList') .addArgument('input', 'AddProductsToCompareListInput', { uid, products }) .addFieldList(this._getCompareListFields()); } - getRemoveProductsFromCompareList(uid: string, products: string[]): Field { - return new Field('removeProductsFromCompareList') + getRemoveProductsFromCompareList( + uid: string, + products: string[] + ): Mutation<'removeProductsFromCompareList', GQLCompareList> { + return new Mutation<'removeProductsFromCompareList', GQLCompareList>('removeProductsFromCompareList') .addArgument('input', 'RemoveProductsFromCompareListInput', { uid, products }) .addFieldList(this._getCompareListFields()); } - getAssignCompareList(uid: string): Field { - return new Field('assignCompareListToCustomer') + getAssignCompareList(uid: string): Mutation<'assignCompareListToCustomer', GQLAssignCompareListToCustomerOutput> { + return new Mutation<'assignCompareListToCustomer', GQLAssignCompareListToCustomerOutput>( + 'assignCompareListToCustomer' + ) .addArgument('uid', 'ID!', uid) .addFieldList(this._getAssignFields()); } - _getAssignFields(): Array { + _getAssignFields(): CommonField[] { return [ 'result', this._getAssignCompareListField() ]; } - _getAssignCompareListField(): Field { - return new Field('compare_list') + _getAssignCompareListField(): Field<'compare_list', GQLCompareList> { + return new Field<'compare_list', GQLCompareList>('compare_list') .addFieldList(this._getCompareListFields()); } - getCompareList(uid: string): Field { - return new Field('compareList') + getCompareList(uid: string): Field<'compareList', GQLCompareList> { + return new Field<'compareList', GQLCompareList>('compareList') .addArgument('uid', 'ID!', uid) .addFieldList(this._getCompareListFields()); } - getCompareListIds(uid: string): Field { - return new Field('compareList') + getCompareListIds(uid: string): Field<'compareList', GQLCompareList & { items: GQLComparableItem[] }> { + return new Field<'compareList', GQLCompareList>('compareList') .addArgument('uid', 'ID!', uid) .addField(this._getComparableItemIdsField()); } - _getCompareListFields(): Array { + _getCompareListFields(): CommonField[] { return [ 'uid', 'item_count', @@ -85,8 +103,8 @@ export class ProductCompareQuery extends ProductListQuery { ]; } - _getCompareAttributeField(): Field { - return new Field('attributes') + _getCompareAttributeField(): Field<'attributes', GQLComparableAttribute, true> { + return new Field<'attributes', GQLComparableAttribute, true>('attributes', true) .addFieldList(this._getCompareAttributeFields()); } @@ -97,8 +115,8 @@ export class ProductCompareQuery extends ProductListQuery { ]; } - _getComparableItemAttributeField(): Field { - return new Field('attributes') + _getComparableItemAttributeField(): Field<'attributes', GQLProductAttribute, true> { + return new Field<'attributes', GQLProductAttribute, true>('attributes', true) .addFieldList(this._getComparableItemAttributeFields()); } @@ -109,21 +127,31 @@ export class ProductCompareQuery extends ProductListQuery { ]; } - _getComparableItemFields(): Field[] { + _getComparableItemFields(): CommonField[] { return [ this._getCompareProductField(), this._getComparableItemAttributeField() ]; } - _getComparableItemIdsFields(): Field[] { + _getComparableItemIdsFields(): Field<'product', GQLProductInterface, false>[] { return [ this._getProductIdsField() ]; } - _getCompareProductField(): Field { - return new Field('product') + _getCompareProductField(): Field< + 'product', + GQLProductInterface & { + url: string; + } & { + review_count: number; + } & { + rating_summary: unknown; + } & { + description: { [x: string]: string }; + } & Partial> { + return new Field<'product', GQLProductInterface>('product') .addFieldList(this._getProductInterfaceFields(true, false)) .addFieldList(['url']) .addField(this._getReviewCountField()) @@ -132,18 +160,18 @@ export class ProductCompareQuery extends ProductListQuery { .addField(this._getGroupedProductItems()); } - _getProductIdsField(): Field { - return new Field('product') + _getProductIdsField(): Field<'product', GQLProductInterface> { + return new Field<'product', GQLProductInterface>('product') .addFieldList(this._getProductIdsFields()); } - _getComparableItemField(): Field { - return new Field('items') + _getComparableItemField(): Field<'items', GQLComparableItem, true> { + return new Field<'items', GQLComparableItem, true>('items') .addFieldList(this._getComparableItemFields()); } - _getComparableItemIdsField(): Field { - return new Field('items') + _getComparableItemIdsField(): Field<'items', GQLComparableItem, true> { + return new Field<'items', GQLComparableItem, true>('items') .addFieldList(this._getComparableItemIdsFields()); } diff --git a/packages/scandipwa/src/query/ProductList.query.ts b/packages/scandipwa/src/query/ProductList.query.ts index bef74ce696..ec3d914848 100644 --- a/packages/scandipwa/src/query/ProductList.query.ts +++ b/packages/scandipwa/src/query/ProductList.query.ts @@ -9,13 +9,35 @@ * @link https://github.com/scandipwa/base-theme */ +import { Field, InlineFragment, Query } from '@tilework/opus'; + import { SORT_DIRECTION_TYPE } from 'Route/CategoryPage/CategoryPage.config'; import { NONE_SORT_OPTION_VALUE } from 'Route/SearchPage/SearchPage.config'; import { CUSTOMER } from 'Store/MyAccount/MyAccount.dispatcher'; +import { + GQLConfigurableProduct, + GQLConfigurableVariant, + GQLCustomizableAreaOption, + GQLCustomizableCheckboxOption, + GQLCustomizableDateOption, + GQLCustomizableDropDownOption, + GQLCustomizableFieldOption, + GQLCustomizableFileOption, + GQLCustomizableMultipleOption, + GQLCustomizableProductInterface, + GQLCustomizableRadioOption, + GQLDownloadableProduct, + GQLDownloadableProductLinks, + GQLDownloadableProductSamples, + GQLGroupedProduct, + GQLGroupedProductItem, + GQLProductInterface, + GQLProducts, + GQLSearchResultPageInfo +} from 'Type/Graphql.type'; import BrowserDatabase from 'Util/BrowserDatabase'; -import { Field, Fragment } from 'Util/Query'; -import { ProductListOptions } from './Query.type'; +import { CommonField, CommonFragment, ProductListOptions } from './Query.type'; /** * Product List Query @@ -24,7 +46,7 @@ import { ProductListOptions } from './Query.type'; export class ProductListQuery { options = {} as ProductListOptions; - getQuery(options: ProductListOptions): Field { + getQuery(options: ProductListOptions): Query<'products', GQLProducts> { if (!options) { throw new Error('Missing argument `options`'); } @@ -34,8 +56,8 @@ export class ProductListQuery { return this._getProductsField(); } - _getProductsField(): Field { - const products = new Field('products') + _getProductsField(): Query<'products', GQLProducts> { + const products = new Query<'products', GQLProducts>('products') .addFieldList(this._getProductFields()); this._getProductArguments().forEach((arg) => products.addArgument(...arg)); @@ -213,7 +235,7 @@ export class ProductListQuery { }, [] as Array<[string, string, unknown]>); } - _getProductFields(): Array { + _getProductFields(): CommonField[] { const { requireInfo, isSingleProduct, notRequireInfo } = this.options; // do not request total count for PDP @@ -238,7 +260,7 @@ export class ProductListQuery { ]; } - _getCartProductInterfaceFields(): Array { + _getCartProductInterfaceFields(): Array { return [ 'uid', 'id', @@ -256,28 +278,27 @@ export class ProductListQuery { ]; } - _getCartConfigurableProductFragment(): Fragment { - return new Fragment('ConfigurableProduct') + _getCartConfigurableProductFragment(): InlineFragment<'ConfigurableProduct', GQLConfigurableProduct> { + return new InlineFragment<'ConfigurableProduct', GQLConfigurableProduct>('ConfigurableProduct') .addFieldList([ this._getConfigurableOptionsField(), this._getCartVariantsField() ]); } - _getCartVariantsField(): Field { - return new Field('variants') - .setAlias('variants') + _getCartVariantsField(): Field<'variants', GQLConfigurableVariant, true> { + return new Field<'variants', GQLConfigurableVariant, true>('variants', true) .addFieldList(this._getCartVariantFields()); } - _getCartVariantFields(): Field[] { + _getCartVariantFields(): CommonField[] { return [ this._getCartProductField() ]; } - _getCartProductField(): Field { - return new Field('product') + _getCartProductField(): Field<'product', GQLProductInterface> { + return new Field<'product', GQLProductInterface>('product') .addFieldList([ 'id', 'sku', @@ -293,7 +314,7 @@ export class ProductListQuery { isVariant: boolean, isForLinkedProducts = false, isForWishlist = false - ): Array { + ): Array { const { isPlp = false, isSingleProduct, @@ -397,7 +418,7 @@ export class ProductListQuery { * @returns {*[]} * @private */ - _getGroupedProductItemFields(): Array { + _getGroupedProductItemFields(): CommonField[] { return [ this._getProductField(), 'position', @@ -410,9 +431,9 @@ export class ProductListQuery { * @returns {Field} * @protected */ - _getGroupedProductItems(): Field { - return new Fragment('GroupedProduct').addField( - new Field('items') + _getGroupedProductItems(): InlineFragment<'GroupedProduct', GQLGroupedProduct> { + return new InlineFragment<'GroupedProduct', GQLGroupedProduct>('GroupedProduct').addField( + new Field<'items', GQLGroupedProductItem, true>('items', true) .addFieldList(this._getGroupedProductItemFields()) ); } @@ -422,12 +443,12 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getDownloadableProductFields(): Fragment { - return new Fragment('DownloadableProduct') + _getDownloadableProductFields(): InlineFragment<'DownloadableProduct', GQLDownloadableProduct> { + return new InlineFragment('DownloadableProduct') .addFieldList(this._getDownloadableProductLinks()); } - _getDownloadableProductLinks(): Array { + _getDownloadableProductLinks(): CommonField[] { return [ 'links_title', 'samples_title', @@ -437,8 +458,8 @@ export class ProductListQuery { ]; } - _getDownloadableProductLinksRequired(): Field { - return new Fragment('DownloadableProduct') + _getDownloadableProductLinksRequired(): InlineFragment<'DownloadableProduct', GQLDownloadableProduct> { + return new InlineFragment<'DownloadableProduct', GQLDownloadableProduct>('DownloadableProduct') .addFieldList(this._getDownloadableProductLinksRequiredFields()); } @@ -448,8 +469,11 @@ export class ProductListQuery { ]; } - _getDownloadableProductLinkField(): Field { - return new Field('downloadable_product_links') + _getDownloadableProductLinkField(): Field<'downloadable_product_links', GQLDownloadableProductLinks, true> { + return new Field<'downloadable_product_links', GQLDownloadableProductLinks, true>( + 'downloadable_product_links', + true + ) .addFieldList(this._getDownloadableProductLinkFields()); } @@ -464,8 +488,11 @@ export class ProductListQuery { ]; } - _getDownloadableProductSampleField(): Field { - return new Field('downloadable_product_samples') + _getDownloadableProductSampleField(): Field<'downloadable_product_samples', GQLDownloadableProductSamples, true> { + return new Field<'downloadable_product_samples', GQLDownloadableProductSamples, true>( + 'downloadable_product_samples', + true + ) .addFieldList(this._getDownloadableProductSampleFields()); } @@ -477,7 +504,7 @@ export class ProductListQuery { ]; } - _getItemsField(): Field { + _getItemsField() { const { isSingleProduct } = this.options; const items = new Field('items') @@ -493,7 +520,7 @@ export class ProductListQuery { return items; } - _getProductField(): Field { + _getProductField() { const { isForLinkedProducts, isForWishlist = false } = this.options; return new Field('product') @@ -506,12 +533,12 @@ export class ProductListQuery { ]; } - _getShortDescriptionField(): Field { + _getShortDescriptionField() { return new Field('short_description') .addFieldList(this._getShortDescriptionFields()); } - _getStockItemField(): Field { + _getStockItemField() { return new Field('stock_item') .addFieldList(this._getStockItemFields()); } @@ -535,12 +562,12 @@ export class ProductListQuery { ]; } - _getBreadcrumbsField(): Field { + _getBreadcrumbsField() { return new Field('breadcrumbs') .addFieldList(this._getBreadcrumbFields()); } - _getCategoryFields(): Array { + _getCategoryFields(): CommonField[] { return [ 'id', 'name', @@ -549,12 +576,12 @@ export class ProductListQuery { ]; } - _getCategoriesField(): Field { + _getCategoriesField() { return new Field('categories') .addFieldList(this._getCategoryFields()); } - _getMinimalPriceFields(): Field[] { + _getMinimalPriceFields(): CommonField[] { return [ this._getDiscountField(), this._getFinalPriceField(), @@ -567,17 +594,17 @@ export class ProductListQuery { ]; } - _getMinimalPriceField(): Field { + _getMinimalPriceField() { return new Field('minimum_price') .addFieldList(this._getMinimalPriceFields()); } - _getMaximalPriceField(): Field { + _getMaximalPriceField() { return new Field('maximum_price') .addFieldList(this._getMinimalPriceFields()); } - _getPriceRangeFields(): Field[] { + _getPriceRangeFields(): CommonField[] { // Using an array as potentially would want to add maximum price return [ this._getMinimalPriceField(), @@ -585,7 +612,7 @@ export class ProductListQuery { ]; } - _getPriceRangeField(): Field { + _getPriceRangeField() { return new Field('price_range') .addFieldList(this._getPriceRangeFields()); } @@ -611,23 +638,23 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getProductThumbnailField(): Field { + _getProductThumbnailField() { return new Field('thumbnail') .addFieldList(this._getProductThumbnailFields()); } - _getProductSmallField(): Field { + _getProductSmallField() { return new Field('small_image') .addFieldList(this._getProductSmallFields()); } - _getProductImageField(): Field { + _getProductImageField() { return new Field('image') .addFieldList(this._getProductThumbnailFields()); } - _getAttributeOptionField(noSwatches: boolean): Array { - const fields: Array = [ + _getAttributeOptionField(noSwatches: boolean): CommonField[] { + const fields: CommonField[] = [ 'label', 'value' ]; @@ -639,7 +666,7 @@ export class ProductListQuery { return fields; } - _getAttributeOptionsField(noSwatches: boolean): Field { + _getAttributeOptionsField(noSwatches: boolean) { return new Field('attribute_options') .addFieldList(this._getAttributeOptionField(noSwatches)); } @@ -656,7 +683,7 @@ export class ProductListQuery { ]; } - _getAttributeOptionsFields(isVariant: boolean): Field[] { + _getAttributeOptionsFields(isVariant: boolean): CommonField[] { if (isVariant) { return []; } @@ -666,7 +693,7 @@ export class ProductListQuery { ]; } - _getAttributeFields(isVariant = false, isCart = false): Array { + _getAttributeFields(isVariant = false, isCart = false): CommonField[] { return [ 'attribute_id', 'attribute_value', @@ -677,13 +704,13 @@ export class ProductListQuery { ]; } - _getAttributesField(isVariant: boolean, isCart: boolean): Field { + _getAttributesField(isVariant: boolean, isCart: boolean) { return new Field('s_attributes') .setAlias('attributes') .addFieldList(this._getAttributeFields(isVariant, isCart)); } - _getMediaGalleryFields(): Array { + _getMediaGalleryFields(): CommonField[] { return [ 'id', 'file', @@ -704,7 +731,7 @@ export class ProductListQuery { * @returns {Field} the video_content field * @private */ - _getVideoContentField(): Field { + _getVideoContentField() { return new Field('video_content').addFieldList([ 'media_type', 'video_description', @@ -721,24 +748,24 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getMediaThumbnailField(): Field { + _getMediaThumbnailField() { return new Field('thumbnail').addField('url'); } - _getMediaBaseField(): Field { + _getMediaBaseField() { return new Field('base').addField('url'); } - _getMediaLargeField(): Field { + _getMediaLargeField() { return new Field('large').addField('url'); } - _getMediaGalleryField(): Field { + _getMediaGalleryField() { return new Field('media_gallery_entries') .addFieldList(this._getMediaGalleryFields()); } - _getProductLinksField(): Field { + _getProductLinksField() { return new Field('product_links') .addFieldList(this._getProductLinkFields()); } @@ -749,12 +776,12 @@ export class ProductListQuery { ]; } - _getDescriptionField(): Field { + _getDescriptionField() { return new Field('description') .addFieldList(this._getDescriptionFields()); } - _getUrlRewritesFields(): Field { + _getUrlRewritesFields() { return new Field('url_rewrites') .addFieldList(['url']); } @@ -767,20 +794,20 @@ export class ProductListQuery { ]; } - _getRatingsBreakdownFields(): Array { + _getRatingsBreakdownFields(): CommonField[] { return [ new Field('name').setAlias('rating_code'), 'value' ]; } - _getRatingsBreakdownField(): Field { + _getRatingsBreakdownField() { return new Field('ratings_breakdown') .setAlias('rating_votes') .addFieldList(this._getRatingsBreakdownFields()); } - _getReviewItemsFields(): Array { + _getReviewItemsFields(): CommonField[] { return [ 'average_rating', 'nickname', @@ -791,18 +818,18 @@ export class ProductListQuery { ]; } - _getReviewItemsField(): Field { + _getReviewItemsField() { return new Field('items') .addFieldList(this._getReviewItemsFields()); } - _getReviewsFields(): Field[] { + _getReviewsFields(): CommonField[] { return [ this._getReviewItemsField() ]; } - _getReviewsField(): Field { + _getReviewsField() { return new Field('reviews') // Hard-coded pages, it will be very hard to // paginate using current implementation @@ -812,15 +839,15 @@ export class ProductListQuery { .addFieldList(this._getReviewsFields()); } - _getReviewCountField(): Field { - return new Field('review_count'); + _getReviewCountField(): Field<'review_count', number> { + return new Field<'review_count', number>('review_count'); } - _getRatingSummaryField(): Field { + _getRatingSummaryField() { return new Field('rating_summary'); } - _getBundleOptionsFields(): Array { + _getBundleOptionsFields(): CommonField[] { return [ 'uid', 'label', @@ -834,12 +861,12 @@ export class ProductListQuery { ]; } - _getProductBundleOptionField(): Field { + _getProductBundleOptionField() { return new Field('product') .addFieldList(this._getProductBundleOptionFields()); } - _getProductBundleOptionFields(): Array { + _getProductBundleOptionFields(): CommonField[] { return [ 'name', 'stock_status', @@ -847,12 +874,12 @@ export class ProductListQuery { ]; } - _getBundleOptionsField(): Field { + _getBundleOptionsField() { return new Field('options') .addFieldList(this._getBundleOptionsFields()); } - _getBundleItemsFields(): Array { + _getBundleItemsFields(): CommonField[] { return [ 'uid', 'option_id', @@ -865,7 +892,7 @@ export class ProductListQuery { ]; } - _getBundleItemsField(): Field { + _getBundleItemsField() { return new Field('items') .addFieldList(this._getBundleItemsFields()); } @@ -880,7 +907,7 @@ export class ProductListQuery { ]; } - _getBundlePriceOptionFields(): Array { + _getBundlePriceOptionFields(): CommonField[] { return [ 'option_id', new Field('selection_details') @@ -888,12 +915,12 @@ export class ProductListQuery { ]; } - _getBundlePriceOptionsField(): Field { + _getBundlePriceOptionsField() { return new Field('bundle_options') .addFieldList(this._getBundlePriceOptionFields()); } - _getBundleProductFragmentFields(): Array { + _getBundleProductFragmentFields(): CommonField[] { return [ 'dynamic_price', 'dynamic_sku', @@ -910,30 +937,30 @@ export class ProductListQuery { ]; } - _getValuesField(): Field { + _getValuesField() { return new Field('values') .addFieldList(this._getValueFields()); } - _getConfigurableOptionFields(): Array { + _getConfigurableOptionFields(): CommonField[] { return [ 'attribute_code', this._getValuesField() ]; } - _getConfigurableOptionsField(): Field { + _getConfigurableOptionsField() { return new Field('configurable_options') .addFieldList(this._getConfigurableOptionFields()); } - _getVariantFields(): Field[] { + _getVariantFields(): CommonField[] { return [ this._getProductField() ]; } - _getVariantsField(): Field { + _getVariantsField() { const { isPlp = false, isForWishlist = false } = this.options; // For PLP page we have optimized variants graphql field @@ -944,7 +971,7 @@ export class ProductListQuery { .addFieldList(this._getVariantFields()); } - _getConfigurableProductFragmentFields(): Field[] { + _getConfigurableProductFragmentFields(): CommonField[] { return [ this._getConfigurableOptionsField(), this._getVariantsField() @@ -963,20 +990,20 @@ export class ProductListQuery { ]; } - _getCustomizableTextValueField(alias: string): Field { + _getCustomizableTextValueField(alias: string) { return new Field('value') .addFieldList(this._getCustomizableTextValueFields()) .setAlias(alias); } - _getCustomizableTextFields(alias: string): Array { + _getCustomizableTextFields(alias: string): CommonField[] { return [ this._getCustomizableTextValueField(alias), 'product_sku' ]; } - _getCustomizableFileValueField(alias: string): Field { + _getCustomizableFileValueField(alias: string) { return new Field('value') .addFieldList([ 'price', @@ -990,18 +1017,18 @@ export class ProductListQuery { .setAlias(alias); } - _getCustomizableAreaOption(): Field { - return new Fragment('CustomizableAreaOption') + _getCustomizableAreaOption(): InlineFragment<'CustomizableAreaOption', GQLCustomizableAreaOption> { + return new InlineFragment<'CustomizableAreaOption', GQLCustomizableAreaOption>('CustomizableAreaOption') .addFieldList(this._getCustomizableTextFields('areaValues')); } - _getCustomizableFieldOption(): Field { - return new Fragment('CustomizableFieldOption') + _getCustomizableFieldOption(): InlineFragment<'CustomizableFieldOption', GQLCustomizableFieldOption> { + return new InlineFragment<'CustomizableFieldOption', GQLCustomizableFieldOption>('CustomizableFieldOption') .addFieldList(this._getCustomizableTextFields('fieldValues')); } - _getCustomizableFileOption(): Field { - return new Fragment('CustomizableFileOption') + _getCustomizableFileOption(): InlineFragment<'CustomizableFileOption', GQLCustomizableFileOption> { + return new InlineFragment<'CustomizableFileOption', GQLCustomizableFileOption>('CustomizableFileOption') .addFieldList([this._getCustomizableFileValueField('fileValues')]); } @@ -1016,20 +1043,20 @@ export class ProductListQuery { ]; } - _getCustomizableDateValueField(): Field { + _getCustomizableDateValueField() { return new Field('value') .addFieldList(this._getCustomizableDateValueFields()); } - _getCustomizableDateFields(): Array { + _getCustomizableDateFields(): CommonField[] { return [ this._getCustomizableDateValueField(), 'product_sku' ]; } - _getCustomizableDateOption(): Field { - return new Fragment('CustomizableDateOption') + _getCustomizableDateOption(): InlineFragment<'CustomizableDateOption', GQLCustomizableDateOption> { + return new InlineFragment<'CustomizableDateOption', GQLCustomizableDateOption>('CustomizableDateOption') .addFieldList(this._getCustomizableDateFields()); } @@ -1048,33 +1075,39 @@ export class ProductListQuery { ]; } - _getCustomizableSelectionValueField(alias: string): Field { + _getCustomizableSelectionValueField(alias: string) { return new Field('value') .addFieldList(this._getCustomizableSelectionValueFields()) .setAlias(alias); } - _getCustomizableCheckboxOption(): Field { - return new Fragment('CustomizableCheckboxOption') + _getCustomizableCheckboxOption(): InlineFragment<'CustomizableCheckboxOption', GQLCustomizableCheckboxOption> { + return new InlineFragment<'CustomizableCheckboxOption', GQLCustomizableCheckboxOption>( + 'CustomizableCheckboxOption' + ) .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); } - _getCustomizableMultiOption(): Field { - return new Fragment('CustomizableMultipleOption') + _getCustomizableMultiOption(): InlineFragment<'CustomizableMultipleOption', GQLCustomizableMultipleOption> { + return new InlineFragment<'CustomizableMultipleOption', GQLCustomizableMultipleOption>( + 'CustomizableMultipleOption' + ) .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); // same as checkbox } - _getCustomizableDropdownOption(): Field { - return new Fragment('CustomizableDropDownOption') + _getCustomizableDropdownOption(): InlineFragment<'CustomizableDropDownOption', GQLCustomizableDropDownOption> { + return new InlineFragment<'CustomizableDropDownOption', GQLCustomizableDropDownOption>( + 'CustomizableDropDownOption' + ) .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); } - _getCustomizableRadioOption(): Field { - return new Fragment('CustomizableRadioOption') + _getCustomizableRadioOption(): InlineFragment<'CustomizableRadioOption', GQLCustomizableRadioOption> { + return new InlineFragment<'CustomizableRadioOption', GQLCustomizableRadioOption>('CustomizableRadioOption') .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); // same as dropdown } - _getCustomizableProductFragmentOptionsFields(): Array { + _getCustomizableProductFragmentOptionsFields(): CommonField[] { return [ this._getCustomizableDropdownOption(), this._getCustomizableRadioOption(), @@ -1092,34 +1125,36 @@ export class ProductListQuery { ]; } - _getCustomizableProductFragmentOptionsField(): Field { + _getCustomizableProductFragmentOptionsField() { return new Field('options') .addFieldList(this._getCustomizableProductFragmentOptionsFields()); } - _getCustomizableProductFragment(): Field { - return new Fragment('CustomizableProductInterface') + _getCustomizableProductFragment(): InlineFragment<'CustomizableProductInterface', GQLCustomizableProductInterface> { + return new InlineFragment<'CustomizableProductInterface', GQLCustomizableProductInterface>( + 'CustomizableProductInterface' + ) .addFieldList([this._getCustomizableProductFragmentOptionsField()]); } - _getSimpleProductFragmentFields(): Field[] { + _getSimpleProductFragmentFields(): CommonField[] { return [ this._getTierPricesField() ]; } - _getVirtualProductFragmentFields(): Field[] { + _getVirtualProductFragmentFields(): CommonField[] { return [ this._getTierPricesField() ]; } - _getTierPricesField(): Field { + _getTierPricesField() { return new Field('price_tiers') .addFieldList(this._getTierPricesFields()); } - _getTierPricesFields(): Array { + _getTierPricesFields(): CommonField[] { return [ this._getDiscountField(), this._getFinalPriceField(), @@ -1127,71 +1162,71 @@ export class ProductListQuery { ]; } - _getDiscountField(): Field { + _getDiscountField() { return new Field('discount') .addField('amount_off') .addField('percent_off'); } - _getFinalPriceField(): Field { + _getFinalPriceField() { return new Field('final_price') .addField('currency') .addField('value'); } - _getFinalPriceExclTaxField(): Field { + _getFinalPriceExclTaxField() { return new Field('final_price_excl_tax') .addField('currency') .addField('value'); } - _getRegularPriceField(): Field { + _getRegularPriceField() { return new Field('regular_price') .addField('currency') .addField('value'); } - _getRegularPriceExclTaxField(): Field { + _getRegularPriceExclTaxField() { return new Field('regular_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultFinalPriceExclTaxField(): Field { + _getDefaultFinalPriceExclTaxField() { return new Field('default_final_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultPriceField(): Field { + _getDefaultPriceField() { return new Field('default_price') .addField('currency') .addField('value'); } - _getDefaultFinalPriceField(): Field { + _getDefaultFinalPriceField() { return new Field('default_final_price') .addField('currency') .addField('value'); } - _getBundleProductFragment(): Field { - return new Fragment('BundleProduct') + _getBundleProductFragment() { + return new InlineFragment('BundleProduct') .addFieldList(this._getBundleProductFragmentFields()); } - _getConfigurableProductFragment(): Field { - return new Fragment('ConfigurableProduct') + _getConfigurableProductFragment() { + return new InlineFragment('ConfigurableProduct') .addFieldList(this._getConfigurableProductFragmentFields()); } - _getSimpleProductFragment(): Field { - return new Fragment('SimpleProduct') + _getSimpleProductFragment() { + return new InlineFragment('SimpleProduct') .addFieldList(this._getSimpleProductFragmentFields()); } - _getVirtualProductFragment(): Field { - return new Fragment('VirtualProduct') + _getVirtualProductFragment() { + return new InlineFragment('VirtualProduct') .addFieldList(this._getVirtualProductFragmentFields()); } @@ -1202,18 +1237,18 @@ export class ProductListQuery { ]; } - _getSortOptionsField(): Field { + _getSortOptionsField() { return new Field('options') .addFieldList(this._getSortOptionFields()); } - _getSortFields(): Field[] { + _getSortFields(): CommonField[] { return [ this._getSortOptionsField() ]; } - _getSortField(): Field { + _getSortField() { return new Field('sort_fields') .addFieldList(this._getSortFields()); } @@ -1225,18 +1260,18 @@ export class ProductListQuery { ]; } - _getSwatchDataField(): Field { + _getSwatchDataField() { return new Field('swatch_data') .addFieldList(this._getSwatchDataFields()); } - _getAggregationsField(): Field { + _getAggregationsField() { return new Field('aggregations') .setAlias('filters') .addFieldList(this._getAggregationsFields()); } - _getAggregationsFields(): Array { + _getAggregationsFields(): CommonField[] { return [ new Field('label').setAlias('name'), new Field('attribute_code').setAlias('request_var'), @@ -1247,13 +1282,13 @@ export class ProductListQuery { ]; } - _getAggregationsOptionsField(): Field { + _getAggregationsOptionsField() { return new Field('options') .setAlias('filter_items') .addFieldList(this._getAggregationsOptionsFields()); } - _getAggregationsOptionsFields(): Array { + _getAggregationsOptionsFields(): CommonField[] { return [ 'label', 'count', @@ -1262,8 +1297,8 @@ export class ProductListQuery { ]; } - _getPageInfoField(): Field { - return new Field('page_info') + _getPageInfoField() { + return new Field<'page_info', GQLSearchResultPageInfo>('page_info') .addField('current_page') .addField('total_pages'); } diff --git a/packages/scandipwa/src/query/Query.type.ts b/packages/scandipwa/src/query/Query.type.ts index e1cc93a359..6136a7e4d2 100644 --- a/packages/scandipwa/src/query/Query.type.ts +++ b/packages/scandipwa/src/query/Query.type.ts @@ -9,8 +9,15 @@ * @link https://github.com/scandipwa/scandipwa */ +import { Field, InlineFragment } from '@tilework/opus'; + import { GQLCustomerInput } from 'Type/Graphql.type'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type CommonField = string | Field; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type CommonFragment = InlineFragment; + export type CategoryQueryOptions = { categoryIds: number; }; diff --git a/packages/scandipwa/src/query/Region.query.ts b/packages/scandipwa/src/query/Region.query.ts index a4c43435b5..8acc716180 100644 --- a/packages/scandipwa/src/query/Region.query.ts +++ b/packages/scandipwa/src/query/Region.query.ts @@ -9,24 +9,28 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; + +import { GQLCountry, GQLRegion } from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** * RegionQuery Mutations * @class RegionQuery * @namespace Query/Region/Query */ export class RegionQuery { - getCountriesQuery(): Field { - return new Field('countries') + getCountriesQuery(): Query<'countries', GQLCountry, true> { + return new Query<'countries', GQLCountry, true>('countries', true) .addFieldList(this._getCountryFields()); } - _getCountryFields(): Array { + _getCountryFields(): CommonField[] { return [ 'id', 'is_state_required', this._getAvailableRegionsField(), - new Field('full_name_locale').setAlias('label') + new Field<'full_name_locale', string>('full_name_locale').setAlias('label') ]; } @@ -38,8 +42,8 @@ export class RegionQuery { ]; } - _getAvailableRegionsField(): Field { - return new Field('available_regions') + _getAvailableRegionsField(): Field<'available_regions', GQLRegion, true> { + return new Field<'available_regions', GQLRegion, true>('available_regions', true) .addFieldList(this._getAvailableRegionFields()); } } diff --git a/packages/scandipwa/src/query/Review.query.ts b/packages/scandipwa/src/query/Review.query.ts index 1df2bd8189..eefd3b7cdf 100644 --- a/packages/scandipwa/src/query/Review.query.ts +++ b/packages/scandipwa/src/query/Review.query.ts @@ -9,36 +9,49 @@ * @link https://github.com/scandipwa/base-theme */ -import { GQLCreateProductReviewInput } from 'Type/Graphql.type'; -import { Field } from 'Util/Query'; +import { Field, Mutation, Query } from '@tilework/opus'; + +import { + GQLCreateProductReviewInput, + GQLCreateProductReviewOutput, + GQLProductReviewRatingMetadata, + GQLProductReviewRatingsMetadata, + GQLProductReviewRatingValueMetadata +} from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** @namespace Query/Review/Query */ export class ReviewQuery { - getAddProductReviewMutation(reviewItem: GQLCreateProductReviewInput): Field { - return new Field('createProductReview') + getAddProductReviewMutation( + reviewItem: GQLCreateProductReviewInput + ): Mutation<'addProductReview', GQLCreateProductReviewOutput> { + return new Mutation<'createProductReview', GQLCreateProductReviewOutput>('createProductReview') .setAlias('addProductReview') .addArgument('input', 'CreateProductReviewInput!', reviewItem) .addField(new Field('review').addField('nickname')); } - getRatingQuery(): Field { - return new Field('productReviewRatingsMetadata') + getRatingQuery(): Query<'reviewRatings', GQLProductReviewRatingsMetadata> { + return new Query<'productReviewRatingsMetadata', GQLProductReviewRatingsMetadata>( + 'productReviewRatingsMetadata' + ) .setAlias('reviewRatings') .addFieldList(this._getRatingFields()); } - _getRatingFields(): Field[] { + _getRatingFields(): CommonField[] { return [ this._getRatingItemsField() ]; } - _getRatingItemsField(): Field { - return new Field('items') + _getRatingItemsField(): Field<'items', GQLProductReviewRatingMetadata, true> { + return new Field<'items', GQLProductReviewRatingMetadata, true>('items', true) .addFieldList(this._getRatingItemsFields()); } - _getRatingItemsFields(): Field[] { + _getRatingItemsFields(): CommonField[] { return [ new Field('id').setAlias('rating_id'), new Field('name').setAlias('rating_code'), @@ -46,15 +59,15 @@ export class ReviewQuery { ]; } - _getRatingOptionFields(): Array { + _getRatingOptionFields(): CommonField[] { return [ new Field('value_id').setAlias('option_id'), 'value' ]; } - _getRatingOptionsField(): Field { - return new Field('values') + _getRatingOptionsField(): Field<'rating_options', GQLProductReviewRatingValueMetadata, true> { + return new Field<'values', GQLProductReviewRatingValueMetadata, true>('values', true) .setAlias('rating_options') .addFieldList(this._getRatingOptionFields()); } diff --git a/packages/scandipwa/src/query/Slider.query.ts b/packages/scandipwa/src/query/Slider.query.ts index d64ca169e4..e8e5fae09b 100644 --- a/packages/scandipwa/src/query/Slider.query.ts +++ b/packages/scandipwa/src/query/Slider.query.ts @@ -9,23 +9,27 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; + +import { GQLSlide, GQLSlider } from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** * Slider Query * @class Slider * @namespace Query/Slider/Query */ export class SliderQuery { - getQuery(options: { sliderId: string }): Field { + getQuery(options: { sliderId: string }): Query<'slider', GQLSlider> { const { sliderId } = options; - return new Field('scandiwebSlider') + return new Query<'scandiwebSlider', GQLSlider>('scandiwebSlider') .addArgument('id', 'ID!', sliderId) .addFieldList(this._getSliderFields()) .setAlias('slider'); } - _getSliderFields(): Array { + _getSliderFields(): CommonField[] { return [ this._getSlidesField(), this._getSlideSpeedField(), @@ -45,13 +49,13 @@ export class SliderQuery { ]; } - _getSlidesField(): Field { - return new Field('slides') + _getSlidesField(): Field<'slides', GQLSlide, true> { + return new Field('slides', true) .addFieldList(this._getSlideFields()); } - _getSlideSpeedField(): Field { - return new Field('slide_speed').setAlias('slideSpeed'); + _getSlideSpeedField(): Field<'slideSpeed', number> { + return new Field<'slide_speed', number>('slide_speed').setAlias('slideSpeed'); } } diff --git a/packages/scandipwa/src/query/StoreInPickUp.query.ts b/packages/scandipwa/src/query/StoreInPickUp.query.ts index bc8e93afe1..80f15c3bc9 100755 --- a/packages/scandipwa/src/query/StoreInPickUp.query.ts +++ b/packages/scandipwa/src/query/StoreInPickUp.query.ts @@ -9,21 +9,24 @@ * @link https://github.com/scandipwa/base-theme */ -import { GQLProductInfoInput } from 'Type/Graphql.type'; -import { Field } from 'Util/Query'; +import { Field, Query } from '@tilework/opus'; + +import { GQLProductInfoInput, GQLStores } from 'Type/Graphql.type'; + +import { CommonField } from './Query.type'; /** @namespace Query/StoreInPickUp/Query */ export class StoreInPickUpQuery { - getStores(country: string, search = '', productsInfo?: GQLProductInfoInput): Field { - return new Field('getStores') + getStores(country: string, search = '', productsInfo?: GQLProductInfoInput): Query<'getStores', GQLStores> { + return new Query<'getStores', GQLStores>('getStores') .addFieldList([this.getStoreFields()]) .addArgument('search', 'String', search) .addArgument('country', 'String', country) .addArgument('productsInfo', '[ProductInfoInput]', productsInfo); } - getStoreFields(): Field { - return new Field('stores') + getStoreFields(): CommonField { + return new Field('stores', true) .addFieldList([ 'city', 'country', diff --git a/packages/scandipwa/src/query/UrlRewrites.query.ts b/packages/scandipwa/src/query/UrlRewrites.query.ts index abe9767464..9c751163f1 100644 --- a/packages/scandipwa/src/query/UrlRewrites.query.ts +++ b/packages/scandipwa/src/query/UrlRewrites.query.ts @@ -8,22 +8,22 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Field, Query } from '@tilework/opus'; +import { Query } from '@tilework/opus'; -import { UrlRewrite } from 'Type/Router.type'; +import { GQLEntityUrl } from 'Type/Graphql.type'; /** * UrlRewrites Query * @class UrlRewritesQuery * @namespace Query/UrlRewrites/Query */ export class UrlRewritesQuery { - getQuery({ urlParam }: { urlParam: string }): UrlRewrite { + getQuery({ urlParam }: { urlParam: string }): Query<'urlResolver', GQLEntityUrl> { return new Query('urlResolver') .addArgument('url', 'String!', urlParam) .addFieldList(this._getUrlResolverFields()); } - _getUrlResolverFields(): Array> { + _getUrlResolverFields(): string[] { return [ 'sku', 'type' diff --git a/packages/scandipwa/src/query/Wishlist.query.ts b/packages/scandipwa/src/query/Wishlist.query.ts index 340c3af5af..1c554079e1 100644 --- a/packages/scandipwa/src/query/Wishlist.query.ts +++ b/packages/scandipwa/src/query/Wishlist.query.ts @@ -10,24 +10,47 @@ * @link https://github.com/scandipwa/base-theme */ +import { Field, Mutation, Query } from '@tilework/opus'; + import ProductListQuery from 'Query/ProductList.query'; -import { GQLShareWishlistInput, GQLWishlistItemInput, GQLWishlistItemUpdateInput } from 'Type/Graphql.type'; +import { + GQLAddProductsToWishlistOutput, + GQLShareWishlistInput, + GQLUpdateProductsInWishlistOutput, + GQLWishlistItemInput, + GQLWishlistItemUpdateInput, + GQLWishlistOutput, + GQLWishListUserInputError +} from 'Type/Graphql.type'; import { isSignedIn } from 'Util/Auth'; import { getGuestQuoteId } from 'Util/Cart'; -import { Field } from 'Util/Query'; + +import { CommonField } from './Query.type'; /** @namespace Query/Wishlist/Query */ export class WishlistQuery { //#region MUTATION - addProductsToWishlist(wishlistId: string, wishlistItems: GQLWishlistItemInput[]): Field { - return new Field('addProductsToWishlist') + addProductsToWishlist( + wishlistId: string, + wishlistItems: GQLWishlistItemInput[] + ): Mutation< + 'addProductsToWishlist', + GQLAddProductsToWishlistOutput & { user_errors: GQLWishListUserInputError[] } + > { + return new Mutation<'addProductsToWishlist', GQLAddProductsToWishlistOutput>('addProductsToWishlist') .addArgument('wishlistId', 'ID!', wishlistId) .addArgument('wishlistItems', '[WishlistItemInput!]!', wishlistItems) .addField(this._getWishlistErrorsField()); } - updateProductsInWishlist(wishlistId: string, wishlistItems: GQLWishlistItemUpdateInput): Field { - return new Field('updateProductsInWishlist') + updateProductsInWishlist( + wishlistId: string, + wishlistItems: GQLWishlistItemUpdateInput + ): Mutation< + 'updateProductsInWishlist', + GQLUpdateProductsInWishlistOutput & { user_errors: GQLWishListUserInputError[] } + > { + return new Mutation<'updateProductsInWishlist', GQLUpdateProductsInWishlistOutput>('updateProductsInWishlist') .addArgument('wishlistId', 'ID!', wishlistId) .addArgument('wishlistItems', '[WishlistItemUpdateInput!]!', wishlistItems) .addField(this._getWishlistErrorsField()); @@ -42,14 +65,14 @@ export class WishlistQuery { ]; } - _getWishlistErrorsField(): Field { - return new Field('user_errors') + _getWishlistErrorsField(): Field<'user_errors', GQLWishListUserInputError, true> { + return new Field<'user_errors', GQLWishListUserInputError, true>('user_errors', true) .addFieldList(this._getWishlistErrorsFields()); } //#endregion - getWishlistQuery(sharingCode: string): Field { - const field = new Field('s_wishlist') + getWishlistQuery(sharingCode: string): Query<'wishlist', GQLWishlistOutput> { + const field = new Query<'s_wishlist', GQLWishlistOutput>('s_wishlist') .setAlias('wishlist') .addFieldList(this._getWishlistFields()); @@ -60,19 +83,19 @@ export class WishlistQuery { return field; } - getShareWishlistMutation(input: GQLShareWishlistInput): Field { - return new Field('s_shareWishlist') + getShareWishlistMutation(input: GQLShareWishlistInput): Mutation<'shareWishlist', boolean> { + return new Mutation<'s_shareWishlist', boolean>('s_shareWishlist') .setAlias('shareWishlist') .addArgument('input', 'ShareWishlistInput!', input); } - getClearWishlist(): Field { - return new Field('s_clearWishlist') + getClearWishlist(): Query<'clearWishlist', boolean> { + return new Query<'s_clearWishlist', boolean>('s_clearWishlist') .setAlias('clearWishlist'); } - getMoveWishlistToCart(sharingCode: string): Field { - const field = new Field('s_moveWishlistToCart') + getMoveWishlistToCart(sharingCode: string): Query<'moveWishlistToCart', boolean> { + const field = new Query<'s_moveWishlistToCart', boolean>('s_moveWishlistToCart') .setAlias('moveWishlistToCart'); if (sharingCode) { @@ -87,13 +110,13 @@ export class WishlistQuery { return field; } - getRemoveProductFromWishlistMutation(item_id: string): Field { - return new Field('s_removeProductFromWishlist') + getRemoveProductFromWishlistMutation(item_id: string): Mutation<'removeProductFromWishlist', boolean> { + return new Mutation<'s_removeProductFromWishlist', boolean>('s_removeProductFromWishlist') .setAlias('removeProductFromWishlist') .addArgument('itemId', 'ID!', item_id); } - _getWishlistFields(): Array { + _getWishlistFields(): CommonField[] { return [ 'id', 'updated_at', @@ -110,12 +133,12 @@ export class WishlistQuery { ]; } - _getItemOptionsField(): Field { + _getItemOptionsField(): CommonField { return new Field('options') .addFieldList(this._getItemOptionsFields()); } - _getWishlistItemsFields(): Array { + _getWishlistItemsFields(): CommonField[] { return [ 'id', 'sku', @@ -128,19 +151,19 @@ export class WishlistQuery { ]; } - _getItemsFields(): Array { + _getItemsFields(): CommonField[] { return [ ...this._getWishlistItemsFields(), this._getProductField() ]; } - _getProductField(): Field { + _getProductField(): CommonField { return new Field('product') .addFieldList(ProductListQuery._getProductInterfaceFields(false, false, true)); } - _getItemsField(): Field { + _getItemsField(): CommonField { return new Field('items') .addFieldList(this._getItemsFields()); } diff --git a/tilework-packages/opus/src/builder/AbstractField.ts b/tilework-packages/opus/src/builder/AbstractField.ts index e96ce2d2e9..9607ec2db3 100644 --- a/tilework-packages/opus/src/builder/AbstractField.ts +++ b/tilework-packages/opus/src/builder/AbstractField.ts @@ -80,9 +80,9 @@ export abstract class AbstractField< return this as any; } - addArgument(name: ArgName, type: string, value: any): HigherKindType< + addArgument(name: string, type: string, value: any): HigherKindType< this['tag'], - ArgName, + Name, FieldReturnType, ArrayExpected > { @@ -187,7 +187,7 @@ export abstract class AbstractField< addFieldList< NewField extends string >( - fieldList: readonly (NewField | Field)[] + fieldList: readonly (NewField | Field)[] ): HigherKindType< this['tag'], Name, From 7731e3f3001fdf178b2d54ed0696232e3ea2c638 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Mon, 4 Apr 2022 20:42:36 +0300 Subject: [PATCH 014/192] Fix eslint for ts migration --- packages/scandipwa/src/type/Account.type.ts | 114 +++++++++--------- .../scandipwa/src/type/Breadcrumbs.type.ts | 6 +- packages/scandipwa/src/type/CMS.type.ts | 8 +- packages/scandipwa/src/type/Category.type.ts | 48 ++++---- packages/scandipwa/src/type/Checkout.type.ts | 52 ++++---- packages/scandipwa/src/type/Common.type.ts | 8 +- packages/scandipwa/src/type/Config.type.ts | 10 +- packages/scandipwa/src/type/Device.type.ts | 2 +- .../scandipwa/src/type/Downloadable.type.ts | 2 +- packages/scandipwa/src/type/Error.type.ts | 2 +- packages/scandipwa/src/type/Field.type.ts | 26 ++-- packages/scandipwa/src/type/Global.type.ts | 34 +++--- packages/scandipwa/src/type/Menu.type.ts | 8 +- packages/scandipwa/src/type/MiniCart.type.ts | 14 +-- packages/scandipwa/src/type/Order.type.ts | 89 +++++++------- packages/scandipwa/src/type/Price.type.ts | 12 +- .../scandipwa/src/type/ProductList.type.ts | 106 ++++++++-------- packages/scandipwa/src/type/Rating.type.ts | 8 +- packages/scandipwa/src/type/Router.type.ts | 10 +- packages/scandipwa/src/type/Slider.type.ts | 4 +- packages/scandipwa/src/util/Address/index.ts | 29 +++-- .../scandipwa/src/util/Browser/Browser.ts | 1 + packages/scandipwa/src/util/CSS/CSS.ts | 2 +- packages/scandipwa/src/util/Cache/Cache.ts | 1 + .../scandipwa/src/util/Category/Filters.ts | 4 +- .../src/util/DynamicReducer/Helper.ts | 7 +- .../src/util/DynamicReducer/index.tsx | 5 +- packages/scandipwa/src/util/Form/Extract.ts | 27 +++-- packages/scandipwa/src/util/Form/Transform.ts | 6 +- .../src/util/FormPortalCollector/index.ts | 4 +- .../scandipwa/src/util/Manipulations/Date.ts | 4 +- packages/scandipwa/src/util/Media/Media.ts | 2 +- packages/scandipwa/src/util/Menu/Menu.ts | 19 +-- .../scandipwa/src/util/Mobile/isMobile.ts | 18 +-- packages/scandipwa/src/util/Orders/Orders.ts | 13 +- packages/scandipwa/src/util/Price/Price.ts | 7 +- .../scandipwa/src/util/Product/Extract.ts | 47 ++++++-- .../scandipwa/src/util/Product/Transform.ts | 41 ++++--- .../src/util/Query/PrepareDocument.ts | 7 +- .../scandipwa/src/util/Query/Query.type.ts | 4 +- packages/scandipwa/src/util/Request/Hash.ts | 3 +- .../scandipwa/src/util/Request/Request.ts | 18 ++- .../scandipwa/src/util/Store/Transform.ts | 4 +- packages/scandipwa/src/util/Store/index.ts | 4 +- packages/scandipwa/src/util/Url/Url.ts | 25 +++- .../scandipwa/src/util/Validator/Validator.ts | 39 +++--- .../scandipwa/src/util/Wishlist/Wishlist.ts | 4 +- 47 files changed, 497 insertions(+), 411 deletions(-) diff --git a/packages/scandipwa/src/type/Account.type.ts b/packages/scandipwa/src/type/Account.type.ts index 8cf68f8824..c8f2ad8996 100644 --- a/packages/scandipwa/src/type/Account.type.ts +++ b/packages/scandipwa/src/type/Account.type.ts @@ -18,7 +18,7 @@ export enum MyAccountTabs { MY_WISHLIST = 'my-wishlist', ADDRESS_BOOK = 'address', NEWSLETTER_SUBSCRIPTION = 'newsletter-subscription', - ACCOUNT_INFORMATION = 'edit', + ACCOUNT_INFORMATION = 'edit' } export enum MyAccountTabsSection { @@ -34,70 +34,70 @@ export enum MyAccountEditTabs { } export type Region = { - region_code: string | null - region: string | null - region_id: number -} + region_code: string | null; + region: string | null; + region_id: number; +}; export type Address = { - city: string - company: string | null - country_id: string - customer_id?: number - default_billing: boolean - default_shipping: boolean - firstname: string - id?: number - lastname: string - middlename: string - postcode: string - prefix: string - region?: Region - street: string | string[] - suffix: string - telephone: string - vat_id: number | null -} + city: string; + company: string | null; + country_id: string; + customer_id?: number; + default_billing: boolean; + default_shipping: boolean; + firstname: string; + id?: number; + lastname: string; + middlename: string; + postcode: string; + prefix: string; + region?: Region; + street: string | string[]; + suffix: string; + telephone: string; + vat_id: number | null; +}; export type Addresses = Address[]; export type TrimmedAddress = { - city: string - company: string | null - country_id: string | number - firstname: string - lastname: string - postcode: string - region?: string | null - region_string?: string | null - region_id: number | string - region_code: string | null - street: string | string[] - telephone: string - vat_id: number | null -} + city: string; + company: string | null; + country_id: string | number; + firstname: string; + lastname: string; + postcode: string; + region?: string | null; + region_string?: string | null; + region_id: number | string; + region_code: string | null; + street: string | string[]; + telephone: string; + vat_id: number | null; +}; export type Customer = { - addresses: Addresses - created_at: string - default_billing: string - default_shipping: string - dob: Date - email: string - firstname: string - group_id: number - id: number - is_subscribed: boolean - lastname: string - middlename: string - prefix: string - suffix: string - taxvat: string -} + addresses: Addresses; + created_at: string; + default_billing: string; + default_shipping: string; + dob: Date; + email: string; + firstname: string; + group_id: number; + id: number; + is_subscribed: boolean; + lastname: string; + middlename: string; + prefix: string; + suffix: string; + taxvat: string; +}; export type Tab = { - url: string - name: string -} + url: string; + name: string; +}; -export type TabMap = Record +export type TabMap = Record; diff --git a/packages/scandipwa/src/type/Breadcrumbs.type.ts b/packages/scandipwa/src/type/Breadcrumbs.type.ts index fbcaa09fa7..12eaf9cf11 100644 --- a/packages/scandipwa/src/type/Breadcrumbs.type.ts +++ b/packages/scandipwa/src/type/Breadcrumbs.type.ts @@ -10,8 +10,8 @@ */ export type Breadcrumb = { - url: string - name: string -} + url: string; + name: string; +}; export type Breadcrumbs = Breadcrumb[]; diff --git a/packages/scandipwa/src/type/CMS.type.ts b/packages/scandipwa/src/type/CMS.type.ts index 5cd5176aa6..09348e3ab3 100644 --- a/packages/scandipwa/src/type/CMS.type.ts +++ b/packages/scandipwa/src/type/CMS.type.ts @@ -17,13 +17,13 @@ export type Page = { meta_title?: MetaTitle; meta_description?: string; meta_keywords?: string; -} +}; export type Block = { title?: string; content?: string; -} +}; export type BlockList = { - items?: Record -} + items?: Record; +}; diff --git a/packages/scandipwa/src/type/Category.type.ts b/packages/scandipwa/src/type/Category.type.ts index beb6bfdf4c..55d9fee72f 100644 --- a/packages/scandipwa/src/type/Category.type.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -18,22 +18,22 @@ export type Breadcrumbs = { }[]; export type CategoryFragment = { - id: number, - breadcrumbs: Breadcrumbs, - description: string, - image: string, - meta_description: string, - meta_title: MetaTitle, - name: string, - product_count: number, - url_key: string, - url_path: string, - display_mode: string -} + id: number; + breadcrumbs: Breadcrumbs; + description: string; + image: string; + meta_description: string; + meta_title: MetaTitle; + name: string; + product_count: number; + url_key: string; + url_path: string; + display_mode: string; +}; export type CategoryTree = CategoryFragment & { children?: CategoryFragment[]; -} +}; export type SelectedFilters = Record; @@ -48,32 +48,32 @@ export type FilterInput = { max?: number; }; conditions?: string; -} +}; export type SortFields = { options?: { label?: string; value?: string; }[]; -} +}; export type FilterItems = { count?: number; label?: string; swatch_data?: { type?: string; - value?: string - } - value: string -} + value?: string; + }; + value: string; +}; export type CategoryFilter = { has_swatch?: boolean; is_boolean?: boolean; name?: string; - position?: number - request_var?: string - filter_items?: FilterItems[] -} + position?: number; + request_var?: string; + filter_items?: FilterItems[]; +}; -export type CategoryFilters = CategoryFilter[] \ No newline at end of file +export type CategoryFilters = CategoryFilter[]; diff --git a/packages/scandipwa/src/type/Checkout.type.ts b/packages/scandipwa/src/type/Checkout.type.ts index c52091d365..8d3a115a7f 100644 --- a/packages/scandipwa/src/type/Checkout.type.ts +++ b/packages/scandipwa/src/type/Checkout.type.ts @@ -10,35 +10,35 @@ */ export type PaymentMethod = { - code: string - title: string -} + code: string; + title: string; +}; -export type PaymentMethods = PaymentMethod[] +export type PaymentMethods = PaymentMethod[]; export type ShippingMethod = { - amount: number - available: boolean - base_amount: number - carrier_code: string - carrier_title: string - error_message: string - method_code: string - method_title: string - price_excl_tax: number - price_incl_tax: number -} + amount: number; + available: boolean; + base_amount: number; + carrier_code: string; + carrier_title: string; + error_message: string; + method_code: string; + method_title: string; + price_excl_tax: number; + price_incl_tax: number; +}; -export type ShippingMethods = ShippingMethod[] +export type ShippingMethods = ShippingMethod[]; export type CheckoutStore = { - city: string - country: string - description: string - name: string - phone: string - pickup_location_code: string - postcode: string - region: string - street: string -} + city: string; + country: string; + description: string; + name: string; + phone: string; + pickup_location_code: string; + postcode: string; + region: string; + street: string; +}; diff --git a/packages/scandipwa/src/type/Common.type.ts b/packages/scandipwa/src/type/Common.type.ts index 555c74bc8f..059043f435 100644 --- a/packages/scandipwa/src/type/Common.type.ts +++ b/packages/scandipwa/src/type/Common.type.ts @@ -15,11 +15,11 @@ export type Mix = { block?: string; elem?: string; mods?: Mods; -} +}; -export type Children = React.ReactNode[] | React.ReactNode +export type Children = React.ReactNode[] | React.ReactNode; -export type Ref = () => void | { current: Element } +export type Ref = () => void | { current: Element }; // TODO unknown -export type MetaTitle = string | unknown +export type MetaTitle = string | unknown; diff --git a/packages/scandipwa/src/type/Config.type.ts b/packages/scandipwa/src/type/Config.type.ts index b4dc03d777..4c2c691ec9 100644 --- a/packages/scandipwa/src/type/Config.type.ts +++ b/packages/scandipwa/src/type/Config.type.ts @@ -13,9 +13,9 @@ export type Region = { code?: string; name?: string; id?: number; -} +}; -export type Regions = Region[] +export type Regions = Region[]; export type Country = { label: string; @@ -30,7 +30,7 @@ export type CartConfig = { include_tax_in_order_total: boolean; display_full_tax_summary: boolean; display_zero_tax_subtotal: boolean; -} +}; export type StoreItem = { id?: string; @@ -38,6 +38,6 @@ export type StoreItem = { storeUrl?: string; storeLinkUrl?: string; label?: string; -} +}; -export type Stores = StoreItem[]; \ No newline at end of file +export type Stores = StoreItem[]; diff --git a/packages/scandipwa/src/type/Device.type.ts b/packages/scandipwa/src/type/Device.type.ts index 79791e8048..5f9e7d3fd1 100644 --- a/packages/scandipwa/src/type/Device.type.ts +++ b/packages/scandipwa/src/type/Device.type.ts @@ -18,4 +18,4 @@ export type Device = { safari?: boolean; windows?: boolean; standaloneMode?: boolean; -} +}; diff --git a/packages/scandipwa/src/type/Downloadable.type.ts b/packages/scandipwa/src/type/Downloadable.type.ts index 21d6cd9f4c..9f8f1faf87 100644 --- a/packages/scandipwa/src/type/Downloadable.type.ts +++ b/packages/scandipwa/src/type/Downloadable.type.ts @@ -16,6 +16,6 @@ export type DownloadableLink = { id?: number; uid?: string; price?: number; -} +}; export type DownloadableLinks = DownloadableLink | string; diff --git a/packages/scandipwa/src/type/Error.type.ts b/packages/scandipwa/src/type/Error.type.ts index ee29f14797..572344bffc 100644 --- a/packages/scandipwa/src/type/Error.type.ts +++ b/packages/scandipwa/src/type/Error.type.ts @@ -15,4 +15,4 @@ export type ErrorDetails = { info?: { componentStack?: string; }; -} +}; diff --git a/packages/scandipwa/src/type/Field.type.ts b/packages/scandipwa/src/type/Field.type.ts index 03fadda761..75c9ad9e37 100644 --- a/packages/scandipwa/src/type/Field.type.ts +++ b/packages/scandipwa/src/type/Field.type.ts @@ -11,13 +11,13 @@ import { ValidationInputTypeText } from 'Util/Validator/Config'; -export type Label = string | React.ReactNode +export type Label = string | React.ReactNode; export type Option = { id?: string | number; label?: Label; value?: string | number; -} +}; export type CustomErrorMessages = { onRequirementFail?: string; @@ -26,24 +26,24 @@ export type CustomErrorMessages = { onRangeFailMin?: string; onRangeFailMax?: string; onExtensionFail?: string; -} +}; export type ValidationRule = { isRequired?: boolean; inputType?: ValidationInputTypeText; - match?: () => void // TODO: Check argument types + match?: () => void; // TODO: Check argument types customErrorMessages?: CustomErrorMessages; -} +}; // TODO -export type Events = () => void +export type Events = () => void; // TODO export type FieldAttr = any; export type FieldOptions = { id?: string | number; - label?: Label + label?: Label; value?: string | number; }[]; @@ -51,24 +51,24 @@ export type ValuesShape = { value?: string | boolean; type?: string | boolean; name?: string | boolean; -} +}; export type ErrorMessageShape = { injectables?: string[]; value?: string; -} +}; export type ErrorFieldShape = { errorMessages?: ErrorMessageShape[]; value?: string | boolean; type?: string | boolean; name?: string | boolean; -} +}; export type FieldGroupValidationResponse = { errorFields: ErrorFieldShape; - errorMessages: ErrorMessageShape - values: ValuesShape -} | boolean + errorMessages: ErrorMessageShape; + values: ValuesShape; +} | boolean; export type Date = number | string; diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index 7bc1cd5d6a..0eb0c97ddf 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -22,16 +22,16 @@ import { declare global { interface Window { // eslint-disable-next-line @typescript-eslint/naming-convention - '__REACT_DEVTOOLS_GLOBAL_HOOK__'?: Record + '__REACT_DEVTOOLS_GLOBAL_HOOK__'?: Record; // eslint-disable-next-line @typescript-eslint/naming-convention - '__REDUX_DEVTOOLS_EXTENSION__'?: (options: unknown) => StoreEnhancer - storeRegexText: string + '__REDUX_DEVTOOLS_EXTENSION__'?: (options: unknown) => StoreEnhancer; + storeRegexText: string; actionName?: { - type?: string - } - secure_base_media_url?: string - prefetchedImages: Record - storeList: Array + type?: string; + }; + secure_base_media_url?: string; + prefetchedImages: Record; + storeList: Array; // dataCache?: Record> } @@ -40,15 +40,15 @@ declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace React { interface Component { - __construct?(props: unknown): void + __construct?(props: unknown): void; } // eslint-disable-next-line @typescript-eslint/no-unused-vars interface ClassAttributes { - block?: string - elem?: string - mods?: Record - mix?: Record + block?: string; + elem?: string; + mods?: Record; + mix?: Record; } } @@ -83,15 +83,15 @@ declare global { } interface HTMLInputElement { - fileData?: string + fileData?: string; } export type InjectReducer = (key: string, asyncReducer: Reducer>) => void; export type ModifiedReduxStore = (Store> & { - asyncReducers?: ReducersMapObject - injectReducer?: InjectReducer - }) + asyncReducers?: ReducersMapObject; + injectReducer?: InjectReducer; + }); // interface HTMLElementEventMap { // validate: ValidationData diff --git a/packages/scandipwa/src/type/Menu.type.ts b/packages/scandipwa/src/type/Menu.type.ts index 3becabd4a1..e71bf3f630 100644 --- a/packages/scandipwa/src/type/Menu.type.ts +++ b/packages/scandipwa/src/type/Menu.type.ts @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import { Location } from 'Type/Router.type'; - export type MenuItem = { item_id: string; is_active?: boolean; @@ -22,8 +20,8 @@ export type MenuItem = { url: string; cms_page_identifier?: string; category_id?: number; - url_type: number -} + url_type: number; +}; export type MenuItems = MenuItem[]; @@ -32,4 +30,4 @@ export type Menu = { is_active?: boolean; css_class?: string; items?: MenuItems; -} +}; diff --git a/packages/scandipwa/src/type/MiniCart.type.ts b/packages/scandipwa/src/type/MiniCart.type.ts index 9c3eb353a8..602ffa674c 100644 --- a/packages/scandipwa/src/type/MiniCart.type.ts +++ b/packages/scandipwa/src/type/MiniCart.type.ts @@ -19,20 +19,20 @@ export type Page = { meta_title?: MetaTitle; meta_description?: string; meta_keywords?: string; -} +}; export type QuantitySelector = { - increase?: () => void // TODO - decrease?: () => void // TODO + increase?: () => void; // TODO + decrease?: () => void; // TODO quantity?: number; -} +}; export type Totals = { count?: number; subTotalPrice?: string; taxPrice?: string; grandTotalPrice?: string; -} +}; export type CartItem = { discount_amount?: number; @@ -45,7 +45,7 @@ export type CartItem = { sku?: string; tax_amount?: number; tax_percent?: number; -} +}; export type CartDisplay = { display_tax_in_price?: string; @@ -54,4 +54,4 @@ export type CartDisplay = { include_tax_in_order_total?: boolean; display_full_tax_summary?: boolean; display_zero_tax_subtotal?: boolean; -} +}; diff --git a/packages/scandipwa/src/type/Order.type.ts b/packages/scandipwa/src/type/Order.type.ts index 9528bbc6c6..272b39b1a8 100644 --- a/packages/scandipwa/src/type/Order.type.ts +++ b/packages/scandipwa/src/type/Order.type.ts @@ -9,36 +9,36 @@ * @link https://github.com/scandipwa/scandipwa */ -export type OrderGrandTotal= { +export type OrderGrandTotal = { value?: number; currency?: string; -} +}; -export type OrderTotal= { +export type OrderTotal = { grand_total?: OrderGrandTotal; -} +}; -export type OrderInfo= { +export type OrderInfo = { id?: number; increment_id?: string; created_at?: string; status_label?: string; grand_total?: number; subtotal?: string; -} +}; -export type OrderPaymentInfo= { +export type OrderPaymentInfo = { name?: string; type?: string; additional_data?: { - name: string - value: string + name: string; + value: string; }; -} +}; export type OrderPaymentsInfo = OrderPaymentInfo[]; -export type OrderAddress= { +export type OrderAddress = { city?: string; country_code?: string; firstname?: string; @@ -48,45 +48,54 @@ export type OrderAddress= { region_id?: string; street?: string[]; telephone?: string; -} +}; -export type orderItemQty= { +export type orderItemQty = { quantity_ordered?: number; quantity_canceled?: number; quantity_invoiced?: number; quantity_refunded?: number; quantity_returned?: number; quantity_shipped?: number; -} +}; -export type Money= { +export type Money = { currency: string; value: number; -} +}; -export type Discount= { +export type Discount = { amount: Money; value: number; -} +}; -export type OptionItem= { +export type OptionItem = { title?: string; qty?: number; price?: number; -} +}; export type OptionItems = OptionItem[]; -export type Option= { +export type Option = { label?: string; value?: string; items?: OptionItems; linkItems?: string[]; -} +}; export type Options = Option[]; -export type OrderProduct= { +export type OrderProductQuantity = { + quantity_ordered?: number; + quantity_canceled?: number; + quantity_invoiced?: number; + quantity_refunded?: number; + quantity_returned?: number; + quantity_shipped?: number; +}; + +export type OrderProduct = OrderProductQuantity & { discounts?: Discount[]; id?: string; selected_options?: Options; @@ -96,32 +105,20 @@ export type OrderProduct= { product_sku?: string; product_type?: string; product_url_key?: string; - quantity_ordered?: number; - quantity_canceled?: number; - quantity_invoiced?: number; - quantity_refunded?: number; - quantity_returned?: number; - quantity_shipped?: number; -} +}; export type OrderProducts = OrderProduct[]; -export type OrderTab= { +export type OrderTab = OrderProductQuantity & { items?: OrderProducts; id?: string | number; number?: string; total?: OrderTotal; - quantity_ordered?: number; - quantity_canceled?: number; - quantity_invoiced?: number; - quantity_refunded?: number; - quantity_returned?: number; - quantity_shipped?: number; -} +}; export type OrderTabs = OrderTab[]; -export type Order= { +export type Order = { can_reorder?: boolean; carrier?: string; id: string; @@ -138,9 +135,9 @@ export type Order= { shipping_method?: string; status?: string; total?: OrderTotal; -} +}; -export type Downloadable= { +export type Downloadable = { id?: number; order_id?: number; order_increment_id?: string; @@ -149,17 +146,17 @@ export type Downloadable= { download_url?: string; created_at?: string; title?: string; -} +}; -export type PageInfo= { +export type PageInfo = { current_page?: number; page_size?: number; total_pages?: number; -} +}; export type Orders = Order[]; -export type OrdersList= { +export type OrdersList = { items?: Orders; pageInfo?: PageInfo; -} +}; diff --git a/packages/scandipwa/src/type/Price.type.ts b/packages/scandipwa/src/type/Price.type.ts index 9134179268..cb389cd6a3 100644 --- a/packages/scandipwa/src/type/Price.type.ts +++ b/packages/scandipwa/src/type/Price.type.ts @@ -13,12 +13,12 @@ export type PriceItem = { currency: string; value: number; valueFormatted?: string; -} +}; export type Discount = { amount_off: number; percent_off: number; -} +}; export type PriceVariant = { discount: Discount; @@ -29,12 +29,12 @@ export type PriceVariant = { default_final_price: PriceItem; default_final_price_excl_tax: PriceItem; default_price: PriceItem; -} +}; export type PriceRange = { minimum_price: PriceVariant; maximum_price: PriceVariant; -} +}; export type OriginalPrice = { minRegularPrice?: PriceItem; @@ -43,7 +43,7 @@ export type OriginalPrice = { maxRegularPrice?: PriceItem; maxFinalPrice?: PriceItem; maxFinalPriceExclTax?: PriceItem; -} +}; export type ProductPrice = { price?: { @@ -60,7 +60,7 @@ export type ProductPrice = { containsRequiredOptions?: false; containsRequiredOptionsWithPrice?: false; }; -} +}; export type TierPrices = { discount?: Discount; diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 6e371a4c05..9407fa0577 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -20,10 +20,10 @@ export type Attribute = { attribute_type?: string; attribute_value?: string; attribute_label?: string; - attribute_options?: Record + attribute_options?: Record; has_swatch?: boolean; is_boolean?: boolean; -} +}; export type Attributes = Attribute | Attribute[]; @@ -34,8 +34,8 @@ export type AttributeOption = { swatch_data?: { type?: string; value?: string; - } -} + }; +}; export type FilterAttribute = { attribute_code?: string; @@ -43,7 +43,7 @@ export type FilterAttribute = { attribute_position?: number; attribute_values?: string[]; attribute_type?: string; - attribute_options?: Record + attribute_options?: Record; is_boolean?: boolean; has_swatch?: boolean; }; @@ -99,8 +99,8 @@ export type ProductLinks = { export type ReviewSummaryShape = { rating_summary: number; - review_count: number -} + review_count: number; +}; export type RatingVote = { vote_id?: number; @@ -177,7 +177,7 @@ export type CustomizableOptionShape = { price_type: string; currency: string; sku: string; -} +}; export type CustomizableOption = CustomizableOptionShape & { uid: string; @@ -188,43 +188,43 @@ export type CustomizableOption = CustomizableOptionShape & { value?: { priceExclTax: number; priceInclTax: number; - } -} + }; +}; export type InputOption = CustomizableOptionShape & { max_characters?: number; -} +}; export type FileOption = CustomizableOptionShape & { file_extension?: string; -} +}; -export type CustomizableOptions = FileOption | InputOption | CustomizableOption[] +export type CustomizableOptions = FileOption | InputOption | CustomizableOption[]; export type ItemShape = ReviewSummaryShape & { attributes: Attributes; - configurable_options: Attributes, - id: number, - image: Image, - name: string, - options: CustomizableOption[], - price_range: PriceRange, - price_tiers: PriceTier, - review_summary: ReviewSummaryShape, - short_description: DescriptionType, - sku: string, - small_image: Image, - special_from_date: string, - special_to_date: string, - stock_item: StockItem, - stock_status: StockStatus, - thumbnail: Image, - type_id: string, - uid: string, - url: string, - url_rewrites: UrlRewrite[] - salable_qty: number -} + configurable_options: Attributes; + id: number; + image: Image; + name: string; + options: CustomizableOption[]; + price_range: PriceRange; + price_tiers: PriceTier; + review_summary: ReviewSummaryShape; + short_description: DescriptionType; + sku: string; + small_image: Image; + special_from_date: string; + special_to_date: string; + stock_item: StockItem; + stock_status: StockStatus; + thumbnail: Image; + type_id: string; + uid: string; + url: string; + url_rewrites: UrlRewrite[]; + salable_qty: number; +}; export type Item = ItemShape; @@ -240,7 +240,7 @@ export type ItemOptionProduct = { price_range: PriceRange; dynamic_price: boolean; type_id: string; -} +}; export type ItemOption = { can_change_quantity?: boolean; @@ -272,7 +272,7 @@ export type ProductBundleItems = { export type ProductGroupedItems = { position: number; qty: number; - product: ItemShape + product: ItemShape; }[]; export interface Product extends ItemShape{ @@ -288,34 +288,34 @@ export interface Product extends ItemShape{ url_key?: string; quantity?: number; reviews?: Reviews; - variants?: ProductVariant[] + variants?: ProductVariant[]; items?: unknown[]; - downloadable_product_links?: ProductDownloadableLink[] - dynamic_price?: boolean -}; + downloadable_product_links?: ProductDownloadableLink[]; + dynamic_price?: boolean; +} export interface ProductGrouped extends Product { items: ProductGroupedItems; } -export interface ProductBundle extends Product { +export interface ProductBundle extends Product { items: ProductBundleItems; - dynamic_price: boolean + dynamic_price: boolean; } export type ProductDownloadable = Product & { - downloadable_product_links: ProductDownloadableLink[] -} + downloadable_product_links: ProductDownloadableLink[]; +}; export type ProductDownloadableLink = { - price: number; - sample_url?: string; - sort_order?: number; - title?: string; - uid: string; -} + price: number; + sample_url?: string; + sort_order?: number; + title?: string; + uid: string; +}; -export type ProductVariant = ItemShape +export type ProductVariant = ItemShape; export type PriceConfiguration = { containsOptions?: boolean; @@ -350,4 +350,4 @@ export type OptionsList = { uid?: string; }[]; -export type LinkedProducts = Record \ No newline at end of file +export type LinkedProducts = Record; diff --git a/packages/scandipwa/src/type/Rating.type.ts b/packages/scandipwa/src/type/Rating.type.ts index 4c33a1c8ed..ff225329a0 100644 --- a/packages/scandipwa/src/type/Rating.type.ts +++ b/packages/scandipwa/src/type/Rating.type.ts @@ -12,7 +12,7 @@ export type RatingOptionItem = { option_id?: string; value?: string; -} +}; export type RatingItems = { rating_id?: string; @@ -24,7 +24,7 @@ export type Vote = { rating_code?: string; value?: string; percent?: number; -} +}; export type ReviewItem = { average_rating?: number; @@ -33,7 +33,7 @@ export type ReviewItem = { detail?: string; created_at?: string; rating_votes?: Vote[]; -} +}; export type CreateProductReviewInput = { nickname: string; @@ -44,4 +44,4 @@ export type CreateProductReviewInput = { id: string; value_id: string; }[]; -} +}; diff --git a/packages/scandipwa/src/type/Router.type.ts b/packages/scandipwa/src/type/Router.type.ts index 12663a2b58..9090f218a8 100644 --- a/packages/scandipwa/src/type/Router.type.ts +++ b/packages/scandipwa/src/type/Router.type.ts @@ -13,17 +13,17 @@ import { RouteComponentProps } from 'react-router-dom'; // TODO -export type History = RouteComponentProps['history'] & {} +export type History = RouteComponentProps['history']; -export type Location = RouteComponentProps['location'] & {} +export type Location = RouteComponentProps['location']; -export type Match = RouteComponentProps['match'] & {} +export type Match = RouteComponentProps['match']; export type UrlRewrite = { id?: number; type?: string; sku?: string; notFound?: boolean; -} +}; -export type Link = [string | unknown] +export type Link = [string | unknown]; diff --git a/packages/scandipwa/src/type/Slider.type.ts b/packages/scandipwa/src/type/Slider.type.ts index a27e0fe15d..89efe81cbd 100644 --- a/packages/scandipwa/src/type/Slider.type.ts +++ b/packages/scandipwa/src/type/Slider.type.ts @@ -13,9 +13,9 @@ export type Slide = { slide_id?: string; image?: string; slide_text?: string; -} +}; export type Slider = { slider_id?: string; slides?: Slide[]; -} +}; diff --git a/packages/scandipwa/src/util/Address/index.ts b/packages/scandipwa/src/util/Address/index.ts index 84ac660995..c925bec18b 100644 --- a/packages/scandipwa/src/util/Address/index.ts +++ b/packages/scandipwa/src/util/Address/index.ts @@ -11,7 +11,7 @@ import StoreItem from 'Component/StoreItem'; import { Address, TrimmedAddress } from 'Type/Account.type'; -import { Country, Regions, Stores } from 'Type/Config.type'; +import { Country, Region, Stores } from 'Type/Config.type'; /** @namespace Util/Address/Index/trimCheckoutCustomerAddress */ export const trimCheckoutCustomerAddress = (customerAddress: Address): TrimmedAddress => { @@ -91,11 +91,14 @@ export const removeEmptyStreets = (street: T | T[]): T | T[] => ( Array.isArray(street) ? street.filter((line) => line) : street ); -// TODO /** transforming "street[index]" entries into a single "street" object for checkout/billing/myAccoutAddress form fields object */ /** @namespace Util/Address/Index/setAddressesInFormObject */ -export const setAddressesInFormObject = (fields: Record, numberOfLines: number, prefix: string = 'street'): Record => { +export const setAddressesInFormObject = ( + fields: Record, + numberOfLines: number, + prefix = 'street' +): Record => { const addressKeys = new Array(numberOfLines) .fill('') .map((_, index) => `${prefix}${index}`); @@ -130,13 +133,16 @@ export const getFormFields = (fields: Record, addressLinesQty: num }; export type ZippopotamResponseResult = { - city: string, - region: string, - regionAbbr: string -} + city: string; + region: string; + regionAbbr: string; +}; /** @namespace Util/Address/Index/getCityAndRegionFromZipcode */ -export const getCityAndRegionFromZipcode = async (countryId: string, value: string): Promise => { +export const getCityAndRegionFromZipcode = async ( + countryId: string, + value: string +): Promise => { const response = await fetch(`https://api.zippopotam.us/${countryId}/${value}`); const data = await response.json(); @@ -169,7 +175,7 @@ export const getDefaultAddressLabel = (address: Address): string => { }; /** @namespace Util/Address/Index/getAvailableRegions */ -export const getAvailableRegions = (country_id: string, countries: Country[]) => { +export const getAvailableRegions = (country_id: string, countries: Country[]): Region[] => { const country = countries.find(({ id }) => id === country_id) || {}; const { available_regions } = country as Country; @@ -211,7 +217,10 @@ export const getFormattedRegion = (address: Address, countries: Country[]) => { }; /** @namespace Util/Address/Index/getRegionIdFromAvailableRegions */ -export const getRegionIdFromAvailableRegions = (availableRegions: Regions, cityAndRegion: ZippopotamResponseResult): number => { +export const getRegionIdFromAvailableRegions = ( + availableRegions: Region[], + cityAndRegion: ZippopotamResponseResult +): number => { const { region, regionAbbr } = cityAndRegion; const { id: regionId = 1 } = availableRegions.find( ({ name, code }) => name === region || code === regionAbbr diff --git a/packages/scandipwa/src/util/Browser/Browser.ts b/packages/scandipwa/src/util/Browser/Browser.ts index 33a06643a2..740312f535 100644 --- a/packages/scandipwa/src/util/Browser/Browser.ts +++ b/packages/scandipwa/src/util/Browser/Browser.ts @@ -19,6 +19,7 @@ export const isSSR = (): boolean => !globalThis.window || !globalThis.window.doc export const isCrawler = (): boolean => crawlerRegEx.test(navigator.userAgent); /** @namespace Util/Browser/toggleScroll */ +// eslint-disable-next-line max-len export const toggleScroll = (state: boolean): boolean => document.documentElement.classList.toggle('scrollDisabled', !state); /** @namespace Util/Browser/isScrollDisabled */ diff --git a/packages/scandipwa/src/util/CSS/CSS.ts b/packages/scandipwa/src/util/CSS/CSS.ts index 81ac291c88..236a2ba924 100644 --- a/packages/scandipwa/src/util/CSS/CSS.ts +++ b/packages/scandipwa/src/util/CSS/CSS.ts @@ -24,7 +24,7 @@ export class CSS { * @return {void} * @memberof CSS */ - static setVariable(ref: React.RefObject, name: string, value: string): void { + static setVariable(ref: React.RefObject, name: string, value: string): void { if (ref && ref.current) { ref.current.style.setProperty(`--${name}`, value); } diff --git a/packages/scandipwa/src/util/Cache/Cache.ts b/packages/scandipwa/src/util/Cache/Cache.ts index 43c9ea79fa..f1c8e5f450 100644 --- a/packages/scandipwa/src/util/Cache/Cache.ts +++ b/packages/scandipwa/src/util/Cache/Cache.ts @@ -34,6 +34,7 @@ export const cacheImages = (urls: string[] = []) => { }); }; +// TODO /** * Returns result from global cache for fn * @param {function} fn diff --git a/packages/scandipwa/src/util/Category/Filters.ts b/packages/scandipwa/src/util/Category/Filters.ts index fbeb3b7e1f..23d111bebe 100644 --- a/packages/scandipwa/src/util/Category/Filters.ts +++ b/packages/scandipwa/src/util/Category/Filters.ts @@ -28,4 +28,6 @@ export const getPriceFilterLabel = (from: number | string, to: number | string, }; /** @namespace Util/Category/Filters/getFiltersCount */ -export const getFiltersCount = (filters: Array): number => Object.values(filters).reduce((prev, next) => prev + next.length, 0); +export const getFiltersCount = ( + filters: Array +): number => Object.values(filters).reduce((prev, next) => prev + next.length, 0); diff --git a/packages/scandipwa/src/util/DynamicReducer/Helper.ts b/packages/scandipwa/src/util/DynamicReducer/Helper.ts index c9ce073001..19ab7646a1 100644 --- a/packages/scandipwa/src/util/DynamicReducer/Helper.ts +++ b/packages/scandipwa/src/util/DynamicReducer/Helper.ts @@ -9,13 +9,16 @@ * @link https://github.com/scandipwa/base-theme */ -import { ReducersMapObject } from "redux"; +import { ReducersMapObject } from 'redux'; /** * @param store * @param reducers */ - export default function injectToReducers >(store: T, reducers: ReducersMapObject) { +export default function injectToReducers >( + store: T, + reducers: ReducersMapObject +): void { Object.keys(reducers).forEach((key) => { if (store.asyncReducers && store.injectReducer && !Reflect.has(store.asyncReducers, key)) { // eslint-disable-next-line no-param-reassign diff --git a/packages/scandipwa/src/util/DynamicReducer/index.tsx b/packages/scandipwa/src/util/DynamicReducer/index.tsx index 70d092feae..8bdfdd64fc 100644 --- a/packages/scandipwa/src/util/DynamicReducer/index.tsx +++ b/packages/scandipwa/src/util/DynamicReducer/index.tsx @@ -11,12 +11,13 @@ import { ElementType } from 'react'; import { ReducersMapObject } from 'redux'; + import injectReducers from 'Util/DynamicReducer/Helper'; import { getStore } from 'Util/Store'; /** @namespace Util/DynamicReducer/Index/withReducers */ -export const withReducers = (reducers: ReducersMapObject) => (WrappedComponent: ElementType ) => { - const injectAndExecute = (props: T) => { +export const withReducers = (reducers: ReducersMapObject) => (WrappedComponent: ElementType) => { + const injectAndExecute = (props: Record) => { injectReducers(getStore(), reducers); // eslint-disable-next-line @scandipwa/scandipwa-guidelines/jsx-no-props-destruction diff --git a/packages/scandipwa/src/util/Form/Extract.ts b/packages/scandipwa/src/util/Form/Extract.ts index 2c332f251e..e74ad49d43 100644 --- a/packages/scandipwa/src/util/Form/Extract.ts +++ b/packages/scandipwa/src/util/Form/Extract.ts @@ -21,7 +21,7 @@ import { DATE_FIELDS_COUNT, FIELD_DATE_TYPE, TIME_FORMAT } from 'Component/Field * @namespace Util/Form/Extract/zeroBasedValue */ // eslint-disable-next-line no-magic-numbers -export const zeroBasedValue = (value: T, lessThan: number = 10): string | T => ( +export const zeroBasedValue = (value: T, lessThan = 10): string | T => ( (+value < lessThan) ? `0${value}` : value ); @@ -61,15 +61,17 @@ export const getDateValue = (dateValue: number | string | Date): number | string } }; +// TODO move + export type YearRangeAttribute = { minYear: number; maxYear: number; -} +}; export type DatRangeAttribute = { minDate: Date; maxDate: Date; -} +}; /** @namespace Util/Form/Extract/calcYearRangeAttributes */ export const calcYearRangeAttributes = (startYear: number, endYear: number): YearRangeAttribute => { @@ -91,7 +93,7 @@ export const calcYearRangeAttributes = (startYear: number, endYear: number): Yea }; /** @namespace Util/Form/Extract/getYearRangeAttributes */ -export const getYearRangeAttributes = (yearRange: string = ',', isYear: boolean = false): YearRangeAttribute | DatRangeAttribute => { +export const getYearRangeAttributes = (yearRange = ',', isYear = false): YearRangeAttribute | DatRangeAttribute => { const [startYear, endYear] = yearRange.split(','); const { minYear, maxYear } = calcYearRangeAttributes(Number(startYear), Number(endYear)); @@ -114,11 +116,12 @@ export const isMagentoDateFormatValid = (dateFieldsOrder: string): boolean => ne /** @namespace Util/Form/Extract/getTimeFormat */ export const getTimeFormat = (timeFormat: string): string => (timeFormat === TIME_FORMAT.H12 ? 'h:mm aa' : 'HH:mm'); +// TODO move export type DateMap = { d: string; m: string; y: string; -} +}; /** @namespace Util/Form/Extract/getDateFormat */ export const getDateFormat = (dateFieldsOrder: string): string => { @@ -161,6 +164,7 @@ export const adjustAmpmHours = (hours: number, ampm: string): number => { return hours; }; +// TODO export type DatesData = { type?: string; year?: string; @@ -175,10 +179,12 @@ export type DateObject = { name: string; value: string; type: string; -} +}; /** @namespace Util/Form/Extract/transformDateFieldsData */ -export const transformDateFieldsData = (datesData: Record) => Object.entries(datesData).reduce((prev, [name, data]) => { +export const transformDateFieldsData = ( + datesData: Record +): Record[] => Object.entries(datesData).reduce((prev, [name, data]) => { const { type, year, @@ -219,7 +225,7 @@ export const transformDateFieldsData = (datesData: Record) => }, [] as Record[]); /** @namespace Util/Form/Extract/groupDateFieldsData */ -export const groupDateFieldsData = (fields: NodeListOf) => Array.from(fields) +export const groupDateFieldsData = (fields: NodeListOf): Record => Array.from(fields) .reduce((prev, field) => { const dataType = field.getAttribute(FIELD_TYPE_ATTR) || ''; @@ -241,7 +247,6 @@ export const groupDateFieldsData = (fields: NodeListOf) => Array.from(f }; }, {} as Record); - /** * Returns fields values from DOM/Form * @param DOM @@ -251,11 +256,11 @@ export const groupDateFieldsData = (fields: NodeListOf) => Array.from(f * @returns {{}|*[]} * @namespace Util/Form/Extract/getFieldsData */ -export const getFieldsData = (DOM: Document, excludeEmpty: boolean = false, ignoreTypes: string[] = [], asObject: boolean = false) => { +export const getFieldsData = (DOM: Document, excludeEmpty = false, ignoreTypes: string[] = [], asObject = false) => { const fields: NodeListOf = DOM.querySelectorAll('input, textarea, select'); const output = []; - const dateFieldsGrouped = groupDateFieldsData(fields) + const dateFieldsGrouped = groupDateFieldsData(fields); output.push(...transformDateFieldsData(dateFieldsGrouped)); fields.forEach((field) => { diff --git a/packages/scandipwa/src/util/Form/Transform.ts b/packages/scandipwa/src/util/Form/Transform.ts index 94de762e38..e3c0dc6e78 100644 --- a/packages/scandipwa/src/util/Form/Transform.ts +++ b/packages/scandipwa/src/util/Form/Transform.ts @@ -15,15 +15,15 @@ * @returns {{}} * @namespace Util/Form/Transform/transformToNameValuePair */ -export const transformToNameValuePair = (fields: any | any[]): T => { - const filteredFields: Record = {}; +export const transformToNameValuePair = (fields: any | any[]): T => { + const filteredFields: Record = {}; const arrayFormat = !Array.isArray(fields) ? Object.values(fields) : fields; arrayFormat.forEach(({ value, name }) => { filteredFields[name] = value; }); - return filteredFields as unknown as T;; + return filteredFields as unknown as T; }; export default transformToNameValuePair; diff --git a/packages/scandipwa/src/util/FormPortalCollector/index.ts b/packages/scandipwa/src/util/FormPortalCollector/index.ts index 1d9ce5d010..354d2e3311 100644 --- a/packages/scandipwa/src/util/FormPortalCollector/index.ts +++ b/packages/scandipwa/src/util/FormPortalCollector/index.ts @@ -17,7 +17,7 @@ export class FormPortalCollector < > { portalsObservers: Record> = {}; - subscribe(id: T, f: U, name: S) { + subscribe(id: T, f: U, name: S): void { if (this.portalsObservers[id]) { this.portalsObservers[id][name] = f; @@ -27,7 +27,7 @@ export class FormPortalCollector < this.portalsObservers[id] = { [name]: f }; } - unsubscribe(id: T, name: S) { + unsubscribe(id: T, name: S): void { if (!this.portalsObservers[id]) { return; } diff --git a/packages/scandipwa/src/util/Manipulations/Date.ts b/packages/scandipwa/src/util/Manipulations/Date.ts index ae55680fac..a3b36dd043 100644 --- a/packages/scandipwa/src/util/Manipulations/Date.ts +++ b/packages/scandipwa/src/util/Manipulations/Date.ts @@ -27,12 +27,10 @@ export const convertStringToDate = (stringDate: string, options: Intl.DateTimeFo }; /** @namespace Util/Manipulations/Date/getTimeInCurrentTimezone */ -export const getTimeInCurrentTimezone = (timestamp: string): string => { +export const getTimeInCurrentTimezone = (timestamp: string): number | string | Date => { const currentDate = new Date(); const timezone = currentDate.getTimezoneOffset() * MILLISECONDS_PER_MINUTE; const timeInCurrentTimezone = new Date(timestamp.replace(/-/g, '/')).getTime() - new Date(timezone).getTime(); return getDateValue(timeInCurrentTimezone); }; - - diff --git a/packages/scandipwa/src/util/Media/Media.ts b/packages/scandipwa/src/util/Media/Media.ts index 2895791ce3..f1cfe94c46 100644 --- a/packages/scandipwa/src/util/Media/Media.ts +++ b/packages/scandipwa/src/util/Media/Media.ts @@ -15,7 +15,7 @@ export const CATEGORY_MEDIA = 'catalog/category/'; export const PRODUCT_MEDIA = 'catalog/product'; export const LOGO_MEDIA = 'logo/'; -export default (src: string, subPath: string = '', isMediaPath: boolean = true): string => { +export default (src: string, subPath = '', isMediaPath = true): string => { // If isMediaPath is passed return local media path const { ConfigReducer: { secure_base_media_url, base_url } } = getStore().getState(); diff --git a/packages/scandipwa/src/util/Menu/Menu.ts b/packages/scandipwa/src/util/Menu/Menu.ts index 7d2d999599..02f33ca22c 100644 --- a/packages/scandipwa/src/util/Menu/Menu.ts +++ b/packages/scandipwa/src/util/Menu/Menu.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { MenuItem } from "Type/Menu.type"; +import { MenuItem } from 'Type/Menu.type'; /* eslint-disable no-param-reassign */ @@ -23,13 +23,13 @@ type MenuLocation = { state: { category?: number; page?: boolean; - } + }; } | string; export type FormattedMenuItem = Omit & { - url: MenuLocation - children: Record -} + url: MenuLocation; + children: Record; +}; /** * Given an array of menu items, returns a copy of the array, sorted by their parent ID, then by their sort order (position) @@ -46,6 +46,7 @@ export const getSortedItems = (unsortedItems: MenuItem[]): MenuItem[] => Array.f /** @namespace Util/Menu */ export class Menu { menu: Record = {}; + menuPositionReference: Record = {}; getMenuUrl({ url, url_type, category_id }: Pick): MenuLocation { @@ -73,7 +74,7 @@ export class Menu { url_type, category_id, ...item - }: MenuItem ): FormattedMenuItem { + }: MenuItem): FormattedMenuItem { return { ...item, url: this.getMenuUrl({ url, url_type, category_id }), @@ -82,7 +83,7 @@ export class Menu { } // TODO from child to menu item ??? Any - setToValue (obj: Record | any, path: string, value: FormattedMenuItem) { + setToValue(obj: Record | any, path: string, value: FormattedMenuItem): void { // eslint-disable-next-line fp/no-let let i; const pathArray = path.split('.'); @@ -94,7 +95,7 @@ export class Menu { obj[pathArray[i]] = value; } - createItem(data: MenuItem) { + createItem(data: MenuItem): void { const { parent_id, item_id } = data; if (parent_id === 0) { @@ -114,7 +115,7 @@ export class Menu { } } - reduce({ items: unsortedItems }: Record) { + reduce({ items: unsortedItems }: Record): Record { this.menu = {}; this.menuPositionReference = {}; diff --git a/packages/scandipwa/src/util/Mobile/isMobile.ts b/packages/scandipwa/src/util/Mobile/isMobile.ts index 498a53b179..1aaaf4d7e2 100644 --- a/packages/scandipwa/src/util/Mobile/isMobile.ts +++ b/packages/scandipwa/src/util/Mobile/isMobile.ts @@ -11,24 +11,24 @@ export const isUsingClientHints = 'userAgentData' in navigator; export const isMobile = { - android: (agent = navigator.userAgent) => /android/i.test(agent), - blackBerry: (agent = navigator.userAgent) => /blackberry/i.test(agent), - iOS: (agent = navigator.userAgent) => /iphone|ipod|ipad/i.test(agent), - opera: (agent = navigator.userAgent) => /opera mini/i.test(agent), + android: (agent = navigator.userAgent): boolean => /android/i.test(agent), + blackBerry: (agent = navigator.userAgent): boolean => /blackberry/i.test(agent), + iOS: (agent = navigator.userAgent): boolean => /iphone|ipod|ipad/i.test(agent), + opera: (agent = navigator.userAgent): boolean => /opera mini/i.test(agent), // see https://developer.chrome.com/docs/multidevice/user-agent/ for details - safari: (agent = navigator.userAgent) => /safari/i.test(agent) + safari: (agent = navigator.userAgent): boolean => /safari/i.test(agent) && !/chrome/i.test(agent) && !/CriOS/i.test(agent) && !/FxiOS/i.test(agent), - windows: (agent = navigator.userAgent) => /iemobile/i.test(agent), + windows: (agent = navigator.userAgent): boolean => /iemobile/i.test(agent), // iPad uses 810 so we need to handle that. - any: () => window.matchMedia('(max-width: 810px)').matches, - standaloneMode: () => window.matchMedia('(display-mode: standalone)').matches + any: (): boolean => window.matchMedia('(max-width: 810px)').matches, + standaloneMode: (): boolean => window.matchMedia('(display-mode: standalone)').matches }; // https://medium.com/@galmeiri/get-ready-for-chrome-user-agent-string-phase-out-c6840da1c31e export const isMobileClientHints = { - getDeviceData: () => navigator.userAgentData.getHighEntropyValues(['platform', 'model']) + getDeviceData: (): Promise => navigator.userAgentData.getHighEntropyValues(['platform', 'model']) }; export default isMobile; diff --git a/packages/scandipwa/src/util/Orders/Orders.ts b/packages/scandipwa/src/util/Orders/Orders.ts index 554f18e072..1716a48bcc 100644 --- a/packages/scandipwa/src/util/Orders/Orders.ts +++ b/packages/scandipwa/src/util/Orders/Orders.ts @@ -10,10 +10,13 @@ * @link https://github.com/scandipwa/scandipwa */ -import { Orders, OrderProduct, OrderProducts, Discount } from "Type/Order.type"; +import { + Discount, Order, OrderProduct, OrderProductQuantity, + OrderProducts +} from 'Type/Order.type'; /** @namespace Util/Orders/getFormattedDate */ -export const getFormattedDate = (rawDate: string = '') => { +export const getFormattedDate = (rawDate = ''): string => { const date = new Date(rawDate.replace(/\s/, 'T')); const RADIX = 10; @@ -26,7 +29,7 @@ export const getFormattedDate = (rawDate: string = '') => { }; /** @namespace Util/Orders/formatOrders */ -export const formatOrders = (orders: Orders) => orders.reduceRight((acc, order) => { +export const formatOrders = (orders: Order[]): Order[] => orders.reduceRight((acc, order) => { const { order_date, id: uid } = order; const formattedDate = getFormattedDate(order_date); @@ -38,10 +41,10 @@ export const formatOrders = (orders: Orders) => orders.reduceRight((acc, order) created_at: formattedDate } ]; -}, [] as Orders); +}, [] as Order[]); /** @namespace Util/Orders/getOrderItemQtyToArray */ -export const getOrderItemQtyToArray = (product: OrderProduct) => { +export const getOrderItemQtyToArray = (product: OrderProduct): OrderProductQuantity => { const { quantity_ordered = 0, quantity_canceled = 0, diff --git a/packages/scandipwa/src/util/Price/Price.ts b/packages/scandipwa/src/util/Price/Price.ts index 12480596d5..01555fa74a 100644 --- a/packages/scandipwa/src/util/Price/Price.ts +++ b/packages/scandipwa/src/util/Price/Price.ts @@ -10,13 +10,16 @@ */ import { PriceTier } from 'Type/ProductList.type'; + import { currencyMap, HUNDRED_PERCENT } from './Price.config'; /** @namespace Util/Price/formatCurrency */ -export const formatCurrency = (currency: string = 'USD'): string | null => Object.keys(currencyMap).includes(currency) ? currency : null ; +export const formatCurrency = ( + currency = 'USD' +): string | null => (Object.keys(currencyMap).includes(currency) ? currency : null); /** @namespace Util/Price/formatPrice */ -export const formatPrice = (price: number, currency: string = 'USD') : string => { +export const formatPrice = (price: number, currency = 'USD') : string => { const language = navigator.languages ? navigator.languages[0] : navigator.language; return new Intl.NumberFormat(language, { style: 'currency', currency }).format(price); diff --git a/packages/scandipwa/src/util/Product/Extract.ts b/packages/scandipwa/src/util/Product/Extract.ts index 40b3c0e116..97a6c8f041 100644 --- a/packages/scandipwa/src/util/Product/Extract.ts +++ b/packages/scandipwa/src/util/Product/Extract.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable spaced-comment */ /** * ScandiPWA - Progressive Web App for Magento @@ -14,7 +15,15 @@ import { PRODUCT_TYPE } from 'Component/Product/Product.config'; import { STOCK_TYPE } from 'Component/Product/Stock.config'; import { ImageTypes } from 'Component/ProductGallery/ProductGallery.config'; import { PriceRange } from 'Type/Price.type'; -import { ProductGrouped, ProductBundle, ItemOption, Product, ProductBundleItems, ProductVariant, StockItem, ProductDownloadable, ItemOptionProduct } from 'Type/ProductList.type'; +import { + ItemOption, + Product, + ProductBundle, + ProductDownloadable, + ProductGrouped, + ProductVariant, + StockItem +} from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; export const DEFAULT_MIN_PRODUCTS = 1; @@ -37,7 +46,10 @@ export enum QtyFields { // TODO unify keyof product and stockitem. /** @namespace Util/Product/Extract/getFieldQty */ -export const getFieldQty = (product: Product | ProductVariant, field: keyof Product | keyof StockItem): number | undefined => { +export const getFieldQty = ( + product: Product | ProductVariant, + field: keyof Product | keyof StockItem +): number | undefined => { if (field === QtyFields.MIN_SALE_QTY || field === QtyFields.MAX_SALE_QTY) { const { stock_item: { [field]: qty } = {} } = product; @@ -58,7 +70,12 @@ export const getFieldQty = (product: Product | ProductVariant, field: keyof Prod * @returns {*} * @namespace Util/Product/Extract/getQuantity */ -export const getQuantity = (product: Product, defaultValue: number, field: keyof Product | keyof StockItem , configIndex: number = -1): number => { +export const getQuantity = ( + product: Product, + defaultValue: number, + field: keyof Product | keyof StockItem, + configIndex = -1 +): number => { if (!product) { return defaultValue; } @@ -111,7 +128,7 @@ export const getMaxQuantity = (product: Product, configIndex = -1) => { * @returns {*} * @namespace Util/Product/Extract/getName */ -export const getName = (product: Product, configIndex: number = -1): string => { +export const getName = (product: Product, configIndex = -1): string => { const { variants = [] } = product; const { @@ -144,7 +161,7 @@ export const getProductInStock = (product: Product, parentProduct?: Product): bo const { items = [] } = product as ProductBundle; const requiredItems = items.filter(({ required }) => required); const requiredItemsInStock = requiredItems.filter( - ({ options } ) => options.some(({ product }) => getProductOptionInStock(product)) + ({ options }) => options.some(({ product }) => getProductOptionInStock(product)) ); return inStock && requiredItemsInStock.length === requiredItems.length; @@ -180,11 +197,12 @@ export const getProductInStock = (product: Product, parentProduct?: Product): bo return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && (inStock || stockStatus === STOCK_TYPE.IN_STOCK); }; +/** @namespace Util/Product/Extract/getProductOptionInStock */ export const getProductOptionInStock = (product: Product): boolean => { const { stock_status: stockStatus } = product; return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && stockStatus === STOCK_TYPE.IN_STOCK; -} +}; /** * Checks if items in Grouped Product are in stock @@ -227,7 +245,7 @@ export type AdjustedPrice = { inclTax: number; hasDiscountCalculated: boolean; requiresDiscountCalculations: boolean; -} +}; export type AdjustedPrices = Record; @@ -243,7 +261,7 @@ export type AdjustedPrices = Record; */ export const getPrice = ( priceRange: PriceRange, - dynamicPrice: boolean = false, + dynamicPrice = false, adjustedPrice: AdjustedPrices = {}, type = PRODUCT_TYPE.simple, options = [] @@ -405,7 +423,7 @@ export const getPrice = ( export type EnteredOption = { uid: string; value: string; -} +}; /** * Generates adjusted price from entered product options @@ -416,7 +434,12 @@ export type EnteredOption = { * @param selectedOptions * @namespace Util/Product/Extract/getAdjustedPrice */ -export const getAdjustedPrice = (product: Product, downloadableLinks: string[], enteredOptions: EnteredOption[], selectedOptions: string[]) => { +export const getAdjustedPrice = ( + product: Product, + downloadableLinks: string[], + enteredOptions: EnteredOption[], + selectedOptions: string[] +) => { const { options = [], type_id: typeId @@ -536,7 +559,7 @@ export const getAdjustedPrice = (product: Product, downloadableLinks: string[], * @param value * @namespace Util/Product/Extract/getSubLabelFromMaxCharacters */ -export const getSubLabelFromMaxCharacters = (maxCharacters: number, value: string = ''): string | null => { +export const getSubLabelFromMaxCharacters = (maxCharacters: number, value = ''): string | null => { const valueLength = value.length; const remainingCharacters = maxCharacters - valueLength; @@ -563,7 +586,7 @@ export const getSubLabelFromMaxCharacters = (maxCharacters: number, value: strin * @param field * @namespace Util/Product/Extract/getImage */ -export const getImage = (product: Product, field: ImageTypes) => { +export const getImage = (product: Product, field: ImageTypes): string => { const { [field]: { url = 'no_selection' } = {} } = product; return url && url !== 'no_selection' ? url : ''; }; diff --git a/packages/scandipwa/src/util/Product/Transform.ts b/packages/scandipwa/src/util/Product/Transform.ts index 8be5588d96..2d049909e4 100644 --- a/packages/scandipwa/src/util/Product/Transform.ts +++ b/packages/scandipwa/src/util/Product/Transform.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/default-param-last */ /** * ScandiPWA - Progressive Web App for Magento * @@ -12,7 +13,9 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import PRODUCT_TYPE from 'Component/Product/Product.config'; import { NONE_RADIO_OPTION } from 'Component/ProductCustomizableOption/ProductCustomizableOption.config'; -import { Attribute, CustomizableOption, Item, ItemOption, Product, ProductGrouped, Quantity } from 'Type/ProductList.type'; +import { + Attribute, CustomizableOption, ItemOption, Product, ProductGrouped +} from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; import { EnteredOption, getProductInStock } from './Extract'; @@ -27,8 +30,8 @@ export type BuyRequest = { action: string; options?: Record; links?: string[]; - super_attribute?: Record -} + super_attribute?: Record; +}; export interface Variant { date_internal: string; @@ -83,7 +86,7 @@ export const getCustomizableOptions = (buyRequest: string): string[] => { return []; } - return Object.entries(options).reduce((prev, [option, variant ]) => { + return Object.entries(options).reduce((prev, [option, variant]) => { if (typeof variant === 'string') { return [...prev, btoa(`custom-option/${option}/${variant}`)]; } @@ -140,7 +143,10 @@ export const getSelectedOptions = (buyRequest: string): string[] => [ ]; /** @namespace Util/Product/Transform/transformParameters */ -export const transformParameters = (parameters: string[] = [], attributes: Record = {}): string[] => Object.entries(parameters) +export const transformParameters = ( + parameters: string[] = [], + attributes: Record = {} +): string[] => Object.entries(parameters) .map(([attrCode, selectedValue]) => { const attrId = attributes[attrCode]?.attribute_id; @@ -151,7 +157,7 @@ export const transformParameters = (parameters: string[] = [], attributes: Recor export type PriceLabels = { baseLabel?: string; priceLabel: string; -} +}; /** * Generates label for bundle option @@ -161,7 +167,7 @@ export type PriceLabels = { * @returns {{baseLabel: string, priceLabel: string}} * @namespace Util/Product/Transform/bundleOptionToLabel */ -export const bundleOptionToLabel = (option: ItemOption, currencyCode: string = 'USD'): PriceLabels => { +export const bundleOptionToLabel = (option: ItemOption, currencyCode = 'USD'): PriceLabels => { const { price, finalOptionPrice, @@ -195,7 +201,7 @@ export type OptionTransformResult = { sort_order: number; isAvailable?: boolean; isDefault?: boolean; -} +}; /** * Converts bundle products options into select field options, @@ -204,7 +210,11 @@ export type OptionTransformResult = { * @param options * @namespace Util/Product/Transform/bundleOptionsToSelectTransform */ -export const bundleOptionsToSelectTransform = (options: ItemOption[], currencyCode = 'USD', quantity = {}): OptionTransformResult[] => ( +export const bundleOptionsToSelectTransform = ( + options: ItemOption[], + currencyCode = 'USD', + quantity = {} +): OptionTransformResult[] => ( options.reduce((result = [], option) => { const { uid: sourceUid = '', @@ -247,7 +257,7 @@ export const bundleOptionsToSelectTransform = (options: ItemOption[], currencyCo * @returns {{baseLabel: string, priceLabel: string}} * @namespace Util/Product/Transform/customizableOptionToLabel */ -export const customizableOptionToLabel = (option: CustomizableOption, currencyCode: string = 'USD'): PriceLabels => { +export const customizableOptionToLabel = (option: CustomizableOption, currencyCode = 'USD'): PriceLabels => { const { price, priceInclTax, @@ -271,7 +281,10 @@ export const customizableOptionToLabel = (option: CustomizableOption, currencyCo * @param options * @namespace Util/Product/Transform/customizableOptionsToSelectTransform */ -export const customizableOptionsToSelectTransform = (options: CustomizableOption[], currencyCode: string = 'USD'): OptionTransformResult[] => ( +export const customizableOptionsToSelectTransform = ( + options: CustomizableOption[], + currencyCode = 'USD' +): OptionTransformResult[] => ( options.reduce((result = [], option) => { const { uid, @@ -303,7 +316,7 @@ export type ProductTransformData = { quantity: number | Record; selected_options: string[]; entered_options: EnteredOption[]; -} +}; /** * Generates Magento type product interface for performing @@ -321,7 +334,7 @@ export const magentoProductTransform = ( quantity: number | Record = 1, enteredOptions: EnteredOption[] = [], selectedOptions: string[] = [] -) => { +): ProductTransformData[] => { const { sku, type_id: typeId } = product; const productData: ProductTransformData[] = []; @@ -368,7 +381,7 @@ export const magentoProductTransform = ( * @namespace Util/Product/Transform/nonRequiredRadioOptions */ export const nonRequiredRadioOptions = ( - options: ItemOption[], isRequired: boolean = false, type: string = FIELD_TYPE.radio + options: ItemOption[], isRequired = false, type: string = FIELD_TYPE.radio ) => { if (isRequired || type !== FIELD_TYPE.radio) { return options; diff --git a/packages/scandipwa/src/util/Query/PrepareDocument.ts b/packages/scandipwa/src/util/Query/PrepareDocument.ts index 5c2f065657..45044b2879 100644 --- a/packages/scandipwa/src/util/Query/PrepareDocument.ts +++ b/packages/scandipwa/src/util/Query/PrepareDocument.ts @@ -10,8 +10,9 @@ */ import { QueryObject, QueryVariables } from 'Util/Request'; + import { Field } from './Field'; -import { FieldArgument, FieldType, PreparedRequest } from './Query.type'; +import { FieldArgument, FieldType } from './Query.type'; /** * Prepare request body string from query list (all entries must be instances of Query). @@ -54,7 +55,7 @@ export const prepareFieldString = ( }; /** @namespace Util/Query/PrepareDocument/prepareRequest */ -export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => { +export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => { const fieldsArray = Array.isArray(fields) ? fields : [fields]; if (type !== FieldType.MUTATION && type !== FieldType.QUERY) { @@ -72,7 +73,7 @@ export const prepareRequest = (fields: Field[], type: FieldType): QueryObject // into the format "$var:Type" and append variable value to variables field const resolvedArgs = Object.entries(accArgs).reduce((acc, [name, dataArray]): string[] => { (dataArray as Array>).forEach((item, i: number) => { - const variable: string = `${name}_${i + 1}`; + const variable = `${name}_${i + 1}`; acc.push(`$${variable}:${item.type}`); variables[variable] = item.value as any; }); diff --git a/packages/scandipwa/src/util/Query/Query.type.ts b/packages/scandipwa/src/util/Query/Query.type.ts index 8677f71f92..da08684f5e 100644 --- a/packages/scandipwa/src/util/Query/Query.type.ts +++ b/packages/scandipwa/src/util/Query/Query.type.ts @@ -21,6 +21,6 @@ export type FieldArgument = { }; export type PreparedRequest = { - query: string, - variables: unknown + query: string; + variables: unknown; }; diff --git a/packages/scandipwa/src/util/Request/Hash.ts b/packages/scandipwa/src/util/Request/Hash.ts index e9ed94259b..ac2e0f6128 100644 --- a/packages/scandipwa/src/util/Request/Hash.ts +++ b/packages/scandipwa/src/util/Request/Hash.ts @@ -14,7 +14,6 @@ * @link https://github.com/scandipwa/base-theme */ - // TODO seed is always undefined! Why ? /** * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011) @@ -28,7 +27,7 @@ * @param {number} seed Positive integer only * @return {number} 32-bit positive integer hash * @namespace Util/Request/Hash/hash */ -export const hash = (key: string, seed: number = 1): number => { +export const hash = (key: string, seed = 1): number => { // eslint-disable-next-line one-var, fp/no-let let h1, h1b, diff --git a/packages/scandipwa/src/util/Request/Request.ts b/packages/scandipwa/src/util/Request/Request.ts index eaa807c5c8..2b3fcdc913 100644 --- a/packages/scandipwa/src/util/Request/Request.ts +++ b/packages/scandipwa/src/util/Request/Request.ts @@ -21,7 +21,7 @@ export const GRAPHQL_URI = '/graphql'; export const WINDOW_ID = 'WINDOW_ID'; /** @namespace Util/Request/getWindowId */ -export const getWindowId = (): string => { +export const getWindowId = (): string => { const result = sessionStorage.getItem(WINDOW_ID); if (!result) { @@ -110,7 +110,11 @@ export const getFetch = (uri: string, name: string): Promise => fetch( * @param {Int} cacheTTL * @namespace Util/Request/putPersistedQuery */ -export const putPersistedQuery = (graphQlURI: string, query: string, cacheTTL: number): Promise => fetch(`${ graphQlURI }?hash=${ hash(query) }`, +export const putPersistedQuery = ( + graphQlURI: string, + query: string, + cacheTTL: number +): Promise => fetch(`${ graphQlURI }?hash=${ hash(query) }`, { method: 'PUT', body: JSON.stringify(query), @@ -128,7 +132,11 @@ export const putPersistedQuery = (graphQlURI: string, query: string, cacheTTL: n * @returns {Promise} * @namespace Util/Request/postFetch */ -export const postFetch = (graphQlURI: string, query: string, variables: Record): Promise => fetch(graphQlURI, +export const postFetch = ( + graphQlURI: string, + query: string, + variables: Record +): Promise => fetch(graphQlURI, { method: 'POST', body: JSON.stringify({ query, variables }), @@ -142,7 +150,7 @@ export const postFetch = (graphQlURI: string, query: string, variables: Record; -} +}; export type QueryVariables = Record; diff --git a/packages/scandipwa/src/util/Store/Transform.ts b/packages/scandipwa/src/util/Store/Transform.ts index 7bf9877664..b17d9d51bb 100644 --- a/packages/scandipwa/src/util/Store/Transform.ts +++ b/packages/scandipwa/src/util/Store/Transform.ts @@ -9,14 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ -import { Countries } from "Type/Config.type"; +import { Country } from 'Type/Config.type'; /** * Transforms countries list into select options * @param countries * @namespace Util/Store/Transform/transformCountriesToOptions */ -export const transformCountriesToOptions = (countries: Countries): Countries => { +export const transformCountriesToOptions = (countries: Country[]): Country[] => { const options = countries.map((country) => { const { id } = country; diff --git a/packages/scandipwa/src/util/Store/index.ts b/packages/scandipwa/src/util/Store/index.ts index 822d24745d..8fbc055692 100644 --- a/packages/scandipwa/src/util/Store/index.ts +++ b/packages/scandipwa/src/util/Store/index.ts @@ -15,7 +15,7 @@ import { combineReducers, createStore } from 'redux'; * Configure the store * @namespace Util/Store/Index/configureStore */ - export function configureStore>(store: T): T { +export function configureStore>(store: T): T { // Add a dictionary to keep track of the registered async reducers store.asyncReducers = {}; @@ -49,4 +49,4 @@ export const store = configureStore(createStore( /** @namespace Util/Store/Index/getStore */ export const getStore = (): typeof store => store; -export default getStore; \ No newline at end of file +export default getStore; diff --git a/packages/scandipwa/src/util/Url/Url.ts b/packages/scandipwa/src/util/Url/Url.ts index 55da6039d3..846e747e96 100644 --- a/packages/scandipwa/src/util/Url/Url.ts +++ b/packages/scandipwa/src/util/Url/Url.ts @@ -9,9 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ +import { History, Location, Match } from 'Type/Router.type'; import { decodeString } from 'Util/Common'; import getStore from 'Util/Store'; -import { History, Location, Match } from 'Type/Router.type'; // TODO move export type KeyValuePairs = Record; @@ -24,7 +24,12 @@ export type KeyValuePairsArray = Record; * @param {String} value * @namespace Util/Url/updateQueryParamWithoutHistory */ -export const updateQueryParamWithoutHistory = (name: string, value: string, history: History, location: Location): void => { +export const updateQueryParamWithoutHistory = ( + name: string, + value: string, + history: History, + location: Location +): void => { const { search, pathname } = location; const params = new URLSearchParams(search); @@ -148,7 +153,11 @@ export const convertQueryStringToKeyValuePairs = (queryString: string): KeyValue * @return {Object} Key-Value pairs * @namespace Util/Url/updateKeyValuePairs */ -export const updateKeyValuePairs = (keyValuePairs: KeyValuePairs, currentKey: string, currentValue: string | number): KeyValuePairs => { +export const updateKeyValuePairs = ( + keyValuePairs: KeyValuePairs, + currentKey: string, + currentValue: string | number +): KeyValuePairs => { const updatedKeyValuePairs: KeyValuePairs = {}; Object.entries(keyValuePairs).forEach((pair) => { @@ -170,7 +179,9 @@ export const updateKeyValuePairs = (keyValuePairs: KeyValuePairs, currentKey: st * @return {String} Converted query string * @namespace Util/Url/convertKeyValuesToQueryString */ -export const convertKeyValuesToQueryString = (keyValuePairs: KeyValuePairsArray): string => Object.entries(keyValuePairs) +export const convertKeyValuesToQueryString = ( + keyValuePairs: KeyValuePairsArray +): string => Object.entries(keyValuePairs) .map((pair) => { const [key, value] = pair; const keyExists = key !== ''; @@ -186,7 +197,11 @@ export const convertKeyValuesToQueryString = (keyValuePairs: KeyValuePairsArray) .join('&'); /** @namespace Util/Url/generateQuery */ -export const generateQuery = (keyValueObject: KeyValuePairs, location: Location, history: History): string => Object.entries(keyValueObject) +export const generateQuery = ( + keyValueObject: KeyValuePairs, + location: Location, + history: History +): string => Object.entries(keyValueObject) .reduce((acc, pair) => { const [key, value] = pair; diff --git a/packages/scandipwa/src/util/Validator/Validator.ts b/packages/scandipwa/src/util/Validator/Validator.ts index 7167f35ce7..d75b2c0dee 100644 --- a/packages/scandipwa/src/util/Validator/Validator.ts +++ b/packages/scandipwa/src/util/Validator/Validator.ts @@ -10,34 +10,34 @@ * @link https://github.com/scandipwa/base-theme */ import FIELD_TYPE from 'Component/Field/Field.config'; -import { ValidationInputTypeNumber, VALIDATION_MESSAGES, VALIDATION_RULES } from 'Util/Validator/Config'; +import { VALIDATION_MESSAGES, VALIDATION_RULES, ValidationInputTypeNumber } from 'Util/Validator/Config'; //TODO Move to Types export type ValidationRule = { - isRequired: boolean, + isRequired: boolean; inputType: string; selector?: string; match: string | ((args: string | Record[]) => boolean); range: Record; - fileExtension: Record - customErrorMessages: Record -} + fileExtension: Record; + customErrorMessages: Record; +}; export type ValidationOutput = { - value: string, - errorMessages: string[] -} + value: string; + errorMessages: string[]; +}; export type ValidationDOMOutput = { values: { - name: string; - value: string; - type: string; + name: string; + value: string; + type: string; }[]; - errorFields: unknown[] - errorMessages: string[] -} + errorFields: unknown[]; + errorMessages: string[]; +}; /** * Validates parameter based on rules @@ -58,7 +58,7 @@ export const validate = (value: string, rule: ValidationRule): boolean | Validat onInputTypeFail, onMatchFail, onRangeFailMin, - onRangeFailMax, + onRangeFailMax, onExtensionFail } = {} } = rule; @@ -124,7 +124,7 @@ export const validate = (value: string, rule: ValidationRule): boolean | Validat if (fileExtension && value !== '') { const { accept } = fileExtension; const acceptedExtensions = accept.split(', '); - const currentFileExtension = value.split('.').pop() as string; + const currentFileExtension = value.split('.').pop() as string; if (!acceptedExtensions.includes(currentFileExtension)) { output.errorMessages.push(onExtensionFail || VALIDATION_MESSAGES.fileExtension); @@ -170,6 +170,7 @@ export const validateGroup = (DOM: Document, rule: ValidationRule): boolean | Va const fieldType = tagName.toLowerCase() === FIELD_TYPE.textarea ? FIELD_TYPE.textarea : type; // TODO change logic so that checked won't fill as value + // eslint-disable-next-line max-len const fieldValue = fieldType === (FIELD_TYPE.checkbox || fieldType === FIELD_TYPE.radio) && field.checked ? '' : value; output.values.push({ name, value: fieldValue, type: fieldType }); @@ -249,7 +250,11 @@ export default validate; * @returns {String|Boolean} * @namespace Util/Validator/validatePassword */ -export const validatePassword = (value: string, range: Record, minCharacter: number): string | boolean => { +export const validatePassword = ( + value: string, + range: Record, + minCharacter: number +): string | boolean => { if (value.length === 0) { return true; } diff --git a/packages/scandipwa/src/util/Wishlist/Wishlist.ts b/packages/scandipwa/src/util/Wishlist/Wishlist.ts index 5b7abee128..c52165cdc2 100644 --- a/packages/scandipwa/src/util/Wishlist/Wishlist.ts +++ b/packages/scandipwa/src/util/Wishlist/Wishlist.ts @@ -9,8 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ -import { PriceRange } from "Type/Price.type"; -import { Product } from "Type/ProductList.type"; +import { PriceRange } from 'Type/Price.type'; +import { Product } from 'Type/ProductList.type'; /** * Updates wishlist item price for option based products From ec0ea4e935b98f2cc3a397a358e83cd9bb5c7c85 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Mon, 4 Apr 2022 20:43:43 +0300 Subject: [PATCH 015/192] Enable eslint for src folder --- packages/scandipwa/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 33c2d89f5e..b975a9782a 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -131,7 +131,7 @@ "parserOptions": { "project": "./tsconfig.json" }, - "ignorePatterns": ["package.json", "src/*"], + "ignorePatterns": ["package.json"], "env": { "browser": true }, From d9d5d8dc9081d6db5ac1d2e81b52465f6eb7ed2a Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Wed, 6 Apr 2022 13:31:43 +0300 Subject: [PATCH 016/192] Finish migrating utils & fix some eslint errors --- packages/scandipwa/package.json | 7 +- .../ProductGallery/ProductGallery.config.ts | 3 +- packages/scandipwa/src/query/Order.query.ts | 11 +- .../scandipwa/src/type/ProductList.type.ts | 98 +++++--- packages/scandipwa/src/util/Form/Extract.ts | 23 +- .../src/util/FormPortalCollector/index.ts | 2 +- packages/scandipwa/src/util/Orders/Orders.ts | 8 +- packages/scandipwa/src/util/Price/Price.ts | 2 +- .../scandipwa/src/util/Product/Extract.ts | 159 ++++++++---- .../util/Product/{Product.js => Product.ts} | 228 ++++++++++++------ .../scandipwa/src/util/Product/Transform.ts | 10 +- .../src/util/Promise/MakeCancelable.ts | 8 +- .../scandipwa/src/util/Request/Mutation.ts | 2 +- packages/scandipwa/src/util/Request/Query.ts | 2 +- .../scandipwa/src/util/Request/Request.ts | 6 +- packages/scandipwa/src/util/Url/Url.ts | 6 +- .../scandipwa/src/util/Wishlist/Wishlist.ts | 6 +- 17 files changed, 403 insertions(+), 178 deletions(-) rename packages/scandipwa/src/util/Product/{Product.js => Product.ts} (67%) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 175573d6bc..a7c3ec73fa 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -22,9 +22,9 @@ "@tilework/opus": "file:../../tilework-packages/opus", "@types/react": "^17.0.19", "@types/react-dom": "^17.0.9", + "@types/react-redux": "7.1.16", "@types/react-router": "^5.1.16", "@types/react-router-dom": "^5.1.8", - "@types/react-redux": "7.1.16", "eslint-config-airbnb-typescript": "^16.1.4", "get-graphql-schema": "^2.1.2", "graphql-schema-typescript": "^1.5.2", @@ -132,7 +132,8 @@ "project": "./tsconfig.json" }, "ignorePatterns": [ - "package.json" + "package.json", + "*.js" ], "env": { "browser": true @@ -180,6 +181,8 @@ } ], "rules": { + "@typescript-eslint/no-shadow": "off", + "@typescript-eslint/space-before-blocks": "off", "@scandipwa/scandipwa-guidelines/no-jsx-variables": "off", "@scandipwa/scandipwa-guidelines/jsx-no-conditional": "off", "@scandipwa/scandipwa-guidelines/jsx-no-props-destruction": "error", diff --git a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts index 1927d11931..4b44d52168 100644 --- a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts +++ b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts @@ -22,9 +22,8 @@ export const AMOUNT_OF_PLACEHOLDERS = 0; export const PRODUCT_GALERY_POPUP_ID = 'ProductGalleryPopup'; - export enum ImageTypes { SMALL_KEY = 'small_image', THUMBNAIL_KEY = 'thumbnail', IMAGE_KEY = 'image' -} \ No newline at end of file +} diff --git a/packages/scandipwa/src/query/Order.query.ts b/packages/scandipwa/src/query/Order.query.ts index 67c5cca2f7..79ece4cd77 100644 --- a/packages/scandipwa/src/query/Order.query.ts +++ b/packages/scandipwa/src/query/Order.query.ts @@ -14,7 +14,16 @@ import { Field, Query } from '@tilework/opus'; import { GQLBundleOption, GQLCheckoutUserInputError, - GQLCustomerDownloadableProduct, GQLCustomerDownloadableProducts, GQLEnteredOptionInput, GQLInvoice, GQLInvoiceItemInterface, GQLMoney, GQLOrderAddress, GQLOrderItemOption, GQLOrderPaymentMethod, GQLPaymentMethodAdditionalData + GQLCustomerDownloadableProduct, + GQLCustomerDownloadableProducts, + GQLEnteredOptionInput, + GQLInvoice, + GQLInvoiceItemInterface, + GQLMoney, + GQLOrderAddress, + GQLOrderItemOption, + GQLOrderPaymentMethod, + GQLPaymentMethodAdditionalData } from 'Type/Graphql.type'; import { CommonField, OrdersOptions } from './Query.type'; diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 9407fa0577..0dc43b399e 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -16,25 +16,35 @@ import { UrlRewrite } from 'Type/Router.type'; export type Attribute = { attribute_id?: number; - attribute_code?: string; + attribute_code: string; attribute_type?: string; - attribute_value?: string; - attribute_label?: string; - attribute_options?: Record; + attribute_value: string; + attribute_label: string; + attribute_options?: { + label: string; + value: string; + }[]; has_swatch?: boolean; is_boolean?: boolean; }; -export type Attributes = Attribute | Attribute[]; - export type AttributeOption = { label?: string; count?: number; value_string?: string; - swatch_data?: { - type?: string; - value?: string; - }; + swatch_data?: SwatchData; +}; + +export type SwatchData = { + type?: string; + value?: string; +}; + +export type ConfigurableAttribute = { + attribute_code: string; + attribute_values: { + value_index: number; + }[]; }; export type FilterAttribute = { @@ -98,24 +108,30 @@ export type ProductLinks = { }[]; export type ReviewSummaryShape = { - rating_summary: number; - review_count: number; + rating_summary?: number; + review_count?: number; }; export type RatingVote = { vote_id?: number; rating_code?: string; percent?: number; + value: number; }; -export type Reviews = { +export type Review = { review_id?: number; nickname?: string; title?: string; detail?: string; created_at?: string; rating_votes?: RatingVote[]; -}[]; + average_rating: number; +}; + +export type Reviews = { + items: Review[]; +}; export type DescriptionType = { html?: string; @@ -123,8 +139,8 @@ export type DescriptionType = { export type StockItem = { in_stock: boolean; - min_sale_qty?: number; - max_sale_qty?: number; + min_sale_qty: number; + max_sale_qty: number; qty_increments: number; }; @@ -202,15 +218,16 @@ export type FileOption = CustomizableOptionShape & { export type CustomizableOptions = FileOption | InputOption | CustomizableOption[]; export type ItemShape = ReviewSummaryShape & { - attributes: Attributes; - configurable_options: Attributes; + attributes: Attribute[]; + configurable_options: ConfigurableAttribute[]; id: number; image: Image; name: string; - options: CustomizableOption[]; + options: Option[]; price_range: PriceRange; price_tiers: PriceTier; review_summary: ReviewSummaryShape; + reviews: Reviews; short_description: DescriptionType; sku: string; small_image: Image; @@ -259,7 +276,7 @@ export type ItemOption = { finalOptionPriceExclTax: number; }; -export type ProductBundleItems = { +export type ProductBundleItem = { option_id?: number; options: ItemOption[]; position?: number; @@ -267,7 +284,7 @@ export type ProductBundleItems = { sku?: string; title?: string; type?: string; -}[]; +}; export type ProductGroupedItems = { position: number; @@ -275,7 +292,8 @@ export type ProductGroupedItems = { product: ItemShape; }[]; -export interface Product extends ItemShape{ +// Refactore to separate types +export interface Product extends ItemShape { canonical_url?: string; categories?: ProductCategories; description?: DescriptionType; @@ -287,19 +305,35 @@ export interface Product extends ItemShape{ special_price?: number; url_key?: string; quantity?: number; - reviews?: Reviews; variants?: ProductVariant[]; items?: unknown[]; downloadable_product_links?: ProductDownloadableLink[]; dynamic_price?: boolean; + bundle_options?: BundleOption[]; } export interface ProductGrouped extends Product { items: ProductGroupedItems; } +export type BundleOptionSelection = { + final_option_price?: number; + final_option_price_excl_tax?: number; + name?: string; + regular_option_price?: number; + regular_option_price_excl_tax?: number; + selection_id?: number; +}; + +export type BundleOption = { + option_id?: number; + price?: number; + qty?: number; + selection_details: BundleOptionSelection[]; + title?: string; +}; export interface ProductBundle extends Product { - items: ProductBundleItems; + items: ProductBundleItem[]; dynamic_price: boolean; } @@ -315,7 +349,9 @@ export type ProductDownloadableLink = { uid: string; }; -export type ProductVariant = ItemShape; +export type ProductVariant = { + product: ItemShape; +}; export type PriceConfiguration = { containsOptions?: boolean; @@ -341,13 +377,21 @@ export type ProductCardProps = { siblingsHaveConfigurableOptions?: boolean; }; -export type OptionsList = { +export type OptionTypes = { + checkboxValues?: Value[]; + dropdownValues?: Value[]; + fieldValues?: Value[]; + areaValues?: Value[]; + fileValues?: Value[]; +}; + +export type Option = OptionTypes & { value?: CustomizableOptions; title?: string; required?: boolean; sort_order?: number; type?: string; uid?: string; -}[]; +}; export type LinkedProducts = Record; diff --git a/packages/scandipwa/src/util/Form/Extract.ts b/packages/scandipwa/src/util/Form/Extract.ts index e74ad49d43..f8be32b9d4 100644 --- a/packages/scandipwa/src/util/Form/Extract.ts +++ b/packages/scandipwa/src/util/Form/Extract.ts @@ -173,6 +173,7 @@ export type DatesData = { hours?: string; minutes?: string; ampm: string; + name?: string; }; export type DateObject = { @@ -247,6 +248,13 @@ export const groupDateFieldsData = (fields: NodeListOf): Record); +export type FieldData = { + field: HTMLElement; + name: string; + type: string; + value: string | boolean | number; +}; + /** * Returns fields values from DOM/Form * @param DOM @@ -256,9 +264,14 @@ export const groupDateFieldsData = (fields: NodeListOf): Record { +export const getFieldsData = ( + DOM: Document, + excludeEmpty = false, + ignoreTypes: string[] = [], + asObject = false +): any => { const fields: NodeListOf = DOM.querySelectorAll('input, textarea, select'); - const output = []; + const output: Record[] = []; const dateFieldsGrouped = groupDateFieldsData(fields); output.push(...transformDateFieldsData(dateFieldsGrouped)); @@ -299,10 +312,10 @@ export const getFieldsData = (DOM: Document, excludeEmpty = false, ignoreTypes: }); if (asObject) { - const objectOutput: Record = {}; + const objectOutput: any = {}; output.forEach((field) => { - const { name } = field as DateObject; - objectOutput[name] = field as DateObject; + const { name } = field as any; + objectOutput[name] = field; }); return objectOutput; diff --git a/packages/scandipwa/src/util/FormPortalCollector/index.ts b/packages/scandipwa/src/util/FormPortalCollector/index.ts index 354d2e3311..6b4687e42e 100644 --- a/packages/scandipwa/src/util/FormPortalCollector/index.ts +++ b/packages/scandipwa/src/util/FormPortalCollector/index.ts @@ -35,7 +35,7 @@ export class FormPortalCollector < delete this.portalsObservers[id][name]; } - collect(id: S) { + collect(id: S): void[] { const portals = this.portalsObservers[id] || {}; return Object.values(portals).map((portal) => portal()); diff --git a/packages/scandipwa/src/util/Orders/Orders.ts b/packages/scandipwa/src/util/Orders/Orders.ts index 1716a48bcc..7d810052ac 100644 --- a/packages/scandipwa/src/util/Orders/Orders.ts +++ b/packages/scandipwa/src/util/Orders/Orders.ts @@ -65,9 +65,11 @@ export const getOrderItemQtyToArray = (product: OrderProduct): OrderProductQuant }; /** @namespace Util/Orders/getProductFromOrder */ -export const getProductFromOrder = (allProducts: OrderProducts, requiredProductSku: string) => allProducts - .find(({ product_sku }) => product_sku === requiredProductSku); +export const getProductFromOrder = ( + allProducts: OrderProducts, + requiredProductSku: string +): OrderProduct | undefined => allProducts.find(({ product_sku }) => product_sku === requiredProductSku); /** @namespace Util/Orders/getOrderItemRowDiscount */ -export const getOrderItemRowDiscount = (discounts: Discount[]) => discounts +export const getOrderItemRowDiscount = (discounts: Discount[]): number => discounts .reduce((currentValue, { amount: { value } }) => value + currentValue, 0); diff --git a/packages/scandipwa/src/util/Price/Price.ts b/packages/scandipwa/src/util/Price/Price.ts index 01555fa74a..24905e4381 100644 --- a/packages/scandipwa/src/util/Price/Price.ts +++ b/packages/scandipwa/src/util/Price/Price.ts @@ -54,7 +54,7 @@ export const calculateTierDiscountOverSpecialPrice = (spec: number, tier: number export const roundPrice = (price: number): string => price.toFixed(2); /** @namespace Util/Price/getLowestPriceTiersPrice */ -export const getLowestPriceTiersPrice = (price_tiers: PriceTier[], currency: string) => { +export const getLowestPriceTiersPrice = (price_tiers: PriceTier[], currency: string): string => { const lowestValue = price_tiers .reduce((acc, { final_price: { value } }) => (acc < value ? acc : value), price_tiers[0].final_price.value); diff --git a/packages/scandipwa/src/util/Product/Extract.ts b/packages/scandipwa/src/util/Product/Extract.ts index 97a6c8f041..cebdd9c37d 100644 --- a/packages/scandipwa/src/util/Product/Extract.ts +++ b/packages/scandipwa/src/util/Product/Extract.ts @@ -1,5 +1,6 @@ +// TODO remove eslint disable +/* eslint-disable no-magic-numbers */ /* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable spaced-comment */ /** * ScandiPWA - Progressive Web App for Magento * @@ -14,18 +15,20 @@ import { PRODUCT_TYPE } from 'Component/Product/Product.config'; import { STOCK_TYPE } from 'Component/Product/Stock.config'; import { ImageTypes } from 'Component/ProductGallery/ProductGallery.config'; -import { PriceRange } from 'Type/Price.type'; +import { PriceItem, PriceRange } from 'Type/Price.type'; import { ItemOption, + ItemShape, Product, ProductBundle, ProductDownloadable, ProductGrouped, - ProductVariant, StockItem } from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; +import { IndexedVariant } from './Product'; + export const DEFAULT_MIN_PRODUCTS = 1; export const DEFAULT_MAX_PRODUCTS = 999; @@ -44,11 +47,15 @@ export enum QtyFields { MAX_SALE_QTY = 'max_sale_qty' } +export type FormattedProduct = Omit & { + variants?: IndexedVariant[]; +}; + // TODO unify keyof product and stockitem. /** @namespace Util/Product/Extract/getFieldQty */ export const getFieldQty = ( - product: Product | ProductVariant, - field: keyof Product | keyof StockItem + product: IndexedVariant | FormattedProduct, + field: keyof FormattedProduct | keyof StockItem ): number | undefined => { if (field === QtyFields.MIN_SALE_QTY || field === QtyFields.MAX_SALE_QTY) { const { stock_item: { [field]: qty } = {} } = product; @@ -71,7 +78,7 @@ export const getFieldQty = ( * @namespace Util/Product/Extract/getQuantity */ export const getQuantity = ( - product: Product, + product: FormattedProduct, defaultValue: number, field: keyof Product | keyof StockItem, configIndex = -1 @@ -88,11 +95,11 @@ export const getQuantity = ( const { variants } = product; - if ((!configIndex && !variants) || configIndex === -1) { + if ((!configIndex && !variants) || configIndex === -1 || typeof variants === 'undefined') { return qty; } - const variantQty = getFieldQty(variants![configIndex], field); + const variantQty = getFieldQty(variants[configIndex], field); return variantQty || qty; }; @@ -104,7 +111,7 @@ export const getQuantity = ( * @returns {*} * @namespace Util/Product/Extract/getMinQuantity */ -export const getMinQuantity = (product: Product, configIndex = -1): number => ( +export const getMinQuantity = (product: FormattedProduct, configIndex = -1): number => ( getQuantity(product, DEFAULT_MIN_PRODUCTS, QtyFields.MIN_SALE_QTY, configIndex) ); @@ -115,9 +122,10 @@ export const getMinQuantity = (product: Product, configIndex = -1): number => ( * @returns {*} * @namespace Util/Product/Extract/getMaxQuantity */ -export const getMaxQuantity = (product: Product, configIndex = -1) => { +export const getMaxQuantity = (product: FormattedProduct, configIndex = -1): number => { const maxQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, MAX_SALE_QTY, configIndex); const salableQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, QtyFields.SALABLE_QTY, configIndex); + return Math.min(maxQuantity, salableQuantity); }; @@ -128,7 +136,7 @@ export const getMaxQuantity = (product: Product, configIndex = -1) => { * @returns {*} * @namespace Util/Product/Extract/getName */ -export const getName = (product: Product, configIndex = -1): string => { +export const getName = (product: FormattedProduct, configIndex = -1): string => { const { variants = [] } = product; const { @@ -138,6 +146,13 @@ export const getName = (product: Product, configIndex = -1): string => { return name; }; +/** @namespace Util/Product/Extract/getProductOptionInStock */ +export const getProductOptionInStock = (product: Product): boolean => { + const { stock_status: stockStatus } = product; + + return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && stockStatus === STOCK_TYPE.IN_STOCK; +}; + /** * Returns whether or not product is in stock (true if in stock | false if out of stock) * @param product @@ -145,7 +160,10 @@ export const getName = (product: Product, configIndex = -1): string => { * @returns {boolean} * @namespace Util/Product/Extract/getProductInStock */ -export const getProductInStock = (product: Product, parentProduct?: Product): boolean => { +export const getProductInStock = ( + product: FormattedProduct | IndexedVariant | ItemShape, + parentProduct?: FormattedProduct +): boolean => { if (!product) { return false; } @@ -161,14 +179,14 @@ export const getProductInStock = (product: Product, parentProduct?: Product): bo const { items = [] } = product as ProductBundle; const requiredItems = items.filter(({ required }) => required); const requiredItemsInStock = requiredItems.filter( - ({ options }) => options.some(({ product }) => getProductOptionInStock(product)) + ({ options }) => options.some(({ product: optionProduct }) => getProductOptionInStock(optionProduct)) ); return inStock && requiredItemsInStock.length === requiredItems.length; } if (type === PRODUCT_TYPE.configurable && parentProduct === product) { - const { variants = [] } = product as Product; + const { variants = [] } = product as FormattedProduct; return inStock && !!variants.some((variant) => getProductInStock(variant, product)); } @@ -189,7 +207,7 @@ export const getProductInStock = (product: Product, parentProduct?: Product): bo if (type === PRODUCT_TYPE.grouped) { const { items = [] } = product as ProductGrouped; - return inStock && !!items.some(({ product }) => getProductInStock(product)); + return inStock && !!items.some(({ product: groupedProduct }) => getProductInStock(groupedProduct)); } const { stock_status: stockStatus } = product; @@ -197,20 +215,15 @@ export const getProductInStock = (product: Product, parentProduct?: Product): bo return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && (inStock || stockStatus === STOCK_TYPE.IN_STOCK); }; -/** @namespace Util/Product/Extract/getProductOptionInStock */ -export const getProductOptionInStock = (product: Product): boolean => { - const { stock_status: stockStatus } = product; - - return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && stockStatus === STOCK_TYPE.IN_STOCK; -}; - /** * Checks if items in Grouped Product are in stock * @param product: productGroup * @param products: products in stock * @namespace Util/Product/Extract/getGroupedProductsInStockQuantity */ -export const getGroupedProductsInStockQuantity = ({ items = [] }: ProductGrouped): Record => items.reduce((acc, { +export const getGroupedProductsInStockQuantity = ( + { items = [] }: ProductGrouped +): Record => items.reduce((acc, { product, product: { id }, qty = 1 }) => (getProductInStock(product) ? { ...acc, [id]: qty } : acc), {}); @@ -249,6 +262,34 @@ export type AdjustedPrice = { export type AdjustedPrices = Record; +export type FormattedPriceConfiguration = { + containsOptions: boolean; + containsOptionsWithPrice: boolean; + containsRequiredOptions: boolean; + containsRequiredOptionsWithPrice: boolean; +}; + +export type FormattedPrice = { + price: { + finalPrice: PriceItem; + finalPriceExclTax: PriceItem; + originalPrice: PriceItem; + originalPriceExclTax: PriceItem; + discount: { + percentOff: number; + }; + }; + originalPrice: { + minRegularPrice: PriceItem; + minFinalPrice: PriceItem; + minFinalPriceExclTax: PriceItem; + maxRegularPrice: PriceItem; + maxFinalPrice: PriceItem; + maxFinalPriceExclTax: PriceItem; + }; + configuration: FormattedPriceConfiguration; +}; + /** * Returns price object for product. * @param priceRange @@ -265,7 +306,7 @@ export const getPrice = ( adjustedPrice: AdjustedPrices = {}, type = PRODUCT_TYPE.simple, options = [] -) => { +): FormattedPrice => { const priceAcc = type === PRODUCT_TYPE.bundle ? 'default_final_price' : 'regular_price'; @@ -317,10 +358,26 @@ export const getPrice = ( ? basePriceExclTax / discountValueRevert : basePriceExclTax; - const priceValue = { value: dynamicPrice ? 0 : basePriceExclDiscount * discountValue, currency, valueFormatted: '0' }; - const priceValueExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax * discountValue, currency, valueFormatted: '0' }; - const priceValueExclDiscount = { value: dynamicPrice ? 0 : basePriceExclDiscount, currency, valueFormatted: '0' }; - const priceValueExclDiscountExclTax = { value: dynamicPrice ? 0 : basePriceExclDiscountExclTax, currency, valueFormatted: '0' }; + const priceValue = { + value: dynamicPrice ? 0 : basePriceExclDiscount * discountValue, + currency, + valueFormatted: '0' + }; + const priceValueExclTax = { + value: dynamicPrice ? 0 : basePriceExclDiscountExclTax * discountValue, + currency, + valueFormatted: '0' + }; + const priceValueExclDiscount = { + value: dynamicPrice ? 0 : basePriceExclDiscount, + currency, + valueFormatted: '0' + }; + const priceValueExclDiscountExclTax = { + value: dynamicPrice ? 0 : basePriceExclDiscountExclTax, + currency, + valueFormatted: '0' + }; // Adds adjusted price Object.keys(adjustedPrice || {}).forEach((key) => { @@ -425,6 +482,26 @@ export type EnteredOption = { value: string; }; +export type FormattedAdjustedPrices = { + downloadable: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + hasDiscountCalculated: boolean; + }; + bundle: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + hasDiscountCalculated: boolean; + }; + config: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + }; +}; + /** * Generates adjusted price from entered product options * @@ -439,7 +516,7 @@ export const getAdjustedPrice = ( downloadableLinks: string[], enteredOptions: EnteredOption[], selectedOptions: string[] -) => { +): FormattedAdjustedPrices => { const { options = [], type_id: typeId @@ -465,7 +542,7 @@ export const getAdjustedPrice = ( } }; - //#region DOWNLOADABLE + // #region DOWNLOADABLE if (typeId === PRODUCT_TYPE.downloadable) { const { downloadable_product_links = [] } = product as ProductDownloadable; downloadableLinks.forEach((uid) => { @@ -478,16 +555,16 @@ export const getAdjustedPrice = ( } }); } - //#endregion + // #endregion - //#region BUNDLE + // #region BUNDLE if (typeId === PRODUCT_TYPE.bundle) { const { items = [], dynamic_price: dynamicPrice = false } = product as ProductBundle; selectedOptions.forEach((uid) => { - items.forEach(({ options = [] }) => { + items.forEach(({ options: sldOptions = [] }) => { const uidParts = atob(uid).split('/'); - const option = Array.isArray(options) && getBundleOption(uid, options); + const option = Array.isArray(options) && getBundleOption(uid, sldOptions); const quantity = +uidParts[uidParts.length - 1]; if (option) { @@ -523,9 +600,9 @@ export const getAdjustedPrice = ( }); }); } - //#endregion + // #endregion - //#region CONFIGURABLE + // #region CONFIGURABLE enteredOptions.forEach(({ uid }) => { const option = options.find(({ uid: linkUid }) => linkUid === uid); @@ -547,12 +624,12 @@ export const getAdjustedPrice = ( } }); }); - //#endregion + // #endregion return adjustedPrice; }; -//#region SubLabel +// #region SubLabel /** * Returns ProductCustomizable Text/TextArea Option Sublabel based on Maximum characters setup in BE * @param maxCharacters @@ -577,9 +654,9 @@ export const getSubLabelFromMaxCharacters = (maxCharacters: number, value = ''): return null; }; -//#endregion +// #endregion -//#region IMAGE +// #region IMAGE /** * Returns product image based on variable field, on fail placeholder * @param product @@ -611,4 +688,4 @@ export const getSmallImage = (product: Product): string => getImage(product, Ima * @namespace Util/Product/Extract/getBaseImage */ export const getBaseImage = (product: Product): string => getImage(product, ImageTypes.IMAGE_KEY); -//#endregion +// #endregion diff --git a/packages/scandipwa/src/util/Product/Product.js b/packages/scandipwa/src/util/Product/Product.ts similarity index 67% rename from packages/scandipwa/src/util/Product/Product.js rename to packages/scandipwa/src/util/Product/Product.ts index d317912e95..77f61346b9 100644 --- a/packages/scandipwa/src/util/Product/Product.js +++ b/packages/scandipwa/src/util/Product/Product.ts @@ -13,7 +13,28 @@ import { STOCK_TYPE } from 'Component/Product/Stock.config'; import { REVIEW_POPUP_ID } from 'Component/ProductReviews/ProductReviews.config'; import { showNotification } from 'Store/Notification/Notification.action'; import { showPopup } from 'Store/Popup/Popup.action'; +import { + Attribute, + AttributeOption, + BundleOption, + BundleOptionSelection, + ConfigurableAttribute, + ItemShape, + Option, + OptionTypes, + Product, + ProductBundle, + ProductBundleItem, + ProductVariant, + RatingVote, + Review, + Reviews, + StockItem, + SwatchData, + Value +} from 'Type/ProductList.type'; import { isSignedIn } from 'Util/Auth'; +import { FormattedProduct } from 'Util/Product/Extract'; import getStore from 'Util/Store'; export const ADD_TO_CART = 'ADD_TO_CART'; @@ -26,7 +47,10 @@ export const ADD_TO_WISHLIST = 'ADD_TO_WISHLIST'; * @returns {boolean} * @namespace Util/Product/checkEveryOption */ -export const checkEveryOption = (attributes, options) => Object.keys(options) +export const checkEveryOption = ( + attributes: Record, + options: Record +): boolean => Object.keys(options) .every((option) => { if (!attributes[option]) { return false; @@ -41,12 +65,17 @@ export const checkEveryOption = (attributes, options) => Object.keys(options) return options[option].includes(attribute_value); }); +// TODO move +export type IndexedOption = AttributeOption & { + swatch_data: SwatchData | null; +}; + /** @namespace Util/Product/getIndexedAttributeOption */ -export const getIndexedAttributeOption = (option) => { +export const getIndexedAttributeOption = (option: AttributeOption): AttributeOption | IndexedOption => { const { swatch_data: defaultSwatchData } = option; if (!defaultSwatchData) { - return option; + return option as AttributeOption; } const { type } = defaultSwatchData; @@ -55,11 +84,13 @@ export const getIndexedAttributeOption = (option) => { return { ...option, swatch_data - }; + } as IndexedOption; }; /** @namespace Util/Product/getIndexedAttributes */ -export const getIndexedAttributes = (attributes) => attributes.reduce((indexedAttributes, attribute) => { +export const getIndexedAttributes = ( + attributes: Attribute[] +): Record => attributes.reduce((indexedAttributes, attribute) => { const { attribute_code, attribute_options = [] } = attribute; return { @@ -78,8 +109,18 @@ export const getIndexedAttributes = (attributes) => attributes.reduce((indexedAt }; }, {}); +export type IndexedConfigurableOption = Attribute & { + attribute_values: string[]; + values: { + value_index: number; + }[]; +}; + /** @namespace Util/Product/getIndexedConfigurableOptions */ -export const getIndexedConfigurableOptions = (configurableOptions, indexedAttributes) => ( +export const getIndexedConfigurableOptions = ( + configurableOptions: ConfigurableAttribute[], + indexedAttributes: Record +): IndexedConfigurableOption => ( configurableOptions.reduce((indexedConfigurableOptions, configurableOption) => { const { values, attribute_code } = configurableOption; @@ -91,11 +132,17 @@ export const getIndexedConfigurableOptions = (configurableOptions, indexedAttrib attribute_values: values.map(({ value_index }) => `${ value_index }`) } }; - }, {}) + }, {} as IndexedConfigurableOption) ); +export type IndexedVariant = Omit & { + attributes: Record; +}; + /** @namespace Util/Product/getIndexedVariants */ -export const getIndexedVariants = (variants) => variants.map(({ product }) => { +export const getIndexedVariants = ( + variants: ProductVariant[] +): IndexedVariant[] => variants.map(({ product }) => { const { attributes } = product; return { @@ -105,7 +152,10 @@ export const getIndexedVariants = (variants) => variants.map(({ product }) => { }); /** @namespace Util/Product/getIndexedSingleVariant */ -export const getIndexedSingleVariant = (variants, itemSku) => { +export const getIndexedSingleVariant = ( + variants: ProductVariant[], + itemSku: string +): IndexedVariant[] => { const index = variants.findIndex(({ product: { sku } }) => sku === itemSku || itemSku.includes(sku)); if (index < 0) { @@ -121,7 +171,11 @@ export const getIndexedSingleVariant = (variants, itemSku) => { }; /** @namespace Util/Product/getVariantsIndexes */ -export const getVariantsIndexes = (variants, options, inStockOnly = false) => { +export const getVariantsIndexes = ( + variants: IndexedVariant[], + options: Record, + inStockOnly = false +): number[] | boolean => { const result = Object.entries(variants) .reduce((indexes, [index, variant]) => { if (checkEveryOption(variant.attributes, options)) { @@ -129,7 +183,7 @@ export const getVariantsIndexes = (variants, options, inStockOnly = false) => { } return indexes; - }, []); + }, [] as number[]); if (inStockOnly) { return result.filter((n) => variants[n].stock_status === STOCK_TYPE.IN_STOCK); @@ -146,14 +200,22 @@ export const getVariantsIndexes = (variants, options, inStockOnly = false) => { * @returns {number} * @namespace Util/Product/getVariantIndex */ -export const getVariantIndex = (variants, options, inStockOnly = false) => { +export const getVariantIndex = ( + variants: IndexedVariant[], + options: Record, + inStockOnly = false +): number => { const indexes = getVariantsIndexes(variants, options, inStockOnly); - return indexes.length ? indexes[0] : -1; + return indexes instanceof Array && indexes.length ? indexes[0] : -1; +}; + +export type IndexedCustomOption = Omit & { + value: Value[]; }; /** @namespace Util/Product/getIndexedCustomOption */ -export const getIndexedCustomOption = (option) => { +export const getIndexedCustomOption = (option: Option): any => { const { checkboxValues, dropdownValues, @@ -191,7 +253,7 @@ export const getIndexedCustomOption = (option) => { }; /** @namespace Util/Product/getIndexedCustomOptions */ -export const getIndexedCustomOptions = (options) => options.reduce( +export const getIndexedCustomOptions = (options: Option[]) => options.reduce( (acc, option) => { const indexedOption = getIndexedCustomOption(option); @@ -201,11 +263,11 @@ export const getIndexedCustomOptions = (options) => options.reduce( return acc; }, - [] + [] as IndexedCustomOption[] ); /** @namespace Util/Product/getIndexedReviews */ -export const getIndexedReviews = (reviews) => { +export const getIndexedReviews = (reviews: Reviews): Review[] | null => { if (!reviews) { return null; } @@ -214,13 +276,13 @@ export const getIndexedReviews = (reviews) => { const ONE_FIFTH_OF_A_HUNDRED = 20; return items.reduce((acc, review) => { - const { rating_votes = [], ...restOfReview } = review; + const { rating_votes = [], ...restOfReview } = review as Review; - const newRatingVotes = rating_votes.reduce((acc, vote) => { - const { rating_code, value } = vote; + const newRatingVotes = rating_votes.reduce((ratingVotesAcc, vote) => { + const { rating_code, value } = vote as RatingVote; return [ - ...acc, + ...ratingVotesAcc, { rating_code, value, @@ -228,7 +290,7 @@ export const getIndexedReviews = (reviews) => { percent: value * ONE_FIFTH_OF_A_HUNDRED } ]; - }, []); + }, [] as RatingVote[]); return [ ...acc, @@ -237,11 +299,11 @@ export const getIndexedReviews = (reviews) => { rating_votes: newRatingVotes } ]; - }, []); + }, [] as Review[]); }; /** @namespace Util/Product/getBundleId */ -export const getBundleId = (uid = '') => { +export const getBundleId = (uid = ''): number => { const arrayId = atob(uid).split('/'); if (Array.isArray(arrayId) && arrayId.length > 2) { @@ -251,9 +313,15 @@ export const getBundleId = (uid = '') => { return 0; }; +export type FormattedBundleOptions = Pick & BundleOptionSelection; + /** @namespace Util/Product/getBundleOptions */ -export const getBundleOptions = (options, items) => { - const bundleOptions = options.reduce((prev, next) => [...prev, ...next.selection_details], []); +export const getBundleOptions = (options: BundleOption[], items: ProductBundleItem[]) => { + const bundleOptions = options + .reduce( + // eslint-disable-next-line max-len + (prev, next) => [...prev, ...next.selection_details], [] as FormattedBundleOptions[] + ); return items.map((item) => ({ ...item, @@ -279,8 +347,12 @@ export const getBundleOptions = (options, items) => { })); }; +// TODO Works with all types /** @namespace Util/Product/getIndexedProduct */ -export const getIndexedProduct = (product, itemSku) => { +export const getIndexedProduct = ( + product: Product | ProductBundle, + itemSku?: string +) => { const { variants: initialVariants = [], configurable_options: initialConfigurableOptions = [], @@ -311,43 +383,57 @@ export const getIndexedProduct = (product, itemSku) => { }; if (bundle_options.length) { - updatedProduct.items = getBundleOptions(bundle_options, items); + updatedProduct.items = getBundleOptions(bundle_options, items as ProductBundleItem[]); } return updatedProduct; }; /** @namespace Util/Product/getIndexedProducts */ -export const getIndexedProducts = (products) => products.map((product) => getIndexedProduct(product)); +export const getIndexedProducts = ( + products: Product[] | ProductBundle[] +): any => products.map((product) => getIndexedProduct(product)); /** @namespace Util/Product/getIndexedParameteredProducts */ -export const getIndexedParameteredProducts = (products) => Object.entries(products) +export const getIndexedParameteredProducts = (products: Product[]) => Object.entries(products) + // eslint-disable-next-line @typescript-eslint/no-shadow .reduce((products, [id, product]) => ({ ...products, [id]: getIndexedProduct(product) }), {}); /** @namespace Util/Product/sortBySortOrder */ -export const sortBySortOrder = (options, sortKey = 'sort_order') => options.sort( - (a, b) => { - if (a[sortKey] < b[sortKey]) { - return -1; - } +export const sortBySortOrder = >( + options: T[], + sortKey: keyof T = 'sort_order' +): T[] => options.sort( + (a, b) => { + if (a[sortKey] < b[sortKey]) { + return -1; + } - if (a[sortKey] > b[sortKey]) { - return 1; - } + if (a[sortKey] > b[sortKey]) { + return 1; + } - return 0; - } -); + return 0; + } + ); /** @namespace Util/Product/getIsConfigurableParameterSelected */ -// eslint-disable-next-line max-len -export const getIsConfigurableParameterSelected = (parameters, key, value) => Object.hasOwnProperty.call(parameters, key) && parameters[key] === value; +export const getIsConfigurableParameterSelected = , U extends string, S>( + parameters: T, + key: U, + value: S +): boolean => Object.hasOwnProperty.call(parameters, key) && parameters[key] === value; /** @namespace Util/Product/getNewParameters */ -export const getNewParameters = (parameters, key, value = '') => { +// eslint-disable-next-line max-len +export const getNewParameters = , U extends string>( + parameters: T, + key: U, + value = '' +): Omit => { // If value is already selected, than we remove the key to achieve deselection if (getIsConfigurableParameterSelected(parameters, key, value)) { const { [key]: oldValue, ...newParameters } = parameters; @@ -362,7 +448,7 @@ export const getNewParameters = (parameters, key, value = '') => { }; /** @namespace Util/Product/showNewReviewPopup */ -export const showNewReviewPopup = () => { +export const showNewReviewPopup = (): void => { const store = getStore(); const { ConfigReducer: { @@ -381,25 +467,8 @@ export const showNewReviewPopup = () => { dispatch(showPopup(REVIEW_POPUP_ID, { title: __('Write a review') })); }; -/** @namespace Util/Product/sortAlphabetically */ -export const sortAlphabetically = (options, key, caseSensitive = false) => options - .sort((a, b) => { - const textA = caseSensitive ? a[key] : a[key].toUpperCase(); - const textB = caseSensitive ? b[key] : b[key].toUpperCase(); - - if (textA < textB) { - return -1; - } - - if (textA > textB) { - return 1; - } - - return 0; - }); - /** @namespace Util/Product/getBooleanLabel */ -export const getBooleanLabel = (label, isBoolean = false) => { +export const getBooleanLabel = (label: string, isBoolean = false): string => { if (!isBoolean) { return label; } @@ -407,8 +476,15 @@ export const getBooleanLabel = (label, isBoolean = false) => { return +label ? __('Yes') : __('No'); }; +export type FormattedConfigurableOption = Attribute & { + attribute_values: string[]; +}; + /** @namespace Util/Product/filterConfigurableOptions */ -export const filterConfigurableOptions = (options, variants) => Object.values(options) +export const filterConfigurableOptions = ( + options: FormattedConfigurableOption[], + variants: IndexedVariant[] +): Record => Object.values(options) .reduce((acc, option) => { const { attribute_values, @@ -428,7 +504,7 @@ export const filterConfigurableOptions = (options, variants) => Object.values(op } return acc; - }, []); + }, [] as string[]); return { ...acc, @@ -437,10 +513,10 @@ export const filterConfigurableOptions = (options, variants) => Object.values(op attribute_values: filteredOptions } }; - }, {}); + }, {} as Record); /** @namespace Util/Product/validateProductQuantity */ -export const validateProductQuantity = (quantity, stockItem) => { +export const validateProductQuantity = (quantity: number, stockItem: StockItem): Array => { const { min_sale_qty = 1, max_sale_qty, qty_increments = 1 } = stockItem; if (quantity < min_sale_qty) { @@ -458,23 +534,21 @@ export const validateProductQuantity = (quantity, stockItem) => { return [true]; }; +export type IndexedProduct = Omit & { + attributes: Record; +}; + /** @namespace Util/Product/getAttributesWithValues */ -export const getAttributesWithValues = (product) => { - const { attributes = {}, parameters = {} } = product; +export const getAttributesWithValues = (product: IndexedProduct): Record => { + const { attributes = {} } = product; - return Object.entries(attributes).reduce((acc, [key, val]) => { + return Object.entries(attributes).reduce((acc, [, val]) => { const { attribute_label, attribute_value } = val; if (attribute_value) { return { ...acc, [attribute_label]: val }; } - const valueIndexFromParameter = parameters[key]; - - if (valueIndexFromParameter) { - return { ...acc, [attribute_label]: { ...val, attribute_value: valueIndexFromParameter } }; - } - return acc; - }, {}); + }, {} as Record); }; diff --git a/packages/scandipwa/src/util/Product/Transform.ts b/packages/scandipwa/src/util/Product/Transform.ts index 2d049909e4..04d6771a98 100644 --- a/packages/scandipwa/src/util/Product/Transform.ts +++ b/packages/scandipwa/src/util/Product/Transform.ts @@ -18,7 +18,7 @@ import { } from 'Type/ProductList.type'; import { formatPrice } from 'Util/Price'; -import { EnteredOption, getProductInStock } from './Extract'; +import { EnteredOption, FormattedProduct, getProductInStock } from './Extract'; import { ADD_TO_CART } from './Product'; export const PRICE_TYPE_PERCENT = 'PERCENT'; @@ -224,7 +224,7 @@ export const bundleOptionsToSelectTransform = ( is_default } = option; - const isAvailable = getProductInStock(product); + const isAvailable = getProductInStock(product as FormattedProduct); const { priceLabel, @@ -381,8 +381,10 @@ export const magentoProductTransform = ( * @namespace Util/Product/Transform/nonRequiredRadioOptions */ export const nonRequiredRadioOptions = ( - options: ItemOption[], isRequired = false, type: string = FIELD_TYPE.radio -) => { + options: ItemOption[], + isRequired = false, + type: string = FIELD_TYPE.radio +): any => { if (isRequired || type !== FIELD_TYPE.radio) { return options; } diff --git a/packages/scandipwa/src/util/Promise/MakeCancelable.ts b/packages/scandipwa/src/util/Promise/MakeCancelable.ts index 0bca96b52b..572b411764 100644 --- a/packages/scandipwa/src/util/Promise/MakeCancelable.ts +++ b/packages/scandipwa/src/util/Promise/MakeCancelable.ts @@ -20,21 +20,21 @@ * @namespace Util/Promise/MakeCancelable/makeCancelable */ export const makeCancelable = (promise: Promise) => { // eslint-disable-next-line fp/no-let - let hasCanceled_ = false; + let hasCanceled = false; const wrappedPromise: Promise = new Promise((resolve, reject) => { promise.then( /** @namespace Util/Promise/MakeCancelable/makeCancelable/wrappedPromise/promise/then */ - (val) => (!hasCanceled_ && resolve(val)), + (val) => (!hasCanceled && resolve(val)), /** @namespace Util/Promise/MakeCancelable/makeCancelable/wrappedPromise/promise/then/catch */ - (error) => (!hasCanceled_ && reject(error)) + (error) => (!hasCanceled && reject(error)) ); }); return { promise: wrappedPromise, cancel() { - hasCanceled_ = true; + hasCanceled = true; } }; }; diff --git a/packages/scandipwa/src/util/Request/Mutation.ts b/packages/scandipwa/src/util/Request/Mutation.ts index 02ed3dc456..4ea044f4d5 100644 --- a/packages/scandipwa/src/util/Request/Mutation.ts +++ b/packages/scandipwa/src/util/Request/Mutation.ts @@ -15,7 +15,7 @@ import { executePost } from 'Util/Request/Request'; // TODO Field or ?? /** @namespace Util/Request/Mutation/fetchMutation */ // eslint-disable-next-line import/prefer-default-export -export const fetchMutation = (rawMutations: Field) => { +export const fetchMutation = (rawMutations: Field): Promise => { const queries = rawMutations instanceof Field ? [rawMutations] : rawMutations; return executePost(prepareMutation(queries)); diff --git a/packages/scandipwa/src/util/Request/Query.ts b/packages/scandipwa/src/util/Request/Query.ts index a9d4c0ef2e..d2524fab0f 100644 --- a/packages/scandipwa/src/util/Request/Query.ts +++ b/packages/scandipwa/src/util/Request/Query.ts @@ -15,7 +15,7 @@ import { executePost } from 'Util/Request/Request'; // TODO Field or ?? /** @namespace Util/Request/Query/fetchQuery */ // eslint-disable-next-line import/prefer-default-export -export const fetchQuery = (rawQueries: Field) => { +export const fetchQuery = (rawQueries: Field): Promise => { const queries = rawQueries instanceof Field ? [rawQueries] : rawQueries; return executePost(prepareQuery(queries)); diff --git a/packages/scandipwa/src/util/Request/Request.ts b/packages/scandipwa/src/util/Request/Request.ts index 2b3fcdc913..6a1cca3497 100644 --- a/packages/scandipwa/src/util/Request/Request.ts +++ b/packages/scandipwa/src/util/Request/Request.ts @@ -297,9 +297,8 @@ export const debounce = (callback: () => void, delay: number) => { let timeout: NodeJS.Timeout; return (...args: T[]) => { - const context = this; clearTimeout(timeout); - timeout = setTimeout(() => callback.apply(context, args as any), delay); + timeout = setTimeout(() => callback.apply(this, args as any), delay); }; }; @@ -314,9 +313,8 @@ export class Debouncer < handler = () => {}; startDebounce = (callback:T, delay: U) => (...args: S[]) => { - const context = this; clearTimeout(this.timeout); - this.handler = () => callback.apply(context, args as any); + this.handler = () => callback.apply(this, args as any); this.timeout = setTimeout(this.handler, delay); }; diff --git a/packages/scandipwa/src/util/Url/Url.ts b/packages/scandipwa/src/util/Url/Url.ts index 846e747e96..b2255e56cf 100644 --- a/packages/scandipwa/src/util/Url/Url.ts +++ b/packages/scandipwa/src/util/Url/Url.ts @@ -14,7 +14,7 @@ import { decodeString } from 'Util/Common'; import getStore from 'Util/Store'; // TODO move -export type KeyValuePairs = Record; +export type KeyValuePairs = Record>; export type KeyValuePairsArray = Record; @@ -156,7 +156,7 @@ export const convertQueryStringToKeyValuePairs = (queryString: string): KeyValue export const updateKeyValuePairs = ( keyValuePairs: KeyValuePairs, currentKey: string, - currentValue: string | number + currentValue: string | number | Array ): KeyValuePairs => { const updatedKeyValuePairs: KeyValuePairs = {}; @@ -180,7 +180,7 @@ export const updateKeyValuePairs = ( * @namespace Util/Url/convertKeyValuesToQueryString */ export const convertKeyValuesToQueryString = ( - keyValuePairs: KeyValuePairsArray + keyValuePairs: KeyValuePairs ): string => Object.entries(keyValuePairs) .map((pair) => { const [key, value] = pair; diff --git a/packages/scandipwa/src/util/Wishlist/Wishlist.ts b/packages/scandipwa/src/util/Wishlist/Wishlist.ts index c52165cdc2..dca09173fd 100644 --- a/packages/scandipwa/src/util/Wishlist/Wishlist.ts +++ b/packages/scandipwa/src/util/Wishlist/Wishlist.ts @@ -17,7 +17,11 @@ import { Product } from 'Type/ProductList.type'; * @param {Object} product * @namespace Util/Wishlist/getPriceRange */ -export const getPriceRange = (product: Product, price: number, priceWithoutTax: number): PriceRange | {} => { +export const getPriceRange = ( + product: Product, + price: number, + priceWithoutTax: number +): PriceRange | Record => { if (!price) { return {}; } From 054af64a91e33f3f2799b05283aef577c26596c1 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Thu, 7 Apr 2022 06:02:42 +0300 Subject: [PATCH 017/192] Migrated queries to opus --- packages/scandipwa/package.json | 3 +- packages/scandipwa/src/query/Cart.query.ts | 32 +- packages/scandipwa/src/query/Config.query.ts | 26 +- packages/scandipwa/src/query/Order.query.ts | 156 +++---- .../scandipwa/src/query/ProductList.query.ts | 380 +++++++++++------- packages/scandipwa/src/query/Query.type.ts | 6 +- .../opus/src/builder/AbstractField.ts | 2 +- yarn.lock | 133 +++--- 8 files changed, 443 insertions(+), 295 deletions(-) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index 175573d6bc..c4ca98d04e 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -537,7 +537,8 @@ "requireLast": false } } - ] + ], + "@typescript-eslint/space-before-blocks": "off" } }, "license": "OSL-3.0", diff --git a/packages/scandipwa/src/query/Cart.query.ts b/packages/scandipwa/src/query/Cart.query.ts index 88b9195eb6..2d576d4645 100644 --- a/packages/scandipwa/src/query/Cart.query.ts +++ b/packages/scandipwa/src/query/Cart.query.ts @@ -92,7 +92,9 @@ export class CartQuery { .addField('id'); } - getRemoveCartItemMutation(item_id: number, quoteId: string): Mutation<'removeCartItem', GQLQuery> { + getRemoveCartItemMutation(item_id: number, quoteId: string): Mutation<'removeCartItem', GQLQuery & { + cartData: GQLQuoteData; + }> { const mutation = new Mutation<'removeCartItem', GQLQuery>('removeCartItem') .addArgument('item_id', 'Int!', item_id) .addFieldList(this._getRemoveCartItemFields(quoteId)); @@ -104,10 +106,12 @@ export class CartQuery { return mutation; } - getApplyCouponMutation(couponCode: string, quoteId: string): Mutation<'applyCoupon', GQLQuery> { + getApplyCouponMutation(couponCode: string, quoteId: string): Mutation<'applyCoupon', GQLQuery & { + cartData: GQLQuoteData; + }> { const mutation = new Mutation<'applyCoupon', GQLQuery>('applyCoupon') .addArgument('coupon_code', 'String!', couponCode) - .addField(this.getCartQuery(quoteId)); + .addField(this._getCartQueryField(quoteId)); if (!isSignedIn()) { mutation.addArgument('guestCartId', 'String', quoteId); @@ -116,9 +120,11 @@ export class CartQuery { return mutation; } - getRemoveCouponMutation(quoteId: string): Mutation<'removeCoupon', GQLQuery> { + getRemoveCouponMutation(quoteId: string): Mutation<'removeCoupon', GQLQuery & { + cartData: GQLQuoteData; + }> { const mutation = new Mutation<'removeCoupon', GQLQuery>('removeCoupon') - .addField(this.getCartQuery(quoteId)); + .addField(this._getCartQueryField(quoteId)); if (!isSignedIn()) { mutation.addArgument('guestCartId', 'String', quoteId); @@ -146,12 +152,24 @@ export class CartQuery { ]; } - _getRemoveCartItemFields(quoteId: string): Query<'cartData', GQLQuoteData, false>[] { + _getRemoveCartItemFields(quoteId: string): Field<'cartData', GQLQuoteData, false>[] { return [ - this.getCartQuery(quoteId) + this._getCartQueryField(quoteId) ]; } + _getCartQueryField(quoteId: string): Field<'cartData', GQLQuoteData> { + const query = new Field<'getCartForCustomer', GQLQuoteData>('getCartForCustomer') + .addFieldList(this._getCartTotalsFields()) + .setAlias('cartData'); + + if (!isSignedIn()) { + query.addArgument('guestCartId', 'String', quoteId); + } + + return query; + } + _getCartTotalsFields(): CommonField[] { return [ 'id', diff --git a/packages/scandipwa/src/query/Config.query.ts b/packages/scandipwa/src/query/Config.query.ts index df1a2737ff..85ac5cdf6d 100644 --- a/packages/scandipwa/src/query/Config.query.ts +++ b/packages/scandipwa/src/query/Config.query.ts @@ -31,8 +31,8 @@ export class ConfigQuery { .addFieldList(this._getCheckoutAgreementFields()); } - getCurrencyField(): Query<'available_currencies_data', { id: string; label: string; value: string }, true> { - return new Query<'available_currencies_data', GQLCurrency, true>('available_currencies_data', true) + getCurrencyField(): Field<'available_currencies_data', { id: string; label: string; value: string }, true> { + return new Field<'available_currencies_data', GQLCurrency, true>('available_currencies_data', true) .addFieldList([ 'id', 'label', @@ -40,7 +40,10 @@ export class ConfigQuery { ]); } - getCurrencyData(): Query<'currencyData', GQLCurrencyConfig> { + getCurrencyData(): Query<'currencyData', GQLCurrencyConfig & { + available_currencies_data: GQLCurrency[]; + current_currency_code: string; + }> { return new Query<'currencyData', GQLCurrencyConfig>('currencyData') .addFieldList([ this.getCurrencyField(), @@ -59,11 +62,24 @@ export class ConfigQuery { ]); } - getSaveSelectedCurrencyMutation(newCurrency: string): Mutation<'saveSelectedCurrency', GQLQuery> { + getSaveSelectedCurrencyMutation(newCurrency: string): Mutation<'saveSelectedCurrency', GQLQuery & { + currencyData: GQLCurrencyConfig; + }> { return new Mutation<'saveSelectedCurrency', GQLQuery>('saveSelectedCurrency') .addArgument('currency', 'String', newCurrency) .addFieldList([ - this.getCurrencyData() + this._getCurrencyDataField() + ]); + } + + _getCurrencyDataField(): Field<'currencyData', GQLCurrencyConfig & { + available_currencies_data: GQLCurrency[]; + current_currency_code: string; + }> { + return new Field<'currencyData', GQLCurrencyConfig>('currencyData') + .addFieldList([ + this.getCurrencyField(), + 'current_currency_code' ]); } diff --git a/packages/scandipwa/src/query/Order.query.ts b/packages/scandipwa/src/query/Order.query.ts index 67c5cca2f7..e52c027811 100644 --- a/packages/scandipwa/src/query/Order.query.ts +++ b/packages/scandipwa/src/query/Order.query.ts @@ -14,7 +14,31 @@ import { Field, Query } from '@tilework/opus'; import { GQLBundleOption, GQLCheckoutUserInputError, - GQLCustomerDownloadableProduct, GQLCustomerDownloadableProducts, GQLEnteredOptionInput, GQLInvoice, GQLInvoiceItemInterface, GQLMoney, GQLOrderAddress, GQLOrderItemOption, GQLOrderPaymentMethod, GQLPaymentMethodAdditionalData + GQLCreditMemo, + GQLCreditMemoItemInterface, + GQLCustomer, + GQLCustomerDownloadableProduct, + GQLCustomerDownloadableProducts, + GQLCustomerOrders, + GQLDiscount, + GQLEnteredOptionInput, + GQLInvoice, + GQLInvoiceItemInterface, + GQLMoney, + GQLOrderAddress, + GQLOrderItemInterface, + GQLOrderItemOption, + GQLOrderPaymentMethod, + GQLOrderShipment, + GQLOrderTotal, + GQLPaymentMethodAdditionalData, + GQLReorderItemsOutput, + GQLSalesCommentItem, + GQLSearchResultPageInfo, + GQLShipmentItemInterface, + GQLShipmentTracking, + GQLShippingHandling, + GQLTaxItem } from 'Type/Graphql.type'; import { CommonField, OrdersOptions } from './Query.type'; @@ -24,26 +48,30 @@ import { CommonField, OrdersOptions } from './Query.type'; * @class OrderQuery * @namespace Query/Order/Query */ export class OrderQuery { - getReorder(incrementId: string) { - return new Field('reorderItems') + getReorder(incrementId: string): Query<'reorderItems', GQLReorderItemsOutput & { + userInputErrors: GQLCheckoutUserInputError[]; + }> { + return new Query<'reorderItems', GQLReorderItemsOutput>('reorderItems') .addArgument('orderNumber', 'String!', incrementId) .addField(this._getReorderField()); } - getOrderListQuery(options: OrdersOptions) { - return new Field('customer') + getOrderListQuery(options: OrdersOptions): Query<'customer', GQLCustomer & { + orders: GQLCustomerOrders; + }> { + return new Query<'customer', GQLCustomer>('customer') .addFieldList(this._getOrderListFields(options)); } - _getOrderListFields(options: OrdersOptions) { + _getOrderListFields(options: OrdersOptions): Field<'orders', GQLCustomerOrders, false>[] { return [ this._getOrdersField(options) ]; } - _getOrdersField(options: OrdersOptions) { + _getOrdersField(options: OrdersOptions): Field<'orders', GQLCustomerOrders> { const { orderId, page = 1 } = options || {}; - const ordersField = new Field('orders'); + const ordersField = new Field<'orders', GQLCustomerOrders>('orders'); if (orderId) { return ordersField @@ -64,8 +92,8 @@ export class OrderQuery { ]; } - _getSearchResultPageInfoField() { - return new Field('page_info') + _getSearchResultPageInfoField(): Field<'page_info', GQLSearchResultPageInfo> { + return new Field<'page_info', GQLSearchResultPageInfo>('page_info') .addFieldList(this._getSearchResultPageInfoFields()); } @@ -77,8 +105,8 @@ export class OrderQuery { ]; } - _getOrderItemsField(isSingleOrder: boolean) { - return new Field('items') + _getOrderItemsField(isSingleOrder: boolean): Field<'items', GQLOrderItemInterface, true> { + return new Field<'items', GQLOrderItemInterface, true>('items', true) .addFieldList(this._getOrderItemsFields(isSingleOrder)); } @@ -115,8 +143,8 @@ export class OrderQuery { ]; } - _getOrderCommentsField() { - return new Field('comments') + _getOrderCommentsField(): Field<'comments', GQLSalesCommentItem, true> { + return new Field<'comments', GQLSalesCommentItem, true>('comments', true) .addFieldList(this._getOrderCommentsFields()); } @@ -127,12 +155,12 @@ export class OrderQuery { ]; } - _getOrderItemTotalField() { - return new Field('total') + _getOrderItemTotalField(): Field<'total', GQLOrderTotal> { + return new Field<'total', GQLOrderTotal>('total') .addFieldList(this._getOrderItemTotalFields()); } - _getOrderItemTotalFields() { + _getOrderItemTotalFields(): CommonField[] { return [ this._getOrderGrandTotalField(), this._getOrderDiscountsField(), @@ -145,8 +173,8 @@ export class OrderQuery { ]; } - _getOrderTaxesField() { - return new Field('taxes') + _getOrderTaxesField(): Field<'taxes', GQLTaxItem, true> { + return new Field<'taxes', GQLTaxItem, true>('taxes', true) .addFieldList(this._getOrderTaxesFields()); } @@ -158,12 +186,12 @@ export class OrderQuery { ]; } - _getOrderShippingHandlingField() { - return new Field('shipping_handling') + _getOrderShippingHandlingField(): Field<'shipping_handling', GQLShippingHandling> { + return new Field<'shipping_handling', GQLShippingHandling>('shipping_handling') .addFieldList(this._getOrderShippingHandlingFields()); } - _getOrderShippingHandlingFields() { + _getOrderShippingHandlingFields(): CommonField[] { return [ this._getOrderShippingAmountExclTaxField(), this._getOrderShippingAmountInclTaxField(), @@ -173,54 +201,54 @@ export class OrderQuery { ]; } - _getOrderShippingDiscountsField() { - return new Field('discounts') + _getOrderShippingDiscountsField(): Field<'discounts', GQLDiscount, true> { + return new Field<'discounts', GQLDiscount, true>('discounts', true) .addFieldList(this._getOrderShippingDiscountsFields()); } - _getOrderShippingDiscountsFields() { + _getOrderShippingDiscountsFields(): Field<'amount', GQLMoney, false>[] { return [ this._getOrderAmountField() ]; } - _getOrderShippingAmountExclTaxField() { - return new Field('amount_excluding_tax') + _getOrderShippingAmountExclTaxField(): Field<'amount_excluding_tax', GQLMoney> { + return new Field<'amount_excluding_tax', GQLMoney>('amount_excluding_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingAmountInclTaxField() { - return new Field('amount_including_tax') + _getOrderShippingAmountInclTaxField(): Field<'amount_including_tax', GQLMoney> { + return new Field<'amount_including_tax', GQLMoney>('amount_including_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderShippingHandlingTotalField() { - return new Field('total_amount') + _getOrderShippingHandlingTotalField(): Field<'total_amount', GQLMoney> { + return new Field<'total_amount', GQLMoney>('total_amount') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalTaxField() { - return new Field('total_tax') + _getOrderTotalTaxField(): Field<'total_tax', GQLMoney> { + return new Field<'total_tax', GQLMoney>('total_tax') .addFieldList(this._getOrderPriceFields()); } - _getOrderTotalShippingField() { - return new Field('total_shipping') + _getOrderTotalShippingField(): Field<'total_shipping', GQLMoney> { + return new Field<'total_shipping', GQLMoney>('total_shipping') .addFieldList(this._getOrderPriceFields()); } - _getOrderBaseGrantTotalField() { - return new Field('base_grand_total') + _getOrderBaseGrantTotalField(): Field<'base_grand_total', GQLMoney> { + return new Field<'base_grand_total', GQLMoney>('base_grand_total') .addFieldList(this._getOrderPriceFields()); } - _getOrderSubtotalField() { - return new Field('subtotal') + _getOrderSubtotalField(): Field<'subtotal', GQLMoney> { + return new Field<'subtotal', GQLMoney>('subtotal') .addFieldList(this._getOrderPriceFields()); } - _getOrderGrandTotalField() { - return new Field('grand_total') + _getOrderGrandTotalField(): Field<'grand_total', GQLMoney> { + return new Field<'grand_total', GQLMoney>('grand_total') .addFieldList(this._getOrderPriceFields()); } @@ -231,8 +259,8 @@ export class OrderQuery { ]; } - _getOrderShipmentsField() { - return new Field('shipments') + _getOrderShipmentsField(): Field<'shipments', GQLOrderShipment, true> { + return new Field<'shipments', GQLOrderShipment, true>('shipments', true) .addFieldList(this._getOrderShipmentsFields()); } @@ -246,8 +274,8 @@ export class OrderQuery { ]; } - _getShipmentsItemsProductsField() { - return new Field('items') + _getShipmentsItemsProductsField(): Field<'items', GQLShipmentItemInterface, true> { + return new Field<'items', GQLShipmentItemInterface, true>('items', true) .addFieldList(this._getShipmentsItemsProductsFields()); } @@ -258,8 +286,8 @@ export class OrderQuery { ]; } - _getOrderShipmentTrackingField() { - return new Field('tracking') + _getOrderShipmentTrackingField(): Field<'tracking', GQLShipmentTracking, true> { + return new Field<'tracking', GQLShipmentTracking, true>('tracking', true) .addFieldList(this._getOrderShipmentTrackingFields()); } @@ -271,8 +299,8 @@ export class OrderQuery { ]; } - _getOrderRefundsField() { - return new Field('credit_memos') + _getOrderRefundsField(): Field<'credit_memos', GQLCreditMemo, true> { + return new Field<'credit_memos', GQLCreditMemo, true>('credit_memos', true) .addFieldList(this._getOrderRefundsFields()); } @@ -286,8 +314,8 @@ export class OrderQuery { ]; } - _getOrderDiscountsField() { - return new Field('discounts') + _getOrderDiscountsField(): Field<'discounts', GQLDiscount, true> { + return new Field<'discounts', GQLDiscount, true>('discounts', true) .addFieldList(this._getOrderDiscountsFields()); } @@ -298,13 +326,13 @@ export class OrderQuery { ]; } - _getOrderAmountField() { - return new Field('amount') + _getOrderAmountField(): Field<'amount', GQLMoney> { + return new Field<'amount', GQLMoney>('amount') .addFieldList(this._getOrderPriceFields()); } - _getRefundsItemsProductsField() { - return new Field('items') + _getRefundsItemsProductsField(): Field<'items', GQLCreditMemoItemInterface, true> { + return new Field<'items', GQLCreditMemoItemInterface, true>('items', true) .addFieldList(this._getRefundsItemsProductsFields()); } @@ -318,8 +346,8 @@ export class OrderQuery { ]; } - _getRefundsItemInformationField() { - return new Field('order_item') + _getRefundsItemInformationField(): Field<'order_item', GQLOrderItemInterface> { + return new Field<'order_item', GQLOrderItemInterface>('order_item') .addFieldList(this._getOrderItemProductsFields()); } @@ -351,8 +379,8 @@ export class OrderQuery { ]; } - _getOrderItemsProductsField() { - return new Field('items') + _getOrderItemsProductsField(): Field<'items', GQLOrderItemInterface, true> { + return new Field<'items', GQLOrderItemInterface, true>('items', true) .addFieldList(this._getOrderItemProductsFields()); } @@ -506,21 +534,11 @@ export class OrderQuery { .addField(this._getDownloadableField()); } - getOrderByIdQuery(orderId: number) { - return this._getOrderByIdField(orderId); - } - linkOrderMutation(customerEmail: string): Field<'linkOrder', boolean> { return new Field<'linkOrder', boolean>('linkOrder') .addArgument('customer_email', 'String!', customerEmail); } - _getOrderByIdField(orderId: number) { - return new Field('Customer') - .addArgument('id', 'Int!', orderId) - .addFieldList(this._getOrderItemsFields(false)); - } - _getDownloadableField(): Field<'items', GQLCustomerDownloadableProduct, true> { return new Field<'items', GQLCustomerDownloadableProduct, true>('items', true) .addFieldList(this._getDownloadableFields()); diff --git a/packages/scandipwa/src/query/ProductList.query.ts b/packages/scandipwa/src/query/ProductList.query.ts index ec3d914848..ec88086b44 100644 --- a/packages/scandipwa/src/query/ProductList.query.ts +++ b/packages/scandipwa/src/query/ProductList.query.ts @@ -15,15 +15,36 @@ import { SORT_DIRECTION_TYPE } from 'Route/CategoryPage/CategoryPage.config'; import { NONE_SORT_OPTION_VALUE } from 'Route/SearchPage/SearchPage.config'; import { CUSTOMER } from 'Store/MyAccount/MyAccount.dispatcher'; import { + GQLAggregation, + GQLAggregationOption, + GQLAttributeOption, + GQLAttributeWithValue, + GQLBreadcrumb, + GQLBundleItem, + GQLBundleItemOption, + GQLBundleProduct, + GQLCategoryInterface, + GQLComplexTextValue, GQLConfigurableProduct, + GQLConfigurableProductOption, + GQLConfigurableProductOptions, + GQLConfigurableProductOptionsValues, GQLConfigurableVariant, + GQLCurrencyEnum, GQLCustomizableAreaOption, GQLCustomizableCheckboxOption, + GQLCustomizableCheckboxValue, GQLCustomizableDateOption, + GQLCustomizableDateValue, GQLCustomizableDropDownOption, + GQLCustomizableDropDownValue, GQLCustomizableFieldOption, + GQLCustomizableFieldValue, GQLCustomizableFileOption, + GQLCustomizableFileValue, GQLCustomizableMultipleOption, + GQLCustomizableMultipleValue, + GQLCustomizableOptionInterface, GQLCustomizableProductInterface, GQLCustomizableRadioOption, GQLDownloadableProduct, @@ -31,13 +52,33 @@ import { GQLDownloadableProductSamples, GQLGroupedProduct, GQLGroupedProductItem, + GQLMediaGalleryEntry, + GQLMoney, + GQLOptimizedProductImage, + GQLPriceRange, + GQLPriceTypeEnum, + GQLProductDiscount, GQLProductInterface, + GQLProductLinksInterface, + GQLProductMediaGalleryEntriesVideoContent, + GQLProductPrice, + GQLProductReview, + GQLProductReviewRating, + GQLProductReviews, GQLProducts, - GQLSearchResultPageInfo + GQLProductStockItem, + GQLSearchResultPageInfo, + GQLSimpleProduct, + GQLSortField, + GQLSortFields, + GQLSwatchData, + GQLTierPrice, + GQLUrlRewrite, + GQLVirtualProduct } from 'Type/Graphql.type'; import BrowserDatabase from 'Util/BrowserDatabase'; -import { CommonField, CommonFragment, ProductListOptions } from './Query.type'; +import { CommonField, ProductListOptions } from './Query.type'; /** * Product List Query @@ -260,7 +301,7 @@ export class ProductListQuery { ]; } - _getCartProductInterfaceFields(): Array { + _getCartProductInterfaceFields(): CommonField[] { return [ 'uid', 'id', @@ -278,7 +319,10 @@ export class ProductListQuery { ]; } - _getCartConfigurableProductFragment(): InlineFragment<'ConfigurableProduct', GQLConfigurableProduct> { + _getCartConfigurableProductFragment(): InlineFragment<'ConfigurableProduct', GQLConfigurableProduct & { + configurable_options: GQLConfigurableProductOptions[]; + variants: GQLConfigurableVariant[]; + }> { return new InlineFragment<'ConfigurableProduct', GQLConfigurableProduct>('ConfigurableProduct') .addFieldList([ this._getConfigurableOptionsField(), @@ -299,22 +343,26 @@ export class ProductListQuery { _getCartProductField(): Field<'product', GQLProductInterface> { return new Field<'product', GQLProductInterface>('product') - .addFieldList([ - 'id', - 'sku', - 'stock_status', - 'salable_qty', - this._getStockItemField(), - this._getProductThumbnailField(), - this._getAttributesField(true, true) - ]); + .addFieldList(this._getCartProductFields()); + } + + _getCartProductFields(): CommonField[] { + return [ + 'id', + 'sku', + 'stock_status', + 'salable_qty', + this._getStockItemField(), + this._getProductThumbnailField(), + this._getAttributesField(true, true) + ]; } _getProductInterfaceFields( isVariant: boolean, isForLinkedProducts = false, isForWishlist = false - ): Array { + ): CommonField[] { const { isPlp = false, isSingleProduct, @@ -329,7 +377,7 @@ export class ProductListQuery { } // Basic fields returned always - const fields = [ + const fields: CommonField[] = [ 'uid', 'id', 'sku', @@ -431,7 +479,9 @@ export class ProductListQuery { * @returns {Field} * @protected */ - _getGroupedProductItems(): InlineFragment<'GroupedProduct', GQLGroupedProduct> { + _getGroupedProductItems(): InlineFragment<'GroupedProduct', GQLGroupedProduct & { + items: GQLGroupedProductItem[]; + }> { return new InlineFragment<'GroupedProduct', GQLGroupedProduct>('GroupedProduct').addField( new Field<'items', GQLGroupedProductItem, true>('items', true) .addFieldList(this._getGroupedProductItemFields()) @@ -444,7 +494,7 @@ export class ProductListQuery { * @private */ _getDownloadableProductFields(): InlineFragment<'DownloadableProduct', GQLDownloadableProduct> { - return new InlineFragment('DownloadableProduct') + return new InlineFragment<'DownloadableProduct', GQLDownloadableProduct>('DownloadableProduct') .addFieldList(this._getDownloadableProductLinks()); } @@ -504,10 +554,10 @@ export class ProductListQuery { ]; } - _getItemsField() { + _getItemsField(): Field<'items', T & { [x: string]: unknown }, true> { const { isSingleProduct } = this.options; - const items = new Field('items') + const items = new Field<'items', T, true>('items', true) .addFieldList(this._getProductInterfaceFields(false)); if (isSingleProduct) { @@ -520,10 +570,10 @@ export class ProductListQuery { return items; } - _getProductField() { + _getProductField(): Field<'product', GQLProductInterface> { const { isForLinkedProducts, isForWishlist = false } = this.options; - return new Field('product') + return new Field<'product', GQLProductInterface>('product') .addFieldList(this._getProductInterfaceFields(true, isForLinkedProducts, isForWishlist)); } @@ -533,13 +583,13 @@ export class ProductListQuery { ]; } - _getShortDescriptionField() { - return new Field('short_description') + _getShortDescriptionField(): Field<'short_description', GQLComplexTextValue> { + return new Field<'short_description', GQLComplexTextValue>('short_description') .addFieldList(this._getShortDescriptionFields()); } - _getStockItemField() { - return new Field('stock_item') + _getStockItemField(): Field<'stock_item', GQLProductStockItem> { + return new Field<'stock_item', GQLProductStockItem>('stock_item') .addFieldList(this._getStockItemFields()); } @@ -562,8 +612,8 @@ export class ProductListQuery { ]; } - _getBreadcrumbsField() { - return new Field('breadcrumbs') + _getBreadcrumbsField(): Field<'breadcrumbs', GQLBreadcrumb, true> { + return new Field<'breadcrumbs', GQLBreadcrumb, true>('breadcrumbs', true) .addFieldList(this._getBreadcrumbFields()); } @@ -576,8 +626,8 @@ export class ProductListQuery { ]; } - _getCategoriesField() { - return new Field('categories') + _getCategoriesField(): Field<'categories', GQLCategoryInterface, true> { + return new Field<'categories', GQLCategoryInterface, true>('categories', true) .addFieldList(this._getCategoryFields()); } @@ -594,13 +644,13 @@ export class ProductListQuery { ]; } - _getMinimalPriceField() { - return new Field('minimum_price') + _getMinimalPriceField(): Field<'minimum_price', GQLProductPrice> { + return new Field<'minimum_price', GQLProductPrice>('minimum_price') .addFieldList(this._getMinimalPriceFields()); } - _getMaximalPriceField() { - return new Field('maximum_price') + _getMaximalPriceField(): Field<'maximum_price', GQLProductPrice> { + return new Field<'maximum_price', GQLProductPrice>('maximum_price') .addFieldList(this._getMinimalPriceFields()); } @@ -612,8 +662,8 @@ export class ProductListQuery { ]; } - _getPriceRangeField() { - return new Field('price_range') + _getPriceRangeField(): Field<'price_range', GQLPriceRange> { + return new Field<'price_range', GQLPriceRange>('price_range') .addFieldList(this._getPriceRangeFields()); } @@ -638,18 +688,18 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getProductThumbnailField() { - return new Field('thumbnail') + _getProductThumbnailField(): Field<'thumbnail', GQLOptimizedProductImage> { + return new Field<'thumbnail', GQLOptimizedProductImage>('thumbnail') .addFieldList(this._getProductThumbnailFields()); } - _getProductSmallField() { - return new Field('small_image') + _getProductSmallField(): Field<'small_image', GQLOptimizedProductImage> { + return new Field<'small_image', GQLOptimizedProductImage>('small_image') .addFieldList(this._getProductSmallFields()); } - _getProductImageField() { - return new Field('image') + _getProductImageField(): Field<'image', GQLOptimizedProductImage> { + return new Field<'image', GQLOptimizedProductImage>('image') .addFieldList(this._getProductThumbnailFields()); } @@ -666,8 +716,8 @@ export class ProductListQuery { return fields; } - _getAttributeOptionsField(noSwatches: boolean) { - return new Field('attribute_options') + _getAttributeOptionsField(noSwatches: boolean): Field<'attribute_options', GQLAttributeOption, true> { + return new Field<'attribute_options', GQLAttributeOption, true>('attribute_options', true) .addFieldList(this._getAttributeOptionField(noSwatches)); } @@ -704,8 +754,8 @@ export class ProductListQuery { ]; } - _getAttributesField(isVariant: boolean, isCart: boolean) { - return new Field('s_attributes') + _getAttributesField(isVariant: boolean, isCart: boolean): Field<'attributes', GQLAttributeWithValue, true> { + return new Field<'s_attributes', GQLAttributeWithValue, true>('s_attributes', true) .setAlias('attributes') .addFieldList(this._getAttributeFields(isVariant, isCart)); } @@ -731,8 +781,15 @@ export class ProductListQuery { * @returns {Field} the video_content field * @private */ - _getVideoContentField() { - return new Field('video_content').addFieldList([ + _getVideoContentField(): Field<'video_content', GQLProductMediaGalleryEntriesVideoContent & { + media_type: string; + video_description: string; + video_metadata: string; + video_provider: string; + video_title: string; + video_url: string; + }> { + return new Field<'video_content', GQLProductMediaGalleryEntriesVideoContent>('video_content').addFieldList([ 'media_type', 'video_description', 'video_metadata', @@ -748,25 +805,25 @@ export class ProductListQuery { * @returns {Field} * @private */ - _getMediaThumbnailField() { - return new Field('thumbnail').addField('url'); + _getMediaThumbnailField(): Field<'thumbnail', string & { url: string }> { + return new Field<'thumbnail', string>('thumbnail').addField('url'); } - _getMediaBaseField() { - return new Field('base').addField('url'); + _getMediaBaseField(): Field<'base', string & { url: string }> { + return new Field<'base', string>('base').addField('url'); } - _getMediaLargeField() { - return new Field('large').addField('url'); + _getMediaLargeField(): Field<'large', string & { url: string }> { + return new Field<'large', string>('large').addField('url'); } - _getMediaGalleryField() { - return new Field('media_gallery_entries') + _getMediaGalleryField(): Field<'media_gallery_entries', GQLMediaGalleryEntry, true> { + return new Field<'media_gallery_entries', GQLMediaGalleryEntry, true>('media_gallery_entries', true) .addFieldList(this._getMediaGalleryFields()); } - _getProductLinksField() { - return new Field('product_links') + _getProductLinksField(): Field<'product_links', GQLProductLinksInterface, true> { + return new Field<'product_links', GQLProductLinksInterface, true>('product_links', true) .addFieldList(this._getProductLinkFields()); } @@ -776,13 +833,13 @@ export class ProductListQuery { ]; } - _getDescriptionField() { - return new Field('description') + _getDescriptionField(): Field<'description', GQLComplexTextValue> { + return new Field<'description', GQLComplexTextValue>('description') .addFieldList(this._getDescriptionFields()); } - _getUrlRewritesFields() { - return new Field('url_rewrites') + _getUrlRewritesFields(): Field<'url_rewrites', GQLUrlRewrite & { url: string }, true> { + return new Field<'url_rewrites', GQLUrlRewrite, true>('url_rewrites') .addFieldList(['url']); } @@ -801,8 +858,8 @@ export class ProductListQuery { ]; } - _getRatingsBreakdownField() { - return new Field('ratings_breakdown') + _getRatingsBreakdownField(): Field<'rating_votes', GQLProductReviewRating, true> { + return new Field<'ratings_breakdown', GQLProductReviewRating, true>('ratings_breakdown', true) .setAlias('rating_votes') .addFieldList(this._getRatingsBreakdownFields()); } @@ -818,8 +875,8 @@ export class ProductListQuery { ]; } - _getReviewItemsField() { - return new Field('items') + _getReviewItemsField(): Field<'items', GQLProductReview, true> { + return new Field<'items', GQLProductReview, true>('items', true) .addFieldList(this._getReviewItemsFields()); } @@ -829,8 +886,8 @@ export class ProductListQuery { ]; } - _getReviewsField() { - return new Field('reviews') + _getReviewsField(): Field<'reviews', GQLProductReviews> { + return new Field<'reviews', GQLProductReviews>('reviews') // Hard-coded pages, it will be very hard to // paginate using current implementation // eslint-disable-next-line no-magic-numbers @@ -843,8 +900,8 @@ export class ProductListQuery { return new Field<'review_count', number>('review_count'); } - _getRatingSummaryField() { - return new Field('rating_summary'); + _getRatingSummaryField(): Field<'rating_summary', number> { + return new Field<'rating_summary', number>('rating_summary'); } _getBundleOptionsFields(): CommonField[] { @@ -861,8 +918,8 @@ export class ProductListQuery { ]; } - _getProductBundleOptionField() { - return new Field('product') + _getProductBundleOptionField(): Field<'product', GQLProductInterface> { + return new Field<'product', GQLProductInterface>('product') .addFieldList(this._getProductBundleOptionFields()); } @@ -874,8 +931,8 @@ export class ProductListQuery { ]; } - _getBundleOptionsField() { - return new Field('options') + _getBundleOptionsField(): Field<'options', GQLBundleItemOption, true> { + return new Field<'options', GQLBundleItemOption, true>('options', true) .addFieldList(this._getBundleOptionsFields()); } @@ -892,8 +949,8 @@ export class ProductListQuery { ]; } - _getBundleItemsField() { - return new Field('items') + _getBundleItemsField(): Field<'items', GQLBundleItem, true> { + return new Field<'items', GQLBundleItem, true>('items', true) .addFieldList(this._getBundleItemsFields()); } @@ -915,8 +972,10 @@ export class ProductListQuery { ]; } - _getBundlePriceOptionsField() { - return new Field('bundle_options') + _getBundlePriceOptionsField(): Field<'bundle_options', { + [x: string]: unknown; + }, true> { + return new Field<'bundle_options', unknown, true>('bundle_options', true) .addFieldList(this._getBundlePriceOptionFields()); } @@ -937,8 +996,8 @@ export class ProductListQuery { ]; } - _getValuesField() { - return new Field('values') + _getValuesField(): Field<'values', GQLConfigurableProductOptionsValues, true> { + return new Field<'values', GQLConfigurableProductOptionsValues, true>('values', true) .addFieldList(this._getValueFields()); } @@ -949,8 +1008,8 @@ export class ProductListQuery { ]; } - _getConfigurableOptionsField() { - return new Field('configurable_options') + _getConfigurableOptionsField(): Field<'configurable_options', GQLConfigurableProductOption, true> { + return new Field<'configurable_options', GQLConfigurableProductOption, true>('configurable_options', true) .addFieldList(this._getConfigurableOptionFields()); } @@ -960,13 +1019,13 @@ export class ProductListQuery { ]; } - _getVariantsField() { + _getVariantsField(): Field<'variants_plp' | 'variants', GQLConfigurableVariant, true> { const { isPlp = false, isForWishlist = false } = this.options; // For PLP page we have optimized variants graphql field const variantsField = isPlp && !isForWishlist ? 'variants_plp' : 'variants'; - return new Field(variantsField) + return new Field<'variants_plp' | 'variants', GQLConfigurableVariant, true>(variantsField, true) .setAlias('variants') .addFieldList(this._getVariantFields()); } @@ -990,8 +1049,8 @@ export class ProductListQuery { ]; } - _getCustomizableTextValueField(alias: string) { - return new Field('value') + _getCustomizableTextValueField(alias: A): Field { + return new Field<'value', GQLCustomizableFieldValue>('value') .addFieldList(this._getCustomizableTextValueFields()) .setAlias(alias); } @@ -1003,8 +1062,16 @@ export class ProductListQuery { ]; } - _getCustomizableFileValueField(alias: string) { - return new Field('value') + _getCustomizableFileValueField(alias: A): Field { + return new Field<'value', GQLCustomizableFileValue>('value') .addFieldList([ 'price', 'priceInclTax', @@ -1027,7 +1094,9 @@ export class ProductListQuery { .addFieldList(this._getCustomizableTextFields('fieldValues')); } - _getCustomizableFileOption(): InlineFragment<'CustomizableFileOption', GQLCustomizableFileOption> { + _getCustomizableFileOption(): InlineFragment<'CustomizableFileOption', GQLCustomizableFileOption & { + fileValues: GQLCustomizableFileValue[]; + }> { return new InlineFragment<'CustomizableFileOption', GQLCustomizableFileOption>('CustomizableFileOption') .addFieldList([this._getCustomizableFileValueField('fileValues')]); } @@ -1043,8 +1112,8 @@ export class ProductListQuery { ]; } - _getCustomizableDateValueField() { - return new Field('value') + _getCustomizableDateValueField(): Field<'value', GQLCustomizableDateValue> { + return new Field<'value', GQLCustomizableDateValue>('value') .addFieldList(this._getCustomizableDateValueFields()); } @@ -1075,34 +1144,42 @@ export class ProductListQuery { ]; } - _getCustomizableSelectionValueField(alias: string) { - return new Field('value') + _getCustomizableSelectionValueField(alias: A): Field { + return new Field<'value', T>('value') .addFieldList(this._getCustomizableSelectionValueFields()) .setAlias(alias); } - _getCustomizableCheckboxOption(): InlineFragment<'CustomizableCheckboxOption', GQLCustomizableCheckboxOption> { + _getCustomizableCheckboxOption(): InlineFragment<'CustomizableCheckboxOption', GQLCustomizableCheckboxOption & { + checkboxValues: GQLCustomizableCheckboxValue[]; + }> { return new InlineFragment<'CustomizableCheckboxOption', GQLCustomizableCheckboxOption>( 'CustomizableCheckboxOption' ) .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); } - _getCustomizableMultiOption(): InlineFragment<'CustomizableMultipleOption', GQLCustomizableMultipleOption> { + _getCustomizableMultiOption(): InlineFragment<'CustomizableMultipleOption', GQLCustomizableMultipleOption & { + checkboxValues: GQLCustomizableMultipleValue[]; + }> { return new InlineFragment<'CustomizableMultipleOption', GQLCustomizableMultipleOption>( 'CustomizableMultipleOption' ) .addFieldList([this._getCustomizableSelectionValueField('checkboxValues')]); // same as checkbox } - _getCustomizableDropdownOption(): InlineFragment<'CustomizableDropDownOption', GQLCustomizableDropDownOption> { + _getCustomizableDropdownOption(): InlineFragment<'CustomizableDropDownOption', GQLCustomizableDropDownOption & { + dropdownValues: GQLCustomizableDropDownValue[]; + }> { return new InlineFragment<'CustomizableDropDownOption', GQLCustomizableDropDownOption>( 'CustomizableDropDownOption' ) .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); } - _getCustomizableRadioOption(): InlineFragment<'CustomizableRadioOption', GQLCustomizableRadioOption> { + _getCustomizableRadioOption(): InlineFragment<'CustomizableRadioOption', GQLCustomizableRadioOption & { + dropdownValues: GQLCustomizableDropDownValue[]; + }> { return new InlineFragment<'CustomizableRadioOption', GQLCustomizableRadioOption>('CustomizableRadioOption') .addFieldList([this._getCustomizableSelectionValueField('dropdownValues')]); // same as dropdown } @@ -1125,12 +1202,16 @@ export class ProductListQuery { ]; } - _getCustomizableProductFragmentOptionsField() { - return new Field('options') + _getCustomizableProductFragmentOptionsField(): Field<'options', GQLCustomizableOptionInterface, true> { + return new Field<'options', GQLCustomizableOptionInterface, true>('options', true) .addFieldList(this._getCustomizableProductFragmentOptionsFields()); } - _getCustomizableProductFragment(): InlineFragment<'CustomizableProductInterface', GQLCustomizableProductInterface> { + _getCustomizableProductFragment(): InlineFragment< + 'CustomizableProductInterface', + GQLCustomizableProductInterface & { + options: GQLCustomizableOptionInterface[]; + }> { return new InlineFragment<'CustomizableProductInterface', GQLCustomizableProductInterface>( 'CustomizableProductInterface' ) @@ -1149,8 +1230,8 @@ export class ProductListQuery { ]; } - _getTierPricesField() { - return new Field('price_tiers') + _getTierPricesField(): Field<'price_tiers', GQLTierPrice, true> { + return new Field<'price_tiers', GQLTierPrice, true>('price_tiers') .addFieldList(this._getTierPricesFields()); } @@ -1162,71 +1243,95 @@ export class ProductListQuery { ]; } - _getDiscountField() { - return new Field('discount') + _getDiscountField(): Field<'discount', GQLProductDiscount & { + amount_off: number; + percent_off: number; + }> { + return new Field<'discount', GQLProductDiscount>('discount') .addField('amount_off') .addField('percent_off'); } - _getFinalPriceField() { - return new Field('final_price') + _getFinalPriceField(): Field<'final_price', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'final_price', GQLMoney>('final_price') .addField('currency') .addField('value'); } - _getFinalPriceExclTaxField() { - return new Field('final_price_excl_tax') + _getFinalPriceExclTaxField(): Field<'final_price_excl_tax', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'final_price_excl_tax', GQLMoney>('final_price_excl_tax') .addField('currency') .addField('value'); } - _getRegularPriceField() { - return new Field('regular_price') + _getRegularPriceField(): Field<'regular_price', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'regular_price', GQLMoney>('regular_price') .addField('currency') .addField('value'); } - _getRegularPriceExclTaxField() { - return new Field('regular_price_excl_tax') + _getRegularPriceExclTaxField(): Field<'regular_price_excl_tax', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'regular_price_excl_tax', GQLMoney>('regular_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultFinalPriceExclTaxField() { - return new Field('default_final_price_excl_tax') + _getDefaultFinalPriceExclTaxField(): Field<'default_final_price_excl_tax', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'default_final_price_excl_tax', GQLMoney>('default_final_price_excl_tax') .addField('currency') .addField('value'); } - _getDefaultPriceField() { - return new Field('default_price') + _getDefaultPriceField(): Field<'default_price', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'default_price', GQLMoney>('default_price') .addField('currency') .addField('value'); } - _getDefaultFinalPriceField() { - return new Field('default_final_price') + _getDefaultFinalPriceField(): Field<'default_final_price', GQLMoney & { + currency: GQLCurrencyEnum; + value: number; + }> { + return new Field<'default_final_price', GQLMoney>('default_final_price') .addField('currency') .addField('value'); } - _getBundleProductFragment() { - return new InlineFragment('BundleProduct') + _getBundleProductFragment(): InlineFragment<'BundleProduct', GQLBundleProduct> { + return new InlineFragment<'BundleProduct', GQLBundleProduct>('BundleProduct') .addFieldList(this._getBundleProductFragmentFields()); } - _getConfigurableProductFragment() { - return new InlineFragment('ConfigurableProduct') + _getConfigurableProductFragment(): InlineFragment<'ConfigurableProduct', GQLConfigurableProduct> { + return new InlineFragment<'ConfigurableProduct', GQLConfigurableProduct>('ConfigurableProduct') .addFieldList(this._getConfigurableProductFragmentFields()); } - _getSimpleProductFragment() { - return new InlineFragment('SimpleProduct') + _getSimpleProductFragment(): InlineFragment<'SimpleProduct', GQLSimpleProduct> { + return new InlineFragment<'SimpleProduct', GQLSimpleProduct>('SimpleProduct') .addFieldList(this._getSimpleProductFragmentFields()); } - _getVirtualProductFragment() { - return new InlineFragment('VirtualProduct') + _getVirtualProductFragment(): InlineFragment<'VirtualProduct', GQLVirtualProduct> { + return new InlineFragment<'VirtualProduct', GQLVirtualProduct>('VirtualProduct') .addFieldList(this._getVirtualProductFragmentFields()); } @@ -1237,8 +1342,8 @@ export class ProductListQuery { ]; } - _getSortOptionsField() { - return new Field('options') + _getSortOptionsField(): Field<'options', GQLSortField, true> { + return new Field<'options', GQLSortField, true>('options', true) .addFieldList(this._getSortOptionFields()); } @@ -1248,8 +1353,8 @@ export class ProductListQuery { ]; } - _getSortField() { - return new Field('sort_fields') + _getSortField(): Field<'sort_fields', GQLSortFields> { + return new Field<'sort_fields', GQLSortFields>('sort_fields') .addFieldList(this._getSortFields()); } @@ -1260,13 +1365,13 @@ export class ProductListQuery { ]; } - _getSwatchDataField() { - return new Field('swatch_data') + _getSwatchDataField(): Field<'swatch_data', GQLSwatchData> { + return new Field<'swatch_data', GQLSwatchData>('swatch_data') .addFieldList(this._getSwatchDataFields()); } - _getAggregationsField() { - return new Field('aggregations') + _getAggregationsField(): Field<'filters', GQLAggregation, true> { + return new Field<'aggregations', GQLAggregation, true>('aggregations', true) .setAlias('filters') .addFieldList(this._getAggregationsFields()); } @@ -1282,8 +1387,8 @@ export class ProductListQuery { ]; } - _getAggregationsOptionsField() { - return new Field('options') + _getAggregationsOptionsField(): Field<'filter_items', GQLAggregationOption, true> { + return new Field<'options', GQLAggregationOption, true>('options', true) .setAlias('filter_items') .addFieldList(this._getAggregationsOptionsFields()); } @@ -1297,7 +1402,10 @@ export class ProductListQuery { ]; } - _getPageInfoField() { + _getPageInfoField(): Field<'page_info', GQLSearchResultPageInfo & { + current_page: number; + total_pages: number; + }> { return new Field<'page_info', GQLSearchResultPageInfo>('page_info') .addField('current_page') .addField('total_pages'); diff --git a/packages/scandipwa/src/query/Query.type.ts b/packages/scandipwa/src/query/Query.type.ts index 6136a7e4d2..c068c3813e 100644 --- a/packages/scandipwa/src/query/Query.type.ts +++ b/packages/scandipwa/src/query/Query.type.ts @@ -9,14 +9,12 @@ * @link https://github.com/scandipwa/scandipwa */ -import { Field, InlineFragment } from '@tilework/opus'; +import { AbstractField } from '@tilework/opus'; import { GQLCustomerInput } from 'Type/Graphql.type'; // eslint-disable-next-line @typescript-eslint/no-explicit-any -export type CommonField = string | Field; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type CommonFragment = InlineFragment; +export type CommonField = string | AbstractField; export type CategoryQueryOptions = { categoryIds: number; diff --git a/tilework-packages/opus/src/builder/AbstractField.ts b/tilework-packages/opus/src/builder/AbstractField.ts index 9607ec2db3..4e0d38f1b6 100644 --- a/tilework-packages/opus/src/builder/AbstractField.ts +++ b/tilework-packages/opus/src/builder/AbstractField.ts @@ -187,7 +187,7 @@ export abstract class AbstractField< addFieldList< NewField extends string >( - fieldList: readonly (NewField | Field)[] + fieldList: readonly (NewField | AbstractField)[] ): HigherKindType< this['tag'], Name, diff --git a/yarn.lock b/yarn.lock index 00cf94a38a..90f19d432d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2650,9 +2650,9 @@ integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== "@popperjs/core@^2.9.2": - version "2.11.4" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.4.tgz#d8c7b8db9226d2d7664553a0741ad7d0397ee503" - integrity sha512-q/ytXxO5NKvyT37pmisQAItCFqA7FD/vNb8dgaJy3/630Fsc+Mz9/9f2SziBoIZ30TJooXyTwZmhi1zjXmObYg== + version "2.11.5" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64" + integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw== "@rollup/plugin-babel@^5.3.0": version "5.3.1" @@ -2881,9 +2881,9 @@ pretty-format "^26.6.2" "@testing-library/jest-dom@^5.11.4": - version "5.16.3" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.3.tgz#b76851a909586113c20486f1679ffb4d8ec27bfa" - integrity sha512-u5DfKj4wfSt6akfndfu1eG06jsdyA/IUrlX2n3pyq5UXgXMhXY+NJb8eNK/7pqPWAhCKsCGWDdDO0zKMKAYkEA== + version "5.16.4" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.4.tgz#938302d7b8b483963a3ae821f1c0808f872245cd" + integrity sha512-Gy+IoFutbMQcky0k+bqqumXZ1cTGswLsFqmNLzNdSKkU9KGV2u9oXhukCbbJ9/LRPKiqwxEE8VpV/+YZlfkPUA== dependencies: "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" @@ -3421,9 +3421,9 @@ source-map "^0.6.1" "@types/vscode@^1.45.0": - version "1.65.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.65.0.tgz#042dd8d93c32ac62cb826cd0fa12376069d1f448" - integrity sha512-wQhExnh2nEzpjDMSKhUvnNmz3ucpd3E+R7wJkOhBNK3No6fG3VUdmVmMOKD0A8NDZDDDiQcLNxe3oGmX5SjJ5w== + version "1.66.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.66.0.tgz#e90e1308ad103f2bd31b72c17b8031b4cec0713d" + integrity sha512-ZfJck4M7nrGasfs4A4YbUoxis3Vu24cETw3DERsNYtDZmYSYtk6ljKexKFKhImO/ZmY6ZMsmegu2FPkXoUFImA== "@types/webpack-sources@*": version "3.2.0" @@ -4187,7 +4187,7 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= -array-includes@^3.1.3, array-includes@^3.1.4: +array-includes@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== @@ -5245,9 +5245,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001113, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001154, caniuse-lite@^1.0.30001317: - version "1.0.30001322" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001322.tgz#2e4c09d11e1e8f852767dab287069a8d0c29d623" - integrity sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew== + version "1.0.30001325" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" + integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== capture-exit@^2.0.0: version "2.0.0" @@ -6017,12 +6017,9 @@ craco-sass-resources-loader@^1.1.0: sass-resources-loader "^2.0.0" crc-32@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.1.tgz#436d2bcaad27bcb6bd073a2587139d3024a16460" - integrity sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.3.1" + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== crc32-stream@^4.0.2: version "4.0.2" @@ -6254,9 +6251,9 @@ css-what@^3.2.1: integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== css-what@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.0.1.tgz#3be33be55b9f302f710ba3a9c3abc1e2a63fc7eb" - integrity sha512-z93ZGFLNc6yaoXAmVhqoSIb+BduplteCt1fepvwhBUQK6MNE4g6fgjpuZKJKp0esUe+vXWlIkwZZjNWoOKw0ZA== + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== css.escape@1.5.1, css.escape@^1.5.1: version "1.5.1" @@ -6992,9 +6989,9 @@ ejs@^3.1.5: jake "^10.6.1" electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.585, electron-to-chromium@^1.4.84: - version "1.4.100" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.100.tgz#da82de8a19a47ea3dcdf141dde85355942fbc4e7" - integrity sha512-pNrSE2naf8fizl6/Uxq8UbKb8hU9EiYW4OzCYswosXoLV5NTMOUVKECNzDaHiUubsPq/kAckOzZd7zd8S8CHVw== + version "1.4.104" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.104.tgz#60973b0a7d398efa877196e8ccb0c93d48b918d8" + integrity sha512-2kjoAyiG7uMyGRM9mx25s3HAzmQG2ayuYXxsFmYugHSDcwxREgLtscZvbL1JcW9S/OemeQ3f/SG6JhDwpnCclQ== elliptic@^6.5.3: version "6.5.4" @@ -7268,9 +7265,9 @@ eslint-config-airbnb-base@^15.0.0: semver "^6.3.0" eslint-config-airbnb-typescript@^16.1.4: - version "16.1.4" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.1.4.tgz#ac8553a55080cce34aa1ab5625564b4faf5a5f1c" - integrity sha512-dfm2cEaYXh4mCYd+RyJO8+PQfd5/zp8WwrCeRznly5qD9W5tal3KTjgdInYWuEAdwWnNJxWcmQ/HFiA4bfkM1g== + version "16.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.2.0.tgz#9193fafd62f1cbf444895f4495eae334baf3265b" + integrity sha512-OUaMPZpTOZGKd5tXOjJ9PRU4iYNW/Z5DoHIynjsVK/FpkWdiY5+nxQW6TiJAlLwVI1l53xUOrnlZWtVBVQzuWA== dependencies: eslint-config-airbnb-base "^15.0.0" @@ -7298,7 +7295,7 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.7.2: +eslint-module-utils@^2.7.3: version "2.7.3" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== @@ -7337,23 +7334,23 @@ eslint-plugin-fp@^2.3.0: req-all "^0.1.0" eslint-plugin-import@^2.22.1: - version "2.25.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" - integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== + version "2.26.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" + integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== dependencies: array-includes "^3.1.4" array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.2" + eslint-module-utils "^2.7.3" has "^1.0.3" - is-core-module "^2.8.0" + is-core-module "^2.8.1" is-glob "^4.0.3" - minimatch "^3.0.4" + minimatch "^3.1.2" object.values "^1.1.5" - resolve "^1.20.0" - tsconfig-paths "^3.12.0" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" eslint-plugin-jest@^22.1.3: version "22.21.0" @@ -7737,11 +7734,6 @@ execall@^2.0.0: dependencies: clone-regexp "^2.1.0" -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -8727,9 +8719,9 @@ globule@^1.0.0: minimatch "~3.0.2" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -9050,9 +9042,9 @@ html-react-parser@^0.13.0: style-to-object "0.3.0" html-tags@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140" - integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.2.0.tgz#dbb3518d20b726524e4dd43de397eb0a95726961" + integrity sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg== html-webpack-plugin@4.5.0: version "4.5.0" @@ -9646,7 +9638,7 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" -is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.0, is-core-module@^2.8.1: +is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -9771,9 +9763,9 @@ is-negative-zero@^2.0.2: integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== dependencies: has-tostringtag "^1.0.0" @@ -9874,9 +9866,11 @@ is-root@2.1.0: integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" is-ssh@^1.3.0: version "1.3.3" @@ -10707,11 +10701,11 @@ jsprim@^1.2.2: verror "1.10.0" "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" - integrity sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA== + version "3.2.2" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.2.tgz#6ab1e52c71dfc0c0707008a91729a9491fe9f76c" + integrity sha512-HDAyJ4MNQBboGpUnHAVUNJs6X0lh058s6FuixsFGP7MgJYpD6Vasd6nzSG5iIfXu1zAYlHJ/zsOKNlrenTUBnw== dependencies: - array-includes "^3.1.3" + array-includes "^3.1.4" object.assign "^4.1.2" keymirror@^0.1.1: @@ -13693,9 +13687,9 @@ postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: uniq "^1.0.1" postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.9: - version "6.0.9" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f" - integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ== + version "6.0.10" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" + integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -13866,11 +13860,6 @@ pretty-format@^27.0.0, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -printj@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.3.1.tgz#9af6b1d55647a1587ac44f4c1654a4b95b8e12cb" - integrity sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg== - process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -14325,9 +14314,9 @@ react-property@1.0.1: integrity sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ== react-redux@^7.2.0: - version "7.2.6" - resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.6.tgz#49633a24fe552b5f9caf58feb8a138936ddfe9aa" - integrity sha512-10RPdsz0UUrRL1NZE0ejTkucnclYSgXp5q+tB5SWx2qeG2ZJQJyymgAhwKy73yiL/13btfB6fPr+rgbMAaZIAQ== + version "7.2.8" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.8.tgz#a894068315e65de5b1b68899f9c6ee0923dd28de" + integrity sha512-6+uDjhs3PSIclqoCk0kd6iX74gzrGc3W5zcAjbrFgEdIjRSQObdIwfx80unTkVUYvbQ95Y8Av3OvFHq1w5EOUw== dependencies: "@babel/runtime" "^7.15.4" "@types/react-redux" "^7.1.20" @@ -14956,7 +14945,7 @@ resolve@1.20.0: is-core-module "^2.2.0" path-parse "^1.0.6" -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.3.2, resolve@^1.8.1: version "1.22.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== @@ -16919,7 +16908,7 @@ ts-pnp@1.2.0, ts-pnp@^1.1.6: resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== -tsconfig-paths@^3.12.0: +tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== From 2c2ec743cc89df5d242d400a2832fc63821edbf5 Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Fri, 8 Apr 2022 03:02:18 +0300 Subject: [PATCH 018/192] Started to migrate reducers to typescript & some util fixes --- ...umbs.reducer.js => Breadcrumbs.reducer.ts} | 10 ++++- .../scandipwa/src/store/Breadcrumbs/type.ts | 28 +++++++++++++ .../scandipwa/src/store/Cart/Cart.reducer.js | 1 + packages/scandipwa/src/store/Cart/type.ts | 42 +++++++++++++++++++ ...ategory.reducer.js => Category.reducer.ts} | 10 ++++- packages/scandipwa/src/store/Category/type.ts | 27 ++++++++++++ ...heckout.reducer.js => Checkout.reducer.ts} | 14 ++++++- packages/scandipwa/src/store/Checkout/type.ts | 35 ++++++++++++++++ ...ccount.reducer.js => MyAccount.reducer.ts} | 13 ++++-- .../scandipwa/src/store/MyAccount/type.d.ts | 39 +++++++++++++++++ ...{Offline.reducer.js => Offline.reducer.ts} | 9 +++- packages/scandipwa/src/store/Offline/type.ts | 32 ++++++++++++++ .../{Popup.reducer.js => Popup.reducer.ts} | 12 ++++-- packages/scandipwa/src/store/Popup/type.ts | 29 +++++++++++++ .../src/store/{index.js => index.ts} | 20 ++++++--- packages/scandipwa/src/type/Category.type.ts | 2 +- packages/scandipwa/src/type/Global.type.ts | 7 ---- packages/scandipwa/src/util/Auth/Token.ts | 8 ++-- .../scandipwa/src/util/Compare/Compare.ts | 3 +- packages/scandipwa/src/util/Media/Media.ts | 3 +- .../scandipwa/src/util/Product/Product.ts | 3 +- .../scandipwa/src/util/Request/Request.ts | 8 ++-- packages/scandipwa/src/util/Store/type.d.ts | 37 ++++++++++++++++ packages/scandipwa/src/util/Url/Url.ts | 3 +- 24 files changed, 356 insertions(+), 39 deletions(-) rename packages/scandipwa/src/store/Breadcrumbs/{Breadcrumbs.reducer.js => Breadcrumbs.reducer.ts} (79%) create mode 100644 packages/scandipwa/src/store/Breadcrumbs/type.ts create mode 100644 packages/scandipwa/src/store/Cart/type.ts rename packages/scandipwa/src/store/Category/{Category.reducer.js => Category.reducer.ts} (76%) create mode 100644 packages/scandipwa/src/store/Category/type.ts rename packages/scandipwa/src/store/Checkout/{Checkout.reducer.js => Checkout.reducer.ts} (79%) create mode 100644 packages/scandipwa/src/store/Checkout/type.ts rename packages/scandipwa/src/store/MyAccount/{MyAccount.reducer.js => MyAccount.reducer.ts} (87%) create mode 100644 packages/scandipwa/src/store/MyAccount/type.d.ts rename packages/scandipwa/src/store/Offline/{Offline.reducer.js => Offline.reducer.ts} (80%) create mode 100644 packages/scandipwa/src/store/Offline/type.ts rename packages/scandipwa/src/store/Popup/{Popup.reducer.js => Popup.reducer.ts} (78%) create mode 100644 packages/scandipwa/src/store/Popup/type.ts rename packages/scandipwa/src/store/{index.js => index.ts} (81%) create mode 100644 packages/scandipwa/src/util/Store/type.d.ts diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.js b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts similarity index 79% rename from packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.js rename to packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts index ef18663f06..dc7258bb15 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.js +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts @@ -9,16 +9,22 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; + import { TOGGLE_BREADCRUMBS, UPDATE_BREADCRUMBS } from './Breadcrumbs.action'; +import { BreadcrumbsAction, BreadcrumbsStore } from './type'; /** @namespace Store/Breadcrumbs/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): BreadcrumbsStore => ({ breadcrumbs: [], areBreadcrumbsVisible: true }); /** @namespace Store/Breadcrumbs/Reducer/BreadcrumbsReducer */ -export const BreadcrumbsReducer = ( +export const BreadcrumbsReducer: Reducer< +BreadcrumbsStore, +BreadcrumbsAction & BreadcrumbsStore +> = ( state = getInitialState(), action ) => { diff --git a/packages/scandipwa/src/store/Breadcrumbs/type.ts b/packages/scandipwa/src/store/Breadcrumbs/type.ts new file mode 100644 index 0000000000..10713d119f --- /dev/null +++ b/packages/scandipwa/src/store/Breadcrumbs/type.ts @@ -0,0 +1,28 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { Breadcrumbs } from 'Type/Breadcrumbs.type'; + +import { TOGGLE_BREADCRUMBS, UPDATE_BREADCRUMBS } from './Breadcrumbs.action'; + +export type BreadcrumbsStore = { + breadcrumbs: Breadcrumbs; + areBreadcrumbsVisible: boolean; +}; + +export type BreadcrumbsAction = Action; + +declare module 'Util/Store/type' { + export interface RootState { + BreadcrumbsReducer: BreadcrumbsStore; + } +} diff --git a/packages/scandipwa/src/store/Cart/Cart.reducer.js b/packages/scandipwa/src/store/Cart/Cart.reducer.js index 62addd1267..c61345c154 100644 --- a/packages/scandipwa/src/store/Cart/Cart.reducer.js +++ b/packages/scandipwa/src/store/Cart/Cart.reducer.js @@ -13,6 +13,7 @@ import BrowserDatabase from 'Util/BrowserDatabase'; import { getIndexedProduct } from 'Util/Product'; import { UPDATE_IS_LOADING_CART, UPDATE_SHIPPING_PRICE, UPDATE_TOTALS } from './Cart.action'; +import { CartAction } from './type'; export const CART_TOTALS = 'cart_totals'; diff --git a/packages/scandipwa/src/store/Cart/type.ts b/packages/scandipwa/src/store/Cart/type.ts new file mode 100644 index 0000000000..aa912c101a --- /dev/null +++ b/packages/scandipwa/src/store/Cart/type.ts @@ -0,0 +1,42 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { + ADD_PRODUCT_TO_CART, + APPLY_COUPON_TO_CART, + REMOVE_COUPON_FROM_CART, + REMOVE_PRODUCT_FROM_CART, + UPDATE_IS_LOADING_CART, + UPDATE_SHIPPING_PRICE, + UPDATE_TOTALS +} from './Cart.action'; + +export type CartStore = { + isLoading: boolean; + cartTotals: Record; +}; + +export type CartAction = Action< + typeof ADD_PRODUCT_TO_CART +| typeof REMOVE_PRODUCT_FROM_CART +| typeof UPDATE_TOTALS +| typeof APPLY_COUPON_TO_CART +| typeof REMOVE_COUPON_FROM_CART +| typeof UPDATE_SHIPPING_PRICE +| typeof UPDATE_IS_LOADING_CART +>; + +declare module 'Util/Store/type' { + export interface RootState { + CartReducer: CartStore; + } +} diff --git a/packages/scandipwa/src/store/Category/Category.reducer.js b/packages/scandipwa/src/store/Category/Category.reducer.ts similarity index 76% rename from packages/scandipwa/src/store/Category/Category.reducer.js rename to packages/scandipwa/src/store/Category/Category.reducer.ts index ad3ec7d063..d493c7c8ed 100644 --- a/packages/scandipwa/src/store/Category/Category.reducer.js +++ b/packages/scandipwa/src/store/Category/Category.reducer.ts @@ -9,15 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; + import { UPDATE_CURRENT_CATEGORY } from './Category.action'; +import { CategoryAction, CategoryStore } from './type'; /** @namespace Store/Category/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): CategoryStore => ({ category: {} }); /** @namespace Store/Category/Reducer/CategoryReducer */ -export const CategoryReducer = ( +export const CategoryReducer: Reducer< +CategoryStore, +CategoryAction & CategoryStore +> = ( state = getInitialState(), { type, category } ) => { diff --git a/packages/scandipwa/src/store/Category/type.ts b/packages/scandipwa/src/store/Category/type.ts new file mode 100644 index 0000000000..271bdbbe3e --- /dev/null +++ b/packages/scandipwa/src/store/Category/type.ts @@ -0,0 +1,27 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { CategoryFragment } from 'Type/Category.type'; + +import { UPDATE_CURRENT_CATEGORY } from './Category.action'; + +export type CategoryStore = { + category: CategoryFragment | Record; +}; + +export type CategoryAction = Action; + +declare module 'Util/Store/type' { + export interface RootState { + CategoryReducer: CategoryStore; + } +} diff --git a/packages/scandipwa/src/store/Checkout/Checkout.reducer.js b/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts similarity index 79% rename from packages/scandipwa/src/store/Checkout/Checkout.reducer.js rename to packages/scandipwa/src/store/Checkout/Checkout.reducer.ts index d454932bee..2cb50d02f3 100644 --- a/packages/scandipwa/src/store/Checkout/Checkout.reducer.js +++ b/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts @@ -8,21 +8,31 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ + +import { Reducer } from 'redux'; + import { UPDATE_EMAIL, UPDATE_EMAIL_AVAILABLE, UPDATE_SHIPPING_FIELDS } from './Checkout.action'; +import { CheckoutAction, CheckoutStore } from './type'; /** @namespace Store/Checkout/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): CheckoutStore => ({ shippingFields: {}, email: '', isEmailAvailable: true }); /** @namespace Store/Checkout/Reducer/CheckoutReducer */ -export const CheckoutReducer = (state = getInitialState(), action) => { +export const CheckoutReducer: Reducer< +CheckoutStore, +CheckoutAction & CheckoutStore +> = ( + state = getInitialState(), + action +) => { switch (action.type) { case UPDATE_SHIPPING_FIELDS: const { shippingFields } = action; diff --git a/packages/scandipwa/src/store/Checkout/type.ts b/packages/scandipwa/src/store/Checkout/type.ts new file mode 100644 index 0000000000..5791b865d5 --- /dev/null +++ b/packages/scandipwa/src/store/Checkout/type.ts @@ -0,0 +1,35 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { + UPDATE_EMAIL, + UPDATE_EMAIL_AVAILABLE, + UPDATE_SHIPPING_FIELDS +} from './Checkout.action'; + +export type CheckoutStore = { + shippingFields: Record; + email: string; + isEmailAvailable: boolean; +}; + +export type CheckoutAction = Action< + typeof UPDATE_EMAIL +| typeof UPDATE_EMAIL_AVAILABLE +| typeof UPDATE_SHIPPING_FIELDS +>; + +declare module 'Util/Store/type' { + export interface RootState { + CheckoutReducer: CheckoutStore; + } +} diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.js b/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts similarity index 87% rename from packages/scandipwa/src/store/MyAccount/MyAccount.reducer.js rename to packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts index 2591483d17..b3508d3019 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.js +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts @@ -8,6 +8,7 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; import { isInitiallySignedIn } from 'Util/Auth'; @@ -20,20 +21,26 @@ import { UPDATE_CUSTOMER_PASSWORD_RESET_STATUS, UPDATE_CUSTOMER_SIGN_IN_STATUS } from './MyAccount.action'; +import { MyAccountAction, MyAccountStore } from './type'; /** @namespace Store/MyAccount/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): MyAccountStore => ({ isSignedIn: isInitiallySignedIn(), passwordResetStatus: false, isPasswordForgotSend: false, isLoading: false, isLocked: false, customer: {}, - message: '' + message: '', + email: '', + status: false }); /** @namespace Store/MyAccount/Reducer/MyAccountReducer */ -export const MyAccountReducer = ( +export const MyAccountReducer: Reducer< +MyAccountStore, +MyAccountAction & MyAccountStore +> = ( state = getInitialState(), action ) => { diff --git a/packages/scandipwa/src/store/MyAccount/type.d.ts b/packages/scandipwa/src/store/MyAccount/type.d.ts new file mode 100644 index 0000000000..2c29550a2e --- /dev/null +++ b/packages/scandipwa/src/store/MyAccount/type.d.ts @@ -0,0 +1,39 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +export type MyAccountStore = { + isSignedIn: boolean; + passwordResetStatus: boolean; + isPasswordForgotSend: boolean; + isLoading: boolean; + isLocked: boolean; + customer: Record; + message: string; + email: string; + status: boolean; +}; + +export type MyAccountAction = Action< + typeof UPDATE_CUSTOMER_DETAILS +| typeof UPDATE_CUSTOMER_IS_LOADING +| typeof UPDATE_CUSTOMER_IS_LOCKED +| typeof UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL +| typeof UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS +| typeof UPDATE_CUSTOMER_PASSWORD_RESET_STATUS +| typeof UPDATE_CUSTOMER_SIGN_IN_STATUS +>; + +declare module 'Util/Store/type' { + export interface RootState { + MyAccountReducer: MyAccountStore; + } +} diff --git a/packages/scandipwa/src/store/Offline/Offline.reducer.js b/packages/scandipwa/src/store/Offline/Offline.reducer.ts similarity index 80% rename from packages/scandipwa/src/store/Offline/Offline.reducer.js rename to packages/scandipwa/src/store/Offline/Offline.reducer.ts index e385862f03..921c8ed414 100644 --- a/packages/scandipwa/src/store/Offline/Offline.reducer.js +++ b/packages/scandipwa/src/store/Offline/Offline.reducer.ts @@ -8,20 +8,25 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; import { SET_BIG_OFFLINE_NOTICE, SHOW_OFFLINE_NOTICE } from './Offline.action'; +import { OfflineAction, OfflineStore } from './type'; /** @namespace Store/Offline/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): OfflineStore => ({ isOffline: true, isBig: false }); /** @namespace Store/Offline/Reducer/OfflineReducer */ -export const OfflineReducer = ( +export const OfflineReducer: Reducer< +OfflineStore, +OfflineAction & OfflineStore +> = ( state = getInitialState(), action ) => { diff --git a/packages/scandipwa/src/store/Offline/type.ts b/packages/scandipwa/src/store/Offline/type.ts new file mode 100644 index 0000000000..4226466e96 --- /dev/null +++ b/packages/scandipwa/src/store/Offline/type.ts @@ -0,0 +1,32 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { + SET_BIG_OFFLINE_NOTICE, + SHOW_OFFLINE_NOTICE +} from './Offline.action'; + +export type OfflineStore = { + isOffline: boolean; + isBig: boolean; +}; + +export type OfflineAction = Action< + typeof SET_BIG_OFFLINE_NOTICE +| typeof SHOW_OFFLINE_NOTICE +>; + +declare module 'Util/Store/type' { + export interface RootState { + OfflineReducer: OfflineStore; + } +} diff --git a/packages/scandipwa/src/store/Popup/Popup.reducer.js b/packages/scandipwa/src/store/Popup/Popup.reducer.ts similarity index 78% rename from packages/scandipwa/src/store/Popup/Popup.reducer.js rename to packages/scandipwa/src/store/Popup/Popup.reducer.ts index a9a4a8fefe..cfa96982f4 100644 --- a/packages/scandipwa/src/store/Popup/Popup.reducer.js +++ b/packages/scandipwa/src/store/Popup/Popup.reducer.ts @@ -8,19 +8,25 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; import { HIDE_ACTIVE_OVERLAY, HIDE_ACTIVE_POPUP } from 'Store/Overlay/Overlay.action'; import { SHOW_POPUP } from './Popup.action'; +import { PopupAction, PopupStore } from './type'; /** @namespace Store/Popup/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): PopupStore => ({ popupPayload: {}, - shouldPopupClose: false + shouldPopupClose: false, + payload: {} }); /** @namespace Store/Popup/Reducer/PopupReducer */ -export const PopupReducer = ( +export const PopupReducer: Reducer< +PopupStore, +PopupAction & PopupStore +> = ( state = getInitialState(), action ) => { diff --git a/packages/scandipwa/src/store/Popup/type.ts b/packages/scandipwa/src/store/Popup/type.ts new file mode 100644 index 0000000000..0f2c39e157 --- /dev/null +++ b/packages/scandipwa/src/store/Popup/type.ts @@ -0,0 +1,29 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { Action } from 'redux'; + +import { HIDE_ACTIVE_OVERLAY, HIDE_ACTIVE_POPUP } from 'Store/Overlay/Overlay.action'; + +import { SHOW_POPUP } from './Popup.action'; + +export type PopupStore = { + popupPayload: Record; + shouldPopupClose: boolean; + payload: Record | boolean; +}; + +export type PopupAction = Action; + +declare module 'Util/Store/type' { + export interface RootState { + PopupReducer: PopupStore; + } +} diff --git a/packages/scandipwa/src/store/index.js b/packages/scandipwa/src/store/index.ts similarity index 81% rename from packages/scandipwa/src/store/index.js rename to packages/scandipwa/src/store/index.ts index d48aa247ee..3babbdce92 100644 --- a/packages/scandipwa/src/store/index.js +++ b/packages/scandipwa/src/store/index.ts @@ -8,6 +8,8 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Action, Reducer } from 'redux'; + import CartReducer from 'Store/Cart/Cart.reducer'; import CheckoutReducer from 'Store/Checkout/Checkout.reducer'; import ConfigReducer from 'Store/Config/Config.reducer'; @@ -47,18 +49,24 @@ export const getStaticReducers = () => ({ StoreInPickUpReducer }); -export default function injectStaticReducers(store) { +export type StaticReducersType = ReturnType; + +export default function injectStaticReducers< + S, + A, + T extends ModifiedReduxStore +>(store: T): T & StaticReducersType { // eslint-disable-next-line no-param-reassign - store.asyncReducers = []; + // store.asyncReducers = {}; // Inject all the static reducers into the store Object.entries(getStaticReducers()).forEach( ([name, reducer]) => { - // eslint-disable-next-line no-param-reassign - store.asyncReducers[name] = reducer; - store.injectReducer(name, reducer); + if (store.injectReducer) { + store.injectReducer(name, reducer as Reducer>); + } } ); - return store; + return store as T & StaticReducersType; } diff --git a/packages/scandipwa/src/type/Category.type.ts b/packages/scandipwa/src/type/Category.type.ts index 55d9fee72f..ecb5bd3056 100644 --- a/packages/scandipwa/src/type/Category.type.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -19,7 +19,7 @@ export type Breadcrumbs = { export type CategoryFragment = { id: number; - breadcrumbs: Breadcrumbs; + breadcrumbs?: Breadcrumbs; description: string; image: string; meta_description: string; diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index 0eb0c97ddf..8b08c9ac48 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -86,13 +86,6 @@ declare global { fileData?: string; } - export type InjectReducer = (key: string, asyncReducer: Reducer>) => void; - - export type ModifiedReduxStore = (Store> & { - asyncReducers?: ReducersMapObject; - injectReducer?: InjectReducer; - }); - // interface HTMLElementEventMap { // validate: ValidationData // } diff --git a/packages/scandipwa/src/util/Auth/Token.ts b/packages/scandipwa/src/util/Auth/Token.ts index 56bb687915..a49a8abf47 100644 --- a/packages/scandipwa/src/util/Auth/Token.ts +++ b/packages/scandipwa/src/util/Auth/Token.ts @@ -15,7 +15,7 @@ import { deleteGuestQuoteId } from 'Util/Cart'; import { removeUid } from 'Util/Compare'; import { debounce } from 'Util/Request'; import getStore from 'Util/Store'; - +import { RootState } from 'Util/Store/type'; export const AUTH_TOKEN = 'auth_token'; export const ONE_HOUR_IN_SECONDS = 3600; @@ -28,7 +28,7 @@ export const setAuthorizationToken = (token: string | null): void => { return; } - const state = getStore().getState(); + const state = getStore().getState() as RootState; const { access_token_lifetime = ONE_HOUR } = state.ConfigReducer; @@ -55,11 +55,13 @@ export const isInitiallySignedIn = (): boolean => !!getAuthorizationToken(); export const isSignedIn = (): boolean => { const hasAuthToken = !!getAuthorizationToken(); const store = getStore(); + const { MyAccountReducer: { isSignedIn: isCustomerSignedIn = false } = {} - } = store.getState(); + } = store.getState() as RootState; + const { dispatch } = store; if (!hasAuthToken && isCustomerSignedIn) { diff --git a/packages/scandipwa/src/util/Compare/Compare.ts b/packages/scandipwa/src/util/Compare/Compare.ts index f9190a630b..42a55d0cea 100644 --- a/packages/scandipwa/src/util/Compare/Compare.ts +++ b/packages/scandipwa/src/util/Compare/Compare.ts @@ -15,6 +15,7 @@ import { import BrowserDatabase from 'Util/BrowserDatabase'; import { debounce } from 'Util/Request'; import getStore from 'Util/Store'; +import { RootState } from 'Util/Store/type'; /** * @@ -35,7 +36,7 @@ export const ONE_DAY = 86400; * @namespace Util/Compare/setUid */ export const setUid = (uid: string | boolean): void => { - const state = getStore().getState(); + const state = getStore().getState() as RootState; const { access_token_lifetime = ONE_HOUR } = state.ConfigReducer; diff --git a/packages/scandipwa/src/util/Media/Media.ts b/packages/scandipwa/src/util/Media/Media.ts index f1cfe94c46..0ffea10629 100644 --- a/packages/scandipwa/src/util/Media/Media.ts +++ b/packages/scandipwa/src/util/Media/Media.ts @@ -9,6 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ import getStore from 'Util/Store'; +import { RootState } from 'Util/Store/type'; export const WYSIWYG_MEDIA = 'wysiwyg/'; export const CATEGORY_MEDIA = 'catalog/category/'; @@ -18,7 +19,7 @@ export const LOGO_MEDIA = 'logo/'; export default (src: string, subPath = '', isMediaPath = true): string => { // If isMediaPath is passed return local media path - const { ConfigReducer: { secure_base_media_url, base_url } } = getStore().getState(); + const { ConfigReducer: { secure_base_media_url, base_url } } = getStore().getState() as RootState; const baseUrl = isMediaPath ? secure_base_media_url || '/media/' : base_url; diff --git a/packages/scandipwa/src/util/Product/Product.ts b/packages/scandipwa/src/util/Product/Product.ts index 77f61346b9..5f72c020e6 100644 --- a/packages/scandipwa/src/util/Product/Product.ts +++ b/packages/scandipwa/src/util/Product/Product.ts @@ -36,6 +36,7 @@ import { import { isSignedIn } from 'Util/Auth'; import { FormattedProduct } from 'Util/Product/Extract'; import getStore from 'Util/Store'; +import { RootState } from 'Util/Store/type'; export const ADD_TO_CART = 'ADD_TO_CART'; export const ADD_TO_WISHLIST = 'ADD_TO_WISHLIST'; @@ -454,7 +455,7 @@ export const showNewReviewPopup = (): void => { ConfigReducer: { reviews_allow_guest: isGuestEnabled } = {} - } = store.getState(); + } = store.getState() as RootState; const { dispatch } = store; // if not logged in and guest reviews are not enabled diff --git a/packages/scandipwa/src/util/Request/Request.ts b/packages/scandipwa/src/util/Request/Request.ts index 6a1cca3497..5526fe8249 100644 --- a/packages/scandipwa/src/util/Request/Request.ts +++ b/packages/scandipwa/src/util/Request/Request.ts @@ -310,19 +310,19 @@ export class Debouncer < > { timeout!: NodeJS.Timeout; - handler = () => {}; + handler = (): void => {}; - startDebounce = (callback:T, delay: U) => (...args: S[]) => { + startDebounce = (callback:T, delay: U) => (...args: S[]): void => { clearTimeout(this.timeout); this.handler = () => callback.apply(this, args as any); this.timeout = setTimeout(this.handler, delay); }; - cancelDebounce = () => { + cancelDebounce = (): void => { clearTimeout(this.timeout); }; - cancelDebounceAndExecuteImmediately = () => { + cancelDebounceAndExecuteImmediately = (): void => { clearTimeout(this.timeout); this.handler(); }; diff --git a/packages/scandipwa/src/util/Store/type.d.ts b/packages/scandipwa/src/util/Store/type.d.ts new file mode 100644 index 0000000000..ba8362116d --- /dev/null +++ b/packages/scandipwa/src/util/Store/type.d.ts @@ -0,0 +1,37 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { store } from 'Util/Store'; + +/** + * Extend this interface from reducers! + * + * @example + * ```ts + declare module 'Util/Store/type' { + export interface RootState { + BreadcrumbsReducer: BreadcrumbsStore + } + } + * ``` + */ + +export interface RootState {}; + +export type AppDispatch = typeof store.dispatch; + +declare global { + export type InjectReducer = (key: string, asyncReducer: Reducer>) => void; + + export type ModifiedReduxStore = (Store> & { + asyncReducers?: ReducersMapObject; + injectReducer?: InjectReducer; + }); +} diff --git a/packages/scandipwa/src/util/Url/Url.ts b/packages/scandipwa/src/util/Url/Url.ts index b2255e56cf..8739d7b74f 100644 --- a/packages/scandipwa/src/util/Url/Url.ts +++ b/packages/scandipwa/src/util/Url/Url.ts @@ -12,6 +12,7 @@ import { History, Location, Match } from 'Type/Router.type'; import { decodeString } from 'Util/Common'; import getStore from 'Util/Store'; +import { RootState } from 'Util/Store/type'; // TODO move export type KeyValuePairs = Record>; @@ -88,7 +89,7 @@ export const replace = (regex: RegExp, path: string): string => { * @namespace Util/Url/appendWithStoreCode */ export const appendWithStoreCode = (pathname: string): string => { - const { ConfigReducer: { base_link_url = window.location.href } = {} } = getStore().getState() || {}; + const { ConfigReducer: { base_link_url = window.location.href } = {} } = getStore().getState() as RootState || {}; const { pathname: storePrefix } = new URL(base_link_url); if (!pathname) { From dd8443911aff710af95983a29d960f0a5d351b82 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 8 Apr 2022 05:07:53 +0300 Subject: [PATCH 019/192] Migrated some actions to TS --- packages/scandipwa/package.json | 8 ++ ...crumbs.action.js => Breadcrumbs.action.ts} | 13 +-- .../store/Breadcrumbs/Breadcrumbs.reducer.ts | 12 +-- .../{type.ts => Breadcrumbs.type.ts} | 21 ++++- .../Cart/{Cart.action.js => Cart.action.ts} | 48 ++++++----- .../Cart/{Cart.reducer.js => Cart.reducer.ts} | 17 ++-- .../scandipwa/src/store/Cart/Cart.type.ts | 78 ++++++++++++++++++ packages/scandipwa/src/store/Cart/type.ts | 42 ---------- ...{Category.action.js => Category.action.ts} | 11 ++- .../src/store/Category/Category.reducer.ts | 7 +- .../Category/{type.ts => Category.type.ts} | 13 ++- .../src/store/Checkout/Checkout.action.js | 30 ------- .../src/store/Checkout/Checkout.action.ts | 31 +++++++ .../src/store/Checkout/Checkout.reducer.ts | 15 ++-- .../src/store/Checkout/Checkout.type.ts | 46 +++++++++++ packages/scandipwa/src/store/Checkout/type.ts | 35 -------- .../src/store/MyAccount/MyAccount.action.js | 60 -------------- .../src/store/MyAccount/MyAccount.action.ts | 66 +++++++++++++++ .../src/store/MyAccount/MyAccount.reducer.ts | 48 ++++++----- .../src/store/MyAccount/MyAccount.type.ts | 82 +++++++++++++++++++ .../scandipwa/src/store/MyAccount/type.d.ts | 39 --------- 21 files changed, 429 insertions(+), 293 deletions(-) rename packages/scandipwa/src/store/Breadcrumbs/{Breadcrumbs.action.js => Breadcrumbs.action.ts} (61%) rename packages/scandipwa/src/store/Breadcrumbs/{type.ts => Breadcrumbs.type.ts} (51%) rename packages/scandipwa/src/store/Cart/{Cart.action.js => Cart.action.ts} (52%) rename packages/scandipwa/src/store/Cart/{Cart.reducer.js => Cart.reducer.ts} (83%) create mode 100644 packages/scandipwa/src/store/Cart/Cart.type.ts delete mode 100644 packages/scandipwa/src/store/Cart/type.ts rename packages/scandipwa/src/store/Category/{Category.action.js => Category.action.ts} (56%) rename packages/scandipwa/src/store/Category/{type.ts => Category.type.ts} (64%) delete mode 100644 packages/scandipwa/src/store/Checkout/Checkout.action.js create mode 100644 packages/scandipwa/src/store/Checkout/Checkout.action.ts create mode 100644 packages/scandipwa/src/store/Checkout/Checkout.type.ts delete mode 100644 packages/scandipwa/src/store/Checkout/type.ts delete mode 100644 packages/scandipwa/src/store/MyAccount/MyAccount.action.js create mode 100644 packages/scandipwa/src/store/MyAccount/MyAccount.action.ts create mode 100644 packages/scandipwa/src/store/MyAccount/MyAccount.type.ts delete mode 100644 packages/scandipwa/src/store/MyAccount/type.d.ts diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index a7c3ec73fa..cb8b973f61 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -178,6 +178,14 @@ "@scandipwa/scandipwa-guidelines/use-named-export": "off", "@scandipwa/scandipwa-guidelines/create-config-files": "off" } + }, + { + "files": [ + "*.reducer.ts" + ], + "rules": { + "@typescript-eslint/default-param-last": "off" + } } ], "rules": { diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.js b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts similarity index 61% rename from packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.js rename to packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts index 3a2100cfff..d732328485 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.js +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts @@ -9,8 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_BREADCRUMBS = 'UPDATE_BREADCRUMBS'; -export const TOGGLE_BREADCRUMBS = 'TOGGLE_BREADCRUMBS'; +import { Breadcrumbs } from 'Type/Breadcrumbs.type'; + +import { BreadcrumbsActionType, ToggleBreadcrumbsAction, UpdateBreadcrumbsAction } from './Breadcrumbs.type'; /** * Update current breadcrumbs with new breadcrumbs (rewrite if already exists). @@ -18,8 +19,8 @@ export const TOGGLE_BREADCRUMBS = 'TOGGLE_BREADCRUMBS'; * @return {void} * @namespace Store/Breadcrumbs/Action/updateBreadcrumbs */ -export const updateBreadcrumbs = (breadcrumbs) => ({ - type: UPDATE_BREADCRUMBS, +export const updateBreadcrumbs = (breadcrumbs: Breadcrumbs): UpdateBreadcrumbsAction => ({ + type: BreadcrumbsActionType.UPDATE_BREADCRUMBS, breadcrumbs }); @@ -29,7 +30,7 @@ export const updateBreadcrumbs = (breadcrumbs) => ({ * @return {void} * @namespace Store/Breadcrumbs/Action/toggleBreadcrumbs */ -export const toggleBreadcrumbs = (areBreadcrumbsVisible) => ({ - type: TOGGLE_BREADCRUMBS, +export const toggleBreadcrumbs = (areBreadcrumbsVisible: boolean): ToggleBreadcrumbsAction => ({ + type: BreadcrumbsActionType.TOGGLE_BREADCRUMBS, areBreadcrumbsVisible }); diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts index dc7258bb15..b7e4f282e4 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.reducer.ts @@ -11,8 +11,10 @@ import { Reducer } from 'redux'; -import { TOGGLE_BREADCRUMBS, UPDATE_BREADCRUMBS } from './Breadcrumbs.action'; -import { BreadcrumbsAction, BreadcrumbsStore } from './type'; +import { + BreadcrumbsAction, + BreadcrumbsActionType, BreadcrumbsStore +} from './Breadcrumbs.type'; /** @namespace Store/Breadcrumbs/Reducer/getInitialState */ export const getInitialState = (): BreadcrumbsStore => ({ @@ -23,13 +25,13 @@ export const getInitialState = (): BreadcrumbsStore => ({ /** @namespace Store/Breadcrumbs/Reducer/BreadcrumbsReducer */ export const BreadcrumbsReducer: Reducer< BreadcrumbsStore, -BreadcrumbsAction & BreadcrumbsStore +BreadcrumbsAction > = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_BREADCRUMBS: + case BreadcrumbsActionType.UPDATE_BREADCRUMBS: const { breadcrumbs } = action; return { @@ -37,7 +39,7 @@ BreadcrumbsAction & BreadcrumbsStore breadcrumbs }; - case TOGGLE_BREADCRUMBS: + case BreadcrumbsActionType.TOGGLE_BREADCRUMBS: const { areBreadcrumbsVisible } = action; return { diff --git a/packages/scandipwa/src/store/Breadcrumbs/type.ts b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts similarity index 51% rename from packages/scandipwa/src/store/Breadcrumbs/type.ts rename to packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts index 10713d119f..92dfde866b 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/type.ts +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts @@ -8,19 +8,32 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Action } from 'redux'; +import { AnyAction } from 'redux'; import { Breadcrumbs } from 'Type/Breadcrumbs.type'; -import { TOGGLE_BREADCRUMBS, UPDATE_BREADCRUMBS } from './Breadcrumbs.action'; +export enum BreadcrumbsActionType { + UPDATE_BREADCRUMBS = 'UPDATE_BREADCRUMBS', + TOGGLE_BREADCRUMBS = 'TOGGLE_BREADCRUMBS' +} + +export interface ToggleBreadcrumbsAction extends AnyAction { + type: BreadcrumbsActionType.TOGGLE_BREADCRUMBS; + areBreadcrumbsVisible: boolean; +} + +export interface UpdateBreadcrumbsAction extends AnyAction { + type: BreadcrumbsActionType.UPDATE_BREADCRUMBS; + breadcrumbs: Breadcrumbs; +} + +export type BreadcrumbsAction = ToggleBreadcrumbsAction | UpdateBreadcrumbsAction; export type BreadcrumbsStore = { breadcrumbs: Breadcrumbs; areBreadcrumbsVisible: boolean; }; -export type BreadcrumbsAction = Action; - declare module 'Util/Store/type' { export interface RootState { BreadcrumbsReducer: BreadcrumbsStore; diff --git a/packages/scandipwa/src/store/Cart/Cart.action.js b/packages/scandipwa/src/store/Cart/Cart.action.ts similarity index 52% rename from packages/scandipwa/src/store/Cart/Cart.action.js rename to packages/scandipwa/src/store/Cart/Cart.action.ts index e755c2b2cf..7c68d6b016 100644 --- a/packages/scandipwa/src/store/Cart/Cart.action.js +++ b/packages/scandipwa/src/store/Cart/Cart.action.ts @@ -9,13 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -export const ADD_PRODUCT_TO_CART = 'ADD_PRODUCT_TO_CART'; -export const REMOVE_PRODUCT_FROM_CART = 'REMOVE_PRODUCT_FROM_CART'; -export const UPDATE_TOTALS = 'UPDATE_TOTALS'; -export const APPLY_COUPON_TO_CART = 'APPLY_COUPON_TO_CART'; -export const REMOVE_COUPON_FROM_CART = 'REMOVE_COUPON_FROM_CART'; -export const UPDATE_SHIPPING_PRICE = 'UPDATE_SHIPPING_PRICE'; -export const UPDATE_IS_LOADING_CART = 'UPDATE_IS_LOADING_CART'; +import { GQLPaymentTotals, GQLQuoteData } from 'Type/Graphql.type'; +import { Product } from 'Type/ProductList.type'; + +import { + AddProductToCartAction, + ApplyCouponToCartAction, + CartActionType, + RemoveCouponFromCartAction, + RemoveProductFromCartAction, + UpdateIsLoadingCartAction, + UpdateShippingPriceAction, + UpdateTotalsAction +} from './Cart.type'; /** * Update product list with new list (rewrite if already exists). @@ -24,8 +30,8 @@ export const UPDATE_IS_LOADING_CART = 'UPDATE_IS_LOADING_CART'; * @return {void} * @namespace Store/Cart/Action/addProductToCart */ -export const addProductToCart = (newProduct) => ({ - type: ADD_PRODUCT_TO_CART, +export const addProductToCart = (newProduct: Product): AddProductToCartAction => ({ + type: CartActionType.ADD_PRODUCT_TO_CART, newProduct }); @@ -35,8 +41,8 @@ export const addProductToCart = (newProduct) => ({ * @return {void} * @namespace Store/Cart/Action/removeProductFromCart */ -export const removeProductFromCart = (product) => ({ - type: REMOVE_PRODUCT_FROM_CART, +export const removeProductFromCart = (product: Product): RemoveProductFromCartAction => ({ + type: CartActionType.REMOVE_PRODUCT_FROM_CART, product }); @@ -46,8 +52,8 @@ export const removeProductFromCart = (product) => ({ * @return {void} * @namespace Store/Cart/Action/updateTotals */ -export const updateTotals = (cartData) => ({ - type: UPDATE_TOTALS, +export const updateTotals = (cartData: GQLQuoteData): UpdateTotalsAction => ({ + type: CartActionType.UPDATE_TOTALS, cartData }); @@ -57,8 +63,8 @@ export const updateTotals = (cartData) => ({ * @return {void} * @namespace Store/Cart/Action/updateShippingPrice */ -export const updateShippingPrice = (data) => ({ - type: UPDATE_SHIPPING_PRICE, +export const updateShippingPrice = (data: GQLPaymentTotals): UpdateShippingPriceAction => ({ + type: CartActionType.UPDATE_SHIPPING_PRICE, data }); @@ -68,8 +74,8 @@ export const updateShippingPrice = (data) => ({ * @return {void} * @namespace Store/Cart/Action/applyCouponToCart */ -export const applyCouponToCart = (couponCode) => ({ - type: APPLY_COUPON_TO_CART, +export const applyCouponToCart = (couponCode: string): ApplyCouponToCartAction => ({ + type: CartActionType.APPLY_COUPON_TO_CART, couponCode }); @@ -78,12 +84,12 @@ export const applyCouponToCart = (couponCode) => ({ * @return {void} * @namespace Store/Cart/Action/removeCouponFromCart */ -export const removeCouponFromCart = () => ({ - type: REMOVE_COUPON_FROM_CART +export const removeCouponFromCart = (): RemoveCouponFromCartAction => ({ + type: CartActionType.REMOVE_COUPON_FROM_CART }); /** @namespace Store/Cart/Action/updateIsLoadingCart */ -export const updateIsLoadingCart = (isLoading) => ({ - type: UPDATE_IS_LOADING_CART, +export const updateIsLoadingCart = (isLoading: boolean): UpdateIsLoadingCartAction => ({ + type: CartActionType.UPDATE_IS_LOADING_CART, isLoading }); diff --git a/packages/scandipwa/src/store/Cart/Cart.reducer.js b/packages/scandipwa/src/store/Cart/Cart.reducer.ts similarity index 83% rename from packages/scandipwa/src/store/Cart/Cart.reducer.js rename to packages/scandipwa/src/store/Cart/Cart.reducer.ts index c61345c154..631c091384 100644 --- a/packages/scandipwa/src/store/Cart/Cart.reducer.js +++ b/packages/scandipwa/src/store/Cart/Cart.reducer.ts @@ -9,11 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; + import BrowserDatabase from 'Util/BrowserDatabase'; import { getIndexedProduct } from 'Util/Product'; -import { UPDATE_IS_LOADING_CART, UPDATE_SHIPPING_PRICE, UPDATE_TOTALS } from './Cart.action'; -import { CartAction } from './type'; +import { CartAction, CartActionType, CartStore } from './Cart.type'; export const CART_TOTALS = 'cart_totals'; @@ -63,24 +64,24 @@ export const updateShippingPrice = (action, state) => { }; /** @namespace Store/Cart/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): CartStore => ({ isLoading: false, cartTotals: BrowserDatabase.getItem(CART_TOTALS) || {} }); /** @namespace Store/Cart/Reducer/CartReducer */ -export const CartReducer = ( +export const CartReducer: Reducer = ( state = getInitialState(), action ) => { const { type } = action; switch (type) { - case UPDATE_TOTALS: - return updateCartTotals(action, state); - case UPDATE_SHIPPING_PRICE: + case CartActionType.UPDATE_TOTALS: + return updateCartTotals(action); + case CartActionType.UPDATE_SHIPPING_PRICE: return updateShippingPrice(action, state); - case UPDATE_IS_LOADING_CART: + case CartActionType.UPDATE_IS_LOADING_CART: const { isLoading } = action; return { diff --git a/packages/scandipwa/src/store/Cart/Cart.type.ts b/packages/scandipwa/src/store/Cart/Cart.type.ts new file mode 100644 index 0000000000..8517b51507 --- /dev/null +++ b/packages/scandipwa/src/store/Cart/Cart.type.ts @@ -0,0 +1,78 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { AnyAction } from 'redux'; + +import { GQLPaymentTotals, GQLQuoteData } from 'Type/Graphql.type'; +import { Product } from 'Type/ProductList.type'; + +export enum CartActionType { + ADD_PRODUCT_TO_CART = 'ADD_PRODUCT_TO_CART', + REMOVE_PRODUCT_FROM_CART = 'REMOVE_PRODUCT_FROM_CART', + UPDATE_TOTALS = 'UPDATE_TOTALS', + APPLY_COUPON_TO_CART = 'APPLY_COUPON_TO_CART', + REMOVE_COUPON_FROM_CART = 'REMOVE_COUPON_FROM_CART', + UPDATE_SHIPPING_PRICE = 'UPDATE_SHIPPING_PRICE', + UPDATE_IS_LOADING_CART = 'UPDATE_IS_LOADING_CART' +} + +export interface AddProductToCartAction extends AnyAction { + type: CartActionType.ADD_PRODUCT_TO_CART; + newProduct: Product; +} + +export interface RemoveProductFromCartAction extends AnyAction { + type: CartActionType.REMOVE_PRODUCT_FROM_CART; + product: Product; +} + +export interface UpdateTotalsAction extends AnyAction { + type: CartActionType.UPDATE_TOTALS; + cartData: GQLQuoteData; +} + +export interface UpdateShippingPriceAction extends AnyAction { + type: CartActionType.UPDATE_SHIPPING_PRICE; + data: GQLPaymentTotals; +} + +export interface ApplyCouponToCartAction extends AnyAction { + type: CartActionType.APPLY_COUPON_TO_CART; + couponCode: string; +} + +export interface RemoveCouponFromCartAction extends AnyAction { + type: CartActionType.REMOVE_COUPON_FROM_CART; +} + +export interface UpdateIsLoadingCartAction extends AnyAction { + type: CartActionType.UPDATE_IS_LOADING_CART; + isLoading: boolean; +} + +export type CartAction = AddProductToCartAction +| RemoveProductFromCartAction +| UpdateTotalsAction +| UpdateShippingPriceAction +| ApplyCouponToCartAction +| RemoveCouponFromCartAction +| UpdateIsLoadingCartAction; + +export type CartStore = { + isLoading: boolean; + cartTotals: Record; +}; + +declare module 'Util/Store/type' { + export interface RootState { + CartReducer: CartStore; + } +} diff --git a/packages/scandipwa/src/store/Cart/type.ts b/packages/scandipwa/src/store/Cart/type.ts deleted file mode 100644 index aa912c101a..0000000000 --- a/packages/scandipwa/src/store/Cart/type.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -import { Action } from 'redux'; - -import { - ADD_PRODUCT_TO_CART, - APPLY_COUPON_TO_CART, - REMOVE_COUPON_FROM_CART, - REMOVE_PRODUCT_FROM_CART, - UPDATE_IS_LOADING_CART, - UPDATE_SHIPPING_PRICE, - UPDATE_TOTALS -} from './Cart.action'; - -export type CartStore = { - isLoading: boolean; - cartTotals: Record; -}; - -export type CartAction = Action< - typeof ADD_PRODUCT_TO_CART -| typeof REMOVE_PRODUCT_FROM_CART -| typeof UPDATE_TOTALS -| typeof APPLY_COUPON_TO_CART -| typeof REMOVE_COUPON_FROM_CART -| typeof UPDATE_SHIPPING_PRICE -| typeof UPDATE_IS_LOADING_CART ->; - -declare module 'Util/Store/type' { - export interface RootState { - CartReducer: CartStore; - } -} diff --git a/packages/scandipwa/src/store/Category/Category.action.js b/packages/scandipwa/src/store/Category/Category.action.ts similarity index 56% rename from packages/scandipwa/src/store/Category/Category.action.js rename to packages/scandipwa/src/store/Category/Category.action.ts index 64d221c5b2..fe82e1fb7b 100644 --- a/packages/scandipwa/src/store/Category/Category.action.js +++ b/packages/scandipwa/src/store/Category/Category.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,7 +10,9 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_CURRENT_CATEGORY = 'UPDATE_CURRENT_CATEGORY'; +import { CategoryFragment } from 'Type/Category.type'; + +import { CategoryActionType, UpdateCurrentCategoryAction } from './Category.type'; /** * Update Current Category @@ -17,7 +20,9 @@ export const UPDATE_CURRENT_CATEGORY = 'UPDATE_CURRENT_CATEGORY'; * @return {void} * @namespace Store/Category/Action/updateCurrentCategory */ -export const updateCurrentCategory = (category) => ({ - type: UPDATE_CURRENT_CATEGORY, +export const updateCurrentCategory = ( + category: CategoryFragment | Record +): UpdateCurrentCategoryAction => ({ + type: CategoryActionType.UPDATE_CURRENT_CATEGORY, category }); diff --git a/packages/scandipwa/src/store/Category/Category.reducer.ts b/packages/scandipwa/src/store/Category/Category.reducer.ts index d493c7c8ed..1d615fc01d 100644 --- a/packages/scandipwa/src/store/Category/Category.reducer.ts +++ b/packages/scandipwa/src/store/Category/Category.reducer.ts @@ -11,8 +11,7 @@ import { Reducer } from 'redux'; -import { UPDATE_CURRENT_CATEGORY } from './Category.action'; -import { CategoryAction, CategoryStore } from './type'; +import { CategoryActionType, CategoryStore, UpdateCurrentCategoryAction } from './Category.type'; /** @namespace Store/Category/Reducer/getInitialState */ export const getInitialState = (): CategoryStore => ({ @@ -22,13 +21,13 @@ export const getInitialState = (): CategoryStore => ({ /** @namespace Store/Category/Reducer/CategoryReducer */ export const CategoryReducer: Reducer< CategoryStore, -CategoryAction & CategoryStore +UpdateCurrentCategoryAction > = ( state = getInitialState(), { type, category } ) => { switch (type) { - case UPDATE_CURRENT_CATEGORY: + case CategoryActionType.UPDATE_CURRENT_CATEGORY: return { ...state, category: { ...category } diff --git a/packages/scandipwa/src/store/Category/type.ts b/packages/scandipwa/src/store/Category/Category.type.ts similarity index 64% rename from packages/scandipwa/src/store/Category/type.ts rename to packages/scandipwa/src/store/Category/Category.type.ts index 271bdbbe3e..dbd3f51d50 100644 --- a/packages/scandipwa/src/store/Category/type.ts +++ b/packages/scandipwa/src/store/Category/Category.type.ts @@ -8,18 +8,23 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Action } from 'redux'; +import { AnyAction } from 'redux'; import { CategoryFragment } from 'Type/Category.type'; -import { UPDATE_CURRENT_CATEGORY } from './Category.action'; +export enum CategoryActionType { + UPDATE_CURRENT_CATEGORY = 'UPDATE_CURRENT_CATEGORY' +} + +export interface UpdateCurrentCategoryAction extends AnyAction { + type: CategoryActionType.UPDATE_CURRENT_CATEGORY; + category: CategoryFragment | Record; +} export type CategoryStore = { category: CategoryFragment | Record; }; -export type CategoryAction = Action; - declare module 'Util/Store/type' { export interface RootState { CategoryReducer: CategoryStore; diff --git a/packages/scandipwa/src/store/Checkout/Checkout.action.js b/packages/scandipwa/src/store/Checkout/Checkout.action.js deleted file mode 100644 index 2c88c1b53d..0000000000 --- a/packages/scandipwa/src/store/Checkout/Checkout.action.js +++ /dev/null @@ -1,30 +0,0 @@ -/** * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -export const UPDATE_SHIPPING_FIELDS = 'UPDATE_SHIPPING_FIELDS'; -export const UPDATE_EMAIL = 'UPDATE_EMAIL'; -export const UPDATE_EMAIL_AVAILABLE = 'UPDATE_EMAIL_AVAILABLE'; - -/** @namespace Store/Checkout/Action/updateShippingFields */ -export const updateShippingFields = (shippingFields) => ({ - type: UPDATE_SHIPPING_FIELDS, - shippingFields -}); - -/** @namespace Store/Checkout/Action/updateEmail */ -export const updateEmail = (email) => ({ - type: UPDATE_EMAIL, - email -}); - -/** @namespace Store/Checkout/Action/updateEmailAvailable */ -export const updateEmailAvailable = (isEmailAvailable) => ({ - type: UPDATE_EMAIL_AVAILABLE, - isEmailAvailable -}); diff --git a/packages/scandipwa/src/store/Checkout/Checkout.action.ts b/packages/scandipwa/src/store/Checkout/Checkout.action.ts new file mode 100644 index 0000000000..323b56691a --- /dev/null +++ b/packages/scandipwa/src/store/Checkout/Checkout.action.ts @@ -0,0 +1,31 @@ +/** * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { + CheckoutActionType, UpdateEmailAction, UpdateEmailAvailableAction, UpdateShippingFieldsAction +} from './Checkout.type'; + +/** @namespace Store/Checkout/Action/updateShippingFields */ +export const updateShippingFields = (shippingFields: Record): UpdateShippingFieldsAction => ({ + type: CheckoutActionType.UPDATE_SHIPPING_FIELDS, + shippingFields +}); + +/** @namespace Store/Checkout/Action/updateEmail */ +export const updateEmail = (email: string): UpdateEmailAction => ({ + type: CheckoutActionType.UPDATE_EMAIL, + email +}); + +/** @namespace Store/Checkout/Action/updateEmailAvailable */ +export const updateEmailAvailable = (isEmailAvailable: boolean): UpdateEmailAvailableAction => ({ + type: CheckoutActionType.UPDATE_EMAIL_AVAILABLE, + isEmailAvailable +}); diff --git a/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts b/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts index 2cb50d02f3..9b14873061 100644 --- a/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts +++ b/packages/scandipwa/src/store/Checkout/Checkout.reducer.ts @@ -11,12 +11,7 @@ import { Reducer } from 'redux'; -import { - UPDATE_EMAIL, - UPDATE_EMAIL_AVAILABLE, - UPDATE_SHIPPING_FIELDS -} from './Checkout.action'; -import { CheckoutAction, CheckoutStore } from './type'; +import { CheckoutAction, CheckoutActionType, CheckoutStore } from './Checkout.type'; /** @namespace Store/Checkout/Reducer/getInitialState */ export const getInitialState = (): CheckoutStore => ({ @@ -28,13 +23,13 @@ export const getInitialState = (): CheckoutStore => ({ /** @namespace Store/Checkout/Reducer/CheckoutReducer */ export const CheckoutReducer: Reducer< CheckoutStore, -CheckoutAction & CheckoutStore +CheckoutAction > = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_SHIPPING_FIELDS: + case CheckoutActionType.UPDATE_SHIPPING_FIELDS: const { shippingFields } = action; return { @@ -42,7 +37,7 @@ CheckoutAction & CheckoutStore shippingFields }; - case UPDATE_EMAIL: + case CheckoutActionType.UPDATE_EMAIL: const { email } = action; return { @@ -50,7 +45,7 @@ CheckoutAction & CheckoutStore email }; - case UPDATE_EMAIL_AVAILABLE: + case CheckoutActionType.UPDATE_EMAIL_AVAILABLE: const { isEmailAvailable } = action; return { diff --git a/packages/scandipwa/src/store/Checkout/Checkout.type.ts b/packages/scandipwa/src/store/Checkout/Checkout.type.ts new file mode 100644 index 0000000000..c93d5ef730 --- /dev/null +++ b/packages/scandipwa/src/store/Checkout/Checkout.type.ts @@ -0,0 +1,46 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +export enum CheckoutActionType { + UPDATE_SHIPPING_FIELDS = 'UPDATE_SHIPPING_FIELDS', + UPDATE_EMAIL = 'UPDATE_EMAIL', + UPDATE_EMAIL_AVAILABLE = 'UPDATE_EMAIL_AVAILABLE' +} + +export interface UpdateShippingFieldsAction extends AnyAction { + type: CheckoutActionType.UPDATE_SHIPPING_FIELDS; + shippingFields: Record; +} +export interface UpdateEmailAction extends AnyAction { + type: CheckoutActionType.UPDATE_EMAIL; + email: string; +} +export interface UpdateEmailAvailableAction extends AnyAction { + type: CheckoutActionType.UPDATE_EMAIL_AVAILABLE; + isEmailAvailable: boolean; +} + +export type CheckoutAction = UpdateShippingFieldsAction +| UpdateEmailAction +| UpdateEmailAvailableAction; + +export type CheckoutStore = { + shippingFields: Record; + email: string; + isEmailAvailable: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + CheckoutReducer: CheckoutStore; + } +} diff --git a/packages/scandipwa/src/store/Checkout/type.ts b/packages/scandipwa/src/store/Checkout/type.ts deleted file mode 100644 index 5791b865d5..0000000000 --- a/packages/scandipwa/src/store/Checkout/type.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -import { Action } from 'redux'; - -import { - UPDATE_EMAIL, - UPDATE_EMAIL_AVAILABLE, - UPDATE_SHIPPING_FIELDS -} from './Checkout.action'; - -export type CheckoutStore = { - shippingFields: Record; - email: string; - isEmailAvailable: boolean; -}; - -export type CheckoutAction = Action< - typeof UPDATE_EMAIL -| typeof UPDATE_EMAIL_AVAILABLE -| typeof UPDATE_SHIPPING_FIELDS ->; - -declare module 'Util/Store/type' { - export interface RootState { - CheckoutReducer: CheckoutStore; - } -} diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.action.js b/packages/scandipwa/src/store/MyAccount/MyAccount.action.js deleted file mode 100644 index faab9a3589..0000000000 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.action.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const UPDATE_CUSTOMER_SIGN_IN_STATUS = 'UPDATE_CUSTOMER_SIGN_IN_STATUS'; -export const UPDATE_CUSTOMER_DETAILS = 'UPDATE_CUSTOMER_DETAILS'; -export const UPDATE_CUSTOMER_PASSWORD_RESET_STATUS = 'UPDATE_CUSTOMER_PASSWORD_RESET_STATUS'; -export const UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS = 'UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS'; -export const UPDATE_CUSTOMER_IS_LOADING = 'UPDATE_CUSTOMER_IS_LOADING'; -export const UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL = 'UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL'; -export const UPDATE_CUSTOMER_IS_LOCKED = 'UPDATE_CUSTOMER_IS_LOCKED'; - -/** @namespace Store/MyAccount/Action/updateCustomerSignInStatus */ -export const updateCustomerSignInStatus = (status) => ({ - type: UPDATE_CUSTOMER_SIGN_IN_STATUS, - status -}); - -/** @namespace Store/MyAccount/Action/updateCustomerDetails */ -export const updateCustomerDetails = (customer) => ({ - type: UPDATE_CUSTOMER_DETAILS, - customer -}); - -/** @namespace Store/MyAccount/Action/updateCustomerPasswordResetStatus */ -export const updateCustomerPasswordResetStatus = (status, message) => ({ - type: UPDATE_CUSTOMER_PASSWORD_RESET_STATUS, - status, - message -}); - -/** @namespace Store/MyAccount/Action/updateCustomerPasswordForgotStatus */ -export const updateCustomerPasswordForgotStatus = () => ({ - type: UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS -}); - -/** @namespace Store/MyAccount/Action/updateIsLoading */ -export const updateIsLoading = (isLoading) => ({ - type: UPDATE_CUSTOMER_IS_LOADING, - isLoading -}); - -/** @namespace Store/MyAccount/Action/updateCustomerPasswordForgotEmail */ -export const updateCustomerPasswordForgotEmail = (email) => ({ - type: UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL, - email -}); - -/** @namespace Store/MyAccount/Action/updateIsLocked */ -export const updateIsLocked = (isLocked) => ({ - type: UPDATE_CUSTOMER_IS_LOCKED, - isLocked -}); diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts new file mode 100644 index 0000000000..5a1b22956f --- /dev/null +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts @@ -0,0 +1,66 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { + MyAccountActionType, + UpdateCustomerDetailsAction, + UpdateCustomerPasswordForgotEmailAction, + UpdateCustomerPasswordForgotStatusAction, + UpdateCustomerPasswordResetStatusAction, + UpdateCustomerSignInStatusAction, + UpdateIsLoadingAction, + UpdateIsLockedAction +} from './MyAccount.type'; + +/** @namespace Store/MyAccount/Action/updateCustomerSignInStatus */ +export const updateCustomerSignInStatus = (status: boolean): UpdateCustomerSignInStatusAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_SIGN_IN_STATUS, + status +}); + +/** @namespace Store/MyAccount/Action/updateCustomerDetails */ +export const updateCustomerDetails = (customer: Record): UpdateCustomerDetailsAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_DETAILS, + customer +}); + +/** @namespace Store/MyAccount/Action/updateCustomerPasswordResetStatus */ +export const updateCustomerPasswordResetStatus = ( + status: boolean, + message: string +): UpdateCustomerPasswordResetStatusAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_RESET_STATUS, + status, + message +}); + +/** @namespace Store/MyAccount/Action/updateCustomerPasswordForgotStatus */ +export const updateCustomerPasswordForgotStatus = (): UpdateCustomerPasswordForgotStatusAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS +}); + +/** @namespace Store/MyAccount/Action/updateIsLoading */ +export const updateIsLoading = (isLoading: boolean): UpdateIsLoadingAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_IS_LOADING, + isLoading +}); + +/** @namespace Store/MyAccount/Action/updateCustomerPasswordForgotEmail */ +export const updateCustomerPasswordForgotEmail = (email: string): UpdateCustomerPasswordForgotEmailAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL, + email +}); + +/** @namespace Store/MyAccount/Action/updateIsLocked */ +export const updateIsLocked = (isLocked: boolean): UpdateIsLockedAction => ({ + type: MyAccountActionType.UPDATE_CUSTOMER_IS_LOCKED, + isLocked +}); diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts index b3508d3019..e411ddcd5c 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.reducer.ts @@ -12,16 +12,7 @@ import { Reducer } from 'redux'; import { isInitiallySignedIn } from 'Util/Auth'; -import { - UPDATE_CUSTOMER_DETAILS, - UPDATE_CUSTOMER_IS_LOADING, - UPDATE_CUSTOMER_IS_LOCKED, - UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL, - UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS, - UPDATE_CUSTOMER_PASSWORD_RESET_STATUS, - UPDATE_CUSTOMER_SIGN_IN_STATUS -} from './MyAccount.action'; -import { MyAccountAction, MyAccountStore } from './type'; +import { MyAccountAction, MyAccountActionType, MyAccountStore } from './MyAccount.type'; /** @namespace Store/MyAccount/Reducer/getInitialState */ export const getInitialState = (): MyAccountStore => ({ @@ -39,60 +30,73 @@ export const getInitialState = (): MyAccountStore => ({ /** @namespace Store/MyAccount/Reducer/MyAccountReducer */ export const MyAccountReducer: Reducer< MyAccountStore, -MyAccountAction & MyAccountStore +MyAccountAction > = ( state = getInitialState(), action ) => { - const { - status, customer, message, email - } = action; - switch (action.type) { - case UPDATE_CUSTOMER_SIGN_IN_STATUS: + case MyAccountActionType.UPDATE_CUSTOMER_SIGN_IN_STATUS: { + const { status } = action; + return { ...state, isSignedIn: status }; + } + + case MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_RESET_STATUS: { + const { status, message } = action; - case UPDATE_CUSTOMER_PASSWORD_RESET_STATUS: return { ...state, passwordResetStatus: status, passwordResetMessage: message }; + } - case UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS: + case MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS: { return { ...state, isPasswordForgotSend: !state.isPasswordForgotSend }; + } + + case MyAccountActionType.UPDATE_CUSTOMER_DETAILS: { + const { customer } = action; - case UPDATE_CUSTOMER_DETAILS: return { ...state, customer }; - case UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL: + } + + case MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL: { + const { email } = action; + return { ...state, email }; - case UPDATE_CUSTOMER_IS_LOADING: + } + + case MyAccountActionType.UPDATE_CUSTOMER_IS_LOADING: { const { isLoading } = action; return { ...state, isLoading }; + } - case UPDATE_CUSTOMER_IS_LOCKED: + case MyAccountActionType.UPDATE_CUSTOMER_IS_LOCKED: { const { isLocked } = action; return { ...state, isLocked }; + } default: return state; diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts new file mode 100644 index 0000000000..646b94b25b --- /dev/null +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts @@ -0,0 +1,82 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +export enum MyAccountActionType { + UPDATE_CUSTOMER_SIGN_IN_STATUS = 'UPDATE_CUSTOMER_SIGN_IN_STATUS', + UPDATE_CUSTOMER_DETAILS = 'UPDATE_CUSTOMER_DETAILS', + UPDATE_CUSTOMER_PASSWORD_RESET_STATUS = 'UPDATE_CUSTOMER_PASSWORD_RESET_STATUS', + UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS = 'UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS', + UPDATE_CUSTOMER_IS_LOADING = 'UPDATE_CUSTOMER_IS_LOADING', + UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL = 'UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL', + UPDATE_CUSTOMER_IS_LOCKED = 'UPDATE_CUSTOMER_IS_LOCKED' +} + +export interface UpdateCustomerSignInStatusAction { + type: MyAccountActionType.UPDATE_CUSTOMER_SIGN_IN_STATUS; + status: boolean; +} + +export interface UpdateCustomerDetailsAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_DETAILS; + customer: Record; +} + +export interface UpdateCustomerPasswordResetStatusAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_RESET_STATUS; + status: boolean; + message: string; +} + +export interface UpdateCustomerPasswordForgotStatusAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS; +} + +export interface UpdateIsLoadingAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_IS_LOADING; + isLoading: boolean; +} + +export interface UpdateCustomerPasswordForgotEmailAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL; + email: string; +} + +export interface UpdateIsLockedAction extends AnyAction { + type: MyAccountActionType.UPDATE_CUSTOMER_IS_LOCKED; + isLocked: boolean; +} + +export type MyAccountAction = UpdateCustomerSignInStatusAction +| UpdateCustomerDetailsAction +| UpdateCustomerPasswordResetStatusAction +| UpdateCustomerPasswordForgotStatusAction +| UpdateIsLoadingAction +| UpdateCustomerPasswordForgotEmailAction +| UpdateIsLockedAction; + +export type MyAccountStore = { + isSignedIn: boolean; + passwordResetStatus: boolean; + isPasswordForgotSend: boolean; + isLoading: boolean; + isLocked: boolean; + customer: Record; + message: string; + email: string; + status: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + MyAccountReducer: MyAccountStore; + } +} diff --git a/packages/scandipwa/src/store/MyAccount/type.d.ts b/packages/scandipwa/src/store/MyAccount/type.d.ts deleted file mode 100644 index 2c29550a2e..0000000000 --- a/packages/scandipwa/src/store/MyAccount/type.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -import { Action } from 'redux'; - -export type MyAccountStore = { - isSignedIn: boolean; - passwordResetStatus: boolean; - isPasswordForgotSend: boolean; - isLoading: boolean; - isLocked: boolean; - customer: Record; - message: string; - email: string; - status: boolean; -}; - -export type MyAccountAction = Action< - typeof UPDATE_CUSTOMER_DETAILS -| typeof UPDATE_CUSTOMER_IS_LOADING -| typeof UPDATE_CUSTOMER_IS_LOCKED -| typeof UPDATE_CUSTOMER_PASSWORD_FORGOT_EMAIL -| typeof UPDATE_CUSTOMER_PASSWORD_FORGOT_STATUS -| typeof UPDATE_CUSTOMER_PASSWORD_RESET_STATUS -| typeof UPDATE_CUSTOMER_SIGN_IN_STATUS ->; - -declare module 'Util/Store/type' { - export interface RootState { - MyAccountReducer: MyAccountStore; - } -} From 95571a8829596fec5576952d499822ee5593ab32 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 8 Apr 2022 05:39:30 +0300 Subject: [PATCH 020/192] Migrated some actions to TS --- .../{Offline.action.js => Offline.action.ts} | 11 ++-- .../src/store/Offline/Offline.reducer.ts | 12 ++--- .../src/store/Offline/Offline.type.ts | 39 +++++++++++++++ packages/scandipwa/src/store/Offline/type.ts | 32 ------------ .../{Overlay.action.js => Overlay.action.ts} | 18 +++---- ...{Overlay.reducer.js => Overlay.reducer.ts} | 21 ++++---- .../src/store/Overlay/Overlay.type.ts | 50 +++++++++++++++++++ .../{Popup.action.js => Popup.action.ts} | 7 +-- .../src/store/Popup/Popup.reducer.ts | 13 +++-- .../store/Popup/{type.ts => Popup.type.ts} | 20 ++++++-- 10 files changed, 144 insertions(+), 79 deletions(-) rename packages/scandipwa/src/store/Offline/{Offline.action.js => Offline.action.ts} (61%) create mode 100644 packages/scandipwa/src/store/Offline/Offline.type.ts delete mode 100644 packages/scandipwa/src/store/Offline/type.ts rename packages/scandipwa/src/store/Overlay/{Overlay.action.js => Overlay.action.ts} (50%) rename packages/scandipwa/src/store/Overlay/{Overlay.reducer.js => Overlay.reducer.ts} (72%) create mode 100644 packages/scandipwa/src/store/Overlay/Overlay.type.ts rename packages/scandipwa/src/store/Popup/{Popup.action.js => Popup.action.ts} (61%) rename packages/scandipwa/src/store/Popup/{type.ts => Popup.type.ts} (52%) diff --git a/packages/scandipwa/src/store/Offline/Offline.action.js b/packages/scandipwa/src/store/Offline/Offline.action.ts similarity index 61% rename from packages/scandipwa/src/store/Offline/Offline.action.js rename to packages/scandipwa/src/store/Offline/Offline.action.ts index a3f567b745..47b1456d31 100644 --- a/packages/scandipwa/src/store/Offline/Offline.action.js +++ b/packages/scandipwa/src/store/Offline/Offline.action.ts @@ -9,8 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -export const SHOW_OFFLINE_NOTICE = 'SHOW_OFFLINE_NOTICE'; -export const SET_BIG_OFFLINE_NOTICE = 'SET_BIG_OFFLINE_NOTICE'; +import { OfflineActionType, SetBigOfflineNoticeAction, ShowOfflineNoticeAction } from './Offline.type'; /** * Show offline notice. @@ -18,8 +17,8 @@ export const SET_BIG_OFFLINE_NOTICE = 'SET_BIG_OFFLINE_NOTICE'; * @return {void} * @namespace Store/Offline/Action/showOfflineNotice */ -export const showOfflineNotice = (isOffline) => ({ - type: SHOW_OFFLINE_NOTICE, +export const showOfflineNotice = (isOffline: boolean): ShowOfflineNoticeAction => ({ + type: OfflineActionType.SHOW_OFFLINE_NOTICE, isOffline }); @@ -29,7 +28,7 @@ export const showOfflineNotice = (isOffline) => ({ * @return {void} * @namespace Store/Offline/Action/setBigOfflineNotice */ -export const setBigOfflineNotice = (isBig) => ({ - type: SET_BIG_OFFLINE_NOTICE, +export const setBigOfflineNotice = (isBig: boolean): SetBigOfflineNoticeAction => ({ + type: OfflineActionType.SET_BIG_OFFLINE_NOTICE, isBig }); diff --git a/packages/scandipwa/src/store/Offline/Offline.reducer.ts b/packages/scandipwa/src/store/Offline/Offline.reducer.ts index 921c8ed414..0b8d19b23e 100644 --- a/packages/scandipwa/src/store/Offline/Offline.reducer.ts +++ b/packages/scandipwa/src/store/Offline/Offline.reducer.ts @@ -10,11 +10,7 @@ */ import { Reducer } from 'redux'; -import { - SET_BIG_OFFLINE_NOTICE, - SHOW_OFFLINE_NOTICE -} from './Offline.action'; -import { OfflineAction, OfflineStore } from './type'; +import { OfflineAction, OfflineActionType, OfflineStore } from './Offline.type'; /** @namespace Store/Offline/Reducer/getInitialState */ export const getInitialState = (): OfflineStore => ({ @@ -25,20 +21,20 @@ export const getInitialState = (): OfflineStore => ({ /** @namespace Store/Offline/Reducer/OfflineReducer */ export const OfflineReducer: Reducer< OfflineStore, -OfflineAction & OfflineStore +OfflineAction > = ( state = getInitialState(), action ) => { switch (action.type) { - case SHOW_OFFLINE_NOTICE: + case OfflineActionType.SHOW_OFFLINE_NOTICE: const { isOffline } = action; return { ...state, isOffline }; - case SET_BIG_OFFLINE_NOTICE: + case OfflineActionType.SET_BIG_OFFLINE_NOTICE: const { isBig } = action; return { diff --git a/packages/scandipwa/src/store/Offline/Offline.type.ts b/packages/scandipwa/src/store/Offline/Offline.type.ts new file mode 100644 index 0000000000..51fbda7e59 --- /dev/null +++ b/packages/scandipwa/src/store/Offline/Offline.type.ts @@ -0,0 +1,39 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +export enum OfflineActionType { + SHOW_OFFLINE_NOTICE = 'SHOW_OFFLINE_NOTICE', + SET_BIG_OFFLINE_NOTICE = 'SET_BIG_OFFLINE_NOTICE' +} + +export interface ShowOfflineNoticeAction extends AnyAction { + type: OfflineActionType.SHOW_OFFLINE_NOTICE; + isOffline: boolean; +} + +export interface SetBigOfflineNoticeAction extends AnyAction { + type: OfflineActionType.SET_BIG_OFFLINE_NOTICE; + isBig: boolean; +} + +export type OfflineAction = ShowOfflineNoticeAction | SetBigOfflineNoticeAction; + +export type OfflineStore = { + isOffline: boolean; + isBig: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + OfflineReducer: OfflineStore; + } +} diff --git a/packages/scandipwa/src/store/Offline/type.ts b/packages/scandipwa/src/store/Offline/type.ts deleted file mode 100644 index 4226466e96..0000000000 --- a/packages/scandipwa/src/store/Offline/type.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -import { Action } from 'redux'; - -import { - SET_BIG_OFFLINE_NOTICE, - SHOW_OFFLINE_NOTICE -} from './Offline.action'; - -export type OfflineStore = { - isOffline: boolean; - isBig: boolean; -}; - -export type OfflineAction = Action< - typeof SET_BIG_OFFLINE_NOTICE -| typeof SHOW_OFFLINE_NOTICE ->; - -declare module 'Util/Store/type' { - export interface RootState { - OfflineReducer: OfflineStore; - } -} diff --git a/packages/scandipwa/src/store/Overlay/Overlay.action.js b/packages/scandipwa/src/store/Overlay/Overlay.action.ts similarity index 50% rename from packages/scandipwa/src/store/Overlay/Overlay.action.js rename to packages/scandipwa/src/store/Overlay/Overlay.action.ts index f313151bf0..19d067e910 100644 --- a/packages/scandipwa/src/store/Overlay/Overlay.action.js +++ b/packages/scandipwa/src/store/Overlay/Overlay.action.ts @@ -9,23 +9,23 @@ * @link https://github.com/scandipwa/base-theme */ -export const TOGGLE_OVERLAY = 'TOGGLE_OVERLAY'; -export const HIDE_ACTIVE_OVERLAY = 'HIDE_ACTIVE_OVERLAY'; -export const HIDE_ACTIVE_POPUP = 'HIDE_ACTIVE_POPUP'; +import { + HideActiveOverlayAction, HideActivePopupAction, OverlayActionType, ToggleOverlayByKeyAction +} from './Overlay.type'; /** @namespace Store/Overlay/Action/toggleOverlayByKey */ -export const toggleOverlayByKey = (overlayKey) => ({ - type: TOGGLE_OVERLAY, +export const toggleOverlayByKey = (overlayKey: string): ToggleOverlayByKeyAction => ({ + type: OverlayActionType.TOGGLE_OVERLAY, overlayKey }); /** @namespace Store/Overlay/Action/hideActiveOverlay */ -export const hideActiveOverlay = () => ({ - type: HIDE_ACTIVE_OVERLAY +export const hideActiveOverlay = (): HideActiveOverlayAction => ({ + type: OverlayActionType.HIDE_ACTIVE_OVERLAY }); /** @namespace Store/Overlay/Action/hideActivePopup */ -export const hideActivePopup = (shouldPopupClose = true) => ({ - type: HIDE_ACTIVE_POPUP, +export const hideActivePopup = (shouldPopupClose = true): HideActivePopupAction => ({ + type: OverlayActionType.HIDE_ACTIVE_POPUP, payload: shouldPopupClose }); diff --git a/packages/scandipwa/src/store/Overlay/Overlay.reducer.js b/packages/scandipwa/src/store/Overlay/Overlay.reducer.ts similarity index 72% rename from packages/scandipwa/src/store/Overlay/Overlay.reducer.js rename to packages/scandipwa/src/store/Overlay/Overlay.reducer.ts index 4d91c10d02..779f5e8582 100644 --- a/packages/scandipwa/src/store/Overlay/Overlay.reducer.js +++ b/packages/scandipwa/src/store/Overlay/Overlay.reducer.ts @@ -9,21 +9,24 @@ * @link https://github.com/scandipwa/base-theme */ -import { SHOW_POPUP } from 'Store/Popup/Popup.action'; +import { Reducer } from 'redux'; + +import { PopupActionType } from 'Store/Popup/Popup.type'; import { - HIDE_ACTIVE_OVERLAY, - TOGGLE_OVERLAY -} from './Overlay.action'; + OverlayAction, + OverlayActionType, + OverlayStore +} from './Overlay.type'; /** @namespace Store/Overlay/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): OverlayStore => ({ activeOverlay: '', areOtherOverlaysOpen: false }); /** @namespace Store/Overlay/Reducer/OverlayReducer */ -export const OverlayReducer = ( +export const OverlayReducer: Reducer = ( state = getInitialState(), action ) => { @@ -33,8 +36,8 @@ export const OverlayReducer = ( } = state; switch (action.type) { - case TOGGLE_OVERLAY: - case SHOW_POPUP: + case OverlayActionType.TOGGLE_OVERLAY: + case PopupActionType.SHOW_POPUP: const activeOverlay = prevActiveOverlay === overlayKey ? '' : overlayKey; const areOtherOverlaysOpen = prevActiveOverlay !== ''; @@ -44,7 +47,7 @@ export const OverlayReducer = ( areOtherOverlaysOpen }; - case HIDE_ACTIVE_OVERLAY: + case OverlayActionType.HIDE_ACTIVE_OVERLAY: return { ...state, activeOverlay: '', diff --git a/packages/scandipwa/src/store/Overlay/Overlay.type.ts b/packages/scandipwa/src/store/Overlay/Overlay.type.ts new file mode 100644 index 0000000000..dfa7698de3 --- /dev/null +++ b/packages/scandipwa/src/store/Overlay/Overlay.type.ts @@ -0,0 +1,50 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { ShowPopupAction } from 'Store/Popup/Popup.type'; + +export enum OverlayActionType { + TOGGLE_OVERLAY = 'TOGGLE_OVERLAY', + HIDE_ACTIVE_OVERLAY = 'HIDE_ACTIVE_OVERLAY', + HIDE_ACTIVE_POPUP = 'HIDE_ACTIVE_POPUP' +} + +export interface ToggleOverlayByKeyAction extends AnyAction { + type: OverlayActionType.TOGGLE_OVERLAY; + overlayKey: string; +} + +export interface HideActiveOverlayAction extends AnyAction { + type: OverlayActionType.HIDE_ACTIVE_OVERLAY; +} + +export interface HideActivePopupAction extends AnyAction { + type: OverlayActionType.HIDE_ACTIVE_POPUP; + payload: boolean; +} + +export type OverlayAction = ToggleOverlayByKeyAction +| HideActiveOverlayAction +| HideActivePopupAction +| ShowPopupAction; + +export type OverlayStore = { + activeOverlay: string; + areOtherOverlaysOpen: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + OverlayReducer: OverlayStore; + } +} diff --git a/packages/scandipwa/src/store/Popup/Popup.action.js b/packages/scandipwa/src/store/Popup/Popup.action.ts similarity index 61% rename from packages/scandipwa/src/store/Popup/Popup.action.js rename to packages/scandipwa/src/store/Popup/Popup.action.ts index f1f2ca2d86..4dede0ca9d 100644 --- a/packages/scandipwa/src/store/Popup/Popup.action.js +++ b/packages/scandipwa/src/store/Popup/Popup.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,11 +10,11 @@ * @link https://github.com/scandipwa/base-theme */ -export const SHOW_POPUP = 'SHOW_POPUP'; +import { PopupActionType, ShowPopupAction } from './Popup.type'; /** @namespace Store/Popup/Action/showPopup */ -export const showPopup = (overlayKey, payload) => ({ - type: SHOW_POPUP, +export const showPopup = (overlayKey: string, payload: T): ShowPopupAction => ({ + type: PopupActionType.SHOW_POPUP, overlayKey, payload: { [overlayKey]: payload } }); diff --git a/packages/scandipwa/src/store/Popup/Popup.reducer.ts b/packages/scandipwa/src/store/Popup/Popup.reducer.ts index cfa96982f4..0ca2cbfec6 100644 --- a/packages/scandipwa/src/store/Popup/Popup.reducer.ts +++ b/packages/scandipwa/src/store/Popup/Popup.reducer.ts @@ -10,10 +10,9 @@ */ import { Reducer } from 'redux'; -import { HIDE_ACTIVE_OVERLAY, HIDE_ACTIVE_POPUP } from 'Store/Overlay/Overlay.action'; +import { OverlayActionType } from 'Store/Overlay/Overlay.type'; -import { SHOW_POPUP } from './Popup.action'; -import { PopupAction, PopupStore } from './type'; +import { PopupActionType, PopupStore, PopupType } from './Popup.type'; /** @namespace Store/Popup/Reducer/getInitialState */ export const getInitialState = (): PopupStore => ({ @@ -25,7 +24,7 @@ export const getInitialState = (): PopupStore => ({ /** @namespace Store/Popup/Reducer/PopupReducer */ export const PopupReducer: Reducer< PopupStore, -PopupAction & PopupStore +PopupType > = ( state = getInitialState(), action @@ -33,11 +32,11 @@ PopupAction & PopupStore const { payload, type } = action; switch (type) { - case SHOW_POPUP: + case PopupActionType.SHOW_POPUP: return { ...state, popupPayload: payload }; - case HIDE_ACTIVE_OVERLAY: + case OverlayActionType.HIDE_ACTIVE_OVERLAY: return { ...state, popupPayload: {} }; - case HIDE_ACTIVE_POPUP: + case OverlayActionType.HIDE_ACTIVE_POPUP: return { ...state, shouldPopupClose: payload }; default: return state; diff --git a/packages/scandipwa/src/store/Popup/type.ts b/packages/scandipwa/src/store/Popup/Popup.type.ts similarity index 52% rename from packages/scandipwa/src/store/Popup/type.ts rename to packages/scandipwa/src/store/Popup/Popup.type.ts index 0f2c39e157..7c242840c3 100644 --- a/packages/scandipwa/src/store/Popup/type.ts +++ b/packages/scandipwa/src/store/Popup/Popup.type.ts @@ -8,11 +8,23 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Action } from 'redux'; +import { AnyAction } from 'redux'; -import { HIDE_ACTIVE_OVERLAY, HIDE_ACTIVE_POPUP } from 'Store/Overlay/Overlay.action'; +import { HideActiveOverlayAction, HideActivePopupAction } from 'Store/Overlay/Overlay.type'; -import { SHOW_POPUP } from './Popup.action'; +export enum PopupActionType { + SHOW_POPUP = 'SHOW_POPUP' +} + +export interface ShowPopupAction extends AnyAction { + type: PopupActionType.SHOW_POPUP; + overlayKey: OverlayKey; + payload: Record; +} + +export type PopupType = ShowPopupAction +| HideActiveOverlayAction +| HideActivePopupAction; export type PopupStore = { popupPayload: Record; @@ -20,8 +32,6 @@ export type PopupStore = { payload: Record | boolean; }; -export type PopupAction = Action; - declare module 'Util/Store/type' { export interface RootState { PopupReducer: PopupStore; From 62150b060dc4c5b0ec814f3344b570d64193269e Mon Sep 17 00:00:00 2001 From: Aleksandrs Date: Fri, 8 Apr 2022 16:15:33 +0300 Subject: [PATCH 021/192] Migrate some reducers and actions in redux to TS --- .../src/store/SearchBar/SearchBar.action.js | 31 --------- .../src/store/SearchBar/SearchBar.action.ts | 35 ++++++++++ ...rchBar.reducer.js => SearchBar.reducer.ts} | 21 +++--- .../src/store/SearchBar/SearchBar.type.ts | 55 +++++++++++++++ ...ckUp.action.js => StoreInPickUp.action.ts} | 15 ++-- ...Up.reducer.js => StoreInPickUp.reducer.ts} | 14 ++-- .../store/StoreInPickUp/StoreInPickUp.type.ts | 39 +++++++++++ .../store/UrlRewrites/UrlRewrites.action.js | 26 ------- .../store/UrlRewrites/UrlRewrites.action.ts | 32 +++++++++ ...ites.reducer.js => UrlRewrites.reducer.ts} | 21 +++--- .../src/store/UrlRewrites/UrlRewrites.type.ts | 43 ++++++++++++ ...{Wishlist.action.js => Wishlist.action.ts} | 42 ++++++------ ...ishlist.reducer.js => Wishlist.reducer.ts} | 68 ++++++------------- .../src/store/Wishlist/Wishlist.type.ts | 56 +++++++++++++++ 14 files changed, 344 insertions(+), 154 deletions(-) delete mode 100644 packages/scandipwa/src/store/SearchBar/SearchBar.action.js create mode 100644 packages/scandipwa/src/store/SearchBar/SearchBar.action.ts rename packages/scandipwa/src/store/SearchBar/{SearchBar.reducer.js => SearchBar.reducer.ts} (72%) create mode 100644 packages/scandipwa/src/store/SearchBar/SearchBar.type.ts rename packages/scandipwa/src/store/StoreInPickUp/{StoreInPickUp.action.js => StoreInPickUp.action.ts} (51%) rename packages/scandipwa/src/store/StoreInPickUp/{StoreInPickUp.reducer.js => StoreInPickUp.reducer.ts} (67%) create mode 100644 packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts delete mode 100644 packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.js create mode 100644 packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.ts rename packages/scandipwa/src/store/UrlRewrites/{UrlRewrites.reducer.js => UrlRewrites.reducer.ts} (68%) create mode 100644 packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts rename packages/scandipwa/src/store/Wishlist/{Wishlist.action.js => Wishlist.action.ts} (51%) rename packages/scandipwa/src/store/Wishlist/{Wishlist.reducer.js => Wishlist.reducer.ts} (60%) create mode 100644 packages/scandipwa/src/store/Wishlist/Wishlist.type.ts diff --git a/packages/scandipwa/src/store/SearchBar/SearchBar.action.js b/packages/scandipwa/src/store/SearchBar/SearchBar.action.js deleted file mode 100644 index 883c292770..0000000000 --- a/packages/scandipwa/src/store/SearchBar/SearchBar.action.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const UPDATE_SEARCH_BAR = 'UPDATE_SEARCH_BAR'; -export const UPDATE_SEARCH_LOAD_STATUS = 'UPDATE_SEARCH_LOAD_STATUS'; -export const CLEAR_SEARCH_RESULTS = 'CLEAR_SEARCH_RESULTS'; - -/** @namespace Store/SearchBar/Action/updateSearchBar */ -export const updateSearchBar = (result) => ({ - type: UPDATE_SEARCH_BAR, - result -}); - -/** @namespace Store/SearchBar/Action/updateLoadStatus */ -export const updateLoadStatus = (status) => ({ - type: UPDATE_SEARCH_LOAD_STATUS, - isLoading: status -}); - -/** @namespace Store/SearchBar/Action/clearSearchResults */ -export const clearSearchResults = () => ({ - type: CLEAR_SEARCH_RESULTS -}); diff --git a/packages/scandipwa/src/store/SearchBar/SearchBar.action.ts b/packages/scandipwa/src/store/SearchBar/SearchBar.action.ts new file mode 100644 index 0000000000..180f91dce0 --- /dev/null +++ b/packages/scandipwa/src/store/SearchBar/SearchBar.action.ts @@ -0,0 +1,35 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { + ClearSearchResults, + SearchBarActionType, + SearchBarResult, + UpdateLoadStatus, + UpdateSearchBar +} from './SearchBar.type'; + +/** @namespace Store/SearchBar/Action/updateSearchBar */ +export const updateSearchBar = (result: SearchBarResult): UpdateSearchBar => ({ + type: SearchBarActionType.UPDATE_SEARCH_BAR, + result +}); + +/** @namespace Store/SearchBar/Action/updateLoadStatus */ +export const updateLoadStatus = (status: boolean): UpdateLoadStatus => ({ + type: SearchBarActionType.UPDATE_SEARCH_LOAD_STATUS, + isLoading: status +}); + +/** @namespace Store/SearchBar/Action/clearSearchResults */ +export const clearSearchResults = (): ClearSearchResults => ({ + type: SearchBarActionType.CLEAR_SEARCH_RESULTS +}); diff --git a/packages/scandipwa/src/store/SearchBar/SearchBar.reducer.js b/packages/scandipwa/src/store/SearchBar/SearchBar.reducer.ts similarity index 72% rename from packages/scandipwa/src/store/SearchBar/SearchBar.reducer.js rename to packages/scandipwa/src/store/SearchBar/SearchBar.reducer.ts index ae938d41bc..c7f461a9a7 100644 --- a/packages/scandipwa/src/store/SearchBar/SearchBar.reducer.js +++ b/packages/scandipwa/src/store/SearchBar/SearchBar.reducer.ts @@ -9,27 +9,28 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; + import { getIndexedProducts } from 'Util/Product'; -import { - CLEAR_SEARCH_RESULTS, - UPDATE_SEARCH_BAR, - UPDATE_SEARCH_LOAD_STATUS -} from './SearchBar.action'; +import { SearchBarAction, SearchBarActionType, SearchBarStore } from './SearchBar.type'; /** @namespace Store/SearchBar/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): SearchBarStore => ({ productsInSearch: [], isLoading: true }); /** @namespace Store/SearchBar/Reducer/SearchBarReducer */ -export const SearchBarReducer = ( +export const SearchBarReducer: Reducer< +SearchBarStore, +SearchBarAction +> = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_SEARCH_BAR: + case SearchBarActionType.UPDATE_SEARCH_BAR: const { result: { products: { items: initialItems } } } = action; return { @@ -37,7 +38,7 @@ export const SearchBarReducer = ( productsInSearch: getIndexedProducts(initialItems) }; - case UPDATE_SEARCH_LOAD_STATUS: + case SearchBarActionType.UPDATE_SEARCH_LOAD_STATUS: const { isLoading } = action; return { @@ -45,7 +46,7 @@ export const SearchBarReducer = ( isLoading }; - case CLEAR_SEARCH_RESULTS: + case SearchBarActionType.CLEAR_SEARCH_RESULTS: return { ...state, productsInSearch: getInitialState().productsInSearch diff --git a/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts b/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts new file mode 100644 index 0000000000..422f1c7c7b --- /dev/null +++ b/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts @@ -0,0 +1,55 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +import { Product } from 'Type/ProductList.type'; + +export type SearchBarResult = { + products: { + items: Product[]; + }; +}; + +export enum SearchBarActionType { + UPDATE_SEARCH_BAR = 'UPDATE_SEARCH_BAR', + UPDATE_SEARCH_LOAD_STATUS = 'UPDATE_SEARCH_LOAD_STATUS', + CLEAR_SEARCH_RESULTS = 'CLEAR_SEARCH_RESULTS' +} + +export interface UpdateSearchBar extends AnyAction { + type: SearchBarActionType.UPDATE_SEARCH_BAR; + result: SearchBarResult; +} + +export interface UpdateLoadStatus extends AnyAction { + type: SearchBarActionType.UPDATE_SEARCH_LOAD_STATUS; + isLoading: boolean; +} + +export interface ClearSearchResults extends AnyAction { + type: SearchBarActionType.CLEAR_SEARCH_RESULTS; +} + +export type SearchBarAction = UpdateSearchBar +| UpdateLoadStatus +| ClearSearchResults; + +// TODO Check util return for indexed products and set correct type +export type SearchBarStore = { + productsInSearch: unknown[]; + isLoading: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + SearchBarReducer: SearchBarStore; + } +} diff --git a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.js b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.ts similarity index 51% rename from packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.js rename to packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.ts index 2853fac390..c0fc1dc7e8 100644 --- a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.js +++ b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.action.ts @@ -9,16 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -export const SET_PICK_UP_STORE = 'SET_PICK_UP_STORE'; -export const CLEAR_PICK_UP_STORE = 'CLEAR_PICK_UP_STORE'; +import { PickUpInStore } from 'Type/IsStorePickUp.type'; + +import { ClearPickUpStore, SetPickUpStore, StoreInPickUpActionType } from './StoreInPickUp.type'; /** @namespace Store/StoreInPickUp/Action/setPickUpStore */ -export const setPickUpStore = (store) => ({ - type: SET_PICK_UP_STORE, +export const setPickUpStore = ( + store:PickUpInStore +): SetPickUpStore => ({ + type: StoreInPickUpActionType.SET_PICK_UP_STORE, store }); /** @namespace Store/StoreInPickUp/Action/clearPickUpStore */ -export const clearPickUpStore = () => ({ - type: CLEAR_PICK_UP_STORE +export const clearPickUpStore = (): ClearPickUpStore => ({ + type: StoreInPickUpActionType.CLEAR_PICK_UP_STORE }); diff --git a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.js b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.ts similarity index 67% rename from packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.js rename to packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.ts index 48ff03ea61..552bad1dbc 100644 --- a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.js +++ b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.reducer.ts @@ -8,23 +8,27 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; -import { CLEAR_PICK_UP_STORE, SET_PICK_UP_STORE } from './StoreInPickUp.action'; +import { StoreInPickUpAction, StoreInPickUpActionType, StoreInPickUpStore } from './StoreInPickUp.type'; /** @namespace Store/StoreInPickUp/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): StoreInPickUpStore => ({ store: null }); /** @namespace Store/StoreInPickUp/Reducer/StoreInPickUpReducer */ -export const StoreInPickUpReducer = ( +export const StoreInPickUpReducer: Reducer< +StoreInPickUpStore, +StoreInPickUpAction +> = ( state = getInitialState(), action ) => { const { type } = action; switch (type) { - case SET_PICK_UP_STORE: + case StoreInPickUpActionType.SET_PICK_UP_STORE: const { store } = action; return { @@ -32,7 +36,7 @@ export const StoreInPickUpReducer = ( store }; - case CLEAR_PICK_UP_STORE: + case StoreInPickUpActionType.CLEAR_PICK_UP_STORE: return { ...state, store: null diff --git a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts new file mode 100644 index 0000000000..130bdda042 --- /dev/null +++ b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts @@ -0,0 +1,39 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +import { PickUpInStore } from 'Type/IsStorePickUp.type'; + +export enum StoreInPickUpActionType { + SET_PICK_UP_STORE = 'SET_PICK_UP_STORE', + CLEAR_PICK_UP_STORE = 'CLEAR_PICK_UP_STORE' +} + +export interface SetPickUpStore extends AnyAction { + type: StoreInPickUpActionType.SET_PICK_UP_STORE; + store: PickUpInStore; +} + +export interface ClearPickUpStore extends AnyAction { + type: StoreInPickUpActionType.CLEAR_PICK_UP_STORE; +} + +export type StoreInPickUpAction = SetPickUpStore | ClearPickUpStore; + +export type StoreInPickUpStore = { + store: PickUpInStore | null; +}; + +declare module 'Util/Store/type' { + export interface RootState { + StoreInPickUpReducer: StoreInPickUpStore; + } +} diff --git a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.js b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.js deleted file mode 100644 index ead958d831..0000000000 --- a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const UPDATE_URL_REWRITE = 'UPDATE_URL_REWRITE'; -export const IS_LOADING_URL_REWRITE = 'IS_LOADING_URL_REWRITE'; - -/** @namespace Store/UrlRewrites/Action/updateUrlRewrite */ -export const updateUrlRewrite = (urlRewrite, requestedUrl) => ({ - type: UPDATE_URL_REWRITE, - urlRewrite, - requestedUrl -}); - -/** @namespace Store/UrlRewrites/Action/setIsUrlRewritesLoading */ -export const setIsUrlRewritesLoading = (isLoading) => ({ - type: IS_LOADING_URL_REWRITE, - isLoading -}); diff --git a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.ts b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.ts new file mode 100644 index 0000000000..7840595ba7 --- /dev/null +++ b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.action.ts @@ -0,0 +1,32 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { UrlRewrite } from 'Type/Router.type'; + +import { SetIsUrlRewritesLoading, UpdateUrlRewrite, UrlRewritesActionType } from './UrlRewrites.type'; + +/** @namespace Store/UrlRewrites/Action/updateUrlRewrite */ +export const updateUrlRewrite = ( + urlRewrite: Record, + requestedUrl: string +): UpdateUrlRewrite => ({ + type: UrlRewritesActionType.UPDATE_URL_REWRITE, + urlRewrite, + requestedUrl +}); + +/** @namespace Store/UrlRewrites/Action/setIsUrlRewritesLoading */ +export const setIsUrlRewritesLoading = ( + isLoading: boolean +): SetIsUrlRewritesLoading => ({ + type: UrlRewritesActionType.IS_LOADING_URL_REWRITE, + isLoading +}); diff --git a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.js b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.ts similarity index 68% rename from packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.js rename to packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.ts index 69f1bf6ef8..a5f009d38f 100644 --- a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.js +++ b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.reducer.ts @@ -9,24 +9,27 @@ * @link https://github.com/scandipwa/base-theme */ -import { - IS_LOADING_URL_REWRITE, - UPDATE_URL_REWRITE -} from './UrlRewrites.action'; +import { Reducer } from 'redux'; + +import { UrlRewritesAction, UrlRewritesActionType, UrlRewritesStore } from './UrlRewrites.type'; /** @namespace Store/UrlRewrites/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): UrlRewritesStore => ({ urlRewrite: {}, - isLoading: false + isLoading: false, + requestedUrl: '' }); /** @namespace Store/UrlRewrites/Reducer/UrlRewritesReducer */ -export const UrlRewritesReducer = ( +export const UrlRewritesReducer: Reducer< +UrlRewritesStore, +UrlRewritesAction +> = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_URL_REWRITE: + case UrlRewritesActionType.UPDATE_URL_REWRITE: const { urlRewrite, requestedUrl @@ -39,7 +42,7 @@ export const UrlRewritesReducer = ( requestedUrl }; - case IS_LOADING_URL_REWRITE: + case UrlRewritesActionType.IS_LOADING_URL_REWRITE: const { isLoading } = action; return { diff --git a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts new file mode 100644 index 0000000000..4aa979b8f8 --- /dev/null +++ b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts @@ -0,0 +1,43 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +import { UrlRewrite } from 'Type/Router.type'; + +export enum UrlRewritesActionType { + UPDATE_URL_REWRITE = 'UPDATE_URL_REWRITE', + IS_LOADING_URL_REWRITE = 'IS_LOADING_URL_REWRITE' +} + +export interface UpdateUrlRewrite extends AnyAction { + type: UrlRewritesActionType.UPDATE_URL_REWRITE; + urlRewrite: Record; + requestedUrl: string; +} + +export interface SetIsUrlRewritesLoading extends AnyAction { + type: UrlRewritesActionType.IS_LOADING_URL_REWRITE; + isLoading: boolean; +} + +export type UrlRewritesAction = UpdateUrlRewrite | SetIsUrlRewritesLoading; + +export type UrlRewritesStore = { + urlRewrite: UrlRewrite; + requestedUrl: string; + isLoading: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + UrlRewritesReducer: UrlRewritesStore; + } +} diff --git a/packages/scandipwa/src/store/Wishlist/Wishlist.action.js b/packages/scandipwa/src/store/Wishlist/Wishlist.action.ts similarity index 51% rename from packages/scandipwa/src/store/Wishlist/Wishlist.action.js rename to packages/scandipwa/src/store/Wishlist/Wishlist.action.ts index 6d89361c95..f900cb7cbb 100644 --- a/packages/scandipwa/src/store/Wishlist/Wishlist.action.js +++ b/packages/scandipwa/src/store/Wishlist/Wishlist.action.ts @@ -9,11 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ -export const CLEAR_WISHLIST = 'CLEAR_WISHLIST'; -export const UPDATE_ITEM_OPTIONS = 'UPDATE_ITEM_OPTIONS'; -export const REMOVE_ITEM_FROM_WISHLIST = 'REMOVE_ITEM_FROM_WISHLIST'; -export const UPDATE_ALL_PRODUCTS_IN_WISHLIST = 'UPDATE_ALL_PRODUCTS_IN_WISHLIST'; -export const UPDATE_IS_LOADING_IN_WISHLIST = 'UPDATE_IS_LOADING_IN_WISHLIST'; +import { Product } from 'Type/ProductList.type'; + +import { + ClearWishlist, + RemoveItemFromWishlist, + UpdateAllProductsInWishlist, + UpdateIsLoading, + WishlistActionType +} from './Wishlist.type'; /** * Remove specified product from wishlist @@ -21,8 +25,10 @@ export const UPDATE_IS_LOADING_IN_WISHLIST = 'UPDATE_IS_LOADING_IN_WISHLIST'; * @return {void} * @namespace Store/Wishlist/Action/removeItemFromWishlist */ -export const removeItemFromWishlist = (item_id) => ({ - type: REMOVE_ITEM_FROM_WISHLIST, +export const removeItemFromWishlist = ( + item_id: number +): RemoveItemFromWishlist => ({ + type: WishlistActionType.REMOVE_ITEM_FROM_WISHLIST, item_id }); @@ -32,24 +38,22 @@ export const removeItemFromWishlist = (item_id) => ({ * @return {void} * @namespace Store/Wishlist/Action/updateAllProductsInWishlist */ -export const updateAllProductsInWishlist = (products) => ({ - type: UPDATE_ALL_PRODUCTS_IN_WISHLIST, +export const updateAllProductsInWishlist = ( + products: Record +): UpdateAllProductsInWishlist => ({ + type: WishlistActionType.UPDATE_ALL_PRODUCTS_IN_WISHLIST, products }); /** @namespace Store/Wishlist/Action/updateIsLoading */ -export const updateIsLoading = (isLoading) => ({ - type: UPDATE_IS_LOADING_IN_WISHLIST, +export const updateIsLoading = ( + isLoading: boolean +): UpdateIsLoading => ({ + type: WishlistActionType.UPDATE_IS_LOADING_IN_WISHLIST, isLoading }); -/** @namespace Store/Wishlist/Action/updateItemOptions */ -export const updateItemOptions = (options) => ({ - type: UPDATE_ITEM_OPTIONS, - options -}); - /** @namespace Store/Wishlist/Action/clearWishlist */ -export const clearWishlist = () => ({ - type: CLEAR_WISHLIST +export const clearWishlist = (): ClearWishlist => ({ + type: WishlistActionType.CLEAR_WISHLIST }); diff --git a/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.js b/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts similarity index 60% rename from packages/scandipwa/src/store/Wishlist/Wishlist.reducer.js rename to packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts index 04c37c999d..76f5da5d5d 100644 --- a/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.js +++ b/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts @@ -9,30 +9,28 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'react'; + import BrowserDatabase from 'Util/BrowserDatabase'; import { getIndexedParameteredProducts } from 'Util/Product'; -import { - CLEAR_WISHLIST, - REMOVE_ITEM_FROM_WISHLIST, - UPDATE_ALL_PRODUCTS_IN_WISHLIST, - UPDATE_IS_LOADING_IN_WISHLIST, - UPDATE_ITEM_OPTIONS -} from './Wishlist.action'; +import { WishlistAction, WishlistActionType, WishlistStore } from './Wishlist.type'; export const PRODUCTS_IN_WISHLIST = 'wishlist_products'; /** @namespace Store/Wishlist/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): WishlistStore => ({ productsInWishlist: BrowserDatabase.getItem(PRODUCTS_IN_WISHLIST) || {}, isLoading: true }); /** @namespace Store/Wishlist/Reducer/deleteProperty */ -export const deleteProperty = (key, { [key]: _, ...newObj }) => newObj; +export const deleteProperty = , U extends keyof T>( + key: U, { [key]: _, ...newObj }: T +): Omit => newObj; /** @namespace Store/Wishlist/Reducer/removeItemFromWishlist */ -export const removeItemFromWishlist = ({ item_id }, { productsInWishlist: initialProducts }) => { +export const removeItemFromWishlist = (item_id: number, { productsInWishlist: initialProducts }) => { const productsInWishlist = deleteProperty(item_id, initialProducts) || {}; BrowserDatabase.setItem( @@ -66,65 +64,39 @@ export const updateAllProductsInWishlist = (action) => { return { productsInWishlist: products, isLoading: false }; }; -/** @namespace Store/Wishlist/Reducer/updateItemOptions */ -export const updateItemOptions = (options, { productsInWishlist }) => { - const { item_id } = options; - const cleanedOptions = deleteProperty('item_id', options) || {}; - - const products = { - ...productsInWishlist, - [item_id]: { - ...productsInWishlist[item_id], - wishlist: { - ...productsInWishlist[item_id].wishlist, - ...cleanedOptions - } - } - }; - - BrowserDatabase.setItem( - products, - PRODUCTS_IN_WISHLIST - ); - - return { productsInWishlist: products }; -}; - /** @namespace Store/Wishlist/Reducer/WishlistReducer */ -export const WishlistReducer = ( +export const WishlistReducer: Reducer< +WishlistStore, +WishlistAction +> = ( state = getInitialState(), action ) => { - const { type, options } = action; + const { type } = action; switch (type) { - case REMOVE_ITEM_FROM_WISHLIST: + case WishlistActionType.REMOVE_ITEM_FROM_WISHLIST: + const { item_id } = action; + return { ...state, isLoading: false, - ...removeItemFromWishlist(action, state) + ...removeItemFromWishlist(item_id, state) }; - case CLEAR_WISHLIST: + case WishlistActionType.CLEAR_WISHLIST: return { ...state, ...clearWishlist() }; - case UPDATE_ALL_PRODUCTS_IN_WISHLIST: + case WishlistActionType.UPDATE_ALL_PRODUCTS_IN_WISHLIST: return { ...state, - isLoading: false, ...updateAllProductsInWishlist(action) }; - case UPDATE_ITEM_OPTIONS: - return { - ...state, - ...updateItemOptions(options, state) - }; - - case UPDATE_IS_LOADING_IN_WISHLIST: + case WishlistActionType.UPDATE_IS_LOADING_IN_WISHLIST: const { isLoading } = action; return { diff --git a/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts b/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts new file mode 100644 index 0000000000..4ffb8aaa7d --- /dev/null +++ b/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts @@ -0,0 +1,56 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ +import { AnyAction } from 'redux'; + +import { Product } from 'Type/ProductList.type'; + +export enum WishlistActionType { + CLEAR_WISHLIST = 'CLEAR_WISHLIST', + UPDATE_ITEM_OPTIONS = 'UPDATE_ITEM_OPTIONS', + REMOVE_ITEM_FROM_WISHLIST = 'REMOVE_ITEM_FROM_WISHLIST', + UPDATE_ALL_PRODUCTS_IN_WISHLIST = 'UPDATE_ALL_PRODUCTS_IN_WISHLIST', + UPDATE_IS_LOADING_IN_WISHLIST = 'UPDATE_IS_LOADING_IN_WISHLIST' +} + +export interface RemoveItemFromWishlist extends AnyAction { + type: WishlistActionType.REMOVE_ITEM_FROM_WISHLIST; + item_id: number; +} + +export interface UpdateAllProductsInWishlist extends AnyAction { + type: WishlistActionType.UPDATE_ALL_PRODUCTS_IN_WISHLIST; + products: Record; +} + +export interface UpdateIsLoading extends AnyAction { + type: WishlistActionType.UPDATE_IS_LOADING_IN_WISHLIST; + isLoading: boolean; +} + +export interface ClearWishlist extends AnyAction { + type: WishlistActionType.CLEAR_WISHLIST; +} + +export type WishlistAction = RemoveItemFromWishlist +| UpdateAllProductsInWishlist +| UpdateIsLoading +| ClearWishlist; + +export type WishlistStore = { + productsInWishlist: Record; + isLoading: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + WishlistReducer: WishlistStore; + } +} From bf98fb3ceb2d16ebd6625f87fe92d056aeb58980 Mon Sep 17 00:00:00 2001 From: Aleksandrs Date: Fri, 8 Apr 2022 19:46:47 +0300 Subject: [PATCH 022/192] Move types from util to separate type file --- .../scandipwa/src/type/IsStorePickUp.type.ts | 28 +++++ .../src/util/Address/Address.type.ts | 16 +++ packages/scandipwa/src/util/Address/index.ts | 8 +- packages/scandipwa/src/util/Form/Extract.ts | 54 ++------- packages/scandipwa/src/util/Form/Form.type.ts | 50 ++++++++ packages/scandipwa/src/util/Menu/Menu.ts | 24 +--- packages/scandipwa/src/util/Menu/Menu.type.ts | 37 ++++++ .../scandipwa/src/util/Product/Extract.ts | 104 +++------------- .../scandipwa/src/util/Product/Product.ts | 22 ---- .../src/util/Product/Product.type.ts | 113 ++++++++++++++++++ 10 files changed, 273 insertions(+), 183 deletions(-) create mode 100644 packages/scandipwa/src/type/IsStorePickUp.type.ts create mode 100644 packages/scandipwa/src/util/Address/Address.type.ts create mode 100644 packages/scandipwa/src/util/Form/Form.type.ts create mode 100644 packages/scandipwa/src/util/Menu/Menu.type.ts create mode 100644 packages/scandipwa/src/util/Product/Product.type.ts diff --git a/packages/scandipwa/src/type/IsStorePickUp.type.ts b/packages/scandipwa/src/type/IsStorePickUp.type.ts new file mode 100644 index 0000000000..9d045b9069 --- /dev/null +++ b/packages/scandipwa/src/type/IsStorePickUp.type.ts @@ -0,0 +1,28 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type PickUpInStore = { + city?: string; + contact_name?: string; + country_id?: string; + description?: string; + email?: string; + fax?: string; + latitude?: number; + longitude?: number; + name?: string; + phone?: string; + pickup_location_code?: string; + postcode?: string; + region?: string; + region_id?: number; + street?: string; +}; diff --git a/packages/scandipwa/src/util/Address/Address.type.ts b/packages/scandipwa/src/util/Address/Address.type.ts new file mode 100644 index 0000000000..410e648467 --- /dev/null +++ b/packages/scandipwa/src/util/Address/Address.type.ts @@ -0,0 +1,16 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type ZippopotamResponseResult = { + city: string; + region: string; + regionAbbr: string; +}; diff --git a/packages/scandipwa/src/util/Address/index.ts b/packages/scandipwa/src/util/Address/index.ts index c925bec18b..93ec9881fc 100644 --- a/packages/scandipwa/src/util/Address/index.ts +++ b/packages/scandipwa/src/util/Address/index.ts @@ -13,6 +13,8 @@ import StoreItem from 'Component/StoreItem'; import { Address, TrimmedAddress } from 'Type/Account.type'; import { Country, Region, Stores } from 'Type/Config.type'; +import { ZippopotamResponseResult } from './Address.type'; + /** @namespace Util/Address/Index/trimCheckoutCustomerAddress */ export const trimCheckoutCustomerAddress = (customerAddress: Address): TrimmedAddress => { const { @@ -132,12 +134,6 @@ export const getFormFields = (fields: Record, addressLinesQty: num return setAddressesInFormObject(fields, addressLinesQty); }; -export type ZippopotamResponseResult = { - city: string; - region: string; - regionAbbr: string; -}; - /** @namespace Util/Address/Index/getCityAndRegionFromZipcode */ export const getCityAndRegionFromZipcode = async ( countryId: string, diff --git a/packages/scandipwa/src/util/Form/Extract.ts b/packages/scandipwa/src/util/Form/Extract.ts index f8be32b9d4..f1ad96d2ac 100644 --- a/packages/scandipwa/src/util/Form/Extract.ts +++ b/packages/scandipwa/src/util/Form/Extract.ts @@ -13,6 +13,14 @@ import { FIELD_NAME_ATTR, FIELD_TYPE_ATTR, HOURS_12H_COUNT } from 'Component/Dat import FIELD_TYPE from 'Component/Field/Field.config'; import { DATE_FIELDS_COUNT, FIELD_DATE_TYPE, TIME_FORMAT } from 'Component/FieldDate/FieldDate.config'; +import { + DateMap, + DateRangeAttribute, + DatesData, + FieldData, + YearRangeAttribute +} from './Form.type'; + /** * Appends 0 to value if its less than passed attribute; * @param value @@ -61,18 +69,6 @@ export const getDateValue = (dateValue: number | string | Date): number | string } }; -// TODO move - -export type YearRangeAttribute = { - minYear: number; - maxYear: number; -}; - -export type DatRangeAttribute = { - minDate: Date; - maxDate: Date; -}; - /** @namespace Util/Form/Extract/calcYearRangeAttributes */ export const calcYearRangeAttributes = (startYear: number, endYear: number): YearRangeAttribute => { const currentYear = new Date().getFullYear(); @@ -93,7 +89,7 @@ export const calcYearRangeAttributes = (startYear: number, endYear: number): Yea }; /** @namespace Util/Form/Extract/getYearRangeAttributes */ -export const getYearRangeAttributes = (yearRange = ',', isYear = false): YearRangeAttribute | DatRangeAttribute => { +export const getYearRangeAttributes = (yearRange = ',', isYear = false): YearRangeAttribute | DateRangeAttribute => { const [startYear, endYear] = yearRange.split(','); const { minYear, maxYear } = calcYearRangeAttributes(Number(startYear), Number(endYear)); @@ -116,13 +112,6 @@ export const isMagentoDateFormatValid = (dateFieldsOrder: string): boolean => ne /** @namespace Util/Form/Extract/getTimeFormat */ export const getTimeFormat = (timeFormat: string): string => (timeFormat === TIME_FORMAT.H12 ? 'h:mm aa' : 'HH:mm'); -// TODO move -export type DateMap = { - d: string; - m: string; - y: string; -}; - /** @namespace Util/Form/Extract/getDateFormat */ export const getDateFormat = (dateFieldsOrder: string): string => { if (!isMagentoDateFormatValid(dateFieldsOrder)) { @@ -164,24 +153,6 @@ export const adjustAmpmHours = (hours: number, ampm: string): number => { return hours; }; -// TODO -export type DatesData = { - type?: string; - year?: string; - month?: string; - day?: string; - hours?: string; - minutes?: string; - ampm: string; - name?: string; -}; - -export type DateObject = { - name: string; - value: string; - type: string; -}; - /** @namespace Util/Form/Extract/transformDateFieldsData */ export const transformDateFieldsData = ( datesData: Record @@ -248,13 +219,6 @@ export const groupDateFieldsData = (fields: NodeListOf): Record); -export type FieldData = { - field: HTMLElement; - name: string; - type: string; - value: string | boolean | number; -}; - /** * Returns fields values from DOM/Form * @param DOM diff --git a/packages/scandipwa/src/util/Form/Form.type.ts b/packages/scandipwa/src/util/Form/Form.type.ts new file mode 100644 index 0000000000..957d0ed10d --- /dev/null +++ b/packages/scandipwa/src/util/Form/Form.type.ts @@ -0,0 +1,50 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type YearRangeAttribute = { + minYear: number; + maxYear: number; +}; + +export type DateRangeAttribute = { + minDate: Date; + maxDate: Date; +}; + +export type DateMap = { + d: string; + m: string; + y: string; +}; + +export type DatesData = { + type?: string; + year?: string; + month?: string; + day?: string; + hours?: string; + minutes?: string; + ampm: string; + name?: string; +}; + +export type DateObject = { + name: string; + value: string; + type: string; +}; + +export type FieldData = { + field: HTMLElement; + name: string; + type: string; + value: string | boolean | number; +}; diff --git a/packages/scandipwa/src/util/Menu/Menu.ts b/packages/scandipwa/src/util/Menu/Menu.ts index 02f33ca22c..6da7dc9d7a 100644 --- a/packages/scandipwa/src/util/Menu/Menu.ts +++ b/packages/scandipwa/src/util/Menu/Menu.ts @@ -11,25 +11,7 @@ import { MenuItem } from 'Type/Menu.type'; -/* eslint-disable no-param-reassign */ - -export const TYPE_CUSTOM_URL = 0; -export const TYPE_CMS_PAGE = 1; -export const TYPE_CATEGORY = 2; - -type MenuLocation = { - pathname: string; - search: string; - state: { - category?: number; - page?: boolean; - }; -} | string; - -export type FormattedMenuItem = Omit & { - url: MenuLocation; - children: Record; -}; +import { FormattedMenuItem, MenuItemType } from './Menu.type'; /** * Given an array of menu items, returns a copy of the array, sorted by their parent ID, then by their sort order (position) @@ -51,13 +33,13 @@ export class Menu { getMenuUrl({ url, url_type, category_id }: Pick): MenuLocation { switch (url_type) { - case TYPE_CATEGORY: + case MenuItemType.TYPE_CATEGORY: return { pathname: url, search: '', state: { category: category_id } }; - case TYPE_CMS_PAGE: + case MenuItemType.TYPE_CMS_PAGE: return { pathname: url, search: '', diff --git a/packages/scandipwa/src/util/Menu/Menu.type.ts b/packages/scandipwa/src/util/Menu/Menu.type.ts new file mode 100644 index 0000000000..d92b6a67f0 --- /dev/null +++ b/packages/scandipwa/src/util/Menu/Menu.type.ts @@ -0,0 +1,37 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { MenuItem } from 'Type/Menu.type'; + +export type MenuLocation = { + pathname: string; + search: string; + state: { + category?: number; + page?: boolean; + }; +} | string; + +export type FormattedMenuItem = Omit & { + url: MenuLocation; + children: Record; +}; + +export enum MenuItemType { + TYPE_CUSTOM_URL, + TYPE_CMS_PAGE, + TYPE_CATEGORY +} + +export enum QtyDefault { + DEFAULT_MIN_PRODUCTS = 1, + DEFAULT_MAX_PRODUCTS = 999 +} diff --git a/packages/scandipwa/src/util/Product/Extract.ts b/packages/scandipwa/src/util/Product/Extract.ts index cebdd9c37d..3a6be2b732 100644 --- a/packages/scandipwa/src/util/Product/Extract.ts +++ b/packages/scandipwa/src/util/Product/Extract.ts @@ -15,7 +15,7 @@ import { PRODUCT_TYPE } from 'Component/Product/Product.config'; import { STOCK_TYPE } from 'Component/Product/Stock.config'; import { ImageTypes } from 'Component/ProductGallery/ProductGallery.config'; -import { PriceItem, PriceRange } from 'Type/Price.type'; +import { PriceRange } from 'Type/Price.type'; import { ItemOption, ItemShape, @@ -28,28 +28,9 @@ import { import { formatPrice } from 'Util/Price'; import { IndexedVariant } from './Product'; - -export const DEFAULT_MIN_PRODUCTS = 1; -export const DEFAULT_MAX_PRODUCTS = 999; - -export enum QtyDefault { - DEFAULT_MIN_PRODUCTS = 1, - DEFAULT_MAX_PRODUCTS = 999 -} - -export const MIN_SALE_QTY = 'min_sale_qty'; -export const MAX_SALE_QTY = 'max_sale_qty'; -export const SALABLE_QTY = 'salable_qty'; - -export enum QtyFields { - SALABLE_QTY = 'salable_qty', - MIN_SALE_QTY = 'min_sale_qty', - MAX_SALE_QTY = 'max_sale_qty' -} - -export type FormattedProduct = Omit & { - variants?: IndexedVariant[]; -}; +import { + AdjustedPrice, AdjustedPrices, EnteredOption, FormattedAdjustedPrices, FormattedPrice, FormattedProduct, QtyDefault, QtyFields +} from './Product.type'; // TODO unify keyof product and stockitem. /** @namespace Util/Product/Extract/getFieldQty */ @@ -112,7 +93,7 @@ export const getQuantity = ( * @namespace Util/Product/Extract/getMinQuantity */ export const getMinQuantity = (product: FormattedProduct, configIndex = -1): number => ( - getQuantity(product, DEFAULT_MIN_PRODUCTS, QtyFields.MIN_SALE_QTY, configIndex) + getQuantity(product, QtyDefault.DEFAULT_MIN_PRODUCTS, QtyFields.MIN_SALE_QTY, configIndex) ); /** @@ -123,8 +104,16 @@ export const getMinQuantity = (product: FormattedProduct, configIndex = -1): num * @namespace Util/Product/Extract/getMaxQuantity */ export const getMaxQuantity = (product: FormattedProduct, configIndex = -1): number => { - const maxQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, MAX_SALE_QTY, configIndex); - const salableQuantity: number = getQuantity(product, DEFAULT_MAX_PRODUCTS, QtyFields.SALABLE_QTY, configIndex); + const maxQuantity: number = getQuantity( + product, QtyDefault.DEFAULT_MAX_PRODUCTS, + QtyFields.MAX_SALE_QTY, + configIndex + ); + const salableQuantity: number = getQuantity( + product, QtyDefault.DEFAULT_MAX_PRODUCTS, + QtyFields.SALABLE_QTY, + configIndex + ); return Math.min(maxQuantity, salableQuantity); }; @@ -253,43 +242,6 @@ export const getBundleOption = (uid: string, options: ItemOption[] = []): ItemOp }); }; -export type AdjustedPrice = { - exclTax: number; - inclTax: number; - hasDiscountCalculated: boolean; - requiresDiscountCalculations: boolean; -}; - -export type AdjustedPrices = Record; - -export type FormattedPriceConfiguration = { - containsOptions: boolean; - containsOptionsWithPrice: boolean; - containsRequiredOptions: boolean; - containsRequiredOptionsWithPrice: boolean; -}; - -export type FormattedPrice = { - price: { - finalPrice: PriceItem; - finalPriceExclTax: PriceItem; - originalPrice: PriceItem; - originalPriceExclTax: PriceItem; - discount: { - percentOff: number; - }; - }; - originalPrice: { - minRegularPrice: PriceItem; - minFinalPrice: PriceItem; - minFinalPriceExclTax: PriceItem; - maxRegularPrice: PriceItem; - maxFinalPrice: PriceItem; - maxFinalPriceExclTax: PriceItem; - }; - configuration: FormattedPriceConfiguration; -}; - /** * Returns price object for product. * @param priceRange @@ -476,32 +428,6 @@ export const getPrice = ( }; }; -// TODO move -export type EnteredOption = { - uid: string; - value: string; -}; - -export type FormattedAdjustedPrices = { - downloadable: { - exclTax: number; - inclTax: number; - requiresDiscountCalculations: boolean; - hasDiscountCalculated: boolean; - }; - bundle: { - exclTax: number; - inclTax: number; - requiresDiscountCalculations: boolean; - hasDiscountCalculated: boolean; - }; - config: { - exclTax: number; - inclTax: number; - requiresDiscountCalculations: boolean; - }; -}; - /** * Generates adjusted price from entered product options * diff --git a/packages/scandipwa/src/util/Product/Product.ts b/packages/scandipwa/src/util/Product/Product.ts index 5f72c020e6..7804045cf5 100644 --- a/packages/scandipwa/src/util/Product/Product.ts +++ b/packages/scandipwa/src/util/Product/Product.ts @@ -66,11 +66,6 @@ export const checkEveryOption = ( return options[option].includes(attribute_value); }); -// TODO move -export type IndexedOption = AttributeOption & { - swatch_data: SwatchData | null; -}; - /** @namespace Util/Product/getIndexedAttributeOption */ export const getIndexedAttributeOption = (option: AttributeOption): AttributeOption | IndexedOption => { const { swatch_data: defaultSwatchData } = option; @@ -110,13 +105,6 @@ export const getIndexedAttributes = ( }; }, {}); -export type IndexedConfigurableOption = Attribute & { - attribute_values: string[]; - values: { - value_index: number; - }[]; -}; - /** @namespace Util/Product/getIndexedConfigurableOptions */ export const getIndexedConfigurableOptions = ( configurableOptions: ConfigurableAttribute[], @@ -136,10 +124,6 @@ export const getIndexedConfigurableOptions = ( }, {} as IndexedConfigurableOption) ); -export type IndexedVariant = Omit & { - attributes: Record; -}; - /** @namespace Util/Product/getIndexedVariants */ export const getIndexedVariants = ( variants: ProductVariant[] @@ -211,10 +195,6 @@ export const getVariantIndex = ( return indexes instanceof Array && indexes.length ? indexes[0] : -1; }; -export type IndexedCustomOption = Omit & { - value: Value[]; -}; - /** @namespace Util/Product/getIndexedCustomOption */ export const getIndexedCustomOption = (option: Option): any => { const { @@ -314,8 +294,6 @@ export const getBundleId = (uid = ''): number => { return 0; }; -export type FormattedBundleOptions = Pick & BundleOptionSelection; - /** @namespace Util/Product/getBundleOptions */ export const getBundleOptions = (options: BundleOption[], items: ProductBundleItem[]) => { const bundleOptions = options diff --git a/packages/scandipwa/src/util/Product/Product.type.ts b/packages/scandipwa/src/util/Product/Product.type.ts new file mode 100644 index 0000000000..2114618075 --- /dev/null +++ b/packages/scandipwa/src/util/Product/Product.type.ts @@ -0,0 +1,113 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { PriceItem } from 'Type/Price.type'; +import { Product } from 'Type/ProductList.type'; + +import { IndexedVariant } from './Product'; + +export enum QtyFields { + SALABLE_QTY = 'salable_qty', + MIN_SALE_QTY = 'min_sale_qty', + MAX_SALE_QTY = 'max_sale_qty' +} + +export enum QtyDefault { + DEFAULT_MIN_PRODUCTS = 1, + DEFAULT_MAX_PRODUCTS = 999 +} + +export type FormattedProduct = Omit & { + variants?: IndexedVariant[]; +}; + +export type AdjustedPrices = Record; + +export type FormattedPriceConfiguration = { + containsOptions: boolean; + containsOptionsWithPrice: boolean; + containsRequiredOptions: boolean; + containsRequiredOptionsWithPrice: boolean; +}; + +export type FormattedPrice = { + price: { + finalPrice: PriceItem; + finalPriceExclTax: PriceItem; + originalPrice: PriceItem; + originalPriceExclTax: PriceItem; + discount: { + percentOff: number; + }; + }; + originalPrice: { + minRegularPrice: PriceItem; + minFinalPrice: PriceItem; + minFinalPriceExclTax: PriceItem; + maxRegularPrice: PriceItem; + maxFinalPrice: PriceItem; + maxFinalPriceExclTax: PriceItem; + }; + configuration: FormattedPriceConfiguration; +}; + +export type EnteredOption = { + uid: string; + value: string; +}; + +export type FormattedAdjustedPrices = { + downloadable: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + hasDiscountCalculated: boolean; + }; + bundle: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + hasDiscountCalculated: boolean; + }; + config: { + exclTax: number; + inclTax: number; + requiresDiscountCalculations: boolean; + }; +}; + +export type AdjustedPrice = { + exclTax: number; + inclTax: number; + hasDiscountCalculated: boolean; + requiresDiscountCalculations: boolean; +}; + +export type IndexedOption = AttributeOption & { + swatch_data: SwatchData | null; +}; + +export type IndexedConfigurableOption = Attribute & { + attribute_values: string[]; + values: { + value_index: number; + }[]; +}; + +export type IndexedVariant = Omit & { + attributes: Record; +}; + +export type IndexedCustomOption = Omit & { + value: Value[]; +}; + +export type FormattedBundleOptions = Pick & BundleOptionSelection; From 5cc792676c347a446348bff6c016a227f9bc46c5 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 8 Apr 2022 20:52:27 +0300 Subject: [PATCH 023/192] Migrated some actions to TS --- .../UpsellProducts/UpsellProducts.config.js | 13 --- ...ctForm.action.js => ContactForm.action.ts} | 7 +- ...Form.reducer.js => ContactForm.reducer.ts} | 11 ++- .../src/store/ContactForm/ContactForm.type.ts | 33 ++++++++ ...cts.action.js => LinkedProducts.action.ts} | 12 ++- .../LinkedProducts/LinkedProducts.reducer.js | 84 ------------------- .../LinkedProducts/LinkedProducts.reducer.ts | 83 ++++++++++++++++++ .../LinkedProducts/LinkedProducts.type.ts | 35 ++++++++ .../Meta/{Meta.action.js => Meta.action.ts} | 7 +- .../Meta/{Meta.reducer.js => Meta.reducer.ts} | 18 ++-- .../scandipwa/src/store/Meta/Meta.type.ts | 43 ++++++++++ .../src/store/Navigation/Navigation.action.js | 26 ------ .../src/store/Navigation/Navigation.action.ts | 34 ++++++++ ...ation.reducer.js => Navigation.reducer.ts} | 30 +++---- .../src/store/Navigation/Navigation.type.ts | 57 +++++++++++++ ...on.js => NewsletterSubscription.action.ts} | 7 +- .../NewsletterSubscription.type.ts | 21 +++++ .../{NoMatch.action.js => NoMatch.action.ts} | 7 +- ...{NoMatch.reducer.js => NoMatch.reducer.ts} | 14 ++-- .../src/store/NoMatch/NoMatch.type.ts | 31 +++++++ ...ation.action.js => Notification.action.ts} | 25 +++--- ...ion.reducer.js => Notification.reducer.ts} | 12 +-- .../store/Notification/Notification.type.ts | 53 ++++++++++++ .../scandipwa/src/type/ProductList.type.ts | 14 +++- 24 files changed, 494 insertions(+), 183 deletions(-) delete mode 100644 packages/scandipwa/src/component/UpsellProducts/UpsellProducts.config.js rename packages/scandipwa/src/store/ContactForm/{ContactForm.action.js => ContactForm.action.ts} (59%) rename packages/scandipwa/src/store/ContactForm/{ContactForm.reducer.js => ContactForm.reducer.ts} (65%) create mode 100644 packages/scandipwa/src/store/ContactForm/ContactForm.type.ts rename packages/scandipwa/src/store/LinkedProducts/{LinkedProducts.action.js => LinkedProducts.action.ts} (56%) delete mode 100644 packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.js create mode 100644 packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts create mode 100644 packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts rename packages/scandipwa/src/store/Meta/{Meta.action.js => Meta.action.ts} (60%) rename packages/scandipwa/src/store/Meta/{Meta.reducer.js => Meta.reducer.ts} (72%) create mode 100644 packages/scandipwa/src/store/Meta/Meta.type.ts delete mode 100644 packages/scandipwa/src/store/Navigation/Navigation.action.js create mode 100644 packages/scandipwa/src/store/Navigation/Navigation.action.ts rename packages/scandipwa/src/store/Navigation/{Navigation.reducer.js => Navigation.reducer.ts} (74%) create mode 100644 packages/scandipwa/src/store/Navigation/Navigation.type.ts rename packages/scandipwa/src/store/NewsletterSubscription/{NewsletterSubscription.action.js => NewsletterSubscription.action.ts} (57%) create mode 100644 packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.type.ts rename packages/scandipwa/src/store/NoMatch/{NoMatch.action.js => NoMatch.action.ts} (65%) rename packages/scandipwa/src/store/NoMatch/{NoMatch.reducer.js => NoMatch.reducer.ts} (68%) create mode 100644 packages/scandipwa/src/store/NoMatch/NoMatch.type.ts rename packages/scandipwa/src/store/Notification/{Notification.action.js => Notification.action.ts} (58%) rename packages/scandipwa/src/store/Notification/{Notification.reducer.js => Notification.reducer.ts} (73%) create mode 100644 packages/scandipwa/src/store/Notification/Notification.type.ts diff --git a/packages/scandipwa/src/component/UpsellProducts/UpsellProducts.config.js b/packages/scandipwa/src/component/UpsellProducts/UpsellProducts.config.js deleted file mode 100644 index 582bc9f632..0000000000 --- a/packages/scandipwa/src/component/UpsellProducts/UpsellProducts.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable import/prefer-default-export */ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const UPSELL = 'upsell'; diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.action.js b/packages/scandipwa/src/store/ContactForm/ContactForm.action.ts similarity index 59% rename from packages/scandipwa/src/store/ContactForm/ContactForm.action.js rename to packages/scandipwa/src/store/ContactForm/ContactForm.action.ts index a8e9cbbce0..f6a55b89ae 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.action.js +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,14 +10,14 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_CONTACT_FORM = 'UPDATE_CONTACT_FORM'; +import { ContactFormActionType, UpdateContactFormAction } from './ContactForm.type'; /** * Send message * @param {Object} data * @namespace Store/ContactForm/Action/updateContactForm */ -export const updateContactForm = (data = {}) => ({ - type: UPDATE_CONTACT_FORM, +export const updateContactForm = (data: { isLoading: boolean }): UpdateContactFormAction => ({ + type: ContactFormActionType.UPDATE_CONTACT_FORM, data }); diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.js b/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts similarity index 65% rename from packages/scandipwa/src/store/ContactForm/ContactForm.reducer.js rename to packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts index 318769d311..cee306c1a5 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.js +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts @@ -9,21 +9,26 @@ * @link https://github.com/scandipwa/base-theme */ -import { UPDATE_CONTACT_FORM } from './ContactForm.action'; +import { Reducer } from 'react'; + +import { ContactFormActionType, ContactFormStore, UpdateContactFormAction } from './ContactForm.type'; export const initialState = { isLoading: false }; /** @namespace Store/ContactForm/Reducer/ContactFormReducer */ -export const ContactFormReducer = (state = initialState, action) => { +export const ContactFormReducer: Reducer = ( + state = initialState, + action +) => { const { type, data } = action; switch (type) { - case UPDATE_CONTACT_FORM: + case ContactFormActionType.UPDATE_CONTACT_FORM: return { ...state, ...data }; default: diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts new file mode 100644 index 0000000000..7b0d14cd28 --- /dev/null +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts @@ -0,0 +1,33 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum ContactFormActionType { + UPDATE_CONTACT_FORM = 'UPDATE_CONTACT_FORM' +} + +export interface UpdateContactFormAction extends AnyAction { + type: ContactFormActionType.UPDATE_CONTACT_FORM; + data: { + isLoading: boolean; + }; +} + +export type ContactFormStore = { + isLoading: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + ContactFormReducer: ContactFormStore; + } +} diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.js b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.ts similarity index 56% rename from packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.js rename to packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.ts index 0adc9aad64..73f6b32563 100644 --- a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.js +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,14 +10,19 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_LINKED_PRODUCTS = 'UPDATE_LINKED_PRODUCTS'; +import { LinkedProductsMap } from 'Type/ProductList.type'; + +import { LinkedProductsActionType, UpdateLinkedProductsAction } from './LinkedProducts.type'; + /** * Update upsell products list (rewrite if already exists). * @param {Array} upsell List of products returned from fetch * @return {void} * @namespace Store/LinkedProducts/Action/updateLinkedProducts */ -export const updateLinkedProducts = (linkedProducts) => ({ - type: UPDATE_LINKED_PRODUCTS, +export const updateLinkedProducts = (linkedProducts: LinkedProductsMap & { + updateCrossSell?: boolean; +}): UpdateLinkedProductsAction => ({ + type: LinkedProductsActionType.UPDATE_LINKED_PRODUCTS, linkedProducts }); diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.js b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.js deleted file mode 100644 index c67f2b07ec..0000000000 --- a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -import BrowserDatabase from 'Util/BrowserDatabase'; - -import { UPDATE_LINKED_PRODUCTS } from './LinkedProducts.action'; -import { LINKED_PRODUCTS } from './LinkedProducts.dispatcher'; - -export const UPSELL = 'upsell'; -export const RELATED = 'related'; -export const CROSS_SELL = 'crosssell'; - -/** @namespace Store/LinkedProducts/Reducer/getInitialState */ -export const getInitialState = () => ({ - linkedProducts: BrowserDatabase.getItem(LINKED_PRODUCTS) || { - upsell: {}, - related: {}, - crosssell: {} - } -}); - -/** @namespace Store/LinkedProducts/Reducer/LinkedProductsReducer */ -export const LinkedProductsReducer = ( - state = getInitialState(), - action -) => { - const { type } = action; - - if (type !== UPDATE_LINKED_PRODUCTS) { - return state; - } - - const { - linkedProducts: { - [UPSELL]: upsell, - [RELATED]: related, - [CROSS_SELL]: crosssell, - updateCrossSell = false - } - } = action; - - const { - linkedProducts: { - [CROSS_SELL]: prevCrossSell - } - } = state; - - if (updateCrossSell) { - return { - ...state, - linkedProducts: { - [UPSELL]: upsell, - [RELATED]: related, - [CROSS_SELL]: crosssell - } - }; - } - - return { - ...state, - linkedProducts: { - [UPSELL]: upsell, - [RELATED]: related, - [CROSS_SELL]: { - ...prevCrossSell, - ...related, - items: Object.values({ - ...prevCrossSell.items, - ...crosssell.items - }) - } - } - }; -}; - -export default LinkedProductsReducer; diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts new file mode 100644 index 0000000000..f009de9790 --- /dev/null +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts @@ -0,0 +1,83 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { Reducer } from 'react'; + +import { LinkedProducts, LinkedProductsMap, LinkedProductType } from 'Type/ProductList.type'; +import BrowserDatabase from 'Util/BrowserDatabase'; + +import { LINKED_PRODUCTS } from './LinkedProducts.dispatcher'; +import { LinkedProductsActionType, LinkedProductsStore, UpdateLinkedProductsAction } from './LinkedProducts.type'; + +/** @namespace Store/LinkedProducts/Reducer/getInitialState */ +export const getInitialState = (): LinkedProductsStore => ({ + linkedProducts: BrowserDatabase.getItem(LINKED_PRODUCTS) || { + [LinkedProductType.UPSELL]: {} as LinkedProducts, + [LinkedProductType.RELATED]: {} as LinkedProducts, + [LinkedProductType.CROSS_SELL]: {} as LinkedProducts + } as LinkedProductsMap +}); + +/** @namespace Store/LinkedProducts/Reducer/LinkedProductsReducer */ +export const LinkedProductsReducer: Reducer = ( + state = getInitialState(), + action +) => { + const { type } = action; + + if (type !== LinkedProductsActionType.UPDATE_LINKED_PRODUCTS) { + return state; + } + + const { + linkedProducts: { + [LinkedProductType.UPSELL]: upsell, + [LinkedProductType.RELATED]: related, + [LinkedProductType.CROSS_SELL]: crosssell, + updateCrossSell = false + } + } = action; + + const { + linkedProducts: { + [LinkedProductType.CROSS_SELL]: prevCrossSell + } + } = state; + + if (updateCrossSell) { + return { + ...state, + linkedProducts: { + [LinkedProductType.UPSELL]: upsell, + [LinkedProductType.RELATED]: related, + [LinkedProductType.CROSS_SELL]: crosssell + } + }; + } + + return { + ...state, + linkedProducts: { + [LinkedProductType.UPSELL]: upsell, + [LinkedProductType.RELATED]: related, + [LinkedProductType.CROSS_SELL]: { + ...prevCrossSell, + ...related, + items: Object.values({ + ...(prevCrossSell?.items || []), + ...(crosssell?.items || []) + }) + } as LinkedProducts + } + }; +}; + +export default LinkedProductsReducer; diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts new file mode 100644 index 0000000000..5ef8f135c9 --- /dev/null +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts @@ -0,0 +1,35 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { LinkedProductsMap } from 'Type/ProductList.type'; + +export enum LinkedProductsActionType { + UPDATE_LINKED_PRODUCTS = 'UPDATE_LINKED_PRODUCTS' +} + +export interface UpdateLinkedProductsAction extends AnyAction { + type: LinkedProductsActionType.UPDATE_LINKED_PRODUCTS; + linkedProducts: LinkedProductsMap & { + updateCrossSell?: boolean; + }; +} + +export type LinkedProductsStore = { + linkedProducts: LinkedProductsMap; +}; + +declare module 'Util/Store/type' { + export interface RootState { + LinkedProductsReducer: LinkedProductsStore; + } +} diff --git a/packages/scandipwa/src/store/Meta/Meta.action.js b/packages/scandipwa/src/store/Meta/Meta.action.ts similarity index 60% rename from packages/scandipwa/src/store/Meta/Meta.action.js rename to packages/scandipwa/src/store/Meta/Meta.action.ts index 790beed1b2..ab62fbe1d6 100644 --- a/packages/scandipwa/src/store/Meta/Meta.action.js +++ b/packages/scandipwa/src/store/Meta/Meta.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,10 +10,10 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_META = 'UPDATE_META'; +import { MetaActionType, PageMeta, UpdateMetaAction } from './Meta.type'; /** @namespace Store/Meta/Action/updateMeta */ -export const updateMeta = (metadata) => ({ - type: UPDATE_META, +export const updateMeta = (metadata: Partial): UpdateMetaAction => ({ + type: MetaActionType.UPDATE_META, payload: metadata }); diff --git a/packages/scandipwa/src/store/Meta/Meta.reducer.js b/packages/scandipwa/src/store/Meta/Meta.reducer.ts similarity index 72% rename from packages/scandipwa/src/store/Meta/Meta.reducer.js rename to packages/scandipwa/src/store/Meta/Meta.reducer.ts index d7b2e508be..2be47e63e2 100644 --- a/packages/scandipwa/src/store/Meta/Meta.reducer.js +++ b/packages/scandipwa/src/store/Meta/Meta.reducer.ts @@ -9,9 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import { UPDATE_META } from './Meta.action'; +import { Reducer } from 'react'; -export const updateEveryTime = [ +import { + MetaActionType, MetaStore, PageMeta, UpdateMetaAction +} from './Meta.type'; + +export const updateEveryTime: Array = [ 'title', 'description', 'keywords', @@ -21,18 +25,18 @@ export const updateEveryTime = [ ]; /** @namespace Store/Meta/Reducer/filterData */ -export const filterData = (data) => { +export const filterData = (data: Partial): Partial => { const updated = updateEveryTime.reduce((acc, key) => { acc[key] = data[key]; return acc; - }, {}); + }, {} as Partial); return { ...data, ...updated }; }; /** @namespace Store/Meta/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): MetaStore => ({ title: '', title_prefix: '', title_suffix: '', @@ -44,14 +48,14 @@ export const getInitialState = () => ({ }); /** @namespace Store/Meta/Reducer/MetaReducer */ -export const MetaReducer = ( +export const MetaReducer: Reducer = ( state = getInitialState(), action ) => { const { payload = {}, type } = action; switch (type) { - case UPDATE_META: + case MetaActionType.UPDATE_META: const filteredData = filterData(payload); return { diff --git a/packages/scandipwa/src/store/Meta/Meta.type.ts b/packages/scandipwa/src/store/Meta/Meta.type.ts new file mode 100644 index 0000000000..d8d3bb631f --- /dev/null +++ b/packages/scandipwa/src/store/Meta/Meta.type.ts @@ -0,0 +1,43 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum MetaActionType { + UPDATE_META = 'UPDATE_META' +} + +export type PageMeta = { + default_title: string; + title: string; + default_description: string; + description: string; + default_keywords: string; + keywords: string; + title_prefix: string; + title_suffix: string; + status_code: string; + canonical_url: string; + robots: string; +}; + +export interface UpdateMetaAction extends AnyAction { + type: MetaActionType.UPDATE_META; + payload: Partial; +} + +export type MetaStore = Partial; + +declare module 'Util/Store/type' { + export interface RootState { + MetaReducer: MetaStore; + } +} diff --git a/packages/scandipwa/src/store/Navigation/Navigation.action.js b/packages/scandipwa/src/store/Navigation/Navigation.action.js deleted file mode 100644 index 3d018918a6..0000000000 --- a/packages/scandipwa/src/store/Navigation/Navigation.action.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const CHANGE_NAVIGATION_STATE = 'CHANGE_NAVIGATION_STATE'; -export const GOTO_PREVIOUS_NAVIGATION_STATE = 'GOTO_PREVIOUS_NAVIGATION_STATE'; - -/** @namespace Store/Navigation/Action/changeNavigationState */ -export const changeNavigationState = (navigationType, navigationState) => ({ - type: CHANGE_NAVIGATION_STATE, - navigationType, - navigationState -}); - -/** @namespace Store/Navigation/Action/goToPreviousNavigationState */ -export const goToPreviousNavigationState = (navigationType) => ({ - type: GOTO_PREVIOUS_NAVIGATION_STATE, - navigationType -}); diff --git a/packages/scandipwa/src/store/Navigation/Navigation.action.ts b/packages/scandipwa/src/store/Navigation/Navigation.action.ts new file mode 100644 index 0000000000..fb353a3354 --- /dev/null +++ b/packages/scandipwa/src/store/Navigation/Navigation.action.ts @@ -0,0 +1,34 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { + ChangeNavigationStateAction, + GoToPreviousNavigationStateAction, + NavigationActionType, + NavigationState, + NavigationType +} from './Navigation.type'; + +/** @namespace Store/Navigation/Action/changeNavigationState */ +export const changeNavigationState = ( + navigationType: NavigationType, + navigationState: NavigationState +): ChangeNavigationStateAction => ({ + type: NavigationActionType.CHANGE_NAVIGATION_STATE, + navigationType, + navigationState +}); + +/** @namespace Store/Navigation/Action/goToPreviousNavigationState */ +export const goToPreviousNavigationState = (navigationType: NavigationType): GoToPreviousNavigationStateAction => ({ + type: NavigationActionType.GOTO_PREVIOUS_NAVIGATION_STATE, + navigationType +}); diff --git a/packages/scandipwa/src/store/Navigation/Navigation.reducer.js b/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts similarity index 74% rename from packages/scandipwa/src/store/Navigation/Navigation.reducer.js rename to packages/scandipwa/src/store/Navigation/Navigation.reducer.ts index 333b62a984..d75d7a9b21 100644 --- a/packages/scandipwa/src/store/Navigation/Navigation.reducer.js +++ b/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts @@ -9,32 +9,34 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'react'; + import { DEFAULT_STATE } from 'Component/NavigationAbstract/NavigationAbstract.container'; import { - CHANGE_NAVIGATION_STATE, - GOTO_PREVIOUS_NAVIGATION_STATE -} from './Navigation.action'; - -export const TOP_NAVIGATION_TYPE = 'TOP_NAVIGATION_TYPE'; -export const BOTTOM_NAVIGATION_TYPE = 'BOTTOM_NAVIGATION_TYPE'; + NavigationAction, + NavigationActionType, + NavigationState, + NavigationStore, + NavigationType +} from './Navigation.type'; /** @namespace Store/Navigation/Reducer/getInitialState */ -export const getInitialState = () => ({ - [TOP_NAVIGATION_TYPE]: { +export const getInitialState = (): NavigationStore => ({ + [NavigationType.TOP_NAVIGATION_TYPE]: { navigationState: DEFAULT_STATE, navigationStateHistory: [DEFAULT_STATE] }, - [BOTTOM_NAVIGATION_TYPE]: { + [NavigationType.BOTTOM_NAVIGATION_TYPE]: { navigationState: DEFAULT_STATE, navigationStateHistory: [DEFAULT_STATE] } }); /** @namespace Store/Navigation/Reducer/NavigationReducer */ -export const NavigationReducer = ( +export const NavigationReducer: Reducer = ( state = getInitialState(), action ) => { @@ -42,13 +44,13 @@ export const NavigationReducer = ( const { [navigationType]: { - navigationStateHistory, - navigationState: prevNavigationState + navigationStateHistory = [], + navigationState: prevNavigationState = {} as NavigationState } = {} } = state; switch (action.type) { - case CHANGE_NAVIGATION_STATE: + case NavigationActionType.CHANGE_NAVIGATION_STATE: const { name: nextName, force = false } = navigationState; const { name: prevName } = prevNavigationState; @@ -66,7 +68,7 @@ export const NavigationReducer = ( } }; - case GOTO_PREVIOUS_NAVIGATION_STATE: + case NavigationActionType.GOTO_PREVIOUS_NAVIGATION_STATE: navigationStateHistory.pop(); const newNavigationState = navigationStateHistory.slice(-1)[0]; diff --git a/packages/scandipwa/src/store/Navigation/Navigation.type.ts b/packages/scandipwa/src/store/Navigation/Navigation.type.ts new file mode 100644 index 0000000000..1599dcd004 --- /dev/null +++ b/packages/scandipwa/src/store/Navigation/Navigation.type.ts @@ -0,0 +1,57 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum NavigationActionType { + CHANGE_NAVIGATION_STATE = 'CHANGE_NAVIGATION_STATE', + GOTO_PREVIOUS_NAVIGATION_STATE = 'GOTO_PREVIOUS_NAVIGATION_STATE' +} + +export enum NavigationType { + TOP_NAVIGATION_TYPE = 'TOP_NAVIGATION_TYPE', + BOTTOM_NAVIGATION_TYPE = 'BOTTOM_NAVIGATION_TYPE' +} + +export type NavigationState = { + name: string; + force?: boolean; +}; + +export interface ChangeNavigationStateAction extends AnyAction { + type: NavigationActionType.CHANGE_NAVIGATION_STATE; + navigationType: NavigationType; + navigationState: NavigationState; +} + +export interface GoToPreviousNavigationStateAction extends AnyAction { + type: NavigationActionType.GOTO_PREVIOUS_NAVIGATION_STATE; + navigationType: NavigationType; +} + +export type NavigationAction = ChangeNavigationStateAction | GoToPreviousNavigationStateAction; + +export type NavigationStore = { + [NavigationType.TOP_NAVIGATION_TYPE]: { + navigationState: NavigationState; + navigationStateHistory: NavigationState[]; + }; + [NavigationType.BOTTOM_NAVIGATION_TYPE]: { + navigationState: NavigationState; + navigationStateHistory: NavigationState[]; + }; +}; + +declare module 'Util/Store/type' { + export interface RootState { + NavigationReducer: NavigationStore; + } +} diff --git a/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.js b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.ts similarity index 57% rename from packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.js rename to packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.ts index a55cc129c1..5886112f88 100644 --- a/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.js +++ b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,14 +10,14 @@ * @link https://github.com/scandipwa/base-theme */ -export const SUBSCRIBE_TO_NEWSLETTER = 'SUBSCRIBE_TO_NEWSLETTER'; +import { NewsletterSubscriptionActionType, SubscribeToNewsletterAction } from './NewsletterSubscription.type'; /** * @param {String} email * @returns {void} * @namespace Store/NewsletterSubscription/Action/subscribeToNewsletter */ -export const subscribeToNewsletter = (email) => ({ - type: SUBSCRIBE_TO_NEWSLETTER, +export const subscribeToNewsletter = (email: string): SubscribeToNewsletterAction => ({ + type: NewsletterSubscriptionActionType.SUBSCRIBE_TO_NEWSLETTER, email }); diff --git a/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.type.ts b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.type.ts new file mode 100644 index 0000000000..4c375256f6 --- /dev/null +++ b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.type.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum NewsletterSubscriptionActionType { + SUBSCRIBE_TO_NEWSLETTER = 'SUBSCRIBE_TO_NEWSLETTER' +} + +export interface SubscribeToNewsletterAction extends AnyAction { + type: NewsletterSubscriptionActionType.SUBSCRIBE_TO_NEWSLETTER; + email: string; +} diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.action.js b/packages/scandipwa/src/store/NoMatch/NoMatch.action.ts similarity index 65% rename from packages/scandipwa/src/store/NoMatch/NoMatch.action.js rename to packages/scandipwa/src/store/NoMatch/NoMatch.action.ts index 7907d3b0f8..4cd19c1a14 100644 --- a/packages/scandipwa/src/store/NoMatch/NoMatch.action.js +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,7 +10,7 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_NOMATCH = 'UPDATE_NOMATCH'; +import { NoMatchActionType, UpdateNoMatchAction } from './NoMatch.type'; /** * Update router to show NoMatch page @@ -17,7 +18,7 @@ export const UPDATE_NOMATCH = 'UPDATE_NOMATCH'; * @return {void} * @namespace Store/NoMatch/Action/updateNoMatch */ -export const updateNoMatch = (noMatch) => ({ - type: UPDATE_NOMATCH, +export const updateNoMatch = (noMatch: boolean): UpdateNoMatchAction => ({ + type: NoMatchActionType.UPDATE_NOMATCH, noMatch }); diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.js b/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts similarity index 68% rename from packages/scandipwa/src/store/NoMatch/NoMatch.reducer.js rename to packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts index 3e44db5ecf..2d6b4c34cc 100644 --- a/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.js +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts @@ -9,22 +9,26 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'react'; + import { - UPDATE_NOMATCH -} from './NoMatch.action'; + NoMatchActionType, + NoMatchStore, + UpdateNoMatchAction +} from './NoMatch.type'; /** @namespace Store/NoMatch/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): NoMatchStore => ({ noMatch: false }); /** @namespace Store/NoMatch/Reducer/NoMatchReducer */ -export const NoMatchReducer = ( +export const NoMatchReducer: Reducer = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_NOMATCH: + case NoMatchActionType.UPDATE_NOMATCH: const { noMatch } = action; return { noMatch }; diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts b/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts new file mode 100644 index 0000000000..b98a6062a0 --- /dev/null +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts @@ -0,0 +1,31 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum NoMatchActionType { + UPDATE_NOMATCH = 'UPDATE_NOMATCH' +} + +export interface UpdateNoMatchAction extends AnyAction { + type: NoMatchActionType.UPDATE_NOMATCH; + noMatch: boolean; +} + +export type NoMatchStore = { + noMatch: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + NoMatchReducer: NoMatchStore; + } +} diff --git a/packages/scandipwa/src/store/Notification/Notification.action.js b/packages/scandipwa/src/store/Notification/Notification.action.ts similarity index 58% rename from packages/scandipwa/src/store/Notification/Notification.action.js rename to packages/scandipwa/src/store/Notification/Notification.action.ts index d6fd2c089c..f94447c0bc 100644 --- a/packages/scandipwa/src/store/Notification/Notification.action.js +++ b/packages/scandipwa/src/store/Notification/Notification.action.ts @@ -9,8 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -export const SHOW_NOTIFICATION = 'SHOW_NOTIFICATION'; -export const HIDE_NOTIFICATION = 'HIDE_NOTIFICATION'; +import { + HideNotificationAction, NotificationActionType, NotificationType, ShowNotificationAction +} from './Notification.type'; /** * Show notification (append to notification to global notification map). @@ -20,12 +21,16 @@ export const HIDE_NOTIFICATION = 'HIDE_NOTIFICATION'; * @return {void} * @namespace Store/Notification/Action/showNotification */ -export const showNotification = (msgType, msgText, msgDebug) => ({ - type: SHOW_NOTIFICATION, - msgType, - msgText, - msgDebug -}); +export const showNotification = ( + msgType: NotificationType, + msgText: string, + msgDebug?: T +): ShowNotificationAction => ({ + type: NotificationActionType.SHOW_NOTIFICATION, + msgType, + msgText, + msgDebug + }); /** * Hide notification with specific id (drop notification from global list). @@ -33,7 +38,7 @@ export const showNotification = (msgType, msgText, msgDebug) => ({ * @return {void} * @namespace Store/Notification/Action/hideNotification */ -export const hideNotification = (id) => ({ - type: HIDE_NOTIFICATION, +export const hideNotification = (id: number): HideNotificationAction => ({ + type: NotificationActionType.HIDE_NOTIFICATION, id }); diff --git a/packages/scandipwa/src/store/Notification/Notification.reducer.js b/packages/scandipwa/src/store/Notification/Notification.reducer.ts similarity index 73% rename from packages/scandipwa/src/store/Notification/Notification.reducer.js rename to packages/scandipwa/src/store/Notification/Notification.reducer.ts index c30a94d83e..ba740fe0b2 100644 --- a/packages/scandipwa/src/store/Notification/Notification.reducer.js +++ b/packages/scandipwa/src/store/Notification/Notification.reducer.ts @@ -9,22 +9,24 @@ * @link https://github.com/scandipwa/base-theme */ -import { HIDE_NOTIFICATION, SHOW_NOTIFICATION } from './Notification.action'; +import { Reducer } from 'react'; + +import { NotificationAction, NotificationActionType, NotificationStore } from './Notification.type'; /** @namespace Store/Notification/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): NotificationStore => ({ notifications: {} }); /** @namespace Store/Notification/Reducer/NotificationReducer */ -export const NotificationReducer = ( +export const NotificationReducer: Reducer = ( state = getInitialState(), action ) => { const notifications = { ...state.notifications }; switch (action.type) { - case SHOW_NOTIFICATION: + case NotificationActionType.SHOW_NOTIFICATION: const { msgType, msgText, msgDebug } = action; notifications[Date.now()] = { msgType, msgText, msgDebug }; @@ -33,7 +35,7 @@ export const NotificationReducer = ( notifications }; - case HIDE_NOTIFICATION: + case NotificationActionType.HIDE_NOTIFICATION: const { [action.id]: id, ...shownNotifications } = notifications; return { diff --git a/packages/scandipwa/src/store/Notification/Notification.type.ts b/packages/scandipwa/src/store/Notification/Notification.type.ts new file mode 100644 index 0000000000..1ebcaf451b --- /dev/null +++ b/packages/scandipwa/src/store/Notification/Notification.type.ts @@ -0,0 +1,53 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +export enum NotificationActionType { + SHOW_NOTIFICATION = 'SHOW_NOTIFICATION', + HIDE_NOTIFICATION = 'HIDE_NOTIFICATION' +} + +export enum NotificationType { + INFO = 'info', + ERROR = 'error', + SUCCESS = 'success' +} + +export type Notification = { + msgType: NotificationType; + msgText: string; + msgDebug?: T; +}; + +export interface ShowNotificationAction extends AnyAction { + type: NotificationActionType.SHOW_NOTIFICATION; + msgType: NotificationType; + msgText: string; + msgDebug?: T; +} + +export interface HideNotificationAction extends AnyAction { + type: NotificationActionType.HIDE_NOTIFICATION; + id: number; +} + +export type NotificationAction = ShowNotificationAction | HideNotificationAction; + +export type NotificationStore = { + notifications: Record>; +}; + +declare module 'Util/Store/type' { + export interface RootState { + NotificationReducer: NotificationStore; + } +} diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 0dc43b399e..84711ae8cb 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -394,4 +394,16 @@ export type Option = OptionTypes & { uid?: string; }; -export type LinkedProducts = Record; +export enum LinkedProductType { + UPSELL = 'upsell', + RELATED = 'related', + CROSS_SELL = 'crosssell', + ASSOCIATED = 'associated' +} + +export type LinkedProducts = { + items: Product[]; + total_count: number; +}; + +export type LinkedProductsMap = Partial>; From 6b750326f6cbcce0ed28fe10f189be6c77ba1670 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 8 Apr 2022 21:56:40 +0300 Subject: [PATCH 024/192] Migrated some actions to TS --- .../{Order.action.js => Order.action.ts} | 17 ++++--- .../{Order.reducer.js => Order.reducer.ts} | 42 +++++++++++----- .../scandipwa/src/store/Order/Order.type.ts | 49 +++++++++++++++++++ .../{Product.action.js => Product.action.ts} | 9 ++-- ...{Product.reducer.js => Product.reducer.ts} | 41 +++++----------- .../src/store/Product/Product.type.ts | 28 +++++++++++ packages/scandipwa/src/util/Orders/Orders.ts | 5 +- .../scandipwa/src/util/Product/Product.ts | 2 +- 8 files changed, 140 insertions(+), 53 deletions(-) rename packages/scandipwa/src/store/Order/{Order.action.js => Order.action.ts} (50%) rename packages/scandipwa/src/store/Order/{Order.reducer.js => Order.reducer.ts} (55%) create mode 100644 packages/scandipwa/src/store/Order/Order.type.ts rename packages/scandipwa/src/store/Product/{Product.action.js => Product.action.ts} (62%) rename packages/scandipwa/src/store/Product/{Product.reducer.js => Product.reducer.ts} (50%) create mode 100644 packages/scandipwa/src/store/Product/Product.type.ts diff --git a/packages/scandipwa/src/store/Order/Order.action.js b/packages/scandipwa/src/store/Order/Order.action.ts similarity index 50% rename from packages/scandipwa/src/store/Order/Order.action.js rename to packages/scandipwa/src/store/Order/Order.action.ts index 34b24e519d..ce35562496 100644 --- a/packages/scandipwa/src/store/Order/Order.action.js +++ b/packages/scandipwa/src/store/Order/Order.action.ts @@ -9,18 +9,23 @@ * @link https://github.com/scandipwa/base-theme */ -export const GET_ORDER_LIST = 'GET_ORDER_LIST'; -export const SET_ORDER_LOADING_STATUS = 'SET_ORDER_LOADING_STATUS'; +import { GQLCustomerOrders } from 'Type/Graphql.type'; + +import { + GetOrderListAction, + OrderActionType, + SetLoadingStatusAction +} from './Order.type'; /** @namespace Store/Order/Action/getOrderList */ -export const getOrderList = (orderList, status) => ({ - type: GET_ORDER_LIST, +export const getOrderList = (orderList: GQLCustomerOrders, status: boolean): GetOrderListAction => ({ + type: OrderActionType.GET_ORDER_LIST, orderList, status }); /** @namespace Store/Order/Action/setLoadingStatus */ -export const setLoadingStatus = (status) => ({ - type: SET_ORDER_LOADING_STATUS, +export const setLoadingStatus = (status: boolean): SetLoadingStatusAction => ({ + type: OrderActionType.SET_ORDER_LOADING_STATUS, status }); diff --git a/packages/scandipwa/src/store/Order/Order.reducer.js b/packages/scandipwa/src/store/Order/Order.reducer.ts similarity index 55% rename from packages/scandipwa/src/store/Order/Order.reducer.js rename to packages/scandipwa/src/store/Order/Order.reducer.ts index b9543077d0..2202c38603 100644 --- a/packages/scandipwa/src/store/Order/Order.reducer.js +++ b/packages/scandipwa/src/store/Order/Order.reducer.ts @@ -9,42 +9,58 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'react'; + +import { GQLCustomerOrder } from 'Type/Graphql.type'; import { formatOrders } from 'Util/Orders'; -import { GET_ORDER_LIST, SET_ORDER_LOADING_STATUS } from './Order.action'; +import { + OrderAction, + OrderActionType, + OrderList, + OrderStore +} from './Order.type'; /** @namespace Store/Order/Reducer/getInitialState */ -export const getInitialState = () => ({ - orderList: {}, +export const getInitialState = (): OrderStore => ({ + orderList: {} as OrderList, isLoading: true }); /** @namespace Store/Order/Reducer/OrderReducer */ -export const OrderReducer = ( +export const OrderReducer: Reducer = ( state = getInitialState(), action ) => { - const { - type, - orderList, - status - } = action; + const { type } = action; switch (type) { - case GET_ORDER_LIST: + case OrderActionType.GET_ORDER_LIST: { + const { + orderList, + status + } = action; const { items = [], page_info } = orderList; - const formattedOrders = formatOrders(items); + const formattedOrders = formatOrders(items as GQLCustomerOrder[]); return { ...state, isLoading: status, orderList: { items: formattedOrders, pageInfo: page_info } - }; - case SET_ORDER_LOADING_STATUS: + } as OrderStore; + } + + case OrderActionType.SET_ORDER_LOADING_STATUS: { + const { + status + } = action; + return { ...state, isLoading: status }; + } + default: return state; } diff --git a/packages/scandipwa/src/store/Order/Order.type.ts b/packages/scandipwa/src/store/Order/Order.type.ts new file mode 100644 index 0000000000..ffcdad2d4e --- /dev/null +++ b/packages/scandipwa/src/store/Order/Order.type.ts @@ -0,0 +1,49 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { GQLCustomerOrders, GQLSearchResultPageInfo } from 'Type/Graphql.type'; +import { Order } from 'Type/Order.type'; + +export enum OrderActionType { + GET_ORDER_LIST = 'GET_ORDER_LIST', + SET_ORDER_LOADING_STATUS = 'SET_ORDER_LOADING_STATUS' +} + +export type OrderList = { + items: Order[]; + pageInfo: GQLSearchResultPageInfo; +}; + +export interface GetOrderListAction extends AnyAction { + type: OrderActionType.GET_ORDER_LIST; + orderList: GQLCustomerOrders; + status: boolean; +} + +export interface SetLoadingStatusAction extends AnyAction { + type: OrderActionType.SET_ORDER_LOADING_STATUS; + status: boolean; +} + +export type OrderAction = GetOrderListAction | SetLoadingStatusAction; + +export type OrderStore = { + orderList: OrderList; + isLoading: boolean; +}; + +declare module 'Util/Store/type' { + export interface RootState { + OrderReducer: OrderStore; + } +} diff --git a/packages/scandipwa/src/store/Product/Product.action.js b/packages/scandipwa/src/store/Product/Product.action.ts similarity index 62% rename from packages/scandipwa/src/store/Product/Product.action.js rename to packages/scandipwa/src/store/Product/Product.action.ts index c46304a187..77703319fd 100644 --- a/packages/scandipwa/src/store/Product/Product.action.js +++ b/packages/scandipwa/src/store/Product/Product.action.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,7 +10,9 @@ * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_PRODUCT_DETAILS = 'UPDATE_PRODUCT_DETAILS'; +import { Product, ProductBundle } from 'Type/ProductList.type'; + +import { ProductActionType, UpdateProductDetailsAction } from './Product.type'; /** * Update product list with new list (rewrite if already exists). @@ -18,7 +21,7 @@ export const UPDATE_PRODUCT_DETAILS = 'UPDATE_PRODUCT_DETAILS'; * @return {void} * @namespace Store/Product/Action/updateProductDetails */ -export const updateProductDetails = (product) => ({ - type: UPDATE_PRODUCT_DETAILS, +export const updateProductDetails = (product: Product | ProductBundle): UpdateProductDetailsAction => ({ + type: ProductActionType.UPDATE_PRODUCT_DETAILS, product }); diff --git a/packages/scandipwa/src/store/Product/Product.reducer.js b/packages/scandipwa/src/store/Product/Product.reducer.ts similarity index 50% rename from packages/scandipwa/src/store/Product/Product.reducer.js rename to packages/scandipwa/src/store/Product/Product.reducer.ts index 20d91049df..5e7523063d 100644 --- a/packages/scandipwa/src/store/Product/Product.reducer.js +++ b/packages/scandipwa/src/store/Product/Product.reducer.ts @@ -7,49 +7,34 @@ * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme - */ +*/ + +import { Reducer } from 'react'; + import { getIndexedProduct } from 'Util/Product'; -import { UPDATE_PRODUCT_DETAILS } from './Product.action'; +import { ProductActionType, ProductStore, UpdateProductDetailsAction } from './Product.type'; /** @namespace Store/Product/Reducer/getInitialState */ -export const getInitialState = () => ({ - product: {}, - formattedConfigurableOptions: {}, - showLengthError: false -}); - -/** @namespace Store/Product/Reducer/formatConfigurableOptions */ -export const formatConfigurableOptions = (configurable_options) => configurable_options - .reduce((prev, option) => { - const { - attribute_id, - label, - attribute_code - } = option; - - return { - ...prev, - [attribute_code]: { - attribute_id, - label - } - }; - }, {}); +export const getInitialState = (): ProductStore => ({ + product: {} +} as ProductStore); /** @namespace Store/Product/Reducer/ProductReducer */ -export const ProductReducer = ( +export const ProductReducer: Reducer = ( state = getInitialState(), action ) => { switch (action.type) { - case UPDATE_PRODUCT_DETAILS: + case ProductActionType.UPDATE_PRODUCT_DETAILS: { const { product } = action; return { ...state, product: getIndexedProduct(product) - }; + } as ProductStore; + } + default: return state; } diff --git a/packages/scandipwa/src/store/Product/Product.type.ts b/packages/scandipwa/src/store/Product/Product.type.ts new file mode 100644 index 0000000000..78b1058bd5 --- /dev/null +++ b/packages/scandipwa/src/store/Product/Product.type.ts @@ -0,0 +1,28 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { Product, ProductBundle } from 'Type/ProductList.type'; +import { IndexedProduct } from 'Util/Product/Product'; + +export enum ProductActionType { + UPDATE_PRODUCT_DETAILS = 'UPDATE_PRODUCT_DETAILS' +} + +export interface UpdateProductDetailsAction extends AnyAction { + type: ProductActionType.UPDATE_PRODUCT_DETAILS; + product: Product | ProductBundle; +} + +export type ProductStore = { + product: IndexedProduct; +}; diff --git a/packages/scandipwa/src/util/Orders/Orders.ts b/packages/scandipwa/src/util/Orders/Orders.ts index 7d810052ac..d8162c5fc4 100644 --- a/packages/scandipwa/src/util/Orders/Orders.ts +++ b/packages/scandipwa/src/util/Orders/Orders.ts @@ -10,6 +10,7 @@ * @link https://github.com/scandipwa/scandipwa */ +import { GQLCustomerOrder } from 'Type/Graphql.type'; import { Discount, Order, OrderProduct, OrderProductQuantity, OrderProducts @@ -29,14 +30,14 @@ export const getFormattedDate = (rawDate = ''): string => { }; /** @namespace Util/Orders/formatOrders */ -export const formatOrders = (orders: Order[]): Order[] => orders.reduceRight((acc, order) => { +export const formatOrders = (orders: GQLCustomerOrder[]): Order[] => orders.reduceRight((acc, order) => { const { order_date, id: uid } = order; const formattedDate = getFormattedDate(order_date); return [ ...acc, { - ...order, + ...order as unknown as Order, id: atob(uid), created_at: formattedDate } diff --git a/packages/scandipwa/src/util/Product/Product.ts b/packages/scandipwa/src/util/Product/Product.ts index 7804045cf5..19d889ae7f 100644 --- a/packages/scandipwa/src/util/Product/Product.ts +++ b/packages/scandipwa/src/util/Product/Product.ts @@ -331,7 +331,7 @@ export const getBundleOptions = (options: BundleOption[], items: ProductBundleIt export const getIndexedProduct = ( product: Product | ProductBundle, itemSku?: string -) => { +): IndexedProduct => { const { variants: initialVariants = [], configurable_options: initialConfigurableOptions = [], From e24e8a75807aa9ab8d8d1d40689b6e9d1afde4ac Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Fri, 8 Apr 2022 22:23:18 +0300 Subject: [PATCH 025/192] Migrated some actions to TS --- .../ProductCompare/ProductCompare.action.js | 59 ------------- .../ProductCompare/ProductCompare.action.ts | 64 ++++++++++++++ ...e.reducer.js => ProductCompare.reducer.ts} | 37 ++++---- .../ProductCompare/ProductCompare.type.ts | 87 +++++++++++++++++++ 4 files changed, 171 insertions(+), 76 deletions(-) delete mode 100644 packages/scandipwa/src/store/ProductCompare/ProductCompare.action.js create mode 100644 packages/scandipwa/src/store/ProductCompare/ProductCompare.action.ts rename packages/scandipwa/src/store/ProductCompare/{ProductCompare.reducer.js => ProductCompare.reducer.ts} (71%) create mode 100644 packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.js b/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.js deleted file mode 100644 index 725506b3c5..0000000000 --- a/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const TOGGLE_COMPARE_LIST_LOADER = 'TOGGLE_COMPARE_LIST_LOADER'; -export const SET_COMPARE_LIST = 'SET_COMPARE_LIST'; -export const REMOVE_COMPARED_PRODUCT = 'REMOVE_COMPARED_PRODUCT'; -export const CLEAR_COMPARED_PRODUCTS = 'CLEAR_COMPARED_PRODUCTS'; -export const SET_COMPARED_PRODUCT_IDS = 'SET_COMPARED_PRODUCT_IDS'; -export const ADD_COMPARED_PRODUCT_ID = 'ADD_COMPARED_PRODUCT_ID'; -export const UPDATE_COMPARE_TOTALS = 'UPDATE_COMPARE_TOTALS'; - -/** @namespace Store/ProductCompare/Action/toggleLoader */ -export const toggleLoader = (isLoading) => ({ - type: TOGGLE_COMPARE_LIST_LOADER, - isLoading -}); - -/** @namespace Store/ProductCompare/Action/setCompareList */ -export const setCompareList = (payload) => ({ - type: SET_COMPARE_LIST, - ...payload -}); - -/** @namespace Store/ProductCompare/Action/removeComparedProduct */ -export const removeComparedProduct = (productId) => ({ - type: REMOVE_COMPARED_PRODUCT, - productId -}); - -/** @namespace Store/ProductCompare/Action/clearComparedProducts */ -export const clearComparedProducts = () => ({ - type: CLEAR_COMPARED_PRODUCTS -}); - -/** @namespace Store/ProductCompare/Action/setCompareListIds */ -export const setCompareListIds = (productIds) => ({ - type: SET_COMPARED_PRODUCT_IDS, - productIds -}); - -/** @namespace Store/ProductCompare/Action/addComparedProductIds */ -export const addComparedProductIds = (productId) => ({ - type: ADD_COMPARED_PRODUCT_ID, - productId -}); - -/** @namespace Store/ProductCompare/Action/updateCompareTotals */ -export const updateCompareTotals = (compareTotals) => ({ - type: UPDATE_COMPARE_TOTALS, - compareTotals -}); diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.ts b/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.ts new file mode 100644 index 0000000000..6b5e5f840d --- /dev/null +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.action.ts @@ -0,0 +1,64 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { GQLCompareList } from 'Type/Graphql.type'; + +import { + AddComparedProductIdsAction, + ClearComparedProductsAction, + ProductCompareActionType, + RemoveComparedProductAction, + SetCompareListAction, + SetCompareListIdsAction, + ToggleLoaderAction, + UpdateCompareTotalsAction +} from './ProductCompare.type'; + +/** @namespace Store/ProductCompare/Action/toggleLoader */ +export const toggleLoader = (isLoading: boolean): ToggleLoaderAction => ({ + type: ProductCompareActionType.TOGGLE_COMPARE_LIST_LOADER, + isLoading +}); + +/** @namespace Store/ProductCompare/Action/setCompareList */ +export const setCompareList = (payload: GQLCompareList): SetCompareListAction => ({ + type: ProductCompareActionType.SET_COMPARE_LIST, + payload +}); + +/** @namespace Store/ProductCompare/Action/removeComparedProduct */ +export const removeComparedProduct = (productId: number): RemoveComparedProductAction => ({ + type: ProductCompareActionType.REMOVE_COMPARED_PRODUCT, + productId +}); + +/** @namespace Store/ProductCompare/Action/clearComparedProducts */ +export const clearComparedProducts = (): ClearComparedProductsAction => ({ + type: ProductCompareActionType.CLEAR_COMPARED_PRODUCTS +}); + +/** @namespace Store/ProductCompare/Action/setCompareListIds */ +export const setCompareListIds = (productIds: number[]): SetCompareListIdsAction => ({ + type: ProductCompareActionType.SET_COMPARED_PRODUCT_IDS, + productIds +}); + +/** @namespace Store/ProductCompare/Action/addComparedProductIds */ +export const addComparedProductIds = (productId: number): AddComparedProductIdsAction => ({ + type: ProductCompareActionType.ADD_COMPARED_PRODUCT_ID, + productId +}); + +/** @namespace Store/ProductCompare/Action/updateCompareTotals */ +export const updateCompareTotals = (compareTotals: number): UpdateCompareTotalsAction => ({ + type: ProductCompareActionType.UPDATE_COMPARE_TOTALS, + compareTotals +}); diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.js b/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts similarity index 71% rename from packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.js rename to packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts index a67ea662ed..11b544a83d 100644 --- a/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.js +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts @@ -9,21 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'react'; + import BrowserDatabase from 'Util/BrowserDatabase/BrowserDatabase'; import { - CLEAR_COMPARED_PRODUCTS, - SET_COMPARE_LIST, - SET_COMPARED_PRODUCT_IDS, - TOGGLE_COMPARE_LIST_LOADER, - UPDATE_COMPARE_TOTALS -} from './ProductCompare.action'; + ProductCompareAction, + ProductCompareActionType, + ProductCompareStore +} from './ProductCompare.type'; export const COMPARE_LIST_PRODUCTS = 'compare_list_products'; /** @namespace Store/ProductCompare/Reducer/getInitialState */ -export const getInitialState = () => { - const compareListProducts = BrowserDatabase.getItem(COMPARE_LIST_PRODUCTS) || []; +export const getInitialState = (): ProductCompareStore => { + const compareListProducts = BrowserDatabase.getItem(COMPARE_LIST_PRODUCTS) || []; return { isLoading: false, @@ -36,11 +36,14 @@ export const getInitialState = () => { }; /** @namespace Store/ProductCompare/Reducer/ProductCompareReducer */ -export const ProductCompareReducer = (state = getInitialState(), action) => { +export const ProductCompareReducer: Reducer = ( + state = getInitialState(), + action +) => { const { type } = action; switch (type) { - case TOGGLE_COMPARE_LIST_LOADER: { + case ProductCompareActionType.TOGGLE_COMPARE_LIST_LOADER: { const { isLoading } = action; return { @@ -49,11 +52,11 @@ export const ProductCompareReducer = (state = getInitialState(), action) => { }; } - case SET_COMPARE_LIST: { - const { item_count = 0, items = [], attributes = [] } = action; + case ProductCompareActionType.SET_COMPARE_LIST: { + const { item_count = 0, items = [], attributes = [] } = action.payload; const products = items.map((item) => ({ - ...item.product, + ...(item?.product || {}), attributes: [] })); const productIds = products.map((product) => product.id); @@ -70,10 +73,10 @@ export const ProductCompareReducer = (state = getInitialState(), action) => { products, productIds, items - }; + } as ProductCompareStore; } - case UPDATE_COMPARE_TOTALS: { + case ProductCompareActionType.UPDATE_COMPARE_TOTALS: { const { compareTotals = 0 } = action; return { @@ -82,7 +85,7 @@ export const ProductCompareReducer = (state = getInitialState(), action) => { }; } - case CLEAR_COMPARED_PRODUCTS: { + case ProductCompareActionType.CLEAR_COMPARED_PRODUCTS: { BrowserDatabase.setItem( [], COMPARE_LIST_PRODUCTS @@ -98,7 +101,7 @@ export const ProductCompareReducer = (state = getInitialState(), action) => { }; } - case SET_COMPARED_PRODUCT_IDS: { + case ProductCompareActionType.SET_COMPARED_PRODUCT_IDS: { const { productIds } = action; BrowserDatabase.setItem( diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts b/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts new file mode 100644 index 0000000000..7415a535b3 --- /dev/null +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts @@ -0,0 +1,87 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { + GQLComparableAttribute, GQLComparableItem, GQLCompareList, GQLProductInterface +} from 'Type/Graphql.type'; + +export enum ProductCompareActionType { + TOGGLE_COMPARE_LIST_LOADER = 'TOGGLE_COMPARE_LIST_LOADER', + SET_COMPARE_LIST = 'SET_COMPARE_LIST', + REMOVE_COMPARED_PRODUCT = 'REMOVE_COMPARED_PRODUCT', + CLEAR_COMPARED_PRODUCTS = 'CLEAR_COMPARED_PRODUCTS', + SET_COMPARED_PRODUCT_IDS = 'SET_COMPARED_PRODUCT_IDS', + ADD_COMPARED_PRODUCT_ID = 'ADD_COMPARED_PRODUCT_ID', + UPDATE_COMPARE_TOTALS = 'UPDATE_COMPARE_TOTALS' +} + +export interface ToggleLoaderAction extends AnyAction { + type: ProductCompareActionType.TOGGLE_COMPARE_LIST_LOADER; + isLoading: boolean; +} + +export interface SetCompareListAction extends AnyAction { + type: ProductCompareActionType.SET_COMPARE_LIST; + payload: GQLCompareList; +} + +export interface RemoveComparedProductAction extends AnyAction { + type: ProductCompareActionType.REMOVE_COMPARED_PRODUCT; + productId: number; +} + +export interface ClearComparedProductsAction extends AnyAction { + type: ProductCompareActionType.CLEAR_COMPARED_PRODUCTS; +} + +export interface SetCompareListIdsAction extends AnyAction { + type: ProductCompareActionType.SET_COMPARED_PRODUCT_IDS; + productIds: number[]; +} + +export interface AddComparedProductIdsAction extends AnyAction { + type: ProductCompareActionType.ADD_COMPARED_PRODUCT_ID; + productId: number; +} + +export interface UpdateCompareTotalsAction extends AnyAction { + type: ProductCompareActionType.UPDATE_COMPARE_TOTALS; + compareTotals: number; +} + +export type ProductCompareAction = ToggleLoaderAction +| SetCompareListAction +| RemoveComparedProductAction +| ClearComparedProductsAction +| SetCompareListIdsAction +| AddComparedProductIdsAction +| UpdateCompareTotalsAction; + +export type ComparableProduct = GQLProductInterface & { + attributes: GQLComparableAttribute[]; +}; + +export type ProductCompareStore = { + isLoading: boolean; + count: number; + attributes: GQLComparableAttribute[]; + products: ComparableProduct[]; + productIds: number[]; + items: GQLComparableItem[]; +}; + +declare module 'Util/Store/type' { + export interface RootState { + ProductCompareReducer: ProductCompareStore; + } +} From a87633e1bbc1b340823d93c8b1c05c384bcc265b Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 11 Apr 2022 01:28:48 +0300 Subject: [PATCH 026/192] Migrated some actions to TS --- .../{Config.action.js => Config.action.ts} | 17 +++-- .../{Config.reducer.js => Config.reducer.ts} | 39 +++++++--- .../scandipwa/src/store/Config/Config.type.ts | 73 +++++++++++++++++++ .../store/ContactForm/ContactForm.reducer.ts | 2 +- .../LinkedProducts/LinkedProducts.reducer.ts | 2 +- .../scandipwa/src/store/Meta/Meta.reducer.ts | 2 +- .../store/Navigation/Navigation.reducer.ts | 2 +- .../src/store/NoMatch/NoMatch.reducer.ts | 2 +- .../Notification/Notification.reducer.ts | 2 +- .../src/store/Order/Order.reducer.ts | 2 +- .../src/store/Product/Product.reducer.ts | 2 +- .../ProductCompare/ProductCompare.reducer.ts | 2 +- .../src/store/Wishlist/Wishlist.reducer.ts | 2 +- 13 files changed, 122 insertions(+), 27 deletions(-) rename packages/scandipwa/src/store/Config/{Config.action.js => Config.action.ts} (51%) rename packages/scandipwa/src/store/Config/{Config.reducer.js => Config.reducer.ts} (73%) create mode 100644 packages/scandipwa/src/store/Config/Config.type.ts diff --git a/packages/scandipwa/src/store/Config/Config.action.js b/packages/scandipwa/src/store/Config/Config.action.ts similarity index 51% rename from packages/scandipwa/src/store/Config/Config.action.js rename to packages/scandipwa/src/store/Config/Config.action.ts index 2dd7271b7d..274f6a55c7 100644 --- a/packages/scandipwa/src/store/Config/Config.action.js +++ b/packages/scandipwa/src/store/Config/Config.action.ts @@ -8,18 +8,21 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -export const UPDATE_CONFIG = 'UPDATE_CONFIG'; + +import { Device } from 'Type/Device.type'; + +import { + ConfigActionType, ConfigStore, UpdateConfigAction, UpdateConfigDeviceAction +} from './Config.type'; /** @namespace Store/Config/Action/updateConfig */ -export const updateConfig = (config) => ({ - type: UPDATE_CONFIG, +export const updateConfig = (config: ConfigStore): UpdateConfigAction => ({ + type: ConfigActionType.UPDATE_CONFIG, config }); -export const UPDATE_CONFIG_DEVICE = 'UPDATE_CONFIG_DEVICE'; - /** @namespace Store/Config/Action/updateConfigDevice */ -export const updateConfigDevice = (device) => ({ - type: UPDATE_CONFIG_DEVICE, +export const updateConfigDevice = (device: Device): UpdateConfigDeviceAction => ({ + type: ConfigActionType.UPDATE_CONFIG_DEVICE, device }); diff --git a/packages/scandipwa/src/store/Config/Config.reducer.js b/packages/scandipwa/src/store/Config/Config.reducer.ts similarity index 73% rename from packages/scandipwa/src/store/Config/Config.reducer.js rename to packages/scandipwa/src/store/Config/Config.reducer.ts index da3e2b7341..746e1cb622 100644 --- a/packages/scandipwa/src/store/Config/Config.reducer.js +++ b/packages/scandipwa/src/store/Config/Config.reducer.ts @@ -9,16 +9,27 @@ * @link https://github.com/scandipwa/base-theme */ +import { Reducer } from 'redux'; + +import { + GQLCheckoutAgreement, GQLCountry, GQLCurrencyConfig, GQLStoreConfig +} from 'Type/Graphql.type'; import BrowserDatabase from 'Util/BrowserDatabase'; -import { UPDATE_CONFIG, UPDATE_CONFIG_DEVICE } from './Config.action'; +import { + ConfigAction, + ConfigActionType, + ConfigStore, + ReviewRatingItem, + ReviewRatings +} from './Config.type'; export const MAX_WIDTH = 150; export const MAX_HEIGHT = 40; export const DEFAULT_CATGORY_URL_SUFFIX = '.html'; /** @namespace Store/Config/Reducer/filterStoreConfig */ -export const filterStoreConfig = (config) => Object.entries(config).reduce( +export const filterStoreConfig = (config: GQLStoreConfig): Partial => Object.entries(config).reduce( (acc, [key, value]) => (value !== null ? { ...acc, [key]: value } : acc), {} ); @@ -41,19 +52,27 @@ export const { }; /** @namespace Store/Config/Reducer/getIndexedRatings */ -export const getIndexedRatings = (reviewRatings) => ((reviewRatings) ? reviewRatings.items || [] : []); +export const getIndexedRatings = ( + reviewRatings: ReviewRatings +): ReviewRatingItem[] => ((reviewRatings) ? reviewRatings.items || [] : []); /** @namespace Store/Config/Reducer/getCurrencyData */ -export const getCurrencyData = (base, state) => (base || state.currencyData || {}); +export const getCurrencyData = ( + base: GQLCurrencyConfig, + state: ConfigStore +): GQLCurrencyConfig => (base || state.currencyData || {}); /** @namespace Store/Config/Reducer/getCountryData */ -export const getCountryData = (base, state) => (base || state.countries || {}); +export const getCountryData = (base: GQLCountry[], state: ConfigStore): GQLCountry[] => (base || state.countries || {}); /** @namespace Store/Config/Reducer/getCheckoutAgreementData */ -export const getCheckoutAgreementData = (base, state) => (base || state.checkoutAgreements || {}); +export const getCheckoutAgreementData = ( + base: GQLCheckoutAgreement[], + state: ConfigStore +): GQLCheckoutAgreement[] => (base || state.checkoutAgreements || {}); /** @namespace Store/Config/Reducer/getInitialState */ -export const getInitialState = () => ({ +export const getInitialState = (): ConfigStore => ({ ...filterStoreConfig(storeConfig), countries, reviewRatings, @@ -75,7 +94,7 @@ export const getInitialState = () => ({ }); /** @namespace Store/Config/Reducer/ConfigReducer */ -export const ConfigReducer = ( +export const ConfigReducer: Reducer = ( state = getInitialState(), action ) => { @@ -93,7 +112,7 @@ export const ConfigReducer = ( } = action; switch (type) { - case UPDATE_CONFIG: + case ConfigActionType.UPDATE_CONFIG: const filteredStoreConfig = filterStoreConfig(storeConfig); const { secure_base_media_url } = filteredStoreConfig; window.secure_base_media_url = secure_base_media_url; @@ -111,7 +130,7 @@ export const ConfigReducer = ( cartDisplayConfig }; - case UPDATE_CONFIG_DEVICE: + case ConfigActionType.UPDATE_CONFIG_DEVICE: return { ...state, device: { diff --git a/packages/scandipwa/src/store/Config/Config.type.ts b/packages/scandipwa/src/store/Config/Config.type.ts new file mode 100644 index 0000000000..3ec46a1c29 --- /dev/null +++ b/packages/scandipwa/src/store/Config/Config.type.ts @@ -0,0 +1,73 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { AnyAction } from 'redux'; + +import { Device } from 'Type/Device.type'; +import { + GQLCartDisplayConfig, + GQLCheckoutAgreement, + GQLCountry, + GQLCurrencyConfig, + GQLPriceTaxDisplay, + GQLStoreConfig +} from 'Type/Graphql.type'; + +export enum ConfigActionType { + UPDATE_CONFIG = 'UPDATE_CONFIG', + UPDATE_CONFIG_DEVICE = 'UPDATE_CONFIG_DEVICE' +} + +export interface UpdateConfigAction extends AnyAction { + type: ConfigActionType.UPDATE_CONFIG; + config: ConfigStore; +} + +export interface UpdateConfigDeviceAction extends AnyAction { + type: ConfigActionType.UPDATE_CONFIG_DEVICE; + device: Device; +} + +export type ConfigAction = UpdateConfigAction | UpdateConfigDeviceAction; + +export type ReviewRatingOption = { + option_id: string; + value: string; +}; + +export type ReviewRatingItem = { + rating_id: string; + rating_code: string; + rating_options: ReviewRatingOption[]; +}; + +export type ReviewRatings = { + items: ReviewRatingItem[]; +}; + +export type ConfigStore = GQLStoreConfig & { + countries: GQLCountry[]; + reviewRatings: ReviewRatingItem[]; + // storeConfig: GQLStoreConfig; + checkoutAgreements: GQLCheckoutAgreement[]; + currencyData: GQLCurrencyConfig; + cartDisplayConfig: GQLCartDisplayConfig; + priceTaxDisplay: GQLPriceTaxDisplay; + isLoading: boolean; + category_url_suffix: string; + device: Device; +}; + +declare module 'Util/Store/type' { + export interface RootState { + ConfigReducer: ConfigStore; + } +} diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts b/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts index cee306c1a5..5d72b5f0b9 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { ContactFormActionType, ContactFormStore, UpdateContactFormAction } from './ContactForm.type'; diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts index f009de9790..f1cd877781 100644 --- a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { LinkedProducts, LinkedProductsMap, LinkedProductType } from 'Type/ProductList.type'; import BrowserDatabase from 'Util/BrowserDatabase'; diff --git a/packages/scandipwa/src/store/Meta/Meta.reducer.ts b/packages/scandipwa/src/store/Meta/Meta.reducer.ts index 2be47e63e2..84e78a35f8 100644 --- a/packages/scandipwa/src/store/Meta/Meta.reducer.ts +++ b/packages/scandipwa/src/store/Meta/Meta.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { MetaActionType, MetaStore, PageMeta, UpdateMetaAction diff --git a/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts b/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts index d75d7a9b21..524c483140 100644 --- a/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts +++ b/packages/scandipwa/src/store/Navigation/Navigation.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { DEFAULT_STATE diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts b/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts index 2d6b4c34cc..b6bf46463a 100644 --- a/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { NoMatchActionType, diff --git a/packages/scandipwa/src/store/Notification/Notification.reducer.ts b/packages/scandipwa/src/store/Notification/Notification.reducer.ts index ba740fe0b2..0fb3315d51 100644 --- a/packages/scandipwa/src/store/Notification/Notification.reducer.ts +++ b/packages/scandipwa/src/store/Notification/Notification.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { NotificationAction, NotificationActionType, NotificationStore } from './Notification.type'; diff --git a/packages/scandipwa/src/store/Order/Order.reducer.ts b/packages/scandipwa/src/store/Order/Order.reducer.ts index 2202c38603..e40d8974fd 100644 --- a/packages/scandipwa/src/store/Order/Order.reducer.ts +++ b/packages/scandipwa/src/store/Order/Order.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { GQLCustomerOrder } from 'Type/Graphql.type'; import { formatOrders } from 'Util/Orders'; diff --git a/packages/scandipwa/src/store/Product/Product.reducer.ts b/packages/scandipwa/src/store/Product/Product.reducer.ts index 5e7523063d..b1d3b01fc7 100644 --- a/packages/scandipwa/src/store/Product/Product.reducer.ts +++ b/packages/scandipwa/src/store/Product/Product.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import { getIndexedProduct } from 'Util/Product'; diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts b/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts index 11b544a83d..6caa174b72 100644 --- a/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import BrowserDatabase from 'Util/BrowserDatabase/BrowserDatabase'; diff --git a/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts b/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts index 76f5da5d5d..47bf896e90 100644 --- a/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts +++ b/packages/scandipwa/src/store/Wishlist/Wishlist.reducer.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Reducer } from 'react'; +import { Reducer } from 'redux'; import BrowserDatabase from 'Util/BrowserDatabase'; import { getIndexedParameteredProducts } from 'Util/Product'; From 3ca9638565ab7e6a2123707cc94409639aabd90d Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Mon, 11 Apr 2022 02:25:46 +0300 Subject: [PATCH 027/192] Remove unused types --- packages/scandipwa/src/type/Account.type.ts | 4 +- packages/scandipwa/src/type/Category.type.ts | 8 ++- packages/scandipwa/src/type/Checkout.type.ts | 4 -- packages/scandipwa/src/type/Config.type.ts | 16 +++--- packages/scandipwa/src/type/Device.type.ts | 16 +++--- .../scandipwa/src/type/Downloadable.type.ts | 2 - packages/scandipwa/src/type/Field.type.ts | 1 + packages/scandipwa/src/type/Global.type.ts | 8 +-- packages/scandipwa/src/type/Graphql.type.ts | 2 +- packages/scandipwa/src/type/Menu.type.ts | 4 +- .../scandipwa/src/type/ProductList.type.ts | 54 ++++++++++++++----- 11 files changed, 65 insertions(+), 54 deletions(-) diff --git a/packages/scandipwa/src/type/Account.type.ts b/packages/scandipwa/src/type/Account.type.ts index c8f2ad8996..fe91b247e3 100644 --- a/packages/scandipwa/src/type/Account.type.ts +++ b/packages/scandipwa/src/type/Account.type.ts @@ -59,8 +59,6 @@ export type Address = { vat_id: number | null; }; -export type Addresses = Address[]; - export type TrimmedAddress = { city: string; company: string | null; @@ -78,7 +76,7 @@ export type TrimmedAddress = { }; export type Customer = { - addresses: Addresses; + addresses: Address[]; created_at: string; default_billing: string; default_shipping: string; diff --git a/packages/scandipwa/src/type/Category.type.ts b/packages/scandipwa/src/type/Category.type.ts index ecb5bd3056..5853a62ba4 100644 --- a/packages/scandipwa/src/type/Category.type.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -11,15 +11,15 @@ import { MetaTitle } from 'Type/Common.type'; -export type Breadcrumbs = { +export type Breadcrumb = { category_name?: string; category_url?: string; category_level?: number; -}[]; +}; export type CategoryFragment = { id: number; - breadcrumbs?: Breadcrumbs; + breadcrumbs?: Breadcrumb[]; description: string; image: string; meta_description: string; @@ -75,5 +75,3 @@ export type CategoryFilter = { request_var?: string; filter_items?: FilterItems[]; }; - -export type CategoryFilters = CategoryFilter[]; diff --git a/packages/scandipwa/src/type/Checkout.type.ts b/packages/scandipwa/src/type/Checkout.type.ts index 8d3a115a7f..75beeb293f 100644 --- a/packages/scandipwa/src/type/Checkout.type.ts +++ b/packages/scandipwa/src/type/Checkout.type.ts @@ -14,8 +14,6 @@ export type PaymentMethod = { title: string; }; -export type PaymentMethods = PaymentMethod[]; - export type ShippingMethod = { amount: number; available: boolean; @@ -29,8 +27,6 @@ export type ShippingMethod = { price_incl_tax: number; }; -export type ShippingMethods = ShippingMethod[]; - export type CheckoutStore = { city: string; country: string; diff --git a/packages/scandipwa/src/type/Config.type.ts b/packages/scandipwa/src/type/Config.type.ts index 4c2c691ec9..e4576f609e 100644 --- a/packages/scandipwa/src/type/Config.type.ts +++ b/packages/scandipwa/src/type/Config.type.ts @@ -9,14 +9,18 @@ * @link https://github.com/scandipwa/base-theme */ +import { + DisplayCartTaxInPrice, + DisplayCartTaxInShipping, + DisplayCartTaxInSubTotal +} from 'Util/Cart/Cart.type'; + export type Region = { code?: string; name?: string; id?: number; }; -export type Regions = Region[]; - export type Country = { label: string; id: string; @@ -24,9 +28,9 @@ export type Country = { }; export type CartConfig = { - display_tax_in_price?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_PRICE)) - display_tax_in_subtotal?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_SUBTOTAL)) - display_tax_in_shipping_amount?: any; // TODO: Props.oneOf(Object.values(DISPLAY_CART_TAX_IN_SHIPPING)) + display_tax_in_price?: DisplayCartTaxInPrice; + display_tax_in_subtotal?: DisplayCartTaxInSubTotal; + display_tax_in_shipping_amount?: DisplayCartTaxInShipping; include_tax_in_order_total: boolean; display_full_tax_summary: boolean; display_zero_tax_subtotal: boolean; @@ -39,5 +43,3 @@ export type StoreItem = { storeLinkUrl?: string; label?: string; }; - -export type Stores = StoreItem[]; diff --git a/packages/scandipwa/src/type/Device.type.ts b/packages/scandipwa/src/type/Device.type.ts index 5f9e7d3fd1..9dce75e499 100644 --- a/packages/scandipwa/src/type/Device.type.ts +++ b/packages/scandipwa/src/type/Device.type.ts @@ -10,12 +10,12 @@ */ export type Device = { - isMobile?: boolean; - android?: boolean; - ios?: boolean; - blackberry?: boolean; - opera?: boolean; - safari?: boolean; - windows?: boolean; - standaloneMode?: boolean; + isMobile: boolean; + android: boolean; + ios: boolean; + blackberry: boolean; + opera: boolean; + safari: boolean; + windows: boolean; + standaloneMode: boolean; }; diff --git a/packages/scandipwa/src/type/Downloadable.type.ts b/packages/scandipwa/src/type/Downloadable.type.ts index 9f8f1faf87..fbc6b21f5c 100644 --- a/packages/scandipwa/src/type/Downloadable.type.ts +++ b/packages/scandipwa/src/type/Downloadable.type.ts @@ -17,5 +17,3 @@ export type DownloadableLink = { uid?: string; price?: number; }; - -export type DownloadableLinks = DownloadableLink | string; diff --git a/packages/scandipwa/src/type/Field.type.ts b/packages/scandipwa/src/type/Field.type.ts index 75c9ad9e37..7918df2316 100644 --- a/packages/scandipwa/src/type/Field.type.ts +++ b/packages/scandipwa/src/type/Field.type.ts @@ -29,6 +29,7 @@ export type CustomErrorMessages = { }; export type ValidationRule = { + selector?: string; isRequired?: boolean; inputType?: ValidationInputTypeText; match?: () => void; // TODO: Check argument types diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index 8b08c9ac48..b0217015d3 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -9,13 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { - Action, - Reducer, - ReducersMapObject, - Store, - StoreEnhancer -} from 'redux'; +import { StoreEnhancer } from 'redux'; // import { ValidationData } from 'Util/Validator'; diff --git a/packages/scandipwa/src/type/Graphql.type.ts b/packages/scandipwa/src/type/Graphql.type.ts index 69ba6aaad8..f5f06ce906 100644 --- a/packages/scandipwa/src/type/Graphql.type.ts +++ b/packages/scandipwa/src/type/Graphql.type.ts @@ -6486,7 +6486,7 @@ export interface GQLPaymentMethod { * Product Information used for Pickup Locations search. */ export interface GQLProductInfoInput { - + /** * Product SKU. */ diff --git a/packages/scandipwa/src/type/Menu.type.ts b/packages/scandipwa/src/type/Menu.type.ts index e71bf3f630..277d5207f1 100644 --- a/packages/scandipwa/src/type/Menu.type.ts +++ b/packages/scandipwa/src/type/Menu.type.ts @@ -23,11 +23,9 @@ export type MenuItem = { url_type: number; }; -export type MenuItems = MenuItem[]; - export type Menu = { menu_id?: string; is_active?: boolean; css_class?: string; - items?: MenuItems; + items?: MenuItem[]; }; diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 84711ae8cb..252aba5f8e 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -14,6 +14,15 @@ import { MetaTitle } from 'Type/Common.type'; import { PriceRange } from 'Type/Price.type'; import { UrlRewrite } from 'Type/Router.type'; +import { + GQLBundleProduct, + GQLConfigurableProduct, + GQLDownloadableProduct, + GQLGroupedProduct, + GQLSimpleProduct, + GQLVirtualProduct +} from './Graphql.type'; + export type Attribute = { attribute_id?: number; attribute_code: string; @@ -24,8 +33,8 @@ export type Attribute = { label: string; value: string; }[]; - has_swatch?: boolean; - is_boolean?: boolean; + attribute_group_id?: string; + attribute_group_name?: string; }; export type AttributeOption = { @@ -58,10 +67,10 @@ export type FilterAttribute = { has_swatch?: boolean; }; -export type Breadcrumbs = { +export type Breadcrumb = { name?: string; url_path?: string; -}[]; +}; export type Image = { path?: string; @@ -71,11 +80,9 @@ export type Image = { export type ProductCategory = { name?: string; url_path?: string; - breadcrumbs?: Breadcrumbs; + breadcrumbs?: Breadcrumb[]; }; -export type ProductCategories = ProductCategory[]; - export type Thumbnail = { height?: string; type?: string; @@ -138,10 +145,11 @@ export type DescriptionType = { }; export type StockItem = { - in_stock: boolean; - min_sale_qty: number; - max_sale_qty: number; - qty_increments: number; + in_stock?: boolean; + min_sale_qty?: number; + max_sale_qty?: number; + qty?: number; + qty_increments?: number; }; export type OptionValue = { @@ -217,16 +225,25 @@ export type FileOption = CustomizableOptionShape & { export type CustomizableOptions = FileOption | InputOption | CustomizableOption[]; +export type ItemUrlRewriteParameter = { + name?: string; + value?: string; +}; + +export type ItemUrlRewrite = { + parameters?: ItemUrlRewriteParameter[]; + url?: string; +}; + export type ItemShape = ReviewSummaryShape & { attributes: Attribute[]; configurable_options: ConfigurableAttribute[]; id: number; image: Image; name: string; - options: Option[]; + options: Option[] | null; price_range: PriceRange; price_tiers: PriceTier; - review_summary: ReviewSummaryShape; reviews: Reviews; short_description: DescriptionType; sku: string; @@ -241,6 +258,7 @@ export type ItemShape = ReviewSummaryShape & { url: string; url_rewrites: UrlRewrite[]; salable_qty: number; + upsell_products?: Product[] | null; }; export type Item = ItemShape; @@ -295,7 +313,7 @@ export type ProductGroupedItems = { // Refactore to separate types export interface Product extends ItemShape { canonical_url?: string; - categories?: ProductCategories; + categories?: ProductCategory[]; description?: DescriptionType; media_gallery_entries?: Media; meta_description?: string; @@ -332,6 +350,7 @@ export type BundleOption = { selection_details: BundleOptionSelection[]; title?: string; }; + export interface ProductBundle extends Product { items: ProductBundleItem[]; dynamic_price: boolean; @@ -407,3 +426,10 @@ export type LinkedProducts = { }; export type LinkedProductsMap = Partial>; + +export type ProductInterface = GQLBundleProduct +& GQLConfigurableProduct +& GQLSimpleProduct +& GQLDownloadableProduct +& GQLGroupedProduct +& GQLVirtualProduct; From dd11f6375a57dcfc3d439809807ff22058d46903 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 11 Apr 2022 02:29:04 +0300 Subject: [PATCH 028/192] Migrated some dispatchers to TS --- .../store/Breadcrumbs/Breadcrumbs.action.ts | 4 +- ...ispatcher.js => Breadcrumbs.dispatcher.ts} | 75 +++++++++++-------- .../scandipwa/src/type/Breadcrumbs.type.ts | 4 +- packages/scandipwa/src/type/Category.type.ts | 1 + packages/scandipwa/src/type/Common.type.ts | 5 ++ .../scandipwa/src/type/ProductList.type.ts | 1 + 6 files changed, 56 insertions(+), 34 deletions(-) rename packages/scandipwa/src/store/Breadcrumbs/{Breadcrumbs.dispatcher.js => Breadcrumbs.dispatcher.ts} (63%) diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts index d732328485..5968ab494c 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.action.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Breadcrumbs } from 'Type/Breadcrumbs.type'; +import { Breadcrumb } from 'Type/Breadcrumbs.type'; import { BreadcrumbsActionType, ToggleBreadcrumbsAction, UpdateBreadcrumbsAction } from './Breadcrumbs.type'; @@ -19,7 +19,7 @@ import { BreadcrumbsActionType, ToggleBreadcrumbsAction, UpdateBreadcrumbsAction * @return {void} * @namespace Store/Breadcrumbs/Action/updateBreadcrumbs */ -export const updateBreadcrumbs = (breadcrumbs: Breadcrumbs): UpdateBreadcrumbsAction => ({ +export const updateBreadcrumbs = (breadcrumbs: Breadcrumb[]): UpdateBreadcrumbsAction => ({ type: BreadcrumbsActionType.UPDATE_BREADCRUMBS, breadcrumbs }); diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.js b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.ts similarity index 63% rename from packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.js rename to packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.ts index f459931e94..3153ea442d 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.js +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.dispatcher.ts @@ -9,7 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import { toggleBreadcrumbs, updateBreadcrumbs } from 'Store/Breadcrumbs/Breadcrumbs.action'; +import { Breadcrumb } from 'Type/Breadcrumbs.type'; +import { GQLCategoryTree } from 'Type/Graphql.type'; +import { Product, ProductCategory } from 'Type/ProductList.type'; /** * Breadcrumbs Dispatcher @@ -23,7 +28,7 @@ export class BreadcrumbsDispatcher { * @param {Function} dispatch * @memberof BreadcrumbsDispatcher */ - update(breadcrumbs, dispatch) { + update(breadcrumbs: Breadcrumb[], dispatch: Dispatch): void { dispatch(toggleBreadcrumbs(true)); dispatch(updateBreadcrumbs(breadcrumbs)); } @@ -34,7 +39,7 @@ export class BreadcrumbsDispatcher { * @param {Function} dispatch * @memberof BreadcrumbsDispatcher */ - updateWithCategory(category, dispatch) { + updateWithCategory(category: GQLCategoryTree, dispatch: Dispatch): void { const breadcrumbs = this._getCategoryBreadcrumbs(category); dispatch(toggleBreadcrumbs(true)); dispatch(updateBreadcrumbs(breadcrumbs)); @@ -47,7 +52,7 @@ export class BreadcrumbsDispatcher { * @param {Function} dispatch * @memberof BreadcrumbsDispatcher */ - updateWithProduct(product, prevCategoryId, dispatch) { + updateWithProduct(product: Product, prevCategoryId: number, dispatch: Dispatch): void { const breadcrumbs = this._getProductBreadcrumbs(product, prevCategoryId); dispatch(toggleBreadcrumbs(true)); dispatch(updateBreadcrumbs(breadcrumbs)); @@ -59,7 +64,7 @@ export class BreadcrumbsDispatcher { * @param {Function} dispatch * @memberof BreadcrumbsDispatcher */ - updateWithCmsPage({ title }, dispatch) { + updateWithCmsPage({ title }: { title: string }, dispatch: Dispatch): void { const breadcrumbs = title ? [ { @@ -78,30 +83,36 @@ export class BreadcrumbsDispatcher { * @return {Array} Breadcrumbs array * @memberof BreadcrumbsDispatcher */ - _getCategoryBreadcrumbs(category) { - const { url, name, breadcrumbs } = category; - const breadcrumbsList = []; + _getCategoryBreadcrumbs(category: GQLCategoryTree): Breadcrumb[] { + const { url = '', name = '', breadcrumbs } = category; + const breadcrumbsList: Breadcrumb[] = []; - if (breadcrumbs) { + if (breadcrumbs?.length) { breadcrumbs - .sort((a, b) => a.category_level - b.category_level) + .sort((a, b) => (a?.category_level || 0) - (b?.category_level || 0)) .forEach((crumb) => { - const { category_url, category_name, category_is_active } = crumb; - - // do not add link to inactive categories - if (category_is_active) { - breadcrumbsList.push({ - name: category_name, - url: { - pathname: category_url, - state: { category: true } - } - }); - } else { - breadcrumbsList.push({ - url: '', - name: category_name - }); + if (crumb) { + const { + category_url, + category_name, + category_is_active + } = crumb; + + // do not add link to inactive categories + if (category_is_active) { + breadcrumbsList.push({ + name: category_name || '', + url: { + pathname: category_url || '', + state: { category: true } + } + }); + } else { + breadcrumbsList.push({ + url: '', + name: category_name || '' + }); + } } }); } @@ -112,12 +123,14 @@ export class BreadcrumbsDispatcher { ]; } - findCategoryById(categories, categoryId) { + findCategoryById(categories: ProductCategory[], categoryId: number): ProductCategory | undefined { return categories.find(({ id }) => id === categoryId); } - findLongestBreadcrumbs(categories) { - const { breadcrumbsCategory = {} } = categories.reduce((acc, category) => { + findLongestBreadcrumbs(categories: ProductCategory[]): ProductCategory { + const { + breadcrumbsCategory = {} + } = categories.reduce((acc, category) => { const { longestBreadcrumbsLength } = acc; const { breadcrumbs } = category; const breadcrumbsLength = (breadcrumbs || []).length; @@ -143,7 +156,7 @@ export class BreadcrumbsDispatcher { longestBreadcrumbsLength: 0 }); - return breadcrumbsCategory; + return breadcrumbsCategory as ProductCategory; } /** @@ -154,7 +167,7 @@ export class BreadcrumbsDispatcher { * @return {Array} Breadcrumbs array * @memberof BreadcrumbsDispatcher */ - _getProductBreadcrumbs(product, prevCategoryId = null) { + _getProductBreadcrumbs(product: Product, prevCategoryId: number | null = null): Breadcrumb[] { const { categories, url, name } = product; if (!categories) { @@ -168,7 +181,7 @@ export class BreadcrumbsDispatcher { return [ { url, name }, ...this._getCategoryBreadcrumbs( - this.findCategoryById(categories, prevCategoryId) + this.findCategoryById(categories, prevCategoryId || 0) as GQLCategoryTree || this.findLongestBreadcrumbs(categories) ) ]; diff --git a/packages/scandipwa/src/type/Breadcrumbs.type.ts b/packages/scandipwa/src/type/Breadcrumbs.type.ts index 12eaf9cf11..4e767991df 100644 --- a/packages/scandipwa/src/type/Breadcrumbs.type.ts +++ b/packages/scandipwa/src/type/Breadcrumbs.type.ts @@ -9,8 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ +import { Url } from './Common.type'; + export type Breadcrumb = { - url: string; + url: Url; name: string; }; diff --git a/packages/scandipwa/src/type/Category.type.ts b/packages/scandipwa/src/type/Category.type.ts index ecb5bd3056..5b1e6fef24 100644 --- a/packages/scandipwa/src/type/Category.type.ts +++ b/packages/scandipwa/src/type/Category.type.ts @@ -29,6 +29,7 @@ export type CategoryFragment = { url_key: string; url_path: string; display_mode: string; + url: string; }; export type CategoryTree = CategoryFragment & { diff --git a/packages/scandipwa/src/type/Common.type.ts b/packages/scandipwa/src/type/Common.type.ts index 059043f435..f00c0b60bf 100644 --- a/packages/scandipwa/src/type/Common.type.ts +++ b/packages/scandipwa/src/type/Common.type.ts @@ -23,3 +23,8 @@ export type Ref = () => void | { current: Element }; // TODO unknown export type MetaTitle = string | unknown; + +export type Url = string | { + pathname: string; + state: T; +}; diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index 84711ae8cb..4b2a546b64 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -69,6 +69,7 @@ export type Image = { }; export type ProductCategory = { + id: number; name?: string; url_path?: string; breadcrumbs?: Breadcrumbs; From df36393930e37c6ed45b554018638bbce0e842f1 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 11 Apr 2022 07:42:28 +0300 Subject: [PATCH 029/192] Migrated some actions to TS --- packages/scandipwa/src/query/Cart.query.ts | 6 +- packages/scandipwa/src/query/Query.type.ts | 1 + ...{Cart.dispatcher.js => Cart.dispatcher.ts} | 153 +++++++++--------- ...y.dispatcher.js => Category.dispatcher.ts} | 23 ++- .../src/store/Category/Category.type.ts | 7 + ...t.dispatcher.js => Checkout.dispatcher.ts} | 16 +- .../src/store/Checkout/Checkout.type.ts | 8 + ...fig.dispatcher.js => Config.dispatcher.ts} | 34 ++-- ...ispatcher.js => ContactForm.dispatcher.ts} | 10 +- .../src/store/ContactForm/ContactForm.type.ts | 9 ++ .../src/util/Promise/MakeCancelable.ts | 4 +- .../src/util/Promise/Promise.type.ts | 15 ++ .../src/util/Query/PrepareDocument.ts | 19 ++- .../scandipwa/src/util/Request/Mutation.ts | 13 +- packages/scandipwa/src/util/Request/Query.ts | 13 +- ...{QueryDispatcher.js => QueryDispatcher.ts} | 36 +++-- .../scandipwa/src/util/Request/Request.ts | 24 +-- 17 files changed, 244 insertions(+), 147 deletions(-) rename packages/scandipwa/src/store/Cart/{Cart.dispatcher.js => Cart.dispatcher.ts} (62%) rename packages/scandipwa/src/store/Category/{Category.dispatcher.js => Category.dispatcher.ts} (57%) rename packages/scandipwa/src/store/Checkout/{Checkout.dispatcher.js => Checkout.dispatcher.ts} (60%) rename packages/scandipwa/src/store/Config/{Config.dispatcher.js => Config.dispatcher.ts} (60%) rename packages/scandipwa/src/store/ContactForm/{ContactForm.dispatcher.js => ContactForm.dispatcher.ts} (79%) create mode 100644 packages/scandipwa/src/util/Promise/Promise.type.ts rename packages/scandipwa/src/util/Request/{QueryDispatcher.js => QueryDispatcher.ts} (79%) diff --git a/packages/scandipwa/src/query/Cart.query.ts b/packages/scandipwa/src/query/Cart.query.ts index 2d576d4645..05b2f03929 100644 --- a/packages/scandipwa/src/query/Cart.query.ts +++ b/packages/scandipwa/src/query/Cart.query.ts @@ -34,7 +34,7 @@ export class CartQuery { //#region MUTATIONS getAddProductToCartMutation( cartId: string, - cartItems: GQLCartItemInput + cartItems: GQLCartItemInput[] ): Mutation<'addProductsToCart', GQLAddProductsToCartOutput & { user_errors: GQLWishListUserInputError[]; }> { @@ -139,8 +139,8 @@ export class CartQuery { .addFieldList(this._getCartDisplayConfigFields()); } - getMergeCartQuery(sourceCartId: string, destinationCartId: string): Field<'mergeCarts', GQLCart> { - return new Field<'mergeCarts', GQLCart>('mergeCarts') + getMergeCartQuery(sourceCartId: string, destinationCartId: string): Mutation<'mergeCarts', GQLCart> { + return new Mutation<'mergeCarts', GQLCart>('mergeCarts') .addArgument('source_cart_id', 'String!', sourceCartId) .addArgument('destination_cart_id', 'String!', destinationCartId) .addField('id'); diff --git a/packages/scandipwa/src/query/Query.type.ts b/packages/scandipwa/src/query/Query.type.ts index c068c3813e..3e7ea4abf1 100644 --- a/packages/scandipwa/src/query/Query.type.ts +++ b/packages/scandipwa/src/query/Query.type.ts @@ -18,6 +18,7 @@ export type CommonField = string | AbstractField; export type CategoryQueryOptions = { categoryIds: number; + isSearchPage?: boolean; }; export type CmsPage = { diff --git a/packages/scandipwa/src/store/Cart/Cart.dispatcher.js b/packages/scandipwa/src/store/Cart/Cart.dispatcher.ts similarity index 62% rename from packages/scandipwa/src/store/Cart/Cart.dispatcher.js rename to packages/scandipwa/src/store/Cart/Cart.dispatcher.ts index 10c87c93c8..d5001016d4 100644 --- a/packages/scandipwa/src/store/Cart/Cart.dispatcher.js +++ b/packages/scandipwa/src/store/Cart/Cart.dispatcher.ts @@ -9,9 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import CartQuery from 'Query/Cart.query'; import { updateIsLoadingCart, updateTotals } from 'Store/Cart/Cart.action'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; +import { + GQLCartItemInput, + GQLConfigurableProduct, + GQLConfigurableVariant, + GQLProductLinksInterface, + GQLQuoteData, + GQLTotalsItem +} from 'Type/Graphql.type'; +import { LinkedProductType } from 'Type/ProductList.type'; import { getAuthorizationToken, isSignedIn } from 'Util/Auth'; import { getGuestQuoteId, setGuestQuoteId } from 'Util/Cart'; import { fetchMutation, fetchQuery, getErrorMessage } from 'Util/Request'; @@ -27,30 +39,30 @@ export const LinkedProductsDispatcher = import( * @namespace Store/Cart/Dispatcher */ export class CartDispatcher { - async updateInitialCartData(dispatch, isForCustomer = false) { + async updateInitialCartData(dispatch: Dispatch, isForCustomer = false): Promise { // Need to get current cart from BE, update cart try { // ! Get quote token first (local or from the backend) just to make sure it exists const quoteId = await this._getGuestQuoteId(dispatch); const { cartData = {} } = await fetchQuery( CartQuery.getCartQuery( - quoteId + quoteId || '' ) ); dispatch(updateIsLoadingCart(false)); if (isForCustomer && !getAuthorizationToken()) { - return null; + return; } - return this._updateCartData(cartData, dispatch); + this._updateCartData(cartData, dispatch); } catch (error) { - return this.createGuestEmptyCart(dispatch); + this.createGuestEmptyCart(dispatch); } } - async createGuestEmptyCart(dispatch) { + async createGuestEmptyCart(dispatch: Dispatch): Promise { try { const { createEmptyCart: quoteId = '' @@ -61,13 +73,17 @@ export class CartDispatcher { return quoteId; } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return null; } } - async mergeCarts(sourceCartId, destinationCartId, dispatch) { + async mergeCarts( + sourceCartId: string, + destinationCartId: string, + dispatch: Dispatch + ): Promise { try { const { mergeCarts: { @@ -79,24 +95,28 @@ export class CartDispatcher { return id; } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return null; } } - resetGuestCart(dispatch) { + resetGuestCart(dispatch: Dispatch): void { return this._updateCartData({}, dispatch); } - async changeItemQty(dispatch, options) { + async changeItemQty(dispatch: Dispatch, options: { + quantity: number; + uid: string; + cartId: string; + }): Promise { const { uid, quantity = 1, cartId: originalCartId } = options; const cartId = !originalCartId ? getGuestQuoteId() : originalCartId; try { if (!cartId) { - return Promise.reject(); + return await Promise.reject(); } await fetchMutation( @@ -111,27 +131,33 @@ export class CartDispatcher { }) ); - return this.updateInitialCartData(dispatch); + return await this.updateInitialCartData(dispatch); } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return Promise.reject(); } } - async addProductToCart(dispatch, options = {}) { + async addProductToCart( + dispatch: Dispatch, + options: { + cartId: string; + products: GQLCartItemInput[]; + } + ): Promise { const { products = [], cartId: userCartId } = options; const cartId = userCartId || getGuestQuoteId(); if (!Array.isArray(products) || products.length === 0) { - dispatch(showNotification('error', __('No product data!'))); + dispatch(showNotification(NotificationType.ERROR, __('No product data!'))); return Promise.reject(); } try { if (!cartId) { - return Promise.reject(); + return await Promise.reject(); } const { addProductsToCart: { user_errors: errors = [] } = {} } = await fetchMutation( @@ -140,28 +166,28 @@ export class CartDispatcher { if (Array.isArray(errors) && errors.length > 0) { errors.forEach((error) => { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); }); - return Promise.reject(); + return await Promise.reject(); } await this.updateInitialCartData(dispatch); - dispatch(showNotification('success', __('Product was added to cart!'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Product was added to cart!'))); } catch (error) { if (!navigator.onLine) { - dispatch(showNotification('error', __('Not possible to fetch while offline'))); + dispatch(showNotification(NotificationType.ERROR, __('Not possible to fetch while offline'))); return Promise.reject(); } - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return Promise.reject(); } return Promise.resolve(); } - async removeProductFromCart(dispatch, item_id) { + async removeProductFromCart(dispatch: Dispatch, item_id: number): Promise { try { const isCustomerSignedIn = isSignedIn(); const guestQuoteId = !isCustomerSignedIn && getGuestQuoteId(); @@ -171,20 +197,20 @@ export class CartDispatcher { } const { removeCartItem: { cartData = {} } = {} } = await fetchMutation( - CartQuery.getRemoveCartItemMutation(item_id, guestQuoteId) + CartQuery.getRemoveCartItemMutation(item_id, guestQuoteId || '') ); this._updateCartData(cartData, dispatch); return cartData; } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return null; } } - async applyCouponToCart(dispatch, couponCode) { + async applyCouponToCart(dispatch: Dispatch, couponCode: string): Promise { try { const isCustomerSignedIn = isSignedIn(); const guestQuoteId = !isCustomerSignedIn && getGuestQuoteId(); @@ -194,17 +220,17 @@ export class CartDispatcher { } const { applyCoupon: { cartData = {} } = {} } = await fetchMutation( - CartQuery.getApplyCouponMutation(couponCode, guestQuoteId) + CartQuery.getApplyCouponMutation(couponCode, guestQuoteId || '') ); this._updateCartData(cartData, dispatch); - dispatch(showNotification('success', __('Coupon was applied!'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Coupon was applied!'))); } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); } } - async removeCouponFromCart(dispatch) { + async removeCouponFromCart(dispatch: Dispatch): Promise { try { const isCustomerSignedIn = isSignedIn(); const guestQuoteId = !isCustomerSignedIn && getGuestQuoteId(); @@ -214,35 +240,48 @@ export class CartDispatcher { } const { removeCoupon: { cartData = {} } = {} } = await fetchMutation( - CartQuery.getRemoveCouponMutation(guestQuoteId) + CartQuery.getRemoveCouponMutation(guestQuoteId || '') ); this._updateCartData(cartData, dispatch); - dispatch(showNotification('success', __('Coupon was removed!'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Coupon was removed!'))); } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); } } - updateCrossSellProducts(items, dispatch) { + updateCrossSellProducts(items: GQLTotalsItem[], dispatch: Dispatch): void { if (items && items.length) { const product_links = items.reduce((links, product) => { - const { product: { product_links, variants = [] }, sku: variantSku } = product; - - const { product_links: childProductLinks } = variants.find(({ sku }) => sku === variantSku) || {}; + const { product: { product_links, variants = [] }, sku: variantSku } = product as { + product: GQLConfigurableProduct; + sku: string; + }; + + const { + product: { + product_links: childProductLinks = [] + } = {} + } = (variants as GQLConfigurableVariant[]).find( + ({ product: { sku } = {} }) => sku === variantSku + ) || {} as GQLConfigurableVariant; if (childProductLinks) { - Object.values(childProductLinks).filter(({ link_type }) => link_type === 'crosssell') + Object.values(childProductLinks as GQLProductLinksInterface[]).filter( + ({ link_type }) => link_type === LinkedProductType.CROSS_SELL + ) .map((item) => links.push(item)); } if (product_links) { - Object.values(product_links).filter(({ link_type }) => link_type === 'crosssell') + (Object.values(product_links) as GQLProductLinksInterface[]).filter( + ({ link_type }) => link_type === LinkedProductType.CROSS_SELL + ) .map((item) => links.push(item)); } return links; - }, []); + }, [] as GQLProductLinksInterface[]); if (product_links.length !== 0) { LinkedProductsDispatcher.then( @@ -260,46 +299,16 @@ export class CartDispatcher { } } - _updateCartData(cartData, dispatch) { + _updateCartData(cartData: GQLQuoteData, dispatch: Dispatch): void { dispatch(updateTotals(cartData)); } - /** - * @param {*} attribute - * @param {*} product - */ - _getProductAttribute(attribute, product) { - const { variants, configurableVariantIndex, [attribute]: attributeValue } = product; - - return configurableVariantIndex >= 0 - ? variants[configurableVariantIndex][attribute] - : attributeValue; - } - - /** - * Check if it is allowed to add product to cart - * @param {Object} options Cart options - * @return {Boolean} Indicates is allowed or not - * @memberof CartDispatcher - */ - _canBeAdded(options) { - if (options.product && options.quantity && (options.product.quantity + options.quantity) < 1) { - return false; - } - - if (options.quantity === 0) { - return false; - } - - return true; - } - /** * Get quote id. If quote id is missing, fetch it from the BE. * @param Dispatch dispatch * @return string quote id */ - _getGuestQuoteId(dispatch) { + async _getGuestQuoteId(dispatch: Dispatch): Promise { const guestQuoteId = getGuestQuoteId(); if (guestQuoteId) { diff --git a/packages/scandipwa/src/store/Category/Category.dispatcher.js b/packages/scandipwa/src/store/Category/Category.dispatcher.ts similarity index 57% rename from packages/scandipwa/src/store/Category/Category.dispatcher.js rename to packages/scandipwa/src/store/Category/Category.dispatcher.ts index fa601baf44..430357d05d 100644 --- a/packages/scandipwa/src/store/Category/Category.dispatcher.js +++ b/packages/scandipwa/src/store/Category/Category.dispatcher.ts @@ -9,24 +9,31 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import CategoryQuery from 'Query/Category.query'; +import { CategoryQueryOptions } from 'Query/Query.type'; import { updateCurrentCategory } from 'Store/Category/Category.action'; import { updateNoMatch } from 'Store/NoMatch/NoMatch.action'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import { QueryDispatcher } from 'Util/Request'; +import { CategoryDispatcherData } from './Category.type'; + /** * Category Dispatcher * @class CategoryDispatcher * @extends QueryDispatcher * @namespace Store/Category/Dispatcher */ -export class CategoryDispatcher extends QueryDispatcher { - __construct() { +export class CategoryDispatcher extends QueryDispatcher { + __construct(): void { super.__construct('Category'); } - onSuccess(data, dispatch, { isSearchPage }) { + onSuccess(data: CategoryDispatcherData, dispatch: Dispatch, { isSearchPage }: CategoryQueryOptions): void { const { category = {}, category: { id } } = data; if (!id && !isSearchPage) { @@ -36,17 +43,19 @@ export class CategoryDispatcher extends QueryDispatcher { dispatch(updateCurrentCategory(category)); } - onError(error, dispatch, { isSearchPage }) { + onError(error: unknown, dispatch: Dispatch, { isSearchPage }: CategoryQueryOptions): void { if (!isSearchPage) { dispatch(updateNoMatch(true)); - dispatch(showNotification('error', __('Error fetching Category!'), error)); + dispatch(showNotification(NotificationType.ERROR, __('Error fetching Category!'), error)); } else { dispatch(updateCurrentCategory({ id: 'all-products' })); } } - prepareRequest(options) { - return CategoryQuery.getQuery(options); + prepareRequest( + options: CategoryQueryOptions + ): Query<'category', unknown, false> { + return CategoryQuery.getQuery(options) as Query<'category', unknown, false>; } } diff --git a/packages/scandipwa/src/store/Category/Category.type.ts b/packages/scandipwa/src/store/Category/Category.type.ts index dbd3f51d50..fb1aca7602 100644 --- a/packages/scandipwa/src/store/Category/Category.type.ts +++ b/packages/scandipwa/src/store/Category/Category.type.ts @@ -11,6 +11,7 @@ import { AnyAction } from 'redux'; import { CategoryFragment } from 'Type/Category.type'; +import { GQLCategoryTree } from 'Type/Graphql.type'; export enum CategoryActionType { UPDATE_CURRENT_CATEGORY = 'UPDATE_CURRENT_CATEGORY' @@ -30,3 +31,9 @@ declare module 'Util/Store/type' { CategoryReducer: CategoryStore; } } + +export type CategoryDispatcherData = { + category: GQLCategoryTree & { + children: GQLCategoryTree[]; + }; +}; diff --git a/packages/scandipwa/src/store/Checkout/Checkout.dispatcher.js b/packages/scandipwa/src/store/Checkout/Checkout.dispatcher.ts similarity index 60% rename from packages/scandipwa/src/store/Checkout/Checkout.dispatcher.js rename to packages/scandipwa/src/store/Checkout/Checkout.dispatcher.ts index 1963199fd4..68de7dd51e 100644 --- a/packages/scandipwa/src/store/Checkout/Checkout.dispatcher.js +++ b/packages/scandipwa/src/store/Checkout/Checkout.dispatcher.ts @@ -9,10 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import CheckEmailQuery from 'Query/CheckEmail.query'; import { QueryDispatcher } from 'Util/Request'; import { updateEmailAvailable } from './Checkout.action'; +import { CheckoutDispatcherData } from './Checkout.type'; /** * Checkout Dispatcher @@ -20,24 +24,24 @@ import { updateEmailAvailable } from './Checkout.action'; * @extends QueryDispatcher * @namespace Store/Checkout/Dispatcher */ -export class CheckoutDispatcher extends QueryDispatcher { - __construct() { +export class CheckoutDispatcher extends QueryDispatcher { + __construct(): void { super.__construct('Checkout'); } - onSuccess(data, dispatch) { + onSuccess(data: CheckoutDispatcherData, dispatch: Dispatch): void { const { isEmailAvailable: { is_email_available } } = data; dispatch(updateEmailAvailable(is_email_available)); } - onError(error, dispatch) { + onError(error: unknown, dispatch: Dispatch): unknown { dispatch(updateEmailAvailable(true)); return error; } - prepareRequest(email) { - return CheckEmailQuery.getIsEmailAvailableQuery(email); + prepareRequest(email: string): Query<'isEmailAvailable', unknown, false> { + return CheckEmailQuery.getIsEmailAvailableQuery(email) as Query<'isEmailAvailable', unknown, false>; } } diff --git a/packages/scandipwa/src/store/Checkout/Checkout.type.ts b/packages/scandipwa/src/store/Checkout/Checkout.type.ts index c93d5ef730..1861a6045d 100644 --- a/packages/scandipwa/src/store/Checkout/Checkout.type.ts +++ b/packages/scandipwa/src/store/Checkout/Checkout.type.ts @@ -10,6 +10,8 @@ */ import { AnyAction } from 'redux'; +import { GQLIsEmailAvailableOutput } from 'Type/Graphql.type'; + export enum CheckoutActionType { UPDATE_SHIPPING_FIELDS = 'UPDATE_SHIPPING_FIELDS', UPDATE_EMAIL = 'UPDATE_EMAIL', @@ -44,3 +46,9 @@ declare module 'Util/Store/type' { CheckoutReducer: CheckoutStore; } } + +export type CheckoutDispatcherData = { + isEmailAvailable: GQLIsEmailAvailableOutput & { + is_email_available: boolean; + }; +}; diff --git a/packages/scandipwa/src/store/Config/Config.dispatcher.js b/packages/scandipwa/src/store/Config/Config.dispatcher.ts similarity index 60% rename from packages/scandipwa/src/store/Config/Config.dispatcher.js rename to packages/scandipwa/src/store/Config/Config.dispatcher.ts index d697b91950..33e7e6f42a 100644 --- a/packages/scandipwa/src/store/Config/Config.dispatcher.js +++ b/packages/scandipwa/src/store/Config/Config.dispatcher.ts @@ -9,46 +9,52 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import CartQuery from 'Query/Cart.query'; import ConfigQuery from 'Query/Config.query'; import RegionQuery from 'Query/Region.query'; import ReviewQuery from 'Query/Review.query'; import { updateConfig } from 'Store/Config/Config.action'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import BrowserDatabase from 'Util/BrowserDatabase'; import { setCurrency } from 'Util/Currency'; import { fetchMutation, QueryDispatcher } from 'Util/Request'; import { ONE_MONTH_IN_SECONDS } from 'Util/Request/QueryDispatcher'; +import { ConfigStore } from './Config.type'; + /** @namespace Store/Config/Dispatcher */ -export class ConfigDispatcher extends QueryDispatcher { - __construct() { +export class ConfigDispatcher extends QueryDispatcher { + __construct(): void { super.__construct('Config'); } - static updateCurrency(dispatch, options) { + static async updateCurrency(dispatch: Dispatch, options: { currencyCode: string }): Promise { const { currencyCode } = options; - return fetchMutation(ConfigQuery.getSaveSelectedCurrencyMutation( - currencyCode - )).then( - setCurrency(currencyCode), - dispatch(updateConfig()) - ); + try { + await fetchMutation(ConfigQuery.getSaveSelectedCurrencyMutation(currencyCode)); + setCurrency(currencyCode); + } catch (e) { + dispatch(updateConfig({} as ConfigStore)); + } } - onSuccess(data, dispatch) { + onSuccess(data: ConfigStore, dispatch: Dispatch): void { if (data) { BrowserDatabase.setItem(data, 'config', ONE_MONTH_IN_SECONDS); dispatch(updateConfig(data)); } } - onError(error, dispatch) { - dispatch(showNotification('error', __('Error fetching Config!'), error)); + onError(error: unknown, dispatch: Dispatch): void { + dispatch(showNotification(NotificationType.ERROR, __('Error fetching Config!'), error)); } - prepareRequest() { + prepareRequest(): Query[] { return [ RegionQuery.getCountriesQuery(), ReviewQuery.getRatingQuery(), @@ -56,7 +62,7 @@ export class ConfigDispatcher extends QueryDispatcher { ConfigQuery.getCheckoutAgreements(), ConfigQuery.getCurrencyData(), CartQuery.getCartDisplayConfig() - ]; + ] as Query[]; } } diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.js b/packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.ts similarity index 79% rename from packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.js rename to packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.ts index bbe3feaed3..e074f06a8b 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.js +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.dispatcher.ts @@ -9,11 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import ContactFormQuery from 'Query/ContactForm.query'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import { fetchMutation, getErrorMessage } from 'Util/Request'; import { updateContactForm } from './ContactForm.action'; +import { ContactFormDispatcherOptions } from './ContactForm.type'; /** * ContactForm Dispatcher @@ -22,7 +26,7 @@ import { updateContactForm } from './ContactForm.action'; * @namespace Store/ContactForm/Dispatcher */ export class ContactFormDispatcher { - prepareRequest(options, dispatch) { + prepareRequest(options: ContactFormDispatcherOptions, dispatch: Dispatch): Promise { const { form = {}, fields = {} } = options; const mutation = ContactFormQuery.getSendContactFormMutation(fields); @@ -35,7 +39,7 @@ export class ContactFormDispatcher { .then( /** @namespace Store/ContactForm/Dispatcher/ContactFormDispatcher/prepareRequest/fetchMutation/then */ (data) => { - dispatch(showNotification('success', data.contactForm.message)); + dispatch(showNotification(NotificationType.SUCCESS, data.contactForm.message || '')); dispatch(updateContactForm({ isLoading: false })); @@ -47,7 +51,7 @@ export class ContactFormDispatcher { }, /** @namespace Store/ContactForm/Dispatcher/ContactFormDispatcher/prepareRequest/fetchMutation/then/catch */ (error) => { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); dispatch(updateContactForm({ isLoading: false })); diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts index 7b0d14cd28..eae5f2e91e 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts @@ -11,6 +11,8 @@ import { AnyAction } from 'redux'; +import { GQLContactForm } from 'Type/Graphql.type'; + export enum ContactFormActionType { UPDATE_CONTACT_FORM = 'UPDATE_CONTACT_FORM' } @@ -31,3 +33,10 @@ declare module 'Util/Store/type' { ContactFormReducer: ContactFormStore; } } + +export type ContactFormDispatcherOptions = { + form: { + reset?: () => void; + }; + fields: GQLContactForm; +}; diff --git a/packages/scandipwa/src/util/Promise/MakeCancelable.ts b/packages/scandipwa/src/util/Promise/MakeCancelable.ts index 572b411764..d3a89a236e 100644 --- a/packages/scandipwa/src/util/Promise/MakeCancelable.ts +++ b/packages/scandipwa/src/util/Promise/MakeCancelable.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { CancelablePromise } from './Promise.type'; + /* eslint-disable prefer-promise-reject-errors */ // Disabled due promise being reject with custom error (isCanceled) @@ -18,7 +20,7 @@ * @param {Promise} promise promise which has to be cancelable * @return {Promise} Cancelable promise * @namespace Util/Promise/MakeCancelable/makeCancelable */ -export const makeCancelable = (promise: Promise) => { +export const makeCancelable = (promise: Promise): CancelablePromise => { // eslint-disable-next-line fp/no-let let hasCanceled = false; diff --git a/packages/scandipwa/src/util/Promise/Promise.type.ts b/packages/scandipwa/src/util/Promise/Promise.type.ts new file mode 100644 index 0000000000..d386d19c6e --- /dev/null +++ b/packages/scandipwa/src/util/Promise/Promise.type.ts @@ -0,0 +1,15 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type CancelablePromise = { + promise: Promise; + cancel: () => void; +}; diff --git a/packages/scandipwa/src/util/Query/PrepareDocument.ts b/packages/scandipwa/src/util/Query/PrepareDocument.ts index 45044b2879..7af87b69da 100644 --- a/packages/scandipwa/src/util/Query/PrepareDocument.ts +++ b/packages/scandipwa/src/util/Query/PrepareDocument.ts @@ -9,9 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ +import { AbstractField, Mutation, Query } from '@tilework/opus'; + import { QueryObject, QueryVariables } from 'Util/Request'; -import { Field } from './Field'; import { FieldArgument, FieldType } from './Query.type'; /** @@ -19,8 +20,8 @@ import { FieldArgument, FieldType } from './Query.type'; * @param {Array} queries * @return {String} JSON String, format: `{"query":"{alias: queryName (attr:key) { field1, field2 }}"}` * @namespace Util/Query/PrepareDocument/prepareFieldString */ -export const prepareFieldString = ( - rootField: Field, +export const prepareFieldString = ( + rootField: AbstractField, accArgs: Record = {} ): string => { const { @@ -55,7 +56,7 @@ export const prepareFieldString = ( }; /** @namespace Util/Query/PrepareDocument/prepareRequest */ -export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => { +export const prepareRequest = (fields: AbstractField[], type: FieldType): QueryObject => { const fieldsArray = Array.isArray(fields) ? fields : [fields]; if (type !== FieldType.MUTATION && type !== FieldType.QUERY) { @@ -75,7 +76,7 @@ export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => (dataArray as Array>).forEach((item, i: number) => { const variable = `${name}_${i + 1}`; acc.push(`$${variable}:${item.type}`); - variables[variable] = item.value as any; + variables[variable] = String(item.value); }); return acc; @@ -104,7 +105,11 @@ export const prepareRequest = (fields: Field[], type: FieldType): QueryObject => }; /** @namespace Util/Query/PrepareDocument/prepareMutation */ -export const prepareMutation = (mutations: Field[]): QueryObject => prepareRequest(mutations, FieldType.MUTATION); +export const prepareMutation = ( + mutations: Mutation[] +): QueryObject => prepareRequest(mutations, FieldType.MUTATION); /** @namespace Util/Query/PrepareDocument/prepareQuery */ -export const prepareQuery = (queries: Field[]): QueryObject => prepareRequest(queries, FieldType.QUERY); +export const prepareQuery = ( + queries: Query[] +): QueryObject => prepareRequest(queries, FieldType.QUERY); diff --git a/packages/scandipwa/src/util/Request/Mutation.ts b/packages/scandipwa/src/util/Request/Mutation.ts index 4ea044f4d5..48dd16b7ca 100644 --- a/packages/scandipwa/src/util/Request/Mutation.ts +++ b/packages/scandipwa/src/util/Request/Mutation.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,14 +10,16 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field, prepareMutation } from 'Util/Query'; +import { Mutation } from '@tilework/opus'; + +import { prepareMutation } from 'Util/Query'; import { executePost } from 'Util/Request/Request'; -// TODO Field or ?? /** @namespace Util/Request/Mutation/fetchMutation */ -// eslint-disable-next-line import/prefer-default-export -export const fetchMutation = (rawMutations: Field): Promise => { - const queries = rawMutations instanceof Field ? [rawMutations] : rawMutations; +export const fetchMutation = ( + rawMutations: Mutation | Mutation[] +): Promise> => { + const queries = rawMutations instanceof Mutation ? [rawMutations] : rawMutations; return executePost(prepareMutation(queries)); }; diff --git a/packages/scandipwa/src/util/Request/Query.ts b/packages/scandipwa/src/util/Request/Query.ts index d2524fab0f..0bfd7fe186 100644 --- a/packages/scandipwa/src/util/Request/Query.ts +++ b/packages/scandipwa/src/util/Request/Query.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,14 +10,16 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field, prepareQuery } from 'Util/Query'; +import { Query } from '@tilework/opus'; + +import { prepareQuery } from 'Util/Query'; import { executePost } from 'Util/Request/Request'; -// TODO Field or ?? /** @namespace Util/Request/Query/fetchQuery */ -// eslint-disable-next-line import/prefer-default-export -export const fetchQuery = (rawQueries: Field): Promise => { - const queries = rawQueries instanceof Field ? [rawQueries] : rawQueries; +export const fetchQuery = ( + rawQueries: Query | Query[] +): Promise> => { + const queries = rawQueries instanceof Query ? [rawQueries] : rawQueries; return executePost(prepareQuery(queries)); }; diff --git a/packages/scandipwa/src/util/Request/QueryDispatcher.js b/packages/scandipwa/src/util/Request/QueryDispatcher.ts similarity index 79% rename from packages/scandipwa/src/util/Request/QueryDispatcher.js rename to packages/scandipwa/src/util/Request/QueryDispatcher.ts index 2411ea703e..796f81f291 100644 --- a/packages/scandipwa/src/util/Request/QueryDispatcher.js +++ b/packages/scandipwa/src/util/Request/QueryDispatcher.ts @@ -10,8 +10,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import { makeCancelable } from 'Util/Promise'; -import { Field, prepareQuery } from 'Util/Query'; +import { CancelablePromise } from 'Util/Promise/Promise.type'; +import { prepareQuery } from 'Util/Query'; import { executeGet, listenForBroadCast } from 'Util/Request/Request'; export const ONE_MONTH_IN_SECONDS = 2592000; @@ -23,15 +27,20 @@ export const FIVE_MINUTES_IN_SECONDS = 300; * @class QueryDispatcher * @namespace Util/Request/QueryDispatcher */ -export class QueryDispatcher { +export abstract class QueryDispatcher { + protected name = ''; + + protected cacheTTL = 0; + + protected promise: CancelablePromise | null = null; + /** * Creates an instance of QueryDispatcher. * @param {String} name Name of model for ServiceWorker to send BroadCasts updates to * @param {Number} cacheTTL Cache TTL (in seconds) for ServiceWorker to cache responses * @memberof QueryDispatcher */ - __construct(name, cacheTTL = ONE_MONTH_IN_SECONDS) { - super.__construct(); + __construct(name: string, cacheTTL = ONE_MONTH_IN_SECONDS): void { this.name = name; this.cacheTTL = cacheTTL; this.promise = null; @@ -43,7 +52,7 @@ export class QueryDispatcher { * @param {any} options Any options received from Container * @return {void}@memberof QueryDispatcher */ - handleData(dispatch, options) { + handleData(dispatch: Dispatch, options: Options): void { const { name, cacheTTL } = this; const rawQueries = this.prepareRequest(options, dispatch); @@ -52,7 +61,7 @@ export class QueryDispatcher { return; } - const queries = rawQueries instanceof Field ? [rawQueries] : rawQueries; + const queries = rawQueries instanceof Query ? [rawQueries] : rawQueries; if (this.promise) { this.promise.cancel(); @@ -63,7 +72,7 @@ export class QueryDispatcher { executeGet(prepareQuery(queries), name, cacheTTL) .then( /** @namespace Util/Request/QueryDispatcher/QueryDispatcher/handleData/makeCancelable/executeGet/then/resolve */ - (data) => resolve(data), + (data) => resolve(data as Data), /** @namespace Util/Request/QueryDispatcher/QueryDispatcher/handleData/makeCancelable/executeGet/then/reject/catch */ (error) => reject(error) ); @@ -79,7 +88,7 @@ export class QueryDispatcher { listenForBroadCast(name).then( /** @namespace Util/Request/QueryDispatcher/QueryDispatcher/handleData/listenForBroadCast/then */ - (data) => this.onUpdate(data, dispatch, options), + (data) => this.onUpdate(data as Data, dispatch, options), ); } @@ -91,7 +100,7 @@ export class QueryDispatcher { * @return {void} * @memberof QueryDispatcher */ - onUpdate(data, dispatch, options) { + onUpdate(data: Data, dispatch: Dispatch, options: Options): void { this.onSuccess(data, dispatch, options); } @@ -102,7 +111,10 @@ export class QueryDispatcher { * @return {Array|Field} Array or single item of Field instances * @memberof QueryDispatcher */ - prepareRequest(options, dispatch) {} + abstract prepareRequest( + options: Options, + dispatch: Dispatch + ): Query | Query[]; /** * Is triggered on successful fetch of GraphQL endpoint. @@ -112,7 +124,7 @@ export class QueryDispatcher { * @param {any} dispatch * @return {void}@memberof QueryDispatcher */ - onSuccess(data, dispatch) {} + abstract onSuccess(data: Data, dispatch: Dispatch, options: Options): void; /** * Is triggered on error in fetch of GraphQL endpoint. @@ -122,7 +134,7 @@ export class QueryDispatcher { * @param {any} dispatch * @return {void}@memberof QueryDispatcher */ - onError(error, dispatch) {} + abstract onError(error: unknown, dispatch: Dispatch, options: Options): void; } export default QueryDispatcher; diff --git a/packages/scandipwa/src/util/Request/Request.ts b/packages/scandipwa/src/util/Request/Request.ts index 5526fe8249..e7787534b3 100644 --- a/packages/scandipwa/src/util/Request/Request.ts +++ b/packages/scandipwa/src/util/Request/Request.ts @@ -10,6 +10,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { GraphQlResponse } from '@tilework/opus'; + import { getAuthorizationToken, isSignedIn, refreshAuthorizationToken } from 'Util/Auth'; import { refreshUid } from 'Util/Compare'; import { getCurrency } from 'Util/Currency'; @@ -146,10 +148,8 @@ export const postFetch = ( }) }); -// TODO -export type ResponseBody = { - errors: any; - data: any; +export type ResponseBody = Omit & { + data: T; }; /** @@ -158,7 +158,7 @@ export type ResponseBody = { * @return {Promise} Handled GraphqlQL results promise * @namespace Util/Request/checkForErrors */ -export const checkForErrors = (res: ResponseBody): Promise => new Promise((resolve, reject) => { +export const checkForErrors = (res: ResponseBody): Promise => new Promise((resolve, reject) => { const { errors, data } = res; return errors ? reject(errors) : resolve(data); @@ -179,7 +179,7 @@ export const handleConnectionError = (err: unknown): void => console.error(err); * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/parseResponse */ -export const parseResponse = (promise: Promise): Promise => new Promise((resolve, reject) => { +export const parseResponse = (promise: Promise): Promise => new Promise((resolve, reject) => { promise.then( /** @namespace Util/Request/parseResponse/Promise/promise/then */ (res) => res.json().then( @@ -219,7 +219,7 @@ export type QueryVariables = Record; * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/executeGet */ -export const executeGet = (queryObject: QueryObject, name: string, cacheTTL: number) => { +export const executeGet = (queryObject: QueryObject, name: string, cacheTTL: number): Promise => { const { query, variables } = queryObject; const uri = formatURI(query, variables, getGraphqlEndpoint()); @@ -260,7 +260,7 @@ export const executeGet = (queryObject: QueryObject, name: string, cacheTTL: num * @return {Promise} Fetch promise to GraphQL endpoint * @namespace Util/Request/executePost */ -export const executePost = (queryObject: QueryObject): Promise => { +export const executePost = (queryObject: QueryObject): Promise => { const { query, variables } = queryObject; if (isSignedIn()) { @@ -277,7 +277,7 @@ export const executePost = (queryObject: QueryObject): Promise => { * @return {Promise} Broadcast message promise * @namespace Util/Request/listenForBroadCast */ -export const listenForBroadCast = (name: string): Promise => new Promise((resolve) => { +export const listenForBroadCast = (name: string): Promise => new Promise((resolve) => { const { BroadcastChannel } = window; const windowId = getWindowId(); @@ -292,13 +292,13 @@ export const listenForBroadCast = (name: string): Promise => new Promi // TODO /** @namespace Util/Request/debounce */ -export const debounce = (callback: () => void, delay: number) => { +export const debounce = (callback: () => void, delay: number): (...args: T[]) => void => { // eslint-disable-next-line fp/no-let let timeout: NodeJS.Timeout; return (...args: T[]) => { clearTimeout(timeout); - timeout = setTimeout(() => callback.apply(this, args as any), delay); + timeout = setTimeout(() => callback.apply(this, args as []), delay); }; }; @@ -314,7 +314,7 @@ export class Debouncer < startDebounce = (callback:T, delay: U) => (...args: S[]): void => { clearTimeout(this.timeout); - this.handler = () => callback.apply(this, args as any); + this.handler = () => callback.apply(this, args as []); this.timeout = setTimeout(this.handler, delay); }; From f5bd36973d0aa95714b10976d520ebafa1eb9d4c Mon Sep 17 00:00:00 2001 From: aleksandrskondratjevs Date: Mon, 11 Apr 2022 11:14:19 +0300 Subject: [PATCH 030/192] Redundant type remove. Refactore store type --- .../src/store/Breadcrumbs/Breadcrumbs.type.ts | 2 +- .../scandipwa/src/store/Cart/Cart.type.ts | 2 +- .../src/store/Category/Category.type.ts | 2 +- .../src/store/Checkout/Checkout.type.ts | 2 +- .../src/store/ContactForm/ContactForm.type.ts | 2 +- .../LinkedProducts/LinkedProducts.type.ts | 2 +- .../scandipwa/src/store/Meta/Meta.type.ts | 2 +- .../src/store/MyAccount/MyAccount.type.ts | 2 +- .../src/store/Navigation/Navigation.type.ts | 2 +- .../src/store/NoMatch/NoMatch.type.ts | 2 +- .../store/Notification/Notification.type.ts | 2 +- .../src/store/Offline/Offline.type.ts | 2 +- .../scandipwa/src/store/Order/Order.type.ts | 2 +- .../src/store/Overlay/Overlay.type.ts | 2 +- .../scandipwa/src/store/Popup/Popup.type.ts | 2 +- .../ProductCompare/ProductCompare.type.ts | 2 +- .../src/store/SearchBar/SearchBar.type.ts | 2 +- .../store/StoreInPickUp/StoreInPickUp.type.ts | 2 +- .../src/store/UrlRewrites/UrlRewrites.type.ts | 2 +- .../src/store/Wishlist/Wishlist.type.ts | 2 +- packages/scandipwa/src/type/Order.type.ts | 4 +- .../src/util/Address/Address.type.ts | 7 ++ packages/scandipwa/src/util/Address/index.ts | 9 +- packages/scandipwa/src/util/Auth/Token.ts | 3 +- .../scandipwa/src/util/Compare/Compare.ts | 2 +- packages/scandipwa/src/util/Media/Media.ts | 2 +- .../util/Store/{type.d.ts => Store.type.ts} | 12 ++- packages/scandipwa/src/util/Url/Url.ts | 2 +- .../scandipwa/src/util/Validator/Config.ts | 93 +++++++------------ .../scandipwa/src/util/Validator/Validator.ts | 28 +----- .../src/util/Validator/Validator.type.ts | 35 +++++++ 31 files changed, 120 insertions(+), 117 deletions(-) rename packages/scandipwa/src/util/Store/{type.d.ts => Store.type.ts} (78%) create mode 100644 packages/scandipwa/src/util/Validator/Validator.type.ts diff --git a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts index 92dfde866b..8b613875b9 100644 --- a/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts +++ b/packages/scandipwa/src/store/Breadcrumbs/Breadcrumbs.type.ts @@ -34,7 +34,7 @@ export type BreadcrumbsStore = { areBreadcrumbsVisible: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { BreadcrumbsReducer: BreadcrumbsStore; } diff --git a/packages/scandipwa/src/store/Cart/Cart.type.ts b/packages/scandipwa/src/store/Cart/Cart.type.ts index 8517b51507..8f3d4c0488 100644 --- a/packages/scandipwa/src/store/Cart/Cart.type.ts +++ b/packages/scandipwa/src/store/Cart/Cart.type.ts @@ -71,7 +71,7 @@ export type CartStore = { cartTotals: Record; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { CartReducer: CartStore; } diff --git a/packages/scandipwa/src/store/Category/Category.type.ts b/packages/scandipwa/src/store/Category/Category.type.ts index fb1aca7602..5713d5f354 100644 --- a/packages/scandipwa/src/store/Category/Category.type.ts +++ b/packages/scandipwa/src/store/Category/Category.type.ts @@ -26,7 +26,7 @@ export type CategoryStore = { category: CategoryFragment | Record; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { CategoryReducer: CategoryStore; } diff --git a/packages/scandipwa/src/store/Checkout/Checkout.type.ts b/packages/scandipwa/src/store/Checkout/Checkout.type.ts index 1861a6045d..7b8970533e 100644 --- a/packages/scandipwa/src/store/Checkout/Checkout.type.ts +++ b/packages/scandipwa/src/store/Checkout/Checkout.type.ts @@ -41,7 +41,7 @@ export type CheckoutStore = { isEmailAvailable: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { CheckoutReducer: CheckoutStore; } diff --git a/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts index eae5f2e91e..3507a3d57c 100644 --- a/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts +++ b/packages/scandipwa/src/store/ContactForm/ContactForm.type.ts @@ -28,7 +28,7 @@ export type ContactFormStore = { isLoading: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { ContactFormReducer: ContactFormStore; } diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts index 5ef8f135c9..18588e341d 100644 --- a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.type.ts @@ -28,7 +28,7 @@ export type LinkedProductsStore = { linkedProducts: LinkedProductsMap; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { LinkedProductsReducer: LinkedProductsStore; } diff --git a/packages/scandipwa/src/store/Meta/Meta.type.ts b/packages/scandipwa/src/store/Meta/Meta.type.ts index d8d3bb631f..5632a501d3 100644 --- a/packages/scandipwa/src/store/Meta/Meta.type.ts +++ b/packages/scandipwa/src/store/Meta/Meta.type.ts @@ -36,7 +36,7 @@ export interface UpdateMetaAction extends AnyAction { export type MetaStore = Partial; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { MetaReducer: MetaStore; } diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts index 646b94b25b..79c9a2d54f 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts @@ -75,7 +75,7 @@ export type MyAccountStore = { status: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { MyAccountReducer: MyAccountStore; } diff --git a/packages/scandipwa/src/store/Navigation/Navigation.type.ts b/packages/scandipwa/src/store/Navigation/Navigation.type.ts index 1599dcd004..5f34ef5488 100644 --- a/packages/scandipwa/src/store/Navigation/Navigation.type.ts +++ b/packages/scandipwa/src/store/Navigation/Navigation.type.ts @@ -50,7 +50,7 @@ export type NavigationStore = { }; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { NavigationReducer: NavigationStore; } diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts b/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts index b98a6062a0..34c9e4eb75 100644 --- a/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.type.ts @@ -24,7 +24,7 @@ export type NoMatchStore = { noMatch: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { NoMatchReducer: NoMatchStore; } diff --git a/packages/scandipwa/src/store/Notification/Notification.type.ts b/packages/scandipwa/src/store/Notification/Notification.type.ts index 1ebcaf451b..cff7f27ae5 100644 --- a/packages/scandipwa/src/store/Notification/Notification.type.ts +++ b/packages/scandipwa/src/store/Notification/Notification.type.ts @@ -46,7 +46,7 @@ export type NotificationStore = { notifications: Record>; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { NotificationReducer: NotificationStore; } diff --git a/packages/scandipwa/src/store/Offline/Offline.type.ts b/packages/scandipwa/src/store/Offline/Offline.type.ts index 51fbda7e59..2a3c3590c8 100644 --- a/packages/scandipwa/src/store/Offline/Offline.type.ts +++ b/packages/scandipwa/src/store/Offline/Offline.type.ts @@ -32,7 +32,7 @@ export type OfflineStore = { isBig: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { OfflineReducer: OfflineStore; } diff --git a/packages/scandipwa/src/store/Order/Order.type.ts b/packages/scandipwa/src/store/Order/Order.type.ts index ffcdad2d4e..758783ec81 100644 --- a/packages/scandipwa/src/store/Order/Order.type.ts +++ b/packages/scandipwa/src/store/Order/Order.type.ts @@ -42,7 +42,7 @@ export type OrderStore = { isLoading: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { OrderReducer: OrderStore; } diff --git a/packages/scandipwa/src/store/Overlay/Overlay.type.ts b/packages/scandipwa/src/store/Overlay/Overlay.type.ts index dfa7698de3..4817bd0b3b 100644 --- a/packages/scandipwa/src/store/Overlay/Overlay.type.ts +++ b/packages/scandipwa/src/store/Overlay/Overlay.type.ts @@ -43,7 +43,7 @@ export type OverlayStore = { areOtherOverlaysOpen: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { OverlayReducer: OverlayStore; } diff --git a/packages/scandipwa/src/store/Popup/Popup.type.ts b/packages/scandipwa/src/store/Popup/Popup.type.ts index 7c242840c3..b046bfc9bf 100644 --- a/packages/scandipwa/src/store/Popup/Popup.type.ts +++ b/packages/scandipwa/src/store/Popup/Popup.type.ts @@ -32,7 +32,7 @@ export type PopupStore = { payload: Record | boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { PopupReducer: PopupStore; } diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts b/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts index 7415a535b3..d406dce011 100644 --- a/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.type.ts @@ -80,7 +80,7 @@ export type ProductCompareStore = { items: GQLComparableItem[]; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { ProductCompareReducer: ProductCompareStore; } diff --git a/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts b/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts index 422f1c7c7b..f456f16c83 100644 --- a/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts +++ b/packages/scandipwa/src/store/SearchBar/SearchBar.type.ts @@ -48,7 +48,7 @@ export type SearchBarStore = { isLoading: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { SearchBarReducer: SearchBarStore; } diff --git a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts index 130bdda042..463dfcc499 100644 --- a/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts +++ b/packages/scandipwa/src/store/StoreInPickUp/StoreInPickUp.type.ts @@ -32,7 +32,7 @@ export type StoreInPickUpStore = { store: PickUpInStore | null; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { StoreInPickUpReducer: StoreInPickUpStore; } diff --git a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts index 4aa979b8f8..b3b6e77b87 100644 --- a/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts +++ b/packages/scandipwa/src/store/UrlRewrites/UrlRewrites.type.ts @@ -36,7 +36,7 @@ export type UrlRewritesStore = { isLoading: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { UrlRewritesReducer: UrlRewritesStore; } diff --git a/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts b/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts index 4ffb8aaa7d..fd0f654865 100644 --- a/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts +++ b/packages/scandipwa/src/store/Wishlist/Wishlist.type.ts @@ -49,7 +49,7 @@ export type WishlistStore = { isLoading: boolean; }; -declare module 'Util/Store/type' { +declare module 'Util/Store/Store.type' { export interface RootState { WishlistReducer: WishlistStore; } diff --git a/packages/scandipwa/src/type/Order.type.ts b/packages/scandipwa/src/type/Order.type.ts index 272b39b1a8..a01dbf4d1e 100644 --- a/packages/scandipwa/src/type/Order.type.ts +++ b/packages/scandipwa/src/type/Order.type.ts @@ -154,9 +154,7 @@ export type PageInfo = { total_pages?: number; }; -export type Orders = Order[]; - export type OrdersList = { - items?: Orders; + items?: Order[]; pageInfo?: PageInfo; }; diff --git a/packages/scandipwa/src/util/Address/Address.type.ts b/packages/scandipwa/src/util/Address/Address.type.ts index 410e648467..e7b1dc0dee 100644 --- a/packages/scandipwa/src/util/Address/Address.type.ts +++ b/packages/scandipwa/src/util/Address/Address.type.ts @@ -9,8 +9,15 @@ * @link https://github.com/scandipwa/scandipwa */ +import { Region } from 'Type/Config.type'; + export type ZippopotamResponseResult = { city: string; region: string; regionAbbr: string; }; + +export type FormattedRegion = { + country: string; + region: Region[]; +}; diff --git a/packages/scandipwa/src/util/Address/index.ts b/packages/scandipwa/src/util/Address/index.ts index 93ec9881fc..86563bcff0 100644 --- a/packages/scandipwa/src/util/Address/index.ts +++ b/packages/scandipwa/src/util/Address/index.ts @@ -11,7 +11,7 @@ import StoreItem from 'Component/StoreItem'; import { Address, TrimmedAddress } from 'Type/Account.type'; -import { Country, Region, Stores } from 'Type/Config.type'; +import { Country, Region } from 'Type/Config.type'; import { ZippopotamResponseResult } from './Address.type'; @@ -180,7 +180,10 @@ export const getAvailableRegions = (country_id: string, countries: Country[]): R }; /** @namespace Util/Address/Index/getFormattedRegion */ -export const getFormattedRegion = (address: Address, countries: Country[]) => { +export const getFormattedRegion = ( + address: Address, + countries: Country[] +) => { const { country_id, region: regionData } = address; if (!regionData) { @@ -226,7 +229,7 @@ export const getRegionIdFromAvailableRegions = ( }; /** @namespace Util/Address/Index/checkIfStoreIncluded */ -export const checkIfStoreIncluded = (stores: Stores, selectedStore: StoreItem): boolean => { +export const checkIfStoreIncluded = (stores: StoreItem[], selectedStore: StoreItem): boolean => { const selectedStoreInString = JSON.stringify(selectedStore); return !!stores.find((store) => JSON.stringify(store) === selectedStoreInString); diff --git a/packages/scandipwa/src/util/Auth/Token.ts b/packages/scandipwa/src/util/Auth/Token.ts index a49a8abf47..e0c8a87d55 100644 --- a/packages/scandipwa/src/util/Auth/Token.ts +++ b/packages/scandipwa/src/util/Auth/Token.ts @@ -15,7 +15,8 @@ import { deleteGuestQuoteId } from 'Util/Cart'; import { removeUid } from 'Util/Compare'; import { debounce } from 'Util/Request'; import getStore from 'Util/Store'; -import { RootState } from 'Util/Store/type'; +import { RootState } from 'Util/Store/Store.type'; + export const AUTH_TOKEN = 'auth_token'; export const ONE_HOUR_IN_SECONDS = 3600; diff --git a/packages/scandipwa/src/util/Compare/Compare.ts b/packages/scandipwa/src/util/Compare/Compare.ts index 42a55d0cea..94d8487797 100644 --- a/packages/scandipwa/src/util/Compare/Compare.ts +++ b/packages/scandipwa/src/util/Compare/Compare.ts @@ -15,7 +15,7 @@ import { import BrowserDatabase from 'Util/BrowserDatabase'; import { debounce } from 'Util/Request'; import getStore from 'Util/Store'; -import { RootState } from 'Util/Store/type'; +import { RootState } from 'Util/Store/Store.type'; /** * diff --git a/packages/scandipwa/src/util/Media/Media.ts b/packages/scandipwa/src/util/Media/Media.ts index 0ffea10629..58e94c7a3e 100644 --- a/packages/scandipwa/src/util/Media/Media.ts +++ b/packages/scandipwa/src/util/Media/Media.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ import getStore from 'Util/Store'; -import { RootState } from 'Util/Store/type'; +import { RootState } from 'Util/Store/Store.type'; export const WYSIWYG_MEDIA = 'wysiwyg/'; export const CATEGORY_MEDIA = 'catalog/category/'; diff --git a/packages/scandipwa/src/util/Store/type.d.ts b/packages/scandipwa/src/util/Store/Store.type.ts similarity index 78% rename from packages/scandipwa/src/util/Store/type.d.ts rename to packages/scandipwa/src/util/Store/Store.type.ts index ba8362116d..f24983bb57 100644 --- a/packages/scandipwa/src/util/Store/type.d.ts +++ b/packages/scandipwa/src/util/Store/Store.type.ts @@ -8,6 +8,13 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { + Action, + Reducer, + ReducersMapObject, + Store +} from 'redux'; + import { store } from 'Util/Store'; /** @@ -15,7 +22,7 @@ import { store } from 'Util/Store'; * * @example * ```ts - declare module 'Util/Store/type' { + declare module 'Util/Store/Store.type'; { export interface RootState { BreadcrumbsReducer: BreadcrumbsStore } @@ -23,7 +30,8 @@ import { store } from 'Util/Store'; * ``` */ -export interface RootState {}; +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface RootState {} export type AppDispatch = typeof store.dispatch; diff --git a/packages/scandipwa/src/util/Url/Url.ts b/packages/scandipwa/src/util/Url/Url.ts index 8739d7b74f..2ac32e664b 100644 --- a/packages/scandipwa/src/util/Url/Url.ts +++ b/packages/scandipwa/src/util/Url/Url.ts @@ -12,7 +12,7 @@ import { History, Location, Match } from 'Type/Router.type'; import { decodeString } from 'Util/Common'; import getStore from 'Util/Store'; -import { RootState } from 'Util/Store/type'; +import { RootState } from 'Util/Store/Store.type'; // TODO move export type KeyValuePairs = Record>; diff --git a/packages/scandipwa/src/util/Validator/Config.ts b/packages/scandipwa/src/util/Validator/Config.ts index 6536993dd5..69f1e1c8a5 100644 --- a/packages/scandipwa/src/util/Validator/Config.ts +++ b/packages/scandipwa/src/util/Validator/Config.ts @@ -11,14 +11,6 @@ * @link https://github.com/scandipwa/base-theme */ -export const VALIDATION_INPUT_TYPE_TEXT = { - alpha: 'alpha', - alphaSpace: 'alphaSpace', - alphaNumeric: 'alphaNumeric', - alphaDash: 'alphaDash', - url: 'url' -}; - export enum ValidationInputTypeText { ALPHA = 'alpha', ALPHASPACE = 'alphaSpace', @@ -27,15 +19,6 @@ export enum ValidationInputTypeText { URL = 'url' } -export const VALIDATION_INPUT_TYPE_NUMBER = { - numeric: 'numeric', - numericDash: 'numericDash', - integer: 'integer', - decimal: 'decimal', - natural: 'natural', - naturalNoZero: 'naturalNoZero' -}; - export enum ValidationInputTypeNumber { NUMERIC = 'numeric', NUMERICDASH = 'numericDash', @@ -45,14 +28,6 @@ export enum ValidationInputTypeNumber { NATURALNOZERO = 'naturalNoZero' } -export const VALIDATION_INPUT_TYPE_INPUT = { - email: 'email', - password: 'password', - date: 'date', - phone: 'phone', - emailList: 'emailList' -}; - export enum ValidationInputTypeInput { EMAIL = 'email', PASSWORD = 'password', @@ -61,10 +36,10 @@ export enum ValidationInputTypeInput { EMAILLIST = 'emailList' } -export const VALIDATION_INPUT_TYPE = { - ...VALIDATION_INPUT_TYPE_TEXT, - ...VALIDATION_INPUT_TYPE_NUMBER, - ...VALIDATION_INPUT_TYPE_INPUT +export const ValidationInputType = { + ...ValidationInputTypeInput, + ...ValidationInputTypeNumber, + ...ValidationInputTypeText }; export const VALIDATION_MESSAGES = { @@ -77,45 +52,45 @@ export const VALIDATION_MESSAGES = { //#endregion //#region VALIDATION RULE MSG - [VALIDATION_INPUT_TYPE.alpha]: __('Incorrect input! Only letters allowed!'), - [VALIDATION_INPUT_TYPE.alphaSpace]: __('Incorrect input! Only words allowed!'), - [VALIDATION_INPUT_TYPE.alphaNumeric]: __('Incorrect input! Alpha-Numeric value required!'), - [VALIDATION_INPUT_TYPE.alphaDash]: __('Incorrect input! Alpha-Dash value required!'), - [VALIDATION_INPUT_TYPE.url]: __('Incorrect input! URL required!'), - [VALIDATION_INPUT_TYPE.numeric]: __('Incorrect input! Numeric value required!'), - [VALIDATION_INPUT_TYPE.numericDash]: __('Incorrect input! Numeric-Dash value required!'), - [VALIDATION_INPUT_TYPE.integer]: __('Incorrect input! Integer required!'), - [VALIDATION_INPUT_TYPE.natural]: __('Incorrect input! Natural number required!'), - [VALIDATION_INPUT_TYPE.naturalNoZero]: __('Incorrect input!'), - [VALIDATION_INPUT_TYPE.email]: __('Incorrect email format!'), - [VALIDATION_INPUT_TYPE.emailList]: __('Incorrect list of emails!'), - [VALIDATION_INPUT_TYPE.date]: __('Incorrect date input!'), - [VALIDATION_INPUT_TYPE.password]: __('Incorrect password input!'), - [VALIDATION_INPUT_TYPE.phone]: __('Incorrect phone input!') + [ValidationInputType.ALPHA]: __('Incorrect input! Only letters allowed!'), + [ValidationInputType.ALPHASPACE]: __('Incorrect input! Only words allowed!'), + [ValidationInputType.ALPHANUMERIC]: __('Incorrect input! Alpha-Numeric value required!'), + [ValidationInputType.ALPHADASH]: __('Incorrect input! Alpha-Dash value required!'), + [ValidationInputType.URL]: __('Incorrect input! URL required!'), + [ValidationInputType.NUMERIC]: __('Incorrect input! Numeric value required!'), + [ValidationInputType.NUMERICDASH]: __('Incorrect input! Numeric-Dash value required!'), + [ValidationInputType.INTEGER]: __('Incorrect input! Integer required!'), + [ValidationInputType.NATURAL]: __('Incorrect input! Natural number required!'), + [ValidationInputType.NATURALNOZERO]: __('Incorrect input!'), + [ValidationInputType.EMAIL]: __('Incorrect email format!'), + [ValidationInputType.EMAILLIST]: __('Incorrect list of emails!'), + [ValidationInputType.DATE]: __('Incorrect date input!'), + [ValidationInputType.PASSWORD]: __('Incorrect password input!'), + [ValidationInputType.PHONE]: __('Incorrect phone input!') //#endregion }; export const VALIDATION_RULES = { // Text - [VALIDATION_INPUT_TYPE.alpha]: /^[a-z]+$/i, - [VALIDATION_INPUT_TYPE.alphaSpace]: /^[a-z\s]+$/i, - [VALIDATION_INPUT_TYPE.alphaNumeric]: /^[a-z0-9]+$/i, - [VALIDATION_INPUT_TYPE.alphaDash]: /^[a-z0-9_\\-]+$/i, - [VALIDATION_INPUT_TYPE.url]: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\\/]))?$/, + [ValidationInputType.ALPHA]: /^[a-z]+$/i, + [ValidationInputType.ALPHASPACE]: /^[a-z\s]+$/i, + [ValidationInputType.ALPHANUMERIC]: /^[a-z0-9]+$/i, + [ValidationInputType.ALPHADASH]: /^[a-z0-9_\\-]+$/i, + [ValidationInputType.URL]: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\\/]))?$/, // Numbers - [VALIDATION_INPUT_TYPE.numeric]: /^[0-9]+$/, - [VALIDATION_INPUT_TYPE.numericDash]: /^[\d\-\s]+$/, - [VALIDATION_INPUT_TYPE.integer]: /^\\-?[0-9]+$/, - [VALIDATION_INPUT_TYPE.decimal]: /^\\-?[0-9]*\.?[0-9]+$/, - [VALIDATION_INPUT_TYPE.natural]: /^[0-9]+$/i, - [VALIDATION_INPUT_TYPE.naturalNoZero]: /^[1-9][0-9]*$/i, + [ValidationInputType.NUMERIC]: /^[0-9]+$/, + [ValidationInputType.NUMERICDASH]: /^[\d\-\s]+$/, + [ValidationInputType.INTEGER]: /^\\-?[0-9]+$/, + [ValidationInputType.DECIMAL]: /^\\-?[0-9]*\.?[0-9]+$/, + [ValidationInputType.NATURAL]: /^[0-9]+$/i, + [ValidationInputType.NATURALNOZERO]: /^[1-9][0-9]*$/i, // Inputs // eslint-disable-next-line max-len - [VALIDATION_INPUT_TYPE.email]: /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z0-9]{2,}))$/, - [VALIDATION_INPUT_TYPE.date]: /\d{4}-\d{1,2}-\d{1,2}/, - [VALIDATION_INPUT_TYPE.phone]: /^[\\+]?[(]?[0-9]{3}[)]?[-\s\\.]?[0-9]{3}[-\s\\.]?[0-9]{4,6}$/im, + [ValidationInputType.EMAIL]: /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z0-9]{2,}))$/, + [ValidationInputType.DATE]: /\d{4}-\d{1,2}-\d{1,2}/, + [ValidationInputType.PHONE]: /^[\\+]?[(]?[0-9]{3}[)]?[-\s\\.]?[0-9]{3}[-\s\\.]?[0-9]{4,6}$/im, // eslint-disable-next-line max-len - [VALIDATION_INPUT_TYPE.emailList]: /^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\.([a-zA-Z]{2,5}){1,25})+([,\s]+(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/ + [ValidationInputType.EMAILLIST]: /^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\.([a-zA-Z]{2,5}){1,25})+([,\s]+(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/ }; diff --git a/packages/scandipwa/src/util/Validator/Validator.ts b/packages/scandipwa/src/util/Validator/Validator.ts index d75b2c0dee..3a37ecf77a 100644 --- a/packages/scandipwa/src/util/Validator/Validator.ts +++ b/packages/scandipwa/src/util/Validator/Validator.ts @@ -10,34 +10,10 @@ * @link https://github.com/scandipwa/base-theme */ import FIELD_TYPE from 'Component/Field/Field.config'; +import { ValidationRule } from 'Type/Field.type'; import { VALIDATION_MESSAGES, VALIDATION_RULES, ValidationInputTypeNumber } from 'Util/Validator/Config'; -//TODO Move to Types - -export type ValidationRule = { - isRequired: boolean; - inputType: string; - selector?: string; - match: string | ((args: string | Record[]) => boolean); - range: Record; - fileExtension: Record; - customErrorMessages: Record; -}; - -export type ValidationOutput = { - value: string; - errorMessages: string[]; -}; - -export type ValidationDOMOutput = { - values: { - name: string; - value: string; - type: string; - }[]; - errorFields: unknown[]; - errorMessages: string[]; -}; +import { ValidationDOMOutput, ValidationOutput } from './Validator.type'; /** * Validates parameter based on rules diff --git a/packages/scandipwa/src/util/Validator/Validator.type.ts b/packages/scandipwa/src/util/Validator/Validator.type.ts new file mode 100644 index 0000000000..95dc0f61d4 --- /dev/null +++ b/packages/scandipwa/src/util/Validator/Validator.type.ts @@ -0,0 +1,35 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export type ValidationRule = { + isRequired: boolean; + inputType: string; + selector?: string; + match: string | ((args: string | Record[]) => boolean); + range: Record; + fileExtension: Record; + customErrorMessages: Record; +}; + +export type ValidationOutput = { + value: string; + errorMessages: string[]; +}; + +export type ValidationDOMOutput = { + values: { + name: string; + value: string; + type: string; + }[]; + errorFields: unknown[]; + errorMessages: string[]; +}; From 08bfb01e9528b1c05c178d248848dd950adb87f0 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 11 Apr 2022 13:50:37 +0300 Subject: [PATCH 031/192] Migrated some actions to TS --- .../scandipwa/src/query/MyAccount.query.ts | 22 ++-- packages/scandipwa/src/query/Order.query.ts | 6 +- .../src/query/ProductCompare.query.ts | 23 ++-- ...atcher.js => LinkedProducts.dispatcher.ts} | 82 +++++++++----- ...{Meta.dispatcher.js => Meta.dispatcher.ts} | 22 ++-- .../scandipwa/src/store/Meta/Meta.type.ts | 33 ++++++ .../src/store/MyAccount/MyAccount.action.ts | 6 +- ....dispatcher.js => MyAccount.dispatcher.ts} | 100 ++++++++++-------- .../src/store/MyAccount/MyAccount.type.ts | 6 +- ...s => NewsletterSubscription.dispatcher.ts} | 9 +- ...ch.dispatcher.js => NoMatch.dispatcher.ts} | 4 +- ...rder.dispatcher.js => Order.dispatcher.ts} | 37 ++++--- ...ct.dispatcher.js => Product.dispatcher.ts} | 28 +++-- .../src/store/Product/Product.type.ts | 5 + ...atcher.js => ProductCompare.dispatcher.ts} | 68 +++++++----- .../scandipwa/src/type/ProductList.type.ts | 3 +- .../scandipwa/src/util/Compare/Compare.ts | 10 +- 17 files changed, 296 insertions(+), 168 deletions(-) rename packages/scandipwa/src/store/LinkedProducts/{LinkedProducts.dispatcher.js => LinkedProducts.dispatcher.ts} (56%) rename packages/scandipwa/src/store/Meta/{Meta.dispatcher.js => Meta.dispatcher.ts} (80%) rename packages/scandipwa/src/store/MyAccount/{MyAccount.dispatcher.js => MyAccount.dispatcher.ts} (74%) rename packages/scandipwa/src/store/NewsletterSubscription/{NewsletterSubscription.dispatcher.js => NewsletterSubscription.dispatcher.ts} (78%) rename packages/scandipwa/src/store/NoMatch/{NoMatch.dispatcher.js => NoMatch.dispatcher.ts} (84%) rename packages/scandipwa/src/store/Order/{Order.dispatcher.js => Order.dispatcher.ts} (61%) rename packages/scandipwa/src/store/Product/{Product.dispatcher.js => Product.dispatcher.ts} (62%) rename packages/scandipwa/src/store/ProductCompare/{ProductCompare.dispatcher.js => ProductCompare.dispatcher.ts} (68%) diff --git a/packages/scandipwa/src/query/MyAccount.query.ts b/packages/scandipwa/src/query/MyAccount.query.ts index 10bde33914..db8ea38365 100644 --- a/packages/scandipwa/src/query/MyAccount.query.ts +++ b/packages/scandipwa/src/query/MyAccount.query.ts @@ -125,26 +125,26 @@ export class MyAccountQuery { .addFieldList(this._getAddressFields()); } - getCreateAccountMutation(options: CreateAccountOptions): Field<'createCustomer', GQLCustomerOutput> { + getCreateAccountMutation(options: CreateAccountOptions): Mutation<'createCustomer', GQLCustomerOutput> { const { customer, password } = options; - return new Field<'createCustomer', GQLCustomerOutput>('createCustomer') + return new Mutation<'createCustomer', GQLCustomerOutput>('createCustomer') .addArgument('input', 'CustomerInput!', { ...customer, password }) .addField(this._getCustomerField()); } - getConfirmAccountMutation(options: ConfirmAccountOptions): Field<'confirmCustomerEmail', GQLCreateCustomerType> { + getConfirmAccountMutation(options: ConfirmAccountOptions): Mutation<'confirmCustomerEmail', GQLCreateCustomerType> { const { key, email, password } = options; - return new Field<'confirmCustomerEmail', GQLCreateCustomerType>('confirmCustomerEmail') + return new Mutation<'confirmCustomerEmail', GQLCreateCustomerType>('confirmCustomerEmail') .addArgument('key', 'String!', key) .addArgument('email', 'String!', email) .addArgument('password', 'String!', password) .addFieldList(this._getConfirmAccountFields()); } - getRevokeAccountToken(): Field<'revokeCustomerToken', GQLRevokeCustomerTokenOutput> { - return new Field<'revokeCustomerToken', GQLRevokeCustomerTokenOutput>('revokeCustomerToken') + getRevokeAccountToken(): Mutation<'revokeCustomerToken', GQLRevokeCustomerTokenOutput> { + return new Mutation<'revokeCustomerToken', GQLRevokeCustomerTokenOutput>('revokeCustomerToken') .addFieldList(this.getRevokeAccountTokenFields()); } @@ -237,12 +237,14 @@ export class MyAccountQuery { * @returns {Field} * @memberof MyAccount */ - getForgotPasswordMutation(options: { email: string }): Field<'forgotPassword', GQLCustomerActionConfirmationType & { - status: string; - }> { + getForgotPasswordMutation( + options: { email: string } + ): Mutation<'forgotPassword', GQLCustomerActionConfirmationType & { + status: string; + }> { const { email } = options; - return new Field<'forgotPassword', GQLCustomerActionConfirmationType>('forgotPassword') + return new Mutation<'forgotPassword', GQLCustomerActionConfirmationType>('forgotPassword') .addArgument('email', 'String!', email) .addField('status'); } diff --git a/packages/scandipwa/src/query/Order.query.ts b/packages/scandipwa/src/query/Order.query.ts index e52c027811..509d31f9ef 100644 --- a/packages/scandipwa/src/query/Order.query.ts +++ b/packages/scandipwa/src/query/Order.query.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field, Query } from '@tilework/opus'; +import { Field, Mutation, Query } from '@tilework/opus'; import { GQLBundleOption, @@ -48,10 +48,10 @@ import { CommonField, OrdersOptions } from './Query.type'; * @class OrderQuery * @namespace Query/Order/Query */ export class OrderQuery { - getReorder(incrementId: string): Query<'reorderItems', GQLReorderItemsOutput & { + getReorder(incrementId: string): Mutation<'reorderItems', GQLReorderItemsOutput & { userInputErrors: GQLCheckoutUserInputError[]; }> { - return new Query<'reorderItems', GQLReorderItemsOutput>('reorderItems') + return new Mutation<'reorderItems', GQLReorderItemsOutput>('reorderItems') .addArgument('orderNumber', 'String!', incrementId) .addField(this._getReorderField()); } diff --git a/packages/scandipwa/src/query/ProductCompare.query.ts b/packages/scandipwa/src/query/ProductCompare.query.ts index ff05650fa2..a4f65c7974 100644 --- a/packages/scandipwa/src/query/ProductCompare.query.ts +++ b/packages/scandipwa/src/query/ProductCompare.query.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ -import { Field, Mutation } from '@tilework/opus'; +import { Field, Mutation, Query } from '@tilework/opus'; import { ProductListQuery } from 'Query/ProductList.query'; import { @@ -18,7 +18,6 @@ import { GQLComparableItem, GQLCompareList, GQLDeleteCompareListOutput, - GQLGroupedProduct, GQLProductAttribute, GQLProductInterface } from 'Type/Graphql.type'; @@ -80,14 +79,14 @@ export class ProductCompareQuery extends ProductListQuery { .addFieldList(this._getCompareListFields()); } - getCompareList(uid: string): Field<'compareList', GQLCompareList> { - return new Field<'compareList', GQLCompareList>('compareList') + getCompareList(uid: string): Query<'compareList', GQLCompareList> { + return new Query<'compareList', GQLCompareList>('compareList') .addArgument('uid', 'ID!', uid) .addFieldList(this._getCompareListFields()); } - getCompareListIds(uid: string): Field<'compareList', GQLCompareList & { items: GQLComparableItem[] }> { - return new Field<'compareList', GQLCompareList>('compareList') + getCompareListIds(uid: string): Query<'compareList', GQLCompareList & { items: GQLComparableItem[] }> { + return new Query<'compareList', GQLCompareList>('compareList') .addArgument('uid', 'ID!', uid) .addField(this._getComparableItemIdsField()); } @@ -140,17 +139,7 @@ export class ProductCompareQuery extends ProductListQuery { ]; } - _getCompareProductField(): Field< - 'product', - GQLProductInterface & { - url: string; - } & { - review_count: number; - } & { - rating_summary: unknown; - } & { - description: { [x: string]: string }; - } & Partial> { + _getCompareProductField() { return new Field<'product', GQLProductInterface>('product') .addFieldList(this._getProductInterfaceFields(true, false)) .addFieldList(['url']) diff --git a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.js b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.ts similarity index 56% rename from packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.js rename to packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.ts index 440420d471..b1647b2f27 100644 --- a/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.js +++ b/packages/scandipwa/src/store/LinkedProducts/LinkedProducts.dispatcher.ts @@ -9,36 +9,52 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import ProductListQuery from 'Query/ProductList.query'; +import { ProductListOptions } from 'Query/Query.type'; import { updateLinkedProducts } from 'Store/LinkedProducts/LinkedProducts.action'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; +import { GQLProductInterface, GQLProductLinksInterface, GQLProducts } from 'Type/Graphql.type'; +import { + LinkedProducts, LinkedProductType, Product, ProductBundle +} from 'Type/ProductList.type'; import BrowserDatabase from 'Util/BrowserDatabase'; -import { getIndexedProduct } from 'Util/Product'; +import { getIndexedProduct, IndexedProduct } from 'Util/Product'; import { fetchQuery, QueryDispatcher } from 'Util/Request'; import { ONE_MONTH_IN_SECONDS } from 'Util/Request/QueryDispatcher'; export const LINKED_PRODUCTS = 'LINKED_PRODUCTS'; +export type LinkedProductsDispatcherData = { + products: GQLProducts; +}; + /** * Linked Prodcts List Dispatcher * @class LinkedProductsDispatcher * @extends QueryDispatcher * @namespace Store/LinkedProducts/Dispatcher */ -export class LinkedProductsDispatcher extends QueryDispatcher { - __construct() { +export class LinkedProductsDispatcher extends QueryDispatcher< +GQLProductLinksInterface[], +LinkedProductsDispatcherData +> { + __construct(): void { super.__construct('LinkedProducts', ONE_MONTH_IN_SECONDS); } - onSuccess(data, dispatch, product_links) { + onSuccess(data: LinkedProductsDispatcherData, dispatch: Dispatch, product_links: GQLProductLinksInterface[]): void { const linkedProducts = this._processResponse(data, product_links); BrowserDatabase.setItem(linkedProducts, LINKED_PRODUCTS); dispatch(updateLinkedProducts(linkedProducts)); } - onError(error, dispatch) { - dispatch(showNotification('error', __('Error fetching LinkedProducts!'), error)); + onError(error: unknown, dispatch: Dispatch): void { + dispatch(showNotification(NotificationType.ERROR, __('Error fetching LinkedProducts!'), error)); } /** @@ -47,12 +63,12 @@ export class LinkedProductsDispatcher extends QueryDispatcher { * @memberof LinkedProductsDispatcher * @param product_links */ - prepareRequest(product_links) { + prepareRequest(product_links: GQLProductLinksInterface[]): Query[] { const relatedSKUs = product_links.reduce((links, link) => { const { linked_product_sku } = link; - return [...links, `${ linked_product_sku.replace(/ /g, '%20') }`]; - }, []); + return [...links, `${ linked_product_sku?.replace(/ /g, '%20') }`]; + }, [] as string[]); return [ ProductListQuery.getQuery({ @@ -62,8 +78,8 @@ export class LinkedProductsDispatcher extends QueryDispatcher { } }, notRequireInfo: true - }) - ]; + } as unknown as ProductListOptions) + ] as Query[]; } /** @@ -72,7 +88,7 @@ export class LinkedProductsDispatcher extends QueryDispatcher { * @return {Query} ProductList query * @memberof LinkedProductsDispatcher */ - clearLinkedProducts(dispatch, updateCrossSell = false) { + clearLinkedProducts(dispatch: Dispatch, updateCrossSell = false): void { const linkedProducts = { upsell: { total_count: 0, items: [] }, related: { total_count: 0, items: [] }, @@ -87,11 +103,15 @@ export class LinkedProductsDispatcher extends QueryDispatcher { })); } - async fetchCrossSellProducts(dispatch, product_links) { + async fetchCrossSellProducts(dispatch: Dispatch, product_links: GQLProductLinksInterface[]): Promise { const query = this.prepareRequest(product_links); - const data = await fetchQuery(query); + const data = await fetchQuery(query) as LinkedProductsDispatcherData; const { crosssell } = this._processResponse(data, product_links); - const linkedProducts = BrowserDatabase.getItem(LINKED_PRODUCTS) || {}; + const linkedProducts = ( + BrowserDatabase.getItem(LINKED_PRODUCTS) || {} + ) as Partial> & { + updateCrossSell?: boolean | undefined; + }; Object.assign(linkedProducts, { crosssell, @@ -101,8 +121,12 @@ export class LinkedProductsDispatcher extends QueryDispatcher { dispatch(updateLinkedProducts(linkedProducts)); } - clearCrossSellProducts(dispatch) { - const linkedProducts = BrowserDatabase.getItem(LINKED_PRODUCTS) || {}; + clearCrossSellProducts(dispatch: Dispatch): void { + const linkedProducts = ( + BrowserDatabase.getItem(LINKED_PRODUCTS) || {} + ) as Partial> & { + updateCrossSell?: boolean | undefined; + }; Object.assign(linkedProducts, { crosssell: { total_count: 0, items: [] }, @@ -112,18 +136,28 @@ export class LinkedProductsDispatcher extends QueryDispatcher { dispatch(updateLinkedProducts(linkedProducts)); } - _processResponse(data, product_links) { + _processResponse( + data: LinkedProductsDispatcherData, + product_links: GQLProductLinksInterface[] + ): Record { const { products: { items } } = data; - const indexedBySku = items.reduce((acc, item) => { - const { sku } = item; - acc[sku] = getIndexedProduct(item); + const indexedBySku = (items as GQLProductInterface[]).reduce((acc, item) => { + const { sku } = item as { sku: string }; + + acc[sku] = getIndexedProduct(item as unknown as Product | ProductBundle); return acc; - }, {}); + }, {} as Record); const linkedProducts = product_links.reduce((acc, link) => { - const { linked_product_sku, link_type } = link; + const { + linked_product_sku, + link_type + } = link as { linked_product_sku: string; link_type: LinkedProductType }; if (indexedBySku[linked_product_sku] && acc[link_type]) { acc[link_type].items.push( @@ -139,7 +173,7 @@ export class LinkedProductsDispatcher extends QueryDispatcher { related: { total_count: 0, items: [] }, crosssell: { total_count: 0, items: [] }, associated: { total_count: 0, items: [] } - }); + } as Record); return linkedProducts; } diff --git a/packages/scandipwa/src/store/Meta/Meta.dispatcher.js b/packages/scandipwa/src/store/Meta/Meta.dispatcher.ts similarity index 80% rename from packages/scandipwa/src/store/Meta/Meta.dispatcher.js rename to packages/scandipwa/src/store/Meta/Meta.dispatcher.ts index 59e6d9e452..48092f2586 100644 --- a/packages/scandipwa/src/store/Meta/Meta.dispatcher.js +++ b/packages/scandipwa/src/store/Meta/Meta.dispatcher.ts @@ -8,9 +8,15 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import { updateMeta } from 'Store/Meta/Meta.action'; import { appendWithStoreCode } from 'Util/Url'; +import { + Category, CategoryMeta, Product, ProductMeta +} from './Meta.type'; + /** * Meta Dispatcher * @class MetaDispatcher @@ -22,7 +28,7 @@ export class MetaDispatcher { * @param {Function} dispatch * @memberof MetaDispatcher */ - updateWithCategory(category, dispatch) { + updateWithCategory(category: Category, dispatch: Dispatch): void { const meta = this._getCategoryMeta(category); dispatch(updateMeta(meta)); } @@ -33,7 +39,7 @@ export class MetaDispatcher { * @param {Function} dispatch * @memberof MetaDispatcher */ - updateWithProduct(product, dispatch) { + updateWithProduct(product: Product, dispatch: Dispatch): void { const meta = this._getProductMeta(product); dispatch(updateMeta(meta)); } @@ -44,7 +50,7 @@ export class MetaDispatcher { * @return {Object} Meta object * @memberof MetaDispatcher */ - _getProductMeta(product) { + _getProductMeta(product: Product): ProductMeta { const { name, meta_title, @@ -67,10 +73,14 @@ export class MetaDispatcher { * @return {Object} Meta object * @memberof MetaDispatcher */ - _getCategoryMeta(category) { + _getCategoryMeta(category: Category): CategoryMeta { const { - description, name, canonical_url, - meta_title, meta_keywords, meta_description, + description, + name, + canonical_url, + meta_title, + meta_keywords, + meta_description, meta_robots = 'follow, index' } = category; diff --git a/packages/scandipwa/src/store/Meta/Meta.type.ts b/packages/scandipwa/src/store/Meta/Meta.type.ts index d8d3bb631f..3367600595 100644 --- a/packages/scandipwa/src/store/Meta/Meta.type.ts +++ b/packages/scandipwa/src/store/Meta/Meta.type.ts @@ -41,3 +41,36 @@ declare module 'Util/Store/type' { MetaReducer: MetaStore; } } + +export type Category = { + description: string; + name: string; + canonical_url: string; + meta_title: string; + meta_keywords: string; + meta_description: string; + meta_robots: string; +}; + +export type CategoryMeta = { + description: string; + title: string; + keywords: string; + canonical_url: string; + robots: string; +}; + +export type Product = { + name: string; + meta_title: string; + meta_keyword: string; + canonical_url: string; + meta_description: string; +}; + +export type ProductMeta = { + description: string; + keywords: string; + title: string; + canonical_url: string; +}; diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts index 5a1b22956f..a352b5157f 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.action.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { GQLCustomer } from 'Type/Graphql.type'; + import { MyAccountActionType, UpdateCustomerDetailsAction, @@ -27,14 +29,14 @@ export const updateCustomerSignInStatus = (status: boolean): UpdateCustomerSignI }); /** @namespace Store/MyAccount/Action/updateCustomerDetails */ -export const updateCustomerDetails = (customer: Record): UpdateCustomerDetailsAction => ({ +export const updateCustomerDetails = (customer: GQLCustomer): UpdateCustomerDetailsAction => ({ type: MyAccountActionType.UPDATE_CUSTOMER_DETAILS, customer }); /** @namespace Store/MyAccount/Action/updateCustomerPasswordResetStatus */ export const updateCustomerPasswordResetStatus = ( - status: boolean, + status: string, message: string ): UpdateCustomerPasswordResetStatusAction => ({ type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_RESET_STATUS, diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.js b/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts similarity index 74% rename from packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.js rename to packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts index 46900f9093..b77ec5c74e 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.js +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts @@ -9,9 +9,15 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import { CHECKOUT, MY_ACCOUNT } from 'Component/Header/Header.config'; import { CONFIRMATION_REQUIRED } from 'Component/MyAccountCreateAccount/MyAccountCreateAccount.config'; import MyAccountQuery from 'Query/MyAccount.query'; +import { + ConfirmAccountOptions, CreateAccountOptions, ResetPasswordOptions, SignInOptions +} from 'Query/Query.type'; import { ACCOUNT_LOGIN_URL } from 'Route/MyAccount/MyAccount.config'; import { updateCustomerDetails, @@ -22,8 +28,10 @@ import { updateIsLocked } from 'Store/MyAccount/MyAccount.action'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType, ShowNotificationAction } from 'Store/Notification/Notification.type'; import { hideActiveOverlay } from 'Store/Overlay/Overlay.action'; import { clearComparedProducts } from 'Store/ProductCompare/ProductCompare.action'; +import { GQLCustomer } from 'Type/Graphql.type'; import { deleteAuthorizationToken, getAuthorizationToken, @@ -38,6 +46,8 @@ import history from 'Util/History'; import { prepareQuery } from 'Util/Query'; import { executePost, fetchMutation, getErrorMessage } from 'Util/Request'; +import { UpdateCustomerPasswordForgotStatusAction, UpdateCustomerPasswordResetStatusAction } from './MyAccount.type'; + export const CartDispatcher = import( /* webpackMode: "lazy", webpackChunkName: "dispatchers" */ 'Store/Cart/Cart.dispatcher' @@ -68,12 +78,14 @@ export class MyAccountDispatcher { MY_ACCOUNT ]; - requestCustomerData(dispatch) { - const query = MyAccountQuery.getCustomerQuery(); + requestCustomerData(dispatch: Dispatch): Promise { + const query = MyAccountQuery.getCustomerQuery() as unknown as Query<'customer', GQLCustomer, false>; return executePost(prepareQuery([query])).then( /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/requestCustomerData/executePost/then */ - ({ customer }) => { + (data) => { + const { customer } = data as { customer: GQLCustomer }; + if (!getAuthorizationToken()) { return; } @@ -89,15 +101,15 @@ export class MyAccountDispatcher { if (category === GRAPHQL_AUTH) { dispatch(updateIsLocked(true)); } - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); } ); } - logout(authTokenExpired = false, isWithNotification = true, dispatch) { + logout(authTokenExpired: boolean, isWithNotification: boolean, dispatch: Dispatch): void { if (authTokenExpired) { if (isWithNotification) { - dispatch(showNotification('error', __('Your session is over, you are logged out!'))); + dispatch(showNotification(NotificationType.ERROR, __('Your session is over, you are logged out!'))); } this.handleForceRedirectToLoginPage(); @@ -108,7 +120,7 @@ export class MyAccountDispatcher { } if (isWithNotification) { - dispatch(showNotification('success', __('You are successfully logged out!'))); + dispatch(showNotification(NotificationType.SUCCESS, __('You are successfully logged out!'))); } } @@ -117,7 +129,7 @@ export class MyAccountDispatcher { removeUid(); dispatch(updateCustomerSignInStatus(false)); - dispatch(updateCustomerDetails({})); + dispatch(updateCustomerDetails({} as GQLCustomer)); // After logout cart, wishlist and compared product list is always empty. // There is no need to fetch it from the backend. @@ -132,7 +144,7 @@ export class MyAccountDispatcher { ); dispatch(clearComparedProducts()); - dispatch(updateCustomerDetails({})); + dispatch(updateCustomerDetails({} as GQLCustomer)); } /** @@ -141,14 +153,17 @@ export class MyAccountDispatcher { * @returns {Promise<{status: String}>} Reset password token * @memberof MyAccountDispatcher */ - forgotPassword(options = {}, dispatch) { + forgotPassword( + options: { email: string }, + dispatch: Dispatch + ): Promise> { const mutation = MyAccountQuery.getForgotPasswordMutation(options); return fetchMutation(mutation).then( /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/forgotPassword/fetchMutation/then/dispatch */ () => dispatch(updateCustomerPasswordForgotStatus()), /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/forgotPassword/fetchMutation/then/dispatch/catch */ - (error) => dispatch(showNotification('error', getErrorMessage(error))) + (error) => dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))) ); } @@ -158,12 +173,12 @@ export class MyAccountDispatcher { * @returns {Promise<{status: String}>} Reset password token * @memberof MyAccountDispatcher */ - resetPassword(options = {}, dispatch) { - const mutation = MyAccountQuery.getResetPasswordMutation(options); + resetPassword(options: ResetPasswordOptions, dispatch: Dispatch): Promise { + const mutation = MyAccountQuery.getResetPasswordMutation(options || {}); return fetchMutation(mutation).then( /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/resetPassword/fetchMutation/then/dispatch */ - ({ s_resetPassword: { status } }) => dispatch(updateCustomerPasswordResetStatus(status)), + ({ s_resetPassword: { status } }) => dispatch(updateCustomerPasswordResetStatus(status, '')), /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/resetPassword/fetchMutation/then/dispatch/catch */ (errors) => dispatch(updateCustomerPasswordResetStatus('error', getErrorMessage(errors))) ); @@ -174,33 +189,28 @@ export class MyAccountDispatcher { * @param {{customer: Object, password: String}} [options={}] * @memberof MyAccountDispatcher */ - createAccount(options = {}, dispatch) { - const { customer: { email }, password } = options; + async createAccount(options: CreateAccountOptions, dispatch: Dispatch): Promise { + const { customer: { email = '' }, password } = options || {}; const mutation = MyAccountQuery.getCreateAccountMutation(options); dispatch(updateIsLoading(true)); - return fetchMutation(mutation).then( - /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/createAccount/fetchMutation/then */ - (data) => { - const { createCustomer: { customer } } = data; - const { confirmation_required } = customer; + try { + const data = await fetchMutation(mutation); + const { createCustomer: { customer } } = data; + const { confirmation_required } = customer; - if (confirmation_required) { - dispatch(updateIsLoading(false)); - - return CONFIRMATION_REQUIRED; - } - - return this.signIn({ email, password }, dispatch); - }, - - /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/createAccount/fetchMutation/then/catch */ - (error) => { + if (confirmation_required) { dispatch(updateIsLoading(false)); - dispatch(showNotification('error', getErrorMessage(error))); - return false; + + return CONFIRMATION_REQUIRED; } - ); + + return await this.signIn({ email, password }, dispatch); + } catch (error) { + dispatch(updateIsLoading(false)); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); + return false; + } } /** @@ -208,16 +218,16 @@ export class MyAccountDispatcher { * @param {{key: String, email: String, password: String}} [options={}] * @memberof MyAccountDispatcher */ - confirmAccount(options = {}, dispatch) { + confirmAccount(options: ConfirmAccountOptions, dispatch: Dispatch): Promise> { const mutation = MyAccountQuery.getConfirmAccountMutation(options); return fetchMutation(mutation).then( /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/confirmAccount/fetchMutation/then/dispatch */ - () => dispatch(showNotification('success', __('Your account is confirmed!'))), + () => dispatch(showNotification(NotificationType.SUCCESS, __('Your account is confirmed!'))), /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/confirmAccount/fetchMutation/then/dispatch/catch */ (error) => dispatch( showNotification( - 'error', + NotificationType.ERROR, getErrorMessage(error, __('Something went wrong! Please, try again!')) ) ) @@ -229,8 +239,8 @@ export class MyAccountDispatcher { * @param {{email: String, password: String}} [options={}] * @memberof MyAccountDispatcher */ - async signIn(options = {}, dispatch) { - const mutation = MyAccountQuery.getSignInMutation(options); + async signIn(options: SignInOptions, dispatch: Dispatch): Promise { + const mutation = MyAccountQuery.getSignInMutation(options || {}); const result = await fetchMutation(mutation); const { generateCustomerToken: { token } } = result; @@ -242,9 +252,9 @@ export class MyAccountDispatcher { ); const cartDispatcher = (await CartDispatcher).default; - const guestCartToken = getGuestQuoteId(); + const guestCartToken = getGuestQuoteId() || ''; // if customer is authorized, `createEmptyCart` mutation returns customer cart token - const customerCartToken = await cartDispatcher.createGuestEmptyCart(dispatch); + const customerCartToken = await cartDispatcher.createGuestEmptyCart(dispatch) || ''; if (guestCartToken && guestCartToken !== customerCartToken) { // merge guest cart id and customer cart id using magento capabilities @@ -263,12 +273,12 @@ export class MyAccountDispatcher { dispatch(updateCustomerSignInStatus(true)); dispatch(updateIsLoading(false)); dispatch(hideActiveOverlay()); - dispatch(showNotification('success', __('You are successfully logged in!'))); + dispatch(showNotification(NotificationType.SUCCESS, __('You are successfully logged in!'))); return true; } - handleForceRedirectToLoginPage() { + handleForceRedirectToLoginPage(): void { const { location: { pathname = '' } = {} } = history; const doRedirect = this.forceLogoutRedirectPages.reduce((result, urlPart) => { if (pathname.includes(urlPart)) { @@ -283,7 +293,7 @@ export class MyAccountDispatcher { } } - handleCustomerDataOnInit(dispatch) { + handleCustomerDataOnInit(dispatch: Dispatch): void { if (isSignedIn()) { return; } diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts index 646b94b25b..f883febb0c 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.type.ts @@ -10,6 +10,8 @@ */ import { AnyAction } from 'redux'; +import { GQLCustomer } from 'Type/Graphql.type'; + export enum MyAccountActionType { UPDATE_CUSTOMER_SIGN_IN_STATUS = 'UPDATE_CUSTOMER_SIGN_IN_STATUS', UPDATE_CUSTOMER_DETAILS = 'UPDATE_CUSTOMER_DETAILS', @@ -27,12 +29,12 @@ export interface UpdateCustomerSignInStatusAction { export interface UpdateCustomerDetailsAction extends AnyAction { type: MyAccountActionType.UPDATE_CUSTOMER_DETAILS; - customer: Record; + customer: GQLCustomer; } export interface UpdateCustomerPasswordResetStatusAction extends AnyAction { type: MyAccountActionType.UPDATE_CUSTOMER_PASSWORD_RESET_STATUS; - status: boolean; + status: string; message: string; } diff --git a/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.js b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.ts similarity index 78% rename from packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.js rename to packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.ts index 5594560577..32b8f04530 100644 --- a/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.js +++ b/packages/scandipwa/src/store/NewsletterSubscription/NewsletterSubscription.dispatcher.ts @@ -9,8 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import NewsletterSubscriptionQuery from 'Query/NewsletterSubscription.query'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType, ShowNotificationAction } from 'Store/Notification/Notification.type'; import { fetchMutation, getErrorMessage } from 'Util/Request'; export const NOT_ACTIVE = 'NOT_ACTIVE'; @@ -21,7 +24,7 @@ export const NOT_ACTIVE = 'NOT_ACTIVE'; * @namespace Store/NewsletterSubscription/Dispatcher */ export class NewsletterSubscriptionDispatcher { - subscribeToNewsletter(dispatch, email) { + subscribeToNewsletter(dispatch: Dispatch, email: string): Promise> { return fetchMutation(NewsletterSubscriptionQuery.getSubscribeToNewsletterMutation(email)).then( /** @namespace Store/NewsletterSubscription/Dispatcher/NewsletterSubscriptionDispatcher/subscribeToNewsletter/fetchMutation/then */ ({ subscribeEmailToNewsletter: { status } }) => { @@ -30,10 +33,10 @@ export class NewsletterSubscriptionDispatcher { ? __('Confirmation request has been sent.') : __('Thank you for your subscription.'); - return dispatch(showNotification('success', message)); + return dispatch(showNotification(NotificationType.SUCCESS, message)); }, /** @namespace Store/NewsletterSubscription/Dispatcher/NewsletterSubscriptionDispatcher/subscribeToNewsletter/fetchMutation/then/dispatch/catch */ - (error) => dispatch(showNotification('error', getErrorMessage(error))) + (error) => dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))) ); } } diff --git a/packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.js b/packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.ts similarity index 84% rename from packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.js rename to packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.ts index 4aefff37cb..aa396a4a72 100644 --- a/packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.js +++ b/packages/scandipwa/src/store/NoMatch/NoMatch.dispatcher.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import { updateNoMatch } from 'Store/NoMatch/NoMatch.action'; /** * NoMatch Dispatcher @@ -16,7 +18,7 @@ import { updateNoMatch } from 'Store/NoMatch/NoMatch.action'; * @namespace Store/NoMatch/Dispatcher */ export class NoMatchDispatcher { - updateNoMatch(dispatch, options) { + updateNoMatch(dispatch: Dispatch, options: { noMatch: boolean }): void { const { noMatch } = options; dispatch(updateNoMatch(noMatch)); } diff --git a/packages/scandipwa/src/store/Order/Order.dispatcher.js b/packages/scandipwa/src/store/Order/Order.dispatcher.ts similarity index 61% rename from packages/scandipwa/src/store/Order/Order.dispatcher.js rename to packages/scandipwa/src/store/Order/Order.dispatcher.ts index 773b272ce1..c41f3e561b 100644 --- a/packages/scandipwa/src/store/Order/Order.dispatcher.js +++ b/packages/scandipwa/src/store/Order/Order.dispatcher.ts @@ -9,9 +9,14 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import OrderQuery from 'Query/Order.query'; +import { OrdersOptions } from 'Query/Query.type'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import { getOrderList, setLoadingStatus } from 'Store/Order/Order.action'; +import { GQLCheckoutUserInputError, GQLCustomerOrder, GQLReorderItemsOutput } from 'Type/Graphql.type'; import { getAuthorizationToken } from 'Util/Auth'; import history from 'Util/History'; import { fetchMutation, fetchQuery, getErrorMessage } from 'Util/Request'; @@ -24,8 +29,8 @@ export const CartDispatcher = import( /** @namespace Store/Order/Dispatcher */ export class OrderDispatcher { - requestOrders(dispatch, page = 1) { - const query = OrderQuery.getOrderListQuery({ page }); + requestOrders(dispatch: Dispatch, page = 1): Promise { + const query = OrderQuery.getOrderListQuery({ page } as OrdersOptions); dispatch(setLoadingStatus(true)); return fetchQuery(query).then( @@ -35,38 +40,46 @@ export class OrderDispatcher { }, /** @namespace Store/Order/Dispatcher/OrderDispatcher/requestOrders/fetchQuery/then/catch */ (error) => { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); dispatch(setLoadingStatus(false)); } ); } - async reorder(dispatch, incrementId) { + async reorder(dispatch: Dispatch, incrementId: string): Promise { const { reorderItems: { userInputErrors = [] } = {} - } = await this.handleReorderMutation(dispatch, incrementId); + } = await this.handleReorderMutation(dispatch, incrementId) || {}; const cartDispatcher = (await CartDispatcher).default; - cartDispatcher.updateInitialCartData(dispatch, getAuthorizationToken()); + cartDispatcher.updateInitialCartData(dispatch, !!getAuthorizationToken()); history.push(appendWithStoreCode('/cart')); if (userInputErrors.length) { - userInputErrors.map(({ message }) => dispatch(showNotification('error', message))); + userInputErrors.map(( + { message }: { message: string } + ) => dispatch(showNotification(NotificationType.ERROR, message))); } } - handleReorderMutation(dispatch, incrementId) { + handleReorderMutation( + dispatch: Dispatch, + incrementId: string + ): Promise> | null { try { return fetchMutation(OrderQuery.getReorder(incrementId)); } catch (error) { - return dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); + return null; } } - async getOrderById(dispatch, orderId) { + async getOrderById(dispatch: Dispatch, orderId: number): Promise { try { const { customer: { @@ -74,11 +87,11 @@ export class OrderDispatcher { items } } - } = await fetchQuery(OrderQuery.getOrderListQuery({ orderId })); + } = await fetchQuery(OrderQuery.getOrderListQuery({ orderId } as OrdersOptions)); return items[0]; } catch (error) { - dispatch(showNotification('error', getErrorMessage(error))); + dispatch(showNotification(NotificationType.ERROR, getErrorMessage(error))); return null; } diff --git a/packages/scandipwa/src/store/Product/Product.dispatcher.js b/packages/scandipwa/src/store/Product/Product.dispatcher.ts similarity index 62% rename from packages/scandipwa/src/store/Product/Product.dispatcher.js rename to packages/scandipwa/src/store/Product/Product.dispatcher.ts index edf6fc9fac..5b080897ae 100644 --- a/packages/scandipwa/src/store/Product/Product.dispatcher.js +++ b/packages/scandipwa/src/store/Product/Product.dispatcher.ts @@ -9,11 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; +import { Dispatch } from 'redux'; + import ProductListQuery from 'Query/ProductList.query'; +import { ProductListOptions } from 'Query/Query.type'; import { updateNoMatch } from 'Store/NoMatch/NoMatch.action'; import { updateProductDetails } from 'Store/Product/Product.action'; +import { GQLProductInterface, GQLProductLinksInterface } from 'Type/Graphql.type'; +import { Product, ProductBundle } from 'Type/ProductList.type'; import { QueryDispatcher } from 'Util/Request'; +import { ProductDispatcherData } from './Product.type'; + export const LinkedProductsDispatcher = import( /* webpackMode: "lazy", webpackChunkName: "dispatchers" */ 'Store/LinkedProducts/LinkedProducts.dispatcher' @@ -25,12 +33,12 @@ export const LinkedProductsDispatcher = import( * @extends ProductDispatcher * @namespace Store/Product/Dispatcher */ -export class ProductDispatcher extends QueryDispatcher { - __construct() { +export class ProductDispatcher extends QueryDispatcher { + __construct(): void { super.__construct('Product'); } - onSuccess(data, dispatch) { + onSuccess(data: ProductDispatcherData, dispatch: Dispatch): void { const { products: { items } } = data; /** @@ -45,17 +53,17 @@ export class ProductDispatcher extends QueryDispatcher { const [product] = items; - const product_links = items.reduce((links, product) => { + const product_links = (items as GQLProductInterface[]).reduce((links, product) => { const { product_links } = product; if (product_links) { - Object.values(product_links).forEach((item) => { + (Object.values(product_links) as GQLProductLinksInterface[]).forEach((item) => { links.push(item); }); } return links; - }, []); + }, [] as GQLProductLinksInterface[]); LinkedProductsDispatcher.then( ({ default: dispatcher }) => { @@ -67,15 +75,15 @@ export class ProductDispatcher extends QueryDispatcher { } ); - dispatch(updateProductDetails(product)); + dispatch(updateProductDetails(product as unknown as Product | ProductBundle)); } - onError(_, dispatch) { + onError(_: unknown, dispatch: Dispatch): void { dispatch(updateNoMatch(true)); } - prepareRequest(options) { - return ProductListQuery.getQuery(options); + prepareRequest(options: ProductListOptions): Query<'products', unknown, false> { + return ProductListQuery.getQuery(options) as Query<'products', unknown, false>; } } diff --git a/packages/scandipwa/src/store/Product/Product.type.ts b/packages/scandipwa/src/store/Product/Product.type.ts index 78b1058bd5..952f37cccc 100644 --- a/packages/scandipwa/src/store/Product/Product.type.ts +++ b/packages/scandipwa/src/store/Product/Product.type.ts @@ -11,6 +11,7 @@ import { AnyAction } from 'redux'; +import { GQLProducts } from 'Type/Graphql.type'; import { Product, ProductBundle } from 'Type/ProductList.type'; import { IndexedProduct } from 'Util/Product/Product'; @@ -26,3 +27,7 @@ export interface UpdateProductDetailsAction extends AnyAction { export type ProductStore = { product: IndexedProduct; }; + +export type ProductDispatcherData = { + products: GQLProducts; +}; diff --git a/packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.js b/packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.ts similarity index 68% rename from packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.js rename to packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.ts index f9069dfc74..449ef690dd 100644 --- a/packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.js +++ b/packages/scandipwa/src/store/ProductCompare/ProductCompare.dispatcher.ts @@ -9,8 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ +import { Dispatch } from 'redux'; + import ProductCompareQuery from 'Query/ProductCompare.query'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import { clearComparedProducts, setCompareList, @@ -18,6 +21,7 @@ import { toggleLoader, updateCompareTotals } from 'Store/ProductCompare/ProductCompare.action'; +import { GQLCompareList, GQLDeleteCompareListOutput } from 'Type/Graphql.type'; import { getAuthorizationToken } from 'Util/Auth'; import { getUid, removeUid, setUid } from 'Util/Compare'; import { fetchMutation, fetchQuery } from 'Util/Request'; @@ -29,8 +33,8 @@ export const CartDispatcher = import( /** @namespace Store/ProductCompare/Dispatcher */ export class ProductCompareDispatcher { - async getCompareList(dispatch) { - const uid = getUid(); + async getCompareList(dispatch: Dispatch): Promise { + const uid = getUid() || ''; if (!uid) { return false; @@ -47,7 +51,7 @@ export class ProductCompareDispatcher { dispatch(setCompareList(compareList)); } catch (error) { dispatch(toggleLoader(false)); - dispatch(showNotification('error', __('Unable to fetch compare list'), error)); + dispatch(showNotification(NotificationType.ERROR, __('Unable to fetch compare list'), error)); return false; } @@ -55,7 +59,7 @@ export class ProductCompareDispatcher { return true; } - async createCompareList(productId) { + async createCompareList(productId: string): Promise { const { createCompareList, createCompareList: { @@ -74,7 +78,7 @@ export class ProductCompareDispatcher { return createCompareList; } - async addToCompareList(uid, productId) { + async addToCompareList(uid: string, productId: string): Promise { const { addProductsToCompareList } = await fetchMutation( @@ -87,7 +91,7 @@ export class ProductCompareDispatcher { return addProductsToCompareList; } - async addProductToCompare(productId, dispatch) { + async addProductToCompare(productId: string, dispatch: Dispatch): Promise { const uid = getUid(); try { @@ -96,21 +100,21 @@ export class ProductCompareDispatcher { : await this.createCompareList(productId); dispatch(setCompareList(result)); - dispatch(showNotification('success', __('Product is added to the compare list'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Product is added to the compare list'))); return result; } catch (error) { - dispatch(showNotification('error', __('Unable to add product to the compare list'), error)); + dispatch(showNotification(NotificationType.ERROR, __('Unable to add product to the compare list'), error)); - return false; + return null; } } - async removeComparedProduct(productId, dispatch) { + async removeComparedProduct(productId: string, dispatch: Dispatch): Promise { const uid = getUid(); if (!uid) { - return false; + return null; } try { @@ -124,17 +128,21 @@ export class ProductCompareDispatcher { ); dispatch(setCompareList(removeProductsFromCompareList)); - dispatch(showNotification('success', __('Product is removed from the compare list'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Product is removed from the compare list'))); return removeProductsFromCompareList; } catch (error) { - dispatch(showNotification('error', __('Unable to remove product from the compare list'), error)); + dispatch(showNotification( + NotificationType.SUCCESS, + __('Unable to remove product from the compare list'), + error + )); - return false; + return null; } } - async fetchCustomersList(dispatch) { + async fetchCustomersList(dispatch: Dispatch): Promise { const { createCompareList, createCompareList: { @@ -155,7 +163,7 @@ export class ProductCompareDispatcher { dispatch(setCompareList(createCompareList)); } - async assignCompareList(dispatch) { + async assignCompareList(dispatch: Dispatch): Promise { const uid = getUid(); if (!uid) { @@ -172,8 +180,8 @@ export class ProductCompareDispatcher { result, compare_list, compare_list: { - uid: newUid - } + uid: newUid = '' + } = {} } } = await fetchMutation( ProductCompareQuery.getAssignCompareList(uid) @@ -185,7 +193,7 @@ export class ProductCompareDispatcher { if (result) { setUid(newUid); - dispatch(setCompareList(compare_list)); + dispatch(setCompareList(compare_list as GQLCompareList)); } return result; @@ -196,11 +204,13 @@ export class ProductCompareDispatcher { } } - async clearComparedProducts(dispatch) { + async clearComparedProducts( + dispatch: Dispatch + ): Promise | null> { const uid = getUid(); if (!uid) { - return false; + return null; } dispatch(toggleLoader(true)); @@ -212,19 +222,21 @@ export class ProductCompareDispatcher { removeUid(); dispatch(clearComparedProducts()); - dispatch(showNotification('success', __('Compare list is cleared'))); + dispatch(showNotification(NotificationType.SUCCESS, __('Compare list is cleared'))); dispatch(toggleLoader(false)); return result; } catch (error) { dispatch(toggleLoader(false)); - dispatch(showNotification('error', __('Unable to clear product compare list'), error)); + dispatch(showNotification(NotificationType.ERROR, __('Unable to clear product compare list'), error)); - return false; + return null; } } - async updateInitialProductCompareData(dispatch) { + async updateInitialProductCompareData( + dispatch: Dispatch + ): Promise | boolean> { const uid = getUid(); if (!uid) { @@ -238,14 +250,14 @@ export class ProductCompareDispatcher { ProductCompareQuery.getCompareListIds(uid) ); const { items = [] } = compareList || {}; - const compareIds = items.map(({ product: { id } }) => id); + const compareIds = items.map((data) => data?.product?.id) as number[]; dispatch(toggleLoader(false)); dispatch(setCompareListIds(compareIds)); dispatch(updateCompareTotals(compareIds.length)); } catch (error) { dispatch(toggleLoader(false)); - dispatch(showNotification('error', __('Unable to fetch compare list'), error)); + dispatch(showNotification(NotificationType.ERROR, __('Unable to fetch compare list'), error)); return false; } @@ -253,7 +265,7 @@ export class ProductCompareDispatcher { return true; } - resetComparedProducts(dispatch) { + resetComparedProducts(dispatch: Dispatch): void { dispatch(clearComparedProducts()); } } diff --git a/packages/scandipwa/src/type/ProductList.type.ts b/packages/scandipwa/src/type/ProductList.type.ts index d0188cdff4..eea851509d 100644 --- a/packages/scandipwa/src/type/ProductList.type.ts +++ b/packages/scandipwa/src/type/ProductList.type.ts @@ -13,6 +13,7 @@ import { StockStatus } from 'Component/Product/Stock.config'; import { MetaTitle } from 'Type/Common.type'; import { PriceRange } from 'Type/Price.type'; import { UrlRewrite } from 'Type/Router.type'; +import { IndexedProduct } from 'Util/Product/Product'; import { GQLBundleProduct, @@ -422,7 +423,7 @@ export enum LinkedProductType { } export type LinkedProducts = { - items: Product[]; + items: IndexedProduct[]; total_count: number; }; diff --git a/packages/scandipwa/src/util/Compare/Compare.ts b/packages/scandipwa/src/util/Compare/Compare.ts index 42a55d0cea..0940b2f030 100644 --- a/packages/scandipwa/src/util/Compare/Compare.ts +++ b/packages/scandipwa/src/util/Compare/Compare.ts @@ -35,13 +35,15 @@ export const ONE_DAY = 86400; * @returns {void} * @namespace Util/Compare/setUid */ -export const setUid = (uid: string | boolean): void => { +export const setUid = (uid: string | null): void => { const state = getStore().getState() as RootState; const { access_token_lifetime = ONE_HOUR } = state.ConfigReducer; - const uidExpirationTimeInStorage = isSignedIn() ? access_token_lifetime * ONE_HOUR_IN_SECONDS : ONE_DAY; + const uidExpirationTimeInStorage = isSignedIn() + ? parseInt(String(access_token_lifetime), 10) * ONE_HOUR_IN_SECONDS + : ONE_DAY; BrowserDatabase.setItem(uid, COMPARE_UID, uidExpirationTimeInStorage); }; @@ -51,10 +53,10 @@ export const setUid = (uid: string | boolean): void => { * @returns {string|boolean} uid * @namespace Util/Compare/getUid */ -export const getUid = (): string | boolean => { +export const getUid = (): string | null => { const uid = BrowserDatabase.getItem(COMPARE_UID); - return (typeof uid === 'string') ? uid : false; + return (typeof uid === 'string') ? uid : null; }; /** From 8ef4d65c38556e82a22845a2e46d2c642a29f762 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Mon, 11 Apr 2022 21:44:40 +0300 Subject: [PATCH 032/192] Migrated data container to TS --- packages/scandipwa/src/type/Global.type.ts | 2 +- .../{DataContainer.js => DataContainer.ts} | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) rename packages/scandipwa/src/util/Request/{DataContainer.js => DataContainer.ts} (70%) diff --git a/packages/scandipwa/src/type/Global.type.ts b/packages/scandipwa/src/type/Global.type.ts index b0217015d3..383e7d43eb 100644 --- a/packages/scandipwa/src/type/Global.type.ts +++ b/packages/scandipwa/src/type/Global.type.ts @@ -26,7 +26,7 @@ declare global { secure_base_media_url?: string; prefetchedImages: Record; storeList: Array; - // dataCache?: Record> + dataCache?: Record; } function __(message: string, ...args: unknown[]): string; diff --git a/packages/scandipwa/src/util/Request/DataContainer.js b/packages/scandipwa/src/util/Request/DataContainer.ts similarity index 70% rename from packages/scandipwa/src/util/Request/DataContainer.js rename to packages/scandipwa/src/util/Request/DataContainer.ts index cce8ed405b..492afaabd6 100644 --- a/packages/scandipwa/src/util/Request/DataContainer.js +++ b/packages/scandipwa/src/util/Request/DataContainer.ts @@ -9,10 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ +import { Query } from '@tilework/opus'; import { PureComponent } from 'react'; import { noopFn } from 'Util/Common'; import { makeCancelable } from 'Util/Promise'; +import { CancelablePromise } from 'Util/Promise/Promise.type'; import { prepareQuery } from 'Util/Query'; import { executeGet, listenForBroadCast } from 'Util/Request'; import { hash } from 'Util/Request/Hash'; @@ -21,21 +23,42 @@ import { ONE_MONTH_IN_SECONDS } from './QueryDispatcher'; /** @namespace Util/Request/DataContainer */ export class DataContainer extends PureComponent { - __construct(props, dataModelName, isShouldListenForBroadcast = true, cacheTTL = ONE_MONTH_IN_SECONDS) { - super.__construct(props); + protected dataModelName = ''; + + protected isShouldListenForBroadcast = true; + + protected cacheTTL = ONE_MONTH_IN_SECONDS; + + protected promise?: CancelablePromise; + + __construct( + props: Record, + dataModelName = '', + isShouldListenForBroadcast = true, + cacheTTL = ONE_MONTH_IN_SECONDS + ): void { + if (super.__construct) { + super.__construct(props); + } + this.dataModelName = dataModelName; this.isShouldListenForBroadcast = isShouldListenForBroadcast; this.cacheTTL = cacheTTL; - this.promise = null; + this.promise = undefined; } - componentWillUnmount() { + componentWillUnmount(): void { if (this.promise) { this.promise.cancel(); } } - fetchData(rawQueries, onSuccess = noopFn, onError = noopFn, takeFromWindowCache = true) { + fetchData( + rawQueries: Query[], + onSuccess: (x: unknown) => void = noopFn, + onError: (x: unknown) => void = noopFn, + takeFromWindowCache = true + ): void { const preparedQuery = prepareQuery(rawQueries); const { query, variables } = preparedQuery; const queryHash = hash(query + JSON.stringify(variables)); @@ -57,7 +80,7 @@ export class DataContainer extends PureComponent { this.promise.promise.then( /** @namespace Util/Request/DataContainer/DataContainer/fetchData/then */ (response) => { - window.dataCache[queryHash] = response; + (window.dataCache || {})[queryHash] = response; onSuccess(response); }, /** @namespace Util/Request/DataContainer/DataContainer/fetchData/then/onError/catch */ From ec2ff6ac12f742c7f2857ecd75dc43aabf83f63f Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Wed, 13 Apr 2022 03:15:32 +0300 Subject: [PATCH 033/192] Migrated some components --- packages/scandipwa/package.json | 3 +- ...con.component.js => AddIcon.component.tsx} | 11 +- .../AddIcon.type.ts} | 7 +- .../component/AddIcon/{index.js => index.ts} | 0 .../AddToCart/{index.js => index.ts} | 0 .../src/component/App/{index.js => index.ts} | 0 .../Breadcrumb/{index.js => index.ts} | 0 .../Breadcrumbs/{index.js => index.ts} | 0 ...oll.config.js => CarouselScroll.config.ts} | 0 .../CarouselScroll/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../CarouselScrollItem/{index.js => index.ts} | 0 .../CartCoupon/{index.js => index.ts} | 0 ...on.component.js => CartIcon.component.tsx} | 11 +- .../src/component/CartIcon/CartIcon.type.ts | 14 ++ .../component/CartIcon/{index.js => index.ts} | 0 .../component/CartItem/{index.js => index.ts} | 0 .../CartItemPrice/{index.js => index.ts} | 0 .../CartOverlay/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../CategoryDetails/{index.js => index.ts} | 0 ...fig.js => CategoryFilterOverlay.config.ts} | 2 - .../{index.js => index.ts} | 0 .../CategoryItemsCount/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../CategorySort/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...onfig.js => CheckoutAddressForm.config.ts} | 2 - .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../CheckoutBilling/{index.js => index.ts} | 0 ...ig.js => CheckoutDeliveryOption.config.ts} | 4 - .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ....config.js => CheckoutGuestForm.config.ts} | 2 - .../CheckoutGuestForm/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../CheckoutPayment/{index.js => index.ts} | 0 .../CheckoutPayments.config.js | 16 -- .../CheckoutPayments.config.ts | 18 ++ .../CheckoutPayments/{index.js => index.ts} | 0 .../CheckoutShipping/{index.js => index.ts} | 0 .../CheckoutSuccess/{index.js => index.ts} | 0 ...CheckoutTermsAndConditionsPopup.config.ts} | 2 - .../{index.js => index.ts} | 0 ...component.js => ChevronIcon.component.tsx} | 15 +- .../ChevronIcon/ChevronIcon.config.ts | 6 - .../component/ChevronIcon/ChevronIcon.type.ts | 16 ++ .../ChevronIcon/{index.js => index.ts} | 0 .../ClickOutside/{index.js => index.ts} | 0 ...n.component.js => CloseIcon.component.tsx} | 2 +- .../CloseIcon/{index.js => index.ts} | 0 .../component/CmsBlock/{index.js => index.ts} | 0 ...component.js => CompareIcon.component.tsx} | 11 +- .../component/CompareIcon/CompareIcon.type.ts | 14 ++ .../CompareIcon/{index.js => index.ts} | 0 .../ContactForm/{index.js => index.ts} | 0 .../ContentWrapper/{index.js => index.ts} | 0 ...ePopup.config.js => CookiePopup.config.ts} | 2 - .../CookiePopup/{index.js => index.ts} | 0 .../CurrencySwitcher/{index.js => index.ts} | 0 .../DatePicker/{index.js => index.ts} | 0 ...eSelect.config.js => DateSelect.config.ts} | 16 +- .../DateSelect/{index.js => index.ts} | 0 .../DemoNotice/{index.js => index.ts} | 0 .../Draggable/{index.js => index.ts} | 0 ...on.component.js => EditIcon.component.tsx} | 2 +- .../component/EditIcon/{index.js => index.ts} | 0 ...t.js => ExclamationMarkIcon.component.tsx} | 2 +- .../{index.js => index.ts} | 0 .../ExpandableContent/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../src/component/Field/Field.config.js | 32 --- .../src/component/Field/Field.config.ts | 30 +++ .../src/component/Field/Keyboard.config.js | 31 --- .../src/component/Field/Keyboard.config.ts | 30 +++ .../component/Field/{index.js => index.ts} | 0 ...ieldDate.config.js => FieldDate.config.ts} | 18 +- .../FieldDate/{index.js => index.ts} | 0 .../FieldFile/{index.js => index.ts} | 0 .../FieldForm/{index.js => index.ts} | 0 .../FieldGroup/{index.js => index.ts} | 0 .../FieldNumber/{index.js => index.ts} | 0 ...Select.config.js => FieldSelect.config.ts} | 0 .../FieldSelect/{index.js => index.ts} | 0 ....component.js => FilterIcon.component.tsx} | 2 +- .../FilterIcon/{index.js => index.ts} | 0 .../{Footer.config.js => Footer.config.ts} | 1 - .../component/Footer/{index.js => index.ts} | 0 .../src/component/Form/{index.js => index.ts} | 0 ...on.component.js => GridIcon.component.tsx} | 11 +- .../src/component/GridIcon/GridIcon.type.ts | 14 ++ .../component/GridIcon/{index.js => index.ts} | 0 .../GroupedProductList/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../src/component/Header/Header.config.js | 35 --- .../src/component/Header/Header.config.ts | 37 ++++ .../component/Header/{index.js => index.ts} | 0 ...n.component.js => HeartIcon.component.tsx} | 11 +- .../src/component/HeartIcon/HeartIcon.type.ts | 14 ++ .../HeartIcon/{index.js => index.ts} | 0 ...on.component.js => HomeIcon.component.tsx} | 11 +- .../src/component/HomeIcon/HomeIcon.type.ts | 14 ++ .../component/HomeIcon/{index.js => index.ts} | 0 .../src/component/Html/{index.js => index.ts} | 0 .../{Image.config.js => Image.config.ts} | 11 +- .../component/Image/{index.js => index.ts} | 0 .../ImageZoomPopup/{index.js => index.ts} | 0 .../InstallPrompt/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../InstallPromptIOS/{index.js => index.ts} | 0 .../KeyValueTable/{index.js => index.ts} | 0 .../{Klarna.config.js => Klarna.config.ts} | 2 - .../component/Klarna/{index.js => index.ts} | 0 .../src/component/Link/{index.js => index.ts} | 0 ...on.component.js => ListIcon.component.tsx} | 11 +- .../src/component/ListIcon/ListIcon.type.ts | 14 ++ .../component/ListIcon/{index.js => index.ts} | 0 .../component/Loader/{index.js => index.ts} | 0 ...on.component.js => LockIcon.component.tsx} | 2 +- .../component/LockIcon/{index.js => index.ts} | 0 .../src/component/Logo/{index.js => index.ts} | 0 .../Menu/{Menu.config.js => Menu.config.ts} | 2 - .../src/component/Menu/{index.js => index.ts} | 0 ...on.component.js => MenuIcon.component.tsx} | 11 +- .../src/component/MenuIcon/MenuIcon.type.ts | 14 ++ .../component/MenuIcon/{index.js => index.ts} | 0 ...{MenuItem.config.js => MenuItem.config.ts} | 1 - .../component/MenuItem/{index.js => index.ts} | 0 .../src/component/Meta/{index.js => index.ts} | 0 ...n.component.js => MinusIcon.component.tsx} | 11 +- .../src/component/MinusIcon/MinusIcon.type.ts | 14 ++ .../MinusIcon/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...nfig.js => MyAccountAddressForm.config.ts} | 1 - .../{index.js => index.ts} | 0 ...fig.js => MyAccountAddressPopup.config.ts} | 2 - .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...ig.js => MyAccountCreateAccount.config.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../MyAccountDashboard/{index.js => index.ts} | 0 ...fig.js => MyAccountDownloadable.config.ts} | 2 - .../{index.js => index.ts} | 0 ...> MyAccountDownloadableTableRow.config.ts} | 2 - .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../MyAccountMyOrders/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../MyAccountOrder/MyAccountOrder.config.js | 17 -- .../MyAccountOrder/MyAccountOrder.config.ts | 17 ++ .../MyAccountOrder/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../MyAccountOrderItemsTableRow.component.js | 182 ++++++++-------- ... => MyAccountOrderItemsTableRow.config.ts} | 3 +- .../{index.js => index.ts} | 0 .../MyAccountOrderTab/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../MyAccountOrderTabs/{index.js => index.ts} | 0 ...nfig.js => MyAccountOrderTotals.config.ts} | 7 +- .../{index.js => index.ts} | 0 .../MyAccountOverlay.config.js | 21 -- .../MyAccountOverlay.config.ts | 21 ++ .../MyAccountOverlay/{index.js => index.ts} | 0 .../MyAccountSignIn/{index.js => index.ts} | 0 .../MyAccountTabList/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...config.js => NavigationAbstract.config.ts} | 2 - .../NavigationAbstract/{index.js => index.ts} | 0 .../NavigationTabs/NavigationTabs.config.js | 18 -- .../NavigationTabs/NavigationTabs.config.ts | 18 ++ .../NavigationTabs/{index.js => index.ts} | 0 .../NewProducts/{index.js => index.ts} | 0 ...up.config.js => NewVersionPopup.config.ts} | 2 - .../NewVersionPopup/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...ation.config.js => Notification.config.ts} | 4 +- .../Notification/{index.js => index.ts} | 0 .../NotificationList/{index.js => index.ts} | 0 .../OfflineNotice/{index.js => index.ts} | 0 .../component/Overlay/{index.js => index.ts} | 0 ...ination.config.js => Pagination.config.ts} | 2 - .../Pagination/{index.js => index.ts} | 0 .../PaginationLink/{index.js => index.ts} | 0 .../PasswordChangeForm/{index.js => index.ts} | 0 .../src/component/Popup/Popup.config.ts | 14 ++ .../component/Popup/{index.js => index.ts} | 0 ...ense.config.js => PopupSuspense.config.ts} | 2 - .../PopupSuspense/{index.js => index.ts} | 0 .../src/component/Product/Product.config.js | 21 -- .../src/component/Product/Product.config.ts | 19 ++ .../src/component/Product/Stock.config.ts | 7 - .../ProductActions.component.js | 200 +++++++++--------- ...ons.config.js => ProductActions.config.ts} | 2 - .../ProductActions.container.js | 10 +- .../ProductActions/{index.js => index.ts} | 0 .../ProductAlerts/ProductAlerts.component.js | 28 +-- .../ProductAlerts/ProductAlerts.config.js | 15 -- .../ProductAlerts/ProductAlerts.config.ts | 15 ++ .../ProductAlerts/{index.js => index.ts} | 0 ...fig.js => ProductAttributeValue.config.ts} | 2 - .../{index.js => index.ts} | 0 .../ProductAttributes/{index.js => index.ts} | 0 ...onfig.js => ProductBundleOption.config.ts} | 2 - .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../ProductCard/ProductCard.config.js | 19 -- .../ProductCard/{index.js => index.ts} | 0 ...are.config.js => ProductCompare.config.ts} | 0 .../ProductCompare/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...config.js => ProductCompareItem.config.ts} | 0 .../ProductCompareItem/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ...> ProductConfigurableAttributes.config.ts} | 0 ...ProductConfigurableAttributes.container.js | 22 +- .../{index.js => index.ts} | 0 ...js => ProductCustomizableOption.config.ts} | 26 ++- .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../ProductGallery/ProductGallery.config.ts | 26 +-- .../ProductGallery/{index.js => index.ts} | 0 ...g.js => ProductGalleryBaseImage.config.ts} | 0 .../{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 .../ProductInformation/{index.js => index.ts} | 0 .../ProductLinks/{index.js => index.ts} | 0 .../ProductList/ProductList.component.js | 78 +++---- ...ctList.config.js => ProductList.config.ts} | 2 +- .../ProductList/{index.js => index.ts} | 0 ...ge.config.js => ProductListPage.config.ts} | 1 - .../ProductListPage/{index.js => index.ts} | 0 .../ProductListWidget/{index.js => index.ts} | 0 .../ProductPrice/ProductPrice.config.js | 14 -- .../ProductPrice/ProductPrice.config.ts | 16 ++ .../ProductPrice/{index.js => index.ts} | 0 .../ProductReviewForm/{index.js => index.ts} | 0 .../ProductReviewItem/{index.js => index.ts} | 0 .../ProductReviewList/{index.js => index.ts} | 0 ...onfig.js => ProductReviewRating.config.ts} | 0 .../{index.js => index.ts} | 0 ...ews.config.js => ProductReviews.config.ts} | 2 - .../ProductReviews/{index.js => index.ts} | 0 .../ProductTab/{index.js => index.ts} | 0 .../ProductTabs/{index.js => index.ts} | 0 ...fig.js => ProductWishlistButton.config.ts} | 1 - .../{index.js => index.ts} | 0 .../PurchaseOrder/{index.js => index.ts} | 0 ...onent.js => RadioButtonIcon.component.tsx} | 11 +- .../RadioButtonIcon/RadioButtonIcon.type.ts | 14 ++ .../RadioButtonIcon/{index.js => index.ts} | 0 ...nfig.js => RecentlyViewedWidget.config.ts} | 0 .../{index.js => index.ts} | 0 .../RenderWhenVisible/{index.js => index.ts} | 0 .../ResetAttributes/{index.js => index.ts} | 0 .../ResetButton/{index.js => index.ts} | 0 .../ReviewStar/{index.js => index.ts} | 0 .../src/component/Router/Router.config.js | 51 ----- .../src/component/Router/Router.config.ts | 57 +++++ .../component/Router/{index.js => index.ts} | 0 .../SearchField/{index.js => index.ts} | 0 ....component.js => SearchIcon.component.tsx} | 2 +- .../SearchIcon/{index.js => index.ts} | 0 .../SearchItem/{index.js => index.ts} | 0 ...rlay.config.js => SearchOverlay.config.ts} | 0 .../SearchOverlay/{index.js => index.ts} | 0 ...n.component.js => ShareIcon.component.tsx} | 11 +- .../src/component/ShareIcon/ShareIcon.type.ts | 14 ++ .../ShareIcon/{index.js => index.ts} | 0 .../ShareWishlistForm/{index.js => index.ts} | 0 ...config.js => ShareWishlistPopup.config.ts} | 2 - .../ShareWishlistPopup/{index.js => index.ts} | 0 ...n.config.js => SharedTransition.config.ts} | 1 - .../SharedTransition/{index.js => index.ts} | 0 .../SharedWishlistItem/{index.js => index.ts} | 0 .../{Slider.config.js => Slider.config.ts} | 0 .../component/Slider/{index.js => index.ts} | 0 .../SliderWidget/{index.js => index.ts} | 0 ...on.component.js => StarIcon.component.tsx} | 20 +- .../src/component/StarIcon/StarIcon.config.js | 13 -- .../StarIcon.config.ts} | 8 +- .../src/component/StarIcon/StarIcon.type.ts | 16 ++ .../component/StarIcon/{index.js => index.ts} | 0 ...ckUp.config.js => StoreInPickUp.config.ts} | 8 +- .../StoreInPickUp/{index.js => index.ts} | 0 ...config.js => StoreInPickUpPopup.config.ts} | 0 .../StoreInPickUpPopup/{index.js => index.ts} | 0 .../StoreInPickUpStore/{index.js => index.ts} | 0 .../StoreItem/{index.js => index.ts} | 0 ...cher.config.js => StoreSwitcher.config.ts} | 1 - .../StoreSwitcher/{index.js => index.ts} | 0 ...lete.config.js => SwipeToDelete.config.ts} | 0 .../SwipeToDelete/{index.js => index.ts} | 0 .../TextPlaceholder/{index.js => index.ts} | 0 .../TierPrices/{index.js => index.ts} | 0 .../{index.js => index.ts} | 0 ....component.js => UploadIcon.component.tsx} | 2 +- .../UploadIcon/{index.js => index.ts} | 0 ...on.component.js => UserIcon.component.tsx} | 11 +- .../src/component/UserIcon/UserIcon.type.ts | 14 ++ .../component/UserIcon/{index.js => index.ts} | 0 ...eoPopup.config.js => VideoPopup.config.ts} | 2 - .../VideoPopup/{index.js => index.ts} | 0 .../VideoThumbnail/{index.js => index.ts} | 0 .../WidgetFactory/WidgetFactory.config.js | 17 -- .../WidgetFactory/WidgetFactory.config.ts | 17 ++ .../WidgetFactory/{index.js => index.ts} | 0 ...tItem.config.js => WishlistItem.config.ts} | 1 - .../WishlistItem/{index.js => index.ts} | 0 .../scandipwa/src/{index.js => index.tsx} | 0 .../scandipwa/src/query/ProductList.query.ts | 4 +- .../src/route/CartPage/{index.js => index.ts} | 0 .../route/CategoryPage/CategoryPage.config.ts | 25 +-- .../CategoryPage/CategoryPage.container.js | 28 +-- .../route/CategoryPage/{index.js => index.ts} | 0 .../src/route/Checkout/Checkout.config.ts | 13 +- .../src/route/Checkout/{index.js => index.ts} | 0 .../{CmsPage.config.js => CmsPage.config.ts} | 1 - .../src/route/CmsPage/{index.js => index.ts} | 0 .../ConfirmAccountPage/{index.js => index.ts} | 0 ...ctPage.config.js => ContactPage.config.ts} | 1 - .../route/ContactPage/{index.js => index.ts} | 0 .../CreateAccount/{index.js => index.ts} | 0 .../ForgotPassword/{index.js => index.ts} | 0 .../src/route/HomePage/{index.js => index.ts} | 0 .../route/LoginAccount/{index.js => index.ts} | 0 .../src/route/MenuPage/{index.js => index.ts} | 0 .../src/route/MyAccount/MyAccount.config.js | 23 -- .../src/route/MyAccount/MyAccount.config.ts | 24 +++ .../route/MyAccount/{index.js => index.ts} | 0 .../src/route/NoMatch/{index.js => index.ts} | 0 .../NoMatchHandler/{index.js => index.ts} | 0 .../PasswordChangePage.config.js | 13 -- .../PasswordChangePage.config.ts | 15 ++ .../PasswordChangePage/{index.js => index.ts} | 0 .../ProductComparePage/{index.js => index.ts} | 0 .../route/ProductPage/ProductPage.config.js | 15 -- .../route/ProductPage/ProductPage.config.ts | 16 ++ .../route/ProductPage/{index.js => index.ts} | 0 ...rchPage.config.js => SearchPage.config.ts} | 1 - .../route/SearchPage/SearchPage.container.js | 18 +- .../route/SearchPage/{index.js => index.ts} | 0 .../SomethingWentWrong/{index.js => index.ts} | 0 ...age.config.js => StyleGuidePage.config.ts} | 7 +- .../StyleGuidePage/{index.js => index.ts} | 0 .../route/UrlRewrites/UrlRewrites.config.js | 15 -- .../route/UrlRewrites/UrlRewrites.config.ts | 17 ++ .../route/UrlRewrites/{index.js => index.ts} | 0 .../WishlistSharedPage/{index.js => index.ts} | 0 .../store/MyAccount/MyAccount.dispatcher.ts | 2 +- packages/scandipwa/src/store/index.ts | 31 ++- packages/scandipwa/src/type/Direction.type.js | 6 +- .../scandipwa/src/type/StockStatus.type.js | 4 +- .../src/util/Address/Address.type.ts | 6 +- packages/scandipwa/src/util/Address/index.ts | 4 +- .../src/util/Polyfill/{index.js => index.ts} | 0 .../scandipwa/src/util/Price/Price.config.ts | 2 +- packages/scandipwa/src/util/Price/Price.ts | 4 +- .../scandipwa/src/util/Product/Extract.ts | 26 ++- .../scandipwa/src/util/Product/Product.ts | 7 +- .../scandipwa/src/util/Store/Store.type.ts | 8 +- 373 files changed, 1075 insertions(+), 981 deletions(-) rename packages/scandipwa/src/component/AddIcon/{AddIcon.component.js => AddIcon.component.tsx} (85%) rename packages/scandipwa/src/component/{SliderWidget/SliderWidget.config.js => AddIcon/AddIcon.type.ts} (65%) rename packages/scandipwa/src/component/AddIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/AddToCart/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/App/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Breadcrumb/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Breadcrumbs/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CarouselScroll/{CarouselScroll.config.js => CarouselScroll.config.ts} (100%) rename packages/scandipwa/src/component/CarouselScroll/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CarouselScrollArrow/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CarouselScrollItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CartCoupon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CartIcon/{CartIcon.component.js => CartIcon.component.tsx} (91%) create mode 100644 packages/scandipwa/src/component/CartIcon/CartIcon.type.ts rename packages/scandipwa/src/component/CartIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CartItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CartItemPrice/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CartOverlay/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategoryConfigurableAttributes/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategoryDetails/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategoryFilterOverlay/{CategoryFilterOverlay.config.js => CategoryFilterOverlay.config.ts} (88%) rename packages/scandipwa/src/component/CategoryFilterOverlay/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategoryItemsCount/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategoryProductList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CategorySort/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutAddressBook/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutAddressForm/{CheckoutAddressForm.config.js => CheckoutAddressForm.config.ts} (87%) rename packages/scandipwa/src/component/CheckoutAddressForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutAddressTable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutBilling/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutDeliveryOption/{CheckoutDeliveryOption.config.js => CheckoutDeliveryOption.config.ts} (67%) rename packages/scandipwa/src/component/CheckoutDeliveryOption/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutDeliveryOptions/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutGuestForm/{CheckoutGuestForm.config.js => CheckoutGuestForm.config.ts} (88%) rename packages/scandipwa/src/component/CheckoutGuestForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutOrderSummary/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutPayment/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.js create mode 100644 packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.ts rename packages/scandipwa/src/component/CheckoutPayments/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutShipping/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutSuccess/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/{CheckoutTermsAndConditionsPopup.config.js => CheckoutTermsAndConditionsPopup.config.ts} (87%) rename packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ChevronIcon/{ChevronIcon.component.js => ChevronIcon.component.tsx} (79%) create mode 100644 packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts rename packages/scandipwa/src/component/ChevronIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ClickOutside/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CloseIcon/{CloseIcon.component.js => CloseIcon.component.tsx} (97%) rename packages/scandipwa/src/component/CloseIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CmsBlock/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CompareIcon/{CompareIcon.component.js => CompareIcon.component.tsx} (91%) create mode 100644 packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts rename packages/scandipwa/src/component/CompareIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ContactForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ContentWrapper/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CookiePopup/{CookiePopup.config.js => CookiePopup.config.ts} (86%) rename packages/scandipwa/src/component/CookiePopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/CurrencySwitcher/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/DatePicker/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/DateSelect/{DateSelect.config.js => DateSelect.config.ts} (73%) rename packages/scandipwa/src/component/DateSelect/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/DemoNotice/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Draggable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/EditIcon/{EditIcon.component.js => EditIcon.component.tsx} (97%) rename packages/scandipwa/src/component/EditIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ExclamationMarkIcon/{ExclamationMarkIcon.component.js => ExclamationMarkIcon.component.tsx} (97%) rename packages/scandipwa/src/component/ExclamationMarkIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ExpandableContent/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ExpandableContentShowMore/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/Field/Field.config.js create mode 100644 packages/scandipwa/src/component/Field/Field.config.ts delete mode 100644 packages/scandipwa/src/component/Field/Keyboard.config.js create mode 100644 packages/scandipwa/src/component/Field/Keyboard.config.ts rename packages/scandipwa/src/component/Field/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldDate/{FieldDate.config.js => FieldDate.config.ts} (67%) rename packages/scandipwa/src/component/FieldDate/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldFile/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldGroup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldNumber/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FieldSelect/{FieldSelect.config.js => FieldSelect.config.ts} (100%) rename packages/scandipwa/src/component/FieldSelect/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/FilterIcon/{FilterIcon.component.js => FilterIcon.component.tsx} (97%) rename packages/scandipwa/src/component/FilterIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Footer/{Footer.config.js => Footer.config.ts} (97%) rename packages/scandipwa/src/component/Footer/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Form/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/GridIcon/{GridIcon.component.js => GridIcon.component.tsx} (89%) create mode 100644 packages/scandipwa/src/component/GridIcon/GridIcon.type.ts rename packages/scandipwa/src/component/GridIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/GroupedProductList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/GroupedProductsItem/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/Header/Header.config.js create mode 100644 packages/scandipwa/src/component/Header/Header.config.ts rename packages/scandipwa/src/component/Header/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/HeartIcon/{HeartIcon.component.js => HeartIcon.component.tsx} (90%) create mode 100644 packages/scandipwa/src/component/HeartIcon/HeartIcon.type.ts rename packages/scandipwa/src/component/HeartIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/HomeIcon/{HomeIcon.component.js => HomeIcon.component.tsx} (89%) create mode 100644 packages/scandipwa/src/component/HomeIcon/HomeIcon.type.ts rename packages/scandipwa/src/component/HomeIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Html/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Image/{Image.config.js => Image.config.ts} (62%) rename packages/scandipwa/src/component/Image/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ImageZoomPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/InstallPrompt/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/InstallPromptAndroid/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/InstallPromptIOS/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/KeyValueTable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Klarna/{Klarna.config.js => Klarna.config.ts} (90%) rename packages/scandipwa/src/component/Klarna/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Link/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ListIcon/{ListIcon.component.js => ListIcon.component.tsx} (87%) create mode 100644 packages/scandipwa/src/component/ListIcon/ListIcon.type.ts rename packages/scandipwa/src/component/ListIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Loader/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/LockIcon/{LockIcon.component.js => LockIcon.component.tsx} (97%) rename packages/scandipwa/src/component/LockIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Logo/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Menu/{Menu.config.js => Menu.config.ts} (88%) rename packages/scandipwa/src/component/Menu/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MenuIcon/{MenuIcon.component.js => MenuIcon.component.tsx} (90%) create mode 100644 packages/scandipwa/src/component/MenuIcon/MenuIcon.type.ts rename packages/scandipwa/src/component/MenuIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MenuItem/{MenuItem.config.js => MenuItem.config.ts} (86%) rename packages/scandipwa/src/component/MenuItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Meta/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MinusIcon/{MinusIcon.component.js => MinusIcon.component.tsx} (84%) create mode 100644 packages/scandipwa/src/component/MinusIcon/MinusIcon.type.ts rename packages/scandipwa/src/component/MinusIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountAddressBook/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountAddressForm/{MyAccountAddressForm.config.js => MyAccountAddressForm.config.ts} (87%) rename packages/scandipwa/src/component/MyAccountAddressForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountAddressPopup/{MyAccountAddressPopup.config.js => MyAccountAddressPopup.config.ts} (90%) rename packages/scandipwa/src/component/MyAccountAddressPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountAddressTable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountConfirmEmail/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountCreateAccount/{MyAccountCreateAccount.config.js => MyAccountCreateAccount.config.ts} (100%) rename packages/scandipwa/src/component/MyAccountCreateAccount/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountCustomerForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountCustomerTable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountDashboard/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountDownloadable/{MyAccountDownloadable.config.js => MyAccountDownloadable.config.ts} (85%) rename packages/scandipwa/src/component/MyAccountDownloadable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountDownloadableTableRow/{MyAccountDownloadableTableRow.config.js => MyAccountDownloadableTableRow.config.ts} (86%) rename packages/scandipwa/src/component/MyAccountDownloadableTableRow/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountForgotPassword/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountInformation/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountMyOrders/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountMyWishlist/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountNewsletterSubscription/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.js create mode 100644 packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.ts rename packages/scandipwa/src/component/MyAccountOrder/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderInformation/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderItemsTable/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderItemsTableRow/{MyAccountOrderItemsTableRow.config.js => MyAccountOrderItemsTableRow.config.ts} (85%) rename packages/scandipwa/src/component/MyAccountOrderItemsTableRow/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderTab/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderTableRow/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderTabs/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountOrderTotals/{MyAccountOrderTotals.config.js => MyAccountOrderTotals.config.ts} (74%) rename packages/scandipwa/src/component/MyAccountOrderTotals/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.js create mode 100644 packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.ts rename packages/scandipwa/src/component/MyAccountOverlay/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountSignIn/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountTabList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/MyAccountTabListItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NavigationAbstract/{NavigationAbstract.config.js => NavigationAbstract.config.ts} (86%) rename packages/scandipwa/src/component/NavigationAbstract/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.js create mode 100644 packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.ts rename packages/scandipwa/src/component/NavigationTabs/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NewProducts/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NewVersionPopup/{NewVersionPopup.config.js => NewVersionPopup.config.ts} (87%) rename packages/scandipwa/src/component/NewVersionPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NewsletterSubscription/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NotSupportedPayment/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Notification/{Notification.config.js => Notification.config.ts} (78%) rename packages/scandipwa/src/component/Notification/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/NotificationList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/OfflineNotice/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Overlay/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Pagination/{Pagination.config.js => Pagination.config.ts} (86%) rename packages/scandipwa/src/component/Pagination/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/PaginationLink/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/PasswordChangeForm/{index.js => index.ts} (100%) create mode 100644 packages/scandipwa/src/component/Popup/Popup.config.ts rename packages/scandipwa/src/component/Popup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/PopupSuspense/{PopupSuspense.config.js => PopupSuspense.config.ts} (87%) rename packages/scandipwa/src/component/PopupSuspense/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/Product/Product.config.js create mode 100644 packages/scandipwa/src/component/Product/Product.config.ts rename packages/scandipwa/src/component/ProductActions/{ProductActions.config.js => ProductActions.config.ts} (87%) rename packages/scandipwa/src/component/ProductActions/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.js create mode 100644 packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.ts rename packages/scandipwa/src/component/ProductAlerts/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductAttributeValue/{ProductAttributeValue.config.js => ProductAttributeValue.config.ts} (87%) rename packages/scandipwa/src/component/ProductAttributeValue/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductAttributes/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductBundleOption/{ProductBundleOption.config.js => ProductBundleOption.config.ts} (90%) rename packages/scandipwa/src/component/ProductBundleOption/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductBundleOptions/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/ProductCard/ProductCard.config.js rename packages/scandipwa/src/component/ProductCard/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCompare/{ProductCompare.config.js => ProductCompare.config.ts} (100%) rename packages/scandipwa/src/component/ProductCompare/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCompareAttributeRow/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCompareButton/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCompareItem/{ProductCompareItem.config.js => ProductCompareItem.config.ts} (100%) rename packages/scandipwa/src/component/ProductCompareItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductConfigurableAttributes/{ProductConfigurableAttributes.config.js => ProductConfigurableAttributes.config.ts} (100%) rename packages/scandipwa/src/component/ProductConfigurableAttributes/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCustomizableOption/{ProductCustomizableOption.config.js => ProductCustomizableOption.config.ts} (66%) rename packages/scandipwa/src/component/ProductCustomizableOption/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductCustomizableOptions/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductDownloadableLinks/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductDownloadableSamples/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductGallery/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductGalleryBaseImage/{ProductGalleryBaseImage.config.js => ProductGalleryBaseImage.config.ts} (100%) rename packages/scandipwa/src/component/ProductGalleryBaseImage/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductGalleryThumbnailImage/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductInformation/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductLinks/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductList/{ProductList.config.js => ProductList.config.ts} (89%) rename packages/scandipwa/src/component/ProductList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductListPage/{ProductListPage.config.js => ProductListPage.config.ts} (87%) rename packages/scandipwa/src/component/ProductListPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductListWidget/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/ProductPrice/ProductPrice.config.js create mode 100644 packages/scandipwa/src/component/ProductPrice/ProductPrice.config.ts rename packages/scandipwa/src/component/ProductPrice/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductReviewForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductReviewItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductReviewList/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductReviewRating/{ProductReviewRating.config.js => ProductReviewRating.config.ts} (100%) rename packages/scandipwa/src/component/ProductReviewRating/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductReviews/{ProductReviews.config.js => ProductReviews.config.ts} (87%) rename packages/scandipwa/src/component/ProductReviews/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductTab/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductTabs/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ProductWishlistButton/{ProductWishlistButton.config.js => ProductWishlistButton.config.ts} (88%) rename packages/scandipwa/src/component/ProductWishlistButton/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/PurchaseOrder/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/RadioButtonIcon/{RadioButtonIcon.component.js => RadioButtonIcon.component.tsx} (90%) create mode 100644 packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.type.ts rename packages/scandipwa/src/component/RadioButtonIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/RecentlyViewedWidget/{RecentlyViewedWidget.config.js => RecentlyViewedWidget.config.ts} (100%) rename packages/scandipwa/src/component/RecentlyViewedWidget/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/RenderWhenVisible/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ResetAttributes/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ResetButton/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ReviewStar/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/Router/Router.config.js create mode 100644 packages/scandipwa/src/component/Router/Router.config.ts rename packages/scandipwa/src/component/Router/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SearchField/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SearchIcon/{SearchIcon.component.js => SearchIcon.component.tsx} (97%) rename packages/scandipwa/src/component/SearchIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SearchItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SearchOverlay/{SearchOverlay.config.js => SearchOverlay.config.ts} (100%) rename packages/scandipwa/src/component/SearchOverlay/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ShareIcon/{ShareIcon.component.js => ShareIcon.component.tsx} (91%) create mode 100644 packages/scandipwa/src/component/ShareIcon/ShareIcon.type.ts rename packages/scandipwa/src/component/ShareIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ShareWishlistForm/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/ShareWishlistPopup/{ShareWishlistPopup.config.js => ShareWishlistPopup.config.ts} (87%) rename packages/scandipwa/src/component/ShareWishlistPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SharedTransition/{SharedTransition.config.js => SharedTransition.config.ts} (87%) rename packages/scandipwa/src/component/SharedTransition/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SharedWishlistItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/Slider/{Slider.config.js => Slider.config.ts} (100%) rename packages/scandipwa/src/component/Slider/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SliderWidget/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StarIcon/{StarIcon.component.js => StarIcon.component.tsx} (89%) delete mode 100644 packages/scandipwa/src/component/StarIcon/StarIcon.config.js rename packages/scandipwa/src/component/{Popup/Popup.config.js => StarIcon/StarIcon.config.ts} (75%) create mode 100644 packages/scandipwa/src/component/StarIcon/StarIcon.type.ts rename packages/scandipwa/src/component/StarIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StoreInPickUp/{StoreInPickUp.config.js => StoreInPickUp.config.ts} (62%) rename packages/scandipwa/src/component/StoreInPickUp/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StoreInPickUpPopup/{StoreInPickUpPopup.config.js => StoreInPickUpPopup.config.ts} (100%) rename packages/scandipwa/src/component/StoreInPickUpPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StoreInPickUpStore/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StoreItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/StoreSwitcher/{StoreSwitcher.config.js => StoreSwitcher.config.ts} (85%) rename packages/scandipwa/src/component/StoreSwitcher/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/SwipeToDelete/{SwipeToDelete.config.js => SwipeToDelete.config.ts} (100%) rename packages/scandipwa/src/component/SwipeToDelete/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/TextPlaceholder/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/TierPrices/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/TranslateOnCursorMove/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/UploadIcon/{UploadIcon.component.js => UploadIcon.component.tsx} (99%) rename packages/scandipwa/src/component/UploadIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/UserIcon/{UserIcon.component.js => UserIcon.component.tsx} (88%) create mode 100644 packages/scandipwa/src/component/UserIcon/UserIcon.type.ts rename packages/scandipwa/src/component/UserIcon/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/VideoPopup/{VideoPopup.config.js => VideoPopup.config.ts} (92%) rename packages/scandipwa/src/component/VideoPopup/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/VideoThumbnail/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.js create mode 100644 packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.ts rename packages/scandipwa/src/component/WidgetFactory/{index.js => index.ts} (100%) rename packages/scandipwa/src/component/WishlistItem/{WishlistItem.config.js => WishlistItem.config.ts} (87%) rename packages/scandipwa/src/component/WishlistItem/{index.js => index.ts} (100%) rename packages/scandipwa/src/{index.js => index.tsx} (100%) rename packages/scandipwa/src/route/CartPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/CategoryPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/Checkout/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/CmsPage/{CmsPage.config.js => CmsPage.config.ts} (86%) rename packages/scandipwa/src/route/CmsPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/ConfirmAccountPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/ContactPage/{ContactPage.config.js => ContactPage.config.ts} (86%) rename packages/scandipwa/src/route/ContactPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/CreateAccount/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/ForgotPassword/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/HomePage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/LoginAccount/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/MenuPage/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/route/MyAccount/MyAccount.config.js create mode 100644 packages/scandipwa/src/route/MyAccount/MyAccount.config.ts rename packages/scandipwa/src/route/MyAccount/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/NoMatch/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/NoMatchHandler/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.js create mode 100644 packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.ts rename packages/scandipwa/src/route/PasswordChangePage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/ProductComparePage/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/route/ProductPage/ProductPage.config.js create mode 100644 packages/scandipwa/src/route/ProductPage/ProductPage.config.ts rename packages/scandipwa/src/route/ProductPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/SearchPage/{SearchPage.config.js => SearchPage.config.ts} (90%) rename packages/scandipwa/src/route/SearchPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/SomethingWentWrong/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/StyleGuidePage/{StyleGuidePage.config.js => StyleGuidePage.config.ts} (91%) rename packages/scandipwa/src/route/StyleGuidePage/{index.js => index.ts} (100%) delete mode 100644 packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.js create mode 100644 packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.ts rename packages/scandipwa/src/route/UrlRewrites/{index.js => index.ts} (100%) rename packages/scandipwa/src/route/WishlistSharedPage/{index.js => index.ts} (100%) rename packages/scandipwa/src/util/Polyfill/{index.js => index.ts} (100%) diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index cb8b973f61..c17cc6651c 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -176,7 +176,8 @@ "@scandipwa/scandipwa-guidelines/use-namespace": "off", "@scandipwa/scandipwa-guidelines/export-level-one": "off", "@scandipwa/scandipwa-guidelines/use-named-export": "off", - "@scandipwa/scandipwa-guidelines/create-config-files": "off" + "@scandipwa/scandipwa-guidelines/create-config-files": "off", + "import/prefer-default-export": "off" } }, { diff --git a/packages/scandipwa/src/component/AddIcon/AddIcon.component.js b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx similarity index 85% rename from packages/scandipwa/src/component/AddIcon/AddIcon.component.js rename to packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx index dcc6fb0da7..2cb4f30a43 100644 --- a/packages/scandipwa/src/component/AddIcon/AddIcon.component.js +++ b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { AddIconProps } from './AddIcon.type'; + import './AddIcon.style'; /** @namespace Component/AddIcon/Component */ -export class AddIcon extends PureComponent { - static propTypes = { - isPrimary: PropTypes.bool - }; - +export class AddIcon extends PureComponent { static defaultProps = { isPrimary: false }; - render() { + render(): JSX.Element { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/SliderWidget/SliderWidget.config.js b/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts similarity index 65% rename from packages/scandipwa/src/component/SliderWidget/SliderWidget.config.js rename to packages/scandipwa/src/component/AddIcon/AddIcon.type.ts index c7eb76682c..f12106c9a9 100644 --- a/packages/scandipwa/src/component/SliderWidget/SliderWidget.config.js +++ b/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts @@ -6,8 +6,9 @@ * * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa */ -export const DIRECTION_RIGHT = 'right'; -export const DIRECTION_LEFT = 'left'; +export interface AddIconProps { + isPrimary: boolean; +} diff --git a/packages/scandipwa/src/component/AddIcon/index.js b/packages/scandipwa/src/component/AddIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/AddIcon/index.js rename to packages/scandipwa/src/component/AddIcon/index.ts diff --git a/packages/scandipwa/src/component/AddToCart/index.js b/packages/scandipwa/src/component/AddToCart/index.ts similarity index 100% rename from packages/scandipwa/src/component/AddToCart/index.js rename to packages/scandipwa/src/component/AddToCart/index.ts diff --git a/packages/scandipwa/src/component/App/index.js b/packages/scandipwa/src/component/App/index.ts similarity index 100% rename from packages/scandipwa/src/component/App/index.js rename to packages/scandipwa/src/component/App/index.ts diff --git a/packages/scandipwa/src/component/Breadcrumb/index.js b/packages/scandipwa/src/component/Breadcrumb/index.ts similarity index 100% rename from packages/scandipwa/src/component/Breadcrumb/index.js rename to packages/scandipwa/src/component/Breadcrumb/index.ts diff --git a/packages/scandipwa/src/component/Breadcrumbs/index.js b/packages/scandipwa/src/component/Breadcrumbs/index.ts similarity index 100% rename from packages/scandipwa/src/component/Breadcrumbs/index.js rename to packages/scandipwa/src/component/Breadcrumbs/index.ts diff --git a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.config.js b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.config.ts similarity index 100% rename from packages/scandipwa/src/component/CarouselScroll/CarouselScroll.config.js rename to packages/scandipwa/src/component/CarouselScroll/CarouselScroll.config.ts diff --git a/packages/scandipwa/src/component/CarouselScroll/index.js b/packages/scandipwa/src/component/CarouselScroll/index.ts similarity index 100% rename from packages/scandipwa/src/component/CarouselScroll/index.js rename to packages/scandipwa/src/component/CarouselScroll/index.ts diff --git a/packages/scandipwa/src/component/CarouselScrollArrow/index.js b/packages/scandipwa/src/component/CarouselScrollArrow/index.ts similarity index 100% rename from packages/scandipwa/src/component/CarouselScrollArrow/index.js rename to packages/scandipwa/src/component/CarouselScrollArrow/index.ts diff --git a/packages/scandipwa/src/component/CarouselScrollItem/index.js b/packages/scandipwa/src/component/CarouselScrollItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/CarouselScrollItem/index.js rename to packages/scandipwa/src/component/CarouselScrollItem/index.ts diff --git a/packages/scandipwa/src/component/CartCoupon/index.js b/packages/scandipwa/src/component/CartCoupon/index.ts similarity index 100% rename from packages/scandipwa/src/component/CartCoupon/index.js rename to packages/scandipwa/src/component/CartCoupon/index.ts diff --git a/packages/scandipwa/src/component/CartIcon/CartIcon.component.js b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx similarity index 91% rename from packages/scandipwa/src/component/CartIcon/CartIcon.component.js rename to packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx index 051dfbfee1..2819209537 100644 --- a/packages/scandipwa/src/component/CartIcon/CartIcon.component.js +++ b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { CartIconProps } from './CartIcon.type'; + import './CartIcon.style'; /** @namespace Component/CartIcon/Component */ -export class CartIcon extends PureComponent { - static propTypes = { - isActive: PropTypes.bool - }; - +export class CartIcon extends PureComponent { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts b/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts new file mode 100644 index 0000000000..fdcf2a551d --- /dev/null +++ b/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface CartIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/CartIcon/index.js b/packages/scandipwa/src/component/CartIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/CartIcon/index.js rename to packages/scandipwa/src/component/CartIcon/index.ts diff --git a/packages/scandipwa/src/component/CartItem/index.js b/packages/scandipwa/src/component/CartItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/CartItem/index.js rename to packages/scandipwa/src/component/CartItem/index.ts diff --git a/packages/scandipwa/src/component/CartItemPrice/index.js b/packages/scandipwa/src/component/CartItemPrice/index.ts similarity index 100% rename from packages/scandipwa/src/component/CartItemPrice/index.js rename to packages/scandipwa/src/component/CartItemPrice/index.ts diff --git a/packages/scandipwa/src/component/CartOverlay/index.js b/packages/scandipwa/src/component/CartOverlay/index.ts similarity index 100% rename from packages/scandipwa/src/component/CartOverlay/index.js rename to packages/scandipwa/src/component/CartOverlay/index.ts diff --git a/packages/scandipwa/src/component/CategoryConfigurableAttributes/index.js b/packages/scandipwa/src/component/CategoryConfigurableAttributes/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategoryConfigurableAttributes/index.js rename to packages/scandipwa/src/component/CategoryConfigurableAttributes/index.ts diff --git a/packages/scandipwa/src/component/CategoryDetails/index.js b/packages/scandipwa/src/component/CategoryDetails/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategoryDetails/index.js rename to packages/scandipwa/src/component/CategoryDetails/index.ts diff --git a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.js b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.ts similarity index 88% rename from packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.js rename to packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.ts index 7dab5fb106..5e758d7e3a 100644 --- a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.js +++ b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/CategoryFilterOverlay/index.js b/packages/scandipwa/src/component/CategoryFilterOverlay/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategoryFilterOverlay/index.js rename to packages/scandipwa/src/component/CategoryFilterOverlay/index.ts diff --git a/packages/scandipwa/src/component/CategoryItemsCount/index.js b/packages/scandipwa/src/component/CategoryItemsCount/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategoryItemsCount/index.js rename to packages/scandipwa/src/component/CategoryItemsCount/index.ts diff --git a/packages/scandipwa/src/component/CategoryProductList/index.js b/packages/scandipwa/src/component/CategoryProductList/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategoryProductList/index.js rename to packages/scandipwa/src/component/CategoryProductList/index.ts diff --git a/packages/scandipwa/src/component/CategorySort/index.js b/packages/scandipwa/src/component/CategorySort/index.ts similarity index 100% rename from packages/scandipwa/src/component/CategorySort/index.js rename to packages/scandipwa/src/component/CategorySort/index.ts diff --git a/packages/scandipwa/src/component/CheckoutAddressBook/index.js b/packages/scandipwa/src/component/CheckoutAddressBook/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutAddressBook/index.js rename to packages/scandipwa/src/component/CheckoutAddressBook/index.ts diff --git a/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.js b/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.ts similarity index 87% rename from packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.js rename to packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.ts index 7589dee452..9d4d834211 100644 --- a/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.js +++ b/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/CheckoutAddressForm/index.js b/packages/scandipwa/src/component/CheckoutAddressForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutAddressForm/index.js rename to packages/scandipwa/src/component/CheckoutAddressForm/index.ts diff --git a/packages/scandipwa/src/component/CheckoutAddressTable/index.js b/packages/scandipwa/src/component/CheckoutAddressTable/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutAddressTable/index.js rename to packages/scandipwa/src/component/CheckoutAddressTable/index.ts diff --git a/packages/scandipwa/src/component/CheckoutBilling/index.js b/packages/scandipwa/src/component/CheckoutBilling/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutBilling/index.js rename to packages/scandipwa/src/component/CheckoutBilling/index.ts diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.js b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.ts similarity index 67% rename from packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.js rename to packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.ts index 171950e4d2..7add11d728 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.js +++ b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.config.ts @@ -9,9 +9,5 @@ * @link https://github.com/scandipwa/base-theme */ -export const DISPLAY_SHIPPING_PRICES_INCL_TAX = 'DISPLAY_SHIPPING_PRICES_INCL_TAX'; -export const DISPLAY_SHIPPING_PRICES_EXCL_TAX = 'DISPLAY_SHIPPING_PRICES_EXCL_TAX'; -export const DISPLAY_SHIPPING_PRICES_BOTH = 'DISPLAY_SHIPPING_PRICES_BOTH'; - // eslint-disable-next-line max-len export const DELIVERY_METHOD_UNAVAILABLE_MESSAGE = __('This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.'); diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOption/index.js b/packages/scandipwa/src/component/CheckoutDeliveryOption/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutDeliveryOption/index.js rename to packages/scandipwa/src/component/CheckoutDeliveryOption/index.ts diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOptions/index.js b/packages/scandipwa/src/component/CheckoutDeliveryOptions/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutDeliveryOptions/index.js rename to packages/scandipwa/src/component/CheckoutDeliveryOptions/index.ts diff --git a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.js b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.ts similarity index 88% rename from packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.js rename to packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.ts index b5e4341e77..8fc0a3666d 100644 --- a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.js +++ b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/CheckoutGuestForm/index.js b/packages/scandipwa/src/component/CheckoutGuestForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutGuestForm/index.js rename to packages/scandipwa/src/component/CheckoutGuestForm/index.ts diff --git a/packages/scandipwa/src/component/CheckoutOrderSummary/index.js b/packages/scandipwa/src/component/CheckoutOrderSummary/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutOrderSummary/index.js rename to packages/scandipwa/src/component/CheckoutOrderSummary/index.ts diff --git a/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/index.js b/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/index.js rename to packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/index.ts diff --git a/packages/scandipwa/src/component/CheckoutPayment/index.js b/packages/scandipwa/src/component/CheckoutPayment/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutPayment/index.js rename to packages/scandipwa/src/component/CheckoutPayment/index.ts diff --git a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.js b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.js deleted file mode 100644 index 88813b50fe..0000000000 --- a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const KLARNA = 'klarna_kp'; -export const CHECK_MONEY = 'checkmo'; -export const PAYPAL_EXPRESS = 'paypal_express'; -export const PAYPAL_EXPRESS_CREDIT = 'paypal_express_bml'; -export const PURCHASE_ORDER = 'purchaseorder'; diff --git a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.ts b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.ts new file mode 100644 index 0000000000..d21ba79242 --- /dev/null +++ b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.config.ts @@ -0,0 +1,18 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum PaymentMethods { + KLARNA = 'klarna_kp', + CHECK_MONEY = 'checkmo', + PAYPAL_EXPRESS = 'paypal_express', + PAYPAL_EXPRESS_CREDIT = 'paypal_express_bml', + PURCHASE_ORDER = 'purchaseorder' +} diff --git a/packages/scandipwa/src/component/CheckoutPayments/index.js b/packages/scandipwa/src/component/CheckoutPayments/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutPayments/index.js rename to packages/scandipwa/src/component/CheckoutPayments/index.ts diff --git a/packages/scandipwa/src/component/CheckoutShipping/index.js b/packages/scandipwa/src/component/CheckoutShipping/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutShipping/index.js rename to packages/scandipwa/src/component/CheckoutShipping/index.ts diff --git a/packages/scandipwa/src/component/CheckoutSuccess/index.js b/packages/scandipwa/src/component/CheckoutSuccess/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutSuccess/index.js rename to packages/scandipwa/src/component/CheckoutSuccess/index.ts diff --git a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.js b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.ts similarity index 87% rename from packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.js rename to packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.ts index e35f47195c..6b5786c60d 100644 --- a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.js +++ b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/index.js b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/index.js rename to packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/index.ts diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.js b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx similarity index 79% rename from packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.js rename to packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx index aefb001260..b6b169bd92 100644 --- a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.js +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx @@ -11,23 +11,18 @@ import { PureComponent } from 'react'; -import { DirectionType } from 'Type/Direction.type'; - -import { RIGHT } from './ChevronIcon.config'; +import { Directions } from './ChevronIcon.config'; +import { ChevronIconProps } from './ChevronIcon.type'; import './ChevronIcon.style'; /** @namespace Component/ChevronIcon/Component */ -export class ChevronIcon extends PureComponent { - static propTypes = { - direction: DirectionType - }; - +export class ChevronIcon extends PureComponent { static defaultProps = { - direction: RIGHT + direction: Directions.RIGHT }; - render() { + render(): JSX.Element { const { direction } = this.props; return ( diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts index f0266738ae..ea510897b7 100644 --- a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -10,11 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -export const LEFT = 'left'; -export const RIGHT = 'right'; -export const TOP = 'top'; -export const BOTTOM = 'bottom'; - export enum Directions { LEFT = 'left', RIGHT = 'right', diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts new file mode 100644 index 0000000000..7baf24797d --- /dev/null +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts @@ -0,0 +1,16 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Directions } from './ChevronIcon.config'; + +export interface ChevronIconProps { + direction: Directions; +} diff --git a/packages/scandipwa/src/component/ChevronIcon/index.js b/packages/scandipwa/src/component/ChevronIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/ChevronIcon/index.js rename to packages/scandipwa/src/component/ChevronIcon/index.ts diff --git a/packages/scandipwa/src/component/ClickOutside/index.js b/packages/scandipwa/src/component/ClickOutside/index.ts similarity index 100% rename from packages/scandipwa/src/component/ClickOutside/index.js rename to packages/scandipwa/src/component/ClickOutside/index.ts diff --git a/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.js b/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CloseIcon/CloseIcon.component.js rename to packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx index 3a598ca65a..ba7d257ea7 100644 --- a/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.js +++ b/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx @@ -15,7 +15,7 @@ import './CloseIcon.style'; /** @namespace Component/CloseIcon/Component */ export class CloseIcon extends PureComponent { - render() { + render(): JSX.Element { return ( { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts b/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts new file mode 100644 index 0000000000..e340e79786 --- /dev/null +++ b/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface CompareIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/CompareIcon/index.js b/packages/scandipwa/src/component/CompareIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/CompareIcon/index.js rename to packages/scandipwa/src/component/CompareIcon/index.ts diff --git a/packages/scandipwa/src/component/ContactForm/index.js b/packages/scandipwa/src/component/ContactForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/ContactForm/index.js rename to packages/scandipwa/src/component/ContactForm/index.ts diff --git a/packages/scandipwa/src/component/ContentWrapper/index.js b/packages/scandipwa/src/component/ContentWrapper/index.ts similarity index 100% rename from packages/scandipwa/src/component/ContentWrapper/index.js rename to packages/scandipwa/src/component/ContentWrapper/index.ts diff --git a/packages/scandipwa/src/component/CookiePopup/CookiePopup.config.js b/packages/scandipwa/src/component/CookiePopup/CookiePopup.config.ts similarity index 86% rename from packages/scandipwa/src/component/CookiePopup/CookiePopup.config.js rename to packages/scandipwa/src/component/CookiePopup/CookiePopup.config.ts index a882e7ed81..138959f6ca 100644 --- a/packages/scandipwa/src/component/CookiePopup/CookiePopup.config.js +++ b/packages/scandipwa/src/component/CookiePopup/CookiePopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/CookiePopup/index.js b/packages/scandipwa/src/component/CookiePopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/CookiePopup/index.js rename to packages/scandipwa/src/component/CookiePopup/index.ts diff --git a/packages/scandipwa/src/component/CurrencySwitcher/index.js b/packages/scandipwa/src/component/CurrencySwitcher/index.ts similarity index 100% rename from packages/scandipwa/src/component/CurrencySwitcher/index.js rename to packages/scandipwa/src/component/CurrencySwitcher/index.ts diff --git a/packages/scandipwa/src/component/DatePicker/index.js b/packages/scandipwa/src/component/DatePicker/index.ts similarity index 100% rename from packages/scandipwa/src/component/DatePicker/index.js rename to packages/scandipwa/src/component/DatePicker/index.ts diff --git a/packages/scandipwa/src/component/DateSelect/DateSelect.config.js b/packages/scandipwa/src/component/DateSelect/DateSelect.config.ts similarity index 73% rename from packages/scandipwa/src/component/DateSelect/DateSelect.config.js rename to packages/scandipwa/src/component/DateSelect/DateSelect.config.ts index 90483f43d5..1164cea5e3 100644 --- a/packages/scandipwa/src/component/DateSelect/DateSelect.config.js +++ b/packages/scandipwa/src/component/DateSelect/DateSelect.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-magic-numbers */ /** * ScandiPWA - Progressive Web App for Magento * @@ -14,11 +15,16 @@ export const AMPM_FORMAT = { PM: __('PM') }; +export enum HourFormat { + H12 = 12, + H24 = 24 +} + +export enum DateFieldAttr { + NAME = 'data-field', + TYPE = 'data-type' +} + export const DEFAULT_MONTH_DAYS = 31; export const MONTHS_COUNT = 12; export const MINUTES_COUNT = 60; -export const HOURS_12H_COUNT = 12; -export const HOURS_24H_COUNT = 24; - -export const FIELD_NAME_ATTR = 'data-field'; -export const FIELD_TYPE_ATTR = 'data-type'; diff --git a/packages/scandipwa/src/component/DateSelect/index.js b/packages/scandipwa/src/component/DateSelect/index.ts similarity index 100% rename from packages/scandipwa/src/component/DateSelect/index.js rename to packages/scandipwa/src/component/DateSelect/index.ts diff --git a/packages/scandipwa/src/component/DemoNotice/index.js b/packages/scandipwa/src/component/DemoNotice/index.ts similarity index 100% rename from packages/scandipwa/src/component/DemoNotice/index.js rename to packages/scandipwa/src/component/DemoNotice/index.ts diff --git a/packages/scandipwa/src/component/Draggable/index.js b/packages/scandipwa/src/component/Draggable/index.ts similarity index 100% rename from packages/scandipwa/src/component/Draggable/index.js rename to packages/scandipwa/src/component/Draggable/index.ts diff --git a/packages/scandipwa/src/component/EditIcon/EditIcon.component.js b/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx similarity index 97% rename from packages/scandipwa/src/component/EditIcon/EditIcon.component.js rename to packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx index 8723c31c68..78d1558c0d 100644 --- a/packages/scandipwa/src/component/EditIcon/EditIcon.component.js +++ b/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx @@ -15,7 +15,7 @@ import './EditIcon.style'; /** @namespace Component/EditIcon/Component */ export class EditIcon extends PureComponent { - render() { + render(): JSX.Element { return ( { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/GridIcon/GridIcon.type.ts b/packages/scandipwa/src/component/GridIcon/GridIcon.type.ts new file mode 100644 index 0000000000..3b4df211f6 --- /dev/null +++ b/packages/scandipwa/src/component/GridIcon/GridIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface GridIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/GridIcon/index.js b/packages/scandipwa/src/component/GridIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/GridIcon/index.js rename to packages/scandipwa/src/component/GridIcon/index.ts diff --git a/packages/scandipwa/src/component/GroupedProductList/index.js b/packages/scandipwa/src/component/GroupedProductList/index.ts similarity index 100% rename from packages/scandipwa/src/component/GroupedProductList/index.js rename to packages/scandipwa/src/component/GroupedProductList/index.ts diff --git a/packages/scandipwa/src/component/GroupedProductsItem/index.js b/packages/scandipwa/src/component/GroupedProductsItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/GroupedProductsItem/index.js rename to packages/scandipwa/src/component/GroupedProductsItem/index.ts diff --git a/packages/scandipwa/src/component/Header/Header.config.js b/packages/scandipwa/src/component/Header/Header.config.js deleted file mode 100644 index 220f6f852d..0000000000 --- a/packages/scandipwa/src/component/Header/Header.config.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const PDP = 'pdp'; -export const POPUP = 'popup'; -export const CATEGORY = 'category'; -export const CUSTOMER_ACCOUNT = 'customer_account'; -export const CUSTOMER_SUB_ACCOUNT = 'customer_sub_account'; -export const CUSTOMER_ACCOUNT_PAGE = 'customer_account_page'; -export const CUSTOMER_WISHLIST = 'wishlist'; -export const CUSTOMER_ORDER = 'customer_order'; -export const HOME_PAGE = 'home'; -export const MENU = 'menu'; -export const MENU_SUBCATEGORY = 'menu_subcategory'; -export const SEARCH = 'search'; -export const FILTER = 'filter'; -export const CART = 'cart'; -export const CART_OVERLAY = 'cart_overlay'; -export const CART_EDITING = 'cart_editing'; -export const CHECKOUT = 'checkout'; -export const CHECKOUT_SUCCESS = 'checkout_success'; -export const CHECKOUT_ACCOUNT = 'checkout_account'; -export const CMS_PAGE = 'cms-page'; -export const MY_ACCOUNT = 'my-account'; -export const NO_MATCH = 'no-match'; -export const CONTACT_US = 'contact-us'; -export const PRODUCT_COMPARE = 'product-compare'; diff --git a/packages/scandipwa/src/component/Header/Header.config.ts b/packages/scandipwa/src/component/Header/Header.config.ts new file mode 100644 index 0000000000..27ef350e0c --- /dev/null +++ b/packages/scandipwa/src/component/Header/Header.config.ts @@ -0,0 +1,37 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum Page { + PDP = 'pdp', + POPUP = 'popup', + CATEGORY = 'category', + CUSTOMER_ACCOUNT = 'customer_account', + CUSTOMER_SUB_ACCOUNT = 'customer_sub_account', + CUSTOMER_ACCOUNT_PAGE = 'customer_account_page', + CUSTOMER_WISHLIST = 'wishlist', + CUSTOMER_ORDER = 'customer_order', + HOME_PAGE = 'home', + MENU = 'menu', + MENU_SUBCATEGORY = 'menu_subcategory', + SEARCH = 'search', + FILTER = 'filter', + CART = 'cart', + CART_OVERLAY = 'cart_overlay', + CART_EDITING = 'cart_editing', + CHECKOUT = 'checkout', + CHECKOUT_SUCCESS = 'checkout_success', + CHECKOUT_ACCOUNT = 'checkout_account', + CMS_PAGE = 'cms-page', + MY_ACCOUNT = 'my-account', + NO_MATCH = 'no-match', + CONTACT_US = 'contact-us', + PRODUCT_COMPARE = 'product-compare' +} diff --git a/packages/scandipwa/src/component/Header/index.js b/packages/scandipwa/src/component/Header/index.ts similarity index 100% rename from packages/scandipwa/src/component/Header/index.js rename to packages/scandipwa/src/component/Header/index.ts diff --git a/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.js b/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx similarity index 90% rename from packages/scandipwa/src/component/HeartIcon/HeartIcon.component.js rename to packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx index 0a65bef102..532957a602 100644 --- a/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.js +++ b/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { HeartIconProps } from './HeartIcon.type'; + import './HeartIcon.style'; /** @namespace Component/HeartIcon/Component */ -export class HeartIcon extends PureComponent { - static propTypes = { - isActive: PropTypes.bool - }; - +export class HeartIcon extends PureComponent { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/HeartIcon/HeartIcon.type.ts b/packages/scandipwa/src/component/HeartIcon/HeartIcon.type.ts new file mode 100644 index 0000000000..af50c2f93a --- /dev/null +++ b/packages/scandipwa/src/component/HeartIcon/HeartIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface HeartIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/HeartIcon/index.js b/packages/scandipwa/src/component/HeartIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/HeartIcon/index.js rename to packages/scandipwa/src/component/HeartIcon/index.ts diff --git a/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.js b/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx similarity index 89% rename from packages/scandipwa/src/component/HomeIcon/HomeIcon.component.js rename to packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx index 137814779d..856f91cc65 100644 --- a/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.js +++ b/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { HomeIconProps } from './HomeIcon.type'; + import './HomeIcon.style'; /** @namespace Component/HomeIcon/Component */ -export class HomeIcon extends PureComponent { - static propTypes = { - isActive: PropTypes.bool - }; - +export class HomeIcon extends PureComponent { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/HomeIcon/HomeIcon.type.ts b/packages/scandipwa/src/component/HomeIcon/HomeIcon.type.ts new file mode 100644 index 0000000000..804ab3ef0b --- /dev/null +++ b/packages/scandipwa/src/component/HomeIcon/HomeIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface HomeIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/HomeIcon/index.js b/packages/scandipwa/src/component/HomeIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/HomeIcon/index.js rename to packages/scandipwa/src/component/HomeIcon/index.ts diff --git a/packages/scandipwa/src/component/Html/index.js b/packages/scandipwa/src/component/Html/index.ts similarity index 100% rename from packages/scandipwa/src/component/Html/index.js rename to packages/scandipwa/src/component/Html/index.ts diff --git a/packages/scandipwa/src/component/Image/Image.config.js b/packages/scandipwa/src/component/Image/Image.config.ts similarity index 62% rename from packages/scandipwa/src/component/Image/Image.config.js rename to packages/scandipwa/src/component/Image/Image.config.ts index 9a366f9336..5ee335e4e3 100644 --- a/packages/scandipwa/src/component/Image/Image.config.js +++ b/packages/scandipwa/src/component/Image/Image.config.ts @@ -9,8 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -export const IMAGE_LOADING = 'IMAGE_LOADING'; -export const IMAGE_LOADED = 'IMAGE_LOADED'; -export const IMAGE_NOT_FOUND = 'IMAGE_NOT_FOUND'; -export const IMAGE_NOT_SPECIFIED = 'IMAGE_NOT_SPECIFIED'; export const IMAGE_HUNDRED_PERCENT = '100%'; + +export enum ImageState { + IMAGE_LOADING = 'IMAGE_LOADING', + IMAGE_LOADED = 'IMAGE_LOADED', + IMAGE_NOT_FOUND = 'IMAGE_NOT_FOUND', + IMAGE_NOT_SPECIFIED = 'IMAGE_NOT_SPECIFIED' +} diff --git a/packages/scandipwa/src/component/Image/index.js b/packages/scandipwa/src/component/Image/index.ts similarity index 100% rename from packages/scandipwa/src/component/Image/index.js rename to packages/scandipwa/src/component/Image/index.ts diff --git a/packages/scandipwa/src/component/ImageZoomPopup/index.js b/packages/scandipwa/src/component/ImageZoomPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/ImageZoomPopup/index.js rename to packages/scandipwa/src/component/ImageZoomPopup/index.ts diff --git a/packages/scandipwa/src/component/InstallPrompt/index.js b/packages/scandipwa/src/component/InstallPrompt/index.ts similarity index 100% rename from packages/scandipwa/src/component/InstallPrompt/index.js rename to packages/scandipwa/src/component/InstallPrompt/index.ts diff --git a/packages/scandipwa/src/component/InstallPromptAndroid/index.js b/packages/scandipwa/src/component/InstallPromptAndroid/index.ts similarity index 100% rename from packages/scandipwa/src/component/InstallPromptAndroid/index.js rename to packages/scandipwa/src/component/InstallPromptAndroid/index.ts diff --git a/packages/scandipwa/src/component/InstallPromptIOS/index.js b/packages/scandipwa/src/component/InstallPromptIOS/index.ts similarity index 100% rename from packages/scandipwa/src/component/InstallPromptIOS/index.js rename to packages/scandipwa/src/component/InstallPromptIOS/index.ts diff --git a/packages/scandipwa/src/component/KeyValueTable/index.js b/packages/scandipwa/src/component/KeyValueTable/index.ts similarity index 100% rename from packages/scandipwa/src/component/KeyValueTable/index.js rename to packages/scandipwa/src/component/KeyValueTable/index.ts diff --git a/packages/scandipwa/src/component/Klarna/Klarna.config.js b/packages/scandipwa/src/component/Klarna/Klarna.config.ts similarity index 90% rename from packages/scandipwa/src/component/Klarna/Klarna.config.js rename to packages/scandipwa/src/component/Klarna/Klarna.config.ts index dd59bf1ad5..a87e29e05a 100644 --- a/packages/scandipwa/src/component/Klarna/Klarna.config.js +++ b/packages/scandipwa/src/component/Klarna/Klarna.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/Klarna/index.js b/packages/scandipwa/src/component/Klarna/index.ts similarity index 100% rename from packages/scandipwa/src/component/Klarna/index.js rename to packages/scandipwa/src/component/Klarna/index.ts diff --git a/packages/scandipwa/src/component/Link/index.js b/packages/scandipwa/src/component/Link/index.ts similarity index 100% rename from packages/scandipwa/src/component/Link/index.js rename to packages/scandipwa/src/component/Link/index.ts diff --git a/packages/scandipwa/src/component/ListIcon/ListIcon.component.js b/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx similarity index 87% rename from packages/scandipwa/src/component/ListIcon/ListIcon.component.js rename to packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx index 8e482b3663..4163e2afce 100644 --- a/packages/scandipwa/src/component/ListIcon/ListIcon.component.js +++ b/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ListIconProps } from './ListIcon.type'; + import './ListIcon.style'; /** @namespace Component/ListIcon/Component */ -export class ListIcon extends PureComponent { - static propTypes = { - isActive: PropTypes.bool - }; - +export class ListIcon extends PureComponent { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/ListIcon/ListIcon.type.ts b/packages/scandipwa/src/component/ListIcon/ListIcon.type.ts new file mode 100644 index 0000000000..e2b154bfb6 --- /dev/null +++ b/packages/scandipwa/src/component/ListIcon/ListIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface ListIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/ListIcon/index.js b/packages/scandipwa/src/component/ListIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/ListIcon/index.js rename to packages/scandipwa/src/component/ListIcon/index.ts diff --git a/packages/scandipwa/src/component/Loader/index.js b/packages/scandipwa/src/component/Loader/index.ts similarity index 100% rename from packages/scandipwa/src/component/Loader/index.js rename to packages/scandipwa/src/component/Loader/index.ts diff --git a/packages/scandipwa/src/component/LockIcon/LockIcon.component.js b/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx similarity index 97% rename from packages/scandipwa/src/component/LockIcon/LockIcon.component.js rename to packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx index 68abd4c61f..e0cdb4dc34 100644 --- a/packages/scandipwa/src/component/LockIcon/LockIcon.component.js +++ b/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx @@ -15,7 +15,7 @@ import './LockIcon.style'; /** @namespace Component/LockIcon/Component */ export class LockIcon extends PureComponent { - render() { + render(): JSX.Element { return ( { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/MenuIcon/MenuIcon.type.ts b/packages/scandipwa/src/component/MenuIcon/MenuIcon.type.ts new file mode 100644 index 0000000000..c964feccf7 --- /dev/null +++ b/packages/scandipwa/src/component/MenuIcon/MenuIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface MenuIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/MenuIcon/index.js b/packages/scandipwa/src/component/MenuIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/MenuIcon/index.js rename to packages/scandipwa/src/component/MenuIcon/index.ts diff --git a/packages/scandipwa/src/component/MenuItem/MenuItem.config.js b/packages/scandipwa/src/component/MenuItem/MenuItem.config.ts similarity index 86% rename from packages/scandipwa/src/component/MenuItem/MenuItem.config.js rename to packages/scandipwa/src/component/MenuItem/MenuItem.config.ts index da383c2fe1..14872a3dec 100644 --- a/packages/scandipwa/src/component/MenuItem/MenuItem.config.js +++ b/packages/scandipwa/src/component/MenuItem/MenuItem.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/MenuItem/index.js b/packages/scandipwa/src/component/MenuItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/MenuItem/index.js rename to packages/scandipwa/src/component/MenuItem/index.ts diff --git a/packages/scandipwa/src/component/Meta/index.js b/packages/scandipwa/src/component/Meta/index.ts similarity index 100% rename from packages/scandipwa/src/component/Meta/index.js rename to packages/scandipwa/src/component/Meta/index.ts diff --git a/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.js b/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx similarity index 84% rename from packages/scandipwa/src/component/MinusIcon/MinusIcon.component.js rename to packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx index c0ddd17a99..680c5ad674 100644 --- a/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.js +++ b/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { MinusIconProps } from './MinusIcon.type'; + import './MinusIcon.style'; /** @namespace Component/MinusIcon/Component */ -export class MinusIcon extends PureComponent { - static propTypes = { - isPrimary: PropTypes.bool - }; - +export class MinusIcon extends PureComponent { static defaultProps = { isPrimary: false }; - render() { + render(): JSX.Element { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/MinusIcon/MinusIcon.type.ts b/packages/scandipwa/src/component/MinusIcon/MinusIcon.type.ts new file mode 100644 index 0000000000..75717a27dd --- /dev/null +++ b/packages/scandipwa/src/component/MinusIcon/MinusIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface MinusIconProps { + isPrimary: boolean; +} diff --git a/packages/scandipwa/src/component/MinusIcon/index.js b/packages/scandipwa/src/component/MinusIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/MinusIcon/index.js rename to packages/scandipwa/src/component/MinusIcon/index.ts diff --git a/packages/scandipwa/src/component/MyAccountAddressBook/index.js b/packages/scandipwa/src/component/MyAccountAddressBook/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountAddressBook/index.js rename to packages/scandipwa/src/component/MyAccountAddressBook/index.ts diff --git a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.js b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.ts similarity index 87% rename from packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.js rename to packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.ts index 3e2e7a12c7..b0b13abbb3 100644 --- a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.js +++ b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/MyAccountAddressForm/index.js b/packages/scandipwa/src/component/MyAccountAddressForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountAddressForm/index.js rename to packages/scandipwa/src/component/MyAccountAddressForm/index.ts diff --git a/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.js b/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.ts similarity index 90% rename from packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.js rename to packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.ts index 487c5dac1d..6a049eacaa 100644 --- a/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.js +++ b/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/MyAccountAddressPopup/index.js b/packages/scandipwa/src/component/MyAccountAddressPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountAddressPopup/index.js rename to packages/scandipwa/src/component/MyAccountAddressPopup/index.ts diff --git a/packages/scandipwa/src/component/MyAccountAddressTable/index.js b/packages/scandipwa/src/component/MyAccountAddressTable/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountAddressTable/index.js rename to packages/scandipwa/src/component/MyAccountAddressTable/index.ts diff --git a/packages/scandipwa/src/component/MyAccountConfirmEmail/index.js b/packages/scandipwa/src/component/MyAccountConfirmEmail/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountConfirmEmail/index.js rename to packages/scandipwa/src/component/MyAccountConfirmEmail/index.ts diff --git a/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.config.js b/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.config.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.config.js rename to packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.config.ts diff --git a/packages/scandipwa/src/component/MyAccountCreateAccount/index.js b/packages/scandipwa/src/component/MyAccountCreateAccount/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountCreateAccount/index.js rename to packages/scandipwa/src/component/MyAccountCreateAccount/index.ts diff --git a/packages/scandipwa/src/component/MyAccountCustomerForm/index.js b/packages/scandipwa/src/component/MyAccountCustomerForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountCustomerForm/index.js rename to packages/scandipwa/src/component/MyAccountCustomerForm/index.ts diff --git a/packages/scandipwa/src/component/MyAccountCustomerTable/index.js b/packages/scandipwa/src/component/MyAccountCustomerTable/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountCustomerTable/index.js rename to packages/scandipwa/src/component/MyAccountCustomerTable/index.ts diff --git a/packages/scandipwa/src/component/MyAccountDashboard/index.js b/packages/scandipwa/src/component/MyAccountDashboard/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountDashboard/index.js rename to packages/scandipwa/src/component/MyAccountDashboard/index.ts diff --git a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.js b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.ts similarity index 85% rename from packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.js rename to packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.ts index 688f58db4e..28496f0553 100644 --- a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.js +++ b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.config.ts @@ -10,5 +10,3 @@ */ export const NUMBER_OF_COLUMNS_IN_DOWNLOADABLE_TABLE = 5; - -export default NUMBER_OF_COLUMNS_IN_DOWNLOADABLE_TABLE; diff --git a/packages/scandipwa/src/component/MyAccountDownloadable/index.js b/packages/scandipwa/src/component/MyAccountDownloadable/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountDownloadable/index.js rename to packages/scandipwa/src/component/MyAccountDownloadable/index.ts diff --git a/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.js b/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.ts similarity index 86% rename from packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.js rename to packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.ts index 42598c615e..d3d198bc42 100644 --- a/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.js +++ b/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/MyAccountDownloadableTableRow/index.js b/packages/scandipwa/src/component/MyAccountDownloadableTableRow/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountDownloadableTableRow/index.js rename to packages/scandipwa/src/component/MyAccountDownloadableTableRow/index.ts diff --git a/packages/scandipwa/src/component/MyAccountForgotPassword/index.js b/packages/scandipwa/src/component/MyAccountForgotPassword/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountForgotPassword/index.js rename to packages/scandipwa/src/component/MyAccountForgotPassword/index.ts diff --git a/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/index.js b/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/index.js rename to packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/index.ts diff --git a/packages/scandipwa/src/component/MyAccountInformation/index.js b/packages/scandipwa/src/component/MyAccountInformation/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountInformation/index.js rename to packages/scandipwa/src/component/MyAccountInformation/index.ts diff --git a/packages/scandipwa/src/component/MyAccountMyOrders/index.js b/packages/scandipwa/src/component/MyAccountMyOrders/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountMyOrders/index.js rename to packages/scandipwa/src/component/MyAccountMyOrders/index.ts diff --git a/packages/scandipwa/src/component/MyAccountMyWishlist/index.js b/packages/scandipwa/src/component/MyAccountMyWishlist/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountMyWishlist/index.js rename to packages/scandipwa/src/component/MyAccountMyWishlist/index.ts diff --git a/packages/scandipwa/src/component/MyAccountNewsletterSubscription/index.js b/packages/scandipwa/src/component/MyAccountNewsletterSubscription/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountNewsletterSubscription/index.js rename to packages/scandipwa/src/component/MyAccountNewsletterSubscription/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.js b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.js deleted file mode 100644 index afd2495872..0000000000 --- a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.js +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const ORDER_ITEMS = 'Items'; -export const ORDER_INVOICES = 'Invoice'; -export const ORDER_SHIPMENTS = 'Shipment'; -export const ORDER_REFUNDS = 'Refund'; diff --git a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.ts b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.ts new file mode 100644 index 0000000000..bb01f033cc --- /dev/null +++ b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.config.ts @@ -0,0 +1,17 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum OrderTabs { + ORDER_ITEMS = 'Items', + ORDER_INVOICES = 'Invoice', + ORDER_SHIPMENTS = 'Shipment', + ORDER_REFUNDS = 'Refund' +} diff --git a/packages/scandipwa/src/component/MyAccountOrder/index.js b/packages/scandipwa/src/component/MyAccountOrder/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrder/index.js rename to packages/scandipwa/src/component/MyAccountOrder/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderInformation/index.js b/packages/scandipwa/src/component/MyAccountOrderInformation/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderInformation/index.js rename to packages/scandipwa/src/component/MyAccountOrderInformation/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTable/index.js b/packages/scandipwa/src/component/MyAccountOrderItemsTable/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderItemsTable/index.js rename to packages/scandipwa/src/component/MyAccountOrderItemsTable/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js index 9a3595d272..d7a353fc62 100644 --- a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js @@ -18,7 +18,7 @@ import { OptionsType, OrderProductType } from 'Type/Order.type'; import { getOrderItemQtyToArray, getOrderItemRowDiscount } from 'Util/Orders'; import { formatPrice } from 'Util/Price'; -import { orderQtyTranslationMap } from './MyAccountOrderItemsTableRow.config'; +import { ORDER_STATUS_TRANSLATION_MAP } from './MyAccountOrderItemsTableRow.config'; import './MyAccountOrderItemsTableRow.style'; @@ -63,7 +63,7 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return this.renderPrice(value, currency, (__('Price'))); } - renderQty([type, qty], index) { + renderQty([ type, qty ], index) { const { activeTab } = this.props; if (qty === 0) { @@ -72,12 +72,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (activeTab === ORDER_ITEMS) { return ( -
  • { `${orderQtyTranslationMap[type]}: ${qty}` }
  • +
  • {`${ORDER_STATUS_TRANSLATION_MAP[ type ]}: ${qty}`}
  • ); } return ( -
  • { qty }
  • +
  • {qty}
  • ); } @@ -89,10 +89,10 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return (
      - { Object.entries(qtyArray).map(renderQty) } + {Object.entries(qtyArray).map(renderQty)}
    ); } @@ -121,12 +121,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( - - { title } - { formatPrice(value, currency) } + + {title} + {formatPrice(value, currency)} ); @@ -134,7 +134,7 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - { formatPrice(value, currency) } + {formatPrice(value, currency)} ); } @@ -155,12 +155,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( - - { selectedOptions.map(renderOption) } - { enteredOptions.map(renderOption) } + + {selectedOptions.map(renderOption)} + {enteredOptions.map(renderOption)} ); @@ -168,8 +168,8 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - { selectedOptions.map(renderOption) } - { enteredOptions.map(renderOption) } + {selectedOptions.map(renderOption)} + {enteredOptions.map(renderOption)} ); } @@ -180,12 +180,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - { product_name } + {product_name} - { this.renderSelectedAndEnteredOptions() } + {this.renderSelectedAndEnteredOptions()} ); } @@ -200,20 +200,20 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - { `${qty} x ${title}` } + {`${qty} x ${title}`} - { title } - { this.renderEnteredOptionPrice(formatPrice(price, currency)) } + {title} + {this.renderEnteredOptionPrice(formatPrice(price, currency))} - { quantity_ordered * qty } + {quantity_ordered * qty} ); @@ -228,10 +228,10 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - { price } + {price} ); } @@ -244,9 +244,9 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - { this.renderMobileBodyContentRow(__('Product name'), `${qty} x ${title}`, nameRowMix) } - { this.renderMobileBodyContentRow(__('SKU'), title) } - { this.renderMobileBodyContentRow(__('Price'), formatPrice(price, currency)) } + {this.renderMobileBodyContentRow(__('Product name'), `${qty} x ${title}`, nameRowMix)} + {this.renderMobileBodyContentRow(__('SKU'), title)} + {this.renderMobileBodyContentRow(__('Price'), formatPrice(price, currency))} ); } @@ -265,17 +265,17 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - { label } + {label} - { items.map((item) => renderOptionItem(item, isLastOptionItem)) } + {items.map((item) => renderOptionItem(item, isLastOptionItem))} ); } @@ -303,14 +303,14 @@ export class MyAccountOrderItemsTableRow extends PureComponent { } return ( -
    +
    - { label } + {label}
    - { this.renderOptionContent(option) } + {this.renderOptionContent(option)}
    ); } @@ -325,17 +325,17 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return linkItems.map(this.renderLink.bind(this)); } - return
    ; + return
    ; } renderLink(title, index) { return (
    - { title } + {title}
    ); } @@ -362,24 +362,24 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( <> - { this.renderPrice( + {this.renderPrice( -totalDiscount, currency, __('Discount Amount') - ) } - { this.renderPrice( + )} + {this.renderPrice( row_subtotal - totalDiscount, currency, __('Row Total') - ) } + )} ); } return ( <> - { formatPrice(-totalDiscount, currency) } - { formatPrice(row_subtotal - totalDiscount, currency) } + {formatPrice(-totalDiscount, currency)} + {formatPrice(row_subtotal - totalDiscount, currency)} ); } @@ -389,13 +389,13 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - - { label } - { value } + + {label} + {value} ); @@ -416,18 +416,18 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - { this.renderMobileBodyContentRow(__('Product name'), product_name, nameRowMix) } - { this.renderSelectedAndEnteredOptions() } - { this.renderMobileBodyContentRow(__('SKU'), product_sku) } - { this.renderItemPrice() } - { this.renderMobileBodyContentRow(__('Qty'), this.renderRowQty()) } - { this.renderRowSubtotal() } - { this.renderDiscountAndRowTotal() } - { this.renderEnteredOptionsAsRow() } + {this.renderMobileBodyContentRow(__('Product name'), product_name, nameRowMix)} + {this.renderSelectedAndEnteredOptions()} + {this.renderMobileBodyContentRow(__('SKU'), product_sku)} + {this.renderItemPrice()} + {this.renderMobileBodyContentRow(__('Qty'), this.renderRowQty())} + {this.renderRowSubtotal()} + {this.renderDiscountAndRowTotal()} + {this.renderEnteredOptionsAsRow()} ); } @@ -442,29 +442,29 @@ export class MyAccountOrderItemsTableRow extends PureComponent { comments } = this.props; - const isWithEnteredItems = !!enteredOptions[0]?.items; + const isWithEnteredItems = !!enteredOptions[ 0 ]?.items; const lineBefore = !!((activeTab === ORDER_SHIPMENTS) && (comments.length)); return ( <> - { this.renderNameAndOptions() } - { product_sku } - { this.renderItemPrice() } + {this.renderNameAndOptions()} + {product_sku} + {this.renderItemPrice()} - { this.renderRowQty() } + {this.renderRowQty()} - { this.renderRowSubtotal() } - { this.renderDiscountAndRowTotal() } + {this.renderRowSubtotal()} + {this.renderDiscountAndRowTotal()} - { this.renderEnteredOptionsAsRow() } + {this.renderEnteredOptionsAsRow()} ); } diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.js b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.ts similarity index 85% rename from packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.js rename to packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.ts index e35464d1ca..6085d869e9 100644 --- a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.js +++ b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -10,7 +9,7 @@ * @link https://github.com/scandipwa/scandipwa */ -export const orderQtyTranslationMap = { +export const ORDER_STATUS_TRANSLATION_MAP = { quantity_ordered: __('Ordered'), quantity_canceled: __('Canceled'), quantity_invoiced: __('Invoiced'), diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/index.js b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderItemsTableRow/index.js rename to packages/scandipwa/src/component/MyAccountOrderItemsTableRow/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderTab/index.js b/packages/scandipwa/src/component/MyAccountOrderTab/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderTab/index.js rename to packages/scandipwa/src/component/MyAccountOrderTab/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderTableRow/index.js b/packages/scandipwa/src/component/MyAccountOrderTableRow/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderTableRow/index.js rename to packages/scandipwa/src/component/MyAccountOrderTableRow/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderTabs/index.js b/packages/scandipwa/src/component/MyAccountOrderTabs/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderTabs/index.js rename to packages/scandipwa/src/component/MyAccountOrderTabs/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.js b/packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.ts similarity index 74% rename from packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.js rename to packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.ts index 4d16eb0647..076e12e8be 100644 --- a/packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.js +++ b/packages/scandipwa/src/component/MyAccountOrderTotals/MyAccountOrderTotals.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -9,17 +8,17 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/scandipwa */ -import { ORDER_REFUNDS } from 'Component/MyAccountOrder/MyAccountOrder.config'; +import { OrderTabs } from 'Component/MyAccountOrder/MyAccountOrder.config'; export const colSpanCounts = { - [ORDER_REFUNDS]: { + [OrderTabs.ORDER_REFUNDS]: { colSpanPriceCount: '1', colSpanLabelCount: '6' } }; export const colSpanCountsMobile = { - [ORDER_REFUNDS]: { + [OrderTabs.ORDER_REFUNDS]: { colSpanPriceCount: '2', colSpanLabelCount: '5' } diff --git a/packages/scandipwa/src/component/MyAccountOrderTotals/index.js b/packages/scandipwa/src/component/MyAccountOrderTotals/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOrderTotals/index.js rename to packages/scandipwa/src/component/MyAccountOrderTotals/index.ts diff --git a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.js b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.js deleted file mode 100644 index 79a8c6636f..0000000000 --- a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.js +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const STATE_SIGN_IN = 'signIn'; -export const STATE_FORGOT_PASSWORD = 'forgotPassword'; -export const STATE_FORGOT_PASSWORD_SUCCESS = 'forgotPasswordSuccess'; -export const STATE_CREATE_ACCOUNT = 'createAccount'; -export const STATE_LOGGED_IN = 'loggedIn'; -export const STATE_CONFIRM_EMAIL = 'confirmEmail'; - -export const CUSTOMER_ACCOUNT_OVERLAY_KEY = 'customer_account'; diff --git a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.ts b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.ts new file mode 100644 index 0000000000..d70ee65d47 --- /dev/null +++ b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.config.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum MyAccountPageState { + STATE_SIGN_IN = 'signIn', + STATE_FORGOT_PASSWORD = 'forgotPassword', + STATE_FORGOT_PASSWORD_SUCCESS = 'forgotPasswordSuccess', + STATE_CREATE_ACCOUNT = 'createAccount', + STATE_LOGGED_IN = 'loggedIn', + STATE_CONFIRM_EMAIL = 'confirmEmail' +} + +export const CUSTOMER_ACCOUNT_OVERLAY_KEY = 'customer_account'; diff --git a/packages/scandipwa/src/component/MyAccountOverlay/index.js b/packages/scandipwa/src/component/MyAccountOverlay/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountOverlay/index.js rename to packages/scandipwa/src/component/MyAccountOverlay/index.ts diff --git a/packages/scandipwa/src/component/MyAccountSignIn/index.js b/packages/scandipwa/src/component/MyAccountSignIn/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountSignIn/index.js rename to packages/scandipwa/src/component/MyAccountSignIn/index.ts diff --git a/packages/scandipwa/src/component/MyAccountTabList/index.js b/packages/scandipwa/src/component/MyAccountTabList/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountTabList/index.js rename to packages/scandipwa/src/component/MyAccountTabList/index.ts diff --git a/packages/scandipwa/src/component/MyAccountTabListItem/index.js b/packages/scandipwa/src/component/MyAccountTabListItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/MyAccountTabListItem/index.js rename to packages/scandipwa/src/component/MyAccountTabListItem/index.ts diff --git a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.js b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.ts similarity index 86% rename from packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.js rename to packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.ts index c106622407..84ebbd503a 100644 --- a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.js +++ b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/NavigationAbstract/index.js b/packages/scandipwa/src/component/NavigationAbstract/index.ts similarity index 100% rename from packages/scandipwa/src/component/NavigationAbstract/index.js rename to packages/scandipwa/src/component/NavigationAbstract/index.ts diff --git a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.js b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.js deleted file mode 100644 index 4316f76031..0000000000 --- a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const HOME_TAB = 'HOME_TAB'; -export const MENU_TAB = 'MENU_TAB'; -export const ACCOUNT_TAB = 'ACCOUNT_TAB'; -export const CART_TAB = 'CART_TAB'; -export const CHECKOUT_TAB = 'CHECKOUT_TAB'; diff --git a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.ts b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.ts new file mode 100644 index 0000000000..17e805f6f2 --- /dev/null +++ b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.config.ts @@ -0,0 +1,18 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum NavigationTabs { + HOME_TAB = 'HOME_TAB', + MENU_TAB = 'MENU_TAB', + ACCOUNT_TAB = 'ACCOUNT_TAB', + CART_TAB = 'CART_TAB', + CHECKOUT_TAB = 'CHECKOUT_TAB' +} diff --git a/packages/scandipwa/src/component/NavigationTabs/index.js b/packages/scandipwa/src/component/NavigationTabs/index.ts similarity index 100% rename from packages/scandipwa/src/component/NavigationTabs/index.js rename to packages/scandipwa/src/component/NavigationTabs/index.ts diff --git a/packages/scandipwa/src/component/NewProducts/index.js b/packages/scandipwa/src/component/NewProducts/index.ts similarity index 100% rename from packages/scandipwa/src/component/NewProducts/index.js rename to packages/scandipwa/src/component/NewProducts/index.ts diff --git a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.js b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.ts similarity index 87% rename from packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.js rename to packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.ts index a7c6f67d51..b3d2d64117 100644 --- a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.js +++ b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/NewVersionPopup/index.js b/packages/scandipwa/src/component/NewVersionPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/NewVersionPopup/index.js rename to packages/scandipwa/src/component/NewVersionPopup/index.ts diff --git a/packages/scandipwa/src/component/NewsletterSubscription/index.js b/packages/scandipwa/src/component/NewsletterSubscription/index.ts similarity index 100% rename from packages/scandipwa/src/component/NewsletterSubscription/index.js rename to packages/scandipwa/src/component/NewsletterSubscription/index.ts diff --git a/packages/scandipwa/src/component/NotSupportedPayment/index.js b/packages/scandipwa/src/component/NotSupportedPayment/index.ts similarity index 100% rename from packages/scandipwa/src/component/NotSupportedPayment/index.js rename to packages/scandipwa/src/component/NotSupportedPayment/index.ts diff --git a/packages/scandipwa/src/component/Notification/Notification.config.js b/packages/scandipwa/src/component/Notification/Notification.config.ts similarity index 78% rename from packages/scandipwa/src/component/Notification/Notification.config.js rename to packages/scandipwa/src/component/Notification/Notification.config.ts index 2e443d041d..66cb61a2af 100644 --- a/packages/scandipwa/src/component/Notification/Notification.config.js +++ b/packages/scandipwa/src/component/Notification/Notification.config.ts @@ -1,4 +1,4 @@ -/* eslint-disable import/prefer-default-export */ +import { NotificationType } from 'Store/Notification/Notification.type'; /** * ScandiPWA - Progressive Web App for Magento @@ -15,4 +15,4 @@ export const ANIMATION_DURATION = 400; export const NOTIFICATION_LIFETIME = 1500; export const ERROR_NOTIFICATION_LIFETIME = 2500; -export const ERROR_TYPE = 'error'; +export const ERROR_TYPE = NotificationType.ERROR; diff --git a/packages/scandipwa/src/component/Notification/index.js b/packages/scandipwa/src/component/Notification/index.ts similarity index 100% rename from packages/scandipwa/src/component/Notification/index.js rename to packages/scandipwa/src/component/Notification/index.ts diff --git a/packages/scandipwa/src/component/NotificationList/index.js b/packages/scandipwa/src/component/NotificationList/index.ts similarity index 100% rename from packages/scandipwa/src/component/NotificationList/index.js rename to packages/scandipwa/src/component/NotificationList/index.ts diff --git a/packages/scandipwa/src/component/OfflineNotice/index.js b/packages/scandipwa/src/component/OfflineNotice/index.ts similarity index 100% rename from packages/scandipwa/src/component/OfflineNotice/index.js rename to packages/scandipwa/src/component/OfflineNotice/index.ts diff --git a/packages/scandipwa/src/component/Overlay/index.js b/packages/scandipwa/src/component/Overlay/index.ts similarity index 100% rename from packages/scandipwa/src/component/Overlay/index.js rename to packages/scandipwa/src/component/Overlay/index.ts diff --git a/packages/scandipwa/src/component/Pagination/Pagination.config.js b/packages/scandipwa/src/component/Pagination/Pagination.config.ts similarity index 86% rename from packages/scandipwa/src/component/Pagination/Pagination.config.js rename to packages/scandipwa/src/component/Pagination/Pagination.config.ts index 8ff71f5e60..08498a3192 100644 --- a/packages/scandipwa/src/component/Pagination/Pagination.config.js +++ b/packages/scandipwa/src/component/Pagination/Pagination.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/Pagination/index.js b/packages/scandipwa/src/component/Pagination/index.ts similarity index 100% rename from packages/scandipwa/src/component/Pagination/index.js rename to packages/scandipwa/src/component/Pagination/index.ts diff --git a/packages/scandipwa/src/component/PaginationLink/index.js b/packages/scandipwa/src/component/PaginationLink/index.ts similarity index 100% rename from packages/scandipwa/src/component/PaginationLink/index.js rename to packages/scandipwa/src/component/PaginationLink/index.ts diff --git a/packages/scandipwa/src/component/PasswordChangeForm/index.js b/packages/scandipwa/src/component/PasswordChangeForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/PasswordChangeForm/index.js rename to packages/scandipwa/src/component/PasswordChangeForm/index.ts diff --git a/packages/scandipwa/src/component/Popup/Popup.config.ts b/packages/scandipwa/src/component/Popup/Popup.config.ts new file mode 100644 index 0000000000..831f6b9c27 --- /dev/null +++ b/packages/scandipwa/src/component/Popup/Popup.config.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +import { KeyCode } from 'Component/Field/Keyboard.config'; + +export const ESCAPE_KEY = KeyCode.ESC; diff --git a/packages/scandipwa/src/component/Popup/index.js b/packages/scandipwa/src/component/Popup/index.ts similarity index 100% rename from packages/scandipwa/src/component/Popup/index.js rename to packages/scandipwa/src/component/Popup/index.ts diff --git a/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.js b/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.ts similarity index 87% rename from packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.js rename to packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.ts index cb8a9a88e7..398b2e1b66 100644 --- a/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.js +++ b/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/PopupSuspense/index.js b/packages/scandipwa/src/component/PopupSuspense/index.ts similarity index 100% rename from packages/scandipwa/src/component/PopupSuspense/index.js rename to packages/scandipwa/src/component/PopupSuspense/index.ts diff --git a/packages/scandipwa/src/component/Product/Product.config.js b/packages/scandipwa/src/component/Product/Product.config.js deleted file mode 100644 index 1df6d9495c..0000000000 --- a/packages/scandipwa/src/component/Product/Product.config.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const PRODUCT_TYPE = { - configurable: 'configurable', - grouped: 'grouped', - simple: 'simple', - bundle: 'bundle', - downloadable: 'downloadable', - virtual: 'virtual' -}; - -export default PRODUCT_TYPE; diff --git a/packages/scandipwa/src/component/Product/Product.config.ts b/packages/scandipwa/src/component/Product/Product.config.ts new file mode 100644 index 0000000000..1afe76f10b --- /dev/null +++ b/packages/scandipwa/src/component/Product/Product.config.ts @@ -0,0 +1,19 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum PRODUCT_TYPE { + CONFIGURABLE = 'configurable', + GROUPED = 'grouped', + SIMPLE = 'simple', + BUNDLE = 'bundle', + DOWNLOADABLE = 'downloadable', + VIRTUAL = 'virtual' +} diff --git a/packages/scandipwa/src/component/Product/Stock.config.ts b/packages/scandipwa/src/component/Product/Stock.config.ts index 9637db8b2b..e8fcc2dc2c 100644 --- a/packages/scandipwa/src/component/Product/Stock.config.ts +++ b/packages/scandipwa/src/component/Product/Stock.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -10,12 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -// eslint-disable-next-line import/prefer-default-export -export const STOCK_TYPE = { - IN_STOCK: 'IN_STOCK', - OUT_OF_STOCK: 'OUT_OF_STOCK' -}; - export enum StockStatus { IN_STOCK = 'IN_STOCK', OUT_OF_STOCK = 'OUT_OF_STOCK' diff --git a/packages/scandipwa/src/component/ProductActions/ProductActions.component.js b/packages/scandipwa/src/component/ProductActions/ProductActions.component.js index 5cb563bf1e..8cec7d6cbc 100644 --- a/packages/scandipwa/src/component/ProductActions/ProductActions.component.js +++ b/packages/scandipwa/src/component/ProductActions/ProductActions.component.js @@ -14,7 +14,7 @@ import PropTypes from 'prop-types'; import Html from 'Component/Html'; import { Product } from 'Component/Product/Product.component'; import PRODUCT_TYPE from 'Component/Product/Product.config'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; import ProductAlerts from 'Component/ProductAlerts'; import TextPlaceholder from 'Component/TextPlaceholder'; import TierPrices from 'Component/TierPrices'; @@ -76,16 +76,16 @@ export class ProductActions extends Product { return ( ); @@ -101,21 +101,21 @@ export class ProductActions extends Product { return (
    - { showOnlyIfLoaded( + {showOnlyIfLoaded( sku, ( <> - { this.renderSku() } - { this.renderStock() } + {this.renderSku()} + {this.renderStock()} ), - ) } + )}
    ); } @@ -124,11 +124,11 @@ export class ProductActions extends Product { const { product: { short_description } } = this.props; const { html } = short_description || {}; - const htmlWithItemProp = `
    ${ html }
    `; + const htmlWithItemProp = `
    ${html}
    `; return (
    - { html ? :

    } + {html ? :

    }
    ); } @@ -143,12 +143,12 @@ export class ProductActions extends Product { return (
    - { this.renderShortDescriptionContent() } + {this.renderShortDescriptionContent()}
    ); } @@ -159,8 +159,8 @@ export class ProductActions extends Product { if (offerCount > 1) { return ( ); } @@ -177,17 +177,17 @@ export class ProductActions extends Product { return ( <> - { this.renderOfferCount() } - - - { /* eslint-disable-next-line react/forbid-elements */ } + {this.renderOfferCount()} + + + { /* eslint-disable-next-line react/forbid-elements */} ); @@ -211,15 +211,15 @@ export class ProductActions extends Product { return (
    - { this.renderSchema() } + {this.renderSchema()} - { this.renderPrice() } + {this.renderPrice()}
    ); } @@ -238,13 +238,13 @@ export class ProductActions extends Product { return (
    - { this.renderPriceWithSchema() } + {this.renderPriceWithSchema()}
    ); } @@ -252,11 +252,11 @@ export class ProductActions extends Product { renderReviewSection() { return (
    - { this.renderRatingSummary() } - { this.renderReviewButton() } + {this.renderRatingSummary()} + {this.renderReviewButton()}
    ); } @@ -280,7 +280,7 @@ export class ProductActions extends Product { return (
    - +
    ); } @@ -305,13 +305,13 @@ export class ProductActions extends Product { return (
    ); @@ -320,15 +320,15 @@ export class ProductActions extends Product { renderAddToCartActionBlock() { return (
    - { this.renderQuantityChanger() } - { this.renderAddToCartButton() } + {this.renderQuantityChanger()} + {this.renderAddToCartButton()}
    - { this.renderWishlistButton() } - { this.renderCompareButton() } + {this.renderWishlistButton()} + {this.renderCompareButton()}
    ); @@ -337,13 +337,13 @@ export class ProductActions extends Product { renderAddToCartMobile() { return (
    - { this.renderQuantityChanger() } - { this.renderAddToCartButton() } - { this.renderWishlistButton() } + {this.renderQuantityChanger()} + {this.renderAddToCartButton()} + {this.renderWishlistButton()}
    ); } @@ -351,20 +351,20 @@ export class ProductActions extends Product { renderDesktop() { return ( <> - { this.renderBrand(true) } - { this.renderName() } - { this.renderReviewSection() } - { this.renderSkuAndStock() } - { this.renderShortDescription() } - { this.renderConfigurableOptions() } - { this.renderCustomAndBundleOptions() } - { this.renderGroupedOptions() } - { this.renderDownloadableSamples() } - { this.renderDownloadableLinks() } - { this.renderTierPrices() } - { this.renderProductAlerts() } - { this.renderPriceWithGlobalSchema() } - { this.renderAddToCartActionBlock() } + {this.renderBrand(true)} + {this.renderName()} + {this.renderReviewSection()} + {this.renderSkuAndStock()} + {this.renderShortDescription()} + {this.renderConfigurableOptions()} + {this.renderCustomAndBundleOptions()} + {this.renderGroupedOptions()} + {this.renderDownloadableSamples()} + {this.renderDownloadableLinks()} + {this.renderTierPrices()} + {this.renderProductAlerts()} + {this.renderPriceWithGlobalSchema()} + {this.renderAddToCartActionBlock()} ); } @@ -375,24 +375,24 @@ export class ProductActions extends Product { return ( <> - { this.renderTierPrices() } -
    - { this.renderPriceWithGlobalSchema() } - { this.renderSkuAndStock() } + {this.renderTierPrices()} +
    + {this.renderPriceWithGlobalSchema()} + {this.renderSkuAndStock()}
    - { this.renderReviewSection() } - { this.renderCompareButton() } + {this.renderReviewSection()} + {this.renderCompareButton()}
    - { this.renderBrand(true) } - { this.renderShortDescription() } - { this.renderProductAlerts() } - { this.renderConfigurableOptions() } - { this.renderCustomAndBundleOptions() } - { this.renderGroupedOptions() } - { this.renderDownloadableSamples() } - { this.renderDownloadableLinks() } - { this.renderAddToCartMobile() } + {this.renderBrand(true)} + {this.renderShortDescription()} + {this.renderProductAlerts()} + {this.renderConfigurableOptions()} + {this.renderCustomAndBundleOptions()} + {this.renderGroupedOptions()} + {this.renderDownloadableSamples()} + {this.renderDownloadableLinks()} + {this.renderAddToCartMobile()} ); } @@ -401,8 +401,8 @@ export class ProductActions extends Product { const { device: { isMobile } = {}, setValidator } = this.props; return ( -
    setValidator(elem) }> - { isMobile ? this.renderMobile() : this.renderDesktop() } +
    setValidator(elem)}> + {isMobile ? this.renderMobile() : this.renderDesktop()}
    ); } diff --git a/packages/scandipwa/src/component/ProductActions/ProductActions.config.js b/packages/scandipwa/src/component/ProductActions/ProductActions.config.ts similarity index 87% rename from packages/scandipwa/src/component/ProductActions/ProductActions.config.js rename to packages/scandipwa/src/component/ProductActions/ProductActions.config.ts index 287f89e8b5..ba8ef580ef 100644 --- a/packages/scandipwa/src/component/ProductActions/ProductActions.config.js +++ b/packages/scandipwa/src/component/ProductActions/ProductActions.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ProductActions/ProductActions.container.js b/packages/scandipwa/src/component/ProductActions/ProductActions.container.js index daadc20cd6..6922d1013a 100644 --- a/packages/scandipwa/src/component/ProductActions/ProductActions.container.js +++ b/packages/scandipwa/src/component/ProductActions/ProductActions.container.js @@ -19,7 +19,7 @@ import { mapStateToProps as sourceMapStateToProps, ProductContainer } from 'Component/Product/Product.container'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; import ProductActions from './ProductActions.component'; @@ -105,9 +105,9 @@ export class ProductActionsContainer extends ProductContainer { const { stock_status - } = variants[configurableVariantIndex] || product; + } = variants[ configurableVariantIndex ] || product; - if (stock_status === STOCK_TYPE.IN_STOCK) { + if (stock_status === StockType.IN_STOCK) { return 'https://schema.org/InStock'; } @@ -171,8 +171,8 @@ export class ProductActionsContainer extends ProductContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductActions/index.js b/packages/scandipwa/src/component/ProductActions/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductActions/index.js rename to packages/scandipwa/src/component/ProductActions/index.ts diff --git a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js index 3f7ba99ac3..068c03ee6e 100644 --- a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js +++ b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js @@ -12,7 +12,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; import { StockStatusType } from 'Type/StockStatus.type'; import './ProductAlerts.style'; @@ -42,11 +42,11 @@ export class ProductAlerts extends PureComponent { return ( ); } @@ -62,17 +62,17 @@ export class ProductAlerts extends PureComponent { return null; } - if (stockStatus === STOCK_TYPE.IN_STOCK || !stockStatus) { + if (stockStatus === StockType.IN_STOCK || !stockStatus) { return null; } return ( ); } @@ -80,11 +80,11 @@ export class ProductAlerts extends PureComponent { render() { return (
    - { this.renderPriceDropSubscribeButton() } - { this.renderInStockSubscribeButton() } + {this.renderPriceDropSubscribeButton()} + {this.renderInStockSubscribeButton()}
    ); } diff --git a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.js b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.js deleted file mode 100644 index e91f42744e..0000000000 --- a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const PRODUCT_ALERT_PRICE_DROP = 'PRODUCT_ALERT_PRICE_DROP'; -export const PRODUCT_ALERT_IN_STOCK = 'PRODUCT_ALERT_IN_STOCK'; diff --git a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.ts b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.ts new file mode 100644 index 0000000000..768215fd30 --- /dev/null +++ b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.config.ts @@ -0,0 +1,15 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum ProductAlert { + PRICE_DROP = 'PRODUCT_ALERT_PRICE_DROP', + IN_STOCK = 'PRODUCT_ALERT_IN_STOCK' +} diff --git a/packages/scandipwa/src/component/ProductAlerts/index.js b/packages/scandipwa/src/component/ProductAlerts/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductAlerts/index.js rename to packages/scandipwa/src/component/ProductAlerts/index.ts diff --git a/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.js b/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.ts similarity index 87% rename from packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.js rename to packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.ts index 9479517273..c4d6784865 100644 --- a/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.js +++ b/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ProductAttributeValue/index.js b/packages/scandipwa/src/component/ProductAttributeValue/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductAttributeValue/index.js rename to packages/scandipwa/src/component/ProductAttributeValue/index.ts diff --git a/packages/scandipwa/src/component/ProductAttributes/index.js b/packages/scandipwa/src/component/ProductAttributes/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductAttributes/index.js rename to packages/scandipwa/src/component/ProductAttributes/index.ts diff --git a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.js b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.ts similarity index 90% rename from packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.js rename to packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.ts index 06595aafd3..f0ce2dfe49 100644 --- a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.js +++ b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.config.ts @@ -10,5 +10,3 @@ */ export const DEFAULT_SORT_FIELD = 'position'; - -export default DEFAULT_SORT_FIELD; diff --git a/packages/scandipwa/src/component/ProductBundleOption/index.js b/packages/scandipwa/src/component/ProductBundleOption/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductBundleOption/index.js rename to packages/scandipwa/src/component/ProductBundleOption/index.ts diff --git a/packages/scandipwa/src/component/ProductBundleOptions/index.js b/packages/scandipwa/src/component/ProductBundleOptions/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductBundleOptions/index.js rename to packages/scandipwa/src/component/ProductBundleOptions/index.ts diff --git a/packages/scandipwa/src/component/ProductCard/ProductCard.config.js b/packages/scandipwa/src/component/ProductCard/ProductCard.config.js deleted file mode 100644 index f3f2cd1916..0000000000 --- a/packages/scandipwa/src/component/ProductCard/ProductCard.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const OPTION_TYPE_IMAGE = '2'; -export const OPTION_TYPE_COLOR = '1'; -export const OPTION_TYPE_TEXT = '0'; -export const validOptionTypes = [OPTION_TYPE_TEXT, OPTION_TYPE_COLOR, OPTION_TYPE_IMAGE]; - -export const TIER_PRICES = 'TIER_PRICES'; diff --git a/packages/scandipwa/src/component/ProductCard/index.js b/packages/scandipwa/src/component/ProductCard/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCard/index.js rename to packages/scandipwa/src/component/ProductCard/index.ts diff --git a/packages/scandipwa/src/component/ProductCompare/ProductCompare.config.js b/packages/scandipwa/src/component/ProductCompare/ProductCompare.config.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompare/ProductCompare.config.js rename to packages/scandipwa/src/component/ProductCompare/ProductCompare.config.ts diff --git a/packages/scandipwa/src/component/ProductCompare/index.js b/packages/scandipwa/src/component/ProductCompare/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompare/index.js rename to packages/scandipwa/src/component/ProductCompare/index.ts diff --git a/packages/scandipwa/src/component/ProductCompareAttributeRow/index.js b/packages/scandipwa/src/component/ProductCompareAttributeRow/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompareAttributeRow/index.js rename to packages/scandipwa/src/component/ProductCompareAttributeRow/index.ts diff --git a/packages/scandipwa/src/component/ProductCompareButton/index.js b/packages/scandipwa/src/component/ProductCompareButton/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompareButton/index.js rename to packages/scandipwa/src/component/ProductCompareButton/index.ts diff --git a/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.config.js b/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.config.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.config.js rename to packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.config.ts diff --git a/packages/scandipwa/src/component/ProductCompareItem/index.js b/packages/scandipwa/src/component/ProductCompareItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCompareItem/index.js rename to packages/scandipwa/src/component/ProductCompareItem/index.ts diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/index.js b/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/index.js rename to packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/index.ts diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.config.js b/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.config.ts similarity index 100% rename from packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.config.js rename to packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.config.ts diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.container.js b/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.container.js index f0a2ddc579..6e0110ac13 100644 --- a/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.container.js +++ b/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.container.js @@ -12,7 +12,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; import { BIG_PLACEHOLDER_CONFIG } from 'Component/ProductConfigurableAttributes/ProductConfigurableAttributes.config'; @@ -32,7 +32,7 @@ export class ProductConfigurableAttributesContainer extends PureComponent { updateConfigurableVariant: PropTypes.func.isRequired, isExpandable: PropTypes.bool, showProductAttributeAsLink: PropTypes.bool, - variants: PropTypes.oneOfType([ItemsType, ItemType]), + variants: PropTypes.oneOfType([ ItemsType, ItemType ]), mix: MixType, isReady: PropTypes.bool, numberOfPlaceholders: PropTypes.arrayOf(PropTypes.number), @@ -111,7 +111,7 @@ export class ProductConfigurableAttributesContainer extends PureComponent { attribute_code, attribute_value }) - ? [...acc, getBooleanLabel(attribute_options[attribute_value].label, is_boolean)] + ? [ ...acc, getBooleanLabel(attribute_options[ attribute_value ].label, is_boolean) ] : acc), []).join(', '); } @@ -122,7 +122,7 @@ export class ProductConfigurableAttributesContainer extends PureComponent { isSelected({ attribute_code, attribute_value }) { const { parameters = {} } = this.props; - const parameter = parameters[attribute_code]; + const parameter = parameters[ attribute_code ]; if (parameter === undefined) { return false; @@ -154,7 +154,7 @@ export class ProductConfigurableAttributesContainer extends PureComponent { const isAttributeSelected = Object.hasOwnProperty.call(parameters, attribute_code); // If value matches current attribute_value, option should be enabled - if (isAttributeSelected && parameters[attribute_code] === attribute_value) { + if (isAttributeSelected && parameters[ attribute_code ] === attribute_value) { return true; } @@ -162,19 +162,19 @@ export class ProductConfigurableAttributesContainer extends PureComponent { const selectedAttributes = isAttributeSelected // Need to exclude itself, otherwise different attribute_values of the same attribute_code will always be disabled - ? parameterPairs.filter(([key]) => key !== attribute_code) + ? parameterPairs.filter(([ key ]) => key !== attribute_code) : parameterPairs; return variants .some(({ stock_status, attributes }) => { - const { attribute_value: foundValue } = attributes[attribute_code] || {}; + const { attribute_value: foundValue } = attributes[ attribute_code ] || {}; return ( - stock_status === STOCK_TYPE.IN_STOCK + stock_status === StockType.IN_STOCK // Variant must have currently checked attribute_code and attribute_value && foundValue === attribute_value // Variant must have all currently selected attributes - && selectedAttributes.every(([key, value]) => attributes[key].attribute_value === value) + && selectedAttributes.every(([ key, value ]) => attributes[ key ].attribute_value === value) ); }); } @@ -182,8 +182,8 @@ export class ProductConfigurableAttributesContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributes/index.js b/packages/scandipwa/src/component/ProductConfigurableAttributes/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductConfigurableAttributes/index.js rename to packages/scandipwa/src/component/ProductConfigurableAttributes/index.ts diff --git a/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.js b/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.ts similarity index 66% rename from packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.js rename to packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.ts index 3f9fed697d..23471685b5 100644 --- a/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.js +++ b/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.config.ts @@ -10,18 +10,18 @@ */ import { FIELD_RADIO_NONE } from 'Component/Field/Field.config'; -export const CONFIG_FIELD_TYPE = { - text: 'field', - radio: 'radio', - checkbox: 'checkbox', - textarea: 'area', - select: 'drop_down', - file: 'file', - date: 'date', - dateTime: 'date_time', - time: 'time', - multi: 'multiple' -}; +export enum ConfigFieldType { + TEXT = 'field', + RADIO = 'radio', + CHECKBOX = 'checkbox', + TEXTAREA = 'area', + SELECT = 'drop_down', + FILE = 'file', + DATE = 'date', + DATETIME = 'date_time', + TIME = 'time', + MULTI = 'multiple' +} export const NONE_RADIO_OPTION = { title: __('None'), @@ -32,5 +32,3 @@ export const NONE_RADIO_OPTION = { can_change_quantity: false, priceInclTax: 0 }; - -export default CONFIG_FIELD_TYPE; diff --git a/packages/scandipwa/src/component/ProductCustomizableOption/index.js b/packages/scandipwa/src/component/ProductCustomizableOption/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCustomizableOption/index.js rename to packages/scandipwa/src/component/ProductCustomizableOption/index.ts diff --git a/packages/scandipwa/src/component/ProductCustomizableOptions/index.js b/packages/scandipwa/src/component/ProductCustomizableOptions/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductCustomizableOptions/index.js rename to packages/scandipwa/src/component/ProductCustomizableOptions/index.ts diff --git a/packages/scandipwa/src/component/ProductDownloadableLinks/index.js b/packages/scandipwa/src/component/ProductDownloadableLinks/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductDownloadableLinks/index.js rename to packages/scandipwa/src/component/ProductDownloadableLinks/index.ts diff --git a/packages/scandipwa/src/component/ProductDownloadableSamples/index.js b/packages/scandipwa/src/component/ProductDownloadableSamples/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductDownloadableSamples/index.js rename to packages/scandipwa/src/component/ProductDownloadableSamples/index.ts diff --git a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts index 4b44d52168..bed46b097d 100644 --- a/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts +++ b/packages/scandipwa/src/component/ProductGallery/ProductGallery.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * @@ -11,19 +9,21 @@ * @link https://github.com/scandipwa/base-theme */ -export const MAX_ZOOM_SCALE = 8; +export enum ImageType { + SMALL = 'small_image', + THUMBNAIL = 'thumbnail', + IMAGE = 'image' +} + +export enum MediaType { + IMAGE = 'image', + VIDEO = 'external-video', + PLACEHOLDER = 'placeholder' +} -export const IMAGE_TYPE = 'image'; -export const VIDEO_TYPE = 'external-video'; -export const PLACEHOLDER_TYPE = 'placeholder'; +export const MAX_ZOOM_SCALE = 8; -export const THUMBNAIL_KEY = 'small_image'; +export const THUMBNAIL_KEY = ImageType.SMALL; export const AMOUNT_OF_PLACEHOLDERS = 0; export const PRODUCT_GALERY_POPUP_ID = 'ProductGalleryPopup'; - -export enum ImageTypes { - SMALL_KEY = 'small_image', - THUMBNAIL_KEY = 'thumbnail', - IMAGE_KEY = 'image' -} diff --git a/packages/scandipwa/src/component/ProductGallery/index.js b/packages/scandipwa/src/component/ProductGallery/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductGallery/index.js rename to packages/scandipwa/src/component/ProductGallery/index.ts diff --git a/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.config.js b/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.config.ts similarity index 100% rename from packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.config.js rename to packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.config.ts diff --git a/packages/scandipwa/src/component/ProductGalleryBaseImage/index.js b/packages/scandipwa/src/component/ProductGalleryBaseImage/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductGalleryBaseImage/index.js rename to packages/scandipwa/src/component/ProductGalleryBaseImage/index.ts diff --git a/packages/scandipwa/src/component/ProductGalleryThumbnailImage/index.js b/packages/scandipwa/src/component/ProductGalleryThumbnailImage/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductGalleryThumbnailImage/index.js rename to packages/scandipwa/src/component/ProductGalleryThumbnailImage/index.ts diff --git a/packages/scandipwa/src/component/ProductInformation/index.js b/packages/scandipwa/src/component/ProductInformation/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductInformation/index.js rename to packages/scandipwa/src/component/ProductInformation/index.ts diff --git a/packages/scandipwa/src/component/ProductLinks/index.js b/packages/scandipwa/src/component/ProductLinks/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductLinks/index.js rename to packages/scandipwa/src/component/ProductLinks/index.ts diff --git a/packages/scandipwa/src/component/ProductList/ProductList.component.js b/packages/scandipwa/src/component/ProductList/ProductList.component.js index 6bfc3e2606..52c6715251 100644 --- a/packages/scandipwa/src/component/ProductList/ProductList.component.js +++ b/packages/scandipwa/src/component/ProductList/ProductList.component.js @@ -21,7 +21,7 @@ import { PagesType } from 'Type/ProductList.type'; import { scrollToTop } from 'Util/Browser'; import { noopFn } from 'Util/Common'; -import { observerThreshold } from './ProductList.config'; +import { OBSERVER_THRESHOLD } from './ProductList.config'; import './ProductList.style'; @@ -111,7 +111,7 @@ export class ProductList extends PureComponent { const { currentPage } = this.props; entries.forEach(({ target, isIntersecting }) => { - const page = +Object.keys(this.nodes).find((node) => this.nodes[node] === target); + const page = +Object.keys(this.nodes).find((node) => this.nodes[ node ] === target); const index = this.pagesIntersecting.indexOf(page); if (isIntersecting && index === -1) { @@ -166,8 +166,8 @@ export class ProductList extends PureComponent { const hundredPercent = 100; return Array.from( - { length: (hundredPercent / observerThreshold) + 1 }, - (_, i) => i * (observerThreshold / hundredPercent) + { length: (hundredPercent / OBSERVER_THRESHOLD) + 1 }, + (_, i) => i * (OBSERVER_THRESHOLD / hundredPercent) ); } @@ -184,14 +184,14 @@ export class ProductList extends PureComponent { return (
    - { __('Load previous') } + {__('Load previous')}
    ); } @@ -200,12 +200,12 @@ export class ProductList extends PureComponent { return (
    -

    { __('We are sorry!') }

    -

    { __('There were no products found matching your request.') }

    -

    { __('Please, try removing selected filters and try again!') }

    +

    {__('We are sorry!')}

    +

    {__('There were no products found matching your request.')}

    +

    {__('Please, try removing selected filters and try again!')}

    ); @@ -267,22 +267,22 @@ export class ProductList extends PureComponent { return ( ); } - renderProductPage([key, items = []]) { + renderProductPage([ key, items = [] ]) { const { selectedFilters } = this.props; const pageNumber = +key; @@ -293,7 +293,7 @@ export class ProductList extends PureComponent { items, key, wrapperRef: (node) => { - this.nodes[pageNumber] = node; + this.nodes[ pageNumber ] = node; } }); } @@ -311,8 +311,8 @@ export class ProductList extends PureComponent { return ( ); } @@ -325,7 +325,7 @@ export class ProductList extends PureComponent { } return ( -

    { title }

    +

    {title}

    ); } @@ -342,14 +342,14 @@ export class ProductList extends PureComponent { return (
    - { this.renderTitle() } - { this.renderLoadButton() } - { this.renderPages() } - { this.renderPagination() } + {this.renderTitle()} + {this.renderLoadButton()} + {this.renderPages()} + {this.renderPagination()}
    ); } diff --git a/packages/scandipwa/src/component/ProductList/ProductList.config.js b/packages/scandipwa/src/component/ProductList/ProductList.config.ts similarity index 89% rename from packages/scandipwa/src/component/ProductList/ProductList.config.js rename to packages/scandipwa/src/component/ProductList/ProductList.config.ts index a20ce401aa..b2a079e4c3 100644 --- a/packages/scandipwa/src/component/ProductList/ProductList.config.js +++ b/packages/scandipwa/src/component/ProductList/ProductList.config.ts @@ -8,6 +8,6 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -export const observerThreshold = 10; +export const OBSERVER_THRESHOLD = 10; export const INTERSECTION_RATIO = 0.5; diff --git a/packages/scandipwa/src/component/ProductList/index.js b/packages/scandipwa/src/component/ProductList/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductList/index.js rename to packages/scandipwa/src/component/ProductList/index.ts diff --git a/packages/scandipwa/src/component/ProductListPage/ProductListPage.config.js b/packages/scandipwa/src/component/ProductListPage/ProductListPage.config.ts similarity index 87% rename from packages/scandipwa/src/component/ProductListPage/ProductListPage.config.js rename to packages/scandipwa/src/component/ProductListPage/ProductListPage.config.ts index f4a17b05f2..b44cda95fa 100644 --- a/packages/scandipwa/src/component/ProductListPage/ProductListPage.config.js +++ b/packages/scandipwa/src/component/ProductListPage/ProductListPage.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ProductListPage/index.js b/packages/scandipwa/src/component/ProductListPage/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductListPage/index.js rename to packages/scandipwa/src/component/ProductListPage/index.ts diff --git a/packages/scandipwa/src/component/ProductListWidget/index.js b/packages/scandipwa/src/component/ProductListWidget/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductListWidget/index.js rename to packages/scandipwa/src/component/ProductListWidget/index.ts diff --git a/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.js b/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.js deleted file mode 100644 index 82bd3bb3f3..0000000000 --- a/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const DISPLAY_PRODUCT_PRICES_IN_CATALOG_INCL_TAX = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_INCL_TAX'; -export const DISPLAY_PRODUCT_PRICES_IN_CATALOG_EXCL_TAX = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_EXCL_TAX'; -export const DISPLAY_PRODUCT_PRICES_IN_CATALOG_BOTH = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_BOTH'; diff --git a/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.ts b/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.ts new file mode 100644 index 0000000000..53cc1ad25a --- /dev/null +++ b/packages/scandipwa/src/component/ProductPrice/ProductPrice.config.ts @@ -0,0 +1,16 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum DisplayProductPricesInCatalog { + INCL_TAX = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_INCL_TAX', + EXCL_TAX = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_EXCL_TAX', + BOTH = 'DISPLAY_PRODUCT_PRICES_IN_CATALOG_BOTH' +} diff --git a/packages/scandipwa/src/component/ProductPrice/index.js b/packages/scandipwa/src/component/ProductPrice/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductPrice/index.js rename to packages/scandipwa/src/component/ProductPrice/index.ts diff --git a/packages/scandipwa/src/component/ProductReviewForm/index.js b/packages/scandipwa/src/component/ProductReviewForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviewForm/index.js rename to packages/scandipwa/src/component/ProductReviewForm/index.ts diff --git a/packages/scandipwa/src/component/ProductReviewItem/index.js b/packages/scandipwa/src/component/ProductReviewItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviewItem/index.js rename to packages/scandipwa/src/component/ProductReviewItem/index.ts diff --git a/packages/scandipwa/src/component/ProductReviewList/index.js b/packages/scandipwa/src/component/ProductReviewList/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviewList/index.js rename to packages/scandipwa/src/component/ProductReviewList/index.ts diff --git a/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.config.js b/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.config.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.config.js rename to packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.config.ts diff --git a/packages/scandipwa/src/component/ProductReviewRating/index.js b/packages/scandipwa/src/component/ProductReviewRating/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviewRating/index.js rename to packages/scandipwa/src/component/ProductReviewRating/index.ts diff --git a/packages/scandipwa/src/component/ProductReviews/ProductReviews.config.js b/packages/scandipwa/src/component/ProductReviews/ProductReviews.config.ts similarity index 87% rename from packages/scandipwa/src/component/ProductReviews/ProductReviews.config.js rename to packages/scandipwa/src/component/ProductReviews/ProductReviews.config.ts index 63684b2635..6d883970de 100644 --- a/packages/scandipwa/src/component/ProductReviews/ProductReviews.config.js +++ b/packages/scandipwa/src/component/ProductReviews/ProductReviews.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ProductReviews/index.js b/packages/scandipwa/src/component/ProductReviews/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductReviews/index.js rename to packages/scandipwa/src/component/ProductReviews/index.ts diff --git a/packages/scandipwa/src/component/ProductTab/index.js b/packages/scandipwa/src/component/ProductTab/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductTab/index.js rename to packages/scandipwa/src/component/ProductTab/index.ts diff --git a/packages/scandipwa/src/component/ProductTabs/index.js b/packages/scandipwa/src/component/ProductTabs/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductTabs/index.js rename to packages/scandipwa/src/component/ProductTabs/index.ts diff --git a/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.js b/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.ts similarity index 88% rename from packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.js rename to packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.ts index bc557cccb3..9d5ff4c97d 100644 --- a/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.js +++ b/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ProductWishlistButton/index.js b/packages/scandipwa/src/component/ProductWishlistButton/index.ts similarity index 100% rename from packages/scandipwa/src/component/ProductWishlistButton/index.js rename to packages/scandipwa/src/component/ProductWishlistButton/index.ts diff --git a/packages/scandipwa/src/component/PurchaseOrder/index.js b/packages/scandipwa/src/component/PurchaseOrder/index.ts similarity index 100% rename from packages/scandipwa/src/component/PurchaseOrder/index.js rename to packages/scandipwa/src/component/PurchaseOrder/index.ts diff --git a/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.js b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx similarity index 90% rename from packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.js rename to packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx index 8945e8552f..033ca2ea63 100644 --- a/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.js +++ b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx @@ -9,22 +9,19 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { RadioButtonIconProps } from './RadioButtonIcon.type'; + import './RadioButtonIcon.style'; /** @namespace Component/RadioButtonIcon/Component */ -export class RadioButton extends PureComponent { - static propTypes = { - isActive: PropTypes.bool - }; - +export class RadioButton extends PureComponent { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.type.ts b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.type.ts new file mode 100644 index 0000000000..6ea90eaa1e --- /dev/null +++ b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface RadioButtonIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/RadioButtonIcon/index.js b/packages/scandipwa/src/component/RadioButtonIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/RadioButtonIcon/index.js rename to packages/scandipwa/src/component/RadioButtonIcon/index.ts diff --git a/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.config.js b/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.config.ts similarity index 100% rename from packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.config.js rename to packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.config.ts diff --git a/packages/scandipwa/src/component/RecentlyViewedWidget/index.js b/packages/scandipwa/src/component/RecentlyViewedWidget/index.ts similarity index 100% rename from packages/scandipwa/src/component/RecentlyViewedWidget/index.js rename to packages/scandipwa/src/component/RecentlyViewedWidget/index.ts diff --git a/packages/scandipwa/src/component/RenderWhenVisible/index.js b/packages/scandipwa/src/component/RenderWhenVisible/index.ts similarity index 100% rename from packages/scandipwa/src/component/RenderWhenVisible/index.js rename to packages/scandipwa/src/component/RenderWhenVisible/index.ts diff --git a/packages/scandipwa/src/component/ResetAttributes/index.js b/packages/scandipwa/src/component/ResetAttributes/index.ts similarity index 100% rename from packages/scandipwa/src/component/ResetAttributes/index.js rename to packages/scandipwa/src/component/ResetAttributes/index.ts diff --git a/packages/scandipwa/src/component/ResetButton/index.js b/packages/scandipwa/src/component/ResetButton/index.ts similarity index 100% rename from packages/scandipwa/src/component/ResetButton/index.js rename to packages/scandipwa/src/component/ResetButton/index.ts diff --git a/packages/scandipwa/src/component/ReviewStar/index.js b/packages/scandipwa/src/component/ReviewStar/index.ts similarity index 100% rename from packages/scandipwa/src/component/ReviewStar/index.js rename to packages/scandipwa/src/component/ReviewStar/index.ts diff --git a/packages/scandipwa/src/component/Router/Router.config.js b/packages/scandipwa/src/component/Router/Router.config.js deleted file mode 100644 index c063af5a0f..0000000000 --- a/packages/scandipwa/src/component/Router/Router.config.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ -export const BEFORE_ITEMS_TYPE = 'BEFORE_ITEMS_TYPE'; -export const SWITCH_ITEMS_TYPE = 'SWITCH_ITEMS_TYPE'; -export const AFTER_ITEMS_TYPE = 'AFTER_ITEMS_TYPE'; - -// BEFORE_ITEMS_TYPE -export const NOTIFICATION_LIST = 'NOTIFICATION_LIST'; -export const NAVIGATION_TABS = 'NAVIGATION_TABS'; -export const DEMO_NOTICE = 'DEMO_NOTICE'; -export const HEADER = 'HEADER'; -export const BREADCRUMBS = 'BREADCRUMBS'; -export const NEW_VERSION_POPUP = 'NEW_VERSION_POPUP'; - -// SWITCH_ITEMS_TYPE -export const HOME = 'HOME'; -export const SEARCH = 'SEARCH'; -export const CMS_PAGE = 'CMS_PAGE'; -export const CART = 'CART'; -export const CHECKOUT = 'CHECKOUT'; -export const CHANGE_PASSWORD = 'CHANGE_PASSWORD'; -export const CREATE_ACCOUNT = 'CREATE_ACCOUNT'; -export const LOGIN = 'LOGIN'; -export const ACCOUNT_FORGOT_PASSWORD = 'ACCOUNT_FORGOT_PASSWORD'; -export const FORGOT_PASSWORD = 'FORGOT_PASSWORD'; -export const CONFIRM_ACCOUNT = 'CONFIRM_ACCOUNT'; -export const MY_ACCOUNT = 'MY_ACCOUNT'; -export const MY_ACCOUNT_ORDER = 'MY_ACCOUNT_ORDER'; -export const MY_ACCOUNT_ORDERS = 'MY_ACCOUNT_ORDERS'; -export const MY_ACCOUNT_DOWNLOADABLE = 'MY_ACCOUNT_DOWNLOADABLE'; -export const MY_ACCOUNT_WISHLIST = 'MY_ACCOUNT_WISHLIST'; -export const MY_ACCOUNT_ADDRESS = 'MY_ACCOUNT_ADDRESS'; -export const MY_ACCOUNT_NEWSLETTER = 'MY_ACCOUNT_NEWSLETTER'; -export const MENU = 'MENU'; -export const SHARED_WISHLIST = 'SHARED_WISHLIST'; -export const CONTACT_PAGE = 'CONTACT_PAGE'; -export const COMPARE = 'COMPARE'; -export const STYLE_GUIDE = 'STYLE_GUIDE'; -export const URL_REWRITES = 'URL_REWRITES'; - -// AFTER_ITEMS_TYPE -export const FOOTER = 'FOOTER'; -export const COOKIE_POPUP = 'COOKIE_POPUP'; diff --git a/packages/scandipwa/src/component/Router/Router.config.ts b/packages/scandipwa/src/component/Router/Router.config.ts new file mode 100644 index 0000000000..06b59117b1 --- /dev/null +++ b/packages/scandipwa/src/component/Router/Router.config.ts @@ -0,0 +1,57 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum RouterItemType { + BEFORE_ITEMS_TYPE = 'BEFORE_ITEMS_TYPE', + SWITCH_ITEMS_TYPE = 'SWITCH_ITEMS_TYPE', + AFTER_ITEMS_TYPE = 'AFTER_ITEMS_TYPE' +} + +export enum RouterBeforeItemType { + NOTIFICATION_LIST = 'NOTIFICATION_LIST', + NAVIGATION_TABS = 'NAVIGATION_TABS', + DEMO_NOTICE = 'DEMO_NOTICE', + HEADER = 'HEADER', + BREADCRUMBS = 'BREADCRUMBS', + NEW_VERSION_POPUP = 'NEW_VERSION_POPUP' +} + +export enum RouterSwitchItemType { + HOME = 'HOME', + SEARCH = 'SEARCH', + CMS_PAGE = 'CMS_PAGE', + CART = 'CART', + CHECKOUT = 'CHECKOUT', + CHANGE_PASSWORD = 'CHANGE_PASSWORD', + CREATE_ACCOUNT = 'CREATE_ACCOUNT', + LOGIN = 'LOGIN', + ACCOUNT_FORGOT_PASSWORD = 'ACCOUNT_FORGOT_PASSWORD', + FORGOT_PASSWORD = 'FORGOT_PASSWORD', + CONFIRM_ACCOUNT = 'CONFIRM_ACCOUNT', + MY_ACCOUNT = 'MY_ACCOUNT', + MY_ACCOUNT_ORDER = 'MY_ACCOUNT_ORDER', + MY_ACCOUNT_ORDERS = 'MY_ACCOUNT_ORDERS', + MY_ACCOUNT_DOWNLOADABLE = 'MY_ACCOUNT_DOWNLOADABLE', + MY_ACCOUNT_WISHLIST = 'MY_ACCOUNT_WISHLIST', + MY_ACCOUNT_ADDRESS = 'MY_ACCOUNT_ADDRESS', + MY_ACCOUNT_NEWSLETTER = 'MY_ACCOUNT_NEWSLETTER', + MENU = 'MENU', + SHARED_WISHLIST = 'SHARED_WISHLIST', + CONTACT_PAGE = 'CONTACT_PAGE', + COMPARE = 'COMPARE', + STYLE_GUIDE = 'STYLE_GUIDE', + URL_REWRITES = 'URL_REWRITES' +} + +export enum RouterAfterItemType { + FOOTER = 'FOOTER', + COOKIE_POPUP = 'COOKIE_POPUP' +} diff --git a/packages/scandipwa/src/component/Router/index.js b/packages/scandipwa/src/component/Router/index.ts similarity index 100% rename from packages/scandipwa/src/component/Router/index.js rename to packages/scandipwa/src/component/Router/index.ts diff --git a/packages/scandipwa/src/component/SearchField/index.js b/packages/scandipwa/src/component/SearchField/index.ts similarity index 100% rename from packages/scandipwa/src/component/SearchField/index.js rename to packages/scandipwa/src/component/SearchField/index.ts diff --git a/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.js b/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx similarity index 97% rename from packages/scandipwa/src/component/SearchIcon/SearchIcon.component.js rename to packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx index 613afc4dfb..0909418206 100644 --- a/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.js +++ b/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx @@ -15,7 +15,7 @@ import './SearchIcon.style'; /** @namespace Component/SearchIcon/Component */ export class SearchIcon extends PureComponent { - render() { + render(): JSX.Element { return ( { static defaultProps = { isPrimary: false }; - render() { + render(): JSX.Element { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/ShareIcon/ShareIcon.type.ts b/packages/scandipwa/src/component/ShareIcon/ShareIcon.type.ts new file mode 100644 index 0000000000..d6ca8daac4 --- /dev/null +++ b/packages/scandipwa/src/component/ShareIcon/ShareIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface ShareIconProps { + isPrimary: boolean; +} diff --git a/packages/scandipwa/src/component/ShareIcon/index.js b/packages/scandipwa/src/component/ShareIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/ShareIcon/index.js rename to packages/scandipwa/src/component/ShareIcon/index.ts diff --git a/packages/scandipwa/src/component/ShareWishlistForm/index.js b/packages/scandipwa/src/component/ShareWishlistForm/index.ts similarity index 100% rename from packages/scandipwa/src/component/ShareWishlistForm/index.js rename to packages/scandipwa/src/component/ShareWishlistForm/index.ts diff --git a/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.js b/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.ts similarity index 87% rename from packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.js rename to packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.ts index 527849ec79..12730ecf51 100644 --- a/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.js +++ b/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/ShareWishlistPopup/index.js b/packages/scandipwa/src/component/ShareWishlistPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/ShareWishlistPopup/index.js rename to packages/scandipwa/src/component/ShareWishlistPopup/index.ts diff --git a/packages/scandipwa/src/component/SharedTransition/SharedTransition.config.js b/packages/scandipwa/src/component/SharedTransition/SharedTransition.config.ts similarity index 87% rename from packages/scandipwa/src/component/SharedTransition/SharedTransition.config.js rename to packages/scandipwa/src/component/SharedTransition/SharedTransition.config.ts index 530ca3e38e..3d659a100f 100644 --- a/packages/scandipwa/src/component/SharedTransition/SharedTransition.config.js +++ b/packages/scandipwa/src/component/SharedTransition/SharedTransition.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/SharedTransition/index.js b/packages/scandipwa/src/component/SharedTransition/index.ts similarity index 100% rename from packages/scandipwa/src/component/SharedTransition/index.js rename to packages/scandipwa/src/component/SharedTransition/index.ts diff --git a/packages/scandipwa/src/component/SharedWishlistItem/index.js b/packages/scandipwa/src/component/SharedWishlistItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/SharedWishlistItem/index.js rename to packages/scandipwa/src/component/SharedWishlistItem/index.ts diff --git a/packages/scandipwa/src/component/Slider/Slider.config.js b/packages/scandipwa/src/component/Slider/Slider.config.ts similarity index 100% rename from packages/scandipwa/src/component/Slider/Slider.config.js rename to packages/scandipwa/src/component/Slider/Slider.config.ts diff --git a/packages/scandipwa/src/component/Slider/index.js b/packages/scandipwa/src/component/Slider/index.ts similarity index 100% rename from packages/scandipwa/src/component/Slider/index.js rename to packages/scandipwa/src/component/Slider/index.ts diff --git a/packages/scandipwa/src/component/SliderWidget/index.js b/packages/scandipwa/src/component/SliderWidget/index.ts similarity index 100% rename from packages/scandipwa/src/component/SliderWidget/index.js rename to packages/scandipwa/src/component/SliderWidget/index.ts diff --git a/packages/scandipwa/src/component/StarIcon/StarIcon.component.js b/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx similarity index 89% rename from packages/scandipwa/src/component/StarIcon/StarIcon.component.js rename to packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx index f6ce3cddaa..fe23c4571f 100644 --- a/packages/scandipwa/src/component/StarIcon/StarIcon.component.js +++ b/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx @@ -9,35 +9,31 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { STAR_EMPTY, STAR_FULL, STAR_HALF_FULL } from './StarIcon.config'; +import { StartFill } from './StarIcon.config'; +import { StarIconProps } from './StarIcon.type'; import './StarIcon.style'; /** @namespace Component/StarIcon/Component */ -export class AddIcon extends PureComponent { - static propTypes = { - starFill: PropTypes.oneOf([STAR_HALF_FULL, STAR_EMPTY, STAR_FULL]).isRequired - }; - - getStarPath() { +export class AddIcon extends PureComponent { + getStarPath(): JSX.Element | null { const { starFill } = this.props; - if (starFill === STAR_EMPTY) { + if (starFill === StartFill.EMPTY) { return ( ); } - if (starFill === STAR_HALF_FULL) { + if (starFill === StartFill.HALF_FULL) { return ( ); } - if (starFill === STAR_FULL) { + if (starFill === StartFill.FULL) { return ( ); @@ -46,7 +42,7 @@ export class AddIcon extends PureComponent { return null; } - render() { + render(): JSX.Element { return ( { static defaultProps = { isActive: false }; - render() { + render(): JSX.Element { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/UserIcon/UserIcon.type.ts b/packages/scandipwa/src/component/UserIcon/UserIcon.type.ts new file mode 100644 index 0000000000..603d480625 --- /dev/null +++ b/packages/scandipwa/src/component/UserIcon/UserIcon.type.ts @@ -0,0 +1,14 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +export interface UserIconProps { + isActive: boolean; +} diff --git a/packages/scandipwa/src/component/UserIcon/index.js b/packages/scandipwa/src/component/UserIcon/index.ts similarity index 100% rename from packages/scandipwa/src/component/UserIcon/index.js rename to packages/scandipwa/src/component/UserIcon/index.ts diff --git a/packages/scandipwa/src/component/VideoPopup/VideoPopup.config.js b/packages/scandipwa/src/component/VideoPopup/VideoPopup.config.ts similarity index 92% rename from packages/scandipwa/src/component/VideoPopup/VideoPopup.config.js rename to packages/scandipwa/src/component/VideoPopup/VideoPopup.config.ts index e4f9f8287a..e66d8d9b97 100644 --- a/packages/scandipwa/src/component/VideoPopup/VideoPopup.config.js +++ b/packages/scandipwa/src/component/VideoPopup/VideoPopup.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/VideoPopup/index.js b/packages/scandipwa/src/component/VideoPopup/index.ts similarity index 100% rename from packages/scandipwa/src/component/VideoPopup/index.js rename to packages/scandipwa/src/component/VideoPopup/index.ts diff --git a/packages/scandipwa/src/component/VideoThumbnail/index.js b/packages/scandipwa/src/component/VideoThumbnail/index.ts similarity index 100% rename from packages/scandipwa/src/component/VideoThumbnail/index.js rename to packages/scandipwa/src/component/VideoThumbnail/index.ts diff --git a/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.js b/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.js deleted file mode 100644 index 048acc1a06..0000000000 --- a/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.js +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const SLIDER = 'Slider'; -export const NEW_PRODUCTS = 'NewProducts'; -export const CATALOG_PRODUCT_LIST = 'CatalogProductList'; -export const RECENTLY_VIEWED = 'RecentlyViewed'; diff --git a/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.ts b/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.ts new file mode 100644 index 0000000000..2b32d576a9 --- /dev/null +++ b/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.config.ts @@ -0,0 +1,17 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum Widget { + SLIDER = 'Slider', + NEW_PRODUCTS = 'NewProducts', + CATALOG_PRODUCT_LIST = 'CatalogProductList', + RECENTLY_VIEWED = 'RecentlyViewed' +} diff --git a/packages/scandipwa/src/component/WidgetFactory/index.js b/packages/scandipwa/src/component/WidgetFactory/index.ts similarity index 100% rename from packages/scandipwa/src/component/WidgetFactory/index.js rename to packages/scandipwa/src/component/WidgetFactory/index.ts diff --git a/packages/scandipwa/src/component/WishlistItem/WishlistItem.config.js b/packages/scandipwa/src/component/WishlistItem/WishlistItem.config.ts similarity index 87% rename from packages/scandipwa/src/component/WishlistItem/WishlistItem.config.js rename to packages/scandipwa/src/component/WishlistItem/WishlistItem.config.ts index 400fd09381..25cf9c74cf 100644 --- a/packages/scandipwa/src/component/WishlistItem/WishlistItem.config.js +++ b/packages/scandipwa/src/component/WishlistItem/WishlistItem.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/component/WishlistItem/index.js b/packages/scandipwa/src/component/WishlistItem/index.ts similarity index 100% rename from packages/scandipwa/src/component/WishlistItem/index.js rename to packages/scandipwa/src/component/WishlistItem/index.ts diff --git a/packages/scandipwa/src/index.js b/packages/scandipwa/src/index.tsx similarity index 100% rename from packages/scandipwa/src/index.js rename to packages/scandipwa/src/index.tsx diff --git a/packages/scandipwa/src/query/ProductList.query.ts b/packages/scandipwa/src/query/ProductList.query.ts index ec88086b44..1e5d9e00ae 100644 --- a/packages/scandipwa/src/query/ProductList.query.ts +++ b/packages/scandipwa/src/query/ProductList.query.ts @@ -11,7 +11,7 @@ import { Field, InlineFragment, Query } from '@tilework/opus'; -import { SORT_DIRECTION_TYPE } from 'Route/CategoryPage/CategoryPage.config'; +import { SortDirections } from 'Route/CategoryPage/CategoryPage.config'; import { NONE_SORT_OPTION_VALUE } from 'Route/SearchPage/SearchPage.config'; import { CUSTOMER } from 'Store/MyAccount/MyAccount.dispatcher'; import { @@ -197,7 +197,7 @@ export class ProductListQuery { return {}; } - return { [sortKey]: sortDirection || SORT_DIRECTION_TYPE.asc }; + return { [sortKey]: sortDirection || SortDirections.ASC }; } }, filter: { diff --git a/packages/scandipwa/src/route/CartPage/index.js b/packages/scandipwa/src/route/CartPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/CartPage/index.js rename to packages/scandipwa/src/route/CartPage/index.ts diff --git a/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts b/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts index f52b8768ad..a0b57d38ab 100644 --- a/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts +++ b/packages/scandipwa/src/route/CategoryPage/CategoryPage.config.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-vars */ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * @@ -12,21 +10,18 @@ */ export const LOADING_TIME = 500; - -export const DISPLAY_MODE_PRODUCTS = 'PRODUCTS'; - -export const DISPLAY_MODE_CMS_BLOCK = 'PAGE'; - -export const DISPLAY_MODE_BOTH = 'PRODUCTS_AND_PAGE'; - export const LAYOUT_KEY = 'layout'; -export const GRID_LAYOUT = 'grid'; -export const LIST_LAYOUT = 'list'; -export const SORT_DIRECTION_TYPE = { - asc: 'ASC', - desc: 'DESC' -}; +export enum CategoryDisplayMode { + PRODUCTS = 'PRODUCTS', + CMS_BLOCK = 'PAGE', + BOTH = 'PRODUCTS_AND_PAGE' +} + +export enum CategoryPageLayout { + GRID = 'grid', + LIST = 'list' +} export enum SortDirections { ASC = 'ASC', diff --git a/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js b/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js index b6598078df..1ef090b649 100644 --- a/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js +++ b/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js @@ -19,7 +19,7 @@ import { GRID_LAYOUT, LAYOUT_KEY, LIST_LAYOUT, - SORT_DIRECTION_TYPE + SortDirectionType } from 'Route/CategoryPage/CategoryPage.config'; import { updateCurrentCategory } from 'Store/Category/Category.action'; import CategoryReducer from 'Store/Category/Category.reducer'; @@ -169,7 +169,7 @@ export class CategoryPageContainer extends PureComponent { config = { sortKey: 'name', - sortDirection: SORT_DIRECTION_TYPE.asc + sortDirection: SortDirectionType.asc }; containerFunctions = { @@ -201,12 +201,12 @@ export class CategoryPageContainer extends PureComponent { if (!defaultPlpType || !plpTypes) { if (plpType.match('-')) { const plpTypes = plpType.split('-'); - const defaultType = isMobile ? GRID_LAYOUT : plpTypes[0]; + const defaultType = isMobile ? GRID_LAYOUT : plpTypes[ 0 ]; Object.assign(update, { defaultPlpType: defaultType, plpTypes }); } else { const defaultType = isMobile ? GRID_LAYOUT : plpType; - Object.assign(update, { defaultPlpType: defaultType, plpTypes: [plpType] }); + Object.assign(update, { defaultPlpType: defaultType, plpTypes: [ plpType ] }); } } @@ -471,9 +471,9 @@ export class CategoryPageContainer extends PureComponent { const { location: { search } } = this.props; return search.substr(1).split('&').reduce((acc, part) => { - const [key, value] = part.split('='); + const [ key, value ] = part.split('='); - return { ...acc, [key]: value }; + return { ...acc, [ key ]: value }; }, {}); } @@ -485,9 +485,9 @@ export class CategoryPageContainer extends PureComponent { if (!filter) { return acc; } - const [key, value] = filter.split(':'); + const [ key, value ] = filter.split(':'); - return { ...acc, [key]: value.split(',') }; + return { ...acc, [ key ]: value.split(',') }; }, {}); } @@ -715,12 +715,12 @@ export class CategoryPageContainer extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/route/CategoryPage/index.js b/packages/scandipwa/src/route/CategoryPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/CategoryPage/index.js rename to packages/scandipwa/src/route/CategoryPage/index.ts diff --git a/packages/scandipwa/src/route/Checkout/Checkout.config.ts b/packages/scandipwa/src/route/Checkout/Checkout.config.ts index 9d4457eaef..5cd7a07c23 100644 --- a/packages/scandipwa/src/route/Checkout/Checkout.config.ts +++ b/packages/scandipwa/src/route/Checkout/Checkout.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ /** * ScandiPWA - Progressive Web App for Magento * @@ -10,19 +9,17 @@ * @link https://github.com/scandipwa/base-theme */ -export const SHIPPING_STEP = 'SHIPPING_STEP'; -export const BILLING_STEP = 'BILLING_STEP'; -export const DETAILS_STEP = 'DETAILS_STEP'; - export enum CheckoutSteps { SHIPPING_STEP = 'SHIPPING_STEP', BILLING_STEP = 'BILLING_STEP', DETAILS_STEP = 'DETAILS_STEP' } -export const CHECKOUT_URL = '/checkout'; -export const BILLING_URL = '/checkout/billing'; -export const SHIPPING_URL = '/checkout/shipping'; +export enum CheckoutStepUrl { + CHECKOUT_URL = '/checkout', + BILLING_URL = '/checkout/billing', + SHIPPING_URL = '/checkout/shipping' +} export const PAYMENT_TOTALS = 'PAYMENT_TOTALS'; diff --git a/packages/scandipwa/src/route/Checkout/index.js b/packages/scandipwa/src/route/Checkout/index.ts similarity index 100% rename from packages/scandipwa/src/route/Checkout/index.js rename to packages/scandipwa/src/route/Checkout/index.ts diff --git a/packages/scandipwa/src/route/CmsPage/CmsPage.config.js b/packages/scandipwa/src/route/CmsPage/CmsPage.config.ts similarity index 86% rename from packages/scandipwa/src/route/CmsPage/CmsPage.config.js rename to packages/scandipwa/src/route/CmsPage/CmsPage.config.ts index b9fa50967d..9a19a82b56 100644 --- a/packages/scandipwa/src/route/CmsPage/CmsPage.config.js +++ b/packages/scandipwa/src/route/CmsPage/CmsPage.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/route/CmsPage/index.js b/packages/scandipwa/src/route/CmsPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/CmsPage/index.js rename to packages/scandipwa/src/route/CmsPage/index.ts diff --git a/packages/scandipwa/src/route/ConfirmAccountPage/index.js b/packages/scandipwa/src/route/ConfirmAccountPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/ConfirmAccountPage/index.js rename to packages/scandipwa/src/route/ConfirmAccountPage/index.ts diff --git a/packages/scandipwa/src/route/ContactPage/ContactPage.config.js b/packages/scandipwa/src/route/ContactPage/ContactPage.config.ts similarity index 86% rename from packages/scandipwa/src/route/ContactPage/ContactPage.config.js rename to packages/scandipwa/src/route/ContactPage/ContactPage.config.ts index 1a6327697a..6a6d233ac4 100644 --- a/packages/scandipwa/src/route/ContactPage/ContactPage.config.js +++ b/packages/scandipwa/src/route/ContactPage/ContactPage.config.ts @@ -9,5 +9,4 @@ * @link https://github.com/scandipwa/base-theme */ -// eslint-disable-next-line import/prefer-default-export export const DEFAULT_CONTACT_US_CMS_BLOCK = 'contact_us_page_block'; diff --git a/packages/scandipwa/src/route/ContactPage/index.js b/packages/scandipwa/src/route/ContactPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/ContactPage/index.js rename to packages/scandipwa/src/route/ContactPage/index.ts diff --git a/packages/scandipwa/src/route/CreateAccount/index.js b/packages/scandipwa/src/route/CreateAccount/index.ts similarity index 100% rename from packages/scandipwa/src/route/CreateAccount/index.js rename to packages/scandipwa/src/route/CreateAccount/index.ts diff --git a/packages/scandipwa/src/route/ForgotPassword/index.js b/packages/scandipwa/src/route/ForgotPassword/index.ts similarity index 100% rename from packages/scandipwa/src/route/ForgotPassword/index.js rename to packages/scandipwa/src/route/ForgotPassword/index.ts diff --git a/packages/scandipwa/src/route/HomePage/index.js b/packages/scandipwa/src/route/HomePage/index.ts similarity index 100% rename from packages/scandipwa/src/route/HomePage/index.js rename to packages/scandipwa/src/route/HomePage/index.ts diff --git a/packages/scandipwa/src/route/LoginAccount/index.js b/packages/scandipwa/src/route/LoginAccount/index.ts similarity index 100% rename from packages/scandipwa/src/route/LoginAccount/index.js rename to packages/scandipwa/src/route/LoginAccount/index.ts diff --git a/packages/scandipwa/src/route/MenuPage/index.js b/packages/scandipwa/src/route/MenuPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/MenuPage/index.js rename to packages/scandipwa/src/route/MenuPage/index.ts diff --git a/packages/scandipwa/src/route/MyAccount/MyAccount.config.js b/packages/scandipwa/src/route/MyAccount/MyAccount.config.js deleted file mode 100644 index d62ceb33a7..0000000000 --- a/packages/scandipwa/src/route/MyAccount/MyAccount.config.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable import/prefer-default-export */ - -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const ACCOUNT_INFORMATION_EDIT_URL = 'customer/account/edit'; -export const ACCOUNT_FORGOT_PASSWORD_URL = 'customer/account/forgotpassword'; -export const ACCOUNT_REGISTRATION_URL = '/customer/account/create'; -export const ACCOUNT_LOGIN_URL = '/customer/account/login'; -export const ACCOUNT_URL = '/customer/account'; -export const ACCOUNT_ORDER_URL = '/sales/order/view/order_id'; -export const ACCOUNT_ORDER_PRINT_URL = 'sales/order/print/order_id'; -export const ACCOUNT_ORDER_HISTORY = 'sales/order/history'; -// eslint-disable-next-line max-len -export const LOCKED_ACCOUNT_ERROR_MESSAGE = __('The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.'); diff --git a/packages/scandipwa/src/route/MyAccount/MyAccount.config.ts b/packages/scandipwa/src/route/MyAccount/MyAccount.config.ts new file mode 100644 index 0000000000..436cd3c8d8 --- /dev/null +++ b/packages/scandipwa/src/route/MyAccount/MyAccount.config.ts @@ -0,0 +1,24 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum AccountPageUrl { + INFORMATION_EDIT_URL = 'customer/account/edit', + FORGOT_PASSWORD_URL = 'customer/account/forgotpassword', + REGISTRATION_URL = '/customer/account/create', + LOGIN_URL = '/customer/account/login', + URL = '/customer/account', + ORDER_URL = '/sales/order/view/order_id', + ORDER_PRINT_URL = 'sales/order/print/order_id', + ORDER_HISTORY = 'sales/order/history' +} + +// eslint-disable-next-line max-len +export const LOCKED_ACCOUNT_ERROR_MESSAGE = __('The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.'); diff --git a/packages/scandipwa/src/route/MyAccount/index.js b/packages/scandipwa/src/route/MyAccount/index.ts similarity index 100% rename from packages/scandipwa/src/route/MyAccount/index.js rename to packages/scandipwa/src/route/MyAccount/index.ts diff --git a/packages/scandipwa/src/route/NoMatch/index.js b/packages/scandipwa/src/route/NoMatch/index.ts similarity index 100% rename from packages/scandipwa/src/route/NoMatch/index.js rename to packages/scandipwa/src/route/NoMatch/index.ts diff --git a/packages/scandipwa/src/route/NoMatchHandler/index.js b/packages/scandipwa/src/route/NoMatchHandler/index.ts similarity index 100% rename from packages/scandipwa/src/route/NoMatchHandler/index.js rename to packages/scandipwa/src/route/NoMatchHandler/index.ts diff --git a/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.js b/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.js deleted file mode 100644 index 1885129ef0..0000000000 --- a/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const STATUS_PASSWORD_UPDATED = 'password_updated'; -export const STATUS_PASSWORD_MISS_MATCH = 'passwords_miss_match'; diff --git a/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.ts b/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.ts new file mode 100644 index 0000000000..d30cb92199 --- /dev/null +++ b/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.config.ts @@ -0,0 +1,15 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum PasswordPageStatus { + UPDATED = 'password_updated', + MISS_MATCH = 'passwords_miss_match' +} diff --git a/packages/scandipwa/src/route/PasswordChangePage/index.js b/packages/scandipwa/src/route/PasswordChangePage/index.ts similarity index 100% rename from packages/scandipwa/src/route/PasswordChangePage/index.js rename to packages/scandipwa/src/route/PasswordChangePage/index.ts diff --git a/packages/scandipwa/src/route/ProductComparePage/index.js b/packages/scandipwa/src/route/ProductComparePage/index.ts similarity index 100% rename from packages/scandipwa/src/route/ProductComparePage/index.js rename to packages/scandipwa/src/route/ProductComparePage/index.ts diff --git a/packages/scandipwa/src/route/ProductPage/ProductPage.config.js b/packages/scandipwa/src/route/ProductPage/ProductPage.config.js deleted file mode 100644 index 841678a9a2..0000000000 --- a/packages/scandipwa/src/route/ProductPage/ProductPage.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -// eslint-disable-next-line import/prefer-default-export -export const PRODUCT_INFORMATION = 'information'; -export const PRODUCT_ATTRIBUTES = 'attributes'; -export const PRODUCT_REVIEWS = 'reviews'; diff --git a/packages/scandipwa/src/route/ProductPage/ProductPage.config.ts b/packages/scandipwa/src/route/ProductPage/ProductPage.config.ts new file mode 100644 index 0000000000..047db4b1a5 --- /dev/null +++ b/packages/scandipwa/src/route/ProductPage/ProductPage.config.ts @@ -0,0 +1,16 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum ProductPageTabs { + INFORMATION = 'information', + ATTRIBUTES = 'attributes', + REVIEWS = 'reviews' +} diff --git a/packages/scandipwa/src/route/ProductPage/index.js b/packages/scandipwa/src/route/ProductPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/ProductPage/index.js rename to packages/scandipwa/src/route/ProductPage/index.ts diff --git a/packages/scandipwa/src/route/SearchPage/SearchPage.config.js b/packages/scandipwa/src/route/SearchPage/SearchPage.config.ts similarity index 90% rename from packages/scandipwa/src/route/SearchPage/SearchPage.config.js rename to packages/scandipwa/src/route/SearchPage/SearchPage.config.ts index d0f6b9ade4..95680235b6 100644 --- a/packages/scandipwa/src/route/SearchPage/SearchPage.config.js +++ b/packages/scandipwa/src/route/SearchPage/SearchPage.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ /** * ScandiPWA - Progressive Web App for Magento * diff --git a/packages/scandipwa/src/route/SearchPage/SearchPage.container.js b/packages/scandipwa/src/route/SearchPage/SearchPage.container.js index 11b6cdbb5b..7022e3fd8d 100644 --- a/packages/scandipwa/src/route/SearchPage/SearchPage.container.js +++ b/packages/scandipwa/src/route/SearchPage/SearchPage.container.js @@ -13,7 +13,7 @@ import { connect } from 'react-redux'; // TODO: try SEARCH type import { CATEGORY } from 'Component/Header/Header.config'; -import { LOADING_TIME, SORT_DIRECTION_TYPE } from 'Route/CategoryPage/CategoryPage.config'; +import { LOADING_TIME, SortDirectionType } from 'Route/CategoryPage/CategoryPage.config'; import { CategoryPageContainer } from 'Route/CategoryPage/CategoryPage.container'; import CategoryReducer from 'Store/Category/Category.reducer'; import { updateMeta } from 'Store/Meta/Meta.action'; @@ -104,7 +104,7 @@ export class SearchPageContainer extends CategoryPageContainer { config = { sortKey: 'none', - sortDirection: SORT_DIRECTION_TYPE.asc + sortDirection: SortDirectionType.asc }; updateMeta() { @@ -116,10 +116,10 @@ export class SearchPageContainer extends CategoryPageContainer { const { updateBreadcrumbs } = this.props; const search = decodeString(this.getSearchParam()); - updateBreadcrumbs([{ + updateBreadcrumbs([ { url: '', name: search - }]); + } ]); } updateHeaderState() { @@ -215,11 +215,11 @@ export class SearchPageContainer extends CategoryPageContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/route/SearchPage/index.js b/packages/scandipwa/src/route/SearchPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/SearchPage/index.js rename to packages/scandipwa/src/route/SearchPage/index.ts diff --git a/packages/scandipwa/src/route/SomethingWentWrong/index.js b/packages/scandipwa/src/route/SomethingWentWrong/index.ts similarity index 100% rename from packages/scandipwa/src/route/SomethingWentWrong/index.js rename to packages/scandipwa/src/route/SomethingWentWrong/index.ts diff --git a/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.js b/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.ts similarity index 91% rename from packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.js rename to packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.ts index 0ee3272ef0..988da7b1e4 100644 --- a/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.js +++ b/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.config.ts @@ -26,6 +26,7 @@ import SearchIcon from 'Component/SearchIcon'; import ShareIcon from 'Component/ShareIcon'; import StarIcon from 'Component/StarIcon'; import UserIcon from 'Component/UserIcon'; +import { NotificationType } from 'Store/Notification/Notification.type'; import facebook from 'Style/icons/logos/facebook.svg'; import linkedIn from 'Style/icons/logos/linkedIn.svg'; import twitter from 'Style/icons/logos/twitter.svg'; @@ -60,13 +61,13 @@ export const ICONS_LIST = { }; export const NOTIFICATION_SUCCESS_DATA = { msgText: 'Product was added to cart!', - msgType: 'success' + msgType: NotificationType.SUCCESS }; export const NOTIFICATION_ERROR_DATA = { msgText: 'Product was not added to cart!', - msgType: 'error' + msgType: NotificationType.ERROR }; export const NOTIFICATION_INFO_DATA = { msgText: 'Please correct all errors.', - msgType: 'info' + msgType: NotificationType.INFO }; diff --git a/packages/scandipwa/src/route/StyleGuidePage/index.js b/packages/scandipwa/src/route/StyleGuidePage/index.ts similarity index 100% rename from packages/scandipwa/src/route/StyleGuidePage/index.js rename to packages/scandipwa/src/route/StyleGuidePage/index.ts diff --git a/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.js b/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.js deleted file mode 100644 index 0e91fc29d8..0000000000 --- a/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -export const TYPE_PRODUCT = 'PRODUCT'; -export const TYPE_CMS_PAGE = 'CMS_PAGE'; -export const TYPE_CATEGORY = 'CATEGORY'; -export const TYPE_NOTFOUND = 'NOT_FOUND'; diff --git a/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.ts b/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.ts new file mode 100644 index 0000000000..cde324c823 --- /dev/null +++ b/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.config.ts @@ -0,0 +1,17 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/base-theme + */ + +export enum UrlRewritePageType { + PRODUCT = 'PRODUCT', + CMS_PAGE = 'CMS_PAGE', + CATEGORY = 'CATEGORY', + NOTFOUND = 'NOT_FOUND' +} diff --git a/packages/scandipwa/src/route/UrlRewrites/index.js b/packages/scandipwa/src/route/UrlRewrites/index.ts similarity index 100% rename from packages/scandipwa/src/route/UrlRewrites/index.js rename to packages/scandipwa/src/route/UrlRewrites/index.ts diff --git a/packages/scandipwa/src/route/WishlistSharedPage/index.js b/packages/scandipwa/src/route/WishlistSharedPage/index.ts similarity index 100% rename from packages/scandipwa/src/route/WishlistSharedPage/index.js rename to packages/scandipwa/src/route/WishlistSharedPage/index.ts diff --git a/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts b/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts index b77ec5c74e..df3fe546a6 100644 --- a/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts +++ b/packages/scandipwa/src/store/MyAccount/MyAccount.dispatcher.ts @@ -180,7 +180,7 @@ export class MyAccountDispatcher { /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/resetPassword/fetchMutation/then/dispatch */ ({ s_resetPassword: { status } }) => dispatch(updateCustomerPasswordResetStatus(status, '')), /** @namespace Store/MyAccount/Dispatcher/MyAccountDispatcher/resetPassword/fetchMutation/then/dispatch/catch */ - (errors) => dispatch(updateCustomerPasswordResetStatus('error', getErrorMessage(errors))) + (errors) => dispatch(updateCustomerPasswordResetStatus(NotificationType.ERROR, getErrorMessage(errors))) ); } diff --git a/packages/scandipwa/src/store/index.ts b/packages/scandipwa/src/store/index.ts index 3babbdce92..446cccda4c 100644 --- a/packages/scandipwa/src/store/index.ts +++ b/packages/scandipwa/src/store/index.ts @@ -8,7 +8,7 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import { Action, Reducer } from 'redux'; +import { AnyAction, Reducer } from 'redux'; import CartReducer from 'Store/Cart/Cart.reducer'; import CheckoutReducer from 'Store/Checkout/Checkout.reducer'; @@ -28,8 +28,28 @@ import StoreInPickUpReducer from 'Store/StoreInPickUp/StoreInPickUp.reducer'; import UrlRewritesReducer from 'Store/UrlRewrites/UrlRewrites.reducer'; import WishlistReducer from 'Store/Wishlist/Wishlist.reducer'; +export type StaticReducers = { + // ProductListReducer: ReturnType; + // ProductListInfoReducer: ReturnType; + CartReducer: ReturnType; + WishlistReducer: ReturnType; + NoMatchReducer: ReturnType; + MyAccountReducer: ReturnType; + NavigationReducer: ReturnType; + OverlayReducer: ReturnType; + OfflineReducer: ReturnType; + PopupReducer: ReturnType; + UrlRewritesReducer: ReturnType; + ConfigReducer: ReturnType; + MetaReducer: ReturnType; + CheckoutReducer: ReturnType; + ContactFormReducer: ReturnType; + ProductCompareReducer: ReturnType; + StoreInPickUpReducer: ReturnType; +}; + /** @namespace Store/Index/getStaticReducers */ -export const getStaticReducers = () => ({ +export const getStaticReducers = (): StaticReducers => ({ ProductListReducer, ProductListInfoReducer, CartReducer, @@ -47,14 +67,13 @@ export const getStaticReducers = () => ({ ContactFormReducer, ProductCompareReducer, StoreInPickUpReducer -}); +} as unknown as StaticReducers); export type StaticReducersType = ReturnType; export default function injectStaticReducers< S, - A, - T extends ModifiedReduxStore + T extends ModifiedReduxStore >(store: T): T & StaticReducersType { // eslint-disable-next-line no-param-reassign // store.asyncReducers = {}; @@ -63,7 +82,7 @@ export default function injectStaticReducers< Object.entries(getStaticReducers()).forEach( ([name, reducer]) => { if (store.injectReducer) { - store.injectReducer(name, reducer as Reducer>); + store.injectReducer(name, reducer as Reducer); } } ); diff --git a/packages/scandipwa/src/type/Direction.type.js b/packages/scandipwa/src/type/Direction.type.js index 00e481a1fa..ee18fc1553 100644 --- a/packages/scandipwa/src/type/Direction.type.js +++ b/packages/scandipwa/src/type/Direction.type.js @@ -17,8 +17,8 @@ import { RIGHT, TOP } from 'Component/ChevronIcon/ChevronIcon.config'; -import { SORT_DIRECTION_TYPE } from 'Route/CategoryPage/CategoryPage.config'; +import { SortDirectionType } from 'Route/CategoryPage/CategoryPage.config'; -export const DirectionType = PropTypes.oneOf([RIGHT, LEFT, TOP, BOTTOM]); +export const DirectionType = PropTypes.oneOf([ RIGHT, LEFT, TOP, BOTTOM ]); -export const SortDirectionType = PropTypes.oneOf(Object.values(SORT_DIRECTION_TYPE)); +export const SortDirectionType = PropTypes.oneOf(Object.values(SortDirectionType)); diff --git a/packages/scandipwa/src/type/StockStatus.type.js b/packages/scandipwa/src/type/StockStatus.type.js index cf72e273b9..4b569ba34a 100644 --- a/packages/scandipwa/src/type/StockStatus.type.js +++ b/packages/scandipwa/src/type/StockStatus.type.js @@ -11,7 +11,7 @@ import PropTypes from 'prop-types'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; // eslint-disable-next-line import/prefer-default-export -export const StockStatusType = PropTypes.oneOf(Object.values(STOCK_TYPE)); +export const StockStatusType = PropTypes.oneOf(Object.values(StockType)); diff --git a/packages/scandipwa/src/util/Address/Address.type.ts b/packages/scandipwa/src/util/Address/Address.type.ts index e7b1dc0dee..7d2c520d44 100644 --- a/packages/scandipwa/src/util/Address/Address.type.ts +++ b/packages/scandipwa/src/util/Address/Address.type.ts @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/scandipwa */ -import { Region } from 'Type/Config.type'; - export type ZippopotamResponseResult = { city: string; region: string; @@ -18,6 +16,6 @@ export type ZippopotamResponseResult = { }; export type FormattedRegion = { - country: string; - region: Region[]; + country?: string; + region?: string | null; }; diff --git a/packages/scandipwa/src/util/Address/index.ts b/packages/scandipwa/src/util/Address/index.ts index 86563bcff0..df4e9f93e8 100644 --- a/packages/scandipwa/src/util/Address/index.ts +++ b/packages/scandipwa/src/util/Address/index.ts @@ -13,7 +13,7 @@ import StoreItem from 'Component/StoreItem'; import { Address, TrimmedAddress } from 'Type/Account.type'; import { Country, Region } from 'Type/Config.type'; -import { ZippopotamResponseResult } from './Address.type'; +import { FormattedRegion, ZippopotamResponseResult } from './Address.type'; /** @namespace Util/Address/Index/trimCheckoutCustomerAddress */ export const trimCheckoutCustomerAddress = (customerAddress: Address): TrimmedAddress => { @@ -183,7 +183,7 @@ export const getAvailableRegions = (country_id: string, countries: Country[]): R export const getFormattedRegion = ( address: Address, countries: Country[] -) => { +): FormattedRegion => { const { country_id, region: regionData } = address; if (!regionData) { diff --git a/packages/scandipwa/src/util/Polyfill/index.js b/packages/scandipwa/src/util/Polyfill/index.ts similarity index 100% rename from packages/scandipwa/src/util/Polyfill/index.js rename to packages/scandipwa/src/util/Polyfill/index.ts diff --git a/packages/scandipwa/src/util/Price/Price.config.ts b/packages/scandipwa/src/util/Price/Price.config.ts index 528002759b..67194b7c26 100644 --- a/packages/scandipwa/src/util/Price/Price.config.ts +++ b/packages/scandipwa/src/util/Price/Price.config.ts @@ -12,7 +12,7 @@ export const TIER_PRICES = 'TIER_PRICES'; export const HUNDRED_PERCENT = 100; -export enum currencyMap { +export enum CurrencyMap { AED = 'د.إ', AFN = '؋', ALL = 'L', diff --git a/packages/scandipwa/src/util/Price/Price.ts b/packages/scandipwa/src/util/Price/Price.ts index 24905e4381..b0cb664046 100644 --- a/packages/scandipwa/src/util/Price/Price.ts +++ b/packages/scandipwa/src/util/Price/Price.ts @@ -11,12 +11,12 @@ import { PriceTier } from 'Type/ProductList.type'; -import { currencyMap, HUNDRED_PERCENT } from './Price.config'; +import { CurrencyMap, HUNDRED_PERCENT } from './Price.config'; /** @namespace Util/Price/formatCurrency */ export const formatCurrency = ( currency = 'USD' -): string | null => (Object.keys(currencyMap).includes(currency) ? currency : null); +): string | null => (Object.keys(CurrencyMap).includes(currency) ? currency : null); /** @namespace Util/Price/formatPrice */ export const formatPrice = (price: number, currency = 'USD') : string => { diff --git a/packages/scandipwa/src/util/Product/Extract.ts b/packages/scandipwa/src/util/Product/Extract.ts index 3a6be2b732..03d8719180 100644 --- a/packages/scandipwa/src/util/Product/Extract.ts +++ b/packages/scandipwa/src/util/Product/Extract.ts @@ -13,8 +13,8 @@ */ import { PRODUCT_TYPE } from 'Component/Product/Product.config'; -import { STOCK_TYPE } from 'Component/Product/Stock.config'; -import { ImageTypes } from 'Component/ProductGallery/ProductGallery.config'; +import { StockStatus } from 'Component/Product/Stock.config'; +import { ImageType } from 'Component/ProductGallery/ProductGallery.config'; import { PriceRange } from 'Type/Price.type'; import { ItemOption, @@ -29,7 +29,13 @@ import { formatPrice } from 'Util/Price'; import { IndexedVariant } from './Product'; import { - AdjustedPrice, AdjustedPrices, EnteredOption, FormattedAdjustedPrices, FormattedPrice, FormattedProduct, QtyDefault, QtyFields + AdjustedPrices, + EnteredOption, + FormattedAdjustedPrices, + FormattedPrice, + FormattedProduct, + QtyDefault, + QtyFields } from './Product.type'; // TODO unify keyof product and stockitem. @@ -139,7 +145,7 @@ export const getName = (product: FormattedProduct, configIndex = -1): string => export const getProductOptionInStock = (product: Product): boolean => { const { stock_status: stockStatus } = product; - return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && stockStatus === STOCK_TYPE.IN_STOCK; + return stockStatus !== StockStatus.OUT_OF_STOCK && stockStatus === StockStatus.IN_STOCK; }; /** @@ -190,7 +196,7 @@ export const getProductInStock = ( stock_status: parentStockStatus } = parentProduct || {}; - return parentInStock && parentStockStatus !== STOCK_TYPE.OUT_OF_STOCK && getProductInStock(product); + return parentInStock && parentStockStatus !== StockStatus.OUT_OF_STOCK && getProductInStock(product); } if (type === PRODUCT_TYPE.grouped) { @@ -201,7 +207,7 @@ export const getProductInStock = ( const { stock_status: stockStatus } = product; - return stockStatus !== STOCK_TYPE.OUT_OF_STOCK && (inStock || stockStatus === STOCK_TYPE.IN_STOCK); + return stockStatus !== StockStatus.OUT_OF_STOCK && (inStock || stockStatus === StockStatus.IN_STOCK); }; /** @@ -589,7 +595,7 @@ export const getSubLabelFromMaxCharacters = (maxCharacters: number, value = ''): * @param field * @namespace Util/Product/Extract/getImage */ -export const getImage = (product: Product, field: ImageTypes): string => { +export const getImage = (product: Product, field: ImageType): string => { const { [field]: { url = 'no_selection' } = {} } = product; return url && url !== 'no_selection' ? url : ''; }; @@ -599,19 +605,19 @@ export const getImage = (product: Product, field: ImageTypes): string => { * @param product * @namespace Util/Product/Extract/getThumbnailImage */ -export const getThumbnailImage = (product: Product): string => getImage(product, ImageTypes.THUMBNAIL_KEY); +export const getThumbnailImage = (product: Product): string => getImage(product, ImageType.THUMBNAIL); /** * Returns products small image * @param product * @namespace Util/Product/Extract/getSmallImage */ -export const getSmallImage = (product: Product): string => getImage(product, ImageTypes.SMALL_KEY); +export const getSmallImage = (product: Product): string => getImage(product, ImageType.SMALL); /** * Returns products base image * @param product * @namespace Util/Product/Extract/getBaseImage */ -export const getBaseImage = (product: Product): string => getImage(product, ImageTypes.IMAGE_KEY); +export const getBaseImage = (product: Product): string => getImage(product, ImageType.IMAGE); // #endregion diff --git a/packages/scandipwa/src/util/Product/Product.ts b/packages/scandipwa/src/util/Product/Product.ts index 19d889ae7f..94480c8cd7 100644 --- a/packages/scandipwa/src/util/Product/Product.ts +++ b/packages/scandipwa/src/util/Product/Product.ts @@ -9,9 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import { STOCK_TYPE } from 'Component/Product/Stock.config'; +import { StockType } from 'Component/Product/Stock.config'; import { REVIEW_POPUP_ID } from 'Component/ProductReviews/ProductReviews.config'; import { showNotification } from 'Store/Notification/Notification.action'; +import { NotificationType } from 'Store/Notification/Notification.type'; import { showPopup } from 'Store/Popup/Popup.action'; import { Attribute, @@ -171,7 +172,7 @@ export const getVariantsIndexes = ( }, [] as number[]); if (inStockOnly) { - return result.filter((n) => variants[n].stock_status === STOCK_TYPE.IN_STOCK); + return result.filter((n) => variants[n].stock_status === StockType.IN_STOCK); } return result; @@ -438,7 +439,7 @@ export const showNewReviewPopup = (): void => { // if not logged in and guest reviews are not enabled if (!isSignedIn() && !isGuestEnabled) { - dispatch(showNotification('info', __('You must login or register to review products.'))); + dispatch(showNotification(NotificationType.INFO, __('You must login or register to review products.'))); return; } diff --git a/packages/scandipwa/src/util/Store/Store.type.ts b/packages/scandipwa/src/util/Store/Store.type.ts index f24983bb57..2e0c177c3a 100644 --- a/packages/scandipwa/src/util/Store/Store.type.ts +++ b/packages/scandipwa/src/util/Store/Store.type.ts @@ -9,7 +9,7 @@ * @link https://github.com/scandipwa/base-theme */ import { - Action, + AnyAction, Reducer, ReducersMapObject, Store @@ -36,10 +36,10 @@ export interface RootState {} export type AppDispatch = typeof store.dispatch; declare global { - export type InjectReducer = (key: string, asyncReducer: Reducer>) => void; + export type InjectReducer = (key: string, asyncReducer: Reducer) => void; - export type ModifiedReduxStore = (Store> & { + export type ModifiedReduxStore = (Store & { asyncReducers?: ReducersMapObject; - injectReducer?: InjectReducer; + injectReducer?: InjectReducer; }); } From 0e94676b182cde2e5cbe1ea2a61c7f4aabb64a34 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Thu, 14 Apr 2022 03:18:28 +0300 Subject: [PATCH 034/192] Migrated some components --- packages/scandipwa/.vscode/settings.json | 10 +- packages/scandipwa/package.json | 1 + .../component/AddIcon/AddIcon.component.tsx | 4 +- ...t.component.js => AddToCart.component.tsx} | 23 +- .../AddToCart/AddToCart.container.js | 16 +- .../src/component/AddToCart/AddToCart.type.ts | 23 ++ .../{App.component.js => App.component.tsx} | 60 +++--- .../scandipwa/src/component/App/App.type.ts | 18 ++ ....component.js => Breadcrumb.component.tsx} | 30 +-- .../component/Breadcrumb/Breadcrumb.type.ts | 19 ++ ...component.js => Breadcrumbs.component.tsx} | 21 +- .../component/Breadcrumbs/Breadcrumbs.type.ts | 17 ++ ...ponent.js => CarouselScroll.component.tsx} | 55 +++-- .../CarouselScroll/CarouselScroll.type.ts | 21 ++ ...t.js => CarouselScrollArrow.component.tsx} | 6 +- ...nt.js => CarouselScrollItem.component.tsx} | 6 +- ....component.js => CartCoupon.component.tsx} | 5 +- .../component/CartIcon/CartIcon.component.tsx | 4 +- ...em.component.js => CartItem.component.tsx} | 6 +- .../component/CartItem/CartItem.container.js | 40 ++-- ...mponent.js => CartItemPrice.component.tsx} | 5 +- ...component.js => CartOverlay.component.tsx} | 6 +- ...egoryConfigurableAttributes.component.tsx} | 2 - ...onent.js => CategoryDetails.component.tsx} | 4 +- ...js => CategoryFilterOverlay.component.tsx} | 4 +- ...nt.js => CategoryItemsCount.component.tsx} | 4 +- ...omponent.js => CategorySort.component.tsx} | 4 +- ...t.js => CheckoutAddressBook.component.tsx} | 4 +- .../CheckoutAddressBook.container.js | 10 +- ...t.js => CheckoutAddressForm.component.tsx} | 6 +- ....js => CheckoutAddressTable.component.tsx} | 4 +- ...onent.js => CheckoutBilling.component.tsx} | 6 +- ...s => CheckoutDeliveryOption.component.tsx} | 4 +- ... => CheckoutDeliveryOptions.component.tsx} | 4 +- .../CheckoutDeliveryOptions.container.js | 10 +- ...ent.js => CheckoutGuestForm.component.tsx} | 6 +- .../CheckoutGuestForm.container.js | 6 +- ....js => CheckoutOrderSummary.component.tsx} | 3 +- ...eckoutOrderSummaryPriceLine.component.tsx} | 5 +- ...onent.js => CheckoutPayment.component.tsx} | 4 +- ...nent.js => CheckoutPayments.component.tsx} | 4 +- .../CheckoutPayments.container.js | 12 +- ...nent.js => CheckoutShipping.component.tsx} | 4 +- .../CheckoutShipping.container.js | 18 +- ...onent.js => CheckoutSuccess.component.tsx} | 4 +- ...koutTermsAndConditionsPopup.component.tsx} | 4 +- .../ChevronIcon/ChevronIcon.component.tsx | 4 +- ...omponent.js => ClickOutside.component.tsx} | 9 +- .../CloseIcon/CloseIcon.component.tsx | 4 +- ...ck.component.js => CmsBlock.component.tsx} | 6 +- .../component/CmsBlock/CmsBlock.container.js | 10 +- .../CompareIcon/CompareIcon.component.tsx | 4 +- ...component.js => ContactForm.component.tsx} | 4 +- ...ponent.js => ContentWrapper.component.tsx} | 5 +- ...component.js => CookiePopup.component.tsx} | 4 +- ...nent.js => CurrencySwitcher.component.tsx} | 4 +- ....component.js => DatePicker.component.tsx} | 3 +- ....component.js => DateSelect.component.tsx} | 4 +- ....component.js => DemoNotice.component.tsx} | 8 +- ...e.component.js => Draggable.component.tsx} | 9 +- .../component/EditIcon/EditIcon.component.tsx | 4 +- .../ExclamationMarkIcon.component.tsx | 4 +- ...ent.js => ExpandableContent.component.tsx} | 6 +- ...> ExpandableContentShowMore.component.tsx} | 9 +- ...Field.component.js => Field.component.tsx} | 5 +- .../src/component/Field/Field.container.js | 12 +- ...e.component.js => FieldFile.component.tsx} | 4 +- ...m.component.js => FieldForm.component.tsx} | 3 +- ....component.js => FieldGroup.component.tsx} | 5 +- .../FieldGroup/FieldGroup.container.js | 16 +- ...component.js => FieldNumber.component.tsx} | 4 +- .../FieldNumber/FieldNumber.container.js | 8 +- ...component.js => FieldSelect.component.tsx} | 4 +- .../FieldSelect/FieldSelect.container.js | 18 +- .../FilterIcon/FilterIcon.component.tsx | 4 +- ...oter.component.js => Footer.component.tsx} | 3 +- .../{Form.component.js => Form.component.tsx} | 5 +- .../src/component/Form/Form.container.js | 22 +- .../component/GridIcon/GridIcon.component.tsx | 4 +- ...nt.js => GroupedProductList.component.tsx} | 4 +- ...t.js => GroupedProductsItem.component.tsx} | 4 +- ...ader.component.js => Header.component.tsx} | 3 +- .../src/component/Header/Header.container.js | 16 +- .../HeartIcon/HeartIcon.component.tsx | 4 +- .../component/HomeIcon/HomeIcon.component.tsx | 4 +- .../{Html.component.js => Html.component.tsx} | 3 +- ...Image.component.js => Image.component.tsx} | 7 +- ...ponent.js => ImageZoomPopup.component.tsx} | 5 +- .../ImageZoomPopup.container.js | 16 +- ...mponent.js => InstallPrompt.component.tsx} | 4 +- .../InstallPrompt/InstallPrompt.container.js | 6 +- ....js => InstallPromptAndroid.component.tsx} | 5 +- ...nent.js => InstallPromptIOS.component.tsx} | 6 +- ...mponent.js => KeyValueTable.component.tsx} | 4 +- ...arna.component.js => Klarna.component.tsx} | 6 +- .../{Link.component.js => Link.component.tsx} | 35 ++- .../src/component/Link/Link.container.js | 6 +- .../scandipwa/src/component/Link/Link.type.ts | 23 ++ .../component/ListIcon/ListIcon.component.tsx | 4 +- ...ader.component.js => Loader.component.tsx} | 5 +- .../component/LockIcon/LockIcon.component.tsx | 4 +- .../{Logo.component.js => Logo.component.tsx} | 2 +- .../{Menu.component.js => Menu.component.tsx} | 8 +- .../src/component/Menu/Menu.container.js | 14 +- .../component/MenuIcon/MenuIcon.component.tsx | 4 +- ...em.component.js => MenuItem.component.tsx} | 5 +- .../{Meta.component.js => Meta.component.tsx} | 7 +- .../MinusIcon/MinusIcon.component.tsx | 4 +- ....js => MyAccountAddressBook.component.tsx} | 3 +- ....js => MyAccountAddressForm.component.tsx} | 2 - ...js => MyAccountAddressPopup.component.tsx} | 4 +- ...js => MyAccountAddressTable.component.tsx} | 4 +- ...js => MyAccountConfirmEmail.component.tsx} | 4 +- ...s => MyAccountCreateAccount.component.tsx} | 4 +- ...js => MyAccountCustomerForm.component.tsx} | 2 - ...s => MyAccountCustomerPopup.component.tsx} | 4 +- ...s => MyAccountCustomerTable.component.tsx} | 4 +- ...nt.js => MyAccountDashboard.component.tsx} | 4 +- ...js => MyAccountDownloadable.component.tsx} | 3 +- .../MyAccountDownloadable.container.js | 4 +- ...AccountDownloadableTableRow.component.tsx} | 4 +- ... => MyAccountForgotPassword.component.tsx} | 5 +- ...ccountForgotPasswordSuccess.component.tsx} | 4 +- ....js => MyAccountInformation.component.tsx} | 4 +- ...ent.js => MyAccountMyOrders.component.tsx} | 3 +- .../MyAccountMyOrders.container.js | 6 +- ...t.js => MyAccountMyWishlist.component.tsx} | 7 +- ...countNewsletterSubscription.component.tsx} | 2 - ...ponent.js => MyAccountOrder.component.tsx} | 6 +- .../MyAccountOrder.container.js | 8 +- ...> MyAccountOrderInformation.component.tsx} | 3 +- ...=> MyAccountOrderItemsTable.component.tsx} | 4 +- ...MyAccountOrderItemsTableRow.component.tsx} | 181 ++++++++-------- ...ent.js => MyAccountOrderTab.component.tsx} | 5 +- ...s => MyAccountOrderTableRow.component.tsx} | 4 +- ...nt.js => MyAccountOrderTabs.component.tsx} | 4 +- ....js => MyAccountOrderTotals.component.tsx} | 4 +- .../MyAccountOrderTotals.container.js | 8 +- ...nent.js => MyAccountOverlay.component.tsx} | 4 +- .../MyAccountOverlay.container.js | 6 +- ...js => MyAccountPasswordForm.component.tsx} | 2 - ...onent.js => MyAccountSignIn.component.tsx} | 4 +- .../MyAccountSignIn.container.js | 6 +- ...nent.js => MyAccountTabList.component.tsx} | 4 +- ....js => MyAccountTabListItem.component.tsx} | 5 +- ...nt.js => NavigationAbstract.component.tsx} | 2 +- .../NavigationAbstract.container.js | 6 +- ...ponent.js => NavigationTabs.component.tsx} | 2 +- .../NavigationTabs.container.js | 18 +- ...component.js => NewProducts.component.tsx} | 7 +- .../NewProducts/NewProducts.container.js | 8 +- ...onent.js => NewVersionPopup.component.tsx} | 4 +- .../NewVersionPopup.container.js | 4 +- ...s => NewsletterSubscription.component.tsx} | 4 +- ...t.js => NotSupportedPayment.component.tsx} | 8 +- ...omponent.js => Notification.component.tsx} | 7 +- ...nent.js => NotificationList.component.tsx} | 4 +- ...mponent.js => OfflineNotice.component.tsx} | 6 +- .../OfflineNotice/OfflineNotice.container.js | 10 +- ...lay.component.js => Overlay.component.tsx} | 5 +- ....component.js => Pagination.component.tsx} | 5 +- ...ponent.js => PaginationLink.component.tsx} | 5 +- ...nt.js => PasswordChangeForm.component.tsx} | 1 - ...Popup.component.js => Popup.component.tsx} | 9 +- ...mponent.js => PopupSuspense.component.tsx} | 7 +- ...uct.component.js => Product.component.tsx} | 5 +- .../component/Product/Product.container.js | 26 +-- ...ponent.js => ProductActions.component.tsx} | 202 +++++++++--------- .../ProductActions.container.js | 2 +- ...mponent.js => ProductAlerts.component.tsx} | 28 +-- ...js => ProductAttributeValue.component.tsx} | 5 +- ...ent.js => ProductAttributes.component.tsx} | 3 +- ...t.js => ProductBundleOption.component.tsx} | 6 +- .../ProductBundleOption.container.js | 14 +- ....js => ProductBundleOptions.component.tsx} | 4 +- ...component.js => ProductCard.component.tsx} | 5 +- ...ponent.js => ProductCompare.component.tsx} | 3 +- .../ProductCompare.container.js | 12 +- ... ProductCompareAttributeRow.component.tsx} | 4 +- ....js => ProductCompareButton.component.tsx} | 5 +- ...nt.js => ProductCompareItem.component.tsx} | 6 +- ...nfigurableAttributeDropdown.component.tsx} | 5 +- ...oductConfigurableAttributes.component.tsx} | 5 +- ...> ProductCustomizableOption.component.tsx} | 6 +- ... ProductCustomizableOptions.component.tsx} | 4 +- ...=> ProductDownloadableLinks.component.tsx} | 4 +- .../ProductDownloadableLinks.container.js | 8 +- ... ProductDownloadableSamples.component.tsx} | 5 +- ...ponent.js => ProductGallery.component.tsx} | 11 +- .../ProductGallery.container.js | 30 +-- ... => ProductGalleryBaseImage.component.tsx} | 4 +- .../ProductGalleryBaseImage.container.js | 4 +- ...roductGalleryThumbnailImage.component.tsx} | 4 +- ...nt.js => ProductInformation.component.tsx} | 4 +- ...omponent.js => ProductLinks.component.tsx} | 3 +- ...component.js => ProductList.component.tsx} | 77 ++++--- .../ProductList/ProductList.container.js | 24 +-- ...onent.js => ProductListPage.component.tsx} | 11 +- ...omponent.js => ProductPrice.component.tsx} | 5 +- ...ent.js => ProductReviewForm.component.tsx} | 4 +- ...ent.js => ProductReviewItem.component.tsx} | 3 +- ...ent.js => ProductReviewList.component.tsx} | 3 +- ...t.js => ProductReviewRating.component.tsx} | 7 +- ...ponent.js => ProductReviews.component.tsx} | 4 +- ....component.js => ProductTab.component.tsx} | 4 +- ...component.js => ProductTabs.component.tsx} | 8 +- ...js => ProductWishlistButton.component.tsx} | 5 +- .../ProductWishlistButton.container.js | 12 +- ...mponent.js => PurchaseOrder.component.tsx} | 4 +- .../RadioButtonIcon.component.tsx | 4 +- ....js => RecentlyViewedWidget.component.tsx} | 3 +- .../RecentlyViewedWidget.container.js | 6 +- ...ent.js => RenderWhenVisible.component.tsx} | 9 +- ...onent.js => ResetAttributes.component.tsx} | 4 +- ...component.js => ResetButton.component.tsx} | 5 +- ....component.js => ReviewStar.component.tsx} | 5 +- ...uter.component.js => Router.component.tsx} | 3 +- .../src/component/Router/Router.container.js | 8 +- ...component.js => SearchField.component.tsx} | 3 +- .../SearchIcon/SearchIcon.component.tsx | 4 +- ....component.js => SearchItem.component.tsx} | 6 +- ...mponent.js => SearchOverlay.component.tsx} | 6 +- .../ShareIcon/ShareIcon.component.tsx | 4 +- ...ent.js => ShareWishlistForm.component.tsx} | 1 - ...nt.js => ShareWishlistPopup.component.tsx} | 4 +- ...nent.js => SharedTransition.component.tsx} | 5 +- ...nt.js => SharedWishlistItem.component.tsx} | 2 +- ...ider.component.js => Slider.component.tsx} | 9 +- ...omponent.js => SliderWidget.component.tsx} | 6 +- .../SliderWidget/SliderWidget.container.js | 10 +- .../component/StarIcon/StarIcon.component.tsx | 6 +- ...mponent.js => StoreInPickUp.component.tsx} | 4 +- ...nt.js => StoreInPickUpPopup.component.tsx} | 4 +- .../StoreInPickUpPopup.container.js | 8 +- ...nt.js => StoreInPickUpStore.component.tsx} | 4 +- ...m.component.js => StoreItem.component.tsx} | 4 +- ...mponent.js => StoreSwitcher.component.tsx} | 4 +- .../StoreSwitcher/StoreSwitcher.container.js | 12 +- ...mponent.js => SwipeToDelete.component.tsx} | 5 +- ...onent.js => TextPlaceholder.component.tsx} | 5 +- ....component.js => TierPrices.component.tsx} | 5 +- ...js => TranslateOnCursorMove.component.tsx} | 10 +- .../UploadIcon/UploadIcon.component.tsx | 4 +- .../component/UserIcon/UserIcon.component.tsx | 4 +- ....component.js => VideoPopup.component.tsx} | 7 +- ...ponent.js => VideoThumbnail.component.tsx} | 4 +- ...mponent.js => WidgetFactory.component.tsx} | 3 +- ...omponent.js => WishlistItem.component.tsx} | 4 +- .../src/route/CartPage/CartPage.container.js | 10 +- .../CategoryPage/CategoryPage.container.js | 4 +- .../src/route/Checkout/Checkout.component.js | 190 ++++++++-------- .../src/route/Checkout/Checkout.container.js | 12 +- .../src/route/CmsPage/CmsPage.container.js | 8 +- .../ConfirmAccountPage.container.js | 6 +- .../ContactPage/ContactPage.container.js | 6 +- .../CreateAccount/CreateAccount.container.js | 10 +- .../ForgotPassword.container.js | 12 +- .../src/route/HomePage/HomePage.container.js | 4 +- .../LoginAccount/LoginAccount.container.js | 12 +- .../src/route/MenuPage/MenuPage.container.js | 4 +- .../route/MyAccount/MyAccount.container.js | 74 +++---- .../src/route/NoMatch/NoMatch.component.js | 26 +-- .../src/route/NoMatch/NoMatch.container.js | 14 +- .../NoMatchHandler.component.js | 6 +- .../NoMatchHandler.container.js | 4 +- .../PasswordChangePage.container.js | 22 +- .../ProductComparePage.container.js | 4 +- .../ProductPage/ProductPage.container.js | 22 +- .../route/SearchPage/SearchPage.container.js | 4 +- .../SomethingWentWrong.container.js | 4 +- .../StyleGuidePage.container.js | 6 +- .../UrlRewrites/UrlRewrites.container.js | 90 ++++---- .../WishlistSharedPage.container.js | 12 +- .../scandipwa/src/type/Breadcrumbs.type.ts | 2 - packages/scandipwa/src/type/Common.type.ts | 8 +- packages/scandipwa/src/type/Layout.type.js | 17 -- packages/scandipwa/src/type/Router.type.ts | 6 +- yarn.lock | 5 + 278 files changed, 1454 insertions(+), 1377 deletions(-) rename packages/scandipwa/src/component/AddToCart/{AddToCart.component.js => AddToCart.component.tsx} (69%) create mode 100644 packages/scandipwa/src/component/AddToCart/AddToCart.type.ts rename packages/scandipwa/src/component/App/{App.component.js => App.component.tsx} (73%) create mode 100644 packages/scandipwa/src/component/App/App.type.ts rename packages/scandipwa/src/component/Breadcrumb/{Breadcrumb.component.js => Breadcrumb.component.tsx} (76%) create mode 100644 packages/scandipwa/src/component/Breadcrumb/Breadcrumb.type.ts rename packages/scandipwa/src/component/Breadcrumbs/{Breadcrumbs.component.js => Breadcrumbs.component.tsx} (81%) create mode 100644 packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.type.ts rename packages/scandipwa/src/component/CarouselScroll/{CarouselScroll.component.js => CarouselScroll.component.tsx} (84%) create mode 100644 packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts rename packages/scandipwa/src/component/CarouselScrollArrow/{CarouselScrollArrow.component.js => CarouselScrollArrow.component.tsx} (91%) rename packages/scandipwa/src/component/CarouselScrollItem/{CarouselScrollItem.component.js => CarouselScrollItem.component.tsx} (91%) rename packages/scandipwa/src/component/CartCoupon/{CartCoupon.component.js => CartCoupon.component.tsx} (98%) rename packages/scandipwa/src/component/CartItem/{CartItem.component.js => CartItem.component.tsx} (99%) rename packages/scandipwa/src/component/CartItemPrice/{CartItemPrice.component.js => CartItemPrice.component.tsx} (94%) rename packages/scandipwa/src/component/CartOverlay/{CartOverlay.component.js => CartOverlay.component.tsx} (98%) rename packages/scandipwa/src/component/CategoryConfigurableAttributes/{CategoryConfigurableAttributes.component.js => CategoryConfigurableAttributes.component.tsx} (99%) rename packages/scandipwa/src/component/CategoryDetails/{CategoryDetails.component.js => CategoryDetails.component.tsx} (97%) rename packages/scandipwa/src/component/CategoryFilterOverlay/{CategoryFilterOverlay.component.js => CategoryFilterOverlay.component.tsx} (98%) rename packages/scandipwa/src/component/CategoryItemsCount/{CategoryItemsCount.component.js => CategoryItemsCount.component.tsx} (93%) rename packages/scandipwa/src/component/CategorySort/{CategorySort.component.js => CategorySort.component.tsx} (97%) rename packages/scandipwa/src/component/CheckoutAddressBook/{CheckoutAddressBook.component.js => CheckoutAddressBook.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutAddressForm/{CheckoutAddressForm.component.js => CheckoutAddressForm.component.tsx} (97%) rename packages/scandipwa/src/component/CheckoutAddressTable/{CheckoutAddressTable.component.js => CheckoutAddressTable.component.tsx} (96%) rename packages/scandipwa/src/component/CheckoutBilling/{CheckoutBilling.component.js => CheckoutBilling.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutDeliveryOption/{CheckoutDeliveryOption.component.js => CheckoutDeliveryOption.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutDeliveryOptions/{CheckoutDeliveryOptions.component.js => CheckoutDeliveryOptions.component.tsx} (97%) rename packages/scandipwa/src/component/CheckoutGuestForm/{CheckoutGuestForm.component.js => CheckoutGuestForm.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutOrderSummary/{CheckoutOrderSummary.component.js => CheckoutOrderSummary.component.tsx} (99%) rename packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/{CheckoutOrderSummaryPriceLine.component.js => CheckoutOrderSummaryPriceLine.component.tsx} (96%) rename packages/scandipwa/src/component/CheckoutPayment/{CheckoutPayment.component.js => CheckoutPayment.component.tsx} (96%) rename packages/scandipwa/src/component/CheckoutPayments/{CheckoutPayments.component.js => CheckoutPayments.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutShipping/{CheckoutShipping.component.js => CheckoutShipping.component.tsx} (98%) rename packages/scandipwa/src/component/CheckoutSuccess/{CheckoutSuccess.component.js => CheckoutSuccess.component.tsx} (97%) rename packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/{CheckoutTermsAndConditionsPopup.component.js => CheckoutTermsAndConditionsPopup.component.tsx} (94%) rename packages/scandipwa/src/component/ClickOutside/{ClickOutside.component.js => ClickOutside.component.tsx} (92%) rename packages/scandipwa/src/component/CmsBlock/{CmsBlock.component.js => CmsBlock.component.tsx} (94%) rename packages/scandipwa/src/component/ContactForm/{ContactForm.component.js => ContactForm.component.tsx} (96%) rename packages/scandipwa/src/component/ContentWrapper/{ContentWrapper.component.js => ContentWrapper.component.tsx} (93%) rename packages/scandipwa/src/component/CookiePopup/{CookiePopup.component.js => CookiePopup.component.tsx} (97%) rename packages/scandipwa/src/component/CurrencySwitcher/{CurrencySwitcher.component.js => CurrencySwitcher.component.tsx} (96%) rename packages/scandipwa/src/component/DatePicker/{DatePicker.component.js => DatePicker.component.tsx} (98%) rename packages/scandipwa/src/component/DateSelect/{DateSelect.component.js => DateSelect.component.tsx} (99%) rename packages/scandipwa/src/component/DemoNotice/{DemoNotice.component.js => DemoNotice.component.tsx} (91%) rename packages/scandipwa/src/component/Draggable/{Draggable.component.js => Draggable.component.tsx} (97%) rename packages/scandipwa/src/component/ExpandableContent/{ExpandableContent.component.js => ExpandableContent.component.tsx} (98%) rename packages/scandipwa/src/component/ExpandableContentShowMore/{ExpandableContentShowMore.component.js => ExpandableContentShowMore.component.tsx} (97%) rename packages/scandipwa/src/component/Field/{Field.component.js => Field.component.tsx} (99%) rename packages/scandipwa/src/component/FieldFile/{FieldFile.component.js => FieldFile.component.tsx} (97%) rename packages/scandipwa/src/component/FieldForm/{FieldForm.component.js => FieldForm.component.tsx} (97%) rename packages/scandipwa/src/component/FieldGroup/{FieldGroup.component.js => FieldGroup.component.tsx} (97%) rename packages/scandipwa/src/component/FieldNumber/{FieldNumber.component.js => FieldNumber.component.tsx} (97%) rename packages/scandipwa/src/component/FieldSelect/{FieldSelect.component.js => FieldSelect.component.tsx} (98%) rename packages/scandipwa/src/component/Footer/{Footer.component.js => Footer.component.tsx} (99%) rename packages/scandipwa/src/component/Form/{Form.component.js => Form.component.tsx} (97%) rename packages/scandipwa/src/component/GroupedProductList/{GroupedProductList.component.js => GroupedProductList.component.tsx} (95%) rename packages/scandipwa/src/component/GroupedProductsItem/{GroupedProductsItem.component.js => GroupedProductsItem.component.tsx} (98%) rename packages/scandipwa/src/component/Header/{Header.component.js => Header.component.tsx} (99%) rename packages/scandipwa/src/component/Html/{Html.component.js => Html.component.tsx} (99%) rename packages/scandipwa/src/component/Image/{Image.component.js => Image.component.tsx} (98%) rename packages/scandipwa/src/component/ImageZoomPopup/{ImageZoomPopup.component.js => ImageZoomPopup.component.tsx} (92%) rename packages/scandipwa/src/component/InstallPrompt/{InstallPrompt.component.js => InstallPrompt.component.tsx} (97%) rename packages/scandipwa/src/component/InstallPromptAndroid/{InstallPromptAndroid.component.js => InstallPromptAndroid.component.tsx} (96%) rename packages/scandipwa/src/component/InstallPromptIOS/{InstallPromptIOS.component.js => InstallPromptIOS.component.tsx} (95%) rename packages/scandipwa/src/component/KeyValueTable/{KeyValueTable.component.js => KeyValueTable.component.tsx} (96%) rename packages/scandipwa/src/component/Klarna/{Klarna.component.js => Klarna.component.tsx} (97%) rename packages/scandipwa/src/component/Link/{Link.component.js => Link.component.tsx} (83%) create mode 100644 packages/scandipwa/src/component/Link/Link.type.ts rename packages/scandipwa/src/component/Loader/{Loader.component.js => Loader.component.tsx} (92%) rename packages/scandipwa/src/component/Logo/{Logo.component.js => Logo.component.tsx} (98%) rename packages/scandipwa/src/component/Menu/{Menu.component.js => Menu.component.tsx} (98%) rename packages/scandipwa/src/component/MenuItem/{MenuItem.component.js => MenuItem.component.tsx} (97%) rename packages/scandipwa/src/component/Meta/{Meta.component.js => Meta.component.tsx} (95%) rename packages/scandipwa/src/component/MyAccountAddressBook/{MyAccountAddressBook.component.js => MyAccountAddressBook.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountAddressForm/{MyAccountAddressForm.component.js => MyAccountAddressForm.component.tsx} (99%) rename packages/scandipwa/src/component/MyAccountAddressPopup/{MyAccountAddressPopup.component.js => MyAccountAddressPopup.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountAddressTable/{MyAccountAddressTable.component.js => MyAccountAddressTable.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountConfirmEmail/{MyAccountConfirmEmail.component.js => MyAccountConfirmEmail.component.tsx} (94%) rename packages/scandipwa/src/component/MyAccountCreateAccount/{MyAccountCreateAccount.component.js => MyAccountCreateAccount.component.tsx} (99%) rename packages/scandipwa/src/component/MyAccountCustomerForm/{MyAccountCustomerForm.component.js => MyAccountCustomerForm.component.tsx} (99%) rename packages/scandipwa/src/component/MyAccountCustomerPopup/{MyAccountCustomerPopup.component.js => MyAccountCustomerPopup.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountCustomerTable/{MyAccountCustomerTable.component.js => MyAccountCustomerTable.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountDashboard/{MyAccountDashboard.component.js => MyAccountDashboard.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountDownloadable/{MyAccountDownloadable.component.js => MyAccountDownloadable.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountDownloadableTableRow/{MyAccountDownloadableTableRow.component.js => MyAccountDownloadableTableRow.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountForgotPassword/{MyAccountForgotPassword.component.js => MyAccountForgotPassword.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/{MyAccountForgotPasswordSuccess.component.js => MyAccountForgotPasswordSuccess.component.tsx} (95%) rename packages/scandipwa/src/component/MyAccountInformation/{MyAccountInformation.component.js => MyAccountInformation.component.tsx} (96%) rename packages/scandipwa/src/component/MyAccountMyOrders/{MyAccountMyOrders.component.js => MyAccountMyOrders.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountMyWishlist/{MyAccountMyWishlist.component.js => MyAccountMyWishlist.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountNewsletterSubscription/{MyAccountNewsletterSubscription.component.js => MyAccountNewsletterSubscription.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountOrder/{MyAccountOrder.component.js => MyAccountOrder.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountOrderInformation/{MyAccountOrderInformation.component.js => MyAccountOrderInformation.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountOrderItemsTable/{MyAccountOrderItemsTable.component.js => MyAccountOrderItemsTable.component.tsx} (99%) rename packages/scandipwa/src/component/MyAccountOrderItemsTableRow/{MyAccountOrderItemsTableRow.component.js => MyAccountOrderItemsTableRow.component.tsx} (66%) rename packages/scandipwa/src/component/MyAccountOrderTab/{MyAccountOrderTab.component.js => MyAccountOrderTab.component.tsx} (93%) rename packages/scandipwa/src/component/MyAccountOrderTableRow/{MyAccountOrderTableRow.component.js => MyAccountOrderTableRow.component.tsx} (95%) rename packages/scandipwa/src/component/MyAccountOrderTabs/{MyAccountOrderTabs.component.js => MyAccountOrderTabs.component.tsx} (95%) rename packages/scandipwa/src/component/MyAccountOrderTotals/{MyAccountOrderTotals.component.js => MyAccountOrderTotals.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountOverlay/{MyAccountOverlay.component.js => MyAccountOverlay.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountPasswordForm/{MyAccountPasswordForm.component.js => MyAccountPasswordForm.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountSignIn/{MyAccountSignIn.component.js => MyAccountSignIn.component.tsx} (98%) rename packages/scandipwa/src/component/MyAccountTabList/{MyAccountTabList.component.js => MyAccountTabList.component.tsx} (97%) rename packages/scandipwa/src/component/MyAccountTabListItem/{MyAccountTabListItem.component.js => MyAccountTabListItem.component.tsx} (94%) rename packages/scandipwa/src/component/NavigationAbstract/{NavigationAbstract.component.js => NavigationAbstract.component.tsx} (98%) rename packages/scandipwa/src/component/NavigationTabs/{NavigationTabs.component.js => NavigationTabs.component.tsx} (99%) rename packages/scandipwa/src/component/NewProducts/{NewProducts.component.js => NewProducts.component.tsx} (96%) rename packages/scandipwa/src/component/NewVersionPopup/{NewVersionPopup.component.js => NewVersionPopup.component.tsx} (97%) rename packages/scandipwa/src/component/NewsletterSubscription/{NewsletterSubscription.component.js => NewsletterSubscription.component.tsx} (97%) rename packages/scandipwa/src/component/NotSupportedPayment/{NotSupportedPayment.component.js => NotSupportedPayment.component.tsx} (88%) rename packages/scandipwa/src/component/Notification/{Notification.component.js => Notification.component.tsx} (97%) rename packages/scandipwa/src/component/NotificationList/{NotificationList.component.js => NotificationList.component.tsx} (94%) rename packages/scandipwa/src/component/OfflineNotice/{OfflineNotice.component.js => OfflineNotice.component.tsx} (96%) rename packages/scandipwa/src/component/Overlay/{Overlay.component.js => Overlay.component.tsx} (97%) rename packages/scandipwa/src/component/Pagination/{Pagination.component.js => Pagination.component.tsx} (98%) rename packages/scandipwa/src/component/PaginationLink/{PaginationLink.component.js => PaginationLink.component.tsx} (94%) rename packages/scandipwa/src/component/PasswordChangeForm/{PasswordChangeForm.component.js => PasswordChangeForm.component.tsx} (97%) rename packages/scandipwa/src/component/Popup/{Popup.component.js => Popup.component.tsx} (97%) rename packages/scandipwa/src/component/PopupSuspense/{PopupSuspense.component.js => PopupSuspense.component.tsx} (95%) rename packages/scandipwa/src/component/Product/{Product.component.js => Product.component.tsx} (99%) rename packages/scandipwa/src/component/ProductActions/{ProductActions.component.js => ProductActions.component.tsx} (61%) rename packages/scandipwa/src/component/ProductAlerts/{ProductAlerts.component.js => ProductAlerts.component.tsx} (74%) rename packages/scandipwa/src/component/ProductAttributeValue/{ProductAttributeValue.component.js => ProductAttributeValue.component.tsx} (99%) rename packages/scandipwa/src/component/ProductAttributes/{ProductAttributes.component.js => ProductAttributes.component.tsx} (98%) rename packages/scandipwa/src/component/ProductBundleOption/{ProductBundleOption.component.js => ProductBundleOption.component.tsx} (99%) rename packages/scandipwa/src/component/ProductBundleOptions/{ProductBundleOptions.component.js => ProductBundleOptions.component.tsx} (95%) rename packages/scandipwa/src/component/ProductCard/{ProductCard.component.js => ProductCard.component.tsx} (99%) rename packages/scandipwa/src/component/ProductCompare/{ProductCompare.component.js => ProductCompare.component.tsx} (99%) rename packages/scandipwa/src/component/ProductCompareAttributeRow/{ProductCompareAttributeRow.component.js => ProductCompareAttributeRow.component.tsx} (96%) rename packages/scandipwa/src/component/ProductCompareButton/{ProductCompareButton.component.js => ProductCompareButton.component.tsx} (94%) rename packages/scandipwa/src/component/ProductCompareItem/{ProductCompareItem.component.js => ProductCompareItem.component.tsx} (98%) rename packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/{ProductConfigurableAttributeDropdown.component.js => ProductConfigurableAttributeDropdown.component.tsx} (96%) rename packages/scandipwa/src/component/ProductConfigurableAttributes/{ProductConfigurableAttributes.component.js => ProductConfigurableAttributes.component.tsx} (98%) rename packages/scandipwa/src/component/ProductCustomizableOption/{ProductCustomizableOption.component.js => ProductCustomizableOption.component.tsx} (98%) rename packages/scandipwa/src/component/ProductCustomizableOptions/{ProductCustomizableOptions.component.js => ProductCustomizableOptions.component.tsx} (95%) rename packages/scandipwa/src/component/ProductDownloadableLinks/{ProductDownloadableLinks.component.js => ProductDownloadableLinks.component.tsx} (98%) rename packages/scandipwa/src/component/ProductDownloadableSamples/{ProductDownloadableSamples.component.js => ProductDownloadableSamples.component.tsx} (96%) rename packages/scandipwa/src/component/ProductGallery/{ProductGallery.component.js => ProductGallery.component.tsx} (98%) rename packages/scandipwa/src/component/ProductGalleryBaseImage/{ProductGalleryBaseImage.component.js => ProductGalleryBaseImage.component.tsx} (94%) rename packages/scandipwa/src/component/ProductGalleryThumbnailImage/{ProductGalleryThumbnailImage.component.js => ProductGalleryThumbnailImage.component.tsx} (97%) rename packages/scandipwa/src/component/ProductInformation/{ProductInformation.component.js => ProductInformation.component.tsx} (97%) rename packages/scandipwa/src/component/ProductLinks/{ProductLinks.component.js => ProductLinks.component.tsx} (98%) rename packages/scandipwa/src/component/ProductList/{ProductList.component.js => ProductList.component.tsx} (83%) rename packages/scandipwa/src/component/ProductListPage/{ProductListPage.component.js => ProductListPage.component.tsx} (97%) rename packages/scandipwa/src/component/ProductPrice/{ProductPrice.component.js => ProductPrice.component.tsx} (99%) rename packages/scandipwa/src/component/ProductReviewForm/{ProductReviewForm.component.js => ProductReviewForm.component.tsx} (98%) rename packages/scandipwa/src/component/ProductReviewItem/{ProductReviewItem.component.js => ProductReviewItem.component.tsx} (97%) rename packages/scandipwa/src/component/ProductReviewList/{ProductReviewList.component.js => ProductReviewList.component.tsx} (94%) rename packages/scandipwa/src/component/ProductReviewRating/{ProductReviewRating.component.js => ProductReviewRating.component.tsx} (97%) rename packages/scandipwa/src/component/ProductReviews/{ProductReviews.component.js => ProductReviews.component.tsx} (98%) rename packages/scandipwa/src/component/ProductTab/{ProductTab.component.js => ProductTab.component.tsx} (94%) rename packages/scandipwa/src/component/ProductTabs/{ProductTabs.component.js => ProductTabs.component.tsx} (95%) rename packages/scandipwa/src/component/ProductWishlistButton/{ProductWishlistButton.component.js => ProductWishlistButton.component.tsx} (96%) rename packages/scandipwa/src/component/PurchaseOrder/{PurchaseOrder.component.js => PurchaseOrder.component.tsx} (95%) rename packages/scandipwa/src/component/RecentlyViewedWidget/{RecentlyViewedWidget.component.js => RecentlyViewedWidget.component.tsx} (98%) rename packages/scandipwa/src/component/RenderWhenVisible/{RenderWhenVisible.component.js => RenderWhenVisible.component.tsx} (94%) rename packages/scandipwa/src/component/ResetAttributes/{ResetAttributes.component.js => ResetAttributes.component.tsx} (97%) rename packages/scandipwa/src/component/ResetButton/{ResetButton.component.js => ResetButton.component.tsx} (94%) rename packages/scandipwa/src/component/ReviewStar/{ReviewStar.component.js => ReviewStar.component.tsx} (95%) rename packages/scandipwa/src/component/Router/{Router.component.js => Router.component.tsx} (99%) rename packages/scandipwa/src/component/SearchField/{SearchField.component.js => SearchField.component.tsx} (99%) rename packages/scandipwa/src/component/SearchItem/{SearchItem.component.js => SearchItem.component.tsx} (96%) rename packages/scandipwa/src/component/SearchOverlay/{SearchOverlay.component.js => SearchOverlay.component.tsx} (96%) rename packages/scandipwa/src/component/ShareWishlistForm/{ShareWishlistForm.component.js => ShareWishlistForm.component.tsx} (97%) rename packages/scandipwa/src/component/ShareWishlistPopup/{ShareWishlistPopup.component.js => ShareWishlistPopup.component.tsx} (94%) rename packages/scandipwa/src/component/SharedTransition/{SharedTransition.component.js => SharedTransition.component.tsx} (97%) rename packages/scandipwa/src/component/SharedWishlistItem/{SharedWishlistItem.component.js => SharedWishlistItem.component.tsx} (98%) rename packages/scandipwa/src/component/Slider/{Slider.component.js => Slider.component.tsx} (99%) rename packages/scandipwa/src/component/SliderWidget/{SliderWidget.component.js => SliderWidget.component.tsx} (97%) rename packages/scandipwa/src/component/StoreInPickUp/{StoreInPickUp.component.js => StoreInPickUp.component.tsx} (98%) rename packages/scandipwa/src/component/StoreInPickUpPopup/{StoreInPickUpPopup.component.js => StoreInPickUpPopup.component.tsx} (98%) rename packages/scandipwa/src/component/StoreInPickUpStore/{StoreInPickUpStore.component.js => StoreInPickUpStore.component.tsx} (97%) rename packages/scandipwa/src/component/StoreItem/{StoreItem.component.js => StoreItem.component.tsx} (92%) rename packages/scandipwa/src/component/StoreSwitcher/{StoreSwitcher.component.js => StoreSwitcher.component.tsx} (97%) rename packages/scandipwa/src/component/SwipeToDelete/{SwipeToDelete.component.js => SwipeToDelete.component.tsx} (98%) rename packages/scandipwa/src/component/TextPlaceholder/{TextPlaceholder.component.js => TextPlaceholder.component.tsx} (92%) rename packages/scandipwa/src/component/TierPrices/{TierPrices.component.js => TierPrices.component.tsx} (98%) rename packages/scandipwa/src/component/TranslateOnCursorMove/{TranslateOnCursorMove.component.js => TranslateOnCursorMove.component.tsx} (96%) rename packages/scandipwa/src/component/VideoPopup/{VideoPopup.component.js => VideoPopup.component.tsx} (96%) rename packages/scandipwa/src/component/VideoThumbnail/{VideoThumbnail.component.js => VideoThumbnail.component.tsx} (96%) rename packages/scandipwa/src/component/WidgetFactory/{WidgetFactory.component.js => WidgetFactory.component.tsx} (98%) rename packages/scandipwa/src/component/WishlistItem/{WishlistItem.component.js => WishlistItem.component.tsx} (99%) delete mode 100644 packages/scandipwa/src/type/Layout.type.js diff --git a/packages/scandipwa/.vscode/settings.json b/packages/scandipwa/.vscode/settings.json index 0b5601aef5..26eed6a75d 100644 --- a/packages/scandipwa/.vscode/settings.json +++ b/packages/scandipwa/.vscode/settings.json @@ -24,5 +24,11 @@ ], "stylelint.enable": true, "css.validate": false, - "scss.validate": false -} \ No newline at end of file + "scss.validate": false, + "javascript.preferences.quoteStyle": "single", + "javascript.referencesCodeLens.showOnAllFunctions": true, + "javascript.referencesCodeLens.enabled": true, + "typescript.preferences.quoteStyle": "single", + "typescript.referencesCodeLens.enabled": true, + "typescript.referencesCodeLens.showOnAllFunctions": true +} diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index c17cc6651c..9fad1bc9bf 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -25,6 +25,7 @@ "@types/react-redux": "7.1.16", "@types/react-router": "^5.1.16", "@types/react-router-dom": "^5.1.8", + "@types/webpack-env": "^1.16.3", "eslint-config-airbnb-typescript": "^16.1.4", "get-graphql-schema": "^2.1.2", "graphql-schema-typescript": "^1.5.2", diff --git a/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx index 2cb4f30a43..203ab78b4e 100644 --- a/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx +++ b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { AddIconProps } from './AddIcon.type'; import './AddIcon.style'; @@ -21,7 +23,7 @@ export class AddIcon extends PureComponent { isPrimary: false }; - render(): JSX.Element { + render(): ReactElement { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/AddToCart/AddToCart.component.js b/packages/scandipwa/src/component/AddToCart/AddToCart.component.tsx similarity index 69% rename from packages/scandipwa/src/component/AddToCart/AddToCart.component.js rename to packages/scandipwa/src/component/AddToCart/AddToCart.component.tsx index 423856a21d..cf0e54f4a5 100644 --- a/packages/scandipwa/src/component/AddToCart/AddToCart.component.js +++ b/packages/scandipwa/src/component/AddToCart/AddToCart.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CartIcon from 'Component/CartIcon'; -import { MixType } from 'Type/Common.type'; -import { LayoutType } from 'Type/Layout.type'; +import { ReactElement } from 'Type/Common.type'; + +import { AddToCartComponentProps } from './AddToCart.type'; import './AddToCart.style'; @@ -23,19 +23,8 @@ import './AddToCart.style'; * @class AddToCart * @namespace Component/AddToCart/Component */ -export class AddToCart extends PureComponent { - static propTypes = { - addProductToCart: PropTypes.func.isRequired, - isDisabled: PropTypes.bool.isRequired, - isAdding: PropTypes.bool.isRequired, - - // Customization - isIconEnabled: PropTypes.bool.isRequired, - mix: MixType.isRequired, - layout: LayoutType.isRequired - }; - - renderCartIcon() { +export class AddToCart extends PureComponent { + renderCartIcon(): ReactElement { const { isIconEnabled } = this.props; if (!isIconEnabled) { @@ -45,7 +34,7 @@ export class AddToCart extends PureComponent { return ; } - render() { + render(): ReactElement { const { mix, addProductToCart, diff --git a/packages/scandipwa/src/component/AddToCart/AddToCart.container.js b/packages/scandipwa/src/component/AddToCart/AddToCart.container.js index 0a0fed7b10..0e77961ca6 100644 --- a/packages/scandipwa/src/component/AddToCart/AddToCart.container.js +++ b/packages/scandipwa/src/component/AddToCart/AddToCart.container.js @@ -49,7 +49,7 @@ export const mapDispatchToProps = (dispatch) => ({ export class AddToCartContainer extends PureComponent { static propTypes = { product: ProductType, - quantity: PropTypes.oneOfType([PropTypes.number, PropTypes.objectOf(PropTypes.number)]), + quantity: PropTypes.oneOfType([ PropTypes.number, PropTypes.objectOf(PropTypes.number) ]), cartId: PropTypes.string, showNotification: PropTypes.func.isRequired, addToCart: PropTypes.func, @@ -88,10 +88,10 @@ export class AddToCartContainer extends PureComponent { ]; typeValidationMap = { - [PRODUCT_TYPE.bundle]: this.validateBundle.bind(this), - [PRODUCT_TYPE.downloadable]: this.validateDownloadable.bind(this), - [PRODUCT_TYPE.configurable]: this.validateConfigurable.bind(this), - [PRODUCT_TYPE.grouped]: this.validateGroup.bind(this) + [ PRODUCT_TYPE.bundle ]: this.validateBundle.bind(this), + [ PRODUCT_TYPE.downloadable ]: this.validateDownloadable.bind(this), + [ PRODUCT_TYPE.configurable ]: this.validateConfigurable.bind(this), + [ PRODUCT_TYPE.grouped ]: this.validateGroup.bind(this) }; async addProductToCart(e) { @@ -181,7 +181,7 @@ export class AddToCartContainer extends PureComponent { validateByType() { const { product: { type_id } = {} } = this.props; - const { [type_id]: typeValidationFn } = this.typeValidationMap; + const { [ type_id ]: typeValidationFn } = this.typeValidationMap; if (!typeValidationFn) { return true; @@ -234,8 +234,8 @@ export class AddToCartContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/AddToCart/AddToCart.type.ts b/packages/scandipwa/src/component/AddToCart/AddToCart.type.ts new file mode 100644 index 0000000000..8a8eb77470 --- /dev/null +++ b/packages/scandipwa/src/component/AddToCart/AddToCart.type.ts @@ -0,0 +1,23 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { CategoryPageLayout } from 'Route/CategoryPage/CategoryPage.config'; +import { Mix } from 'Type/Common.type'; + +export interface AddToCartComponentProps { + addProductToCart: () => void; + isDisabled: boolean; + isAdding:boolean; + // Customization + isIconEnabled: boolean; + mix: Mix; + layout: CategoryPageLayout; +} diff --git a/packages/scandipwa/src/component/App/App.component.js b/packages/scandipwa/src/component/App/App.component.tsx similarity index 73% rename from packages/scandipwa/src/component/App/App.component.js rename to packages/scandipwa/src/component/App/App.component.tsx index 5474984a27..baac5cff4e 100644 --- a/packages/scandipwa/src/component/App/App.component.js +++ b/packages/scandipwa/src/component/App/App.component.tsx @@ -11,17 +11,23 @@ import { PureComponent } from 'react'; import { Provider } from 'react-redux'; +import { AnyAction, Store } from 'redux'; import { Provider as UnstatedProvider } from 'unstated'; import Router from 'Component/Router'; import SharedTransition from 'Component/SharedTransition'; import SomethingWentWrong from 'Route/SomethingWentWrong'; -import injectStaticReducers from 'Store'; +import injectStaticReducers from 'Store/index'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import getStore from 'Util/Store'; +import { AppComponentState } from './App.type'; + /** @namespace Component/App/Component */ -export class App extends PureComponent { +export class App extends PureComponent { + protected reduxStore?: Store = undefined; + productionFunctions = [ this.disableReactDevTools.bind(this), this.injectComment.bind(this) @@ -47,31 +53,37 @@ export class App extends PureComponent { state = { isSomethingWentWrong: false, - errorDetails: {} + errorDetails: undefined }; - __construct(props) { - super.__construct(props); + __construct(props: unknown): void { + if (super.__construct) { + super.__construct(props); + } this.configureAppBasedOnEnvironment(); this.configureApp(); } - componentDidCatch(err, info) { + componentDidCatch(err: Error, info: unknown): void { this.setState({ isSomethingWentWrong: true, errorDetails: { err, info } }); } - configureStore() { + configureStore(): void { const store = getStore(); injectStaticReducers(store); this.reduxStore = store; } - renderRedux(children) { + renderRedux(children: ReactElement): ReactElement { + if (!this.reduxStore) { + return null; + } + return ( { children } @@ -79,7 +91,7 @@ export class App extends PureComponent { ); } - renderUnStated(children) { + renderUnStated(children: ReactElement): ReactElement { return ( { children } @@ -87,22 +99,22 @@ export class App extends PureComponent { ); } - enableHotReload() { + enableHotReload(): void { if (module.hot) { module.hot.accept(); } } - injectComment() { + injectComment(): void { const comment = document.createComment('Powered by ScandiPWA (scandipwa.com)'); - document.querySelector('html').appendChild(comment); + document.querySelector('html')?.appendChild(comment); } /** * Disable react-dev-tools * @link https://github.com/facebook/react-devtools/issues/191#issuecomment-367905536 */ - disableReactDevTools() { + disableReactDevTools(): void { if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'object') { // eslint-disable-next-line no-restricted-syntax, fp/no-loops, no-unused-vars for (const [key, value] of Object.entries(window.__REACT_DEVTOOLS_GLOBAL_HOOK__)) { @@ -111,7 +123,7 @@ export class App extends PureComponent { } } - configureAppBasedOnEnvironment() { + configureAppBasedOnEnvironment(): void { const functionsToRun = process.env.NODE_ENV === 'production' ? this.productionFunctions : this.developmentFunctions; @@ -119,31 +131,31 @@ export class App extends PureComponent { functionsToRun.forEach((func) => func()); } - configureApp() { + configureApp(): void { this.commonFunctions.forEach((func) => func()); } - handleErrorReset() { + handleErrorReset(): void { this.setState({ isSomethingWentWrong: false }); } - renderSharedTransition() { + renderSharedTransition(): ReactElement { return ( ); } - renderRouter() { + renderRouter(): ReactElement { return ( ); } - renderRootComponents() { + renderRootComponents(): ReactElement { return this.rootComponents.map((render) => render()); } - renderContextProviders() { + renderContextProviders(): ReactElement { const { isSomethingWentWrong } = this.state; const child = isSomethingWentWrong @@ -152,12 +164,12 @@ export class App extends PureComponent { return this.contextProviders.reduce( (acc, render) => render(acc), - [child()] + [child()] as ReactElement ); } - renderSomethingWentWrong() { - const { errorDetails } = this.state; + renderSomethingWentWrong(): ReactElement { + const { errorDetails = {} } = this.state; return ( { static defaultProps = { url: '', name: '' }; - getLinkUrl() { + getLinkUrl(): UrlType { const { url = '' } = this.props; @@ -41,24 +36,21 @@ export class Breadcrumb extends PureComponent { if (typeof url === 'string' || !url) { return { pathname: url || '', - search: '', - state: { - ...this.state - } + search: '' }; } return url; } - renderLink() { + renderLink(): ReactElement { const { index, isDisabled, name } = this.props; - const url = this.getLinkUrl() || {}; + const url = this.getLinkUrl(); const nameToString = String(name); return ( @@ -73,12 +65,12 @@ export class Breadcrumb extends PureComponent { - + ); } - render() { + render(): ReactElement { const { index } = this.props; return ( diff --git a/packages/scandipwa/src/component/Breadcrumb/Breadcrumb.type.ts b/packages/scandipwa/src/component/Breadcrumb/Breadcrumb.type.ts new file mode 100644 index 0000000000..5d56f78df5 --- /dev/null +++ b/packages/scandipwa/src/component/Breadcrumb/Breadcrumb.type.ts @@ -0,0 +1,19 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { UrlType } from 'Type/Router.type'; + +export interface BreadcrumbComponentProps { + index: number; + isDisabled: boolean; + url: string | UrlType; + name: string; +} diff --git a/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.js b/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.tsx similarity index 81% rename from packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.js rename to packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.tsx index 76205c8329..a7479b9882 100644 --- a/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.js +++ b/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.component.tsx @@ -9,14 +9,16 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Breadcrumb from 'Component/Breadcrumb'; import ContentWrapper from 'Component/ContentWrapper'; -import { BreadcrumbsType } from 'Type/Breadcrumbs.type'; +import { Breadcrumb as BreadcrumbType } from 'Type/Breadcrumbs.type'; +import { ReactElement } from 'Type/Common.type'; import { appendWithStoreCode, isHomePageUrl } from 'Util/Url'; +import { BreadcrumbsComponentProps } from './Breadcrumbs.type'; + import './Breadcrumbs.style'; /** @@ -24,13 +26,8 @@ import './Breadcrumbs.style'; * @class Breadcrumbs * @namespace Component/Breadcrumbs/Component */ -export class Breadcrumbs extends PureComponent { - static propTypes = { - breadcrumbs: BreadcrumbsType.isRequired, - areBreadcrumbsVisible: PropTypes.bool.isRequired - }; - - renderBreadcrumb({ url, name }, i) { +export class Breadcrumbs extends PureComponent { + renderBreadcrumb({ url, name }: BreadcrumbType, i: number): ReactElement { const { breadcrumbs } = this.props; const isDisabled = !url || breadcrumbs.length - 1 === i; @@ -45,7 +42,7 @@ export class Breadcrumbs extends PureComponent { ); } - renderBreadcrumbList(breadcrumbs) { + renderBreadcrumbList(breadcrumbs: BreadcrumbType[]): ReactElement { const breadcrumbsWithHome = [ ...breadcrumbs, // Looks like a browser bug, temporary fixed with .toString() @@ -57,7 +54,7 @@ export class Breadcrumbs extends PureComponent { )); } - render() { + render(): ReactElement { const { breadcrumbs, areBreadcrumbsVisible } = this.props; const { pathname = appendWithStoreCode('/') } = location; @@ -81,7 +78,7 @@ export class Breadcrumbs extends PureComponent { { ( breadcrumbs.length ? this.renderBreadcrumbList(breadcrumbs) - : this.renderBreadcrumb({}, 0) + : this.renderBreadcrumb({} as BreadcrumbType, 0) ) } diff --git a/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.type.ts b/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.type.ts new file mode 100644 index 0000000000..144d2fc9af --- /dev/null +++ b/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.type.ts @@ -0,0 +1,17 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Breadcrumb } from 'Type/Breadcrumbs.type'; + +export interface BreadcrumbsComponentProps { + breadcrumbs: Breadcrumb[]; + areBreadcrumbsVisible: boolean; +} diff --git a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.js b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx similarity index 84% rename from packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.js rename to packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx index b427f26f4c..b59bbf130b 100644 --- a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.js +++ b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx @@ -8,30 +8,23 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { createRef, PureComponent } from 'react'; import { CAROUSEL_ITEM_GAP } from 'Component/CarouselScroll/CarouselScroll.config'; import CarouselScrollArrow from 'Component/CarouselScrollArrow'; import CarouselScrollItem from 'Component/CarouselScrollItem'; -import { ChildrenType } from 'Type/Common.type'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import CSS from 'Util/CSS'; import { isRtl } from 'Util/CSS/CSS'; +import { CarouselScrollComponentProps } from './CarouselScroll.type'; + import './CarouselScroll.style'; /** @namespace Component/CarouselScroll/Component */ -export class CarouselScroll extends PureComponent { - static propTypes = { - children: ChildrenType.isRequired, - showArrow: PropTypes.bool, - showedItemCount: PropTypes.number, - onChange: PropTypes.func, - activeItemId: PropTypes.number, - isImageZoomPopupActive: PropTypes.bool - }; - +export class CarouselScroll extends PureComponent { static defaultProps = { showArrow: true, showedItemCount: 1, @@ -45,15 +38,15 @@ export class CarouselScroll extends PureComponent { firstCarouselItemId: 0 }; - itemRef = createRef(); + itemRef = createRef(); - carouselRef = createRef(); + carouselRef = createRef(); handleArrowClick = this.handleArrowClick.bind(this); handleChange = this.handleChange.bind(this); - componentDidMount() { + componentDidMount(): void { const { showedItemCount } = this.props; const margin = CAROUSEL_ITEM_GAP; @@ -63,7 +56,7 @@ export class CarouselScroll extends PureComponent { CSS.setVariable(this.carouselRef, 'carousel-width', width); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps: CarouselScrollComponentProps): void { const { children: { length: prevChildrenLength }, showedItemCount: prevShowedItemCount @@ -94,7 +87,7 @@ export class CarouselScroll extends PureComponent { } } - updateFirstSlide() { + updateFirstSlide(): void { const { firstCarouselItemId } = this.state; const maxId = this.getMaxFirstItemId(); @@ -105,30 +98,30 @@ export class CarouselScroll extends PureComponent { } } - getCarouselWidth(showedItemCount) { + getCarouselWidth(showedItemCount: number): string { const margin = CAROUSEL_ITEM_GAP; - const { offsetWidth: cardWidth } = this.itemRef.current; + const { offsetWidth: cardWidth = 0 } = this.itemRef.current || {} as HTMLElement; return `${ (margin + cardWidth) * showedItemCount - margin }px`; } - getNextTranslate(nextId) { - const { offsetWidth } = this.itemRef.current; + getNextTranslate(nextId: number): string { + const { offsetWidth = 0 } = this.itemRef.current || {} as HTMLElement; const multiplier = isRtl() ? nextId : -nextId; return `${ multiplier * (offsetWidth + CAROUSEL_ITEM_GAP) }px`; } - setTranslate(nextId) { + setTranslate(nextId: number): void { const translate = this.getNextTranslate(nextId); CSS.setVariable(this.carouselRef, 'translateX', translate); } - getMaxFirstItemId() { + getMaxFirstItemId(): number { const { children: { length: childrenLength }, showedItemCount } = this.props; return Math.max(childrenLength - showedItemCount, 0); } - getNewCarouselItemId(isNextArrow) { + getNewCarouselItemId(isNextArrow: boolean): number { const { showedItemCount } = this.props; const { firstCarouselItemId: prevFirstCarouselItemId } = this.state; @@ -139,13 +132,13 @@ export class CarouselScroll extends PureComponent { : Math.max(prevFirstCarouselItemId - scrollStep, 0); } - handleArrowClick(isNextArrow) { + handleArrowClick(isNextArrow: boolean): void { const firstCarouselItemId = this.getNewCarouselItemId(isNextArrow); this.setTranslate(firstCarouselItemId); this.setState({ firstCarouselItemId }); } - handleChange(nextId) { + handleChange(nextId: number): void { const { onChange, showedItemCount } = this.props; const { firstCarouselItemId } = this.state; onChange(nextId); @@ -158,7 +151,7 @@ export class CarouselScroll extends PureComponent { } } - handleReset() { + handleReset(): void { const { onChange } = this.props; const activeItemId = 0; @@ -169,7 +162,7 @@ export class CarouselScroll extends PureComponent { this.setState({ activeItemId }); } - renderArrow(isNextArrow = false) { + renderArrow(isNextArrow = false): ReactElement { const { showArrow, children: { length: childrenLength }, showedItemCount } = this.props; const { firstCarouselItemId } = this.state; @@ -190,7 +183,7 @@ export class CarouselScroll extends PureComponent { ); } - renderContentItem(child, key) { + renderContentItem(child: ReactElement, key: number): ReactElement { const { activeItemId } = this.state; return ( @@ -206,7 +199,7 @@ export class CarouselScroll extends PureComponent { ); } - renderContent() { + renderContent(): ReactElement { const { children, isImageZoomPopupActive } = this.props; return ( @@ -218,7 +211,7 @@ export class CarouselScroll extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderArrow() } diff --git a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts new file mode 100644 index 0000000000..9a5c85e344 --- /dev/null +++ b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts @@ -0,0 +1,21 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Children } from 'Type/Common.type'; + +export interface CarouselScrollComponentProps { + children: Children; + showArrow: boolean; + showedItemCount: number; + onChange: () => void; + activeItemId: number; + isImageZoomPopupActive: boolean; +} diff --git a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.js b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx similarity index 91% rename from packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.js rename to packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx index 5fbdb0f28a..1941d4c1d8 100644 --- a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.js +++ b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx @@ -8,11 +8,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; -import { ModsType } from 'Type/Common.type'; +import { ModsType, ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import './CarouselScrollArrow.style'; @@ -29,7 +29,7 @@ export class CarouselScrollArrow extends PureComponent { onClick: noopFn }; - render() { + render(): ReactElement { const { mods, onClick } = this.props; return ( diff --git a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.js b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx similarity index 91% rename from packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.js rename to packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx index 984cfef958..7e31bea16f 100644 --- a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.js +++ b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx @@ -8,10 +8,10 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; -import { ChildrenType, RefType } from 'Type/Common.type'; +import { ChildrenType, ReactElement, RefType } from 'Type/Common.type'; import './CarouselScrollItem.style'; @@ -24,7 +24,7 @@ export class CarouselScrollItem extends PureComponent { children: ChildrenType.isRequired }; - render() { + render(): ReactElement { const { isActive, itemRef, diff --git a/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.js b/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CartCoupon/CartCoupon.component.js rename to packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx index c3ca77894f..37f3f5e3f5 100644 --- a/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.js +++ b/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx @@ -9,14 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import Form from 'Component/Form'; import Loader from 'Component/Loader'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import './CartCoupon.style'; @@ -162,7 +161,7 @@ export class CartCoupon extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, couponCode, mix } = this.props; return ( diff --git a/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx index 2819209537..255909973f 100644 --- a/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx +++ b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { CartIconProps } from './CartIcon.type'; import './CartIcon.style'; @@ -21,7 +23,7 @@ export class CartIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/CartItem/CartItem.component.js b/packages/scandipwa/src/component/CartItem/CartItem.component.tsx similarity index 99% rename from packages/scandipwa/src/component/CartItem/CartItem.component.js rename to packages/scandipwa/src/component/CartItem/CartItem.component.tsx index 92cc06b2c5..1c851e0959 100644 --- a/packages/scandipwa/src/component/CartItem/CartItem.component.js +++ b/packages/scandipwa/src/component/CartItem/CartItem.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CartItemPrice from 'Component/CartItemPrice'; @@ -19,8 +18,9 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import Image from 'Component/Image'; import Link from 'Component/Link'; import Loader from 'Component/Loader'; +import { ReactElement } from 'Type/Common.type'; import { CartItemType } from 'Type/MiniCart.type'; -import { LinkType } from 'Type/Router.type'; +import { UrlType } from 'Type/Router.type'; import { formatPrice } from 'Util/Price'; import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; @@ -533,7 +533,7 @@ export class CartItem extends PureComponent { ); } - render() { + render(): ReactElement { const { isEditing, isCartOverlay } = this.props; return ( diff --git a/packages/scandipwa/src/component/CartItem/CartItem.container.js b/packages/scandipwa/src/component/CartItem/CartItem.container.js index 9a5cc26883..95177493a1 100644 --- a/packages/scandipwa/src/component/CartItem/CartItem.container.js +++ b/packages/scandipwa/src/component/CartItem/CartItem.container.js @@ -94,11 +94,11 @@ export class CartItemContainer extends PureComponent { getProductVariant: this.getProductVariant.bind(this) }; - componentDidMount() { + componentDidMount(): void { this.setStateNotLoading(); } - componentWillUnmount() { + componentWillUnmount(): void { this.notifyAboutLoadingStateChange(false); if (this.handlers.length) { @@ -121,7 +121,7 @@ export class CartItemContainer extends PureComponent { return variantIndex < 0 ? product - : product.variants[variantIndex]; + : product.variants[ variantIndex ]; } setStateNotLoading() { @@ -253,7 +253,7 @@ export class CartItemContainer extends PureComponent { } } = this.props; - return variants[this._getVariantIndex()]; + return variants[ this._getVariantIndex() ]; } /** @@ -303,9 +303,9 @@ export class CartItemContainer extends PureComponent { const { attributes } = variant; const parameters = Object.entries(attributes).reduce( - (parameters, [code, { attribute_value }]) => { + (parameters, [ code, { attribute_value } ]) => { if (Object.keys(configurable_options).includes(code)) { - return { ...parameters, [code]: attribute_value }; + return { ...parameters, [ code ]: attribute_value }; } return parameters; @@ -328,7 +328,7 @@ export class CartItemContainer extends PureComponent { return thumbnail || ''; } - getConfigurationOptionLabel([key, attribute]) { + getConfigurationOptionLabel([ key, attribute ]) { const { item: { product: { @@ -344,9 +344,9 @@ export class CartItemContainer extends PureComponent { } const { - [attribute_code]: { // configurable option attribute + [ attribute_code ]: { // configurable option attribute attribute_options: { - [attribute_value]: { // attribute option value label + [ attribute_value ]: { // attribute option value label label } } @@ -373,7 +373,7 @@ export class CartItemContainer extends PureComponent { const { attributes = [] } = this.getCurrentProduct() || {}; return Object.entries(attributes) - .filter(([attrKey]) => Object.keys(configurable_options).includes(attrKey)) + .filter(([ attrKey ]) => Object.keys(configurable_options).includes(attrKey)) .map(this.getConfigurationOptionLabel.bind(this)) .filter((label) => label); } @@ -391,12 +391,12 @@ export class CartItemContainer extends PureComponent { return ( ); } @@ -406,13 +406,13 @@ export class CartItemContainer extends PureComponent { return ( ); diff --git a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.js b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx similarity index 94% rename from packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.js rename to packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx index c837b0a6b5..a6707835ed 100644 --- a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.js +++ b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx @@ -9,10 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { formatPrice, roundPrice } from 'Util/Price'; /** @namespace Component/CartItemPrice/Component */ @@ -57,7 +56,7 @@ export class CartItemPrice extends PureComponent { ); } - render() { + render(): ReactElement { const { mix } = this.props; return ( diff --git a/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.js b/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CartOverlay/CartOverlay.component.js rename to packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx index 107a104074..ad9da35d27 100644 --- a/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.js +++ b/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CartItem from 'Component/CartItem'; @@ -19,6 +18,7 @@ import Link from 'Component/Link'; import LockIcon from 'Component/LockIcon'; import Overlay from 'Component/Overlay'; import { OVERLAY_PLACEHOLDER } from 'Component/PopupSuspense/PopupSuspense.config'; +import { ReactElement } from 'Type/Common.type'; import { CartDisplayType, TotalsType } from 'Type/MiniCart.type'; import { scrollToTop } from 'Util/Browser'; import { formatPrice } from 'Util/Price'; @@ -48,7 +48,7 @@ export class CartOverlay extends PureComponent { cartTotalSubPrice: null }; - componentDidMount() { + componentDidMount(): void { const { showOverlay, isMobile, activeOverlay } = this.props; if (!isMobile && activeOverlay === OVERLAY_PLACEHOLDER) { @@ -275,7 +275,7 @@ export class CartOverlay extends PureComponent { ); } - render() { + render(): ReactElement { const { changeHeaderState } = this.props; return ( diff --git a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.js b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx similarity index 99% rename from packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.js rename to packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx index 82e6c5045f..7231614c33 100644 --- a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.js +++ b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import ExpandableContent from 'Component/ExpandableContent'; import ExpandableContentShowMore from 'Component/ExpandableContentShowMore'; import ProductAttributeValue from 'Component/ProductAttributeValue/ProductAttributeValue.component'; diff --git a/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.js b/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.js rename to packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx index 7a233a67d6..bc7d8fd6fb 100644 --- a/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.js +++ b/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx @@ -9,13 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Html from 'Component/Html'; import Image from 'Component/Image'; import TextPlaceholder from 'Component/TextPlaceholder'; import { CategoryTreeType } from 'Type/Category.type'; +import { ReactElement } from 'Type/Common.type'; import './CategoryDetails.style'; @@ -127,7 +127,7 @@ export class CategoryDetails extends PureComponent { ); } - render() { + render(): ReactElement { return (
    diff --git a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.js b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.js rename to packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.tsx index 03ddb3a72b..43f8a8df33 100644 --- a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.js +++ b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CategoryConfigurableAttributes from 'Component/CategoryConfigurableAttributes'; @@ -17,6 +16,7 @@ import Overlay from 'Component/Overlay'; import ResetAttributes from 'Component/ResetAttributes'; import ResetButton from 'Component/ResetButton'; import { SelectedFiltersType } from 'Type/Category.type'; +import { ReactElement } from 'Type/Common.type'; import { AttributesType } from 'Type/ProductList.type'; import { CATEGORY_FILTER_OVERLAY_ID } from './CategoryFilterOverlay.config'; @@ -180,7 +180,7 @@ export class CategoryFilterOverlay extends PureComponent { ); } - render() { + render(): ReactElement { const { onVisible, onHide, diff --git a/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.js b/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.tsx similarity index 93% rename from packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.js rename to packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.tsx index 6433e891e9..5aa77c62d9 100644 --- a/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.js +++ b/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import TextPlaceholder from 'Component/TextPlaceholder'; +import { ReactElement } from 'Type/Common.type'; /** @namespace Component/CategoryItemsCount/Component */ export class CategoryItemsCount extends PureComponent { @@ -25,7 +25,7 @@ export class CategoryItemsCount extends PureComponent { isMatchingListFilter: false }; - render() { + render(): ReactElement { const { totalItems, isMatchingListFilter diff --git a/packages/scandipwa/src/component/CategorySort/CategorySort.component.js b/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CategorySort/CategorySort.component.js rename to packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx index 99e8356b03..d7ed51eb47 100644 --- a/packages/scandipwa/src/component/CategorySort/CategorySort.component.js +++ b/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import TextPlaceholder from 'Component/TextPlaceholder'; +import { ReactElement } from 'Type/Common.type'; import { SortDirectionType } from 'Type/Direction.type'; import './CategorySort.style'; @@ -92,7 +92,7 @@ export class CategorySort extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderSortField() } diff --git a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.js b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.js rename to packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx index 613d0a19be..656c9c94e0 100644 --- a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.js +++ b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CheckoutAddressForm from 'Component/CheckoutAddressForm'; @@ -19,6 +18,7 @@ import Loader from 'Component/Loader'; import { BILLING_STEP, SHIPPING_STEP } from 'Route/Checkout/Checkout.config'; import { ACCOUNT_URL } from 'Route/MyAccount/MyAccount.config'; import { ADDRESS_BOOK, CustomerType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { getDefaultAddressLabel } from 'Util/Address'; import { isSignedIn } from 'Util/Auth'; @@ -188,7 +188,7 @@ export class CheckoutAddressBook extends PureComponent { return this.renderGuestContent(); } - render() { + render(): ReactElement { return (
    { this.renderHeading() } diff --git a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js index 155e2ea22d..f4ddad72ee 100644 --- a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js +++ b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js @@ -59,14 +59,14 @@ export class CheckoutAddressBookContainer extends PureComponent { static _getDefaultAddressId(props) { const { customer, isBilling } = props; const defaultKey = isBilling ? 'default_billing' : 'default_shipping'; - const { [defaultKey]: defaultAddressId, addresses } = customer; + const { [ defaultKey ]: defaultAddressId, addresses } = customer; if (defaultAddressId) { return +defaultAddressId; } if (addresses && addresses.length) { - return addresses[0].id; + return addresses[ 0 ].id; } return 0; @@ -116,7 +116,7 @@ export class CheckoutAddressBookContainer extends PureComponent { return null; } - componentDidUpdate(_, prevState) { + componentDidUpdate(_, prevState): void { const { onAddressSelect, requestCustomerData, @@ -198,8 +198,8 @@ export class CheckoutAddressBookContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.js b/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.js rename to packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.tsx index 0ac03e5c31..fbd2a93855 100644 --- a/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.js +++ b/packages/scandipwa/src/component/CheckoutAddressForm/CheckoutAddressForm.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import MyAccountAddressForm from 'Component/MyAccountAddressForm/MyAccountAddressForm.component'; import { noopFn } from 'Util/Common'; import transformToNameValuePair from 'Util/Form/Transform'; @@ -31,7 +29,7 @@ export class CheckoutAddressForm extends MyAccountAddressForm { onAddressChange = this.onAddressChange.bind(this); - componentDidMount() { + componentDidMount(): void { const { address: { countryId, @@ -105,7 +103,7 @@ export class CheckoutAddressForm extends MyAccountAddressForm { return null; } - render() { + render(): ReactElement { return (
    { this.renderFormBody() } diff --git a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.js b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx similarity index 96% rename from packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.js rename to packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx index bb4c60919d..bf40d19c75 100644 --- a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.js +++ b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import Loader from 'Component/Loader'; import MyAccountAddressTable from 'Component/MyAccountAddressTable/MyAccountAddressTable.component'; @@ -52,7 +50,7 @@ export class CheckoutAddressTable extends MyAccountAddressTable { ); } - render() { + render(): ReactElement { const { countries } = this.props; return ( diff --git a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js rename to packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx index df76d094bd..5a8616fc5a 100644 --- a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.js +++ b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CheckoutAddressBook from 'Component/CheckoutAddressBook'; @@ -22,6 +21,7 @@ import { STORE_IN_PICK_UP_METHOD_CODE } from 'Component/StoreInPickUp/StoreInPic import { BILLING_STEP } from 'Route/Checkout/Checkout.config'; import { Addresstype } from 'Type/Account.type'; import { PaymentMethodsType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import { TotalsType } from 'Type/MiniCart.type'; import { formatPrice } from 'Util/Price'; @@ -65,7 +65,7 @@ export class CheckoutBilling extends PureComponent { handleShowPopup = this.handleShowPopup.bind(this); - componentDidMount() { + componentDidMount(): void { const { termsAreEnabled } = this.props; if (!termsAreEnabled) { @@ -317,7 +317,7 @@ export class CheckoutBilling extends PureComponent { return ; } - render() { + render(): ReactElement { const { onBillingSuccess } = this.props; return ( diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.js b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.js rename to packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx index f8bde59035..d501cba97a 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.js +++ b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import { ShippingMethodType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import { formatPrice } from 'Util/Price'; import { DELIVERY_METHOD_UNAVAILABLE_MESSAGE } from './CheckoutDeliveryOption.config'; @@ -149,7 +149,7 @@ export class CheckoutDeliveryOption extends PureComponent { ); } - render() { + render(): ReactElement { const { option: { carrier_title, diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.js b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.js rename to packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx index aa5c04530c..6cb89a1a1a 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.js +++ b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CheckoutDeliveryOption from 'Component/CheckoutDeliveryOption'; import { STORE_IN_PICK_UP_METHOD_CODE } from 'Component/StoreInPickUp/StoreInPickUp.config'; import { ShippingMethodsType, ShippingMethodType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import './CheckoutDeliveryOptions.style'; @@ -105,7 +105,7 @@ export class CheckoutDeliveryOptions extends PureComponent { return render(); } - render() { + render(): ReactElement { return (
    { this.renderHeading() } diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js index f7a8af1dc4..51fc19e084 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js +++ b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js @@ -61,13 +61,13 @@ export class CheckoutDeliveryOptionsContainer extends PureComponent { dataMap = {}; - componentDidMount() { + componentDidMount(): void { if (window.formPortalCollector) { window.formPortalCollector.subscribe(SHIPPING_STEP, this.collectAdditionalData, 'CheckoutDeliveryOptions'); } } - componentWillUnmount() { + componentWillUnmount(): void { if (window.formPortalCollector) { window.formPortalCollector.unsubscribe(SHIPPING_STEP, 'CheckoutDeliveryOptions'); } @@ -97,7 +97,7 @@ export class CheckoutDeliveryOptionsContainer extends PureComponent { collectAdditionalData() { const { selectedShippingMethod: { method_code } } = this.props; - const additionalDataGetter = this.dataMap[method_code]; + const additionalDataGetter = this.dataMap[ method_code ]; if (!additionalDataGetter) { return {}; @@ -120,8 +120,8 @@ export class CheckoutDeliveryOptionsContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.js b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.js rename to packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.tsx index 3a37181606..bc4876fd36 100644 --- a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.js +++ b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import FieldForm from 'Component/FieldForm'; import MyAccountConfirmEmail from 'Component/MyAccountConfirmEmail'; import MyAccountForgotPassword from 'Component/MyAccountForgotPassword'; @@ -46,7 +44,7 @@ export class CheckoutGuestForm extends FieldForm { }; // eslint-disable-next-line @scandipwa/scandipwa-guidelines/only-render-in-component - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isEmailAvailable, setSignInState, signInState } = this.props; const { isEmailAvailable: prevIsEmailAvailable } = prevProps; @@ -226,7 +224,7 @@ export class CheckoutGuestForm extends FieldForm { return typeof render === 'function' ? render() : super.render(); } - render() { + render(): ReactElement { return (
    { const field = document.getElementById(GUEST_EMAIL_FIELD_ID); @@ -218,8 +218,8 @@ export class CheckoutGuestFormContainer extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.js b/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx similarity index 99% rename from packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.js rename to packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx index fd32af51bc..4a65d0b1cc 100644 --- a/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.js +++ b/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { lazy, PureComponent } from 'react'; import CartItem from 'Component/CartItem'; @@ -404,7 +403,7 @@ export class CheckoutOrderSummary extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.js b/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.tsx similarity index 96% rename from packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.js rename to packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.tsx index c8c8421b66..2c1deae2b0 100644 --- a/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.js +++ b/packages/scandipwa/src/component/CheckoutOrderSummaryPriceLine/CheckoutOrderSummaryPriceLine.component.tsx @@ -9,10 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { ChildrenType, ModsType } from 'Type/Common.type'; +import { ChildrenType, ModsType, ReactElement } from 'Type/Common.type'; import { formatPrice } from 'Util/Price'; /** @namespace Component/CheckoutOrderSummaryPriceLine/Component */ @@ -85,7 +84,7 @@ export class CheckoutOrderSummaryPriceLine extends PureComponent { ); } - render() { + render(): ReactElement { const { price, mods, diff --git a/packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.js b/packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.tsx similarity index 96% rename from packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.js rename to packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.tsx index 942b47a38c..8ebdc38fc6 100644 --- a/packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.js +++ b/packages/scandipwa/src/component/CheckoutPayment/CheckoutPayment.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import { PaymentMethodType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import './CheckoutPayment.style'; @@ -41,7 +41,7 @@ export class CheckoutPayment extends PureComponent { onClick(method); } - render() { + render(): ReactElement { const { isSelected, method: { title } diff --git a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.js b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.js rename to packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.tsx index faa7a6d4c0..541a830d3d 100644 --- a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.js +++ b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.component.tsx @@ -10,7 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CheckoutPayment from 'Component/CheckoutPayment'; @@ -19,6 +18,7 @@ import NotSupportedPayment from 'Component/NotSupportedPayment'; import { PurchaseOrder } from 'Component/PurchaseOrder/PurchaseOrder.component'; import { BILLING_STEP } from 'Route/Checkout/Checkout.config'; import { PaymentMethodsType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import { KLARNA, PURCHASE_ORDER } from './CheckoutPayments.config'; @@ -157,7 +157,7 @@ export class CheckoutPayments extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderContent() } diff --git a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js index ffa5e4a804..1d7a67489d 100644 --- a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js +++ b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js @@ -55,20 +55,20 @@ export class CheckoutPaymentsContainer extends PureComponent { }; dataMap = { - [KLARNA]: this.getKlarnaData.bind(this) + [ KLARNA ]: this.getKlarnaData.bind(this) }; __construct(props) { super.__construct(props); } - componentDidMount() { + componentDidMount(): void { if (window.formPortalCollector) { window.formPortalCollector.subscribe(BILLING_STEP, this.collectAdditionalData, 'CheckoutPaymentsContainer'); } } - componentWillUnmount() { + componentWillUnmount(): void { if (window.formPortalCollector) { window.formPortalCollector.unsubscribe(BILLING_STEP, 'CheckoutPaymentsContainer'); } @@ -99,7 +99,7 @@ export class CheckoutPaymentsContainer extends PureComponent { collectAdditionalData() { const { selectedPaymentCode } = this.state; - const additionalDataGetter = this.dataMap[selectedPaymentCode]; + const additionalDataGetter = this.dataMap[ selectedPaymentCode ]; if (!additionalDataGetter) { return {}; @@ -125,8 +125,8 @@ export class CheckoutPaymentsContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js rename to packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.tsx index 57ae63c368..1fac504864 100644 --- a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.js +++ b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CheckoutAddressBook from 'Component/CheckoutAddressBook'; @@ -21,6 +20,7 @@ import StoreInPickUpComponent from 'Component/StoreInPickUp'; import { SHIPPING_STEP } from 'Route/Checkout/Checkout.config'; import { Addresstype } from 'Type/Account.type'; import { ShippingMethodsType, ShippingMethodType } from 'Type/Checkout.type'; +import { ReactElement } from 'Type/Common.type'; import { TotalsType } from 'Type/MiniCart.type'; import { getAllCartItemsSku } from 'Util/Cart'; import { formatPrice } from 'Util/Price'; @@ -201,7 +201,7 @@ export class CheckoutShipping extends PureComponent { ); } - render() { + render(): ReactElement { const { onShippingSuccess, onShippingError diff --git a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.container.js b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.container.js index b4948af24a..ebddf90a66 100644 --- a/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.container.js +++ b/packages/scandipwa/src/component/CheckoutShipping/CheckoutShipping.container.js @@ -92,7 +92,7 @@ export class CheckoutShippingContainer extends PureComponent { (method) => `${method.carrier_code}_${method.method_code}` === savedShippingMethodCode ); - const [defaultShippingMethod] = shippingMethods.filter((method) => method.available); + const [ defaultShippingMethod ] = shippingMethods.filter((method) => method.available); const selectedShippingMethod = previousShippingMethod || defaultShippingMethod || {}; const { method_code = '' } = selectedShippingMethod; @@ -105,7 +105,7 @@ export class CheckoutShippingContainer extends PureComponent { }; } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { shippingMethods: prevShippingMethods } = prevProps; const { shippingMethods } = this.props; @@ -122,7 +122,7 @@ export class CheckoutShippingContainer extends PureComponent { return; } - const [defaultShippingMethod] = shippingMethods.filter((method) => method.available); + const [ defaultShippingMethod ] = shippingMethods.filter((method) => method.available); const selectedShippingMethod = defaultShippingMethod || {}; this.setState({ selectedShippingMethod }); @@ -181,7 +181,7 @@ export class CheckoutShippingContainer extends PureComponent { city, postcode, telephone: phone, - street: [street], + street: [ street ], firstname: name, lastname: 'Store' }; @@ -240,8 +240,8 @@ export class CheckoutShippingContainer extends PureComponent { formattedFields.street = []; // eslint-disable-next-line fp/no-loops,fp/no-let for (let i = 0; i < addressLinesQty; i++) { - if (formattedFields[`street_${i}`]) { - formattedFields.street.push(formattedFields[`street_${i}`]); + if (formattedFields[ `street_${i}` ]) { + formattedFields.street.push(formattedFields[ `street_${i}` ]); } } } @@ -273,7 +273,7 @@ export class CheckoutShippingContainer extends PureComponent { updateShippingFields({ ...( street.length - || (default_shipping && parseInt(default_shipping, 10) === data.shipping_address.id) + || (default_shipping && parseInt(default_shipping, 10) === data.shipping_address.id) ? formattedFields : data.shipping_address ), shippingMethod @@ -294,8 +294,8 @@ export class CheckoutShippingContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.js b/packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.js rename to packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.tsx index 8f61b3ab4c..1bb450b421 100644 --- a/packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.js +++ b/packages/scandipwa/src/component/CheckoutSuccess/CheckoutSuccess.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; import { ACCOUNT_REGISTRATION_URL } from 'Route/MyAccount/MyAccount.config'; +import { ReactElement } from 'Type/Common.type'; import { isSignedIn } from 'Util/Auth'; import { appendWithStoreCode } from 'Util/Url'; @@ -80,7 +80,7 @@ export class CheckoutSuccess extends PureComponent { ); } - render() { + render(): ReactElement { const { orderID } = this.props; return ( diff --git a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.js b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx similarity index 94% rename from packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.js rename to packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx index b3191df5fe..29602831a8 100644 --- a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.js +++ b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Html from 'Component/Html'; import Popup from 'Component/Popup'; +import { ReactElement } from 'Type/Common.type'; import { TERMS_AND_CONDITIONS_POPUP_ID } from './CheckoutTermsAndConditionsPopup.config'; @@ -35,7 +35,7 @@ export class CheckoutTermsAndConditionsPopup extends PureComponent { ); } - render() { + render(): ReactElement { return ( { direction: Directions.RIGHT }; - render(): JSX.Element { + render(): ReactElement { const { direction } = this.props; return ( diff --git a/packages/scandipwa/src/component/ClickOutside/ClickOutside.component.js b/packages/scandipwa/src/component/ClickOutside/ClickOutside.component.tsx similarity index 92% rename from packages/scandipwa/src/component/ClickOutside/ClickOutside.component.js rename to packages/scandipwa/src/component/ClickOutside/ClickOutside.component.tsx index 150f0a8d9e..07795a1166 100644 --- a/packages/scandipwa/src/component/ClickOutside/ClickOutside.component.js +++ b/packages/scandipwa/src/component/ClickOutside/ClickOutside.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Children, cloneElement, @@ -34,7 +33,7 @@ export class ClickOutside extends PureComponent { handleClick = this.handleClick.bind(this); - __construct(props) { + __construct(props): void { super.__construct(props); const { children } = this.props; @@ -45,11 +44,11 @@ export class ClickOutside extends PureComponent { ); } - componentDidMount() { + componentDidMount(): void { document.addEventListener('click', this.handleClick); } - componentWillUnmount() { + componentWillUnmount(): void { document.removeEventListener('click', this.handleClick); } @@ -67,7 +66,7 @@ export class ClickOutside extends PureComponent { } } - render() { + render(): ReactElement { const { children } = this.props; return Children.map(children, (element, idx) => ( diff --git a/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx b/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx index ba7d257ea7..8c1e92d012 100644 --- a/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx +++ b/packages/scandipwa/src/component/CloseIcon/CloseIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './CloseIcon.style'; /** @namespace Component/CloseIcon/Component */ export class CloseIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( { if (!items.length) { return; } - this.setState({ cmsBlock: items[0] }); + this.setState({ cmsBlock: items[ 0 ] }); } ); } @@ -67,7 +67,7 @@ export class CmsBlockContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/CompareIcon/CompareIcon.component.tsx b/packages/scandipwa/src/component/CompareIcon/CompareIcon.component.tsx index f0e3b97bfb..ed4493ab50 100644 --- a/packages/scandipwa/src/component/CompareIcon/CompareIcon.component.tsx +++ b/packages/scandipwa/src/component/CompareIcon/CompareIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { CompareIconProps } from './CompareIcon.type'; import './CompareIcon.style'; @@ -21,7 +23,7 @@ export class CompareIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/ContactForm/ContactForm.component.js b/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx similarity index 96% rename from packages/scandipwa/src/component/ContactForm/ContactForm.component.js rename to packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx index 5139f81d33..04ab9ffc98 100644 --- a/packages/scandipwa/src/component/ContactForm/ContactForm.component.js +++ b/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import FieldForm from 'Component/FieldForm'; import Loader from 'Component/Loader'; @@ -54,7 +52,7 @@ export class ContactForm extends FieldForm { ); } - render() { + render(): ReactElement { return (
    { super.render() } diff --git a/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.js b/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx similarity index 93% rename from packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.js rename to packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx index a1339e4de0..ea3d07552f 100644 --- a/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.js +++ b/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx @@ -9,10 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { ChildrenType, MixType } from 'Type/Common.type'; +import { ChildrenType, MixType, ReactElement } from 'Type/Common.type'; import { LabelType } from 'Type/Field.type'; import './ContentWrapper.style'; @@ -53,7 +52,7 @@ export class ContentWrapper extends PureComponent { ); } - render() { + render(): ReactElement { const { mix, label, isNotSection } = this.props; diff --git a/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.js b/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/CookiePopup/CookiePopup.component.js rename to packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx index d4c57552f4..551c8cecb1 100644 --- a/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.js +++ b/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; +import { ReactElement } from 'Type/Common.type'; import BrowserDatabase from 'Util/BrowserDatabase'; import { ONE_MONTH_IN_SECONDS } from 'Util/Request/QueryDispatcher'; @@ -93,7 +93,7 @@ export class CookiePopup extends PureComponent { ); } - render() { + render(): ReactElement { const { cookieText } = this.props; const { isAccepted } = this.state; diff --git a/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.js b/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx similarity index 96% rename from packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.js rename to packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx index d2aa6f4d9f..04d99bd955 100755 --- a/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.js +++ b/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; +import { ReactElement } from 'Type/Common.type'; import { getCurrency } from 'Util/Currency'; import './CurrencySwitcher.style'; @@ -47,7 +47,7 @@ export class CurrencySwitcher extends PureComponent { return availableCurrencies.some((e) => e.id === currency) ? currency : currentCurrencyCode; } - render() { + render(): ReactElement { const { handleCurrencySelect, currencyData: { diff --git a/packages/scandipwa/src/component/DatePicker/DatePicker.component.js b/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx similarity index 98% rename from packages/scandipwa/src/component/DatePicker/DatePicker.component.js rename to packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx index 9f4ace3bbe..8333704098 100644 --- a/packages/scandipwa/src/component/DatePicker/DatePicker.component.js +++ b/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx @@ -11,7 +11,6 @@ import 'react-datepicker/dist/react-datepicker.css'; -import PropTypes from 'prop-types'; import { forwardRef, PureComponent } from 'react'; import DatePicker from 'react-datepicker'; @@ -67,7 +66,7 @@ export class DatePickerComponent extends PureComponent { ); } - render() { + render(): ReactElement { const { selectedDate, onSetDate, diff --git a/packages/scandipwa/src/component/DateSelect/DateSelect.component.js b/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx similarity index 99% rename from packages/scandipwa/src/component/DateSelect/DateSelect.component.js rename to packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx index c901de79d4..a91b82fd7b 100644 --- a/packages/scandipwa/src/component/DateSelect/DateSelect.component.js +++ b/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/scandipwa */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { @@ -25,6 +24,7 @@ import { import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import { FIELD_DATE_TYPE, TIME_FORMAT } from 'Component/FieldDate/FieldDate.config'; +import { ReactElement } from 'Type/Common.type'; import { DateType } from 'Type/Field.type'; import { isMagentoDateFormatValid, zeroBasedValue } from 'Util/Form/Extract'; import { range } from 'Util/Manipulations'; @@ -361,7 +361,7 @@ export class DateSelectComponent extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderDate() } diff --git a/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.js b/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx similarity index 91% rename from packages/scandipwa/src/component/DemoNotice/DemoNotice.component.js rename to packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx index 4b8f3bffdf..046d9debc0 100644 --- a/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.js +++ b/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx @@ -9,9 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import './DemoNotice.style'; @@ -27,11 +27,11 @@ export class DemoNotice extends PureComponent { isDemoNoticeEnabled: false }; - componentDidMount() { + componentDidMount(): void { this.checkForDemoNotice(); } - componentDidUpdate() { + componentDidUpdate(): void { this.checkForDemoNotice(); } @@ -55,7 +55,7 @@ export class DemoNotice extends PureComponent { return __('This is a demo store. No orders will be fulfilled.'); } - render() { + render(): ReactElement { const { isDemoNoticeEnabled } = this.props; if (!isDemoNoticeEnabled) { diff --git a/packages/scandipwa/src/component/Draggable/Draggable.component.js b/packages/scandipwa/src/component/Draggable/Draggable.component.tsx similarity index 97% rename from packages/scandipwa/src/component/Draggable/Draggable.component.js rename to packages/scandipwa/src/component/Draggable/Draggable.component.tsx index 1b57ae3940..f39deb6d0d 100644 --- a/packages/scandipwa/src/component/Draggable/Draggable.component.js +++ b/packages/scandipwa/src/component/Draggable/Draggable.component.tsx @@ -10,10 +10,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { ChildrenType, MixType, RefType } from 'Type/Common.type'; +import { + ChildrenType, MixType, ReactElement, RefType +} from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import './Draggable.style'; @@ -96,7 +97,7 @@ export class Draggable extends PureComponent { return null; } - componentWillUnmount() { + componentWillUnmount(): void { window.removeEventListener('mousemove', this.handleMouseMove); window.removeEventListener('mouseup', this.handleMouseUp); window.removeEventListener('touchmove', this.handleTouchMove); @@ -220,7 +221,7 @@ export class Draggable extends PureComponent { // lastTranslateY: 0 } - render() { + render(): ReactElement { const { children, handleFocus, diff --git a/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx b/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx index 78d1558c0d..2fe478f358 100644 --- a/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx +++ b/packages/scandipwa/src/component/EditIcon/EditIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './EditIcon.style'; /** @namespace Component/EditIcon/Component */ export class EditIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( { - const { [eventName]: baseEvent } = events; - newEvents[eventName] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; + const { [ eventName ]: baseEvent } = events; + newEvents[ eventName ] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; }); return { @@ -239,7 +239,7 @@ export class FieldContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/FieldFile/FieldFile.component.js b/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx similarity index 97% rename from packages/scandipwa/src/component/FieldFile/FieldFile.component.js rename to packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx index 671ab378c4..b2256dc647 100644 --- a/packages/scandipwa/src/component/FieldFile/FieldFile.component.js +++ b/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { FIELD_TYPE } from 'Component/Field/Field.config'; import Loader from 'Component/Loader'; import UploadIcon from 'Component/UploadIcon'; +import { ReactElement } from 'Type/Common.type'; import { EventsType, FieldAttrType } from 'Type/Field.type'; /** @@ -70,7 +70,7 @@ export class FieldFile extends PureComponent { ); } - render() { + render(): ReactElement { const { attr = {}, attr: { accept = '' } = {}, diff --git a/packages/scandipwa/src/component/FieldForm/FieldForm.component.js b/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx similarity index 97% rename from packages/scandipwa/src/component/FieldForm/FieldForm.component.js rename to packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx index 1806abe98b..35b4b03ec3 100644 --- a/packages/scandipwa/src/component/FieldForm/FieldForm.component.js +++ b/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx @@ -15,6 +15,7 @@ import { PureComponent } from 'react'; import Field from 'Component/Field'; import FieldGroup from 'Component/FieldGroup'; import Form from 'Component/Form'; +import { ReactElement } from 'Type/Common.type'; import './FieldForm.style'; @@ -91,7 +92,7 @@ export class FieldForm extends PureComponent { return { ...this.props }; } - render() { + render(): ReactElement { return (
    { this.renderFormBody() } diff --git a/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.js b/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/FieldGroup/FieldGroup.component.js rename to packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx index 8369162bbb..2619867c70 100644 --- a/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.js +++ b/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx @@ -10,10 +10,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { ChildrenType, ModsType } from 'Type/Common.type'; +import { ChildrenType, ModsType, ReactElement } from 'Type/Common.type'; import { EventsType, FieldAttrType, FieldGroupValidationResponseType } from 'Type/Field.type'; import './FieldGroup.style'; @@ -101,7 +100,7 @@ export class FieldGroup extends PureComponent { } //#endregion - render() { + render(): ReactElement { const { validationResponse, children, diff --git a/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js b/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js index d90f112901..67c96d5ccb 100644 --- a/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js +++ b/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js @@ -70,7 +70,7 @@ export class FieldGroupContainer extends PureComponent { //#region VALIDATION // Removes event listener for validation from field - componentWillUnmount() { + componentWillUnmount(): void { const { validationRule } = this.props; if (this.groupRef && validationRule && Object.keys(validationRule).length > 0) { @@ -127,10 +127,10 @@ export class FieldGroupContainer extends PureComponent { const fields = getFieldsData( this.groupRef, false, - [FIELD_TYPE.number, FIELD_TYPE.button] + [ FIELD_TYPE.number, FIELD_TYPE.button ] ); - hook(...[...args, { ...attr, formRef: this.groupRef, fields }]); + hook(...[ ...args, { ...attr, formRef: this.groupRef, fields } ]); } //#endregion @@ -151,13 +151,13 @@ export class FieldGroupContainer extends PureComponent { // Surrounds events with validation const newEvents = {}; Object.keys(events).forEach((eventName) => { - const { [eventName]: event } = events; - newEvents[eventName] = this.surroundEvent.bind(this, event); + const { [ eventName ]: event } = events; + newEvents[ eventName ] = this.surroundEvent.bind(this, event); }); validateOn.forEach((eventName) => { - const { [eventName]: baseEvent } = events; - newEvents[eventName] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; + const { [ eventName ]: baseEvent } = events; + newEvents[ eventName ] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; }); return { @@ -176,7 +176,7 @@ export class FieldGroupContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.js b/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx similarity index 97% rename from packages/scandipwa/src/component/FieldNumber/FieldNumber.component.js rename to packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx index 3ae8c98ef5..59d11a8493 100644 --- a/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.js +++ b/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import AddIcon from 'Component/AddIcon'; import { FIELD_TYPE } from 'Component/Field/Field.config'; import MinusIcon from 'Component/MinusIcon'; +import { ReactElement } from 'Type/Common.type'; import { EventsType, FieldAttrType } from 'Type/Field.type'; import { DEFAULT_MAX_PRODUCTS } from 'Util/Product/Extract'; @@ -32,7 +32,7 @@ export class FieldNumber extends PureComponent { isDisabled: PropTypes.bool.isRequired }; - render() { + render(): ReactElement { const { attr, attr: { min = 1, max = DEFAULT_MAX_PRODUCTS }, diff --git a/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js b/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js index e4a4bac97c..8c7efef67b 100644 --- a/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js +++ b/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js @@ -41,12 +41,12 @@ export class FieldNumberContainer extends PureComponent { fieldRef = createRef(); - componentDidMount() { + componentDidMount(): void { const { attr: { defaultValue = 0 } } = this.props; this.handleInitialLoad(defaultValue); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { attr: { value, defaultValue = 0 } = {} } = this.props; const { attr: { value: prevValue, defaultValue: prevDefaultValue } = {} } = prevProps; @@ -139,8 +139,8 @@ export class FieldNumberContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/FieldSelect/FieldSelect.component.js b/packages/scandipwa/src/component/FieldSelect/FieldSelect.component.tsx similarity index 98% rename from packages/scandipwa/src/component/FieldSelect/FieldSelect.component.js rename to packages/scandipwa/src/component/FieldSelect/FieldSelect.component.tsx index f32c26f9b2..d28c5a02fc 100644 --- a/packages/scandipwa/src/component/FieldSelect/FieldSelect.component.js +++ b/packages/scandipwa/src/component/FieldSelect/FieldSelect.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; import { BOTTOM, TOP } from 'Component/ChevronIcon/ChevronIcon.config'; import ClickOutside from 'Component/ClickOutside'; +import { ReactElement } from 'Type/Common.type'; import { EventsType, FieldAttrType, FieldOptionsType } from 'Type/Field.type'; import './FieldSelect.style'; @@ -174,7 +174,7 @@ export class FieldSelect extends PureComponent { ); } - render() { + render(): ReactElement { const { attr: { id = '' } = {}, isExpanded, diff --git a/packages/scandipwa/src/component/FieldSelect/FieldSelect.container.js b/packages/scandipwa/src/component/FieldSelect/FieldSelect.container.js index 955ae2eb0a..9be1e4c1b2 100644 --- a/packages/scandipwa/src/component/FieldSelect/FieldSelect.container.js +++ b/packages/scandipwa/src/component/FieldSelect/FieldSelect.container.js @@ -74,11 +74,11 @@ export class FieldSelectContainer extends PureComponent { return { isExpanded: isExpanded || stateIsExpanded }; } - componentDidMount() { + componentDidMount(): void { this.handleIsScrollableList(); } - componentDidUpdate() { + componentDidUpdate(): void { const { selectedOptionIndex: prevSelectedOptionIndex } = this.state; const selectedOptionIndex = this.fieldRef.options.selectedIndex; @@ -90,7 +90,7 @@ export class FieldSelectContainer extends PureComponent { isSelectedOptionAvailable() { const options = this.getOptions(); const selectedOptionIndex = this.fieldRef.options.selectedIndex; - const selectedOption = options[selectedOptionIndex]; + const selectedOption = options[ selectedOptionIndex ]; const isAvailable = selectedOption.isAvailable !== false; this.setState({ @@ -193,7 +193,7 @@ export class FieldSelectContainer extends PureComponent { const pressedKeyValue = String.fromCharCode(keyCode).toLowerCase(); - const searchString = (prevSearchString[prevSearchString.length - 1] !== pressedKeyValue) + const searchString = (prevSearchString[ prevSearchString.length - 1 ] !== pressedKeyValue) ? `${prevSearchString}${pressedKeyValue}` : pressedKeyValue; @@ -208,7 +208,7 @@ export class FieldSelectContainer extends PureComponent { } // if no items were found, take only the latest letter of the search string - const newSearchString = searchString[searchString.length - 1]; + const newSearchString = searchString[ searchString.length - 1 ]; const newValueIndex = options.findIndex(({ label }) => ( label && label.toLowerCase().startsWith(newSearchString) @@ -256,7 +256,7 @@ export class FieldSelectContainer extends PureComponent { this.updateValue(valueIndex); this.setState({ searchString, valueIndex }, () => { - const { id, value } = options[valueIndex]; + const { id, value } = options[ valueIndex ]; // converting to string for avoiding the error with the first select option if (onChange && value) { @@ -274,7 +274,7 @@ export class FieldSelectContainer extends PureComponent { updateValue(valueIndex) { if (this.fieldRef) { const { options } = this.props; - const { value } = options[valueIndex]; + const { value } = options[ valueIndex ]; if (value) { this.fieldRef.value = value; @@ -346,8 +346,8 @@ export class FieldSelectContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/FilterIcon/FilterIcon.component.tsx b/packages/scandipwa/src/component/FilterIcon/FilterIcon.component.tsx index c8eeb73430..6ff4456909 100644 --- a/packages/scandipwa/src/component/FilterIcon/FilterIcon.component.tsx +++ b/packages/scandipwa/src/component/FilterIcon/FilterIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './FilterIcon.style'; /** @namespace Component/FilterIcon/Component */ export class FilterIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( { - const { [eventName]: event } = events; - newEvents[eventName] = this.surroundEvent.bind(this, event); + const { [ eventName ]: event } = events; + newEvents[ eventName ] = this.surroundEvent.bind(this, event); }); // Surrounds events with validation validateOn.forEach((eventName) => { - const { [eventName]: baseEvent } = events; - newEvents[eventName] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; + const { [ eventName ]: baseEvent } = events; + newEvents[ eventName ] = baseEvent ? this.validateOnEvent.bind(this, baseEvent) : validate; }); return { @@ -226,8 +226,8 @@ export class FormContainer extends PureComponent { render() { return (
    ); } diff --git a/packages/scandipwa/src/component/GridIcon/GridIcon.component.tsx b/packages/scandipwa/src/component/GridIcon/GridIcon.component.tsx index 26cc88d4dd..90aea39f6d 100644 --- a/packages/scandipwa/src/component/GridIcon/GridIcon.component.tsx +++ b/packages/scandipwa/src/component/GridIcon/GridIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { GridIconProps } from './GridIcon.type'; import './GridIcon.style'; @@ -21,7 +23,7 @@ export class GridIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.js b/packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.tsx similarity index 95% rename from packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.js rename to packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.tsx index fa94285bed..ee09c34b6d 100644 --- a/packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.js +++ b/packages/scandipwa/src/component/GroupedProductList/GroupedProductList.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import GroupedProductsItem from 'Component/GroupedProductsItem'; import PRODUCT_TYPE from 'Component/Product/Product.config'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; /** @@ -50,7 +50,7 @@ export class GroupedProductList extends PureComponent { ); } - render() { + render(): ReactElement { const { product: { items, type_id } } = this.props; diff --git a/packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.js b/packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.tsx similarity index 98% rename from packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.js rename to packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.tsx index 9dc18fc41c..2771720c11 100644 --- a/packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.js +++ b/packages/scandipwa/src/component/GroupedProductsItem/GroupedProductsItem.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import FieldContainer from 'Component/Field'; @@ -18,6 +17,7 @@ import Image from 'Component/Image'; import ProductPrice from 'Component/ProductPrice'; import TextPlaceholder from 'Component/TextPlaceholder'; import TierPrices from 'Component/TierPrices'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; import { getMaxQuantity, getMinQuantity, getPrice, getProductInStock, getThumbnailImage @@ -144,7 +144,7 @@ export class GroupedProductsItem extends PureComponent { ); } - render() { + render(): ReactElement { return (
  • { this.renderImage() } diff --git a/packages/scandipwa/src/component/Header/Header.component.js b/packages/scandipwa/src/component/Header/Header.component.tsx similarity index 99% rename from packages/scandipwa/src/component/Header/Header.component.js rename to packages/scandipwa/src/component/Header/Header.component.tsx index 95482aae1b..1e566cbabe 100644 --- a/packages/scandipwa/src/component/Header/Header.component.js +++ b/packages/scandipwa/src/component/Header/Header.component.tsx @@ -11,7 +11,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, lazy, Suspense } from 'react'; import CartIcon from 'Component/CartIcon'; @@ -731,7 +730,7 @@ export class Header extends NavigationAbstract { ); } - render() { + render(): ReactElement { const { stateMap } = this; const { navigationState: { name, isHiddenOnMobile = false }, diff --git a/packages/scandipwa/src/component/Header/Header.container.js b/packages/scandipwa/src/component/Header/Header.container.js index fc7eb0a2cf..3e8d3a2e96 100644 --- a/packages/scandipwa/src/component/Header/Header.container.js +++ b/packages/scandipwa/src/component/Header/Header.container.js @@ -44,7 +44,7 @@ import { /** @namespace Component/Header/Container/mapStateToProps */ export const mapStateToProps = (state) => ({ - navigationState: state.NavigationReducer[TOP_NAVIGATION_TYPE].navigationState, + navigationState: state.NavigationReducer[ TOP_NAVIGATION_TYPE ].navigationState, cartTotals: state.CartReducer.cartTotals, totals: state.CartReducer.cartTotals, compareTotals: state.ProductCompareReducer.count, @@ -191,12 +191,12 @@ export class HeaderContainer extends NavigationAbstractContainer { }; } - componentDidMount() { + componentDidMount(): void { this.handleHeaderVisibility(); super.componentDidMount(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { this.hideSearchOnStateChange(prevProps); this.handleHeaderVisibility(); this.navigateToShippingStep(prevProps); @@ -237,7 +237,7 @@ export class HeaderContainer extends NavigationAbstractContainer { return navigationState; } - return this.routeMap[activeRoute] || this.default_state; + return this.routeMap[ activeRoute ] || this.default_state; } getUserName() { @@ -405,7 +405,7 @@ export class HeaderContainer extends NavigationAbstractContainer { device } = this.props; - if (device.isMobile || ![CUSTOMER_ACCOUNT, CUSTOMER_SUB_ACCOUNT, CHECKOUT_ACCOUNT].includes(name)) { + if (device.isMobile || ![ CUSTOMER_ACCOUNT, CUSTOMER_SUB_ACCOUNT, CHECKOUT_ACCOUNT ].includes(name)) { return; } @@ -459,7 +459,7 @@ export class HeaderContainer extends NavigationAbstractContainer { return; } - history.push(appendWithStoreCode(`/${ CART }`)); + history.push(appendWithStoreCode(`/${CART}`)); } onMinicartOutsideClick() { @@ -517,8 +517,8 @@ export class HeaderContainer extends NavigationAbstractContainer { render() { return (
    ); } diff --git a/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx b/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx index 532957a602..dc0fcf4bed 100644 --- a/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx +++ b/packages/scandipwa/src/component/HeartIcon/HeartIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { HeartIconProps } from './HeartIcon.type'; import './HeartIcon.style'; @@ -21,7 +23,7 @@ export class HeartIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx b/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx index 856f91cc65..d982649b77 100644 --- a/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx +++ b/packages/scandipwa/src/component/HomeIcon/HomeIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { HomeIconProps } from './HomeIcon.type'; import './HomeIcon.style'; @@ -21,7 +23,7 @@ export class HomeIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/Html/Html.component.js b/packages/scandipwa/src/component/Html/Html.component.tsx similarity index 99% rename from packages/scandipwa/src/component/Html/Html.component.js rename to packages/scandipwa/src/component/Html/Html.component.tsx index 240ac4170b..30b968da4f 100644 --- a/packages/scandipwa/src/component/Html/Html.component.js +++ b/packages/scandipwa/src/component/Html/Html.component.tsx @@ -16,7 +16,6 @@ import parser from 'html-react-parser'; import attributesToProps from 'html-react-parser/lib/attributes-to-props'; import domToReact from 'html-react-parser/lib/dom-to-react'; -import PropTypes from 'prop-types'; import { lazy, PureComponent, Suspense } from 'react'; import Image from 'Component/Image'; @@ -261,7 +260,7 @@ export class Html extends PureComponent { return <>; } - render() { + render(): ReactElement { const { content } = this.props; return parser(content, this.parserOptions); diff --git a/packages/scandipwa/src/component/Image/Image.component.js b/packages/scandipwa/src/component/Image/Image.component.tsx similarity index 98% rename from packages/scandipwa/src/component/Image/Image.component.js rename to packages/scandipwa/src/component/Image/Image.component.tsx index 0f6dea65f4..09552cedbe 100644 --- a/packages/scandipwa/src/component/Image/Image.component.js +++ b/packages/scandipwa/src/component/Image/Image.component.tsx @@ -11,7 +11,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import { MixType, RefType } from 'Type/Common.type'; @@ -91,11 +90,11 @@ export class Image extends PureComponent { onLoad = this.onLoad.bind(this); - componentDidMount() { + componentDidMount(): void { this.onImageChange(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { src: prevSrc } = prevProps; const { src } = this.props; @@ -230,7 +229,7 @@ export class Image extends PureComponent { ); } - render() { + render(): ReactElement { const { ratio, mix, diff --git a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.js b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.tsx similarity index 92% rename from packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.js rename to packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.tsx index a6d93e9622..3405977666 100644 --- a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.js +++ b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.component.tsx @@ -9,11 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import TranslateOnCursorMove from 'Component/TranslateOnCursorMove'; -import { ChildrenType } from 'Type/Common.type'; +import { ChildrenType, ReactElement } from 'Type/Common.type'; import './ImageZoomPopup.style'; @@ -24,7 +23,7 @@ export class ImageZoomPopup extends PureComponent { activeImageId: PropTypes.number.isRequired }; - render() { + render(): ReactElement { const { children, activeImageId diff --git a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.js b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.js index 551634d5bb..027bd62aa5 100644 --- a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.js +++ b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.js @@ -51,7 +51,7 @@ export class ImageZoomPopupContainer extends PureComponent { mix: {} }; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isActive: prevIsActive, popupId } = prevProps; const { isActive, showPopup } = this.props; @@ -88,15 +88,15 @@ export class ImageZoomPopupContainer extends PureComponent { return ( ); diff --git a/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.js b/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.tsx similarity index 97% rename from packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.js rename to packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.tsx index 4878a9e4b8..a445db20de 100644 --- a/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.js +++ b/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import InstallPromptAndroid from 'Component/InstallPromptAndroid'; import InstallPromptIOS from 'Component/InstallPromptIOS'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import './InstallPrompt.style'; @@ -79,7 +79,7 @@ export class InstallPrompt extends PureComponent { return null; } - render() { + render(): ReactElement { const displayComponent = this.hasSupport(); if (!displayComponent) { diff --git a/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.container.js b/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.container.js index cd1e56d50e..c961295004 100644 --- a/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.container.js +++ b/packages/scandipwa/src/component/InstallPrompt/InstallPrompt.container.js @@ -41,7 +41,7 @@ export class InstallPromptContainer extends PureComponent { handleBannerClose: this.handleBannerClose.bind(this) }; - componentDidMount() { + componentDidMount(): void { this.listenForInstallPrompt(); } @@ -96,8 +96,8 @@ export class InstallPromptContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.js b/packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.tsx similarity index 96% rename from packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.js rename to packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.tsx index 51347a8395..b02100ab35 100644 --- a/packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.js +++ b/packages/scandipwa/src/component/InstallPromptAndroid/InstallPromptAndroid.component.tsx @@ -8,10 +8,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import CloseIcon from 'Component/CloseIcon'; +import { ReactElement } from 'Type/Common.type'; import './InstallPromptAndroid.style'; @@ -60,7 +61,7 @@ export class InstallPromptAndroid extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderCloseButton() } diff --git a/packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.js b/packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.tsx similarity index 95% rename from packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.js rename to packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.tsx index 0ff0b0f10b..d136880a2e 100644 --- a/packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.js +++ b/packages/scandipwa/src/component/InstallPromptIOS/InstallPromptIOS.component.tsx @@ -8,9 +8,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './InstallPromptIOS.style'; /** @namespace Component/InstallPromptIOS/Component */ @@ -53,7 +55,7 @@ export class InstallPromptIOS extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderHeading() } diff --git a/packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.js b/packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.tsx similarity index 96% rename from packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.js rename to packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.tsx index 51ae01a634..8c9e70456b 100644 --- a/packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.js +++ b/packages/scandipwa/src/component/KeyValueTable/KeyValueTable.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import RadioButton from 'Component/RadioButtonIcon'; +import { ReactElement } from 'Type/Common.type'; import './KeyValueTable.style'; @@ -98,7 +98,7 @@ export class KeyValueTable extends PureComponent { ); } - render() { + render(): ReactElement { return this.renderTable(); } } diff --git a/packages/scandipwa/src/component/Klarna/Klarna.component.js b/packages/scandipwa/src/component/Klarna/Klarna.component.tsx similarity index 97% rename from packages/scandipwa/src/component/Klarna/Klarna.component.js rename to packages/scandipwa/src/component/Klarna/Klarna.component.tsx index ce70cc6f83..915e84a7bd 100644 --- a/packages/scandipwa/src/component/Klarna/Klarna.component.js +++ b/packages/scandipwa/src/component/Klarna/Klarna.component.tsx @@ -10,11 +10,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Loader from 'Component/Loader'; import KlarnaQuery from 'Query/Klarna.query'; +import { ReactElement } from 'Type/Common.type'; import { isSignedIn } from 'Util/Auth'; import { getGuestQuoteId } from 'Util/Cart'; import { fetchMutation } from 'Util/Request'; @@ -45,7 +45,7 @@ export class Klarna extends PureComponent { paymentIsShown: false }; - componentWillUnmount() { + componentWillUnmount(): void { const { paymentIsShown } = this.state; if (paymentIsShown) { @@ -164,7 +164,7 @@ export class Klarna extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading } = this.state; return ( diff --git a/packages/scandipwa/src/component/Link/Link.component.js b/packages/scandipwa/src/component/Link/Link.component.tsx similarity index 83% rename from packages/scandipwa/src/component/Link/Link.component.js rename to packages/scandipwa/src/component/Link/Link.component.tsx index 10ddc35c5a..82c44cd44c 100644 --- a/packages/scandipwa/src/component/Link/Link.component.js +++ b/packages/scandipwa/src/component/Link/Link.component.tsx @@ -11,26 +11,17 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; -import { PureComponent } from 'react'; +import { MouseEvent, PureComponent } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { stringify } from 'rebem-classname'; -import { ChildrenType, MixType } from 'Type/Common.type'; -import { LinkType } from 'Type/Router.type'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; -/** @namespace Component/Link/Component */ -export class Link extends PureComponent { - static propTypes = { - to: LinkType.isRequired, - className: PropTypes.string, - bemProps: MixType, - children: ChildrenType.isRequired, - onClick: PropTypes.func, - isOpenInNewTab: PropTypes.bool - }; +import { LinkComponentProps } from './Link.type'; +/** @namespace Component/Link/Component */ +export class Link extends PureComponent { static defaultProps = { bemProps: {}, className: '', @@ -38,29 +29,29 @@ export class Link extends PureComponent { isOpenInNewTab: false }; - scrollToElement(e) { + scrollToElement(e: MouseEvent): void { const { to: cssIdentifier, onClick } = this.props; - const elem = document.querySelector( + const elem = document.querySelector( cssIdentifier !== '#' ? cssIdentifier : 'body' ); - event.preventDefault(); + e.preventDefault(); window.scrollTo({ - top: elem.offsetTop, + top: elem?.offsetTop || 0, behavior: 'smooth' }); - elem.focus(); + elem?.focus(); onClick(e); } - renderRelativePathLink() { + renderRelativePathLink(): ReactElement { const { isOpenInNewTab, children, @@ -95,7 +86,7 @@ export class Link extends PureComponent { ); } - renderAbsolutePathLink(classNameConverted) { + renderAbsolutePathLink(classNameConverted: string): ReactElement { const { isOpenInNewTab, children, @@ -131,7 +122,7 @@ export class Link extends PureComponent { ); } - render() { + render(): ReactElement { const { className, bemProps, diff --git a/packages/scandipwa/src/component/Link/Link.container.js b/packages/scandipwa/src/component/Link/Link.container.js index f2fe1a16d4..d92c601b25 100644 --- a/packages/scandipwa/src/component/Link/Link.container.js +++ b/packages/scandipwa/src/component/Link/Link.container.js @@ -15,7 +15,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; -import { LinkType } from 'Type/Router.type'; +import { UrlType } from 'Type/Router.type'; import { noopFn } from 'Util/Common'; import { appendWithStoreCode } from 'Util/Url'; @@ -114,8 +114,8 @@ export class LinkContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/Link/Link.type.ts b/packages/scandipwa/src/component/Link/Link.type.ts new file mode 100644 index 0000000000..5b9f8a338a --- /dev/null +++ b/packages/scandipwa/src/component/Link/Link.type.ts @@ -0,0 +1,23 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { MouseEvent } from 'react'; + +import { Children, Mix } from 'Type/Common.type'; + +export interface LinkComponentProps { + to: string; + className: string; + bemProps: Mix; + children: Children; + onClick: (e: MouseEvent) => void; + isOpenInNewTab: boolean; +} diff --git a/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx b/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx index 4163e2afce..d1a3d81918 100644 --- a/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx +++ b/packages/scandipwa/src/component/ListIcon/ListIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { ListIconProps } from './ListIcon.type'; import './ListIcon.style'; @@ -21,7 +23,7 @@ export class ListIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/Loader/Loader.component.js b/packages/scandipwa/src/component/Loader/Loader.component.tsx similarity index 92% rename from packages/scandipwa/src/component/Loader/Loader.component.js rename to packages/scandipwa/src/component/Loader/Loader.component.tsx index 9cdc8403a4..81dab258c8 100644 --- a/packages/scandipwa/src/component/Loader/Loader.component.js +++ b/packages/scandipwa/src/component/Loader/Loader.component.tsx @@ -9,10 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import './Loader.style'; @@ -41,7 +40,7 @@ export class Loader extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, mix } = this.props; if (!isLoading) { diff --git a/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx b/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx index e0cdb4dc34..9efd67ae54 100644 --- a/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx +++ b/packages/scandipwa/src/component/LockIcon/LockIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './LockIcon.style'; /** @namespace Component/LockIcon/Component */ export class LockIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( this.setState({ menu: MenuHelper.reduce(menu) }) @@ -112,7 +112,7 @@ export class MenuContainer extends DataContainer { return activeMenuItemsStack.filter((id) => id !== item_id); } - return [item_id, ...activeMenuItemsStack]; + return [ item_id, ...activeMenuItemsStack ]; } handleSubcategoryClick(e, activeSubcategory) { @@ -139,7 +139,7 @@ export class MenuContainer extends DataContainer { return; } - this.setState({ activeMenuItemsStack: [item_id] }); + this.setState({ activeMenuItemsStack: [ item_id ] }); } closeMenu() { @@ -155,8 +155,8 @@ export class MenuContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MenuIcon/MenuIcon.component.tsx b/packages/scandipwa/src/component/MenuIcon/MenuIcon.component.tsx index 984e9880bc..00b417962e 100644 --- a/packages/scandipwa/src/component/MenuIcon/MenuIcon.component.tsx +++ b/packages/scandipwa/src/component/MenuIcon/MenuIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { MenuIconProps } from './MenuIcon.type'; import './MenuIcon.style'; @@ -21,7 +23,7 @@ export class MenuIcon extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/MenuItem/MenuItem.component.js b/packages/scandipwa/src/component/MenuItem/MenuItem.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MenuItem/MenuItem.component.js rename to packages/scandipwa/src/component/MenuItem/MenuItem.component.tsx index 2b3cb82a33..aeb65996e5 100644 --- a/packages/scandipwa/src/component/MenuItem/MenuItem.component.js +++ b/packages/scandipwa/src/component/MenuItem/MenuItem.component.tsx @@ -10,13 +10,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import AddIcon from 'Component/AddIcon'; import Link from 'Component/Link'; import MinusIcon from 'Component/MinusIcon'; -import { ModsType } from 'Type/Common.type'; +import { ModsType, ReactElement } from 'Type/Common.type'; import { MenuItemType } from 'Type/Menu.type'; import { noopFn } from 'Util/Common'; @@ -113,7 +112,7 @@ export class MenuItem extends PureComponent { ); } - render() { + render(): ReactElement { const { item, itemMods, isLink } = this.props; if (isLink) { diff --git a/packages/scandipwa/src/component/Meta/Meta.component.js b/packages/scandipwa/src/component/Meta/Meta.component.tsx similarity index 95% rename from packages/scandipwa/src/component/Meta/Meta.component.js rename to packages/scandipwa/src/component/Meta/Meta.component.tsx index 942be72b38..211d595e0d 100644 --- a/packages/scandipwa/src/component/Meta/Meta.component.js +++ b/packages/scandipwa/src/component/Meta/Meta.component.tsx @@ -9,11 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { createPortal } from 'react-dom'; -import { MetaTitleType } from 'Type/Common.type'; +import { MetaTitleType, ReactElement } from 'Type/Common.type'; /** * Page Meta data @@ -44,7 +43,7 @@ export class Meta extends PureComponent { canonical_url: '' }; - componentDidMount() { + componentDidMount(): void { // Remove prerendered meta tags so dynamic meta tags can take effect Array.prototype.slice.call( document.head.querySelectorAll('title[data-prerendered], meta[data-prerendered]') @@ -110,7 +109,7 @@ export class Meta extends PureComponent { ); } - render() { + render(): ReactElement { return createPortal( { ...this.renderMeta() }, document.head diff --git a/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx b/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx index 680c5ad674..ec88d94376 100644 --- a/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx +++ b/packages/scandipwa/src/component/MinusIcon/MinusIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { MinusIconProps } from './MinusIcon.type'; import './MinusIcon.style'; @@ -21,7 +23,7 @@ export class MinusIcon extends PureComponent { isPrimary: false }; - render(): JSX.Element { + render(): ReactElement { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.js b/packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.js rename to packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.tsx index 0caa757c99..7497557fd4 100644 --- a/packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.js +++ b/packages/scandipwa/src/component/MyAccountAddressBook/MyAccountAddressBook.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Component } from 'react'; import MyAccountAddressPopup from 'Component/MyAccountAddressPopup'; @@ -84,7 +83,7 @@ export class MyAccountAddressBook extends Component { return addresses.map(this.renderAddress); } - render() { + render(): ReactElement { return (
    { this.renderActions() } diff --git a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.tsx similarity index 99% rename from packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js rename to packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.tsx index 6fae4bd548..274b35afeb 100644 --- a/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.js +++ b/packages/scandipwa/src/component/MyAccountAddressForm/MyAccountAddressForm.component.tsx @@ -10,8 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import FIELD_TYPE from 'Component/Field/Field.config'; import FieldForm from 'Component/FieldForm'; import { Addresstype } from 'Type/Account.type'; diff --git a/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.js b/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.js rename to packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.tsx index 642df1a999..9b88cccb98 100644 --- a/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.js +++ b/packages/scandipwa/src/component/MyAccountAddressPopup/MyAccountAddressPopup.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Loader from 'Component/Loader'; @@ -17,6 +16,7 @@ import MyAccountAddressForm from 'Component/MyAccountAddressForm'; import MyAccountAddressTable from 'Component/MyAccountAddressTable'; import Popup from 'Component/Popup'; import { Addresstype } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { ADD_ADDRESS, ADDRESS_POPUP_ID, DELETE_ADDRESS, EDIT_ADDRESS @@ -81,7 +81,7 @@ export class MyAccountAddressPopup extends PureComponent { } } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.js b/packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.js rename to packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.tsx index 449422a9ee..4c2f8a6a6e 100644 --- a/packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.js +++ b/packages/scandipwa/src/component/MyAccountAddressTable/MyAccountAddressTable.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import KeyValueTable from 'Component/KeyValueTable'; import Loader from 'Component/Loader'; import { Addresstype } from 'Type/Account.type'; @@ -84,7 +82,7 @@ export class MyAccountAddressTable extends KeyValueTable { ); } - render() { + render(): ReactElement { const { countries, mix } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.js b/packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.tsx similarity index 94% rename from packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.js rename to packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.tsx index 5c88ed1e01..30f2c21fc8 100644 --- a/packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.js +++ b/packages/scandipwa/src/component/MyAccountConfirmEmail/MyAccountConfirmEmail.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; /** @namespace Component/MyAccountConfirmEmail/Component */ export class MyAccountConfirmEmail extends PureComponent { @@ -21,7 +21,7 @@ export class MyAccountConfirmEmail extends PureComponent { handleSignIn: PropTypes.func.isRequired }; - render() { + render(): ReactElement { const { state, handleSignIn } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.js b/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.tsx similarity index 99% rename from packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.js rename to packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.tsx index 56d37d2559..f7e505cb07 100644 --- a/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.js +++ b/packages/scandipwa/src/component/MyAccountCreateAccount/MyAccountCreateAccount.component.tsx @@ -9,13 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import Form from 'Component/Form'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import history from 'Util/History'; import { validatePassword } from 'Util/Validator'; import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; @@ -251,7 +251,7 @@ export class MyAccountCreateAccount extends PureComponent { ); } - render() { + render(): ReactElement { return ( <> { this.renderCreateAccountForm() } diff --git a/packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.js b/packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.tsx similarity index 99% rename from packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.js rename to packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.tsx index 8160248fae..30da7becdc 100644 --- a/packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.js +++ b/packages/scandipwa/src/component/MyAccountCustomerForm/MyAccountCustomerForm.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import FieldForm from 'Component/FieldForm'; import { CustomerType } from 'Type/Account.type'; import transformToNameValuePair from 'Util/Form/Transform'; diff --git a/packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.js b/packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.js rename to packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.tsx index 79c96bfe14..f3570e9ab3 100644 --- a/packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.js +++ b/packages/scandipwa/src/component/MyAccountCustomerPopup/MyAccountCustomerPopup.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Loader from 'Component/Loader'; @@ -17,6 +16,7 @@ import MyAccountCustomerForm from 'Component/MyAccountCustomerForm'; import MyAccountPasswordForm from 'Component/MyAccountPasswordForm'; import Popup from 'Component/Popup'; import { CustomerType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { CHANGE_PASSWORD, CUSTOMER_POPUP_ID, EDIT_CUSTOMER } from './MyAccountCustomerPopup.config'; @@ -71,7 +71,7 @@ export class MyAccountCustomerPopup extends PureComponent { } } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.js b/packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.js rename to packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.tsx index d665e06fec..ce8c5c8c2b 100644 --- a/packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.js +++ b/packages/scandipwa/src/component/MyAccountCustomerTable/MyAccountCustomerTable.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import KeyValueTable from 'Component/KeyValueTable'; import { CustomerType } from 'Type/Account.type'; @@ -72,7 +70,7 @@ export class MyAccountCustomerTable extends KeyValueTable { ); } - render() { + render(): ReactElement { return (
    { this.renderTable() } diff --git a/packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.js b/packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.js rename to packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.tsx index 321e17584f..c33c37ac9c 100644 --- a/packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.js +++ b/packages/scandipwa/src/component/MyAccountDashboard/MyAccountDashboard.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; @@ -18,6 +17,7 @@ import MyAccountAddressTable from 'Component/MyAccountAddressTable'; import MyAccountCustomerTable from 'Component/MyAccountCustomerTable'; import { ACCOUNT_URL } from 'Route/MyAccount/MyAccount.config'; import { ADDRESS_BOOK, CustomerType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import './MyAccountDashboard.style'; @@ -130,7 +130,7 @@ export class MyAccountDashboard extends PureComponent { ); } - render() { + render(): ReactElement { const { customer } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.js b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.js rename to packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.tsx index b8c4e0ae49..00827558c8 100755 --- a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.js +++ b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Component } from 'react'; import Loader from 'Component/Loader'; @@ -107,7 +106,7 @@ export class MyAccountDownloadableComponent extends Component { ); } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.container.js b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.container.js index f68c924a8d..fdd2ea8db4 100755 --- a/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.container.js +++ b/packages/scandipwa/src/component/MyAccountDownloadable/MyAccountDownloadable.container.js @@ -49,7 +49,7 @@ export class MyAccountDownloadableContainer extends PureComponent { isLoading: false }; - componentDidMount() { + componentDidMount(): void { this.requestDownloadable(); } @@ -110,7 +110,7 @@ export class MyAccountDownloadableContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.js b/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.js rename to packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.tsx index 77fd3398e9..2c4fdbd97e 100755 --- a/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.js +++ b/packages/scandipwa/src/component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.component.tsx @@ -10,11 +10,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; import { STATUS_EXPIRED } from 'Component/MyAccountDownloadableTableRow/MyAccountDownloadableTableRow.config'; +import { ReactElement } from 'Type/Common.type'; import { DownloadableType } from 'Type/Order.type'; import './MyAccountDownloadableTableRow.style'; @@ -70,7 +70,7 @@ export class MyAccountDownloadableTableRowComponent extends PureComponent { ); } - render() { + render(): ReactElement { const { order: { order_increment_id, diff --git a/packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.js b/packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.js rename to packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.tsx index 5104b42d8c..14064005a3 100644 --- a/packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.js +++ b/packages/scandipwa/src/component/MyAccountForgotPassword/MyAccountForgotPassword.component.tsx @@ -8,13 +8,14 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import Form from 'Component/Form'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; /** @namespace Component/MyAccountForgotPassword/Component */ @@ -109,7 +110,7 @@ export class MyAccountForgotPassword extends PureComponent { ); } - render() { + render(): ReactElement { return ( <> { this.renderForgotPasswordForm() } diff --git a/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.js b/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.tsx similarity index 95% rename from packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.js rename to packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.tsx index 5b0971e182..18257f0612 100644 --- a/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.js +++ b/packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/MyAccountForgotPasswordSuccess.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; /** @namespace Component/MyAccountForgotPasswordSuccess/Component */ export class MyAccountForgotPasswordSuccess extends PureComponent { @@ -22,7 +22,7 @@ export class MyAccountForgotPasswordSuccess extends PureComponent { submittedEmail: PropTypes.string.isRequired }; - render() { + render(): ReactElement { // eslint-disable-next-line react/prop-types const { state, handleSignIn, submittedEmail } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.js b/packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.tsx similarity index 96% rename from packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.js rename to packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.tsx index 215f209056..335ba9610a 100644 --- a/packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.js +++ b/packages/scandipwa/src/component/MyAccountInformation/MyAccountInformation.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Loader from 'Component/Loader'; import MyAccountCustomerForm from 'Component/MyAccountCustomerForm'; import { CustomerType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import './MyAccountInformation.style'; @@ -52,7 +52,7 @@ export class MyAccountInformation extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.js b/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.js rename to packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.tsx index 52430554c8..7ea13f4ca1 100644 --- a/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.js +++ b/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Component } from 'react'; import Loader from 'Component/Loader'; @@ -121,7 +120,7 @@ export class MyAccountMyOrders extends Component { ); } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.container.js b/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.container.js index 241552a59f..acf37c0835 100644 --- a/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.container.js +++ b/packages/scandipwa/src/component/MyAccountMyOrders/MyAccountMyOrders.container.js @@ -51,12 +51,12 @@ export class MyAccountMyOrdersContainer extends PureComponent { location: LocationType.isRequired }; - componentDidMount() { + componentDidMount(): void { const { getOrderList } = this.props; getOrderList(this._getPageFromUrl()); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { getOrderList } = this.props; const { location: prevLocation } = prevProps; @@ -85,7 +85,7 @@ export class MyAccountMyOrdersContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.js b/packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.js rename to packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.tsx index 5b874ce825..95555cc1d4 100644 --- a/packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.js +++ b/packages/scandipwa/src/component/MyAccountMyWishlist/MyAccountMyWishlist.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import CartIcon from 'Component/CartIcon'; @@ -52,11 +51,11 @@ export class MyAccountMyWishlist extends PureComponent { handleSelectIdChange = this.handleSelectIdChange.bind(this); - componentDidMount() { + componentDidMount(): void { this.setActionLineHeight(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isEditingActive: prevIsEditingActive, isMobile: prevIsMobile } = prevProps; const { isEditingActive, isMobile } = this.props; const { actionLineHeight: prevActionLineHeight } = this.state; @@ -316,7 +315,7 @@ export class MyAccountMyWishlist extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderShareWishlist() } diff --git a/packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.js b/packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.js rename to packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.tsx index 5389c75b26..6882d4f910 100644 --- a/packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.js +++ b/packages/scandipwa/src/component/MyAccountNewsletterSubscription/MyAccountNewsletterSubscription.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import { FIELD_TYPE } from 'Component/Field/Field.config'; import FieldForm from 'Component/FieldForm'; import { CustomerType } from 'Type/Account.type'; diff --git a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.js b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.js rename to packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.tsx index 3f71ef85e4..9882169cae 100644 --- a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.js +++ b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; @@ -17,6 +16,7 @@ import Loader from 'Component/Loader'; import MyAccountOrderInformation from 'Component/MyAccountOrderInformation'; import MyAccountOrderItemsTable from 'Component/MyAccountOrderItemsTable'; import MyAccountOrderTabs from 'Component/MyAccountOrderTabs'; +import { ReactElement } from 'Type/Common.type'; import { OrderType } from 'Type/Order.type'; import { convertStringToDate, getTimeInCurrentTimezone } from 'Util/Manipulations/Date'; @@ -110,7 +110,7 @@ export class MyAccountOrder extends PureComponent { } }; - shouldTabsRender() { + shouldTabsrender(): ReactElement { return Object.values(this.tabMap).filter(({ shouldTabRender }) => shouldTabRender()); } @@ -280,7 +280,7 @@ export class MyAccountOrder extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.container.js b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.container.js index c7782ab539..aa73cd98e4 100644 --- a/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.container.js +++ b/packages/scandipwa/src/component/MyAccountOrder/MyAccountOrder.container.js @@ -94,7 +94,7 @@ export class MyAccountOrderContainer extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { const { changeTabName, setTabSubheading } = this.props; changeTabName(); @@ -165,7 +165,7 @@ export class MyAccountOrderContainer extends PureComponent { const order = await getOrderById(orderId); if (!order) { - history.replace(appendWithStoreCode(`${ ACCOUNT_ORDER_HISTORY }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_ORDER_HISTORY}`)); return; } @@ -180,8 +180,8 @@ export class MyAccountOrderContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.js b/packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.js rename to packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.tsx index e892dea953..329dba56a7 100644 --- a/packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderInformation/MyAccountOrderInformation.component.tsx @@ -11,6 +11,7 @@ */ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import MyAccountAddressTable from 'Component/MyAccountAddressTable'; import { OrderType } from 'Type/Order.type'; @@ -179,7 +180,7 @@ export class MyAccountOrderInformation extends PureComponent { ); } - render() { + render(): ReactElement { const { order } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.js b/packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.tsx similarity index 99% rename from packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.js rename to packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.tsx index e9116dd788..0de62c8ea4 100644 --- a/packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderItemsTable/MyAccountOrderItemsTable.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/scandipwa */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { ORDER_ITEMS, ORDER_REFUNDS, ORDER_SHIPMENTS } from 'Component/MyAccountOrder/MyAccountOrder.config'; import MyAccountOrderItemsTableRow from 'Component/MyAccountOrderItemsTableRow'; import MyAccountOrderTotals from 'Component/MyAccountOrderTotals'; +import { ReactElement } from 'Type/Common.type'; import { OrderProductsType, OrderTabType, OrderTotalType } from 'Type/Order.type'; import { getTimeInCurrentTimezone } from 'Util/Manipulations/Date'; import { getProductFromOrder } from 'Util/Orders'; @@ -254,7 +254,7 @@ export class MyAccountOrderItemsTable extends PureComponent { ); } - render() { + render(): ReactElement { const { isMobile } = this.props; if (!isMobile) { diff --git a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.tsx similarity index 66% rename from packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js rename to packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.tsx index d7a353fc62..dafd85d67c 100644 --- a/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderItemsTableRow/MyAccountOrderItemsTableRow.component.tsx @@ -14,6 +14,7 @@ import { PureComponent } from 'react'; import Html from 'Component/Html'; import { ORDER_ITEMS, ORDER_REFUNDS, ORDER_SHIPMENTS } from 'Component/MyAccountOrder/MyAccountOrder.config'; +import { ReactElement } from 'Type/Common.type'; import { OptionsType, OrderProductType } from 'Type/Order.type'; import { getOrderItemQtyToArray, getOrderItemRowDiscount } from 'Util/Orders'; import { formatPrice } from 'Util/Price'; @@ -63,7 +64,7 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return this.renderPrice(value, currency, (__('Price'))); } - renderQty([ type, qty ], index) { + renderQty([type, qty], index) { const { activeTab } = this.props; if (qty === 0) { @@ -72,12 +73,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (activeTab === ORDER_ITEMS) { return ( -
  • {`${ORDER_STATUS_TRANSLATION_MAP[ type ]}: ${qty}`}
  • +
  • { `${ORDER_STATUS_TRANSLATION_MAP[ type ]}: ${qty}` }
  • ); } return ( -
  • {qty}
  • +
  • { qty }
  • ); } @@ -89,10 +90,10 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return (
      - {Object.entries(qtyArray).map(renderQty)} + { Object.entries(qtyArray).map(renderQty) }
    ); } @@ -121,12 +122,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( - - {title} - {formatPrice(value, currency)} + + { title } + { formatPrice(value, currency) } ); @@ -134,7 +135,7 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - {formatPrice(value, currency)} + { formatPrice(value, currency) } ); } @@ -155,12 +156,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( - - {selectedOptions.map(renderOption)} - {enteredOptions.map(renderOption)} + + { selectedOptions.map(renderOption) } + { enteredOptions.map(renderOption) } ); @@ -168,8 +169,8 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - {selectedOptions.map(renderOption)} - {enteredOptions.map(renderOption)} + { selectedOptions.map(renderOption) } + { enteredOptions.map(renderOption) } ); } @@ -180,12 +181,12 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - {product_name} + { product_name } - {this.renderSelectedAndEnteredOptions()} + { this.renderSelectedAndEnteredOptions() } ); } @@ -200,20 +201,20 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - {`${qty} x ${title}`} + { `${qty} x ${title}` } - {title} - {this.renderEnteredOptionPrice(formatPrice(price, currency))} + { title } + { this.renderEnteredOptionPrice(formatPrice(price, currency)) } - {quantity_ordered * qty} + { quantity_ordered * qty } ); @@ -228,10 +229,10 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - {price} + { price } ); } @@ -244,9 +245,9 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - {this.renderMobileBodyContentRow(__('Product name'), `${qty} x ${title}`, nameRowMix)} - {this.renderMobileBodyContentRow(__('SKU'), title)} - {this.renderMobileBodyContentRow(__('Price'), formatPrice(price, currency))} + { this.renderMobileBodyContentRow(__('Product name'), `${qty} x ${title}`, nameRowMix) } + { this.renderMobileBodyContentRow(__('SKU'), title) } + { this.renderMobileBodyContentRow(__('Price'), formatPrice(price, currency)) } ); } @@ -265,17 +266,17 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - {label} + { label } - {items.map((item) => renderOptionItem(item, isLastOptionItem))} + { items.map((item) => renderOptionItem(item, isLastOptionItem)) } ); } @@ -303,14 +304,14 @@ export class MyAccountOrderItemsTableRow extends PureComponent { } return ( -
    +
    - {label} + { label }
    - {this.renderOptionContent(option)} + { this.renderOptionContent(option) }
    ); } @@ -325,17 +326,17 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return linkItems.map(this.renderLink.bind(this)); } - return
    ; + return
    ; } renderLink(title, index) { return (
    - {title} + { title }
    ); } @@ -362,24 +363,24 @@ export class MyAccountOrderItemsTableRow extends PureComponent { if (isMobile) { return ( <> - {this.renderPrice( + { this.renderPrice( -totalDiscount, currency, __('Discount Amount') - )} - {this.renderPrice( + ) } + { this.renderPrice( row_subtotal - totalDiscount, currency, __('Row Total') - )} + ) } ); } return ( <> - {formatPrice(-totalDiscount, currency)} - {formatPrice(row_subtotal - totalDiscount, currency)} + { formatPrice(-totalDiscount, currency) } + { formatPrice(row_subtotal - totalDiscount, currency) } ); } @@ -389,13 +390,13 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - - {label} - {value} + + { label } + { value } ); @@ -416,18 +417,18 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( - {this.renderMobileBodyContentRow(__('Product name'), product_name, nameRowMix)} - {this.renderSelectedAndEnteredOptions()} - {this.renderMobileBodyContentRow(__('SKU'), product_sku)} - {this.renderItemPrice()} - {this.renderMobileBodyContentRow(__('Qty'), this.renderRowQty())} - {this.renderRowSubtotal()} - {this.renderDiscountAndRowTotal()} - {this.renderEnteredOptionsAsRow()} + { this.renderMobileBodyContentRow(__('Product name'), product_name, nameRowMix) } + { this.renderSelectedAndEnteredOptions() } + { this.renderMobileBodyContentRow(__('SKU'), product_sku) } + { this.renderItemPrice() } + { this.renderMobileBodyContentRow(__('Qty'), this.renderRowQty()) } + { this.renderRowSubtotal() } + { this.renderDiscountAndRowTotal() } + { this.renderEnteredOptionsAsRow() } ); } @@ -448,28 +449,28 @@ export class MyAccountOrderItemsTableRow extends PureComponent { return ( <> - {this.renderNameAndOptions()} - {product_sku} - {this.renderItemPrice()} + { this.renderNameAndOptions() } + { product_sku } + { this.renderItemPrice() } - {this.renderRowQty()} + { this.renderRowQty() } - {this.renderRowSubtotal()} - {this.renderDiscountAndRowTotal()} + { this.renderRowSubtotal() } + { this.renderDiscountAndRowTotal() } - {this.renderEnteredOptionsAsRow()} + { this.renderEnteredOptionsAsRow() } ); } - render() { + render(): ReactElement { const { isMobile } = this.props; if (!isMobile) { diff --git a/packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.js b/packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.tsx similarity index 93% rename from packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.js rename to packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.tsx index 4906faabe6..89d396e1e7 100644 --- a/packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderTab/MyAccountOrderTab.component.tsx @@ -9,9 +9,10 @@ * @link https://github.com/scandipwa/scandipwa */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './MyAccountOrderTab.style'; /** @namespace Component/MyAccountOrderTab/Component */ @@ -22,7 +23,7 @@ export class MyAccountOrderTab extends PureComponent { isActive: PropTypes.bool.isRequired }; - render() { + render(): ReactElement { const { title, isActive, handleClickOnTab } = this.props; return ( diff --git a/packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.js b/packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.tsx similarity index 95% rename from packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.js rename to packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.tsx index f68cd12851..ae4e1c2d51 100644 --- a/packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderTableRow/MyAccountOrderTableRow.component.tsx @@ -9,9 +9,9 @@ * @link https://gitdub.com/scandipwa/base-tdeme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { OrderType } from 'Type/Order.type'; import { formatPrice } from 'Util/Price'; @@ -24,7 +24,7 @@ export class MyAccountOrderTableRow extends PureComponent { onViewClick: PropTypes.func.isRequired }; - render() { + render(): ReactElement { const { order: { created_at, diff --git a/packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.js b/packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.tsx similarity index 95% rename from packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.js rename to packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.tsx index a168cc2114..8ad5d897dc 100644 --- a/packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.js +++ b/packages/scandipwa/src/component/MyAccountOrderTabs/MyAccountOrderTabs.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/scandipwa */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import MyAccountOrderTab from 'Component/MyAccountOrderTab'; +import { ReactElement } from 'Type/Common.type'; import './MyAccountOrderTabs.style'; @@ -59,7 +59,7 @@ export class MyAccountOrderTabs extends PureComponent { ); } - render() { + render(): ReactElement { return (
    ); } diff --git a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.js b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.js rename to packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.tsx index 47b1e6f278..221c9211b8 100644 --- a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.js +++ b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { withRouter } from 'react-router-dom'; @@ -21,6 +20,7 @@ import MyAccountForgotPasswordSuccess from 'Component/MyAccountForgotPasswordSuc import MyAccountSignIn from 'Component/MyAccountSignIn'; import Overlay from 'Component/Overlay'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import { @@ -189,7 +189,7 @@ export class MyAccountOverlay extends PureComponent { ); } - render() { + render(): ReactElement { const { onVisible, isCheckout, diff --git a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.container.js b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.container.js index a17b73cb96..f51d0438fa 100644 --- a/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.container.js +++ b/packages/scandipwa/src/component/MyAccountOverlay/MyAccountOverlay.container.js @@ -152,7 +152,7 @@ export class MyAccountOverlayContainer extends PureComponent { return Object.keys(stateToBeUpdated).length ? stateToBeUpdated : null; } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { isSignedIn: prevIsSignedIn } = prevProps; const { state: oldMyAccountState } = prevState; const { state: newMyAccountState } = this.state; @@ -333,8 +333,8 @@ export class MyAccountOverlayContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.js b/packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.js rename to packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.tsx index 17da5c83cf..7fa5af0432 100644 --- a/packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.js +++ b/packages/scandipwa/src/component/MyAccountPasswordForm/MyAccountPasswordForm.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import FieldForm from 'Component/FieldForm'; import transformToNameValuePair from 'Util/Form/Transform'; diff --git a/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.js b/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.tsx similarity index 98% rename from packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.js rename to packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.tsx index e6096f9fba..b3c13e1e8f 100644 --- a/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.js +++ b/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; @@ -17,6 +16,7 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import Form from 'Component/Form'; import Loader from 'Component/Loader'; import { SignInStateType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; import './MyAccountSignIn.style.scss'; @@ -134,7 +134,7 @@ export class MyAccountSignIn extends PureComponent { ); } - render() { + render(): ReactElement { return ( <> { this.renderSignInForm() } diff --git a/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.container.js b/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.container.js index 34685d6689..fe9391c37d 100644 --- a/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.container.js +++ b/packages/scandipwa/src/component/MyAccountSignIn/MyAccountSignIn.container.js @@ -82,7 +82,7 @@ export class MyAccountSignInContainer extends PureComponent { onSignInSuccess: this.onSignInSuccess.bind(this) }; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isCheckout, isEmailAvailable, setSignInState } = this.props; const { isEmailAvailable: prevIsEmailAvailable } = prevProps; @@ -160,8 +160,8 @@ export class MyAccountSignInContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.js b/packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.tsx similarity index 97% rename from packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.js rename to packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.tsx index c707b07711..93c1b9d0d1 100644 --- a/packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.js +++ b/packages/scandipwa/src/component/MyAccountTabList/MyAccountTabList.component.tsx @@ -9,12 +9,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ExpandableContent from 'Component/ExpandableContent'; import MyAccountTabListItem from 'Component/MyAccountTabListItem'; import { ActiveTabType, TabMapType } from 'Type/Account.type'; +import { ReactElement } from 'Type/Common.type'; import './MyAccountTabList.style'; @@ -74,7 +74,7 @@ export class MyAccountTabList extends PureComponent { ); } - render() { + render(): ReactElement { const { activeTab, isContentExpanded, diff --git a/packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.js b/packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.tsx similarity index 94% rename from packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.js rename to packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.tsx index a164728f3d..b1054c2338 100644 --- a/packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.js +++ b/packages/scandipwa/src/component/MyAccountTabListItem/MyAccountTabListItem.component.tsx @@ -9,12 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; import { TabType } from 'Type/Account.type'; -import { ChildrenType } from 'Type/Common.type'; +import { ChildrenType, ReactElement } from 'Type/Common.type'; import './MyAccountTabListItem.style'; @@ -45,7 +44,7 @@ export class MyAccountTabListItem extends PureComponent { changeActiveTab(key); } - render() { + render(): ReactElement { const { children, tabEntry: [, { tabName }], isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.js b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.tsx similarity index 98% rename from packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.js rename to packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.tsx index 6468127434..c53c75f026 100644 --- a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.js +++ b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.component.tsx @@ -46,7 +46,7 @@ export class NavigationAbstract extends Component { ); } - render() { + render(): ReactElement { throw new Error('Please redefine "render" method.'); } } diff --git a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.container.js b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.container.js index 21bd30e40e..b8b107d459 100644 --- a/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.container.js +++ b/packages/scandipwa/src/component/NavigationAbstract/NavigationAbstract.container.js @@ -53,7 +53,7 @@ export class NavigationAbstractContainer extends PureComponent { prevPathname: '' }; - componentDidMount() { + componentDidMount(): void { const { setNavigationState } = this.props; setNavigationState(this.getNavigationState()); history.listen((history) => { @@ -81,7 +81,7 @@ export class NavigationAbstractContainer extends PureComponent { const activeRoute = Object.keys(this.routeMap).find((route) => ( (route !== '/' && route !== '') || isHomePageUrl(pathname)) && pathname.includes(route)); - return this.routeMap[activeRoute] || this.default_state; + return this.routeMap[ activeRoute ] || this.default_state; } goToDefaultHeaderState() { @@ -130,7 +130,7 @@ export class NavigationAbstractContainer extends PureComponent { setNavigationState } = this.props; - setNavigationState(this.routeMap['/']); + setNavigationState(this.routeMap[ '/' ]); hideActiveOverlay(); return {}; diff --git a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.js b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.tsx similarity index 99% rename from packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.js rename to packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.tsx index f9612f28f4..1c6c7f4ba1 100644 --- a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.js +++ b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.component.tsx @@ -163,7 +163,7 @@ export class NavigationTabs extends NavigationAbstract { ); } - render() { + render(): ReactElement { const { navigationState: { isHidden }, device } = this.props; if (!device.isMobile) { diff --git a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.container.js b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.container.js index 3daebe3e2a..ac646fabc2 100644 --- a/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.container.js +++ b/packages/scandipwa/src/component/NavigationTabs/NavigationTabs.container.js @@ -36,8 +36,8 @@ import { /** @namespace Component/NavigationTabs/Container/mapStateToProps */ export const mapStateToProps = (state) => ({ - navigationState: state.NavigationReducer[BOTTOM_NAVIGATION_TYPE].navigationState, - headerState: state.NavigationReducer[TOP_NAVIGATION_TYPE].navigationState, + navigationState: state.NavigationReducer[ BOTTOM_NAVIGATION_TYPE ].navigationState, + headerState: state.NavigationReducer[ TOP_NAVIGATION_TYPE ].navigationState, device: state.ConfigReducer.device, cartTotals: state.CartReducer.cartTotals, noMatch: state.NoMatchReducer.noMatch @@ -81,7 +81,7 @@ export class NavigationTabsContainer extends NavigationAbstractContainer { onHomeButtonClick: this.onHomeButtonClick.bind(this) }; - componentDidMount() { + componentDidMount(): void { this.handleNavVisibility(); const SCROLL_DEBOUNCE_DELAY = 10; @@ -92,7 +92,7 @@ export class NavigationTabsContainer extends NavigationAbstractContainer { super.componentDidMount(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { navigationState: { isHidden } } = this.props; const { navigationState: { isHidden: prevHidden } } = prevProps; @@ -189,15 +189,15 @@ export class NavigationTabsContainer extends NavigationAbstractContainer { onMinicartButtonClick() { const { pathname } = location; - if (pathname !== appendWithStoreCode(`/${ CART }`)) { + if (pathname !== appendWithStoreCode(`/${CART}`)) { scrollToTop(); - browserHistory.push(appendWithStoreCode(`/${ CART }`)); + browserHistory.push(appendWithStoreCode(`/${CART}`)); } } onMyAccountButtonClick() { const { pathname } = location; - const url = appendWithStoreCode(isSignedIn() ? `${ ACCOUNT_URL }` : ACCOUNT_LOGIN_URL); + const url = appendWithStoreCode(isSignedIn() ? `${ACCOUNT_URL}` : ACCOUNT_LOGIN_URL); if (pathname !== url) { browserHistory.push(url); @@ -266,8 +266,8 @@ export class NavigationTabsContainer extends NavigationAbstractContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/NewProducts/NewProducts.component.js b/packages/scandipwa/src/component/NewProducts/NewProducts.component.tsx similarity index 96% rename from packages/scandipwa/src/component/NewProducts/NewProducts.component.js rename to packages/scandipwa/src/component/NewProducts/NewProducts.component.tsx index ebf5a768da..56b5d1820c 100644 --- a/packages/scandipwa/src/component/NewProducts/NewProducts.component.js +++ b/packages/scandipwa/src/component/NewProducts/NewProducts.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Component, createRef } from 'react'; import ProductCard from 'Component/ProductCard'; @@ -35,7 +34,7 @@ export class NewProducts extends Component { renderProductCard = this.renderProductCard.bind(this); - componentDidMount() { + componentDidMount(): void { this.setStyles(); } @@ -49,7 +48,7 @@ export class NewProducts extends Component { return products !== nextProducts || productsPerPage !== nextProductsPerPage; } - componentDidUpdate() { + componentDidUpdate(): void { this.setStyles(); } @@ -90,7 +89,7 @@ export class NewProducts extends Component { ); } - render() { + render(): ReactElement { const { products } = this.props; return ( diff --git a/packages/scandipwa/src/component/NewProducts/NewProducts.container.js b/packages/scandipwa/src/component/NewProducts/NewProducts.container.js index 21416d7758..159b02f10b 100644 --- a/packages/scandipwa/src/component/NewProducts/NewProducts.container.js +++ b/packages/scandipwa/src/component/NewProducts/NewProducts.container.js @@ -57,11 +57,11 @@ export class NewProductsContainer extends PureComponent { siblingsHaveConfigurableOptions: false }; - componentDidMount() { + componentDidMount(): void { this.requestProducts(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { category, productsCount, @@ -161,7 +161,7 @@ export class NewProductsContainer extends PureComponent { } }; - const query = [ProductListQuery.getQuery(options)]; + const query = [ ProductListQuery.getQuery(options) ]; executeGet(prepareQuery(query), 'NewProducts', cacheLifetime) .then( /** @namespace Component/NewProducts/Container/NewProductsContainer/requestProducts/then/catch/executeGet/then */ @@ -176,7 +176,7 @@ export class NewProductsContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.js b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.js rename to packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx index 1633d0a28d..9cf6839f26 100644 --- a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.js +++ b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Popup from 'Component/Popup'; +import { ReactElement } from 'Type/Common.type'; import { NEW_VERSION_POPUP_ID } from './NewVersionPopup.config'; @@ -93,7 +93,7 @@ export class NewVersionPopup extends PureComponent { ); } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.js b/packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.tsx similarity index 97% rename from packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.js rename to packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.tsx index 4f07dd2437..ae79da1af1 100644 --- a/packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.js +++ b/packages/scandipwa/src/component/NewsletterSubscription/NewsletterSubscription.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import { FIELD_TYPE } from 'Component/Field/Field.config'; import FieldForm from 'Component/FieldForm'; @@ -64,7 +62,7 @@ export class NewsletterSubscription extends FieldForm { }; } - render() { + render(): ReactElement { return (
    { super.render() } diff --git a/packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.js b/packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.tsx similarity index 88% rename from packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.js rename to packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.tsx index ac0fb36ad1..5f1d744504 100644 --- a/packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.js +++ b/packages/scandipwa/src/component/NotSupportedPayment/NotSupportedPayment.component.tsx @@ -8,9 +8,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './NotSupportedPayment.style'; /** @namespace Component/NotSupportedPayment/Component */ @@ -19,12 +21,12 @@ export class NotSupportedPayment extends PureComponent { disableButton: PropTypes.func.isRequired }; - componentDidMount() { + componentDidMount(): void { const { disableButton } = this.props; disableButton(); } - render() { + render(): ReactElement { return (

    { __('This payment method is not supported yet.') }

    diff --git a/packages/scandipwa/src/component/Notification/Notification.component.js b/packages/scandipwa/src/component/Notification/Notification.component.tsx similarity index 97% rename from packages/scandipwa/src/component/Notification/Notification.component.js rename to packages/scandipwa/src/component/Notification/Notification.component.tsx index 67550ad83e..0f18c47670 100644 --- a/packages/scandipwa/src/component/Notification/Notification.component.js +++ b/packages/scandipwa/src/component/Notification/Notification.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import { NotificationType } from 'Type/NotificationList.type'; @@ -44,7 +43,7 @@ export class Notification extends PureComponent { notification = createRef(); - componentDidMount() { + componentDidMount(): void { const { notification: { msgType }, lifeTime } = this.props; // Make sure error notification stays a little longer @@ -57,7 +56,7 @@ export class Notification extends PureComponent { CSS.setVariable(this.notification, 'animation-duration', `${ANIMATION_DURATION}ms`); } - componentWillUnmount() { + componentWillUnmount(): void { // clear started timeouts, to assure we are not changing state of unmounted component clearTimeout(this.hideTimeout); clearTimeout(this.CSSHideTimeout); @@ -98,7 +97,7 @@ export class Notification extends PureComponent { ); } - render() { + render(): ReactElement { const { notification, id } = this.props; const { isNotificationVisible } = this.state; const { msgText, msgType } = notification; diff --git a/packages/scandipwa/src/component/NotificationList/NotificationList.component.js b/packages/scandipwa/src/component/NotificationList/NotificationList.component.tsx similarity index 94% rename from packages/scandipwa/src/component/NotificationList/NotificationList.component.js rename to packages/scandipwa/src/component/NotificationList/NotificationList.component.tsx index e87ed1fc6c..6bbd2b532f 100644 --- a/packages/scandipwa/src/component/NotificationList/NotificationList.component.js +++ b/packages/scandipwa/src/component/NotificationList/NotificationList.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Notification from 'Component/Notification'; +import { ReactElement } from 'Type/Common.type'; import { NotificationListType } from 'Type/NotificationList.type'; import './NotificationList.style'; @@ -28,7 +28,7 @@ export class NotificationList extends PureComponent { onHideNotification: PropTypes.func.isRequired }; - render() { + render(): ReactElement { const { onHideNotification, notifications } = this.props; return ( diff --git a/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.js b/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.tsx similarity index 96% rename from packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.js rename to packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.tsx index 4a6b090aad..1fe45f63c5 100644 --- a/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.js +++ b/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.component.tsx @@ -10,9 +10,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './OfflineNotice.style'; /** @namespace Component/OfflineNotice/Component */ @@ -56,7 +58,7 @@ export class OfflineNotice extends PureComponent { ); } - render() { + render(): ReactElement { const { isPage, isBig } = this.props; if (!isBig && isPage) { diff --git a/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.container.js b/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.container.js index 142f91201a..9d6da6d680 100644 --- a/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.container.js +++ b/packages/scandipwa/src/component/OfflineNotice/OfflineNotice.container.js @@ -45,7 +45,7 @@ export class OfflineNoticeContainer extends PureComponent { isPage: false }; - componentDidMount() { + componentDidMount(): void { const { isPage } = this.props; if (!isPage) { @@ -55,7 +55,7 @@ export class OfflineNoticeContainer extends PureComponent { } } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { location: { pathname }, isBig, @@ -82,7 +82,7 @@ export class OfflineNoticeContainer extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { const { isPage } = this.props; if (!isPage) { @@ -132,8 +132,8 @@ export class OfflineNoticeContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/Overlay/Overlay.component.js b/packages/scandipwa/src/component/Overlay/Overlay.component.tsx similarity index 97% rename from packages/scandipwa/src/component/Overlay/Overlay.component.js rename to packages/scandipwa/src/component/Overlay/Overlay.component.tsx index 8b07114805..f21427294c 100644 --- a/packages/scandipwa/src/component/Overlay/Overlay.component.js +++ b/packages/scandipwa/src/component/Overlay/Overlay.component.tsx @@ -11,7 +11,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import { createPortal } from 'react-dom'; @@ -47,7 +46,7 @@ export class Overlay extends PureComponent { overlayRef = createRef(); - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const prevWasVisible = this.getIsVisible(prevProps); const isVisible = this.getIsVisible(); @@ -116,7 +115,7 @@ export class Overlay extends PureComponent { return content; } - render() { + render(): ReactElement { const { children, mix, diff --git a/packages/scandipwa/src/component/Pagination/Pagination.component.js b/packages/scandipwa/src/component/Pagination/Pagination.component.tsx similarity index 98% rename from packages/scandipwa/src/component/Pagination/Pagination.component.js rename to packages/scandipwa/src/component/Pagination/Pagination.component.tsx index 7305385f62..3981a4ce77 100644 --- a/packages/scandipwa/src/component/Pagination/Pagination.component.js +++ b/packages/scandipwa/src/component/Pagination/Pagination.component.tsx @@ -9,14 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; import { LEFT, RIGHT } from 'Component/ChevronIcon/ChevronIcon.config'; import PaginationLink from 'Component/PaginationLink'; import TextPlaceholder from 'Component/TextPlaceholder'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { range } from 'Util/Manipulations'; import './Pagination.style'; @@ -220,7 +219,7 @@ export class Pagination extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, totalPages, diff --git a/packages/scandipwa/src/component/PaginationLink/PaginationLink.component.js b/packages/scandipwa/src/component/PaginationLink/PaginationLink.component.tsx similarity index 94% rename from packages/scandipwa/src/component/PaginationLink/PaginationLink.component.js rename to packages/scandipwa/src/component/PaginationLink/PaginationLink.component.tsx index 262acec8d0..0017ab0b5e 100644 --- a/packages/scandipwa/src/component/PaginationLink/PaginationLink.component.js +++ b/packages/scandipwa/src/component/PaginationLink/PaginationLink.component.tsx @@ -9,11 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Link from 'Component/Link'; -import { ChildrenType } from 'Type/Common.type'; +import { ChildrenType, ReactElement } from 'Type/Common.type'; import './PaginationLink.style'; @@ -38,7 +37,7 @@ export class PaginationLink extends PureComponent { return getSearchQueryForPage(pageNumber); } - render() { + render(): ReactElement { const { label, url_path: pathname, diff --git a/packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.js b/packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.tsx similarity index 97% rename from packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.js rename to packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.tsx index fec3ecba3f..783bb8ff4b 100644 --- a/packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.js +++ b/packages/scandipwa/src/component/PasswordChangeForm/PasswordChangeForm.component.tsx @@ -9,7 +9,6 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import FieldForm from 'Component/FieldForm'; diff --git a/packages/scandipwa/src/component/Popup/Popup.component.js b/packages/scandipwa/src/component/Popup/Popup.component.tsx similarity index 97% rename from packages/scandipwa/src/component/Popup/Popup.component.js rename to packages/scandipwa/src/component/Popup/Popup.component.tsx index a03bb4cf0b..6a66aed291 100644 --- a/packages/scandipwa/src/component/Popup/Popup.component.js +++ b/packages/scandipwa/src/component/Popup/Popup.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createPortal } from 'react-dom'; import ClickOutside from 'Component/ClickOutside'; @@ -42,11 +41,11 @@ export class Popup extends Overlay { handleClickOutside = this.handleClickOutside.bind(this); - componentDidMount() { + componentDidMount(): void { document.addEventListener('keydown', this.handleKeyDown.bind(this)); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { shouldPopupClose, resetHideActivePopup } = this.props; const { shouldPopupClose: prevShouldPopupClose } = prevProps; @@ -58,7 +57,7 @@ export class Popup extends Overlay { super.componentDidUpdate(prevProps); } - componentWillUnmount() { + componentWillUnmount(): void { document.removeEventListener('keydown', this.handleKeyDown.bind(this)); } @@ -191,7 +190,7 @@ export class Popup extends Overlay { ); } - render() { + render(): ReactElement { const { mix, areOtherOverlaysOpen } = this.props; const isVisible = this.getIsVisible(); diff --git a/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.js b/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.tsx similarity index 95% rename from packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.js rename to packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.tsx index 342c63f6d0..5ca0b01c87 100644 --- a/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.js +++ b/packages/scandipwa/src/component/PopupSuspense/PopupSuspense.component.tsx @@ -8,13 +8,14 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import { CART_OVERLAY } from 'Component/Header/Header.config'; import Loader from 'Component/Loader'; import { CUSTOMER_ACCOUNT_OVERLAY_KEY } from 'Component/MyAccountOverlay/MyAccountOverlay.config'; import Overlay from 'Component/Overlay'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import { OVERLAY_PLACEHOLDER } from './PopupSuspense.config'; @@ -44,7 +45,7 @@ export class PopupSuspense extends PureComponent { [CUSTOMER_ACCOUNT_OVERLAY_KEY]: 'MyAccountOverlay' }; - componentDidMount() { + componentDidMount(): void { const { showOverlay } = this.props; showOverlay(OVERLAY_PLACEHOLDER); @@ -58,7 +59,7 @@ export class PopupSuspense extends PureComponent { ); } - render() { + render(): ReactElement { const { onVisible, actualOverlayKey diff --git a/packages/scandipwa/src/component/Product/Product.component.js b/packages/scandipwa/src/component/Product/Product.component.tsx similarity index 99% rename from packages/scandipwa/src/component/Product/Product.component.js rename to packages/scandipwa/src/component/Product/Product.component.tsx index e8780f466b..23d7c02ab8 100644 --- a/packages/scandipwa/src/component/Product/Product.component.js +++ b/packages/scandipwa/src/component/Product/Product.component.tsx @@ -10,7 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import AddToCart from 'Component/AddToCart'; @@ -456,7 +455,7 @@ export class Product extends PureComponent { * * @param header If header outputs as H1 * @param dynamic Name type (false - shows parent product only) - * @returns {JSX.Element} + * @returns {ReactElement} */ renderName(header = true, dynamic = false) { const { product: { name }, productName } = this.props; @@ -478,7 +477,7 @@ export class Product extends PureComponent { } //#endregion - render() { + render(): ReactElement { return null; } } diff --git a/packages/scandipwa/src/component/Product/Product.container.js b/packages/scandipwa/src/component/Product/Product.container.js index 6cc4d9e591..2ab354c3ca 100644 --- a/packages/scandipwa/src/component/Product/Product.container.js +++ b/packages/scandipwa/src/component/Product/Product.container.js @@ -134,10 +134,10 @@ export class ProductContainer extends PureComponent { } setDefaultProductOptions(keyProp, keyState) { - const { [keyProp]: value } = this.props; + const { [ keyProp ]: value } = this.props; if (Array.isArray(value) && value.length > 0) { - this.setState({ [keyState]: value || [] }, () => { + this.setState({ [ keyState ]: value || [] }, () => { this.updateAdjustedPrice(); }); } @@ -184,12 +184,12 @@ export class ProductContainer extends PureComponent { return null; } - componentDidMount() { + componentDidMount(): void { this.updateSelectedValues(); this.updateAdjustedPrice(); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { enteredOptions, selectedOptions, @@ -248,11 +248,11 @@ export class ProductContainer extends PureComponent { } = activeProduct || {}; const output = { - inStock: fromCache(getProductInStock, [activeProduct, product]), + inStock: fromCache(getProductInStock, [ activeProduct, product ]), maxQuantity: getMaxQuantity(activeProduct), minQuantity: getMinQuantity(activeProduct), productName: getName(product), - productPrice: fromCache(getPrice, [priceRange, dynamicPrice, adjustedPrice, type, options]) + productPrice: fromCache(getPrice, [ priceRange, dynamicPrice, adjustedPrice, type, options ]) }; return { @@ -292,7 +292,7 @@ export class ProductContainer extends PureComponent { }); } - const values = getFieldsData(current, true, [FIELD_TYPE.number]); + const values = getFieldsData(current, true, [ FIELD_TYPE.number ]); values.forEach(({ name, value, type }) => { if (type === FIELD_TYPE.select) { @@ -334,7 +334,7 @@ export class ProductContainer extends PureComponent { this.setState({ adjustedPrice: { ...adjustedPrice, - [type]: amount + [ type ]: amount } }); } @@ -350,7 +350,7 @@ export class ProductContainer extends PureComponent { const { product: { configurable_options } } = this.props; const unselectedOptions = Object.keys(configurable_options).reduce((accumulator, value) => { - if (!parameters[value]) { + if (!parameters[ value ]) { accumulator.push(value); } @@ -452,7 +452,7 @@ export class ProductContainer extends PureComponent { const newParameters = getNewParameters(prevParameters, key, value); - const { [key]: oldValue, ...currentParameters } = newParameters; + const { [ key ]: oldValue, ...currentParameters } = newParameters; const parameters = oldValue === '' && checkEmptyValue ? currentParameters : newParameters; this.setState({ parameters }); @@ -465,7 +465,7 @@ export class ProductContainer extends PureComponent { // Not all parameters are selected yet, therefore variantIndex must be invalid : -1; - const newProduct = newIndex === -1 ? null : variants[newIndex]; + const newProduct = newIndex === -1 ? null : variants[ newIndex ]; if (newProduct !== selectedProduct) { this.setState({ @@ -495,7 +495,7 @@ export class ProductContainer extends PureComponent { * @param options State value */ setStateOptions(type, options) { - this.setState({ [type]: options }); + this.setState({ [ type ]: options }); } /** @@ -520,7 +520,7 @@ export class ProductContainer extends PureComponent { product, quantity, enteredOptions, - [...selectedOptions, ...downloadableLinks, ...configurableOptions], + [ ...selectedOptions, ...downloadableLinks, ...configurableOptions ], ); } diff --git a/packages/scandipwa/src/component/ProductActions/ProductActions.component.js b/packages/scandipwa/src/component/ProductActions/ProductActions.component.tsx similarity index 61% rename from packages/scandipwa/src/component/ProductActions/ProductActions.component.js rename to packages/scandipwa/src/component/ProductActions/ProductActions.component.tsx index 8cec7d6cbc..886a110a4d 100644 --- a/packages/scandipwa/src/component/ProductActions/ProductActions.component.js +++ b/packages/scandipwa/src/component/ProductActions/ProductActions.component.tsx @@ -9,8 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; - import Html from 'Component/Html'; import { Product } from 'Component/Product/Product.component'; import PRODUCT_TYPE from 'Component/Product/Product.config'; @@ -56,7 +54,7 @@ export class ProductActions extends Product { className = 'ProductActions'; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { product: { id: prevId } } = prevProps; const { product: { id }, minQuantity, setQuantity } = this.props; @@ -76,16 +74,16 @@ export class ProductActions extends Product { return ( ); @@ -101,21 +99,21 @@ export class ProductActions extends Product { return (
    - {showOnlyIfLoaded( + { showOnlyIfLoaded( sku, ( <> - {this.renderSku()} - {this.renderStock()} + { this.renderSku() } + { this.renderStock() } ), - )} + ) }
    ); } @@ -128,7 +126,7 @@ export class ProductActions extends Product { return (
    - {html ? :

    } + { html ? :

    }
    ); } @@ -143,12 +141,12 @@ export class ProductActions extends Product { return (
    - {this.renderShortDescriptionContent()} + { this.renderShortDescriptionContent() }
    ); } @@ -159,8 +157,8 @@ export class ProductActions extends Product { if (offerCount > 1) { return ( ); } @@ -177,17 +175,17 @@ export class ProductActions extends Product { return ( <> - {this.renderOfferCount()} - - - { /* eslint-disable-next-line react/forbid-elements */} + { this.renderOfferCount() } + + + { /* eslint-disable-next-line react/forbid-elements */ } ); @@ -211,15 +209,15 @@ export class ProductActions extends Product { return (
    - {this.renderSchema()} + { this.renderSchema() } - {this.renderPrice()} + { this.renderPrice() }
    ); } @@ -238,13 +236,13 @@ export class ProductActions extends Product { return (
    - {this.renderPriceWithSchema()} + { this.renderPriceWithSchema() }
    ); } @@ -252,11 +250,11 @@ export class ProductActions extends Product { renderReviewSection() { return (
    - {this.renderRatingSummary()} - {this.renderReviewButton()} + { this.renderRatingSummary() } + { this.renderReviewButton() }
    ); } @@ -280,7 +278,7 @@ export class ProductActions extends Product { return (
    - +
    ); } @@ -305,13 +303,13 @@ export class ProductActions extends Product { return (
    ); @@ -320,15 +318,15 @@ export class ProductActions extends Product { renderAddToCartActionBlock() { return (
    - {this.renderQuantityChanger()} - {this.renderAddToCartButton()} + { this.renderQuantityChanger() } + { this.renderAddToCartButton() }
    - {this.renderWishlistButton()} - {this.renderCompareButton()} + { this.renderWishlistButton() } + { this.renderCompareButton() }
    ); @@ -337,13 +335,13 @@ export class ProductActions extends Product { renderAddToCartMobile() { return (
    - {this.renderQuantityChanger()} - {this.renderAddToCartButton()} - {this.renderWishlistButton()} + { this.renderQuantityChanger() } + { this.renderAddToCartButton() } + { this.renderWishlistButton() }
    ); } @@ -351,20 +349,20 @@ export class ProductActions extends Product { renderDesktop() { return ( <> - {this.renderBrand(true)} - {this.renderName()} - {this.renderReviewSection()} - {this.renderSkuAndStock()} - {this.renderShortDescription()} - {this.renderConfigurableOptions()} - {this.renderCustomAndBundleOptions()} - {this.renderGroupedOptions()} - {this.renderDownloadableSamples()} - {this.renderDownloadableLinks()} - {this.renderTierPrices()} - {this.renderProductAlerts()} - {this.renderPriceWithGlobalSchema()} - {this.renderAddToCartActionBlock()} + { this.renderBrand(true) } + { this.renderName() } + { this.renderReviewSection() } + { this.renderSkuAndStock() } + { this.renderShortDescription() } + { this.renderConfigurableOptions() } + { this.renderCustomAndBundleOptions() } + { this.renderGroupedOptions() } + { this.renderDownloadableSamples() } + { this.renderDownloadableLinks() } + { this.renderTierPrices() } + { this.renderProductAlerts() } + { this.renderPriceWithGlobalSchema() } + { this.renderAddToCartActionBlock() } ); } @@ -375,34 +373,34 @@ export class ProductActions extends Product { return ( <> - {this.renderTierPrices()} -
    - {this.renderPriceWithGlobalSchema()} - {this.renderSkuAndStock()} + { this.renderTierPrices() } +
    + { this.renderPriceWithGlobalSchema() } + { this.renderSkuAndStock() }
    - {this.renderReviewSection()} - {this.renderCompareButton()} + { this.renderReviewSection() } + { this.renderCompareButton() }
    - {this.renderBrand(true)} - {this.renderShortDescription()} - {this.renderProductAlerts()} - {this.renderConfigurableOptions()} - {this.renderCustomAndBundleOptions()} - {this.renderGroupedOptions()} - {this.renderDownloadableSamples()} - {this.renderDownloadableLinks()} - {this.renderAddToCartMobile()} + { this.renderBrand(true) } + { this.renderShortDescription() } + { this.renderProductAlerts() } + { this.renderConfigurableOptions() } + { this.renderCustomAndBundleOptions() } + { this.renderGroupedOptions() } + { this.renderDownloadableSamples() } + { this.renderDownloadableLinks() } + { this.renderAddToCartMobile() } ); } - render() { + render(): ReactElement { const { device: { isMobile } = {}, setValidator } = this.props; return ( -
    setValidator(elem)}> - {isMobile ? this.renderMobile() : this.renderDesktop()} +
    setValidator(elem) }> + { isMobile ? this.renderMobile() : this.renderDesktop() }
    ); } diff --git a/packages/scandipwa/src/component/ProductActions/ProductActions.container.js b/packages/scandipwa/src/component/ProductActions/ProductActions.container.js index 6922d1013a..e893577ef4 100644 --- a/packages/scandipwa/src/component/ProductActions/ProductActions.container.js +++ b/packages/scandipwa/src/component/ProductActions/ProductActions.container.js @@ -75,7 +75,7 @@ export class ProductActionsContainer extends ProductContainer { }; } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { super.componentDidUpdate(prevProps, prevState); const { selectedProduct: prevSelectedProduct } = prevState; diff --git a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.tsx similarity index 74% rename from packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js rename to packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.tsx index 068c03ee6e..d534c4c320 100644 --- a/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.js +++ b/packages/scandipwa/src/component/ProductAlerts/ProductAlerts.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { StockType } from 'Component/Product/Stock.config'; +import { ReactElement } from 'Type/Common.type'; import { StockStatusType } from 'Type/StockStatus.type'; import './ProductAlerts.style'; @@ -42,11 +42,11 @@ export class ProductAlerts extends PureComponent { return ( ); } @@ -68,23 +68,23 @@ export class ProductAlerts extends PureComponent { return ( ); } - render() { + render(): ReactElement { return (
    - {this.renderPriceDropSubscribeButton()} - {this.renderInStockSubscribeButton()} + { this.renderPriceDropSubscribeButton() } + { this.renderInStockSubscribeButton() }
    ); } diff --git a/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.js b/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.tsx similarity index 99% rename from packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.js rename to packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.tsx index 8113c467c9..76e73c69e7 100644 --- a/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.js +++ b/packages/scandipwa/src/component/ProductAttributeValue/ProductAttributeValue.component.tsx @@ -11,13 +11,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import Html from 'Component/Html'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { AttributeType } from 'Type/ProductList.type'; import { noopFn } from 'Util/Common'; import { getBooleanLabel } from 'Util/Product'; @@ -376,7 +375,7 @@ export class ProductAttributeValue extends PureComponent { } } - render() { + render(): ReactElement { const { getLink, attribute, diff --git a/packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.js b/packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.js rename to packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.tsx index 2cec89dd7d..786ce86861 100644 --- a/packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.js +++ b/packages/scandipwa/src/component/ProductAttributes/ProductAttributes.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Fragment, PureComponent } from 'react'; import ExpandableContent from 'Component/ExpandableContent'; @@ -109,7 +108,7 @@ export class ProductAttributes extends PureComponent { ); } - render() { + render(): ReactElement { const { areDetailsLoaded } = this.props; diff --git a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.js b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.tsx similarity index 99% rename from packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.js rename to packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.tsx index bb4fdec37b..05e0c9d755 100644 --- a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.js +++ b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.component.tsx @@ -10,12 +10,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import { FIELD_TYPE } from 'Component/Field/Field.config'; import FieldGroup from 'Component/FieldGroup'; +import { ReactElement } from 'Type/Common.type'; import { ItemOptionsType } from 'Type/ProductList.type'; import { DEFAULT_MAX_PRODUCTS, DEFAULT_MIN_PRODUCTS, @@ -56,7 +56,7 @@ export class ProductBundleOption extends PureComponent { [FIELD_TYPE.select]: this.renderSelectValue.bind(this) }; - componentDidMount() { + componentDidMount(): void { const { updateSelectedValues } = this.props; updateSelectedValues(); } @@ -338,7 +338,7 @@ export class ProductBundleOption extends PureComponent { } //#endregion - render() { + render(): ReactElement { const { title, options, type } = this.props; const render = this.renderMap[type]; diff --git a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.container.js b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.container.js index 7478634c76..224192d05a 100644 --- a/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.container.js +++ b/packages/scandipwa/src/component/ProductBundleOption/ProductBundleOption.container.js @@ -62,11 +62,11 @@ export class ProductBundleOptionContainer extends PureComponent { setDefaultOption: this.setDefaultOption.bind(this) }; - componentDidMount() { + componentDidMount(): void { this.setDefaultOption(); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { quantity } = this.state; const { quantity: prevQuantity } = prevState; @@ -77,7 +77,7 @@ export class ProductBundleOptionContainer extends PureComponent { } getUidWithQuantity(uid, defaultQuantity = 1) { - const { quantity: { [uid]: quantity = defaultQuantity } } = this.state; + const { quantity: { [ uid ]: quantity = defaultQuantity } } = this.state; return getEncodedBundleUid(uid, quantity); } @@ -88,7 +88,7 @@ export class ProductBundleOptionContainer extends PureComponent { this.setState({ quantity: { ...quantity, - [uid]: rangedValue + [ uid ]: rangedValue } }); } @@ -102,7 +102,7 @@ export class ProductBundleOptionContainer extends PureComponent { setDefaultOption() { const { options } = this.props; - const [defaultOption = null] = bundleOptionsToSelectTransform(options).filter(({ isDefault }) => isDefault); + const [ defaultOption = null ] = bundleOptionsToSelectTransform(options).filter(({ isDefault }) => isDefault); const { isAvailable = false } = defaultOption || {}; if (defaultOption && isAvailable) { @@ -158,8 +158,8 @@ export class ProductBundleOptionContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.js b/packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.tsx similarity index 95% rename from packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.js rename to packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.tsx index 1a1930a0a6..87da14905a 100644 --- a/packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.js +++ b/packages/scandipwa/src/component/ProductBundleOptions/ProductBundleOptions.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ProductBundleOption from 'Component/ProductBundleOption'; +import { ReactElement } from 'Type/Common.type'; import { ProductItemsType } from 'Type/ProductList.type'; import './ProductBundleOptions.style'; @@ -54,7 +54,7 @@ export class ProductBundleOptions extends PureComponent { ); } - render() { + render(): ReactElement { const { options = [] } = this.props; return ( diff --git a/packages/scandipwa/src/component/ProductCard/ProductCard.component.js b/packages/scandipwa/src/component/ProductCard/ProductCard.component.tsx similarity index 99% rename from packages/scandipwa/src/component/ProductCard/ProductCard.component.js rename to packages/scandipwa/src/component/ProductCard/ProductCard.component.tsx index 633c2f0b3f..ba9ee1aea5 100644 --- a/packages/scandipwa/src/component/ProductCard/ProductCard.component.js +++ b/packages/scandipwa/src/component/ProductCard/ProductCard.component.tsx @@ -10,7 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef } from 'react'; import Image from 'Component/Image'; @@ -23,7 +22,7 @@ import { GRID_LAYOUT, LIST_LAYOUT } from 'Route/CategoryPage/CategoryPage.config import { MixType } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import { LayoutType } from 'Type/Layout.type'; -import { LinkType } from 'Type/Router.type'; +import { UrlType } from 'Type/Router.type'; import './ProductCard.style'; @@ -380,7 +379,7 @@ export class ProductCard extends Product { )); } - render() { + render(): ReactElement { const { children, mix, diff --git a/packages/scandipwa/src/component/ProductCompare/ProductCompare.component.js b/packages/scandipwa/src/component/ProductCompare/ProductCompare.component.tsx similarity index 99% rename from packages/scandipwa/src/component/ProductCompare/ProductCompare.component.js rename to packages/scandipwa/src/component/ProductCompare/ProductCompare.component.tsx index 30963e030c..936ba8e814 100644 --- a/packages/scandipwa/src/component/ProductCompare/ProductCompare.component.js +++ b/packages/scandipwa/src/component/ProductCompare/ProductCompare.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { Component } from 'react'; import ProductCompareAttributeRow from 'Component/ProductCompareAttributeRow'; @@ -236,7 +235,7 @@ export class ProductCompare extends Component { return this.renderProducts(); } - render() { + render(): ReactElement { return ( <> { this.renderHeading() } diff --git a/packages/scandipwa/src/component/ProductCompare/ProductCompare.container.js b/packages/scandipwa/src/component/ProductCompare/ProductCompare.container.js index 0e3d5b6c21..f2487510ca 100644 --- a/packages/scandipwa/src/component/ProductCompare/ProductCompare.container.js +++ b/packages/scandipwa/src/component/ProductCompare/ProductCompare.container.js @@ -83,12 +83,12 @@ export class ProductCompareContainer extends PureComponent { handleBlockScroll: this.handleBlockScroll.bind(this) }; - componentDidMount() { + componentDidMount(): void { this.fetchCompareList(); scrollToTop({ behavior: 'smooth' }); } - componentDidUpdate() { + componentDidUpdate(): void { const { device } = this.props; const productCompareRow = document.getElementById('productCompareRow'); @@ -100,7 +100,7 @@ export class ProductCompareContainer extends PureComponent { ? productCompareRow.offsetWidth : productCompareRow.offsetWidth - PRODUCT_COMPARE_FIRST_COLUMN_WIDTH; - scrollerContent.style.width = `${ width }px`; + scrollerContent.style.width = `${width}px`; } } @@ -159,7 +159,7 @@ export class ProductCompareContainer extends PureComponent { ({ product, attributes }) => { if (code === 'description' || code === 'short_description') { const { - [code]: { + [ code ]: { html } = {} } = product || {}; @@ -178,8 +178,8 @@ export class ProductCompareContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.js b/packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.tsx similarity index 96% rename from packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.js rename to packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.tsx index 5c955659fd..057f705f35 100644 --- a/packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.js +++ b/packages/scandipwa/src/component/ProductCompareAttributeRow/ProductCompareAttributeRow.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Html from 'Component/Html'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import './ProductCompareAttributeRow.style'; @@ -65,7 +65,7 @@ export class ProductCompareAttributeRow extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderTitle() } diff --git a/packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.js b/packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.tsx similarity index 94% rename from packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.js rename to packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.tsx index 97f8740fb3..7c2aa01abe 100644 --- a/packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.js +++ b/packages/scandipwa/src/component/ProductCompareButton/ProductCompareButton.component.tsx @@ -9,12 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CompareIcon from 'Component/CompareIcon'; import Loader from 'Component/Loader'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import './ProductCompareButton.style'; @@ -32,7 +31,7 @@ export class ProductCompareButton extends PureComponent { isActive: false }; - render() { + render(): ReactElement { const { handleClick, isLoading, diff --git a/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.js b/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.js rename to packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.tsx index 7628075e9a..46b0b56467 100644 --- a/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.js +++ b/packages/scandipwa/src/component/ProductCompareItem/ProductCompareItem.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import AddToCart from 'Component/AddToCart'; @@ -19,8 +18,9 @@ import Link from 'Component/Link'; import Loader from 'Component/Loader'; import ProductReviewRating from 'Component/ProductReviewRating'; import ProductWishlistButton from 'Component/ProductWishlistButton/ProductWishlistButton.container'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; -import { LinkType } from 'Type/Router.type'; +import { UrlType } from 'Type/Router.type'; import { ADD_TO_WISHLIST } from 'Util/Product'; import { magentoProductTransform } from 'Util/Product/Transform'; @@ -202,7 +202,7 @@ export class ProductCompareItem extends PureComponent { return ; } - render() { + render(): ReactElement { return (
    diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.js b/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.tsx similarity index 96% rename from packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.js rename to packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.tsx index e0f3f543f6..23b26eb0ce 100644 --- a/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.js +++ b/packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/ProductConfigurableAttributeDropdown.component.tsx @@ -8,11 +8,12 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import './ProductConfigurableAttributeDropdown.style'; @@ -40,7 +41,7 @@ export class ProductConfigurableAttributeDropdown extends PureComponent { isUnselected: false }; - render() { + render(): ReactElement { const { selectOptions, selectValue, diff --git a/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.js b/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.js rename to packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.tsx index 98a0dd3c46..f4cb14b82a 100644 --- a/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.js +++ b/packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.component.tsx @@ -9,12 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ProductAttributeValue from 'Component/ProductAttributeValue'; import ProductConfigurableAttributeDropdown from 'Component/ProductConfigurableAttributeDropdown'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { AttributesType } from 'Type/ProductList.type'; import { noopFn } from 'Util/Common'; @@ -180,7 +179,7 @@ export class ProductConfigurableAttributes extends PureComponent { }); } - render() { + render(): ReactElement { const { isReady, mix } = this.props; return ( diff --git a/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.js b/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.js rename to packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.tsx index d2c429965a..4fb0ab3b18 100644 --- a/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.js +++ b/packages/scandipwa/src/component/ProductCustomizableOption/ProductCustomizableOption.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; @@ -17,6 +16,7 @@ import { FIELD_TYPE } from 'Component/Field/Field.config'; import FieldDate from 'Component/FieldDate'; import { FIELD_DATE_TYPE } from 'Component/FieldDate/FieldDate.config'; import FieldGroup from 'Component/FieldGroup'; +import { ReactElement } from 'Type/Common.type'; import { CustomizableOptionsType } from 'Type/ProductList.type'; // eslint-disable-next-line no-unused-vars import { getSubLabelFromMaxCharacters } from 'Util/Product/Extract'; @@ -64,7 +64,7 @@ export class ProductCustomizableOption extends PureComponent { value: '' }; - componentDidMount() { + componentDidMount(): void { const { updateSelectedValues } = this.props; updateSelectedValues(); } @@ -309,7 +309,7 @@ export class ProductCustomizableOption extends PureComponent { ); } - render() { + render(): ReactElement { const { options, type, title } = this.props; const render = this.renderMap[type]; diff --git a/packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.js b/packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.tsx similarity index 95% rename from packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.js rename to packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.tsx index 0aa4ef05de..ae9aca03aa 100644 --- a/packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.js +++ b/packages/scandipwa/src/component/ProductCustomizableOptions/ProductCustomizableOptions.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ProductCustomizableOption from 'Component/ProductCustomizableOption'; +import { ReactElement } from 'Type/Common.type'; import { OptionsListType } from 'Type/ProductList.type'; import './ProductCustomizableOptions.style'; @@ -56,7 +56,7 @@ export class ProductCustomizableOptions extends PureComponent { ); } - render() { + render(): ReactElement { const { options = [] } = this.props; options.sort((first, second) => (first.sort_order - second.sort_order)); diff --git a/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.js b/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.js rename to packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.tsx index 9187c60b6e..5d0b760e6d 100644 --- a/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.js +++ b/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ExpandableContent from 'Component/ExpandableContent'; @@ -17,6 +16,7 @@ import FieldContainer from 'Component/Field'; import { FIELD_TYPE } from 'Component/Field/Field.config'; import FieldGroup from 'Component/FieldGroup'; import Link from 'Component/Link'; +import { ReactElement } from 'Type/Common.type'; import { DownloadableLinksType } from 'Type/Downloadable.type'; import { formatPrice } from 'Util/Price'; @@ -165,7 +165,7 @@ export class ProductDownloadableLinks extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, title } = this.props; if (isLoading) { diff --git a/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.container.js b/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.container.js index b1d554cfec..326885fed4 100644 --- a/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.container.js +++ b/packages/scandipwa/src/component/ProductDownloadableLinks/ProductDownloadableLinks.container.js @@ -55,7 +55,7 @@ export class ProductDownloadableLinksContainer extends PureComponent { formRef = createRef(); - componentDidMount() { + componentDidMount(): void { const { links } = this.props; if (links) { @@ -63,7 +63,7 @@ export class ProductDownloadableLinksContainer extends PureComponent { } } - componentDidUpdate(_, prevState) { + componentDidUpdate(_, prevState): void { const { links } = this.props; const { selectedLinks, @@ -140,8 +140,8 @@ export class ProductDownloadableLinksContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.js b/packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.tsx similarity index 96% rename from packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.js rename to packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.tsx index d71ff2a527..e79e92358a 100644 --- a/packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.js +++ b/packages/scandipwa/src/component/ProductDownloadableSamples/ProductDownloadableSamples.component.tsx @@ -8,11 +8,12 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import ExpandableContent from 'Component/ExpandableContent'; import Link from 'Component/Link'; +import { ReactElement } from 'Type/Common.type'; import { DownloadableSamplesType } from 'Type/ProductList.type'; import './ProductDownloadableSamples.style'; @@ -56,7 +57,7 @@ export class ProductDownloadableSamples extends PureComponent { }); } - render() { + render(): ReactElement { const { title } = this.props; return ( diff --git a/packages/scandipwa/src/component/ProductGallery/ProductGallery.component.js b/packages/scandipwa/src/component/ProductGallery/ProductGallery.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductGallery/ProductGallery.component.js rename to packages/scandipwa/src/component/ProductGallery/ProductGallery.component.tsx index 9a1fd3fac8..6f7f148475 100644 --- a/packages/scandipwa/src/component/ProductGallery/ProductGallery.component.js +++ b/packages/scandipwa/src/component/ProductGallery/ProductGallery.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import { withRouter } from 'react-router'; import { TransformWrapper } from 'react-zoom-pan-pinch'; @@ -97,17 +96,17 @@ export class ProductGallery extends PureComponent { onWheel = this.onWheel.bind(this); - __construct(props, context) { + __construct(props, context): void { super.__construct(props, context); this.renderSlide = this.renderSlide.bind(this); } - componentDidMount() { + componentDidMount(): void { this.updateSharedDestinationElement(); window.addEventListener('resize', this.calculateGallerySize); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { productId, location: { pathname }, @@ -139,7 +138,7 @@ export class ProductGallery extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { window.removeEventListener('resize', this.calculateGallerySize); } @@ -444,7 +443,7 @@ export class ProductGallery extends PureComponent { ); } - render() { + render(): ReactElement { return (
    { this.renderSlider() } diff --git a/packages/scandipwa/src/component/ProductGallery/ProductGallery.container.js b/packages/scandipwa/src/component/ProductGallery/ProductGallery.container.js index 484e2a3270..afbc7f8a9a 100644 --- a/packages/scandipwa/src/component/ProductGallery/ProductGallery.container.js +++ b/packages/scandipwa/src/component/ProductGallery/ProductGallery.container.js @@ -92,11 +92,11 @@ export class ProductGalleryContainer extends PureComponent { return { prevProdId: id, activeImage }; } - componentDidMount() { + componentDidMount(): void { this.cacheImages(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { product: { media_gallery_entries: mediaGallery = [] }, isZoomEnabled, @@ -128,7 +128,7 @@ export class ProductGalleryContainer extends PureComponent { const urls = []; variants.forEach(({ media_gallery_entries: mediaGallery = [] }) => { if (mediaGallery.length > 0) { - const { base: { url } = {} } = mediaGallery[0]; + const { base: { url } = {} } = mediaGallery[ 0 ]; urls.push(url); } }); @@ -183,8 +183,8 @@ export class ProductGalleryContainer extends PureComponent { areDetailsLoaded, product: { media_gallery_entries: mediaGallery = [], - [THUMBNAIL_KEY]: { url: thumbnailUrl } = {}, - [IMAGE_TYPE]: { url: imageTypeUrl } = {}, + [ THUMBNAIL_KEY ]: { url: thumbnailUrl } = {}, + [ IMAGE_TYPE ]: { url: imageTypeUrl } = {}, name } } = this.props; @@ -275,19 +275,19 @@ export class ProductGalleryContainer extends PureComponent { return ( - - { ({ registerSharedElementDestination }) => ( + + {({ registerSharedElementDestination }) => ( - ) } + )} ); diff --git a/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.js b/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.tsx similarity index 94% rename from packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.js rename to packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.tsx index b1d28c3ee2..f0e6b6661a 100644 --- a/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.js +++ b/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { TransformComponent } from 'react-zoom-pan-pinch'; import Image from 'Component/Image'; +import { ReactElement } from 'Type/Common.type'; /** @namespace Component/ProductGalleryBaseImage/Component */ export class ProductGalleryBaseImage extends PureComponent { @@ -22,7 +22,7 @@ export class ProductGalleryBaseImage extends PureComponent { alt: PropTypes.string.isRequired }; - render() { + render(): ReactElement { const { src, alt } = this.props; return ( diff --git a/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.container.js b/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.container.js index 68a615397d..0ee3d53f31 100644 --- a/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.container.js +++ b/packages/scandipwa/src/component/ProductGalleryBaseImage/ProductGalleryBaseImage.container.js @@ -53,7 +53,7 @@ export class ProductGalleryBaseImageContainer extends Component { return false; } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { scale, previousScale, @@ -104,7 +104,7 @@ export class ProductGalleryBaseImageContainer extends Component { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.js b/packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.tsx similarity index 97% rename from packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.js rename to packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.tsx index 29f9fea239..c97a948e7a 100644 --- a/packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.js +++ b/packages/scandipwa/src/component/ProductGalleryThumbnailImage/ProductGalleryThumbnailImage.component.tsx @@ -9,13 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Image from 'Component/Image'; import { IMAGE_TYPE, PLACEHOLDER_TYPE, THUMBNAIL_KEY, VIDEO_TYPE } from 'Component/ProductGallery/ProductGallery.config'; +import { ReactElement } from 'Type/Common.type'; import media, { PRODUCT_MEDIA } from 'Util/Media'; import './ProductGalleryThumbnailImage.style'; @@ -106,7 +106,7 @@ export class ProductGalleryThumbnailImage extends PureComponent { ); } - render() { + render(): ReactElement { return (
    - {__('Load previous')} + { __('Load previous') }
    ); } @@ -200,12 +199,12 @@ export class ProductList extends PureComponent { return (
    -

    {__('We are sorry!')}

    -

    {__('There were no products found matching your request.')}

    -

    {__('Please, try removing selected filters and try again!')}

    +

    { __('We are sorry!') }

    +

    { __('There were no products found matching your request.') }

    +

    { __('Please, try removing selected filters and try again!') }

    ); @@ -267,22 +266,22 @@ export class ProductList extends PureComponent { return ( ); } - renderProductPage([ key, items = [] ]) { + renderProductPage([key, items = []]) { const { selectedFilters } = this.props; const pageNumber = +key; @@ -311,8 +310,8 @@ export class ProductList extends PureComponent { return ( ); } @@ -325,11 +324,11 @@ export class ProductList extends PureComponent { } return ( -

    {title}

    +

    { title }

    ); } - render() { + render(): ReactElement { const { totalPages, isLoading, @@ -342,14 +341,14 @@ export class ProductList extends PureComponent { return (
    - {this.renderTitle()} - {this.renderLoadButton()} - {this.renderPages()} - {this.renderPagination()} + { this.renderTitle() } + { this.renderLoadButton() } + { this.renderPages() } + { this.renderPagination() }
    ); } diff --git a/packages/scandipwa/src/component/ProductList/ProductList.container.js b/packages/scandipwa/src/component/ProductList/ProductList.container.js index 691997acdb..95c79a358b 100644 --- a/packages/scandipwa/src/component/ProductList/ProductList.container.js +++ b/packages/scandipwa/src/component/ProductList/ProductList.container.js @@ -91,7 +91,7 @@ export class ProductListContainer extends PureComponent { pagesCount: 1 }; - componentDidMount() { + componentDidMount(): void { const { pages, isPreventRequest } = this.props; const { pagesCount } = this.state; const pagesLength = Object.keys(pages).length; @@ -106,7 +106,7 @@ export class ProductListContainer extends PureComponent { } } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { sort, search, @@ -144,15 +144,15 @@ export class ProductListContainer extends PureComponent { isEmptyFilter() { const { filter } = this.props; - const validFilters = Object.entries(filter).filter(([key, value]) => { + const validFilters = Object.entries(filter).filter(([ key, value ]) => { switch (key) { - case 'priceRange': - return value.min > 0 || value.max > 0; - case 'customFilters': - return Object.keys(value).length > 0; - case 'categoryIds': - default: - return true; + case 'priceRange': + return value.min > 0 || value.max > 0; + case 'customFilters': + return Object.keys(value).length > 0; + case 'categoryIds': + default: + return true; } }); @@ -332,8 +332,8 @@ export class ProductListContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/ProductListPage/ProductListPage.component.js b/packages/scandipwa/src/component/ProductListPage/ProductListPage.component.tsx similarity index 97% rename from packages/scandipwa/src/component/ProductListPage/ProductListPage.component.js rename to packages/scandipwa/src/component/ProductListPage/ProductListPage.component.tsx index bf7bdbd560..8770aabe47 100644 --- a/packages/scandipwa/src/component/ProductListPage/ProductListPage.component.js +++ b/packages/scandipwa/src/component/ProductListPage/ProductListPage.component.tsx @@ -9,14 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { withRouter } from 'react-router-dom'; import ProductCard from 'Component/ProductCard'; import { GRID_LAYOUT } from 'Route/CategoryPage/CategoryPage.config'; import { FilterType } from 'Type/Category.type'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; import { noopFn } from 'Util/Common'; @@ -59,15 +58,15 @@ export class ProductListPage extends PureComponent { siblingsHaveConfigurableOptions: false }; - componentDidMount() { + componentDidMount(): void { this.startObserving(); } - componentDidUpdate() { + componentDidUpdate(): void { this.startObserving(); } - componentWillUnmount() { + componentWillUnmount(): void { this.stopObserving(); } @@ -219,7 +218,7 @@ export class ProductListPage extends PureComponent { return this.renderPageItems(); } - render() { + render(): ReactElement { const { pageNumber, wrapperRef, diff --git a/packages/scandipwa/src/component/ProductPrice/ProductPrice.component.js b/packages/scandipwa/src/component/ProductPrice/ProductPrice.component.tsx similarity index 99% rename from packages/scandipwa/src/component/ProductPrice/ProductPrice.component.js rename to packages/scandipwa/src/component/ProductPrice/ProductPrice.component.tsx index c3afda2419..788d4b89ca 100644 --- a/packages/scandipwa/src/component/ProductPrice/ProductPrice.component.js +++ b/packages/scandipwa/src/component/ProductPrice/ProductPrice.component.tsx @@ -9,12 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import PRODUCT_TYPE from 'Component/Product/Product.config'; import TextPlaceholder from 'Component/TextPlaceholder'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import { OriginalPriceType, ProductPriceType } from 'Type/Price.type'; import { PriceConfiguration } from 'Type/ProductList.type'; @@ -415,7 +414,7 @@ export class ProductPrice extends PureComponent { ); } - render() { + render(): ReactElement { const { price: { finalPrice, diff --git a/packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.js b/packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.js rename to packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.tsx index 7879f29f50..c15c47ea38 100644 --- a/packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.js +++ b/packages/scandipwa/src/component/ProductReviewForm/ProductReviewForm.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import FieldGroup from 'Component//FieldGroup'; @@ -18,6 +17,7 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import Form from 'Component/Form'; import Loader from 'Component/Loader'; import ReviewStar from 'Component/ReviewStar'; +import { ReactElement } from 'Type/Common.type'; import { RatingItemsType } from 'Type/Rating.type'; import './ProductReviewForm.style'; @@ -180,7 +180,7 @@ export class ProductReviewForm extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, onReviewSubmitSuccess, diff --git a/packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.js b/packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.tsx similarity index 97% rename from packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.js rename to packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.tsx index 037feae6bc..f02e952c28 100644 --- a/packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.js +++ b/packages/scandipwa/src/component/ProductReviewItem/ProductReviewItem.component.tsx @@ -12,6 +12,7 @@ import { PureComponent } from 'react'; import ProductReviewRating from 'Component/ProductReviewRating'; +import { ReactElement } from 'Type/Common.type'; import { ReviewItemType } from 'Type/Rating.type'; import './ProductReviewItem.style'; @@ -73,7 +74,7 @@ export class ProductReviewItem extends PureComponent { ); } - render() { + render(): ReactElement { const { reviewItem, reviewItem: { diff --git a/packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.js b/packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.tsx similarity index 94% rename from packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.js rename to packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.tsx index d15e41180a..42881a2e94 100644 --- a/packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.js +++ b/packages/scandipwa/src/component/ProductReviewList/ProductReviewList.component.tsx @@ -12,6 +12,7 @@ import { PureComponent } from 'react'; import ProductReviewItem from 'Component/ProductReviewItem'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; import './ProductReviewList.style'; @@ -37,7 +38,7 @@ export class ProductReviewList extends PureComponent { )); } - render() { + render(): ReactElement { const { product } = this.props; const hasReviews = product.reviews && Object.keys(product.reviews).length > 0; diff --git a/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.js b/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.tsx similarity index 97% rename from packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.js rename to packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.tsx index 5b3a837312..538ee70481 100644 --- a/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.js +++ b/packages/scandipwa/src/component/ProductReviewRating/ProductReviewRating.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import { @@ -47,11 +46,11 @@ export class ProductReviewRating extends PureComponent { reviewRating = createRef(); - componentDidMount() { + componentDidMount(): void { this.updateRating(); } - componentDidUpdate() { + componentDidUpdate(): void { this.updateRating(); } @@ -97,7 +96,7 @@ export class ProductReviewRating extends PureComponent { return Array.from(Array(count), (_, i) => ); } - render() { + render(): ReactElement { const { summary, code, diff --git a/packages/scandipwa/src/component/ProductReviews/ProductReviews.component.js b/packages/scandipwa/src/component/ProductReviews/ProductReviews.component.tsx similarity index 98% rename from packages/scandipwa/src/component/ProductReviews/ProductReviews.component.js rename to packages/scandipwa/src/component/ProductReviews/ProductReviews.component.tsx index 0629f3985e..da2cd035a8 100644 --- a/packages/scandipwa/src/component/ProductReviews/ProductReviews.component.js +++ b/packages/scandipwa/src/component/ProductReviews/ProductReviews.component.tsx @@ -9,13 +9,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ContentWrapper from 'Component/ContentWrapper'; import ExpandableContent from 'Component/ExpandableContent'; import ProductReviewList from 'Component/ProductReviewList'; import ProductReviewRating from 'Component/ProductReviewRating'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import { ProductType } from 'Type/ProductList.type'; import { showNewReviewPopup } from 'Util/Product'; @@ -140,7 +140,7 @@ export class ProductReviews extends PureComponent { ); } - render() { + render(): ReactElement { const { areDetailsLoaded } = this.props; const heading = areDetailsLoaded ? __('Reviews') : ''; diff --git a/packages/scandipwa/src/component/ProductTab/ProductTab.component.js b/packages/scandipwa/src/component/ProductTab/ProductTab.component.tsx similarity index 94% rename from packages/scandipwa/src/component/ProductTab/ProductTab.component.js rename to packages/scandipwa/src/component/ProductTab/ProductTab.component.tsx index 7a328f949b..dbeaea2280 100644 --- a/packages/scandipwa/src/component/ProductTab/ProductTab.component.js +++ b/packages/scandipwa/src/component/ProductTab/ProductTab.component.tsx @@ -9,9 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; import './ProductTab.style'; @@ -36,7 +36,7 @@ export class ProductTab extends PureComponent { onClick(tabName); } - render() { + render(): ReactElement { const { tabName, isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/ProductTabs/ProductTabs.component.js b/packages/scandipwa/src/component/ProductTabs/ProductTabs.component.tsx similarity index 95% rename from packages/scandipwa/src/component/ProductTabs/ProductTabs.component.js rename to packages/scandipwa/src/component/ProductTabs/ProductTabs.component.tsx index 35b318cd86..a3de2e4c0e 100644 --- a/packages/scandipwa/src/component/ProductTabs/ProductTabs.component.js +++ b/packages/scandipwa/src/component/ProductTabs/ProductTabs.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ContentWrapper from 'Component/ContentWrapper'; import ProductTab from 'Component/ProductTab'; +import { ReactElement } from 'Type/Common.type'; import { isCrawler, isSSR } from 'Util/Browser'; import { isMobile } from 'Util/Mobile'; @@ -30,7 +30,7 @@ export class ProductTabs extends PureComponent { onTabClick = this.onTabClick.bind(this); - __construct(props) { + __construct(props): void { super.__construct(props); const { tabs: [{ id }] } = this.props; @@ -40,7 +40,7 @@ export class ProductTabs extends PureComponent { }; } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { tabs: prevTabs } = prevProps; const { tabs } = this.props; @@ -114,7 +114,7 @@ export class ProductTabs extends PureComponent { ); } - render() { + render(): ReactElement { return ( 0) { diff --git a/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.container.js b/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.container.js index 690b5ee8f3..1ef4f5db73 100644 --- a/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.container.js +++ b/packages/scandipwa/src/component/ProductWishlistButton/ProductWishlistButton.container.js @@ -74,7 +74,7 @@ export class ProductWishlistButtonContainer extends PureComponent { removeFromWishlist: this.toggleProductInWishlist.bind(this, false) }; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isAddingWishlistItem: isPrevAddingWishlistItem } = prevProps; const { isAddingWishlistItem } = this.props; @@ -102,7 +102,7 @@ export class ProductWishlistButtonContainer extends PureComponent { async toggleProductInWishlist(add = true) { const { magentoProduct, - magentoProduct: [{ sku }] = [], + magentoProduct: [ { sku } ] = [], showNotification, addProductToWishlist, removeProductFromWishlist, @@ -174,7 +174,7 @@ export class ProductWishlistButtonContainer extends PureComponent { isInWishlist() { const { magentoProduct = [] } = this.props; - const [{ sku: productSku }] = magentoProduct; + const [ { sku: productSku } ] = magentoProduct; if (!productSku) { return false; @@ -188,9 +188,9 @@ export class ProductWishlistButtonContainer extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.js b/packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.tsx similarity index 95% rename from packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.js rename to packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.tsx index 9c316decde..d31cf56c8d 100644 --- a/packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.js +++ b/packages/scandipwa/src/component/PurchaseOrder/PurchaseOrder.component.tsx @@ -10,12 +10,12 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import FieldGroup from 'Component/FieldGroup'; +import { ReactElement } from 'Type/Common.type'; import './PurchaseOrder.style'; @@ -25,7 +25,7 @@ export class PurchaseOrder extends PureComponent { id: PropTypes.string.isRequired }; - render() { + render(): ReactElement { const { id } = this.props; return ( diff --git a/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx index 033ca2ea63..a5a1dbec94 100644 --- a/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx +++ b/packages/scandipwa/src/component/RadioButtonIcon/RadioButtonIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { RadioButtonIconProps } from './RadioButtonIcon.type'; import './RadioButtonIcon.style'; @@ -21,7 +23,7 @@ export class RadioButton extends PureComponent { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.js b/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.tsx similarity index 98% rename from packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.js rename to packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.tsx index 2ed917b6b6..4e5afc4ad4 100644 --- a/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.js +++ b/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import React, { Component } from 'react'; import ProductCard from 'Component/ProductCard'; @@ -85,7 +84,7 @@ export class RecentlyViewedWidget extends Component { ); } - render() { + render(): ReactElement { const { products = [] } = this.props; if (!products.length) { diff --git a/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.container.js b/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.container.js index 428e95a730..85f1a1137d 100644 --- a/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.container.js +++ b/packages/scandipwa/src/component/RecentlyViewedWidget/RecentlyViewedWidget.container.js @@ -54,7 +54,7 @@ export class RecentlyViewedWidgetContainer extends PureComponent { siblingsHaveConfigurableOptions: false }; - componentDidMount() { + componentDidMount(): void { const { updateRecentViewedProductsInfo, recentProducts, @@ -81,7 +81,7 @@ export class RecentlyViewedWidgetContainer extends PureComponent { isLoading } = this.props; - const products = recentProducts[store] ?? []; + const products = recentProducts[ store ] ?? []; return { productCardFunctions: { @@ -105,7 +105,7 @@ export class RecentlyViewedWidgetContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.js b/packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.tsx similarity index 94% rename from packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.js rename to packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.tsx index 3c3ac6e25c..689c77de84 100644 --- a/packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.js +++ b/packages/scandipwa/src/component/RenderWhenVisible/RenderWhenVisible.component.tsx @@ -10,11 +10,10 @@ */ import 'intersection-observer'; -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { InView } from 'react-intersection-observer'; -import { ChildrenType } from 'Type/Common.type'; +import { ChildrenType, ReactElement } from 'Type/Common.type'; import { isCrawler, isSSR } from 'Util/Browser'; import { noopFn } from 'Util/Common'; @@ -37,7 +36,7 @@ export class RenderWhenVisible extends PureComponent { handleVisibilityToggle = this.handleVisibilityToggle.bind(this); - __construct(props) { + __construct(props): void { super.__construct(props); // a hack to determine if the element is on screen or not immediately @@ -57,7 +56,7 @@ export class RenderWhenVisible extends PureComponent { } } - shouldRender() { + shouldrender(): ReactElement { const { wasVisible } = this.state; return !wasVisible && !isSSR() && !isCrawler(); @@ -106,7 +105,7 @@ export class RenderWhenVisible extends PureComponent { return this.renderChildren(); } - render() { + render(): ReactElement { return (
    diff --git a/packages/scandipwa/src/component/Router/Router.container.js b/packages/scandipwa/src/component/Router/Router.container.js index cd4efa8493..7c28f5a66e 100644 --- a/packages/scandipwa/src/component/Router/Router.container.js +++ b/packages/scandipwa/src/component/Router/Router.container.js @@ -128,11 +128,11 @@ export class RouterContainer extends PureComponent { this.handleResize(); } - componentDidMount() { + componentDidMount(): void { window.addEventListener('resize', this.handleResize); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isLoading, updateMeta } = this.props; const { isLoading: prevIsLoading } = prevProps; @@ -163,7 +163,7 @@ export class RouterContainer extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { window.removeEventListener('resize', this.handleResize); } @@ -222,7 +222,7 @@ export class RouterContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/component/SearchField/SearchField.component.js b/packages/scandipwa/src/component/SearchField/SearchField.component.tsx similarity index 99% rename from packages/scandipwa/src/component/SearchField/SearchField.component.js rename to packages/scandipwa/src/component/SearchField/SearchField.component.tsx index 5cf42fbc44..defdefe52b 100644 --- a/packages/scandipwa/src/component/SearchField/SearchField.component.js +++ b/packages/scandipwa/src/component/SearchField/SearchField.component.tsx @@ -10,7 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, lazy, @@ -207,7 +206,7 @@ export class SearchField extends PureComponent { ); } - render() { + render(): ReactElement { const { isVisible, isActive diff --git a/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx b/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx index 0909418206..f442a51fde 100644 --- a/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx +++ b/packages/scandipwa/src/component/SearchIcon/SearchIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './SearchIcon.style'; /** @namespace Component/SearchIcon/Component */ export class SearchIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( { this.renderLink() } diff --git a/packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.js b/packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.tsx similarity index 96% rename from packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.js rename to packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.tsx index eb111ad391..6778cea4b7 100644 --- a/packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.js +++ b/packages/scandipwa/src/component/SearchOverlay/SearchOverlay.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Overlay from 'Component/Overlay'; import SearchItem from 'Component/SearchItem'; +import { ReactElement } from 'Type/Common.type'; import { ItemsType } from 'Type/ProductList.type'; import { @@ -38,7 +38,7 @@ export class SearchOverlay extends PureComponent { searchCriteria: '' }; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { searchCriteria: prevSearchCriteria } = prevProps; const { searchCriteria, clearSearchResults, makeSearchRequest } = this.props; @@ -83,7 +83,7 @@ export class SearchOverlay extends PureComponent { ); } - render() { + render(): ReactElement { const { isHideOverlay, searchCriteria } = this.props; if (!searchCriteria.trim()) { diff --git a/packages/scandipwa/src/component/ShareIcon/ShareIcon.component.tsx b/packages/scandipwa/src/component/ShareIcon/ShareIcon.component.tsx index 6eb4015fb5..33f6c22579 100644 --- a/packages/scandipwa/src/component/ShareIcon/ShareIcon.component.tsx +++ b/packages/scandipwa/src/component/ShareIcon/ShareIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { ShareIconProps } from './ShareIcon.type'; import './ShareIcon.style'; @@ -21,7 +23,7 @@ export class ShareIcon extends PureComponent { isPrimary: false }; - render(): JSX.Element { + render(): ReactElement { const { isPrimary } = this.props; return ( diff --git a/packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.js b/packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.tsx similarity index 97% rename from packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.js rename to packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.tsx index f99c93e7e1..888e9c2cb9 100644 --- a/packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.js +++ b/packages/scandipwa/src/component/ShareWishlistForm/ShareWishlistForm.component.tsx @@ -8,7 +8,6 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import FieldForm from 'Component/FieldForm'; import Loader from 'Component/Loader'; diff --git a/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.js b/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.tsx similarity index 94% rename from packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.js rename to packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.tsx index d4977649ea..aa714af522 100644 --- a/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.js +++ b/packages/scandipwa/src/component/ShareWishlistPopup/ShareWishlistPopup.component.tsx @@ -9,11 +9,11 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Popup from 'Component/Popup'; import ShareWishlistForm from 'Component/ShareWishlistForm'; +import { ReactElement } from 'Type/Common.type'; import { SHARE_WISHLIST_POPUP_ID } from './ShareWishlistPopup.config'; @@ -39,7 +39,7 @@ export class ShareWishlistPopup extends PureComponent { ); } - render() { + render(): ReactElement { return ( CSS.setVariable(sliderRef, 'sliderOpacity', '1'), 0); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { activeImage: prevActiveImage } = prevProps; const { activeImage } = this.props; @@ -557,7 +556,7 @@ export class Slider extends PureComponent { ); } - render() { + render(): ReactElement { const { mix } = this.props; return ( diff --git a/packages/scandipwa/src/component/SliderWidget/SliderWidget.component.js b/packages/scandipwa/src/component/SliderWidget/SliderWidget.component.tsx similarity index 97% rename from packages/scandipwa/src/component/SliderWidget/SliderWidget.component.js rename to packages/scandipwa/src/component/SliderWidget/SliderWidget.component.tsx index 0b691f3e4b..4cc7afb37d 100644 --- a/packages/scandipwa/src/component/SliderWidget/SliderWidget.component.js +++ b/packages/scandipwa/src/component/SliderWidget/SliderWidget.component.tsx @@ -10,13 +10,13 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Html from 'Component/Html'; import Image from 'Component/Image'; import Slider from 'Component/Slider'; import { DIRECTION_LEFT, DIRECTION_RIGHT } from 'Component/SliderWidget/SliderWidget.config'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import { debounce } from 'Util/Request'; @@ -55,7 +55,7 @@ export class SliderWidget extends PureComponent { onActiveImageChange = this.onActiveImageChange.bind(this); - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { slider: { slideSpeed, slides } } = this.props; const { slider: { slideSpeed: prevSlideSpeed } } = prevProps; @@ -152,7 +152,7 @@ export class SliderWidget extends PureComponent { ); } - render() { + render(): ReactElement { const { activeImage } = this.state; const { slider: { slides, title: block } } = this.props; diff --git a/packages/scandipwa/src/component/SliderWidget/SliderWidget.container.js b/packages/scandipwa/src/component/SliderWidget/SliderWidget.container.js index 7856f33204..7ef1bb39d1 100644 --- a/packages/scandipwa/src/component/SliderWidget/SliderWidget.container.js +++ b/packages/scandipwa/src/component/SliderWidget/SliderWidget.container.js @@ -40,7 +40,7 @@ export class SliderWidgetContainer extends DataContainer { state = { slider: { slideSpeed: 0, - slides: [{ image: '', slide_text: '', isPlaceholder: true }] + slides: [ { image: '', slide_text: '', isPlaceholder: true } ] } }; @@ -50,11 +50,11 @@ export class SliderWidgetContainer extends DataContainer { super.__construct(props, `SliderWidgetContainer-${sliderId}`); } - componentDidMount() { + componentDidMount(): void { this.requestSlider(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { sliderId } = this.props; const { sliderId: pSliderId } = prevProps; @@ -74,7 +74,7 @@ export class SliderWidgetContainer extends DataContainer { const { sliderId, showNotification, isOffline } = this.props; this.fetchData( - [SliderQuery.getQuery({ sliderId })], + [ SliderQuery.getQuery({ sliderId }) ], ({ slider }) => this.setState({ slider }), (e) => showNotification('error', __('Error fetching Slider!'), e), isOffline @@ -90,7 +90,7 @@ export class SliderWidgetContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx b/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx index fe23c4571f..c146819c35 100644 --- a/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx +++ b/packages/scandipwa/src/component/StarIcon/StarIcon.component.tsx @@ -11,6 +11,8 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import { StartFill } from './StarIcon.config'; import { StarIconProps } from './StarIcon.type'; @@ -18,7 +20,7 @@ import './StarIcon.style'; /** @namespace Component/StarIcon/Component */ export class AddIcon extends PureComponent { - getStarPath(): JSX.Element | null { + getStarPath(): ReactElement { const { starFill } = this.props; if (starFill === StartFill.EMPTY) { @@ -42,7 +44,7 @@ export class AddIcon extends PureComponent { return null; } - render(): JSX.Element { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.js b/packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.tsx similarity index 97% rename from packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.js rename to packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.tsx index 8a0340e0e6..b48fd9b7b3 100644 --- a/packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.js +++ b/packages/scandipwa/src/component/StoreInPickUpStore/StoreInPickUpStore.component.tsx @@ -9,10 +9,10 @@ * @link https://github.com/scandipwa/scandipwa */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Html from 'Component/Html'; +import { ReactElement } from 'Type/Common.type'; import './StoreInPickUpStore.style'; @@ -54,7 +54,7 @@ export class StoreInPickUpStoreComponent extends PureComponent { ); } - render() { + render(): ReactElement { const { store: { city, diff --git a/packages/scandipwa/src/component/StoreItem/StoreItem.component.js b/packages/scandipwa/src/component/StoreItem/StoreItem.component.tsx similarity index 92% rename from packages/scandipwa/src/component/StoreItem/StoreItem.component.js rename to packages/scandipwa/src/component/StoreItem/StoreItem.component.tsx index 1ecb572d2c..ec2a232083 100644 --- a/packages/scandipwa/src/component/StoreItem/StoreItem.component.js +++ b/packages/scandipwa/src/component/StoreItem/StoreItem.component.tsx @@ -9,9 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { StoreItemType } from 'Type/Config.type'; import './StoreItem.style'; @@ -23,7 +23,7 @@ export class StoreItem extends PureComponent { getStoreCode: PropTypes.func.isRequired }; - render() { + render(): ReactElement { const { item: { label }, getStoreCode diff --git a/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.js b/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.tsx similarity index 97% rename from packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.js rename to packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.tsx index 2835ec0305..7f8ee3a9ae 100644 --- a/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.js +++ b/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; @@ -18,6 +17,7 @@ import ClickOutside from 'Component/ClickOutside'; import Field from 'Component/Field'; import FIELD_TYPE from 'Component/Field/Field.config'; import StoreItem from 'Component/StoreItem'; +import { ReactElement } from 'Type/Common.type'; import { DeviceType } from 'Type/Device.type'; import './StoreSwitcher.style'; @@ -114,7 +114,7 @@ export class StoreSwitcher extends PureComponent { ); } - render() { + render(): ReactElement { const { storeList, device } = this.props; if (storeList.length <= 1) { diff --git a/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.container.js b/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.container.js index 5d4afef651..2346748042 100644 --- a/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.container.js +++ b/packages/scandipwa/src/component/StoreSwitcher/StoreSwitcher.container.js @@ -58,11 +58,11 @@ export class StoreSwitcherContainer extends DataContainer { super.__construct(props, 'StoreSwitcherContainer'); } - componentDidMount() { + componentDidMount(): void { this._getStoreList(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { currentStoreCode } = this.props; const { prevStoreCode } = prevProps; const { storeLabel, storeList } = this.state; @@ -101,7 +101,7 @@ export class StoreSwitcherContainer extends DataContainer { _getStoreList() { this.fetchData( - [ConfigQuery.getStoreListField()], + [ ConfigQuery.getStoreListField() ], ({ storeList }) => this.setState({ storeList: this._formatStoreList(storeList) }) @@ -119,7 +119,7 @@ export class StoreSwitcherContainer extends DataContainer { return [ ...acc, { - id: `store_${ code }`, + id: `store_${code}`, value: code, storeUrl: base_url, storeLinkUrl: base_link_url, @@ -166,8 +166,8 @@ export class StoreSwitcherContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.js b/packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.tsx similarity index 98% rename from packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.js rename to packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.tsx index ddcde68e99..057b4bf3d5 100644 --- a/packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.js +++ b/packages/scandipwa/src/component/SwipeToDelete/SwipeToDelete.component.tsx @@ -9,7 +9,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; import Draggable from 'Component/Draggable'; @@ -52,7 +51,7 @@ export class SwipeToDelete extends PureComponent { handleDrag = this.handleDrag.bind(this); - componentDidMount() { + componentDidMount(): void { // Sets default style this.setTranslateXStyle(0); this.setRightSideContentWidth(); @@ -219,7 +218,7 @@ export class SwipeToDelete extends PureComponent { ); } - render() { + render(): ReactElement { const { topElemMix, isLoading } = this.props; const { isAheadRemoveItemThreshold } = this.state; diff --git a/packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.js b/packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.tsx similarity index 92% rename from packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.js rename to packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.tsx index 0cae186ccd..0722deafc7 100644 --- a/packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.js +++ b/packages/scandipwa/src/component/TextPlaceholder/TextPlaceholder.component.tsx @@ -9,10 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { MixType } from 'Type/Common.type'; +import { MixType, ReactElement } from 'Type/Common.type'; import './TextPlaceholder.style'; @@ -45,7 +44,7 @@ export class TextPlaceholder extends PureComponent { mix: {} }; - render() { + render(): ReactElement { const { content, length, mix } = this.props; if (content) { diff --git a/packages/scandipwa/src/component/TierPrices/TierPrices.component.js b/packages/scandipwa/src/component/TierPrices/TierPrices.component.tsx similarity index 98% rename from packages/scandipwa/src/component/TierPrices/TierPrices.component.js rename to packages/scandipwa/src/component/TierPrices/TierPrices.component.tsx index 4ea01f41ae..8200cc07f8 100644 --- a/packages/scandipwa/src/component/TierPrices/TierPrices.component.js +++ b/packages/scandipwa/src/component/TierPrices/TierPrices.component.tsx @@ -8,10 +8,11 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { PureComponent } from 'react'; import PRODUCT_TYPE from 'Component/Product/Product.config'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; import { formatPrice, getLowestPriceTiersPrice } from 'Util/Price'; @@ -154,7 +155,7 @@ export class TierPrices extends PureComponent { return this.renderDetailedTierPriceList(); } - render() { + render(): ReactElement { const { product, product: { price_tiers = [] } } = this.props; if (!price_tiers || Object.keys(product).length <= 0 || !price_tiers.length) { diff --git a/packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.js b/packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.tsx similarity index 96% rename from packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.js rename to packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.tsx index 3015c2a46a..f54cc517bb 100644 --- a/packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.js +++ b/packages/scandipwa/src/component/TranslateOnCursorMove/TranslateOnCursorMove.component.tsx @@ -8,7 +8,7 @@ * @package scandipwa/base-theme * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; + import { createRef, PureComponent } from 'react'; import { ChildrenType } from 'Type/Common.type'; @@ -34,11 +34,11 @@ export class TranslateOnCursorMove extends PureComponent { handleMouseMove = this.handleMouseMove.bind(this); - componentDidMount() { + componentDidMount(): void { window.addEventListener('resize', this.handleLoad); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { activeImageId } = this.props; const { activeImageId: prevActiveImageId } = prevProps; @@ -47,7 +47,7 @@ export class TranslateOnCursorMove extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { window.removeEventListener('resize', this.handleLoad); CSS.setVariable(this.ref, 'translateYOnCursorMove', '0'); } @@ -114,7 +114,7 @@ export class TranslateOnCursorMove extends PureComponent { target.style.transform = `translateY(-${translate}px)`; } - render() { + render(): ReactElement { const { children, isMobile } = this.props; if (isMobile) { diff --git a/packages/scandipwa/src/component/UploadIcon/UploadIcon.component.tsx b/packages/scandipwa/src/component/UploadIcon/UploadIcon.component.tsx index 9afc6633a5..900bec4db2 100644 --- a/packages/scandipwa/src/component/UploadIcon/UploadIcon.component.tsx +++ b/packages/scandipwa/src/component/UploadIcon/UploadIcon.component.tsx @@ -11,11 +11,13 @@ import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; + import './UploadIcon.style'; /** @namespace Component/UploadIcon/Component */ export class UploadIcon extends PureComponent { - render(): JSX.Element { + render(): ReactElement { return ( { isActive: false }; - render(): JSX.Element { + render(): ReactElement { const { isActive } = this.props; return ( diff --git a/packages/scandipwa/src/component/VideoPopup/VideoPopup.component.js b/packages/scandipwa/src/component/VideoPopup/VideoPopup.component.tsx similarity index 96% rename from packages/scandipwa/src/component/VideoPopup/VideoPopup.component.js rename to packages/scandipwa/src/component/VideoPopup/VideoPopup.component.tsx index 27c5d24b37..04e8d71044 100644 --- a/packages/scandipwa/src/component/VideoPopup/VideoPopup.component.js +++ b/packages/scandipwa/src/component/VideoPopup/VideoPopup.component.tsx @@ -14,6 +14,7 @@ import { PureComponent } from 'react'; import Popup from 'Component/Popup'; +import { ReactElement } from 'Type/Common.type'; import { MediaItemType } from 'Type/ProductList.type'; import { makeCancelable } from 'Util/Promise'; @@ -31,7 +32,7 @@ export class VideoPopup extends PureComponent { payload: MediaItemType.isRequired }; - componentDidMount() { + componentDidMount(): void { this.loadVimeoLibrary(); this.loadYouTubeLibrary(); @@ -44,7 +45,7 @@ export class VideoPopup extends PureComponent { ); } - componentWillUnmount() { + componentWillUnmount(): void { if (this.youTubePromise) { this.youTubePromise.cancel(); } @@ -154,7 +155,7 @@ export class VideoPopup extends PureComponent { return null; } - render() { + render(): ReactElement { return (
    diff --git a/packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.js b/packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.tsx similarity index 96% rename from packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.js rename to packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.tsx index caa4e7314b..de339cf058 100644 --- a/packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.js +++ b/packages/scandipwa/src/component/VideoThumbnail/VideoThumbnail.component.tsx @@ -11,10 +11,10 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Image from 'Component/Image/Image.container'; +import { ReactElement } from 'Type/Common.type'; import { MediaItemType } from 'Type/ProductList.type'; import './VideoThumbnail.style'; @@ -40,7 +40,7 @@ export class VideoThumbnail extends PureComponent { ); } - render() { + render(): ReactElement { const { media: { thumbnail: { url }, diff --git a/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.js b/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.tsx similarity index 98% rename from packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.js rename to packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.tsx index b3993c0796..a48da215e4 100644 --- a/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.js +++ b/packages/scandipwa/src/component/WidgetFactory/WidgetFactory.component.tsx @@ -11,7 +11,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { lazy, PureComponent, Suspense } from 'react'; import RenderWhenVisible from 'Component/RenderWhenVisible'; @@ -116,7 +115,7 @@ export class WidgetFactory extends PureComponent { return fallback(); } - render() { + render(): ReactElement { return ( { this.renderContent() } diff --git a/packages/scandipwa/src/component/WishlistItem/WishlistItem.component.js b/packages/scandipwa/src/component/WishlistItem/WishlistItem.component.tsx similarity index 99% rename from packages/scandipwa/src/component/WishlistItem/WishlistItem.component.js rename to packages/scandipwa/src/component/WishlistItem/WishlistItem.component.tsx index 82083f2cf9..89b6efc2b2 100644 --- a/packages/scandipwa/src/component/WishlistItem/WishlistItem.component.js +++ b/packages/scandipwa/src/component/WishlistItem/WishlistItem.component.tsx @@ -10,7 +10,6 @@ * @link https://github.com/scandipwa/base-theme */ -import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import CloseIcon from 'Component/CloseIcon'; @@ -20,6 +19,7 @@ import FIELD_TYPE from 'Component/Field/Field.config'; import PRODUCT_TYPE from 'Component/Product/Product.config'; import ProductCard from 'Component/ProductCard'; import ProductReviewRating from 'Component/ProductReviewRating'; +import { ReactElement } from 'Type/Common.type'; import { ProductType } from 'Type/ProductList.type'; import { noopFn } from 'Util/Common'; @@ -451,7 +451,7 @@ export class WishlistItem extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading, isRemoving } = this.props; const product = this.getWishlistProduct(); diff --git a/packages/scandipwa/src/route/CartPage/CartPage.container.js b/packages/scandipwa/src/route/CartPage/CartPage.container.js index 7cb2d02a44..cbeac1ea6c 100644 --- a/packages/scandipwa/src/route/CartPage/CartPage.container.js +++ b/packages/scandipwa/src/route/CartPage/CartPage.container.js @@ -56,7 +56,7 @@ export const CartDispatcher = import( /** @namespace Route/CartPage/Container/mapStateToProps */ export const mapStateToProps = (state) => ({ totals: state.CartReducer.cartTotals, - headerState: state.NavigationReducer[TOP_NAVIGATION_TYPE].navigationState, + headerState: state.NavigationReducer[ TOP_NAVIGATION_TYPE ].navigationState, guest_checkout: state.ConfigReducer.guest_checkout, device: state.ConfigReducer.device, cartDisplayConfig: state.ConfigReducer.cartDisplayConfig, @@ -105,7 +105,7 @@ export class CartPageContainer extends PureComponent { isCartItemLoading: false }; - componentDidMount() { + componentDidMount(): void { const { updateMeta } = this.props; updateMeta({ title: __('Cart') }); @@ -115,7 +115,7 @@ export class CartPageContainer extends PureComponent { this._updateCrossSellProducts(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { changeHeaderState, totals: { items_qty = 0 }, @@ -258,8 +258,8 @@ export class CartPageContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js b/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js index 1ef090b649..00381aa97c 100644 --- a/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js +++ b/packages/scandipwa/src/route/CategoryPage/CategoryPage.container.js @@ -224,7 +224,7 @@ export class CategoryPageContainer extends PureComponent { return update; } - componentDidMount() { + componentDidMount(): void { const { categoryIds, category: { @@ -267,7 +267,7 @@ export class CategoryPageContainer extends PureComponent { } } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isOffline, categoryIds, diff --git a/packages/scandipwa/src/route/Checkout/Checkout.component.js b/packages/scandipwa/src/route/Checkout/Checkout.component.js index 306b1bc826..e2b663fe85 100644 --- a/packages/scandipwa/src/route/Checkout/Checkout.component.js +++ b/packages/scandipwa/src/route/Checkout/Checkout.component.js @@ -125,21 +125,21 @@ export class Checkout extends PureComponent { }; stepMap = { - [SHIPPING_STEP]: { + [ SHIPPING_STEP ]: { number: 1, title: __('Personal information'), url: '/shipping', render: this.renderShippingStep.bind(this), areTotalsVisible: true }, - [BILLING_STEP]: { + [ BILLING_STEP ]: { number: 2, title: __('Payment'), url: '/billing', render: this.renderBillingStep.bind(this), areTotalsVisible: true }, - [DETAILS_STEP]: { + [ DETAILS_STEP ]: { title: __('Thank you for your purchase!'), mobileTitle: __('Order details'), url: '/success', @@ -150,16 +150,16 @@ export class Checkout extends PureComponent { stepsCount = 2; - componentDidMount() { + componentDidMount(): void { const { checkoutStep, history } = this.props; - const { url } = this.stepMap[checkoutStep]; + const { url } = this.stepMap[ checkoutStep ]; this.updateHeader(); - history.replace(appendWithStoreCode(`${ CHECKOUT_URL }${ url }`)); + history.replace(appendWithStoreCode(`${CHECKOUT_URL}${url}`)); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { checkoutStep } = this.props; const { checkoutStep: prevCheckoutStep } = prevProps; @@ -171,7 +171,7 @@ export class Checkout extends PureComponent { updateHeader() { const { setHeaderState, checkoutStep, goBack } = this.props; - const { mobileTitle, title } = this.stepMap[checkoutStep]; + const { mobileTitle, title } = this.stepMap[ checkoutStep ]; setHeaderState({ name: checkoutStep === DETAILS_STEP ? CHECKOUT_SUCCESS : CHECKOUT, @@ -182,20 +182,20 @@ export class Checkout extends PureComponent { updateStep() { const { checkoutStep, history } = this.props; - const { url } = this.stepMap[checkoutStep]; + const { url } = this.stepMap[ checkoutStep ]; - history.push(appendWithStoreCode(`${ CHECKOUT_URL }${ url }`)); + history.push(appendWithStoreCode(`${CHECKOUT_URL}${url}`)); scrollToTop({ behavior: 'smooth' }); } renderTitle() { const { checkoutStep, totals: { is_virtual } } = this.props; - const { title = '', number } = this.stepMap[checkoutStep]; + const { title = '', number } = this.stepMap[ checkoutStep ]; if (is_virtual || !number) { return (
    -
    { title }
    +
    {title}
    ); } @@ -203,15 +203,15 @@ export class Checkout extends PureComponent { return (
    -
    { title }
    +
    {title}
    - { number } + {number} / - { this.stepsCount } + {this.stepsCount}
    -
    +
    ); } @@ -234,12 +234,12 @@ export class Checkout extends PureComponent { return ( ); } @@ -264,23 +264,23 @@ export class Checkout extends PureComponent { } = this.props; return ( - }> + }> ); @@ -297,14 +297,14 @@ export class Checkout extends PureComponent { } = this.props; return ( - }> + }> ); @@ -322,13 +322,13 @@ export class Checkout extends PureComponent { } = this.props; return ( - }> + }> ); @@ -346,18 +346,18 @@ export class Checkout extends PureComponent { return ( - + ); } renderStep() { const { checkoutStep } = this.props; - const { render } = this.stepMap[checkoutStep]; + const { render } = this.stepMap[ checkoutStep ]; if (render) { return render(); @@ -369,7 +369,7 @@ export class Checkout extends PureComponent { renderLoader() { const { isLoading } = this.props; - return ; + return ; } renderSummary(showOnMobile = false) { @@ -380,7 +380,7 @@ export class Checkout extends PureComponent { isMobile, onCouponCodeUpdate } = this.props; - const { areTotalsVisible } = this.stepMap[checkoutStep]; + const { areTotalsVisible } = this.stepMap[ checkoutStep ]; const { renderPromo } = this.renderPromo(true); if (!areTotalsVisible || (showOnMobile && !isMobile) || (!showOnMobile && isMobile)) { @@ -390,15 +390,15 @@ export class Checkout extends PureComponent { return ( <> - { !showOnMobile && this.renderDiscountCode() } + {!showOnMobile && this.renderDiscountCode()} ); } @@ -413,7 +413,7 @@ export class Checkout extends PureComponent { const { checkout_content: { - [isBilling ? 'checkout_billing_cms' : 'checkout_shipping_cms']: promo + [ isBilling ? 'checkout_billing_cms' : 'checkout_shipping_cms' ]: promo } = {} } = window.contentConfiguration; @@ -423,7 +423,7 @@ export class Checkout extends PureComponent { return (
    - +
    ); } @@ -449,28 +449,28 @@ export class Checkout extends PureComponent { return (
    ); @@ -480,23 +480,23 @@ export class Checkout extends PureComponent { return (
    - { this.renderSummary(true) } + {this.renderSummary(true)}
    - { this.renderTitle() } - { this.renderStoreInPickUpMethod() } - { this.renderGuestForm() } - { this.renderStep() } - { this.renderLoader() } + {this.renderTitle()} + {this.renderStoreInPickUpMethod()} + {this.renderGuestForm()} + {this.renderStep()} + {this.renderLoader()}
    - }> - { this.renderSummary() } - { this.renderPromo() } + }> + {this.renderSummary()} + {this.renderPromo()}
    diff --git a/packages/scandipwa/src/route/Checkout/Checkout.container.js b/packages/scandipwa/src/route/Checkout/Checkout.container.js index c026e582c3..366f73ef40 100644 --- a/packages/scandipwa/src/route/Checkout/Checkout.container.js +++ b/packages/scandipwa/src/route/Checkout/Checkout.container.js @@ -214,7 +214,7 @@ export class CheckoutContainer extends PureComponent { } } - componentDidMount() { + componentDidMount(): void { const { history, showInfoNotification, @@ -250,7 +250,7 @@ export class CheckoutContainer extends PureComponent { updateMeta({ title: __('Checkout') }); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { match: { params: { step: urlStep } }, isEmailAvailable, updateEmail } = this.props; const { match: { params: { step: prevUrlStep } } } = prevProps; const { email } = this.state; @@ -278,7 +278,7 @@ export class CheckoutContainer extends PureComponent { return null; } - componentWillUnmount() { + componentWillUnmount(): void { const { toggleBreadcrumbs } = this.props; toggleBreadcrumbs(true); } @@ -790,7 +790,7 @@ export class CheckoutContainer extends PureComponent { guest_cart_id, payment_method: { code, - [code]: additional_data, + [ code ]: additional_data, purchase_order_number } })); @@ -807,8 +807,8 @@ export class CheckoutContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/CmsPage/CmsPage.container.js b/packages/scandipwa/src/route/CmsPage/CmsPage.container.js index d460eb9460..941dfefcd5 100644 --- a/packages/scandipwa/src/route/CmsPage/CmsPage.container.js +++ b/packages/scandipwa/src/route/CmsPage/CmsPage.container.js @@ -115,7 +115,7 @@ export class CmsPageContainer extends DataContainer { }; } - componentDidMount() { + componentDidMount(): void { const { isOffline, isOnlyPlaceholder @@ -134,7 +134,7 @@ export class CmsPageContainer extends DataContainer { } } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { location: { pathname }, pageIdentifiers, @@ -239,7 +239,7 @@ export class CmsPageContainer extends DataContainer { this.setState({ isLoading: true }); this.fetchData( - [CmsPageQuery.getQuery(params)], + [ CmsPageQuery.getQuery(params) ], this.onPageLoad.bind(this), () => this.setState({ isLoading: false }), isOffline @@ -249,7 +249,7 @@ export class CmsPageContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/route/ConfirmAccountPage/ConfirmAccountPage.container.js b/packages/scandipwa/src/route/ConfirmAccountPage/ConfirmAccountPage.container.js index 2e07eecc3b..5b267346d2 100644 --- a/packages/scandipwa/src/route/ConfirmAccountPage/ConfirmAccountPage.container.js +++ b/packages/scandipwa/src/route/ConfirmAccountPage/ConfirmAccountPage.container.js @@ -76,7 +76,7 @@ export class ConfirmAccountPageContainer extends PureComponent { }; } - componentDidMount() { + componentDidMount(): void { const { updateMeta, toggleBreadcrumbs } = this.props; if (isSignedIn()) { @@ -157,8 +157,8 @@ export class ConfirmAccountPageContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/ContactPage/ContactPage.container.js b/packages/scandipwa/src/route/ContactPage/ContactPage.container.js index b0bb9a2387..b87f3ee9aa 100644 --- a/packages/scandipwa/src/route/ContactPage/ContactPage.container.js +++ b/packages/scandipwa/src/route/ContactPage/ContactPage.container.js @@ -63,7 +63,7 @@ export class ContactPageContainer extends DataContainer { this.updateBreadcrumbs(); } - componentDidMount() { + componentDidMount(): void { this.updateMeta(); this.updateBreadcrumbs(); this.updateHeader(); @@ -116,7 +116,7 @@ export class ContactPageContainer extends DataContainer { ({ contactPageConfig: { enabled } = {} }) => { this.setState({ isEnabled: enabled, isLoading: false }); }, - ([e]) => { + ([ e ]) => { this.setState({ isLoading: false }); showNotification(e.message); } @@ -126,7 +126,7 @@ export class ContactPageContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/route/CreateAccount/CreateAccount.container.js b/packages/scandipwa/src/route/CreateAccount/CreateAccount.container.js index 8523827a10..199ea284f4 100644 --- a/packages/scandipwa/src/route/CreateAccount/CreateAccount.container.js +++ b/packages/scandipwa/src/route/CreateAccount/CreateAccount.container.js @@ -64,7 +64,7 @@ export class CreateAccountContainer extends MyAccountOverlayContainer { onLoginClick: this.onLoginClick.bind(this) }; - componentDidMount() { + componentDidMount(): void { const { setHeaderState, toggleBreadcrumbs } = this.props; if (isSignedIn()) { @@ -79,7 +79,7 @@ export class CreateAccountContainer extends MyAccountOverlayContainer { name: CUSTOMER_SUB_ACCOUNT, title: __('Create account'), onBackClick: (e) => { - history.push({ pathname: appendWithStoreCode(`${ ACCOUNT_LOGIN_URL }`) }); + history.push({ pathname: appendWithStoreCode(`${ACCOUNT_LOGIN_URL}`) }); this.handleSignIn(e); } }); @@ -87,14 +87,14 @@ export class CreateAccountContainer extends MyAccountOverlayContainer { } onLoginClick() { - history.replace(appendWithStoreCode(`${ ACCOUNT_LOGIN_URL }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_LOGIN_URL}`)); } render() { return ( ); } diff --git a/packages/scandipwa/src/route/ForgotPassword/ForgotPassword.container.js b/packages/scandipwa/src/route/ForgotPassword/ForgotPassword.container.js index 0b247b8ebf..190a65ad07 100644 --- a/packages/scandipwa/src/route/ForgotPassword/ForgotPassword.container.js +++ b/packages/scandipwa/src/route/ForgotPassword/ForgotPassword.container.js @@ -55,7 +55,7 @@ export class ForgotPasswordContainer extends MyAccountOverlayContainer { onCreateAccountClick: this.onCreateAccountClick.bind(this) }; - componentDidMount() { + componentDidMount(): void { const { setHeaderState, toggleBreadcrumbs } = this.props; toggleBreadcrumbs(false); @@ -63,7 +63,7 @@ export class ForgotPasswordContainer extends MyAccountOverlayContainer { name: CUSTOMER_SUB_ACCOUNT, title: __('Forgot password'), onBackClick: (e) => { - history.push({ pathname: appendWithStoreCode(`${ ACCOUNT_LOGIN_URL }`) }); + history.push({ pathname: appendWithStoreCode(`${ACCOUNT_LOGIN_URL}`) }); this.handleSignIn(e); } }); @@ -71,18 +71,18 @@ export class ForgotPasswordContainer extends MyAccountOverlayContainer { } onLoginClick() { - history.replace(appendWithStoreCode(`${ ACCOUNT_LOGIN_URL }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_LOGIN_URL}`)); } onCreateAccountClick() { - history.replace(appendWithStoreCode(`${ ACCOUNT_REGISTRATION_URL }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_REGISTRATION_URL}`)); } render() { return ( ); } diff --git a/packages/scandipwa/src/route/HomePage/HomePage.container.js b/packages/scandipwa/src/route/HomePage/HomePage.container.js index 27c066eea5..a19942476b 100644 --- a/packages/scandipwa/src/route/HomePage/HomePage.container.js +++ b/packages/scandipwa/src/route/HomePage/HomePage.container.js @@ -42,7 +42,7 @@ export class HomePageContainer extends PureComponent { match: MatchType.isRequired }; - componentDidMount() { + componentDidMount(): void { const { changeHeaderState } = this.props; changeHeaderState({ @@ -71,7 +71,7 @@ export class HomePageContainer extends PureComponent { return (
    - +
    ); diff --git a/packages/scandipwa/src/route/LoginAccount/LoginAccount.container.js b/packages/scandipwa/src/route/LoginAccount/LoginAccount.container.js index ddcbe9d98b..fa95efe339 100644 --- a/packages/scandipwa/src/route/LoginAccount/LoginAccount.container.js +++ b/packages/scandipwa/src/route/LoginAccount/LoginAccount.container.js @@ -53,14 +53,14 @@ export class LoginAccountContainer extends MyAccountOverlayContainer { }; onCreateAccountClick() { - history.replace(appendWithStoreCode(`${ ACCOUNT_REGISTRATION_URL }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_REGISTRATION_URL}`)); } handleForgotPassword() { - history.replace(appendWithStoreCode(`${ ACCOUNT_FORGOT_PASSWORD_URL }`)); + history.replace(appendWithStoreCode(`${ACCOUNT_FORGOT_PASSWORD_URL}`)); } - componentDidMount() { + componentDidMount(): void { const { setHeaderState, toggleBreadcrumbs, @@ -81,7 +81,7 @@ export class LoginAccountContainer extends MyAccountOverlayContainer { scrollToTop({ behavior: 'smooth' }); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { if (isSignedIn()) { // remove login url from history to skip it when navigating back history.replace(appendWithStoreCode(ACCOUNT_URL)); @@ -95,8 +95,8 @@ export class LoginAccountContainer extends MyAccountOverlayContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/route/MenuPage/MenuPage.container.js b/packages/scandipwa/src/route/MenuPage/MenuPage.container.js index 0260619179..bb6e3b6f0e 100644 --- a/packages/scandipwa/src/route/MenuPage/MenuPage.container.js +++ b/packages/scandipwa/src/route/MenuPage/MenuPage.container.js @@ -45,7 +45,7 @@ export class MenuPageContainer extends PureComponent { this.redirectIfNotOnMobile(); } - componentDidMount() { + componentDidMount(): void { const { updateMeta, changeHeaderState } = this.props; updateMeta({ title: __('Menu') }); @@ -55,7 +55,7 @@ export class MenuPageContainer extends PureComponent { }); } - componentDidUpdate() { + componentDidUpdate(): void { this.redirectIfNotOnMobile(); } diff --git a/packages/scandipwa/src/route/MyAccount/MyAccount.container.js b/packages/scandipwa/src/route/MyAccount/MyAccount.container.js index 5f5e18be17..8f4c1b6236 100644 --- a/packages/scandipwa/src/route/MyAccount/MyAccount.container.js +++ b/packages/scandipwa/src/route/MyAccount/MyAccount.container.js @@ -108,42 +108,42 @@ export class MyAccountContainer extends PureComponent { }; static tabMap = { - [MY_ACCOUNT]: { + [ MY_ACCOUNT ]: { url: '', tabName: __('My Account'), section: FIRST_SECTION }, - [MY_ORDERS]: { + [ MY_ORDERS ]: { url: '/sales/order/history', tabName: __('My Orders'), section: FIRST_SECTION, isFullUrl: true }, - [MY_DOWNLOADABLE]: { + [ MY_DOWNLOADABLE ]: { url: '/downloadable/customer/products', tabName: __('My Downloadable'), section: FIRST_SECTION, isFullUrl: true }, - [MY_WISHLIST]: { + [ MY_WISHLIST ]: { url: '/wishlist', tabName: __('My Wish List'), section: FIRST_SECTION, isFullUrl: true }, - [ADDRESS_BOOK]: { + [ ADDRESS_BOOK ]: { url: '/customer/address', tabName: __('Address Book'), section: SECOND_SECTION, isFullUrl: true }, - [ACCOUNT_INFORMATION]: { + [ ACCOUNT_INFORMATION ]: { url: '/edit', tabName: __('Account Information'), title: __('Edit Account Information'), section: SECOND_SECTION }, - [NEWSLETTER_SUBSCRIPTION]: { + [ NEWSLETTER_SUBSCRIPTION ]: { url: '/newsletter/manage', tabName: __('Newsletter Subscription'), section: THIRD_SECTION, @@ -155,12 +155,12 @@ export class MyAccountContainer extends PureComponent { const { isWishlistEnabled, newsletterActive } = props; switch (tabName) { - case MY_WISHLIST: - return isWishlistEnabled; - case NEWSLETTER_SUBSCRIPTION: - return newsletterActive; - default: - return true; + case MY_WISHLIST: + return isWishlistEnabled; + case NEWSLETTER_SUBSCRIPTION: + return newsletterActive; + default: + return true; } } @@ -176,18 +176,18 @@ export class MyAccountContainer extends PureComponent { } = props; const { activeTab } = state; - if (this.tabMap[selectedTab] && isSignedIn()) { + if (this.tabMap[ selectedTab ] && isSignedIn()) { return { activeTab: selectedTab }; } // redirect to Dashboard, if user visited non-existent or disabled page - const newActiveTab = this.tabMap[historyActiveTab] && MyAccountContainer.isTabEnabled(props, historyActiveTab) + const newActiveTab = this.tabMap[ historyActiveTab ] && MyAccountContainer.isTabEnabled(props, historyActiveTab) ? historyActiveTab : MY_ACCOUNT; - const { url: activeTabUrl } = this.tabMap[newActiveTab]; + const { url: activeTabUrl } = this.tabMap[ newActiveTab ]; if (historyActiveTab !== newActiveTab && activeTab !== MY_ACCOUNT && isSignedIn() && !isMobile) { - history.push(appendWithStoreCode(`${ ACCOUNT_URL }${ activeTabUrl }`)); + history.push(appendWithStoreCode(`${ACCOUNT_URL}${activeTabUrl}`)); } if (activeTab !== newActiveTab) { @@ -207,7 +207,7 @@ export class MyAccountContainer extends PureComponent { }; subHeadingRenderMap = { - [MY_WISHLIST]: this.getMyWishlistSubHeading.bind(this) + [ MY_WISHLIST ]: this.getMyWishlistSubHeading.bind(this) }; __construct(props) { @@ -241,7 +241,7 @@ export class MyAccountContainer extends PureComponent { return MyAccountContainer.navigateToSelectedTab(props, state); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, prevState): void { const { wishlistItems: prevWishlistItems, IsSignedInFromState: prevIsSignedInFromState @@ -300,7 +300,7 @@ export class MyAccountContainer extends PureComponent { getSubHeading() { const { activeTab, stateSubHeading } = this.state; - const subHeadingFunc = this.subHeadingRenderMap[activeTab]; + const subHeadingFunc = this.subHeadingRenderMap[ activeTab ]; if (!subHeadingFunc) { return stateSubHeading; @@ -312,7 +312,7 @@ export class MyAccountContainer extends PureComponent { getTabName() { const { location: { pathname } } = this.props; const { tabName: stateTabName, activeTab } = this.state; - const { tabName, url } = MyAccountContainer.tabMap[activeTab]; + const { tabName, url } = MyAccountContainer.tabMap[ activeTab ]; if (!pathname.includes(url)) { return stateTabName; @@ -324,7 +324,7 @@ export class MyAccountContainer extends PureComponent { getMyWishlistSubHeading() { const count = this.getWishlistItemsCount(); - return ` (${ count })`; + return ` (${count})`; } getWishlistItemsCount() { @@ -338,7 +338,7 @@ export class MyAccountContainer extends PureComponent { getMyWishlistHeaderTitle() { const count = this.getWishlistItemsCount(); - return `${ count } ${ count === 1 ? __('item') : __('items') }`; + return `${count} ${count === 1 ? __('item') : __('items')}`; } // #endregion @@ -351,23 +351,23 @@ export class MyAccountContainer extends PureComponent { const { isWishlistEnabled, newsletterActive } = this.props; switch (tabName) { - case MY_WISHLIST: - return isWishlistEnabled; - case NEWSLETTER_SUBSCRIPTION: - return newsletterActive; - default: - return true; + case MY_WISHLIST: + return isWishlistEnabled; + case NEWSLETTER_SUBSCRIPTION: + return newsletterActive; + default: + return true; } } tabsFilterEnabled() { return Object.fromEntries(Object.entries(MyAccountContainer.tabMap) - .filter(([tabName]) => MyAccountContainer.isTabEnabled(this.props, tabName))); + .filter(([ tabName ]) => MyAccountContainer.isTabEnabled(this.props, tabName))); } changeActiveTab(activeTab) { const { - [activeTab]: { + [ activeTab ]: { url, isFullUrl = false } @@ -376,7 +376,7 @@ export class MyAccountContainer extends PureComponent { if (isFullUrl) { history.push(appendWithStoreCode(url)); } else { - history.push(appendWithStoreCode(`${ ACCOUNT_URL }${ url }`)); + history.push(appendWithStoreCode(`${ACCOUNT_URL}${url}`)); } this.changeMyAccountHeaderState(); @@ -451,12 +451,12 @@ export class MyAccountContainer extends PureComponent { updateBreadcrumbs() { const { updateBreadcrumbs } = this.props; const { activeTab } = this.state; - const { url, tabName, isFullUrl } = MyAccountContainer.tabMap[activeTab]; + const { url, tabName, isFullUrl } = MyAccountContainer.tabMap[ activeTab ]; const breadcrumbs = []; if (activeTab !== MY_ACCOUNT) { breadcrumbs.push({ - url: isFullUrl ? url : `${ ACCOUNT_URL }${ url }`, + url: isFullUrl ? url : `${ACCOUNT_URL}${url}`, name: tabName }); } @@ -507,9 +507,9 @@ export class MyAccountContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/NoMatch/NoMatch.component.js b/packages/scandipwa/src/route/NoMatch/NoMatch.component.js index 2064ad7c07..90fc202cbb 100644 --- a/packages/scandipwa/src/route/NoMatch/NoMatch.component.js +++ b/packages/scandipwa/src/route/NoMatch/NoMatch.component.js @@ -25,7 +25,7 @@ export class NoMatch extends PureComponent { cleanUpTransition: PropTypes.func.isRequired }; - componentDidMount() { + componentDidMount(): void { this.updateBreadcrumbs(); this.cleanUpTransition(); scrollToTop(); @@ -51,29 +51,29 @@ export class NoMatch extends PureComponent { render() { return ( -
    +

    404

    - { __('Page not found') } + {__('Page not found')}

    - { /* eslint-disable-next-line max-len */ } - { __('Sorry, we can`t find the page you are looking for! Please press a button below to go back to homepage.') } + { /* eslint-disable-next-line max-len */} + {__('Sorry, we can`t find the page you are looking for! Please press a button below to go back to homepage.')}

    - { __('Back to homepage') } + {__('Back to homepage')}
    diff --git a/packages/scandipwa/src/route/NoMatch/NoMatch.container.js b/packages/scandipwa/src/route/NoMatch/NoMatch.container.js index de8990a645..ddc1a5da8b 100644 --- a/packages/scandipwa/src/route/NoMatch/NoMatch.container.js +++ b/packages/scandipwa/src/route/NoMatch/NoMatch.container.js @@ -55,13 +55,13 @@ export class NoMatchContainer extends PureComponent { updateBreadcrumbs: PropTypes.func.isRequired }; - componentDidMount() { + componentDidMount(): void { this.updateHeaderState(); this.updateMeta(); this.updateNoMatch(); } - componentWillUnmount() { + componentWillUnmount(): void { const { updateNoMatch } = this.props; updateNoMatch(false); @@ -97,13 +97,13 @@ export class NoMatchContainer extends PureComponent { render() { return ( - - { ({ cleanUpTransition }) => ( + + {({ cleanUpTransition }) => ( - ) } + )} ); } diff --git a/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.component.js b/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.component.js index 505a21d863..4643a0bf05 100644 --- a/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.component.js +++ b/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.component.js @@ -26,11 +26,11 @@ export class NoMatchHandler extends PureComponent { location: LocationType.isRequired }; - componentDidMount() { + componentDidMount(): void { scrollToTop(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { location: { pathname: newPathname } } = this.props; const { location: { pathname } } = prevProps; @@ -40,7 +40,7 @@ export class NoMatchHandler extends PureComponent { } } - componentWillUnmount() { + componentWillUnmount(): void { const { noMatch, updateNoMatch diff --git a/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.container.js b/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.container.js index da2c0a230f..79a9928f41 100644 --- a/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.container.js +++ b/packages/scandipwa/src/route/NoMatchHandler/NoMatchHandler.container.js @@ -54,7 +54,7 @@ export class NoMatchHandlerContainer extends PureComponent { noMatch: false }; - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { noMatch, updateMeta } = this.props; const { noMatch: prevNoMatch } = prevProps; @@ -84,7 +84,7 @@ export class NoMatchHandlerContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.container.js b/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.container.js index 8b7ed9d89c..6ee8dd91dc 100644 --- a/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.container.js +++ b/packages/scandipwa/src/route/PasswordChangePage/PasswordChangePage.container.js @@ -105,14 +105,14 @@ export class PasswordChangePageContainer extends PureComponent { stateToBeUpdated.passwordResetStatus = passwordResetStatus; switch (passwordResetStatus) { - case STATUS_PASSWORD_UPDATED: - showNotification('success', __('Password has been successfully updated!')); - break; - case STATUS_PASSWORD_MISS_MATCH: - showNotification('info', __('Your password and confirmation password do not match.')); - break; - default: - showNotification('error', passwordResetMessage); + case STATUS_PASSWORD_UPDATED: + showNotification('success', __('Password has been successfully updated!')); + break; + case STATUS_PASSWORD_MISS_MATCH: + showNotification('info', __('Your password and confirmation password do not match.')); + break; + default: + showNotification('error', passwordResetMessage); } } @@ -124,7 +124,7 @@ export class PasswordChangePageContainer extends PureComponent { onError: this.onError.bind(this) }; - componentDidMount() { + componentDidMount(): void { const { setHeaderState } = this.props; this.updateMeta(); this.toggleBreadcrumbs(false); @@ -201,8 +201,8 @@ export class PasswordChangePageContainer extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/route/ProductComparePage/ProductComparePage.container.js b/packages/scandipwa/src/route/ProductComparePage/ProductComparePage.container.js index 9121f899ea..acafa2197e 100644 --- a/packages/scandipwa/src/route/ProductComparePage/ProductComparePage.container.js +++ b/packages/scandipwa/src/route/ProductComparePage/ProductComparePage.container.js @@ -61,7 +61,7 @@ export class ProductComparePageContainer extends DataContainer { super.__construct(props, 'ProductComparePageContainer'); } - componentDidMount() { + componentDidMount(): void { scrollToTop(); this.updateMeta(); this.updateBreadcrumbs(); @@ -104,7 +104,7 @@ export class ProductComparePageContainer extends DataContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/route/ProductPage/ProductPage.container.js b/packages/scandipwa/src/route/ProductPage/ProductPage.container.js index 9e69b754e6..74f8d29d35 100644 --- a/packages/scandipwa/src/route/ProductPage/ProductPage.container.js +++ b/packages/scandipwa/src/route/ProductPage/ProductPage.container.js @@ -157,9 +157,9 @@ export class ProductPageContainer extends PureComponent { } const parameters = Object.entries(convertQueryStringToKeyValuePairs(search)) - .reduce((acc, [key, value]) => { + .reduce((acc, [ key, value ]) => { if (key in configurable_options) { - return { ...acc, [key]: value }; + return { ...acc, [ key ]: value }; } return acc; @@ -181,7 +181,7 @@ export class ProductPageContainer extends PureComponent { }, []); const prevRequiredOptions = productOptionsData?.requiredOptions || []; - const requiredOptions = [...prevRequiredOptions, ...newOptionsData]; + const requiredOptions = [ ...prevRequiredOptions, ...newOptionsData ]; return { parameters, @@ -192,7 +192,7 @@ export class ProductPageContainer extends PureComponent { }; } - componentDidMount() { + componentDidMount(): void { /** * Always make sure the navigation switches into the MENU tab * */ @@ -217,7 +217,7 @@ export class ProductPageContainer extends PureComponent { scrollToTop(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isOffline, productSKU, @@ -347,7 +347,7 @@ export class ProductPageContainer extends PureComponent { }; if (key) { - obj[key] = value; + obj[ key ] = value; } const query = objectToUri(obj); @@ -432,9 +432,9 @@ export class ProductPageContainer extends PureComponent { const attributes = {}; Object.keys(productAttr).forEach((attr) => { - const { [attr]: { attribute_value: attrValue }, [attr]: currAttr } = productAttr; - const { [attr]: { attribute_value: activeAttrValue } = {} } = activeAttr; - attributes[attr] = { + const { [ attr ]: { attribute_value: attrValue }, [ attr ]: currAttr } = productAttr; + const { [ attr ]: { attribute_value: activeAttrValue } = {} } = activeAttr; + attributes[ attr ] = { ...currAttr, attribute_value: activeAttrValue || attrValue }; @@ -544,8 +544,8 @@ export class ProductPageContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/SearchPage/SearchPage.container.js b/packages/scandipwa/src/route/SearchPage/SearchPage.container.js index 7022e3fd8d..f7dcedf986 100644 --- a/packages/scandipwa/src/route/SearchPage/SearchPage.container.js +++ b/packages/scandipwa/src/route/SearchPage/SearchPage.container.js @@ -158,14 +158,14 @@ export class SearchPageContainer extends CategoryPageContainer { return search === currentSearch; } - componentDidMount() { + componentDidMount(): void { this.updateMeta(); this.updateBreadcrumbs(); this.updateHeaderState(); this.updateNavigationState(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { isOffline, match: { params: { query } } diff --git a/packages/scandipwa/src/route/SomethingWentWrong/SomethingWentWrong.container.js b/packages/scandipwa/src/route/SomethingWentWrong/SomethingWentWrong.container.js index 55c4c90bca..ec3e867b6b 100644 --- a/packages/scandipwa/src/route/SomethingWentWrong/SomethingWentWrong.container.js +++ b/packages/scandipwa/src/route/SomethingWentWrong/SomethingWentWrong.container.js @@ -31,7 +31,7 @@ export class SomethingWentWrongContainer extends PureComponent { errorDetails: ErrorDetailsType.isRequired }; - componentDidMount() { + componentDidMount(): void { const { updateMeta } = this.props; updateMeta({ title: __('Something went wrong!') }); @@ -46,7 +46,7 @@ export class SomethingWentWrongContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.container.js b/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.container.js index 5037198c8c..25dd0c1737 100755 --- a/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.container.js +++ b/packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.container.js @@ -48,7 +48,7 @@ export class StyleGuidePageContainer extends PureComponent { fakeFunction: this.fakeFunction.bind(this) }; - componentDidMount() { + componentDidMount(): void { const { updateProductDetails } = this.props; updateProductDetails(product); @@ -69,8 +69,8 @@ export class StyleGuidePageContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.container.js b/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.container.js index 07581544e4..e154f2d8d5 100644 --- a/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.container.js +++ b/packages/scandipwa/src/route/UrlRewrites/UrlRewrites.container.js @@ -82,11 +82,11 @@ export class UrlRewritesContainer extends PureComponent { this.requestUrlRewrite(); } - componentDidMount() { + componentDidMount(): void { this.initialUrl = location.pathname; } - componentDidUpdate() { + componentDidUpdate(): void { const { isLoading } = this.props; /** @@ -109,7 +109,7 @@ export class UrlRewritesContainer extends PureComponent { const type = this.getType(); - if ([TYPE_CATEGORY, TYPE_PRODUCT].includes(type)) { + if ([ TYPE_CATEGORY, TYPE_PRODUCT ].includes(type)) { if (location.pathname.endsWith('/')) { history.replace( location.pathname.slice(0, -1), @@ -137,51 +137,51 @@ export class UrlRewritesContainer extends PureComponent { const isLoading = this.getIsLoading(); switch (this.getType()) { - case TYPE_PRODUCT: - /** - * In case we are not yet sure what product ID it is: - * - check if there is a hint in browser history - * - fallback to none - */ - if (isLoading) { - const product = history?.state?.state?.product; - - if (product) { - const { sku: historySKU, id } = product; - - return { productSKU: historySKU, id }; + case TYPE_PRODUCT: + /** + * In case we are not yet sure what product ID it is: + * - check if there is a hint in browser history + * - fallback to none + */ + if (isLoading) { + const product = history?.state?.state?.product; + + if (product) { + const { sku: historySKU, id } = product; + + return { productSKU: historySKU, id }; + } + + return {}; } - return {}; - } - - return { productSKU: sku, id }; - case TYPE_CMS_PAGE: - if (isLoading) { - return { isOnlyPlaceholder: true }; - } - - return { pageIds: id }; - case TYPE_CATEGORY: - /** - * In case we are not yet sure what category ID it is: - * - check if there is a hint in browser history - * - fallback to none - */ - if (isLoading) { - const category = history?.state?.state?.category; + return { productSKU: sku, id }; + case TYPE_CMS_PAGE: + if (isLoading) { + return { isOnlyPlaceholder: true }; + } - if (category && category !== true) { - return { categoryIds: category }; + return { pageIds: id }; + case TYPE_CATEGORY: + /** + * In case we are not yet sure what category ID it is: + * - check if there is a hint in browser history + * - fallback to none + */ + if (isLoading) { + const category = history?.state?.state?.category; + + if (category && category !== true) { + return { categoryIds: category }; + } + + return {}; } + return { categoryIds: id }; + case TYPE_NOTFOUND: + default: return {}; - } - - return { categoryIds: id }; - case TYPE_NOTFOUND: - default: - return {}; } } @@ -228,10 +228,10 @@ export class UrlRewritesContainer extends PureComponent { */ if (this.getIsLoading()) { const state = history?.state?.state || {}; - const typeKey = Object.keys(state).find((key) => UrlRewritesContainer.stateMapping[key]); + const typeKey = Object.keys(state).find((key) => UrlRewritesContainer.stateMapping[ key ]); if (typeKey) { - return UrlRewritesContainer.stateMapping[typeKey]; + return UrlRewritesContainer.stateMapping[ typeKey ]; } /** @@ -260,7 +260,7 @@ export class UrlRewritesContainer extends PureComponent { render() { return ( ); } diff --git a/packages/scandipwa/src/route/WishlistSharedPage/WishlistSharedPage.container.js b/packages/scandipwa/src/route/WishlistSharedPage/WishlistSharedPage.container.js index 662cf7a1f9..663535ecac 100644 --- a/packages/scandipwa/src/route/WishlistSharedPage/WishlistSharedPage.container.js +++ b/packages/scandipwa/src/route/WishlistSharedPage/WishlistSharedPage.container.js @@ -65,11 +65,11 @@ export class WishlistSharedPageContainer extends MyAccountMyWishlistContainer { isLoading: false }; - componentDidMount() { + componentDidMount(): void { this.requestWishlist(); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps): void { const { match: { params: { code } } } = prevProps; if (this.getCode() !== code) { @@ -99,7 +99,7 @@ export class WishlistSharedPageContainer extends MyAccountMyWishlistContainer { const { showError, showNoMatch, updateBreadcrumbs } = this.props; const code = this.getCode(); - const query = prepareQuery([WishlistQuery.getWishlistQuery(code)]); + const query = prepareQuery([ WishlistQuery.getWishlistQuery(code) ]); updateBreadcrumbs([]); this.setLoading(); @@ -126,7 +126,7 @@ export class WishlistSharedPageContainer extends MyAccountMyWishlistContainer { return { ...prev, - [id]: { + [ id ]: { quantity, wishlist: { id, @@ -174,8 +174,8 @@ export class WishlistSharedPageContainer extends MyAccountMyWishlistContainer { render() { return ( ); } diff --git a/packages/scandipwa/src/type/Breadcrumbs.type.ts b/packages/scandipwa/src/type/Breadcrumbs.type.ts index 4e767991df..284e1cef89 100644 --- a/packages/scandipwa/src/type/Breadcrumbs.type.ts +++ b/packages/scandipwa/src/type/Breadcrumbs.type.ts @@ -15,5 +15,3 @@ export type Breadcrumb = { url: Url; name: string; }; - -export type Breadcrumbs = Breadcrumb[]; diff --git a/packages/scandipwa/src/type/Common.type.ts b/packages/scandipwa/src/type/Common.type.ts index f00c0b60bf..78ef7ccf08 100644 --- a/packages/scandipwa/src/type/Common.type.ts +++ b/packages/scandipwa/src/type/Common.type.ts @@ -9,6 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ +import { ReactNode } from 'react'; + export type Mods = Record; export type Mix = { @@ -17,9 +19,11 @@ export type Mix = { mods?: Mods; }; -export type Children = React.ReactNode[] | React.ReactNode; +export type ReactElement = ReactNode | ReactNode[]; + +export type Children = ReactNode[]; -export type Ref = () => void | { current: Element }; +export type Ref = () => void | { current: T }; // TODO unknown export type MetaTitle = string | unknown; diff --git a/packages/scandipwa/src/type/Layout.type.js b/packages/scandipwa/src/type/Layout.type.js deleted file mode 100644 index 43bb90c8d8..0000000000 --- a/packages/scandipwa/src/type/Layout.type.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * ScandiPWA - Progressive Web App for Magento - * - * Copyright © Scandiweb, Inc. All rights reserved. - * See LICENSE for license details. - * - * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) - * @package scandipwa/base-theme - * @link https://github.com/scandipwa/base-theme - */ - -import PropTypes from 'prop-types'; - -import { GRID_LAYOUT, LIST_LAYOUT } from 'Route/CategoryPage/CategoryPage.config'; - -// eslint-disable-next-line import/prefer-default-export -export const LayoutType = PropTypes.oneOf([GRID_LAYOUT, LIST_LAYOUT]); diff --git a/packages/scandipwa/src/type/Router.type.ts b/packages/scandipwa/src/type/Router.type.ts index 9090f218a8..fea32dea62 100644 --- a/packages/scandipwa/src/type/Router.type.ts +++ b/packages/scandipwa/src/type/Router.type.ts @@ -26,4 +26,8 @@ export type UrlRewrite = { notFound?: boolean; }; -export type Link = [string | unknown]; +export type UrlType = { + pathname: string; + search?: string; + state?: T; +}; diff --git a/yarn.lock b/yarn.lock index 90f19d432d..a7bb215bf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3425,6 +3425,11 @@ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.66.0.tgz#e90e1308ad103f2bd31b72c17b8031b4cec0713d" integrity sha512-ZfJck4M7nrGasfs4A4YbUoxis3Vu24cETw3DERsNYtDZmYSYtk6ljKexKFKhImO/ZmY6ZMsmegu2FPkXoUFImA== +"@types/webpack-env@^1.16.3": + version "1.16.3" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.16.3.tgz#b776327a73e561b71e7881d0cd6d34a1424db86a" + integrity sha512-9gtOPPkfyNoEqCQgx4qJKkuNm/x0R2hKR7fdl7zvTJyHnIisuE/LfvXOsYWL0o3qq6uiBnKZNNNzi3l0y/X+xw== + "@types/webpack-sources@*": version "3.2.0" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b" From c8280b8fc1f7f177c99999678b38c1c44ce0f8c4 Mon Sep 17 00:00:00 2001 From: Zans Laksa Date: Sat, 16 Apr 2022 03:04:33 +0300 Subject: [PATCH 035/192] Migrated some components --- .../component/AddIcon/AddIcon.component.tsx | 4 +- .../src/component/AddIcon/AddIcon.type.ts | 2 +- ...t.container.js => AddToCart.container.tsx} | 3 +- .../src/component/App/App.component.tsx | 4 +- ...container.js => Breadcrumbs.container.tsx} | 0 .../CarouselScroll.component.tsx | 16 +- .../CarouselScroll/CarouselScroll.type.ts | 7 +- .../CarouselScrollArrow.component.tsx | 11 +- ...r.js => CarouselScrollArrow.container.tsx} | 7 +- .../CarouselScrollArrow.type.ts | 17 + .../CarouselScrollItem.component.tsx | 13 +- ...er.js => CarouselScrollItem.container.tsx} | 7 +- .../CarouselScrollItem.type.ts | 19 + .../CartCoupon/CartCoupon.component.tsx | 50 +- ....container.js => CartCoupon.container.tsx} | 7 +- .../component/CartCoupon/CartCoupon.type.ts | 25 + .../component/CartIcon/CartIcon.component.tsx | 4 +- .../src/component/CartIcon/CartIcon.type.ts | 2 +- .../component/CartItem/CartItem.component.tsx | 110 ++-- ...em.container.js => CartItem.container.tsx} | 9 +- .../src/component/CartItem/CartItem.type.ts | 32 ++ .../CartItemPrice/CartItemPrice.component.tsx | 17 +- ...ntainer.js => CartItemPrice.container.tsx} | 5 +- .../CartItemPrice/CartItemPrice.type.ts | 19 + .../CartOverlay/CartOverlay.component.tsx | 59 +- ...container.js => CartOverlay.container.tsx} | 7 +- .../component/CartOverlay/CartOverlay.type.ts | 26 + ...tegoryConfigurableAttributes.component.tsx | 14 +- ...egoryConfigurableAttributes.container.tsx} | 6 +- .../CategoryConfigurableAttributes.type.ts | 10 + .../CategoryDetails.component.tsx | 12 +- .../CategoryFilterOverlay.component.tsx | 20 +- ...js => CategoryFilterOverlay.container.tsx} | 31 +- ...er.js => CategoryItemsCount.container.tsx} | 0 ...r.js => CategoryProductList.container.tsx} | 7 +- .../CategorySort/CategorySort.component.tsx | 8 +- ...ontainer.js => CategorySort.container.tsx} | 53 +- .../CheckoutAddressBook.component.tsx | 20 +- ...r.js => CheckoutAddressBook.container.tsx} | 3 +- .../CheckoutAddressForm.component.tsx | 2 +- ...r.js => CheckoutAddressForm.container.tsx} | 6 +- .../CheckoutAddressTable.component.tsx | 2 +- ....js => CheckoutAddressTable.container.tsx} | 6 +- .../CheckoutBilling.component.tsx | 26 +- ...ainer.js => CheckoutBilling.container.tsx} | 55 +- .../CheckoutDeliveryOption.component.tsx | 14 +- ...s => CheckoutDeliveryOption.container.tsx} | 7 +- .../CheckoutDeliveryOptions.component.tsx | 10 +- ... => CheckoutDeliveryOptions.container.tsx} | 3 +- .../CheckoutGuestForm.component.tsx | 16 +- ...ner.js => CheckoutGuestForm.container.tsx} | 3 +- .../CheckoutGuestForm.form.js | 20 +- .../CheckoutOrderSummary.component.tsx | 32 +- ....js => CheckoutOrderSummary.container.tsx} | 0 ...heckoutOrderSummaryPriceLine.component.tsx | 12 +- .../CheckoutPayment.component.tsx | 4 +- .../CheckoutPayments.component.tsx | 16 +- ...iner.js => CheckoutPayments.container.tsx} | 3 +- .../CheckoutShipping.component.tsx | 16 +- ...iner.js => CheckoutShipping.container.tsx} | 3 +- .../CheckoutSuccess.component.tsx | 4 +- ...ckoutTermsAndConditionsPopup.component.tsx | 2 +- ...koutTermsAndConditionsPopup.container.tsx} | 9 +- .../ChevronIcon/ChevronIcon.component.tsx | 4 +- .../component/ChevronIcon/ChevronIcon.type.ts | 2 +- .../component/CmsBlock/CmsBlock.component.tsx | 2 +- ...ck.container.js => CmsBlock.container.tsx} | 2 +- .../CompareIcon/CompareIcon.component.tsx | 4 +- .../component/CompareIcon/CompareIcon.type.ts | 2 +- .../ContactForm/ContactForm.component.tsx | 2 +- ...container.js => ContactForm.container.tsx} | 9 +- .../component/ContactForm/ContactForm.form.js | 24 +- .../ContentWrapper.component.tsx | 6 +- .../CookiePopup/CookiePopup.component.tsx | 6 +- ...container.js => CookiePopup.container.tsx} | 7 +- .../CurrencySwitcher.component.tsx | 4 +- ...iner.js => CurrencySwitcher.container.tsx} | 6 +- .../DatePicker/DatePicker.component.tsx | 12 +- ....container.js => DatePicker.container.tsx} | 7 +- .../DateSelect/DateSelect.component.tsx | 44 +- ....container.js => DateSelect.container.tsx} | 7 +- .../DemoNotice/DemoNotice.component.tsx | 2 +- ....container.js => DemoNotice.container.tsx} | 0 .../Draggable/Draggable.component.tsx | 3 +- .../ExpandableContent.component.tsx | 8 +- ...ner.js => ExpandableContent.container.tsx} | 0 .../ExpandableContentShowMore.component.tsx | 6 +- ...> ExpandableContentShowMore.container.tsx} | 0 .../src/component/Field/Field.component.tsx | 60 +-- ...Field.container.js => Field.container.tsx} | 14 +- ...e.container.js => FieldDate.container.tsx} | 7 +- .../FieldFile/FieldFile.component.tsx | 8 +- ...e.container.js => FieldFile.container.tsx} | 10 +- .../FieldForm/FieldForm.component.tsx | 6 +- .../FieldGroup/FieldGroup.component.tsx | 12 +- ....container.js => FieldGroup.container.tsx} | 6 +- ....container.js => FieldInput.container.tsx} | 6 +- .../FieldNumber/FieldNumber.component.tsx | 8 +- ...container.js => FieldNumber.container.tsx} | 2 +- .../FieldSelect/FieldSelect.component.tsx | 10 +- ...container.js => FieldSelect.container.tsx} | 2 +- .../src/component/Footer/Footer.component.tsx | 18 +- ...oter.container.js => Footer.container.tsx} | 7 +- .../src/component/Form/Form.component.tsx | 12 +- .../{Form.container.js => Form.container.tsx} | 8 +- .../component/GridIcon/GridIcon.component.tsx | 4 +- .../src/component/GridIcon/GridIcon.type.ts | 2 +- .../GroupedProductList.component.tsx | 2 +- .../GroupedProductsItem.component.tsx | 12 +- ...r.js => GroupedProductsItem.container.tsx} | 11 +- .../src/component/Header/Header.component.tsx | 48 +- ...ader.container.js => Header.container.tsx} | 2 +- .../HeartIcon/HeartIcon.component.tsx | 4 +- .../src/component/HeartIcon/HeartIcon.type.ts | 2 +- .../component/HomeIcon/HomeIcon.component.tsx | 4 +- .../src/component/HomeIcon/HomeIcon.type.ts | 2 +- .../src/component/Image/Image.component.tsx | 14 +- ...Image.container.js => Image.container.tsx} | 13 +- ...tainer.js => ImageZoomPopup.container.tsx} | 3 +- .../InstallPrompt/InstallPrompt.component.tsx | 2 +- ...ntainer.js => InstallPrompt.container.tsx} | 3 +- .../InstallPromptAndroid.component.tsx | 6 +- .../InstallPromptIOS.component.tsx | 6 +- .../KeyValueTable/KeyValueTable.component.tsx | 6 +- .../src/component/Klarna/Klarna.component.tsx | 4 +- ...arna.container.js => Klarna.container.tsx} | 5 +- .../{Link.container.js => Link.container.tsx} | 5 +- .../component/ListIcon/ListIcon.component.tsx | 4 +- .../src/component/ListIcon/ListIcon.type.ts | 2 +- .../src/component/Loader/Loader.component.tsx | 2 +- .../src/component/Logo/Logo.component.tsx | 4 +- .../{Logo.container.js => Logo.container.tsx} | 6 +- .../src/component/Menu/Menu.component.tsx | 28 +- .../{Menu.container.js => Menu.container.tsx} | 2 +- .../component/MenuIcon/MenuIcon.component.tsx | 4 +- .../src/component/MenuIcon/MenuIcon.type.ts | 2 +- .../component/MenuItem/MenuItem.component.tsx | 8 +- ...em.container.js => MenuItem.container.tsx} | 7 +- .../src/component/Meta/Meta.component.tsx | 6 +- .../{Meta.container.js => Meta.container.tsx} | 9 +- .../MinusIcon/MinusIcon.component.tsx | 4 +- .../src/component/MinusIcon/MinusIcon.type.ts | 2 +- .../MyAccountAddressBook.component.tsx | 10 +- ....js => MyAccountAddressBook.container.tsx} | 7 +- .../MyAccountAddressForm.component.tsx | 6 +- ....js => MyAccountAddressForm.container.tsx} | 6 +- .../MyAccountAddressForm.form.js | 62 +-- .../MyAccountAddressPopup.component.tsx | 6 +- ...js => MyAccountAddressPopup.container.tsx} | 9 +- .../MyAccountAddressTable.component.tsx | 2 +- ...js => MyAccountAddressTable.container.tsx} | 7 +- .../MyAccountCreateAccount.component.tsx | 42 +- ...s => MyAccountCreateAccount.container.tsx} | 7 +- .../MyAccountCustomerForm.component.tsx | 6 +- ...js => MyAccountCustomerForm.container.tsx} | 7 +- .../MyAccountCustomerForm.form.js | 44 +- .../MyAccountCustomerPopup.component.tsx | 6 +- ...s => MyAccountCustomerPopup.container.tsx} | 9 +- .../MyAccountCustomerTable.component.tsx | 2 +- ...s => MyAccountCustomerTable.container.tsx} | 7 +- .../MyAccountDashboard.component.tsx | 14 +- ...er.js => MyAccountDashboard.container.tsx} | 9 +- .../MyAccountDownloadable.component.tsx | 10 +- ...js => MyAccountDownloadable.container.tsx} | 3 +- ...yAccountDownloadableTableRow.component.tsx | 4 +- ...AccountDownloadableTableRow.container.tsx} | 7 +- .../MyAccountForgotPassword.component.tsx | 14 +- ... => MyAccountForgotPassword.container.tsx} | 9 +- ...ccountForgotPasswordSuccess.container.tsx} | 52 +- .../MyAccountInformation.component.tsx | 2 +- ....js => MyAccountInformation.container.tsx} | 9 +- .../MyAccountMyOrders.component.tsx | 12 +- ...ner.js => MyAccountMyOrders.container.tsx} | 3 +- .../MyAccountMyWishlist.component.tsx | 26 +- ...r.js => MyAccountMyWishlist.container.tsx} | 9 +- ...ccountNewsletterSubscription.component.tsx | 10 +- ...countNewsletterSubscription.container.tsx} | 8 +- .../MyAccountOrder.component.tsx | 20 +- ...tainer.js => MyAccountOrder.container.tsx} | 3 +- .../MyAccountOrderInformation.component.tsx | 13 +- .../MyAccountOrderItemsTable.component.tsx | 22 +- ...=> MyAccountOrderItemsTable.container.tsx} | 5 +- .../MyAccountOrderItemsTableRow.component.tsx | 39 +- ...MyAccountOrderItemsTableRow.container.tsx} | 23 +- ...ner.js => MyAccountOrderTab.container.tsx} | 7 +- ...s => MyAccountOrderTableRow.container.tsx} | 7 +- .../MyAccountOrderTabs.component.tsx | 6 +- .../MyAccountOrderTotals.component.tsx | 14 +- ....js => MyAccountOrderTotals.container.tsx} | 3 +- .../MyAccountOverlay.component.tsx | 12 +- ...iner.js => MyAccountOverlay.container.tsx} | 3 +- .../MyAccountPasswordForm.component.tsx | 2 +- .../MyAccountPasswordForm.form.js | 16 +- .../MyAccountSignIn.component.tsx | 16 +- ...ainer.js => MyAccountSignIn.container.tsx} | 3 +- .../MyAccountTabList.component.tsx | 6 +- ...iner.js => MyAccountTabList.container.tsx} | 7 +- .../NavigationAbstract.component.tsx | 2 +- ...er.js => NavigationAbstract.container.tsx} | 3 +- .../NavigationTabs.component.tsx | 10 +- ...tainer.js => NavigationTabs.container.tsx} | 2 +- .../NewProducts/NewProducts.component.tsx | 2 +- ...container.js => NewProducts.container.tsx} | 3 +- .../NewVersionPopup.component.tsx | 12 +- ...ainer.js => NewVersionPopup.container.tsx} | 3 +- .../NewsletterForm.form.js | 10 +- .../NewsletterSubscription.component.tsx | 8 +- ...s => NewsletterSubscription.container.tsx} | 9 +- .../Notification/Notification.component.tsx | 2 +- ...iner.js => NotificationList.container.tsx} | 0 .../OfflineNotice/OfflineNotice.component.tsx | 4 +- ...ntainer.js => OfflineNotice.container.tsx} | 3 +- .../component/Overlay/Overlay.component.tsx | 2 +- ...lay.container.js => Overlay.container.tsx} | 0 .../Pagination/Pagination.component.tsx | 18 +- ....container.js => Pagination.container.tsx} | 13 +- .../PasswordChangeForm.component.tsx | 2 +- .../PasswordChangeForm.form.js | 16 +- .../src/component/Popup/Popup.component.tsx | 8 +- ...Popup.container.js => Popup.container.tsx} | 9 +- ...ntainer.js => PopupSuspense.container.tsx} | 0 .../component/Product/Product.component.tsx | 42 +- ...uct.container.js => Product.container.tsx} | 12 +- .../ProductActions.component.tsx | 32 +- ...tainer.js => ProductActions.container.tsx} | 2 +- .../ProductAlerts/ProductAlerts.component.tsx | 4 +- ...ntainer.js => ProductAlerts.container.tsx} | 7 +- .../ProductAttributeValue.component.tsx | 32 +- .../ProductAttributes.component.tsx | 8 +- ...ner.js => ProductAttributes.container.tsx} | 5 +- .../ProductBundleOption.component.tsx | 32 +- ...r.js => ProductBundleOption.container.tsx} | 3 +- .../ProductBundleOptions.component.tsx | 2 +- ....js => ProductBundleOptions.container.tsx} | 5 +- .../ProductCard/ProductCard.component.tsx | 28 +- ...container.js => ProductCard.container.tsx} | 16 +- .../ProductCompare.component.tsx | 22 +- ...tainer.js => ProductCompare.container.tsx} | 3 +- .../ProductCompareAttributeRow.component.tsx | 6 +- ... ProductCompareAttributeRow.container.tsx} | 5 +- ....js => ProductCompareButton.container.tsx} | 7 +- .../ProductCompareItem.component.tsx | 24 +- ...er.js => ProductCompareItem.container.tsx} | 11 +- ...onfigurableAttributeDropdown.component.tsx | 4 +- ...nfigurableAttributeDropdown.container.tsx} | 15 +- ...roductConfigurableAttributes.component.tsx | 10 +- ...oductConfigurableAttributes.container.tsx} | 3 +- .../ProductConfigurableAttributes.type.ts | 10 + .../ProductCustomizableOption.component.tsx | 60 +-- ...> ProductCustomizableOption.container.tsx} | 17 +- .../ProductCustomizableOptions.component.tsx | 2 +- ... ProductCustomizableOptions.container.tsx} | 5 +- .../ProductDownloadableLinks.component.tsx | 20 +- ...=> ProductDownloadableLinks.container.tsx} | 2 +- .../ProductDownloadableSamples.component.tsx | 2 +- ... ProductDownloadableSamples.container.tsx} | 5 +- .../ProductGallery.component.tsx | 14 +- ...tainer.js => ProductGallery.container.tsx} | 2 +- ... => ProductGalleryBaseImage.container.tsx} | 2 +- ...ProductGalleryThumbnailImage.component.tsx | 8 +- .../ProductInformation.component.tsx | 4 +- .../ProductLinks/ProductLinks.component.tsx | 6 +- ...ontainer.js => ProductLinks.container.tsx} | 7 +- .../ProductList/ProductList.component.tsx | 14 +- ...container.js => ProductList.container.tsx} | 3 +- .../ProductListPage.component.tsx | 8 +- ...ner.js => ProductListWidget.container.tsx} | 20 +- .../ProductPrice/ProductPrice.component.tsx | 30 +- ...ontainer.js => ProductPrice.container.tsx} | 5 +- .../ProductReviewForm.component.tsx | 16 +- ...ner.js => ProductReviewForm.container.tsx} | 11 +- .../ProductReviewItem.component.tsx | 4 +- .../ProductReviewList.component.tsx | 2 +- .../ProductReviewRating.component.tsx | 4 +- .../ProductReviews.component.tsx | 12 +- ...tainer.js => ProductReviews.container.tsx} | 7 +- .../ProductTabs/ProductTabs.component.tsx | 8 +- .../ProductWishlistButton.component.tsx | 6 +- ...js => ProductWishlistButton.container.tsx} | 3 +- .../PurchaseOrder/PurchaseOrder.component.tsx | 4 +- .../RadioButtonIcon.component.tsx | 4 +- .../RadioButtonIcon/RadioButtonIcon.type.ts | 2 +- .../RecentlyViewedWidget.component.tsx | 4 +- ....js => RecentlyViewedWidget.container.tsx} | 3 +- .../RenderWhenVisible.component.tsx | 8 +- .../ResetAttributes.component.tsx | 8 +- ...ainer.js => ResetAttributes.container.tsx} | 15 +- ...container.js => ResetButton.container.tsx} | 11 +- .../src/component/Router/Router.component.tsx | 14 +- ...uter.container.js => Router.container.tsx} | 3 +- .../SearchField/SearchField.component.tsx | 8 +- ...container.js => SearchField.container.tsx} | 0 .../SearchItem/SearchItem.component.tsx | 10 +- ....container.js => SearchItem.container.tsx} | 9 +- .../SearchOverlay/SearchOverlay.component.tsx | 6 +- ...ntainer.js => SearchOverlay.container.tsx} | 7 +- .../ShareIcon/ShareIcon.component.tsx | 4 +- .../src/component/ShareIcon/ShareIcon.type.ts | 2 +- .../ShareWishlistForm.component.tsx | 2 +- .../ShareWishlistForm.form.js | 12 +- .../ShareWishlistPopup.component.tsx | 2 +- ...er.js => ShareWishlistPopup.container.tsx} | 7 +- ...iner.js => SharedTransition.container.tsx} | 0 .../SharedWishlistItem.component.tsx | 6 +- ...er.js => SharedWishlistItem.container.tsx} | 6 +- .../src/component/Slider/Slider.component.tsx | 10 +- ...ider.container.js => Slider.container.tsx} | 0 .../SliderWidget/SliderWidget.component.tsx | 2 +- ...ontainer.js => SliderWidget.container.tsx} | 2 +- .../component/StarIcon/StarIcon.component.tsx | 4 +- .../src/component/StarIcon/StarIcon.type.ts | 2 +- .../StoreInPickUp/StoreInPickUp.component.tsx | 12 +- ...ntainer.js => StoreInPickUp.container.tsx} | 7 +- .../StoreInPickUpPopup.component.tsx | 18 +- ...er.js => StoreInPickUpPopup.container.tsx} | 3 +- .../StoreInPickUpStore.component.tsx | 2 +- ...er.js => StoreInPickUpStore.container.tsx} | 7 +- ...m.container.js => StoreItem.container.tsx} | 7 +- .../StoreSwitcher/StoreSwitcher.component.tsx | 10 +- ...ntainer.js => StoreSwitcher.container.tsx} | 2 +- .../SwipeToDelete/SwipeToDelete.component.tsx | 4 +- ...ntainer.js => SwipeToDelete.container.tsx} | 5 +- .../TierPrices/TierPrices.component.tsx | 10 +- ...js => TranslateOnCursorMove.container.tsx} | 0 .../component/UserIcon/UserIcon.component.tsx | 4 +- .../src/component/UserIcon/UserIcon.type.ts | 2 +- .../VideoPopup/VideoPopup.component.tsx | 6 +- ....container.js => VideoPopup.container.tsx} | 0 .../VideoThumbnail.component.tsx | 2 +- ...tainer.js => VideoThumbnail.container.tsx} | 7 +- .../WidgetFactory/WidgetFactory.component.tsx | 8 +- .../WishlistItem/WishlistItem.component.tsx | 42 +- ...ontainer.js => WishlistItem.container.tsx} | 41 +- ...ge.component.js => CartPage.component.tsx} | 143 ++--- ...ge.container.js => CartPage.container.tsx} | 3 +- ...omponent.js => CategoryPage.component.tsx} | 214 ++++---- ...ontainer.js => CategoryPage.container.tsx} | 3 +- ...ut.component.js => Checkout.component.tsx} | 24 +- ...ut.container.js => Checkout.container.tsx} | 3 +- ...age.component.js => CmsPage.component.tsx} | 21 +- ...age.container.js => CmsPage.container.tsx} | 2 +- ...nt.js => ConfirmAccountPage.component.tsx} | 95 ++-- ...er.js => ConfirmAccountPage.container.tsx} | 3 +- ...component.js => ContactPage.component.tsx} | 27 +- ...container.js => ContactPage.container.tsx} | 2 +- ...mponent.js => CreateAccount.component.tsx} | 46 +- ...ntainer.js => CreateAccount.container.tsx} | 2 +- ...ponent.js => ForgotPassword.component.tsx} | 62 +-- ...tainer.js => ForgotPassword.container.tsx} | 2 +- ...ge.container.js => HomePage.container.tsx} | 3 +- ...omponent.js => LoginAccount.component.tsx} | 54 +- ...ontainer.js => LoginAccount.container.tsx} | 2 +- ...ge.container.js => MenuPage.container.tsx} | 3 +- ...t.component.js => MyAccount.component.tsx} | 68 +-- ...t.container.js => MyAccount.container.tsx} | 3 +- ...tch.component.js => NoMatch.component.tsx} | 3 +- ...tch.container.js => NoMatch.container.tsx} | 3 +- ...ponent.js => NoMatchHandler.component.tsx} | 3 +- ...tainer.js => NoMatchHandler.container.tsx} | 3 +- ...nt.js => PasswordChangePage.component.tsx} | 39 +- ...er.js => PasswordChangePage.container.tsx} | 3 +- ...nt.js => ProductComparePage.component.tsx} | 7 +- ...er.js => ProductComparePage.container.tsx} | 2 +- ...component.js => ProductPage.component.tsx} | 110 ++-- ...container.js => ProductPage.container.tsx} | 3 +- ....component.js => SearchPage.component.tsx} | 24 +- ....container.js => SearchPage.container.tsx} | 2 +- ...nt.js => SomethingWentWrong.component.tsx} | 29 +- ...er.js => SomethingWentWrong.container.tsx} | 3 +- .../StyleGuidePage.component.js | 503 ----------------- .../StyleGuidePage.component.tsx | 504 ++++++++++++++++++ ...tainer.js => StyleGuidePage.container.tsx} | 3 +- ...component.js => UrlRewrites.component.tsx} | 88 +-- ...container.js => UrlRewrites.container.tsx} | 3 +- ...nt.js => WishlistSharedPage.component.tsx} | 30 +- ...er.js => WishlistSharedPage.container.tsx} | 2 +- .../scandipwa/src/type/Breadcrumbs.type.js | 4 +- .../scandipwa/src/type/Downloadable.type.js | 4 +- packages/scandipwa/src/type/Field.type.js | 28 +- packages/scandipwa/src/type/Global.type.ts | 6 + packages/scandipwa/src/type/MiniCart.type.js | 2 +- packages/scandipwa/src/type/MiniCart.type.ts | 17 + packages/scandipwa/src/type/Router.type.js | 2 +- packages/scandipwa/src/util/CSS/CSS.ts | 11 +- packages/scandipwa/src/util/Form/Extract.ts | 14 +- .../scandipwa/src/util/Product/Transform.ts | 6 +- .../src/util/Request/DataContainer.ts | 5 +- .../scandipwa/src/util/Validator/Validator.ts | 12 +- 388 files changed, 2975 insertions(+), 2689 deletions(-) rename packages/scandipwa/src/component/AddToCart/{AddToCart.container.js => AddToCart.container.tsx} (98%) rename packages/scandipwa/src/component/Breadcrumbs/{Breadcrumbs.container.js => Breadcrumbs.container.tsx} (100%) rename packages/scandipwa/src/component/CarouselScrollArrow/{CarouselScrollArrow.container.js => CarouselScrollArrow.container.tsx} (88%) create mode 100644 packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.type.ts rename packages/scandipwa/src/component/CarouselScrollItem/{CarouselScrollItem.container.js => CarouselScrollItem.container.tsx} (90%) create mode 100644 packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.type.ts rename packages/scandipwa/src/component/CartCoupon/{CartCoupon.container.js => CartCoupon.container.tsx} (95%) create mode 100644 packages/scandipwa/src/component/CartCoupon/CartCoupon.type.ts rename packages/scandipwa/src/component/CartItem/{CartItem.container.js => CartItem.container.tsx} (98%) create mode 100644 packages/scandipwa/src/component/CartItem/CartItem.type.ts rename packages/scandipwa/src/component/CartItemPrice/{CartItemPrice.container.js => CartItemPrice.container.tsx} (93%) create mode 100644 packages/scandipwa/src/component/CartItemPrice/CartItemPrice.type.ts rename packages/scandipwa/src/component/CartOverlay/{CartOverlay.container.js => CartOverlay.container.tsx} (97%) create mode 100644 packages/scandipwa/src/component/CartOverlay/CartOverlay.type.ts rename packages/scandipwa/src/component/CategoryConfigurableAttributes/{CategoryConfigurableAttributes.container.js => CategoryConfigurableAttributes.container.tsx} (95%) create mode 100644 packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.type.ts rename packages/scandipwa/src/component/CategoryFilterOverlay/{CategoryFilterOverlay.container.js => CategoryFilterOverlay.container.tsx} (91%) rename packages/scandipwa/src/component/CategoryItemsCount/{CategoryItemsCount.container.js => CategoryItemsCount.container.tsx} (100%) rename packages/scandipwa/src/component/CategoryProductList/{CategoryProductList.container.js => CategoryProductList.container.tsx} (96%) rename packages/scandipwa/src/component/CategorySort/{CategorySort.container.js => CategorySort.container.tsx} (74%) rename packages/scandipwa/src/component/CheckoutAddressBook/{CheckoutAddressBook.container.js => CheckoutAddressBook.container.tsx} (98%) rename packages/scandipwa/src/component/CheckoutAddressForm/{CheckoutAddressForm.container.js => CheckoutAddressForm.container.tsx} (92%) rename packages/scandipwa/src/component/CheckoutAddressTable/{CheckoutAddressTable.container.js => CheckoutAddressTable.container.tsx} (91%) rename packages/scandipwa/src/component/CheckoutBilling/{CheckoutBilling.container.js => CheckoutBilling.container.tsx} (90%) rename packages/scandipwa/src/component/CheckoutDeliveryOption/{CheckoutDeliveryOption.container.js => CheckoutDeliveryOption.container.tsx} (93%) rename packages/scandipwa/src/component/CheckoutDeliveryOptions/{CheckoutDeliveryOptions.container.js => CheckoutDeliveryOptions.container.tsx} (98%) rename packages/scandipwa/src/component/CheckoutGuestForm/{CheckoutGuestForm.container.js => CheckoutGuestForm.container.tsx} (98%) rename packages/scandipwa/src/component/CheckoutOrderSummary/{CheckoutOrderSummary.container.js => CheckoutOrderSummary.container.tsx} (100%) rename packages/scandipwa/src/component/CheckoutPayments/{CheckoutPayments.container.js => CheckoutPayments.container.tsx} (98%) rename packages/scandipwa/src/component/CheckoutShipping/{CheckoutShipping.container.js => CheckoutShipping.container.tsx} (99%) rename packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/{CheckoutTermsAndConditionsPopup.container.js => CheckoutTermsAndConditionsPopup.container.tsx} (85%) rename packages/scandipwa/src/component/CmsBlock/{CmsBlock.container.js => CmsBlock.container.tsx} (98%) rename packages/scandipwa/src/component/ContactForm/{ContactForm.container.js => ContactForm.container.tsx} (89%) rename packages/scandipwa/src/component/CookiePopup/{CookiePopup.container.js => CookiePopup.container.tsx} (91%) rename packages/scandipwa/src/component/CurrencySwitcher/{CurrencySwitcher.container.js => CurrencySwitcher.container.tsx} (94%) rename packages/scandipwa/src/component/DatePicker/{DatePicker.container.js => DatePicker.container.tsx} (95%) rename packages/scandipwa/src/component/DateSelect/{DateSelect.container.js => DateSelect.container.tsx} (97%) rename packages/scandipwa/src/component/DemoNotice/{DemoNotice.container.js => DemoNotice.container.tsx} (100%) rename packages/scandipwa/src/component/ExpandableContent/{ExpandableContent.container.js => ExpandableContent.container.tsx} (100%) rename packages/scandipwa/src/component/ExpandableContentShowMore/{ExpandableContentShowMore.container.js => ExpandableContentShowMore.container.tsx} (100%) rename packages/scandipwa/src/component/Field/{Field.container.js => Field.container.tsx} (94%) rename packages/scandipwa/src/component/FieldDate/{FieldDate.container.js => FieldDate.container.tsx} (91%) rename packages/scandipwa/src/component/FieldFile/{FieldFile.container.js => FieldFile.container.tsx} (93%) rename packages/scandipwa/src/component/FieldGroup/{FieldGroup.container.js => FieldGroup.container.tsx} (97%) rename packages/scandipwa/src/component/FieldInput/{FieldInput.container.js => FieldInput.container.tsx} (94%) rename packages/scandipwa/src/component/FieldNumber/{FieldNumber.container.js => FieldNumber.container.tsx} (99%) rename packages/scandipwa/src/component/FieldSelect/{FieldSelect.container.js => FieldSelect.container.tsx} (99%) rename packages/scandipwa/src/component/Footer/{Footer.container.js => Footer.container.tsx} (91%) rename packages/scandipwa/src/component/Form/{Form.container.js => Form.container.tsx} (96%) rename packages/scandipwa/src/component/GroupedProductsItem/{GroupedProductsItem.container.js => GroupedProductsItem.container.tsx} (87%) rename packages/scandipwa/src/component/Header/{Header.container.js => Header.container.tsx} (99%) rename packages/scandipwa/src/component/Image/{Image.container.js => Image.container.tsx} (93%) rename packages/scandipwa/src/component/ImageZoomPopup/{ImageZoomPopup.container.js => ImageZoomPopup.container.tsx} (97%) rename packages/scandipwa/src/component/InstallPrompt/{InstallPrompt.container.js => InstallPrompt.container.tsx} (97%) rename packages/scandipwa/src/component/Klarna/{Klarna.container.js => Klarna.container.tsx} (92%) rename packages/scandipwa/src/component/Link/{Link.container.js => Link.container.tsx} (96%) rename packages/scandipwa/src/component/Logo/{Logo.container.js => Logo.container.tsx} (83%) rename packages/scandipwa/src/component/Menu/{Menu.container.js => Menu.container.tsx} (99%) rename packages/scandipwa/src/component/MenuItem/{MenuItem.container.js => MenuItem.container.tsx} (95%) rename packages/scandipwa/src/component/Meta/{Meta.container.js => Meta.container.tsx} (93%) rename packages/scandipwa/src/component/MyAccountAddressBook/{MyAccountAddressBook.container.js => MyAccountAddressBook.container.tsx} (92%) rename packages/scandipwa/src/component/MyAccountAddressForm/{MyAccountAddressForm.container.js => MyAccountAddressForm.container.tsx} (98%) rename packages/scandipwa/src/component/MyAccountAddressPopup/{MyAccountAddressPopup.container.js => MyAccountAddressPopup.container.tsx} (95%) rename packages/scandipwa/src/component/MyAccountAddressTable/{MyAccountAddressTable.container.js => MyAccountAddressTable.container.tsx} (94%) rename packages/scandipwa/src/component/MyAccountCreateAccount/{MyAccountCreateAccount.container.js => MyAccountCreateAccount.container.tsx} (97%) rename packages/scandipwa/src/component/MyAccountCustomerForm/{MyAccountCustomerForm.container.js => MyAccountCustomerForm.container.tsx} (95%) rename packages/scandipwa/src/component/MyAccountCustomerPopup/{MyAccountCustomerPopup.container.js => MyAccountCustomerPopup.container.tsx} (95%) rename packages/scandipwa/src/component/MyAccountCustomerTable/{MyAccountCustomerTable.container.js => MyAccountCustomerTable.container.tsx} (91%) rename packages/scandipwa/src/component/MyAccountDashboard/{MyAccountDashboard.container.js => MyAccountDashboard.container.tsx} (86%) rename packages/scandipwa/src/component/MyAccountDownloadable/{MyAccountDownloadable.container.js => MyAccountDownloadable.container.tsx} (97%) rename packages/scandipwa/src/component/MyAccountDownloadableTableRow/{MyAccountDownloadableTableRow.container.js => MyAccountDownloadableTableRow.container.tsx} (92%) rename packages/scandipwa/src/component/MyAccountForgotPassword/{MyAccountForgotPassword.container.js => MyAccountForgotPassword.container.tsx} (94%) rename packages/scandipwa/src/component/MyAccountForgotPasswordSuccess/{MyAccountForgotPasswordSuccess.container.js => MyAccountForgotPasswordSuccess.container.tsx} (62%) rename packages/scandipwa/src/component/MyAccountInformation/{MyAccountInformation.container.js => MyAccountInformation.container.tsx} (97%) rename packages/scandipwa/src/component/MyAccountMyOrders/{MyAccountMyOrders.container.js => MyAccountMyOrders.container.tsx} (97%) rename packages/scandipwa/src/component/MyAccountMyWishlist/{MyAccountMyWishlist.container.js => MyAccountMyWishlist.container.tsx} (96%) rename packages/scandipwa/src/component/MyAccountNewsletterSubscription/{MyAccountNewsletterSubscription.container.js => MyAccountNewsletterSubscription.container.tsx} (96%) rename packages/scandipwa/src/component/MyAccountOrder/{MyAccountOrder.container.js => MyAccountOrder.container.tsx} (98%) rename packages/scandipwa/src/component/MyAccountOrderItemsTable/{MyAccountOrderItemsTable.container.js => MyAccountOrderItemsTable.container.tsx} (93%) rename packages/scandipwa/src/component/MyAccountOrderItemsTableRow/{MyAccountOrderItemsTableRow.container.js => MyAccountOrderItemsTableRow.container.tsx} (87%) rename packages/scandipwa/src/component/MyAccountOrderTab/{MyAccountOrderTab.container.js => MyAccountOrderTab.container.tsx} (88%) rename packages/scandipwa/src/component/MyAccountOrderTableRow/{MyAccountOrderTableRow.container.js => MyAccountOrderTableRow.container.tsx} (92%) rename packages/scandipwa/src/component/MyAccountOrderTotals/{MyAccountOrderTotals.container.js => MyAccountOrderTotals.container.tsx} (97%) rename packages/scandipwa/src/component/MyAccountOverlay/{MyAccountOverlay.container.js => MyAccountOverlay.container.tsx} (99%) rename packages/scandipwa/src/component/MyAccountSignIn/{MyAccountSignIn.container.js => MyAccountSignIn.container.tsx} (98%) rename packages/scandipwa/src/component/MyAccountTabList/{MyAccountTabList.container.js => MyAccountTabList.container.tsx} (94%) rename packages/scandipwa/src/component/NavigationAbstract/{NavigationAbstract.container.js => NavigationAbstract.container.tsx} (98%) rename packages/scandipwa/src/component/NavigationTabs/{NavigationTabs.container.js => NavigationTabs.container.tsx} (99%) rename packages/scandipwa/src/component/NewProducts/{NewProducts.container.js => NewProducts.container.tsx} (98%) rename packages/scandipwa/src/component/NewVersionPopup/{NewVersionPopup.container.js => NewVersionPopup.container.tsx} (97%) rename packages/scandipwa/src/component/NewsletterSubscription/{NewsletterSubscription.container.js => NewsletterSubscription.container.tsx} (94%) rename packages/scandipwa/src/component/NotificationList/{NotificationList.container.js => NotificationList.container.tsx} (100%) rename packages/scandipwa/src/component/OfflineNotice/{OfflineNotice.container.js => OfflineNotice.container.tsx} (98%) rename packages/scandipwa/src/component/Overlay/{Overlay.container.js => Overlay.container.tsx} (100%) rename packages/scandipwa/src/component/Pagination/{Pagination.container.js => Pagination.container.tsx} (94%) rename packages/scandipwa/src/component/Popup/{Popup.container.js => Popup.container.tsx} (95%) rename packages/scandipwa/src/component/PopupSuspense/{PopupSuspense.container.js => PopupSuspense.container.tsx} (100%) rename packages/scandipwa/src/component/Product/{Product.container.js => Product.container.tsx} (97%) rename packages/scandipwa/src/component/ProductActions/{ProductActions.container.js => ProductActions.container.tsx} (99%) rename packages/scandipwa/src/component/ProductAlerts/{ProductAlerts.container.js => ProductAlerts.container.tsx} (95%) rename packages/scandipwa/src/component/ProductAttributes/{ProductAttributes.container.js => ProductAttributes.container.tsx} (90%) rename packages/scandipwa/src/component/ProductBundleOption/{ProductBundleOption.container.js => ProductBundleOption.container.tsx} (98%) rename packages/scandipwa/src/component/ProductBundleOptions/{ProductBundleOptions.container.js => ProductBundleOptions.container.tsx} (90%) rename packages/scandipwa/src/component/ProductCard/{ProductCard.container.js => ProductCard.container.tsx} (92%) rename packages/scandipwa/src/component/ProductCompare/{ProductCompare.container.js => ProductCompare.container.tsx} (98%) rename packages/scandipwa/src/component/ProductCompareAttributeRow/{ProductCompareAttributeRow.container.js => ProductCompareAttributeRow.container.tsx} (92%) rename packages/scandipwa/src/component/ProductCompareButton/{ProductCompareButton.container.js => ProductCompareButton.container.tsx} (94%) rename packages/scandipwa/src/component/ProductCompareItem/{ProductCompareItem.container.js => ProductCompareItem.container.tsx} (95%) rename packages/scandipwa/src/component/ProductConfigurableAttributeDropdown/{ProductConfigurableAttributeDropdown.container.js => ProductConfigurableAttributeDropdown.container.tsx} (88%) rename packages/scandipwa/src/component/ProductConfigurableAttributes/{ProductConfigurableAttributes.container.js => ProductConfigurableAttributes.container.tsx} (98%) create mode 100644 packages/scandipwa/src/component/ProductConfigurableAttributes/ProductConfigurableAttributes.type.ts rename packages/scandipwa/src/component/ProductCustomizableOption/{ProductCustomizableOption.container.js => ProductCustomizableOption.container.tsx} (86%) rename packages/scandipwa/src/component/ProductCustomizableOptions/{ProductCustomizableOptions.container.js => ProductCustomizableOptions.container.tsx} (91%) rename packages/scandipwa/src/component/ProductDownloadableLinks/{ProductDownloadableLinks.container.js => ProductDownloadableLinks.container.tsx} (99%) rename packages/scandipwa/src/component/ProductDownloadableSamples/{ProductDownloadableSamples.container.js => ProductDownloadableSamples.container.tsx} (92%) rename packages/scandipwa/src/component/ProductGallery/{ProductGallery.container.js => ProductGallery.container.tsx} (99%) rename packages/scandipwa/src/component/ProductGalleryBaseImage/{ProductGalleryBaseImage.container.js => ProductGalleryBaseImage.container.tsx} (99%) rename packages/scandipwa/src/component/ProductLinks/{ProductLinks.container.js => ProductLinks.container.tsx} (95%) rename packages/scandipwa/src/component/ProductList/{ProductList.container.js => ProductList.container.tsx} (99%) rename packages/scandipwa/src/component/ProductListWidget/{ProductListWidget.container.js => ProductListWidget.container.tsx} (91%) rename packages/scandipwa/src/component/ProductPrice/{ProductPrice.container.js => ProductPrice.container.tsx} (96%) rename packages/scandipwa/src/component/ProductReviewForm/{ProductReviewForm.container.js => ProductReviewForm.container.tsx} (94%) rename packages/scandipwa/src/component/ProductReviews/{ProductReviews.container.js => ProductReviews.container.tsx} (93%) rename packages/scandipwa/src/component/ProductWishlistButton/{ProductWishlistButton.container.js => ProductWishlistButton.container.tsx} (98%) rename packages/scandipwa/src/component/RecentlyViewedWidget/{RecentlyViewedWidget.container.js => RecentlyViewedWidget.container.tsx} (97%) rename packages/scandipwa/src/component/ResetAttributes/{ResetAttributes.container.js => ResetAttributes.container.tsx} (88%) rename packages/scandipwa/src/component/ResetButton/{ResetButton.container.js => ResetButton.container.tsx} (88%) rename packages/scandipwa/src/component/Router/{Router.container.js => Router.container.tsx} (98%) rename packages/scandipwa/src/component/SearchField/{SearchField.container.js => SearchField.container.tsx} (100%) rename packages/scandipwa/src/component/SearchItem/{SearchItem.container.js => SearchItem.container.tsx} (91%) rename packages/scandipwa/src/component/SearchOverlay/{SearchOverlay.container.js => SearchOverlay.container.tsx} (94%) rename packages/scandipwa/src/component/ShareWishlistPopup/{ShareWishlistPopup.container.js => ShareWishlistPopup.container.tsx} (95%) rename packages/scandipwa/src/component/SharedTransition/{SharedTransition.container.js => SharedTransition.container.tsx} (100%) rename packages/scandipwa/src/component/SharedWishlistItem/{SharedWishlistItem.container.js => SharedWishlistItem.container.tsx} (95%) rename packages/scandipwa/src/component/Slider/{Slider.container.js => Slider.container.tsx} (100%) rename packages/scandipwa/src/component/SliderWidget/{SliderWidget.container.js => SliderWidget.container.tsx} (98%) rename packages/scandipwa/src/component/StoreInPickUp/{StoreInPickUp.container.js => StoreInPickUp.container.tsx} (95%) rename packages/scandipwa/src/component/StoreInPickUpPopup/{StoreInPickUpPopup.container.js => StoreInPickUpPopup.container.tsx} (98%) rename packages/scandipwa/src/component/StoreInPickUpStore/{StoreInPickUpStore.container.js => StoreInPickUpStore.container.tsx} (88%) rename packages/scandipwa/src/component/StoreItem/{StoreItem.container.js => StoreItem.container.tsx} (87%) rename packages/scandipwa/src/component/StoreSwitcher/{StoreSwitcher.container.js => StoreSwitcher.container.tsx} (99%) rename packages/scandipwa/src/component/SwipeToDelete/{SwipeToDelete.container.js => SwipeToDelete.container.tsx} (96%) rename packages/scandipwa/src/component/TranslateOnCursorMove/{TranslateOnCursorMove.container.js => TranslateOnCursorMove.container.tsx} (100%) rename packages/scandipwa/src/component/VideoPopup/{VideoPopup.container.js => VideoPopup.container.tsx} (100%) rename packages/scandipwa/src/component/VideoThumbnail/{VideoThumbnail.container.js => VideoThumbnail.container.tsx} (94%) rename packages/scandipwa/src/component/WishlistItem/{WishlistItem.container.js => WishlistItem.container.tsx} (91%) rename packages/scandipwa/src/route/CartPage/{CartPage.component.js => CartPage.component.tsx} (60%) rename packages/scandipwa/src/route/CartPage/{CartPage.container.js => CartPage.container.tsx} (99%) rename packages/scandipwa/src/route/CategoryPage/{CategoryPage.component.js => CategoryPage.component.tsx} (66%) rename packages/scandipwa/src/route/CategoryPage/{CategoryPage.container.js => CategoryPage.container.tsx} (99%) rename packages/scandipwa/src/route/Checkout/{Checkout.component.js => Checkout.component.tsx} (97%) rename packages/scandipwa/src/route/Checkout/{Checkout.container.js => Checkout.container.tsx} (99%) rename packages/scandipwa/src/route/CmsPage/{CmsPage.component.js => CmsPage.component.tsx} (80%) rename packages/scandipwa/src/route/CmsPage/{CmsPage.container.js => CmsPage.container.tsx} (99%) rename packages/scandipwa/src/route/ConfirmAccountPage/{ConfirmAccountPage.component.js => ConfirmAccountPage.component.tsx} (54%) rename packages/scandipwa/src/route/ConfirmAccountPage/{ConfirmAccountPage.container.js => ConfirmAccountPage.container.tsx} (98%) rename packages/scandipwa/src/route/ContactPage/{ContactPage.component.js => ContactPage.component.tsx} (80%) rename packages/scandipwa/src/route/ContactPage/{ContactPage.container.js => ContactPage.container.tsx} (99%) rename packages/scandipwa/src/route/CreateAccount/{CreateAccount.component.js => CreateAccount.component.tsx} (57%) rename packages/scandipwa/src/route/CreateAccount/{CreateAccount.container.js => CreateAccount.container.tsx} (99%) rename packages/scandipwa/src/route/ForgotPassword/{ForgotPassword.component.js => ForgotPassword.component.tsx} (57%) rename packages/scandipwa/src/route/ForgotPassword/{ForgotPassword.container.js => ForgotPassword.container.tsx} (98%) rename packages/scandipwa/src/route/HomePage/{HomePage.container.js => HomePage.container.tsx} (96%) rename packages/scandipwa/src/route/LoginAccount/{LoginAccount.component.js => LoginAccount.component.tsx} (57%) rename packages/scandipwa/src/route/LoginAccount/{LoginAccount.container.js => LoginAccount.container.tsx} (99%) rename packages/scandipwa/src/route/MenuPage/{MenuPage.container.js => MenuPage.container.tsx} (96%) rename packages/scandipwa/src/route/MyAccount/{MyAccount.component.js => MyAccount.component.tsx} (75%) rename packages/scandipwa/src/route/MyAccount/{MyAccount.container.js => MyAccount.container.tsx} (99%) rename packages/scandipwa/src/route/NoMatch/{NoMatch.component.js => NoMatch.component.tsx} (96%) rename packages/scandipwa/src/route/NoMatch/{NoMatch.container.js => NoMatch.container.tsx} (97%) rename packages/scandipwa/src/route/NoMatchHandler/{NoMatchHandler.component.js => NoMatchHandler.component.tsx} (95%) rename packages/scandipwa/src/route/NoMatchHandler/{NoMatchHandler.container.js => NoMatchHandler.container.tsx} (97%) rename packages/scandipwa/src/route/PasswordChangePage/{PasswordChangePage.component.js => PasswordChangePage.component.tsx} (66%) rename packages/scandipwa/src/route/PasswordChangePage/{PasswordChangePage.container.js => PasswordChangePage.container.tsx} (98%) rename packages/scandipwa/src/route/ProductComparePage/{ProductComparePage.component.js => ProductComparePage.component.tsx} (83%) rename packages/scandipwa/src/route/ProductComparePage/{ProductComparePage.container.js => ProductComparePage.container.tsx} (99%) rename packages/scandipwa/src/route/ProductPage/{ProductPage.component.js => ProductPage.component.tsx} (66%) rename packages/scandipwa/src/route/ProductPage/{ProductPage.container.js => ProductPage.container.tsx} (99%) rename packages/scandipwa/src/route/SearchPage/{SearchPage.component.js => SearchPage.component.tsx} (66%) rename packages/scandipwa/src/route/SearchPage/{SearchPage.container.js => SearchPage.container.tsx} (99%) rename packages/scandipwa/src/route/SomethingWentWrong/{SomethingWentWrong.component.js => SomethingWentWrong.component.tsx} (75%) rename packages/scandipwa/src/route/SomethingWentWrong/{SomethingWentWrong.container.js => SomethingWentWrong.container.tsx} (95%) delete mode 100755 packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.component.js create mode 100755 packages/scandipwa/src/route/StyleGuidePage/StyleGuidePage.component.tsx rename packages/scandipwa/src/route/StyleGuidePage/{StyleGuidePage.container.js => StyleGuidePage.container.tsx} (96%) rename packages/scandipwa/src/route/UrlRewrites/{UrlRewrites.component.js => UrlRewrites.component.tsx} (58%) rename packages/scandipwa/src/route/UrlRewrites/{UrlRewrites.container.js => UrlRewrites.container.tsx} (98%) rename packages/scandipwa/src/route/WishlistSharedPage/{WishlistSharedPage.component.js => WishlistSharedPage.component.tsx} (73%) rename packages/scandipwa/src/route/WishlistSharedPage/{WishlistSharedPage.container.js => WishlistSharedPage.container.tsx} (99%) diff --git a/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx index 203ab78b4e..f7a9776b32 100644 --- a/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx +++ b/packages/scandipwa/src/component/AddIcon/AddIcon.component.tsx @@ -13,12 +13,12 @@ import { PureComponent } from 'react'; import { ReactElement } from 'Type/Common.type'; -import { AddIconProps } from './AddIcon.type'; +import { AddIconComponentProps } from './AddIcon.type'; import './AddIcon.style'; /** @namespace Component/AddIcon/Component */ -export class AddIcon extends PureComponent { +export class AddIcon extends PureComponent { static defaultProps = { isPrimary: false }; diff --git a/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts b/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts index f12106c9a9..dc841e7ba7 100644 --- a/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts +++ b/packages/scandipwa/src/component/AddIcon/AddIcon.type.ts @@ -9,6 +9,6 @@ * @link https://github.com/scandipwa/scandipwa */ -export interface AddIconProps { +export interface AddIconComponentProps { isPrimary: boolean; } diff --git a/packages/scandipwa/src/component/AddToCart/AddToCart.container.js b/packages/scandipwa/src/component/AddToCart/AddToCart.container.tsx similarity index 98% rename from packages/scandipwa/src/component/AddToCart/AddToCart.container.js rename to packages/scandipwa/src/component/AddToCart/AddToCart.container.tsx index 0e77961ca6..d163601dab 100644 --- a/packages/scandipwa/src/component/AddToCart/AddToCart.container.js +++ b/packages/scandipwa/src/component/AddToCart/AddToCart.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import PRODUCT_TYPE from 'Component/Product/Product.config'; @@ -231,7 +232,7 @@ export class AddToCartContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( { }; __construct(props: unknown): void { - if (super.__construct) { - super.__construct(props); - } + super.__construct?.(props); this.configureAppBasedOnEnvironment(); this.configureApp(); diff --git a/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.container.js b/packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.container.tsx similarity index 100% rename from packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.container.js rename to packages/scandipwa/src/component/Breadcrumbs/Breadcrumbs.container.tsx diff --git a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx index b59bbf130b..e5402dd6fb 100644 --- a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx +++ b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.component.tsx @@ -19,12 +19,12 @@ import { noopFn } from 'Util/Common'; import CSS from 'Util/CSS'; import { isRtl } from 'Util/CSS/CSS'; -import { CarouselScrollComponentProps } from './CarouselScroll.type'; +import { CarouselScrollComponentProps, CarouselScrollComponentState } from './CarouselScroll.type'; import './CarouselScroll.style'; /** @namespace Component/CarouselScroll/Component */ -export class CarouselScroll extends PureComponent { +export class CarouselScroll extends PureComponent { static defaultProps = { showArrow: true, showedItemCount: 1, @@ -33,18 +33,20 @@ export class CarouselScroll extends PureComponent isImageZoomPopupActive: false }; - state = { + state: CarouselScrollComponentState = { activeItemId: 0, firstCarouselItemId: 0 }; itemRef = createRef(); - carouselRef = createRef(); + carouselRef = createRef(); - handleArrowClick = this.handleArrowClick.bind(this); - - handleChange = this.handleChange.bind(this); + __construct(props: CarouselScrollComponentProps): void { + super.__construct?.(props); + this.handleArrowClick = this.handleArrowClick.bind(this); + this.handleChange = this.handleChange.bind(this); + } componentDidMount(): void { const { showedItemCount } = this.props; diff --git a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts index 9a5c85e344..7d13baf862 100644 --- a/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts +++ b/packages/scandipwa/src/component/CarouselScroll/CarouselScroll.type.ts @@ -15,7 +15,12 @@ export interface CarouselScrollComponentProps { children: Children; showArrow: boolean; showedItemCount: number; - onChange: () => void; + onChange: (activeItem: number) => void; activeItemId: number; isImageZoomPopupActive: boolean; } + +export interface CarouselScrollComponentState { + activeItemId: number; + firstCarouselItemId: number; +} diff --git a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx index 1941d4c1d8..40df7f4b92 100644 --- a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx +++ b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.component.tsx @@ -12,18 +12,15 @@ import { PureComponent } from 'react'; import ChevronIcon from 'Component/ChevronIcon'; -import { ModsType, ReactElement } from 'Type/Common.type'; +import { ReactElement } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; +import { CarouselScrollArrowComponentProps } from './CarouselScrollArrow.type'; + import './CarouselScrollArrow.style'; /** @namespace Component/CarouselScrollArrow/Component */ -export class CarouselScrollArrow extends PureComponent { - static propTypes = { - mods: ModsType, - onClick: PropTypes.func - }; - +export class CarouselScrollArrow extends PureComponent { static defaultProps = { mods: {}, onClick: noopFn diff --git a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.js b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.tsx similarity index 88% rename from packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.js rename to packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.tsx index 15910ba04d..326db1f8f9 100644 --- a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.js +++ b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.container.tsx @@ -10,6 +10,7 @@ */ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import CarouselScrollArrow from './CarouselScrollArrow.component'; @@ -41,11 +42,11 @@ export class CarouselScrollArrowContainer extends PureComponent { onClick(isNextArrow); } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.type.ts b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.type.ts new file mode 100644 index 0000000000..06e5ccc2e8 --- /dev/null +++ b/packages/scandipwa/src/component/CarouselScrollArrow/CarouselScrollArrow.type.ts @@ -0,0 +1,17 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Mods } from 'Type/Common.type'; + +export interface CarouselScrollArrowComponentProps { + mods: Mods; + onClick: () => void; +} diff --git a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx index 7e31bea16f..3f371adcac 100644 --- a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx +++ b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.component.tsx @@ -11,19 +11,14 @@ import { PureComponent } from 'react'; -import { ChildrenType, ReactElement, RefType } from 'Type/Common.type'; +import { ReactElement } from 'Type/Common.type'; + +import { CarouselScrollItemComponentProps } from './CarouselScrollItem.type'; import './CarouselScrollItem.style'; /** @namespace Component/CarouselScrollItem/Component */ -export class CarouselScrollItem extends PureComponent { - static propTypes = { - isActive: PropTypes.bool.isRequired, - itemRef: RefType.isRequired, - onClick: PropTypes.func.isRequired, - children: ChildrenType.isRequired - }; - +export class CarouselScrollItem extends PureComponent { render(): ReactElement { const { isActive, diff --git a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.js b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.tsx similarity index 90% rename from packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.js rename to packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.tsx index 713d7ca9c2..3d4a24c54b 100644 --- a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.js +++ b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.container.tsx @@ -10,6 +10,7 @@ */ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { ChildrenType, RefType } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; @@ -56,11 +57,11 @@ export class CarouselScrollItemContainer extends PureComponent { onClick(position); } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.type.ts b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.type.ts new file mode 100644 index 0000000000..5f3c9b5dc1 --- /dev/null +++ b/packages/scandipwa/src/component/CarouselScrollItem/CarouselScrollItem.type.ts @@ -0,0 +1,19 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Children, Ref } from 'Type/Common.type'; + +export interface CarouselScrollItemComponentProps { + isActive: boolean; + itemRef: Ref; + onClick: ()=> void; + children: Children; +} diff --git a/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx b/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx index 37f3f5e3f5..21f25fac33 100644 --- a/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx +++ b/packages/scandipwa/src/component/CartCoupon/CartCoupon.component.tsx @@ -12,41 +12,35 @@ import { PureComponent } from 'react'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import { FieldType } from 'Component/Field/Field.config'; import Form from 'Component/Form'; import Loader from 'Component/Loader'; -import { MixType, ReactElement } from 'Type/Common.type'; +import { ReactElement } from 'Type/Common.type'; + +import { CartCouponComponentProps, CartCouponComponentState } from './CartCoupon.type'; import './CartCoupon.style'; /** @namespace Component/CartCoupon/Component */ -export class CartCoupon extends PureComponent { - static propTypes = { - isLoading: PropTypes.bool.isRequired, - couponCode: PropTypes.string, - handleApplyCouponToCart: PropTypes.func.isRequired, - handleRemoveCouponFromCart: PropTypes.func.isRequired, - mix: MixType.isRequired, - title: PropTypes.string.isRequired - }; - +export class CartCoupon extends PureComponent { static defaultProps = { couponCode: '' }; - state = { + state: CartCouponComponentState = { enteredCouponCode: '' }; - handleCouponCodeChange = this.handleCouponCodeChange.bind(this); + __construct(props: CartCouponComponentProps): void { + super.__construct?.(props); - handleApplyCoupon = this.handleApplyCoupon.bind(this); - - handleRemoveCoupon = this.handleRemoveCoupon.bind(this); - - handleFormSubmit = this.handleFormSubmit.bind(this); + this.handleCouponCodeChange = this.handleCouponCodeChange.bind(this); + this.handleApplyCoupon = this.handleApplyCoupon.bind(this); + this.handleRemoveCoupon = this.handleRemoveCoupon.bind(this); + this.handleFormSubmit = this.handleFormSubmit.bind(this); + } - handleCouponCodeChange(event, field) { + handleCouponCodeChange(event: Event, field: HTMLInputElement): void { const { value = '' } = field; this.setState({ @@ -54,14 +48,14 @@ export class CartCoupon extends PureComponent { }); } - handleApplyCoupon() { + handleApplyCoupon(): void { const { handleApplyCouponToCart } = this.props; const { enteredCouponCode } = this.state; handleApplyCouponToCart(enteredCouponCode); } - handleRemoveCoupon() { + handleRemoveCoupon(): void { const { handleRemoveCouponFromCart } = this.props; handleRemoveCouponFromCart(); @@ -73,7 +67,7 @@ export class CartCoupon extends PureComponent { }); } - handleFormSubmit() { + handleFormSubmit(): void { const { couponCode } = this.props; if (couponCode) { @@ -85,14 +79,14 @@ export class CartCoupon extends PureComponent { this.handleApplyCoupon(); } - renderApplyCoupon() { + renderApplyCoupon(): ReactElement { const { enteredCouponCode } = this.state; return ( <>
    ); } diff --git a/packages/scandipwa/src/component/CartCoupon/CartCoupon.type.ts b/packages/scandipwa/src/component/CartCoupon/CartCoupon.type.ts new file mode 100644 index 0000000000..1ca2bd699b --- /dev/null +++ b/packages/scandipwa/src/component/CartCoupon/CartCoupon.type.ts @@ -0,0 +1,25 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Mix } from 'Type/Common.type'; + +export interface CartCouponComponentProps { + isLoading: boolean; + couponCode: string; + handleApplyCouponToCart: (coupon: string) => void; + handleRemoveCouponFromCart: () => void; + mix: Mix; + title: string; +} + +export interface CartCouponComponentState { + enteredCouponCode: string; +} diff --git a/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx index 255909973f..05aa0cbbc7 100644 --- a/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx +++ b/packages/scandipwa/src/component/CartIcon/CartIcon.component.tsx @@ -13,12 +13,12 @@ import { PureComponent } from 'react'; import { ReactElement } from 'Type/Common.type'; -import { CartIconProps } from './CartIcon.type'; +import { CartIconComponentProps } from './CartIcon.type'; import './CartIcon.style'; /** @namespace Component/CartIcon/Component */ -export class CartIcon extends PureComponent { +export class CartIcon extends PureComponent { static defaultProps = { isActive: false }; diff --git a/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts b/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts index fdcf2a551d..af760a7181 100644 --- a/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts +++ b/packages/scandipwa/src/component/CartIcon/CartIcon.type.ts @@ -9,6 +9,6 @@ * @link https://github.com/scandipwa/scandipwa */ -export interface CartIconProps { +export interface CartIconComponentProps { isActive: boolean; } diff --git a/packages/scandipwa/src/component/CartItem/CartItem.component.tsx b/packages/scandipwa/src/component/CartItem/CartItem.component.tsx index 1c851e0959..195461a373 100644 --- a/packages/scandipwa/src/component/CartItem/CartItem.component.tsx +++ b/packages/scandipwa/src/component/CartItem/CartItem.component.tsx @@ -9,20 +9,27 @@ * @link https://github.com/scandipwa/base-theme */ -import { PureComponent } from 'react'; +import { KeyboardEvent, MouseEvent, PureComponent } from 'react'; import CartItemPrice from 'Component/CartItemPrice'; import CloseIcon from 'Component/CloseIcon'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import { FieldType } from 'Component/Field/Field.config'; import Image from 'Component/Image'; import Link from 'Component/Link'; import Loader from 'Component/Loader'; import { ReactElement } from 'Type/Common.type'; -import { CartItemType } from 'Type/MiniCart.type'; -import { UrlType } from 'Type/Router.type'; +import { + GQLSelectedBundleOption, + GQLSelectedBundleOptionValue, + GQLSelectedCustomizableOption, + GQLSelectedCustomizableOptionValue, + GQLSelectedDownloadableLinks +} from 'Type/Graphql.type'; import { formatPrice } from 'Util/Price'; -import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; +import { ValidationInputType } from 'Util/Validator/Config'; + +import { CartItemComponentProps } from './CartItem.type'; import './CartItem.style'; @@ -31,26 +38,7 @@ import './CartItem.style'; * @class CartItem * @namespace Component/CartItem/Component */ -export class CartItem extends PureComponent { - static propTypes = { - isLoading: PropTypes.bool.isRequired, - item: CartItemType.isRequired, - currency_code: PropTypes.string.isRequired, - isEditing: PropTypes.bool.isRequired, - isCartOverlay: PropTypes.bool, - handleRemoveItem: PropTypes.func.isRequired, - minSaleQuantity: PropTypes.number.isRequired, - maxSaleQuantity: PropTypes.number.isRequired, - handleChangeQuantity: PropTypes.func.isRequired, - linkTo: LinkType.isRequired, - thumbnail: PropTypes.string.isRequired, - isProductInStock: PropTypes.bool.isRequired, - isMobile: PropTypes.bool.isRequired, - optionsLabels: PropTypes.arrayOf(PropTypes.string).isRequired, - isMobileLayout: PropTypes.bool, - showLoader: PropTypes.bool - }; - +export class CartItem extends PureComponent { static defaultProps = { isCartOverlay: false, isMobileLayout: false, @@ -59,7 +47,7 @@ export class CartItem extends PureComponent { renderProductOption = this._renderProductOption.bind(this); - renderProductConfigurations() { + renderProductConfigurations(): ReactElement { const { optionsLabels } = this.props; return ( @@ -72,7 +60,7 @@ export class CartItem extends PureComponent { ); } - renderWrapperContent() { + renderWrapperContent(): ReactElement { const { isEditing, isMobileLayout } = this.props; if (isMobileLayout) { @@ -82,7 +70,7 @@ export class CartItem extends PureComponent { return isEditing ? this.renderDesktopContent() : this.renderDesktopSummary(); } - renderDesktopSummary() { + renderDesktopSummary(): ReactElement { return (
    { this.renderImage() } @@ -99,7 +87,7 @@ export class CartItem extends PureComponent { ); } - renderTitle() { + renderTitle(): ReactElement { const { isMobileLayout } = this.props; const { @@ -122,7 +110,7 @@ export class CartItem extends PureComponent { ); } - renderMobileContent() { + renderMobileContent(): ReactElement { const { isMobileLayout, isProductInStock } = this.props; return ( @@ -142,7 +130,7 @@ export class CartItem extends PureComponent { ); } - renderDesktopContent() { + renderDesktopContent(): ReactElement { return (
    @@ -161,7 +149,7 @@ export class CartItem extends PureComponent { ); } - renderContent() { + renderContent(): ReactElement { const { linkTo = {}, isProductInStock, isMobile } = this.props; if (!isProductInStock || Object.keys(linkTo).length === 0 || isMobile) { @@ -180,7 +168,9 @@ export class CartItem extends PureComponent { ); } - renderProductOptionLabel(option) { + renderProductOptionLabel( + option: GQLSelectedCustomizableOption | GQLSelectedDownloadableLinks & { values?: never[] } + ): ReactElement { const { label, values = [] } = option; if (Array.isArray(values) && values.length > 0) { @@ -188,7 +178,9 @@ export class CartItem extends PureComponent { <> { `${label}: ` } - { values.map(({ label, value }) => label || value).join(', ') } + { (values as GQLSelectedCustomizableOptionValue[]) + .map(({ label, value }) => label || value) + .join(', ') } ); @@ -197,7 +189,7 @@ export class CartItem extends PureComponent { return label; } - renderBundleProductOptionValue(value, index) { + renderBundleProductOptionValue(value: GQLSelectedBundleOptionValue, index: number): ReactElement { const { label, quantity, price, id } = value; @@ -212,7 +204,7 @@ export class CartItem extends PureComponent { ); } - renderBundleProductOptionLabel(option) { + renderBundleProductOptionLabel(option: GQLSelectedBundleOption): ReactElement { const { label, values = [] } = option; if (values.length === 0) { @@ -225,13 +217,13 @@ export class CartItem extends PureComponent { { `${label}:` }
    - { values.map(this.renderBundleProductOptionValue.bind(this)) } + { (values as GQLSelectedBundleOptionValue[]).map(this.renderBundleProductOptionValue.bind(this)) }
    ); } - renderProductBundleOption(option) { + renderProductBundleOption(option: GQLSelectedBundleOption): ReactElement { const { id } = option; return ( @@ -246,7 +238,7 @@ export class CartItem extends PureComponent { ); } - renderProductBundleOptions(itemOptions = []) { + renderProductBundleOptions(itemOptions: GQLSelectedBundleOption[] = []): ReactElement { if (!itemOptions.length) { return null; } @@ -261,7 +253,9 @@ export class CartItem extends PureComponent { ); } - _renderProductOption(option) { + _renderProductOption( + option: GQLSelectedCustomizableOption | GQLSelectedDownloadableLinks + ): ReactElement { const { id } = option; return ( @@ -275,7 +269,7 @@ export class CartItem extends PureComponent { ); } - renderProductOptions(itemOptions = []) { + renderProductOptions(itemOptions: GQLSelectedCustomizableOption[] = []): ReactElement { if (!itemOptions.length) { return null; } @@ -290,7 +284,7 @@ export class CartItem extends PureComponent { ); } - renderProductLinks(itemOptions = []) { + renderProductLinks(itemOptions: GQLSelectedDownloadableLinks[] = []): ReactElement { if (!itemOptions.length) { return null; } @@ -316,12 +310,12 @@ export class CartItem extends PureComponent { ); } - renderProductName() { + renderProductName(): ReactElement { const { item: { product: { - name - } + name = '' + } = {} } } = this.props; @@ -335,7 +329,7 @@ export class CartItem extends PureComponent { ); } - renderProductPrice() { + renderProductPrice(): ReactElement { const { currency_code, item: { @@ -360,7 +354,7 @@ export class CartItem extends PureComponent { ); } - renderOutOfStockMessage() { + renderOutOfStockMessage(): ReactElement { const { isProductInStock } = this.props; if (isProductInStock) { @@ -374,11 +368,11 @@ export class CartItem extends PureComponent { ); } - quantityClickHandler(e) { + quantityClickHandler(e: MouseEvent | KeyboardEvent): void { e.preventDefault(); } - renderQuantityChangeField() { + renderQuantityChangeField(): ReactElement { const { item: { sku, @@ -408,11 +402,11 @@ export class CartItem extends PureComponent { onClick={ this.quantityClickHandler } onKeyDown={ this.quantityClickHandler } role="button" - tabIndex="-1" + tabIndex={ -1 } > ({ /** @namespace Component/CartItem/Container */ export class CartItemContainer extends PureComponent { static propTypes = { - item: CartItemType.isRequired, + item: CartItem.isRequired, currency_code: PropTypes.string.isRequired, changeItemQty: PropTypes.func.isRequired, removeProduct: PropTypes.func.isRequired, @@ -386,7 +387,7 @@ export class CartItemContainer extends PureComponent { } } - renderRightSideContent() { + renderRightSideContent(): ReactElement { const { handleRemoveItem } = this.containerFunctions; return ( @@ -401,7 +402,7 @@ export class CartItemContainer extends PureComponent { ); } - render() { + render(): ReactElement { const { isLoading } = this.state; return ( diff --git a/packages/scandipwa/src/component/CartItem/CartItem.type.ts b/packages/scandipwa/src/component/CartItem/CartItem.type.ts new file mode 100644 index 0000000000..18700591e4 --- /dev/null +++ b/packages/scandipwa/src/component/CartItem/CartItem.type.ts @@ -0,0 +1,32 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { CartItem } from 'Type/MiniCart.type'; +import { UrlType } from 'Type/Router.type'; + +export interface CartItemComponentProps { + isLoading: boolean; + item: CartItem; + currency_code: string; + isEditing: boolean; + isCartOverlay: boolean; + handleRemoveItem: () => void; + minSaleQuantity: number; + maxSaleQuantity: number; + handleChangeQuantity: () => void; + linkTo: UrlType; + thumbnail: string; + isProductInStock: boolean; + isMobile: boolean; + optionsLabels: string[]; + isMobileLayout: boolean; + showLoader: boolean; +} diff --git a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx index a6707835ed..455e9fefe0 100644 --- a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx +++ b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.component.tsx @@ -11,23 +11,18 @@ import { PureComponent } from 'react'; -import { MixType, ReactElement } from 'Type/Common.type'; +import { ReactElement } from 'Type/Common.type'; import { formatPrice, roundPrice } from 'Util/Price'; -/** @namespace Component/CartItemPrice/Component */ -export class CartItemPrice extends PureComponent { - static propTypes = { - price: PropTypes.number.isRequired, - subPrice: PropTypes.number, - currency_code: PropTypes.string.isRequired, - mix: MixType.isRequired - }; +import { CartItemPriceComponentProps } from './CartItemPrice.type'; +/** @namespace Component/CartItemPrice/Component */ +export class CartItemPrice extends PureComponent { static defaultProps = { subPrice: null }; - renderPrice() { + renderPrice(): ReactElement { const { price, currency_code } = this.props; const value = roundPrice(price); @@ -38,7 +33,7 @@ export class CartItemPrice extends PureComponent { ); } - renderSubPrice() { + renderSubPrice(): ReactElement { const { subPrice, currency_code } = this.props; if (!subPrice) { diff --git a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.js b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.tsx similarity index 93% rename from packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.js rename to packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.tsx index ead0f8f9ca..f6348a4fad 100644 --- a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.js +++ b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { MixType } from 'Type/Common.type'; @@ -53,10 +54,10 @@ export class CartItemPriceContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.type.ts b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.type.ts new file mode 100644 index 0000000000..6b7066a520 --- /dev/null +++ b/packages/scandipwa/src/component/CartItemPrice/CartItemPrice.type.ts @@ -0,0 +1,19 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { Mix } from 'Type/Common.type'; + +export interface CartItemPriceComponentProps { + price: number; + subPrice: number; + currency_code: string; + mix: Mix; +} diff --git a/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx b/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx index ad9da35d27..3d2076227f 100644 --- a/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx +++ b/packages/scandipwa/src/component/CartOverlay/CartOverlay.component.tsx @@ -13,34 +13,21 @@ import { PureComponent } from 'react'; import CartItem from 'Component/CartItem'; import CmsBlock from 'Component/CmsBlock'; -import { CART_OVERLAY } from 'Component/Header/Header.config'; +import { Page } from 'Component/Header/Header.config'; import Link from 'Component/Link'; import LockIcon from 'Component/LockIcon'; import Overlay from 'Component/Overlay'; import { OVERLAY_PLACEHOLDER } from 'Component/PopupSuspense/PopupSuspense.config'; import { ReactElement } from 'Type/Common.type'; -import { CartDisplayType, TotalsType } from 'Type/MiniCart.type'; import { scrollToTop } from 'Util/Browser'; import { formatPrice } from 'Util/Price'; +import { CartOverlayComponentProps } from './CartOverlay.type'; + import './CartOverlay.style'; /** @namespace Component/CartOverlay/Component */ -export class CartOverlay extends PureComponent { - static propTypes = { - totals: TotalsType.isRequired, - changeHeaderState: PropTypes.func.isRequired, - handleCheckoutClick: PropTypes.func.isRequired, - currencyCode: PropTypes.string, - showOverlay: PropTypes.func.isRequired, - activeOverlay: PropTypes.string.isRequired, - hasOutOfStockProductsInCart: PropTypes.bool, - cartTotalSubPrice: PropTypes.number, - cartDisplaySettings: CartDisplayType.isRequired, - isMobile: PropTypes.bool.isRequired, - onCartItemLoading: PropTypes.func - }; - +export class CartOverlay extends PureComponent { static defaultProps = { hasOutOfStockProductsInCart: false, onCartItemLoading: null, @@ -52,17 +39,17 @@ export class CartOverlay extends PureComponent { const { showOverlay, isMobile, activeOverlay } = this.props; if (!isMobile && activeOverlay === OVERLAY_PLACEHOLDER) { - showOverlay(CART_OVERLAY); + showOverlay(Page.CART_OVERLAY); } } - renderPriceLine(price) { + renderPriceLine(price: number): ReactElement { const { currencyCode } = this.props; return formatPrice(price, currencyCode); } - renderCartItems() { + renderCartItems(): ReactElement { const { totals: { items = [], @@ -91,7 +78,7 @@ export class CartOverlay extends PureComponent { ); } - renderNoCartItems() { + renderNoCartItems(): ReactElement { return (

    { __('You have no items in your shopping cart.') } @@ -99,7 +86,7 @@ export class CartOverlay extends PureComponent { ); } - renderOrderTotalExlTax() { + renderOrderTotalExlTax(): ReactElement { const { cartTotalSubPrice } = this.props; if (!cartTotalSubPrice) { @@ -113,7 +100,7 @@ export class CartOverlay extends PureComponent { ); } - renderTotals() { + renderTotals(): ReactElement { const { totals: { grand_total = 0 } } = this.props; return ( @@ -130,7 +117,7 @@ export class CartOverlay extends PureComponent { ); } - renderTax() { + renderTax(): ReactElement { const { totals: { tax_amount = 0 @@ -155,7 +142,7 @@ export class CartOverlay extends PureComponent { ); } - renderCouponCode(code) { + renderCouponCode(code: string): ReactElement { if (!code) { return null; } @@ -163,12 +150,12 @@ export class CartOverlay extends PureComponent { return { `${code.toUpperCase()}:` }; } - renderDiscount() { + renderDiscount(): ReactElement { const { totals: { applied_rule_ids, discount_amount, - coupon_code + coupon_code = '' } } = this.props; @@ -192,7 +179,7 @@ export class CartOverlay extends PureComponent { ); } - renderSecureCheckoutButton() { + renderSecureCheckoutButton(): ReactElement { const { handleCheckoutClick, hasOutOfStockProductsInCart } = this.props; return ( @@ -209,7 +196,7 @@ export class CartOverlay extends PureComponent { ); } - renderActions() { + renderActions(): ReactElement { return (

    ; @@ -261,7 +252,7 @@ export class CartOverlay extends PureComponent { ); } - renderOutOfStockProductsWarning() { + renderOutOfStockProductsWarning(): ReactElement { const { hasOutOfStockProductsInCart } = this.props; if (!hasOutOfStockProductsInCart) { @@ -280,7 +271,7 @@ export class CartOverlay extends PureComponent { return ( diff --git a/packages/scandipwa/src/component/CartOverlay/CartOverlay.container.js b/packages/scandipwa/src/component/CartOverlay/CartOverlay.container.tsx similarity index 97% rename from packages/scandipwa/src/component/CartOverlay/CartOverlay.container.js rename to packages/scandipwa/src/component/CartOverlay/CartOverlay.container.tsx index e598881f0b..319c6c4b40 100644 --- a/packages/scandipwa/src/component/CartOverlay/CartOverlay.container.js +++ b/packages/scandipwa/src/component/CartOverlay/CartOverlay.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { CART_EDITING, CART_OVERLAY } from 'Component/Header/Header.config'; @@ -203,11 +204,11 @@ export class CartOverlayContainer extends PureComponent { this.setState({ isCartItemLoading }); } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CartOverlay/CartOverlay.type.ts b/packages/scandipwa/src/component/CartOverlay/CartOverlay.type.ts new file mode 100644 index 0000000000..7ece4c5097 --- /dev/null +++ b/packages/scandipwa/src/component/CartOverlay/CartOverlay.type.ts @@ -0,0 +1,26 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ + +import { CartDisplay, Totals } from 'Type/MiniCart.type'; + +export interface CartOverlayComponentProps { + totals: Totals; + changeHeaderState: () => void; + handleCheckoutClick: () => void; + currencyCode: string; + showOverlay: (overlay: string) => void; + activeOverlay: string; + hasOutOfStockProductsInCart: boolean; + cartTotalSubPrice: number; + cartDisplaySettings: CartDisplay; + isMobile: boolean; + onCartItemLoading: () => void; +} diff --git a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx index 7231614c33..a951678b2b 100644 --- a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx +++ b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.component.tsx @@ -29,7 +29,7 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute parameters: SelectedFiltersType.isRequired }; - renderSubCategories(option) { + renderSubCategories(option): ReactElement { const { getSubCategories } = this.props; const optionWithSubcategories = getSubCategories(option); @@ -42,7 +42,7 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute return this.renderDropdownOrSwatch(optionWithSubcategories); } - renderPriceSwatch(option) { + renderPriceSwatch(option): ReactElement { const { currencyCode } = this.props; const { attribute_options, ...priceOption } = option; @@ -65,7 +65,7 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute return this.renderDropdownOrSwatch(priceOption); } - renderDropdownOrSwatch(option) { + renderDropdownOrSwatch(option): ReactElement { const { isContentExpanded, getSubHeading @@ -96,7 +96,7 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute ); } - renderConfigurableAttributeValue(attribute) { + renderConfigurableAttributeValue(attribute): ReactElement { const { getIsConfigurableAttributeAvailable, handleOptionClick, @@ -120,7 +120,7 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute ); } - renderConfigurableOption(option) { + renderConfigurableOption(option): ReactElement { const { attribute_code } = option; switch (attribute_code) { @@ -133,14 +133,14 @@ export class CategoryConfigurableAttributes extends ProductConfigurableAttribute } } - renderConfigurableAttributes() { + renderConfigurableAttributes(): ReactElement { const { configurable_options } = this.props; return sortBySortOrder(Object.values(configurable_options), 'attribute_position') .map(this.renderConfigurableOption.bind(this)); } - renderDropdown(option) { + renderDropdown(option): ReactElement { const { attribute_values } = option; return ( diff --git a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.js b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.tsx similarity index 95% rename from packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.js rename to packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.tsx index 5251a70481..edb71f29fb 100644 --- a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.js +++ b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.container.tsx @@ -72,11 +72,11 @@ export class CategoryConfigurableAttributesContainer extends ProductConfigurable return optionWithSubcategories; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.type.ts b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.type.ts new file mode 100644 index 0000000000..6877a7aba8 --- /dev/null +++ b/packages/scandipwa/src/component/CategoryConfigurableAttributes/CategoryConfigurableAttributes.type.ts @@ -0,0 +1,10 @@ +/** + * ScandiPWA - Progressive Web App for Magento + * + * Copyright © Scandiweb, Inc. All rights reserved. + * See LICENSE for license details. + * + * @license OSL-3.0 (Open Software License ("OSL") v. 3.0) + * @package scandipwa/base-theme + * @link https://github.com/scandipwa/scandipwa + */ diff --git a/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx b/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx index bc7d8fd6fb..f78a8f5203 100644 --- a/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx +++ b/packages/scandipwa/src/component/CategoryDetails/CategoryDetails.component.tsx @@ -34,7 +34,7 @@ export class CategoryDetails extends PureComponent { isCurrentCategoryLoaded: true }; - renderCategoryText() { + renderCategoryText(): ReactElement { const { category: { name }, isCurrentCategoryLoaded @@ -51,7 +51,7 @@ export class CategoryDetails extends PureComponent { ); } - renderCategoryName() { + renderCategoryName(): ReactElement { const { category: { name, id } } = this.props; @@ -67,7 +67,7 @@ export class CategoryDetails extends PureComponent { ); } - renderCategoryDescription() { + renderCategoryDescription(): ReactElement { const { category: { description, id }, isCurrentCategoryLoaded @@ -84,7 +84,7 @@ export class CategoryDetails extends PureComponent { return ; } - renderCategoryDescriptionPlaceholder() { + renderCategoryDescriptionPlaceholder(): ReactElement { return (

    @@ -92,7 +92,7 @@ export class CategoryDetails extends PureComponent { ); } - renderCategoryImagePlaceholder() { + renderCategoryImagePlaceholder(): ReactElement { return ( { __(`The selected filter combination returned no results. @@ -130,7 +130,7 @@ export class CategoryFilterOverlay extends PureComponent { ); } - renderEmptyFilters() { + renderEmptyFilters(): ReactElement { return ( <> { this.renderNoResults() } @@ -140,11 +140,11 @@ export class CategoryFilterOverlay extends PureComponent { ); } - renderMinimalFilters() { + renderMinimalFilters(): ReactElement { return this.renderSeeResults(); } - renderDefaultFilters() { + renderDefaultFilters(): ReactElement { return ( <> { this.renderHeading() } @@ -157,7 +157,7 @@ export class CategoryFilterOverlay extends PureComponent { ); } - renderContent() { + renderContent(): ReactElement { const { totalPages, areFiltersEmpty, diff --git a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.js b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.tsx similarity index 91% rename from packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.js rename to packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.tsx index e045066111..11f08b172c 100644 --- a/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.js +++ b/packages/scandipwa/src/component/CategoryFilterOverlay/CategoryFilterOverlay.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; @@ -95,7 +96,7 @@ export class CategoryFilterOverlayContainer extends PureComponent { const customFilters = isFull ? `${pathname}?customFilters=` : ''; const formattedFilters = this._formatSelectedFiltersString(selectedFilters); - return `${ customFilters }${ formattedFilters }`; + return `${customFilters}${formattedFilters}`; } getCustomFilterUrl(filterKey, value) { @@ -110,9 +111,9 @@ export class CategoryFilterOverlayContainer extends PureComponent { if (!filter) { return acc; } - const [key, value] = filter.split(':'); + const [ key, value ] = filter.split(':'); - return { ...acc, [key]: value.split(',') }; + return { ...acc, [ key ]: value.split(',') }; }, {}); } @@ -120,11 +121,11 @@ export class CategoryFilterOverlayContainer extends PureComponent { const prevCustomFilters = this._getSelectedFiltersFromUrl(); const customFilers = { ...prevCustomFilters, - [filterName]: filterArray + [ filterName ]: filterArray }; return Object.entries(customFilers) - .reduce((accumulator, [filterKey, filterValue]) => { + .reduce((accumulator, [ filterKey, filterValue ]) => { if (filterValue.length) { const filterValues = filterValue.sort().join(','); @@ -138,8 +139,8 @@ export class CategoryFilterOverlayContainer extends PureComponent { } _formatSelectedFiltersString(string) { - const hasTrailingSemicolon = string[string.length - 1] === ';'; - const hasLeadingSemicolon = string[0] === ';'; + const hasTrailingSemicolon = string[ string.length - 1 ] === ';'; + const hasLeadingSemicolon = string[ 0 ] === ';'; if (hasLeadingSemicolon) { return this._formatSelectedFiltersString(string.slice(0, -1)); @@ -264,9 +265,9 @@ export class CategoryFilterOverlayContainer extends PureComponent { const { location: { search } } = this.props; return search.substr(1).split('&').reduce((acc, part) => { - const [key, value] = part.split('='); + const [ key, value ] = part.split('='); - return { ...acc, [key]: value }; + return { ...acc, [ key ]: value }; }, {}); } @@ -280,8 +281,8 @@ export class CategoryFilterOverlayContainer extends PureComponent { */ _getNewFilterArray(filterKey, value) { const { customFiltersValues, customFiltersValues: { price } } = this.props; - const newFilterArray = customFiltersValues[filterKey] !== undefined - ? Array.from(customFiltersValues[filterKey]) + const newFilterArray = customFiltersValues[ filterKey ] !== undefined + ? Array.from(customFiltersValues[ filterKey ]) : []; const filterValueIndex = newFilterArray.indexOf(value); @@ -293,7 +294,7 @@ export class CategoryFilterOverlayContainer extends PureComponent { // if price is already selected and new other price is selected, replace return price && price.includes(value) ? [] - : [value]; + : [ value ]; } if (filterValueIndex === -1) { @@ -305,11 +306,11 @@ export class CategoryFilterOverlayContainer extends PureComponent { return newFilterArray; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.container.js b/packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.container.tsx similarity index 100% rename from packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.container.js rename to packages/scandipwa/src/component/CategoryItemsCount/CategoryItemsCount.container.tsx diff --git a/packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.js b/packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.tsx similarity index 96% rename from packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.js rename to packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.tsx index 36c7174b53..6070590076 100644 --- a/packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.js +++ b/packages/scandipwa/src/component/CategoryProductList/CategoryProductList.container.tsx @@ -10,6 +10,7 @@ */ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import ProductList from 'Component/ProductList'; @@ -161,11 +162,11 @@ export class CategoryProductListContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx b/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx index d7ed51eb47..54ef91079d 100644 --- a/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx +++ b/packages/scandipwa/src/component/CategorySort/CategorySort.component.tsx @@ -12,7 +12,7 @@ import { PureComponent } from 'react'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import TextPlaceholder from 'Component/TextPlaceholder'; import { ReactElement } from 'Type/Common.type'; import { SortDirectionType } from 'Type/Direction.type'; @@ -53,7 +53,7 @@ export class CategorySort extends PureComponent { onSortChange(direction, key); } - renderPlaceholder() { + renderPlaceholder(): ReactElement { return (

    @@ -61,7 +61,7 @@ export class CategorySort extends PureComponent { ); } - renderSortField() { + renderSortField(): ReactElement { const { sortKey, sortDirection, @@ -75,7 +75,7 @@ export class CategorySort extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx index 656c9c94e0..9d3cc4f4f1 100644 --- a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx +++ b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.component.tsx @@ -64,7 +64,7 @@ export class CheckoutAddressBook extends PureComponent { onAddressSelect({}); } - renderNoAddresses() { + renderNoAddresses(): ReactElement { return (

    { __('You have no configured addresses.') }

    @@ -77,13 +77,13 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderLoading() { + renderLoading(): ReactElement { return ( ); } - renderAddress(address, index) { + renderAddress(address, index): ReactElement { const { onAddressSelect, selectedAddressId } = this.props; const addressNumber = index + 1; const { id } = address; @@ -100,7 +100,7 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderAddressList() { + renderAddressList(): ReactElement { const { customer: { addresses } } = this.props; if (!addresses) { @@ -114,7 +114,7 @@ export class CheckoutAddressBook extends PureComponent { return addresses.map(this.renderAddress); } - renderHeading() { + renderHeading(): ReactElement { const { isBilling } = this.props; if (isBilling) { @@ -128,7 +128,7 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderCustomAddress() { + renderCustomAddress(): ReactElement { const { isBilling, onShippingEstimationFieldsChange, isSubmitted } = this.props; const formPortalId = isBilling ? BILLING_STEP : SHIPPING_STEP; @@ -142,7 +142,7 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderOptionalCustomAddress() { + renderOptionalCustomAddress(): ReactElement { const { isCustomAddressExpanded } = this.state; return ( @@ -165,7 +165,7 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderSignedInContent() { + renderSignedInContent(): ReactElement { return ( <>
    @@ -176,11 +176,11 @@ export class CheckoutAddressBook extends PureComponent { ); } - renderGuestContent() { + renderGuestContent(): ReactElement { return this.renderCustomAddress(); } - renderContent() { + renderContent(): ReactElement { if (isSignedIn()) { return this.renderSignedInContent(); } diff --git a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js rename to packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.tsx index f4ddad72ee..d6f34d8104 100644 --- a/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.js +++ b/packages/scandipwa/src/component/CheckoutAddressBook/CheckoutAddressBook.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { CustomerType } from 'Type/Account.type'; @@ -195,7 +196,7 @@ export class CheckoutAddressBookContainer extends PureComponent { }); } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx index bf40d19c75..26c5dda003 100644 --- a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx +++ b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.component.tsx @@ -34,7 +34,7 @@ export class CheckoutAddressTable extends MyAccountAddressTable { onClick(address); } - renderTable() { + renderTable(): ReactElement { const { isSelected } = this.props; return ( diff --git a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.js b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.tsx similarity index 91% rename from packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.js rename to packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.tsx index 336598ebbb..36ac301ad3 100644 --- a/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.js +++ b/packages/scandipwa/src/component/CheckoutAddressTable/CheckoutAddressTable.container.tsx @@ -38,11 +38,11 @@ export class CheckoutAddressTableContainer extends MyAccountAddressTableContaine }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx index 5a8616fc5a..49319c2aff 100644 --- a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx +++ b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.component.tsx @@ -15,7 +15,7 @@ import CheckoutAddressBook from 'Component/CheckoutAddressBook'; import CheckoutPayments from 'Component/CheckoutPayments'; import CheckoutTermsAndConditionsPopup from 'Component/CheckoutTermsAndConditionsPopup'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import Form from 'Component/Form'; import { STORE_IN_PICK_UP_METHOD_CODE } from 'Component/StoreInPickUp/StoreInPickUp.config'; import { BILLING_STEP } from 'Route/Checkout/Checkout.config'; @@ -93,7 +93,7 @@ export class CheckoutBilling extends PureComponent { showPopup(); } - renderTermsAndConditions() { + renderTermsAndConditions(): ReactElement { const { termsAreEnabled, termsAndConditions @@ -121,7 +121,7 @@ export class CheckoutBilling extends PureComponent { htmlFor="termsAndConditions" > { __('Billing address') } @@ -277,7 +277,7 @@ export class CheckoutBilling extends PureComponent { ); } - renderAddresses() { + renderAddresses(): ReactElement { return ( <> { this.renderHeading() } @@ -287,7 +287,7 @@ export class CheckoutBilling extends PureComponent { ); } - renderPayments() { + renderPayments(): ReactElement { const { paymentMethods, onPaymentMethodSelect, @@ -313,7 +313,7 @@ export class CheckoutBilling extends PureComponent { ); } - renderPopup() { + renderPopup(): ReactElement { return ; } diff --git a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.js b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.tsx similarity index 90% rename from packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.js rename to packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.tsx index f93f062d48..9285189469 100644 --- a/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.js +++ b/packages/scandipwa/src/component/CheckoutBilling/CheckoutBilling.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { KLARNA, PURCHASE_ORDER } from 'Component/CheckoutPayments/CheckoutPayments.config'; @@ -87,7 +88,7 @@ export class CheckoutBillingContainer extends PureComponent { const { paymentMethods } = props; if (!prevPaymentMethods.length && !paymentMethod) { - const [method] = paymentMethods; + const [ method ] = paymentMethods; const { code: paymentMethod } = method || {}; return { @@ -111,7 +112,7 @@ export class CheckoutBillingContainer extends PureComponent { super.__construct(props); const { paymentMethods, customer } = props; - const [method] = paymentMethods; + const [ method ] = paymentMethods; const { code: paymentMethod } = method || {}; this.state = { @@ -167,7 +168,7 @@ export class CheckoutBillingContainer extends PureComponent { || (default_billing && parseInt(default_billing, 10) === newShippingId) || (!default_billing) ) - && selectedShippingMethod !== STORE_IN_PICK_UP_METHOD_CODE; + && selectedShippingMethod !== STORE_IN_PICK_UP_METHOD_CODE; } onAddressSelect(id) { @@ -202,7 +203,7 @@ export class CheckoutBillingContainer extends PureComponent { const { name: title = __('Terms and Conditions'), content: text = __('There are no Terms and Conditions configured.') - } = termsAndConditions[0] || {}; + } = termsAndConditions[ 0 ] || {}; return showPopup({ title, text @@ -213,26 +214,26 @@ export class CheckoutBillingContainer extends PureComponent { const { paymentMethod: code } = this.state; switch (code) { - case KLARNA: - const [{ authorization_token }] = asyncData; - - return { - code, - additional_data: { - authorization_token - } - }; - - case PURCHASE_ORDER: - const { purchaseOrderNumber } = fields; - - return { - code, - purchase_order_number: purchaseOrderNumber - }; - - default: - return { code }; + case KLARNA: + const [ { authorization_token } ] = asyncData; + + return { + code, + additional_data: { + authorization_token + } + }; + + case PURCHASE_ORDER: + const { purchaseOrderNumber } = fields; + + return { + code, + purchase_order_number: purchaseOrderNumber + }; + + default: + return { code }; } } @@ -277,11 +278,11 @@ export class CheckoutBillingContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx index d501cba97a..79f1d7c411 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx +++ b/packages/scandipwa/src/component/CheckoutDeliveryOption/CheckoutDeliveryOption.component.tsx @@ -12,7 +12,7 @@ import { PureComponent } from 'react'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { ShippingMethodType } from 'Type/Checkout.type'; import { ReactElement } from 'Type/Common.type'; import { formatPrice } from 'Util/Price'; @@ -38,7 +38,7 @@ export class CheckoutDeliveryOption extends PureComponent { optionSubPrice: 0 }; - renderSubPrice() { + renderSubPrice(): ReactElement { const { currency, optionSubPrice @@ -67,7 +67,7 @@ export class CheckoutDeliveryOption extends PureComponent { return formatPrice(optionPrice, currency); } - renderPrice() { + renderPrice(): ReactElement { const { option: { available @@ -86,7 +86,7 @@ export class CheckoutDeliveryOption extends PureComponent { ); } - renderRate() { + renderRate(): ReactElement { const { option: { method_title, @@ -106,7 +106,7 @@ export class CheckoutDeliveryOption extends PureComponent { ); } - renderAvailabilityMessage() { + renderAvailabilityMessage(): ReactElement { const { option: { available @@ -127,7 +127,7 @@ export class CheckoutDeliveryOption extends PureComponent { ); } - renderRow() { + renderRow(): ReactElement { const { option: { carrier_title, @@ -177,7 +177,7 @@ export class CheckoutDeliveryOption extends PureComponent { disabled={ !available } > ); } diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx index 6cb89a1a1a..2cce771d1c 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx +++ b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.component.tsx @@ -36,7 +36,7 @@ export class CheckoutDeliveryOptions extends PureComponent { [STORE_IN_PICK_UP_METHOD_CODE]: this.handleSelectStoreInPickUp.bind(this) }; - renderHeading() { + renderHeading(): ReactElement { return (

    { __('Shipping method') } @@ -57,7 +57,7 @@ export class CheckoutDeliveryOptions extends PureComponent { handleSelectDeliveryMethod(); } - renderDeliveryOption(option) { + renderDeliveryOption(option): ReactElement { const { selectShippingMethod, selectedShippingMethod: { method_code: selectedMethodCode } @@ -76,7 +76,7 @@ export class CheckoutDeliveryOptions extends PureComponent { ); } - renderNoDeliveryOptions() { + renderNoDeliveryOptions(): ReactElement { return (

    { __('There are no shipping methods available, try different address.') } @@ -84,7 +84,7 @@ export class CheckoutDeliveryOptions extends PureComponent { ); } - renderShippingMethods() { + renderShippingMethods(): ReactElement { const { shippingMethods } = this.props; if (!shippingMethods.length) { @@ -94,7 +94,7 @@ export class CheckoutDeliveryOptions extends PureComponent { return shippingMethods.map(this.renderDeliveryOption.bind(this)); } - renderSelectedShippingMethod() { + renderSelectedShippingMethod(): ReactElement { const { selectedShippingMethod: { method_code } } = this.props; const render = this.shippingRenderMap[method_code]; diff --git a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js rename to packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.tsx index 51fc19e084..20fb78687c 100644 --- a/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.js +++ b/packages/scandipwa/src/component/CheckoutDeliveryOptions/CheckoutDeliveryOptions.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { SHIPPING_STEP } from 'Route/Checkout/Checkout.config'; @@ -117,7 +118,7 @@ export class CheckoutDeliveryOptionsContainer extends PureComponent { onShippingMethodSelect(shippingMethod); } - render() { + render(): ReactElement { return ( { __('Enter personal information') } @@ -108,7 +108,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderSignIn() { + renderSignIn(): ReactElement { const { signInState, onFormError, @@ -139,7 +139,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderConfirmEmail() { + renderConfirmEmail(): ReactElement { const { signInState, handleSignIn } = this.props; return ( @@ -150,7 +150,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderForgotPassword() { + renderForgotPassword(): ReactElement { const { signInState, onFormError, @@ -173,7 +173,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderForgotPasswordSuccess() { + renderForgotPasswordSuccess(): ReactElement { const { signInState, handleSignIn } = this.props; return ( @@ -184,7 +184,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderSignInForm() { + renderSignInForm(): ReactElement { const { signInState, onFormError, @@ -208,7 +208,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderFormBody() { + renderFormBody(): ReactElement { return ( <> { super.renderFormBody() } @@ -217,7 +217,7 @@ export class CheckoutGuestForm extends FieldForm { ); } - renderForm() { + renderForm(): ReactElement { const { signInState } = this.props; const { render } = this.renderMap[signInState] || {}; diff --git a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.js b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.js rename to packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.tsx index a0d7dcb30c..d6015bb1f0 100644 --- a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.js +++ b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { @@ -209,7 +210,7 @@ export class CheckoutGuestFormContainer extends PureComponent { onPasswordChange(password); } - render() { + render(): ReactElement { const { isGuestEmailSaved } = this.props; if (isSignedIn() || isGuestEmailSaved) { diff --git a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.form.js b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.form.js index 06fd803ba7..783abf3d9d 100644 --- a/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.form.js +++ b/packages/scandipwa/src/component/CheckoutGuestForm/CheckoutGuestForm.form.js @@ -9,9 +9,9 @@ * @link https://github.com/scandipwa/base-theme */ -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { validatePassword } from 'Util/Validator'; -import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; +import { ValidationInputType } from 'Util/Validator/Config'; /** * Form for guest checkout @@ -28,7 +28,7 @@ export const checkoutGuestForm = (props, events) => { return [ { - type: FIELD_TYPE.email, + type: FieldType.email, label: __('Email'), attr: { name: 'guest_email', @@ -41,14 +41,14 @@ export const checkoutGuestForm = (props, events) => { onChange: handleEmailInput }, addRequiredTag: true, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { - inputType: VALIDATION_INPUT_TYPE.email, + inputType: ValidationInputType.email, isRequired: true } }, - ...(isCreateUser ? [{ - type: FIELD_TYPE.password, + ...(isCreateUser ? [ { + type: FieldType.password, label: __('Create Password'), attr: { name: 'guest_password', @@ -59,13 +59,13 @@ export const checkoutGuestForm = (props, events) => { events: { onChange: handlePasswordInput }, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { - inputType: VALIDATION_INPUT_TYPE.password, + inputType: ValidationInputType.password, isRequired: true, match: (value) => validatePassword(value, range, minimunPasswordCharacter) } - }] : []) + } ] : []) ]; }; diff --git a/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx b/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx index 4a65d0b1cc..5bd3d395f7 100644 --- a/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx +++ b/packages/scandipwa/src/component/CheckoutOrderSummary/CheckoutOrderSummary.component.tsx @@ -67,7 +67,7 @@ export class CheckoutOrderSummary extends PureComponent { checkoutStep: null }; - renderPriceLine(price, title, mods) { + renderPriceLine(price, title, mods): ReactElement { if (!price) { return null; } @@ -84,7 +84,7 @@ export class CheckoutOrderSummary extends PureComponent { ); } - renderItem(item) { + renderItem(item): ReactElement { const { totals: { quote_currency_code } } = this.props; const { item_id } = item; @@ -98,7 +98,7 @@ export class CheckoutOrderSummary extends PureComponent { ); } - renderDiscount() { + renderDiscount(): ReactElement { const { totals: { applied_rule_ids, @@ -122,7 +122,7 @@ export class CheckoutOrderSummary extends PureComponent { ); } - renderMobileDiscount(coupon_code) { + renderMobileDiscount(coupon_code): ReactElement { return ( <>

    ; } - renderPurchaseOrderPayment() { + renderPurchaseOrderPayment(): ReactElement { return ; } - renderNotSupported() { + renderNotSupported(): ReactElement { const { setOrderButtonEnableStatus } = this.props; return ; } - renderPayment(method) { + renderPayment(method): ReactElement { const { selectPaymentMethod, selectedPaymentCode @@ -112,13 +112,13 @@ export class CheckoutPayments extends PureComponent { ); } - renderPayments() { + renderPayments(): ReactElement { const { paymentMethods } = this.props; return paymentMethods.map(this.renderPayment); } - renderSelectedPayment() { + renderSelectedPayment(): ReactElement { const { selectedPaymentCode } = this.props; const render = this.paymentRenderMap[selectedPaymentCode]; @@ -129,7 +129,7 @@ export class CheckoutPayments extends PureComponent { return render(); } - renderHeading() { + renderHeading(): ReactElement { return (

    { __('Payment method') } @@ -137,7 +137,7 @@ export class CheckoutPayments extends PureComponent { ); } - renderContent() { + renderContent(): ReactElement { const { hasError } = this.state; if (hasError) { diff --git a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.tsx similarity index 98% rename from packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js rename to packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.tsx index 1d7a67489d..bdcaf93583 100644 --- a/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.js +++ b/packages/scandipwa/src/component/CheckoutPayments/CheckoutPayments.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { KlarnaContainer } from 'Component/Klarna/Klarna.container'; @@ -122,7 +123,7 @@ export class CheckoutPaymentsContainer extends PureComponent { setOrderButtonEnableStatus(true); } - render() { + render(): ReactElement { return ( ({ - payload: state.PopupReducer.popupPayload[TERMS_AND_CONDITIONS_POPUP_ID] || {} + payload: state.PopupReducer.popupPayload[ TERMS_AND_CONDITIONS_POPUP_ID ] || {} }); /** @namespace Component/CheckoutTermsAndConditionsPopup/Container/mapDispatchToProps */ @@ -44,11 +45,11 @@ export class CheckoutTermsAndConditionsPopupContainer extends PureComponent { return { payload }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx index c99179a1a1..d2ab9154dd 100644 --- a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.component.tsx @@ -14,12 +14,12 @@ import { PureComponent } from 'react'; import { ReactElement } from 'Type/Common.type'; import { Directions } from './ChevronIcon.config'; -import { ChevronIconProps } from './ChevronIcon.type'; +import { ChevronIconComponentProps } from './ChevronIcon.type'; import './ChevronIcon.style'; /** @namespace Component/ChevronIcon/Component */ -export class ChevronIcon extends PureComponent { +export class ChevronIcon extends PureComponent { static defaultProps = { direction: Directions.RIGHT }; diff --git a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts index 7baf24797d..0e2c5863cf 100644 --- a/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts +++ b/packages/scandipwa/src/component/ChevronIcon/ChevronIcon.type.ts @@ -11,6 +11,6 @@ import { Directions } from './ChevronIcon.config'; -export interface ChevronIconProps { +export interface ChevronIconComponentProps { direction: Directions; } diff --git a/packages/scandipwa/src/component/CmsBlock/CmsBlock.component.tsx b/packages/scandipwa/src/component/CmsBlock/CmsBlock.component.tsx index 981b8c8de5..9edeb63ea4 100644 --- a/packages/scandipwa/src/component/CmsBlock/CmsBlock.component.tsx +++ b/packages/scandipwa/src/component/CmsBlock/CmsBlock.component.tsx @@ -38,7 +38,7 @@ export class CmsBlock extends PureComponent { blockType: '' }; - renderPlaceholder() { + renderPlaceholder(): ReactElement { const { children } = this.props; diff --git a/packages/scandipwa/src/component/CmsBlock/CmsBlock.container.js b/packages/scandipwa/src/component/CmsBlock/CmsBlock.container.tsx similarity index 98% rename from packages/scandipwa/src/component/CmsBlock/CmsBlock.container.js rename to packages/scandipwa/src/component/CmsBlock/CmsBlock.container.tsx index 9297cbd2e4..edf2985781 100644 --- a/packages/scandipwa/src/component/CmsBlock/CmsBlock.container.js +++ b/packages/scandipwa/src/component/CmsBlock/CmsBlock.container.tsx @@ -64,7 +64,7 @@ export class CmsBlockContainer extends DataContainer { ); } - render() { + render(): ReactElement { return ( { +export class CompareIcon extends PureComponent { static defaultProps = { isActive: false }; diff --git a/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts b/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts index e340e79786..089d4771e9 100644 --- a/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts +++ b/packages/scandipwa/src/component/CompareIcon/CompareIcon.type.ts @@ -9,6 +9,6 @@ * @link https://github.com/scandipwa/scandipwa */ -export interface CompareIconProps { +export interface CompareIconComponentProps { isActive: boolean; } diff --git a/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx b/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx index 04ab9ffc98..447fb4e549 100644 --- a/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx +++ b/packages/scandipwa/src/component/ContactForm/ContactForm.component.tsx @@ -39,7 +39,7 @@ export class ContactForm extends FieldForm { }; } - renderActions() { + renderActions(): ReactElement { const { isLoading } = this.props; return ( diff --git a/packages/scandipwa/src/component/ContactForm/ContactForm.container.js b/packages/scandipwa/src/component/ContactForm/ContactForm.container.tsx similarity index 89% rename from packages/scandipwa/src/component/ContactForm/ContactForm.container.js rename to packages/scandipwa/src/component/ContactForm/ContactForm.container.tsx index c927857992..315e657a37 100644 --- a/packages/scandipwa/src/component/ContactForm/ContactForm.container.js +++ b/packages/scandipwa/src/component/ContactForm/ContactForm.container.tsx @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import ContactForm from './ContactForm.component'; @@ -47,7 +48,7 @@ export class ContactFormContainer extends PureComponent { const { sendMessage } = this.props; const filteredFields = {}; fields.forEach(({ name, value }) => { - filteredFields[name] = value; + filteredFields[ name ] = value; }); sendMessage({ form, fields: filteredFields }); @@ -59,11 +60,11 @@ export class ContactFormContainer extends PureComponent { return { isLoading }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/ContactForm/ContactForm.form.js b/packages/scandipwa/src/component/ContactForm/ContactForm.form.js index bcb5038563..63c1885e77 100644 --- a/packages/scandipwa/src/component/ContactForm/ContactForm.form.js +++ b/packages/scandipwa/src/component/ContactForm/ContactForm.form.js @@ -9,8 +9,8 @@ * @link https://github.com/scandipwa/base-theme */ -import FIELD_TYPE from 'Component/Field/Field.config'; -import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; +import FieldType from 'Component/Field/Field.config'; +import { ValidationInputType } from 'Util/Validator/Config'; /** * Form for contacts @@ -18,53 +18,53 @@ import { VALIDATION_INPUT_TYPE } from 'Util/Validator/Config'; */ export const contactForm = () => [ { - type: FIELD_TYPE.text, + type: FieldType.text, label: __('Name'), attr: { name: 'name', placeholder: __('Your name') }, addRequiredTag: true, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { isRequired: true } }, { - type: FIELD_TYPE.email, + type: FieldType.email, label: __('Email'), attr: { name: 'email', placeholder: __('Your email') }, addRequiredTag: true, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { - inputType: VALIDATION_INPUT_TYPE.email, + inputType: ValidationInputType.email, isRequired: true } }, { - type: FIELD_TYPE.text, + type: FieldType.text, label: __('Phone number'), attr: { name: 'telephone', placeholder: __('Phone number') }, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { - inputType: VALIDATION_INPUT_TYPE.phone + inputType: ValidationInputType.phone } }, { - type: FIELD_TYPE.textarea, + type: FieldType.textarea, label: __('What\'s on your mind?'), attr: { name: 'message', placeholder: __('Message') }, addRequiredTag: true, - validateOn: ['onChange'], + validateOn: [ 'onChange' ], validationRule: { isRequired: true } diff --git a/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx b/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx index ea3d07552f..57addf7132 100644 --- a/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx +++ b/packages/scandipwa/src/component/ContentWrapper/ContentWrapper.component.tsx @@ -11,7 +11,9 @@ import { PureComponent } from 'react'; -import { ChildrenType, MixType, ReactElement } from 'Type/Common.type'; +import { + ChildrenType, MixType, ReactElement +} from 'Type/Common.type'; import { LabelType } from 'Type/Field.type'; import './ContentWrapper.style'; @@ -40,7 +42,7 @@ export class ContentWrapper extends PureComponent { isNotSection: false }; - renderContentWrapper() { + renderContentWrapper(): ReactElement { const { children, wrapperMix } = this.props; diff --git a/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx b/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx index 551c8cecb1..0dc99144e4 100644 --- a/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx +++ b/packages/scandipwa/src/component/CookiePopup/CookiePopup.component.tsx @@ -49,7 +49,7 @@ export class CookiePopup extends PureComponent { this.setState({ isAccepted: true }); } - renderCookieLink() { + renderCookieLink(): ReactElement { const { cookieLink } = this.props; if (!cookieLink) { @@ -67,7 +67,7 @@ export class CookiePopup extends PureComponent { ); } - renderCookieText() { + renderCookieText(): ReactElement { const { cookieText } = this.props; return ( @@ -78,7 +78,7 @@ export class CookiePopup extends PureComponent { ); } - renderCTA() { + renderCTA(): ReactElement { return (
    ); } diff --git a/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx b/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx index 04d99bd955..c90b4cfaf8 100755 --- a/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx +++ b/packages/scandipwa/src/component/CurrencySwitcher/CurrencySwitcher.component.tsx @@ -12,7 +12,7 @@ import { PureComponent } from 'react'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { ReactElement } from 'Type/Common.type'; import { getCurrency } from 'Util/Currency'; @@ -59,7 +59,7 @@ export class CurrencySwitcher extends PureComponent { return (
    ); } diff --git a/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx b/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx index 8333704098..02e5a1ab3c 100644 --- a/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx +++ b/packages/scandipwa/src/component/DatePicker/DatePicker.component.tsx @@ -14,7 +14,7 @@ import 'react-datepicker/dist/react-datepicker.css'; import { forwardRef, PureComponent } from 'react'; import DatePicker from 'react-datepicker'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { FIELD_DATE_TYPE } from 'Component/FieldDate/FieldDate.config'; import './DatePicker.style.scss'; @@ -36,9 +36,9 @@ export class DatePickerComponent extends PureComponent { }; placeholderMap = { - [FIELD_TYPE.date]: __('Select date'), - [FIELD_TYPE.dateTime]: __('Select date & time'), - [FIELD_TYPE.time]: __('Select time') + [FieldType.date]: __('Select date'), + [FieldType.dateTime]: __('Select date & time'), + [FieldType.time]: __('Select time') }; getPlaceholder() { @@ -47,14 +47,14 @@ export class DatePickerComponent extends PureComponent { return this.placeholderMap[type] || ''; } - renderCustomInput({ value, onClick }, ref) { + renderCustomInput({ value, onClick }, ref): ReactElement { const { selectedDate, uid } = this.props; return ( ); } diff --git a/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx b/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx index a91b82fd7b..f0e30d7485 100644 --- a/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx +++ b/packages/scandipwa/src/component/DateSelect/DateSelect.component.tsx @@ -15,14 +15,14 @@ import { AMPM_FORMAT, DEFAULT_MONTH_DAYS, FIELD_NAME_ATTR, - FIELD_TYPE_ATTR, + FieldType_ATTR, HOURS_12H_COUNT, HOURS_24H_COUNT, MINUTES_COUNT, MONTHS_COUNT } from 'Component/DateSelect/DateSelect.config'; import Field from 'Component/Field'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { FIELD_DATE_TYPE, TIME_FORMAT } from 'Component/FieldDate/FieldDate.config'; import { ReactElement } from 'Type/Common.type'; import { DateType } from 'Type/Field.type'; @@ -113,7 +113,7 @@ export class DateSelectComponent extends PureComponent { })); } - renderYear() { + renderYear(): ReactElement { const { uid, isRequired, @@ -124,14 +124,14 @@ export class DateSelectComponent extends PureComponent { return ( ); } diff --git a/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx b/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx index 046d9debc0..bd116baaa9 100644 --- a/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx +++ b/packages/scandipwa/src/component/DemoNotice/DemoNotice.component.tsx @@ -45,7 +45,7 @@ export class DemoNotice extends PureComponent { } } - renderText() { + renderText(): ReactElement { const { device } = this.props; if (device.isMobile) { diff --git a/packages/scandipwa/src/component/DemoNotice/DemoNotice.container.js b/packages/scandipwa/src/component/DemoNotice/DemoNotice.container.tsx similarity index 100% rename from packages/scandipwa/src/component/DemoNotice/DemoNotice.container.js rename to packages/scandipwa/src/component/DemoNotice/DemoNotice.container.tsx diff --git a/packages/scandipwa/src/component/Draggable/Draggable.component.tsx b/packages/scandipwa/src/component/Draggable/Draggable.component.tsx index f39deb6d0d..66d9217087 100644 --- a/packages/scandipwa/src/component/Draggable/Draggable.component.tsx +++ b/packages/scandipwa/src/component/Draggable/Draggable.component.tsx @@ -13,7 +13,8 @@ import { PureComponent } from 'react'; import { - ChildrenType, MixType, ReactElement, RefType + ChildrenType, MixType, ReactElement, + ReactElement, RefType } from 'Type/Common.type'; import { noopFn } from 'Util/Common'; diff --git a/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.component.tsx b/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.component.tsx index 54a3cbe223..8e779800a5 100644 --- a/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.component.tsx +++ b/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.component.tsx @@ -128,7 +128,7 @@ export class ExpandableContent extends PureComponent { ); } - renderButton() { + renderButton(): ReactElement { const { isContentExpanded } = this.state; const { heading, mix } = this.props; @@ -159,7 +159,7 @@ export class ExpandableContent extends PureComponent { ); } - renderButtonIcon() { + renderButtonIcon(): ReactElement { const { isContentExpanded } = this.state; const { isArrow, device: { isMobile } } = this.props; @@ -174,7 +174,7 @@ export class ExpandableContent extends PureComponent { return this.renderTogglePlusMinus(); } - renderTogglePlusMinus() { + renderTogglePlusMinus(): ReactElement { const { isContentExpanded } = this.state; if (isContentExpanded) { @@ -184,7 +184,7 @@ export class ExpandableContent extends PureComponent { return ; } - renderContent() { + renderContent(): ReactElement { const { children, mix } = this.props; const { isContentExpanded } = this.state; const mods = { isContentExpanded }; diff --git a/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.container.js b/packages/scandipwa/src/component/ExpandableContent/ExpandableContent.container.tsx similarity index 100% rename from packages/scandipwa/src/component/ExpandableContent/ExpandableContent.container.js rename to packages/scandipwa/src/component/ExpandableContent/ExpandableContent.container.tsx diff --git a/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.component.tsx b/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.component.tsx index 046c5ee9df..d65fdc241b 100644 --- a/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.component.tsx +++ b/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.component.tsx @@ -114,7 +114,7 @@ export class ExpandableContentShowMore extends PureComponent { } } - renderShowAllButton() { + renderShowAllButton(): ReactElement { const { showElemCount, children: { length } } = this.props; if (length <= showElemCount) { @@ -138,7 +138,7 @@ export class ExpandableContentShowMore extends PureComponent { ); } - renderExpandableChildren() { + renderExpandableChildren(): ReactElement { const { isOpen, isExpanding } = this.state; const { children, showElemCount } = this.props; @@ -159,7 +159,7 @@ export class ExpandableContentShowMore extends PureComponent { ); } - renderContent() { + renderContent(): ReactElement { const { children, showElemCount } = this.props; const child = children.slice(0, showElemCount); diff --git a/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.container.js b/packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.container.tsx similarity index 100% rename from packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.container.js rename to packages/scandipwa/src/component/ExpandableContentShowMore/ExpandableContentShowMore.container.tsx diff --git a/packages/scandipwa/src/component/Field/Field.component.tsx b/packages/scandipwa/src/component/Field/Field.component.tsx index cba286f450..57fbf5dd34 100644 --- a/packages/scandipwa/src/component/Field/Field.component.tsx +++ b/packages/scandipwa/src/component/Field/Field.component.tsx @@ -24,7 +24,7 @@ import { } from 'Type/Field.type'; import { noopFn } from 'Util/Common'; -import { FIELD_TYPE } from './Field.config'; +import { FieldType } from './Field.config'; import './Field.style'; @@ -36,7 +36,7 @@ import './Field.style'; export class Field extends PureComponent { static propTypes = { // Field attributes - type: PropTypes.oneOf(Object.values(FIELD_TYPE)).isRequired, + type: PropTypes.oneOf(Object.values(FieldType)).isRequired, attr: FieldAttrType.isRequired, events: EventsType.isRequired, isDisabled: PropTypes.bool.isRequired, @@ -81,30 +81,30 @@ export class Field extends PureComponent { renderMap = { // Checkboxes & Radio - [FIELD_TYPE.radio]: this.renderCheckboxOrRadio.bind(this), - [FIELD_TYPE.checkbox]: this.renderCheckboxOrRadio.bind(this), - [FIELD_TYPE.multi]: this.renderCheckboxOrRadio.bind(this), + [FieldType.radio]: this.renderCheckboxOrRadio.bind(this), + [FieldType.checkbox]: this.renderCheckboxOrRadio.bind(this), + [FieldType.multi]: this.renderCheckboxOrRadio.bind(this), // Default input - [FIELD_TYPE.email]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.text]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.time]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.dateTime]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.date]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.password]: this.renderDefaultInput.bind(this), - [FIELD_TYPE.submit]: this.renderDefaultInput.bind(this), + [FieldType.email]: this.renderDefaultInput.bind(this), + [FieldType.text]: this.renderDefaultInput.bind(this), + [FieldType.time]: this.renderDefaultInput.bind(this), + [FieldType.dateTime]: this.renderDefaultInput.bind(this), + [FieldType.date]: this.renderDefaultInput.bind(this), + [FieldType.password]: this.renderDefaultInput.bind(this), + [FieldType.submit]: this.renderDefaultInput.bind(this), // Custom fields - [FIELD_TYPE.file]: this.renderFile.bind(this), - [FIELD_TYPE.select]: this.renderSelect.bind(this), - [FIELD_TYPE.textarea]: this.renderTextArea.bind(this), - [FIELD_TYPE.button]: this.renderButton.bind(this), - [FIELD_TYPE.number]: this.renderNumber.bind(this) + [FieldType.file]: this.renderFile.bind(this), + [FieldType.select]: this.renderSelect.bind(this), + [FieldType.textarea]: this.renderTextArea.bind(this), + [FieldType.button]: this.renderButton.bind(this), + [FieldType.number]: this.renderNumber.bind(this) }; //#region INPUT TYPE RENDER - renderDefaultInput() { + renderDefaultInput(): ReactElement { const { type, setRef, attr, events, isDisabled } = this.props; @@ -120,7 +120,7 @@ export class Field extends PureComponent { ); } - renderFile() { + renderFile(): ReactElement { const { attr, events, setRef } = this.props; return ( @@ -128,7 +128,7 @@ export class Field extends PureComponent { ); } - renderNumber() { + renderNumber(): ReactElement { const { attr, events, @@ -146,7 +146,7 @@ export class Field extends PureComponent { ); } - renderSelect() { + renderSelect(): ReactElement { const { attr, events, @@ -170,7 +170,7 @@ export class Field extends PureComponent { ); } - renderButton() { + renderButton(): ReactElement { const { setRef, attr, events, isDisabled } = this.props; @@ -188,7 +188,7 @@ export class Field extends PureComponent { ); } - renderCheckboxOrRadio() { + renderCheckboxOrRadio(): ReactElement { const { type, setRef, @@ -225,7 +225,7 @@ export class Field extends PureComponent { ); } - renderTextArea() { + renderTextArea(): ReactElement { const { setRef, attr, events, isDisabled } = this.props; @@ -243,11 +243,11 @@ export class Field extends PureComponent { //#region LABEL/TEXT RENDER // Renders validation error messages under field - renderErrorMessage(message, key) { + renderErrorMessage(message, key): ReactElement { return
    { message }
    ; } - renderErrorMessages() { + renderErrorMessages(): ReactElement { const { showErrorAsLabel, validationResponse, @@ -272,7 +272,7 @@ export class Field extends PureComponent { } // Renders fields label above field - renderLabel() { + renderLabel(): ReactElement { const { type, label, attr: { name } = {} } = this.props; if (!label) { @@ -290,7 +290,7 @@ export class Field extends PureComponent { } // Renders * for required fields - renderRequiredTag() { + renderRequiredTag(): ReactElement { const { addRequiredTag } = this.props; if (!addRequiredTag) { @@ -305,7 +305,7 @@ export class Field extends PureComponent { } // Renders fields label under field - renderSubLabel() { + renderSubLabel(): ReactElement { const { subLabel } = this.props; if (!subLabel) { @@ -339,7 +339,7 @@ export class Field extends PureComponent { } } mix={ mix } > - { type !== FIELD_TYPE.checkbox && type !== FIELD_TYPE.radio && this.renderLabel() } + { type !== FieldType.checkbox && type !== FieldType.radio && this.renderLabel() } { inputRenderer && inputRenderer() }
    { this.renderErrorMessages() } diff --git a/packages/scandipwa/src/component/Field/Field.container.js b/packages/scandipwa/src/component/Field/Field.container.tsx similarity index 94% rename from packages/scandipwa/src/component/Field/Field.container.js rename to packages/scandipwa/src/component/Field/Field.container.tsx index 2953c9a327..a23ee6b7a3 100644 --- a/packages/scandipwa/src/component/Field/Field.container.js +++ b/packages/scandipwa/src/component/Field/Field.container.tsx @@ -20,7 +20,7 @@ import { import { validate } from 'Util/Validator'; import Field from './Field.component'; -import { FIELD_TYPE } from './Field.config'; +import { FieldType } from './Field.config'; /** * Field @@ -30,7 +30,7 @@ import { FIELD_TYPE } from './Field.config'; export class FieldContainer extends PureComponent { static propTypes = { // Field attributes - type: PropTypes.oneOf(Object.values(FIELD_TYPE)), + type: PropTypes.oneOf(Object.values(FieldType)), attr: FieldAttrType, events: EventsType, isDisabled: PropTypes.bool, @@ -52,7 +52,7 @@ export class FieldContainer extends PureComponent { }; static defaultProps = { - type: FIELD_TYPE.text, + type: FieldType.text, attr: {}, events: {}, mix: {}, @@ -123,7 +123,7 @@ export class FieldContainer extends PureComponent { const { validationRule, type } = this.props; const { showLengthError } = this.state; - if (type === FIELD_TYPE.textarea || type === FIELD_TYPE.text) { + if (type === FieldType.textarea || type === FieldType.text) { validationRule.range = { ...validationRule.range, showLengthError }; } @@ -135,11 +135,11 @@ export class FieldContainer extends PureComponent { validationRule: { range: { max: maxValidLength = 0 } = {} }, type, attr: { name } = {} } = this.props; const { showLengthError } = this.state; - const value = type === FIELD_TYPE.checkbox || type === FIELD_TYPE.radio + const value = type === FieldType.checkbox || type === FieldType.radio ? !!this.fieldRef.checked : this.fieldRef.value; const newValidRule = this.handleShowLengthError(); - const response = validate(type === FIELD_TYPE.file + const response = validate(type === FieldType.file ? value.toLowerCase() : value, newValidRule); const output = response !== true ? { ...response, type, name } : response; @@ -236,7 +236,7 @@ export class FieldContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ); } return ( ); } diff --git a/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx b/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx index b2256dc647..1c1b787063 100644 --- a/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx +++ b/packages/scandipwa/src/component/FieldFile/FieldFile.component.tsx @@ -11,7 +11,7 @@ import { PureComponent } from 'react'; -import { FIELD_TYPE } from 'Component/Field/Field.config'; +import { FieldType } from 'Component/Field/Field.config'; import Loader from 'Component/Loader'; import UploadIcon from 'Component/UploadIcon'; import { ReactElement } from 'Type/Common.type'; @@ -30,7 +30,7 @@ export class FieldFile extends PureComponent { isLoading: PropTypes.bool.isRequired }; - renderSubLabel(allowedTypes) { + renderSubLabel(allowedTypes): ReactElement { return (

    { __('Compatible file extensions to upload:') } @@ -39,7 +39,7 @@ export class FieldFile extends PureComponent { ); } - renderFileLabel() { + renderFileLabel(): ReactElement { const { attr: { id = '', multiple = false } = {}, fileName = '', @@ -87,7 +87,7 @@ export class FieldFile extends PureComponent { <> setRef(elem) } - type={ FIELD_TYPE.file } + type={ FieldType.file } // eslint-disable-next-line @scandipwa/scandipwa-guidelines/jsx-no-props-destruction { ...attr } // eslint-disable-next-line @scandipwa/scandipwa-guidelines/jsx-no-props-destruction diff --git a/packages/scandipwa/src/component/FieldFile/FieldFile.container.js b/packages/scandipwa/src/component/FieldFile/FieldFile.container.tsx similarity index 93% rename from packages/scandipwa/src/component/FieldFile/FieldFile.container.js rename to packages/scandipwa/src/component/FieldFile/FieldFile.container.tsx index d8dda2a3bb..bf56dc2462 100644 --- a/packages/scandipwa/src/component/FieldFile/FieldFile.container.js +++ b/packages/scandipwa/src/component/FieldFile/FieldFile.container.tsx @@ -56,7 +56,7 @@ export class FieldFileContainer extends PureComponent { const { files } = this.fieldRef; this.setState({ isLoading: true }); - const { name } = files[0]; + const { name } = files[ 0 ]; const reader = new FileReader(); reader.onload = () => { this.setState({ @@ -81,7 +81,7 @@ export class FieldFileContainer extends PureComponent { onChange(value); } }; - reader.readAsDataURL(files[0]); + reader.readAsDataURL(files[ 0 ]); } } @@ -113,11 +113,11 @@ export class FieldFileContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ); } diff --git a/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx b/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx index 35b4b03ec3..a76b38f53d 100644 --- a/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx +++ b/packages/scandipwa/src/component/FieldForm/FieldForm.component.tsx @@ -52,7 +52,7 @@ export class FieldForm extends PureComponent { ]; } - renderSection(section) { + renderSection(section): ReactElement { const { fields, attr: { @@ -73,11 +73,11 @@ export class FieldForm extends PureComponent { return ; } - renderActions() { + renderActions(): ReactElement { return null; } - renderFormBody() { + renderFormBody(): ReactElement { return (

    diff --git a/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx b/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx index 2619867c70..f425d68ea0 100644 --- a/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx +++ b/packages/scandipwa/src/component/FieldGroup/FieldGroup.component.tsx @@ -12,7 +12,9 @@ import { PureComponent } from 'react'; -import { ChildrenType, ModsType, ReactElement } from 'Type/Common.type'; +import { + ChildrenType, ModsType, ReactElement +} from 'Type/Common.type'; import { EventsType, FieldAttrType, FieldGroupValidationResponseType } from 'Type/Field.type'; import './FieldGroup.style'; @@ -46,11 +48,11 @@ export class FieldGroup extends PureComponent { //#region LABEL/TEXT RENDER // Renders validation error messages under group - renderErrorMessage(message) { + renderErrorMessage(message): ReactElement { return
    { message }
    ; } - renderErrorMessages() { + renderErrorMessages(): ReactElement { const { showErrorAsLabel, validationResponse @@ -74,7 +76,7 @@ export class FieldGroup extends PureComponent { } // Renders group label above field - renderLabel() { + renderLabel(): ReactElement { const { label } = this.props; if (!label) { @@ -87,7 +89,7 @@ export class FieldGroup extends PureComponent { } // Renders group label under field - renderSubLabel() { + renderSubLabel(): ReactElement { const { subLabel } = this.props; if (!subLabel) { diff --git a/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js b/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.tsx similarity index 97% rename from packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js rename to packages/scandipwa/src/component/FieldGroup/FieldGroup.container.tsx index 67c96d5ccb..b2ded91011 100644 --- a/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.js +++ b/packages/scandipwa/src/component/FieldGroup/FieldGroup.container.tsx @@ -13,7 +13,7 @@ import PropTypes from 'prop-types'; import { createRef, PureComponent } from 'react'; -import FIELD_TYPE from 'Component/Field/Field.config'; +import FieldType from 'Component/Field/Field.config'; import { ChildrenType, ModsType, RefType } from 'Type/Common.type'; import { EventsType, FieldAttrType, ValidationRuleType } from 'Type/Field.type'; import getFieldsData from 'Util/Form/Extract'; @@ -127,7 +127,7 @@ export class FieldGroupContainer extends PureComponent { const fields = getFieldsData( this.groupRef, false, - [ FIELD_TYPE.number, FIELD_TYPE.button ] + [ FieldType.number, FieldType.button ] ); hook(...[ ...args, { ...attr, formRef: this.groupRef, fields } ]); @@ -173,7 +173,7 @@ export class FieldGroupContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( + ); } } diff --git a/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx b/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx index 59d11a8493..91ded706c9 100644 --- a/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx +++ b/packages/scandipwa/src/component/FieldNumber/FieldNumber.component.tsx @@ -12,7 +12,7 @@ import { PureComponent } from 'react'; import AddIcon from 'Component/AddIcon'; -import { FIELD_TYPE } from 'Component/Field/Field.config'; +import { FieldType } from 'Component/Field/Field.config'; import MinusIcon from 'Component/MinusIcon'; import { ReactElement } from 'Type/Common.type'; import { EventsType, FieldAttrType } from 'Type/Field.type'; @@ -51,7 +51,7 @@ export class FieldNumber extends PureComponent { { ...attr } // eslint-disable-next-line @scandipwa/scandipwa-guidelines/jsx-no-props-destruction { ...events } - type={ FIELD_TYPE.number } + type={ FieldType.number } readOnly aria-label={ __('Value') } value={ value } @@ -62,7 +62,7 @@ export class FieldNumber extends PureComponent { // eslint-disable-next-line react/jsx-no-bind onClick={ () => handleValueChange(+value + 1) } aria-label={ __('Add') } - type={ FIELD_TYPE.button } + type={ FieldType.button } > @@ -71,7 +71,7 @@ export class FieldNumber extends PureComponent { // eslint-disable-next-line react/jsx-no-bind onClick={ () => handleValueChange(+value - 1) } aria-label={ __('Subtract') } - type={ FIELD_TYPE.button } + type={ FieldType.button } > diff --git a/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js b/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.tsx similarity index 99% rename from packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js rename to packages/scandipwa/src/component/FieldNumber/FieldNumber.container.tsx index 8c7efef67b..797c954381 100644 --- a/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.js +++ b/packages/scandipwa/src/component/FieldNumber/FieldNumber.container.tsx @@ -136,7 +136,7 @@ export class FieldNumberContainer extends PureComponent { }; } - render() { + render(): ReactElement { return ( ; } - renderCmsBlockWrapper() { + renderCmsBlockWrapper(): ReactElement { const { footer_content: { footer_cms } = {} } = window.contentConfiguration; return ( @@ -189,7 +189,7 @@ export class Footer extends Component { ); } - renderContent() { + renderContent(): ReactElement { const { footer_content: { footer_cms } = {} } = window.contentConfiguration; if (footer_cms) { @@ -203,7 +203,7 @@ export class Footer extends Component { ); } - renderCopyrightContent() { + renderCopyrightContent(): ReactElement { const { copyright } = this.props; return ( diff --git a/packages/scandipwa/src/component/Footer/Footer.container.js b/packages/scandipwa/src/component/Footer/Footer.container.tsx similarity index 91% rename from packages/scandipwa/src/component/Footer/Footer.container.js rename to packages/scandipwa/src/component/Footer/Footer.container.tsx index b8019c7311..8c9207c355 100644 --- a/packages/scandipwa/src/component/Footer/Footer.container.js +++ b/packages/scandipwa/src/component/Footer/Footer.container.tsx @@ -10,6 +10,7 @@ */ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; +import { ReactElement } from 'Type/Common.type'; import { connect } from 'react-redux'; import { DeviceType } from 'Type/Device.type'; @@ -65,11 +66,11 @@ export class FooterContainer extends PureComponent { scrollToTop(); } - render() { + render(): ReactElement { return (