@unboundcx/sdk 1.1.0 → 1.2.0
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/package.json +1 -1
- package/services/login.js +32 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/services/login.js
CHANGED
|
@@ -62,21 +62,49 @@ export class LoginService {
|
|
|
62
62
|
return validation;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
async changePassword(
|
|
65
|
+
async changePassword(newPassword) {
|
|
66
66
|
this.sdk.validateParams(
|
|
67
|
-
{
|
|
67
|
+
{ newPassword },
|
|
68
68
|
{
|
|
69
|
-
currentPassword: { type: 'string', required: true },
|
|
70
69
|
newPassword: { type: 'string', required: true },
|
|
71
70
|
},
|
|
72
71
|
);
|
|
73
72
|
|
|
74
73
|
const options = {
|
|
75
|
-
body: {
|
|
74
|
+
body: { password: newPassword },
|
|
76
75
|
};
|
|
77
76
|
|
|
78
77
|
const result = await this.sdk._fetch(
|
|
79
78
|
'/login/changePassword',
|
|
79
|
+
'PUT',
|
|
80
|
+
options,
|
|
81
|
+
);
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async getPasswordRequirements() {
|
|
86
|
+
const result = await this.sdk._fetch(
|
|
87
|
+
'/login/passwordRequirements',
|
|
88
|
+
'GET',
|
|
89
|
+
{},
|
|
90
|
+
);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async validatePasswordStrength(password) {
|
|
95
|
+
this.sdk.validateParams(
|
|
96
|
+
{ password },
|
|
97
|
+
{
|
|
98
|
+
password: { type: 'string', required: true },
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const options = {
|
|
103
|
+
body: { password },
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const result = await this.sdk._fetch(
|
|
107
|
+
'/login/validatePasswordStrength',
|
|
80
108
|
'POST',
|
|
81
109
|
options,
|
|
82
110
|
);
|