@reactionary/core 0.3.8 → 0.3.10

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 (106) hide show
  1. package/decorators/reactionary.decorator.js +1 -1
  2. package/package.json +1 -1
  3. package/schemas/capabilities.schema.js +1 -1
  4. package/schemas/errors/generic.error.js +1 -1
  5. package/schemas/errors/invalid-input.error.js +1 -1
  6. package/schemas/errors/invalid-output.error.js +1 -1
  7. package/schemas/errors/not-found.error.js +1 -1
  8. package/schemas/models/base.model.js +11 -11
  9. package/schemas/models/cart.model.js +1 -1
  10. package/schemas/models/category.model.js +1 -1
  11. package/schemas/models/checkout.model.js +2 -2
  12. package/schemas/models/cost.model.js +1 -1
  13. package/schemas/models/currency.model.js +1 -1
  14. package/schemas/models/identifiers.model.js +16 -16
  15. package/schemas/models/identity.model.js +1 -1
  16. package/schemas/models/inventory.model.js +1 -1
  17. package/schemas/models/order-search.model.js +1 -1
  18. package/schemas/models/order.model.js +1 -1
  19. package/schemas/models/payment.model.js +2 -2
  20. package/schemas/models/price.model.js +3 -3
  21. package/schemas/models/product-recommendations.model.js +5 -4
  22. package/schemas/models/product-search.model.js +2 -2
  23. package/schemas/models/product.model.js +24 -24
  24. package/schemas/models/profile.model.js +1 -1
  25. package/schemas/models/shipping-method.model.js +8 -8
  26. package/schemas/models/store.model.js +1 -1
  27. package/schemas/mutations/analytics/index.js +1 -1
  28. package/schemas/mutations/analytics/product-add-to-cart.mutation.js +1 -1
  29. package/schemas/mutations/analytics/product-details-view.mutation.js +1 -1
  30. package/schemas/mutations/analytics/product-summary-click.mutation.js +1 -1
  31. package/schemas/mutations/analytics/product-summary-view.mutation.js +1 -1
  32. package/schemas/mutations/analytics/purchase.mutation.js +1 -1
  33. package/schemas/mutations/base.mutation.js +1 -1
  34. package/schemas/mutations/cart.mutation.js +1 -1
  35. package/schemas/mutations/checkout.mutation.js +1 -1
  36. package/schemas/mutations/identity.mutation.js +1 -1
  37. package/schemas/mutations/inventory.mutation.js +1 -1
  38. package/schemas/mutations/price.mutation.js +1 -1
  39. package/schemas/mutations/product.mutation.js +1 -1
  40. package/schemas/mutations/profile.mutation.js +3 -3
  41. package/schemas/mutations/search.mutation.js +1 -1
  42. package/schemas/queries/analytics.query.js +1 -1
  43. package/schemas/queries/base.query.js +1 -1
  44. package/schemas/queries/category.query.js +1 -1
  45. package/schemas/queries/product-associations.query.js +2 -2
  46. package/schemas/queries/product-recommendations.query.js +12 -12
  47. package/schemas/queries/product-search.query.js +3 -3
  48. package/schemas/queries/product.query.js +1 -1
  49. package/schemas/queries/store.query.js +1 -1
  50. package/schemas/session.schema.js +6 -6
  51. package/src/cache/cache.interface.d.ts +1 -1
  52. package/src/cache/memory-cache.d.ts +1 -1
  53. package/src/cache/noop-cache.d.ts +1 -1
  54. package/src/cache/redis-cache.d.ts +1 -1
  55. package/src/decorators/reactionary.decorator.d.ts +1 -1
  56. package/src/schemas/capabilities.schema.d.ts +1 -1
  57. package/src/schemas/errors/generic.error.d.ts +1 -1
  58. package/src/schemas/errors/invalid-input.error.d.ts +1 -1
  59. package/src/schemas/errors/invalid-output.error.d.ts +1 -1
  60. package/src/schemas/errors/not-found.error.d.ts +1 -1
  61. package/src/schemas/models/analytics.model.d.ts +1 -1
  62. package/src/schemas/models/base.model.d.ts +1 -1
  63. package/src/schemas/models/cart.model.d.ts +1 -1
  64. package/src/schemas/models/category.model.d.ts +1 -1
  65. package/src/schemas/models/checkout.model.d.ts +1 -1
  66. package/src/schemas/models/cost.model.d.ts +1 -1
  67. package/src/schemas/models/currency.model.d.ts +1 -1
  68. package/src/schemas/models/identifiers.model.d.ts +1 -1
  69. package/src/schemas/models/identity.model.d.ts +1 -1
  70. package/src/schemas/models/inventory.model.d.ts +1 -1
  71. package/src/schemas/models/order-search.model.d.ts +17 -17
  72. package/src/schemas/models/order.model.d.ts +1 -1
  73. package/src/schemas/models/payment.model.d.ts +1 -1
  74. package/src/schemas/models/price.model.d.ts +1 -1
  75. package/src/schemas/models/product-recommendations.model.d.ts +37 -36
  76. package/src/schemas/models/product-search.model.d.ts +1 -1
  77. package/src/schemas/models/product.model.d.ts +1 -1
  78. package/src/schemas/models/profile.model.d.ts +1 -1
  79. package/src/schemas/models/shipping-method.model.d.ts +1 -1
  80. package/src/schemas/models/store.model.d.ts +1 -1
  81. package/src/schemas/mutations/analytics/index.d.ts +63 -63
  82. package/src/schemas/mutations/analytics/product-add-to-cart.mutation.d.ts +10 -10
  83. package/src/schemas/mutations/analytics/product-details-view.mutation.d.ts +3 -3
  84. package/src/schemas/mutations/analytics/product-summary-click.mutation.d.ts +1 -1
  85. package/src/schemas/mutations/analytics/product-summary-view.mutation.d.ts +1 -1
  86. package/src/schemas/mutations/analytics/purchase.mutation.d.ts +34 -34
  87. package/src/schemas/mutations/base.mutation.d.ts +1 -1
  88. package/src/schemas/mutations/cart.mutation.d.ts +1 -1
  89. package/src/schemas/mutations/checkout.mutation.d.ts +1 -1
  90. package/src/schemas/mutations/identity.mutation.d.ts +1 -1
  91. package/src/schemas/mutations/profile.mutation.d.ts +1 -1
  92. package/src/schemas/queries/base.query.d.ts +1 -1
  93. package/src/schemas/queries/category.query.d.ts +1 -1
  94. package/src/schemas/queries/checkout.query.d.ts +1 -1
  95. package/src/schemas/queries/identity.query.d.ts +1 -1
  96. package/src/schemas/queries/inventory.query.d.ts +1 -1
  97. package/src/schemas/queries/order.query.d.ts +1 -1
  98. package/src/schemas/queries/price.query.d.ts +1 -1
  99. package/src/schemas/queries/product-associations.query.d.ts +7 -7
  100. package/src/schemas/queries/product-recommendations.query.d.ts +31 -31
  101. package/src/schemas/queries/product-search.query.d.ts +1 -1
  102. package/src/schemas/queries/product.query.d.ts +1 -1
  103. package/src/schemas/queries/profile.query.d.ts +1 -1
  104. package/src/schemas/queries/store.query.d.ts +1 -1
  105. package/src/schemas/session.schema.d.ts +1 -1
  106. package/src/zod-utils.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import { SpanStatusCode, trace } from "@opentelemetry/api";
2
- import { z } from "zod";
2
+ import * as z from "zod";
3
3
  import { getReactionaryMeter } from "../metrics/metrics.js";
4
4
  import { error, success } from "../schemas/result.js";
5
5
  const TRACER_NAME = "@reactionary";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/core",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const CapabilitiesSchema = z.looseObject({
3
3
  product: z.boolean(),
4
4
  productSearch: z.boolean(),
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const GenericErrorSchema = z.looseObject({
3
3
  type: z.literal("Generic"),
4
4
  message: z.string().nonempty()
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const InvalidInputErrorSchema = z.looseObject({
3
3
  type: z.literal("InvalidInput"),
4
4
  error: z.string()
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const InvalidOutputErrorSchema = z.looseObject({
3
3
  type: z.literal("InvalidOutput"),
4
4
  error: z.string()
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const NotFoundErrorSchema = z.looseObject({
3
3
  type: z.literal("NotFound"),
4
4
  identifier: z.unknown()
@@ -1,23 +1,23 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const BaseModelSchema = z.looseObject({});
3
3
  const PaginationOptionsSchema = z.looseObject({
4
- pageNumber: z.number().default(1).describe("Current page number, starting from 1"),
5
- pageSize: z.number().min(1).max(50).default(20).describe("Number of items per page")
4
+ pageNumber: z.number().default(1).meta({ description: "Current page number, starting from 1" }),
5
+ pageSize: z.number().min(1).max(50).default(20).meta({ description: "Number of items per page" })
6
6
  });
7
7
  function createPaginatedResponseSchema(itemSchema) {
8
8
  return z.object({
9
- pageNumber: z.number().min(1).describe("Current page number, starting from 1"),
10
- pageSize: z.number().min(1).describe("Number of items per page"),
11
- totalCount: z.number().min(0).describe("Total number of items available"),
12
- totalPages: z.number().min(0).describe("Total number of pages available"),
9
+ pageNumber: z.number().min(1).meta({ description: "Current page number, starting from 1" }),
10
+ pageSize: z.number().min(1).meta({ description: "Number of items per page" }),
11
+ totalCount: z.number().min(0).meta({ description: "Total number of items available" }),
12
+ totalPages: z.number().min(0).meta({ description: "Total number of pages available" }),
13
13
  items: z.array(itemSchema)
14
14
  });
15
15
  }
16
16
  const ImageSchema = z.looseObject({
17
- sourceUrl: z.string().default("").describe("The original source URL of the image. Pass this through your image resizing and transcoding service to get the desired size, and generate thumbnails as needed"),
18
- altText: z.string().default("").describe("Alternative text for the image, for accessibility purposes. Must always be set, and non-empty"),
19
- width: z.number().optional().describe("Width of the original image, in pixels, if known"),
20
- height: z.number().optional().describe("Height of the original image, in pixels, if known")
17
+ sourceUrl: z.string().default("").meta({ description: "The original source URL of the image. Pass this through your image resizing and transcoding service to get the desired size, and generate thumbnails as needed" }),
18
+ altText: z.string().default("").meta({ description: "Alternative text for the image, for accessibility purposes. Must always be set, and non-empty" }),
19
+ width: z.number().optional().meta({ description: "Width of the original image, in pixels, if known" }),
20
+ height: z.number().optional().meta({ description: "Height of the original image, in pixels, if known" })
21
21
  });
22
22
  export {
23
23
  BaseModelSchema,
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, ProductIdentifierSchema, ProductVariantIdentifierSchema } from "../models/identifiers.model.js";
3
3
  import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model.js";
4
4
  import { BaseModelSchema } from "./base.model.js";
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from "./base.model.js";
3
3
  import { CategoryIdentifierSchema } from "./identifiers.model.js";
4
4
  const CategorySchema = BaseModelSchema.extend({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema } from "./base.model.js";
3
3
  import { CartIdentifierSchema, CheckoutIdentifierSchema, CheckoutItemIdentifierSchema, OrderIdentifierSchema, ProductVariantIdentifierSchema } from "./identifiers.model.js";
4
4
  import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model.js";
@@ -36,7 +36,7 @@ const CheckoutSchema = BaseModelSchema.extend({
36
36
  * Indicates if the checkout has all the required information to be finalized into an order.
37
37
  * This does not mean it will succeed, as there may be issues with payment or shipping, but all required information is present.
38
38
  */
39
- readyForFinalization: z.boolean().default(false).describe("Indicates if the checkout has all the required information to be finalized into an order. This does not mean it will succeed, as there may be issues with payment or shipping, but all required information is present.")
39
+ readyForFinalization: z.boolean().default(false).meta({ description: "Indicates if the checkout has all the required information to be finalized into an order. This does not mean it will succeed, as there may be issues with payment or shipping, but all required information is present." })
40
40
  });
41
41
  export {
42
42
  CheckoutItemSchema,
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { MonetaryAmountSchema } from "./price.model.js";
3
3
  const CostBreakDownSchema = z.looseObject({
4
4
  totalTax: MonetaryAmountSchema.default(() => MonetaryAmountSchema.parse({})).describe("The amount of tax paid on the cart. This may include VAT, GST, sales tax, etc."),
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const CurrencySchema = z.enum([
3
3
  "AED",
4
4
  "AFN",
@@ -1,7 +1,7 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { PaginationOptionsSchema } from "./base.model.js";
3
- const OrderStatusSchema = z.enum(["AwaitingPayment", "ReleasedToFulfillment", "Shipped", "Cancelled"]).describe("The current status of the order.");
4
- const OrderInventoryStatusSchema = z.enum(["NotAllocated", "Allocated", "Backordered", "Preordered"]).describe("The inventory release status of the order.");
3
+ const OrderStatusSchema = z.enum(["AwaitingPayment", "ReleasedToFulfillment", "Shipped", "Cancelled"]).meta({ description: "The current status of the order." });
4
+ const OrderInventoryStatusSchema = z.enum(["NotAllocated", "Allocated", "Backordered", "Preordered"]).meta({ description: "The inventory release status of the order." });
5
5
  const FacetIdentifierSchema = z.looseObject({
6
6
  key: z.string()
7
7
  });
@@ -13,17 +13,17 @@ const ProductVariantIdentifierSchema = z.looseObject({
13
13
  sku: z.string()
14
14
  });
15
15
  const ProductAttributeIdentifierSchema = z.looseObject({
16
- key: z.string().describe("The unique identifier for the product attribute.")
16
+ key: z.string().meta({ description: "The unique identifier for the product attribute." })
17
17
  });
18
18
  const ProductAttributeValueIdentifierSchema = z.looseObject({
19
- key: z.string().describe("The unique identifier for the product attribute value.")
19
+ key: z.string().meta({ description: "The unique identifier for the product attribute value." })
20
20
  });
21
21
  const ProductOptionIdentifierSchema = z.looseObject({
22
- key: z.string().describe("The unique identifier for the product option.")
22
+ key: z.string().meta({ description: "The unique identifier for the product option." })
23
23
  });
24
24
  const ProductOptionValueIdentifierSchema = z.looseObject({
25
25
  option: ProductOptionIdentifierSchema,
26
- key: z.string().describe('The value of the product option, e.g., "Red" or "Large".')
26
+ key: z.string().meta({ description: 'The value of the product option, e.g., "Red" or "Large".' })
27
27
  });
28
28
  const ProductIdentifierSchema = z.looseObject({
29
29
  key: z.string()
@@ -90,20 +90,20 @@ const ProductRecommendationIdentifierSchema = z.looseObject({
90
90
  algorithm: z.string()
91
91
  });
92
92
  const ProductSearchIdentifierSchema = z.looseObject({
93
- term: z.string().describe("The search term used to find products."),
94
- facets: z.array(FacetValueIdentifierSchema).describe("The facets applied to filter the search results."),
95
- filters: z.array(z.string()).describe("Additional filters applied to the search results."),
93
+ term: z.string().meta({ description: "The search term used to find products." }),
94
+ facets: z.array(FacetValueIdentifierSchema).meta({ description: "The facets applied to filter the search results." }),
95
+ filters: z.array(z.string()).meta({ description: "Additional filters applied to the search results." }),
96
96
  paginationOptions: PaginationOptionsSchema.describe("Pagination options for the search results."),
97
97
  categoryFilter: FacetValueIdentifierSchema.optional().describe("An optional category filter applied to the search results.")
98
98
  });
99
99
  const OrderSearchIdentifierSchema = z.looseObject({
100
- term: z.string().describe("The search term used to find orders. Not all providers may support term-based search for orders."),
101
- partNumber: z.array(z.string()).optional().describe("An optional list part number to filter orders by specific products. Will be ANDed together."),
102
- orderStatus: z.array(OrderStatusSchema).optional().describe("An optional list of order statuses to filter the search results."),
100
+ term: z.string().meta({ description: "The search term used to find orders. Not all providers may support term-based search for orders." }),
101
+ partNumber: z.array(z.string()).optional().meta({ description: "An optional list part number to filter orders by specific products. Will be ANDed together." }),
102
+ orderStatus: z.array(OrderStatusSchema).optional().meta({ description: "An optional list of order statuses to filter the search results." }),
103
103
  user: IdentityIdentifierSchema.optional().describe("An optional user ID to filter orders by specific users. Mostly for b2b usecases with hierachial order access."),
104
- startDate: z.string().optional().describe("An optional start date to filter orders from a specific date onwards. ISO8601"),
105
- endDate: z.string().optional().describe("An optional end date to filter orders up to a specific date. ISO8601"),
106
- filters: z.array(z.string()).describe("Additional filters applied to the search results."),
104
+ startDate: z.string().optional().meta({ description: "An optional start date to filter orders from a specific date onwards. ISO8601" }),
105
+ endDate: z.string().optional().meta({ description: "An optional end date to filter orders up to a specific date. ISO8601" }),
106
+ filters: z.array(z.string()).meta({ description: "Additional filters applied to the search results." }),
107
107
  paginationOptions: PaginationOptionsSchema.describe("Pagination options for the search results.")
108
108
  });
109
109
  export {
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema } from "./base.model.js";
3
3
  import { IdentityIdentifierSchema } from "./identifiers.model.js";
4
4
  const AnonymousIdentitySchema = BaseModelSchema.extend({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema } from "./base.model.js";
3
3
  import { InventoryIdentifierSchema } from "./identifiers.model.js";
4
4
  const InventoryStatusSchema = z.enum(["inStock", "outOfStock", "onBackOrder", "preOrder", "discontinued"]);
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema, createPaginatedResponseSchema } from "./base.model.js";
3
3
  import { IdentityIdentifierSchema, OrderIdentifierSchema, OrderInventoryStatusSchema, OrderSearchIdentifierSchema, OrderStatusSchema } from "./identifiers.model.js";
4
4
  import { MonetaryAmountSchema } from "./price.model.js";
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { CartIdentifierSchema, IdentityIdentifierSchema, OrderIdentifierSchema, OrderInventoryStatusSchema, OrderItemIdentifierSchema, OrderStatusSchema, ProductVariantIdentifierSchema } from "../models/identifiers.model.js";
3
3
  import { BaseModelSchema } from "./base.model.js";
4
4
  import { AddressSchema } from "./profile.model.js";
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema, ImageSchema } from "./base.model.js";
3
3
  import { PaymentInstructionIdentifierSchema, PaymentMethodIdentifierSchema } from "./identifiers.model.js";
4
4
  import { MonetaryAmountSchema } from "./price.model.js";
@@ -17,7 +17,7 @@ const PaymentInstructionSchema = BaseModelSchema.extend({
17
17
  identifier: PaymentInstructionIdentifierSchema,
18
18
  amount: MonetaryAmountSchema,
19
19
  paymentMethod: PaymentMethodIdentifierSchema,
20
- protocolData: z.array(PaymentProtocolDataSchema).describe("Additional protocol-specific data for processing the payment."),
20
+ protocolData: z.array(PaymentProtocolDataSchema).meta({ description: "Additional protocol-specific data for processing the payment." }),
21
21
  status: PaymentStatusSchema
22
22
  });
23
23
  export {
@@ -1,13 +1,13 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema } from "./base.model.js";
3
3
  import { PriceIdentifierSchema } from "./identifiers.model.js";
4
4
  import { CurrencySchema } from "./currency.model.js";
5
5
  const MonetaryAmountSchema = z.looseObject({
6
- value: z.number().describe("The monetary amount in decimal-precision."),
6
+ value: z.number().meta({ description: "The monetary amount in decimal-precision." }),
7
7
  currency: CurrencySchema.describe("The currency associated with the amount, as a ISO 4217 standardized code.")
8
8
  });
9
9
  const TieredPriceSchema = z.looseObject({
10
- minimumQuantity: z.number().describe("The minimum quantity required to be eligible for the tiered price."),
10
+ minimumQuantity: z.number().meta({ description: "The minimum quantity required to be eligible for the tiered price." }),
11
11
  price: MonetaryAmountSchema.describe("The monetary amount for the tiered price.")
12
12
  });
13
13
  const PriceSchema = BaseModelSchema.extend({
@@ -1,15 +1,16 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { ProductIdentifierSchema, ProductRecommendationIdentifierSchema, ProductVariantIdentifierSchema } from "./identifiers.model.js";
3
3
  import { ProductSearchResultItemSchema } from "./product-search.model.js";
4
- const BaseProductRecommendationSchema = z.looseObject({
4
+ import { BaseModelSchema } from "./base.model.js";
5
+ const BaseProductRecommendationSchema = BaseModelSchema.extend({
5
6
  recommendationIdentifier: ProductRecommendationIdentifierSchema.describe("The identifier for the product recommendation, which includes a key and an algorithm and any other vendor specific/instance specific data ")
6
7
  });
7
8
  const ProductRecommendationIdOnlySchema = BaseProductRecommendationSchema.extend({
8
- recommendationReturnType: z.literal("idOnly").describe("The type of recommendation return"),
9
+ recommendationReturnType: z.literal("idOnly").meta({ description: "The type of recommendation return" }),
9
10
  product: ProductIdentifierSchema.describe("The identifier for the recommended product.")
10
11
  });
11
12
  const ProductRecommendationProductSearchResultItemSchema = BaseProductRecommendationSchema.extend({
12
- recommendationReturnType: z.literal("productSearchResultItem").describe("The type of recommendation return"),
13
+ recommendationReturnType: z.literal("productSearchResultItem").meta({ description: "The type of recommendation return" }),
13
14
  product: ProductSearchResultItemSchema.describe("The recommended product, including its identifier, name, slug, and variants. This can be used to display the recommended product directly on the frontend without needing to make an additional request to fetch the product details.")
14
15
  });
15
16
  const ProductRecommendationSchema = z.discriminatedUnion("recommendationReturnType", [
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, ProductSearchIdentifierSchema, ProductVariantIdentifierSchema } from "./identifiers.model.js";
3
3
  import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from "./base.model.js";
4
4
  import { ProductVariantOptionSchema } from "./product.model.js";
@@ -11,7 +11,7 @@ const ProductSearchResultItemSchema = BaseModelSchema.extend({
11
11
  identifier: ProductIdentifierSchema,
12
12
  name: z.string(),
13
13
  slug: z.string(),
14
- variants: z.array(ProductSearchResultItemVariantSchema).describe("A list of variants associated with the product in the search results. If exactly one is present, you can use add-to-cart directly from PLP. If none are present, you must direct to PDP. If mulitple are present, and no options are set, you must direct to PDP. If multiple are present, and they have options, you can render swatches on PLP and allow customer to flip between variants.")
14
+ variants: z.array(ProductSearchResultItemVariantSchema).meta({ description: "A list of variants associated with the product in the search results. If exactly one is present, you can use add-to-cart directly from PLP. If none are present, you must direct to PDP. If mulitple are present, and no options are set, you must direct to PDP. If multiple are present, and they have options, you can render swatches on PLP and allow customer to flip between variants." })
15
15
  });
16
16
  const ProductSearchResultFacetValueSchema = z.looseObject({
17
17
  identifier: FacetValueIdentifierSchema,
@@ -1,34 +1,34 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { CategoryIdentifierSchema, ProductAttributeIdentifierSchema, ProductAttributeValueIdentifierSchema, ProductIdentifierSchema, ProductOptionIdentifierSchema, ProductOptionValueIdentifierSchema, ProductVariantIdentifierSchema } from "./identifiers.model.js";
3
3
  import { BaseModelSchema, ImageSchema } from "./base.model.js";
4
4
  const ProductOptionValueSchema = z.looseObject({
5
5
  identifier: ProductOptionValueIdentifierSchema.describe("The unique identifier for the product option value."),
6
- label: z.string().describe("The human-friendly label for the product option value.")
6
+ label: z.string().meta({ description: "The human-friendly label for the product option value." })
7
7
  });
8
8
  const ProductOptionSchema = z.looseObject({
9
9
  identifier: ProductOptionIdentifierSchema.describe("The unique identifier for the option."),
10
- name: z.string().describe("The name of the option, e.g., Size or Color."),
11
- values: z.array(ProductOptionValueSchema).describe("A list of possible values for the option.")
10
+ name: z.string().meta({ description: "The name of the option, e.g., Size or Color." }),
11
+ values: z.array(ProductOptionValueSchema).meta({ description: "A list of possible values for the option." })
12
12
  });
13
13
  const ProductVariantOptionSchema = z.looseObject({
14
14
  identifier: ProductOptionIdentifierSchema.describe("The unique identifier for the option."),
15
- name: z.string().describe("The name of the option, e.g., Size or Color."),
15
+ name: z.string().meta({ description: "The name of the option, e.g., Size or Color." }),
16
16
  value: ProductOptionValueSchema.describe("The unique identifier for the option value.")
17
17
  });
18
18
  const ProductVariantSchema = z.looseObject({
19
19
  identifier: ProductVariantIdentifierSchema.describe("The unique identifier for the variant. Often its SKU"),
20
20
  name: z.string(),
21
- images: z.array(ImageSchema).describe("A list of images associated with the product variant"),
22
- ean: z.string().describe("The European Article Number identifier for the product variant"),
23
- gtin: z.string().describe("The Global Trade Item Number identifier for the product variant"),
24
- upc: z.string().describe("The Universal Product Code identifier for the product variant"),
25
- barcode: z.string().describe("The barcode identifier for the product variant"),
26
- options: z.array(ProductVariantOptionSchema).describe("A list of option identifiers that define this variant")
21
+ images: z.array(ImageSchema).meta({ description: "A list of images associated with the product variant" }),
22
+ ean: z.string().meta({ description: "The European Article Number identifier for the product variant" }),
23
+ gtin: z.string().meta({ description: "The Global Trade Item Number identifier for the product variant" }),
24
+ upc: z.string().meta({ description: "The Universal Product Code identifier for the product variant" }),
25
+ barcode: z.string().meta({ description: "The barcode identifier for the product variant" }),
26
+ options: z.array(ProductVariantOptionSchema).meta({ description: "A list of option identifiers that define this variant" })
27
27
  });
28
28
  const ProductAttributeValueSchema = z.looseObject({
29
29
  identifier: ProductAttributeValueIdentifierSchema.describe("The unique identifier for the attribute value."),
30
- value: z.string().describe("The value of the attribute. Typically a language independent string"),
31
- label: z.string().describe("The human friendly label for the attribute value. Typically a language dependent string")
30
+ value: z.string().meta({ description: "The value of the attribute. Typically a language independent string" }),
31
+ label: z.string().meta({ description: "The human friendly label for the attribute value. Typically a language dependent string" })
32
32
  });
33
33
  const ProductAttributeSchema = z.looseObject({
34
34
  identifier: ProductAttributeIdentifierSchema.describe("The unique identifier for the attribute, also typically used as the facet key if the attribute is filterable."),
@@ -38,18 +38,18 @@ const ProductAttributeSchema = z.looseObject({
38
38
  });
39
39
  const ProductSchema = BaseModelSchema.extend({
40
40
  identifier: ProductIdentifierSchema,
41
- name: z.string().describe("The name of the product"),
42
- slug: z.string().describe("The URL-friendly identifier for the product"),
43
- description: z.string().describe("A brief description of the product"),
44
- longDescription: z.string().describe("A detailed description of the product"),
45
- brand: z.string().describe("The brand associated with the product"),
46
- manufacturer: z.string().describe("The manufacturer of the product"),
47
- parentCategories: z.array(CategoryIdentifierSchema).describe("A list of parent categories the product belongs to"),
48
- published: z.boolean().describe("Indicates whether the product is published and visible to customers"),
49
- sharedAttributes: z.array(ProductAttributeSchema).describe("A list of technical attributes associated with the product"),
50
- options: z.array(ProductOptionSchema).describe("A list of options available for the product, such as size or color. Can be empty if product is single-sku"),
41
+ name: z.string().meta({ description: "The name of the product" }),
42
+ slug: z.string().meta({ description: "The URL-friendly identifier for the product" }),
43
+ description: z.string().meta({ description: "A brief description of the product" }),
44
+ longDescription: z.string().meta({ description: "A detailed description of the product" }),
45
+ brand: z.string().meta({ description: "The brand associated with the product" }),
46
+ manufacturer: z.string().meta({ description: "The manufacturer of the product" }),
47
+ parentCategories: z.array(CategoryIdentifierSchema).meta({ description: "A list of parent categories the product belongs to" }),
48
+ published: z.boolean().meta({ description: "Indicates whether the product is published and visible to customers" }),
49
+ sharedAttributes: z.array(ProductAttributeSchema).meta({ description: "A list of technical attributes associated with the product" }),
50
+ options: z.array(ProductOptionSchema).meta({ description: "A list of options available for the product, such as size or color. Can be empty if product is single-sku" }),
51
51
  mainVariant: ProductVariantSchema.describe("The primary SKU for the product"),
52
- variants: z.array(ProductVariantSchema).default([]).describe("A list of all SKUs for the product. Can be empty or omitted if product is single-sku")
52
+ variants: z.array(ProductVariantSchema).default([]).meta({ description: "A list of all SKUs for the product. Can be empty or omitted if product is single-sku" })
53
53
  }).describe("A product is a wrapper around sellable items. It contains all the shared information for a set of SKUs. All products have at least one SKU, but can potentially have hundreds.");
54
54
  export {
55
55
  ProductAttributeSchema,
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { AddressIdentifierSchema, IdentityIdentifierSchema } from "./identifiers.model.js";
3
3
  import { BaseModelSchema } from "./base.model.js";
4
4
  const AddressSchema = BaseModelSchema.extend({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { ShippingMethodIdentifierSchema } from "./identifiers.model.js";
3
3
  import { MonetaryAmountSchema } from "./price.model.js";
4
4
  import { BaseModelSchema, ImageSchema } from "./base.model.js";
@@ -10,10 +10,10 @@ const PickupPointSchema = z.looseObject({
10
10
  name: z.string(),
11
11
  description: z.string(),
12
12
  address: AddressSchema,
13
- openingHours: z.string().optional().describe('The opening hours of the pickup point, if applicable. This could be a string like "Mon-Fri 9am-5pm".'),
14
- contactPhone: z.string().optional().describe("The contact phone number for the pickup point, if applicable."),
15
- contactEmail: z.string().optional().describe("The contact email for the pickup point, if applicable."),
16
- instructions: z.string().optional().describe("Any special instructions for picking up from this point.")
13
+ openingHours: z.string().optional().meta({ description: 'The opening hours of the pickup point, if applicable. This could be a string like "Mon-Fri 9am-5pm".' }),
14
+ contactPhone: z.string().optional().meta({ description: "The contact phone number for the pickup point, if applicable." }),
15
+ contactEmail: z.string().optional().meta({ description: "The contact email for the pickup point, if applicable." }),
16
+ instructions: z.string().optional().meta({ description: "Any special instructions for picking up from this point." })
17
17
  });
18
18
  const ShippingMethodSchema = z.looseObject({
19
19
  identifier: ShippingMethodIdentifierSchema,
@@ -26,9 +26,9 @@ const ShippingMethodSchema = z.looseObject({
26
26
  });
27
27
  const ShippingInstructionSchema = BaseModelSchema.extend({
28
28
  shippingMethod: ShippingMethodIdentifierSchema,
29
- pickupPoint: z.string().describe("An optional pickup point for the shipping method. This could be a physical store, a locker, or similar. If not set, it means home delivery to the shipping address."),
30
- instructions: z.string().describe("Optional instructions for the shipping. This could be delivery instructions, or similar."),
31
- consentForUnattendedDelivery: z.boolean().describe("Indicates if the customer has given consent for unattended delivery, if applicable.")
29
+ pickupPoint: z.string().meta({ description: "An optional pickup point for the shipping method. This could be a physical store, a locker, or similar. If not set, it means home delivery to the shipping address." }),
30
+ instructions: z.string().meta({ description: "Optional instructions for the shipping. This could be delivery instructions, or similar." }),
31
+ consentForUnattendedDelivery: z.boolean().meta({ description: "Indicates if the customer has given consent for unattended delivery, if applicable." })
32
32
  });
33
33
  export {
34
34
  PickupPointSchema,
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseModelSchema } from "./base.model.js";
3
3
  import {
4
4
  FulfillmentCenterIdentifierSchema,
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { AnalyticsMutationProductAddToCartEventSchema } from "./product-add-to-cart.mutation.js";
3
3
  import { AnalyticsMutationProductDetailsViewEventSchema } from "./product-details-view.mutation.js";
4
4
  import { AnalyticsMutationProductSummaryClickEventSchema } from "./product-summary-click.mutation.js";
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import {
3
3
  ProductSearchIdentifierSchema,
4
4
  ProductIdentifierSchema
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { ProductIdentifierSchema } from "../../models/identifiers.model.js";
3
3
  import { BaseMutationSchema } from "../base.mutation.js";
4
4
  const AnalyticsMutationProductDetailsViewEventSchema = BaseMutationSchema.extend({
@@ -3,7 +3,7 @@ import {
3
3
  ProductSearchIdentifierSchema
4
4
  } from "../../models/identifiers.model.js";
5
5
  import { BaseMutationSchema } from "../base.mutation.js";
6
- import { z } from "zod";
6
+ import * as z from "zod";
7
7
  const AnalyticsMutationProductSummaryClickEventSchema = BaseMutationSchema.extend({
8
8
  event: z.literal("product-summary-click"),
9
9
  product: ProductIdentifierSchema,
@@ -3,7 +3,7 @@ import {
3
3
  ProductSearchIdentifierSchema
4
4
  } from "../../models/identifiers.model.js";
5
5
  import { BaseMutationSchema } from "../base.mutation.js";
6
- import { z } from "zod";
6
+ import * as z from "zod";
7
7
  const AnalyticsMutationProductSummaryViewEventSchema = BaseMutationSchema.extend({
8
8
  event: z.literal("product-summary-view"),
9
9
  source: z.discriminatedUnion("type", [
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseMutationSchema } from "../base.mutation.js";
3
3
  import { OrderSchema } from "../../models/order.model.js";
4
4
  const AnalyticsMutationPurchaseEventSchema = BaseMutationSchema.extend({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const BaseMutationSchema = z.looseObject({});
3
3
  export {
4
4
  BaseMutationSchema
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseMutationSchema } from "./base.mutation.js";
3
3
  import { CartIdentifierSchema, CartItemIdentifierSchema, PaymentMethodIdentifierSchema, ShippingMethodIdentifierSchema, ProductVariantIdentifierSchema } from "../models/identifiers.model.js";
4
4
  import { AddressSchema } from "../models/profile.model.js";
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { CartIdentifierSchema, AddressSchema, PaymentInstructionIdentifierSchema, PaymentInstructionSchema, ShippingInstructionSchema, CartSchema } from "../models/index.js";
3
3
  import { BaseMutationSchema } from "./base.mutation.js";
4
4
  const CheckoutMutationInitiateCheckoutSchema = BaseMutationSchema.extend({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseMutationSchema } from "./base.mutation.js";
3
3
  const IdentityMutationLoginSchema = BaseMutationSchema.extend({
4
4
  username: z.string(),
@@ -1 +1 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
@@ -1 +1 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
@@ -1 +1 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
@@ -1,11 +1,11 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseMutationSchema } from "./base.mutation.js";
3
3
  import { AddressIdentifierSchema, IdentityIdentifierSchema } from "../models/identifiers.model.js";
4
4
  import { AddressSchema } from "../models/profile.model.js";
5
5
  const ProfileMutationUpdateSchema = BaseMutationSchema.extend({
6
6
  identifier: IdentityIdentifierSchema,
7
- email: z.email().describe("The main contact email of the profile"),
8
- phone: z.string().describe("The main phone number of the profile")
7
+ email: z.email().meta({ description: "The main contact email of the profile" }),
8
+ phone: z.string().meta({ description: "The main phone number of the profile" })
9
9
  });
10
10
  const ProfileMutationAddShippingAddressSchema = BaseMutationSchema.extend({
11
11
  identifier: IdentityIdentifierSchema,
@@ -1 +1 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
@@ -1 +1 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  const BaseQuerySchema = z.looseObject({});
3
3
  export {
4
4
  BaseQuerySchema
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { CategoryIdentifierSchema } from "../models/identifiers.model.js";
3
3
  import { BaseQuerySchema } from "./base.query.js";
4
4
  import { PaginationOptionsSchema } from "../models/base.model.js";
@@ -1,10 +1,10 @@
1
- import z from "zod";
1
+ import * as z from "zod";
2
2
  import { BaseQuerySchema } from "./base.query.js";
3
3
  import { ProductIdentifierSchema, ProductVariantIdentifierSchema } from "../models/identifiers.model.js";
4
4
  import { CartItemSchema } from "../models/cart.model.js";
5
5
  const ProductAssociationsGetAccessoriesQuerySchema = BaseQuerySchema.extend({
6
6
  forProductVariant: ProductVariantIdentifierSchema.describe("The product variant identifier for which to get accessory recommendations. The provider should return recommendations that are relevant to this product, e.g., products that are frequently bought together, products that are similar in style or category, or products that are popular among users with similar preferences."),
7
- numberOfAccessories: z.number().min(1).max(12).describe("The number of accessory recommendations requested. The provider may return fewer than this number, but should not return more.")
7
+ numberOfAccessories: z.number().min(1).max(12).meta({ description: "The number of accessory recommendations requested. The provider may return fewer than this number, but should not return more." })
8
8
  });
9
9
  const ProductAssociationsGetSparepartsQuerySchema = BaseQuerySchema.extend({
10
10
  forProductVariant: ProductVariantIdentifierSchema.describe("The product variant identifier for which to get similar item recommendations. The provider should return recommendations that are relevant to this product, e.g., products that are frequently bought together, products that are similar in style or category, or products that are popular among users with similar preferences.")