washday-sdk 1.6.5 → 1.6.7
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 +5 -2
- package/dist/api/reports/get.js +20 -0
- package/dist/api/stores/get.js +15 -0
- package/dist/api/stores/put.js +15 -0
- package/package.json +1 -1
- package/src/api/index.ts +5 -2
- package/src/api/reports/get.ts +23 -0
- package/src/api/stores/get.ts +13 -0
- package/src/api/stores/put.ts +13 -0
- package/src/interfaces/Api.ts +5 -2
package/dist/api/index.js
CHANGED
|
@@ -13,9 +13,9 @@ import { deleteStoreStaffById } from "./staff/delete";
|
|
|
13
13
|
import { getStoreStaff, getStoreStaffById } from "./staff/get";
|
|
14
14
|
import { createStoreStaff } from "./staff/post";
|
|
15
15
|
import { updateStoreStaffById } from "./staff/put";
|
|
16
|
-
import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
|
|
16
|
+
import { getOrderSequence, getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
|
|
17
17
|
import { copyStore, createStore, createStoreImage } from "./stores/post";
|
|
18
|
-
import { deleteStoreById, updateStoreById } from "./stores/put";
|
|
18
|
+
import { deleteStoreById, setOrderSequence, updateStoreById } from "./stores/put";
|
|
19
19
|
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
|
|
20
20
|
import { deleteSupplyById } from "./supplies/delete";
|
|
21
21
|
import { getSupplies, getSupplyById, getSupplyHistory } from "./supplies/get";
|
|
@@ -171,6 +171,8 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
171
171
|
createStoreImage: createStoreImage,
|
|
172
172
|
getStoreReviewLink: getStoreReviewLink,
|
|
173
173
|
deleteStoreById: deleteStoreById,
|
|
174
|
+
getOrderSequence: getOrderSequence,
|
|
175
|
+
setOrderSequence: setOrderSequence,
|
|
174
176
|
});
|
|
175
177
|
this.products = bindMethods(this, {
|
|
176
178
|
getById: productsEndpoints.getModule.getById,
|
|
@@ -303,6 +305,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
303
305
|
getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
|
|
304
306
|
getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
|
|
305
307
|
getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
|
|
308
|
+
getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
|
|
306
309
|
getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
|
|
307
310
|
getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
|
|
308
311
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
package/dist/api/reports/get.js
CHANGED
|
@@ -319,3 +319,23 @@ export const getCashUpReportsByDateRange = function (storeId, params) {
|
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
321
|
};
|
|
322
|
+
export const getScheduledDeliveries = function (companyId, params) {
|
|
323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
324
|
+
try {
|
|
325
|
+
const config = {
|
|
326
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
327
|
+
};
|
|
328
|
+
const queryParams = generateQueryParamsStr([
|
|
329
|
+
'storeId',
|
|
330
|
+
'dateFrom',
|
|
331
|
+
'dateTo',
|
|
332
|
+
'includeDelivered',
|
|
333
|
+
], params);
|
|
334
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries?${queryParams}`, config);
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
console.error('Error fetching getScheduledDeliveries:', error);
|
|
338
|
+
throw error;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
};
|
package/dist/api/stores/get.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
11
|
const GET_SET_STORES = 'api/store';
|
|
12
|
+
const GET_SET_STORES_V2 = 'api/v2/stores';
|
|
12
13
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
13
14
|
const REQUEST_PARAMS = {
|
|
14
15
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -107,3 +108,17 @@ export const getStoresByIdCustomersApp = function (id) {
|
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
};
|
|
111
|
+
export const getOrderSequence = function (storeId) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
try {
|
|
114
|
+
const config = {
|
|
115
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
116
|
+
};
|
|
117
|
+
return yield this.axiosInstance.get(`${GET_SET_STORES_V2}/${storeId}/settings/order-sequence`, config).then(response => { var _a; return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.data) || {}; });
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
console.error('Error fetching getOrderSequence:', error);
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
package/dist/api/stores/put.js
CHANGED
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
const GET_SET_STORES = 'api/store';
|
|
11
|
+
const GET_SET_STORES_V2 = 'api/v2/stores';
|
|
11
12
|
const REQUEST_PARAMS = {
|
|
12
13
|
token: 'LOGGED_USER_TOKEN',
|
|
13
14
|
};
|
|
@@ -41,3 +42,17 @@ export const deleteStoreById = function (storeId) {
|
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
};
|
|
45
|
+
export const setOrderSequence = function (storeId, data) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
try {
|
|
48
|
+
const config = {
|
|
49
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
50
|
+
};
|
|
51
|
+
return yield this.axiosInstance.put(`${GET_SET_STORES_V2}/${storeId}/settings/order-sequence`, data, config);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('Error fetching setOrderSequence:', error);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -14,9 +14,9 @@ import { deleteStoreStaffById } from "./staff/delete";
|
|
|
14
14
|
import { getStoreStaff, getStoreStaffById } from "./staff/get";
|
|
15
15
|
import { createStoreStaff } from "./staff/post";
|
|
16
16
|
import { updateStoreStaffById } from "./staff/put";
|
|
17
|
-
import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
|
|
17
|
+
import { getOrderSequence, getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
|
|
18
18
|
import { copyStore, createStore, createStoreImage } from "./stores/post";
|
|
19
|
-
import { deleteStoreById, updateStoreById } from "./stores/put";
|
|
19
|
+
import { deleteStoreById, setOrderSequence, updateStoreById } from "./stores/put";
|
|
20
20
|
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
|
|
21
21
|
import { deleteSupplyById } from "./supplies/delete";
|
|
22
22
|
import { getSupplies, getSupplyById, getSupplyHistory } from "./supplies/get";
|
|
@@ -178,6 +178,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
178
178
|
createStoreImage: createStoreImage,
|
|
179
179
|
getStoreReviewLink: getStoreReviewLink,
|
|
180
180
|
deleteStoreById: deleteStoreById,
|
|
181
|
+
getOrderSequence: getOrderSequence,
|
|
182
|
+
setOrderSequence: setOrderSequence,
|
|
181
183
|
});
|
|
182
184
|
this.products = bindMethods(this, {
|
|
183
185
|
getById: productsEndpoints.getModule.getById,
|
|
@@ -310,6 +312,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
310
312
|
getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
|
|
311
313
|
getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
|
|
312
314
|
getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
|
|
315
|
+
getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
|
|
313
316
|
getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
|
|
314
317
|
getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
|
|
315
318
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
package/src/api/reports/get.ts
CHANGED
|
@@ -347,4 +347,27 @@ export const getCashUpReportsByDateRange = async function (this: WashdayClientIn
|
|
|
347
347
|
console.error('Error fetching getCashUpReportsByDateRange:', error);
|
|
348
348
|
throw error;
|
|
349
349
|
}
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export const getScheduledDeliveries = async function (this: WashdayClientInstance, companyId: string, params: {
|
|
353
|
+
storeId?: string
|
|
354
|
+
dateFrom?: string
|
|
355
|
+
dateTo?: string
|
|
356
|
+
includeDelivered?: string
|
|
357
|
+
}): Promise<any> {
|
|
358
|
+
try {
|
|
359
|
+
const config = {
|
|
360
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
361
|
+
};
|
|
362
|
+
const queryParams = generateQueryParamsStr([
|
|
363
|
+
'storeId',
|
|
364
|
+
'dateFrom',
|
|
365
|
+
'dateTo',
|
|
366
|
+
'includeDelivered',
|
|
367
|
+
], params);
|
|
368
|
+
return await this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries?${queryParams}`, config);
|
|
369
|
+
} catch (error) {
|
|
370
|
+
console.error('Error fetching getScheduledDeliveries:', error);
|
|
371
|
+
throw error;
|
|
372
|
+
}
|
|
350
373
|
};
|
package/src/api/stores/get.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
|
4
4
|
import axiosInstance from "../axiosInstance";
|
|
5
5
|
|
|
6
6
|
const GET_SET_STORES = 'api/store';
|
|
7
|
+
const GET_SET_STORES_V2 = 'api/v2/stores';
|
|
7
8
|
const GET_SET_STORE_IMAGE = 'api/store-image';
|
|
8
9
|
const REQUEST_PARAMS = {
|
|
9
10
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -91,3 +92,15 @@ export const getStoresByIdCustomersApp = async function (this: WashdayClientInst
|
|
|
91
92
|
throw error;
|
|
92
93
|
}
|
|
93
94
|
};
|
|
95
|
+
|
|
96
|
+
export const getOrderSequence = async function (this: WashdayClientInstance, storeId: string): Promise<any> {
|
|
97
|
+
try {
|
|
98
|
+
const config = {
|
|
99
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
100
|
+
};
|
|
101
|
+
return await this.axiosInstance.get(`${GET_SET_STORES_V2}/${storeId}/settings/order-sequence`, config).then(response => response.data?.data || {});
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.error('Error fetching getOrderSequence:', error);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
};
|
package/src/api/stores/put.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
import { IStore } from "../../interfaces/Store";
|
|
3
3
|
import axiosInstance from "../axiosInstance";
|
|
4
4
|
const GET_SET_STORES = 'api/store';
|
|
5
|
+
const GET_SET_STORES_V2 = 'api/v2/stores';
|
|
5
6
|
const REQUEST_PARAMS = {
|
|
6
7
|
token: 'LOGGED_USER_TOKEN',
|
|
7
8
|
};
|
|
@@ -32,4 +33,16 @@ export const deleteStoreById = async function (this: WashdayClientInstance, stor
|
|
|
32
33
|
console.error('Error fetching deleteStoreById:', error);
|
|
33
34
|
throw error;
|
|
34
35
|
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const setOrderSequence = async function (this: WashdayClientInstance, storeId: string, data: { currentSequence: number }): Promise<any> {
|
|
39
|
+
try {
|
|
40
|
+
const config = {
|
|
41
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
42
|
+
};
|
|
43
|
+
return await this.axiosInstance.put(`${GET_SET_STORES_V2}/${storeId}/settings/order-sequence`, data, config);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Error fetching setOrderSequence:', error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
35
48
|
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -13,9 +13,9 @@ import { deleteStoreStaffById } from "../api/staff/delete";
|
|
|
13
13
|
import { getStoreStaff, getStoreStaffById } from "../api/staff/get";
|
|
14
14
|
import { createStoreStaff } from "../api/staff/post";
|
|
15
15
|
import { updateStoreStaffById } from "../api/staff/put";
|
|
16
|
-
import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "../api/stores/get";
|
|
16
|
+
import { getOrderSequence, getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "../api/stores/get";
|
|
17
17
|
import { copyStore, createStore, createStoreImage } from "../api/stores/post";
|
|
18
|
-
import { deleteStoreById, updateStoreById } from "../api/stores/put";
|
|
18
|
+
import { deleteStoreById, setOrderSequence, updateStoreById } from "../api/stores/put";
|
|
19
19
|
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "../api/stripe/post";
|
|
20
20
|
import { deleteSupplyById } from "../api/supplies/delete";
|
|
21
21
|
import { getSupplies, getSupplyById, getSupplyHistory } from "../api/supplies/get";
|
|
@@ -163,6 +163,8 @@ export interface WashdayClientInstance {
|
|
|
163
163
|
createStoreImage: typeof createStoreImage;
|
|
164
164
|
getStoreReviewLink: typeof getStoreReviewLink;
|
|
165
165
|
deleteStoreById: typeof deleteStoreById;
|
|
166
|
+
getOrderSequence: typeof getOrderSequence;
|
|
167
|
+
setOrderSequence: typeof setOrderSequence;
|
|
166
168
|
};
|
|
167
169
|
products: {
|
|
168
170
|
getById: typeof productsEndpoints.getModule.getById;
|
|
@@ -295,6 +297,7 @@ export interface WashdayClientInstance {
|
|
|
295
297
|
getProductSalesReport: typeof reportsExportEndpoints.getModule.getProductSalesReport;
|
|
296
298
|
getPaymentLinesReport: typeof reportsExportEndpoints.getModule.getPaymentLinesReport;
|
|
297
299
|
getUnpaidOrdersReport: typeof reportsExportEndpoints.getModule.getUnpaidOrdersReport;
|
|
300
|
+
getScheduledDeliveries: typeof reportsExportEndpoints.getModule.getScheduledDeliveries;
|
|
298
301
|
getAnnualSalesStatistics: typeof reportsExportEndpoints.getModule.getAnnualSalesStatistics;
|
|
299
302
|
getPaymentMethodStatistics: typeof reportsExportEndpoints.getModule.getPaymentMethodStatistics;
|
|
300
303
|
getProductsStatistics: typeof reportsExportEndpoints.getModule.getProductsStatistics;
|