washday-sdk 0.0.42 → 0.0.43

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
@@ -21,7 +21,8 @@ WashdayClient.prototype.stores = {
21
21
  getStores: get_2.getStores,
22
22
  getStoreById: get_2.getStoreById,
23
23
  updateStoreById: put_2.updateStoreById,
24
- createStoreImage: post_1.createStoreImage
24
+ createStoreImage: post_1.createStoreImage,
25
+ getStoreReviewLink: get_2.getStoreReviewLink
25
26
  };
26
27
  WashdayClient.prototype.products = {
27
28
  bulkUpdate: put_1.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.getStoreById = exports.getStores = void 0;
15
+ exports.getStoreById = exports.getStoreReviewLink = exports.getStores = void 0;
16
16
  const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
17
  const GET_SET_STORES = 'api/store';
18
18
  const REQUEST_PARAMS = {
@@ -37,6 +37,22 @@ const getStores = function (params) {
37
37
  });
38
38
  };
39
39
  exports.getStores = getStores;
40
+ const getStoreReviewLink = function (storeId) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ try {
43
+ const config = {
44
+ headers: { Authorization: `Bearer ${this.apiToken}` }
45
+ };
46
+ const response = yield axiosInstance_1.default.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
47
+ return response;
48
+ }
49
+ catch (error) {
50
+ console.error('Error fetching getStoreReviewLink:', error);
51
+ throw error;
52
+ }
53
+ });
54
+ };
55
+ exports.getStoreReviewLink = getStoreReviewLink;
40
56
  const getStoreById = function (storeId) {
41
57
  return __awaiter(this, void 0, void 0, function* () {
42
58
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/api/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
2
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
3
3
  import { bulkUpdate } from "./products/put";
4
- import { getStoreById, getStores } from "./stores/get";
4
+ import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
5
5
  import { createStoreImage } from "./stores/post";
6
6
  import { updateStoreById } from "./stores/put";
7
7
  import { updateUserById } from "./users/put";
@@ -29,7 +29,8 @@ WashdayClient.prototype.stores = {
29
29
  getStores: getStores,
30
30
  getStoreById: getStoreById,
31
31
  updateStoreById: updateStoreById,
32
- createStoreImage: createStoreImage
32
+ createStoreImage: createStoreImage,
33
+ getStoreReviewLink: getStoreReviewLink
33
34
  };
34
35
 
35
36
 
@@ -25,6 +25,19 @@ export const getStores = async function (this: WashdayClientInstance, params: {
25
25
  };
26
26
 
27
27
 
28
+ export const getStoreReviewLink = async function (this: WashdayClientInstance, storeId: string): Promise<any> {
29
+ try {
30
+ const config = {
31
+ headers: { Authorization: `Bearer ${this.apiToken}` }
32
+ };
33
+ const response = await axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
34
+ return response;
35
+ } catch (error) {
36
+ console.error('Error fetching getStoreReviewLink:', error);
37
+ throw error;
38
+ }
39
+ };
40
+
28
41
  export const getStoreById = async function (this: WashdayClientInstance, storeId: string): Promise<{ store: IStore }> {
29
42
  try {
30
43
  REQUEST_PARAMS.token = this.apiToken;
@@ -4,19 +4,26 @@ import { IUser } from "../../interfaces/User";
4
4
  import axiosInstance from "../axiosInstance";
5
5
  const GET_SET_USER = 'api/user';
6
6
  const REQUEST_PARAMS = {
7
- token: 'LOGGED_USER_TOKEN',
7
+ token: 'LOGGED_USER_TOKEN',
8
8
  };
9
9
 
10
+ interface userDTO {
11
+ printer?: {
12
+ name: string,
13
+ paperSize: string
14
+ }
15
+ freshChatRestoreID?: string
16
+ }
10
17
 
11
- export const updateUserById = async function (this: WashdayClientInstance, userId: string, data: IUser): Promise<any> {
12
- try {
13
- const config = {
14
- headers: { Authorization: `Bearer ${this.apiToken}`}
15
- };
16
- const response = await axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
17
- return response.data || {}
18
- } catch (error) {
19
- console.error('Error fetching updateUserById:', error);
20
- throw error;
21
- }
18
+ export const updateUserById = async function (this: WashdayClientInstance, userId: string, data: userDTO): Promise<any> {
19
+ try {
20
+ const config = {
21
+ headers: { Authorization: `Bearer ${this.apiToken}` }
22
+ };
23
+ const response = await axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
24
+ return response.data || {}
25
+ } catch (error) {
26
+ console.error('Error fetching updateUserById:', error);
27
+ throw error;
28
+ }
22
29
  };