zudello-integration-sdk 1.0.7 → 1.0.9

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/package.json +1 -1
  2. package/src/sdk/Zudello.js +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudello-integration-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -162,7 +162,22 @@ class ZudelloSDK extends BaseSDK {
162
162
 
163
163
  const response = await this.getFileAttachment({ uuid, type });
164
164
 
165
- return await axios.get(response.data.url);
165
+ return await axios.get(response.data);
166
+ }
167
+
168
+ async ai({ key, body }) {
169
+ const validateIsEmpty = this.validator.isEmpty({ key, body });
170
+
171
+ if (!validateIsEmpty.valid) {
172
+ return this.responseHandler.error(validateIsEmpty.errors);
173
+ }
174
+
175
+ return await axios.post("https://openrouter.ai/api/v1/chat/completions", body, {
176
+ headers: {
177
+ Authorization: `Bearer ${key}`,
178
+ "Content-Type": "application/json",
179
+ },
180
+ });
166
181
  }
167
182
 
168
183
  async update({