@ccci/micro-server 1.0.119 → 1.0.121
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/dist/index.js
CHANGED
|
@@ -250743,19 +250743,13 @@ class Uploader {
|
|
|
250743
250743
|
} else {
|
|
250744
250744
|
files.push(uploads);
|
|
250745
250745
|
}
|
|
250746
|
-
console.log("bucket :>> ", bucket);
|
|
250747
|
-
console.log("dir :>> ", dir);
|
|
250748
|
-
console.log("uploads :>> ", uploads);
|
|
250749
250746
|
let response4 = [];
|
|
250750
250747
|
for (let index2 = 0;index2 < files.length; index2++) {
|
|
250751
250748
|
const file = files[index2];
|
|
250752
250749
|
let filename = file.name.replace(/ /g, "_");
|
|
250753
250750
|
let newName = new Date;
|
|
250754
250751
|
let path3 = `/${bucket}/${dir}/${newName.getTime()}`;
|
|
250755
|
-
console.log("path :>> ", path3);
|
|
250756
|
-
console.log("Uploader.client :>> ", Uploader.client);
|
|
250757
250752
|
let etag = await Uploader.client.putObject(bucket, `${dir}/${newName.getTime()}`, file.data, file.size, { "Content-type": file.mimetype });
|
|
250758
|
-
console.log("etag :>> ", etag);
|
|
250759
250753
|
response4.push({
|
|
250760
250754
|
etag,
|
|
250761
250755
|
path: path3,
|
|
@@ -250958,10 +250952,6 @@ class PushNotifier {
|
|
|
250958
250952
|
credential: import_firebase_admin.default.credential.cert(FirebaseServiceAccount.default)
|
|
250959
250953
|
});
|
|
250960
250954
|
PushNotifier.instance = PushNotifier.FirebaseAdmin.app.length;
|
|
250961
|
-
PushNotifier.FirebaseAdmin.messaging().send({
|
|
250962
|
-
token: "fW3o0vp_F2iPB9qsJp0UEP:APA91bEuiMrkpSQnJi8FyvkNPJNK4uSTqBHGQ18QLufnZpl7xOC3-6-Fz938fCqX0iimTNAFpY42r2Dm0zz3ClGgOhagF9MTjYE3JwresxjfxRhe8NO-qK8UbYp8-EwDDs0PalNCMMfu",
|
|
250963
|
-
notification: { title: "Push Notification", body: "Push Notification" }
|
|
250964
|
-
});
|
|
250965
250955
|
});
|
|
250966
250956
|
}
|
|
250967
250957
|
}
|
package/dist/utils/Uploader.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UploadedFile } from 'express-fileupload';
|
|
2
2
|
import * as minio from 'minio';
|
|
3
3
|
import { ApplicationOptionType } from '..';
|
|
4
|
+
import { UploadedFileType } from '@/types/UploadedFileType';
|
|
4
5
|
export default class Uploader {
|
|
5
6
|
static client: minio.Client;
|
|
6
7
|
constructor();
|
|
@@ -19,7 +20,7 @@ export default class Uploader {
|
|
|
19
20
|
* @param uploads {Array<UploadedFile> | UploadedFile} file(s) to be uploaded
|
|
20
21
|
* @returns
|
|
21
22
|
*/
|
|
22
|
-
static upload(bucket: string, dir: string, uploads: Array<UploadedFile> | UploadedFile): Promise<
|
|
23
|
+
static upload(bucket: string, dir: string, uploads: Array<UploadedFile> | UploadedFile): Promise<Array<UploadedFileType>>;
|
|
23
24
|
/**
|
|
24
25
|
*
|
|
25
26
|
* @param bucket {string} bucket name
|