@twin.org/api-models 0.0.1-next.7 → 0.0.1-next.9
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/dist/cjs/index.cjs +10 -61
- package/dist/esm/index.mjs +11 -62
- package/dist/types/helpers/httpParameterHelper.d.ts +8 -27
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/routes/IRestRoute.d.ts +4 -10
- package/dist/types/models/routes/IRestRouteExample.d.ts +13 -0
- package/dist/types/models/routes/IRestRouteRequestExample.d.ts +10 -0
- package/dist/types/models/routes/IRestRouteResponseExample.d.ts +10 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/HttpParameterHelper.md +13 -53
- package/docs/reference/index.md +3 -0
- package/docs/reference/interfaces/IRestRoute.md +1 -1
- package/docs/reference/interfaces/IRestRouteExample.md +24 -0
- package/docs/reference/interfaces/IRestRouteRequestExample.md +43 -0
- package/docs/reference/interfaces/IRestRouteResponseExample.md +43 -0
- package/package.json +1 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -88,71 +88,20 @@ class HttpParameterHelper {
|
|
|
88
88
|
return values?.join(",");
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* Convert
|
|
92
|
-
* @param
|
|
93
|
-
* @returns The
|
|
91
|
+
* Convert object string to object.
|
|
92
|
+
* @param value The value query string.
|
|
93
|
+
* @returns The object.
|
|
94
94
|
*/
|
|
95
|
-
static
|
|
96
|
-
|
|
97
|
-
const conditionsList = [];
|
|
98
|
-
for (const conditionPart of conditionParts) {
|
|
99
|
-
const parts = conditionPart.split("|");
|
|
100
|
-
if (parts.length === 3) {
|
|
101
|
-
conditionsList.push({
|
|
102
|
-
property: parts[0],
|
|
103
|
-
comparison: parts[1],
|
|
104
|
-
value: parts[2]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return conditionsList.length === 0 ? undefined : conditionsList;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Convert the conditions to a string parameter.
|
|
112
|
-
* @param conditions The conditions to convert.
|
|
113
|
-
* @returns The string version of the comparators.
|
|
114
|
-
*/
|
|
115
|
-
static conditionsToString(conditions) {
|
|
116
|
-
if (core.Is.arrayValue(conditions)) {
|
|
117
|
-
const conditionsList = [];
|
|
118
|
-
for (const conditionPart of conditions) {
|
|
119
|
-
conditionsList.push(`${conditionPart.property}|${conditionPart.comparison}|${conditionPart.value}`);
|
|
120
|
-
}
|
|
121
|
-
return conditionsList.join(",");
|
|
122
|
-
}
|
|
95
|
+
static objectFromString(value) {
|
|
96
|
+
return core.Coerce.object(value);
|
|
123
97
|
}
|
|
124
98
|
/**
|
|
125
|
-
* Convert
|
|
126
|
-
* @param
|
|
127
|
-
* @returns The
|
|
99
|
+
* Convert object to query string.
|
|
100
|
+
* @param value The value to convert to a string.
|
|
101
|
+
* @returns The converted object.
|
|
128
102
|
*/
|
|
129
|
-
static
|
|
130
|
-
|
|
131
|
-
const sortPropertyList = [];
|
|
132
|
-
for (const conditionPart of sortParts) {
|
|
133
|
-
const parts = conditionPart.split("|");
|
|
134
|
-
if (parts.length === 2) {
|
|
135
|
-
sortPropertyList.push({
|
|
136
|
-
property: parts[0],
|
|
137
|
-
sortDirection: parts[1]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return sortPropertyList.length === 0 ? undefined : sortPropertyList;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Convert the sort properties to a string parameter.
|
|
145
|
-
* @param sortProperties The sort properties to convert.
|
|
146
|
-
* @returns The string version of the sort properties.
|
|
147
|
-
*/
|
|
148
|
-
static sortPropertiesToString(sortProperties) {
|
|
149
|
-
if (core.Is.arrayValue(sortProperties)) {
|
|
150
|
-
const sortPropertyList = [];
|
|
151
|
-
for (const conditionPart of sortProperties) {
|
|
152
|
-
sortPropertyList.push(`${conditionPart.property}|${conditionPart.sortDirection}`);
|
|
153
|
-
}
|
|
154
|
-
return sortPropertyList.join(",");
|
|
155
|
-
}
|
|
103
|
+
static objectToString(value) {
|
|
104
|
+
return core.Is.object(value) ? JSON.stringify(value) : undefined;
|
|
156
105
|
}
|
|
157
106
|
}
|
|
158
107
|
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError, GuardError, ConflictError, NotFoundError, AlreadyExistsError, UnauthorizedError, NotImplementedError, UnprocessableError, Is } from '@twin.org/core';
|
|
1
|
+
import { BaseError, GuardError, ConflictError, NotFoundError, AlreadyExistsError, UnauthorizedError, NotImplementedError, UnprocessableError, Coerce, Is } from '@twin.org/core';
|
|
2
2
|
import { HttpStatusCode, HeaderTypes, MimeTypes } from '@twin.org/web';
|
|
3
3
|
|
|
4
4
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -86,71 +86,20 @@ class HttpParameterHelper {
|
|
|
86
86
|
return values?.join(",");
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Convert
|
|
90
|
-
* @param
|
|
91
|
-
* @returns The
|
|
89
|
+
* Convert object string to object.
|
|
90
|
+
* @param value The value query string.
|
|
91
|
+
* @returns The object.
|
|
92
92
|
*/
|
|
93
|
-
static
|
|
94
|
-
|
|
95
|
-
const conditionsList = [];
|
|
96
|
-
for (const conditionPart of conditionParts) {
|
|
97
|
-
const parts = conditionPart.split("|");
|
|
98
|
-
if (parts.length === 3) {
|
|
99
|
-
conditionsList.push({
|
|
100
|
-
property: parts[0],
|
|
101
|
-
comparison: parts[1],
|
|
102
|
-
value: parts[2]
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return conditionsList.length === 0 ? undefined : conditionsList;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Convert the conditions to a string parameter.
|
|
110
|
-
* @param conditions The conditions to convert.
|
|
111
|
-
* @returns The string version of the comparators.
|
|
112
|
-
*/
|
|
113
|
-
static conditionsToString(conditions) {
|
|
114
|
-
if (Is.arrayValue(conditions)) {
|
|
115
|
-
const conditionsList = [];
|
|
116
|
-
for (const conditionPart of conditions) {
|
|
117
|
-
conditionsList.push(`${conditionPart.property}|${conditionPart.comparison}|${conditionPart.value}`);
|
|
118
|
-
}
|
|
119
|
-
return conditionsList.join(",");
|
|
120
|
-
}
|
|
93
|
+
static objectFromString(value) {
|
|
94
|
+
return Coerce.object(value);
|
|
121
95
|
}
|
|
122
96
|
/**
|
|
123
|
-
* Convert
|
|
124
|
-
* @param
|
|
125
|
-
* @returns The
|
|
97
|
+
* Convert object to query string.
|
|
98
|
+
* @param value The value to convert to a string.
|
|
99
|
+
* @returns The converted object.
|
|
126
100
|
*/
|
|
127
|
-
static
|
|
128
|
-
|
|
129
|
-
const sortPropertyList = [];
|
|
130
|
-
for (const conditionPart of sortParts) {
|
|
131
|
-
const parts = conditionPart.split("|");
|
|
132
|
-
if (parts.length === 2) {
|
|
133
|
-
sortPropertyList.push({
|
|
134
|
-
property: parts[0],
|
|
135
|
-
sortDirection: parts[1]
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return sortPropertyList.length === 0 ? undefined : sortPropertyList;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Convert the sort properties to a string parameter.
|
|
143
|
-
* @param sortProperties The sort properties to convert.
|
|
144
|
-
* @returns The string version of the sort properties.
|
|
145
|
-
*/
|
|
146
|
-
static sortPropertiesToString(sortProperties) {
|
|
147
|
-
if (Is.arrayValue(sortProperties)) {
|
|
148
|
-
const sortPropertyList = [];
|
|
149
|
-
for (const conditionPart of sortProperties) {
|
|
150
|
-
sortPropertyList.push(`${conditionPart.property}|${conditionPart.sortDirection}`);
|
|
151
|
-
}
|
|
152
|
-
return sortPropertyList.join(",");
|
|
153
|
-
}
|
|
101
|
+
static objectToString(value) {
|
|
102
|
+
return Is.object(value) ? JSON.stringify(value) : undefined;
|
|
154
103
|
}
|
|
155
104
|
}
|
|
156
105
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IComparator, SortDirection } from "@twin.org/entity";
|
|
2
1
|
/**
|
|
3
2
|
* Class to help with handling http parameters.
|
|
4
3
|
*/
|
|
@@ -16,33 +15,15 @@ export declare class HttpParameterHelper {
|
|
|
16
15
|
*/
|
|
17
16
|
static arrayToString<T = string>(values?: T[]): string | undefined;
|
|
18
17
|
/**
|
|
19
|
-
* Convert
|
|
20
|
-
* @param
|
|
21
|
-
* @returns The
|
|
18
|
+
* Convert object string to object.
|
|
19
|
+
* @param value The value query string.
|
|
20
|
+
* @returns The object.
|
|
22
21
|
*/
|
|
23
|
-
static
|
|
22
|
+
static objectFromString<T = unknown>(value?: string): T | undefined;
|
|
24
23
|
/**
|
|
25
|
-
* Convert
|
|
26
|
-
* @param
|
|
27
|
-
* @returns The
|
|
24
|
+
* Convert object to query string.
|
|
25
|
+
* @param value The value to convert to a string.
|
|
26
|
+
* @returns The converted object.
|
|
28
27
|
*/
|
|
29
|
-
static
|
|
30
|
-
/**
|
|
31
|
-
* Convert the sort string to a list of sort properties.
|
|
32
|
-
* @param sortProperties The sort properties query string.
|
|
33
|
-
* @returns The list of sort properties.
|
|
34
|
-
*/
|
|
35
|
-
static sortPropertiesFromString<T = unknown>(sortProperties?: string): {
|
|
36
|
-
property: keyof T;
|
|
37
|
-
sortDirection: SortDirection;
|
|
38
|
-
}[] | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Convert the sort properties to a string parameter.
|
|
41
|
-
* @param sortProperties The sort properties to convert.
|
|
42
|
-
* @returns The string version of the sort properties.
|
|
43
|
-
*/
|
|
44
|
-
static sortPropertiesToString<T = unknown>(sortProperties?: {
|
|
45
|
-
property: keyof T;
|
|
46
|
-
sortDirection: SortDirection;
|
|
47
|
-
}[]): string | undefined;
|
|
28
|
+
static objectToString<T = unknown>(value?: T): string | undefined;
|
|
48
29
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,7 +27,10 @@ export * from "./models/responses/success/IOkResponse";
|
|
|
27
27
|
export * from "./models/routes/IBaseRoute";
|
|
28
28
|
export * from "./models/routes/IRestRoute";
|
|
29
29
|
export * from "./models/routes/IRestRouteEntryPoint";
|
|
30
|
+
export * from "./models/routes/IRestRouteExample";
|
|
31
|
+
export * from "./models/routes/IRestRouteRequestExample";
|
|
30
32
|
export * from "./models/routes/IRestRouteResponseAttachmentOptions";
|
|
33
|
+
export * from "./models/routes/IRestRouteResponseExample";
|
|
31
34
|
export * from "./models/routes/IRestRouteResponseOptions";
|
|
32
35
|
export * from "./models/routes/ISocketRoute";
|
|
33
36
|
export * from "./models/routes/ITag";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HttpMethod } from "@twin.org/web";
|
|
2
2
|
import type { IBaseRoute } from "./IBaseRoute";
|
|
3
|
+
import type { IRestRouteRequestExample } from "./IRestRouteRequestExample";
|
|
4
|
+
import type { IRestRouteResponseExample } from "./IRestRouteResponseExample";
|
|
3
5
|
import type { IRestRouteResponseOptions } from "./IRestRouteResponseOptions";
|
|
4
6
|
import type { IHttpRequest } from "../protocol/IHttpRequest";
|
|
5
7
|
import type { IHttpRequestContext } from "../protocol/IHttpRequestContext";
|
|
@@ -47,11 +49,7 @@ export interface IRestRoute<T extends IHttpRequest = any, U extends IHttpRespons
|
|
|
47
49
|
/**
|
|
48
50
|
* Example objects for the request.
|
|
49
51
|
*/
|
|
50
|
-
examples?:
|
|
51
|
-
id: string;
|
|
52
|
-
description?: string;
|
|
53
|
-
request: T;
|
|
54
|
-
}[];
|
|
52
|
+
examples?: IRestRouteRequestExample<T>[];
|
|
55
53
|
};
|
|
56
54
|
/**
|
|
57
55
|
* The type of the response object.
|
|
@@ -68,11 +66,7 @@ export interface IRestRoute<T extends IHttpRequest = any, U extends IHttpRespons
|
|
|
68
66
|
/**
|
|
69
67
|
* Example objects of the response.
|
|
70
68
|
*/
|
|
71
|
-
examples?:
|
|
72
|
-
id: string;
|
|
73
|
-
description?: string;
|
|
74
|
-
response: U;
|
|
75
|
-
}[];
|
|
69
|
+
examples?: IRestRouteResponseExample<U>[];
|
|
76
70
|
}[];
|
|
77
71
|
/**
|
|
78
72
|
* Exclude the route from being included in the spec file.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IRestRouteExample } from "./IRestRouteExample";
|
|
2
|
+
/**
|
|
3
|
+
* Interface which defines a REST route request example.
|
|
4
|
+
*/
|
|
5
|
+
export interface IRestRouteRequestExample<T> extends IRestRouteExample {
|
|
6
|
+
/**
|
|
7
|
+
* The example request object.
|
|
8
|
+
*/
|
|
9
|
+
request: T;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IRestRouteExample } from "./IRestRouteExample";
|
|
2
|
+
/**
|
|
3
|
+
* Interface which defines a REST route response example.
|
|
4
|
+
*/
|
|
5
|
+
export interface IRestRouteResponseExample<T> extends IRestRouteExample {
|
|
6
|
+
/**
|
|
7
|
+
* The example response object.
|
|
8
|
+
*/
|
|
9
|
+
response: T;
|
|
10
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -62,51 +62,11 @@ The combined.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### objectFromString()
|
|
66
66
|
|
|
67
|
-
> `static` **
|
|
67
|
+
> `static` **objectFromString**\<`T`\>(`value`?): `undefined` \| `T`
|
|
68
68
|
|
|
69
|
-
Convert
|
|
70
|
-
|
|
71
|
-
#### Parameters
|
|
72
|
-
|
|
73
|
-
• **conditions?**: `string`
|
|
74
|
-
|
|
75
|
-
The conditions query string.
|
|
76
|
-
|
|
77
|
-
#### Returns
|
|
78
|
-
|
|
79
|
-
`undefined` \| `IComparator`[]
|
|
80
|
-
|
|
81
|
-
The list of comparators.
|
|
82
|
-
|
|
83
|
-
***
|
|
84
|
-
|
|
85
|
-
### conditionsToString()
|
|
86
|
-
|
|
87
|
-
> `static` **conditionsToString**(`conditions`?): `undefined` \| `string`
|
|
88
|
-
|
|
89
|
-
Convert the conditions to a string parameter.
|
|
90
|
-
|
|
91
|
-
#### Parameters
|
|
92
|
-
|
|
93
|
-
• **conditions?**: `IComparator`[]
|
|
94
|
-
|
|
95
|
-
The conditions to convert.
|
|
96
|
-
|
|
97
|
-
#### Returns
|
|
98
|
-
|
|
99
|
-
`undefined` \| `string`
|
|
100
|
-
|
|
101
|
-
The string version of the comparators.
|
|
102
|
-
|
|
103
|
-
***
|
|
104
|
-
|
|
105
|
-
### sortPropertiesFromString()
|
|
106
|
-
|
|
107
|
-
> `static` **sortPropertiesFromString**\<`T`\>(`sortProperties`?): `undefined` \| `object`[]
|
|
108
|
-
|
|
109
|
-
Convert the sort string to a list of sort properties.
|
|
69
|
+
Convert object string to object.
|
|
110
70
|
|
|
111
71
|
#### Type Parameters
|
|
112
72
|
|
|
@@ -114,23 +74,23 @@ Convert the sort string to a list of sort properties.
|
|
|
114
74
|
|
|
115
75
|
#### Parameters
|
|
116
76
|
|
|
117
|
-
• **
|
|
77
|
+
• **value?**: `string`
|
|
118
78
|
|
|
119
|
-
The
|
|
79
|
+
The value query string.
|
|
120
80
|
|
|
121
81
|
#### Returns
|
|
122
82
|
|
|
123
|
-
`undefined` \| `
|
|
83
|
+
`undefined` \| `T`
|
|
124
84
|
|
|
125
|
-
The
|
|
85
|
+
The object.
|
|
126
86
|
|
|
127
87
|
***
|
|
128
88
|
|
|
129
|
-
###
|
|
89
|
+
### objectToString()
|
|
130
90
|
|
|
131
|
-
> `static` **
|
|
91
|
+
> `static` **objectToString**\<`T`\>(`value`?): `undefined` \| `string`
|
|
132
92
|
|
|
133
|
-
Convert
|
|
93
|
+
Convert object to query string.
|
|
134
94
|
|
|
135
95
|
#### Type Parameters
|
|
136
96
|
|
|
@@ -138,12 +98,12 @@ Convert the sort properties to a string parameter.
|
|
|
138
98
|
|
|
139
99
|
#### Parameters
|
|
140
100
|
|
|
141
|
-
• **
|
|
101
|
+
• **value?**: `T`
|
|
142
102
|
|
|
143
|
-
The
|
|
103
|
+
The value to convert to a string.
|
|
144
104
|
|
|
145
105
|
#### Returns
|
|
146
106
|
|
|
147
107
|
`undefined` \| `string`
|
|
148
108
|
|
|
149
|
-
The
|
|
109
|
+
The converted object.
|
package/docs/reference/index.md
CHANGED
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
- [IBaseRoute](interfaces/IBaseRoute.md)
|
|
35
35
|
- [IRestRoute](interfaces/IRestRoute.md)
|
|
36
36
|
- [IRestRouteEntryPoint](interfaces/IRestRouteEntryPoint.md)
|
|
37
|
+
- [IRestRouteExample](interfaces/IRestRouteExample.md)
|
|
38
|
+
- [IRestRouteRequestExample](interfaces/IRestRouteRequestExample.md)
|
|
37
39
|
- [IRestRouteResponseAttachmentOptions](interfaces/IRestRouteResponseAttachmentOptions.md)
|
|
40
|
+
- [IRestRouteResponseExample](interfaces/IRestRouteResponseExample.md)
|
|
38
41
|
- [IRestRouteResponseOptions](interfaces/IRestRouteResponseOptions.md)
|
|
39
42
|
- [ISocketRoute](interfaces/ISocketRoute.md)
|
|
40
43
|
- [ITag](interfaces/ITag.md)
|
|
@@ -116,7 +116,7 @@ The mime type of the request, defaults to "application/json" if there is a body.
|
|
|
116
116
|
|
|
117
117
|
#### examples?
|
|
118
118
|
|
|
119
|
-
> `optional` **examples**: `
|
|
119
|
+
> `optional` **examples**: [`IRestRouteRequestExample`](IRestRouteRequestExample.md)\<`T`\>[]
|
|
120
120
|
|
|
121
121
|
Example objects for the request.
|
|
122
122
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Interface: IRestRouteExample
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route example.
|
|
4
|
+
|
|
5
|
+
## Extended by
|
|
6
|
+
|
|
7
|
+
- [`IRestRouteRequestExample`](IRestRouteRequestExample.md)
|
|
8
|
+
- [`IRestRouteResponseExample`](IRestRouteResponseExample.md)
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
|
|
12
|
+
### id
|
|
13
|
+
|
|
14
|
+
> **id**: `string`
|
|
15
|
+
|
|
16
|
+
Example objects for the request.
|
|
17
|
+
|
|
18
|
+
***
|
|
19
|
+
|
|
20
|
+
### description?
|
|
21
|
+
|
|
22
|
+
> `optional` **description**: `string`
|
|
23
|
+
|
|
24
|
+
Description of the example.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Interface: IRestRouteRequestExample\<T\>
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route request example.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IRestRouteExample`](IRestRouteExample.md)
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
• **T**
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### id
|
|
16
|
+
|
|
17
|
+
> **id**: `string`
|
|
18
|
+
|
|
19
|
+
Example objects for the request.
|
|
20
|
+
|
|
21
|
+
#### Inherited from
|
|
22
|
+
|
|
23
|
+
[`IRestRouteExample`](IRestRouteExample.md).[`id`](IRestRouteExample.md#id)
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### description?
|
|
28
|
+
|
|
29
|
+
> `optional` **description**: `string`
|
|
30
|
+
|
|
31
|
+
Description of the example.
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`IRestRouteExample`](IRestRouteExample.md).[`description`](IRestRouteExample.md#description)
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### request
|
|
40
|
+
|
|
41
|
+
> **request**: `T`
|
|
42
|
+
|
|
43
|
+
The example request object.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Interface: IRestRouteResponseExample\<T\>
|
|
2
|
+
|
|
3
|
+
Interface which defines a REST route response example.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IRestRouteExample`](IRestRouteExample.md)
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
• **T**
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### id
|
|
16
|
+
|
|
17
|
+
> **id**: `string`
|
|
18
|
+
|
|
19
|
+
Example objects for the request.
|
|
20
|
+
|
|
21
|
+
#### Inherited from
|
|
22
|
+
|
|
23
|
+
[`IRestRouteExample`](IRestRouteExample.md).[`id`](IRestRouteExample.md#id)
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### description?
|
|
28
|
+
|
|
29
|
+
> `optional` **description**: `string`
|
|
30
|
+
|
|
31
|
+
Description of the example.
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`IRestRouteExample`](IRestRouteExample.md).[`description`](IRestRouteExample.md#description)
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### response
|
|
40
|
+
|
|
41
|
+
> **response**: `T`
|
|
42
|
+
|
|
43
|
+
The example response object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-models",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.9",
|
|
4
4
|
"description": "Contains models and classes for use with APIs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/entity": "next",
|
|
19
18
|
"@twin.org/nameof": "next",
|
|
20
19
|
"@twin.org/web": "next"
|
|
21
20
|
},
|