@stackfactor/client-api 1.1.116 → 1.1.118
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/quota.js +25 -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/quota.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get the current quota for the user and tenant
|
|
5
|
+
* @param {String} token
|
|
6
|
+
* @returns {Promise}
|
|
7
|
+
*/
|
|
8
|
+
const getAllQuota = (token) => {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
let confirmationRequest = client.get(`/api/v1/quota/getcurrentquota`, {
|
|
11
|
+
headers: { authorization: token },
|
|
12
|
+
});
|
|
13
|
+
confirmationRequest
|
|
14
|
+
.then((response) => {
|
|
15
|
+
resolve(response.data);
|
|
16
|
+
})
|
|
17
|
+
.catch((error) => {
|
|
18
|
+
reject(error);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
getAllQuota,
|
|
25
|
+
};
|