washday-sdk 1.6.5 → 1.6.6
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 +4 -2
- 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 +4 -2
- package/src/api/stores/get.ts +13 -0
- package/src/api/stores/put.ts +13 -0
- package/src/interfaces/Api.ts +4 -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,
|
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,
|
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;
|