washday-sdk 0.0.197 → 0.0.198

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
@@ -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,23 @@
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
+ return yield axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
17
+ }
18
+ catch (error) {
19
+ console.error('Error fetching validateUserPin:', error);
20
+ throw error;
21
+ }
22
+ });
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.197",
3
+ "version": "0.0.198",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
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,17 @@
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
+ userId: string,
8
+ pin: string
9
+ }): Promise<any> {
10
+ try {
11
+ const config = {};
12
+ return await axiosInstance.post(`${GET_SET_USER}/validate-pin`, data, config);
13
+ } catch (error) {
14
+ console.error('Error fetching validateUserPin:', error);
15
+ throw error;
16
+ }
17
+ };
@@ -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;