washday-sdk 0.0.111 → 0.0.112

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
@@ -13,7 +13,7 @@ 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, getStoresByName } from "./stores/get";
16
+ import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
17
17
  import { copyStore, createStore, createStoreImage } from "./stores/post";
18
18
  import { deleteStoreById, updateStoreById } from "./stores/put";
19
19
  import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
@@ -108,6 +108,7 @@ const WashdayClient = function WashdayClient(apiToken) {
108
108
  getStoreById: getStoreById,
109
109
  getStoreImages: getStoreImages,
110
110
  getStoresByName: getStoresByName,
111
+ getStoresByIdCustomersApp: getStoresByIdCustomersApp,
111
112
  createStore: createStore,
112
113
  copyStore: copyStore,
113
114
  updateStoreById: updateStoreById,
@@ -142,6 +143,7 @@ const WashdayClient = function WashdayClient(apiToken) {
142
143
  this.sections = bindMethods(this, {
143
144
  getSections: sectionsEndpoints.getModule.getList,
144
145
  getById: sectionsEndpoints.getModule.getById,
146
+ getSectionsByStoreCustomersApp: sectionsEndpoints.getModule.getSectionsByStoreCustomersApp,
145
147
  create: sectionsEndpoints.postModule.create,
146
148
  deleteById: sectionsEndpoints.deleteModule.deleteById,
147
149
  updateById: sectionsEndpoints.putModule.updateById,
@@ -7,8 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { generateQueryParamsStr } from "../../utils/apiUtils";
10
11
  import axiosInstance from "../axiosInstance";
11
12
  const GET_SET_SECTIONS = 'api/section';
13
+ const GET_SET_SECTIONS_WASHDAY_APP = 'api/v2/washdayapp/sections';
12
14
  export const getList = function (params) {
13
15
  return __awaiter(this, void 0, void 0, function* () {
14
16
  try {
@@ -50,3 +52,20 @@ export const getById = function (id) {
50
52
  }
51
53
  });
52
54
  };
55
+ export const getSectionsByStoreCustomersApp = function (params) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ const config = {
59
+ headers: { Authorization: `Bearer ${this.apiToken}` }
60
+ };
61
+ const queryParams = generateQueryParamsStr([
62
+ 'storeId',
63
+ ], params);
64
+ return yield axiosInstance.get(`${GET_SET_SECTIONS_WASHDAY_APP}?${queryParams}`, config);
65
+ }
66
+ catch (error) {
67
+ console.error('Error fetching getSectionsByStoreCustomersApp:', error);
68
+ throw error;
69
+ }
70
+ });
71
+ };
@@ -92,3 +92,19 @@ export const getStoresByName = function (query) {
92
92
  }
93
93
  });
94
94
  };
95
+ export const getStoresByIdCustomersApp = function (id) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ var _a, _b;
98
+ try {
99
+ const config = {
100
+ headers: { Authorization: `Bearer ${this.apiToken}` }
101
+ };
102
+ const response = yield axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
103
+ return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.store) || [];
104
+ }
105
+ catch (error) {
106
+ console.error('Error fetching getStoresByIdCustomersApp:', error);
107
+ throw error;
108
+ }
109
+ });
110
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -14,7 +14,7 @@ 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, getStoresByName } from "./stores/get";
17
+ import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "./stores/get";
18
18
  import { copyStore, createStore, createStoreImage } from "./stores/post";
19
19
  import { deleteStoreById, updateStoreById } from "./stores/put";
20
20
  import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
@@ -114,6 +114,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
114
114
  getStoreById: getStoreById,
115
115
  getStoreImages: getStoreImages,
116
116
  getStoresByName: getStoresByName,
117
+ getStoresByIdCustomersApp: getStoresByIdCustomersApp,
117
118
  createStore: createStore,
118
119
  copyStore: copyStore,
119
120
  updateStoreById: updateStoreById,
@@ -148,6 +149,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
148
149
  this.sections = bindMethods(this, {
149
150
  getSections: sectionsEndpoints.getModule.getList,
150
151
  getById: sectionsEndpoints.getModule.getById,
152
+ getSectionsByStoreCustomersApp: sectionsEndpoints.getModule.getSectionsByStoreCustomersApp,
151
153
  create: sectionsEndpoints.postModule.create,
152
154
  deleteById: sectionsEndpoints.deleteModule.deleteById,
153
155
  updateById: sectionsEndpoints.putModule.updateById,
@@ -1,8 +1,10 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import { ISection } from "../../interfaces/Section";
3
+ import { IStore } from "../../interfaces/Store";
4
+ import { generateQueryParamsStr } from "../../utils/apiUtils";
3
5
  import axiosInstance from "../axiosInstance";
4
-
5
6
  const GET_SET_SECTIONS = 'api/section';
7
+ const GET_SET_SECTIONS_WASHDAY_APP = 'api/v2/washdayapp/sections';
6
8
 
7
9
  export const getList = async function (this: WashdayClientInstance, params?: {
8
10
  storeId?: string
@@ -43,4 +45,23 @@ export const getById = async function (this: WashdayClientInstance, id: string):
43
45
  console.error('Error fetching getSectionById:', error);
44
46
  throw error;
45
47
  }
46
- };
48
+ };
49
+
50
+ export const getSectionsByStoreCustomersApp = async function (this: WashdayClientInstance,
51
+ params: {
52
+ storeId: string
53
+ }
54
+ ): Promise<{ store: IStore }> {
55
+ try {
56
+ const config = {
57
+ headers: { Authorization: `Bearer ${this.apiToken}` }
58
+ };
59
+ const queryParams = generateQueryParamsStr([
60
+ 'storeId',
61
+ ], params);
62
+ return await axiosInstance.get(`${GET_SET_SECTIONS_WASHDAY_APP}?${queryParams}`, config);
63
+ } catch (error) {
64
+ console.error('Error fetching getSectionsByStoreCustomersApp:', error);
65
+ throw error;
66
+ }
67
+ };
@@ -78,3 +78,16 @@ export const getStoresByName = async function (this: WashdayClientInstance, quer
78
78
  throw error;
79
79
  }
80
80
  };
81
+
82
+ export const getStoresByIdCustomersApp = async function (this: WashdayClientInstance, id: string): Promise<{ store: IStore }> {
83
+ try {
84
+ const config = {
85
+ headers: { Authorization: `Bearer ${this.apiToken}` }
86
+ };
87
+ const response = await axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
88
+ return response.data?.data?.store || [];
89
+ } catch (error) {
90
+ console.error('Error fetching getStoresByIdCustomersApp:', error);
91
+ throw error;
92
+ }
93
+ };
@@ -13,7 +13,7 @@ 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, getStoresByName } from "../api/stores/get";
16
+ import { getStoreById, getStoreImages, getStoreReviewLink, getStores, getStoresByIdCustomersApp, getStoresByName } from "../api/stores/get";
17
17
  import { copyStore, createStore, createStoreImage } from "../api/stores/post";
18
18
  import { deleteStoreById, updateStoreById } from "../api/stores/put";
19
19
  import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "../api/stripe/post";
@@ -100,6 +100,7 @@ export interface WashdayClientInstance {
100
100
  getStoreById: typeof getStoreById;
101
101
  getStoreImages: typeof getStoreImages;
102
102
  getStoresByName: typeof getStoresByName;
103
+ getStoresByIdCustomersApp: typeof getStoresByIdCustomersApp;
103
104
  createStore: typeof createStore;
104
105
  copyStore: typeof copyStore;
105
106
  updateStoreById: typeof updateStoreById;
@@ -134,6 +135,7 @@ export interface WashdayClientInstance {
134
135
  sections: {
135
136
  getSections: typeof sectionsEndpoints.getModule.getList;
136
137
  getById: typeof sectionsEndpoints.getModule.getById;
138
+ getSectionsByStoreCustomersApp: typeof sectionsEndpoints.getModule.getSectionsByStoreCustomersApp;
137
139
  create: typeof sectionsEndpoints.postModule.create;
138
140
  deleteById: typeof sectionsEndpoints.deleteModule.deleteById;
139
141
  updateById: typeof sectionsEndpoints.putModule.updateById;