@plasmicpkgs/commerce-shopify 0.0.1
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/README.md +1 -0
- package/dist/cart/index.d.ts +4 -0
- package/dist/cart/use-add-item.d.ts +5 -0
- package/dist/cart/use-cart.d.ts +13 -0
- package/dist/cart/use-remove-item.d.ts +17 -0
- package/dist/cart/use-update-item.d.ts +19 -0
- package/dist/commerce-shopify.cjs.development.js +2179 -0
- package/dist/commerce-shopify.cjs.development.js.map +1 -0
- package/dist/commerce-shopify.cjs.production.min.js +2 -0
- package/dist/commerce-shopify.cjs.production.min.js.map +1 -0
- package/dist/commerce-shopify.esm.js +2169 -0
- package/dist/commerce-shopify.esm.js.map +1 -0
- package/dist/const.d.ts +4 -0
- package/dist/fetcher.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/dist/product/use-price.d.ts +2 -0
- package/dist/product/use-search.d.ts +26 -0
- package/dist/provider.d.ts +52 -0
- package/dist/registerCommerceProvider.d.ts +11 -0
- package/dist/registerable.d.ts +4 -0
- package/dist/shopify.d.ts +4 -0
- package/dist/types/cart.d.ts +25 -0
- package/dist/types/checkout.d.ts +1 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/customer.d.ts +3 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/login.d.ts +6 -0
- package/dist/types/logout.d.ts +1 -0
- package/dist/types/page.d.ts +8 -0
- package/dist/types/product.d.ts +1 -0
- package/dist/types/signup.d.ts +1 -0
- package/dist/types/site.d.ts +1 -0
- package/dist/types/wishlist.d.ts +1 -0
- package/dist/utils/checkout-create.d.ts +4 -0
- package/dist/utils/checkout-to-cart.d.ts +9 -0
- package/dist/utils/colors.d.ts +1 -0
- package/dist/utils/customer-token.d.ts +3 -0
- package/dist/utils/get-brands.d.ts +11 -0
- package/dist/utils/get-categories.d.ts +3 -0
- package/dist/utils/get-checkout-id.d.ts +2 -0
- package/dist/utils/get-search-variables.d.ts +16 -0
- package/dist/utils/get-sort-variables.d.ts +2 -0
- package/dist/utils/handle-account-activation.d.ts +3 -0
- package/dist/utils/handle-fetch-response.d.ts +5 -0
- package/dist/utils/handle-login.d.ts +4 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/mutations/associate-customer-with-checkout.d.ts +2 -0
- package/dist/utils/mutations/checkout-create.d.ts +2 -0
- package/dist/utils/mutations/checkout-line-item-add.d.ts +2 -0
- package/dist/utils/mutations/checkout-line-item-remove.d.ts +2 -0
- package/dist/utils/mutations/checkout-line-item-update.d.ts +2 -0
- package/dist/utils/mutations/customer-access-token-create.d.ts +2 -0
- package/dist/utils/mutations/customer-access-token-delete.d.ts +2 -0
- package/dist/utils/mutations/customer-activate-by-url.d.ts +2 -0
- package/dist/utils/mutations/customer-activate.d.ts +2 -0
- package/dist/utils/mutations/customer-create.d.ts +2 -0
- package/dist/utils/mutations/index.d.ts +9 -0
- package/dist/utils/normalize.d.ts +4 -0
- package/dist/utils/queries/get-all-collections-query.d.ts +2 -0
- package/dist/utils/queries/get-all-pages-query.d.ts +2 -0
- package/dist/utils/queries/get-all-product-vendors-query.d.ts +2 -0
- package/dist/utils/queries/get-all-products-paths-query.d.ts +2 -0
- package/dist/utils/queries/get-all-products-query.d.ts +3 -0
- package/dist/utils/queries/get-checkout-query.d.ts +3 -0
- package/dist/utils/queries/get-collection-products-query.d.ts +2 -0
- package/dist/utils/queries/get-customer-id-query.d.ts +2 -0
- package/dist/utils/queries/get-customer-query.d.ts +2 -0
- package/dist/utils/queries/get-page-query.d.ts +2 -0
- package/dist/utils/queries/get-product-query.d.ts +2 -0
- package/dist/utils/queries/get-site-info-query.d.ts +2 -0
- package/dist/utils/queries/index.d.ts +11 -0
- package/dist/utils/throw-user-errors.d.ts +5 -0
- package/package.json +41 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as handleFetchResponse } from './handle-fetch-response';
|
|
2
|
+
export { default as getSearchVariables } from './get-search-variables';
|
|
3
|
+
export { default as getSortVariables } from './get-sort-variables';
|
|
4
|
+
export { default as getCheckoutId } from './get-checkout-id';
|
|
5
|
+
export { default as checkoutCreate } from './checkout-create';
|
|
6
|
+
export { default as checkoutToCart } from './checkout-to-cart';
|
|
7
|
+
export * from './queries';
|
|
8
|
+
export * from './normalize';
|
|
9
|
+
export * from './mutations';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const associateCustomerWithCheckoutMutation = "\nmutation associateCustomerWithCheckout($checkoutId: ID!, $customerAccessToken: String!) {\n checkoutCustomerAssociateV2(checkoutId: $checkoutId, customerAccessToken: $customerAccessToken) {\n checkout {\n id\n }\n checkoutUserErrors {\n code\n field\n message\n }\n customer {\n id\n }\n }\n }\n";
|
|
2
|
+
export default associateCustomerWithCheckoutMutation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const customerAccessTokenCreateMutation = "\n mutation customerAccessTokenCreate($input: CustomerAccessTokenCreateInput!) {\n customerAccessTokenCreate(input: $input) {\n customerAccessToken {\n accessToken\n expiresAt\n }\n customerUserErrors {\n code\n field\n message\n }\n }\n }\n";
|
|
2
|
+
export default customerAccessTokenCreateMutation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const customerAccessTokenDeleteMutation = "\n mutation customerAccessTokenDelete($customerAccessToken: String!) {\n customerAccessTokenDelete(customerAccessToken: $customerAccessToken) {\n deletedAccessToken\n deletedCustomerAccessTokenId\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
2
|
+
export default customerAccessTokenDeleteMutation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const customerActivateByUrlMutation = "\n mutation customerActivateByUrl($activationUrl: URL!, $password: String!) {\n customerActivateByUrl(activationUrl: $activationUrl, password: $password) {\n customer {\n id\n }\n customerAccessToken {\n accessToken\n expiresAt\n }\n customerUserErrors {\n code\n field\n message\n }\n }\n }\n";
|
|
2
|
+
export default customerActivateByUrlMutation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const customerActivateMutation = "\n mutation customerActivate($id: ID!, $input: CustomerActivateInput!) {\n customerActivate(id: $id, input: $input) {\n customer {\n id\n }\n customerAccessToken {\n accessToken\n expiresAt\n }\n customerUserErrors {\n code\n field\n message\n }\n }\n }\n";
|
|
2
|
+
export default customerActivateMutation;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as customerCreateMutation } from './customer-create';
|
|
2
|
+
export { default as checkoutCreateMutation } from './checkout-create';
|
|
3
|
+
export { default as checkoutLineItemAddMutation } from './checkout-line-item-add';
|
|
4
|
+
export { default as checkoutLineItemUpdateMutation } from './checkout-line-item-update';
|
|
5
|
+
export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove';
|
|
6
|
+
export { default as customerAccessTokenCreateMutation } from './customer-access-token-create';
|
|
7
|
+
export { default as customerAccessTokenDeleteMutation } from './customer-access-token-delete';
|
|
8
|
+
export { default as customerActivateMutation } from './customer-activate';
|
|
9
|
+
export { default as customerActivateByUrlMutation } from './customer-activate-by-url';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Product } from '@plasmicpkgs/commerce';
|
|
2
|
+
import type { Cart } from '../types/cart';
|
|
3
|
+
export declare function normalizeProduct({ id, title: name, vendor, images, variants, description, descriptionHtml, handle, priceRange, options, metafields, ...rest }: any): Product;
|
|
4
|
+
export declare function normalizeCart(checkout: any): Cart;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const getAllProductVendors = "\n query getAllProductVendors($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n vendor\n }\n cursor\n }\n }\n }\n";
|
|
2
|
+
export default getAllProductVendors;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const getAllProductsPathsQuery = "\n query getAllProductPaths($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n handle\n }\n cursor\n }\n }\n }\n";
|
|
2
|
+
export default getAllProductsPathsQuery;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const productConnectionFragment = "\n fragment productConnection on ProductConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n vendor\n handle\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n options {\n id\n name\n values\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n }\n }\n";
|
|
2
|
+
declare const getAllProductsQuery: string;
|
|
3
|
+
export default getAllProductsQuery;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const checkoutDetailsFragment = "\n fragment checkoutDetails on Checkout {\n id\n webUrl\n subtotalPriceV2 {\n amount\n currencyCode\n }\n totalTaxV2 {\n amount\n currencyCode\n }\n totalPriceV2 {\n amount\n currencyCode\n }\n completedAt\n createdAt\n taxesIncluded\n lineItems(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n variant {\n id\n sku\n title\n selectedOptions {\n name\n value\n }\n image {\n originalSrc\n altText\n width\n height\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n product {\n handle\n }\n }\n quantity\n }\n }\n }\n }\n";
|
|
2
|
+
declare const getCheckoutQuery: string;
|
|
3
|
+
export default getCheckoutQuery;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const getCustomerQuery = "\n query getCustomer($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n id\n firstName\n lastName\n displayName\n email\n phone\n tags\n acceptsMarketing\n createdAt\n }\n }\n";
|
|
2
|
+
export default getCustomerQuery;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const getProductQuery = "\n query getProductBySlug($slug: String!) {\n productByHandle(handle: $slug) {\n id\n handle\n availableForSale\n title\n productType\n vendor\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n }\n";
|
|
2
|
+
export default getProductQuery;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as getSiteCollectionsQuery } from './get-all-collections-query';
|
|
2
|
+
export { default as getProductQuery } from './get-product-query';
|
|
3
|
+
export { default as getAllProductsQuery } from './get-all-products-query';
|
|
4
|
+
export { default as getAllProductsPathtsQuery } from './get-all-products-paths-query';
|
|
5
|
+
export { default as getAllProductVendors } from './get-all-product-vendors-query';
|
|
6
|
+
export { default as getCollectionProductsQuery } from './get-collection-products-query';
|
|
7
|
+
export { default as getCheckoutQuery } from './get-checkout-query';
|
|
8
|
+
export { default as getAllPagesQuery } from './get-all-pages-query';
|
|
9
|
+
export { default as getPageQuery } from './get-page-query';
|
|
10
|
+
export { default as getCustomerQuery } from './get-customer-query';
|
|
11
|
+
export { default as getSiteInfoQuery } from './get-site-info-query';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CheckoutErrorCode, CheckoutUserError, CustomerErrorCode, CustomerUserError } from '../schema';
|
|
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;
|
|
5
|
+
export default throwUserErrors;
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plasmicpkgs/commerce-shopify",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Plasmic 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": "tsdx test --passWithNoTests",
|
|
15
|
+
"lint": "tsdx lint",
|
|
16
|
+
"prepare": "tsdx build",
|
|
17
|
+
"size": "size-limit",
|
|
18
|
+
"analyze": "size-limit --why"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@plasmicapp/host": "1.0.21",
|
|
22
|
+
"@size-limit/preset-small-lib": "^4.11.0",
|
|
23
|
+
"@types/js-cookie": "^3.0.1",
|
|
24
|
+
"@types/lodash.debounce": "^4.0.6",
|
|
25
|
+
"@types/node": "^14.0.26",
|
|
26
|
+
"react": "^17.0.2",
|
|
27
|
+
"react-dom": "^17.0.2",
|
|
28
|
+
"size-limit": "^4.11.0",
|
|
29
|
+
"tsdx": "^0.14.1",
|
|
30
|
+
"typescript": "^3.9.7"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@plasmicapp/host": "^1.0.0",
|
|
34
|
+
"react": ">=16.8.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@plasmicpkgs/commerce": "^0.0.2",
|
|
38
|
+
"@types/react": "^17.0.40",
|
|
39
|
+
"lodash": "^4.17.21"
|
|
40
|
+
}
|
|
41
|
+
}
|