@plasmicpkgs/commerce-saleor 0.0.210 → 0.0.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cart/index.d.ts +4 -4
- package/dist/cart/use-add-item.d.ts +5 -5
- package/dist/cart/use-cart.d.ts +6 -5
- package/dist/cart/use-remove-item.d.ts +15 -15
- package/dist/cart/use-update-item.d.ts +27 -27
- package/dist/commerce-saleor.cjs.development.js +77 -76
- package/dist/commerce-saleor.cjs.development.js.map +1 -1
- package/dist/commerce-saleor.cjs.production.min.js +1 -1
- package/dist/commerce-saleor.cjs.production.min.js.map +1 -1
- package/dist/commerce-saleor.esm.js +77 -76
- package/dist/commerce-saleor.esm.js.map +1 -1
- package/dist/const.d.ts +4 -4
- package/dist/fetcher.d.ts +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/product/use-price.d.ts +2 -2
- package/dist/product/use-product.d.ts +9 -9
- package/dist/product/use-search.d.ts +16 -16
- package/dist/provider.d.ts +68 -68
- package/dist/registerCommerceProvider.d.ts +11 -11
- package/dist/registerable.d.ts +6 -6
- package/dist/saleor.d.ts +5 -5
- package/dist/site/use-brands.d.ts +5 -5
- package/dist/site/use-categories.d.ts +5 -5
- package/dist/types/cart.d.ts +22 -22
- package/dist/types/site.d.ts +7 -7
- package/dist/types.d.ts +24 -24
- package/dist/utils/checkout-attach.d.ts +2 -2
- package/dist/utils/checkout-create.d.ts +3 -3
- package/dist/utils/checkout-to-cart.d.ts +9 -9
- package/dist/utils/customer-token.d.ts +7 -7
- package/dist/utils/fragments/checkout-details.d.ts +1 -1
- package/dist/utils/fragments/index.d.ts +2 -2
- package/dist/utils/fragments/product.d.ts +1 -1
- package/dist/utils/get-categories.d.ts +3 -3
- package/dist/utils/get-checkout-id.d.ts +5 -5
- package/dist/utils/get-search-variables.d.ts +14 -14
- package/dist/utils/get-sort-variables.d.ts +1 -1
- package/dist/utils/get-vendors.d.ts +11 -11
- package/dist/utils/handle-fetch-response.d.ts +5 -5
- package/dist/utils/handle-login.d.ts +5 -5
- package/dist/utils/index.d.ts +13 -13
- package/dist/utils/mutations/account-create.d.ts +1 -1
- package/dist/utils/mutations/checkout-attach.d.ts +1 -1
- package/dist/utils/mutations/checkout-create.d.ts +1 -1
- package/dist/utils/mutations/checkout-line-add.d.ts +1 -1
- package/dist/utils/mutations/checkout-line-remove.d.ts +1 -1
- package/dist/utils/mutations/checkout-line-update.d.ts +1 -1
- package/dist/utils/mutations/index.d.ts +8 -8
- package/dist/utils/mutations/session-create.d.ts +1 -1
- package/dist/utils/mutations/session-destroy.d.ts +1 -1
- package/dist/utils/normalize.d.ts +7 -7
- package/dist/utils/queries/checkout-one.d.ts +1 -1
- package/dist/utils/queries/collection-many.d.ts +1 -1
- package/dist/utils/queries/collection-one.d.ts +1 -1
- package/dist/utils/queries/customer-current.d.ts +1 -1
- package/dist/utils/queries/customer-one.d.ts +1 -1
- package/dist/utils/queries/get-all-product-vendors-query.d.ts +1 -1
- package/dist/utils/queries/get-all-products-paths-query.d.ts +1 -1
- package/dist/utils/queries/index.d.ts +11 -11
- package/dist/utils/queries/page-many.d.ts +1 -1
- package/dist/utils/queries/page-one.d.ts +1 -1
- package/dist/utils/queries/product-many.d.ts +1 -1
- package/dist/utils/queries/product-one-by-id.d.ts +1 -1
- package/dist/utils/queries/product-one-by-slug.d.ts +1 -1
- package/dist/utils/throw-user-errors.d.ts +5 -5
- package/package.json +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GlobalContextMeta } from "@plasmicapp/host";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Registerable } from "./registerable";
|
|
4
|
-
interface CommerceProviderProps {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
saleorApiUrl: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps>;
|
|
9
|
-
export declare function CommerceProviderComponent(props: CommerceProviderProps): React.JSX.Element;
|
|
10
|
-
export declare function registerCommerceProvider(loader?: Registerable, customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>): void;
|
|
11
|
-
export {};
|
|
1
|
+
import { GlobalContextMeta } from "@plasmicapp/host";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Registerable } from "./registerable";
|
|
4
|
+
interface CommerceProviderProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
saleorApiUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps>;
|
|
9
|
+
export declare function CommerceProviderComponent(props: CommerceProviderProps): React.JSX.Element;
|
|
10
|
+
export declare function registerCommerceProvider(loader?: Registerable, customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>): void;
|
|
11
|
+
export {};
|
package/dist/registerable.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import registerGlobalContext from "@plasmicapp/host/registerGlobalContext";
|
|
2
|
-
import registerComponent from "@plasmicapp/host/registerComponent";
|
|
3
|
-
export
|
|
4
|
-
registerComponent: typeof registerComponent;
|
|
5
|
-
registerGlobalContext: typeof registerGlobalContext;
|
|
6
|
-
};
|
|
1
|
+
import registerGlobalContext from "@plasmicapp/host/registerGlobalContext";
|
|
2
|
+
import registerComponent from "@plasmicapp/host/registerComponent";
|
|
3
|
+
export type Registerable = {
|
|
4
|
+
registerComponent: typeof registerComponent;
|
|
5
|
+
registerGlobalContext: typeof registerGlobalContext;
|
|
6
|
+
};
|
package/dist/saleor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SaleorProvider } from "./provider";
|
|
3
|
-
export type { SaleorProvider };
|
|
4
|
-
export declare const useCommerce: () => import("@plasmicpkgs/commerce").CommerceContextValue<SaleorProvider>;
|
|
5
|
-
export declare const getCommerceProvider: (saleorApiUrl: string) => ({ children, ...props }: import("@plasmicpkgs/commerce").CommerceProviderProps) => import("react").JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SaleorProvider } from "./provider";
|
|
3
|
+
export type { SaleorProvider };
|
|
4
|
+
export declare const useCommerce: () => import("@plasmicpkgs/commerce").CommerceContextValue<SaleorProvider>;
|
|
5
|
+
export declare const getCommerceProvider: (saleorApiUrl: string) => ({ children, ...props }: import("@plasmicpkgs/commerce").CommerceProviderProps) => import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SWRHook } from "@plasmicpkgs/commerce";
|
|
2
|
-
import { GetBrandsHook } from "../types/site";
|
|
3
|
-
declare const _default
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const handler: SWRHook<GetBrandsHook>;
|
|
1
|
+
import { SWRHook, UseBrands } from "@plasmicpkgs/commerce";
|
|
2
|
+
import { GetBrandsHook } from "../types/site";
|
|
3
|
+
declare const _default: UseBrands<typeof handler>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const handler: SWRHook<GetBrandsHook>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SWRHook } from "@plasmicpkgs/commerce";
|
|
2
|
-
import { GetCategoriesHook } from "../types/site";
|
|
3
|
-
declare const _default
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const handler: SWRHook<GetCategoriesHook>;
|
|
1
|
+
import { SWRHook, UseCategories } from "@plasmicpkgs/commerce";
|
|
2
|
+
import { GetCategoriesHook } from "../types/site";
|
|
3
|
+
declare const _default: UseCategories<typeof handler>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const handler: SWRHook<GetCategoriesHook>;
|
package/dist/types/cart.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CartType as Core } from '@plasmicpkgs/commerce';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Extend core cart types
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
lineItems: Core.LineItem[];
|
|
9
|
-
url?: string;
|
|
10
|
-
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
1
|
+
import { CartType as Core } from '@plasmicpkgs/commerce';
|
|
2
|
+
export type SaleorCart = {};
|
|
3
|
+
export type LineItem = Core.LineItem;
|
|
4
|
+
/**
|
|
5
|
+
* Extend core cart types
|
|
6
|
+
*/
|
|
7
|
+
export type Cart = Core.Cart & {
|
|
8
|
+
lineItems: Core.LineItem[];
|
|
9
|
+
url?: string;
|
|
10
|
+
};
|
|
11
|
+
export type CartTypes = Core.CartTypes;
|
|
12
|
+
export type CartHooks = Core.CartHooks<CartTypes>;
|
|
13
|
+
export type GetCartHook = CartHooks['getCart'];
|
|
14
|
+
export type AddItemHook = CartHooks['addItem'];
|
|
15
|
+
export type UpdateItemHook = CartHooks['updateItem'];
|
|
16
|
+
export type RemoveItemHook = CartHooks['removeItem'];
|
|
17
|
+
export type CartSchema = Core.CartSchema<CartTypes>;
|
|
18
|
+
export type CartHandlers = Core.CartHandlers<CartTypes>;
|
|
19
|
+
export type GetCartHandler = CartHandlers['getCart'];
|
|
20
|
+
export type AddItemHandler = CartHandlers['addItem'];
|
|
21
|
+
export type UpdateItemHandler = CartHandlers['updateItem'];
|
|
22
|
+
export type RemoveItemHandler = CartHandlers['removeItem'];
|
package/dist/types/site.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SiteTypes } from "@plasmicpkgs/commerce";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
import { SiteTypes } from "@plasmicpkgs/commerce";
|
|
2
|
+
export type Category = SiteTypes.Category;
|
|
3
|
+
export type Brand = SiteTypes.Brand;
|
|
4
|
+
export type SiteTypes = SiteTypes.SiteTypes;
|
|
5
|
+
export type GetSiteInfoOperation = SiteTypes.GetSiteInfoOperation;
|
|
6
|
+
export type GetCategoriesHook = SiteTypes.GetCategoriesHook;
|
|
7
|
+
export type GetBrandsHook = SiteTypes.GetBrandsHook;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { CartType as CoreCart } from '@plasmicpkgs/commerce';
|
|
2
|
-
import { CheckoutLine } from './schema';
|
|
3
|
-
export
|
|
4
|
-
id: string;
|
|
5
|
-
webUrl: string;
|
|
6
|
-
lineItems: CheckoutLine[];
|
|
7
|
-
};
|
|
8
|
-
export
|
|
9
|
-
lineItems: LineItem[];
|
|
10
|
-
};
|
|
11
|
-
export interface LineItem extends CoreCart.LineItem {
|
|
12
|
-
options?: any[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Cart mutations
|
|
16
|
-
*/
|
|
17
|
-
export
|
|
18
|
-
option_id: number;
|
|
19
|
-
option_value: number | string;
|
|
20
|
-
};
|
|
21
|
-
export
|
|
22
|
-
productId: string;
|
|
23
|
-
optionSelections?: OptionSelections;
|
|
24
|
-
};
|
|
1
|
+
import type { CartType as CoreCart } from '@plasmicpkgs/commerce';
|
|
2
|
+
import { CheckoutLine } from './schema';
|
|
3
|
+
export type SaleorCheckout = {
|
|
4
|
+
id: string;
|
|
5
|
+
webUrl: string;
|
|
6
|
+
lineItems: CheckoutLine[];
|
|
7
|
+
};
|
|
8
|
+
export type Cart = CoreCart.Cart & {
|
|
9
|
+
lineItems: LineItem[];
|
|
10
|
+
};
|
|
11
|
+
export interface LineItem extends CoreCart.LineItem {
|
|
12
|
+
options?: any[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Cart mutations
|
|
16
|
+
*/
|
|
17
|
+
export type OptionSelections = {
|
|
18
|
+
option_id: number;
|
|
19
|
+
option_value: number | string;
|
|
20
|
+
};
|
|
21
|
+
export type CartItemBody = CoreCart.CartItemBody & {
|
|
22
|
+
productId: string;
|
|
23
|
+
optionSelections?: OptionSelections;
|
|
24
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CheckoutCustomerAttach } from '../schema';
|
|
2
|
-
export declare const checkoutAttach: (fetch: any, { variables, headers }: any) => Promise<CheckoutCustomerAttach>;
|
|
1
|
+
import { CheckoutCustomerAttach } from '../schema';
|
|
2
|
+
export declare const checkoutAttach: (fetch: any, { variables, headers }: any) => Promise<CheckoutCustomerAttach>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CheckoutCreate } from '../schema';
|
|
2
|
-
export declare const checkoutCreate: (fetch: any) => Promise<CheckoutCreate>;
|
|
3
|
-
export default checkoutCreate;
|
|
1
|
+
import { CheckoutCreate } from '../schema';
|
|
2
|
+
export declare const checkoutCreate: (fetch: any) => Promise<CheckoutCreate>;
|
|
3
|
+
export default checkoutCreate;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Cart } from '../types';
|
|
2
|
-
import { CheckoutLinesAdd, CheckoutLinesUpdate, CheckoutCreate, CheckoutError, Checkout, CheckoutLineDelete } from '../schema';
|
|
3
|
-
export
|
|
4
|
-
checkout: Checkout;
|
|
5
|
-
errors?: Array<CheckoutError>;
|
|
6
|
-
};
|
|
7
|
-
export
|
|
8
|
-
declare const checkoutToCart: (checkoutPayload?:
|
|
9
|
-
export default checkoutToCart;
|
|
1
|
+
import { Cart } from '../types';
|
|
2
|
+
import { CheckoutLinesAdd, CheckoutLinesUpdate, CheckoutCreate, CheckoutError, Checkout, Maybe, CheckoutLineDelete } from '../schema';
|
|
3
|
+
export type CheckoutQuery = {
|
|
4
|
+
checkout: Checkout;
|
|
5
|
+
errors?: Array<CheckoutError>;
|
|
6
|
+
};
|
|
7
|
+
export type CheckoutPayload = CheckoutLinesAdd | CheckoutLinesUpdate | CheckoutCreate | CheckoutQuery | CheckoutLineDelete;
|
|
8
|
+
declare const checkoutToCart: (checkoutPayload?: Maybe<CheckoutPayload>) => Cart | undefined;
|
|
9
|
+
export default checkoutToCart;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const getToken: () => string | undefined;
|
|
3
|
-
export declare const setToken: (token?: string
|
|
4
|
-
export declare const getCSRFToken: () => string | undefined;
|
|
5
|
-
export declare const setCSRFToken: (token?: string
|
|
6
|
-
export declare const getCheckoutToken: () => string | undefined;
|
|
7
|
-
export declare const setCheckoutToken: (token?: string
|
|
1
|
+
import { CookieAttributes } from 'js-cookie';
|
|
2
|
+
export declare const getToken: () => string | undefined;
|
|
3
|
+
export declare const setToken: (token?: string, options?: CookieAttributes) => void;
|
|
4
|
+
export declare const getCSRFToken: () => string | undefined;
|
|
5
|
+
export declare const setCSRFToken: (token?: string, options?: CookieAttributes) => void;
|
|
6
|
+
export declare const getCheckoutToken: () => string | undefined;
|
|
7
|
+
export declare const setCheckoutToken: (token?: string, options?: CookieAttributes) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutDetails = "\n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const CheckoutDetails = "\n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ProductConnection } from './product';
|
|
2
|
-
export { CheckoutDetails } from './checkout-details';
|
|
1
|
+
export { ProductConnection } from './product';
|
|
2
|
+
export { CheckoutDetails } from './checkout-details';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ProductConnection = "\n fragment ProductConnection on ProductCountableConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n name\n description\n slug\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n media {\n url\n alt\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const ProductConnection = "\n fragment ProductConnection on ProductCountableConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n name\n description\n slug\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n media {\n url\n alt\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n }\n }\n }\n";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Category } from '../types/site';
|
|
2
|
-
declare const getCategories: (config:
|
|
3
|
-
export default getCategories;
|
|
1
|
+
import { Category } from '../types/site';
|
|
2
|
+
declare const getCategories: (config: SaleorConfig) => Promise<Category[]>;
|
|
3
|
+
export default getCategories;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const getCheckoutId: (id?: string
|
|
2
|
-
checkoutId: string;
|
|
3
|
-
checkoutToken: string;
|
|
4
|
-
};
|
|
5
|
-
export default getCheckoutId;
|
|
1
|
+
declare const getCheckoutId: (id?: string) => {
|
|
2
|
+
checkoutId: string;
|
|
3
|
+
checkoutToken: string;
|
|
4
|
+
};
|
|
5
|
+
export default getCheckoutId;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { SearchProductsInput } from '../product/use-search';
|
|
2
|
-
export declare const getSearchVariables: ({ brandId, search, categoryId, sort, count }: SearchProductsInput) => {
|
|
3
|
-
categoryId: string | number | undefined;
|
|
4
|
-
filter: {
|
|
5
|
-
search: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
sortBy: {
|
|
8
|
-
channel: string;
|
|
9
|
-
field: string;
|
|
10
|
-
direction: string;
|
|
11
|
-
};
|
|
12
|
-
first: number | undefined;
|
|
13
|
-
};
|
|
14
|
-
export default getSearchVariables;
|
|
1
|
+
import type { SearchProductsInput } from '../product/use-search';
|
|
2
|
+
export declare const getSearchVariables: ({ brandId, search, categoryId, sort, count }: SearchProductsInput) => {
|
|
3
|
+
categoryId: string | number | undefined;
|
|
4
|
+
filter: {
|
|
5
|
+
search: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
sortBy: {
|
|
8
|
+
channel: string;
|
|
9
|
+
field: string;
|
|
10
|
+
direction: string;
|
|
11
|
+
};
|
|
12
|
+
first: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
export default getSearchVariables;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getSortVariables: (sort?: string
|
|
1
|
+
export declare const getSortVariables: (sort?: string, isCategory?: boolean) => {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
entityId: string;
|
|
3
|
-
name: string;
|
|
4
|
-
path: string;
|
|
5
|
-
};
|
|
6
|
-
export
|
|
7
|
-
node: Brand;
|
|
8
|
-
};
|
|
9
|
-
export
|
|
10
|
-
declare const getVendors: (config:
|
|
11
|
-
export default getVendors;
|
|
1
|
+
export type Brand = {
|
|
2
|
+
entityId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
};
|
|
6
|
+
export type BrandEdge = {
|
|
7
|
+
node: Brand;
|
|
8
|
+
};
|
|
9
|
+
export type Brands = BrandEdge[];
|
|
10
|
+
declare const getVendors: (config: SaleorConfig) => Promise<BrandEdge[]>;
|
|
11
|
+
export default getVendors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherError } from '@plasmicpkgs/commerce';
|
|
2
|
-
export declare function getError(errors: any[], status: number): FetcherError;
|
|
3
|
-
export declare function getAsyncError(res: Response): Promise<FetcherError>;
|
|
4
|
-
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
5
|
-
export default handleFetchResponse;
|
|
1
|
+
import { FetcherError } from '@plasmicpkgs/commerce';
|
|
2
|
+
export declare function getError(errors: any[], status: number): FetcherError;
|
|
3
|
+
export declare function getAsyncError(res: Response): Promise<FetcherError>;
|
|
4
|
+
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
5
|
+
export default handleFetchResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherOptions } from '@plasmicpkgs/commerce';
|
|
2
|
-
import { CreateToken, MutationTokenCreateArgs } from '../schema';
|
|
3
|
-
declare const handleLogin: (data: CreateToken) => string |
|
|
4
|
-
export declare const handleAutomaticLogin: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>, input: MutationTokenCreateArgs) => Promise<void>;
|
|
5
|
-
export default handleLogin;
|
|
1
|
+
import { FetcherOptions } from '@plasmicpkgs/commerce';
|
|
2
|
+
import { CreateToken, MutationTokenCreateArgs } from '../schema';
|
|
3
|
+
declare const handleLogin: (data: CreateToken) => import("../schema").Maybe<string> | undefined;
|
|
4
|
+
export declare const handleAutomaticLogin: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>, input: MutationTokenCreateArgs) => Promise<void>;
|
|
5
|
+
export default handleLogin;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { getSortVariables } from './get-sort-variables';
|
|
2
|
-
export { default as handleFetchResponse } from './handle-fetch-response';
|
|
3
|
-
export { default as getSearchVariables } from './get-search-variables';
|
|
4
|
-
export { default as getCheckoutId } from './get-checkout-id';
|
|
5
|
-
export { default as checkoutCreate } from './checkout-create';
|
|
6
|
-
export { checkoutAttach } from './checkout-attach';
|
|
7
|
-
export { default as checkoutToCart } from './checkout-to-cart';
|
|
8
|
-
export { default as handleLogin, handleAutomaticLogin } from './handle-login';
|
|
9
|
-
export { default as throwUserErrors } from './throw-user-errors';
|
|
10
|
-
export * from './queries';
|
|
11
|
-
export * from './mutations';
|
|
12
|
-
export * from './normalize';
|
|
13
|
-
export * from './customer-token';
|
|
1
|
+
export { getSortVariables } from './get-sort-variables';
|
|
2
|
+
export { default as handleFetchResponse } from './handle-fetch-response';
|
|
3
|
+
export { default as getSearchVariables } from './get-search-variables';
|
|
4
|
+
export { default as getCheckoutId } from './get-checkout-id';
|
|
5
|
+
export { default as checkoutCreate } from './checkout-create';
|
|
6
|
+
export { checkoutAttach } from './checkout-attach';
|
|
7
|
+
export { default as checkoutToCart } from './checkout-to-cart';
|
|
8
|
+
export { default as handleLogin, handleAutomaticLogin } from './handle-login';
|
|
9
|
+
export { default as throwUserErrors } from './throw-user-errors';
|
|
10
|
+
export * from './queries';
|
|
11
|
+
export * from './mutations';
|
|
12
|
+
export * from './normalize';
|
|
13
|
+
export * from './customer-token';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AccountCreate = "\n mutation AccountCreate($input: AccountRegisterInput!) {\n accountRegister(input: $input) {\n errors {\n code\n field\n message\n }\n user {\n email\n isActive\n }\n }\n }\n";
|
|
1
|
+
export declare const AccountCreate = "\n mutation AccountCreate($input: AccountRegisterInput!) {\n accountRegister(input: $input) {\n errors {\n code\n field\n message\n }\n user {\n email\n isActive\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutAttach = "\n mutation CheckoutAttach($checkoutId: ID!) {\n checkoutCustomerAttach(checkoutId: $checkoutId) {\n errors {\n message\n }\n checkout {\n id\n }\n }\n }\n";
|
|
1
|
+
export declare const CheckoutAttach = "\n mutation CheckoutAttach($checkoutId: ID!) {\n checkoutCustomerAttach(checkoutId: $checkoutId) {\n errors {\n message\n }\n checkout {\n id\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutCreate:
|
|
1
|
+
export declare const CheckoutCreate = "\n mutation CheckoutCreate {\n checkoutCreate(input: { email: \"customer@example.com\", lines: [], channel: \"default-channel\" }) {\n errors {\n code\n field\n message\n }\n checkout {\n ...CheckoutDetails\n }\n }\n }\n \n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutLineAdd:
|
|
1
|
+
export declare const CheckoutLineAdd = "\n mutation CheckoutLineAdd($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) {\n checkoutLinesAdd(checkoutId: $checkoutId, lines: $lineItems) {\n errors {\n code\n field\n message\n }\n checkout {\n ...CheckoutDetails\n }\n }\n }\n \n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutLineDelete:
|
|
1
|
+
export declare const CheckoutLineDelete = "\n mutation CheckoutLineDelete($checkoutId: ID!, $lineId: ID!) {\n checkoutLineDelete(checkoutId: $checkoutId, lineId: $lineId) {\n errors {\n code\n field\n message\n }\n checkout {\n ...CheckoutDetails\n }\n }\n }\n \n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutLineUpdate:
|
|
1
|
+
export declare const CheckoutLineUpdate = "\n mutation CheckoutLineUpdate($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) {\n checkoutLinesUpdate(checkoutId: $checkoutId, lines: $lineItems) {\n errors {\n code\n field\n message\n }\n checkout {\n ...CheckoutDetails\n }\n }\n }\n \n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n\n";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AccountCreate } from './account-create';
|
|
2
|
-
export { CheckoutCreate } from './checkout-create';
|
|
3
|
-
export { CheckoutLineAdd } from './checkout-line-add';
|
|
4
|
-
export { CheckoutLineUpdate } from './checkout-line-update';
|
|
5
|
-
export { CheckoutLineDelete } from './checkout-line-remove';
|
|
6
|
-
export { SessionCreate } from './session-create';
|
|
7
|
-
export { SessionDestroy } from './session-destroy';
|
|
8
|
-
export { CheckoutAttach } from './checkout-attach';
|
|
1
|
+
export { AccountCreate } from './account-create';
|
|
2
|
+
export { CheckoutCreate } from './checkout-create';
|
|
3
|
+
export { CheckoutLineAdd } from './checkout-line-add';
|
|
4
|
+
export { CheckoutLineUpdate } from './checkout-line-update';
|
|
5
|
+
export { CheckoutLineDelete } from './checkout-line-remove';
|
|
6
|
+
export { SessionCreate } from './session-create';
|
|
7
|
+
export { SessionDestroy } from './session-destroy';
|
|
8
|
+
export { CheckoutAttach } from './checkout-attach';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SessionCreate = "\n mutation SessionCreate($email: String!, $password: String!) {\n tokenCreate(email: $email, password: $password) {\n token\n refreshToken\n csrfToken\n errors {\n code\n field\n message\n }\n }\n }\n";
|
|
1
|
+
export declare const SessionCreate = "\n mutation SessionCreate($email: String!, $password: String!) {\n tokenCreate(email: $email, password: $password) {\n token\n refreshToken\n csrfToken\n errors {\n code\n field\n message\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SessionDestroy = "\n mutation SessionDestroy {\n tokensDeactivateAll {\n errors {\n field\n message\n }\n }\n }\n";
|
|
1
|
+
export declare const SessionDestroy = "\n mutation SessionDestroy {\n tokensDeactivateAll {\n errors {\n field\n message\n }\n }\n }\n";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Product } from "@plasmicpkgs/commerce";
|
|
2
|
-
import { Product as SaleorProduct, Checkout, Collection } from "../schema";
|
|
3
|
-
import { Category } from "../types/site";
|
|
4
|
-
import type { Cart } from "../types";
|
|
5
|
-
export declare function normalizeProduct(productNode: SaleorProduct): Product;
|
|
6
|
-
export declare function normalizeCart(checkout: Checkout): Cart;
|
|
7
|
-
export declare const normalizeCategory: ({ name, slug, id, }: Collection) => Category;
|
|
1
|
+
import { Product } from "@plasmicpkgs/commerce";
|
|
2
|
+
import { Product as SaleorProduct, Checkout, Collection } from "../schema";
|
|
3
|
+
import { Category } from "../types/site";
|
|
4
|
+
import type { Cart } from "../types";
|
|
5
|
+
export declare function normalizeProduct(productNode: SaleorProduct): Product;
|
|
6
|
+
export declare function normalizeCart(checkout: Checkout): Cart;
|
|
7
|
+
export declare const normalizeCategory: ({ name, slug, id, }: Collection) => Category;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CheckoutOne:
|
|
1
|
+
export declare const CheckoutOne = "\n query CheckoutOne($checkoutId: UUID!) {\n checkout(token: $checkoutId) {\n ... on Checkout {\n ...CheckoutDetails\n }\n }\n }\n \n fragment CheckoutDetails on Checkout {\n id\n token\n created\n totalPrice {\n currency\n gross {\n amount\n }\n }\n subtotalPrice {\n currency\n gross {\n amount\n }\n }\n\n lines {\n id\n variant {\n id\n name\n sku\n product {\n name\n slug\n id\n }\n media {\n url\n }\n pricing {\n price {\n gross {\n amount\n }\n }\n }\n }\n quantity\n totalPrice {\n currency\n gross {\n amount\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CollectionMany = "\n query CollectionMany( $channel: String = \"default-channel\") {\n collections(first:100, channel: $channel) {\n edges {\n node {\n id\n name\n slug\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const CollectionMany = "\n query CollectionMany( $channel: String = \"default-channel\") {\n collections(first:100, channel: $channel) {\n edges {\n node {\n id\n name\n slug\n }\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CollectionOne:
|
|
1
|
+
export declare const CollectionOne = "\n query getProductsFromCollection($categoryId: ID!, $first: Int = 100, $channel: String = \"default-channel\") {\n collection(id: $categoryId, channel: $channel) {\n id\n name\n slug\n products(first: $first) {\n ...ProductConnection\n }\n }\n }\n \n fragment ProductConnection on ProductCountableConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n name\n description\n slug\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n media {\n url\n alt\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CustomerCurrent = "\n query CustomerCurrent {\n me {\n id\n email\n firstName\n lastName\n dateJoined\n }\n }\n";
|
|
1
|
+
export declare const CustomerCurrent = "\n query CustomerCurrent {\n me {\n id\n email\n firstName\n lastName\n dateJoined\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CustomerOne = "\n query CustomerOne($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n id\n }\n }\n";
|
|
1
|
+
export declare const CustomerOne = "\n query CustomerOne($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n id\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getAllProductVendors = "\n query getAllProductVendors($cursor: String, $channel: String = \"default-channel\") {\n products(first:100,channel: $channel, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n slug\n }\n cursor\n }\n }\n }\n";
|
|
1
|
+
export declare const getAllProductVendors = "\n query getAllProductVendors($cursor: String, $channel: String = \"default-channel\") {\n products(first:100,channel: $channel, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n slug\n }\n cursor\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getAllProductsPathsQuery = "\n query getAllProductPaths($cursor: String, $channel: String = \"default-channel\") {\n products(first: 100, after: $cursor, channel: $channel) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n slug\n }\n cursor\n }\n }\n }\n";
|
|
1
|
+
export declare const getAllProductsPathsQuery = "\n query getAllProductPaths($cursor: String, $channel: String = \"default-channel\") {\n products(first: 100, after: $cursor, channel: $channel) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n slug\n }\n cursor\n }\n }\n }\n";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { CollectionMany } from './collection-many';
|
|
2
|
-
export { ProductOneBySlug } from './product-one-by-slug';
|
|
3
|
-
export { ProductMany } from './product-many';
|
|
4
|
-
export { CollectionOne } from './collection-one';
|
|
5
|
-
export { CheckoutOne } from './checkout-one';
|
|
6
|
-
export { PageMany } from './page-many';
|
|
7
|
-
export { PageOne } from './page-one';
|
|
8
|
-
export { CustomerCurrent } from './customer-current';
|
|
9
|
-
export { CustomerOne } from './customer-one';
|
|
10
|
-
export { getAllProductsPathsQuery } from './get-all-products-paths-query';
|
|
11
|
-
export { getAllProductVendors } from './get-all-product-vendors-query';
|
|
1
|
+
export { CollectionMany } from './collection-many';
|
|
2
|
+
export { ProductOneBySlug } from './product-one-by-slug';
|
|
3
|
+
export { ProductMany } from './product-many';
|
|
4
|
+
export { CollectionOne } from './collection-one';
|
|
5
|
+
export { CheckoutOne } from './checkout-one';
|
|
6
|
+
export { PageMany } from './page-many';
|
|
7
|
+
export { PageOne } from './page-one';
|
|
8
|
+
export { CustomerCurrent } from './customer-current';
|
|
9
|
+
export { CustomerOne } from './customer-one';
|
|
10
|
+
export { getAllProductsPathsQuery } from './get-all-products-paths-query';
|
|
11
|
+
export { getAllProductVendors } from './get-all-product-vendors-query';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PageMany = "\n query PageMany($first: Int = 100) {\n pages(first: $first) {\n edges {\n node {\n id\n title\n slug\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const PageMany = "\n query PageMany($first: Int = 100) {\n pages(first: $first) {\n edges {\n node {\n id\n title\n slug\n }\n }\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PageOne = "\n query PageOne($id: ID!) {\n page(id: $id) {\n id\n title\n slug\n }\n }\n";
|
|
1
|
+
export declare const PageOne = "\n query PageOne($id: ID!) {\n page(id: $id) {\n id\n title\n slug\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ProductMany:
|
|
1
|
+
export declare const ProductMany = "\n query ProductMany(\n $first: Int = 100\n $filter: ProductFilterInput\n $sortBy: ProductOrder\n $channel: String = \"default-channel\"\n ) {\n products(first: $first, channel: $channel, filter: $filter, sortBy: $sortBy) {\n ...ProductConnection\n }\n }\n \n fragment ProductConnection on ProductCountableConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n name\n description\n slug\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n media {\n url\n alt\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n }\n }\n }\n\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ProductOneById = "\n query ProductOneById($id: ID!, $channel: String = \"default-channel\") {\n product(id: $id, channel: $channel) {\n\n slug\n name\n description\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n media {\n url\n alt\n }\n }\n }";
|
|
1
|
+
export declare const ProductOneById = "\n query ProductOneById($id: ID!, $channel: String = \"default-channel\") {\n product(id: $id, channel: $channel) {\n\n slug\n name\n description\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n media {\n url\n alt\n }\n }\n }";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ProductOneBySlug = "\n query ProductOneBySlug($slug: String!, $channel: String = \"default-channel\") {\n product(slug: $slug, channel: $channel) {\n id\n slug\n name\n description\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n media {\n url\n alt\n }\n }\n }\n";
|
|
1
|
+
export declare const ProductOneBySlug = "\n query ProductOneBySlug($slug: String!, $channel: String = \"default-channel\") {\n product(slug: $slug, channel: $channel) {\n id\n slug\n name\n description\n pricing {\n priceRange {\n start {\n net {\n amount\n }\n }\n }\n }\n variants {\n id\n name\n attributes {\n attribute {\n name\n }\n values {\n name\n }\n }\n pricing {\n price {\n net {\n amount\n currency\n }\n }\n }\n }\n media {\n url\n alt\n }\n }\n }\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../schema';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export declare const throwUserErrors: (errors?: UserErrors
|
|
5
|
-
export default throwUserErrors;
|
|
1
|
+
import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../schema';
|
|
2
|
+
export type UserErrors = Array<CheckoutError | AccountError | AppError>;
|
|
3
|
+
export type UserErrorCode = CheckoutErrorCode | AccountErrorCode | null | undefined;
|
|
4
|
+
export declare const throwUserErrors: (errors?: UserErrors) => void;
|
|
5
|
+
export default throwUserErrors;
|