washday-sdk 0.0.197 → 0.0.199
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 +2 -0
- package/dist/api/users/post.js +25 -0
- package/package.json +1 -1
- package/src/api/index.ts +2 -0
- package/src/api/users/post.ts +19 -0
- package/src/interfaces/Api.ts +2 -0
package/dist/api/index.js
CHANGED
|
@@ -39,6 +39,7 @@ import { deleteUserById } from "./users/delete";
|
|
|
39
39
|
import * as partnersEndpoints from './partners';
|
|
40
40
|
import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
41
41
|
import * as publicsEndpoints from './publics';
|
|
42
|
+
import { validateUserPin } from "./users/post";
|
|
42
43
|
function bindMethods(instance, methods) {
|
|
43
44
|
const boundMethods = {};
|
|
44
45
|
for (const key in methods) {
|
|
@@ -175,6 +176,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
175
176
|
this.users = bindMethods(this, {
|
|
176
177
|
updateUserById: updateUserById,
|
|
177
178
|
deleteUserById: deleteUserById,
|
|
179
|
+
validateUserPin: validateUserPin,
|
|
178
180
|
});
|
|
179
181
|
this.countries = bindMethods(this, {
|
|
180
182
|
getCountries: getCountries,
|
|
@@ -0,0 +1,25 @@
|
|
|
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_SET_USER = 'api/users';
|
|
12
|
+
export const validateUserPin = function (data) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
try {
|
|
15
|
+
const config = {
|
|
16
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
|
+
};
|
|
18
|
+
return yield axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error('Error fetching validateUserPin:', error);
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { customersAppChangePassword } from './auth/post';
|
|
|
41
41
|
import * as partnersEndpoints from './partners';
|
|
42
42
|
import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
43
43
|
import * as publicsEndpoints from './publics';
|
|
44
|
+
import { validateUserPin } from "./users/post";
|
|
44
45
|
|
|
45
46
|
type WashdayClientConstructor = {
|
|
46
47
|
new(apiToken: string): WashdayClientInstance
|
|
@@ -182,6 +183,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
182
183
|
this.users = bindMethods(this, {
|
|
183
184
|
updateUserById: updateUserById,
|
|
184
185
|
deleteUserById: deleteUserById,
|
|
186
|
+
validateUserPin: validateUserPin,
|
|
185
187
|
});
|
|
186
188
|
this.countries = bindMethods(this, {
|
|
187
189
|
getCountries: getCountries,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
|
|
4
|
+
const GET_SET_USER = 'api/users';
|
|
5
|
+
|
|
6
|
+
export const validateUserPin = async function (this: WashdayClientInstance, data: {
|
|
7
|
+
companyId: string,
|
|
8
|
+
pin: string
|
|
9
|
+
}): Promise<any> {
|
|
10
|
+
try {
|
|
11
|
+
const config = {
|
|
12
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
13
|
+
};
|
|
14
|
+
return await axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error('Error fetching validateUserPin:', error);
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { deleteUserById } from "../api/users/delete";
|
|
|
39
39
|
import * as partnersEndpoints from '../api/partners';
|
|
40
40
|
import * as outsourcedOrdersEndpoints from '../api/outsourcedOrders';
|
|
41
41
|
import * as publicsEndpoints from '../api/publics';
|
|
42
|
+
import { validateUserPin } from "../api/users/post";
|
|
42
43
|
|
|
43
44
|
export interface WashdayClientInstance {
|
|
44
45
|
apiToken: string;
|
|
@@ -167,6 +168,7 @@ export interface WashdayClientInstance {
|
|
|
167
168
|
users: {
|
|
168
169
|
updateUserById: typeof updateUserById;
|
|
169
170
|
deleteUserById: typeof deleteUserById;
|
|
171
|
+
validateUserPin: typeof validateUserPin;
|
|
170
172
|
};
|
|
171
173
|
countries: {
|
|
172
174
|
getCountries: typeof getCountries;
|