@stemy/backend 2.9.2 → 2.9.3
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/bundles/stemy-backend.umd.js +2 -3
- package/bundles/stemy-backend.umd.js.map +1 -1
- package/bundles/stemy-backend.umd.min.js +1 -1
- package/bundles/stemy-backend.umd.min.js.map +1 -1
- package/common-types.d.ts +1 -0
- package/esm2015/common-types.js +1 -1
- package/esm2015/services/assets.js +2 -3
- package/fesm2015/stemy-backend.js +1 -2
- package/fesm2015/stemy-backend.js.map +1 -1
- package/package.json +1 -1
|
@@ -1947,18 +1947,17 @@
|
|
|
1947
1947
|
};
|
|
1948
1948
|
Assets.prototype.upload = function (stream, fileType, metadata) {
|
|
1949
1949
|
return __awaiter$q(this, void 0, void 0, function () {
|
|
1950
|
-
var contentType
|
|
1950
|
+
var contentType;
|
|
1951
1951
|
var _this = this;
|
|
1952
1952
|
return __generator(this, function (_b) {
|
|
1953
1953
|
contentType = fileType.mime.trim();
|
|
1954
|
-
extension = (fileType.ext || "").trim();
|
|
1955
1954
|
metadata = Object.assign({
|
|
1956
|
-
extension: extension,
|
|
1957
1955
|
downloadCount: 0,
|
|
1958
1956
|
firstDownload: null,
|
|
1959
1957
|
lastDownload: null
|
|
1960
1958
|
}, metadata || {});
|
|
1961
1959
|
metadata.filename = metadata.filename || new bson.ObjectId().toHexString();
|
|
1960
|
+
metadata.extension = (fileType.ext || "").trim();
|
|
1962
1961
|
return [2 /*return*/, new Promise((function (resolve, reject) {
|
|
1963
1962
|
var uploaderStream = _this.bucket.openUploadStream(metadata.filename);
|
|
1964
1963
|
stream.pipe(uploaderStream)
|