@twin.org/api-models 0.0.1-next.13 → 0.0.1-next.15

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.
@@ -25,6 +25,7 @@ export * from "./models/responses/success/ICreatedResponse";
25
25
  export * from "./models/responses/success/INoContentResponse";
26
26
  export * from "./models/responses/success/IOkResponse";
27
27
  export * from "./models/routes/IBaseRoute";
28
+ export * from "./models/routes/IBaseRouteEntryPoint";
28
29
  export * from "./models/routes/IRestRoute";
29
30
  export * from "./models/routes/IRestRouteEntryPoint";
30
31
  export * from "./models/routes/IRestRouteExample";
@@ -33,10 +34,11 @@ export * from "./models/routes/IRestRouteResponseAttachmentOptions";
33
34
  export * from "./models/routes/IRestRouteResponseExample";
34
35
  export * from "./models/routes/IRestRouteResponseOptions";
35
36
  export * from "./models/routes/ISocketRoute";
37
+ export * from "./models/routes/ISocketRouteEntryPoint";
36
38
  export * from "./models/routes/ITag";
37
- export * from "./models/server/IRestRouteProcessor";
38
- export * from "./models/server/IMimeTypeProcessor";
39
39
  export * from "./models/server/IBaseRouteProcessor";
40
+ export * from "./models/server/IMimeTypeProcessor";
41
+ export * from "./models/server/IRestRouteProcessor";
40
42
  export * from "./models/server/ISocketRouteProcessor";
41
43
  export * from "./models/server/IWebServer";
42
44
  export * from "./models/server/IWebServerOptions";
@@ -0,0 +1,22 @@
1
+ import type { ITag } from "./ITag";
2
+ /**
3
+ * Route entry points are used for exposing the routes from a package.
4
+ */
5
+ export interface IBaseRouteEntryPoint<T> {
6
+ /**
7
+ * The name of the routes.
8
+ */
9
+ name: string;
10
+ /**
11
+ * The default base route name for the routes.
12
+ */
13
+ defaultBaseRoute: string;
14
+ /**
15
+ * The tags for the routes.
16
+ */
17
+ tags: ITag[];
18
+ /**
19
+ * The method to generate the routes.
20
+ */
21
+ generateRoutes: (baseRouteName: string, componentName: string) => T[];
22
+ }
@@ -1,23 +1,6 @@
1
+ import type { IBaseRouteEntryPoint } from "./IBaseRouteEntryPoint";
1
2
  import type { IRestRoute } from "./IRestRoute";
2
- import type { ITag } from "./ITag";
3
3
  /**
4
4
  * Route entry points are used for exposing the REST routes from a package.
5
5
  */
6
- export interface IRestRouteEntryPoint {
7
- /**
8
- * The name of the REST routes.
9
- */
10
- name: string;
11
- /**
12
- * The default base route name for the REST routes.
13
- */
14
- defaultBaseRoute: string;
15
- /**
16
- * The tags for the REST routes.
17
- */
18
- tags: ITag[];
19
- /**
20
- * The method to generate the REST routes.
21
- */
22
- generateRoutes: (baseRouteName: string, componentName: string) => IRestRoute[];
23
- }
6
+ export type IRestRouteEntryPoint = IBaseRouteEntryPoint<IRestRoute>;
@@ -21,5 +21,5 @@ export interface ISocketRoute<T extends IHttpRequest = any, U extends IHttpRespo
21
21
  /**
22
22
  * The function to emit a message.
23
23
  */
24
- emit: (response: U) => Promise<void>) => void;
24
+ emit: (topic: string, response: U) => Promise<void>) => void;
25
25
  }
@@ -0,0 +1,6 @@
1
+ import type { IBaseRouteEntryPoint } from "./IBaseRouteEntryPoint";
2
+ import type { ISocketRoute } from "./ISocketRoute";
3
+ /**
4
+ * Route entry points are used for exposing the socket routes from a package.
5
+ */
6
+ export type ISocketRouteEntryPoint = IBaseRouteEntryPoint<ISocketRoute>;
@@ -39,5 +39,5 @@ export interface ISocketRouteProcessor extends IBaseRouteProcessor<ISocketRoute>
39
39
  */
40
40
  process?(request: IHttpServerRequest, response: IHttpResponse, route: ISocketRoute | undefined, requestIdentity: IHttpRequestIdentity, processorState: {
41
41
  [id: string]: unknown;
42
- }, responseEmitter: (response: IHttpResponse) => Promise<void>): Promise<void>;
42
+ }, responseEmitter: (topic: string, response: IHttpResponse) => Promise<void>): Promise<void>;
43
43
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/api-models - Changelog
2
2
 
3
- ## v0.0.1-next.13
3
+ ## v0.0.1-next.15
4
4
 
5
5
  - Initial Release
@@ -32,8 +32,8 @@
32
32
  - [INoContentResponse](interfaces/INoContentResponse.md)
33
33
  - [IOkResponse](interfaces/IOkResponse.md)
34
34
  - [IBaseRoute](interfaces/IBaseRoute.md)
35
+ - [IBaseRouteEntryPoint](interfaces/IBaseRouteEntryPoint.md)
35
36
  - [IRestRoute](interfaces/IRestRoute.md)
36
- - [IRestRouteEntryPoint](interfaces/IRestRouteEntryPoint.md)
37
37
  - [IRestRouteExample](interfaces/IRestRouteExample.md)
38
38
  - [IRestRouteRequestExample](interfaces/IRestRouteRequestExample.md)
39
39
  - [IRestRouteResponseAttachmentOptions](interfaces/IRestRouteResponseAttachmentOptions.md)
@@ -53,6 +53,8 @@
53
53
 
54
54
  ## Type Aliases
55
55
 
56
+ - [IRestRouteEntryPoint](type-aliases/IRestRouteEntryPoint.md)
57
+ - [ISocketRouteEntryPoint](type-aliases/ISocketRouteEntryPoint.md)
56
58
  - [HealthStatus](type-aliases/HealthStatus.md)
57
59
 
58
60
  ## Variables
@@ -0,0 +1,49 @@
1
+ # Interface: IBaseRouteEntryPoint\<T\>
2
+
3
+ Route entry points are used for exposing the routes from a package.
4
+
5
+ ## Type Parameters
6
+
7
+ • **T**
8
+
9
+ ## Properties
10
+
11
+ ### name
12
+
13
+ > **name**: `string`
14
+
15
+ The name of the routes.
16
+
17
+ ***
18
+
19
+ ### defaultBaseRoute
20
+
21
+ > **defaultBaseRoute**: `string`
22
+
23
+ The default base route name for the routes.
24
+
25
+ ***
26
+
27
+ ### tags
28
+
29
+ > **tags**: [`ITag`](ITag.md)[]
30
+
31
+ The tags for the routes.
32
+
33
+ ***
34
+
35
+ ### generateRoutes()
36
+
37
+ > **generateRoutes**: (`baseRouteName`, `componentName`) => `T`[]
38
+
39
+ The method to generate the routes.
40
+
41
+ #### Parameters
42
+
43
+ • **baseRouteName**: `string`
44
+
45
+ • **componentName**: `string`
46
+
47
+ #### Returns
48
+
49
+ `T`[]
@@ -0,0 +1,5 @@
1
+ # Type Alias: IRestRouteEntryPoint
2
+
3
+ > **IRestRouteEntryPoint**: [`IBaseRouteEntryPoint`](../interfaces/IBaseRouteEntryPoint.md)\<[`IRestRoute`](../interfaces/IRestRoute.md)\>
4
+
5
+ Route entry points are used for exposing the REST routes from a package.
@@ -0,0 +1,5 @@
1
+ # Type Alias: ISocketRouteEntryPoint
2
+
3
+ > **ISocketRouteEntryPoint**: [`IBaseRouteEntryPoint`](../interfaces/IBaseRouteEntryPoint.md)\<[`ISocketRoute`](../interfaces/ISocketRoute.md)\>
4
+
5
+ Route entry points are used for exposing the socket routes from a package.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-models",
3
- "version": "0.0.1-next.13",
3
+ "version": "0.0.1-next.15",
4
4
  "description": "Contains models and classes for use with APIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,45 +0,0 @@
1
- # Interface: IRestRouteEntryPoint
2
-
3
- Route entry points are used for exposing the REST routes from a package.
4
-
5
- ## Properties
6
-
7
- ### name
8
-
9
- > **name**: `string`
10
-
11
- The name of the REST routes.
12
-
13
- ***
14
-
15
- ### defaultBaseRoute
16
-
17
- > **defaultBaseRoute**: `string`
18
-
19
- The default base route name for the REST routes.
20
-
21
- ***
22
-
23
- ### tags
24
-
25
- > **tags**: [`ITag`](ITag.md)[]
26
-
27
- The tags for the REST routes.
28
-
29
- ***
30
-
31
- ### generateRoutes()
32
-
33
- > **generateRoutes**: (`baseRouteName`, `componentName`) => [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>[]
34
-
35
- The method to generate the REST routes.
36
-
37
- #### Parameters
38
-
39
- • **baseRouteName**: `string`
40
-
41
- • **componentName**: `string`
42
-
43
- #### Returns
44
-
45
- [`IRestRoute`](IRestRoute.md)\<`any`, `any`\>[]