washday-sdk 1.6.16 → 1.6.17
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.
- package/dist/api/index.js +1 -0
- package/dist/api/reports/get.js +21 -0
- package/package.json +1 -1
- package/src/api/index.ts +2 -1
- package/src/api/reports/get.ts +26 -1
- package/src/interfaces/Api.ts +1 -0
package/dist/api/index.js
CHANGED
|
@@ -320,6 +320,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
320
320
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
|
321
321
|
getMonthSalesStatistics: reportsExportEndpoints.getModule.getMonthSalesStatistics,
|
|
322
322
|
getPopularDaysStatistics: reportsExportEndpoints.getModule.getPopularDaysStatistics,
|
|
323
|
+
getSupplyCostReport: reportsExportEndpoints.getModule.getSupplyCostReport,
|
|
323
324
|
});
|
|
324
325
|
this.partners = bindMethods(this, {
|
|
325
326
|
getPartners: partnersEndpoints.getModule.getPartners,
|
package/dist/api/reports/get.js
CHANGED
|
@@ -183,6 +183,27 @@ export const getPaymentLinesReport = function (storeId, params) {
|
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
};
|
|
186
|
+
export const getSupplyCostReport = function (params) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
try {
|
|
189
|
+
const config = {
|
|
190
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
191
|
+
};
|
|
192
|
+
const queryParams = generateQueryParamsStr([
|
|
193
|
+
'store',
|
|
194
|
+
'fromDate',
|
|
195
|
+
'toDate',
|
|
196
|
+
'supplyId',
|
|
197
|
+
'productId',
|
|
198
|
+
], params);
|
|
199
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/supply-cost?${queryParams}`, config);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
console.error('Error fetching getSupplyCostReport:', error);
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
};
|
|
186
207
|
export const getUnpaidOrdersReport = function (storeId, params) {
|
|
187
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
209
|
try {
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -327,6 +327,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
327
327
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
|
328
328
|
getMonthSalesStatistics: reportsExportEndpoints.getModule.getMonthSalesStatistics,
|
|
329
329
|
getPopularDaysStatistics: reportsExportEndpoints.getModule.getPopularDaysStatistics,
|
|
330
|
+
getSupplyCostReport: reportsExportEndpoints.getModule.getSupplyCostReport,
|
|
330
331
|
});
|
|
331
332
|
this.partners = bindMethods(this, {
|
|
332
333
|
getPartners: partnersEndpoints.getModule.getPartners,
|
|
@@ -374,4 +375,4 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
374
375
|
});
|
|
375
376
|
} as any;
|
|
376
377
|
|
|
377
|
-
export default WashdayClient;
|
|
378
|
+
export default WashdayClient;
|
package/src/api/reports/get.ts
CHANGED
|
@@ -196,6 +196,31 @@ export const getPaymentLinesReport = async function (this: WashdayClientInstance
|
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
+
export const getSupplyCostReport = async function (this: WashdayClientInstance, params: {
|
|
200
|
+
store?: string; // store id or "all"
|
|
201
|
+
fromDate?: string;
|
|
202
|
+
toDate?: string;
|
|
203
|
+
supplyId?: string;
|
|
204
|
+
productId?: string;
|
|
205
|
+
}): Promise<any> {
|
|
206
|
+
try {
|
|
207
|
+
const config = {
|
|
208
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
209
|
+
};
|
|
210
|
+
const queryParams = generateQueryParamsStr([
|
|
211
|
+
'store',
|
|
212
|
+
'fromDate',
|
|
213
|
+
'toDate',
|
|
214
|
+
'supplyId',
|
|
215
|
+
'productId',
|
|
216
|
+
], params);
|
|
217
|
+
return await this.axiosInstance.get(`${GET_SET_REPORTS}/supply-cost?${queryParams}`, config);
|
|
218
|
+
} catch (error) {
|
|
219
|
+
console.error('Error fetching getSupplyCostReport:', error);
|
|
220
|
+
throw error;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
199
224
|
export const getUnpaidOrdersReport = async function (this: WashdayClientInstance, storeId: string, params: {
|
|
200
225
|
fromDate?: string
|
|
201
226
|
toDate?: string
|
|
@@ -370,4 +395,4 @@ export const getScheduledDeliveries = async function (this: WashdayClientInstanc
|
|
|
370
395
|
console.error('Error fetching getScheduledDeliveries:', error);
|
|
371
396
|
throw error;
|
|
372
397
|
}
|
|
373
|
-
};
|
|
398
|
+
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -312,6 +312,7 @@ export interface WashdayClientInstance {
|
|
|
312
312
|
getProductsStatistics: typeof reportsExportEndpoints.getModule.getProductsStatistics;
|
|
313
313
|
getMonthSalesStatistics: typeof reportsExportEndpoints.getModule.getMonthSalesStatistics;
|
|
314
314
|
getPopularDaysStatistics: typeof reportsExportEndpoints.getModule.getPopularDaysStatistics;
|
|
315
|
+
getSupplyCostReport: typeof reportsExportEndpoints.getModule.getSupplyCostReport;
|
|
315
316
|
};
|
|
316
317
|
partners: {
|
|
317
318
|
getPartners: typeof partnersEndpoints.getModule.getPartners;
|