@vue-storefront/core
Advanced tools
Comparing version 2.2.1 to 2.3.0-rc.1
@@ -1,4 +0,3 @@ | ||
import apiClientFactory from './apiClientFactory'; | ||
import apiProxyFactory from './apiProxyFactory'; | ||
export * from './types'; | ||
export { apiProxyFactory, apiClientFactory }; | ||
import { ApiClientFactoryParams, ApiClientConfig, ApiClientFactory } from './../../types'; | ||
declare const apiClientFactory: <ALL_SETTINGS extends ApiClientConfig, ALL_FUNCTIONS>(factoryParams: ApiClientFactoryParams<ALL_SETTINGS, ALL_FUNCTIONS>) => ApiClientFactory; | ||
export { apiClientFactory }; |
@@ -0,12 +1,16 @@ | ||
export * from './apiClientFactory'; | ||
export * from './useBillingFactory'; | ||
export * from './useCartFactory'; | ||
export * from './useWishlistFactory'; | ||
export * from './useCategoryFactory'; | ||
export * from './useContentFactory'; | ||
export * from './useFacetFactory'; | ||
export * from './useMakeOrderFactory'; | ||
export * from './useProductFactory'; | ||
export * from './useReviewFactory'; | ||
export * from './useShippingFactory'; | ||
export * from './useUserBillingFactory'; | ||
export * from './useUserFactory'; | ||
export * from './useUserOrderFactory'; | ||
export * from './useUserShippingFactory'; | ||
export * from './useUserBillingFactory'; | ||
export * from './useUserOrdersFactory'; | ||
export * from './apiClientFactory'; | ||
export * from './useReviewFactory'; | ||
export * from './useFacetFactory'; | ||
export * from './useContentFactory'; | ||
export * from './useWishlistFactory'; | ||
export * from './useShippingProviderFactory'; |
@@ -40,3 +40,3 @@ import { CustomQuery, UseCart, Context, FactoryParams } from '../types'; | ||
}>; | ||
isOnCart: (context: Context, params: { | ||
isInCart: (context: Context, params: { | ||
currentCart: CART; | ||
@@ -43,0 +43,0 @@ product: PRODUCT; |
@@ -13,4 +13,4 @@ import { RenderComponent, UseContent, Context, FactoryParams } from '../types'; | ||
props: { | ||
content: PropOptions<{} | []>; | ||
content: PropOptions<any>; | ||
}; | ||
}; |
import { UseUser, Context, FactoryParams } from '../types'; | ||
export interface UseUserFactoryParams<USER, UPDATE_USER_PARAMS, REGISTER_USER_PARAMS> extends FactoryParams { | ||
load: (context: Context, params?: {}) => Promise<USER>; | ||
load: (context: Context, params?: any) => Promise<USER>; | ||
logOut: (context: Context, params?: { | ||
@@ -5,0 +5,0 @@ currentUser?: USER; |
@@ -19,3 +19,3 @@ import { UseWishlist, CustomQuery, Context, FactoryParams } from '../types'; | ||
}) => Promise<WISHLIST>; | ||
isOnWishlist: (context: Context, params: { | ||
isInWishlist: (context: Context, params: { | ||
currentWishlist: WISHLIST; | ||
@@ -22,0 +22,0 @@ product: PRODUCT; |
import { Ref } from '@vue/composition-api'; | ||
import type { Request, Response } from 'express'; | ||
export declare type ComputedProperty<T> = Readonly<Ref<Readonly<T>>>; | ||
export declare type CustomQuery = Record<string, string>; | ||
export declare type ComposableFunctionArgs<T> = T & { | ||
customQuery?: CustomQuery; | ||
}; | ||
export declare type CustomQuery<T = any> = (query: any, variables: T) => { | ||
query?: any; | ||
variables?: T; | ||
}; | ||
export interface ProductsSearchParams { | ||
@@ -70,3 +68,3 @@ perPage?: number; | ||
} | ||
export interface UseUserOrdersSearchParams { | ||
export interface UseUserOrderSearchParams { | ||
id?: any; | ||
@@ -77,10 +75,10 @@ page?: number; | ||
} | ||
export interface UseUserOrdersErrors { | ||
export interface UseUserOrderErrors { | ||
search?: Error; | ||
} | ||
export interface UseUserOrders<ORDERS, ORDER_SEARCH_PARAMS> { | ||
export interface UseUserOrder<ORDERS, ORDER_SEARCH_PARAMS> { | ||
orders: ComputedProperty<ORDERS>; | ||
search(params: ComposableFunctionArgs<ORDER_SEARCH_PARAMS>): Promise<void>; | ||
loading: ComputedProperty<boolean>; | ||
error: ComputedProperty<UseUserOrdersErrors>; | ||
error: ComputedProperty<UseUserOrderErrors>; | ||
} | ||
@@ -214,3 +212,3 @@ export interface UseUserAddress<ADDRESS> { | ||
}): Promise<void>; | ||
isOnCart: ({ product: PRODUCT }: { | ||
isInCart: ({ product: PRODUCT }: { | ||
product: any; | ||
@@ -266,3 +264,3 @@ }) => boolean; | ||
setWishlist: (wishlist: WISHLIST) => void; | ||
isOnWishlist({ product: PRODUCT }: { | ||
isInWishlist({ product: PRODUCT }: { | ||
product: any; | ||
@@ -279,2 +277,13 @@ }): boolean; | ||
} | ||
export interface UseMakeOrderErrors { | ||
make?: Error; | ||
} | ||
export interface UseMakeOrder<ORDER> { | ||
order: Ref<ORDER>; | ||
make(params: { | ||
customQuery?: CustomQuery; | ||
}): Promise<void>; | ||
error: ComputedProperty<UseMakeOrderErrors>; | ||
loading: ComputedProperty<boolean>; | ||
} | ||
export interface UseCheckout<PAYMENT_METHODS, SHIPPING_METHODS, PERSONAL_DETAILS, SHIPPING_DETAILS, BILLING_DETAILS, CHOOSEN_PAYMENT_METHOD, CHOOSEN_SHIPPING_METHOD, PLACE_ORDER> { | ||
@@ -303,5 +312,78 @@ paymentMethods: Ref<PAYMENT_METHODS>; | ||
} | ||
export interface UseShippingErrors { | ||
load?: Error; | ||
save?: Error; | ||
} | ||
export interface UseShipping<SHIPPING, SHIPPING_PARAMS> { | ||
error: ComputedProperty<UseShippingErrors>; | ||
loading: ComputedProperty<boolean>; | ||
shipping: ComputedProperty<SHIPPING>; | ||
load(): Promise<void>; | ||
load(params: { | ||
customQuery?: CustomQuery; | ||
}): Promise<void>; | ||
save: (params: { | ||
params: SHIPPING_PARAMS; | ||
shippingDetails: SHIPPING; | ||
customQuery?: CustomQuery; | ||
}) => Promise<void>; | ||
} | ||
export interface UseShippingErrors { | ||
load?: Error; | ||
save?: Error; | ||
} | ||
export interface UseShippingProvider<STATE, SHIPPING_METHOD> { | ||
error: ComputedProperty<UseShippingErrors>; | ||
loading: ComputedProperty<boolean>; | ||
state: ComputedProperty<STATE>; | ||
setState(state: STATE): void; | ||
load(): Promise<void>; | ||
load(params: { | ||
customQuery?: CustomQuery; | ||
}): Promise<void>; | ||
save(params: { | ||
shippingMethod: SHIPPING_METHOD; | ||
customQuery?: CustomQuery; | ||
}): Promise<void>; | ||
} | ||
export interface UseShippingProviderErrors { | ||
load?: Error; | ||
save?: Error; | ||
} | ||
export interface UseBillingErrors { | ||
load?: Error; | ||
save?: Error; | ||
} | ||
export interface UseBilling<BILLING, BILLING_PARAMS> { | ||
error: ComputedProperty<UseBillingErrors>; | ||
loading: ComputedProperty<boolean>; | ||
billing: ComputedProperty<BILLING>; | ||
load(): Promise<void>; | ||
load(params: { | ||
customQuery?: CustomQuery; | ||
}): Promise<void>; | ||
save: (params: { | ||
params: BILLING_PARAMS; | ||
billingDetails: BILLING; | ||
customQuery?: CustomQuery; | ||
}) => Promise<void>; | ||
} | ||
export interface UseFacetErrors { | ||
search?: Error; | ||
} | ||
export interface AgnosticFacetSearchParams { | ||
categorySlug?: string; | ||
rootCatSlug?: string; | ||
term?: string; | ||
page?: number; | ||
itemsPerPage?: number; | ||
sort?: string; | ||
filters?: Record<string, string[]>; | ||
metadata?: any; | ||
[x: string]: any; | ||
} | ||
export interface FacetSearchResult<S> { | ||
data: S; | ||
input: AgnosticFacetSearchParams; | ||
} | ||
export interface UseFacet<SEARCH_DATA> { | ||
@@ -324,4 +406,117 @@ result: ComputedProperty<FacetSearchResult<SEARCH_DATA>>; | ||
componentName: string; | ||
props?: {}; | ||
props?: any; | ||
} | ||
export interface AgnosticPrice { | ||
regular: number | null; | ||
special?: number | null; | ||
} | ||
export interface AgnosticMediaGalleryItem { | ||
small: string; | ||
normal: string; | ||
big: string; | ||
} | ||
export interface AgnosticAttribute { | ||
name?: string; | ||
value: string | Record<string, any>; | ||
label: string; | ||
} | ||
export interface AgnosticBreadcrumb { | ||
text: string; | ||
link: string; | ||
} | ||
export interface AgnosticTotals { | ||
total: number; | ||
subtotal: number; | ||
special?: number; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticCoupon { | ||
id: string; | ||
name: string; | ||
code: string; | ||
value: number; | ||
} | ||
export interface AgnosticDiscount { | ||
id: string; | ||
name: string; | ||
description: string; | ||
value: number; | ||
code?: string; | ||
} | ||
export interface AgnosticCategoryTree { | ||
label: string; | ||
slug?: string; | ||
items: AgnosticCategoryTree[]; | ||
isCurrent: boolean; | ||
count?: number; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticProductReview { | ||
id: string; | ||
author: string; | ||
date: Date; | ||
message: string | null; | ||
rating: number | null; | ||
} | ||
export interface AgnosticLocale { | ||
code: string; | ||
label: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticCountry { | ||
code: string; | ||
label: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticCurrency { | ||
code: string; | ||
label: string; | ||
prefixSign: boolean; | ||
sign: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticSortByOption { | ||
label: string; | ||
value: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticRateCount { | ||
rate: number; | ||
count: number; | ||
} | ||
export declare enum AgnosticOrderStatus { | ||
Open = "Open", | ||
Pending = "Pending", | ||
Confirmed = "Confirmed", | ||
Shipped = "Shipped", | ||
Complete = "Complete", | ||
Cancelled = "Cancelled", | ||
Refunded = "Refunded" | ||
} | ||
export interface AgnosticFacet { | ||
type: string; | ||
id: string; | ||
value: any; | ||
attrName?: string; | ||
count?: number; | ||
selected?: boolean; | ||
metadata?: any; | ||
} | ||
export interface AgnosticGroupedFacet { | ||
id: string; | ||
label: string; | ||
count?: number; | ||
options: AgnosticFacet[]; | ||
} | ||
export interface AgnosticSort { | ||
options: AgnosticFacet[]; | ||
selected: string; | ||
} | ||
export interface AgnosticPagination { | ||
currentPage: number; | ||
totalPages: number; | ||
totalItems: number; | ||
itemsPerPage: number; | ||
pageOptions: number[]; | ||
} | ||
export interface ProductGetters<PRODUCT, PRODUCT_FILTER> { | ||
@@ -427,123 +622,2 @@ getName: (product: PRODUCT) => string; | ||
} | ||
export interface AgnosticCoupon { | ||
id: string; | ||
name: string; | ||
code: string; | ||
value: number; | ||
} | ||
export interface AgnosticMediaGalleryItem { | ||
small: string; | ||
normal: string; | ||
big: string; | ||
} | ||
export interface AgnosticCategoryTree { | ||
label: string; | ||
slug?: string; | ||
items: AgnosticCategoryTree[]; | ||
isCurrent: boolean; | ||
count?: number; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticPrice { | ||
regular: number | null; | ||
special?: number | null; | ||
} | ||
export interface AgnosticTotals { | ||
total: number; | ||
subtotal: number; | ||
special?: number; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticAttribute { | ||
name?: string; | ||
value: string | Record<string, any>; | ||
label: string; | ||
} | ||
export interface AgnosticProductReview { | ||
id: string; | ||
author: string; | ||
date: Date; | ||
message: string | null; | ||
rating: number | null; | ||
} | ||
export interface AgnosticLocale { | ||
code: string; | ||
label: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticCountry { | ||
code: string; | ||
label: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticCurrency { | ||
code: string; | ||
label: string; | ||
prefixSign: boolean; | ||
sign: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticBreadcrumb { | ||
text: string; | ||
link: string; | ||
} | ||
export interface AgnosticSortByOption { | ||
label: string; | ||
value: string; | ||
[x: string]: unknown; | ||
} | ||
export interface AgnosticRateCount { | ||
rate: number; | ||
count: number; | ||
} | ||
export declare enum AgnosticOrderStatus { | ||
Open = "Open", | ||
Pending = "Pending", | ||
Confirmed = "Confirmed", | ||
Shipped = "Shipped", | ||
Complete = "Complete", | ||
Cancelled = "Cancelled", | ||
Refunded = "Refunded" | ||
} | ||
export interface AgnosticFacet { | ||
type: string; | ||
id: string; | ||
value: any; | ||
attrName?: string; | ||
count?: number; | ||
selected?: boolean; | ||
metadata?: any; | ||
} | ||
export interface AgnosticGroupedFacet { | ||
id: string; | ||
label: string; | ||
count?: number; | ||
options: AgnosticFacet[]; | ||
} | ||
export interface AgnosticSort { | ||
options: AgnosticFacet[]; | ||
selected: string; | ||
} | ||
export interface AgnosticPagination { | ||
currentPage: number; | ||
totalPages: number; | ||
totalItems: number; | ||
itemsPerPage: number; | ||
pageOptions: number[]; | ||
} | ||
export interface FacetSearchResult<S> { | ||
data: S; | ||
input: AgnosticFacetSearchParams; | ||
} | ||
export interface AgnosticFacetSearchParams { | ||
categorySlug?: string; | ||
rootCatSlug?: string; | ||
term?: string; | ||
page?: number; | ||
itemsPerPage?: number; | ||
sort?: string; | ||
filters?: Record<string, string[]>; | ||
metadata?: any; | ||
[x: string]: any; | ||
} | ||
export interface VSFLogger { | ||
@@ -555,9 +629,2 @@ debug(message?: any, ...args: any): void; | ||
} | ||
export interface AgnosticDiscount { | ||
id: string; | ||
name: string; | ||
description: string; | ||
value: number; | ||
code?: string; | ||
} | ||
export interface IntegrationContext<CLIENT = any, CONFIG = any, API = any> { | ||
@@ -575,1 +642,68 @@ client: CLIENT; | ||
} | ||
export interface HookParams<C> { | ||
configuration: C; | ||
} | ||
export interface CallHookParams<C> extends HookParams<C> { | ||
callName: string; | ||
} | ||
export declare type BeforeCallArgs = any; | ||
export declare type AfterCallArgs = any; | ||
export interface BeforeCallParams<C> extends CallHookParams<C> { | ||
args: BeforeCallArgs; | ||
} | ||
export interface AfterCallParams<C> extends CallHookParams<C> { | ||
response: AfterCallArgs; | ||
} | ||
export interface ApiClientExtensionHooks<C = any> { | ||
beforeCreate?: (params: HookParams<C>) => C; | ||
afterCreate?: (params: HookParams<C>) => C; | ||
beforeCall?: (params: BeforeCallParams<C>) => BeforeCallArgs; | ||
afterCall?: (params: AfterCallParams<C>) => AfterCallArgs; | ||
} | ||
export declare type CustomQueryFn<T = any> = (query: any, variables: T) => { | ||
query?: any; | ||
variables?: T; | ||
}; | ||
export declare type ApiClientMethod = (...args: any) => Promise<any>; | ||
export interface ApiClientExtension { | ||
name: string; | ||
extendApiMethods?: Record<string, ApiClientMethod>; | ||
hooks?: (req: Request, res: Response) => ApiClientExtensionHooks; | ||
} | ||
export interface Integration { | ||
location: string; | ||
configuration: any; | ||
extensions?: (extensions: ApiClientExtension[]) => ApiClientExtension[]; | ||
customQueries?: Record<string, CustomQueryFn>; | ||
} | ||
export declare type IntegrationsSection = Record<string, Integration>; | ||
export interface MiddlewareConfig { | ||
integrations: Record<string, Integration>; | ||
} | ||
export interface ApiClientFactoryParams<T, F = any> { | ||
api: F; | ||
isProxy?: boolean; | ||
onCreate: (config: T, headers?: Record<string, string>) => { | ||
config: T; | ||
client: any; | ||
}; | ||
extensions?: ApiClientExtension[]; | ||
} | ||
export interface ApiInstance { | ||
api: any; | ||
client: any; | ||
settings: any; | ||
} | ||
export declare type CreateApiProxyFn = (givenConfig: any, customApi?: any) => ApiInstance; | ||
export declare type CreateApiClientFn = (givenConfig: any, customApi?: any) => ApiInstance; | ||
export interface ApiClientFactory { | ||
createApiClient: CreateApiClientFn; | ||
} | ||
export interface ApiClientConfig { | ||
[x: string]: any; | ||
client?: any; | ||
extensions?: ApiClientExtension[]; | ||
} | ||
export declare type ApiClientMethods<T> = { | ||
[K in keyof T]: T[K] extends (...args: any) => any ? (...args: [...Parameters<T[K]>, CustomQuery?]) => ReturnType<T[K]> : T[K]; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { Context } from './../../types'; | ||
import { Context, FactoryParams } from './../../types'; | ||
interface ContextConfiguration { | ||
@@ -7,4 +7,4 @@ useVSFContext: () => Context; | ||
declare const configureContext: (config: ContextConfiguration) => void; | ||
declare const applyContextForApi: (api: any, context: any) => {}; | ||
declare const generateContext: (factoryParams: any) => any; | ||
export { generateContext, useVSFContext, configureContext, applyContextForApi }; | ||
declare const configureFactoryParams: <T extends FactoryParams>(factoryParams: T) => any; | ||
export { generateContext, useVSFContext, configureContext, configureFactoryParams }; |
@@ -6,4 +6,4 @@ import { onSSR, vsfRef, configureSSR } from './ssr'; | ||
import mask from './logger/mask'; | ||
import { useVSFContext, configureContext, generateContext } from './context'; | ||
import { integrationPluginFactory } from './nuxt'; | ||
export { wrap, onSSR, vsfRef, configureSSR, sharedRef, Logger, registerLogger, mask, configureContext, useVSFContext, generateContext, integrationPluginFactory }; | ||
import { useVSFContext, configureContext, generateContext, configureFactoryParams } from './context'; | ||
import { integrationPlugin } from './nuxt'; | ||
export { wrap, onSSR, vsfRef, configureSSR, sharedRef, Logger, registerLogger, mask, configureContext, useVSFContext, configureFactoryParams, generateContext, integrationPlugin }; |
@@ -1,1 +0,5 @@ | ||
export declare const integrationPluginFactory: (createApiClientFn: any) => (pluginFn: any) => (nuxtCtx: any, inject: any) => void; | ||
import { Context as NuxtContext, Plugin as NuxtPlugin } from '@nuxt/types'; | ||
declare type InjectFn = (key: string, value: any) => void; | ||
export declare type IntegrationPlugin = (pluginFn: NuxtPlugin) => NuxtPlugin; | ||
export declare const integrationPlugin: (pluginFn: NuxtPlugin) => (nuxtCtx: NuxtContext, inject: InjectFn) => void; | ||
export {}; |
import { Ref } from '@vue/composition-api'; | ||
declare function sharedRef<T>(value: T, key: string): Ref; | ||
declare function sharedRef<T>(key: string, _?: any): Ref; | ||
declare function sharedRef(key: string, _?: any): Ref; | ||
export { sharedRef }; |
{ | ||
"name": "@vue-storefront/core", | ||
"version": "2.2.1", | ||
"version": "2.3.0-rc.1", | ||
"sideEffects": false, | ||
@@ -10,6 +10,4 @@ "main": "lib/index.cjs.js", | ||
"scripts": { | ||
"build:client": "rollup -c rollup-client.config.js", | ||
"build:server": "rollup -c rollup-server.config.js", | ||
"build": "yarn build:client && yarn build:server", | ||
"dev": "rollup -c rollup-client.config.js -w", | ||
"build": "rimraf lib && rollup -c rollup.config.js", | ||
"dev": "rimraf lib && rollup -c rollup.config.js -w", | ||
"prepublish": "yarn build" | ||
@@ -21,5 +19,8 @@ }, | ||
"lodash-es": "^4.17.15", | ||
"express": "^4.17.1" | ||
"express": "^4.17.1", | ||
"axios": "0.21.1", | ||
"is-https": "^3.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/express": "^4.11.1", | ||
"@vue/test-utils": "^1.0.0-beta.30", | ||
@@ -26,0 +27,0 @@ "vue-template-compiler": "^2.6.x" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
851060
9835
6
3
68
1
2
3
+ Addedaxios@0.21.1
+ Addedis-https@^3.0.2
+ Addedaxios@0.21.1(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedis-https@3.0.2(transitive)