owebjs 1.2.0 → 1.2.1

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.
@@ -0,0 +1,34 @@
1
+ interface FileData {
2
+ buffer: Buffer;
3
+ fileName: string;
4
+ currentChunk: number;
5
+ totalChunks: number;
6
+ }
7
+ interface ChunkUploadOptions {
8
+ /**
9
+ * Path to save file
10
+ */
11
+ path: string;
12
+ /**
13
+ * Max chunk size in bytes
14
+ */
15
+ maxChunkSize: number;
16
+ /**
17
+ * Max file size in bytes
18
+ */
19
+ maxFileSize?: number;
20
+ }
21
+ interface ChunkUploadResult {
22
+ statusCode: ChunkUploadStatusCode;
23
+ uploadCompleted?: true;
24
+ currentChunk?: number;
25
+ }
26
+ declare enum ChunkUploadStatusCode {
27
+ Success = 200,
28
+ FileTooLarge = 413,
29
+ ChunkTooLarge = 413,
30
+ InvalidChunk = 400
31
+ }
32
+ declare function ChunkUpload(file: FileData, options: ChunkUploadOptions): Promise<ChunkUploadResult>;
33
+
34
+ export { ChunkUpload, ChunkUploadOptions, ChunkUploadResult, ChunkUploadStatusCode, FileData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owebjs",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Flexible handler that built on top of Fastify",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "./plugins": {
14
14
  "import": "./dist/plugins/index.js",
15
- "default": "./dist/plugins/index.js"
15
+ "default": "./dist/plugins/index.js",
16
+ "types": "./dist/plugins/index.d.ts"
16
17
  }
17
18
  },
18
19
  "scripts": {