@plasmicpkgs/commerce-shopify 0.0.214 → 0.0.216
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/use-add-item.d.ts +4 -4
- package/dist/cart/use-cart.d.ts +2 -3
- package/dist/cart/use-remove-item.d.ts +12 -8
- package/dist/cart/use-update-item.d.ts +12 -8
- package/dist/commerce-shopify.cjs.development.js +2863 -716
- package/dist/commerce-shopify.cjs.development.js.map +1 -1
- package/dist/commerce-shopify.cjs.production.min.js +1 -1
- package/dist/commerce-shopify.cjs.production.min.js.map +1 -1
- package/dist/commerce-shopify.esm.js +2864 -717
- package/dist/commerce-shopify.esm.js.map +1 -1
- package/dist/const.d.ts +1 -1
- package/dist/fetcher.d.ts +1 -1
- package/dist/graphql-config.d.ts +6 -0
- package/dist/product/use-product.d.ts +2 -5
- package/dist/product/use-search.d.ts +1 -9
- package/dist/provider.d.ts +19 -13
- package/dist/shopify-types.d.ts +5 -0
- package/dist/site/use-brands.d.ts +2 -3
- package/dist/site/use-categories.d.ts +2 -3
- package/dist/utils/cart-create.d.ts +3 -0
- package/dist/utils/fragments/cart.d.ts +1 -0
- package/dist/utils/fragments/collection.d.ts +1 -0
- package/dist/utils/fragments/image.d.ts +1 -0
- package/dist/utils/fragments/product-variant.d.ts +1 -0
- package/dist/utils/fragments/product.d.ts +1 -0
- package/dist/utils/fragments/seo.d.ts +1 -0
- package/dist/utils/get-cart-id.d.ts +1 -0
- package/dist/utils/graphql/gen/gql.d.ts +76 -0
- package/dist/utils/graphql/gen/graphql.d.ts +11114 -0
- package/dist/utils/graphql/gen/index.d.ts +1 -0
- package/dist/utils/mutations/cart.d.ts +15 -0
- package/dist/utils/mutations/customer-activate-by-url.d.ts +4 -2
- package/dist/utils/normalize.d.ts +6 -7
- package/dist/utils/queries/get-all-collections-query.d.ts +3 -2
- package/dist/utils/queries/get-all-product-vendors-query.d.ts +4 -2
- package/dist/utils/queries/get-all-products-query.d.ts +6 -3
- package/dist/utils/queries/get-cart-query.d.ts +3 -0
- package/dist/utils/queries/get-collection-products-query.d.ts +6 -2
- package/dist/utils/queries/get-collection-query.d.ts +5 -3
- package/dist/utils/queries/get-product-query.d.ts +6 -3
- package/dist/utils/throw-user-errors.d.ts +1 -2
- package/package.json +9 -6
- package/dist/cart/index.d.ts +0 -4
- package/dist/product/use-price.d.ts +0 -2
- package/dist/types/cart.d.ts +0 -25
- package/dist/types/checkout.d.ts +0 -1
- package/dist/types/common.d.ts +0 -1
- package/dist/types/customer.d.ts +0 -3
- package/dist/types/index.d.ts +0 -12
- package/dist/types/login.d.ts +0 -6
- package/dist/types/logout.d.ts +0 -1
- package/dist/types/page.d.ts +0 -8
- package/dist/types/product.d.ts +0 -1
- package/dist/types/signup.d.ts +0 -1
- package/dist/types/site.d.ts +0 -7
- package/dist/types/wishlist.d.ts +0 -1
- package/dist/utils/checkout-create.d.ts +0 -4
- package/dist/utils/checkout-to-cart.d.ts +0 -9
- package/dist/utils/customer-token.d.ts +0 -3
- package/dist/utils/get-brands.d.ts +0 -11
- package/dist/utils/get-categories.d.ts +0 -3
- package/dist/utils/get-checkout-id.d.ts +0 -2
- package/dist/utils/handle-account-activation.d.ts +0 -3
- package/dist/utils/handle-fetch-response.d.ts +0 -5
- package/dist/utils/handle-login.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/mutations/associate-customer-with-checkout.d.ts +0 -2
- package/dist/utils/mutations/checkout-create.d.ts +0 -2
- package/dist/utils/mutations/checkout-line-item-add.d.ts +0 -2
- package/dist/utils/mutations/checkout-line-item-remove.d.ts +0 -2
- package/dist/utils/mutations/checkout-line-item-update.d.ts +0 -2
- package/dist/utils/mutations/customer-access-token-create.d.ts +0 -2
- package/dist/utils/mutations/customer-access-token-delete.d.ts +0 -2
- package/dist/utils/mutations/customer-activate.d.ts +0 -2
- package/dist/utils/mutations/customer-create.d.ts +0 -2
- package/dist/utils/mutations/index.d.ts +0 -9
- package/dist/utils/queries/get-all-pages-query.d.ts +0 -2
- package/dist/utils/queries/get-all-products-paths-query.d.ts +0 -2
- package/dist/utils/queries/get-checkout-query.d.ts +0 -3
- package/dist/utils/queries/get-customer-id-query.d.ts +0 -2
- package/dist/utils/queries/get-customer-query.d.ts +0 -2
- package/dist/utils/queries/get-page-query.d.ts +0 -2
- package/dist/utils/queries/get-site-info-query.d.ts +0 -2
- package/dist/utils/queries/index.d.ts +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MutationHook } from
|
|
2
|
-
import
|
|
3
|
-
declare const _default: () => (input:
|
|
1
|
+
import type { MutationHook } from "@plasmicpkgs/commerce";
|
|
2
|
+
import { CartType } from "@plasmicpkgs/commerce";
|
|
3
|
+
declare const _default: () => (input: CartType.CartItemBody) => CartType.Cart | Promise<CartType.Cart | undefined> | undefined;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const handler: MutationHook<AddItemHook>;
|
|
5
|
+
export declare const handler: MutationHook<CartType.AddItemHook>;
|
package/dist/cart/use-cart.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SWRHook } from
|
|
2
|
-
import { GetCartHook } from '../types/cart';
|
|
1
|
+
import { CartType, SWRHook } from "@plasmicpkgs/commerce";
|
|
3
2
|
declare const _default;
|
|
4
3
|
export default _default;
|
|
5
|
-
export declare const handler: SWRHook<GetCartHook>;
|
|
4
|
+
export declare const handler: SWRHook<CartType.GetCartHook>;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare type
|
|
5
|
-
declare
|
|
1
|
+
import type { CartType, HookFetcherContext, MutationHookContext } from "@plasmicpkgs/commerce";
|
|
2
|
+
import type { ShopifyCart } from "../shopify-types";
|
|
3
|
+
import { RemoveFromCartMutation } from "../utils/graphql/gen/graphql";
|
|
4
|
+
export declare type RemoveItemFn<T = any> = T extends CartType.LineItem ? (input?: RemoveItemActionInput<T>) => Promise<ShopifyCart | null | undefined> : (input: RemoveItemActionInput<T>) => Promise<ShopifyCart | null>;
|
|
5
|
+
export declare type RemoveItemActionInput<T = any> = T extends CartType.LineItem ? Partial<CartType.RemoveItemHook["actionInput"]> : CartType.RemoveItemHook["actionInput"];
|
|
6
|
+
declare const _default: <T extends CartType.LineItem | undefined = undefined>(ctx?: {
|
|
6
7
|
item?: T | undefined;
|
|
7
8
|
}) => RemoveItemFn<T>;
|
|
8
9
|
export default _default;
|
|
9
10
|
export declare const handler: {
|
|
10
11
|
fetchOptions: {
|
|
11
|
-
query: string
|
|
12
|
+
query: string & import("@graphql-typed-document-node/core").DocumentTypeDecoration<RemoveFromCartMutation, import("../utils/graphql/gen/graphql").Exact<{
|
|
13
|
+
cartId: string;
|
|
14
|
+
lineIds: string | string[];
|
|
15
|
+
}>>;
|
|
12
16
|
};
|
|
13
|
-
fetcher({ input: { itemId }, options, fetch, }: HookFetcherContext<RemoveItemHook>): Promise<
|
|
14
|
-
useHook: ({ fetch }: MutationHookContext<RemoveItemHook>) => <T extends
|
|
17
|
+
fetcher({ input: { itemId }, options, fetch, }: HookFetcherContext<CartType.RemoveItemHook>): Promise<ShopifyCart | undefined>;
|
|
18
|
+
useHook: ({ fetch }: MutationHookContext<CartType.RemoveItemHook>) => <T extends CartType.LineItem | undefined = undefined>(ctx?: {
|
|
15
19
|
item?: T | undefined;
|
|
16
20
|
}) => RemoveItemFn<T>;
|
|
17
21
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { HookFetcherContext, MutationHookContext } from "@plasmicpkgs/commerce";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
declare
|
|
2
|
+
import { CartType } from "@plasmicpkgs/commerce";
|
|
3
|
+
import { EditCartItemsMutation } from "../utils/graphql/gen/graphql";
|
|
4
|
+
export declare type UpdateItemActionInput<T = any> = T extends CartType.LineItem ? Partial<CartType.UpdateItemHook["actionInput"]> : CartType.UpdateItemHook["actionInput"];
|
|
5
|
+
declare const _default: <T extends CartType.LineItem | undefined = undefined>(ctx?: {
|
|
5
6
|
item?: T | undefined;
|
|
6
7
|
wait?: number | undefined;
|
|
7
|
-
}) => ((input: UpdateItemActionInput<T>) => Promise<
|
|
8
|
+
}) => ((input: UpdateItemActionInput<T>) => Promise<CartType.Cart | null | undefined>) & {
|
|
8
9
|
clear(): void;
|
|
9
10
|
} & {
|
|
10
11
|
flush(): void;
|
|
@@ -12,13 +13,16 @@ declare const _default: <T extends import("@plasmicpkgs/commerce/dist/types/cart
|
|
|
12
13
|
export default _default;
|
|
13
14
|
export declare const handler: {
|
|
14
15
|
fetchOptions: {
|
|
15
|
-
query: string
|
|
16
|
+
query: string & import("@graphql-typed-document-node/core").DocumentTypeDecoration<EditCartItemsMutation, import("../utils/graphql/gen/graphql").Exact<{
|
|
17
|
+
cartId: string;
|
|
18
|
+
lines: import("../utils/graphql/gen/graphql").CartLineUpdateInput | import("../utils/graphql/gen/graphql").CartLineUpdateInput[];
|
|
19
|
+
}>>;
|
|
16
20
|
};
|
|
17
|
-
fetcher({ input: { itemId, item }, options, fetch, }: HookFetcherContext<UpdateItemHook>): Promise<import("../types
|
|
18
|
-
useHook: ({ fetch }: MutationHookContext<UpdateItemHook>) => <T extends
|
|
21
|
+
fetcher({ input: { itemId, item }, options, fetch, }: HookFetcherContext<CartType.UpdateItemHook>): Promise<import("../shopify-types").ShopifyCart | undefined>;
|
|
22
|
+
useHook: ({ fetch }: MutationHookContext<CartType.UpdateItemHook>) => <T extends CartType.LineItem | undefined = undefined>(ctx?: {
|
|
19
23
|
item?: T | undefined;
|
|
20
24
|
wait?: number | undefined;
|
|
21
|
-
}) => ((input: UpdateItemActionInput<T>) => Promise<
|
|
25
|
+
}) => ((input: UpdateItemActionInput<T>) => Promise<CartType.Cart | null | undefined>) & {
|
|
22
26
|
clear(): void;
|
|
23
27
|
} & {
|
|
24
28
|
flush(): void;
|