@travetto/web-upload 7.0.4 → 7.0.6
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/README.md +1 -1
- package/package.json +4 -4
- package/src/decorator.ts +4 -4
- package/src/interceptor.ts +4 -4
- package/src/util.ts +3 -3
- package/support/test/server.ts +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ A simple example:
|
|
|
22
22
|
**Code: Web controller with upload support**
|
|
23
23
|
```typescript
|
|
24
24
|
import { Controller, Post, Get } from '@travetto/web';
|
|
25
|
-
import { FileMap, Upload } from '@travetto/web-upload';
|
|
25
|
+
import { type FileMap, Upload } from '@travetto/web-upload';
|
|
26
26
|
|
|
27
27
|
@Controller('/simple')
|
|
28
28
|
export class Simple {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-upload",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Provides integration between the travetto asset and web module.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@fastify/busboy": "^3.2.0",
|
|
30
|
-
"@travetto/config": "^7.0.
|
|
31
|
-
"@travetto/web": "^7.0.
|
|
30
|
+
"@travetto/config": "^7.0.6",
|
|
31
|
+
"@travetto/web": "^7.0.6",
|
|
32
32
|
"file-type": "^21.3.0",
|
|
33
33
|
"mime": "^4.1.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/test": "^7.0.
|
|
36
|
+
"@travetto/test": "^7.0.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/test": {
|
package/src/decorator.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AppError, toConcrete, ClassInstance, getClass } from '@travetto/runtime';
|
|
2
|
-
import { ControllerRegistryIndex, EndpointParameterConfig, Param } from '@travetto/web';
|
|
1
|
+
import { AppError, toConcrete, type ClassInstance, getClass } from '@travetto/runtime';
|
|
2
|
+
import { ControllerRegistryIndex, type EndpointParameterConfig, Param } from '@travetto/web';
|
|
3
3
|
import { SchemaRegistryIndex } from '@travetto/schema';
|
|
4
4
|
|
|
5
5
|
import { WebUploadInterceptor } from './interceptor.ts';
|
|
6
|
-
import { WebUploadConfig } from './config.ts';
|
|
7
|
-
import { FileMap } from './types.ts';
|
|
6
|
+
import type { WebUploadConfig } from './config.ts';
|
|
7
|
+
import type { FileMap } from './types.ts';
|
|
8
8
|
import { WebUploadUtil } from './util.ts';
|
|
9
9
|
|
|
10
10
|
type UploadConfig = Partial<Pick<WebUploadConfig, 'types' | 'maxSize' | 'cleanupFiles'>>;
|
package/src/interceptor.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Inject, Injectable } from '@travetto/di';
|
|
2
2
|
import {
|
|
3
|
-
BodyInterceptor, WebInterceptor, WebInterceptorCategory, WebChainedContext,
|
|
4
|
-
WebResponse, DecompressInterceptor, WebInterceptorContext
|
|
3
|
+
BodyInterceptor, type WebInterceptor, type WebInterceptorCategory, type WebChainedContext,
|
|
4
|
+
type WebResponse, DecompressInterceptor, type WebInterceptorContext
|
|
5
5
|
} from '@travetto/web';
|
|
6
6
|
|
|
7
|
-
import { WebUploadConfig } from './config.ts';
|
|
7
|
+
import type { WebUploadConfig } from './config.ts';
|
|
8
8
|
import { WebUploadUtil } from './util.ts';
|
|
9
|
-
import { FileMap } from './types.ts';
|
|
9
|
+
import type { FileMap } from './types.ts';
|
|
10
10
|
|
|
11
11
|
@Injectable()
|
|
12
12
|
export class WebUploadInterceptor implements WebInterceptor<WebUploadConfig> {
|
package/src/util.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { Readable, Transform } from 'node:stream';
|
|
|
7
7
|
|
|
8
8
|
import busboy from '@fastify/busboy';
|
|
9
9
|
|
|
10
|
-
import { WebRequest, WebCommonUtil, WebBodyUtil, WebHeaderUtil } from '@travetto/web';
|
|
10
|
+
import { type WebRequest, WebCommonUtil, WebBodyUtil, WebHeaderUtil } from '@travetto/web';
|
|
11
11
|
import { AsyncQueue, AppError, castTo, Util, BinaryUtil } from '@travetto/runtime';
|
|
12
12
|
|
|
13
|
-
import { WebUploadConfig } from './config.ts';
|
|
14
|
-
import { FileMap } from './types.ts';
|
|
13
|
+
import type { WebUploadConfig } from './config.ts';
|
|
14
|
+
import type { FileMap } from './types.ts';
|
|
15
15
|
|
|
16
16
|
const MULTIPART = new Set(['application/x-www-form-urlencoded', 'multipart/form-data']);
|
|
17
17
|
|
package/support/test/server.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Registry } from '@travetto/registry';
|
|
|
8
8
|
import { BaseWebSuite } from '@travetto/web/support/test/suite/base.ts';
|
|
9
9
|
|
|
10
10
|
import { Upload } from '../../src/decorator.ts';
|
|
11
|
-
import { FileMap } from '../../src/types.ts';
|
|
11
|
+
import type { FileMap } from '../../src/types.ts';
|
|
12
12
|
|
|
13
13
|
const bHash = (blob: Blob) => BinaryUtil.getBlobMeta(blob)?.hash;
|
|
14
14
|
|