@twin.org/api-models 0.0.1-next.10 → 0.0.1-next.12

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.
@@ -35,6 +35,7 @@ export * from "./models/routes/IRestRouteResponseOptions";
35
35
  export * from "./models/routes/ISocketRoute";
36
36
  export * from "./models/routes/ITag";
37
37
  export * from "./models/server/IHttpRestRouteProcessor";
38
+ export * from "./models/server/IMimeTypeProcessor";
38
39
  export * from "./models/server/IWebServer";
39
40
  export * from "./models/server/IWebServerOptions";
40
41
  export * from "./models/services/healthStatus";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The definition for a handler for a specific MIME type.
3
+ */
4
+ export interface IMimeTypeProcessor {
5
+ /**
6
+ * Get the MIME types that this handler can handle.
7
+ * @returns The MIME types that this handler can handle.
8
+ */
9
+ getTypes(): string[];
10
+ /**
11
+ * Handle content.
12
+ * @param body The body to process.
13
+ * @returns The processed body.
14
+ */
15
+ handle(body: Uint8Array): Promise<unknown>;
16
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/api-models - Changelog
2
2
 
3
- ## v0.0.1-next.10
3
+ ## v0.0.1-next.12
4
4
 
5
5
  - Initial Release
@@ -42,6 +42,7 @@
42
42
  - [ISocketRoute](interfaces/ISocketRoute.md)
43
43
  - [ITag](interfaces/ITag.md)
44
44
  - [IHttpRestRouteProcessor](interfaces/IHttpRestRouteProcessor.md)
45
+ - [IMimeTypeProcessor](interfaces/IMimeTypeProcessor.md)
45
46
  - [IWebServer](interfaces/IWebServer.md)
46
47
  - [IWebServerOptions](interfaces/IWebServerOptions.md)
47
48
  - [IHealthInfo](interfaces/IHealthInfo.md)
@@ -0,0 +1,37 @@
1
+ # Interface: IMimeTypeProcessor
2
+
3
+ The definition for a handler for a specific MIME type.
4
+
5
+ ## Methods
6
+
7
+ ### getTypes()
8
+
9
+ > **getTypes**(): `string`[]
10
+
11
+ Get the MIME types that this handler can handle.
12
+
13
+ #### Returns
14
+
15
+ `string`[]
16
+
17
+ The MIME types that this handler can handle.
18
+
19
+ ***
20
+
21
+ ### handle()
22
+
23
+ > **handle**(`body`): `Promise`\<`unknown`\>
24
+
25
+ Handle content.
26
+
27
+ #### Parameters
28
+
29
+ • **body**: `Uint8Array`
30
+
31
+ The body to process.
32
+
33
+ #### Returns
34
+
35
+ `Promise`\<`unknown`\>
36
+
37
+ The processed body.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-models",
3
- "version": "0.0.1-next.10",
3
+ "version": "0.0.1-next.12",
4
4
  "description": "Contains models and classes for use with APIs",
5
5
  "repository": {
6
6
  "type": "git",