@ccci/micro-server 1.0.47 → 1.0.49

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.
@@ -10,5 +10,10 @@ export type ApplicationOptionType = {
10
10
  enableWebSocket?: boolean;
11
11
  enableFirebase?: boolean;
12
12
  enableEmail?: boolean;
13
+ minioHost?: string;
14
+ minioPort?: number;
15
+ minioAccessKey?: string;
16
+ minioSecretKey?: string;
17
+ minioUseSSL?: boolean;
13
18
  };
14
19
  //# sourceMappingURL=ApplicationOptionType.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { UploadedFile } from 'express-fileupload';
2
+ import * as minio from 'minio';
3
+ import { ApplicationOptionType } from '..';
4
+ export default class Uploader {
5
+ static client: minio.Client;
6
+ constructor();
7
+ /**
8
+ * Initializes the minIO client instance
9
+ */
10
+ static init(options: ApplicationOptionType): Promise<void>;
11
+ /**
12
+ * checks .env variables if properly configured
13
+ */
14
+ static hasValidConfig(options: ApplicationOptionType): boolean;
15
+ /**
16
+ *
17
+ * @param bucket {string} The bucket name in minIO
18
+ * @param dir {string} The directory where the files are stored
19
+ * @param uploads {Array<UploadedFile> | UploadedFile} file(s) to be uploaded
20
+ * @returns
21
+ */
22
+ static upload(bucket: string, dir: string, uploads: Array<UploadedFile> | UploadedFile): Promise<object[]>;
23
+ /**
24
+ *
25
+ * @param bucket {string} bucket name
26
+ * @param file {string} file directory
27
+ */
28
+ preview(bucket: string, file: string): Promise<void>;
29
+ }
30
+ //# sourceMappingURL=Uploader.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,6 +40,7 @@
40
40
  "express-fileupload": "^1.5.0",
41
41
  "helmet": "^7.1.0",
42
42
  "jsonwebtoken": "^9.0.2",
43
+ "minio": "^8.0.0",
43
44
  "pg": "^8.11.5",
44
45
  "pg-hstore": "^2.3.4",
45
46
  "sequelize": "^6.37.3",