washday-sdk 0.0.184 → 0.0.185
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 +4 -0
- package/dist/api/publics/get.js +26 -0
- package/dist/api/publics/index.js +1 -0
- package/package.json +1 -1
- package/src/api/index.ts +4 -0
- package/src/api/publics/get.ts +16 -0
- package/src/api/publics/index.ts +1 -0
- package/src/interfaces/Api.ts +4 -0
package/dist/api/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import * as cashupsEndpoints from './cashups';
|
|
|
38
38
|
import { deleteUserById } from "./users/delete";
|
|
39
39
|
import * as partnersEndpoints from './partners';
|
|
40
40
|
import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
41
|
+
import * as publicsEndpoints from './publics';
|
|
41
42
|
function bindMethods(instance, methods) {
|
|
42
43
|
const boundMethods = {};
|
|
43
44
|
for (const key in methods) {
|
|
@@ -85,6 +86,9 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
85
86
|
getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
|
|
86
87
|
startRoute: routesEndpoints.postModule.startRoute,
|
|
87
88
|
});
|
|
89
|
+
this.publics = bindMethods(this, {
|
|
90
|
+
getOrderPublicReceipt: publicsEndpoints.getModule.getOrderPublicReceipt,
|
|
91
|
+
});
|
|
88
92
|
this.auth = bindMethods(this, {
|
|
89
93
|
customerLoginToken: authEndpoints.postModule.customerLoginToken,
|
|
90
94
|
googleLogin: authEndpoints.postModule.googleLogin,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import axiosInstance from "../axiosInstance";
|
|
11
|
+
const GET_PUBLIC = '/api/public';
|
|
12
|
+
const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
|
|
13
|
+
export const getOrderPublicReceipt = function (orderId) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const config = {
|
|
17
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
|
+
};
|
|
19
|
+
return yield axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderId}/receipt`, config);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error('Error fetching getOrderPublicReceipt:', error);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getModule from './get';
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ import { deleteUserById } from "./users/delete";
|
|
|
40
40
|
import { customersAppChangePassword } from './auth/post';
|
|
41
41
|
import * as partnersEndpoints from './partners';
|
|
42
42
|
import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
43
|
+
import * as publicsEndpoints from './publics';
|
|
43
44
|
|
|
44
45
|
type WashdayClientConstructor = {
|
|
45
46
|
new(apiToken: string): WashdayClientInstance
|
|
@@ -92,6 +93,9 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
92
93
|
getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
|
|
93
94
|
startRoute: routesEndpoints.postModule.startRoute,
|
|
94
95
|
});
|
|
96
|
+
this.publics = bindMethods(this, {
|
|
97
|
+
getOrderPublicReceipt: publicsEndpoints.getModule.getOrderPublicReceipt,
|
|
98
|
+
});
|
|
95
99
|
this.auth = bindMethods(this, {
|
|
96
100
|
customerLoginToken: authEndpoints.postModule.customerLoginToken,
|
|
97
101
|
googleLogin: authEndpoints.postModule.googleLogin,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
const GET_PUBLIC = '/api/public';
|
|
4
|
+
const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
|
|
5
|
+
|
|
6
|
+
export const getOrderPublicReceipt = async function (this: WashdayClientInstance, orderId: string): Promise<any> {
|
|
7
|
+
try {
|
|
8
|
+
const config = {
|
|
9
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
|
+
};
|
|
11
|
+
return await axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderId}/receipt`, config);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error('Error fetching getOrderPublicReceipt:', error);
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getModule from './get';
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -38,6 +38,7 @@ import * as authEndpoints from '../api/auth';
|
|
|
38
38
|
import { deleteUserById } from "../api/users/delete";
|
|
39
39
|
import * as partnersEndpoints from '../api/partners';
|
|
40
40
|
import * as outsourcedOrdersEndpoints from '../api/outsourcedOrders';
|
|
41
|
+
import * as publicsEndpoints from '../api/publics';
|
|
41
42
|
|
|
42
43
|
export interface WashdayClientInstance {
|
|
43
44
|
apiToken: string;
|
|
@@ -92,6 +93,9 @@ export interface WashdayClientInstance {
|
|
|
92
93
|
getRoutesByDriver: typeof routesEndpoints.getModule.getRoutesByDriver,
|
|
93
94
|
startRoute: typeof routesEndpoints.postModule.startRoute,
|
|
94
95
|
},
|
|
96
|
+
publics: {
|
|
97
|
+
getOrderPublicReceipt: typeof publicsEndpoints.getModule.getOrderPublicReceipt,
|
|
98
|
+
},
|
|
95
99
|
orders: {
|
|
96
100
|
getList: typeof ordersEndpoints.getModule.getList;
|
|
97
101
|
getOrdersHeaderSummary: typeof ordersEndpoints.getModule.getOrdersHeaderSummary;
|