washday-sdk 0.0.55 → 0.0.57
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 +2 -1
- package/dist/api/staff/put.js +2 -2
- package/dist/api/stores/put.js +17 -1
- package/package.json +2 -2
- package/src/api/index.ts +3 -2
- package/src/api/staff/put.ts +2 -2
- package/src/api/stores/put.ts +14 -0
package/dist/api/index.js
CHANGED
|
@@ -37,7 +37,8 @@ WashdayClient.prototype.stores = {
|
|
|
37
37
|
getStoreById: get_6.getStoreById,
|
|
38
38
|
updateStoreById: put_4.updateStoreById,
|
|
39
39
|
createStoreImage: post_3.createStoreImage,
|
|
40
|
-
getStoreReviewLink: get_6.getStoreReviewLink
|
|
40
|
+
getStoreReviewLink: get_6.getStoreReviewLink,
|
|
41
|
+
deleteStoreById: put_4.deleteStoreById,
|
|
41
42
|
};
|
|
42
43
|
WashdayClient.prototype.products = {
|
|
43
44
|
bulkUpdate: put_2.bulkUpdate,
|
package/dist/api/staff/put.js
CHANGED
|
@@ -14,13 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.updateStoreStaffById = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
-
const updateStoreStaffById = function (storeId, data) {
|
|
17
|
+
const updateStoreStaffById = function (storeId, staffId, data) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
try {
|
|
20
20
|
const config = {
|
|
21
21
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
22
|
};
|
|
23
|
-
const response = yield axiosInstance_1.default.put(`api/store/${storeId}/staff`, data, config);
|
|
23
|
+
const response = yield axiosInstance_1.default.put(`api/store/${storeId}/staff/${staffId}`, data, config);
|
|
24
24
|
return response;
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
package/dist/api/stores/put.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.updateStoreById = void 0;
|
|
15
|
+
exports.deleteStoreById = exports.updateStoreById = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
17
|
const GET_SET_STORES = 'api/store';
|
|
18
18
|
const REQUEST_PARAMS = {
|
|
@@ -34,3 +34,19 @@ const updateStoreById = function (storeId, data) {
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
exports.updateStoreById = updateStoreById;
|
|
37
|
+
const deleteStoreById = function (storeId) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const config = {
|
|
41
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
42
|
+
};
|
|
43
|
+
const response = yield axiosInstance_1.default.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error('Error fetching deleteStoreById:', error);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.deleteStoreById = deleteStoreById;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "washday-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"description": "Washday utilities functions and API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"
|
|
9
|
+
"publishVersion": "npm run build && npm publish --access public"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"washday"
|
package/src/api/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { createStoreStaff } from "./staff/post";
|
|
|
12
12
|
import { updateStoreStaffById } from "./staff/put";
|
|
13
13
|
import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
|
|
14
14
|
import { createStoreImage } from "./stores/post";
|
|
15
|
-
import { updateStoreById } from "./stores/put";
|
|
15
|
+
import { deleteStoreById, updateStoreById } from "./stores/put";
|
|
16
16
|
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
|
|
17
17
|
import { updateUserById } from "./users/put";
|
|
18
18
|
|
|
@@ -45,7 +45,8 @@ WashdayClient.prototype.stores = {
|
|
|
45
45
|
getStoreById: getStoreById,
|
|
46
46
|
updateStoreById: updateStoreById,
|
|
47
47
|
createStoreImage: createStoreImage,
|
|
48
|
-
getStoreReviewLink: getStoreReviewLink
|
|
48
|
+
getStoreReviewLink: getStoreReviewLink,
|
|
49
|
+
deleteStoreById: deleteStoreById,
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
|
package/src/api/staff/put.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
import { IStore } from "../../interfaces/Store";
|
|
3
3
|
import axiosInstance from "../axiosInstance";
|
|
4
4
|
|
|
5
|
-
export const updateStoreStaffById = async function (this: WashdayClientInstance, storeId: string, data: IStore): Promise<any> {
|
|
5
|
+
export const updateStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string, data: IStore): Promise<any> {
|
|
6
6
|
try {
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.put(`api/store/${storeId}/staff`, data, config);
|
|
10
|
+
const response = await axiosInstance.put(`api/store/${storeId}/staff/${staffId}`, data, config);
|
|
11
11
|
return response;
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching getStoreById:', error);
|
package/src/api/stores/put.ts
CHANGED
|
@@ -18,4 +18,18 @@ export const updateStoreById = async function (this: WashdayClientInstance, stor
|
|
|
18
18
|
console.error('Error fetching getStoreById:', error);
|
|
19
19
|
throw error;
|
|
20
20
|
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export const deleteStoreById = async function (this: WashdayClientInstance, storeId: string): Promise<any> {
|
|
25
|
+
try {
|
|
26
|
+
const config = {
|
|
27
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
28
|
+
};
|
|
29
|
+
const response = await axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
30
|
+
return response;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Error fetching deleteStoreById:', error);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
21
35
|
};
|