@plasmicpkgs/commerce-swell 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.
Files changed (52) hide show
  1. package/README.md +1 -0
  2. package/dist/cart/index.d.ts +3 -0
  3. package/dist/cart/use-add-item.d.ts +5 -0
  4. package/dist/cart/use-cart.d.ts +14 -0
  5. package/dist/cart/use-remove-item.d.ts +17 -0
  6. package/dist/cart/use-update-item.d.ts +26 -0
  7. package/dist/cart/utils/checkout-create.d.ts +2 -0
  8. package/dist/cart/utils/checkout-to-cart.d.ts +5 -0
  9. package/dist/cart/utils/index.d.ts +2 -0
  10. package/dist/commerce-swell.cjs.development.js +1755 -0
  11. package/dist/commerce-swell.cjs.development.js.map +1 -0
  12. package/dist/commerce-swell.cjs.production.min.js +2 -0
  13. package/dist/commerce-swell.cjs.production.min.js.map +1 -0
  14. package/dist/commerce-swell.esm.js +1745 -0
  15. package/dist/commerce-swell.esm.js.map +1 -0
  16. package/dist/const.d.ts +4 -0
  17. package/dist/fetcher.d.ts +3 -0
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.js +8 -0
  20. package/dist/product/index.d.ts +2 -0
  21. package/dist/product/use-price.d.ts +2 -0
  22. package/dist/product/use-search.d.ts +25 -0
  23. package/dist/provider.d.ts +60 -0
  24. package/dist/registerCommerceProvider.d.ts +11 -0
  25. package/dist/registerable.d.ts +4 -0
  26. package/dist/swell.d.ts +8 -0
  27. package/dist/types/cart.d.ts +18 -0
  28. package/dist/types/checkout.d.ts +1 -0
  29. package/dist/types/common.d.ts +1 -0
  30. package/dist/types/customer.d.ts +1 -0
  31. package/dist/types/index.d.ts +12 -0
  32. package/dist/types/login.d.ts +8 -0
  33. package/dist/types/logout.d.ts +1 -0
  34. package/dist/types/page.d.ts +1 -0
  35. package/dist/types/product.d.ts +14 -0
  36. package/dist/types/signup.d.ts +1 -0
  37. package/dist/types/site.d.ts +5 -0
  38. package/dist/types/wishlist.d.ts +1 -0
  39. package/dist/types.d.ts +98 -0
  40. package/dist/utils/customer-token.d.ts +3 -0
  41. package/dist/utils/fetch-swell-api.d.ts +2 -0
  42. package/dist/utils/get-categories.d.ts +4 -0
  43. package/dist/utils/get-checkout-id.d.ts +2 -0
  44. package/dist/utils/get-search-variables.d.ts +6 -0
  45. package/dist/utils/get-sort-variables.d.ts +2 -0
  46. package/dist/utils/get-vendors.d.ts +17 -0
  47. package/dist/utils/handle-fetch-response.d.ts +8 -0
  48. package/dist/utils/handle-login.d.ts +2 -0
  49. package/dist/utils/index.d.ts +8 -0
  50. package/dist/utils/normalize.d.ts +4 -0
  51. package/dist/utils/storage.d.ts +2 -0
  52. package/package.json +42 -0
@@ -0,0 +1,8 @@
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 getVendors } from './get-vendors';
5
+ export { default as getCategories } from './get-categories';
6
+ export { default as getCheckoutId } from './get-checkout-id';
7
+ export * from './normalize';
8
+ export * from './customer-token';
@@ -0,0 +1,4 @@
1
+ import { Product } from '../types/product';
2
+ import type { Cart, SwellProduct, SwellCart } from '../types';
3
+ export declare function normalizeProduct(swellProduct: SwellProduct): Product;
4
+ export declare function normalizeCart({ id, account_id, date_created, currency, tax_included_total, items, sub_total, grand_total, discounts, }: SwellCart): Cart;
@@ -0,0 +1,2 @@
1
+ export declare const getCheckoutIdFromStorage: (token: string) => string | null;
2
+ export declare const setCheckoutIdInStorage: (token: string, id: string | number) => void;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@plasmicpkgs/commerce-swell",
3
+ "version": "0.0.1",
4
+ "description": "Plasmic registration calls for swell commerce provider",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/commerce-swell.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.3",
38
+ "@types/react": "^17.0.40",
39
+ "lodash": "^4.17.21",
40
+ "swell-js": "^3.13.0"
41
+ }
42
+ }