washday-sdk 0.0.77 → 0.0.79
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 +1 -0
- package/dist/api/order/post.js +15 -0
- package/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/order/post.ts +14 -0
package/dist/api/index.js
CHANGED
|
@@ -49,6 +49,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
49
49
|
updateById: ordersEndpoints.putModule.updateById,
|
|
50
50
|
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
51
51
|
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
52
|
+
sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
|
|
52
53
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
53
54
|
});
|
|
54
55
|
this.customers = bindMethods(this, {
|
package/dist/api/order/post.js
CHANGED
|
@@ -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_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
12
|
+
const GET_SET_ORDER = 'api/v2/order';
|
|
12
13
|
export const createPaymentLine = function (id, data) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -23,3 +24,17 @@ export const createPaymentLine = function (id, data) {
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
};
|
|
27
|
+
export const sendEmailReceipt = function (id) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const config = {
|
|
31
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
|
+
};
|
|
33
|
+
return yield axiosInstance.post(`${GET_SET_ORDER}/${id}/sendEmailReceipt`, null, config);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error fetching create:', error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -55,6 +55,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
55
55
|
updateById: ordersEndpoints.putModule.updateById,
|
|
56
56
|
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
57
57
|
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
58
|
+
sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
|
|
58
59
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
59
60
|
});
|
|
60
61
|
this.customers = bindMethods(this, {
|
package/src/api/order/post.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
|
|
4
|
+
const GET_SET_ORDER = 'api/v2/order';
|
|
4
5
|
|
|
5
6
|
export const createPaymentLine = async function (this: WashdayClientInstance, id: string, data: {
|
|
6
7
|
amountPaid: number,
|
|
@@ -18,3 +19,16 @@ export const createPaymentLine = async function (this: WashdayClientInstance, id
|
|
|
18
19
|
throw error;
|
|
19
20
|
}
|
|
20
21
|
};
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export const sendEmailReceipt = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
25
|
+
try {
|
|
26
|
+
const config = {
|
|
27
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
28
|
+
};
|
|
29
|
+
return await axiosInstance.post(`${GET_SET_ORDER}/${id}/sendEmailReceipt`, null, config);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('Error fetching create:', error);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
};
|