@ecomiq/core 0.1.0

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 (68) hide show
  1. package/README.md +42 -0
  2. package/dist/api.cjs +99 -0
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +52 -0
  5. package/dist/api.d.ts +52 -0
  6. package/dist/api.js +93 -0
  7. package/dist/api.js.map +1 -0
  8. package/dist/client.cjs +1344 -0
  9. package/dist/client.cjs.map +1 -0
  10. package/dist/client.d.cts +82 -0
  11. package/dist/client.d.ts +82 -0
  12. package/dist/client.js +1341 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/index.cjs +1611 -0
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/index.d.cts +1109 -0
  17. package/dist/index.d.ts +1109 -0
  18. package/dist/index.js +1450 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/models/collections.cjs +20 -0
  21. package/dist/models/collections.cjs.map +1 -0
  22. package/dist/models/collections.d.cts +56 -0
  23. package/dist/models/collections.d.ts +56 -0
  24. package/dist/models/collections.js +17 -0
  25. package/dist/models/collections.js.map +1 -0
  26. package/dist/models/geo.cjs +62 -0
  27. package/dist/models/geo.cjs.map +1 -0
  28. package/dist/models/geo.d.cts +279 -0
  29. package/dist/models/geo.d.ts +279 -0
  30. package/dist/models/geo.js +48 -0
  31. package/dist/models/geo.js.map +1 -0
  32. package/dist/models/products.cjs +212 -0
  33. package/dist/models/products.cjs.map +1 -0
  34. package/dist/models/products.d.cts +1421 -0
  35. package/dist/models/products.d.ts +1421 -0
  36. package/dist/models/products.js +187 -0
  37. package/dist/models/products.js.map +1 -0
  38. package/dist/models/search.cjs +200 -0
  39. package/dist/models/search.cjs.map +1 -0
  40. package/dist/models/search.d.cts +51 -0
  41. package/dist/models/search.d.ts +51 -0
  42. package/dist/models/search.js +196 -0
  43. package/dist/models/search.js.map +1 -0
  44. package/dist/models/settings.cjs +285 -0
  45. package/dist/models/settings.cjs.map +1 -0
  46. package/dist/models/settings.d.cts +7039 -0
  47. package/dist/models/settings.d.ts +7039 -0
  48. package/dist/models/settings.js +239 -0
  49. package/dist/models/settings.js.map +1 -0
  50. package/dist/models/storefront-cart.cjs +148 -0
  51. package/dist/models/storefront-cart.cjs.map +1 -0
  52. package/dist/models/storefront-cart.d.cts +747 -0
  53. package/dist/models/storefront-cart.d.ts +747 -0
  54. package/dist/models/storefront-cart.js +133 -0
  55. package/dist/models/storefront-cart.js.map +1 -0
  56. package/dist/models/storefront-checkout.cjs +307 -0
  57. package/dist/models/storefront-checkout.cjs.map +1 -0
  58. package/dist/models/storefront-checkout.d.cts +4122 -0
  59. package/dist/models/storefront-checkout.d.ts +4122 -0
  60. package/dist/models/storefront-checkout.js +288 -0
  61. package/dist/models/storefront-checkout.js.map +1 -0
  62. package/dist/models/storefront-reviews.cjs +223 -0
  63. package/dist/models/storefront-reviews.cjs.map +1 -0
  64. package/dist/models/storefront-reviews.d.cts +147 -0
  65. package/dist/models/storefront-reviews.d.ts +147 -0
  66. package/dist/models/storefront-reviews.js +218 -0
  67. package/dist/models/storefront-reviews.js.map +1 -0
  68. package/package.json +109 -0
@@ -0,0 +1,147 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const StorefrontReviewSchema: z.ZodObject<{
4
+ id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
5
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
6
+ isVerifiedPurchase: z.ZodBoolean;
7
+ rating: z.ZodNumber;
8
+ title: z.ZodNullable<z.ZodString>;
9
+ content: z.ZodString;
10
+ reviewerName: z.ZodNullable<z.ZodString>;
11
+ createdOn: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ id: string;
14
+ productId: string;
15
+ isVerifiedPurchase: boolean;
16
+ rating: number;
17
+ title: string | null;
18
+ content: string;
19
+ reviewerName: string | null;
20
+ createdOn: string;
21
+ }, {
22
+ id: string | number;
23
+ productId: string | number;
24
+ isVerifiedPurchase: boolean;
25
+ rating: number;
26
+ title: string | null;
27
+ content: string;
28
+ reviewerName: string | null;
29
+ createdOn: string;
30
+ }>;
31
+ declare const StorefrontReviewsSchema: z.ZodObject<{
32
+ data: z.ZodArray<z.ZodObject<{
33
+ id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
34
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
35
+ isVerifiedPurchase: z.ZodBoolean;
36
+ rating: z.ZodNumber;
37
+ title: z.ZodNullable<z.ZodString>;
38
+ content: z.ZodString;
39
+ reviewerName: z.ZodNullable<z.ZodString>;
40
+ createdOn: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string;
43
+ productId: string;
44
+ isVerifiedPurchase: boolean;
45
+ rating: number;
46
+ title: string | null;
47
+ content: string;
48
+ reviewerName: string | null;
49
+ createdOn: string;
50
+ }, {
51
+ id: string | number;
52
+ productId: string | number;
53
+ isVerifiedPurchase: boolean;
54
+ rating: number;
55
+ title: string | null;
56
+ content: string;
57
+ reviewerName: string | null;
58
+ createdOn: string;
59
+ }>, "many">;
60
+ hasNextPage: z.ZodBoolean;
61
+ nextCursor: z.ZodNullable<z.ZodString>;
62
+ totalCount: z.ZodNullable<z.ZodNumber>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ totalCount: number | null;
65
+ data: {
66
+ id: string;
67
+ productId: string;
68
+ isVerifiedPurchase: boolean;
69
+ rating: number;
70
+ title: string | null;
71
+ content: string;
72
+ reviewerName: string | null;
73
+ createdOn: string;
74
+ }[];
75
+ hasNextPage: boolean;
76
+ nextCursor: string | null;
77
+ }, {
78
+ totalCount: number | null;
79
+ data: {
80
+ id: string | number;
81
+ productId: string | number;
82
+ isVerifiedPurchase: boolean;
83
+ rating: number;
84
+ title: string | null;
85
+ content: string;
86
+ reviewerName: string | null;
87
+ createdOn: string;
88
+ }[];
89
+ hasNextPage: boolean;
90
+ nextCursor: string | null;
91
+ }>;
92
+ declare const ListProductReviewsParamsSchema: z.ZodObject<{
93
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
94
+ limit: z.ZodOptional<z.ZodNumber>;
95
+ cursor: z.ZodOptional<z.ZodString>;
96
+ search: z.ZodOptional<z.ZodString>;
97
+ sortBy: z.ZodOptional<z.ZodEnum<["rating", "createdOn"]>>;
98
+ sortDirection: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
99
+ rating: z.ZodOptional<z.ZodNumber>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ productId: string;
102
+ search?: string | undefined;
103
+ limit?: number | undefined;
104
+ rating?: number | undefined;
105
+ cursor?: string | undefined;
106
+ sortBy?: "rating" | "createdOn" | undefined;
107
+ sortDirection?: "asc" | "desc" | undefined;
108
+ }, {
109
+ productId: string | number;
110
+ search?: string | undefined;
111
+ limit?: number | undefined;
112
+ rating?: number | undefined;
113
+ cursor?: string | undefined;
114
+ sortBy?: "rating" | "createdOn" | undefined;
115
+ sortDirection?: "asc" | "desc" | undefined;
116
+ }>;
117
+ declare const CreateProductReviewParamsSchema: z.ZodObject<{
118
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
119
+ rating: z.ZodNumber;
120
+ content: z.ZodString;
121
+ title: z.ZodOptional<z.ZodString>;
122
+ reviewerName: z.ZodString;
123
+ reviewerEmail: z.ZodString;
124
+ orderId: z.ZodOptional<z.ZodNumber>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ productId: string;
127
+ rating: number;
128
+ content: string;
129
+ reviewerName: string;
130
+ reviewerEmail: string;
131
+ title?: string | undefined;
132
+ orderId?: number | undefined;
133
+ }, {
134
+ productId: string | number;
135
+ rating: number;
136
+ content: string;
137
+ reviewerName: string;
138
+ reviewerEmail: string;
139
+ title?: string | undefined;
140
+ orderId?: number | undefined;
141
+ }>;
142
+ type StorefrontReview = z.infer<typeof StorefrontReviewSchema>;
143
+ type StorefrontReviews = z.infer<typeof StorefrontReviewsSchema>;
144
+ type ListProductReviewsParams = z.input<typeof ListProductReviewsParamsSchema>;
145
+ type CreateProductReviewParams = z.input<typeof CreateProductReviewParamsSchema>;
146
+
147
+ export { type CreateProductReviewParams, CreateProductReviewParamsSchema, type ListProductReviewsParams, ListProductReviewsParamsSchema, type StorefrontReview, StorefrontReviewSchema, type StorefrontReviews, StorefrontReviewsSchema };
@@ -0,0 +1,147 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const StorefrontReviewSchema: z.ZodObject<{
4
+ id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
5
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
6
+ isVerifiedPurchase: z.ZodBoolean;
7
+ rating: z.ZodNumber;
8
+ title: z.ZodNullable<z.ZodString>;
9
+ content: z.ZodString;
10
+ reviewerName: z.ZodNullable<z.ZodString>;
11
+ createdOn: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ id: string;
14
+ productId: string;
15
+ isVerifiedPurchase: boolean;
16
+ rating: number;
17
+ title: string | null;
18
+ content: string;
19
+ reviewerName: string | null;
20
+ createdOn: string;
21
+ }, {
22
+ id: string | number;
23
+ productId: string | number;
24
+ isVerifiedPurchase: boolean;
25
+ rating: number;
26
+ title: string | null;
27
+ content: string;
28
+ reviewerName: string | null;
29
+ createdOn: string;
30
+ }>;
31
+ declare const StorefrontReviewsSchema: z.ZodObject<{
32
+ data: z.ZodArray<z.ZodObject<{
33
+ id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
34
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
35
+ isVerifiedPurchase: z.ZodBoolean;
36
+ rating: z.ZodNumber;
37
+ title: z.ZodNullable<z.ZodString>;
38
+ content: z.ZodString;
39
+ reviewerName: z.ZodNullable<z.ZodString>;
40
+ createdOn: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string;
43
+ productId: string;
44
+ isVerifiedPurchase: boolean;
45
+ rating: number;
46
+ title: string | null;
47
+ content: string;
48
+ reviewerName: string | null;
49
+ createdOn: string;
50
+ }, {
51
+ id: string | number;
52
+ productId: string | number;
53
+ isVerifiedPurchase: boolean;
54
+ rating: number;
55
+ title: string | null;
56
+ content: string;
57
+ reviewerName: string | null;
58
+ createdOn: string;
59
+ }>, "many">;
60
+ hasNextPage: z.ZodBoolean;
61
+ nextCursor: z.ZodNullable<z.ZodString>;
62
+ totalCount: z.ZodNullable<z.ZodNumber>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ totalCount: number | null;
65
+ data: {
66
+ id: string;
67
+ productId: string;
68
+ isVerifiedPurchase: boolean;
69
+ rating: number;
70
+ title: string | null;
71
+ content: string;
72
+ reviewerName: string | null;
73
+ createdOn: string;
74
+ }[];
75
+ hasNextPage: boolean;
76
+ nextCursor: string | null;
77
+ }, {
78
+ totalCount: number | null;
79
+ data: {
80
+ id: string | number;
81
+ productId: string | number;
82
+ isVerifiedPurchase: boolean;
83
+ rating: number;
84
+ title: string | null;
85
+ content: string;
86
+ reviewerName: string | null;
87
+ createdOn: string;
88
+ }[];
89
+ hasNextPage: boolean;
90
+ nextCursor: string | null;
91
+ }>;
92
+ declare const ListProductReviewsParamsSchema: z.ZodObject<{
93
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
94
+ limit: z.ZodOptional<z.ZodNumber>;
95
+ cursor: z.ZodOptional<z.ZodString>;
96
+ search: z.ZodOptional<z.ZodString>;
97
+ sortBy: z.ZodOptional<z.ZodEnum<["rating", "createdOn"]>>;
98
+ sortDirection: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
99
+ rating: z.ZodOptional<z.ZodNumber>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ productId: string;
102
+ search?: string | undefined;
103
+ limit?: number | undefined;
104
+ rating?: number | undefined;
105
+ cursor?: string | undefined;
106
+ sortBy?: "rating" | "createdOn" | undefined;
107
+ sortDirection?: "asc" | "desc" | undefined;
108
+ }, {
109
+ productId: string | number;
110
+ search?: string | undefined;
111
+ limit?: number | undefined;
112
+ rating?: number | undefined;
113
+ cursor?: string | undefined;
114
+ sortBy?: "rating" | "createdOn" | undefined;
115
+ sortDirection?: "asc" | "desc" | undefined;
116
+ }>;
117
+ declare const CreateProductReviewParamsSchema: z.ZodObject<{
118
+ productId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
119
+ rating: z.ZodNumber;
120
+ content: z.ZodString;
121
+ title: z.ZodOptional<z.ZodString>;
122
+ reviewerName: z.ZodString;
123
+ reviewerEmail: z.ZodString;
124
+ orderId: z.ZodOptional<z.ZodNumber>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ productId: string;
127
+ rating: number;
128
+ content: string;
129
+ reviewerName: string;
130
+ reviewerEmail: string;
131
+ title?: string | undefined;
132
+ orderId?: number | undefined;
133
+ }, {
134
+ productId: string | number;
135
+ rating: number;
136
+ content: string;
137
+ reviewerName: string;
138
+ reviewerEmail: string;
139
+ title?: string | undefined;
140
+ orderId?: number | undefined;
141
+ }>;
142
+ type StorefrontReview = z.infer<typeof StorefrontReviewSchema>;
143
+ type StorefrontReviews = z.infer<typeof StorefrontReviewsSchema>;
144
+ type ListProductReviewsParams = z.input<typeof ListProductReviewsParamsSchema>;
145
+ type CreateProductReviewParams = z.input<typeof CreateProductReviewParamsSchema>;
146
+
147
+ export { type CreateProductReviewParams, CreateProductReviewParamsSchema, type ListProductReviewsParams, ListProductReviewsParamsSchema, type StorefrontReview, StorefrontReviewSchema, type StorefrontReviews, StorefrontReviewsSchema };
@@ -0,0 +1,218 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/models/storefront-reviews.ts
4
+ var ProductPublicIdSchema = z.union([
5
+ z.string().regex(/^[1-9]\d*$/),
6
+ z.number().int().safe().positive()
7
+ ]).transform(String);
8
+ var ProductSummarySchema = z.object({
9
+ id: ProductPublicIdSchema,
10
+ name: z.string(),
11
+ slug: z.string(),
12
+ productType: z.string(),
13
+ imageUrl: z.string(),
14
+ price: z.number().nonnegative(),
15
+ compareAtPrice: z.number().nonnegative().nullable(),
16
+ variantCount: z.number().int().nonnegative(),
17
+ isAvailable: z.boolean(),
18
+ totalInventory: z.number().int().nonnegative(),
19
+ bundleItemsCount: z.number().int().nonnegative(),
20
+ brand: z.string(),
21
+ category: z.string(),
22
+ status: z.string(),
23
+ collections: z.array(z.string()),
24
+ tags: z.array(z.string())
25
+ });
26
+ z.array(ProductSummarySchema);
27
+ var FacetItemSchema = z.object({
28
+ value: z.string(),
29
+ count: z.number().int().nonnegative(),
30
+ label: z.string().nullable(),
31
+ selected: z.boolean()
32
+ });
33
+ var SearchFilterSchema = z.object({
34
+ id: z.string(),
35
+ label: z.string(),
36
+ type: z.enum(["list", "price_range"]),
37
+ values: z.array(FacetItemSchema),
38
+ min: z.number().nonnegative().nullable(),
39
+ max: z.number().nonnegative().nullable(),
40
+ selectedMin: z.number().nonnegative().nullable(),
41
+ selectedMax: z.number().nonnegative().nullable()
42
+ });
43
+ z.object({
44
+ pageIndex: z.number().int().positive(),
45
+ pageSize: z.number().int().positive().max(100),
46
+ totalCount: z.number().int().nonnegative(),
47
+ totalPages: z.number().int().nonnegative(),
48
+ products: z.array(ProductSummarySchema),
49
+ filters: z.array(SearchFilterSchema)
50
+ });
51
+ var ProductSortSchema = z.enum([
52
+ "price_asc",
53
+ "price_desc",
54
+ "name_asc",
55
+ "name_desc",
56
+ "newest"
57
+ ]);
58
+ z.object({
59
+ page: z.number().int().positive().default(1),
60
+ pageSize: z.number().int().positive().max(100).default(24),
61
+ sort: ProductSortSchema.optional(),
62
+ sellerId: z.string().uuid().optional(),
63
+ search: z.string().optional(),
64
+ collection: z.string().optional(),
65
+ collections: z.array(z.string()).optional(),
66
+ collectionId: ProductPublicIdSchema.optional(),
67
+ category: z.string().optional(),
68
+ categories: z.array(z.string()).optional(),
69
+ brand: z.string().optional(),
70
+ brands: z.array(z.string()).optional(),
71
+ productType: z.string().optional(),
72
+ productTypes: z.array(z.string()).optional(),
73
+ tag: z.string().optional(),
74
+ tags: z.array(z.string()).optional(),
75
+ filters: z.array(z.string()).optional(),
76
+ locationId: z.string().uuid().optional(),
77
+ inStock: z.boolean().optional(),
78
+ minPrice: z.number().nonnegative().optional(),
79
+ maxPrice: z.number().nonnegative().optional()
80
+ });
81
+ z.object({
82
+ sellerId: z.string().uuid().optional()
83
+ });
84
+ z.object({
85
+ productId: ProductPublicIdSchema,
86
+ limit: z.number().int().positive().max(12).default(8),
87
+ sellerId: z.string().uuid().optional()
88
+ });
89
+ var SpecItemSchema = z.object({
90
+ key: z.string(),
91
+ name: z.string(),
92
+ value: z.string()
93
+ });
94
+ var ProductImageSchema = z.object({
95
+ url: z.string(),
96
+ name: z.string(),
97
+ order: z.number().int().nonnegative()
98
+ });
99
+ var VariantItemSchema = z.object({
100
+ id: z.string().nullable(),
101
+ sku: z.string(),
102
+ status: z.string(),
103
+ price: z.number().nonnegative(),
104
+ compareAtPrice: z.number().nonnegative().nullable(),
105
+ quantity: z.number().int().nonnegative(),
106
+ options: z.array(SpecItemSchema),
107
+ images: z.array(ProductImageSchema)
108
+ });
109
+ var ProductPriceTierSchema = z.object({
110
+ variantId: z.string(),
111
+ minQuantity: z.number().int().positive(),
112
+ maxQuantity: z.number().int().positive().nullable(),
113
+ unitPrice: z.number().nonnegative()
114
+ });
115
+ var BundleItemSchema = z.object({
116
+ productId: ProductPublicIdSchema,
117
+ variantId: ProductPublicIdSchema,
118
+ productName: z.string(),
119
+ variantName: z.string().nullable(),
120
+ sku: z.string().nullable(),
121
+ brand: z.string().nullable(),
122
+ imageUrl: z.string().nullable(),
123
+ quantity: z.number().int().positive(),
124
+ available: z.number().int().nonnegative(),
125
+ allowBackorders: z.boolean(),
126
+ requiresShipping: z.boolean()
127
+ });
128
+ var SizeGuideMeasurementSchema = z.object({
129
+ key: z.string(),
130
+ name: z.string(),
131
+ min: z.number().nullable(),
132
+ max: z.number().nullable(),
133
+ value: z.number().nullable(),
134
+ description: z.string().nullable()
135
+ });
136
+ var SizeGuideRowSchema = z.object({
137
+ label: z.string(),
138
+ sizeKey: z.string(),
139
+ order: z.number().int().nonnegative(),
140
+ measurements: z.array(SizeGuideMeasurementSchema)
141
+ });
142
+ var SizeGuideSchema = z.object({
143
+ id: z.string(),
144
+ name: z.string(),
145
+ slug: z.string(),
146
+ description: z.string().nullable(),
147
+ imageUrl: z.string().nullable(),
148
+ gender: z.string(),
149
+ measurementType: z.string(),
150
+ unit: z.string(),
151
+ notes: z.string().nullable(),
152
+ rows: z.array(SizeGuideRowSchema)
153
+ });
154
+ z.object({
155
+ id: ProductPublicIdSchema,
156
+ name: z.string(),
157
+ slug: z.string(),
158
+ description: z.string(),
159
+ productType: z.string(),
160
+ status: z.string(),
161
+ imageUrl: z.string(),
162
+ price: z.number().nonnegative(),
163
+ compareAtPrice: z.number().nonnegative().nullable(),
164
+ isAvailable: z.boolean(),
165
+ totalInventory: z.number().int().nonnegative(),
166
+ brand: z.string(),
167
+ category: z.string(),
168
+ categoryId: ProductPublicIdSchema.nullable(),
169
+ tags: z.array(z.string()),
170
+ specifications: z.array(SpecItemSchema),
171
+ variants: z.array(VariantItemSchema),
172
+ images: z.array(ProductImageSchema),
173
+ bundleItems: z.array(BundleItemSchema),
174
+ sizeGuide: SizeGuideSchema.nullable(),
175
+ priceTiers: z.array(ProductPriceTierSchema),
176
+ createdAt: z.string().datetime({ offset: true }).nullable(),
177
+ updatedAt: z.string().datetime({ offset: true }).nullable()
178
+ });
179
+
180
+ // src/models/storefront-reviews.ts
181
+ var StorefrontReviewSchema = z.object({
182
+ id: ProductPublicIdSchema,
183
+ productId: ProductPublicIdSchema,
184
+ isVerifiedPurchase: z.boolean(),
185
+ rating: z.number().int().min(1).max(5),
186
+ title: z.string().nullable(),
187
+ content: z.string(),
188
+ reviewerName: z.string().nullable(),
189
+ createdOn: z.string().datetime({ offset: true })
190
+ });
191
+ var StorefrontReviewsSchema = z.object({
192
+ data: z.array(StorefrontReviewSchema),
193
+ hasNextPage: z.boolean(),
194
+ nextCursor: z.string().nullable(),
195
+ totalCount: z.number().int().nonnegative().nullable()
196
+ });
197
+ var ListProductReviewsParamsSchema = z.object({
198
+ productId: ProductPublicIdSchema,
199
+ limit: z.number().int().min(1).max(200).optional(),
200
+ cursor: z.string().optional(),
201
+ search: z.string().optional(),
202
+ sortBy: z.enum(["rating", "createdOn"]).optional(),
203
+ sortDirection: z.enum(["asc", "desc"]).optional(),
204
+ rating: z.number().int().min(1).max(5).optional()
205
+ });
206
+ var CreateProductReviewParamsSchema = z.object({
207
+ productId: ProductPublicIdSchema,
208
+ rating: z.number().int().min(1).max(5),
209
+ content: z.string().min(1).max(4e3),
210
+ title: z.string().max(200).optional(),
211
+ reviewerName: z.string().min(1).max(200),
212
+ reviewerEmail: z.string().email().max(320),
213
+ orderId: z.number().int().safe().positive().optional()
214
+ });
215
+
216
+ export { CreateProductReviewParamsSchema, ListProductReviewsParamsSchema, StorefrontReviewSchema, StorefrontReviewsSchema };
217
+ //# sourceMappingURL=storefront-reviews.js.map
218
+ //# sourceMappingURL=storefront-reviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/models/products.ts","../../src/models/storefront-reviews.ts"],"names":["z"],"mappings":";;;AAEO,IAAM,qBAAA,GAAwB,EAClC,KAAA,CAAM;AAAA,EACL,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,YAAY,CAAA;AAAA,EAC7B,EAAE,MAAA,EAAO,CAAE,KAAI,CAAE,IAAA,GAAO,QAAA;AAC1B,CAAC,CAAA,CACA,UAAU,MAAM,CAAA;AAEZ,IAAM,oBAAA,GAAuB,EAAE,MAAA,CAAO;AAAA,EAC3C,EAAA,EAAI,qBAAA;AAAA,EACJ,IAA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,CAAE,QAAA,EAAS,CAAE,QAAA;AAC9C,CAAC","file":"storefront-reviews.js","sourcesContent":["import { z } from 'zod'\n\nexport const ProductPublicIdSchema = z\n .union([\n z.string().regex(/^[1-9]\\d*$/),\n z.number().int().safe().positive(),\n ])\n .transform(String)\n\nexport const ProductSummarySchema = z.object({\n id: ProductPublicIdSchema,\n name: z.string(),\n slug: z.string(),\n productType: z.string(),\n imageUrl: z.string(),\n price: z.number().nonnegative(),\n compareAtPrice: z.number().nonnegative().nullable(),\n variantCount: z.number().int().nonnegative(),\n isAvailable: z.boolean(),\n totalInventory: z.number().int().nonnegative(),\n bundleItemsCount: z.number().int().nonnegative(),\n brand: z.string(),\n category: z.string(),\n status: z.string(),\n collections: z.array(z.string()),\n tags: z.array(z.string()),\n})\n\nexport const ProductSummariesSchema = z.array(ProductSummarySchema)\n\nexport const ProductSchema = ProductSummarySchema\n\nexport const FacetItemSchema = z.object({\n value: z.string(),\n count: z.number().int().nonnegative(),\n label: z.string().nullable(),\n selected: z.boolean(),\n})\n\nexport const FacetSchema = FacetItemSchema\n\nexport const SearchFilterSchema = z.object({\n id: z.string(),\n label: z.string(),\n type: z.enum(['list', 'price_range']),\n values: z.array(FacetItemSchema),\n min: z.number().nonnegative().nullable(),\n max: z.number().nonnegative().nullable(),\n selectedMin: z.number().nonnegative().nullable(),\n selectedMax: z.number().nonnegative().nullable(),\n})\n\nexport const ProductsResponseSchema = z.object({\n pageIndex: z.number().int().positive(),\n pageSize: z.number().int().positive().max(100),\n totalCount: z.number().int().nonnegative(),\n totalPages: z.number().int().nonnegative(),\n products: z.array(ProductSummarySchema),\n filters: z.array(SearchFilterSchema),\n})\n\nexport const ProductSortSchema = z.enum([\n 'price_asc',\n 'price_desc',\n 'name_asc',\n 'name_desc',\n 'newest',\n])\n\nexport const ProductsParamsSchema = z.object({\n page: z.number().int().positive().default(1),\n pageSize: z.number().int().positive().max(100).default(24),\n sort: ProductSortSchema.optional(),\n sellerId: z.string().uuid().optional(),\n search: z.string().optional(),\n collection: z.string().optional(),\n collections: z.array(z.string()).optional(),\n collectionId: ProductPublicIdSchema.optional(),\n category: z.string().optional(),\n categories: z.array(z.string()).optional(),\n brand: z.string().optional(),\n brands: z.array(z.string()).optional(),\n productType: z.string().optional(),\n productTypes: z.array(z.string()).optional(),\n tag: z.string().optional(),\n tags: z.array(z.string()).optional(),\n filters: z.array(z.string()).optional(),\n locationId: z.string().uuid().optional(),\n inStock: z.boolean().optional(),\n minPrice: z.number().nonnegative().optional(),\n maxPrice: z.number().nonnegative().optional(),\n})\n\nexport const ProductDetailParamsSchema = z.object({\n sellerId: z.string().uuid().optional(),\n})\n\nexport const RelatedProductsParamsSchema = z.object({\n productId: ProductPublicIdSchema,\n limit: z.number().int().positive().max(12).default(8),\n sellerId: z.string().uuid().optional(),\n})\n\nexport const SpecItemSchema = z.object({\n key: z.string(),\n name: z.string(),\n value: z.string(),\n})\n\nexport const VariantOptionSchema = SpecItemSchema\n\nexport const ProductImageSchema = z.object({\n url: z.string(),\n name: z.string(),\n order: z.number().int().nonnegative(),\n})\n\nexport const VariantItemSchema = z.object({\n id: z.string().nullable(),\n sku: z.string(),\n status: z.string(),\n price: z.number().nonnegative(),\n compareAtPrice: z.number().nonnegative().nullable(),\n quantity: z.number().int().nonnegative(),\n options: z.array(SpecItemSchema),\n images: z.array(ProductImageSchema),\n})\n\nexport const VariantSchema = VariantItemSchema\n\nexport const ProductPriceTierSchema = z.object({\n variantId: z.string(),\n minQuantity: z.number().int().positive(),\n maxQuantity: z.number().int().positive().nullable(),\n unitPrice: z.number().nonnegative(),\n})\n\nexport const PriceTierSchema = ProductPriceTierSchema\n\nexport const BundleItemSchema = z.object({\n productId: ProductPublicIdSchema,\n variantId: ProductPublicIdSchema,\n productName: z.string(),\n variantName: z.string().nullable(),\n sku: z.string().nullable(),\n brand: z.string().nullable(),\n imageUrl: z.string().nullable(),\n quantity: z.number().int().positive(),\n available: z.number().int().nonnegative(),\n allowBackorders: z.boolean(),\n requiresShipping: z.boolean(),\n})\n\nexport const SizeGuideMeasurementSchema = z.object({\n key: z.string(),\n name: z.string(),\n min: z.number().nullable(),\n max: z.number().nullable(),\n value: z.number().nullable(),\n description: z.string().nullable(),\n})\n\nexport const SizeGuideRowSchema = z.object({\n label: z.string(),\n sizeKey: z.string(),\n order: z.number().int().nonnegative(),\n measurements: z.array(SizeGuideMeasurementSchema),\n})\n\nexport const SizeGuideSchema = z.object({\n id: z.string(),\n name: z.string(),\n slug: z.string(),\n description: z.string().nullable(),\n imageUrl: z.string().nullable(),\n gender: z.string(),\n measurementType: z.string(),\n unit: z.string(),\n notes: z.string().nullable(),\n rows: z.array(SizeGuideRowSchema),\n})\n\nexport const ProductDetailSchema = z.object({\n id: ProductPublicIdSchema,\n name: z.string(),\n slug: z.string(),\n description: z.string(),\n productType: z.string(),\n status: z.string(),\n imageUrl: z.string(),\n price: z.number().nonnegative(),\n compareAtPrice: z.number().nonnegative().nullable(),\n isAvailable: z.boolean(),\n totalInventory: z.number().int().nonnegative(),\n brand: z.string(),\n category: z.string(),\n categoryId: ProductPublicIdSchema.nullable(),\n tags: z.array(z.string()),\n specifications: z.array(SpecItemSchema),\n variants: z.array(VariantItemSchema),\n images: z.array(ProductImageSchema),\n bundleItems: z.array(BundleItemSchema),\n sizeGuide: SizeGuideSchema.nullable(),\n priceTiers: z.array(ProductPriceTierSchema),\n createdAt: z.string().datetime({ offset: true }).nullable(),\n updatedAt: z.string().datetime({ offset: true }).nullable(),\n})\n\nexport type ProductSummary = z.infer<typeof ProductSummarySchema>\nexport type Product = ProductSummary\nexport type FacetItem = z.infer<typeof FacetItemSchema>\nexport type Facet = FacetItem\nexport type SearchFilter = z.infer<typeof SearchFilterSchema>\nexport type ProductsResponse = z.infer<typeof ProductsResponseSchema>\nexport type ProductsParams = z.infer<typeof ProductsParamsSchema>\nexport type ProductsParamsInput = z.input<typeof ProductsParamsSchema>\nexport type ProductDetailParams = z.input<typeof ProductDetailParamsSchema>\nexport type RelatedProductsParams = z.input<typeof RelatedProductsParamsSchema>\nexport type ProductSort = z.infer<typeof ProductSortSchema>\nexport type SpecItem = z.infer<typeof SpecItemSchema>\nexport type VariantOption = SpecItem\nexport type VariantItem = z.infer<typeof VariantItemSchema>\nexport type Variant = VariantItem\nexport type ProductImage = z.infer<typeof ProductImageSchema>\nexport type ProductPriceTier = z.infer<typeof ProductPriceTierSchema>\nexport type PriceTier = ProductPriceTier\nexport type BundleItem = z.infer<typeof BundleItemSchema>\nexport type SizeGuideMeasurement = z.infer<typeof SizeGuideMeasurementSchema>\nexport type SizeGuideRow = z.infer<typeof SizeGuideRowSchema>\nexport type SizeGuide = z.infer<typeof SizeGuideSchema>\nexport type ProductDetail = z.infer<typeof ProductDetailSchema>\n","import { z } from 'zod'\n\nimport { ProductPublicIdSchema } from './products'\n\nexport const StorefrontReviewSchema = z.object({\n id: ProductPublicIdSchema,\n productId: ProductPublicIdSchema,\n isVerifiedPurchase: z.boolean(),\n rating: z.number().int().min(1).max(5),\n title: z.string().nullable(),\n content: z.string(),\n reviewerName: z.string().nullable(),\n createdOn: z.string().datetime({ offset: true }),\n})\n\nexport const StorefrontReviewsSchema = z.object({\n data: z.array(StorefrontReviewSchema),\n hasNextPage: z.boolean(),\n nextCursor: z.string().nullable(),\n totalCount: z.number().int().nonnegative().nullable(),\n})\n\nexport const ListProductReviewsParamsSchema = z.object({\n productId: ProductPublicIdSchema,\n limit: z.number().int().min(1).max(200).optional(),\n cursor: z.string().optional(),\n search: z.string().optional(),\n sortBy: z.enum(['rating', 'createdOn']).optional(),\n sortDirection: z.enum(['asc', 'desc']).optional(),\n rating: z.number().int().min(1).max(5).optional(),\n})\n\nexport const CreateProductReviewParamsSchema = z.object({\n productId: ProductPublicIdSchema,\n rating: z.number().int().min(1).max(5),\n content: z.string().min(1).max(4000),\n title: z.string().max(200).optional(),\n reviewerName: z.string().min(1).max(200),\n reviewerEmail: z.string().email().max(320),\n orderId: z.number().int().safe().positive().optional(),\n})\n\nexport type StorefrontReview = z.infer<typeof StorefrontReviewSchema>\nexport type StorefrontReviews = z.infer<typeof StorefrontReviewsSchema>\nexport type ListProductReviewsParams = z.input<typeof ListProductReviewsParamsSchema>\nexport type CreateProductReviewParams = z.input<typeof CreateProductReviewParamsSchema>\n"]}
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "@ecomiq/core",
3
+ "version": "0.1.0",
4
+ "description": "Modelos, API client y schemas compartidos de Ecomiq",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Ecomiq",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/ecomiq/ecomiq-storefront.git",
11
+ "directory": "packages/ecomiq-core"
12
+ },
13
+ "homepage": "https://github.com/ecomiq/ecomiq-storefront/tree/main/packages/ecomiq-core",
14
+ "bugs": {
15
+ "url": "https://github.com/ecomiq/ecomiq-storefront/issues"
16
+ },
17
+ "keywords": [
18
+ "ecomiq",
19
+ "storefront",
20
+ "ecommerce",
21
+ "zod",
22
+ "api-client"
23
+ ],
24
+ "sideEffects": false,
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./api": {
35
+ "types": "./dist/api.d.ts",
36
+ "import": "./dist/api.js",
37
+ "require": "./dist/api.cjs"
38
+ },
39
+ "./client": {
40
+ "types": "./dist/client.d.ts",
41
+ "import": "./dist/client.js",
42
+ "require": "./dist/client.cjs"
43
+ },
44
+ "./models/settings": {
45
+ "types": "./dist/models/settings.d.ts",
46
+ "import": "./dist/models/settings.js",
47
+ "require": "./dist/models/settings.cjs"
48
+ },
49
+ "./models/collections": {
50
+ "types": "./dist/models/collections.d.ts",
51
+ "import": "./dist/models/collections.js",
52
+ "require": "./dist/models/collections.cjs"
53
+ },
54
+ "./models/products": {
55
+ "types": "./dist/models/products.d.ts",
56
+ "import": "./dist/models/products.js",
57
+ "require": "./dist/models/products.cjs"
58
+ },
59
+ "./models/search": {
60
+ "types": "./dist/models/search.d.ts",
61
+ "import": "./dist/models/search.js",
62
+ "require": "./dist/models/search.cjs"
63
+ },
64
+ "./models/storefront-cart": {
65
+ "types": "./dist/models/storefront-cart.d.ts",
66
+ "import": "./dist/models/storefront-cart.js",
67
+ "require": "./dist/models/storefront-cart.cjs"
68
+ },
69
+ "./models/storefront-checkout": {
70
+ "types": "./dist/models/storefront-checkout.d.ts",
71
+ "import": "./dist/models/storefront-checkout.js",
72
+ "require": "./dist/models/storefront-checkout.cjs"
73
+ },
74
+ "./models/storefront-reviews": {
75
+ "types": "./dist/models/storefront-reviews.d.ts",
76
+ "import": "./dist/models/storefront-reviews.js",
77
+ "require": "./dist/models/storefront-reviews.cjs"
78
+ },
79
+ "./models/geo": {
80
+ "types": "./dist/models/geo.d.ts",
81
+ "import": "./dist/models/geo.js",
82
+ "require": "./dist/models/geo.cjs"
83
+ },
84
+ "./package.json": "./package.json"
85
+ },
86
+ "files": [
87
+ "dist",
88
+ "README.md"
89
+ ],
90
+ "scripts": {
91
+ "build": "tsup",
92
+ "dev": "tsup --watch",
93
+ "typecheck": "tsc --noEmit -p tsconfig.json",
94
+ "prepublishOnly": "pnpm run build"
95
+ },
96
+ "publishConfig": {
97
+ "access": "public",
98
+ "registry": "https://registry.npmjs.org/"
99
+ },
100
+ "dependencies": {
101
+ "sanitize-html": "^2.17.6",
102
+ "zod": "catalog:"
103
+ },
104
+ "devDependencies": {
105
+ "@types/sanitize-html": "^2.16.1",
106
+ "tsup": "^8.5.0",
107
+ "typescript": "^5.8.0"
108
+ }
109
+ }