@stackfactor/client-api 1.1.114 → 1.1.117
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/lib/aiAssistant.js +25 -0
- package/lib/security.js +24 -0
- package/package.json +1 -1
package/lib/aiAssistant.js
CHANGED
|
@@ -84,6 +84,30 @@ const getConversationByElementId = (elementId, token) => {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Get the voice assistant URL
|
|
89
|
+
* @param {String} language
|
|
90
|
+
* @param {String} token
|
|
91
|
+
* @returns {Promise}
|
|
92
|
+
*/
|
|
93
|
+
const getVoiceAssistantUrl = (language, token) => {
|
|
94
|
+
return new Promise(function (resolve, reject) {
|
|
95
|
+
let confirmationRequest = client.get(
|
|
96
|
+
`/api/v1/aiassistant/getvoiceassistanturl/${language}`,
|
|
97
|
+
{
|
|
98
|
+
headers: { authorization: token },
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
confirmationRequest
|
|
102
|
+
.then((response) => {
|
|
103
|
+
resolve(response.data);
|
|
104
|
+
})
|
|
105
|
+
.catch((error) => {
|
|
106
|
+
reject(error);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
87
111
|
/**
|
|
88
112
|
* Start conversation with the AI
|
|
89
113
|
* @param {String} elementId
|
|
@@ -135,5 +159,6 @@ export default {
|
|
|
135
159
|
askQuestion,
|
|
136
160
|
endConversation,
|
|
137
161
|
getConversationByElementId,
|
|
162
|
+
getVoiceAssistantUrl,
|
|
138
163
|
startConversation,
|
|
139
164
|
};
|
package/lib/security.js
CHANGED
|
@@ -43,6 +43,29 @@ const setAuthConnections = (data, authToken) => {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Reset the MFA for the user.
|
|
48
|
+
* @param {String} userId
|
|
49
|
+
* @param {String} authToken
|
|
50
|
+
* @returns {Promise<Object>}
|
|
51
|
+
*/
|
|
52
|
+
const resetMFA = (userId, authToken) => {
|
|
53
|
+
return new Promise(function (resolve, reject) {
|
|
54
|
+
const resetMFARequest = client.post(
|
|
55
|
+
`api/v1/security/resetmfa`,
|
|
56
|
+
userId ? {} : { userId: userId },
|
|
57
|
+
{ headers: { authorization: authToken } }
|
|
58
|
+
);
|
|
59
|
+
resetMFARequest
|
|
60
|
+
.then((response) => {
|
|
61
|
+
resolve(response.data);
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
reject(error);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
46
69
|
/**
|
|
47
70
|
* Synchronize the authentication connections with Auth0.
|
|
48
71
|
* @param {String} authToken
|
|
@@ -66,6 +89,7 @@ const synchronizeWithAuth0 = (authToken) => {
|
|
|
66
89
|
|
|
67
90
|
export default {
|
|
68
91
|
getAuthConnections,
|
|
92
|
+
resetMFA,
|
|
69
93
|
setAuthConnections,
|
|
70
94
|
synchronizeWithAuth0,
|
|
71
95
|
};
|