washday-sdk 0.0.56 → 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 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,
@@ -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.56",
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
- "publish": "npm run build && npm publish --access public"
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
 
@@ -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
  };