From 8cf898befd9dcc17a55dd1a1d84d05f39bfee12e Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Fri, 27 Aug 2021 09:30:30 +0200 Subject: [PATCH] Sync `release-2.4` with `release/next` (#6237) --- package.json | 5 +- .../api-client/api-extractor.json | 2 +- .../api-client/src/api-extractor-data.ts | 15 + .../composables/api-extractor.json | 10 + .../composables/src/getters/storeGetters.ts | 16 - .../commercetools/composables/src/index.ts | 12 + .../composables/src/useStore/factoryParams.ts | 3 - packages/core/cache/api-extractor.json | 10 + packages/core/cache/src/index.ts | 11 + packages/core/cache/tsconfig.json | 3 +- packages/core/core/src/index.ts | 12 +- packages/core/core/src/types.ts | 2 +- .../docs/.vuepress/components/PersonTile.vue | 4 +- packages/core/docs/.vuepress/config.js | 30 +- packages/core/docs/.vuepress/integrations.js | 63 ++- .../public/integrations-logos/auth0.svg | 2 +- .../integrations-logos/constructor-io.svg | 1 + .../public/integrations-logos/odoo.svg | 1 + .../public/integrations-logos/opencart.svg | 1 + .../public/integrations-logos/sap.svg | 1 + .../public/integrations-logos/vendure.png | Bin 0 -> 9403 bytes .../public/integrations-logos/woocommerce.svg | 1 + packages/core/docs/Dockerfile | 3 +- .../commercetools/composables/use-billing.md | 91 +-- .../commercetools/composables/use-cart.md | 530 +++++++++--------- .../commercetools/composables/use-category.md | 118 ++-- .../commercetools/composables/use-facet.md | 213 ++++--- .../composables/use-forgot-password.md | 192 +++---- .../composables/use-make-order.md | 138 ++--- .../commercetools/composables/use-product.md | 173 +++--- .../commercetools/composables/use-review.md | 142 +++-- .../composables/use-shipping-provider.md | 108 ++-- .../commercetools/composables/use-shipping.md | 89 +-- .../commercetools/composables/use-store.md | 160 ++++-- .../composables/use-user-billing.md | 401 +++++++------ .../composables/use-user-order.md | 358 ++++++------ .../composables/use-user-shipping.md | 419 +++++++------- .../commercetools/composables/use-user.md | 166 +++--- .../commercetools/composables/use-wishlist.md | 357 ++++++------ .../commercetools/enterprise/use-wishlist.md | 1 - packages/core/docs/commercetools/use-facet.md | 2 +- packages/core/docs/general/enterprise.md | 8 +- packages/core/docs/general/installation.md | 6 +- packages/core/docs/images/cli.jpg | Bin 25501 -> 0 bytes packages/core/docs/integrate/cache-driver.md | 2 +- packages/core/docs/integrate/cms.md | 2 +- .../core/docs/integrate/integration-guide.md | 22 +- packages/core/docs/integrations/README.md | 14 +- packages/core/docs/integrations/adyen.md | 2 +- .../core/docs/integrations/bazaarvoice.md | 2 +- .../core/docs/integrations/redis-cache.md | 2 +- packages/core/docs/package.json | 15 +- packages/core/middleware/api-extractor.json | 10 + packages/core/middleware/package.json | 2 +- packages/core/middleware/src/index.ts | 10 + 55 files changed, 2078 insertions(+), 1885 deletions(-) create mode 100644 packages/commercetools/api-client/src/api-extractor-data.ts create mode 100644 packages/commercetools/composables/api-extractor.json create mode 100644 packages/core/cache/api-extractor.json create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/constructor-io.svg create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/odoo.svg create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/opencart.svg create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/sap.svg create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/vendure.png create mode 100644 packages/core/docs/.vuepress/public/integrations-logos/woocommerce.svg delete mode 100644 packages/core/docs/images/cli.jpg create mode 100644 packages/core/middleware/api-extractor.json diff --git a/package.json b/package.json index 1292cc64d1..23e7292eef 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "scripts": { "build:docs": "cd packages/core/docs && yarn build", "dev:docs": "cd packages/core/docs && yarn dev", - "build:core": "cd packages/core/core && yarn build && cd ../middleware && yarn build", + "build:core": "yarn build:core:core && yarn build:core:cache && yarn build:core:middleware", + "build:core:core": "cd packages/core/core && yarn build", + "build:core:cache": "cd packages/core/cache && yarn build", + "build:core:middleware": "cd packages/core/middleware && yarn build", "build:spr:api-client": "cd packages/spryker/api-client && yarn build", "build:spr:composables": "cd packages/spryker/composables && yarn build", "build:spr:tools": "yarn build:core && yarn build:spr:api-client && yarn build:spr:composables", diff --git a/packages/commercetools/api-client/api-extractor.json b/packages/commercetools/api-client/api-extractor.json index 746ad8ecec..19fe4cc85b 100644 --- a/packages/commercetools/api-client/api-extractor.json +++ b/packages/commercetools/api-client/api-extractor.json @@ -1,6 +1,6 @@ { "extends": "../../api-extractor.base.json", - "mainEntryPointFilePath": "./lib/index.d.ts", + "mainEntryPointFilePath": "./lib/api-extractor-data.d.ts", "dtsRollup": { "untrimmedFilePath": "./lib/.d.ts" }, diff --git a/packages/commercetools/api-client/src/api-extractor-data.ts b/packages/commercetools/api-client/src/api-extractor-data.ts new file mode 100644 index 0000000000..fb829ad5a2 --- /dev/null +++ b/packages/commercetools/api-client/src/api-extractor-data.ts @@ -0,0 +1,15 @@ +/** + * `api-client` for commercetools integration for Vue Storefront 2. + * + * @remarks + * The `@vue-storefront/commercetools-api` library includes everything needed to fetch data from the + * commercetools eCommerce platform. This includes API client configuration, API endpoints, and + * GraphQL types and fragments. + * + * @packageDocumentation + */ + +import * as apiMethods from './api'; + +export * from './index'; +export { apiMethods }; diff --git a/packages/commercetools/composables/api-extractor.json b/packages/commercetools/composables/api-extractor.json new file mode 100644 index 0000000000..746ad8ecec --- /dev/null +++ b/packages/commercetools/composables/api-extractor.json @@ -0,0 +1,10 @@ +{ + "extends": "../../api-extractor.base.json", + "mainEntryPointFilePath": "./lib/index.d.ts", + "dtsRollup": { + "untrimmedFilePath": "./lib/.d.ts" + }, + "docModel": { + "apiJsonFilePath": "/core/docs/commercetools/api-reference/.api.json" + } +} diff --git a/packages/commercetools/composables/src/getters/storeGetters.ts b/packages/commercetools/composables/src/getters/storeGetters.ts index aea1a64e93..6716d46a9f 100644 --- a/packages/commercetools/composables/src/getters/storeGetters.ts +++ b/packages/commercetools/composables/src/getters/storeGetters.ts @@ -3,10 +3,6 @@ import { Store, Channel, Address } from '../types/GraphQL'; import { StoresData } from '../types'; import { FilterCriteriaRecord, Localized, filterArrayByCriteriaRecord } from '../helpers/internals'; -/** - * Types - */ - interface StoreFilterCriteria { store?: FilterCriteriaRecord; channel?: FilterCriteriaRecord @@ -16,10 +12,6 @@ type StoreChannelSetKeys = 'distributionChannels' | 'supplyChannels'; -/** - * Helpers - */ - function mapToAddress(address: Address): AgnosticAddress { return { addressLine1: `${address?.country ?? ''} ${address?.city ?? ''} ${address?.postalCode ?? ''}`.trim(), @@ -94,10 +86,6 @@ function gainAgnosticStoreItems (criteria?: FilterCriteriaRecord) { }; } -/** - * Getters - */ - function getItems (stores: StoresData, criteria: StoreFilterCriteria = {}): AgnosticStore[] { return filterArrayByCriteriaRecord( stores?.results, @@ -109,10 +97,6 @@ function getSelected (stores: StoresData): AgnosticStore | undefined { return getItems(stores, { store: { key: (stores?._selectedStore ?? '') }})[0]; } -/** - * Export - */ - const storeGetters: UseStoreGetters = { getItems, getSelected diff --git a/packages/commercetools/composables/src/index.ts b/packages/commercetools/composables/src/index.ts index 8973a4b7b8..6de189ce7a 100644 --- a/packages/commercetools/composables/src/index.ts +++ b/packages/commercetools/composables/src/index.ts @@ -1,3 +1,14 @@ +/** + * `composables` for commercetools integration for Vue Storefront 2. + * + * @remarks + * The `@vue-storefront/commercetools` library includes everything needed to fetch data from the + * Server Middleware and display them in agnostic and formatted form. This includes composables + * and getters. + * + * @packageDocumentation + */ + /* istanbul ignore file */ import { track } from '@vue-storefront/core'; @@ -21,3 +32,4 @@ export { useForgotPassword, useForgotPasswordFactoryParams } from './useForgotPa export { useStore, useStoreFactoryParams } from './useStore'; export * from './getters'; +export * from './types'; diff --git a/packages/commercetools/composables/src/useStore/factoryParams.ts b/packages/commercetools/composables/src/useStore/factoryParams.ts index 8f361b27b1..22fee3e1bd 100644 --- a/packages/commercetools/composables/src/useStore/factoryParams.ts +++ b/packages/commercetools/composables/src/useStore/factoryParams.ts @@ -16,7 +16,6 @@ export interface CtUseStoreFactoryParams extends UseStoreFactoryParams } -// Load param async function load (context: Context, params: UseStoreFactoryLoadParamArguments): Promise { const { api, config } = context.$ct; const { customQuery } = params; @@ -27,14 +26,12 @@ async function load (context: Context, params: UseStoreFactoryLoadParamArguments }; } -// Change param async function change (context: Context, { store }: UseStoreFactoryChangeParamArguments) { context.$ct.config.storeService.changeCurrentStore(`${store.key}`); window.location.reload(); return null as StoresData; } -// eslint-disable-next-line @typescript-eslint/no-unused-vars async function changeChannel (context: Context, { channel }: UseStoreFactoryChangeChannelParamArguments) { context.$ct.config.storeService.changeCurrentStore(`${(channel.distributtionChannel || 'null')}-${(channel.supplyChannel || 'null')}`); window.location.reload(); diff --git a/packages/core/cache/api-extractor.json b/packages/core/cache/api-extractor.json new file mode 100644 index 0000000000..f12f30fd57 --- /dev/null +++ b/packages/core/cache/api-extractor.json @@ -0,0 +1,10 @@ +{ + "extends": "../../api-extractor.base.json", + "mainEntryPointFilePath": "./lib/index.d.ts", + "dtsRollup": { + "untrimmedFilePath": "./lib/.d.ts" + }, + "docModel": { + "apiJsonFilePath": "/core/docs/core/api-reference/.api.json" + } +} diff --git a/packages/core/cache/src/index.ts b/packages/core/cache/src/index.ts index 82854a63d0..ae79785686 100644 --- a/packages/core/cache/src/index.ts +++ b/packages/core/cache/src/index.ts @@ -1,3 +1,14 @@ +/** + * Core Vue Storefront 2 library for enabling Server Side Rendering (SSR) cache. + * + * @remarks + * The `@vue-storefront/cache` library is a Nuxt.js module, that is core piece required + * to enable Server Side Rendering (SSR) cache in Vue Storefront 2. It uses drivers + * to integration with specific caching solutions. + * + * @packageDocumentation + */ + export { default as useCache } from './composables/useCache'; export enum CacheTagPrefix { diff --git a/packages/core/cache/tsconfig.json b/packages/core/cache/tsconfig.json index 8e25bb39b6..e99af1d9fc 100644 --- a/packages/core/cache/tsconfig.json +++ b/packages/core/cache/tsconfig.json @@ -16,5 +16,6 @@ "strict": false, "allowJs": true }, - "exclude": ["node_modules", "**/*.spec.ts"] + "exclude": ["node_modules", "**/*.spec.ts"], + "include": ["src"], } diff --git a/packages/core/core/src/index.ts b/packages/core/core/src/index.ts index 5d32902b0c..3720a4b3c6 100644 --- a/packages/core/core/src/index.ts +++ b/packages/core/core/src/index.ts @@ -1,5 +1,15 @@ -/* istanbul ignore file */ +/** + * Core Vue Storefront 2 library. + * + * @remarks + * The `@vue-storefront/core` library is a core of the whole Vue Storefront 2 application. + * It defines common interfaces for all eCommerce integrations, factories for creating + * composables, logger, SSR helpers and more. + * + * @packageDocumentation + */ +/* istanbul ignore file */ export * from './utils'; export * from './factories'; export * from './types'; diff --git a/packages/core/core/src/types.ts b/packages/core/core/src/types.ts index faac76f20f..bac41aa852 100644 --- a/packages/core/core/src/types.ts +++ b/packages/core/core/src/types.ts @@ -901,7 +901,7 @@ export interface UseStoreFactoryLoadParamArguments { export interface UseStoreFactoryParams extends FactoryParams { load(context: Context, params: UseStoreFactoryLoadParamArguments): Promise - change(context: Context, parmas: UseStoreFactoryChangeParamArguments): Promise + change(context: Context, params: UseStoreFactoryChangeParamArguments): Promise } export interface UseStoreInterface { change(params: UseStoreFactoryChangeParamArguments): Promise; diff --git a/packages/core/docs/.vuepress/components/PersonTile.vue b/packages/core/docs/.vuepress/components/PersonTile.vue index 610566b060..809e421c26 100644 --- a/packages/core/docs/.vuepress/components/PersonTile.vue +++ b/packages/core/docs/.vuepress/components/PersonTile.vue @@ -3,13 +3,13 @@
{{ name }}
{{ company }}
-
Slack: @{{ slack }}
+
Discord: {{ discord }}
diff --git a/packages/core/docs/.vuepress/config.js b/packages/core/docs/.vuepress/config.js index 36f546cddf..8ea495c111 100644 --- a/packages/core/docs/.vuepress/config.js +++ b/packages/core/docs/.vuepress/config.js @@ -164,29 +164,29 @@ module.exports = { title: 'Composables', collapsable: false, children: [ - ['/commercetools/composables/use-product', 'useProduct'], - ['/commercetools/composables/use-review', 'useReview '], - ['/commercetools/composables/use-user', 'useUser'], - ['/commercetools/composables/use-user-shipping', 'useUserShipping'], - ['/commercetools/composables/use-user-billing', 'useUserBilling'], - ['/commercetools/composables/use-user-order', 'useUserOrder'], - ['/commercetools/composables/use-facet', 'useFacet'], + ['/commercetools/composables/use-billing', 'useBilling'], ['/commercetools/composables/use-cart', 'useCart'], - ['/commercetools/composables/use-wishlist', 'useWishlist'], ['/commercetools/composables/use-category', 'useCategory'], - ['/commercetools/composables/use-shipping', 'useShipping'], - ['/commercetools/composables/use-shipping-provider', 'useShippingProvider'], - ['/commercetools/composables/use-billing', 'useBilling'], - ['/commercetools/composables/use-make-order', 'useMakeOrder'], + ['/commercetools/composables/use-facet', 'useFacet'], ['/commercetools/composables/use-forgot-password', 'useForgotPassword'], - ['/commercetools/composables/use-store', 'useStore'] + ['/commercetools/composables/use-make-order', 'useMakeOrder'], + ['/commercetools/composables/use-product', 'useProduct'], + ['/commercetools/composables/use-review', 'useReview'], + ['/commercetools/composables/use-shipping-provider', 'useShippingProvider'], + ['/commercetools/composables/use-shipping', 'useShipping'], + ['/commercetools/composables/use-store', 'useStore'], + ['/commercetools/composables/use-user-billing', 'useUserBilling'], + ['/commercetools/composables/use-user-order', 'useUserOrder'], + ['/commercetools/composables/use-user-shipping', 'useUserShipping'], + ['/commercetools/composables/use-user', 'useUser'], + ['/commercetools/composables/use-wishlist', 'useWishlist'] ] }, { - title: 'API Client', + title: 'API Reference', collapsable: false, children: [ - ['/commercetools/api-reference/', 'Methods reference'] + ['/commercetools/api-reference/', 'API Reference'] ] }, { diff --git a/packages/core/docs/.vuepress/integrations.js b/packages/core/docs/.vuepress/integrations.js index 13c026eafc..5687e1df5c 100644 --- a/packages/core/docs/.vuepress/integrations.js +++ b/packages/core/docs/.vuepress/integrations.js @@ -53,6 +53,16 @@ const INTEGRATIONS = { { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, ] }, + { + name: 'SAP Commerce Cloud', + link: '', + image: '/v2/integrations-logos/sap.svg', + status: STATUSES.WIP, + availability: AVAILABILITY.ENTERPRISE, + maintainedBy: [ + { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, + ] + }, { name: 'Spryker', link: 'https://docs.vuestorefront.io/spryker', @@ -107,6 +117,42 @@ const INTEGRATIONS = { { name: 'BitBag', link: 'https://bitbag.io/' }, ] }, + { + name: 'WooCommerce', + link: '', + image: '/v2/integrations-logos/woocommerce.svg', + status: STATUSES.WIP, + availability: AVAILABILITY.OPEN_SOURCE, + maintainedBy: [] + }, + { + name: 'OpenCart', + link: '', + image: '/v2/integrations-logos/opencart.svg', + status: STATUSES.WIP, + availability: AVAILABILITY.OPEN_SOURCE, + maintainedBy: [] + }, + { + name: 'Vendure', + link: '', + image: '/v2/integrations-logos/vendure.png', + status: STATUSES.WIP, + availability: AVAILABILITY.OPEN_SOURCE, + maintainedBy: [ + { name: 'Jakub Andrzejewski', link: 'https://www.linkedin.com/in/jakub-andrzejewski/' }, + ] + }, + { + name: 'Odoo', + link: '', + image: '/v2/integrations-logos/odoo.svg', + status: STATUSES.WIP, + availability: AVAILABILITY.OPEN_SOURCE, + maintainedBy: [ + { name: 'OdooGap', link: 'https://www.odoogap.com/' } + ] + } ], other: [ { @@ -238,7 +284,7 @@ const INTEGRATIONS = { maintainedBy: [ { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, ], - categories: [ CATEGORIES.AUTH ], + categories: [ CATEGORIES.CMS ], compatibility: [] }, { @@ -250,7 +296,7 @@ const INTEGRATIONS = { maintainedBy: [ { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, ], - categories: [ CATEGORIES.AUTH ], + categories: [ CATEGORIES.CMS ], compatibility: [] }, { @@ -275,6 +321,19 @@ const INTEGRATIONS = { { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, ], categories: [ CATEGORIES.SEARCH ], + compatibility: [ 'commercetools' ] + }, + + { + name: 'Constructor.io', + link: '', + image: '/v2/integrations-logos/constructor-io.svg', + status: STATUSES.BETA, + availability: AVAILABILITY.ENTERPRISE, + maintainedBy: [ + { name: 'Vue Storefront', link: 'https://vuestorefront.io/' }, + ], + categories: [ CATEGORIES.SEARCH ], compatibility: [] }, { diff --git a/packages/core/docs/.vuepress/public/integrations-logos/auth0.svg b/packages/core/docs/.vuepress/public/integrations-logos/auth0.svg index fc107dc8cb..2766105944 100644 --- a/packages/core/docs/.vuepress/public/integrations-logos/auth0.svg +++ b/packages/core/docs/.vuepress/public/integrations-logos/auth0.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/core/docs/.vuepress/public/integrations-logos/constructor-io.svg b/packages/core/docs/.vuepress/public/integrations-logos/constructor-io.svg new file mode 100644 index 0000000000..4bdd3398e8 --- /dev/null +++ b/packages/core/docs/.vuepress/public/integrations-logos/constructor-io.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/core/docs/.vuepress/public/integrations-logos/odoo.svg b/packages/core/docs/.vuepress/public/integrations-logos/odoo.svg new file mode 100644 index 0000000000..e7b82f7b9b --- /dev/null +++ b/packages/core/docs/.vuepress/public/integrations-logos/odoo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/core/docs/.vuepress/public/integrations-logos/opencart.svg b/packages/core/docs/.vuepress/public/integrations-logos/opencart.svg new file mode 100644 index 0000000000..cf05d79ebd --- /dev/null +++ b/packages/core/docs/.vuepress/public/integrations-logos/opencart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/core/docs/.vuepress/public/integrations-logos/sap.svg b/packages/core/docs/.vuepress/public/integrations-logos/sap.svg new file mode 100644 index 0000000000..36c74abebb --- /dev/null +++ b/packages/core/docs/.vuepress/public/integrations-logos/sap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/core/docs/.vuepress/public/integrations-logos/vendure.png b/packages/core/docs/.vuepress/public/integrations-logos/vendure.png new file mode 100644 index 0000000000000000000000000000000000000000..76f79d1455d5bce1416882967268ddaf689c82c5 GIT binary patch literal 9403 zcmaKSbyytF((a-O4go@dB)B^)5Zv8i7k5~k1r~Rg;32p}aJRtX?(PnOV1eKX!MWso z=XbvQ$31tRXQsM)>V3Pqx@Nj(p8BY&EQ5tkf(`%xu;gSV)t_b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ZDPMos&I#E68PPJ=-kcDD?LHIn$k zBEH7Q5VE|6gy%JEtDxYfUc$O~rvR^7us%JDM8jBW;YAWo#X~6COI6FnC^9l4{1lz= z_d^fiEH*(kHYWaVZVj2c=rqU~gvdJK%Reeotuxy8ukK&j?UfnGITPWqc zJP$2i}aN!~g&Q literal 0 HcmV?d00001 diff --git a/packages/core/docs/.vuepress/public/integrations-logos/woocommerce.svg b/packages/core/docs/.vuepress/public/integrations-logos/woocommerce.svg new file mode 100644 index 0000000000..17f67f7eb1 --- /dev/null +++ b/packages/core/docs/.vuepress/public/integrations-logos/woocommerce.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/core/docs/Dockerfile b/packages/core/docs/Dockerfile index ca186e726b..f0cab02fda 100644 --- a/packages/core/docs/Dockerfile +++ b/packages/core/docs/Dockerfile @@ -5,8 +5,7 @@ WORKDIR /var/www COPY . . RUN yarn install \ - && yarn build:core \ - && yarn build:ct:api-client + && yarn build:ct:tools RUN cd packages/core/docs \ && yarn install \ diff --git a/packages/core/docs/commercetools/composables/use-billing.md b/packages/core/docs/commercetools/composables/use-billing.md index 619dbf6bf9..3107680865 100644 --- a/packages/core/docs/commercetools/composables/use-billing.md +++ b/packages/core/docs/commercetools/composables/use-billing.md @@ -13,11 +13,11 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - getBasicProfile: string -} -``` + ```ts + type CustomQuery = { + getBasicProfile: string + } + ``` - `save` - function for saving billing address. This method accepts a single `saveParams` object. The `saveParams` has the following options: @@ -25,47 +25,52 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```ts -type Address = { - __typename?: "Address"; - id?: Maybe; - title?: Maybe; - salutation?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - streetName?: Maybe; - streetNumber?: Maybe; - additionalStreetInfo?: Maybe; - postalCode?: Maybe; - city?: Maybe; - region?: Maybe; - state?: Maybe; - country: Scalars["Country"]; - company?: Maybe; - department?: Maybe; - building?: Maybe; - apartment?: Maybe; - pOBox?: Maybe; - contactInfo: AddressContactInfo; - phone?: Maybe; - email?: Maybe; - additionalAddressInfo?: Maybe; - externalId?: Maybe; - key?: Maybe; -}; -type CustomQuery = { - updateCart: string -} -``` + ```ts + type Address = { + __typename?: "Address"; + id?: Maybe; + title?: Maybe; + salutation?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + streetName?: Maybe; + streetNumber?: Maybe; + additionalStreetInfo?: Maybe; + postalCode?: Maybe; + city?: Maybe; + region?: Maybe; + state?: Maybe; + country: Scalars["Country"]; + company?: Maybe; + department?: Maybe; + building?: Maybe; + apartment?: Maybe; + pOBox?: Maybe; + contactInfo: AddressContactInfo; + phone?: Maybe; + email?: Maybe; + additionalAddressInfo?: Maybe; + externalId?: Maybe; + key?: Maybe; + }; + + type CustomQuery = { + updateCart: string + } + ``` + - `billing: Address` - a main data object that contains a billing address. + - `loading: boolean` - a reactive object containing information about loading state of your `load` or `save` method. + - `error: UseBillingErrors` - a reactive object containing the error message, if `load` or `save` failed for any reason. -```ts -interface UseBillingErrors { - load?: Error; - save?: Error; -} -``` + + ```ts + interface UseBillingErrors { + load?: Error; + save?: Error; + } + ``` ## Getters diff --git a/packages/core/docs/commercetools/composables/use-cart.md b/packages/core/docs/commercetools/composables/use-cart.md index e7f448875e..c55484984a 100644 --- a/packages/core/docs/commercetools/composables/use-cart.md +++ b/packages/core/docs/commercetools/composables/use-cart.md @@ -13,61 +13,61 @@ - `cart: Cart` - a main data object. -```ts -type Cart = { - __typename?: "Cart"; - customerId?: Maybe; - customer?: Maybe; - customerEmail?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - customLineItems: Array; - totalPrice: Money; - taxedPrice?: Maybe; - shippingAddress?: Maybe
; - billingAddress?: Maybe
; - inventoryMode: InventoryMode; - taxMode: TaxMode; - taxRoundingMode: RoundingMode; - taxCalculationMode: TaxCalculationMode; - customerGroup?: Maybe; - customerGroupRef?: Maybe; - country?: Maybe; - shippingInfo?: Maybe; - discountCodes: Array; - refusedGifts: Array; - refusedGiftsRefs: Array; - paymentInfo?: Maybe; - locale?: Maybe; - shippingRateInput?: Maybe; - origin: CartOrigin; - storeRef?: Maybe; - store?: Maybe; - itemShippingAddresses: Array
; - cartState: CartState; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - deleteDaysAfterLastModification?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} -``` + ```ts + type Cart = { + __typename?: "Cart"; + customerId?: Maybe; + customer?: Maybe; + customerEmail?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + customLineItems: Array; + totalPrice: Money; + taxedPrice?: Maybe; + shippingAddress?: Maybe
; + billingAddress?: Maybe
; + inventoryMode: InventoryMode; + taxMode: TaxMode; + taxRoundingMode: RoundingMode; + taxCalculationMode: TaxCalculationMode; + customerGroup?: Maybe; + customerGroupRef?: Maybe; + country?: Maybe; + shippingInfo?: Maybe; + discountCodes: Array; + refusedGifts: Array; + refusedGiftsRefs: Array; + paymentInfo?: Maybe; + locale?: Maybe; + shippingRateInput?: Maybe; + origin: CartOrigin; + storeRef?: Maybe; + store?: Maybe; + itemShippingAddresses: Array
; + cartState: CartState; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + deleteDaysAfterLastModification?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + ``` - `load` - function required to fetch cart from a server or create brand new if it doesn't exist. This method accepts a single `params` object. The `params` has the following option: - `customQuery?: customQuery` - -```ts -type CustomQuery = { - getBasicProfile: string -} -``` + + ```ts + type CustomQuery = { + getBasicProfile: string + } + ``` - `addItem` - function for adding products to the cart. This method accepts a single `params` object. The `params` has the following options: @@ -77,26 +77,26 @@ type CustomQuery = { - `customQuery?: customQuery` -```ts -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} - -type CustomQuery = { - updateCart: string -} -``` + ```ts + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + + type CustomQuery = { + updateCart: string + } + ``` - `updateItemQty` - function for updating quantity of a product that is already in the cart. This method accepts a single `params` object. The `params` has the following options: @@ -106,106 +106,106 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```ts -type LineItem = { - __typename?: "LineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - name?: Maybe; - nameAllLocales: Array; - productSlug?: Maybe; - productType?: Maybe; - productTypeRef?: Maybe; - variant?: Maybe; - price: ProductPrice; - taxedPrice?: Maybe; - totalPrice?: Maybe; - quantity: Scalars["Long"]; - state: Array; - taxRate?: Maybe; - supplyChannel?: Maybe; - supplyChannelRef?: Maybe; - distributionChannel?: Maybe; - distributionChannelRef?: Maybe; - discountedPricePerQuantity: Array; - lineItemMode: LineItemMode; - priceMode: LineItemPriceMode; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - shippingDetails?: Maybe; - inventoryMode?: Maybe; - customFieldList?: Maybe>; -} + ```ts + type LineItem = { + __typename?: "LineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + name?: Maybe; + nameAllLocales: Array; + productSlug?: Maybe; + productType?: Maybe; + productTypeRef?: Maybe; + variant?: Maybe; + price: ProductPrice; + taxedPrice?: Maybe; + totalPrice?: Maybe; + quantity: Scalars["Long"]; + state: Array; + taxRate?: Maybe; + supplyChannel?: Maybe; + supplyChannelRef?: Maybe; + distributionChannel?: Maybe; + distributionChannelRef?: Maybe; + discountedPricePerQuantity: Array; + lineItemMode: LineItemMode; + priceMode: LineItemPriceMode; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + shippingDetails?: Maybe; + inventoryMode?: Maybe; + customFieldList?: Maybe>; + } + + type CustomQuery = { + updateCart: string + } + ``` -type CustomQuery = { - updateCart: string -} -``` - - `removeItem` - function for removing a product that currently is in the cart. This method accepts a single `params` object. The `params` has the following options: - `product: LineItem` - + - `customQuery?: CustomQuery` - -```ts -type LineItem = { - __typename?: "LineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - name?: Maybe; - nameAllLocales: Array; - productSlug?: Maybe; - productType?: Maybe; - productTypeRef?: Maybe; - variant?: Maybe; - price: ProductPrice; - taxedPrice?: Maybe; - totalPrice?: Maybe; - quantity: Scalars["Long"]; - state: Array; - taxRate?: Maybe; - supplyChannel?: Maybe; - supplyChannelRef?: Maybe; - distributionChannel?: Maybe; - distributionChannelRef?: Maybe; - discountedPricePerQuantity: Array; - lineItemMode: LineItemMode; - priceMode: LineItemPriceMode; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - shippingDetails?: Maybe; - inventoryMode?: Maybe; - customFieldList?: Maybe>; -} -type CustomQuery = { - updateCart: string -} -``` - + ```ts + type LineItem = { + __typename?: "LineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + name?: Maybe; + nameAllLocales: Array; + productSlug?: Maybe; + productType?: Maybe; + productTypeRef?: Maybe; + variant?: Maybe; + price: ProductPrice; + taxedPrice?: Maybe; + totalPrice?: Maybe; + quantity: Scalars["Long"]; + state: Array; + taxRate?: Maybe; + supplyChannel?: Maybe; + supplyChannelRef?: Maybe; + distributionChannel?: Maybe; + distributionChannelRef?: Maybe; + discountedPricePerQuantity: Array; + lineItemMode: LineItemMode; + priceMode: LineItemPriceMode; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + shippingDetails?: Maybe; + inventoryMode?: Maybe; + customFieldList?: Maybe>; + } + + type CustomQuery = { + updateCart: string + } + ``` + - `isInCart` - function for checking if a product is currently in the cart. This method accepts a single `params` object. The `params` has the following option: - `product: ProductVariant` - -```ts -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} -``` + + ```ts + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + ``` - `clear` - function for removing all items currently stored in cart. @@ -215,11 +215,11 @@ type ProductVariant = { - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - updateCart: string -} -``` + ```ts + type CustomQuery = { + updateCart: string + } + ``` - `removeCoupon` - function for removing coupon applied to cart. This method accepts a single `params` object. The `params` has the following options: @@ -227,34 +227,34 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```ts -interface AgnosticCoupon { - id: string; - name: string; - code: string; - value: number; -} - -type CustomQuery = { - updateCart: string -} -``` + ```ts + interface AgnosticCoupon { + id: string; + name: string; + code: string; + value: number; + } + + type CustomQuery = { + updateCart: string + } + ``` - `loading: boolean` - a reactive object containing information about loading state of the cart. - `error: UseCartErrors` - reactive object containing the error message, if some properties failed for any reason. -```ts -interface UseCartErrors { - addItem: Error; - removeItem: Error; - updateItemQty: Error; - load: Error; - clear: Error; - applyCoupon: Error; - removeCoupon: Error; -} -``` + ```ts + interface UseCartErrors { + addItem: Error; + removeItem: Error; + updateItemQty: Error; + load: Error; + clear: Error; + applyCoupon: Error; + removeCoupon: Error; + } + ``` ## Getters @@ -284,87 +284,87 @@ interface UseCartErrors { - `getDiscounts` - returns all discounts. -```ts -interface CartGetters { - getTotals: (cart: Cart) => AgnosticTotals; - getShippingPrice: (cart: Cart) => number; - getItems: (cart: Cart) => LineItem; - getItemName: (product: LineItem) => string; - getItemImage: (product: LineItem) => string; - getItemPrice: (product: LineItem) => AgnosticPrice; - getItemQty: (product: LineItem) => number; - getItemAttributes: (product: LineItem, filterByAttributeName?: Array) => Record; - getItemSku: (product: LineItem) => string; - getTotalItems: (cart: Cart) => number; - getFormattedPrice: (price: number) => string; - getCoupons: (cart: Cart) => AgnosticCoupon[]; - getDiscounts: (cart: Cart) => AgnosticDiscount[]; -} + ```ts + interface CartGetters { + getTotals: (cart: Cart) => AgnosticTotals; + getShippingPrice: (cart: Cart) => number; + getItems: (cart: Cart) => LineItem; + getItemName: (product: LineItem) => string; + getItemImage: (product: LineItem) => string; + getItemPrice: (product: LineItem) => AgnosticPrice; + getItemQty: (product: LineItem) => number; + getItemAttributes: (product: LineItem, filterByAttributeName?: Array) => Record; + getItemSku: (product: LineItem) => string; + getTotalItems: (cart: Cart) => number; + getFormattedPrice: (price: number) => string; + getCoupons: (cart: Cart) => AgnosticCoupon[]; + getDiscounts: (cart: Cart) => AgnosticDiscount[]; + } -type LineItem = { - __typename?: "LineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - name?: Maybe; - nameAllLocales: Array; - productSlug?: Maybe; - productType?: Maybe; - productTypeRef?: Maybe; - variant?: Maybe; - price: ProductPrice; - taxedPrice?: Maybe; - totalPrice?: Maybe; - quantity: Scalars["Long"]; - state: Array; - taxRate?: Maybe; - supplyChannel?: Maybe; - supplyChannelRef?: Maybe; - distributionChannel?: Maybe; - distributionChannelRef?: Maybe; - discountedPricePerQuantity: Array; - lineItemMode: LineItemMode; - priceMode: LineItemPriceMode; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - shippingDetails?: Maybe; - inventoryMode?: Maybe; - customFieldList?: Maybe>; -} + type LineItem = { + __typename?: "LineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + name?: Maybe; + nameAllLocales: Array; + productSlug?: Maybe; + productType?: Maybe; + productTypeRef?: Maybe; + variant?: Maybe; + price: ProductPrice; + taxedPrice?: Maybe; + totalPrice?: Maybe; + quantity: Scalars["Long"]; + state: Array; + taxRate?: Maybe; + supplyChannel?: Maybe; + supplyChannelRef?: Maybe; + distributionChannel?: Maybe; + distributionChannelRef?: Maybe; + discountedPricePerQuantity: Array; + lineItemMode: LineItemMode; + priceMode: LineItemPriceMode; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + shippingDetails?: Maybe; + inventoryMode?: Maybe; + customFieldList?: Maybe>; + } -interface AgnosticTotals { - total: number; - subtotal: number; - special?: number; - [x: string]: unknown; -} + interface AgnosticTotals { + total: number; + subtotal: number; + special?: number; + [x: string]: unknown; + } -interface AgnosticPrice { - regular: number | null; - special?: number | null; -} + interface AgnosticPrice { + regular: number | null; + special?: number | null; + } -interface AgnosticAttribute { - name?: string; - value: string | Record; - label: string; -} + interface AgnosticAttribute { + name?: string; + value: string | Record; + label: string; + } -interface AgnosticCoupon { - id: string; - name: string; - code: string; - value: number; -} + interface AgnosticCoupon { + id: string; + name: string; + code: string; + value: number; + } -interface AgnosticDiscount { - id: string; - name: string; - description: string; - value: number; - code?: string; -} -``` + interface AgnosticDiscount { + id: string; + name: string; + description: string; + value: number; + code?: string; + } + ``` ## Example diff --git a/packages/core/docs/commercetools/composables/use-category.md b/packages/core/docs/commercetools/composables/use-category.md index a2878a2094..07f1655802 100644 --- a/packages/core/docs/commercetools/composables/use-category.md +++ b/packages/core/docs/commercetools/composables/use-category.md @@ -15,79 +15,79 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - categories: string -} -``` + ```ts + type CustomQuery = { + categories: string + } + ``` - `categories: Category[]` - a main data object that contains an array of categories fetched by `search` method. -```ts -type Category = { - __typename?: "Category"; - id: Scalars["String"]; - key?: Maybe; - version: Scalars["Long"]; - name?: Maybe; - nameAllLocales: Array; - description?: Maybe; - descriptionAllLocales?: Maybe>; - slug?: Maybe; - slugAllLocales: Array; - ancestorsRef: Array; - ancestors: Array; - parentRef?: Maybe; - parent?: Maybe; - orderHint: Scalars["String"]; - externalId?: Maybe; - metaTitle?: Maybe; - metaKeywords?: Maybe; - metaDescription?: Maybe; - productCount: Scalars["Int"]; - stagedProductCount: Scalars["Int"]; - childCount: Scalars["Int"]; - children?: Maybe>; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - assets: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} -``` + ```ts + type Category = { + __typename?: "Category"; + id: Scalars["String"]; + key?: Maybe; + version: Scalars["Long"]; + name?: Maybe; + nameAllLocales: Array; + description?: Maybe; + descriptionAllLocales?: Maybe>; + slug?: Maybe; + slugAllLocales: Array; + ancestorsRef: Array; + ancestors: Array; + parentRef?: Maybe; + parent?: Maybe; + orderHint: Scalars["String"]; + externalId?: Maybe; + metaTitle?: Maybe; + metaKeywords?: Maybe; + metaDescription?: Maybe; + productCount: Scalars["Int"]; + stagedProductCount: Scalars["Int"]; + childCount: Scalars["Int"]; + children?: Maybe>; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + assets: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + ``` - `loading: boolean` - a reactive object containing information about loading state of your `search` method. - `error: UseCategoryErrors` - reactive object containing the error message, if `search` failed for any reason. -```ts -interface UseCategoryErrors { - search: Error; -} -``` + ```ts + interface UseCategoryErrors { + search: Error; + } + ``` ## Getters - `getTree` - returns category tree. -```ts -interface CategoryGetters { - getTree: (category: Category) => AgnosticCategoryTree | null; -} + ```ts + interface CategoryGetters { + getTree: (category: Category) => AgnosticCategoryTree | null; + } -interface AgnosticCategoryTree { - label: string; - slug?: string; - items: AgnosticCategoryTree[]; - isCurrent: boolean; - count?: number; - [x: string]: unknown; -} -``` + interface AgnosticCategoryTree { + label: string; + slug?: string; + items: AgnosticCategoryTree[]; + isCurrent: boolean; + count?: number; + [x: string]: unknown; + } + ``` ## Example diff --git a/packages/core/docs/commercetools/composables/use-facet.md b/packages/core/docs/commercetools/composables/use-facet.md index 3f52bf78e5..f0ccbfabdd 100644 --- a/packages/core/docs/commercetools/composables/use-facet.md +++ b/packages/core/docs/commercetools/composables/use-facet.md @@ -3,7 +3,7 @@ :::warning This feature is a part of our commercial offering but also exists in the Open Source version of our commercetools integration. -Open Source implementation relies on GraphQL API (internally using `getProduct` and `getCategory` composables), which doesn't provide full faceting capabilities as does the dedicated REST-based faceting API offered in our Enterprise version. Please [contact our team](https://www.vuestorefront.io/contact/sales) if you'd like to get access to it. +Open Source implementation relies on GraphQL API (internally using `getProduct` and `getCategory` composables), which doesn't provide full faceting capabilities as does the dedicated REST-based faceting API offered in our Enterprise version. Please [contact our Sales team](https://www.vuestorefront.io/contact/sales) if you'd like to get access to it. ::: ## Features @@ -24,19 +24,19 @@ For more information about faceting, please refer to [this page](../composables/ - `search` - function for searching and classifying records, allowing users to browse the catalog data. It accepts a single object as a parameter with following signature: -```ts -interface AgnosticFacetSearchParams { - categorySlug?: string; - rootCatSlug?: string; - term?: string; - page?: number; - itemsPerPage?: number; - sort?: string; - filters?: Record; - metadata?: any; - [x: string]: any; -} -``` + ```ts + interface AgnosticFacetSearchParams { + categorySlug?: string; + rootCatSlug?: string; + term?: string; + page?: number; + itemsPerPage?: number; + sort?: string; + filters?: Record; + metadata?: any; + [x: string]: any; + } + ``` - `result` - reactive data object containing the response from the backend. @@ -44,11 +44,11 @@ interface AgnosticFacetSearchParams { - `error` - reactive object containing the error message, if `search` failed for any reason. -```ts -interface UseFacetErrors { - search: Error; -} -``` + ```ts + interface UseFacetErrors { + search: Error; + } + ``` ## Getters Because the `result` property is a raw response with some additional properties, it's recommended to use `facetGetters` for accessing any data from it. It includes the following helper functions: @@ -67,105 +67,104 @@ Because the `result` property is a raw response with some additional properties, - `getBreadcrumbs` - returns breadcrumbs information. + ```ts + interface FacetsGetters { + getAll: (searchData: SearchData, criteria?: string[]) => AgnosticFacet[]; + getGrouped: (searchData: SearchData, criteria?: string[]) => AgnosticGroupedFacet[]; + getCategoryTree: (searchData: SearchData) => AgnosticCategoryTree; + getSortOptions: (searchData: SearchData) => AgnosticSort; + getProducts: (searchData: SearchData) => ProductVariant[]; + getPagination: (searchData: SearchData) => AgnosticPagination; + getBreadcrumbs: (searchData: SearchData) => AgnosticBreadcrumb[]; + } -```ts -interface FacetsGetters { - getAll: (searchData: SearchData, criteria?: string[]) => AgnosticFacet[]; - getGrouped: (searchData: SearchData, criteria?: string[]) => AgnosticGroupedFacet[]; - getCategoryTree: (searchData: SearchData) => AgnosticCategoryTree; - getSortOptions: (searchData: SearchData) => AgnosticSort; - getProducts: (searchData: SearchData) => ProductVariant[]; - getPagination: (searchData: SearchData) => AgnosticPagination; - getBreadcrumbs: (searchData: SearchData) => AgnosticBreadcrumb[]; -} - -interface AgnosticFacet { - type: string; - id: string; - value: any; - attrName?: string; - count?: number; - selected?: boolean; - metadata?: any; -} + interface AgnosticFacet { + type: string; + id: string; + value: any; + attrName?: string; + count?: number; + selected?: boolean; + metadata?: any; + } -interface AgnosticGroupedFacet { - id: string; - label: string; - count?: number; - options: AgnosticFacet[]; -} + interface AgnosticGroupedFacet { + id: string; + label: string; + count?: number; + options: AgnosticFacet[]; + } -interface AgnosticCategoryTree { - label: string; - slug?: string; - items: AgnosticCategoryTree[]; - isCurrent: boolean; - count?: number; - [x: string]: unknown; -} + interface AgnosticCategoryTree { + label: string; + slug?: string; + items: AgnosticCategoryTree[]; + isCurrent: boolean; + count?: number; + [x: string]: unknown; + } -interface AgnosticSort { - options: AgnosticFacet[]; - selected: string; -} + interface AgnosticSort { + options: AgnosticFacet[]; + selected: string; + } -type SearchData = FacetSearchResult + type SearchData = FacetSearchResult -interface FacetSearchResult { - data; - input: AgnosticFacetSearchParams; -} + interface FacetSearchResult { + data; + input: AgnosticFacetSearchParams; + } -interface AgnosticFacetSearchParams { - categorySlug?: string; - rootCatSlug?: string; - term?: string; - page?: number; - itemsPerPage?: number; - sort?: string; - filters?: Record; - metadata?: any; - [x: string]: any; -} + interface AgnosticFacetSearchParams { + categorySlug?: string; + rootCatSlug?: string; + term?: string; + page?: number; + itemsPerPage?: number; + sort?: string; + filters?: Record; + metadata?: any; + [x: string]: any; + } -interface AgnosticPagination { - currentPage: number; - totalPages: number; - totalItems: number; - itemsPerPage: number; - pageOptions: number[]; -} + interface AgnosticPagination { + currentPage: number; + totalPages: number; + totalItems: number; + itemsPerPage: number; + pageOptions: number[]; + } -interface AgnosticBreadcrumb { - text: string; - link: string; -} + interface AgnosticBreadcrumb { + text: string; + link: string; + } -interface FacetResultsData { - products: ProductVariant[]; - categories: Category[]; - facets: Record; - total: number; - perPageOptions: number[]; - itemsPerPage: number; -} + interface FacetResultsData { + products: ProductVariant[]; + categories: Category[]; + facets: Record; + total: number; + perPageOptions: number[]; + itemsPerPage: number; + } -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} -``` + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + ``` ## Configuration diff --git a/packages/core/docs/commercetools/composables/use-forgot-password.md b/packages/core/docs/commercetools/composables/use-forgot-password.md index 9f55d92bdf..6cf8ca27d8 100644 --- a/packages/core/docs/commercetools/composables/use-forgot-password.md +++ b/packages/core/docs/commercetools/composables/use-forgot-password.md @@ -1,4 +1,4 @@ -# `useForgotPassword` +# `useForgotPassword` ## Features @@ -15,15 +15,15 @@ - `customQuery?: CustomQuery` -```typescript -interface ResetPasswordParams { - email: string; -} + ```typescript + interface ResetPasswordParams { + email: string; + } -type CustomQuery = { - customerCreatePasswordResetToken: string -} -``` + type CustomQuery = { + customerCreatePasswordResetToken: string + } + ``` - `setNew` - function to set new user password after `request`. When invoked, it requests data from the API and populates the `result` object. This method accepts a single `params` object with the following properties: @@ -31,16 +31,16 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```typescript -interface SetNewPasswordParams { - tokenValue: string; - newPassword: string; -} + ```typescript + interface SetNewPasswordParams { + tokenValue: string; + newPassword: string; + } -type CustomQuery = { - customerResetPassword: string -} -``` + type CustomQuery = { + customerResetPassword: string + } + ``` - `token: string` - reactive data string containing the reset token. @@ -48,12 +48,12 @@ type CustomQuery = { - `error: UseForgotPasswordErrors` - reactive object containing the error message, if `setNew` or `request` failed for any reason. -```ts -interface UseForgotPasswordErrors { - request: Error; - setNew: Error; -} -``` + ```ts + interface UseForgotPasswordErrors { + request: Error; + setNew: Error; + } + ``` ## Getters @@ -61,78 +61,78 @@ interface UseForgotPasswordErrors { - `isPasswordChanged` - returns a boolean value of a password set status. -```ts -interface ForgotPasswordGetters { - getResetPasswordToken: (result: ForgotPasswordResult) => string - isPasswordChanged: (result: ForgotPasswordResult) => boolean -} - -interface ForgotPasswordResult { - resetPasswordResult: CreatePasswordResetTokenResponse; - setNewPasswordResult: ResetPasswordResponse; -} - -type CreatePasswordResetTokenResponse = QueryResponse<'customerCreatePasswordResetToken', CustomerPasswordToken>; - -type ResetPasswordResponse = QueryResponse<'customerResetPassword', Customer>; - -type CustomerPasswordToken = { - customerId: Scalars["String"]; - expiresAt: Scalars["DateTime"]; - value: Scalars["String"]; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; -} - -type Customer = Versioned & { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - /** This field contains non-typed data. Consider using `customFields` as a typed alternative. */ - customFieldsRaw?: Maybe>; - /** This field would contain type data */ - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - /** Custom fields are returned as a list instead of an object structure. */ - customFieldList?: Maybe>; -}; -``` + ```ts + interface ForgotPasswordGetters { + getResetPasswordToken: (result: ForgotPasswordResult) => string + isPasswordChanged: (result: ForgotPasswordResult) => boolean + } + + interface ForgotPasswordResult { + resetPasswordResult: CreatePasswordResetTokenResponse; + setNewPasswordResult: ResetPasswordResponse; + } + + type CreatePasswordResetTokenResponse = QueryResponse<'customerCreatePasswordResetToken', CustomerPasswordToken>; + + type ResetPasswordResponse = QueryResponse<'customerResetPassword', Customer>; + + type CustomerPasswordToken = { + customerId: Scalars["String"]; + expiresAt: Scalars["DateTime"]; + value: Scalars["String"]; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + } + + type Customer = Versioned & { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + /** This field contains non-typed data. Consider using `customFields` as a typed alternative. */ + customFieldsRaw?: Maybe>; + /** This field would contain type data */ + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + /** Custom fields are returned as a list instead of an object structure. */ + customFieldList?: Maybe>; + }; + ``` ## Example diff --git a/packages/core/docs/commercetools/composables/use-make-order.md b/packages/core/docs/commercetools/composables/use-make-order.md index 7e7259443f..d4e4ce8b27 100644 --- a/packages/core/docs/commercetools/composables/use-make-order.md +++ b/packages/core/docs/commercetools/composables/use-make-order.md @@ -10,80 +10,82 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - createMyOrderFromCart: string -} -``` + ```ts + type CustomQuery = { + createMyOrderFromCart: string + } + ``` + - `order: Order` - a main data object that contains a made order. -```ts -type Order = Versioned & { - __typename?: "Order"; - customerId?: Maybe; - customer?: Maybe; - customerEmail?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - customLineItems: Array; - totalPrice: Money; - taxedPrice?: Maybe; - shippingAddress?: Maybe
; - billingAddress?: Maybe
; - inventoryMode: InventoryMode; - taxMode: TaxMode; - taxRoundingMode: RoundingMode; - taxCalculationMode: TaxCalculationMode; - customerGroup?: Maybe; - customerGroupRef?: Maybe; - country?: Maybe; - shippingInfo?: Maybe; - discountCodes: Array; - refusedGifts: Array; - refusedGiftsRefs: Array; - paymentInfo?: Maybe; - locale?: Maybe; - shippingRateInput?: Maybe; - origin: CartOrigin; - storeRef?: Maybe; - store?: Maybe; - itemShippingAddresses: Array
; - completedAt?: Maybe; - orderNumber?: Maybe; - orderState: OrderState; - stateRef?: Maybe; - state?: Maybe; - shipmentState?: Maybe; - paymentState?: Maybe; - syncInfo: Array; - returnInfo: Array; - lastMessageSequenceNumber: Scalars["Long"]; - cartRef?: Maybe; - cart?: Maybe; - /** This field contains non-typed data. Consider using `customFields` as a typed alternative. */ - customFieldsRaw?: Maybe>; - /** This field would contain type data */ - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - /** Custom fields are returned as a list instead of an object structure. */ - customFieldList?: Maybe>; -}; -``` + + ```ts + type Order = Versioned & { + __typename?: "Order"; + customerId?: Maybe; + customer?: Maybe; + customerEmail?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + customLineItems: Array; + totalPrice: Money; + taxedPrice?: Maybe; + shippingAddress?: Maybe
; + billingAddress?: Maybe
; + inventoryMode: InventoryMode; + taxMode: TaxMode; + taxRoundingMode: RoundingMode; + taxCalculationMode: TaxCalculationMode; + customerGroup?: Maybe; + customerGroupRef?: Maybe; + country?: Maybe; + shippingInfo?: Maybe; + discountCodes: Array; + refusedGifts: Array; + refusedGiftsRefs: Array; + paymentInfo?: Maybe; + locale?: Maybe; + shippingRateInput?: Maybe; + origin: CartOrigin; + storeRef?: Maybe; + store?: Maybe; + itemShippingAddresses: Array
; + completedAt?: Maybe; + orderNumber?: Maybe; + orderState: OrderState; + stateRef?: Maybe; + state?: Maybe; + shipmentState?: Maybe; + paymentState?: Maybe; + syncInfo: Array; + returnInfo: Array; + lastMessageSequenceNumber: Scalars["Long"]; + cartRef?: Maybe; + cart?: Maybe; + /** This field contains non-typed data. Consider using `customFields` as a typed alternative. */ + customFieldsRaw?: Maybe>; + /** This field would contain type data */ + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + /** Custom fields are returned as a list instead of an object structure. */ + customFieldList?: Maybe>; + }; + ``` - `loading: boolean` - a reactive object containing information about loading state of your `make` method. - `error: UseMakeOrderErrors` - a reactive object containing the error message, if `load` or `save` failed for any reason. -```ts -interface UseMakeOrderErrors { - make?: Error; -} -``` + ```ts + interface UseMakeOrderErrors { + make?: Error; + } + ``` ## Getters diff --git a/packages/core/docs/commercetools/composables/use-product.md b/packages/core/docs/commercetools/composables/use-product.md index 7df7a88e71..d71cc46178 100644 --- a/packages/core/docs/commercetools/composables/use-product.md +++ b/packages/core/docs/commercetools/composables/use-product.md @@ -12,51 +12,52 @@ - `customQuery?: CustomQuery` -```ts -interface ProductsSearchParams { - perPage?: number; - page?: number; - sort?: any; - term?: any; - filters?: Record; - catId?: string | string[]; - skus?: string[]; - slug?: string; - id?: string; -} + ```ts + interface ProductsSearchParams { + perPage?: number; + page?: number; + sort?: any; + term?: any; + filters?: Record; + catId?: string | string[]; + skus?: string[]; + slug?: string; + id?: string; + } + + type CustomQuery = { + products: string + } + ``` -type CustomQuery = { - products: string -} -``` - `products: ProductVariant[]` - a main data object that contains an array of products fetched by `search` method. -```ts -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} -``` + ```ts + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + ``` - `loading: boolean` - a reactive object containing information about loading state of your `search` method. - `error: UseProductErrors` - reactive object containing the error message, if `search` failed for any reason. -```ts -interface UseProductErrors { - search: Error; -} -``` + ```ts + interface UseProductErrors { + search: Error; + } + ``` ## Getters @@ -86,60 +87,60 @@ interface UseProductErrors { - `getAverageRating` - returns average rating from all reviews. -```ts -interface ProductGetters { - getName: (product: ProductVariant | Readonly) => string; - getSlug: (product: ProductVariant | Readonly) => string; - getPrice: (product: ProductVariant | Readonly) => AgnosticPrice; - getGallery: (product: ProductVariant) => AgnosticMediaGalleryItem[]; - getCoverImage: (product: ProductVariant) => string; - getFiltered: (products: ProductVariant[], filters: ProductVariantFilters | any = {}) => ProductVariant[]; - getAttributes: (products: ProductVariant[] | ProductVariant, filterByAttributeName?: string[]) => Record; - getDescription: (product: ProductVariant) => string; - getCategoryIds: (product: ProductVariant) => string[]; - getId: (product: ProductVariant) => string; - getFormattedPrice: (price: number) => string; - getTotalReviews: (product: ProductVariant) => number; - getAverageRating: (product: ProductVariant) => number; -} + ```ts + interface ProductGetters { + getName: (product: ProductVariant | Readonly) => string; + getSlug: (product: ProductVariant | Readonly) => string; + getPrice: (product: ProductVariant | Readonly) => AgnosticPrice; + getGallery: (product: ProductVariant) => AgnosticMediaGalleryItem[]; + getCoverImage: (product: ProductVariant) => string; + getFiltered: (products: ProductVariant[], filters: ProductVariantFilters | any = {}) => ProductVariant[]; + getAttributes: (products: ProductVariant[] | ProductVariant, filterByAttributeName?: string[]) => Record; + getDescription: (product: ProductVariant) => string; + getCategoryIds: (product: ProductVariant) => string[]; + getId: (product: ProductVariant) => string; + getFormattedPrice: (price: number) => string; + getTotalReviews: (product: ProductVariant) => number; + getAverageRating: (product: ProductVariant) => number; + } -interface AgnosticPrice { - regular: number | null; - special?: number | null; -} + interface AgnosticPrice { + regular: number | null; + special?: number | null; + } -interface AgnosticMediaGalleryItem { - small: string; - normal: string; - big: string; -} + interface AgnosticMediaGalleryItem { + small: string; + normal: string; + big: string; + } -interface AgnosticAttribute { - name?: string; - value: string | Record; - label: string; -} + interface AgnosticAttribute { + name?: string; + value: string | Record; + label: string; + } -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } -interface ProductVariantFilters { - master?: boolean; - attributes?: Record; -} -``` + interface ProductVariantFilters { + master?: boolean; + attributes?: Record; + } + ``` ## Examples diff --git a/packages/core/docs/commercetools/composables/use-review.md b/packages/core/docs/commercetools/composables/use-review.md index 828cb6f0a5..696ef39d8e 100644 --- a/packages/core/docs/commercetools/composables/use-review.md +++ b/packages/core/docs/commercetools/composables/use-review.md @@ -16,63 +16,60 @@ - `search` - function for fetching review data. When invoked, it requests data from the API and populates `reviews` property. This method accepts a single params object. The `params` has the following option: - - `searchParams: ReviewSearchParams` + - `productId: string` + + - `limit?: number` + + - `offset?: number` - `customQuery?: CustomQuery` -```typescript -interface ReviewSearchParams { - productId: string; - limit?: number; - offset?: number; -} - -type CustomQuery = { - reviews: string -} -``` + ```typescript + type CustomQuery = { + reviews: string + } + ``` - `addReview` - function for posting new review. When invoked, it submits data to the API and populates `reviews` property with updated information. This method accepts a single params object. The `params` has the following options: - - `params: ReviewAddParams` + - `productId: string` + + - `limit?: number` + + - `offset?: number` + + - `draft: ReviewDraft` - `customQuery?: CustomQuery` -```typescript -interface ReviewAddParams { - productId: string; - limit?: number; - offset?: number; - draft: ReviewDraft; -} - -interface ReviewDraft { - authorName: string; - text: string; - rating: number; -} - -type CustomQuery = { - addReview: string -} -``` + ```typescript + interface ReviewDraft { + authorName: string; + text: string; + rating: number; + } + + type CustomQuery = { + addReview: string + } + ``` - `reviews: Review[]` - reactive data object containing the response from the backend. -```ts -type Review = any; -``` + ```ts + type Review = any; + ``` - `loading: boolean` - reactive object containing information about loading state of `search` and `addReview` methods. - `error: UseReviewErrors` - reactive object containing the error message, if `search` or `addReview` failed for any reason. -```ts -interface UseReviewErrors { - search: Error; - addReview: Error; -} -``` + ```ts + interface UseReviewErrors { + search: Error; + addReview: Error; + } + ``` ## Getters @@ -96,38 +93,38 @@ interface UseReviewErrors { - `getReviewDate` - returns creation date from an individual review item. -```typescript -interface ReviewGetters { - getItems: (review: ReviewResponse) => Review[]; - getTotalReviews: (review: ReviewResponse) => number; - getAverageRating: (review: ReviewResponse) => number; - getRatesCount: (review: ReviewResponse) => AgnosticRateCount[]; - getReviewsPage: (review: ReviewResponse) => number; - getReviewId: (item: Review) => string; - getReviewAuthor: (item: Review) => string; - getReviewMessage: (item: Review) => string; - getReviewRating: (item: Review) => number; - getReviewDate: (item: Review) => string; -} - -type ReviewResponse = { - results: Review[], - total: number; - limit: number; - offset: number; - averageRating: number; - ratingsDistribution: { - [rating: number]: number; - }; -} - -type Review = any; - -interface AgnosticRateCount { - rate: number; - count: number; -} -``` + ```typescript + interface ReviewGetters { + getItems: (review: ReviewResponse) => Review[]; + getTotalReviews: (review: ReviewResponse) => number; + getAverageRating: (review: ReviewResponse) => number; + getRatesCount: (review: ReviewResponse) => AgnosticRateCount[]; + getReviewsPage: (review: ReviewResponse) => number; + getReviewId: (item: Review) => string; + getReviewAuthor: (item: Review) => string; + getReviewMessage: (item: Review) => string; + getReviewRating: (item: Review) => number; + getReviewDate: (item: Review) => string; + } + + type ReviewResponse = { + results: Review[], + total: number; + limit: number; + offset: number; + averageRating: number; + ratingsDistribution: { + [rating: number]: number; + }; + } + + type Review = any; + + interface AgnosticRateCount { + rate: number; + count: number; + } + ``` ## Example @@ -144,7 +141,6 @@ export default { error } = useReview(''); - // If you're using Nuxt or any other framework for Universal Vue apps onSSR(async () => { await search({ productId: '' }); }); diff --git a/packages/core/docs/commercetools/composables/use-shipping-provider.md b/packages/core/docs/commercetools/composables/use-shipping-provider.md index a8a6205128..ee7fea76cf 100644 --- a/packages/core/docs/commercetools/composables/use-shipping-provider.md +++ b/packages/core/docs/commercetools/composables/use-shipping-provider.md @@ -13,11 +13,11 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - getBasicProfile: string -} -``` + ```ts + type CustomQuery = { + getBasicProfile: string + } + ``` - `save` - function for selecting shipping method. This method accepts a single `saveParams` object. The `saveParams` has the following options: @@ -25,61 +25,63 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```ts -type ShippingMethod = Versioned & { - __typename?: "ShippingMethod"; - id: Scalars["String"]; - version: Scalars["Long"]; - name: Scalars["String"]; - description?: Maybe; - zoneRates: Array; - isDefault: Scalars["Boolean"]; - predicate?: Maybe; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - key?: Maybe; - lastModifiedBy?: Maybe; - createdBy?: Maybe; - taxCategoryRef?: Maybe; - taxCategory?: Maybe; -}; - -type CustomQuery = { - updateCart: string -} -``` + ```ts + type ShippingMethod = Versioned & { + __typename?: "ShippingMethod"; + id: Scalars["String"]; + version: Scalars["Long"]; + name: Scalars["String"]; + description?: Maybe; + zoneRates: Array; + isDefault: Scalars["Boolean"]; + predicate?: Maybe; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + key?: Maybe; + lastModifiedBy?: Maybe; + createdBy?: Maybe; + taxCategoryRef?: Maybe; + taxCategory?: Maybe; + }; + + type CustomQuery = { + updateCart: string + } + ``` + - `state: ShippingProviderState` - a main data object that contains a shipping method -```ts -interface ShippingProviderState { - response: ShippingInfo -} -type ShippingInfo = { - __typename?: "ShippingInfo"; - shippingMethodName: Scalars["String"]; - price: Money; - shippingRate: ShippingRate; - taxRate?: Maybe; - taxCategory?: Maybe; - deliveries: Array; - discountedPrice?: Maybe; - taxedPrice?: Maybe; - shippingMethodState: ShippingMethodState; - shippingMethod?: Maybe; - shippingMethodRef?: Maybe; -}; -``` + ```ts + interface ShippingProviderState { + response: ShippingInfo + } + + type ShippingInfo = { + __typename?: "ShippingInfo"; + shippingMethodName: Scalars["String"]; + price: Money; + shippingRate: ShippingRate; + taxRate?: Maybe; + taxCategory?: Maybe; + deliveries: Array; + discountedPrice?: Maybe; + taxedPrice?: Maybe; + shippingMethodState: ShippingMethodState; + shippingMethod?: Maybe; + shippingMethodRef?: Maybe; + }; + ``` - `loading: boolean` - a reactive object containing information about loading state of your `load` or `save` method. - `error: UseShippingProviderErrors` - a reactive object containing the error message, if `load` or `save` failed for any reason. -```ts -interface UseShippingProviderErrors { - load?: Error; - save?: Error; -} -``` + ```ts + interface UseShippingProviderErrors { + load?: Error; + save?: Error; + } + ``` ## Getters diff --git a/packages/core/docs/commercetools/composables/use-shipping.md b/packages/core/docs/commercetools/composables/use-shipping.md index f5505ec97d..7dc6975fd9 100644 --- a/packages/core/docs/commercetools/composables/use-shipping.md +++ b/packages/core/docs/commercetools/composables/use-shipping.md @@ -13,11 +13,11 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - getBasicProfile: string -} -``` + ```ts + type CustomQuery = { + getBasicProfile: string + } + ``` - `save` - function for saving shipping address. This method accepts a single `saveParams` object. The `saveParams` has the following options: @@ -25,51 +25,52 @@ type CustomQuery = { - `customQuery?: CustomQuery` -```ts -type Address = { - __typename?: "Address"; - id?: Maybe; - title?: Maybe; - salutation?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - streetName?: Maybe; - streetNumber?: Maybe; - additionalStreetInfo?: Maybe; - postalCode?: Maybe; - city?: Maybe; - region?: Maybe; - state?: Maybe; - country: Scalars["Country"]; - company?: Maybe; - department?: Maybe; - building?: Maybe; - apartment?: Maybe; - pOBox?: Maybe; - contactInfo: AddressContactInfo; - phone?: Maybe; - email?: Maybe; - additionalAddressInfo?: Maybe; - externalId?: Maybe; - key?: Maybe; -}; - -type CustomQuery = { - updateCart: string -} -``` + ```ts + type Address = { + __typename?: "Address"; + id?: Maybe; + title?: Maybe; + salutation?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + streetName?: Maybe; + streetNumber?: Maybe; + additionalStreetInfo?: Maybe; + postalCode?: Maybe; + city?: Maybe; + region?: Maybe; + state?: Maybe; + country: Scalars["Country"]; + company?: Maybe; + department?: Maybe; + building?: Maybe; + apartment?: Maybe; + pOBox?: Maybe; + contactInfo: AddressContactInfo; + phone?: Maybe; + email?: Maybe; + additionalAddressInfo?: Maybe; + externalId?: Maybe; + key?: Maybe; + }; + + type CustomQuery = { + updateCart: string + } + ``` + - `shipping: Address` - a main data object that contains a shipping address. - `loading: boolean` - a reactive object containing information about loading state of your `load` or `save` method. - `error: UseShippingErrors` - a reactive object containing the error message, if `load` or `save` failed for any reason. -```ts -interface UseShippingErrors { - load?: Error; - save?: Error; -} -``` + ```ts + interface UseShippingErrors { + load?: Error; + save?: Error; + } + ``` ## Getters diff --git a/packages/core/docs/commercetools/composables/use-store.md b/packages/core/docs/commercetools/composables/use-store.md index 00bc048118..97a76e179c 100644 --- a/packages/core/docs/commercetools/composables/use-store.md +++ b/packages/core/docs/commercetools/composables/use-store.md @@ -1,4 +1,4 @@ -# `useStore` +# `useStore` ## Features @@ -13,74 +13,140 @@ - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - [key: string]: string -} -``` + ```ts + type CustomQuery = { + [key: string]: string + } + ``` - `change` - function for changing and saving selected store / channel. This method accepts a single params object. The params has the following options: - `currentStore: AgnosticStore` + - `store: AgnosticStore` + - `customQuery?: CustomQuery` -```ts -interface AgnosticStore { - name: string; - id: string; - description?: string; - locales?: AgnosticLocale[]; - currencies?: AgnosticCurrency[] - address?: AgnosticAddress; - geoLocation?: AgnosticGeoLocation; - [x: string]: unknown; -} -``` + ```ts + interface AgnosticStore { + name: string; + id: string; + description?: string; + locales?: AgnosticLocale[]; + currencies?: AgnosticCurrency[] + address?: AgnosticAddress; + geoLocation?: AgnosticGeoLocation; + [x: string]: unknown; + } + ``` - `response` - a main data object that contains loaded stores data. -```ts -type StoreQueryResult = { - offset: Scalars["Int"]; - count: Scalars["Int"]; - total: Scalars["Long"]; - results: Array; -}; - -export type Store = { - id: Scalars["String"]; - version: Scalars["Long"]; - key: Scalars["String"]; - name?: Maybe; - nameAllLocales?: Maybe>; - languages?: Maybe>; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - distributionChannels: Array; - supplyChannels: Array; -}; -``` + ```ts + type StoreQueryResult = { + offset: Scalars["Int"]; + count: Scalars["Int"]; + total: Scalars["Long"]; + results: Array; + }; + + export type Store = { + id: Scalars["String"]; + version: Scalars["Long"]; + key: Scalars["String"]; + name?: Maybe; + nameAllLocales?: Maybe>; + languages?: Maybe>; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + distributionChannels: Array; + supplyChannels: Array; + }; + ``` - `loading: boolean` - a reactive object containing information about loading state of your `load` method. - `error: UseShippingErrors` - a reactive object containing the error message, if `load` or `save` failed for any reason. -```ts -export interface UseStoreErrors { - load: Error | null; - change: Error | null; -} -``` + ```ts + export interface UseStoreErrors { + load: Error | null; + change: Error | null; + } + ``` ## Getters +`storeGetter` object contains following methods: + - `getItems` - returns list of stores as `AgnosticStore` array. - `getSelected` - returns selected store as `AgnosticStore`. + +Related references: + - [storeGetter](/commercetools/api-reference/commercetools.storegetters.html) + - [UseStoreGetters](/core/api-reference/core.usestoregetters.html) + - [StoresData](/commercetools/api-reference/commercetools.storesdata.html) + + ```typescript + export interface useStoreGetters { + getItems(stores: StoresData, criteria?: CRITERIA): AgnosticStore[]; + getSelected(stores: StoresData): AgnosticStore | undefined + } + + export interface StoresData extends StoreQueryResult { + _selectedStore: string; + } + + export type StoreQueryResult = { + __typename?: "StoreQueryResult"; + offset: Scalars["Int"]; + count: Scalars["Int"]; + total: Scalars["Long"]; + results: Array; + } + + export interface AgnosticStore { + name: string; + id: string; + description?: string; + locales?: AgnosticLocale[]; + currencies?: AgnosticCurrency[] + address?: AgnosticAddress; + geoLocation?: AgnosticGeoLocation; + [x: string]: unknown; + } + + export interface AgnosticLocale { + code: string; + label: string; + [x: string]: unknown; + } + + export interface AgnosticCurrency { + code: string; + label: string; + prefixSign: boolean; + sign: string; + [x: string]: unknown; + } + + export interface AgnosticAddress { + addressLine1: string; + addressLine2: string; + [x: string]: unknown; + } + + export interface AgnosticGeoLocation { + type: string; + coordinates?: unknown; + [x: string]: unknown; + } + ``` + ## Example ```js diff --git a/packages/core/docs/commercetools/composables/use-user-billing.md b/packages/core/docs/commercetools/composables/use-user-billing.md index 8eb94cf0c7..0602e78fce 100644 --- a/packages/core/docs/commercetools/composables/use-user-billing.md +++ b/packages/core/docs/commercetools/composables/use-user-billing.md @@ -20,25 +20,25 @@ - `customQuery?: customQuery` -```typescript -interface BillingAddressAddParams { - address: { - firstName: string; - lastName: string; - streetName: string; - postalCode: string; - city: string; - state: string; - country: string; - apartment: string; - phone: string; - isDefault?: boolean; - } -} -type customQuery = { - addBillingAddress: string -} -``` + ```typescript + interface BillingAddressAddParams { + address: { + firstName: string; + lastName: string; + streetName: string; + postalCode: string; + city: string; + state: string; + country: string; + apartment: string; + phone: string; + isDefault?: boolean; + } + } + type customQuery = { + addBillingAddress: string + } + ``` - `deleteAddress` - function for deleting existing billing address. This method accepts a single `params` object. The `params` has the following options: @@ -46,16 +46,16 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface BillingAddressDeleteParams { - address: { - id: string; - } -} -type customQuery = { - deleteBillingAddress: string -} -``` + ```typescript + interface BillingAddressDeleteParams { + address: { + id: string; + } + } + type customQuery = { + deleteBillingAddress: string + } + ``` - `updateAddress` - function for updating existing billing address. This method accepts a single `params` object. The `params` has the following options: @@ -63,26 +63,26 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface BillingAddressUpdateParams { - address: { - id: string; - firstName: string; - lastName: string; - streetName: string; - postalCode: string; - city: string; - state: string; - country: string; - apartment: string; - phone: string; - isDefault?: boolean; - } -} -type customQuery = { - updateBillingAddress: string -} -``` + ```typescript + interface BillingAddressUpdateParams { + address: { + id: string; + firstName: string; + lastName: string; + streetName: string; + postalCode: string; + city: string; + state: string; + country: string; + apartment: string; + phone: string; + isDefault?: boolean; + } + } + type customQuery = { + updateBillingAddress: string + } + ``` - `setDefaultAddress` - function for settings an existing billing address as default. This method accepts a single `params` object. The `params` has the following options: @@ -90,63 +90,64 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface BillingAddressSetDefaultParams { - address: { - id: string; - } -} -type customQuery = { - setDefaultBillingAddress: string -} -``` + ```typescript + interface BillingAddressSetDefaultParams { + address: { + id: string; + } + } + type customQuery = { + setDefaultBillingAddress: string + } + ``` + - `billing: User` - reactive data object containing response from the backend. -```ts -type Customer = { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} - -type User = Customer; -``` + ```ts + type Customer = { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + + type User = Customer; + ``` - `loading: boolean` - reactive object containing information about loading state of `load`, `addAddress`, `deleteAddress`, `updateAddress` and `setDefaultAddress` methods. @@ -190,103 +191,102 @@ type User = Customer; - `isDefault` - return information if address is current default. -```typescript + ```typescript + interface UserBillingGetters { + getAddresses: (billing: User, criteria?: Record) => BillingAddress[]; + getDefault: (billing: User) => BillingAddress; + getTotal: (billing: User) => number; + getId: (address: BillingAddress) => string | number; + getPostCode: (address: BillingAddress) => string; + getStreetName: (address: BillingAddress) => string; + getStreetNumber: (address: BillingAddress) => string | number; + getCity: (address: BillingAddress) => string; + getFirstName: (address: BillingAddress) => string; + getLastName: (address: BillingAddress) => string; + getCountry: (address: BillingAddress) => string; + getPhone: (address: BillingAddress) => string; + getEmail: (address: BillingAddress) => string; + getProvince: (address: BillingAddress) => string; + getCompanyName: (address: BillingAddress) => string; + getTaxNumber: (address: BillingAddress) => string; + getApartmentNumber: (address: BillingAddress) => string | number; + isDefault: (address: BillingAddress) => boolean; + } -interface UserBillingGetters { - getAddresses: (billing: User, criteria?: Record) => BillingAddress[]; - getDefault: (billing: User) => BillingAddress; - getTotal: (billing: User) => number; - getId: (address: BillingAddress) => string | number; - getPostCode: (address: BillingAddress) => string; - getStreetName: (address: BillingAddress) => string; - getStreetNumber: (address: BillingAddress) => string | number; - getCity: (address: BillingAddress) => string; - getFirstName: (address: BillingAddress) => string; - getLastName: (address: BillingAddress) => string; - getCountry: (address: BillingAddress) => string; - getPhone: (address: BillingAddress) => string; - getEmail: (address: BillingAddress) => string; - getProvince: (address: BillingAddress) => string; - getCompanyName: (address: BillingAddress) => string; - getTaxNumber: (address: BillingAddress) => string; - getApartmentNumber: (address: BillingAddress) => string | number; - isDefault: (address: BillingAddress) => boolean; -} - -type Customer = { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} - -type User = Customer; - -type Address = { - __typename?: "Address"; - id?: Maybe; - title?: Maybe; - salutation?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - streetName?: Maybe; - streetNumber?: Maybe; - additionalStreetInfo?: Maybe; - postalCode?: Maybe; - city?: Maybe; - region?: Maybe; - state?: Maybe; - country: Scalars["Country"]; - company?: Maybe; - department?: Maybe; - building?: Maybe; - apartment?: Maybe; - pOBox?: Maybe; - contactInfo: AddressContactInfo; - additionalAddressInfo?: Maybe; - externalId?: Maybe; - key?: Maybe; -} - -type BillingAddress = Address & { - isDefault?: boolean; -} -``` + type Customer = { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + + type User = Customer; + + type Address = { + __typename?: "Address"; + id?: Maybe; + title?: Maybe; + salutation?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + streetName?: Maybe; + streetNumber?: Maybe; + additionalStreetInfo?: Maybe; + postalCode?: Maybe; + city?: Maybe; + region?: Maybe; + state?: Maybe; + country: Scalars["Country"]; + company?: Maybe; + department?: Maybe; + building?: Maybe; + apartment?: Maybe; + pOBox?: Maybe; + contactInfo: AddressContactInfo; + additionalAddressInfo?: Maybe; + externalId?: Maybe; + key?: Maybe; + } + + type BillingAddress = Address & { + isDefault?: boolean; + } + ``` ## Example @@ -304,7 +304,6 @@ export default { updateAddress } = useUserBilling(); - // If you're using Nuxt or any other framework for Universal Vue apps onSSR(async () => { await load(); }); diff --git a/packages/core/docs/commercetools/composables/use-user-order.md b/packages/core/docs/commercetools/composables/use-user-order.md index 83d9680deb..44aa1fe31c 100644 --- a/packages/core/docs/commercetools/composables/use-user-order.md +++ b/packages/core/docs/commercetools/composables/use-user-order.md @@ -8,89 +8,81 @@ - `searchOrders` - a main querying function that is used to query user's order history from eCommerce platform and populate the `orders` object with the result. This method accepts a single params object. The `params` has the following options: - - `searchParams: OrderSearchParams` + - `id?: string` + + - `page?: number` + + - `perPage?: number` - `customQuery?: customQuery` - -```ts -type OrderSearchParams = { - id?: string; - page?: number; - perPage?: number; -} - -type CustomQuery = { - getMyOrders: string -} -``` - `orders: OrderQueryResult` - a main data object that contains an array of orders fetched by `searchOrders` method and total number of orders. -```ts -type Order = { - __typename?: "Order"; - customerId?: Maybe; - customer?: Maybe; - customerEmail?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - customLineItems: Array; - totalPrice: Money; - taxedPrice?: Maybe; - shippingAddress?: Maybe
; - billingAddress?: Maybe
; - inventoryMode: InventoryMode; - taxMode: TaxMode; - taxRoundingMode: RoundingMode; - taxCalculationMode: TaxCalculationMode; - customerGroup?: Maybe; - customerGroupRef?: Maybe; - country?: Maybe; - shippingInfo?: Maybe; - discountCodes: Array; - refusedGifts: Array; - refusedGiftsRefs: Array; - paymentInfo?: Maybe; - locale?: Maybe; - shippingRateInput?: Maybe; - origin: CartOrigin; - storeRef?: Maybe; - store?: Maybe; - itemShippingAddresses: Array
; - completedAt?: Maybe; - orderNumber?: Maybe; - orderState: OrderState; - stateRef?: Maybe; - state?: Maybe; - shipmentState?: Maybe; - paymentState?: Maybe; - syncInfo: Array; - returnInfo: Array; - lastMessageSequenceNumber: Scalars["Long"]; - cartRef?: Maybe; - cart?: Maybe; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} -``` + ```ts + type Order = { + __typename?: "Order"; + customerId?: Maybe; + customer?: Maybe; + customerEmail?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + customLineItems: Array; + totalPrice: Money; + taxedPrice?: Maybe; + shippingAddress?: Maybe
; + billingAddress?: Maybe
; + inventoryMode: InventoryMode; + taxMode: TaxMode; + taxRoundingMode: RoundingMode; + taxCalculationMode: TaxCalculationMode; + customerGroup?: Maybe; + customerGroupRef?: Maybe; + country?: Maybe; + shippingInfo?: Maybe; + discountCodes: Array; + refusedGifts: Array; + refusedGiftsRefs: Array; + paymentInfo?: Maybe; + locale?: Maybe; + shippingRateInput?: Maybe; + origin: CartOrigin; + storeRef?: Maybe; + store?: Maybe; + itemShippingAddresses: Array
; + completedAt?: Maybe; + orderNumber?: Maybe; + orderState: OrderState; + stateRef?: Maybe; + state?: Maybe; + shipmentState?: Maybe; + paymentState?: Maybe; + syncInfo: Array; + returnInfo: Array; + lastMessageSequenceNumber: Scalars["Long"]; + cartRef?: Maybe; + cart?: Maybe; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + ``` - `loading: boolean` - a reactive object containing information about loading state of your `searchOrders` method. - `error: UseUserOrderErrors` - reactive object containing the error message, if some properties failed for any reason. -```ts -interface UseUserOrderErrors { - search: Error; -} -``` + ```ts + interface UseUserOrderErrors { + search: Error; + } + ``` ## Getters @@ -116,116 +108,116 @@ interface UseUserOrderErrors { - `getOrdersTotal` - returns total number of orders (not affected by pgaination limit). -```ts -interface UserOrderGetters { - getDate: (order: Order) => string; - getId: (order: Order) => string; - getStatus: (order: Order) => AgnosticOrderStatus; - getPrice: (order: Order) => number; - getItems: (order: Order) => LineItem[]; - getItemSku: (item: LineItem) => string; - getItemName: (item: LineItem) => string; - getItemQty: (item: LineItem) => number; - getItemPrice: (item: LineItem) => number; - getFormattedPrice: (price: number) => string; - getOrdersTotal: (orders: OrderQueryResult) => number; -} - -type Order = { - __typename?: "Order"; - customerId?: Maybe; - customer?: Maybe; - customerEmail?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - customLineItems: Array; - totalPrice: Money; - taxedPrice?: Maybe; - shippingAddress?: Maybe
; - billingAddress?: Maybe
; - inventoryMode: InventoryMode; - taxMode: TaxMode; - taxRoundingMode: RoundingMode; - taxCalculationMode: TaxCalculationMode; - customerGroup?: Maybe; - customerGroupRef?: Maybe; - country?: Maybe; - shippingInfo?: Maybe; - discountCodes: Array; - refusedGifts: Array; - refusedGiftsRefs: Array; - paymentInfo?: Maybe; - locale?: Maybe; - shippingRateInput?: Maybe; - origin: CartOrigin; - storeRef?: Maybe; - store?: Maybe; - itemShippingAddresses: Array
; - completedAt?: Maybe; - orderNumber?: Maybe; - orderState: OrderState; - stateRef?: Maybe; - state?: Maybe; - shipmentState?: Maybe; - paymentState?: Maybe; - syncInfo: Array; - returnInfo: Array; - lastMessageSequenceNumber: Scalars["Long"]; - cartRef?: Maybe; - cart?: Maybe; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} - -enum AgnosticOrderStatus { - Open = 'Open', - Pending = 'Pending', - Confirmed = 'Confirmed', - Shipped = 'Shipped', - Complete = 'Complete', - Cancelled = 'Cancelled', - Refunded = 'Refunded' -} - -type LineItem = { - __typename?: "LineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - name?: Maybe; - nameAllLocales: Array; - productSlug?: Maybe; - productType?: Maybe; - productTypeRef?: Maybe; - variant?: Maybe; - price: ProductPrice; - taxedPrice?: Maybe; - totalPrice?: Maybe; - quantity: Scalars["Long"]; - state: Array; - taxRate?: Maybe; - supplyChannel?: Maybe; - supplyChannelRef?: Maybe; - distributionChannel?: Maybe; - distributionChannelRef?: Maybe; - discountedPricePerQuantity: Array; - lineItemMode: LineItemMode; - priceMode: LineItemPriceMode; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - shippingDetails?: Maybe; - inventoryMode?: Maybe; - customFieldList?: Maybe>; -} -``` + ```ts + interface UserOrderGetters { + getDate: (order: Order) => string; + getId: (order: Order) => string; + getStatus: (order: Order) => AgnosticOrderStatus; + getPrice: (order: Order) => number; + getItems: (order: Order) => LineItem[]; + getItemSku: (item: LineItem) => string; + getItemName: (item: LineItem) => string; + getItemQty: (item: LineItem) => number; + getItemPrice: (item: LineItem) => number; + getFormattedPrice: (price: number) => string; + getOrdersTotal: (orders: OrderQueryResult) => number; + } + + type Order = { + __typename?: "Order"; + customerId?: Maybe; + customer?: Maybe; + customerEmail?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + customLineItems: Array; + totalPrice: Money; + taxedPrice?: Maybe; + shippingAddress?: Maybe
; + billingAddress?: Maybe
; + inventoryMode: InventoryMode; + taxMode: TaxMode; + taxRoundingMode: RoundingMode; + taxCalculationMode: TaxCalculationMode; + customerGroup?: Maybe; + customerGroupRef?: Maybe; + country?: Maybe; + shippingInfo?: Maybe; + discountCodes: Array; + refusedGifts: Array; + refusedGiftsRefs: Array; + paymentInfo?: Maybe; + locale?: Maybe; + shippingRateInput?: Maybe; + origin: CartOrigin; + storeRef?: Maybe; + store?: Maybe; + itemShippingAddresses: Array
; + completedAt?: Maybe; + orderNumber?: Maybe; + orderState: OrderState; + stateRef?: Maybe; + state?: Maybe; + shipmentState?: Maybe; + paymentState?: Maybe; + syncInfo: Array; + returnInfo: Array; + lastMessageSequenceNumber: Scalars["Long"]; + cartRef?: Maybe; + cart?: Maybe; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + + enum AgnosticOrderStatus { + Open = 'Open', + Pending = 'Pending', + Confirmed = 'Confirmed', + Shipped = 'Shipped', + Complete = 'Complete', + Cancelled = 'Cancelled', + Refunded = 'Refunded' + } + + type LineItem = { + __typename?: "LineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + name?: Maybe; + nameAllLocales: Array; + productSlug?: Maybe; + productType?: Maybe; + productTypeRef?: Maybe; + variant?: Maybe; + price: ProductPrice; + taxedPrice?: Maybe; + totalPrice?: Maybe; + quantity: Scalars["Long"]; + state: Array; + taxRate?: Maybe; + supplyChannel?: Maybe; + supplyChannelRef?: Maybe; + distributionChannel?: Maybe; + distributionChannelRef?: Maybe; + discountedPricePerQuantity: Array; + lineItemMode: LineItemMode; + priceMode: LineItemPriceMode; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + shippingDetails?: Maybe; + inventoryMode?: Maybe; + customFieldList?: Maybe>; + } + ``` ## Example diff --git a/packages/core/docs/commercetools/composables/use-user-shipping.md b/packages/core/docs/commercetools/composables/use-user-shipping.md index 5b4505c830..11bd913f92 100644 --- a/packages/core/docs/commercetools/composables/use-user-shipping.md +++ b/packages/core/docs/commercetools/composables/use-user-shipping.md @@ -20,25 +20,25 @@ - `customQuery?: customQuery` -```typescript -interface ShippingAddressAddParams { - address: { - firstName: string; - lastName: string; - streetName: string; - postalCode: string; - city: string; - state: string; - country: string; - apartment: string; - phone: string; - isDefault?: boolean; - } -} -type customQuery = { - addShippingAddress: string -} -``` + ```typescript + interface ShippingAddressAddParams { + address: { + firstName: string; + lastName: string; + streetName: string; + postalCode: string; + city: string; + state: string; + country: string; + apartment: string; + phone: string; + isDefault?: boolean; + } + } + type customQuery = { + addShippingAddress: string + } + ``` - `deleteAddress` - function for deleting existing shipping address. This method accepts a single `params` object. The `params` has the following options: @@ -46,16 +46,16 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface ShippingAddressDeleteParams { - address: { - id: string; - } -} -type customQuery = { - deleteShippingAddress: string -} -``` + ```typescript + interface ShippingAddressDeleteParams { + address: { + id: string; + } + } + type customQuery = { + deleteShippingAddress: string + } + ``` - `updateAddress` - function for updating existing shipping address. This method accepts a single `params` object. The `params` has the following options: @@ -63,26 +63,26 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface ShippingAddressUpdateParams { - address: { - id: string; - firstName: string; - lastName: string; - streetName: string; - postalCode: string; - city: string; - state: string; - country: string; - apartment: string; - phone: string; - isDefault?: boolean; - } -} -type customQuery = { - updateShippingAddress: string -} -``` + ```typescript + interface ShippingAddressUpdateParams { + address: { + id: string; + firstName: string; + lastName: string; + streetName: string; + postalCode: string; + city: string; + state: string; + country: string; + apartment: string; + phone: string; + isDefault?: boolean; + } + } + type customQuery = { + updateShippingAddress: string + } + ``` - `setDefaultAddress` - function for settings an existing shipping address as default. This method accepts a single `params` object. The `params` has the following options: @@ -90,78 +90,78 @@ type customQuery = { - `customQuery?: customQuery` -```typescript -interface ShippingAddressSetDefaultParams { - address: { - id: string; - } -} -type customQuery = { - setDefaultShippingAddress: string -} -``` + ```typescript + interface ShippingAddressSetDefaultParams { + address: { + id: string; + } + } + type customQuery = { + setDefaultShippingAddress: string + } + ``` - `shipping: User` - reactive data object containing response from the backend. -```ts -type Customer = { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} - -type User = Customer; -``` + ```ts + type Customer = { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + + type User = Customer; + ``` - `loading: boolean` - reactive object containing information about loading state of `load`, `addAddress`, `deleteAddress`, `updateAddress` and `setDefaultAddress` methods. - `error: UseUserShippingErrors` - reactive object containing the error message, if some properties failed for any reason. -```ts -interface UseUserShippingErrors { - addAddress: Error; - deleteAddress: Error; - updateAddress: Error; - load: Error; - setDefaultAddress: Error; -} -``` + ```ts + interface UseUserShippingErrors { + addAddress: Error; + deleteAddress: Error; + updateAddress: Error; + load: Error; + setDefaultAddress: Error; + } + ``` ## Getters @@ -201,102 +201,102 @@ interface UseUserShippingErrors { - `isDefault` - return information if address is current default. -```typescript -interface UserShippingGetters { - getAddresses: (shipping: User, criteria?: Record) => ShippingAddress[]; - getDefault: (shipping: User) => ShippingAddress; - getTotal: (shipping: User) => number; - getId: (address: ShippingAddress) => string | number; - getPostCode: (address: ShippingAddress) => string; - getStreetName: (address: ShippingAddress) => string; - getStreetNumber: (address: ShippingAddress) => string | number; - getCity: (address: ShippingAddress) => string; - getFirstName: (address: ShippingAddress) => string; - getLastName: (address: ShippingAddress) => string; - getCountry: (address: ShippingAddress) => string; - getPhone: (address: ShippingAddress) => string; - getEmail: (address: ShippingAddress) => string; - getProvince: (address: ShippingAddress) => string; - getCompanyName: (address: ShippingAddress) => string; - getTaxNumber: (address: ShippingAddress) => string; - getApartmentNumber: (address: ShippingAddress) => string | number; - isDefault: (address: ShippingAddress) => boolean; -} - -type Customer = { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} - -type User = Customer; - -type Address = { - __typename?: "Address"; - id?: Maybe; - title?: Maybe; - salutation?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - streetName?: Maybe; - streetNumber?: Maybe; - additionalStreetInfo?: Maybe; - postalCode?: Maybe; - city?: Maybe; - region?: Maybe; - state?: Maybe; - country: Scalars["Country"]; - company?: Maybe; - department?: Maybe; - building?: Maybe; - apartment?: Maybe; - pOBox?: Maybe; - contactInfo: AddressContactInfo; - additionalAddressInfo?: Maybe; - externalId?: Maybe; - key?: Maybe; -} - -type ShippingAddress = Address & { - isDefault?: boolean; -} -``` + ```typescript + interface UserShippingGetters { + getAddresses: (shipping: User, criteria?: Record) => ShippingAddress[]; + getDefault: (shipping: User) => ShippingAddress; + getTotal: (shipping: User) => number; + getId: (address: ShippingAddress) => string | number; + getPostCode: (address: ShippingAddress) => string; + getStreetName: (address: ShippingAddress) => string; + getStreetNumber: (address: ShippingAddress) => string | number; + getCity: (address: ShippingAddress) => string; + getFirstName: (address: ShippingAddress) => string; + getLastName: (address: ShippingAddress) => string; + getCountry: (address: ShippingAddress) => string; + getPhone: (address: ShippingAddress) => string; + getEmail: (address: ShippingAddress) => string; + getProvince: (address: ShippingAddress) => string; + getCompanyName: (address: ShippingAddress) => string; + getTaxNumber: (address: ShippingAddress) => string; + getApartmentNumber: (address: ShippingAddress) => string | number; + isDefault: (address: ShippingAddress) => boolean; + } + + type Customer = { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + + type User = Customer; + + type Address = { + __typename?: "Address"; + id?: Maybe; + title?: Maybe; + salutation?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + streetName?: Maybe; + streetNumber?: Maybe; + additionalStreetInfo?: Maybe; + postalCode?: Maybe; + city?: Maybe; + region?: Maybe; + state?: Maybe; + country: Scalars["Country"]; + company?: Maybe; + department?: Maybe; + building?: Maybe; + apartment?: Maybe; + pOBox?: Maybe; + contactInfo: AddressContactInfo; + additionalAddressInfo?: Maybe; + externalId?: Maybe; + key?: Maybe; + } + + type ShippingAddress = Address & { + isDefault?: boolean; + } + ``` ## Example @@ -314,7 +314,6 @@ export default { updateAddress } = useUserShipping(); - // If you're using Nuxt or any other framework for Universal Vue apps onSSR(async () => { await load(); }); diff --git a/packages/core/docs/commercetools/composables/use-user.md b/packages/core/docs/commercetools/composables/use-user.md index 77496c3b54..0b9a5f72ff 100644 --- a/packages/core/docs/commercetools/composables/use-user.md +++ b/packages/core/docs/commercetools/composables/use-user.md @@ -16,86 +16,86 @@ If you want to fetch/save other user data you should use the following composabl - `user` - reactive object containing information about current user. -```ts -type Customer = { - __typename?: "Customer"; - customerNumber?: Maybe; - email: Scalars["String"]; - password: Scalars["String"]; - addresses: Array
; - defaultShippingAddressId?: Maybe; - defaultBillingAddressId?: Maybe; - shippingAddressIds: Array; - billingAddressIds: Array; - isEmailVerified: Scalars["Boolean"]; - customerGroupRef?: Maybe; - externalId?: Maybe; - key?: Maybe; - firstName?: Maybe; - lastName?: Maybe; - middleName?: Maybe; - title?: Maybe; - locale?: Maybe; - salutation?: Maybe; - dateOfBirth?: Maybe; - companyName?: Maybe; - vatId?: Maybe; - customerGroup?: Maybe; - defaultShippingAddress?: Maybe
; - defaultBillingAddress?: Maybe
; - shippingAddresses: Array
; - billingAddresses: Array
; - storesRef: Array; - stores: Array; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; - customFieldList?: Maybe>; -} -``` + ```ts + type Customer = { + __typename?: "Customer"; + customerNumber?: Maybe; + email: Scalars["String"]; + password: Scalars["String"]; + addresses: Array
; + defaultShippingAddressId?: Maybe; + defaultBillingAddressId?: Maybe; + shippingAddressIds: Array; + billingAddressIds: Array; + isEmailVerified: Scalars["Boolean"]; + customerGroupRef?: Maybe; + externalId?: Maybe; + key?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + middleName?: Maybe; + title?: Maybe; + locale?: Maybe; + salutation?: Maybe; + dateOfBirth?: Maybe; + companyName?: Maybe; + vatId?: Maybe; + customerGroup?: Maybe; + defaultShippingAddress?: Maybe
; + defaultBillingAddress?: Maybe
; + shippingAddresses: Array
; + billingAddresses: Array
; + storesRef: Array; + stores: Array; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + customFieldList?: Maybe>; + } + ``` - `updateUser` - function for updating user data. When invoked, it submits data to the API and populates user property with updated information. This method accepts a single `params` object. The `params` has the following option: - `user: UPDATE_USER_PARAMS` -```ts -interface UPDATE_USER_PARAMS { - email: string; - password: string; - firstName?: string; - lastName?: string; -} -``` + ```ts + interface UPDATE_USER_PARAMS { + email: string; + password: string; + firstName?: string; + lastName?: string; + } + ``` - `register: UseUserRegisterParams` - function for creating a new user. When invoked, it submits new user data to the API and saves them. This method accepts a single `params` object. The `params` has the following option: - `user: UseUserRegisterParams` -```ts -interface UseUserRegisterParams { - email: string; - password: string; - firstName?: string; - lastName?: string; -} -``` + ```ts + interface UseUserRegisterParams { + email: string; + password: string; + firstName?: string; + lastName?: string; + } + ``` - `login: UseUserLoginParams` - function for log in a user based on a username and password. This method accepts a single `params` object. The `params` has the following option: - `user: UseUserLoginParams` -```ts -interface UseUserLoginParams { - username: string; - password: string; -} -``` + ```ts + interface UseUserLoginParams { + username: string; + password: string; + } + ``` - `logout` - function for logout a user. @@ -111,16 +111,16 @@ interface UseUserLoginParams { - `error: UseUserErrors` - reactive object containing the error message, if some properties failed for any reason. -```ts -interface UseUserErrors { - updateUser: Error; - register: Error; - login: Error; - logout: Error; - changePassword: Error; - load: Error; -} -``` + ```ts + interface UseUserErrors { + updateUser: Error; + register: Error; + login: Error; + logout: Error; + changePassword: Error; + load: Error; + } + ``` ## Getters @@ -132,14 +132,14 @@ interface UseUserErrors { - `getEmailAddress` - returns user email address. -```ts -interface UserGetters { - getFirstName: (user: Customer) => string; - getLastName: (user: Customer) => string; - getFullName: (user: Customer) => string; - getEmailAddress: (user: Customer) => string; -} -``` + ```ts + interface UserGetters { + getFirstName: (user: Customer) => string; + getLastName: (user: Customer) => string; + getFullName: (user: Customer) => string; + getEmailAddress: (user: Customer) => string; + } + ``` ## Example diff --git a/packages/core/docs/commercetools/composables/use-wishlist.md b/packages/core/docs/commercetools/composables/use-wishlist.md index dbf2a4b790..c190baabe6 100644 --- a/packages/core/docs/commercetools/composables/use-wishlist.md +++ b/packages/core/docs/commercetools/composables/use-wishlist.md @@ -15,43 +15,43 @@ - `wishlist: Wishlist` - a main data object. -```ts -type ShoppingList = { - __typename?: "ShoppingList"; - key?: Maybe; - name?: Maybe; - nameAllLocales: Array; - description?: Maybe; - descriptionAllLocales?: Maybe>; - slug?: Maybe; - slugAllLocales?: Maybe>; - customerRef?: Maybe; - customer?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - textLineItems: Array; - custom?: Maybe; - deleteDaysAfterLastModification?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; -} - -type Wishlist = ShoppingList; -``` + ```ts + type ShoppingList = { + __typename?: "ShoppingList"; + key?: Maybe; + name?: Maybe; + nameAllLocales: Array; + description?: Maybe; + descriptionAllLocales?: Maybe>; + slug?: Maybe; + slugAllLocales?: Maybe>; + customerRef?: Maybe; + customer?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + textLineItems: Array; + custom?: Maybe; + deleteDaysAfterLastModification?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + } + + type Wishlist = ShoppingList; + ``` - `load` - function used to retrieve wishlist products. When invoked, it requests data from the API and populates `wishlist` property. This method accepts a single `params` object. The `params` has the following option: - `customQuery?: CustomQuery` -```ts -type CustomQuery = { - createMyShoppingList: string -} -``` + ```ts + type CustomQuery = { + createMyShoppingList: string + } + ``` - `addItem` - function used to add new product to wishlist. When invoked, it submits data to the API and populates `wishlist` property with updated information. This method accepts a single `params` object. The `params` has the following options: @@ -59,26 +59,26 @@ type CustomQuery = { - `customQuery?: customQuery` -```ts -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} - -type CustomQuery = { - updateShoppingList: string -} -``` + ```ts + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + + type CustomQuery = { + updateShoppingList: string + } + ``` - `removeItem` - function that removes products from the wishlist. It submits data to the API and populates updated `wishlist` property. This method accepts a single `params` object. The `params` has the following options: @@ -86,42 +86,42 @@ type CustomQuery = { - `customQuery?: customQuery` -```ts -type LineItem = { - __typename?: "LineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - name?: Maybe; - nameAllLocales: Array; - productSlug?: Maybe; - productType?: Maybe; - productTypeRef?: Maybe; - variant?: Maybe; - price: ProductPrice; - taxedPrice?: Maybe; - totalPrice?: Maybe; - quantity: Scalars["Long"]; - state: Array; - taxRate?: Maybe; - supplyChannel?: Maybe; - supplyChannelRef?: Maybe; - distributionChannel?: Maybe; - distributionChannelRef?: Maybe; - discountedPricePerQuantity: Array; - lineItemMode: LineItemMode; - priceMode: LineItemPriceMode; - customFieldsRaw?: Maybe>; - customFields?: Maybe; - custom?: Maybe; - shippingDetails?: Maybe; - inventoryMode?: Maybe; - customFieldList?: Maybe>; -} - -type CustomQuery = { - updateShoppingList: string -} -``` + ```ts + type LineItem = { + __typename?: "LineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + name?: Maybe; + nameAllLocales: Array; + productSlug?: Maybe; + productType?: Maybe; + productTypeRef?: Maybe; + variant?: Maybe; + price: ProductPrice; + taxedPrice?: Maybe; + totalPrice?: Maybe; + quantity: Scalars["Long"]; + state: Array; + taxRate?: Maybe; + supplyChannel?: Maybe; + supplyChannelRef?: Maybe; + distributionChannel?: Maybe; + distributionChannelRef?: Maybe; + discountedPricePerQuantity: Array; + lineItemMode: LineItemMode; + priceMode: LineItemPriceMode; + customFieldsRaw?: Maybe>; + customFields?: Maybe; + custom?: Maybe; + shippingDetails?: Maybe; + inventoryMode?: Maybe; + customFieldList?: Maybe>; + } + + type CustomQuery = { + updateShoppingList: string + } + ``` - `clear` - function that removes all products from the wishlist and populates clear `wishlist` property. @@ -129,35 +129,35 @@ type CustomQuery = { - `product: ProductVariant` -```ts -type ProductVariant = { - __typename?: "ProductVariant"; - id: Scalars["Int"]; - key?: Maybe; - sku?: Maybe; - prices?: Maybe>; - price?: Maybe; - images: Array; - assets: Array; - availability?: Maybe; - attributesRaw: Array; - attributes: ProductType; - attributeList: Array; -} -``` + ```ts + type ProductVariant = { + __typename?: "ProductVariant"; + id: Scalars["Int"]; + key?: Maybe; + sku?: Maybe; + prices?: Maybe>; + price?: Maybe; + images: Array; + assets: Array; + availability?: Maybe; + attributesRaw: Array; + attributes: ProductType; + attributeList: Array; + } + ``` - `loading: boolean` - a reactive object containing information about loading state of the cart. - `error: UseWishlistErrors` - reactive object containing the error message, if some properties failed for any reason. -```ts -interface UseWishlistErrors { - addItem: Error; - removeItem: Error; - load: Error; - clear: Error; -} -``` + ```ts + interface UseWishlistErrors { + addItem: Error; + removeItem: Error; + load: Error; + clear: Error; + } + ``` ## Getters @@ -181,73 +181,73 @@ interface UseWishlistErrors { - `getFormattedPrice` - returns price in formatted manner taking into account local specifics. -```typescript -interface WishlistGetters { - getTotals: (wishlist: Wishlist) => AgnosticTotals; - getItems: (wishlist: Wishlist) => ShoppingListLineItem[]; - getItemName: (product: ShoppingListLineItem) => string; - getItemImage: (product: ShoppingListLineItem) => string; - getItemPrice: (product: ShoppingListLineItem) => AgnosticPrice; - getItemQty: (product: ShoppingListLineItem) => number; - getItemAttributes: (product: ShoppingListLineItem, filterByAttributeName?: string[]) => ({}); - getItemSku: (product: ShoppingListLineItem) => string; - getTotalItems: (wishlist: Wishlist) => number; - getFormattedPrice: (price: number) => string; -}; + ```typescript + interface WishlistGetters { + getTotals: (wishlist: Wishlist) => AgnosticTotals; + getItems: (wishlist: Wishlist) => ShoppingListLineItem[]; + getItemName: (product: ShoppingListLineItem) => string; + getItemImage: (product: ShoppingListLineItem) => string; + getItemPrice: (product: ShoppingListLineItem) => AgnosticPrice; + getItemQty: (product: ShoppingListLineItem) => number; + getItemAttributes: (product: ShoppingListLineItem, filterByAttributeName?: string[]) => ({}); + getItemSku: (product: ShoppingListLineItem) => string; + getTotalItems: (wishlist: Wishlist) => number; + getFormattedPrice: (price: number) => string; + }; + + interface AgnosticTotals { + total: number; + subtotal: number; + special?: number; + [x: string]: unknown; + } -interface AgnosticTotals { - total: number; - subtotal: number; - special?: number; - [x: string]: unknown; -} - -interface AgnosticPrice { - regular: number | null; - special?: number | null; -} - -type Wishlist = { - __typename?: "ShoppingList"; - key?: Maybe; - name?: Maybe; - nameAllLocales: Array; - description?: Maybe; - descriptionAllLocales?: Maybe>; - slug?: Maybe; - slugAllLocales?: Maybe>; - customerRef?: Maybe; - customer?: Maybe; - anonymousId?: Maybe; - lineItems: Array; - textLineItems: Array; - custom?: Maybe; - deleteDaysAfterLastModification?: Maybe; - id: Scalars["String"]; - version: Scalars["Long"]; - createdAt: Scalars["DateTime"]; - lastModifiedAt: Scalars["DateTime"]; - createdBy?: Maybe; - lastModifiedBy?: Maybe; -} - -type ShoppingListLineItem = { - __typename?: "ShoppingListLineItem"; - id: Scalars["String"]; - productId: Scalars["String"]; - variantId?: Maybe; - productTypeRef: Reference; - productType: ProductTypeDefinition; - quantity: Scalars["Int"]; - addedAt: Scalars["DateTime"]; - name?: Maybe; - nameAllLocales: Array; - deactivatedAt?: Maybe; - custom?: Maybe; - productSlug?: Maybe; - variant?: Maybe; -} -``` + interface AgnosticPrice { + regular: number | null; + special?: number | null; + } + + type Wishlist = { + __typename?: "ShoppingList"; + key?: Maybe; + name?: Maybe; + nameAllLocales: Array; + description?: Maybe; + descriptionAllLocales?: Maybe>; + slug?: Maybe; + slugAllLocales?: Maybe>; + customerRef?: Maybe; + customer?: Maybe; + anonymousId?: Maybe; + lineItems: Array; + textLineItems: Array; + custom?: Maybe; + deleteDaysAfterLastModification?: Maybe; + id: Scalars["String"]; + version: Scalars["Long"]; + createdAt: Scalars["DateTime"]; + lastModifiedAt: Scalars["DateTime"]; + createdBy?: Maybe; + lastModifiedBy?: Maybe; + } + + type ShoppingListLineItem = { + __typename?: "ShoppingListLineItem"; + id: Scalars["String"]; + productId: Scalars["String"]; + variantId?: Maybe; + productTypeRef: Reference; + productType: ProductTypeDefinition; + quantity: Scalars["Int"]; + addedAt: Scalars["DateTime"]; + name?: Maybe; + nameAllLocales: Array; + deactivatedAt?: Maybe; + custom?: Maybe; + productSlug?: Maybe; + variant?: Maybe; + } + ``` ## Example @@ -261,7 +261,6 @@ export default { const wishlistItems = computed(() => wishlistGetters.getItems()); - // If you're using Nuxt or any other framework for Universal Vue apps onSSR(async () => { await loadWishlist(); }); diff --git a/packages/core/docs/commercetools/enterprise/use-wishlist.md b/packages/core/docs/commercetools/enterprise/use-wishlist.md index 43df020340..02f9b3bd14 100644 --- a/packages/core/docs/commercetools/enterprise/use-wishlist.md +++ b/packages/core/docs/commercetools/enterprise/use-wishlist.md @@ -102,7 +102,6 @@ export default { const wishlistItems = computed(() => wishlistGetters.getItems()); - // If you're using Nuxt or any other framework for Universal Vue apps onSSR(async () => { await loadWishlist(); }); diff --git a/packages/core/docs/commercetools/use-facet.md b/packages/core/docs/commercetools/use-facet.md index c69e5d4800..856c0282df 100644 --- a/packages/core/docs/commercetools/use-facet.md +++ b/packages/core/docs/commercetools/use-facet.md @@ -3,7 +3,7 @@ :::warning This feature is a part of our commercial offering but also exists in the Open Source version of our commercetools integration. -Open Source implementation relies on GraphQL API (internally using `getProduct` and `getCategory` composables), which doesn't provide full faceting capabilities as does the dedicated REST-based faceting API offered in our Enterprise version. Please [contact our team](https://www.vuestorefront.io/contact/sales) if you'd like to get access to it. +Open Source implementation relies on GraphQL API (internally using `getProduct` and `getCategory` composables), which doesn't provide full faceting capabilities as does the dedicated REST-based faceting API offered in our Enterprise version. Please [contact our Sales team](https://www.vuestorefront.io/contact/sales) if you'd like to get access to it. ::: ## Features diff --git a/packages/core/docs/general/enterprise.md b/packages/core/docs/general/enterprise.md index 7c27912b45..0900c37755 100644 --- a/packages/core/docs/general/enterprise.md +++ b/packages/core/docs/general/enterprise.md @@ -4,18 +4,22 @@ Vue Storefront Enterprise is a commercial offering from the Vue Storefront core team built on top of the Open Source product. Its goal is to give you all the tools you need to launch your shop and provide you with ready-to-use integrations that will reduce the development time and cost of your project. -## What are the differences between Open Source and Enterprise versions? +## Differences between Open Source and Enterprise versions In Enterprise Edition you're getting everything that's in our Open Source. On top of that we also provide: - access to [Vue Storefront Cloud](https://www.vuestorefront.io/cloud); -- additional integrations with third-party services; +- additional [integrations](./integrations/) with third-party services; - extended integration with eCommerce platform with advanced features. Everything with badge in the documentation is only available for our Enterprise customers. You can learn more about our commercial offering on the [Enterprise](https://www.vuestorefront.io/enterprise) page. +## How to get access to Vue Storefront Enterprise + +If you'd like to use Vue Storefront Enterprise in your project, please [contact our Sales team](https://www.vuestorefront.io/contact/sales). + ## How to use Vue Storefront Enterprise Enterprise packages within `@vsf-enterprise` scope are part of our private registry. To make use of them, create a `.npmrc` file in the root of your project with the following content: diff --git a/packages/core/docs/general/installation.md b/packages/core/docs/general/installation.md index 8bf3019aba..98ad830707 100644 --- a/packages/core/docs/general/installation.md +++ b/packages/core/docs/general/installation.md @@ -2,7 +2,7 @@ ## Prerequisites -Before proceeding, make sure you have [Node 10+](https://nodejs.org/en/), [Yarn 1](https://classic.yarnpkg.com/lang/en/) and [Git](https://git-scm.com/) installed. +Before proceeding, make sure you have [Node 10+](https://nodejs.org/en/) and [Yarn 1](https://classic.yarnpkg.com/lang/en/) installed. ## Using Vue Storefront CLI @@ -14,10 +14,6 @@ npx @vue-storefront/cli init ``` Enter the name of the project and select the backend platform you wish to use. -
- Vue Storefront CLI -
- Once selected, the CLI creates the project files in the directory matching your project name. The only thing left is to go to this directory in the terminal and install the dependencies: ```bash diff --git a/packages/core/docs/images/cli.jpg b/packages/core/docs/images/cli.jpg deleted file mode 100644 index fb7918f140b6648f196172ebd80ce00452443f54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25501 zcmeFY1yo$kwl3NPcL{DGNFcbogb<`5xLa^(plPgef+P^!B{&3kr*T4X5AJS38kdA1 zxBsnooV(9CcfWVX8{>`puO73zs#bMX&2PHVadECIJuyu2D66NA@bmcU&gqT}# zT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6*@F7${@9b%PVQvux zthC!Wp@U_`xIB}EcW|yjHm=yW+`?TvmM@i#uDIxn`(Y~@Mh@5%wkEa&68D=!iyw(r zMx&KFwUSu#-p}>@FPYP^%%qGd>V~NbPUj1KAy2^5u$Dpv#DKgvSmoKfw+AmaMH?EF zE(m?bzha!7U5rBl<7O|_3i={4q_d=W;Bh1pMAVcn{TdgtWDi^8yvtj!*WGm>`z^B2 zt#L=)!0u1>tNl67+fIVIQ4jrgVdpcZbQS!#G6Kl*5DZUG=-`e{?7C&FB1j%RA^jj-Jzq(ptMQ)g?&i48*! zhSnBy%NDOs_6VND0ydZ=oiKwgoky^FV}8Q@Hm`$mAS9AV2}cK@qn7M+ChEYSAI8IV zOBxqwYUQAX7=v+ox!^asukXQRw6|UomTJg8Pp)(=7yQKq+gshkY#C-A?VXugw=)GmY2|l9KFv_Mku@-c^aQG zC7DUFj&{WqLyGIfIX%0tdC#^1il)@Tx|%EgF~Tv&YMI{k0KSlE;^{|{ToA!qYq}@! zW;1Np7ki9Fkdgj?apavn9c1!Ay{6_tOzcgg;Mb-oZjvqi>o|CbxXJj$2a(7wTn~*^ zKkiOA!VJ5y6WF8oOcwNo=4I+@Ks!gw1b)d~PQ#cohU*KoXqHc{qdIQZqS-k*f>k}X rUWh|x+Q*(I5EHvU0XYu5G%0pMo4uGo?WGR?ds^n7KjHszejoW83hio} diff --git a/packages/core/docs/integrate/cache-driver.md b/packages/core/docs/integrate/cache-driver.md index a1bac62625..6e40cfa514 100644 --- a/packages/core/docs/integrate/cache-driver.md +++ b/packages/core/docs/integrate/cache-driver.md @@ -1,7 +1,7 @@ # Integrating cache driver ::: warning Want to build an integration? -If you want to integrate with Vue Storefront, please **contact the core team on our [slack](https://slack.vuestorefront.io)** first. We are eager to help you with building it and ensuring its high quality! Building the integration together with the core team is the best way to keep its quality high and make it officially recommended once it's done. +If you want to integrate with Vue Storefront, don't hesitate to get in touch with the core team on our [Discord](https://discord.vuestorefront.io/) server. We are eager to help you to ensure its high quality and maybe even officially recommend it 😉 ::: ## Introduction diff --git a/packages/core/docs/integrate/cms.md b/packages/core/docs/integrate/cms.md index 1942aadc4f..d40e7c381b 100644 --- a/packages/core/docs/integrate/cms.md +++ b/packages/core/docs/integrate/cms.md @@ -1,7 +1,7 @@ # Integrating CMS ::: warning Want to build an integration? -If you want to integrate with Vue Storefront, please **contact the core team on our [slack](https://slack.vuestorefront.io)** first. We are eager to help you with building it and ensuring its high quality! Building the integration together with the core team is the best way to keep its quality high and make it officially recommended once it's done. +If you want to integrate with Vue Storefront, don't hesitate to get in touch with the core team on our [Discord](https://discord.vuestorefront.io/) server. We are eager to help you to ensure its high quality and maybe even officially recommend it 😉 ::: ## What is needed diff --git a/packages/core/docs/integrate/integration-guide.md b/packages/core/docs/integrate/integration-guide.md index 2ad4a556c7..39ca5ebb64 100644 --- a/packages/core/docs/integrate/integration-guide.md +++ b/packages/core/docs/integrate/integration-guide.md @@ -5,7 +5,7 @@ The application does not reload automatically after saving the changes in Server ::: ::: warning Want to build an integration? -If you want to integrate with Vue Storefront, please **contact the core team on our [Discord](https://discord.vuestorefront.io) server**. We are eager to help you to ensure its high quality and maybe even officially recommend it 😉 +If you want to integrate with Vue Storefront, don't hesitate to get in touch with the core team on our [Discord](https://discord.vuestorefront.io/) server. We are eager to help you to ensure its high quality and maybe even officially recommend it 😉 ::: ## Introduction @@ -86,25 +86,7 @@ Once the new repository is ready, clone it locally. **Before you start making changes and installing dependencies**, let's update the name of the packages and integrations. Doing it now prevents issues with linking dependencies later. -Search for all instances of these strings (in this order) and change them to match your integration: - -- `@vue-storefront/boilerplate-theme`, -- `@vue-storefront/boilerplate-api`, -- `@vue-storefront/boilerplate`. - -For the sake of example and simplicity, let's assume our eCommerce platform is called **Sloth**. From now on, we will refer to these packages as: - -- `@sloth/theme`, -- `@sloth/api`, -- `@sloth/sloth`. - -:::tip -It's a convention to name a `composables` package using the platform's name because this is the package that developers use the most when creating a shop. Example of this is `@vue-storefront/commercetools`, `@vue-storefront/magento` and `@vue-storefront/shopify`. -::: - -Open `packages/composables/nuxt/plugin.js` and change `boilerplate` to the name of your integration. This name should not contain any special characters nor spaces. In our case, it's lowercase `sloth`. - -Open `packages/theme/middleware.config.js` and change `boilerplate` to the same name. +Open the "Search and Replace" tool inside your code editor and replace all instances of `<% INTEGRATION %>` with the name of your project or platform. The name must be in lowercase, without spaces or any special characters. ### Install dependencies diff --git a/packages/core/docs/integrations/README.md b/packages/core/docs/integrations/README.md index e65e91c254..9f1f6c4ecb 100644 --- a/packages/core/docs/integrations/README.md +++ b/packages/core/docs/integrations/README.md @@ -1,10 +1,14 @@ # Integrations -Click on the integration tile to read its documentation. +This page lists Vue Storefront 2 integrations created by the Vue Storefront team or our partners. If integration you are interested in isn't listed below, [contact our Sales team](https://www.vuestorefront.io/contact/sales) or core team on our [Discord](https://discord.vuestorefront.io) server. + +:::tip Vue Storefront Enterprise +Packages marked as `Enterprise` are part of the [Vue Storefront Enterprise](/general/enterprise.html) offering. +::: ## eCommerce platforms -> Packages marked as `Enterprise` are part of Vue Storefront Enterprise offering and packages without `From Core Team` badge are created and maintained by our partners. +Below you can find a list of integrations with eCommerce platforms. These integrations are the backbone of every Vue Storefront project. ->This feature is part of the Enterprise version. Please [contact our team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. +>This feature is part of the Enterprise version. Please [contact our Sales team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. ## Introduction diff --git a/packages/core/docs/integrations/bazaarvoice.md b/packages/core/docs/integrations/bazaarvoice.md index 6e92d19d62..a89d7b1ea2 100644 --- a/packages/core/docs/integrations/bazaarvoice.md +++ b/packages/core/docs/integrations/bazaarvoice.md @@ -1,7 +1,7 @@ # Bazaarvoice ::: warning Paid feature -This feature is part of the Enterprise version. Please [contact our team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. +This feature is part of the Enterprise version. Please [contact our Sales team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. ::: ## Introduction diff --git a/packages/core/docs/integrations/redis-cache.md b/packages/core/docs/integrations/redis-cache.md index d82aa33aa4..00249a5076 100644 --- a/packages/core/docs/integrations/redis-cache.md +++ b/packages/core/docs/integrations/redis-cache.md @@ -1,7 +1,7 @@ # Redis cache ::: warning Paid feature -This feature is part of the Enterprise version. Please [contact our team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. +This feature is part of the Enterprise version. Please [contact our Sales team](https://www.vuestorefront.io/contact/sales) if you'd like to use it in your project. ::: ## Introduction diff --git a/packages/core/docs/package.json b/packages/core/docs/package.json index 2893c7b9df..1aa48b9176 100644 --- a/packages/core/docs/package.json +++ b/packages/core/docs/package.json @@ -7,12 +7,17 @@ "scripts": { "dev": "yarn build:core && yarn build:ct && vuepress dev", "build": "yarn build:core && yarn build:ct && NODE_OPTIONS=--max_old_space_size=4096 vuepress build", - "build:core": "yarn core-api-ref && yarn core-api-ref-md", - "build:ct": "yarn ct-api-ref && yarn ct-api-ref-md", - "core-api-ref": "cd ../core && api-extractor run --local", - "core-api-ref-md": "api-documenter markdown --i core/api-reference --o core/api-reference", + + "core-cache-ref": "cd ../cache && api-extractor run --local", + "core-core-ref": "cd ../core && api-extractor run --local", + "core-middleware-ref": "cd ../middleware && api-extractor run --local", + "core-ref-md": "api-documenter markdown --i core/api-reference --o core/api-reference", + "build:core": "yarn core-cache-ref && yarn core-core-ref && yarn core-middleware-ref && yarn core-ref-md", + "ct-api-ref": "cd ../../commercetools/api-client && api-extractor run --local", - "ct-api-ref-md": "api-documenter markdown --i commercetools/api-reference --o commercetools/api-reference" + "ct-comp-ref": "cd ../../commercetools/composables && api-extractor run --local", + "ct-ref-md": "api-documenter markdown --i commercetools/api-reference --o commercetools/api-reference", + "build:ct": "yarn ct-api-ref && yarn ct-comp-ref && yarn ct-ref-md" }, "devDependencies": { "@vue-storefront/commercetools-api": "~1.2.0", diff --git a/packages/core/middleware/api-extractor.json b/packages/core/middleware/api-extractor.json new file mode 100644 index 0000000000..f12f30fd57 --- /dev/null +++ b/packages/core/middleware/api-extractor.json @@ -0,0 +1,10 @@ +{ + "extends": "../../api-extractor.base.json", + "mainEntryPointFilePath": "./lib/index.d.ts", + "dtsRollup": { + "untrimmedFilePath": "./lib/.d.ts" + }, + "docModel": { + "apiJsonFilePath": "/core/docs/core/api-reference/.api.json" + } +} diff --git a/packages/core/middleware/package.json b/packages/core/middleware/package.json index 07e4718168..ac8d609c1a 100644 --- a/packages/core/middleware/package.json +++ b/packages/core/middleware/package.json @@ -4,7 +4,7 @@ "description": "", "main": "lib/index.cjs.js", "module": "lib/index.es.js", - "types": "lib/src/index.d.ts", + "types": "lib/index.d.ts", "scripts": { "build": "rimraf lib && rollup -c", "prepublish": "yarn build" diff --git a/packages/core/middleware/src/index.ts b/packages/core/middleware/src/index.ts index f94bdb51cb..4588b86e3d 100644 --- a/packages/core/middleware/src/index.ts +++ b/packages/core/middleware/src/index.ts @@ -1 +1,11 @@ +/** + * Core Vue Storefront 2 library for Server Middieware. + * + * @remarks + * The `@vue-storefront/middleware` library is a Nuxt.js module, that is core piece + * required to create Server Middleware in Vue Storefront 2. + * + * @packageDocumentation + */ + export * from './createServer';