@plasmicpkgs/commerce-commercetools 0.0.197 → 0.0.199

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 (37) hide show
  1. package/dist/cart/index.d.ts +2 -2
  2. package/dist/cart/use-add-item.d.ts +5 -5
  3. package/dist/cart/use-cart.d.ts +5 -5
  4. package/dist/cart/use-remove-item.d.ts +11 -11
  5. package/dist/cart/use-update-item.d.ts +11 -11
  6. package/dist/client.d.ts +3 -3
  7. package/dist/commerce-commercetools.cjs.development.js +8 -7
  8. package/dist/commerce-commercetools.cjs.development.js.map +1 -1
  9. package/dist/commerce-commercetools.cjs.production.min.js +1 -1
  10. package/dist/commerce-commercetools.cjs.production.min.js.map +1 -1
  11. package/dist/commerce-commercetools.esm.js +8 -7
  12. package/dist/commerce-commercetools.esm.js.map +1 -1
  13. package/dist/commercetools.d.ts +5 -5
  14. package/dist/const.d.ts +4 -4
  15. package/dist/fetcher.d.ts +3 -3
  16. package/dist/index.d.ts +5 -5
  17. package/dist/product/use-product.d.ts +8 -8
  18. package/dist/product/use-search.d.ts +12 -12
  19. package/dist/provider.d.ts +49 -49
  20. package/dist/registerCommerceProvider.d.ts +11 -11
  21. package/dist/registerable.d.ts +6 -6
  22. package/dist/site/use-brands.d.ts +5 -5
  23. package/dist/site/use-categories.d.ts +5 -5
  24. package/dist/types/cart.d.ts +24 -24
  25. package/dist/types/index.d.ts +4 -4
  26. package/dist/types/product.d.ts +14 -14
  27. package/dist/types/site.d.ts +7 -7
  28. package/dist/utils/cart-active.d.ts +4 -4
  29. package/dist/utils/cart-cookie.d.ts +3 -3
  30. package/dist/utils/cart-create.d.ts +4 -4
  31. package/dist/utils/common.d.ts +2 -2
  32. package/dist/utils/cookies.d.ts +3 -3
  33. package/dist/utils/get-sort-variables.d.ts +2 -2
  34. package/dist/utils/index.d.ts +7 -7
  35. package/dist/utils/localized-string.d.ts +2 -2
  36. package/dist/utils/normalize.d.ts +21 -21
  37. package/package.json +8 -8
@@ -1,24 +1,24 @@
1
- import { CartType as Core } from '@plasmicpkgs/commerce';
2
- export declare type SelectedOption = Core.SelectedOption;
3
- export declare type LineItem = Core.LineItem;
4
- export declare type ProductVariant = Core.ProductVariant;
5
- export declare type CartItemBody = Core.CartItemBody;
6
- /**
7
- * Extend core cart types
8
- */
9
- export declare type Cart = Core.Cart & {
10
- lineItems: Core.LineItem[];
11
- url?: string;
12
- };
13
- export declare type CartTypes = Core.CartTypes;
14
- export declare type CartHooks = Core.CartHooks<CartTypes>;
15
- export declare type GetCartHook = CartHooks['getCart'];
16
- export declare type AddItemHook = CartHooks['addItem'];
17
- export declare type UpdateItemHook = CartHooks['updateItem'];
18
- export declare type RemoveItemHook = CartHooks['removeItem'];
19
- export declare type CartSchema = Core.CartSchema<CartTypes>;
20
- export declare type CartHandlers = Core.CartHandlers<CartTypes>;
21
- export declare type GetCartHandler = CartHandlers['getCart'];
22
- export declare type AddItemHandler = CartHandlers['addItem'];
23
- export declare type UpdateItemHandler = CartHandlers['updateItem'];
24
- export declare type RemoveItemHandler = CartHandlers['removeItem'];
1
+ import { CartType as Core } from '@plasmicpkgs/commerce';
2
+ export type SelectedOption = Core.SelectedOption;
3
+ export type LineItem = Core.LineItem;
4
+ export type ProductVariant = Core.ProductVariant;
5
+ export type CartItemBody = Core.CartItemBody;
6
+ /**
7
+ * Extend core cart types
8
+ */
9
+ export type Cart = Core.Cart & {
10
+ lineItems: Core.LineItem[];
11
+ url?: string;
12
+ };
13
+ export type CartTypes = Core.CartTypes;
14
+ export type CartHooks = Core.CartHooks<CartTypes>;
15
+ export type GetCartHook = CartHooks['getCart'];
16
+ export type AddItemHook = CartHooks['addItem'];
17
+ export type UpdateItemHook = CartHooks['updateItem'];
18
+ export type RemoveItemHook = CartHooks['removeItem'];
19
+ export type CartSchema = Core.CartSchema<CartTypes>;
20
+ export type CartHandlers = Core.CartHandlers<CartTypes>;
21
+ export type GetCartHandler = CartHandlers['getCart'];
22
+ export type AddItemHandler = CartHandlers['addItem'];
23
+ export type UpdateItemHandler = CartHandlers['updateItem'];
24
+ export type RemoveItemHandler = CartHandlers['removeItem'];
@@ -1,4 +1,4 @@
1
- import * as Cart from './cart';
2
- import * as Product from './product';
3
- import * as Site from './site';
4
- export type { Cart, Product, Site, };
1
+ import * as Cart from './cart';
2
+ import * as Product from './product';
3
+ import * as Site from './site';
4
+ export type { Cart, Product, Site, };
@@ -1,14 +1,14 @@
1
- import { ProductTypes as Core } from '@plasmicpkgs/commerce';
2
- export declare type ProductImage = Core.ProductImage;
3
- export declare type ProductPrice = Core.ProductPrice;
4
- export declare type ProductOption = Core.ProductOption;
5
- export declare type ProductOptionValues = Core.ProductOptionValues;
6
- export declare type ProductVariant = Core.ProductVariant;
7
- export declare type Product = Core.Product;
8
- export declare type SearchProductsBody = Core.SearchProductsBody;
9
- export declare type ProductTypes = Core.ProductTypes;
10
- export declare type SearchProductsHook = Core.SearchProductsHook;
11
- export declare type ProductsSchema = Core.ProductsSchema;
12
- export declare type GetAllProductPathsOperation = Core.GetAllProductPathsOperation;
13
- export declare type GetAllProductsOperation = Core.GetAllProductsOperation;
14
- export declare type GetProductOperation = Core.GetProductOperation;
1
+ import { ProductTypes as Core } from '@plasmicpkgs/commerce';
2
+ export type ProductImage = Core.ProductImage;
3
+ export type ProductPrice = Core.ProductPrice;
4
+ export type ProductOption = Core.ProductOption;
5
+ export type ProductOptionValues = Core.ProductOptionValues;
6
+ export type ProductVariant = Core.ProductVariant;
7
+ export type Product = Core.Product;
8
+ export type SearchProductsBody = Core.SearchProductsBody;
9
+ export type ProductTypes = Core.ProductTypes;
10
+ export type SearchProductsHook = Core.SearchProductsHook;
11
+ export type ProductsSchema = Core.ProductsSchema;
12
+ export type GetAllProductPathsOperation = Core.GetAllProductPathsOperation;
13
+ export type GetAllProductsOperation = Core.GetAllProductsOperation;
14
+ export type GetProductOperation = Core.GetProductOperation;
@@ -1,7 +1,7 @@
1
- import { SiteTypes } from "@plasmicpkgs/commerce";
2
- export declare type Category = SiteTypes.Category;
3
- export declare type Brand = SiteTypes.Brand;
4
- export declare type SiteTypes = SiteTypes.SiteTypes;
5
- export declare type GetSiteInfoOperation = SiteTypes.GetSiteInfoOperation;
6
- export declare type GetCategoriesHook = SiteTypes.GetCategoriesHook;
7
- export declare type GetBrandsHook = SiteTypes.GetBrandsHook;
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;
@@ -1,4 +1,4 @@
1
- import { Cart } from '@commercetools/platform-sdk';
2
- import { FetcherOptions } from '@plasmicpkgs/commerce';
3
- declare const getActiveCart: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>) => Promise<Cart | undefined>;
4
- export default getActiveCart;
1
+ import { Cart } from '@commercetools/platform-sdk';
2
+ import { FetcherOptions } from '@plasmicpkgs/commerce';
3
+ declare const getActiveCart: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>) => Promise<Cart | undefined>;
4
+ export default getActiveCart;
@@ -1,3 +1,3 @@
1
- export declare const getCartId: () => string | undefined;
2
- export declare const setCartId: (id: string) => string | undefined;
3
- export declare const removeCartCookie: () => void;
1
+ export declare const getCartId: () => string | undefined;
2
+ export declare const setCartId: (id: string) => string | undefined;
3
+ export declare const removeCartCookie: () => void;
@@ -1,4 +1,4 @@
1
- import { Cart } from '@commercetools/platform-sdk';
2
- import { FetcherOptions } from '@plasmicpkgs/commerce';
3
- declare const createCart: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>) => Promise<Cart | undefined>;
4
- export default createCart;
1
+ import { Cart } from '@commercetools/platform-sdk';
2
+ import { FetcherOptions } from '@plasmicpkgs/commerce';
3
+ declare const createCart: (fetch: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>) => Promise<Cart | undefined>;
4
+ export default createCart;
@@ -1,2 +1,2 @@
1
- export declare const withoutNils: <T>(xs: (T | null | undefined)[]) => T[];
2
- export declare const dedup: <T>(xs: T[]) => T[];
1
+ export declare const withoutNils: <T>(xs: (T | null | undefined)[]) => T[];
2
+ export declare const dedup: <T>(xs: T[]) => T[];
@@ -1,3 +1,3 @@
1
- export declare const getCookies: <T>(name: string) => T | undefined;
2
- export declare const setCookies: (name: string, value: any) => string | undefined;
3
- export declare const removeCookies: (name: string) => void;
1
+ export declare const getCookies: <T>(name: string) => T | undefined;
2
+ export declare const setCookies: (name: string, value: any) => string | undefined;
3
+ export declare const removeCookies: (name: string) => void;
@@ -1,2 +1,2 @@
1
- declare const getSortVariables: (sort?: string | undefined, isCategory?: boolean) => string | undefined;
2
- export default getSortVariables;
1
+ declare const getSortVariables: (sort?: string, isCategory?: boolean) => string | undefined;
2
+ export default getSortVariables;
@@ -1,7 +1,7 @@
1
- export { default as getSortVariables } from './get-sort-variables';
2
- export { default as createCart } from './cart-create';
3
- export { default as getActiveCart } from './cart-active';
4
- export { default as getLocalizedString } from './localized-string';
5
- export * from './normalize';
6
- export * from './common';
7
- export * from './cart-cookie';
1
+ export { default as getSortVariables } from './get-sort-variables';
2
+ export { default as createCart } from './cart-create';
3
+ export { default as getActiveCart } from './cart-active';
4
+ export { default as getLocalizedString } from './localized-string';
5
+ export * from './normalize';
6
+ export * from './common';
7
+ export * from './cart-cookie';
@@ -1,2 +1,2 @@
1
- declare const getLocalizedString: (localizedString: Record<string, string> | undefined, locale: string | undefined) => string | undefined;
2
- export default getLocalizedString;
1
+ declare const getLocalizedString: (localizedString: Record<string, string> | undefined, locale: string | undefined) => string | undefined;
2
+ export default getLocalizedString;
@@ -1,21 +1,21 @@
1
- import { Category } from '../types/site';
2
- import { ProductProjection, Category as CommercetoolsCategory, Cart as CommercetoolsCart, Customer, ShoppingList, ProductData } from '@commercetools/platform-sdk';
3
- import { Cart } from '../types/cart';
4
- import { Product } from '../types/product';
5
- export declare const normalizeProduct: (product: ProductProjection | (ProductData & {
6
- id: string;
7
- }), locale: string) => Product;
8
- export declare const normalizeCart: (cart: CommercetoolsCart, locale: string) => Cart;
9
- export declare const normalizeCategory: (category: CommercetoolsCategory, locale: string) => Category;
10
- export declare const normalizeCustomer: (customer: Customer) => {
11
- firstName: string | undefined;
12
- lastName: string | undefined;
13
- email: string;
14
- };
15
- export declare const normalizeWishlist: (wishlist: ShoppingList) => {
16
- items: {
17
- id: string;
18
- product_id: string;
19
- variant_id: number;
20
- }[];
21
- };
1
+ import { Category } from '../types/site';
2
+ import { ProductProjection, Category as CommercetoolsCategory, Cart as CommercetoolsCart, Customer, ShoppingList, ProductData } from '@commercetools/platform-sdk';
3
+ import { Cart } from '../types/cart';
4
+ import { Product } from '../types/product';
5
+ export declare const normalizeProduct: (product: ProductProjection | (ProductData & {
6
+ id: string;
7
+ }), locale: string) => Product;
8
+ export declare const normalizeCart: (cart: CommercetoolsCart, locale: string) => Cart;
9
+ export declare const normalizeCategory: (category: CommercetoolsCategory, locale: string) => Category;
10
+ export declare const normalizeCustomer: (customer: Customer) => {
11
+ firstName: string | undefined;
12
+ lastName: string | undefined;
13
+ email: string;
14
+ };
15
+ export declare const normalizeWishlist: (wishlist: ShoppingList) => {
16
+ items: {
17
+ id: string;
18
+ product_id: string;
19
+ variant_id: number;
20
+ }[];
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/commerce-commercetools",
3
- "version": "0.0.197",
3
+ "version": "0.0.199",
4
4
  "description": "Plasmic registration calls for commercetools commerce provider",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,18 +11,18 @@
11
11
  "scripts": {
12
12
  "build": "tsdx build",
13
13
  "start": "tsdx watch",
14
- "test": "TEST_CWD=`pwd` yarn --cwd=../../.. test --passWithNoTests",
14
+ "test": "TEST_CWD=`pwd` pnpm -w test --passWithNoTests",
15
15
  "lint": "tsdx lint",
16
16
  "prepublishOnly": "npm run build",
17
17
  "size": "size-limit",
18
18
  "analyze": "size-limit --why"
19
19
  },
20
20
  "devDependencies": {
21
- "@plasmicapp/host": "2.0.6",
22
- "@plasmicapp/query": "0.1.84",
21
+ "@plasmicapp/host": "2.0.8",
22
+ "@plasmicapp/query": "0.1.86",
23
23
  "@types/debounce": "^1.2.4",
24
- "@types/js-cookie": "^3.0.1",
25
- "@types/node": "^14.0.26",
24
+ "@types/js-cookie": "^3.0.6",
25
+ "@types/node": "^14.18.63",
26
26
  "@types/react": "^18",
27
27
  "react": "^18.2.0",
28
28
  "react-dom": "^18.2.0",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@commercetools/platform-sdk": "^2.8.0",
38
38
  "@commercetools/sdk-client-v2": "^2.2.2",
39
- "@plasmicpkgs/commerce": "0.0.247",
39
+ "@plasmicpkgs/commerce": "0.0.249",
40
40
  "debounce": "^2.0.0",
41
41
  "js-cookie": "^3.0.5",
42
42
  "qs": "^6.11.0"
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "baa35758ccd16c32259942faebbcbd62d5f174a4"
47
+ "gitHead": "f2542f3c07f280e033323f363580af5dd8dc534b"
48
48
  }