@rivascva/dt-idl 1.0.7

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.
@@ -0,0 +1,690 @@
1
+ import * as openapi_fetch from 'openapi-fetch';
2
+ import { ClientOptions } from 'openapi-fetch';
3
+
4
+ /**
5
+ * This file was auto-generated by openapi-typescript.
6
+ * Do not make direct changes to the file.
7
+ */
8
+ interface paths$1 {
9
+ "/stocks/{symbol}": {
10
+ /** @description Gets the full quote for the given stock symbol */
11
+ get: operations$1["getStock"];
12
+ };
13
+ "/stocks/{symbol}/history": {
14
+ /** @description Gets the price history chart for the given stock symbol */
15
+ get: operations$1["getStockHistory"];
16
+ };
17
+ "/stocks/by-symbols/{symbols}": {
18
+ /** @description Gets the simple quotes for the given stock symbols */
19
+ get: operations$1["getStocksBySymbols"];
20
+ };
21
+ "/stocks/by-exchange/{exchange}": {
22
+ /** @description Gets the simple quotes for the given stock exchange */
23
+ get: operations$1["getStocksByExchange"];
24
+ };
25
+ "/stocks/search": {
26
+ /** @description Gets the simple quotes that fuzzy match the search query */
27
+ get: operations$1["searchStocks"];
28
+ };
29
+ "/news": {
30
+ /** @description Gets the latest news articles */
31
+ get: operations$1["getNews"];
32
+ };
33
+ "/news/by-symbols/{symbols}": {
34
+ /** @description Gets the latest stock news articles for the given stock symbols */
35
+ get: operations$1["getNewsBySymbols"];
36
+ };
37
+ }
38
+ interface components$1 {
39
+ schemas: {
40
+ /** @description A simple stock quote */
41
+ SimpleQuote: {
42
+ /** @example AAPL */
43
+ symbol: string;
44
+ /** @example Apple Inc */
45
+ name: string;
46
+ /**
47
+ * Format: double
48
+ * @example 182.25
49
+ */
50
+ price: number;
51
+ /**
52
+ * Format: double
53
+ * @example 1.25
54
+ */
55
+ percentChange: number;
56
+ };
57
+ /** @description A full stock quote */
58
+ FullQuote: components$1["schemas"]["SimpleQuote"] & {
59
+ /**
60
+ * Format: double
61
+ * @example 180.75
62
+ */
63
+ previousClose: number;
64
+ /**
65
+ * Format: double
66
+ * @example 180.75
67
+ */
68
+ open: number;
69
+ /**
70
+ * Format: double
71
+ * @example 178.25
72
+ */
73
+ dayLow: number;
74
+ /**
75
+ * Format: double
76
+ * @example 185.75
77
+ */
78
+ dayHigh: number;
79
+ /**
80
+ * Format: double
81
+ * @example 165.25
82
+ */
83
+ weekLow52: number;
84
+ /**
85
+ * Format: double
86
+ * @example 192.75
87
+ */
88
+ weekHigh52: number;
89
+ /**
90
+ * Format: int64
91
+ * @example 164000000
92
+ */
93
+ volume: number;
94
+ /**
95
+ * Format: int64
96
+ * @example 62000000
97
+ */
98
+ averageVolume: number;
99
+ /**
100
+ * Format: int64
101
+ * @example 28000000000
102
+ */
103
+ marketCap: number;
104
+ /**
105
+ * Format: double
106
+ * @example 28.25
107
+ */
108
+ pe: number;
109
+ /**
110
+ * Format: double
111
+ * @example 6.75
112
+ */
113
+ eps: number;
114
+ /** @example Apple designs and manufactures smartphones. */
115
+ description: string;
116
+ /** @example Timothy Cook */
117
+ ceo: string;
118
+ /** @example Technology */
119
+ sector: string;
120
+ /** @example Consumer Electronics */
121
+ industry: string;
122
+ /** @example Cupertino */
123
+ city: string;
124
+ /** @example California */
125
+ state: string;
126
+ /** @example USA */
127
+ country: string;
128
+ };
129
+ /** @description A stock history chart entry */
130
+ HistoryChartEntry: {
131
+ /** @example "2024-12-24T02:30:00.000Z" */
132
+ date: string;
133
+ /**
134
+ * Format: double
135
+ * @example 175.25
136
+ */
137
+ open: number;
138
+ /**
139
+ * Format: double
140
+ * @example 172.75
141
+ */
142
+ low: number;
143
+ /**
144
+ * Format: double
145
+ * @example 185.25
146
+ */
147
+ high: number;
148
+ /**
149
+ * Format: double
150
+ * @example 180.75
151
+ */
152
+ close: number;
153
+ };
154
+ /** @description A news article */
155
+ NewsArticle: {
156
+ /** @example Apple Watches Recalled */
157
+ title: string;
158
+ /** @example Apple Watches are being recalled worldwide */
159
+ description: string;
160
+ /**
161
+ * Format: int64
162
+ * @example 1709500000000
163
+ */
164
+ date: number;
165
+ /** @example https://news.com/articles/abc */
166
+ link: string;
167
+ /** @example https://news.com/articles/abc/image.png */
168
+ thumbnail: string;
169
+ };
170
+ /** @description A stock news article */
171
+ StockNewsArticle: components$1["schemas"]["NewsArticle"] & {
172
+ /** @example AAPL */
173
+ symbol: string;
174
+ };
175
+ /** @description A generic error */
176
+ Error: {
177
+ /**
178
+ * Format: int64
179
+ * @example 500
180
+ */
181
+ status: number;
182
+ /** @example ERROR */
183
+ code: components$1["schemas"]["ErrorCode"];
184
+ /** @example Error */
185
+ message: string;
186
+ };
187
+ /** @enum {string} */
188
+ ErrorCode: "ERROR";
189
+ /** @enum {string} */
190
+ HistoryTimeframe: "MIN5" | "MIN15" | "MIN30" | "HOUR1" | "HOUR4" | "DAY1";
191
+ };
192
+ responses: {
193
+ /** @description The resource was not found */
194
+ NotFound: {
195
+ content: {
196
+ "application/json": components$1["schemas"]["Error"];
197
+ };
198
+ };
199
+ /** @description There was an internal server error */
200
+ InternalServerError: {
201
+ content: {
202
+ "application/json": components$1["schemas"]["Error"];
203
+ };
204
+ };
205
+ };
206
+ parameters: never;
207
+ requestBodies: never;
208
+ headers: never;
209
+ pathItems: never;
210
+ }
211
+ interface operations$1 {
212
+ /** @description Gets the full quote for the given stock symbol */
213
+ getStock: {
214
+ parameters: {
215
+ path: {
216
+ /** @description The stock symbol */
217
+ symbol: string;
218
+ };
219
+ };
220
+ responses: {
221
+ /** @description Success */
222
+ 200: {
223
+ content: {
224
+ "application/json": components$1["schemas"]["FullQuote"];
225
+ };
226
+ };
227
+ 404: components$1["responses"]["NotFound"];
228
+ 500: components$1["responses"]["InternalServerError"];
229
+ };
230
+ };
231
+ /** @description Gets the price history chart for the given stock symbol */
232
+ getStockHistory: {
233
+ parameters: {
234
+ query: {
235
+ /** @description The stock history timeframe */
236
+ timeframe: components$1["schemas"]["HistoryTimeframe"];
237
+ /** @description The stock history from date */
238
+ from: string;
239
+ /** @description The stock history to date */
240
+ to: string;
241
+ };
242
+ path: {
243
+ /** @description The stock symbol */
244
+ symbol: string;
245
+ };
246
+ };
247
+ responses: {
248
+ /** @description Success */
249
+ 200: {
250
+ content: {
251
+ "application/json": components$1["schemas"]["HistoryChartEntry"][];
252
+ };
253
+ };
254
+ 404: components$1["responses"]["NotFound"];
255
+ 500: components$1["responses"]["InternalServerError"];
256
+ };
257
+ };
258
+ /** @description Gets the simple quotes for the given stock symbols */
259
+ getStocksBySymbols: {
260
+ parameters: {
261
+ path: {
262
+ /** @description The stock symbols */
263
+ symbols: string;
264
+ };
265
+ };
266
+ responses: {
267
+ /** @description Success */
268
+ 200: {
269
+ content: {
270
+ "application/json": components$1["schemas"]["SimpleQuote"][];
271
+ };
272
+ };
273
+ 404: components$1["responses"]["NotFound"];
274
+ 500: components$1["responses"]["InternalServerError"];
275
+ };
276
+ };
277
+ /** @description Gets the simple quotes for the given stock exchange */
278
+ getStocksByExchange: {
279
+ parameters: {
280
+ path: {
281
+ /** @description The stock exchange */
282
+ exchange: string;
283
+ };
284
+ };
285
+ responses: {
286
+ /** @description Success */
287
+ 200: {
288
+ content: {
289
+ "application/json": components$1["schemas"]["SimpleQuote"][];
290
+ };
291
+ };
292
+ 404: components$1["responses"]["NotFound"];
293
+ 500: components$1["responses"]["InternalServerError"];
294
+ };
295
+ };
296
+ /** @description Gets the simple quotes that fuzzy match the search query */
297
+ searchStocks: {
298
+ parameters: {
299
+ query: {
300
+ /** @description The search query */
301
+ query: string;
302
+ /** @description The maximum number of search results */
303
+ limit?: number;
304
+ };
305
+ };
306
+ responses: {
307
+ /** @description Success */
308
+ 200: {
309
+ content: {
310
+ "application/json": components$1["schemas"]["SimpleQuote"][];
311
+ };
312
+ };
313
+ 404: components$1["responses"]["NotFound"];
314
+ 500: components$1["responses"]["InternalServerError"];
315
+ };
316
+ };
317
+ /** @description Gets the latest news articles */
318
+ getNews: {
319
+ parameters: {
320
+ query?: {
321
+ /** @description The maximum number of articles */
322
+ limit?: number;
323
+ };
324
+ };
325
+ responses: {
326
+ /** @description Success */
327
+ 200: {
328
+ content: {
329
+ "application/json": components$1["schemas"]["NewsArticle"][];
330
+ };
331
+ };
332
+ 500: components$1["responses"]["InternalServerError"];
333
+ };
334
+ };
335
+ /** @description Gets the latest stock news articles for the given stock symbols */
336
+ getNewsBySymbols: {
337
+ parameters: {
338
+ query?: {
339
+ /** @description The maximum number of articles */
340
+ limit?: number;
341
+ };
342
+ path: {
343
+ /** @description The stock symbols */
344
+ symbols: string;
345
+ };
346
+ };
347
+ responses: {
348
+ /** @description Success */
349
+ 200: {
350
+ content: {
351
+ "application/json": components$1["schemas"]["StockNewsArticle"][];
352
+ };
353
+ };
354
+ 404: components$1["responses"]["NotFound"];
355
+ 500: components$1["responses"]["InternalServerError"];
356
+ };
357
+ };
358
+ }
359
+
360
+ /**
361
+ * This file was auto-generated by openapi-typescript.
362
+ * Do not make direct changes to the file.
363
+ */
364
+ interface paths {
365
+ "/users": {
366
+ /** @description Gets all users */
367
+ get: operations["getUsers"];
368
+ /** @description Adds a new user */
369
+ post: operations["addUser"];
370
+ };
371
+ "/users/{userId}": {
372
+ /** @description Gets a user */
373
+ get: operations["getUser"];
374
+ /** @description Updates an existing user */
375
+ put: operations["updateUser"];
376
+ };
377
+ "/users/{userId}/portfolios": {
378
+ /** @description Gets all portfolios of a user */
379
+ get: operations["getUserPortfolios"];
380
+ };
381
+ "/orders": {
382
+ /** @description Add a new order */
383
+ post: operations["addOrder"];
384
+ };
385
+ }
386
+ interface components {
387
+ schemas: {
388
+ /** @description A user payload */
389
+ UserPayload: {
390
+ /** @example sam.smith@example.com */
391
+ email: string;
392
+ /** @example Sam Smith */
393
+ name: string;
394
+ };
395
+ /** @description A user */
396
+ User: components["schemas"]["UserPayload"] & {
397
+ /** @example 123456 */
398
+ id: string;
399
+ /**
400
+ * Format: int64
401
+ * @example 1713398544000
402
+ */
403
+ dateCreated: number;
404
+ /**
405
+ * Format: int64
406
+ * @example 1713398544000
407
+ */
408
+ dateUpdated: number;
409
+ };
410
+ /** @description A trading portfolio */
411
+ Portfolio: {
412
+ /** @example 123456 */
413
+ id: string;
414
+ /** @example 123456 */
415
+ userId: string;
416
+ /** @example PERSONAL */
417
+ type: components["schemas"]["PortfolioType"];
418
+ /**
419
+ * Format: double
420
+ * @example 10500.25
421
+ */
422
+ cash: number;
423
+ holdings: components["schemas"]["Holding"][];
424
+ /**
425
+ * Format: int64
426
+ * @example 1713398544000
427
+ */
428
+ dateCreated: number;
429
+ /**
430
+ * Format: int64
431
+ * @example 1713398544000
432
+ */
433
+ dateUpdated: number;
434
+ };
435
+ /** @description An active stock holding */
436
+ Holding: {
437
+ /** @example 123456 */
438
+ id: string;
439
+ /** @example AAPL */
440
+ symbol: string;
441
+ /**
442
+ * Format: double
443
+ * @example 182.25
444
+ */
445
+ averagePrice: number;
446
+ /**
447
+ * Format: int64
448
+ * @example 10
449
+ */
450
+ quantity: number;
451
+ /**
452
+ * Format: int64
453
+ * @example 1713398544000
454
+ */
455
+ dateCreated: number;
456
+ /**
457
+ * Format: int64
458
+ * @example 1713398544000
459
+ */
460
+ dateUpdated: number;
461
+ };
462
+ /** @description A trade order payload */
463
+ OrderPayload: {
464
+ /** @example 123456 */
465
+ portfolioId: string;
466
+ /** @example BUY */
467
+ type: components["schemas"]["OrderType"];
468
+ /** @example AAPL */
469
+ symbol: string;
470
+ /**
471
+ * Format: double
472
+ * @example 182.25
473
+ */
474
+ targetPrice: number;
475
+ /**
476
+ * Format: int64
477
+ * @example 10
478
+ */
479
+ quantity: number;
480
+ };
481
+ /** @description A trade order */
482
+ Order: components["schemas"]["OrderPayload"] & {
483
+ /** @example 123456 */
484
+ id: string;
485
+ /**
486
+ * Format: double
487
+ * @example 182.25
488
+ */
489
+ actualPrice: number;
490
+ /**
491
+ * Format: int64
492
+ * @example 1713398544000
493
+ */
494
+ dateCreated: number;
495
+ };
496
+ /** @description A generic error */
497
+ Error: {
498
+ /**
499
+ * Format: int64
500
+ * @example 500
501
+ */
502
+ status: number;
503
+ /** @example ERROR */
504
+ code: components["schemas"]["ErrorCode"];
505
+ /** @example Error */
506
+ message: string;
507
+ };
508
+ /** @enum {string} */
509
+ ErrorCode: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "REQS_NOT_MET";
510
+ /** @enum {string} */
511
+ PortfolioType: "PERSONAL" | "COMPETITIVE";
512
+ /** @enum {string} */
513
+ OrderType: "BUY_MARKET" | "BUY_LIMIT" | "BUY_STOP" | "SELL_MARKET" | "SELL_LIMIT" | "SELL_STOP";
514
+ };
515
+ responses: {
516
+ /** @description The resource was not found */
517
+ NotFound: {
518
+ content: {
519
+ "application/json": components["schemas"]["Error"];
520
+ };
521
+ };
522
+ /** @description Invalid request payload */
523
+ BadRequest: {
524
+ content: {
525
+ "application/json": components["schemas"]["Error"];
526
+ };
527
+ };
528
+ /** @description There was an internal server error */
529
+ InternalServerError: {
530
+ content: {
531
+ "application/json": components["schemas"]["Error"];
532
+ };
533
+ };
534
+ };
535
+ parameters: never;
536
+ requestBodies: never;
537
+ headers: never;
538
+ pathItems: never;
539
+ }
540
+ interface operations {
541
+ /** @description Gets all users */
542
+ getUsers: {
543
+ responses: {
544
+ /** @description Success */
545
+ 200: {
546
+ content: {
547
+ "application/json": components["schemas"]["User"][];
548
+ };
549
+ };
550
+ 404: components["responses"]["NotFound"];
551
+ 500: components["responses"]["InternalServerError"];
552
+ };
553
+ };
554
+ /** @description Adds a new user */
555
+ addUser: {
556
+ /** @description The request body to add a user */
557
+ requestBody: {
558
+ content: {
559
+ "application/json": components["schemas"]["UserPayload"];
560
+ };
561
+ };
562
+ responses: {
563
+ /** @description Added */
564
+ 201: {
565
+ content: {
566
+ "application/json": components["schemas"]["User"];
567
+ };
568
+ };
569
+ 400: components["responses"]["BadRequest"];
570
+ 500: components["responses"]["InternalServerError"];
571
+ };
572
+ };
573
+ /** @description Gets a user */
574
+ getUser: {
575
+ parameters: {
576
+ path: {
577
+ /** @description The user id */
578
+ userId: string;
579
+ };
580
+ };
581
+ responses: {
582
+ /** @description Success */
583
+ 200: {
584
+ content: {
585
+ "application/json": components["schemas"]["User"];
586
+ };
587
+ };
588
+ 404: components["responses"]["NotFound"];
589
+ 500: components["responses"]["InternalServerError"];
590
+ };
591
+ };
592
+ /** @description Updates an existing user */
593
+ updateUser: {
594
+ parameters: {
595
+ path: {
596
+ /** @description The user id */
597
+ userId: string;
598
+ };
599
+ };
600
+ /** @description The request body to updated a user */
601
+ requestBody: {
602
+ content: {
603
+ "application/json": components["schemas"]["UserPayload"];
604
+ };
605
+ };
606
+ responses: {
607
+ /** @description Success */
608
+ 200: {
609
+ content: {
610
+ "application/json": components["schemas"]["User"];
611
+ };
612
+ };
613
+ 400: components["responses"]["BadRequest"];
614
+ 404: components["responses"]["NotFound"];
615
+ 500: components["responses"]["InternalServerError"];
616
+ };
617
+ };
618
+ /** @description Gets all portfolios of a user */
619
+ getUserPortfolios: {
620
+ parameters: {
621
+ path: {
622
+ /** @description The user id */
623
+ userId: string;
624
+ };
625
+ };
626
+ responses: {
627
+ /** @description Success */
628
+ 200: {
629
+ content: {
630
+ "application/json": components["schemas"]["Portfolio"][];
631
+ };
632
+ };
633
+ 404: components["responses"]["NotFound"];
634
+ 500: components["responses"]["InternalServerError"];
635
+ };
636
+ };
637
+ /** @description Add a new order */
638
+ addOrder: {
639
+ /** @description The request body to add an order */
640
+ requestBody: {
641
+ content: {
642
+ "application/json": components["schemas"]["OrderPayload"];
643
+ };
644
+ };
645
+ responses: {
646
+ /** @description Added */
647
+ 201: {
648
+ content: {
649
+ "application/json": components["schemas"]["Order"];
650
+ };
651
+ };
652
+ 400: components["responses"]["BadRequest"];
653
+ 404: components["responses"]["NotFound"];
654
+ 500: components["responses"]["InternalServerError"];
655
+ };
656
+ };
657
+ }
658
+
659
+ declare const createMarketServiceClient: (options: ClientOptions) => {
660
+ GET: openapi_fetch.ClientMethod<paths$1, "get", `${string}/${string}`>;
661
+ PUT: openapi_fetch.ClientMethod<paths$1, "put", `${string}/${string}`>;
662
+ POST: openapi_fetch.ClientMethod<paths$1, "post", `${string}/${string}`>;
663
+ DELETE: openapi_fetch.ClientMethod<paths$1, "delete", `${string}/${string}`>;
664
+ OPTIONS: openapi_fetch.ClientMethod<paths$1, "options", `${string}/${string}`>;
665
+ HEAD: openapi_fetch.ClientMethod<paths$1, "head", `${string}/${string}`>;
666
+ PATCH: openapi_fetch.ClientMethod<paths$1, "patch", `${string}/${string}`>;
667
+ TRACE: openapi_fetch.ClientMethod<paths$1, "trace", `${string}/${string}`>;
668
+ use(...middleware: openapi_fetch.Middleware[]): void;
669
+ eject(...middleware: openapi_fetch.Middleware[]): void;
670
+ };
671
+ declare const createTradeServiceClient: (options: ClientOptions) => {
672
+ GET: openapi_fetch.ClientMethod<paths, "get", `${string}/${string}`>;
673
+ PUT: openapi_fetch.ClientMethod<paths, "put", `${string}/${string}`>;
674
+ POST: openapi_fetch.ClientMethod<paths, "post", `${string}/${string}`>;
675
+ DELETE: openapi_fetch.ClientMethod<paths, "delete", `${string}/${string}`>;
676
+ OPTIONS: openapi_fetch.ClientMethod<paths, "options", `${string}/${string}`>;
677
+ HEAD: openapi_fetch.ClientMethod<paths, "head", `${string}/${string}`>;
678
+ PATCH: openapi_fetch.ClientMethod<paths, "patch", `${string}/${string}`>;
679
+ TRACE: openapi_fetch.ClientMethod<paths, "trace", `${string}/${string}`>;
680
+ use(...middleware: openapi_fetch.Middleware[]): void;
681
+ eject(...middleware: openapi_fetch.Middleware[]): void;
682
+ };
683
+
684
+ type SimpleQuotes = components$1['schemas']['SimpleQuote'];
685
+ type FullQuotes = components$1['schemas']['FullQuote'];
686
+ type MarketServiceError = components$1['schemas']['Error'];
687
+ type User = components['schemas']['User'];
688
+ type TradeSErviceError = components['schemas']['Error'];
689
+
690
+ export { type FullQuotes, type MarketServiceError, type SimpleQuotes, type TradeSErviceError, type User, createMarketServiceClient, createTradeServiceClient };