@kizlo/woocommerce 0.1.4 → 0.1.5

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/index.d.ts CHANGED
@@ -1469,7 +1469,7 @@ declare function woocommerce(): kizlo0.Extension<"woocommerce", {
1469
1469
  operator?: "in" | "not_in" | "and" | undefined;
1470
1470
  }[] | undefined;
1471
1471
  attributeRelation?: "in" | "and" | undefined;
1472
- catalogVisibility?: "search" | "any" | "visible" | "catalog" | "hidden" | undefined;
1472
+ catalogVisibility?: "any" | "search" | "visible" | "catalog" | "hidden" | undefined;
1473
1473
  rating?: "1" | "2" | "3" | "4" | "5" | ("1" | "2" | "3" | "4" | "5")[] | undefined;
1474
1474
  related?: string | number | undefined;
1475
1475
  } | undefined;
@@ -1677,7 +1677,7 @@ declare function woocommerce(): kizlo0.Extension<"woocommerce", {
1677
1677
  operator?: "in" | "not_in" | "and" | undefined;
1678
1678
  }[] | undefined;
1679
1679
  attributeRelation?: "in" | "and" | undefined;
1680
- catalogVisibility?: "search" | "any" | "visible" | "catalog" | "hidden" | undefined;
1680
+ catalogVisibility?: "any" | "search" | "visible" | "catalog" | "hidden" | undefined;
1681
1681
  rating?: "1" | "2" | "3" | "4" | "5" | ("1" | "2" | "3" | "4" | "5")[] | undefined;
1682
1682
  related?: string | number | undefined;
1683
1683
  ratingFilters?: string | boolean | undefined;
package/dist/index.js CHANGED
@@ -446,19 +446,7 @@ const ShippingAddress = z$1.object({
446
446
  state: z$1.string(),
447
447
  country: z$1.string()
448
448
  });
449
- const BillingAddress = z$1.object({
450
- firstName: z$1.string(),
451
- lastName: z$1.string(),
452
- phone: z$1.string(),
453
- company: z$1.string().optional(),
454
- address1: z$1.string(),
455
- address2: z$1.string().optional(),
456
- city: z$1.string(),
457
- postcode: z$1.string(),
458
- state: z$1.string(),
459
- country: z$1.string(),
460
- email: z$1.string()
461
- });
449
+ const BillingAddress = ShippingAddress.extend({ email: z$1.string() });
462
450
 
463
451
  //#endregion
464
452
  //#region src/cart/schema.ts
@@ -1471,7 +1459,6 @@ const GET_PRODUCT_ERROR_MAP = defineErrorMap({ PRODUCT_NOT_FOUND: {
1471
1459
  message: "Product not found."
1472
1460
  } });
1473
1461
  const LIST_PRODUCT_ERROR_MAP = defineErrorMap({});
1474
- const FILTER_PRODUCT_ERROR_MAP = defineErrorMap({});
1475
1462
 
1476
1463
  //#endregion
1477
1464
  //#region src/product/utils.ts
@@ -1495,22 +1482,9 @@ function deserializeProduct(data) {
1495
1482
  onSaleTo: data.date_on_sale_to ? toTimestamp(data.date_on_sale_to) : null,
1496
1483
  isInStock: data.stock_status === "instock",
1497
1484
  stock: data.stock_quantity,
1498
- images: data.images.map((item) => ({
1499
- id: item.id,
1500
- src: item.src,
1501
- name: item.name,
1502
- alt: item.alt
1503
- })),
1504
- categories: data.categories.map((category) => ({
1505
- id: category.id,
1506
- name: category.name,
1507
- slug: category.slug
1508
- })),
1509
- tags: data.tags.map((tag) => ({
1510
- id: tag.id,
1511
- name: tag.name,
1512
- slug: tag.slug
1513
- })),
1485
+ images: deserializeImages(data.images),
1486
+ categories: deserializeTermRefs(data.categories),
1487
+ tags: deserializeTermRefs(data.tags),
1514
1488
  averageRating: data.average_rating,
1515
1489
  reviewCount: data.rating_count,
1516
1490
  attributes: data.kizlo.attributes.map((item) => ({
@@ -1552,22 +1526,9 @@ function deserializeStoreProduct(data) {
1552
1526
  salePrice: +data.prices.sale_price,
1553
1527
  regularPrice: +data.prices.regular_price
1554
1528
  },
1555
- images: data.images.map((item) => ({
1556
- id: item.id,
1557
- src: item.src,
1558
- name: item.name,
1559
- alt: item.alt
1560
- })),
1561
- categories: data.categories.map((category) => ({
1562
- id: category.id,
1563
- name: category.name,
1564
- slug: category.slug
1565
- })),
1566
- tags: data.tags.map((tag) => ({
1567
- id: tag.id,
1568
- name: tag.name,
1569
- slug: tag.slug
1570
- })),
1529
+ images: deserializeImages(data.images),
1530
+ categories: deserializeTermRefs(data.categories),
1531
+ tags: deserializeTermRefs(data.tags),
1571
1532
  attributes: data.attributes.map((item) => ({
1572
1533
  id: item.id,
1573
1534
  name: item.name,
@@ -1670,6 +1631,21 @@ function serializeProductListInput(data) {
1670
1631
  search: data?.search
1671
1632
  };
1672
1633
  }
1634
+ function deserializeImages(images) {
1635
+ return images.map((item) => ({
1636
+ id: item.id,
1637
+ src: item.src,
1638
+ name: item.name,
1639
+ alt: item.alt
1640
+ }));
1641
+ }
1642
+ function deserializeTermRefs(terms) {
1643
+ return terms.map((term) => ({
1644
+ id: term.id,
1645
+ name: term.name,
1646
+ slug: term.slug
1647
+ }));
1648
+ }
1673
1649
  function toTimestamp(date) {
1674
1650
  return new Date(date).getTime();
1675
1651
  }
package/dist/test.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as kizlo0 from "kizlo";
1
+ import * as kizlo18 from "kizlo";
2
2
  import { DevPluginSource } from "kizlo/test";
3
3
 
4
4
  //#region src/test/index.d.ts
@@ -10,6 +10,6 @@ import { DevPluginSource } from "kizlo/test";
10
10
  */
11
11
  declare function woocommerce(opts?: {
12
12
  plugins?: DevPluginSource[];
13
- }): kizlo0.Fixture;
13
+ }): kizlo18.Fixture;
14
14
  //#endregion
15
15
  export { woocommerce };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@kizlo/woocommerce",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
+ "sideEffects": false,
5
6
  "description": "WooCommerce extension for Kizlo.",
6
7
  "keywords": [
7
8
  "wordpress",
@@ -48,7 +49,7 @@
48
49
  "access": "public"
49
50
  },
50
51
  "dependencies": {
51
- "@kizlo/shared": "0.3.0",
52
+ "@kizlo/shared": "0.3.1",
52
53
  "jose": "6.1.0",
53
54
  "zod": "^4.3.6"
54
55
  },