washday-sdk 0.0.71 → 0.0.72
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/axiosInstance.d.ts +2 -0
- package/dist/api/axiosInstance.js +4 -8
- package/dist/api/cashierbox/delete.d.ts +2 -0
- package/dist/api/cashierbox/delete.js +3 -10
- package/dist/api/cashierbox/get.d.ts +7 -0
- package/dist/api/cashierbox/get.js +7 -16
- package/dist/api/cashierbox/post.d.ts +11 -0
- package/dist/api/cashierbox/post.js +5 -13
- package/dist/api/cashierbox/put.d.ts +4 -0
- package/dist/api/cashierbox/put.js +3 -10
- package/dist/api/companies/get.d.ts +2 -0
- package/dist/api/companies/get.js +3 -10
- package/dist/api/companies/post.d.ts +3 -0
- package/dist/api/companies/post.js +5 -13
- package/dist/api/companies/put.d.ts +4 -0
- package/dist/api/companies/put.js +7 -16
- package/dist/api/countries/get.d.ts +2 -0
- package/dist/api/countries/get.js +3 -10
- package/dist/api/countries/post.d.ts +0 -0
- package/dist/api/countries/put.d.ts +0 -0
- package/dist/api/csv/get.d.ts +11 -0
- package/dist/api/csv/get.js +5 -12
- package/dist/api/csv/index.d.ts +1 -0
- package/dist/api/csv/index.js +1 -27
- package/dist/api/customers/delete.d.ts +2 -0
- package/dist/api/customers/delete.js +3 -10
- package/dist/api/customers/get.d.ts +28 -0
- package/dist/api/customers/get.js +12 -22
- package/dist/api/customers/index.d.ts +4 -0
- package/dist/api/customers/index.js +4 -30
- package/dist/api/customers/post.d.ts +18 -0
- package/dist/api/customers/post.js +3 -10
- package/dist/api/customers/put.d.ts +18 -0
- package/dist/api/customers/put.js +3 -10
- package/dist/api/discounts/get.d.ts +6 -0
- package/dist/api/discounts/get.js +11 -22
- package/dist/api/discounts/post.d.ts +3 -0
- package/dist/api/discounts/post.js +5 -13
- package/dist/api/discounts/put.d.ts +3 -0
- package/dist/api/discounts/put.js +5 -13
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.js +78 -103
- package/dist/api/inventory/delete.d.ts +2 -0
- package/dist/api/inventory/delete.js +3 -10
- package/dist/api/inventory/get.d.ts +7 -0
- package/dist/api/inventory/get.js +7 -16
- package/dist/api/inventory/index.d.ts +4 -0
- package/dist/api/inventory/index.js +4 -30
- package/dist/api/inventory/post.d.ts +7 -0
- package/dist/api/inventory/post.js +3 -10
- package/dist/api/inventory/put.d.ts +8 -0
- package/dist/api/inventory/put.js +5 -13
- package/dist/api/products/delete.d.ts +3 -0
- package/dist/api/products/delete.js +5 -13
- package/dist/api/products/get.d.ts +2 -0
- package/dist/api/products/get.js +3 -10
- package/dist/api/products/index.d.ts +4 -0
- package/dist/api/products/index.js +4 -30
- package/dist/api/products/post.d.ts +27 -0
- package/dist/api/products/post.js +5 -13
- package/dist/api/products/put.d.ts +21 -0
- package/dist/api/products/put.js +5 -13
- package/dist/api/sections/delete.d.ts +2 -0
- package/dist/api/sections/delete.js +3 -10
- package/dist/api/sections/get.d.ts +7 -0
- package/dist/api/sections/get.js +5 -13
- package/dist/api/sections/index.d.ts +4 -0
- package/dist/api/sections/index.js +4 -30
- package/dist/api/sections/post.d.ts +7 -0
- package/dist/api/sections/post.js +3 -10
- package/dist/api/sections/put.d.ts +8 -0
- package/dist/api/sections/put.js +3 -10
- package/dist/api/staff/delete.d.ts +2 -0
- package/dist/api/staff/delete.js +3 -10
- package/dist/api/staff/get.d.ts +3 -0
- package/dist/api/staff/get.js +5 -13
- package/dist/api/staff/post.d.ts +2 -0
- package/dist/api/staff/post.js +3 -10
- package/dist/api/staff/put.d.ts +2 -0
- package/dist/api/staff/put.js +3 -10
- package/dist/api/stores/get.d.ts +12 -0
- package/dist/api/stores/get.js +9 -19
- package/dist/api/stores/post.d.ts +4 -0
- package/dist/api/stores/post.js +7 -16
- package/dist/api/stores/put.d.ts +6 -0
- package/dist/api/stores/put.js +5 -13
- package/dist/api/stripe/get.d.ts +0 -0
- package/dist/api/stripe/post.d.ts +6 -0
- package/dist/api/stripe/post.js +7 -16
- package/dist/api/stripe/put.d.ts +0 -0
- package/dist/api/supplies/delete.d.ts +2 -0
- package/dist/api/supplies/delete.js +3 -10
- package/dist/api/supplies/get.d.ts +7 -0
- package/dist/api/supplies/get.js +7 -16
- package/dist/api/supplies/post.d.ts +11 -0
- package/dist/api/supplies/post.js +3 -10
- package/dist/api/supplies/put.d.ts +6 -0
- package/dist/api/supplies/put.js +5 -13
- package/dist/api/users/put.d.ts +10 -0
- package/dist/api/users/put.js +3 -10
- package/dist/enum/index.d.ts +10 -0
- package/dist/enum/index.js +4 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -33
- package/dist/interfaces/Api.d.ts +3 -0
- package/dist/interfaces/Api.js +1 -2
- package/dist/interfaces/Company.d.ts +0 -0
- package/dist/interfaces/Customer.d.ts +47 -0
- package/dist/interfaces/Customer.js +1 -2
- package/dist/interfaces/Order.d.ts +91 -0
- package/dist/interfaces/Order.js +1 -2
- package/dist/interfaces/Permission.d.ts +22 -0
- package/dist/interfaces/Permission.js +1 -2
- package/dist/interfaces/Product.d.ts +51 -0
- package/dist/interfaces/Product.js +1 -2
- package/dist/interfaces/Section.d.ts +13 -0
- package/dist/interfaces/Section.js +1 -2
- package/dist/interfaces/Store.d.ts +323 -0
- package/dist/interfaces/Store.js +1 -2
- package/dist/interfaces/StoreImage.d.ts +8 -0
- package/dist/interfaces/StoreImage.js +1 -2
- package/dist/interfaces/User.d.ts +38 -0
- package/dist/interfaces/User.js +1 -2
- package/dist/utils/apiUtils.d.ts +3 -0
- package/dist/utils/apiUtils.js +2 -6
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -17
- package/dist/utils/orders/calculateOrderTotal.d.ts +5 -0
- package/dist/utils/orders/calculateOrderTotal.js +10 -14
- package/dist/utils/orders/calculateTotalTaxesIncluded.d.ts +9 -0
- package/dist/utils/orders/calculateTotalTaxesIncluded.js +3 -7
- package/dist/utils/orders/calculateTotalTaxesOverPrice.d.ts +8 -0
- package/dist/utils/orders/calculateTotalTaxesOverPrice.js +7 -11
- package/dist/utils/orders/helpers.d.ts +15 -0
- package/dist/utils/orders/helpers.js +6 -13
- package/dist/utils/orders/index.d.ts +2 -0
- package/dist/utils/orders/index.js +2 -5
- package/dist/utils/receipt/generateReceiptHTML.d.ts +0 -0
- package/dist/utils/util.d.ts +0 -0
- package/package.json +2 -1
- package/src/api/axiosInstance.ts +1 -0
- package/src/api/customers/get.ts +1 -1
- package/src/api/index.ts +0 -10
- package/src/utils/apiUtils.ts +1 -1
- package/tsconfig.json +10 -9
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const axios_1 = __importDefault(require("axios"));
|
|
1
|
+
import axios from 'axios';
|
|
7
2
|
// Define the type for the Axios instance
|
|
8
3
|
let axiosInstance = null;
|
|
4
|
+
// const BASE_URL: string = 'http://localhost:5555/';
|
|
9
5
|
const BASE_URL = 'https://washday-backend.herokuapp.com/';
|
|
10
6
|
// Function to create or return the singleton instance
|
|
11
7
|
const getAxiosInstance = () => {
|
|
12
8
|
if (!axiosInstance) {
|
|
13
|
-
axiosInstance =
|
|
9
|
+
axiosInstance = axios.create({
|
|
14
10
|
baseURL: BASE_URL,
|
|
15
11
|
headers: {
|
|
16
12
|
'Content-Type': 'application/json',
|
|
@@ -44,4 +40,4 @@ const getAxiosInstance = () => {
|
|
|
44
40
|
}
|
|
45
41
|
return axiosInstance;
|
|
46
42
|
};
|
|
47
|
-
|
|
43
|
+
export default getAxiosInstance();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.deleteCashierBoxById = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
-
const deleteCashierBoxById = function (storeId, id) {
|
|
12
|
+
export const deleteCashierBoxById = function (storeId, id) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
return yield
|
|
18
|
+
return yield axiosInstance.delete(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, config);
|
|
25
19
|
}
|
|
26
20
|
catch (error) {
|
|
27
21
|
console.error('Error fetching getStoreStaff:', error);
|
|
@@ -29,4 +23,3 @@ const deleteCashierBoxById = function (storeId, id) {
|
|
|
29
23
|
}
|
|
30
24
|
});
|
|
31
25
|
};
|
|
32
|
-
exports.deleteCashierBoxById = deleteCashierBoxById;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
export declare const getCashierboxesByStoreId: (this: WashdayClientInstance, storeId: string, queryParams?: string) => Promise<any>;
|
|
3
|
+
export declare const getCashierboxesById: (this: WashdayClientInstance, storeId: string, id: string, queryParams?: string) => Promise<any>;
|
|
4
|
+
export declare const getCashierBoxMovementsHistory: (this: WashdayClientInstance, storeId: string, id: string, params?: {
|
|
5
|
+
pageNum: number;
|
|
6
|
+
limit: number;
|
|
7
|
+
}) => Promise<any>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCashierBoxMovementsHistory = exports.getCashierboxesById = exports.getCashierboxesByStoreId = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
-
const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
12
|
+
export const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
const response = yield
|
|
18
|
+
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
|
|
25
19
|
return response;
|
|
26
20
|
}
|
|
27
21
|
catch (error) {
|
|
@@ -30,14 +24,13 @@ const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
const getCashierboxesById = function (storeId, id, queryParams) {
|
|
27
|
+
export const getCashierboxesById = function (storeId, id, queryParams) {
|
|
35
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
29
|
try {
|
|
37
30
|
const config = {
|
|
38
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
32
|
};
|
|
40
|
-
const response = yield
|
|
33
|
+
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
41
34
|
return response;
|
|
42
35
|
}
|
|
43
36
|
catch (error) {
|
|
@@ -46,8 +39,7 @@ const getCashierboxesById = function (storeId, id, queryParams) {
|
|
|
46
39
|
}
|
|
47
40
|
});
|
|
48
41
|
};
|
|
49
|
-
|
|
50
|
-
const getCashierBoxMovementsHistory = function (storeId, id, params) {
|
|
42
|
+
export const getCashierBoxMovementsHistory = function (storeId, id, params) {
|
|
51
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
44
|
try {
|
|
53
45
|
const config = {
|
|
@@ -60,7 +52,7 @@ const getCashierBoxMovementsHistory = function (storeId, id, params) {
|
|
|
60
52
|
if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('limit')) {
|
|
61
53
|
queryParams += `&limit=${params === null || params === void 0 ? void 0 : params.limit}`;
|
|
62
54
|
}
|
|
63
|
-
const response = yield
|
|
55
|
+
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
64
56
|
return response;
|
|
65
57
|
}
|
|
66
58
|
catch (error) {
|
|
@@ -69,4 +61,3 @@ const getCashierBoxMovementsHistory = function (storeId, id, params) {
|
|
|
69
61
|
}
|
|
70
62
|
});
|
|
71
63
|
};
|
|
72
|
-
exports.getCashierBoxMovementsHistory = getCashierBoxMovementsHistory;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
export declare const createCashierBox: (this: WashdayClientInstance, storeId: string, data: {
|
|
3
|
+
name: string;
|
|
4
|
+
}) => Promise<any>;
|
|
5
|
+
export declare const addCashierBoxMovement: (this: WashdayClientInstance, storeId: string, id: string, data: {
|
|
6
|
+
type: string;
|
|
7
|
+
date: Date;
|
|
8
|
+
amount: number;
|
|
9
|
+
notes?: string;
|
|
10
|
+
paymentMethod: string;
|
|
11
|
+
}) => Promise<any>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.addCashierBoxMovement = exports.createCashierBox = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
-
const createCashierBox = function (storeId, data) {
|
|
12
|
+
export const createCashierBox = function (storeId, data) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
const response = yield
|
|
18
|
+
const response = yield axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
25
19
|
return response;
|
|
26
20
|
}
|
|
27
21
|
catch (error) {
|
|
@@ -30,14 +24,13 @@ const createCashierBox = function (storeId, data) {
|
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
const addCashierBoxMovement = function (storeId, id, data) {
|
|
27
|
+
export const addCashierBoxMovement = function (storeId, id, data) {
|
|
35
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
29
|
try {
|
|
37
30
|
const config = {
|
|
38
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
32
|
};
|
|
40
|
-
const response = yield
|
|
33
|
+
const response = yield axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
41
34
|
return response;
|
|
42
35
|
}
|
|
43
36
|
catch (error) {
|
|
@@ -46,4 +39,3 @@ const addCashierBoxMovement = function (storeId, id, data) {
|
|
|
46
39
|
}
|
|
47
40
|
});
|
|
48
41
|
};
|
|
49
|
-
exports.addCashierBoxMovement = addCashierBoxMovement;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.updateCashierBoxById = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
-
const updateCashierBoxById = function (storeId, id, data) {
|
|
12
|
+
export const updateCashierBoxById = function (storeId, id, data) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
const response = yield
|
|
18
|
+
const response = yield axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
25
19
|
return response;
|
|
26
20
|
}
|
|
27
21
|
catch (error) {
|
|
@@ -30,4 +24,3 @@ const updateCashierBoxById = function (storeId, id, data) {
|
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
26
|
};
|
|
33
|
-
exports.updateCashierBoxById = updateCashierBoxById;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,23 +7,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCompanyById = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_COMPANIES = 'api/company';
|
|
18
12
|
const REQUEST_PARAMS = {
|
|
19
13
|
token: 'LOGGED_USER_TOKEN',
|
|
20
14
|
};
|
|
21
|
-
const getCompanyById = function (companyId) {
|
|
15
|
+
export const getCompanyById = function (companyId) {
|
|
22
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
17
|
try {
|
|
24
18
|
const config = {
|
|
25
19
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
26
20
|
};
|
|
27
|
-
const response = yield
|
|
21
|
+
const response = yield axiosInstance.get(`${GET_SET_COMPANIES}/${companyId}`, config);
|
|
28
22
|
return response;
|
|
29
23
|
}
|
|
30
24
|
catch (error) {
|
|
@@ -33,4 +27,3 @@ const getCompanyById = function (companyId) {
|
|
|
33
27
|
}
|
|
34
28
|
});
|
|
35
29
|
};
|
|
36
|
-
exports.getCompanyById = getCompanyById;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
export declare const updateCompanyTaxInfoCertificates: (this: WashdayClientInstance, companyId: string, data: any) => Promise<any>;
|
|
3
|
+
export declare const updateCFDIOrgLogo: (this: WashdayClientInstance, companyId: string, data: any) => Promise<any>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.updateCFDIOrgLogo = exports.updateCompanyTaxInfoCertificates = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_COMPANIES = 'api/company';
|
|
18
|
-
const updateCompanyTaxInfoCertificates = function (companyId, data) {
|
|
12
|
+
export const updateCompanyTaxInfoCertificates = function (companyId, data) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
const response = yield
|
|
18
|
+
const response = yield axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
|
|
25
19
|
return response;
|
|
26
20
|
}
|
|
27
21
|
catch (error) {
|
|
@@ -30,14 +24,13 @@ const updateCompanyTaxInfoCertificates = function (companyId, data) {
|
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
const updateCFDIOrgLogo = function (companyId, data) {
|
|
27
|
+
export const updateCFDIOrgLogo = function (companyId, data) {
|
|
35
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
29
|
try {
|
|
37
30
|
const config = {
|
|
38
31
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
39
32
|
};
|
|
40
|
-
const response = yield
|
|
33
|
+
const response = yield axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
|
|
41
34
|
return response;
|
|
42
35
|
}
|
|
43
36
|
catch (error) {
|
|
@@ -46,4 +39,3 @@ const updateCFDIOrgLogo = function (companyId, data) {
|
|
|
46
39
|
}
|
|
47
40
|
});
|
|
48
41
|
};
|
|
49
|
-
exports.updateCFDIOrgLogo = updateCFDIOrgLogo;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
export declare const updateCompanyById: (this: WashdayClientInstance, companyId: string, data: any) => Promise<any>;
|
|
3
|
+
export declare const updateCompanyLogoById: (this: WashdayClientInstance, companyId: string, data: any) => Promise<any>;
|
|
4
|
+
export declare const updateCompanyTaxInfoById: (this: WashdayClientInstance, companyId: string, data: any) => Promise<any>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.updateCompanyTaxInfoById = exports.updateCompanyLogoById = exports.updateCompanyById = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_COMPANIES = 'api/company';
|
|
18
|
-
const updateCompanyById = function (companyId, data) {
|
|
12
|
+
export const updateCompanyById = function (companyId, data) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
const response = yield
|
|
18
|
+
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
25
19
|
return response;
|
|
26
20
|
}
|
|
27
21
|
catch (error) {
|
|
@@ -30,15 +24,14 @@ const updateCompanyById = function (companyId, data) {
|
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
const updateCompanyLogoById = function (companyId, data) {
|
|
27
|
+
export const updateCompanyLogoById = function (companyId, data) {
|
|
35
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
29
|
try {
|
|
37
30
|
//TODO: company logo requires to have content-type false?
|
|
38
31
|
const config = {
|
|
39
32
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
40
33
|
};
|
|
41
|
-
const response = yield
|
|
34
|
+
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
42
35
|
return response;
|
|
43
36
|
}
|
|
44
37
|
catch (error) {
|
|
@@ -47,14 +40,13 @@ const updateCompanyLogoById = function (companyId, data) {
|
|
|
47
40
|
}
|
|
48
41
|
});
|
|
49
42
|
};
|
|
50
|
-
|
|
51
|
-
const updateCompanyTaxInfoById = function (companyId, data) {
|
|
43
|
+
export const updateCompanyTaxInfoById = function (companyId, data) {
|
|
52
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
45
|
try {
|
|
54
46
|
const config = {
|
|
55
47
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
56
48
|
};
|
|
57
|
-
const response = yield
|
|
49
|
+
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
|
|
58
50
|
return response;
|
|
59
51
|
}
|
|
60
52
|
catch (error) {
|
|
@@ -63,4 +55,3 @@ const updateCompanyTaxInfoById = function (companyId, data) {
|
|
|
63
55
|
}
|
|
64
56
|
});
|
|
65
57
|
};
|
|
66
|
-
exports.updateCompanyTaxInfoById = updateCompanyTaxInfoById;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,23 +7,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getCountries = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_COUNTRIES = 'api/country';
|
|
18
12
|
const REQUEST_PARAMS = {
|
|
19
13
|
token: 'LOGGED_USER_TOKEN',
|
|
20
14
|
};
|
|
21
|
-
const getCountries = function () {
|
|
15
|
+
export const getCountries = function () {
|
|
22
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
17
|
try {
|
|
24
18
|
const config = {
|
|
25
19
|
headers: { Authorization: '' }
|
|
26
20
|
};
|
|
27
|
-
const response = yield
|
|
21
|
+
const response = yield axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
|
|
28
22
|
return response;
|
|
29
23
|
}
|
|
30
24
|
catch (error) {
|
|
@@ -33,4 +27,3 @@ const getCountries = function () {
|
|
|
33
27
|
}
|
|
34
28
|
});
|
|
35
29
|
};
|
|
36
|
-
exports.getCountries = getCountries;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
export declare const exportCustomersList: (this: WashdayClientInstance, params: {
|
|
3
|
+
searchTerm?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
phone?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
fromDate?: string;
|
|
8
|
+
toDate?: string;
|
|
9
|
+
limit: string;
|
|
10
|
+
pageNum: string;
|
|
11
|
+
}) => Promise<any>;
|
package/dist/api/csv/get.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,15 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.exportCustomersList = void 0;
|
|
16
|
-
const apiUtils_1 = require("../../utils/apiUtils");
|
|
17
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
|
+
import axiosInstance from "../axiosInstance";
|
|
18
12
|
const GENERATE_EXPORT = 'api/export';
|
|
19
|
-
const exportCustomersList = function (params) {
|
|
13
|
+
export const exportCustomersList = function (params) {
|
|
20
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
15
|
try {
|
|
22
16
|
const config = {
|
|
@@ -29,8 +23,8 @@ const exportCustomersList = function (params) {
|
|
|
29
23
|
responseType: 'blob'
|
|
30
24
|
}
|
|
31
25
|
};
|
|
32
|
-
const queryParams =
|
|
33
|
-
return yield
|
|
26
|
+
const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum'], params);
|
|
27
|
+
return yield axiosInstance.get(`${GENERATE_EXPORT}/export-all-customers?${queryParams}`, config);
|
|
34
28
|
}
|
|
35
29
|
catch (error) {
|
|
36
30
|
console.error('Error fetching exportCustomersList:', error);
|
|
@@ -38,4 +32,3 @@ const exportCustomersList = function (params) {
|
|
|
38
32
|
}
|
|
39
33
|
});
|
|
40
34
|
};
|
|
41
|
-
exports.exportCustomersList = exportCustomersList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getModule from './get';
|
package/dist/api/csv/index.js
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getModule = void 0;
|
|
27
|
-
exports.getModule = __importStar(require("./get"));
|
|
1
|
+
export * as getModule from './get';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.deleteById = void 0;
|
|
16
|
-
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
17
11
|
const GET_SET_CUSTOMERS = 'api/customer';
|
|
18
|
-
const deleteById = function (id) {
|
|
12
|
+
export const deleteById = function (id) {
|
|
19
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
14
|
try {
|
|
21
15
|
const config = {
|
|
22
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
17
|
};
|
|
24
|
-
return yield
|
|
18
|
+
return yield axiosInstance.delete(`${GET_SET_CUSTOMERS}/${id}`, config);
|
|
25
19
|
}
|
|
26
20
|
catch (error) {
|
|
27
21
|
console.error('Error fetching deleteById:', error);
|
|
@@ -29,4 +23,3 @@ const deleteById = function (id) {
|
|
|
29
23
|
}
|
|
30
24
|
});
|
|
31
25
|
};
|
|
32
|
-
exports.deleteById = deleteById;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import { ICustomer } from "../../interfaces/Customer";
|
|
3
|
+
import { IOrderInfo } from "../../interfaces/Order";
|
|
4
|
+
export declare const getList: (this: WashdayClientInstance, params: {
|
|
5
|
+
searchTerm?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
fromDate?: string;
|
|
10
|
+
toDate?: string;
|
|
11
|
+
limit: string;
|
|
12
|
+
pageNum: string;
|
|
13
|
+
}) => Promise<any>;
|
|
14
|
+
export declare const getCustomerById: (this: WashdayClientInstance, customerId: string) => Promise<{
|
|
15
|
+
customer: ICustomer;
|
|
16
|
+
orderInfo: IOrderInfo;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const getCustomerHighlightsById: (this: WashdayClientInstance, customerId: string) => Promise<{
|
|
19
|
+
customer: ICustomer;
|
|
20
|
+
orderInfo: IOrderInfo;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const getCustomerOrders: (this: WashdayClientInstance, customerId: string, params: {
|
|
23
|
+
limit: string;
|
|
24
|
+
pageNum: string;
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
orders: any;
|
|
27
|
+
totalRowsCount: any;
|
|
28
|
+
}>;
|