@smess/networking 1.0.15 → 1.0.18

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.
@@ -0,0 +1,335 @@
1
+ import { StoreCartService, StoreCartProvider, } from "./store.cart.service";
2
+ import { NetworkingUIEventWrapped, AlertModel, } from "../types/types";
3
+ import { BehaviorSubject, of } from "rxjs";
4
+ describe("StoreCartService", () => {
5
+ const config = {
6
+ baseUrl: "https://api.example.com",
7
+ isProd: false,
8
+ clientId: "test-client-id",
9
+ apiKey: "test-api-key",
10
+ };
11
+ let service;
12
+ beforeEach(() => {
13
+ service = new StoreCartService(config);
14
+ });
15
+ it("should initialize with null cartHash and storeId", () => {
16
+ expect(service.currentCartHash).toBe(null);
17
+ expect(service.cartHash$.value).toBe(null);
18
+ expect(service.currentStoreId).toBe(null);
19
+ expect(service.storeId$.value).toBe(null);
20
+ });
21
+ it("should initialize with provided storeId BehaviorSubject", () => {
22
+ const storeId = "store-123";
23
+ const $storeId = new BehaviorSubject(storeId);
24
+ const serviceWithStore = new StoreCartService(config, $storeId);
25
+ expect(serviceWithStore.currentStoreId).toBe(storeId);
26
+ expect(serviceWithStore.storeId$.value).toBe(storeId);
27
+ });
28
+ it("should update storeId dynamically", () => {
29
+ expect(service.currentStoreId).toBe(null);
30
+ service.setStoreId("store-456");
31
+ expect(service.currentStoreId).toBe("store-456");
32
+ expect(service.storeId$.value).toBe("store-456");
33
+ });
34
+ describe("getCart", () => {
35
+ it("should get cart successfully and update cartHash", async () => {
36
+ const cart = {
37
+ dateCreated: "2025-10-14 12:56:31",
38
+ dateModified: "2025-10-14 12:56:31",
39
+ discountTotal: 0,
40
+ discountTax: 0,
41
+ shippingTotal: 0,
42
+ shippingTax: 0,
43
+ cartTax: 0,
44
+ total: 20.0,
45
+ totalTax: 0,
46
+ customerId: "cust-123",
47
+ billingInformation: null,
48
+ shippingInformation: null,
49
+ paymentMethod: "cash",
50
+ deliveryType: "pickup",
51
+ transactionId: null,
52
+ customerIpAddress: "172.18.0.1",
53
+ customerUserAgent: "Test Agent",
54
+ customerNote: null,
55
+ cartHash: "test-hash-123",
56
+ cartItems: [
57
+ {
58
+ id: "item-1",
59
+ productId: "prod-1",
60
+ name: "Test Product",
61
+ quantity: 2,
62
+ price: 10.0,
63
+ total: 20.0,
64
+ },
65
+ ],
66
+ paymentUrl: null,
67
+ store: null,
68
+ };
69
+ jest.spyOn(service, "provider").mockReturnValue({
70
+ request: () => of(NetworkingUIEventWrapped.succeeded(cart)),
71
+ });
72
+ const result = await service.getCart().toPromise();
73
+ expect(result?.hasSuccess).toBe(true);
74
+ expect(result?.response).toEqual(cart);
75
+ expect(service.currentCartHash).toBe("test-hash-123");
76
+ });
77
+ it("should handle getCart error", async () => {
78
+ jest.spyOn(service, "provider").mockReturnValue({
79
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
80
+ });
81
+ const result = await service.getCart().toPromise();
82
+ expect(result?.hasFailed).toBe(true);
83
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
84
+ });
85
+ });
86
+ describe("updateCart", () => {
87
+ it("should update cart successfully", async () => {
88
+ const payload = {
89
+ status: "submitted",
90
+ customer_note: "Customer Note Example",
91
+ customer_id: "f1df6e9a-0160-11f0-82c2-6cac1a7e2953",
92
+ payment_method: "bank_transfer",
93
+ delivery_type: "delivery",
94
+ billing_information: {
95
+ email: "billing@example.com",
96
+ phone_number: "+1-555-111-2222",
97
+ street: "456 Market Street",
98
+ city: "san_francisco",
99
+ postal_code: "94103",
100
+ state: "ca",
101
+ country: "us",
102
+ },
103
+ shipping_information: {
104
+ email: "john.doe@example.com",
105
+ phone_number: "+1-555-123-4567",
106
+ street: "123 Main Street",
107
+ city: "san_francisco",
108
+ postal_code: "94105",
109
+ state: "ca",
110
+ country: "us",
111
+ },
112
+ };
113
+ const cart = {
114
+ dateCreated: "2025-10-14 12:56:31",
115
+ dateModified: "2025-10-14 12:56:31",
116
+ discountTotal: 0,
117
+ discountTax: 0,
118
+ shippingTotal: 0,
119
+ shippingTax: 0,
120
+ cartTax: 0,
121
+ total: 0,
122
+ totalTax: 0,
123
+ customerId: null,
124
+ billingInformation: null,
125
+ shippingInformation: null,
126
+ paymentMethod: "cash",
127
+ deliveryType: "pickup",
128
+ transactionId: null,
129
+ customerIpAddress: "172.18.0.1",
130
+ customerUserAgent: "Test Agent",
131
+ customerNote: "Please deliver in the evening",
132
+ cartHash: "test-hash",
133
+ cartItems: [],
134
+ paymentUrl: null,
135
+ store: null,
136
+ };
137
+ jest.spyOn(service, "provider").mockReturnValue({
138
+ request: () => of(NetworkingUIEventWrapped.succeeded(cart)),
139
+ });
140
+ const result = await service.updateCart(payload).toPromise();
141
+ expect(result?.hasSuccess).toBe(true);
142
+ expect(result?.response).toEqual(cart);
143
+ });
144
+ it("should handle updateCart error", async () => {
145
+ const payload = {
146
+ status: "invalid_status",
147
+ };
148
+ jest.spyOn(service, "provider").mockReturnValue({
149
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
150
+ });
151
+ const result = await service.updateCart(payload).toPromise();
152
+ expect(result?.hasFailed).toBe(true);
153
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
154
+ });
155
+ });
156
+ describe("addItem", () => {
157
+ it("should add item to cart successfully", async () => {
158
+ const payload = {
159
+ product_id: "prod-123",
160
+ quantity: 3,
161
+ };
162
+ const cart = {
163
+ dateCreated: "2025-10-14 12:56:31",
164
+ dateModified: "2025-10-14 12:56:31",
165
+ discountTotal: 0,
166
+ discountTax: 0,
167
+ shippingTotal: 0,
168
+ shippingTax: 0,
169
+ cartTax: 0,
170
+ total: 45.0,
171
+ totalTax: 0,
172
+ customerId: null,
173
+ billingInformation: null,
174
+ shippingInformation: null,
175
+ paymentMethod: "cash",
176
+ deliveryType: "pickup",
177
+ transactionId: null,
178
+ customerIpAddress: "172.18.0.1",
179
+ customerUserAgent: "Test Agent",
180
+ customerNote: null,
181
+ cartHash: "test-hash",
182
+ cartItems: [
183
+ {
184
+ id: "item-1",
185
+ productId: "prod-123",
186
+ quantity: 3,
187
+ price: 15.0,
188
+ total: 45.0,
189
+ },
190
+ ],
191
+ paymentUrl: null,
192
+ store: null,
193
+ };
194
+ jest.spyOn(service, "provider").mockReturnValue({
195
+ request: () => of(NetworkingUIEventWrapped.succeeded(cart)),
196
+ });
197
+ const result = await service.addItem(payload).toPromise();
198
+ expect(result?.hasSuccess).toBe(true);
199
+ expect(result?.response).toEqual(cart);
200
+ });
201
+ it("should handle addItem error", async () => {
202
+ const payload = {
203
+ product_id: "prod-999",
204
+ quantity: 1,
205
+ };
206
+ jest.spyOn(service, "provider").mockReturnValue({
207
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
208
+ });
209
+ const result = await service.addItem(payload).toPromise();
210
+ expect(result?.hasFailed).toBe(true);
211
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
212
+ });
213
+ });
214
+ describe("updateItemQuantity", () => {
215
+ it("should update item quantity successfully", async () => {
216
+ const itemId = "item-123";
217
+ const payload = {
218
+ quantity: 5,
219
+ };
220
+ const cart = {
221
+ dateCreated: "2025-10-14 12:56:31",
222
+ dateModified: "2025-10-14 12:56:31",
223
+ discountTotal: 0,
224
+ discountTax: 0,
225
+ shippingTotal: 0,
226
+ shippingTax: 0,
227
+ cartTax: 0,
228
+ total: 75.0,
229
+ totalTax: 0,
230
+ customerId: null,
231
+ billingInformation: null,
232
+ shippingInformation: null,
233
+ paymentMethod: "cash",
234
+ deliveryType: "pickup",
235
+ transactionId: null,
236
+ customerIpAddress: "172.18.0.1",
237
+ customerUserAgent: "Test Agent",
238
+ customerNote: null,
239
+ cartHash: "test-hash",
240
+ cartItems: [
241
+ {
242
+ id: itemId,
243
+ productId: "prod-123",
244
+ quantity: 5,
245
+ price: 15.0,
246
+ total: 75.0,
247
+ },
248
+ ],
249
+ paymentUrl: null,
250
+ store: null,
251
+ };
252
+ jest.spyOn(service, "provider").mockReturnValue({
253
+ request: () => of(NetworkingUIEventWrapped.succeeded(cart)),
254
+ });
255
+ const result = await service.updateItemQuantity(itemId, payload).toPromise();
256
+ expect(result?.hasSuccess).toBe(true);
257
+ expect(result?.response).toEqual(cart);
258
+ });
259
+ it("should handle updateItemQuantity error", async () => {
260
+ const itemId = "item-999";
261
+ const payload = {
262
+ quantity: 5,
263
+ };
264
+ jest.spyOn(service, "provider").mockReturnValue({
265
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
266
+ });
267
+ const result = await service.updateItemQuantity(itemId, payload).toPromise();
268
+ expect(result?.hasFailed).toBe(true);
269
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
270
+ });
271
+ });
272
+ describe("deleteItem", () => {
273
+ it("should delete item from cart successfully", async () => {
274
+ const itemId = "item-123";
275
+ jest.spyOn(service, "provider").mockReturnValue({
276
+ request: () => of(NetworkingUIEventWrapped.succeeded(undefined)),
277
+ });
278
+ const result = await service.deleteItem(itemId).toPromise();
279
+ expect(result?.hasSuccess).toBe(true);
280
+ });
281
+ it("should handle deleteItem error", async () => {
282
+ const itemId = "item-999";
283
+ jest.spyOn(service, "provider").mockReturnValue({
284
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
285
+ });
286
+ const result = await service.deleteItem(itemId).toPromise();
287
+ expect(result?.hasFailed).toBe(true);
288
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
289
+ });
290
+ });
291
+ describe("deleteAllItems", () => {
292
+ it("should delete all items from cart successfully", async () => {
293
+ jest.spyOn(service, "provider").mockReturnValue({
294
+ request: () => of(NetworkingUIEventWrapped.succeeded(undefined)),
295
+ });
296
+ const result = await service.deleteAllItems().toPromise();
297
+ expect(result?.hasSuccess).toBe(true);
298
+ });
299
+ it("should handle deleteAllItems error", async () => {
300
+ jest.spyOn(service, "provider").mockReturnValue({
301
+ request: () => of(NetworkingUIEventWrapped.failed(AlertModel.default())),
302
+ });
303
+ const result = await service.deleteAllItems().toPromise();
304
+ expect(result?.hasFailed).toBe(true);
305
+ expect(result?.alertModel).toBeInstanceOf(AlertModel);
306
+ });
307
+ });
308
+ describe("headers", () => {
309
+ it("should include X-Store-Id header when storeId is set", () => {
310
+ const storeId = "store-123";
311
+ const cartHash = "cart-hash-456";
312
+ const $cartHashSubject = new BehaviorSubject(cartHash);
313
+ const $storeIdSubject = new BehaviorSubject(storeId);
314
+ const provider = new StoreCartProvider(config, "cart-get", $cartHashSubject, $storeIdSubject);
315
+ const headers = provider.headers;
316
+ expect(headers["X-Store-Id"]).toBe(storeId);
317
+ expect(headers["X-Nonce-Token"]).toBe(cartHash);
318
+ });
319
+ it("should not include X-Store-Id header when storeId is null", () => {
320
+ const $cartHashSubject = new BehaviorSubject(null);
321
+ const $storeIdSubject = new BehaviorSubject(null);
322
+ const provider = new StoreCartProvider(config, "cart-get", $cartHashSubject, $storeIdSubject);
323
+ const headers = provider.headers;
324
+ expect(headers["X-Store-Id"]).toBeUndefined();
325
+ });
326
+ it("should include X-Nonce-Token header when cartHash is set", () => {
327
+ const cartHash = "cart-hash-789";
328
+ const $cartHashSubject = new BehaviorSubject(cartHash);
329
+ const $storeIdSubject = new BehaviorSubject(null);
330
+ const provider = new StoreCartProvider(config, "cart-get", $cartHashSubject, $storeIdSubject);
331
+ const headers = provider.headers;
332
+ expect(headers["X-Nonce-Token"]).toBe(cartHash);
333
+ });
334
+ });
335
+ });
@@ -0,0 +1,161 @@
1
+ import { ProviderType, NetworkingConfig, NetworkingUIEventWrapped, HttpResponse } from "../types/types";
2
+ import { SmessService } from "./smess.service";
3
+ import { Observable } from "rxjs";
4
+ export type StoreProductTarget = "featured-product-list" | "featured-product-list-by-store" | "product-category-list" | "product-get-by-id" | "store-list" | "store-information" | "product-collection" | "product-collection-by-store" | "product-update-batch" | "customer-update-batch" | "cart-update-batch" | "order-item-update-batch";
5
+ export interface StoreProductCollectionRequest {
6
+ page?: number;
7
+ per_page?: number;
8
+ search?: string;
9
+ sort_by?: string;
10
+ category?: string;
11
+ min_price?: number;
12
+ max_price?: number;
13
+ only_discounted?: boolean;
14
+ unit?: string;
15
+ supplier?: string;
16
+ has_offer?: boolean;
17
+ [key: string]: unknown;
18
+ }
19
+ export interface BatchUpdateRequest {
20
+ [key: string]: unknown;
21
+ }
22
+ export interface PaginationLinks {
23
+ first: string;
24
+ last: string;
25
+ next?: string;
26
+ prev?: string;
27
+ }
28
+ export interface StoreProduct {
29
+ id: string;
30
+ barcode: string;
31
+ expiryDate: string | null;
32
+ name: string;
33
+ category: string;
34
+ subCategory: string | null;
35
+ vatInPercent: number;
36
+ unit: string;
37
+ volume: number | null;
38
+ quantity: number;
39
+ unitWeight: number | null;
40
+ articleWeight: number | null;
41
+ tareWeight: number | null;
42
+ supplier: string | null;
43
+ supplierCode: string | null;
44
+ supplierItemName: string | null;
45
+ picture: string;
46
+ slug: string;
47
+ internalCode: string;
48
+ htmlDescription: string | null;
49
+ inventory: boolean;
50
+ quantityInStock: number;
51
+ minimumStockQuantity: number;
52
+ pricePurchase: number;
53
+ priceToSell: number;
54
+ discountInPercent: number;
55
+ priceAfterDiscount: number;
56
+ [key: string]: unknown;
57
+ }
58
+ export interface StoreProductCollectionResponse {
59
+ links: PaginationLinks;
60
+ items: StoreProduct[];
61
+ count: number;
62
+ total: number;
63
+ page: number;
64
+ totalPage: number;
65
+ perPage: number;
66
+ metadata: unknown[];
67
+ }
68
+ export interface ProductCategory {
69
+ name: string;
70
+ numberOfProducts: number;
71
+ image: string | null;
72
+ }
73
+ export declare class StoreProductProvider implements ProviderType {
74
+ private readonly config;
75
+ private readonly target;
76
+ constructor(config: NetworkingConfig, target: StoreProductTarget);
77
+ get baseURL(): string;
78
+ get path(): string;
79
+ get method(): string;
80
+ get headers(): Record<string, string>;
81
+ getPath(...queryParams: unknown[]): string;
82
+ }
83
+ export interface StoreProductServiceType {
84
+ getFeaturedProductList(): Observable<NetworkingUIEventWrapped<StoreProduct[]>>;
85
+ getFeaturedProductListByStore(storeId: string): Observable<NetworkingUIEventWrapped<StoreProduct[]>>;
86
+ getProductCategoryList(): Observable<NetworkingUIEventWrapped<ProductCategory[]>>;
87
+ getProductById(productId: string): Observable<NetworkingUIEventWrapped<StoreProduct>>;
88
+ getStoreList(): Observable<NetworkingUIEventWrapped<HttpResponse>>;
89
+ getStoreInformation(storeId: string): Observable<NetworkingUIEventWrapped<HttpResponse>>;
90
+ getProductCollection(payload?: StoreProductCollectionRequest): Observable<NetworkingUIEventWrapped<StoreProductCollectionResponse>>;
91
+ getProductCollectionByStore(storeId: string, payload?: StoreProductCollectionRequest): Observable<NetworkingUIEventWrapped<StoreProductCollectionResponse>>;
92
+ updateProductBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
93
+ updateCustomerBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
94
+ updateCartBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
95
+ updateOrderItemBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
96
+ }
97
+ export declare class StoreProductService implements StoreProductServiceType {
98
+ private readonly config;
99
+ constructor(config: NetworkingConfig);
100
+ provider(target: StoreProductTarget): SmessService<StoreProductProvider>;
101
+ /**
102
+ * Get featured product list
103
+ * GET /api/v1/store/featured-product-list
104
+ */
105
+ getFeaturedProductList(): Observable<NetworkingUIEventWrapped<StoreProduct[]>>;
106
+ /**
107
+ * Get featured product list by store
108
+ * GET /api/v1/store/{id}/featured-product-list
109
+ */
110
+ getFeaturedProductListByStore(storeId: string): Observable<NetworkingUIEventWrapped<StoreProduct[]>>;
111
+ /**
112
+ * Get product category list
113
+ * GET /api/v1/store/product-category/list
114
+ */
115
+ getProductCategoryList(): Observable<NetworkingUIEventWrapped<ProductCategory[]>>;
116
+ /**
117
+ * Get product by ID
118
+ * GET /api/v1/store/product/{id}
119
+ */
120
+ getProductById(productId: string): Observable<NetworkingUIEventWrapped<StoreProduct>>;
121
+ /**
122
+ * Get store list
123
+ * GET /api/v1/store/list
124
+ */
125
+ getStoreList(): Observable<NetworkingUIEventWrapped<HttpResponse>>;
126
+ /**
127
+ * Get store information
128
+ * GET /api/v1/store/{id}/information
129
+ */
130
+ getStoreInformation(storeId: string): Observable<NetworkingUIEventWrapped<HttpResponse>>;
131
+ /**
132
+ * Get product collection
133
+ * GET /api/v1/store/product-collection
134
+ */
135
+ getProductCollection(payload?: StoreProductCollectionRequest): Observable<NetworkingUIEventWrapped<StoreProductCollectionResponse>>;
136
+ /**
137
+ * Get product collection by store
138
+ * GET /api/v1/store/{id}/product-collection
139
+ */
140
+ getProductCollectionByStore(storeId: string, payload?: StoreProductCollectionRequest): Observable<NetworkingUIEventWrapped<StoreProductCollectionResponse>>;
141
+ /**
142
+ * Update product batch
143
+ * POST /api/v1/store/{id}/product
144
+ */
145
+ updateProductBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
146
+ /**
147
+ * Update customer batch
148
+ * POST /api/v1/store/{id}/customer/batch
149
+ */
150
+ updateCustomerBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
151
+ /**
152
+ * Update cart batch
153
+ * POST /api/v1/store/{id}/order/batch
154
+ */
155
+ updateCartBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
156
+ /**
157
+ * Update order item batch
158
+ * POST /api/v1/store/{id}/order-item
159
+ */
160
+ updateOrderItemBatch(storeId: string, payload: BatchUpdateRequest): Observable<NetworkingUIEventWrapped<HttpResponse>>;
161
+ }
@@ -0,0 +1,164 @@
1
+ import { Accept, SMESSHeader, SmessService } from "./smess.service";
2
+ export class StoreProductProvider {
3
+ constructor(config, target) {
4
+ this.config = config;
5
+ this.target = target;
6
+ }
7
+ get baseURL() {
8
+ return this.config.version
9
+ ? `${this.config.baseUrl}/${this.config.version}`
10
+ : this.config.baseUrl;
11
+ }
12
+ get path() {
13
+ switch (this.target) {
14
+ case "featured-product-list":
15
+ return "/store/featured-product-list";
16
+ case "featured-product-list-by-store":
17
+ return "/store/${id}/featured-product-list";
18
+ case "product-category-list":
19
+ return "/store/product-category/list";
20
+ case "product-get-by-id":
21
+ return "/store/product/${id}";
22
+ case "store-list":
23
+ return "/store/list";
24
+ case "store-information":
25
+ return "/store/${id}/information";
26
+ case "product-collection":
27
+ return "/store/product-collection";
28
+ case "product-collection-by-store":
29
+ return "/store/${id}/product-collection";
30
+ case "product-update-batch":
31
+ return "/store/${id}/product";
32
+ case "customer-update-batch":
33
+ return "/store/${id}/customer/batch";
34
+ case "cart-update-batch":
35
+ return "/store/${id}/order/batch";
36
+ case "order-item-update-batch":
37
+ return "/store/${id}/order-item";
38
+ default:
39
+ return "/store";
40
+ }
41
+ }
42
+ get method() {
43
+ switch (this.target) {
44
+ case "product-update-batch":
45
+ case "customer-update-batch":
46
+ case "cart-update-batch":
47
+ case "order-item-update-batch":
48
+ return "POST";
49
+ default:
50
+ return "GET";
51
+ }
52
+ }
53
+ get headers() {
54
+ let headers = SmessService.getHeaders(Accept.V1, null);
55
+ if (this.config.clientId) {
56
+ headers[SMESSHeader.ClientId] = this.config.clientId;
57
+ }
58
+ if (this.config.apiKey) {
59
+ headers[SMESSHeader.ApiKey] = this.config.apiKey;
60
+ }
61
+ return SmessService.filterHeaders(headers);
62
+ }
63
+ getPath(...queryParams) {
64
+ let definedPath = this.path;
65
+ const params = definedPath.match(/\$\{(.+?)\}/g);
66
+ params?.forEach((value, index) => {
67
+ definedPath = definedPath.replace(value, String(queryParams[index]));
68
+ });
69
+ return definedPath;
70
+ }
71
+ }
72
+ export class StoreProductService {
73
+ constructor(config) {
74
+ this.config = config;
75
+ }
76
+ provider(target) {
77
+ const targetWrapper = new StoreProductProvider(this.config, target);
78
+ return new SmessService(targetWrapper);
79
+ }
80
+ /**
81
+ * Get featured product list
82
+ * GET /api/v1/store/featured-product-list
83
+ */
84
+ getFeaturedProductList() {
85
+ return this.provider("featured-product-list").request();
86
+ }
87
+ /**
88
+ * Get featured product list by store
89
+ * GET /api/v1/store/{id}/featured-product-list
90
+ */
91
+ getFeaturedProductListByStore(storeId) {
92
+ return this.provider("featured-product-list-by-store").request(undefined, undefined, storeId);
93
+ }
94
+ /**
95
+ * Get product category list
96
+ * GET /api/v1/store/product-category/list
97
+ */
98
+ getProductCategoryList() {
99
+ return this.provider("product-category-list").request();
100
+ }
101
+ /**
102
+ * Get product by ID
103
+ * GET /api/v1/store/product/{id}
104
+ */
105
+ getProductById(productId) {
106
+ return this.provider("product-get-by-id").request(undefined, undefined, productId);
107
+ }
108
+ /**
109
+ * Get store list
110
+ * GET /api/v1/store/list
111
+ */
112
+ getStoreList() {
113
+ return this.provider("store-list").request();
114
+ }
115
+ /**
116
+ * Get store information
117
+ * GET /api/v1/store/{id}/information
118
+ */
119
+ getStoreInformation(storeId) {
120
+ return this.provider("store-information").request(undefined, undefined, storeId);
121
+ }
122
+ /**
123
+ * Get product collection
124
+ * GET /api/v1/store/product-collection
125
+ */
126
+ getProductCollection(payload) {
127
+ return this.provider("product-collection").request(null, undefined, undefined, payload);
128
+ }
129
+ /**
130
+ * Get product collection by store
131
+ * GET /api/v1/store/{id}/product-collection
132
+ */
133
+ getProductCollectionByStore(storeId, payload) {
134
+ return this.provider("product-collection-by-store").request(null, undefined, storeId, payload);
135
+ }
136
+ /**
137
+ * Update product batch
138
+ * POST /api/v1/store/{id}/product
139
+ */
140
+ updateProductBatch(storeId, payload) {
141
+ return this.provider("product-update-batch").request(payload, undefined, storeId);
142
+ }
143
+ /**
144
+ * Update customer batch
145
+ * POST /api/v1/store/{id}/customer/batch
146
+ */
147
+ updateCustomerBatch(storeId, payload) {
148
+ return this.provider("customer-update-batch").request(payload, undefined, storeId);
149
+ }
150
+ /**
151
+ * Update cart batch
152
+ * POST /api/v1/store/{id}/order/batch
153
+ */
154
+ updateCartBatch(storeId, payload) {
155
+ return this.provider("cart-update-batch").request(payload, undefined, storeId);
156
+ }
157
+ /**
158
+ * Update order item batch
159
+ * POST /api/v1/store/{id}/order-item
160
+ */
161
+ updateOrderItemBatch(storeId, payload) {
162
+ return this.provider("order-item-update-batch").request(payload, undefined, storeId);
163
+ }
164
+ }
@@ -0,0 +1 @@
1
+ export {};