@stuartshay/otel-types 1.0.59
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/README.md +65 -0
- package/index.d.ts +990 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @stuartshay/otel-types
|
|
2
|
+
|
|
3
|
+
TypeScript type definitions for the [otel-demo](https://github.com/stuartshay/otel-demo) API.
|
|
4
|
+
|
|
5
|
+
Auto-generated from the OpenAPI specification using [openapi-typescript](https://github.com/drwpow/openapi-typescript).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @stuartshay/otel-types
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { paths, components } from '@stuartshay/otel-types';
|
|
17
|
+
|
|
18
|
+
// Use path types
|
|
19
|
+
type LocationsResponse = paths['/db/locations']['get']['responses']['200']['content']['application/json'];
|
|
20
|
+
|
|
21
|
+
// Use component schemas
|
|
22
|
+
type Location = components['schemas']['Location'];
|
|
23
|
+
|
|
24
|
+
// Example with fetch
|
|
25
|
+
async function getLocations(): Promise<LocationsResponse> {
|
|
26
|
+
const response = await fetch('https://otel.lab.informationcart.com/db/locations?limit=20');
|
|
27
|
+
return response.json();
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API Documentation
|
|
32
|
+
|
|
33
|
+
Full API documentation is available at:
|
|
34
|
+
|
|
35
|
+
- Swagger UI: <https://otel.lab.informationcart.com/apidocs/>
|
|
36
|
+
- OpenAPI Spec: <https://otel.lab.informationcart.com/apispec.json>
|
|
37
|
+
|
|
38
|
+
## Versioning
|
|
39
|
+
|
|
40
|
+
This package follows the otel-demo API versioning:
|
|
41
|
+
|
|
42
|
+
- Package version matches the Docker image version
|
|
43
|
+
- Breaking API changes result in a major version bump
|
|
44
|
+
- New endpoints or optional fields result in a minor version bump
|
|
45
|
+
- Bug fixes result in a patch version bump
|
|
46
|
+
|
|
47
|
+
## Type Generation
|
|
48
|
+
|
|
49
|
+
Types are automatically generated when the otel-demo API schema changes.
|
|
50
|
+
|
|
51
|
+
To generate types locally:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# From otel-demo root
|
|
55
|
+
./scripts/generate-types.sh
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Related Packages
|
|
59
|
+
|
|
60
|
+
- [otel-demo](https://github.com/stuartshay/otel-demo) - The Flask API
|
|
61
|
+
- [otel-ui](https://github.com/stuartshay/otel-ui) - React frontend (coming soon)
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type paths = {
|
|
7
|
+
"/chain": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Nested spans demonstration.
|
|
16
|
+
* @description Demonstrates nested spans with simulated work across three steps:
|
|
17
|
+
* 1. Database query (PostgreSQL)
|
|
18
|
+
* 2. Cache lookup (Redis)
|
|
19
|
+
* 3. External API call
|
|
20
|
+
*
|
|
21
|
+
* Each step creates a child span with relevant attributes.
|
|
22
|
+
*/
|
|
23
|
+
get: {
|
|
24
|
+
parameters: {
|
|
25
|
+
query?: never;
|
|
26
|
+
header?: never;
|
|
27
|
+
path?: never;
|
|
28
|
+
cookie?: never;
|
|
29
|
+
};
|
|
30
|
+
requestBody?: never;
|
|
31
|
+
responses: {
|
|
32
|
+
/** @description Chain operation completed successfully */
|
|
33
|
+
200: {
|
|
34
|
+
headers: {
|
|
35
|
+
[name: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
content: {
|
|
38
|
+
"*/*": {
|
|
39
|
+
/** @example chain complete */
|
|
40
|
+
status?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @example [
|
|
43
|
+
* "db_query",
|
|
44
|
+
* "cache_check",
|
|
45
|
+
* "api_call"
|
|
46
|
+
* ]
|
|
47
|
+
*/
|
|
48
|
+
steps?: string[];
|
|
49
|
+
/** @example 0af7651916cd43dd8448eb211c80319c */
|
|
50
|
+
trace_id?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
put?: never;
|
|
57
|
+
post?: never;
|
|
58
|
+
delete?: never;
|
|
59
|
+
options?: never;
|
|
60
|
+
head?: never;
|
|
61
|
+
patch?: never;
|
|
62
|
+
trace?: never;
|
|
63
|
+
};
|
|
64
|
+
"/db/locations": {
|
|
65
|
+
parameters: {
|
|
66
|
+
query?: never;
|
|
67
|
+
header?: never;
|
|
68
|
+
path?: never;
|
|
69
|
+
cookie?: never;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Query owntracks locations.
|
|
73
|
+
* @description Retrieves location records from the owntracks.locations table.
|
|
74
|
+
* Supports pagination, sorting, and filtering by device_id.
|
|
75
|
+
*/
|
|
76
|
+
get: {
|
|
77
|
+
parameters: {
|
|
78
|
+
query?: {
|
|
79
|
+
/**
|
|
80
|
+
* @description Maximum number of records to return (max 100)
|
|
81
|
+
* @example 10
|
|
82
|
+
*/
|
|
83
|
+
limit?: number;
|
|
84
|
+
/**
|
|
85
|
+
* @description Number of records to skip for pagination
|
|
86
|
+
* @example 0
|
|
87
|
+
*/
|
|
88
|
+
offset?: number;
|
|
89
|
+
/**
|
|
90
|
+
* @description Column to sort by
|
|
91
|
+
* @example created_at
|
|
92
|
+
*/
|
|
93
|
+
sort?: "created_at" | "latitude" | "longitude" | "accuracy" | "altitude" | "velocity" | "battery";
|
|
94
|
+
/**
|
|
95
|
+
* @description Sort order
|
|
96
|
+
* @example desc
|
|
97
|
+
*/
|
|
98
|
+
order?: "asc" | "desc";
|
|
99
|
+
/**
|
|
100
|
+
* @description Filter by device identifier
|
|
101
|
+
* @example iphone
|
|
102
|
+
*/
|
|
103
|
+
device_id?: string;
|
|
104
|
+
};
|
|
105
|
+
header?: never;
|
|
106
|
+
path?: never;
|
|
107
|
+
cookie?: never;
|
|
108
|
+
};
|
|
109
|
+
requestBody?: never;
|
|
110
|
+
responses: {
|
|
111
|
+
/** @description Location records */
|
|
112
|
+
200: {
|
|
113
|
+
headers: {
|
|
114
|
+
[name: string]: unknown;
|
|
115
|
+
};
|
|
116
|
+
content: {
|
|
117
|
+
"*/*": {
|
|
118
|
+
/** @example 10 */
|
|
119
|
+
count?: number;
|
|
120
|
+
/** @example 20 */
|
|
121
|
+
limit?: number;
|
|
122
|
+
locations?: {
|
|
123
|
+
/** @description Accuracy in meters */
|
|
124
|
+
accuracy?: number;
|
|
125
|
+
/** @description Altitude in meters */
|
|
126
|
+
altitude?: number;
|
|
127
|
+
/** @description Battery percentage */
|
|
128
|
+
battery?: number;
|
|
129
|
+
/** Format: datetime */
|
|
130
|
+
created_at?: string;
|
|
131
|
+
/** @description Device identifier */
|
|
132
|
+
device_id?: string;
|
|
133
|
+
id?: number;
|
|
134
|
+
/** Format: float */
|
|
135
|
+
latitude?: number;
|
|
136
|
+
/** Format: float */
|
|
137
|
+
longitude?: number;
|
|
138
|
+
/** @description Tracker ID */
|
|
139
|
+
tid?: string;
|
|
140
|
+
/** @description Velocity in km/h */
|
|
141
|
+
velocity?: number;
|
|
142
|
+
}[];
|
|
143
|
+
/** @example 0 */
|
|
144
|
+
offset?: number;
|
|
145
|
+
/** @example desc */
|
|
146
|
+
order?: string;
|
|
147
|
+
/** @example created_at */
|
|
148
|
+
sort?: string;
|
|
149
|
+
trace_id?: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/** @description Invalid parameters */
|
|
154
|
+
400: {
|
|
155
|
+
headers: {
|
|
156
|
+
[name: string]: unknown;
|
|
157
|
+
};
|
|
158
|
+
content?: never;
|
|
159
|
+
};
|
|
160
|
+
/** @description Database query failed */
|
|
161
|
+
500: {
|
|
162
|
+
headers: {
|
|
163
|
+
[name: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
content?: never;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
put?: never;
|
|
170
|
+
post?: never;
|
|
171
|
+
delete?: never;
|
|
172
|
+
options?: never;
|
|
173
|
+
head?: never;
|
|
174
|
+
patch?: never;
|
|
175
|
+
trace?: never;
|
|
176
|
+
};
|
|
177
|
+
"/db/status": {
|
|
178
|
+
parameters: {
|
|
179
|
+
query?: never;
|
|
180
|
+
header?: never;
|
|
181
|
+
path?: never;
|
|
182
|
+
cookie?: never;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Database connection status.
|
|
186
|
+
* @description Tests the connection to PostgreSQL via PgBouncer and returns connection info.
|
|
187
|
+
*/
|
|
188
|
+
get: {
|
|
189
|
+
parameters: {
|
|
190
|
+
query?: never;
|
|
191
|
+
header?: never;
|
|
192
|
+
path?: never;
|
|
193
|
+
cookie?: never;
|
|
194
|
+
};
|
|
195
|
+
requestBody?: never;
|
|
196
|
+
responses: {
|
|
197
|
+
/** @description Database connection successful */
|
|
198
|
+
200: {
|
|
199
|
+
headers: {
|
|
200
|
+
[name: string]: unknown;
|
|
201
|
+
};
|
|
202
|
+
content: {
|
|
203
|
+
"*/*": {
|
|
204
|
+
/** @example owntracks */
|
|
205
|
+
database?: string;
|
|
206
|
+
/** @example 192.168.1.175 */
|
|
207
|
+
host?: string;
|
|
208
|
+
/** @example 6432 */
|
|
209
|
+
port?: number;
|
|
210
|
+
/** @example 140005 */
|
|
211
|
+
server_version?: string;
|
|
212
|
+
/** @example connected */
|
|
213
|
+
status?: string;
|
|
214
|
+
trace_id?: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/** @description Database connection failed */
|
|
219
|
+
500: {
|
|
220
|
+
headers: {
|
|
221
|
+
[name: string]: unknown;
|
|
222
|
+
};
|
|
223
|
+
content?: never;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
put?: never;
|
|
228
|
+
post?: never;
|
|
229
|
+
delete?: never;
|
|
230
|
+
options?: never;
|
|
231
|
+
head?: never;
|
|
232
|
+
patch?: never;
|
|
233
|
+
trace?: never;
|
|
234
|
+
};
|
|
235
|
+
"/error": {
|
|
236
|
+
parameters: {
|
|
237
|
+
query?: never;
|
|
238
|
+
header?: never;
|
|
239
|
+
path?: never;
|
|
240
|
+
cookie?: never;
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* Error recording demonstration.
|
|
244
|
+
* @description Demonstrates how errors are recorded in OpenTelemetry traces.
|
|
245
|
+
* This endpoint intentionally raises an exception to show error handling.
|
|
246
|
+
*/
|
|
247
|
+
get: {
|
|
248
|
+
parameters: {
|
|
249
|
+
query?: never;
|
|
250
|
+
header?: never;
|
|
251
|
+
path?: never;
|
|
252
|
+
cookie?: never;
|
|
253
|
+
};
|
|
254
|
+
requestBody?: never;
|
|
255
|
+
responses: {
|
|
256
|
+
/** @description Simulated error response */
|
|
257
|
+
500: {
|
|
258
|
+
headers: {
|
|
259
|
+
[name: string]: unknown;
|
|
260
|
+
};
|
|
261
|
+
content: {
|
|
262
|
+
"*/*": {
|
|
263
|
+
/** @example Simulated error for tracing demo */
|
|
264
|
+
message?: string;
|
|
265
|
+
/** @example error */
|
|
266
|
+
status?: string;
|
|
267
|
+
/** @example 0af7651916cd43dd8448eb211c80319c */
|
|
268
|
+
trace_id?: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
put?: never;
|
|
275
|
+
post?: never;
|
|
276
|
+
delete?: never;
|
|
277
|
+
options?: never;
|
|
278
|
+
head?: never;
|
|
279
|
+
patch?: never;
|
|
280
|
+
trace?: never;
|
|
281
|
+
};
|
|
282
|
+
"/files": {
|
|
283
|
+
parameters: {
|
|
284
|
+
query?: never;
|
|
285
|
+
header?: never;
|
|
286
|
+
path?: never;
|
|
287
|
+
cookie?: never;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* List files or read file content.
|
|
291
|
+
* @description If path is a directory, returns a list of files and subdirectories.
|
|
292
|
+
* If path is a file, returns the file content.
|
|
293
|
+
* Supports nested paths like `/files/subdir/file.txt`.
|
|
294
|
+
*/
|
|
295
|
+
get: {
|
|
296
|
+
parameters: {
|
|
297
|
+
query?: never;
|
|
298
|
+
header?: never;
|
|
299
|
+
path: {
|
|
300
|
+
/** @description Path to file or directory (relative to storage root) */
|
|
301
|
+
filepath: string;
|
|
302
|
+
};
|
|
303
|
+
cookie?: never;
|
|
304
|
+
};
|
|
305
|
+
requestBody?: never;
|
|
306
|
+
responses: {
|
|
307
|
+
/** @description Directory listing or file content */
|
|
308
|
+
200: {
|
|
309
|
+
headers: {
|
|
310
|
+
[name: string]: unknown;
|
|
311
|
+
};
|
|
312
|
+
content: {
|
|
313
|
+
"*/*": {
|
|
314
|
+
/** @description Only present for files */
|
|
315
|
+
content?: string;
|
|
316
|
+
/** @description Only present for directories */
|
|
317
|
+
items?: {
|
|
318
|
+
name?: string;
|
|
319
|
+
size?: number;
|
|
320
|
+
/** @enum {string} */
|
|
321
|
+
type?: "file" | "directory";
|
|
322
|
+
}[];
|
|
323
|
+
/** @example subdir */
|
|
324
|
+
path?: string;
|
|
325
|
+
/** @description File size in bytes (only for files) */
|
|
326
|
+
size?: number;
|
|
327
|
+
trace_id?: string;
|
|
328
|
+
/**
|
|
329
|
+
* @example directory
|
|
330
|
+
* @enum {string}
|
|
331
|
+
*/
|
|
332
|
+
type?: "directory" | "file";
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
/** @description Invalid path (path traversal attempt) */
|
|
337
|
+
400: {
|
|
338
|
+
headers: {
|
|
339
|
+
[name: string]: unknown;
|
|
340
|
+
};
|
|
341
|
+
content?: never;
|
|
342
|
+
};
|
|
343
|
+
/** @description Path not found */
|
|
344
|
+
404: {
|
|
345
|
+
headers: {
|
|
346
|
+
[name: string]: unknown;
|
|
347
|
+
};
|
|
348
|
+
content?: never;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
put?: never;
|
|
353
|
+
/**
|
|
354
|
+
* Create a new directory.
|
|
355
|
+
* @description Creates a new directory. Parent directories are created if needed.
|
|
356
|
+
*/
|
|
357
|
+
post: {
|
|
358
|
+
parameters: {
|
|
359
|
+
query?: never;
|
|
360
|
+
header?: never;
|
|
361
|
+
path?: never;
|
|
362
|
+
cookie?: never;
|
|
363
|
+
};
|
|
364
|
+
requestBody: {
|
|
365
|
+
content: {
|
|
366
|
+
"application/json": {
|
|
367
|
+
/**
|
|
368
|
+
* @description Directory path to create
|
|
369
|
+
* @example subdir/newdir
|
|
370
|
+
*/
|
|
371
|
+
path: string;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
responses: {
|
|
376
|
+
/** @description Directory already exists */
|
|
377
|
+
200: {
|
|
378
|
+
headers: {
|
|
379
|
+
[name: string]: unknown;
|
|
380
|
+
};
|
|
381
|
+
content?: never;
|
|
382
|
+
};
|
|
383
|
+
/** @description Directory created */
|
|
384
|
+
201: {
|
|
385
|
+
headers: {
|
|
386
|
+
[name: string]: unknown;
|
|
387
|
+
};
|
|
388
|
+
content: {
|
|
389
|
+
"*/*": {
|
|
390
|
+
path?: string;
|
|
391
|
+
/** @example created */
|
|
392
|
+
status?: string;
|
|
393
|
+
trace_id?: string;
|
|
394
|
+
/** @example directory */
|
|
395
|
+
type?: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
/** @description Invalid path or missing path parameter */
|
|
400
|
+
400: {
|
|
401
|
+
headers: {
|
|
402
|
+
[name: string]: unknown;
|
|
403
|
+
};
|
|
404
|
+
content?: never;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
delete?: never;
|
|
409
|
+
options?: never;
|
|
410
|
+
head?: never;
|
|
411
|
+
patch?: never;
|
|
412
|
+
trace?: never;
|
|
413
|
+
};
|
|
414
|
+
"/files/": {
|
|
415
|
+
parameters: {
|
|
416
|
+
query?: never;
|
|
417
|
+
header?: never;
|
|
418
|
+
path?: never;
|
|
419
|
+
cookie?: never;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* List files or read file content.
|
|
423
|
+
* @description If path is a directory, returns a list of files and subdirectories.
|
|
424
|
+
* If path is a file, returns the file content.
|
|
425
|
+
* Supports nested paths like `/files/subdir/file.txt`.
|
|
426
|
+
*/
|
|
427
|
+
get: {
|
|
428
|
+
parameters: {
|
|
429
|
+
query?: never;
|
|
430
|
+
header?: never;
|
|
431
|
+
path: {
|
|
432
|
+
/** @description Path to file or directory (relative to storage root) */
|
|
433
|
+
filepath: string;
|
|
434
|
+
};
|
|
435
|
+
cookie?: never;
|
|
436
|
+
};
|
|
437
|
+
requestBody?: never;
|
|
438
|
+
responses: {
|
|
439
|
+
/** @description Directory listing or file content */
|
|
440
|
+
200: {
|
|
441
|
+
headers: {
|
|
442
|
+
[name: string]: unknown;
|
|
443
|
+
};
|
|
444
|
+
content: {
|
|
445
|
+
"*/*": {
|
|
446
|
+
/** @description Only present for files */
|
|
447
|
+
content?: string;
|
|
448
|
+
/** @description Only present for directories */
|
|
449
|
+
items?: {
|
|
450
|
+
name?: string;
|
|
451
|
+
size?: number;
|
|
452
|
+
/** @enum {string} */
|
|
453
|
+
type?: "file" | "directory";
|
|
454
|
+
}[];
|
|
455
|
+
/** @example subdir */
|
|
456
|
+
path?: string;
|
|
457
|
+
/** @description File size in bytes (only for files) */
|
|
458
|
+
size?: number;
|
|
459
|
+
trace_id?: string;
|
|
460
|
+
/**
|
|
461
|
+
* @example directory
|
|
462
|
+
* @enum {string}
|
|
463
|
+
*/
|
|
464
|
+
type?: "directory" | "file";
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
/** @description Invalid path (path traversal attempt) */
|
|
469
|
+
400: {
|
|
470
|
+
headers: {
|
|
471
|
+
[name: string]: unknown;
|
|
472
|
+
};
|
|
473
|
+
content?: never;
|
|
474
|
+
};
|
|
475
|
+
/** @description Path not found */
|
|
476
|
+
404: {
|
|
477
|
+
headers: {
|
|
478
|
+
[name: string]: unknown;
|
|
479
|
+
};
|
|
480
|
+
content?: never;
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
put?: never;
|
|
485
|
+
post?: never;
|
|
486
|
+
delete?: never;
|
|
487
|
+
options?: never;
|
|
488
|
+
head?: never;
|
|
489
|
+
patch?: never;
|
|
490
|
+
trace?: never;
|
|
491
|
+
};
|
|
492
|
+
"/files/{filepath}": {
|
|
493
|
+
parameters: {
|
|
494
|
+
query?: never;
|
|
495
|
+
header?: never;
|
|
496
|
+
path?: never;
|
|
497
|
+
cookie?: never;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* List files or read file content.
|
|
501
|
+
* @description If path is a directory, returns a list of files and subdirectories.
|
|
502
|
+
* If path is a file, returns the file content.
|
|
503
|
+
* Supports nested paths like `/files/subdir/file.txt`.
|
|
504
|
+
*/
|
|
505
|
+
get: {
|
|
506
|
+
parameters: {
|
|
507
|
+
query?: never;
|
|
508
|
+
header?: never;
|
|
509
|
+
path: {
|
|
510
|
+
/** @description Path to file or directory (relative to storage root) */
|
|
511
|
+
filepath: string;
|
|
512
|
+
};
|
|
513
|
+
cookie?: never;
|
|
514
|
+
};
|
|
515
|
+
requestBody?: never;
|
|
516
|
+
responses: {
|
|
517
|
+
/** @description Directory listing or file content */
|
|
518
|
+
200: {
|
|
519
|
+
headers: {
|
|
520
|
+
[name: string]: unknown;
|
|
521
|
+
};
|
|
522
|
+
content: {
|
|
523
|
+
"*/*": {
|
|
524
|
+
/** @description Only present for files */
|
|
525
|
+
content?: string;
|
|
526
|
+
/** @description Only present for directories */
|
|
527
|
+
items?: {
|
|
528
|
+
name?: string;
|
|
529
|
+
size?: number;
|
|
530
|
+
/** @enum {string} */
|
|
531
|
+
type?: "file" | "directory";
|
|
532
|
+
}[];
|
|
533
|
+
/** @example subdir */
|
|
534
|
+
path?: string;
|
|
535
|
+
/** @description File size in bytes (only for files) */
|
|
536
|
+
size?: number;
|
|
537
|
+
trace_id?: string;
|
|
538
|
+
/**
|
|
539
|
+
* @example directory
|
|
540
|
+
* @enum {string}
|
|
541
|
+
*/
|
|
542
|
+
type?: "directory" | "file";
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
/** @description Invalid path (path traversal attempt) */
|
|
547
|
+
400: {
|
|
548
|
+
headers: {
|
|
549
|
+
[name: string]: unknown;
|
|
550
|
+
};
|
|
551
|
+
content?: never;
|
|
552
|
+
};
|
|
553
|
+
/** @description Path not found */
|
|
554
|
+
404: {
|
|
555
|
+
headers: {
|
|
556
|
+
[name: string]: unknown;
|
|
557
|
+
};
|
|
558
|
+
content?: never;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
/**
|
|
563
|
+
* Write content to a file.
|
|
564
|
+
* @description Writes content to a file. Creates parent directories if they don't exist.
|
|
565
|
+
* Content should be sent as the request body (text/plain or application/json with "content" field).
|
|
566
|
+
*/
|
|
567
|
+
put: {
|
|
568
|
+
parameters: {
|
|
569
|
+
query?: never;
|
|
570
|
+
header?: never;
|
|
571
|
+
path: {
|
|
572
|
+
/** @description Path to the file (relative to storage root) */
|
|
573
|
+
filepath: string;
|
|
574
|
+
};
|
|
575
|
+
cookie?: never;
|
|
576
|
+
};
|
|
577
|
+
requestBody: components["requestBodies"]["Body"];
|
|
578
|
+
responses: {
|
|
579
|
+
/** @description File updated */
|
|
580
|
+
200: {
|
|
581
|
+
headers: {
|
|
582
|
+
[name: string]: unknown;
|
|
583
|
+
};
|
|
584
|
+
content: {
|
|
585
|
+
"*/*": {
|
|
586
|
+
path?: string;
|
|
587
|
+
size?: number;
|
|
588
|
+
/** @example updated */
|
|
589
|
+
status?: string;
|
|
590
|
+
trace_id?: string;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
/** @description File created */
|
|
595
|
+
201: {
|
|
596
|
+
headers: {
|
|
597
|
+
[name: string]: unknown;
|
|
598
|
+
};
|
|
599
|
+
content: {
|
|
600
|
+
"*/*": {
|
|
601
|
+
path?: string;
|
|
602
|
+
size?: number;
|
|
603
|
+
/** @example created */
|
|
604
|
+
status?: string;
|
|
605
|
+
trace_id?: string;
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
/** @description Invalid path or missing content */
|
|
610
|
+
400: {
|
|
611
|
+
headers: {
|
|
612
|
+
[name: string]: unknown;
|
|
613
|
+
};
|
|
614
|
+
content?: never;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Write content to a file.
|
|
620
|
+
* @description Writes content to a file. Creates parent directories if they don't exist.
|
|
621
|
+
* Content should be sent as the request body (text/plain or application/json with "content" field).
|
|
622
|
+
*/
|
|
623
|
+
post: {
|
|
624
|
+
parameters: {
|
|
625
|
+
query?: never;
|
|
626
|
+
header?: never;
|
|
627
|
+
path: {
|
|
628
|
+
/** @description Path to the file (relative to storage root) */
|
|
629
|
+
filepath: string;
|
|
630
|
+
};
|
|
631
|
+
cookie?: never;
|
|
632
|
+
};
|
|
633
|
+
requestBody: components["requestBodies"]["Body"];
|
|
634
|
+
responses: {
|
|
635
|
+
/** @description File updated */
|
|
636
|
+
200: {
|
|
637
|
+
headers: {
|
|
638
|
+
[name: string]: unknown;
|
|
639
|
+
};
|
|
640
|
+
content: {
|
|
641
|
+
"*/*": {
|
|
642
|
+
path?: string;
|
|
643
|
+
size?: number;
|
|
644
|
+
/** @example updated */
|
|
645
|
+
status?: string;
|
|
646
|
+
trace_id?: string;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
/** @description File created */
|
|
651
|
+
201: {
|
|
652
|
+
headers: {
|
|
653
|
+
[name: string]: unknown;
|
|
654
|
+
};
|
|
655
|
+
content: {
|
|
656
|
+
"*/*": {
|
|
657
|
+
path?: string;
|
|
658
|
+
size?: number;
|
|
659
|
+
/** @example created */
|
|
660
|
+
status?: string;
|
|
661
|
+
trace_id?: string;
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
/** @description Invalid path or missing content */
|
|
666
|
+
400: {
|
|
667
|
+
headers: {
|
|
668
|
+
[name: string]: unknown;
|
|
669
|
+
};
|
|
670
|
+
content?: never;
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* Delete a file or empty directory.
|
|
676
|
+
* @description Deletes a file or an empty directory.
|
|
677
|
+
* Non-empty directories cannot be deleted (returns 400).
|
|
678
|
+
*/
|
|
679
|
+
delete: {
|
|
680
|
+
parameters: {
|
|
681
|
+
query?: never;
|
|
682
|
+
header?: never;
|
|
683
|
+
path: {
|
|
684
|
+
/** @description Path to the file or directory to delete */
|
|
685
|
+
filepath: string;
|
|
686
|
+
};
|
|
687
|
+
cookie?: never;
|
|
688
|
+
};
|
|
689
|
+
requestBody?: never;
|
|
690
|
+
responses: {
|
|
691
|
+
/** @description File or directory deleted */
|
|
692
|
+
200: {
|
|
693
|
+
headers: {
|
|
694
|
+
[name: string]: unknown;
|
|
695
|
+
};
|
|
696
|
+
content: {
|
|
697
|
+
"*/*": {
|
|
698
|
+
path?: string;
|
|
699
|
+
/** @example deleted */
|
|
700
|
+
status?: string;
|
|
701
|
+
trace_id?: string;
|
|
702
|
+
/** @enum {string} */
|
|
703
|
+
type?: "file" | "directory";
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
/** @description Invalid path or directory not empty */
|
|
708
|
+
400: {
|
|
709
|
+
headers: {
|
|
710
|
+
[name: string]: unknown;
|
|
711
|
+
};
|
|
712
|
+
content?: never;
|
|
713
|
+
};
|
|
714
|
+
/** @description Path not found */
|
|
715
|
+
404: {
|
|
716
|
+
headers: {
|
|
717
|
+
[name: string]: unknown;
|
|
718
|
+
};
|
|
719
|
+
content?: never;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
};
|
|
723
|
+
options?: never;
|
|
724
|
+
head?: never;
|
|
725
|
+
patch?: never;
|
|
726
|
+
trace?: never;
|
|
727
|
+
};
|
|
728
|
+
"/health": {
|
|
729
|
+
parameters: {
|
|
730
|
+
query?: never;
|
|
731
|
+
header?: never;
|
|
732
|
+
path?: never;
|
|
733
|
+
cookie?: never;
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* Health check endpoint.
|
|
737
|
+
* @description Returns the health status of the application. Used by Kubernetes liveness probes.
|
|
738
|
+
*/
|
|
739
|
+
get: {
|
|
740
|
+
parameters: {
|
|
741
|
+
query?: never;
|
|
742
|
+
header?: never;
|
|
743
|
+
path?: never;
|
|
744
|
+
cookie?: never;
|
|
745
|
+
};
|
|
746
|
+
requestBody?: never;
|
|
747
|
+
responses: {
|
|
748
|
+
/** @description Application is healthy */
|
|
749
|
+
200: {
|
|
750
|
+
headers: {
|
|
751
|
+
[name: string]: unknown;
|
|
752
|
+
};
|
|
753
|
+
content: {
|
|
754
|
+
"*/*": {
|
|
755
|
+
/** @example healthy */
|
|
756
|
+
status?: string;
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
put?: never;
|
|
763
|
+
post?: never;
|
|
764
|
+
delete?: never;
|
|
765
|
+
options?: never;
|
|
766
|
+
head?: never;
|
|
767
|
+
patch?: never;
|
|
768
|
+
trace?: never;
|
|
769
|
+
};
|
|
770
|
+
"/info": {
|
|
771
|
+
parameters: {
|
|
772
|
+
query?: never;
|
|
773
|
+
header?: never;
|
|
774
|
+
path?: never;
|
|
775
|
+
cookie?: never;
|
|
776
|
+
};
|
|
777
|
+
/**
|
|
778
|
+
* Service info endpoint.
|
|
779
|
+
* @description Returns service information including version, build info, and a trace ID for verification in New Relic.
|
|
780
|
+
*/
|
|
781
|
+
get: {
|
|
782
|
+
parameters: {
|
|
783
|
+
query?: never;
|
|
784
|
+
header?: never;
|
|
785
|
+
path?: never;
|
|
786
|
+
cookie?: never;
|
|
787
|
+
};
|
|
788
|
+
requestBody?: never;
|
|
789
|
+
responses: {
|
|
790
|
+
/** @description Service information with trace ID */
|
|
791
|
+
200: {
|
|
792
|
+
headers: {
|
|
793
|
+
[name: string]: unknown;
|
|
794
|
+
};
|
|
795
|
+
content: {
|
|
796
|
+
"*/*": {
|
|
797
|
+
/** @example 2026-01-13T18:00:00Z */
|
|
798
|
+
build_date?: string;
|
|
799
|
+
/** @example 42 */
|
|
800
|
+
build_number?: string;
|
|
801
|
+
/** @example OpenTelemetry Demo App - Traces flowing to New Relic! */
|
|
802
|
+
message?: string;
|
|
803
|
+
/** @example https://one.newrelic.com/distributed-tracing?query=trace.id%3D... */
|
|
804
|
+
new_relic_url?: string;
|
|
805
|
+
/** @example otel-demo */
|
|
806
|
+
service?: string;
|
|
807
|
+
/** @example 0af7651916cd43dd8448eb211c80319c */
|
|
808
|
+
trace_id?: string;
|
|
809
|
+
/** @example 1.0.42 */
|
|
810
|
+
version?: string;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
put?: never;
|
|
817
|
+
post?: never;
|
|
818
|
+
delete?: never;
|
|
819
|
+
options?: never;
|
|
820
|
+
head?: never;
|
|
821
|
+
patch?: never;
|
|
822
|
+
trace?: never;
|
|
823
|
+
};
|
|
824
|
+
"/metrics": {
|
|
825
|
+
parameters: {
|
|
826
|
+
query?: never;
|
|
827
|
+
header?: never;
|
|
828
|
+
path?: never;
|
|
829
|
+
cookie?: never;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Observability configuration info.
|
|
833
|
+
* @description Returns the current OpenTelemetry configuration and available endpoints.
|
|
834
|
+
*/
|
|
835
|
+
get: {
|
|
836
|
+
parameters: {
|
|
837
|
+
query?: never;
|
|
838
|
+
header?: never;
|
|
839
|
+
path?: never;
|
|
840
|
+
cookie?: never;
|
|
841
|
+
};
|
|
842
|
+
requestBody?: never;
|
|
843
|
+
responses: {
|
|
844
|
+
/** @description Observability configuration */
|
|
845
|
+
200: {
|
|
846
|
+
headers: {
|
|
847
|
+
[name: string]: unknown;
|
|
848
|
+
};
|
|
849
|
+
content: {
|
|
850
|
+
"*/*": {
|
|
851
|
+
endpoints?: {
|
|
852
|
+
[key: string]: string;
|
|
853
|
+
};
|
|
854
|
+
/** @example homelab */
|
|
855
|
+
environment?: string;
|
|
856
|
+
/** @example localhost:4317 */
|
|
857
|
+
otel_endpoint?: string;
|
|
858
|
+
/** @example otel-demo */
|
|
859
|
+
service_name?: string;
|
|
860
|
+
/** @example otel-demo */
|
|
861
|
+
service_namespace?: string;
|
|
862
|
+
/** @example 1.0.0 */
|
|
863
|
+
version?: string;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
put?: never;
|
|
870
|
+
post?: never;
|
|
871
|
+
delete?: never;
|
|
872
|
+
options?: never;
|
|
873
|
+
head?: never;
|
|
874
|
+
patch?: never;
|
|
875
|
+
trace?: never;
|
|
876
|
+
};
|
|
877
|
+
"/ready": {
|
|
878
|
+
parameters: {
|
|
879
|
+
query?: never;
|
|
880
|
+
header?: never;
|
|
881
|
+
path?: never;
|
|
882
|
+
cookie?: never;
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Readiness check endpoint.
|
|
886
|
+
* @description Returns the readiness status of the application. Used by Kubernetes readiness probes.
|
|
887
|
+
*/
|
|
888
|
+
get: {
|
|
889
|
+
parameters: {
|
|
890
|
+
query?: never;
|
|
891
|
+
header?: never;
|
|
892
|
+
path?: never;
|
|
893
|
+
cookie?: never;
|
|
894
|
+
};
|
|
895
|
+
requestBody?: never;
|
|
896
|
+
responses: {
|
|
897
|
+
/** @description Application is ready to receive traffic */
|
|
898
|
+
200: {
|
|
899
|
+
headers: {
|
|
900
|
+
[name: string]: unknown;
|
|
901
|
+
};
|
|
902
|
+
content: {
|
|
903
|
+
"*/*": {
|
|
904
|
+
/** @example ready */
|
|
905
|
+
status?: string;
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
put?: never;
|
|
912
|
+
post?: never;
|
|
913
|
+
delete?: never;
|
|
914
|
+
options?: never;
|
|
915
|
+
head?: never;
|
|
916
|
+
patch?: never;
|
|
917
|
+
trace?: never;
|
|
918
|
+
};
|
|
919
|
+
"/slow": {
|
|
920
|
+
parameters: {
|
|
921
|
+
query?: never;
|
|
922
|
+
header?: never;
|
|
923
|
+
path?: never;
|
|
924
|
+
cookie?: never;
|
|
925
|
+
};
|
|
926
|
+
/**
|
|
927
|
+
* Slow operation demonstration.
|
|
928
|
+
* @description Demonstrates a slow operation with a random delay between 0.5 and 2.0 seconds.
|
|
929
|
+
* Useful for testing latency monitoring and performance analysis in traces.
|
|
930
|
+
*/
|
|
931
|
+
get: {
|
|
932
|
+
parameters: {
|
|
933
|
+
query?: never;
|
|
934
|
+
header?: never;
|
|
935
|
+
path?: never;
|
|
936
|
+
cookie?: never;
|
|
937
|
+
};
|
|
938
|
+
requestBody?: never;
|
|
939
|
+
responses: {
|
|
940
|
+
/** @description Slow operation completed */
|
|
941
|
+
200: {
|
|
942
|
+
headers: {
|
|
943
|
+
[name: string]: unknown;
|
|
944
|
+
};
|
|
945
|
+
content: {
|
|
946
|
+
"*/*": {
|
|
947
|
+
/**
|
|
948
|
+
* Format: float
|
|
949
|
+
* @example 1.23
|
|
950
|
+
*/
|
|
951
|
+
delay_seconds?: number;
|
|
952
|
+
/** @example complete */
|
|
953
|
+
status?: string;
|
|
954
|
+
/** @example 0af7651916cd43dd8448eb211c80319c */
|
|
955
|
+
trace_id?: string;
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
put?: never;
|
|
962
|
+
post?: never;
|
|
963
|
+
delete?: never;
|
|
964
|
+
options?: never;
|
|
965
|
+
head?: never;
|
|
966
|
+
patch?: never;
|
|
967
|
+
trace?: never;
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
export type webhooks = Record<string, never>;
|
|
971
|
+
export type components = {
|
|
972
|
+
schemas: never;
|
|
973
|
+
responses: never;
|
|
974
|
+
parameters: never;
|
|
975
|
+
requestBodies: {
|
|
976
|
+
/** @description File content (plain text or JSON with "content" field) */
|
|
977
|
+
Body: {
|
|
978
|
+
content: {
|
|
979
|
+
"application/json": {
|
|
980
|
+
/** @example Hello, World! */
|
|
981
|
+
content?: string;
|
|
982
|
+
};
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
headers: never;
|
|
987
|
+
pathItems: never;
|
|
988
|
+
};
|
|
989
|
+
export type $defs = Record<string, never>;
|
|
990
|
+
export type operations = Record<string, never>;
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stuartshay/otel-types",
|
|
3
|
+
"version": "1.0.59",
|
|
4
|
+
"description": "TypeScript types for otel-demo API - Auto-generated from OpenAPI specification",
|
|
5
|
+
"main": "index.d.ts",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.d.ts",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"prepublishOnly": "echo 'Types should be generated before publishing'"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"otel-demo",
|
|
16
|
+
"opentelemetry",
|
|
17
|
+
"typescript",
|
|
18
|
+
"types",
|
|
19
|
+
"api"
|
|
20
|
+
],
|
|
21
|
+
"author": "Stuart Shay",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/stuartshay/otel-demo.git",
|
|
26
|
+
"directory": "packages/otel-types"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/stuartshay/otel-demo/tree/main/packages/otel-types",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|