@twin.org/api-models 0.0.1-next.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.
- package/LICENSE +201 -0
- package/README.md +21 -0
- package/dist/cjs/index.cjs +90 -0
- package/dist/esm/index.mjs +87 -0
- package/dist/types/helpers/httpErrorHelper.d.ts +25 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/models/api/IServerHealthResponse.d.ts +10 -0
- package/dist/types/models/api/IServerInfoResponse.d.ts +10 -0
- package/dist/types/models/api/IServerSpecResponse.d.ts +14 -0
- package/dist/types/models/config/IBaseRestClientConfig.d.ts +26 -0
- package/dist/types/models/config/IBaseSocketClientConfig.d.ts +18 -0
- package/dist/types/models/protocol/IHttpRequest.d.ts +24 -0
- package/dist/types/models/protocol/IHttpRequestContext.d.ts +17 -0
- package/dist/types/models/protocol/IHttpRequestIdentity.d.ts +13 -0
- package/dist/types/models/protocol/IHttpRequestPathParams.d.ts +6 -0
- package/dist/types/models/protocol/IHttpRequestQuery.d.ts +6 -0
- package/dist/types/models/protocol/IHttpResponse.d.ts +18 -0
- package/dist/types/models/protocol/IHttpServerRequest.d.ts +15 -0
- package/dist/types/models/requests/INoContentRequest.d.ts +22 -0
- package/dist/types/models/responses/errors/IBadRequestResponse.d.ts +15 -0
- package/dist/types/models/responses/errors/IConflictResponse.d.ts +20 -0
- package/dist/types/models/responses/errors/IForbiddenResponse.d.ts +15 -0
- package/dist/types/models/responses/errors/IInternalServerErrorResponse.d.ts +15 -0
- package/dist/types/models/responses/errors/INotFoundResponse.d.ts +20 -0
- package/dist/types/models/responses/errors/IUnauthorizedResponse.d.ts +15 -0
- package/dist/types/models/responses/errors/IUnprocessableEntityResponse.d.ts +15 -0
- package/dist/types/models/responses/success/IAcceptedResponse.d.ts +19 -0
- package/dist/types/models/responses/success/ICreatedResponse.d.ts +19 -0
- package/dist/types/models/responses/success/INoContentResponse.d.ts +10 -0
- package/dist/types/models/responses/success/IOkResponse.d.ts +10 -0
- package/dist/types/models/routes/IBaseRoute.d.ts +17 -0
- package/dist/types/models/routes/IRestRoute.d.ts +81 -0
- package/dist/types/models/routes/IRestRouteEntryPoint.d.ts +23 -0
- package/dist/types/models/routes/IRestRouteResponseAttachmentOptions.d.ts +17 -0
- package/dist/types/models/routes/IRestRouteResponseOptions.d.ts +10 -0
- package/dist/types/models/routes/ISocketRoute.d.ts +27 -0
- package/dist/types/models/routes/ITag.d.ts +13 -0
- package/dist/types/models/server/IHttpRestRouteProcessor.d.ts +46 -0
- package/dist/types/models/server/IWebServer.d.ts +31 -0
- package/dist/types/models/server/IWebServerOptions.d.ts +34 -0
- package/dist/types/models/services/IHealthInfo.d.ts +27 -0
- package/dist/types/models/services/IInformationComponent.d.ts +38 -0
- package/dist/types/models/services/IServerInfo.d.ts +13 -0
- package/dist/types/models/services/healthStatus.d.ts +21 -0
- package/docs/changelog.md +5 -0
- package/docs/examples.md +1 -0
- package/docs/reference/classes/HttpErrorHelper.md +71 -0
- package/docs/reference/index.md +53 -0
- package/docs/reference/interfaces/IAcceptedResponse.md +25 -0
- package/docs/reference/interfaces/IBadRequestResponse.md +19 -0
- package/docs/reference/interfaces/IBaseRestClientConfig.md +43 -0
- package/docs/reference/interfaces/IBaseRoute.md +32 -0
- package/docs/reference/interfaces/IBaseSocketClientConfig.md +27 -0
- package/docs/reference/interfaces/IConflictResponse.md +27 -0
- package/docs/reference/interfaces/ICreatedResponse.md +25 -0
- package/docs/reference/interfaces/IForbiddenResponse.md +19 -0
- package/docs/reference/interfaces/IHealthInfo.md +19 -0
- package/docs/reference/interfaces/IHttpRequest.md +44 -0
- package/docs/reference/interfaces/IHttpRequestContext.md +51 -0
- package/docs/reference/interfaces/IHttpRequestIdentity.md +23 -0
- package/docs/reference/interfaces/IHttpRequestPathParams.md +7 -0
- package/docs/reference/interfaces/IHttpRequestQuery.md +7 -0
- package/docs/reference/interfaces/IHttpResponse.md +31 -0
- package/docs/reference/interfaces/IHttpRestRouteProcessor.md +115 -0
- package/docs/reference/interfaces/IHttpServerRequest.md +75 -0
- package/docs/reference/interfaces/IInformationComponent.md +97 -0
- package/docs/reference/interfaces/IInternalServerErrorResponse.md +19 -0
- package/docs/reference/interfaces/INoContentRequest.md +55 -0
- package/docs/reference/interfaces/INoContentResponse.md +11 -0
- package/docs/reference/interfaces/INotFoundResponse.md +27 -0
- package/docs/reference/interfaces/IOkResponse.md +11 -0
- package/docs/reference/interfaces/IRestRoute.md +137 -0
- package/docs/reference/interfaces/IRestRouteEntryPoint.md +45 -0
- package/docs/reference/interfaces/IRestRouteResponseAttachmentOptions.md +27 -0
- package/docs/reference/interfaces/IRestRouteResponseOptions.md +11 -0
- package/docs/reference/interfaces/IServerHealthResponse.md +11 -0
- package/docs/reference/interfaces/IServerInfo.md +19 -0
- package/docs/reference/interfaces/IServerInfoResponse.md +11 -0
- package/docs/reference/interfaces/IServerSpecResponse.md +19 -0
- package/docs/reference/interfaces/ISocketRoute.md +73 -0
- package/docs/reference/interfaces/ITag.md +19 -0
- package/docs/reference/interfaces/IUnauthorizedResponse.md +19 -0
- package/docs/reference/interfaces/IUnprocessableEntityResponse.md +19 -0
- package/docs/reference/interfaces/IWebServer.md +77 -0
- package/docs/reference/interfaces/IWebServerOptions.md +75 -0
- package/docs/reference/type-aliases/HealthStatus.md +5 -0
- package/docs/reference/variables/HealthStatus.md +25 -0
- package/locales/en.json +9 -0
- package/package.json +65 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Interface: IHttpServerRequest\<T\>
|
|
2
|
+
|
|
3
|
+
Model for the standard parameters for an http request.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IHttpRequest`](IHttpRequest.md)\<`T`\>
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
• **T** = `any`
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### headers?
|
|
16
|
+
|
|
17
|
+
> `optional` **headers**: `IHttpHeaders`
|
|
18
|
+
|
|
19
|
+
Incoming Http Headers.
|
|
20
|
+
|
|
21
|
+
#### Inherited from
|
|
22
|
+
|
|
23
|
+
[`IHttpRequest`](IHttpRequest.md).[`headers`](IHttpRequest.md#headers)
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### pathParams?
|
|
28
|
+
|
|
29
|
+
> `optional` **pathParams**: [`IHttpRequestPathParams`](IHttpRequestPathParams.md)
|
|
30
|
+
|
|
31
|
+
The path parameters.
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`IHttpRequest`](IHttpRequest.md).[`pathParams`](IHttpRequest.md#pathparams)
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### query?
|
|
40
|
+
|
|
41
|
+
> `optional` **query**: [`IHttpRequestQuery`](IHttpRequestQuery.md)
|
|
42
|
+
|
|
43
|
+
The query parameters.
|
|
44
|
+
|
|
45
|
+
#### Inherited from
|
|
46
|
+
|
|
47
|
+
[`IHttpRequest`](IHttpRequest.md).[`query`](IHttpRequest.md#query)
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### body?
|
|
52
|
+
|
|
53
|
+
> `optional` **body**: `T`
|
|
54
|
+
|
|
55
|
+
Data to return send as the body.
|
|
56
|
+
|
|
57
|
+
#### Inherited from
|
|
58
|
+
|
|
59
|
+
[`IHttpRequest`](IHttpRequest.md).[`body`](IHttpRequest.md#body)
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### method?
|
|
64
|
+
|
|
65
|
+
> `optional` **method**: `HttpMethod`
|
|
66
|
+
|
|
67
|
+
The request method.
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
71
|
+
### url?
|
|
72
|
+
|
|
73
|
+
> `optional` **url**: `string`
|
|
74
|
+
|
|
75
|
+
The request url.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Interface: IInformationComponent
|
|
2
|
+
|
|
3
|
+
The information component for the server.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### info()
|
|
12
|
+
|
|
13
|
+
> **info**(): `Promise`\<[`IServerInfo`](IServerInfo.md)\>
|
|
14
|
+
|
|
15
|
+
Get the server information.
|
|
16
|
+
|
|
17
|
+
#### Returns
|
|
18
|
+
|
|
19
|
+
`Promise`\<[`IServerInfo`](IServerInfo.md)\>
|
|
20
|
+
|
|
21
|
+
The service information.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### spec()
|
|
26
|
+
|
|
27
|
+
> **spec**(): `Promise`\<`unknown`\>
|
|
28
|
+
|
|
29
|
+
Get the OpenAPI spec.
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<`unknown`\>
|
|
34
|
+
|
|
35
|
+
The OpenAPI spec.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### health()
|
|
40
|
+
|
|
41
|
+
> **health**(): `Promise`\<[`IHealthInfo`](IHealthInfo.md)\>
|
|
42
|
+
|
|
43
|
+
Get the server health.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`Promise`\<[`IHealthInfo`](IHealthInfo.md)\>
|
|
48
|
+
|
|
49
|
+
The service health.
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### setComponentHealth()
|
|
54
|
+
|
|
55
|
+
> **setComponentHealth**(`name`, `status`, `details`?): `Promise`\<`void`\>
|
|
56
|
+
|
|
57
|
+
Set the status of a component.
|
|
58
|
+
|
|
59
|
+
#### Parameters
|
|
60
|
+
|
|
61
|
+
• **name**: `string`
|
|
62
|
+
|
|
63
|
+
The component name.
|
|
64
|
+
|
|
65
|
+
• **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
|
|
66
|
+
|
|
67
|
+
The status of the component.
|
|
68
|
+
|
|
69
|
+
• **details?**: `string`
|
|
70
|
+
|
|
71
|
+
The details for the status.
|
|
72
|
+
|
|
73
|
+
#### Returns
|
|
74
|
+
|
|
75
|
+
`Promise`\<`void`\>
|
|
76
|
+
|
|
77
|
+
Nothing.
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### removeComponentHealth()
|
|
82
|
+
|
|
83
|
+
> **removeComponentHealth**(`name`): `Promise`\<`void`\>
|
|
84
|
+
|
|
85
|
+
Remove the status of a component.
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
• **name**: `string`
|
|
90
|
+
|
|
91
|
+
The component name.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`void`\>
|
|
96
|
+
|
|
97
|
+
Nothing.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IInternalServerErrorResponse
|
|
2
|
+
|
|
3
|
+
The server has encountered a situation it does not know how to handle, see the content for more details.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode
|
|
8
|
+
|
|
9
|
+
> **statusCode**: `500`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body
|
|
16
|
+
|
|
17
|
+
> **body**: `IError`
|
|
18
|
+
|
|
19
|
+
The body which contains the error.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Interface: INoContentRequest
|
|
2
|
+
|
|
3
|
+
A REST request with no input parameters.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IHttpRequest`](IHttpRequest.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### headers?
|
|
12
|
+
|
|
13
|
+
> `optional` **headers**: `undefined`
|
|
14
|
+
|
|
15
|
+
Incoming Http Headers.
|
|
16
|
+
|
|
17
|
+
#### Overrides
|
|
18
|
+
|
|
19
|
+
[`IHttpRequest`](IHttpRequest.md).[`headers`](IHttpRequest.md#headers)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### pathParams?
|
|
24
|
+
|
|
25
|
+
> `optional` **pathParams**: `undefined`
|
|
26
|
+
|
|
27
|
+
The path parameters.
|
|
28
|
+
|
|
29
|
+
#### Overrides
|
|
30
|
+
|
|
31
|
+
[`IHttpRequest`](IHttpRequest.md).[`pathParams`](IHttpRequest.md#pathparams)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### query?
|
|
36
|
+
|
|
37
|
+
> `optional` **query**: `undefined`
|
|
38
|
+
|
|
39
|
+
The query parameters.
|
|
40
|
+
|
|
41
|
+
#### Overrides
|
|
42
|
+
|
|
43
|
+
[`IHttpRequest`](IHttpRequest.md).[`query`](IHttpRequest.md#query)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### body?
|
|
48
|
+
|
|
49
|
+
> `optional` **body**: `undefined`
|
|
50
|
+
|
|
51
|
+
Data to return send as the body.
|
|
52
|
+
|
|
53
|
+
#### Overrides
|
|
54
|
+
|
|
55
|
+
[`IHttpRequest`](IHttpRequest.md).[`body`](IHttpRequest.md#body)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: INotFoundResponse
|
|
2
|
+
|
|
3
|
+
The resource you tried to access does not exist, see the content for more details.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode
|
|
8
|
+
|
|
9
|
+
> **statusCode**: `404`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body
|
|
16
|
+
|
|
17
|
+
> **body**: `IError` & `object`
|
|
18
|
+
|
|
19
|
+
The body which contains the error.
|
|
20
|
+
|
|
21
|
+
#### Type declaration
|
|
22
|
+
|
|
23
|
+
##### notFoundId?
|
|
24
|
+
|
|
25
|
+
> `optional` **notFoundId**: `string`
|
|
26
|
+
|
|
27
|
+
The id if the item that was not found.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Interface: IRestRoute\<T, U\>
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IBaseRoute`](IBaseRoute.md)
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
• **T** *extends* [`IHttpRequest`](IHttpRequest.md) = `any`
|
|
12
|
+
|
|
13
|
+
• **U** *extends* [`IHttpResponse`](IHttpResponse.md) & [`IRestRouteResponseOptions`](IRestRouteResponseOptions.md) = `any`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### operationId
|
|
18
|
+
|
|
19
|
+
> **operationId**: `string`
|
|
20
|
+
|
|
21
|
+
The id of the operation.
|
|
22
|
+
|
|
23
|
+
#### Inherited from
|
|
24
|
+
|
|
25
|
+
[`IBaseRoute`](IBaseRoute.md).[`operationId`](IBaseRoute.md#operationid)
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### path
|
|
30
|
+
|
|
31
|
+
> **path**: `string`
|
|
32
|
+
|
|
33
|
+
The path to use for routing.
|
|
34
|
+
|
|
35
|
+
#### Inherited from
|
|
36
|
+
|
|
37
|
+
[`IBaseRoute`](IBaseRoute.md).[`path`](IBaseRoute.md#path)
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### skipAuth?
|
|
42
|
+
|
|
43
|
+
> `optional` **skipAuth**: `boolean`
|
|
44
|
+
|
|
45
|
+
Skips the authentication for this route.
|
|
46
|
+
|
|
47
|
+
#### Inherited from
|
|
48
|
+
|
|
49
|
+
[`IBaseRoute`](IBaseRoute.md).[`skipAuth`](IBaseRoute.md#skipauth)
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### summary
|
|
54
|
+
|
|
55
|
+
> **summary**: `string`
|
|
56
|
+
|
|
57
|
+
Summary of what task the operation performs.
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### tag
|
|
62
|
+
|
|
63
|
+
> **tag**: `string`
|
|
64
|
+
|
|
65
|
+
Tag for the operation.
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### method
|
|
70
|
+
|
|
71
|
+
> **method**: `HttpMethod`
|
|
72
|
+
|
|
73
|
+
The http method.
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### handler()
|
|
78
|
+
|
|
79
|
+
> **handler**: (`httpRequestContext`, `request`) => `Promise`\<`U`\>
|
|
80
|
+
|
|
81
|
+
The handler module.
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
• **httpRequestContext**: [`IHttpRequestContext`](IHttpRequestContext.md)
|
|
86
|
+
|
|
87
|
+
The http request context.
|
|
88
|
+
|
|
89
|
+
• **request**: `T`
|
|
90
|
+
|
|
91
|
+
The request object, combined query param, path params and body.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`U`\>
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### requestType?
|
|
100
|
+
|
|
101
|
+
> `optional` **requestType**: `object`
|
|
102
|
+
|
|
103
|
+
The type of the request object.
|
|
104
|
+
|
|
105
|
+
#### type
|
|
106
|
+
|
|
107
|
+
> **type**: `string`
|
|
108
|
+
|
|
109
|
+
The object type for the request.
|
|
110
|
+
|
|
111
|
+
#### mimeType?
|
|
112
|
+
|
|
113
|
+
> `optional` **mimeType**: `string`
|
|
114
|
+
|
|
115
|
+
The mime type of the request, defaults to "application/json" if there is a body.
|
|
116
|
+
|
|
117
|
+
#### examples?
|
|
118
|
+
|
|
119
|
+
> `optional` **examples**: `object`[]
|
|
120
|
+
|
|
121
|
+
Example objects for the request.
|
|
122
|
+
|
|
123
|
+
***
|
|
124
|
+
|
|
125
|
+
### responseType?
|
|
126
|
+
|
|
127
|
+
> `optional` **responseType**: `object`[]
|
|
128
|
+
|
|
129
|
+
The type of the response object.
|
|
130
|
+
|
|
131
|
+
***
|
|
132
|
+
|
|
133
|
+
### excludeFromSpec?
|
|
134
|
+
|
|
135
|
+
> `optional` **excludeFromSpec**: `boolean`
|
|
136
|
+
|
|
137
|
+
Exclude the route from being included in the spec file.
|
|
@@ -0,0 +1,45 @@
|
|
|
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`\>[]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IRestRouteResponseAttachmentOptions
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route response for attachments.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### mimeType?
|
|
8
|
+
|
|
9
|
+
> `optional` **mimeType**: `string`
|
|
10
|
+
|
|
11
|
+
The content type to use in the response.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### filename?
|
|
16
|
+
|
|
17
|
+
> `optional` **filename**: `string`
|
|
18
|
+
|
|
19
|
+
The filename to use in content disposition.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### inline?
|
|
24
|
+
|
|
25
|
+
> `optional` **inline**: `boolean`
|
|
26
|
+
|
|
27
|
+
Whether to inline the content.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Interface: IRestRouteResponseOptions
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route response.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### attachment?
|
|
8
|
+
|
|
9
|
+
> `optional` **attachment**: [`IRestRouteResponseAttachmentOptions`](IRestRouteResponseAttachmentOptions.md)
|
|
10
|
+
|
|
11
|
+
Additional options that can be used to control the response.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IServerSpecResponse
|
|
2
|
+
|
|
3
|
+
The OpenAPI spec for the endpoints.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode?
|
|
8
|
+
|
|
9
|
+
> `optional` **statusCode**: `HttpStatusCode`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body?
|
|
16
|
+
|
|
17
|
+
> `optional` **body**: `unknown`
|
|
18
|
+
|
|
19
|
+
The spec for the server.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Interface: ISocketRoute
|
|
2
|
+
|
|
3
|
+
Interface which defines a socket route.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IBaseRoute`](IBaseRoute.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### operationId
|
|
12
|
+
|
|
13
|
+
> **operationId**: `string`
|
|
14
|
+
|
|
15
|
+
The id of the operation.
|
|
16
|
+
|
|
17
|
+
#### Inherited from
|
|
18
|
+
|
|
19
|
+
[`IBaseRoute`](IBaseRoute.md).[`operationId`](IBaseRoute.md#operationid)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### path
|
|
24
|
+
|
|
25
|
+
> **path**: `string`
|
|
26
|
+
|
|
27
|
+
The path to use for routing.
|
|
28
|
+
|
|
29
|
+
#### Inherited from
|
|
30
|
+
|
|
31
|
+
[`IBaseRoute`](IBaseRoute.md).[`path`](IBaseRoute.md#path)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### skipAuth?
|
|
36
|
+
|
|
37
|
+
> `optional` **skipAuth**: `boolean`
|
|
38
|
+
|
|
39
|
+
Skips the authentication for this route.
|
|
40
|
+
|
|
41
|
+
#### Inherited from
|
|
42
|
+
|
|
43
|
+
[`IBaseRoute`](IBaseRoute.md).[`skipAuth`](IBaseRoute.md#skipauth)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### handler()
|
|
48
|
+
|
|
49
|
+
> **handler**: (`httpRequestContext`, `socketId`, `request`, `emitter`) => `Promise`\<`void`\>
|
|
50
|
+
|
|
51
|
+
The handler module.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
• **httpRequestContext**: [`IHttpRequestContext`](IHttpRequestContext.md)
|
|
56
|
+
|
|
57
|
+
The request context.
|
|
58
|
+
|
|
59
|
+
• **socketId**: `string`
|
|
60
|
+
|
|
61
|
+
The id of the socket the request is arriving on.
|
|
62
|
+
|
|
63
|
+
• **request**: `unknown`
|
|
64
|
+
|
|
65
|
+
The request object.
|
|
66
|
+
|
|
67
|
+
• **emitter**
|
|
68
|
+
|
|
69
|
+
Method to emit data on the socket.
|
|
70
|
+
|
|
71
|
+
#### Returns
|
|
72
|
+
|
|
73
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: ITag
|
|
2
|
+
|
|
3
|
+
Tag for routes used to generate OpenAPI information.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### name
|
|
8
|
+
|
|
9
|
+
> **name**: `string`
|
|
10
|
+
|
|
11
|
+
The name of the tag.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### description
|
|
16
|
+
|
|
17
|
+
> **description**: `string`
|
|
18
|
+
|
|
19
|
+
Description for the tag.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IUnauthorizedResponse
|
|
2
|
+
|
|
3
|
+
You are not authorized to use the API or no credentials were supplied, see the content for more details.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### statusCode
|
|
8
|
+
|
|
9
|
+
> **statusCode**: `401`
|
|
10
|
+
|
|
11
|
+
Response status code.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### body
|
|
16
|
+
|
|
17
|
+
> **body**: `IError`
|
|
18
|
+
|
|
19
|
+
The body which contains the error.
|