@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.
- package/LICENSE +14 -0
- package/README.md +104 -0
- package/dist/adjustment-DTSLM7AN.js +5 -0
- package/dist/adjustment-DTSLM7AN.js.map +1 -0
- package/dist/analytics/index.d.ts +27 -0
- package/dist/analytics/index.js +6 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics-DMcD-o8w.d.ts +76 -0
- package/dist/api-factory-B_h4RKBm.d.ts +280 -0
- package/dist/auth/index.d.ts +39 -0
- package/dist/auth/index.js +5 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/catalog/index.d.ts +479 -0
- package/dist/catalog/index.js +9 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/chunk-4ZQK3FFN.js +40 -0
- package/dist/chunk-4ZQK3FFN.js.map +1 -0
- package/dist/chunk-5L6EXDGH.js +465 -0
- package/dist/chunk-5L6EXDGH.js.map +1 -0
- package/dist/chunk-5ZFW3FEI.js +183 -0
- package/dist/chunk-5ZFW3FEI.js.map +1 -0
- package/dist/chunk-66OQAZSL.js +94 -0
- package/dist/chunk-66OQAZSL.js.map +1 -0
- package/dist/chunk-6RYGA6MF.js +123 -0
- package/dist/chunk-6RYGA6MF.js.map +1 -0
- package/dist/chunk-B6MPVOV7.js +328 -0
- package/dist/chunk-B6MPVOV7.js.map +1 -0
- package/dist/chunk-BDA2WSJA.js +148 -0
- package/dist/chunk-BDA2WSJA.js.map +1 -0
- package/dist/chunk-EIVYT3HM.js +126 -0
- package/dist/chunk-EIVYT3HM.js.map +1 -0
- package/dist/chunk-EPQN7ZKZ.js +27 -0
- package/dist/chunk-EPQN7ZKZ.js.map +1 -0
- package/dist/chunk-FA7QFJ2G.js +177 -0
- package/dist/chunk-FA7QFJ2G.js.map +1 -0
- package/dist/chunk-I5TIKUIQ.js +261 -0
- package/dist/chunk-I5TIKUIQ.js.map +1 -0
- package/dist/chunk-ILQUH444.js +135 -0
- package/dist/chunk-ILQUH444.js.map +1 -0
- package/dist/chunk-IXMWZJLV.js +616 -0
- package/dist/chunk-IXMWZJLV.js.map +1 -0
- package/dist/chunk-KZIGRIQG.js +75 -0
- package/dist/chunk-KZIGRIQG.js.map +1 -0
- package/dist/chunk-OF5M6R2S.js +769 -0
- package/dist/chunk-OF5M6R2S.js.map +1 -0
- package/dist/chunk-PYYLHUV6.js +3 -0
- package/dist/chunk-PYYLHUV6.js.map +1 -0
- package/dist/chunk-QO5AGZFP.js +159 -0
- package/dist/chunk-QO5AGZFP.js.map +1 -0
- package/dist/chunk-QUMTBLNE.js +76 -0
- package/dist/chunk-QUMTBLNE.js.map +1 -0
- package/dist/chunk-R5Z7NYLH.js +126 -0
- package/dist/chunk-R5Z7NYLH.js.map +1 -0
- package/dist/chunk-SZYWG5IB.js +75 -0
- package/dist/chunk-SZYWG5IB.js.map +1 -0
- package/dist/chunk-U3XT35GZ.js +202 -0
- package/dist/chunk-U3XT35GZ.js.map +1 -0
- package/dist/chunk-UGELTUIZ.js +830 -0
- package/dist/chunk-UGELTUIZ.js.map +1 -0
- package/dist/chunk-VR36QVX2.js +122 -0
- package/dist/chunk-VR36QVX2.js.map +1 -0
- package/dist/chunk-WUOQK7BO.js +13 -0
- package/dist/chunk-WUOQK7BO.js.map +1 -0
- package/dist/chunk-X6PV5MHG.js +582 -0
- package/dist/chunk-X6PV5MHG.js.map +1 -0
- package/dist/chunk-ZWLMFLLH.js +534 -0
- package/dist/chunk-ZWLMFLLH.js.map +1 -0
- package/dist/content/index.d.ts +309 -0
- package/dist/content/index.js +6 -0
- package/dist/content/index.js.map +1 -0
- package/dist/core/index.d.ts +107 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/react.d.ts +107 -0
- package/dist/core/react.js +5 -0
- package/dist/core/react.js.map +1 -0
- package/dist/coupon-CHFcw7cd.d.ts +632 -0
- package/dist/coupon-zGkvO-Xx.d.ts +129 -0
- package/dist/crud.factory-DyKaPHcU.d.ts +181 -0
- package/dist/finance/index.d.ts +81 -0
- package/dist/finance/index.js +5 -0
- package/dist/finance/index.js.map +1 -0
- package/dist/finance-BJdfKRw0.d.ts +135 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory/index.d.ts +512 -0
- package/dist/inventory/index.js +16 -0
- package/dist/inventory/index.js.map +1 -0
- package/dist/inventory-DCiIZh8P.d.ts +742 -0
- package/dist/logistics/index.d.ts +226 -0
- package/dist/logistics/index.js +7 -0
- package/dist/logistics/index.js.map +1 -0
- package/dist/logistics-V8a9lUN3.d.ts +428 -0
- package/dist/media-CNLJK93J.d.ts +721 -0
- package/dist/movement-7MV3ADY5.js +5 -0
- package/dist/movement-7MV3ADY5.js.map +1 -0
- package/dist/payment-BRboLqvU.d.ts +127 -0
- package/dist/payments/index.d.ts +55 -0
- package/dist/payments/index.js +6 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/platform/index.d.ts +645 -0
- package/dist/platform/index.js +8 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/pos-D1jkkFl0.d.ts +885 -0
- package/dist/product-p09zXkXB.d.ts +260 -0
- package/dist/purchase-24BGT2HA.js +5 -0
- package/dist/purchase-24BGT2HA.js.map +1 -0
- package/dist/request-652PS6VR.js +5 -0
- package/dist/request-652PS6VR.js.map +1 -0
- package/dist/sales/index.d.ts +585 -0
- package/dist/sales/index.js +9 -0
- package/dist/sales/index.js.map +1 -0
- package/dist/server.d.ts +120 -0
- package/dist/server.js +27 -0
- package/dist/server.js.map +1 -0
- package/dist/size-guide-DgjzjM5P.d.ts +554 -0
- package/dist/stock-DEApGC-w.d.ts +632 -0
- package/dist/stock-OOUW57VQ.js +5 -0
- package/dist/stock-OOUW57VQ.js.map +1 -0
- package/dist/supplier-OC6JAWV6.js +5 -0
- package/dist/supplier-OC6JAWV6.js.map +1 -0
- package/dist/transaction/index.d.ts +104 -0
- package/dist/transaction/index.js +8 -0
- package/dist/transaction/index.js.map +1 -0
- package/dist/transaction-BTmoHpWh.d.ts +428 -0
- package/dist/transaction-u5oaNuav.d.ts +84 -0
- package/dist/transfer-7SYSH3RG.js +5 -0
- package/dist/transfer-7SYSH3RG.js.map +1 -0
- package/dist/user-data-DdLjAGwO.d.ts +132 -0
- 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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"purchase-24BGT2HA.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"request-652PS6VR.js"}
|