@stackfactor/client-api 1.1.116 → 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.
Files changed (2) hide show
  1. package/lib/aiAssistant.js +25 -0
  2. package/package.json +1 -1
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.116",
3
+ "version": "1.1.117",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {