washday-sdk 0.0.110 → 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";
@@ -91,6 +91,7 @@ const WashdayClient = function WashdayClient(apiToken) {
91
91
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
92
92
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
93
93
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
94
+ getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
94
95
  });
95
96
  this.customers = bindMethods(this, {
96
97
  getCustomers: customersEndpoints.getModule.getList,
@@ -107,6 +108,7 @@ const WashdayClient = function WashdayClient(apiToken) {
107
108
  getStoreById: getStoreById,
108
109
  getStoreImages: getStoreImages,
109
110
  getStoresByName: getStoresByName,
111
+ getStoresByIdCustomersApp: getStoresByIdCustomersApp,
110
112
  createStore: createStore,
111
113
  copyStore: copyStore,
112
114
  updateStoreById: updateStoreById,
@@ -141,6 +143,7 @@ const WashdayClient = function WashdayClient(apiToken) {
141
143
  this.sections = bindMethods(this, {
142
144
  getSections: sectionsEndpoints.getModule.getList,
143
145
  getById: sectionsEndpoints.getModule.getById,
146
+ getSectionsByStoreCustomersApp: sectionsEndpoints.getModule.getSectionsByStoreCustomersApp,
144
147
  create: sectionsEndpoints.postModule.create,
145
148
  deleteById: sectionsEndpoints.deleteModule.deleteById,
146
149
  updateById: sectionsEndpoints.putModule.updateById,
@@ -140,3 +140,17 @@ export const getListCustomersApp = function (params) {
140
140
  }
141
141
  });
142
142
  };
143
+ export const getByIdCustomersApp = function (id) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ try {
146
+ const config = {
147
+ headers: { Authorization: `Bearer ${this.apiToken}` }
148
+ };
149
+ return yield axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
150
+ }
151
+ catch (error) {
152
+ console.error('Error fetching:', error);
153
+ throw error;
154
+ }
155
+ });
156
+ };
@@ -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.110",
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";
@@ -97,6 +97,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
97
97
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
98
98
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
99
99
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
100
+ getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
100
101
  });
101
102
  this.customers = bindMethods(this, {
102
103
  getCustomers: customersEndpoints.getModule.getList,
@@ -113,6 +114,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
113
114
  getStoreById: getStoreById,
114
115
  getStoreImages: getStoreImages,
115
116
  getStoresByName: getStoresByName,
117
+ getStoresByIdCustomersApp: getStoresByIdCustomersApp,
116
118
  createStore: createStore,
117
119
  copyStore: copyStore,
118
120
  updateStoreById: updateStoreById,
@@ -147,6 +149,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
147
149
  this.sections = bindMethods(this, {
148
150
  getSections: sectionsEndpoints.getModule.getList,
149
151
  getById: sectionsEndpoints.getModule.getById,
152
+ getSectionsByStoreCustomersApp: sectionsEndpoints.getModule.getSectionsByStoreCustomersApp,
150
153
  create: sectionsEndpoints.postModule.create,
151
154
  deleteById: sectionsEndpoints.deleteModule.deleteById,
152
155
  updateById: sectionsEndpoints.putModule.updateById,
@@ -160,3 +160,15 @@ export const getListCustomersApp = async function (this: WashdayClientInstance,
160
160
  throw error;
161
161
  }
162
162
  };
163
+
164
+ export const getByIdCustomersApp = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
165
+ try {
166
+ const config = {
167
+ headers: { Authorization: `Bearer ${this.apiToken}` }
168
+ };
169
+ return await axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
170
+ } catch (error) {
171
+ console.error('Error fetching:', error);
172
+ throw error;
173
+ }
174
+ }
@@ -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";
@@ -83,6 +83,7 @@ export interface WashdayClientInstance {
83
83
  createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
84
84
  deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
85
85
  getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
86
+ getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;
86
87
  };
87
88
  customers: {
88
89
  getCustomers: typeof customersEndpoints.getModule.getList;
@@ -99,6 +100,7 @@ export interface WashdayClientInstance {
99
100
  getStoreById: typeof getStoreById;
100
101
  getStoreImages: typeof getStoreImages;
101
102
  getStoresByName: typeof getStoresByName;
103
+ getStoresByIdCustomersApp: typeof getStoresByIdCustomersApp;
102
104
  createStore: typeof createStore;
103
105
  copyStore: typeof copyStore;
104
106
  updateStoreById: typeof updateStoreById;
@@ -133,6 +135,7 @@ export interface WashdayClientInstance {
133
135
  sections: {
134
136
  getSections: typeof sectionsEndpoints.getModule.getList;
135
137
  getById: typeof sectionsEndpoints.getModule.getById;
138
+ getSectionsByStoreCustomersApp: typeof sectionsEndpoints.getModule.getSectionsByStoreCustomersApp;
136
139
  create: typeof sectionsEndpoints.postModule.create;
137
140
  deleteById: typeof sectionsEndpoints.deleteModule.deleteById;
138
141
  updateById: typeof sectionsEndpoints.putModule.updateById;