@kipicore/dbcore 1.1.339 → 1.1.341
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.
|
@@ -55,8 +55,14 @@ class FileStorageModel extends sequelize_1.Model {
|
|
|
55
55
|
return;
|
|
56
56
|
const instanceArray = Array.isArray(instances) ? instances : [instances];
|
|
57
57
|
await Promise.all(instanceArray.map(async (instance) => {
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const data = typeof instance.get === 'function' ? instance.get() : instance;
|
|
59
|
+
const signedUrl = await (0, helpers_1.getPresignedUrl)(configs_1.ENV_VARIABLE.AWS_BUCKET_NAME, data);
|
|
60
|
+
if (typeof instance.setDataValue === 'function') {
|
|
61
|
+
instance.setDataValue('filePath', signedUrl);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
instance.filePath = signedUrl;
|
|
65
|
+
}
|
|
60
66
|
}));
|
|
61
67
|
});
|
|
62
68
|
}
|
package/package.json
CHANGED