washday-sdk 0.0.97 → 0.0.99

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
@@ -68,6 +68,12 @@ const WashdayClient = function WashdayClient(apiToken) {
68
68
  fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
69
69
  updateById: ordersEndpoints.putModule.updateById,
70
70
  updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
71
+ setOrderCancelledBySequence: ordersEndpoints.putModule.setOrderCancelledBySequence,
72
+ setOrderCleanedBySequence: ordersEndpoints.putModule.setOrderCleanedBySequence,
73
+ setOrderCollectedBySequence: ordersEndpoints.putModule.setOrderCollectedBySequence,
74
+ setOrdePickingBySequence: ordersEndpoints.putModule.setOrdePickingBySequence,
75
+ setOrdeDeliveringBySequence: ordersEndpoints.putModule.setOrdeDeliveringBySequence,
76
+ setOrdeDeliveredBySequence: ordersEndpoints.putModule.setOrdeDeliveredBySequence,
71
77
  createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
72
78
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
73
79
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
@@ -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_ORDER = 'api/v2/order';
12
+ const GET_SET_ORDER_OLD = 'api/order';
12
13
  const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
13
14
  export const updateById = function (id, data) {
14
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -38,3 +39,87 @@ export const updatePaymentLineById = function (orderId, id, data) {
38
39
  }
39
40
  });
40
41
  };
42
+ export const setOrderCancelledBySequence = function (sequence, storeId, data) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ try {
45
+ const config = {
46
+ headers: { Authorization: `Bearer ${this.apiToken}` }
47
+ };
48
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
49
+ }
50
+ catch (error) {
51
+ console.error('Error fetching setOrderCancelledBySequence:', error);
52
+ throw error;
53
+ }
54
+ });
55
+ };
56
+ export const setOrderCleanedBySequence = function (sequence, storeId, data) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ try {
59
+ const config = {
60
+ headers: { Authorization: `Bearer ${this.apiToken}` }
61
+ };
62
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned`, data, config);
63
+ }
64
+ catch (error) {
65
+ console.error('Error fetching setOrderCleanedBySequence:', error);
66
+ throw error;
67
+ }
68
+ });
69
+ };
70
+ export const setOrderCollectedBySequence = function (sequence, storeId, data) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ try {
73
+ const config = {
74
+ headers: { Authorization: `Bearer ${this.apiToken}` }
75
+ };
76
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
77
+ }
78
+ catch (error) {
79
+ console.error('Error fetching setOrderCollectedBySequence:', error);
80
+ throw error;
81
+ }
82
+ });
83
+ };
84
+ export const setOrdePickingBySequence = function (sequence, storeId, data) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ try {
87
+ const config = {
88
+ headers: { Authorization: `Bearer ${this.apiToken}` }
89
+ };
90
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
91
+ }
92
+ catch (error) {
93
+ console.error('Error fetching setOrdePickingBySequence:', error);
94
+ throw error;
95
+ }
96
+ });
97
+ };
98
+ export const setOrdeDeliveringBySequence = function (sequence, storeId, data) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ try {
101
+ const config = {
102
+ headers: { Authorization: `Bearer ${this.apiToken}` }
103
+ };
104
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
105
+ }
106
+ catch (error) {
107
+ console.error('Error fetching setOrdeDeliveringBySequence:', error);
108
+ throw error;
109
+ }
110
+ });
111
+ };
112
+ export const setOrdeDeliveredBySequence = function (sequence, storeId, data) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ try {
115
+ const config = {
116
+ headers: { Authorization: `Bearer ${this.apiToken}` }
117
+ };
118
+ return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
119
+ }
120
+ catch (error) {
121
+ console.error('Error fetching setOrdeDeliveredBySequence:', error);
122
+ throw error;
123
+ }
124
+ });
125
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.97",
3
+ "version": "0.0.99",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_ORDER = 'api/v2/order';
4
+ const GET_SET_ORDER_OLD = 'api/order';
4
5
  const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
5
6
 
6
7
  export const updateById = async function (this: WashdayClientInstance, id: string, data: {
@@ -59,7 +60,7 @@ export const setOrderCancelledBySequence = async function (this: WashdayClientIn
59
60
  const config = {
60
61
  headers: { Authorization: `Bearer ${this.apiToken}` }
61
62
  };
62
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/cancelled`, data, config);
63
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
63
64
  } catch (error) {
64
65
  console.error('Error fetching setOrderCancelledBySequence:', error);
65
66
  throw error;
@@ -74,7 +75,7 @@ export const setOrderCleanedBySequence = async function (this: WashdayClientInst
74
75
  const config = {
75
76
  headers: { Authorization: `Bearer ${this.apiToken}` }
76
77
  };
77
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/cleaned`, data, config);
78
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned`, data, config);
78
79
  } catch (error) {
79
80
  console.error('Error fetching setOrderCleanedBySequence:', error);
80
81
  throw error;
@@ -88,7 +89,7 @@ export const setOrderCollectedBySequence = async function (this: WashdayClientIn
88
89
  const config = {
89
90
  headers: { Authorization: `Bearer ${this.apiToken}` }
90
91
  };
91
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/collected`, data, config);
92
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
92
93
  } catch (error) {
93
94
  console.error('Error fetching setOrderCollectedBySequence:', error);
94
95
  throw error;
@@ -102,7 +103,7 @@ export const setOrdePickingBySequence = async function (this: WashdayClientInsta
102
103
  const config = {
103
104
  headers: { Authorization: `Bearer ${this.apiToken}` }
104
105
  };
105
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/picking`, data, config);
106
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
106
107
  } catch (error) {
107
108
  console.error('Error fetching setOrdePickingBySequence:', error);
108
109
  throw error;
@@ -116,7 +117,7 @@ export const setOrdeDeliveringBySequence = async function (this: WashdayClientIn
116
117
  const config = {
117
118
  headers: { Authorization: `Bearer ${this.apiToken}` }
118
119
  };
119
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/delivering`, data, config);
120
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
120
121
  } catch (error) {
121
122
  console.error('Error fetching setOrdeDeliveringBySequence:', error);
122
123
  throw error;
@@ -130,7 +131,7 @@ export const setOrdeDeliveredBySequence = async function (this: WashdayClientIns
130
131
  const config = {
131
132
  headers: { Authorization: `Bearer ${this.apiToken}` }
132
133
  };
133
- return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/delivered`, data, config);
134
+ return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
134
135
  } catch (error) {
135
136
  console.error('Error fetching setOrdeDeliveredBySequence:', error);
136
137
  throw error;