zudello-integration-sdk 1.0.6 → 1.0.7
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/src/sdk/Zudello.js +13 -0
package/package.json
CHANGED
package/src/sdk/Zudello.js
CHANGED
|
@@ -35,6 +35,7 @@ const ZoneModule = require("./submodules/zudello/Zone");
|
|
|
35
35
|
const SupplierModule = require("./submodules/zudello/Supplier");
|
|
36
36
|
const FixedAssetModule = require("./submodules/zudello/FixedAsset");
|
|
37
37
|
const UniversalModule = require("./submodules/zudello/Universal");
|
|
38
|
+
const { default: axios } = require("axios");
|
|
38
39
|
|
|
39
40
|
class ZudelloSDK extends BaseSDK {
|
|
40
41
|
/**
|
|
@@ -152,6 +153,18 @@ class ZudelloSDK extends BaseSDK {
|
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
async getFileContent({ uuid, type }) {
|
|
157
|
+
const validateIsEmpty = this.validator.isEmpty({ uuid, type });
|
|
158
|
+
|
|
159
|
+
if (!validateIsEmpty.valid) {
|
|
160
|
+
return this.responseHandler.error(validateIsEmpty.errors);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const response = await this.getFileAttachment({ uuid, type });
|
|
164
|
+
|
|
165
|
+
return await axios.get(response.data.url);
|
|
166
|
+
}
|
|
167
|
+
|
|
155
168
|
async update({
|
|
156
169
|
model,
|
|
157
170
|
module = null,
|