@ccci/micro-server 1.0.120 → 1.0.122

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.d.ts CHANGED
@@ -13,6 +13,7 @@ export { default as DatabaseConnector } from './utils/DatabaseConnector';
13
13
  export { default as WebSocketServer } from './utils/WebSocketServer';
14
14
  export { default as BaseSocketHandler } from './utils/BaseSocketHandler';
15
15
  export type { WebSocketData } from './types/BaseSocketType';
16
+ export type { UploadedFileType } from './types/UploadedFileType';
16
17
  export { default as Uploader } from './utils/Uploader';
17
18
  export type { NotificationType, NotificationOptions } from './types/NotificationTypes';
18
19
  export { default as PushNotifier } from './utils/PushNotifier';
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,
@@ -0,0 +1,9 @@
1
+ export type UploadedFileType = {
2
+ etag?: string;
3
+ path?: string;
4
+ bucket?: string;
5
+ directory?: string;
6
+ objectName?: string;
7
+ mimeType?: string;
8
+ };
9
+ //# sourceMappingURL=UploadedFileType.d.ts.map
@@ -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<object[]>;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.120",
3
+ "version": "1.0.122",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",