washday-sdk 0.0.53 → 0.0.54

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.
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // import { WashdayClientInstance } from "../../interfaces/Api";
3
+ // import axiosInstance from "../axiosInstance";
4
+ // export const deleteStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string): Promise<any> {
5
+ // try {
6
+ // const config = {
7
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
8
+ // };
9
+ // const response = await axiosInstance.delete(`api/store/${storeId}/staff/${staffId}`, config);
10
+ // return response;
11
+ // } catch (error) {
12
+ // console.error('Error fetching getStoreStaff:', error);
13
+ // throw error;
14
+ // }
15
+ // };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.getCashierboxesByStoreId = exports.GET_SET_CASHIER_BOX = void 0;
16
+ const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
+ const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
18
+ exports.GET_SET_CASHIER_BOX = GET_SET_CASHIER_BOX;
19
+ const getCashierboxesByStoreId = function (storeId, queryParams) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const config = {
23
+ headers: { Authorization: `Bearer ${this.apiToken}` }
24
+ };
25
+ const response = yield axiosInstance_1.default.get(`${(0, exports.GET_SET_CASHIER_BOX)(storeId)}?${queryParams}`, config);
26
+ return response;
27
+ }
28
+ catch (error) {
29
+ console.error('Error fetching getStoreStaff:', error);
30
+ throw error;
31
+ }
32
+ });
33
+ };
34
+ exports.getCashierboxesByStoreId = getCashierboxesByStoreId;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // import { WashdayClientInstance } from "../../interfaces/Api";
3
+ // import axiosInstance from "../axiosInstance";
4
+ // const GET_SET_STORES = 'api/store';
5
+ // export const createStoreStaff = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
6
+ // try {
7
+ // const config = {
8
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ // };
10
+ // const response = await axiosInstance.post(`api/store/${storeId}/staff`, data, config);
11
+ // return response;
12
+ // } catch (error) {
13
+ // console.error('Error fetching createStoreImage:', error);
14
+ // throw error;
15
+ // }
16
+ // };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // import { WashdayClientInstance } from "../../interfaces/Api";
3
+ // import { IStore } from "../../interfaces/Store";
4
+ // import axiosInstance from "../axiosInstance";
5
+ // export const updateStoreStaffById = async function (this: WashdayClientInstance, storeId: string, data: IStore): Promise<any> {
6
+ // try {
7
+ // const config = {
8
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ // };
10
+ // const response = await axiosInstance.put(`api/store/${storeId}/staff`, data, config);
11
+ // return response;
12
+ // } catch (error) {
13
+ // console.error('Error fetching getStoreById:', error);
14
+ // throw error;
15
+ // }
16
+ // };
package/dist/api/index.js CHANGED
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_1 = require("./companies/get");
3
+ const get_1 = require("./cashierbox/get");
4
+ const get_2 = require("./companies/get");
4
5
  const post_1 = require("./companies/post");
5
6
  const put_1 = require("./companies/put");
6
- const get_2 = require("./countries/get");
7
- const get_3 = require("./customers/get");
7
+ const get_3 = require("./countries/get");
8
+ const get_4 = require("./customers/get");
8
9
  const put_2 = require("./products/put");
9
10
  const delete_1 = require("./staff/delete");
10
- const get_4 = require("./staff/get");
11
+ const get_5 = require("./staff/get");
11
12
  const post_2 = require("./staff/post");
12
13
  const put_3 = require("./staff/put");
13
- const get_5 = require("./stores/get");
14
+ const get_6 = require("./stores/get");
14
15
  const post_3 = require("./stores/post");
15
16
  const put_4 = require("./stores/put");
16
17
  const post_4 = require("./stripe/post");
@@ -25,17 +26,18 @@ const WashdayClient = function WashdayClient(apiToken) {
25
26
  WashdayClient.prototype.companies.apiToken = apiToken;
26
27
  WashdayClient.prototype.stripe.apiToken = apiToken;
27
28
  WashdayClient.prototype.staff.apiToken = apiToken;
29
+ WashdayClient.prototype.cashierboxes.apiToken = apiToken;
28
30
  };
29
31
  WashdayClient.prototype.customers = {
30
- getCustomerById: get_3.getCustomerById,
31
- getCustomerHighlightsById: get_3.getCustomerHighlightsById
32
+ getCustomerById: get_4.getCustomerById,
33
+ getCustomerHighlightsById: get_4.getCustomerHighlightsById
32
34
  };
33
35
  WashdayClient.prototype.stores = {
34
- getStores: get_5.getStores,
35
- getStoreById: get_5.getStoreById,
36
+ getStores: get_6.getStores,
37
+ getStoreById: get_6.getStoreById,
36
38
  updateStoreById: put_4.updateStoreById,
37
39
  createStoreImage: post_3.createStoreImage,
38
- getStoreReviewLink: get_5.getStoreReviewLink
40
+ getStoreReviewLink: get_6.getStoreReviewLink
39
41
  };
40
42
  WashdayClient.prototype.products = {
41
43
  bulkUpdate: put_2.bulkUpdate,
@@ -44,10 +46,13 @@ WashdayClient.prototype.users = {
44
46
  updateUserById: put_5.updateUserById,
45
47
  };
46
48
  WashdayClient.prototype.countries = {
47
- getCountries: get_2.getCountries,
49
+ getCountries: get_3.getCountries,
50
+ };
51
+ WashdayClient.prototype.cashierboxes = {
52
+ getCashierboxesByStoreId: get_1.getCashierboxesByStoreId,
48
53
  };
49
54
  WashdayClient.prototype.companies = {
50
- getCompanyById: get_1.getCompanyById,
55
+ getCompanyById: get_2.getCompanyById,
51
56
  updateCompanyById: put_1.updateCompanyById,
52
57
  updateCompanyLogoById: put_1.updateCompanyLogoById,
53
58
  updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById,
@@ -60,7 +65,7 @@ WashdayClient.prototype.stripe = {
60
65
  createCustomerPortalSession: post_4.createCustomerPortalSession
61
66
  };
62
67
  WashdayClient.prototype.staff = {
63
- getStoreStaff: get_4.getStoreStaff,
68
+ getStoreStaff: get_5.getStoreStaff,
64
69
  updateStoreStaffById: put_3.updateStoreStaffById,
65
70
  createStoreStaff: post_2.createStoreStaff,
66
71
  deleteStoreStaffById: delete_1.deleteStoreStaffById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,15 @@
1
+ // import { WashdayClientInstance } from "../../interfaces/Api";
2
+ // import axiosInstance from "../axiosInstance";
3
+
4
+ // export const deleteStoreStaffById = async function (this: WashdayClientInstance, storeId: string, staffId: string): Promise<any> {
5
+ // try {
6
+ // const config = {
7
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
8
+ // };
9
+ // const response = await axiosInstance.delete(`api/store/${storeId}/staff/${staffId}`, config);
10
+ // return response;
11
+ // } catch (error) {
12
+ // console.error('Error fetching getStoreStaff:', error);
13
+ // throw error;
14
+ // }
15
+ // };
@@ -0,0 +1,18 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ import { IStore } from "../../interfaces/Store";
4
+
5
+ export const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
6
+
7
+ export const getCashierboxesByStoreId = async function (this: WashdayClientInstance, storeId: string, queryParams?: string): Promise<any> {
8
+ try {
9
+ const config = {
10
+ headers: { Authorization: `Bearer ${this.apiToken}` }
11
+ };
12
+ const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
13
+ return response;
14
+ } catch (error) {
15
+ console.error('Error fetching getStoreStaff:', error);
16
+ throw error;
17
+ }
18
+ };
@@ -0,0 +1,17 @@
1
+ // import { WashdayClientInstance } from "../../interfaces/Api";
2
+ // import axiosInstance from "../axiosInstance";
3
+
4
+ // const GET_SET_STORES = 'api/store';
5
+
6
+ // export const createStoreStaff = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
7
+ // try {
8
+ // const config = {
9
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
10
+ // };
11
+ // const response = await axiosInstance.post(`api/store/${storeId}/staff`, data, config);
12
+ // return response;
13
+ // } catch (error) {
14
+ // console.error('Error fetching createStoreImage:', error);
15
+ // throw error;
16
+ // }
17
+ // };
@@ -0,0 +1,16 @@
1
+ // import { WashdayClientInstance } from "../../interfaces/Api";
2
+ // import { IStore } from "../../interfaces/Store";
3
+ // import axiosInstance from "../axiosInstance";
4
+
5
+ // export const updateStoreStaffById = async function (this: WashdayClientInstance, storeId: string, data: IStore): Promise<any> {
6
+ // try {
7
+ // const config = {
8
+ // headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ // };
10
+ // const response = await axiosInstance.put(`api/store/${storeId}/staff`, data, config);
11
+ // return response;
12
+ // } catch (error) {
13
+ // console.error('Error fetching getStoreById:', error);
14
+ // throw error;
15
+ // }
16
+ // };
package/src/api/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
+ import { getCashierboxesByStoreId } from "./cashierbox/get";
2
3
  import { getCompanyById } from "./companies/get";
3
4
  import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
4
5
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
@@ -31,6 +32,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
31
32
  WashdayClient.prototype.companies.apiToken = apiToken;
32
33
  WashdayClient.prototype.stripe.apiToken = apiToken;
33
34
  WashdayClient.prototype.staff.apiToken = apiToken;
35
+ WashdayClient.prototype.cashierboxes.apiToken = apiToken;
34
36
  } as any;
35
37
 
36
38
  WashdayClient.prototype.customers = {
@@ -59,6 +61,10 @@ WashdayClient.prototype.countries = {
59
61
  getCountries: getCountries,
60
62
  };
61
63
 
64
+ WashdayClient.prototype.cashierboxes = {
65
+ getCashierboxesByStoreId: getCashierboxesByStoreId,
66
+ };
67
+
62
68
  WashdayClient.prototype.companies = {
63
69
  getCompanyById: getCompanyById,
64
70
  updateCompanyById: updateCompanyById,