@daouypkgs/commerce-shopify 0.0.241

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.
Files changed (51) hide show
  1. package/README.md +1 -0
  2. package/dist/cart/use-add-item.d.ts +5 -0
  3. package/dist/cart/use-cart.d.ts +4 -0
  4. package/dist/cart/use-remove-item.d.ts +21 -0
  5. package/dist/cart/use-update-item.d.ts +30 -0
  6. package/dist/commerce-shopify.cjs.development.js +3691 -0
  7. package/dist/commerce-shopify.cjs.development.js.map +1 -0
  8. package/dist/commerce-shopify.cjs.production.min.js +2 -0
  9. package/dist/commerce-shopify.cjs.production.min.js.map +1 -0
  10. package/dist/commerce-shopify.esm.js +3679 -0
  11. package/dist/commerce-shopify.esm.js.map +1 -0
  12. package/dist/const.d.ts +4 -0
  13. package/dist/fetcher.d.ts +2 -0
  14. package/dist/graphql-config.d.ts +6 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.js +8 -0
  17. package/dist/product/use-product.d.ts +5 -0
  18. package/dist/product/use-search.d.ts +5 -0
  19. package/dist/provider.d.ts +74 -0
  20. package/dist/registerCommerceProvider.d.ts +12 -0
  21. package/dist/registerable.d.ts +6 -0
  22. package/dist/shopify-types.d.ts +5 -0
  23. package/dist/shopify.d.ts +5 -0
  24. package/dist/site/use-brands.d.ts +4 -0
  25. package/dist/site/use-categories.d.ts +4 -0
  26. package/dist/utils/cart-create.d.ts +3 -0
  27. package/dist/utils/colors.d.ts +1 -0
  28. package/dist/utils/fragments/cart.d.ts +1 -0
  29. package/dist/utils/fragments/collection.d.ts +1 -0
  30. package/dist/utils/fragments/image.d.ts +1 -0
  31. package/dist/utils/fragments/product-variant.d.ts +1 -0
  32. package/dist/utils/fragments/product.d.ts +1 -0
  33. package/dist/utils/fragments/seo.d.ts +1 -0
  34. package/dist/utils/get-cart-id.d.ts +1 -0
  35. package/dist/utils/get-search-variables.d.ts +16 -0
  36. package/dist/utils/get-sort-variables.d.ts +2 -0
  37. package/dist/utils/graphql/gen/gql.d.ts +76 -0
  38. package/dist/utils/graphql/gen/graphql.d.ts +11114 -0
  39. package/dist/utils/graphql/gen/index.d.ts +1 -0
  40. package/dist/utils/mutations/cart.d.ts +15 -0
  41. package/dist/utils/mutations/customer-activate-by-url.d.ts +4 -0
  42. package/dist/utils/normalize.d.ts +6 -0
  43. package/dist/utils/queries/get-all-collections-query.d.ts +3 -0
  44. package/dist/utils/queries/get-all-product-vendors-query.d.ts +4 -0
  45. package/dist/utils/queries/get-all-products-query.d.ts +6 -0
  46. package/dist/utils/queries/get-cart-query.d.ts +3 -0
  47. package/dist/utils/queries/get-collection-products-query.d.ts +6 -0
  48. package/dist/utils/queries/get-collection-query.d.ts +5 -0
  49. package/dist/utils/queries/get-product-query.d.ts +6 -0
  50. package/dist/utils/throw-user-errors.d.ts +4 -0
  51. package/package.json +42 -0
@@ -0,0 +1 @@
1
+ export * from "./gql";
@@ -0,0 +1,15 @@
1
+ export declare const addToCartMutation: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").AddToCartMutation, import("../graphql/gen/graphql").Exact<{
2
+ cartId: string;
3
+ lines: import("../graphql/gen/graphql").CartLineInput | import("../graphql/gen/graphql").CartLineInput[];
4
+ }>>;
5
+ export declare const createCartMutation: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").CreateCartMutation, import("../graphql/gen/graphql").Exact<{
6
+ lines?: import("../graphql/gen/graphql").CartLineInput | import("../graphql/gen/graphql").CartLineInput[] | null | undefined;
7
+ }>>;
8
+ export declare const editCartItemsMutation: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").EditCartItemsMutation, import("../graphql/gen/graphql").Exact<{
9
+ cartId: string;
10
+ lines: import("../graphql/gen/graphql").CartLineUpdateInput | import("../graphql/gen/graphql").CartLineUpdateInput[];
11
+ }>>;
12
+ export declare const removeFromCartMutation: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").RemoveFromCartMutation, import("../graphql/gen/graphql").Exact<{
13
+ cartId: string;
14
+ lineIds: string | string[];
15
+ }>>;
@@ -0,0 +1,4 @@
1
+ export declare const customerActivateByUrlMutation: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").CustomerActivateByUrlMutation, import("../graphql/gen/graphql").Exact<{
2
+ activationUrl: any;
3
+ password: string;
4
+ }>>;
@@ -0,0 +1,6 @@
1
+ import type { Product, SiteTypes } from "@daouypkgs/commerce";
2
+ import type { ShopifyCart } from "../shopify-types";
3
+ import { CartFragment, Collection, ProductFragment } from "./graphql/gen/graphql";
4
+ export declare function normalizeProduct({ id, title: name, vendor, images, variants, description, handle, priceRange, options, ...rest }: ProductFragment): Product;
5
+ export declare function normalizeCart(cart: CartFragment | null | undefined): ShopifyCart | undefined;
6
+ export declare function normalizeCategory({ title: name, handle, id, products, image, }: Collection): SiteTypes.Category;
@@ -0,0 +1,3 @@
1
+ export declare const getSiteCollectionsQuery: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetSiteCollectionsQuery, import("../graphql/gen/graphql").Exact<{
2
+ first: number;
3
+ }>>;
@@ -0,0 +1,4 @@
1
+ export declare const getAllProductVendors: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetAllProductVendorsQuery, import("../graphql/gen/graphql").Exact<{
2
+ first?: number | null | undefined;
3
+ cursor?: string | null | undefined;
4
+ }>>;
@@ -0,0 +1,6 @@
1
+ export declare const getAllProductsQuery: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetAllProductsQuery, import("../graphql/gen/graphql").Exact<{
2
+ first?: number | null | undefined;
3
+ query?: string | null | undefined;
4
+ sortKey?: import("../graphql/gen/graphql").ProductSortKeys | null | undefined;
5
+ reverse?: boolean | null | undefined;
6
+ }>>;
@@ -0,0 +1,3 @@
1
+ export declare const getCartQuery: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetCartQuery, import("../graphql/gen/graphql").Exact<{
2
+ cartId: string;
3
+ }>>;
@@ -0,0 +1,6 @@
1
+ export declare const getCollectionProductsQuery: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetProductsFromCollectionQuery, import("../graphql/gen/graphql").Exact<{
2
+ categoryId: string;
3
+ first?: number | null | undefined;
4
+ sortKey?: import("../graphql/gen/graphql").ProductCollectionSortKeys | null | undefined;
5
+ reverse?: boolean | null | undefined;
6
+ }>>;
@@ -0,0 +1,5 @@
1
+ export declare const getCollectionQueryById: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetSiteCollectionQuery, import("../graphql/gen/graphql").Exact<{
2
+ id?: string | null | undefined;
3
+ handle?: string | null | undefined;
4
+ first?: number | null | undefined;
5
+ }>>;
@@ -0,0 +1,6 @@
1
+ export declare const getProductQueryBySlug: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetProductBySlugQuery, import("../graphql/gen/graphql").Exact<{
2
+ slug: string;
3
+ }>>;
4
+ export declare const getProductQueryById: import("../graphql/gen/graphql").TypedDocumentString<import("../graphql/gen/graphql").GetProductByIdQuery, import("../graphql/gen/graphql").Exact<{
5
+ id: string;
6
+ }>>;
@@ -0,0 +1,4 @@
1
+ import { CheckoutErrorCode, CheckoutUserError, CustomerErrorCode, CustomerUserError } from "./graphql/gen/graphql";
2
+ export declare type UserErrors = Array<CheckoutUserError | CustomerUserError>;
3
+ export declare type UserErrorCode = CustomerErrorCode | CheckoutErrorCode | null | undefined;
4
+ export declare const throwUserErrors: (errors?: UserErrors | undefined) => void;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@daouypkgs/commerce-shopify",
3
+ "version": "0.0.241",
4
+ "description": "Daouy registration calls for shopify commerce provider",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/commerce-shopify.esm.js",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsdx build",
13
+ "start": "tsdx watch",
14
+ "test": "TEST_CWD=`pwd` yarn --cwd=../../.. test",
15
+ "lint": "tsdx lint",
16
+ "prepublishOnly": "npm run build",
17
+ "size": "size-limit",
18
+ "analyze": "size-limit --why",
19
+ "graphql-codegen": "graphql-codegen --config src/graphql-config.ts"
20
+ },
21
+ "devDependencies": {
22
+ "@daouy/host": "^1.0.234",
23
+ "@graphql-codegen/cli": "^5.0.3",
24
+ "@types/debounce": "^1.2.3",
25
+ "@types/js-cookie": "^3.0.1",
26
+ "@types/node": "^14.0.26",
27
+ "nock": "14.0.0",
28
+ "react": "^18.2.0",
29
+ "react-dom": "^18.2.0",
30
+ "tsdx": "^0.14.1"
31
+ },
32
+ "peerDependencies": {
33
+ "@daouy/host": "^1.0.234",
34
+ "react": ">=16.8.0"
35
+ },
36
+ "dependencies": {
37
+ "@daouypkgs/commerce": "^0.0.233",
38
+ "@types/react": "^18.0.27",
39
+ "debounce": "^1.2.1",
40
+ "js-cookie": "^3.0.5"
41
+ }
42
+ }