Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/composables/src/composables/useAddresses/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* eslint-disable no-param-reassign, consistent-return */
/**
* @deprecated since version 1.0.0
*/
import {
Context,
Logger,
Expand All @@ -25,14 +28,11 @@ type RemoveAddressInput = {
}
} & CustomQueryParams;

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseAddressesParams<CustomerAddress,
CustomQueryParams,
SaveAddressInput,
UpdateAddressInput,
RemoveAddressInput> = {
CustomQueryParams,
SaveAddressInput,
UpdateAddressInput,
RemoveAddressInput> = {
load: async (context: Context) => {
Logger.debug('[Magento] load user addresses');

Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/composables/useCategory/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
useCategoryFactory,
Context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @deprecated since version 1.0.0
*/
import {
Context, Logger,
} from '@vue-storefront/core';
import { Category, CategorySearchQueryVariables } from '@vue-storefront/magento-api';
import { UseCategorySearchFactory, useCategorySearchFactory } from '../../factories/useCategorySearchFactory';
import { UseCategorySearch } from '../../types/composables';

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseCategorySearchFactory<Category, CategorySearchQueryVariables> = {
search: async (context: Context, params): Promise<Category[]> => {
Logger.debug('[Magento]: Search for category using', { params });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { Context, Logger } from '@vue-storefront/core';
import { FetchPolicy } from '../../types';
import { useCustomMutationFactory } from '../../factories/useMutationQueryFactory';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @deprecated Will be removed in 1.1.0 release
* @use @vue-storefront/magento-theme/composables/useApi instead
*/
import { Context, Logger } from '@vue-storefront/core';
import {
useCustomQueryFactory,
} from '../../factories/useCustomQueryFactory';
import { FetchPolicy } from '../../types';

/**
* @deprecated Will be removed in 1.1.0 release
* @use @vue-storefront/magento-theme/composables/useApi instead
*/
export default useCustomQueryFactory({
query: async (context: Context, {
query,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* @deprecated since version 1.0.0
*/
import { Context, Logger } from '@vue-storefront/core';
import { useExternalCheckoutFactory, UseExternalCheckoutFactoryParams } from '../../factories/useExternalCheckoutFactory';
import useCart from '../useCart';
// import useConfig from '../useConfig';

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseExternalCheckoutFactoryParams = {
provide() {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* @deprecated since version 1.0.0
*/
import {
Context, Logger,
useForgotPasswordFactory,
} from '@vue-storefront/core';
import { UseForgotPasswordFactoryParams } from '../../factories/useForgotPasswordFactory';

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseForgotPasswordFactoryParams<any> = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
resetPassword: async (context: Context, params) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @deprecated since version 1.0.0
*/

import {
Context, Logger,
} from '@vue-storefront/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @deprecated since version1.0.0
* @deprecated since version 1.0.0
*/
import {
Context, Logger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
ComposableFunctionArgs,
Context,
Expand All @@ -14,9 +17,6 @@ import {
UseRelatedProductsFactoryParams,
} from '../../factories/useRelatedProductsFactory';

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseRelatedProductsFactoryParams<RelatedProductQuery['products']['items'][0]['related_products'], ProductsSearchParams> = {
productsSearch: async (
context: Context,
Expand Down
2 changes: 0 additions & 2 deletions packages/composables/src/composables/useReview/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* istanbul ignore file */

/**
* @deprecated since version 1.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
ComposableFunctionArgs,
Context,
Expand All @@ -14,9 +17,6 @@ import {
} from '../../factories/useUpsellProductsFactory';
import { UseUpsellProducts } from '../../types/composables';

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseUpsellProductsFactoryParams<UpsellProductsQuery['products']['items'][0]['upsell_products'], ProductsSearchParams> = {
productsSearch: async (
context: Context,
Expand Down
7 changes: 3 additions & 4 deletions packages/composables/src/composables/useUser/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* istanbul ignore file */
/**
* @deprecated since version 1.0.0
*/
import {
Context,
CustomQuery,
Expand All @@ -25,9 +27,6 @@ interface UseUserFactoryParams<USER, UPDATE_USER_PARAMS, REGISTER_USER_PARAMS>
}) => Promise<USER>;
}

/**
* @deprecated since version 1.0.0
*/
const factoryParams: UseUserFactoryParams<
any,
UpdateCustomerEmailMutationVariables,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* istanbul ignore file */
/**
* @deprecated since version 1.0.0
*/
import {
Context,
Logger,
Expand Down
5 changes: 3 additions & 2 deletions packages/composables/src/composables/useWishlist/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/require-await */
/* istanbul ignore file */
/**
* @deprecated since version 1.0.0
*/
import {
Context,
Logger,
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/factories/useAddressesFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
configureFactoryParams,
Context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { computed } from '@vue/composition-api';
import {
configureFactoryParams,
Expand All @@ -13,9 +16,7 @@ import { UseCategorySearch, UseCategorySearchErrors } from '../types/composables
export interface UseCategorySearchFactory<CATEGORY, CATEGORY_SEARCH_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
search: (context: Context, params: ComposableFunctionArgs<CATEGORY_SEARCH_PARAMS>) => Promise<CATEGORY[]>;
}
/**
* @deprecated since version 1.0.0
*/

export function useCategorySearchFactory<CATEGORY, CATEGORY_SEARCH_PARAMS, API extends PlatformApi = any>(
factoryParams: UseCategorySearchFactory<CATEGORY, CATEGORY_SEARCH_PARAMS, API>,
) {
Expand Down
8 changes: 4 additions & 4 deletions packages/composables/src/factories/useCustomQueryFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @deprecated Will be removed in 1.1.0 release
* @use @vue-storefront/magento-theme/composables/useApi instead
*/
import {
configureFactoryParams,
Context,
Expand All @@ -10,10 +14,6 @@ import { computed } from '@vue/composition-api';
import { FetchPolicy } from '../types';
import { UseCustomQuery } from '../types/composables';

/**
* @deprecated Will be removed in 1.1.0 release
* @use @vue-storefront/magento-theme/composables/useApi instead
*/
export interface UseCustomQueryFactoryFactoryParams<QUERY_VARIABLES, QUERY_RETURN, API extends PlatformApi = any> extends FactoryParams<API> {
query: (context: Context, {
variables,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
ComposableFunctionArgs,
configureFactoryParams,
Expand All @@ -14,9 +17,6 @@ export interface UseExternalCheckoutFactoryParams<API extends PlatformApi = any>
initializeCheckout: (context: Context, params: ComposableFunctionArgs<{ baseUrl: string }>) => Promise<string>;
}

/**
* @deprecated since version 1.0.0
*/
export const useExternalCheckoutFactory = <API extends PlatformApi = any>(
factoryParams: UseExternalCheckoutFactoryParams<API>,
) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { Ref, computed } from '@vue/composition-api';
import {
ComposableFunctionArgs,
Expand Down Expand Up @@ -27,9 +30,6 @@ export interface UseForgotPasswordFactoryParams<RESULT> extends FactoryParams {
setNewPassword: (context: Context, params: ComposableFunctionArgs<SetNewPasswordParams & { currentResult: RESULT }>) => Promise<RESULT>;
}

/**
* @deprecated since version 1.0.0
*/
export function useForgotPasswordFactory<RESULT>(
factoryParams: UseForgotPasswordFactoryParams<RESULT>,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { computed, Ref } from '@vue/composition-api';
import {
ComposableFunctionArgs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import {
configureFactoryParams,
Context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { computed, Ref } from '@vue/composition-api';
import {
configureFactoryParams,
Expand All @@ -11,9 +14,6 @@ import {
} from '@vue-storefront/core';
import { UseRelatedProducts, UseRelatedProductsErrors } from '../types/composables';

/**
* @deprecated since version 1.0.0
*/
export interface UseRelatedProductsFactoryParams<
PRODUCTS,
RELATED_PRODUCTS_SEARCH_PARAMS extends ProductsSearchParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { computed, Ref } from '@vue/composition-api';
import {
configureFactoryParams,
Expand All @@ -20,9 +23,6 @@ export interface UseUpsellProductsFactoryParams<
productsSearch: (context: Context, params: ComposableFunctionArgs<UPSELL_PRODUCTS_SEARCH_PARAMS>) => Promise<PRODUCTS>;
}

/**
* @deprecated since version 1.0.0
*/
export function useUpsellProductsFactory<PRODUCTS, UPSELL_PRODUCTS_SEARCH_PARAMS, API extends PlatformApi = any>(
factoryParams: UseProductFactoryParams<PRODUCTS, UPSELL_PRODUCTS_SEARCH_PARAMS, API>,
) {
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/factories/useWishlistFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { Ref } from '@vue/composition-api';
import {
configureFactoryParams,
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/helpers/buildCategoryTree.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { AgnosticCategoryTree } from '@vue-storefront/core';
import { htmlDecode } from './htmlDecoder';

Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/helpers/compareWishlist.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
export const compareWishlistProduct = (
productA,
productB,
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/helpers/findItemOnWishlist.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { compareWishlistProduct } from './compareWishlist';

export const findItemOnWishlist = (currentWishlist, product) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/helpers/htmlDecoder.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
export function htmlDecode(input) {
const formatName = () => {
try {
Expand Down
3 changes: 3 additions & 0 deletions packages/composables/src/helpers/userAddressManipulator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @deprecated since version 1.0.0
*/
import { CustomerAddressInput } from '@vue-storefront/magento-api';

export const transformUserCreateAddressInput = (addressInputParams): CustomerAddressInput => {
Expand Down