@classytic/commerce-sdk 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.

Potentially problematic release.


This version of @classytic/commerce-sdk might be problematic. Click here for more details.

Files changed (131) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +104 -0
  3. package/dist/adjustment-DTSLM7AN.js +5 -0
  4. package/dist/adjustment-DTSLM7AN.js.map +1 -0
  5. package/dist/analytics/index.d.ts +27 -0
  6. package/dist/analytics/index.js +6 -0
  7. package/dist/analytics/index.js.map +1 -0
  8. package/dist/analytics-DMcD-o8w.d.ts +76 -0
  9. package/dist/api-factory-B_h4RKBm.d.ts +280 -0
  10. package/dist/auth/index.d.ts +39 -0
  11. package/dist/auth/index.js +5 -0
  12. package/dist/auth/index.js.map +1 -0
  13. package/dist/catalog/index.d.ts +479 -0
  14. package/dist/catalog/index.js +9 -0
  15. package/dist/catalog/index.js.map +1 -0
  16. package/dist/chunk-4ZQK3FFN.js +40 -0
  17. package/dist/chunk-4ZQK3FFN.js.map +1 -0
  18. package/dist/chunk-5L6EXDGH.js +465 -0
  19. package/dist/chunk-5L6EXDGH.js.map +1 -0
  20. package/dist/chunk-5ZFW3FEI.js +183 -0
  21. package/dist/chunk-5ZFW3FEI.js.map +1 -0
  22. package/dist/chunk-66OQAZSL.js +94 -0
  23. package/dist/chunk-66OQAZSL.js.map +1 -0
  24. package/dist/chunk-6RYGA6MF.js +123 -0
  25. package/dist/chunk-6RYGA6MF.js.map +1 -0
  26. package/dist/chunk-B6MPVOV7.js +328 -0
  27. package/dist/chunk-B6MPVOV7.js.map +1 -0
  28. package/dist/chunk-BDA2WSJA.js +148 -0
  29. package/dist/chunk-BDA2WSJA.js.map +1 -0
  30. package/dist/chunk-EIVYT3HM.js +126 -0
  31. package/dist/chunk-EIVYT3HM.js.map +1 -0
  32. package/dist/chunk-EPQN7ZKZ.js +27 -0
  33. package/dist/chunk-EPQN7ZKZ.js.map +1 -0
  34. package/dist/chunk-FA7QFJ2G.js +177 -0
  35. package/dist/chunk-FA7QFJ2G.js.map +1 -0
  36. package/dist/chunk-I5TIKUIQ.js +261 -0
  37. package/dist/chunk-I5TIKUIQ.js.map +1 -0
  38. package/dist/chunk-ILQUH444.js +135 -0
  39. package/dist/chunk-ILQUH444.js.map +1 -0
  40. package/dist/chunk-IXMWZJLV.js +616 -0
  41. package/dist/chunk-IXMWZJLV.js.map +1 -0
  42. package/dist/chunk-KZIGRIQG.js +75 -0
  43. package/dist/chunk-KZIGRIQG.js.map +1 -0
  44. package/dist/chunk-OF5M6R2S.js +769 -0
  45. package/dist/chunk-OF5M6R2S.js.map +1 -0
  46. package/dist/chunk-PYYLHUV6.js +3 -0
  47. package/dist/chunk-PYYLHUV6.js.map +1 -0
  48. package/dist/chunk-QO5AGZFP.js +159 -0
  49. package/dist/chunk-QO5AGZFP.js.map +1 -0
  50. package/dist/chunk-QUMTBLNE.js +76 -0
  51. package/dist/chunk-QUMTBLNE.js.map +1 -0
  52. package/dist/chunk-R5Z7NYLH.js +126 -0
  53. package/dist/chunk-R5Z7NYLH.js.map +1 -0
  54. package/dist/chunk-SZYWG5IB.js +75 -0
  55. package/dist/chunk-SZYWG5IB.js.map +1 -0
  56. package/dist/chunk-U3XT35GZ.js +202 -0
  57. package/dist/chunk-U3XT35GZ.js.map +1 -0
  58. package/dist/chunk-UGELTUIZ.js +830 -0
  59. package/dist/chunk-UGELTUIZ.js.map +1 -0
  60. package/dist/chunk-VR36QVX2.js +122 -0
  61. package/dist/chunk-VR36QVX2.js.map +1 -0
  62. package/dist/chunk-WUOQK7BO.js +13 -0
  63. package/dist/chunk-WUOQK7BO.js.map +1 -0
  64. package/dist/chunk-X6PV5MHG.js +582 -0
  65. package/dist/chunk-X6PV5MHG.js.map +1 -0
  66. package/dist/chunk-ZWLMFLLH.js +534 -0
  67. package/dist/chunk-ZWLMFLLH.js.map +1 -0
  68. package/dist/content/index.d.ts +309 -0
  69. package/dist/content/index.js +6 -0
  70. package/dist/content/index.js.map +1 -0
  71. package/dist/core/index.d.ts +107 -0
  72. package/dist/core/index.js +5 -0
  73. package/dist/core/index.js.map +1 -0
  74. package/dist/core/react.d.ts +107 -0
  75. package/dist/core/react.js +5 -0
  76. package/dist/core/react.js.map +1 -0
  77. package/dist/coupon-CHFcw7cd.d.ts +632 -0
  78. package/dist/coupon-zGkvO-Xx.d.ts +129 -0
  79. package/dist/crud.factory-DyKaPHcU.d.ts +181 -0
  80. package/dist/finance/index.d.ts +81 -0
  81. package/dist/finance/index.js +5 -0
  82. package/dist/finance/index.js.map +1 -0
  83. package/dist/finance-BJdfKRw0.d.ts +135 -0
  84. package/dist/index.d.ts +31 -0
  85. package/dist/index.js +29 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/inventory/index.d.ts +512 -0
  88. package/dist/inventory/index.js +16 -0
  89. package/dist/inventory/index.js.map +1 -0
  90. package/dist/inventory-DCiIZh8P.d.ts +742 -0
  91. package/dist/logistics/index.d.ts +226 -0
  92. package/dist/logistics/index.js +7 -0
  93. package/dist/logistics/index.js.map +1 -0
  94. package/dist/logistics-V8a9lUN3.d.ts +428 -0
  95. package/dist/media-CNLJK93J.d.ts +721 -0
  96. package/dist/movement-7MV3ADY5.js +5 -0
  97. package/dist/movement-7MV3ADY5.js.map +1 -0
  98. package/dist/payment-BRboLqvU.d.ts +127 -0
  99. package/dist/payments/index.d.ts +55 -0
  100. package/dist/payments/index.js +6 -0
  101. package/dist/payments/index.js.map +1 -0
  102. package/dist/platform/index.d.ts +645 -0
  103. package/dist/platform/index.js +8 -0
  104. package/dist/platform/index.js.map +1 -0
  105. package/dist/pos-D1jkkFl0.d.ts +885 -0
  106. package/dist/product-p09zXkXB.d.ts +260 -0
  107. package/dist/purchase-24BGT2HA.js +5 -0
  108. package/dist/purchase-24BGT2HA.js.map +1 -0
  109. package/dist/request-652PS6VR.js +5 -0
  110. package/dist/request-652PS6VR.js.map +1 -0
  111. package/dist/sales/index.d.ts +585 -0
  112. package/dist/sales/index.js +9 -0
  113. package/dist/sales/index.js.map +1 -0
  114. package/dist/server.d.ts +120 -0
  115. package/dist/server.js +27 -0
  116. package/dist/server.js.map +1 -0
  117. package/dist/size-guide-DgjzjM5P.d.ts +554 -0
  118. package/dist/stock-DEApGC-w.d.ts +632 -0
  119. package/dist/stock-OOUW57VQ.js +5 -0
  120. package/dist/stock-OOUW57VQ.js.map +1 -0
  121. package/dist/supplier-OC6JAWV6.js +5 -0
  122. package/dist/supplier-OC6JAWV6.js.map +1 -0
  123. package/dist/transaction/index.d.ts +104 -0
  124. package/dist/transaction/index.js +8 -0
  125. package/dist/transaction/index.js.map +1 -0
  126. package/dist/transaction-BTmoHpWh.d.ts +428 -0
  127. package/dist/transaction-u5oaNuav.d.ts +84 -0
  128. package/dist/transfer-7SYSH3RG.js +5 -0
  129. package/dist/transfer-7SYSH3RG.js.map +1 -0
  130. package/dist/user-data-DdLjAGwO.d.ts +132 -0
  131. package/package.json +146 -0
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Product Types
3
+ *
4
+ * Source of truth: modules/commerce/product/product.model.js
5
+ */
6
+ /**
7
+ * Image Schema
8
+ */
9
+ interface ProductImage {
10
+ url: string;
11
+ variants?: {
12
+ thumbnail?: string;
13
+ medium?: string;
14
+ };
15
+ order?: number;
16
+ isFeatured?: boolean;
17
+ alt?: string;
18
+ }
19
+ /**
20
+ * Dimensions Schema
21
+ */
22
+ interface Dimensions {
23
+ length?: number;
24
+ width?: number;
25
+ height?: number;
26
+ }
27
+ /**
28
+ * Shipping Schema
29
+ */
30
+ interface ProductShipping {
31
+ weightGrams?: number;
32
+ dimensionsCm?: Dimensions;
33
+ }
34
+ /**
35
+ * Variation Attribute (Defines options)
36
+ * e.g. { name: "Size", values: ["S", "M", "L"] }
37
+ */
38
+ interface VariationAttribute {
39
+ name: string;
40
+ values: string[];
41
+ }
42
+ /**
43
+ * Variant (Sellable SKU)
44
+ */
45
+ interface ProductVariant {
46
+ sku: string;
47
+ barcode?: string;
48
+ attributes: Record<string, string>;
49
+ priceModifier: number;
50
+ /**
51
+ * System calculated field (Read-only for frontend)
52
+ * COGS for this specific variant
53
+ */
54
+ costPrice?: number;
55
+ /**
56
+ * VAT rate override for this specific variant
57
+ * null = inherit from product/category/platform
58
+ */
59
+ vatRate?: number | null;
60
+ images?: ProductImage[];
61
+ shipping?: ProductShipping;
62
+ isActive?: boolean;
63
+ }
64
+ /**
65
+ * Discount Schema
66
+ */
67
+ interface ProductDiscount {
68
+ type: 'percentage' | 'fixed';
69
+ value: number;
70
+ startDate?: string;
71
+ endDate?: string;
72
+ description?: string;
73
+ }
74
+ /**
75
+ * Product Stats (System Generated)
76
+ */
77
+ interface ProductStats {
78
+ totalSales: number;
79
+ totalQuantitySold: number;
80
+ viewCount: number;
81
+ }
82
+ /**
83
+ * Stock Projection for Variant Products (Read-Only)
84
+ * Provides fast storefront availability checks
85
+ */
86
+ interface StockProjection {
87
+ variants: Array<{
88
+ sku: string;
89
+ quantity: number;
90
+ }>;
91
+ syncedAt: string;
92
+ }
93
+ /**
94
+ * Main Product Interface (Read Model)
95
+ */
96
+ interface Product {
97
+ _id: string;
98
+ name: string;
99
+ slug: string;
100
+ shortDescription?: string;
101
+ description?: string;
102
+ basePrice: number;
103
+ /**
104
+ * System field: Cost of Goods Sold
105
+ * Not editable by customer. Admin only.
106
+ * Role-restricted field - only visible to authorized roles
107
+ */
108
+ costPrice?: number;
109
+ /**
110
+ * VAT rate override for this product
111
+ * null = inherit from category/platform default
112
+ */
113
+ vatRate?: number | null;
114
+ /**
115
+ * System field: Total stock quantity across all branches.
116
+ * Read-only cache. Source of truth is Inventory Service.
117
+ */
118
+ quantity: number;
119
+ /**
120
+ * Product type: 'simple' for regular products, 'variant' for products with variations
121
+ * Auto-determined by backend based on presence of variationAttributes
122
+ */
123
+ productType: 'simple' | 'variant';
124
+ sku?: string;
125
+ barcode?: string;
126
+ images: ProductImage[];
127
+ /**
128
+ * Category slug (references Category.slug, not ObjectId).
129
+ * Enables direct string queries without $lookup.
130
+ * @see Category model for metadata (name, image, description)
131
+ */
132
+ category: string;
133
+ /**
134
+ * Parent category slug (optional, for hierarchical filtering)
135
+ */
136
+ parentCategory?: string | null;
137
+ style?: string[];
138
+ variationAttributes?: VariationAttribute[];
139
+ variants?: ProductVariant[];
140
+ shipping?: ProductShipping;
141
+ properties?: Record<string, any>;
142
+ tags?: string[];
143
+ stats?: ProductStats;
144
+ averageRating?: number;
145
+ numReviews?: number;
146
+ /**
147
+ * Stock projection for variant products (Read-Only)
148
+ * Contains aggregated stock quantities per variant across all branches
149
+ */
150
+ stockProjection?: StockProjection;
151
+ discount?: ProductDiscount;
152
+ /**
153
+ * Size guide reference (ObjectId of SizeGuide document)
154
+ * Optional - only for products with sizing information
155
+ */
156
+ sizeGuide?: string | null;
157
+ isActive: boolean;
158
+ deletedAt?: string | null;
159
+ createdAt: string;
160
+ updatedAt: string;
161
+ isDiscountActive?: boolean;
162
+ currentPrice?: number;
163
+ featuredImage?: ProductImage | null;
164
+ profitMargin?: number | null;
165
+ profitMarginPercent?: number | null;
166
+ isDeleted?: boolean;
167
+ }
168
+ /**
169
+ * Payload for Creating a Product
170
+ */
171
+ interface CreateProductPayload {
172
+ name: string;
173
+ shortDescription?: string;
174
+ description?: string;
175
+ basePrice: number;
176
+ costPrice?: number;
177
+ vatRate?: number | null;
178
+ productType?: 'simple' | 'variant';
179
+ sku?: string;
180
+ barcode?: string;
181
+ images?: ProductImage[];
182
+ category: string;
183
+ parentCategory?: string;
184
+ style?: string[];
185
+ variationAttributes?: VariationAttribute[];
186
+ variants?: ProductVariant[];
187
+ shipping?: ProductShipping;
188
+ properties?: Record<string, any>;
189
+ tags?: string[];
190
+ discount?: ProductDiscount;
191
+ sizeGuide?: string | null;
192
+ isActive?: boolean;
193
+ }
194
+ /**
195
+ * Payload for Updating a Product
196
+ */
197
+ interface UpdateProductPayload {
198
+ name?: string;
199
+ shortDescription?: string;
200
+ description?: string;
201
+ basePrice?: number;
202
+ costPrice?: number;
203
+ vatRate?: number | null;
204
+ productType?: 'simple' | 'variant';
205
+ sku?: string;
206
+ barcode?: string;
207
+ images?: ProductImage[];
208
+ category?: string;
209
+ parentCategory?: string;
210
+ style?: string[];
211
+ variationAttributes?: VariationAttribute[];
212
+ variants?: ProductVariant[];
213
+ shipping?: ProductShipping;
214
+ properties?: Record<string, any>;
215
+ tags?: string[];
216
+ discount?: ProductDiscount;
217
+ sizeGuide?: string | null;
218
+ isActive?: boolean;
219
+ }
220
+ /**
221
+ * Response from GET /products (paginated list)
222
+ */
223
+ interface ProductListResponse {
224
+ success: boolean;
225
+ method: "offset";
226
+ docs: Product[];
227
+ page: number;
228
+ limit: number;
229
+ total: number;
230
+ pages: number;
231
+ hasNext: boolean;
232
+ hasPrev: boolean;
233
+ }
234
+ /**
235
+ * Response from GET /products/:id or /products/slug/:slug
236
+ */
237
+ interface ProductResponse {
238
+ success: boolean;
239
+ data: Product;
240
+ }
241
+ /**
242
+ * Response from DELETE /products/:id
243
+ */
244
+ interface ProductDeleteResponse {
245
+ success: boolean;
246
+ deleted: boolean;
247
+ message?: string;
248
+ }
249
+ /**
250
+ * Response from POST /products/:id/sync-stock
251
+ */
252
+ interface ProductSyncStockResponse {
253
+ success: boolean;
254
+ productId: string;
255
+ totalQuantity: number;
256
+ synced: boolean;
257
+ errors: any[];
258
+ }
259
+
260
+ export type { CreateProductPayload as C, Dimensions as D, ProductImage as P, StockProjection as S, UpdateProductPayload as U, VariationAttribute as V, ProductShipping as a, ProductVariant as b, ProductDiscount as c, ProductStats as d, Product as e, ProductListResponse as f, ProductResponse as g, ProductDeleteResponse as h, ProductSyncStockResponse as i };
@@ -0,0 +1,5 @@
1
+ export { PurchaseApi, purchaseApi } from './chunk-6RYGA6MF.js';
2
+ import './chunk-I5TIKUIQ.js';
3
+ import './chunk-VR36QVX2.js';
4
+ //# sourceMappingURL=purchase-24BGT2HA.js.map
5
+ //# sourceMappingURL=purchase-24BGT2HA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"purchase-24BGT2HA.js"}
@@ -0,0 +1,5 @@
1
+ export { RequestApi, requestApi } from './chunk-QO5AGZFP.js';
2
+ import './chunk-I5TIKUIQ.js';
3
+ import './chunk-VR36QVX2.js';
4
+ //# sourceMappingURL=request-652PS6VR.js.map
5
+ //# sourceMappingURL=request-652PS6VR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"request-652PS6VR.js"}