washday-sdk 0.0.139 → 0.0.141

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.
@@ -82,3 +82,15 @@ export const regularUserTokenLogin = function (params) {
82
82
  }
83
83
  });
84
84
  };
85
+ export const forgotPassword = function (params) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ try {
88
+ const config = {};
89
+ return yield axiosInstance.post(`${REGULAR_USER_AUTH}/forget-password`, params, config);
90
+ }
91
+ catch (error) {
92
+ console.error('Error fetching forgotPassword:', error);
93
+ throw error;
94
+ }
95
+ });
96
+ };
package/dist/api/index.js CHANGED
@@ -35,6 +35,7 @@ import * as routesEndpoints from './routes';
35
35
  import * as reviewsEndpoints from './reviews';
36
36
  import * as cfdiEndpoints from './cfdi';
37
37
  import * as cashupsEndpoints from './cashups';
38
+ import { deleteUserById } from "./users/delete";
38
39
  function bindMethods(instance, methods) {
39
40
  const boundMethods = {};
40
41
  for (const key in methods) {
@@ -80,6 +81,7 @@ const WashdayClient = function WashdayClient(apiToken) {
80
81
  customerSignUp: authEndpoints.postModule.customerSignUp,
81
82
  regularUserLogin: authEndpoints.postModule.regularUserLogin,
82
83
  regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
84
+ forgotPassword: authEndpoints.postModule.forgotPassword,
83
85
  });
84
86
  this.orders = bindMethods(this, {
85
87
  getList: ordersEndpoints.getModule.getList,
@@ -142,6 +144,7 @@ const WashdayClient = function WashdayClient(apiToken) {
142
144
  });
143
145
  this.users = bindMethods(this, {
144
146
  updateUserById: updateUserById,
147
+ deleteUserById: deleteUserById,
145
148
  });
146
149
  this.countries = bindMethods(this, {
147
150
  getCountries: getCountries,
@@ -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_SET_USER = 'api/user';
12
+ export const deleteUserById = function (id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ try {
15
+ const config = {
16
+ headers: { Authorization: `Bearer ${this.apiToken}` }
17
+ };
18
+ const response = yield axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
19
+ return response;
20
+ }
21
+ catch (error) {
22
+ console.error('Error fetching deleteUserById:', error);
23
+ throw error;
24
+ }
25
+ });
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.139",
3
+ "version": "0.0.141",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -96,3 +96,16 @@ export const regularUserTokenLogin = async function (this: WashdayClientInstance
96
96
  throw error;
97
97
  }
98
98
  };
99
+
100
+
101
+ export const forgotPassword = async function (this: WashdayClientInstance, params: {
102
+ email: string;
103
+ }): Promise<any> {
104
+ try {
105
+ const config = {};
106
+ return await axiosInstance.post(`${REGULAR_USER_AUTH}/forget-password`, params, config);
107
+ } catch (error) {
108
+ console.error('Error fetching forgotPassword:', error);
109
+ throw error;
110
+ }
111
+ };
package/src/api/index.ts CHANGED
@@ -36,6 +36,7 @@ import * as routesEndpoints from './routes';
36
36
  import * as reviewsEndpoints from './reviews';
37
37
  import * as cfdiEndpoints from './cfdi';
38
38
  import * as cashupsEndpoints from './cashups';
39
+ import { deleteUserById } from "./users/delete";
39
40
 
40
41
  type WashdayClientConstructor = {
41
42
  new(apiToken: string): WashdayClientInstance
@@ -86,6 +87,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
86
87
  customerSignUp: authEndpoints.postModule.customerSignUp,
87
88
  regularUserLogin: authEndpoints.postModule.regularUserLogin,
88
89
  regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
90
+ forgotPassword: authEndpoints.postModule.forgotPassword,
89
91
  });
90
92
  this.orders = bindMethods(this, {
91
93
  getList: ordersEndpoints.getModule.getList,
@@ -148,6 +150,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
148
150
  });
149
151
  this.users = bindMethods(this, {
150
152
  updateUserById: updateUserById,
153
+ deleteUserById: deleteUserById,
151
154
  });
152
155
  this.countries = bindMethods(this, {
153
156
  getCountries: getCountries,
@@ -0,0 +1,16 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ const GET_SET_USER = 'api/user';
4
+
5
+ export const deleteUserById = async function (this: WashdayClientInstance, id: string): Promise<any> {
6
+ try {
7
+ const config = {
8
+ headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ };
10
+ const response = await axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
11
+ return response;
12
+ } catch (error) {
13
+ console.error('Error fetching deleteUserById:', error);
14
+ throw error;
15
+ }
16
+ };
@@ -35,6 +35,7 @@ import * as reviewsEndpoints from '../api/reviews';
35
35
  import * as cfdiEndpoints from '../api/cfdi';
36
36
  import * as cashupsEndpoints from '../api/cashups';
37
37
  import * as authEndpoints from '../api/auth';
38
+ import { deleteUserById } from "../api/users/delete";
38
39
 
39
40
  export interface WashdayClientInstance {
40
41
  apiToken: string;
@@ -62,6 +63,7 @@ export interface WashdayClientInstance {
62
63
  customerSignUp: typeof authEndpoints.postModule.customerSignUp;
63
64
  regularUserLogin: typeof authEndpoints.postModule.regularUserLogin;
64
65
  regularUserTokenLogin: typeof authEndpoints.postModule.regularUserTokenLogin;
66
+ forgotPassword: typeof authEndpoints.postModule.forgotPassword;
65
67
  }
66
68
  review: {
67
69
  getList: typeof reviewsEndpoints.getModule.getList;
@@ -134,6 +136,7 @@ export interface WashdayClientInstance {
134
136
  };
135
137
  users: {
136
138
  updateUserById: typeof updateUserById;
139
+ deleteUserById: typeof deleteUserById;
137
140
  };
138
141
  countries: {
139
142
  getCountries: typeof getCountries;