washday-sdk 0.0.191 → 0.0.193
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/cashierbox/delete.js +15 -0
- package/dist/api/cashierbox/post.js +1 -0
- package/dist/api/cashierbox/put.js +16 -0
- package/dist/api/index.js +4 -2
- package/dist/api/order/get.js +1 -0
- package/package.json +1 -1
- package/src/api/cashierbox/delete.ts +13 -0
- package/src/api/cashierbox/post.ts +1 -0
- package/src/api/cashierbox/put.ts +15 -0
- package/src/api/index.ts +4 -2
- package/src/api/order/get.ts +2 -0
- package/src/interfaces/Api.ts +4 -2
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
12
13
|
export const deleteCashierBoxById = function (storeId, id) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -23,3 +24,17 @@ export const deleteCashierBoxById = function (storeId, id) {
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
};
|
|
27
|
+
export const deleteCashierBoxMovementById = function (_a) {
|
|
28
|
+
return __awaiter(this, arguments, void 0, function* ({ storeId, cashierBoxId, movementId }) {
|
|
29
|
+
try {
|
|
30
|
+
const config = {
|
|
31
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
|
+
};
|
|
33
|
+
return yield axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
12
13
|
export const createCashierBox = function (storeId, data) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
11
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
12
13
|
export const updateCashierBoxById = function (storeId, id, data) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -24,3 +25,18 @@ export const updateCashierBoxById = function (storeId, id, data) {
|
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
};
|
|
28
|
+
export const updateCashierBoxMovementById = function (_a, data_1) {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* ({ storeId, cashierBoxId, id }, data) {
|
|
30
|
+
try {
|
|
31
|
+
const config = {
|
|
32
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
|
+
};
|
|
34
|
+
const response = yield axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
35
|
+
return response;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error('Error fetching getStoreById:', error);
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
package/dist/api/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { deleteCashierBoxById } from "./cashierbox/delete";
|
|
1
|
+
import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox/delete";
|
|
2
2
|
import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
|
|
3
3
|
import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
|
|
4
|
-
import { updateCashierBoxById } from "./cashierbox/put";
|
|
4
|
+
import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
|
|
5
5
|
import { getCompanyById } from "./companies/get";
|
|
6
6
|
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
|
|
7
7
|
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
|
|
@@ -209,8 +209,10 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
209
209
|
getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
|
|
210
210
|
createCashierBox: createCashierBox,
|
|
211
211
|
updateCashierBoxById: updateCashierBoxById,
|
|
212
|
+
updateCashierBoxMovementById: updateCashierBoxMovementById,
|
|
212
213
|
deleteCashierBoxById: deleteCashierBoxById,
|
|
213
214
|
addCashierBoxMovement: addCashierBoxMovement,
|
|
215
|
+
deleteCashierBoxMovementById: deleteCashierBoxMovementById,
|
|
214
216
|
});
|
|
215
217
|
this.companies = bindMethods(this, {
|
|
216
218
|
getCompanyById: getCompanyById,
|
package/dist/api/order/get.js
CHANGED
|
@@ -42,6 +42,7 @@ export const getList = function (params, options) {
|
|
|
42
42
|
'deliveryFromDate',
|
|
43
43
|
'deliveryToDate',
|
|
44
44
|
'fetchSection',
|
|
45
|
+
'cfdiId',
|
|
45
46
|
], params);
|
|
46
47
|
// ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
|
|
47
48
|
return yield axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
4
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
4
5
|
|
|
5
6
|
export const deleteCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string): Promise<any> {
|
|
6
7
|
try {
|
|
@@ -13,3 +14,15 @@ export const deleteCashierBoxById = async function (this: WashdayClientInstance,
|
|
|
13
14
|
throw error;
|
|
14
15
|
}
|
|
15
16
|
};
|
|
17
|
+
|
|
18
|
+
export const deleteCashierBoxMovementById = async function (this: WashdayClientInstance, { storeId, cashierBoxId, movementId }: { storeId: string, cashierBoxId: string, movementId: string }): Promise<any> {
|
|
19
|
+
try {
|
|
20
|
+
const config = {
|
|
21
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
22
|
+
};
|
|
23
|
+
return await axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
|
|
4
4
|
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
5
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
5
6
|
|
|
6
7
|
export const createCashierBox = async function (this: WashdayClientInstance, storeId: string, data: {
|
|
7
8
|
name: string
|
|
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
|
|
4
4
|
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
5
|
+
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
5
6
|
|
|
6
7
|
export const updateCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string, data: { name: string }): Promise<any> {
|
|
7
8
|
try {
|
|
@@ -15,3 +16,17 @@ export const updateCashierBoxById = async function (this: WashdayClientInstance,
|
|
|
15
16
|
throw error;
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
|
|
20
|
+
export const updateCashierBoxMovementById = async function (this: WashdayClientInstance, { storeId, cashierBoxId, id }: { storeId: string, cashierBoxId: string, id: string }, data: { name: string }): Promise<any> {
|
|
21
|
+
try {
|
|
22
|
+
const config = {
|
|
23
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
24
|
+
};
|
|
25
|
+
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
26
|
+
return response;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('Error fetching getStoreById:', error);
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
package/src/api/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../interfaces/Api";
|
|
2
|
-
import { deleteCashierBoxById } from "./cashierbox/delete";
|
|
2
|
+
import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox/delete";
|
|
3
3
|
import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
|
|
4
4
|
import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
|
|
5
|
-
import { updateCashierBoxById } from "./cashierbox/put";
|
|
5
|
+
import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
|
|
6
6
|
import { getCompanyById } from "./companies/get";
|
|
7
7
|
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
|
|
8
8
|
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
|
|
@@ -216,8 +216,10 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
216
216
|
getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
|
|
217
217
|
createCashierBox: createCashierBox,
|
|
218
218
|
updateCashierBoxById: updateCashierBoxById,
|
|
219
|
+
updateCashierBoxMovementById: updateCashierBoxMovementById,
|
|
219
220
|
deleteCashierBoxById: deleteCashierBoxById,
|
|
220
221
|
addCashierBoxMovement: addCashierBoxMovement,
|
|
222
|
+
deleteCashierBoxMovementById: deleteCashierBoxMovementById,
|
|
221
223
|
});
|
|
222
224
|
this.companies = bindMethods(this, {
|
|
223
225
|
getCompanyById: getCompanyById,
|
package/src/api/order/get.ts
CHANGED
|
@@ -31,6 +31,7 @@ export const getList = async function (this: WashdayClientInstance, params: {
|
|
|
31
31
|
deliveryToDate: string | undefined,
|
|
32
32
|
signal?: GenericAbortSignal,
|
|
33
33
|
fetchSection?: string,
|
|
34
|
+
cfdiId?: string,
|
|
34
35
|
}, options?: { signal?: GenericAbortSignal }): Promise<any> {
|
|
35
36
|
try {
|
|
36
37
|
const config = {
|
|
@@ -59,6 +60,7 @@ export const getList = async function (this: WashdayClientInstance, params: {
|
|
|
59
60
|
'deliveryFromDate',
|
|
60
61
|
'deliveryToDate',
|
|
61
62
|
'fetchSection',
|
|
63
|
+
'cfdiId',
|
|
62
64
|
], params);
|
|
63
65
|
// ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
|
|
64
66
|
return await axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { deleteCashierBoxById } from "../api/cashierbox/delete";
|
|
1
|
+
import { deleteCashierBoxById, deleteCashierBoxMovementById } from "../api/cashierbox/delete";
|
|
2
2
|
import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "../api/cashierbox/get";
|
|
3
3
|
import { addCashierBoxMovement, createCashierBox } from "../api/cashierbox/post";
|
|
4
|
-
import { updateCashierBoxById } from "../api/cashierbox/put";
|
|
4
|
+
import { updateCashierBoxById, updateCashierBoxMovementById } from "../api/cashierbox/put";
|
|
5
5
|
import { getCompanyById } from "../api/companies/get";
|
|
6
6
|
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "../api/companies/post";
|
|
7
7
|
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "../api/companies/put";
|
|
@@ -201,8 +201,10 @@ export interface WashdayClientInstance {
|
|
|
201
201
|
getCashierBoxMovementsHistory: typeof getCashierBoxMovementsHistory;
|
|
202
202
|
createCashierBox: typeof createCashierBox;
|
|
203
203
|
updateCashierBoxById: typeof updateCashierBoxById;
|
|
204
|
+
updateCashierBoxMovementById: typeof updateCashierBoxMovementById;
|
|
204
205
|
deleteCashierBoxById: typeof deleteCashierBoxById;
|
|
205
206
|
addCashierBoxMovement: typeof addCashierBoxMovement;
|
|
207
|
+
deleteCashierBoxMovementById: typeof deleteCashierBoxMovementById;
|
|
206
208
|
};
|
|
207
209
|
companies: {
|
|
208
210
|
getCompanyById: typeof getCompanyById;
|