@travetto/web-upload 7.0.0-rc.1 → 7.0.0-rc.2
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/package.json +4 -4
- package/src/decorator.ts +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-upload",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.2",
|
|
4
4
|
"description": "Provides integration between the travetto asset and web module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@fastify/busboy": "^3.2.0",
|
|
29
|
-
"@travetto/config": "^7.0.0-rc.
|
|
30
|
-
"@travetto/web": "^7.0.0-rc.
|
|
29
|
+
"@travetto/config": "^7.0.0-rc.1",
|
|
30
|
+
"@travetto/web": "^7.0.0-rc.2",
|
|
31
31
|
"file-type": "^21.1.1",
|
|
32
32
|
"mime": "^4.1.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@travetto/test": "^7.0.0-rc.
|
|
35
|
+
"@travetto/test": "^7.0.0-rc.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@travetto/test": {
|
package/src/decorator.ts
CHANGED
|
@@ -25,11 +25,12 @@ export function Upload(
|
|
|
25
25
|
|
|
26
26
|
return (instance: ClassInstance, property: string | symbol, idx: number): void => {
|
|
27
27
|
// Register field
|
|
28
|
-
const cls =
|
|
29
|
-
const
|
|
28
|
+
const cls = getClass(instance);
|
|
29
|
+
const adapter = ControllerRegistryIndex.getForRegister(cls);
|
|
30
|
+
const getName = (): string => SchemaRegistryIndex.get(cls).getMethod(property).parameters[idx].name!.toString();
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
adapter.registerFinalizeHandler(() => {
|
|
33
|
+
adapter.registerEndpointInterceptorConfig(
|
|
33
34
|
property,
|
|
34
35
|
WebUploadInterceptor,
|
|
35
36
|
{
|
|
@@ -51,7 +52,7 @@ export function Upload(
|
|
|
51
52
|
return Param('body', {
|
|
52
53
|
...finalConf,
|
|
53
54
|
extract: (request) => {
|
|
54
|
-
const input = SchemaRegistryIndex.
|
|
55
|
+
const input = SchemaRegistryIndex.get(cls).getMethod(property).parameters[idx];
|
|
55
56
|
|
|
56
57
|
if (!input) {
|
|
57
58
|
throw new AppError(`Unknown field type, ensure you are using ${Blob.name}, ${File.name} or ${FileMapContract.name}`);
|