@rivascva/dt-idl 1.1.40 → 1.1.42
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/index.cjs.js +4 -0
- package/dist/index.d.ts +274 -117
- package/dist/index.esm.js +3 -1
- package/package.json +1 -1
- package/redocly.yaml +4 -0
- package/services/dt-asset-service.yaml +140 -0
- package/ts/clients/clients.ts +4 -0
- package/ts/clients/errors.ts +9 -1
- package/ts/services/dt-asset-service.ts +150 -0
- package/ts/types/types.ts +6 -0
package/dist/index.cjs.js
CHANGED
|
@@ -490,14 +490,18 @@ function mergeHeaders(...allHeaders) {
|
|
|
490
490
|
const createMarketServiceClient = (options) => createClient(options);
|
|
491
491
|
const createTradeServiceClient = (options) => createClient(options);
|
|
492
492
|
const createUserServiceClient = (options) => createClient(options);
|
|
493
|
+
const createAssetServiceClient = (options) => createClient(options);
|
|
493
494
|
|
|
494
495
|
const isMarketServiceError = (error) => typeof error === 'object';
|
|
495
496
|
const isTradeServiceError = (error) => typeof error === 'object';
|
|
496
497
|
const isUserServiceError = (error) => typeof error === 'object';
|
|
498
|
+
const isAssetServiceError = (error) => typeof error === 'object';
|
|
497
499
|
|
|
500
|
+
exports.createAssetServiceClient = createAssetServiceClient;
|
|
498
501
|
exports.createMarketServiceClient = createMarketServiceClient;
|
|
499
502
|
exports.createTradeServiceClient = createTradeServiceClient;
|
|
500
503
|
exports.createUserServiceClient = createUserServiceClient;
|
|
504
|
+
exports.isAssetServiceError = isAssetServiceError;
|
|
501
505
|
exports.isMarketServiceError = isMarketServiceError;
|
|
502
506
|
exports.isTradeServiceError = isTradeServiceError;
|
|
503
507
|
exports.isUserServiceError = isUserServiceError;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ClientOptions } from 'openapi-fetch';
|
|
|
5
5
|
* This file was auto-generated by openapi-typescript.
|
|
6
6
|
* Do not make direct changes to the file.
|
|
7
7
|
*/
|
|
8
|
-
interface paths$
|
|
8
|
+
interface paths$3 {
|
|
9
9
|
"/stocks/{symbol}": {
|
|
10
10
|
parameters: {
|
|
11
11
|
query?: never;
|
|
@@ -14,7 +14,7 @@ interface paths$2 {
|
|
|
14
14
|
cookie?: never;
|
|
15
15
|
};
|
|
16
16
|
/** @description Gets the full quote for the given stock symbol */
|
|
17
|
-
get: operations$
|
|
17
|
+
get: operations$3["getStock"];
|
|
18
18
|
put?: never;
|
|
19
19
|
post?: never;
|
|
20
20
|
delete?: never;
|
|
@@ -31,7 +31,7 @@ interface paths$2 {
|
|
|
31
31
|
cookie?: never;
|
|
32
32
|
};
|
|
33
33
|
/** @description Gets the price history chart for the given stock symbol */
|
|
34
|
-
get: operations$
|
|
34
|
+
get: operations$3["getStockHistory"];
|
|
35
35
|
put?: never;
|
|
36
36
|
post?: never;
|
|
37
37
|
delete?: never;
|
|
@@ -48,7 +48,7 @@ interface paths$2 {
|
|
|
48
48
|
cookie?: never;
|
|
49
49
|
};
|
|
50
50
|
/** @description Gets the simple quotes for the given stock symbols */
|
|
51
|
-
get: operations$
|
|
51
|
+
get: operations$3["getStocksBySymbols"];
|
|
52
52
|
put?: never;
|
|
53
53
|
post?: never;
|
|
54
54
|
delete?: never;
|
|
@@ -65,7 +65,7 @@ interface paths$2 {
|
|
|
65
65
|
cookie?: never;
|
|
66
66
|
};
|
|
67
67
|
/** @description Gets the simple quotes for the given stock exchange */
|
|
68
|
-
get: operations$
|
|
68
|
+
get: operations$3["getStocksByExchange"];
|
|
69
69
|
put?: never;
|
|
70
70
|
post?: never;
|
|
71
71
|
delete?: never;
|
|
@@ -82,7 +82,7 @@ interface paths$2 {
|
|
|
82
82
|
cookie?: never;
|
|
83
83
|
};
|
|
84
84
|
/** @description Gets the simple quotes for the market gainers */
|
|
85
|
-
get: operations$
|
|
85
|
+
get: operations$3["getMarketGainersStocks"];
|
|
86
86
|
put?: never;
|
|
87
87
|
post?: never;
|
|
88
88
|
delete?: never;
|
|
@@ -99,7 +99,7 @@ interface paths$2 {
|
|
|
99
99
|
cookie?: never;
|
|
100
100
|
};
|
|
101
101
|
/** @description Gets the simple quotes for the market losers */
|
|
102
|
-
get: operations$
|
|
102
|
+
get: operations$3["getMarketLosersStocks"];
|
|
103
103
|
put?: never;
|
|
104
104
|
post?: never;
|
|
105
105
|
delete?: never;
|
|
@@ -116,7 +116,7 @@ interface paths$2 {
|
|
|
116
116
|
cookie?: never;
|
|
117
117
|
};
|
|
118
118
|
/** @description Gets the simple quotes for the market active */
|
|
119
|
-
get: operations$
|
|
119
|
+
get: operations$3["getMarketActiveStocks"];
|
|
120
120
|
put?: never;
|
|
121
121
|
post?: never;
|
|
122
122
|
delete?: never;
|
|
@@ -133,7 +133,7 @@ interface paths$2 {
|
|
|
133
133
|
cookie?: never;
|
|
134
134
|
};
|
|
135
135
|
/** @description Gets the simple quotes that fuzzy match the search query */
|
|
136
|
-
get: operations$
|
|
136
|
+
get: operations$3["getSearchStocks"];
|
|
137
137
|
put?: never;
|
|
138
138
|
post?: never;
|
|
139
139
|
delete?: never;
|
|
@@ -150,7 +150,7 @@ interface paths$2 {
|
|
|
150
150
|
cookie?: never;
|
|
151
151
|
};
|
|
152
152
|
/** @description Gets the latest news articles */
|
|
153
|
-
get: operations$
|
|
153
|
+
get: operations$3["getNews"];
|
|
154
154
|
put?: never;
|
|
155
155
|
post?: never;
|
|
156
156
|
delete?: never;
|
|
@@ -167,7 +167,7 @@ interface paths$2 {
|
|
|
167
167
|
cookie?: never;
|
|
168
168
|
};
|
|
169
169
|
/** @description Gets the latest stock news articles for the given stock symbols */
|
|
170
|
-
get: operations$
|
|
170
|
+
get: operations$3["getNewsBySymbols"];
|
|
171
171
|
put?: never;
|
|
172
172
|
post?: never;
|
|
173
173
|
delete?: never;
|
|
@@ -177,7 +177,7 @@ interface paths$2 {
|
|
|
177
177
|
trace?: never;
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
interface components$
|
|
180
|
+
interface components$3 {
|
|
181
181
|
schemas: {
|
|
182
182
|
/** @description A simple stock quote */
|
|
183
183
|
SimpleQuote: {
|
|
@@ -202,7 +202,7 @@ interface components$2 {
|
|
|
202
202
|
percentChange: number;
|
|
203
203
|
};
|
|
204
204
|
/** @description A full stock quote */
|
|
205
|
-
FullQuote: components$
|
|
205
|
+
FullQuote: components$3["schemas"]["SimpleQuote"] & {
|
|
206
206
|
/**
|
|
207
207
|
* Format: double
|
|
208
208
|
* @example 180.75
|
|
@@ -315,7 +315,7 @@ interface components$2 {
|
|
|
315
315
|
thumbnail: string;
|
|
316
316
|
};
|
|
317
317
|
/** @description A stock news article */
|
|
318
|
-
StockNewsArticle: components$
|
|
318
|
+
StockNewsArticle: components$3["schemas"]["NewsArticle"] & {
|
|
319
319
|
/** @example AAPL */
|
|
320
320
|
symbol: string;
|
|
321
321
|
};
|
|
@@ -327,7 +327,7 @@ interface components$2 {
|
|
|
327
327
|
*/
|
|
328
328
|
status: number;
|
|
329
329
|
/** @example ERROR */
|
|
330
|
-
code: components$
|
|
330
|
+
code: components$3["schemas"]["ErrorCode"];
|
|
331
331
|
/** @example Error */
|
|
332
332
|
message: string;
|
|
333
333
|
};
|
|
@@ -343,7 +343,7 @@ interface components$2 {
|
|
|
343
343
|
[name: string]: unknown;
|
|
344
344
|
};
|
|
345
345
|
content: {
|
|
346
|
-
"application/json": components$
|
|
346
|
+
"application/json": components$3["schemas"]["Error"];
|
|
347
347
|
};
|
|
348
348
|
};
|
|
349
349
|
/** @description There was an internal server error */
|
|
@@ -352,7 +352,7 @@ interface components$2 {
|
|
|
352
352
|
[name: string]: unknown;
|
|
353
353
|
};
|
|
354
354
|
content: {
|
|
355
|
-
"application/json": components$
|
|
355
|
+
"application/json": components$3["schemas"]["Error"];
|
|
356
356
|
};
|
|
357
357
|
};
|
|
358
358
|
};
|
|
@@ -361,7 +361,7 @@ interface components$2 {
|
|
|
361
361
|
headers: never;
|
|
362
362
|
pathItems: never;
|
|
363
363
|
}
|
|
364
|
-
interface operations$
|
|
364
|
+
interface operations$3 {
|
|
365
365
|
getStock: {
|
|
366
366
|
parameters: {
|
|
367
367
|
query?: never;
|
|
@@ -380,18 +380,18 @@ interface operations$2 {
|
|
|
380
380
|
[name: string]: unknown;
|
|
381
381
|
};
|
|
382
382
|
content: {
|
|
383
|
-
"application/json": components$
|
|
383
|
+
"application/json": components$3["schemas"]["FullQuote"];
|
|
384
384
|
};
|
|
385
385
|
};
|
|
386
|
-
404: components$
|
|
387
|
-
500: components$
|
|
386
|
+
404: components$3["responses"]["NotFound"];
|
|
387
|
+
500: components$3["responses"]["InternalServerError"];
|
|
388
388
|
};
|
|
389
389
|
};
|
|
390
390
|
getStockHistory: {
|
|
391
391
|
parameters: {
|
|
392
392
|
query: {
|
|
393
393
|
/** @description The stock history timeframe */
|
|
394
|
-
timeframe: components$
|
|
394
|
+
timeframe: components$3["schemas"]["StockHistoryTimeframe"];
|
|
395
395
|
/** @description The stock history from date */
|
|
396
396
|
from: string;
|
|
397
397
|
/** @description The stock history to date */
|
|
@@ -412,11 +412,11 @@ interface operations$2 {
|
|
|
412
412
|
[name: string]: unknown;
|
|
413
413
|
};
|
|
414
414
|
content: {
|
|
415
|
-
"application/json": components$
|
|
415
|
+
"application/json": components$3["schemas"]["StockHistoryEntry"][];
|
|
416
416
|
};
|
|
417
417
|
};
|
|
418
|
-
404: components$
|
|
419
|
-
500: components$
|
|
418
|
+
404: components$3["responses"]["NotFound"];
|
|
419
|
+
500: components$3["responses"]["InternalServerError"];
|
|
420
420
|
};
|
|
421
421
|
};
|
|
422
422
|
getStocksBySymbols: {
|
|
@@ -437,11 +437,11 @@ interface operations$2 {
|
|
|
437
437
|
[name: string]: unknown;
|
|
438
438
|
};
|
|
439
439
|
content: {
|
|
440
|
-
"application/json": components$
|
|
440
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
441
441
|
};
|
|
442
442
|
};
|
|
443
|
-
404: components$
|
|
444
|
-
500: components$
|
|
443
|
+
404: components$3["responses"]["NotFound"];
|
|
444
|
+
500: components$3["responses"]["InternalServerError"];
|
|
445
445
|
};
|
|
446
446
|
};
|
|
447
447
|
getStocksByExchange: {
|
|
@@ -462,11 +462,11 @@ interface operations$2 {
|
|
|
462
462
|
[name: string]: unknown;
|
|
463
463
|
};
|
|
464
464
|
content: {
|
|
465
|
-
"application/json": components$
|
|
465
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
466
466
|
};
|
|
467
467
|
};
|
|
468
|
-
404: components$
|
|
469
|
-
500: components$
|
|
468
|
+
404: components$3["responses"]["NotFound"];
|
|
469
|
+
500: components$3["responses"]["InternalServerError"];
|
|
470
470
|
};
|
|
471
471
|
};
|
|
472
472
|
getMarketGainersStocks: {
|
|
@@ -484,10 +484,10 @@ interface operations$2 {
|
|
|
484
484
|
[name: string]: unknown;
|
|
485
485
|
};
|
|
486
486
|
content: {
|
|
487
|
-
"application/json": components$
|
|
487
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
488
488
|
};
|
|
489
489
|
};
|
|
490
|
-
500: components$
|
|
490
|
+
500: components$3["responses"]["InternalServerError"];
|
|
491
491
|
};
|
|
492
492
|
};
|
|
493
493
|
getMarketLosersStocks: {
|
|
@@ -505,10 +505,10 @@ interface operations$2 {
|
|
|
505
505
|
[name: string]: unknown;
|
|
506
506
|
};
|
|
507
507
|
content: {
|
|
508
|
-
"application/json": components$
|
|
508
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
509
509
|
};
|
|
510
510
|
};
|
|
511
|
-
500: components$
|
|
511
|
+
500: components$3["responses"]["InternalServerError"];
|
|
512
512
|
};
|
|
513
513
|
};
|
|
514
514
|
getMarketActiveStocks: {
|
|
@@ -526,10 +526,10 @@ interface operations$2 {
|
|
|
526
526
|
[name: string]: unknown;
|
|
527
527
|
};
|
|
528
528
|
content: {
|
|
529
|
-
"application/json": components$
|
|
529
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
530
530
|
};
|
|
531
531
|
};
|
|
532
|
-
500: components$
|
|
532
|
+
500: components$3["responses"]["InternalServerError"];
|
|
533
533
|
};
|
|
534
534
|
};
|
|
535
535
|
getSearchStocks: {
|
|
@@ -552,10 +552,10 @@ interface operations$2 {
|
|
|
552
552
|
[name: string]: unknown;
|
|
553
553
|
};
|
|
554
554
|
content: {
|
|
555
|
-
"application/json": components$
|
|
555
|
+
"application/json": components$3["schemas"]["SimpleQuote"][];
|
|
556
556
|
};
|
|
557
557
|
};
|
|
558
|
-
500: components$
|
|
558
|
+
500: components$3["responses"]["InternalServerError"];
|
|
559
559
|
};
|
|
560
560
|
};
|
|
561
561
|
getNews: {
|
|
@@ -576,10 +576,10 @@ interface operations$2 {
|
|
|
576
576
|
[name: string]: unknown;
|
|
577
577
|
};
|
|
578
578
|
content: {
|
|
579
|
-
"application/json": components$
|
|
579
|
+
"application/json": components$3["schemas"]["NewsArticle"][];
|
|
580
580
|
};
|
|
581
581
|
};
|
|
582
|
-
500: components$
|
|
582
|
+
500: components$3["responses"]["InternalServerError"];
|
|
583
583
|
};
|
|
584
584
|
};
|
|
585
585
|
getNewsBySymbols: {
|
|
@@ -603,11 +603,11 @@ interface operations$2 {
|
|
|
603
603
|
[name: string]: unknown;
|
|
604
604
|
};
|
|
605
605
|
content: {
|
|
606
|
-
"application/json": components$
|
|
606
|
+
"application/json": components$3["schemas"]["StockNewsArticle"][];
|
|
607
607
|
};
|
|
608
608
|
};
|
|
609
|
-
404: components$
|
|
610
|
-
500: components$
|
|
609
|
+
404: components$3["responses"]["NotFound"];
|
|
610
|
+
500: components$3["responses"]["InternalServerError"];
|
|
611
611
|
};
|
|
612
612
|
};
|
|
613
613
|
}
|
|
@@ -616,7 +616,7 @@ interface operations$2 {
|
|
|
616
616
|
* This file was auto-generated by openapi-typescript.
|
|
617
617
|
* Do not make direct changes to the file.
|
|
618
618
|
*/
|
|
619
|
-
interface paths$
|
|
619
|
+
interface paths$2 {
|
|
620
620
|
"/portfolios": {
|
|
621
621
|
parameters: {
|
|
622
622
|
query?: never;
|
|
@@ -627,7 +627,7 @@ interface paths$1 {
|
|
|
627
627
|
get?: never;
|
|
628
628
|
put?: never;
|
|
629
629
|
/** @description Adds a new portfolio */
|
|
630
|
-
post: operations$
|
|
630
|
+
post: operations$2["addPortfolio"];
|
|
631
631
|
delete?: never;
|
|
632
632
|
options?: never;
|
|
633
633
|
head?: never;
|
|
@@ -643,7 +643,7 @@ interface paths$1 {
|
|
|
643
643
|
};
|
|
644
644
|
get?: never;
|
|
645
645
|
/** @description Updates an existing portfolio */
|
|
646
|
-
put: operations$
|
|
646
|
+
put: operations$2["updatePortfolio"];
|
|
647
647
|
post?: never;
|
|
648
648
|
delete?: never;
|
|
649
649
|
options?: never;
|
|
@@ -659,7 +659,7 @@ interface paths$1 {
|
|
|
659
659
|
cookie?: never;
|
|
660
660
|
};
|
|
661
661
|
/** @description Gets the portfolios for the given user */
|
|
662
|
-
get: operations$
|
|
662
|
+
get: operations$2["getPortfoliosByUser"];
|
|
663
663
|
put?: never;
|
|
664
664
|
post?: never;
|
|
665
665
|
delete?: never;
|
|
@@ -678,7 +678,7 @@ interface paths$1 {
|
|
|
678
678
|
get?: never;
|
|
679
679
|
put?: never;
|
|
680
680
|
/** @description Adds a new order */
|
|
681
|
-
post: operations$
|
|
681
|
+
post: operations$2["addOrder"];
|
|
682
682
|
delete?: never;
|
|
683
683
|
options?: never;
|
|
684
684
|
head?: never;
|
|
@@ -696,21 +696,21 @@ interface paths$1 {
|
|
|
696
696
|
put?: never;
|
|
697
697
|
post?: never;
|
|
698
698
|
/** @description Deletes an existing order */
|
|
699
|
-
delete: operations$
|
|
699
|
+
delete: operations$2["deleteOrder"];
|
|
700
700
|
options?: never;
|
|
701
701
|
head?: never;
|
|
702
702
|
patch?: never;
|
|
703
703
|
trace?: never;
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
|
-
interface components$
|
|
706
|
+
interface components$2 {
|
|
707
707
|
schemas: {
|
|
708
708
|
/** @description Payload to add a new portfolio */
|
|
709
709
|
AddPortfolioPayload: {
|
|
710
710
|
/** @example 123456 */
|
|
711
711
|
userId: string;
|
|
712
712
|
/** @example PERSONAL */
|
|
713
|
-
type: components$
|
|
713
|
+
type: components$2["schemas"]["PortfolioType"];
|
|
714
714
|
/**
|
|
715
715
|
* Format: double
|
|
716
716
|
* @example 10500.25
|
|
@@ -718,13 +718,13 @@ interface components$1 {
|
|
|
718
718
|
cash: number;
|
|
719
719
|
};
|
|
720
720
|
/** @description Payload to update an existing portfolio */
|
|
721
|
-
UpdatePortfolioPayload: components$
|
|
721
|
+
UpdatePortfolioPayload: components$2["schemas"]["AddPortfolioPayload"];
|
|
722
722
|
/** @description A trading portfolio */
|
|
723
|
-
Portfolio: components$
|
|
723
|
+
Portfolio: components$2["schemas"]["AddPortfolioPayload"] & {
|
|
724
724
|
/** @example 123456 */
|
|
725
725
|
id: string;
|
|
726
|
-
holdings: components$
|
|
727
|
-
orders: components$
|
|
726
|
+
holdings: components$2["schemas"]["Holding"][];
|
|
727
|
+
orders: components$2["schemas"]["Order"][];
|
|
728
728
|
/**
|
|
729
729
|
* Format: int64
|
|
730
730
|
* @example 1713398544000
|
|
@@ -768,7 +768,7 @@ interface components$1 {
|
|
|
768
768
|
/** @example 123456 */
|
|
769
769
|
portfolioId: string;
|
|
770
770
|
/** @example BUY */
|
|
771
|
-
type: components$
|
|
771
|
+
type: components$2["schemas"]["OrderType"];
|
|
772
772
|
/** @example AAPL */
|
|
773
773
|
symbol: string;
|
|
774
774
|
/**
|
|
@@ -783,7 +783,7 @@ interface components$1 {
|
|
|
783
783
|
shares: number;
|
|
784
784
|
};
|
|
785
785
|
/** @description An order */
|
|
786
|
-
Order: components$
|
|
786
|
+
Order: components$2["schemas"]["AddOrderPayload"] & {
|
|
787
787
|
/** @example 123456 */
|
|
788
788
|
id: string;
|
|
789
789
|
/**
|
|
@@ -815,7 +815,7 @@ interface components$1 {
|
|
|
815
815
|
*/
|
|
816
816
|
status: number;
|
|
817
817
|
/** @example ERROR */
|
|
818
|
-
code: components$
|
|
818
|
+
code: components$2["schemas"]["ErrorCode"];
|
|
819
819
|
/** @example Error */
|
|
820
820
|
message: string;
|
|
821
821
|
};
|
|
@@ -840,7 +840,7 @@ interface components$1 {
|
|
|
840
840
|
[name: string]: unknown;
|
|
841
841
|
};
|
|
842
842
|
content: {
|
|
843
|
-
"application/json": components$
|
|
843
|
+
"application/json": components$2["schemas"]["Error"];
|
|
844
844
|
};
|
|
845
845
|
};
|
|
846
846
|
/** @description Invalid request payload */
|
|
@@ -849,7 +849,7 @@ interface components$1 {
|
|
|
849
849
|
[name: string]: unknown;
|
|
850
850
|
};
|
|
851
851
|
content: {
|
|
852
|
-
"application/json": components$
|
|
852
|
+
"application/json": components$2["schemas"]["Error"];
|
|
853
853
|
};
|
|
854
854
|
};
|
|
855
855
|
/** @description There was an internal server error */
|
|
@@ -858,7 +858,7 @@ interface components$1 {
|
|
|
858
858
|
[name: string]: unknown;
|
|
859
859
|
};
|
|
860
860
|
content: {
|
|
861
|
-
"application/json": components$
|
|
861
|
+
"application/json": components$2["schemas"]["Error"];
|
|
862
862
|
};
|
|
863
863
|
};
|
|
864
864
|
};
|
|
@@ -867,7 +867,7 @@ interface components$1 {
|
|
|
867
867
|
headers: never;
|
|
868
868
|
pathItems: never;
|
|
869
869
|
}
|
|
870
|
-
interface operations$
|
|
870
|
+
interface operations$2 {
|
|
871
871
|
addPortfolio: {
|
|
872
872
|
parameters: {
|
|
873
873
|
query?: never;
|
|
@@ -878,7 +878,7 @@ interface operations$1 {
|
|
|
878
878
|
/** @description The request body to add a portfolio */
|
|
879
879
|
requestBody: {
|
|
880
880
|
content: {
|
|
881
|
-
"application/json": components$
|
|
881
|
+
"application/json": components$2["schemas"]["AddPortfolioPayload"];
|
|
882
882
|
};
|
|
883
883
|
};
|
|
884
884
|
responses: {
|
|
@@ -888,12 +888,12 @@ interface operations$1 {
|
|
|
888
888
|
[name: string]: unknown;
|
|
889
889
|
};
|
|
890
890
|
content: {
|
|
891
|
-
"application/json": components$
|
|
891
|
+
"application/json": components$2["schemas"]["Portfolio"];
|
|
892
892
|
};
|
|
893
893
|
};
|
|
894
|
-
400: components$
|
|
895
|
-
404: components$
|
|
896
|
-
500: components$
|
|
894
|
+
400: components$2["responses"]["BadRequest"];
|
|
895
|
+
404: components$2["responses"]["NotFound"];
|
|
896
|
+
500: components$2["responses"]["InternalServerError"];
|
|
897
897
|
};
|
|
898
898
|
};
|
|
899
899
|
updatePortfolio: {
|
|
@@ -909,7 +909,7 @@ interface operations$1 {
|
|
|
909
909
|
/** @description The request body to update a portfolio */
|
|
910
910
|
requestBody: {
|
|
911
911
|
content: {
|
|
912
|
-
"application/json": components$
|
|
912
|
+
"application/json": components$2["schemas"]["UpdatePortfolioPayload"];
|
|
913
913
|
};
|
|
914
914
|
};
|
|
915
915
|
responses: {
|
|
@@ -919,12 +919,12 @@ interface operations$1 {
|
|
|
919
919
|
[name: string]: unknown;
|
|
920
920
|
};
|
|
921
921
|
content: {
|
|
922
|
-
"application/json": components$
|
|
922
|
+
"application/json": components$2["schemas"]["Portfolio"];
|
|
923
923
|
};
|
|
924
924
|
};
|
|
925
|
-
400: components$
|
|
926
|
-
404: components$
|
|
927
|
-
500: components$
|
|
925
|
+
400: components$2["responses"]["BadRequest"];
|
|
926
|
+
404: components$2["responses"]["NotFound"];
|
|
927
|
+
500: components$2["responses"]["InternalServerError"];
|
|
928
928
|
};
|
|
929
929
|
};
|
|
930
930
|
getPortfoliosByUser: {
|
|
@@ -945,11 +945,11 @@ interface operations$1 {
|
|
|
945
945
|
[name: string]: unknown;
|
|
946
946
|
};
|
|
947
947
|
content: {
|
|
948
|
-
"application/json": components$
|
|
948
|
+
"application/json": components$2["schemas"]["Portfolio"][];
|
|
949
949
|
};
|
|
950
950
|
};
|
|
951
|
-
404: components$
|
|
952
|
-
500: components$
|
|
951
|
+
404: components$2["responses"]["NotFound"];
|
|
952
|
+
500: components$2["responses"]["InternalServerError"];
|
|
953
953
|
};
|
|
954
954
|
};
|
|
955
955
|
addOrder: {
|
|
@@ -962,7 +962,7 @@ interface operations$1 {
|
|
|
962
962
|
/** @description The request body to add an order */
|
|
963
963
|
requestBody: {
|
|
964
964
|
content: {
|
|
965
|
-
"application/json": components$
|
|
965
|
+
"application/json": components$2["schemas"]["AddOrderPayload"];
|
|
966
966
|
};
|
|
967
967
|
};
|
|
968
968
|
responses: {
|
|
@@ -972,12 +972,12 @@ interface operations$1 {
|
|
|
972
972
|
[name: string]: unknown;
|
|
973
973
|
};
|
|
974
974
|
content: {
|
|
975
|
-
"application/json": components$
|
|
975
|
+
"application/json": components$2["schemas"]["Order"];
|
|
976
976
|
};
|
|
977
977
|
};
|
|
978
|
-
400: components$
|
|
979
|
-
404: components$
|
|
980
|
-
500: components$
|
|
978
|
+
400: components$2["responses"]["BadRequest"];
|
|
979
|
+
404: components$2["responses"]["NotFound"];
|
|
980
|
+
500: components$2["responses"]["InternalServerError"];
|
|
981
981
|
};
|
|
982
982
|
};
|
|
983
983
|
deleteOrder: {
|
|
@@ -992,10 +992,10 @@ interface operations$1 {
|
|
|
992
992
|
};
|
|
993
993
|
requestBody?: never;
|
|
994
994
|
responses: {
|
|
995
|
-
204: components$
|
|
996
|
-
400: components$
|
|
997
|
-
404: components$
|
|
998
|
-
500: components$
|
|
995
|
+
204: components$2["responses"]["NoContent"];
|
|
996
|
+
400: components$2["responses"]["BadRequest"];
|
|
997
|
+
404: components$2["responses"]["NotFound"];
|
|
998
|
+
500: components$2["responses"]["InternalServerError"];
|
|
999
999
|
};
|
|
1000
1000
|
};
|
|
1001
1001
|
}
|
|
@@ -1004,7 +1004,7 @@ interface operations$1 {
|
|
|
1004
1004
|
* This file was auto-generated by openapi-typescript.
|
|
1005
1005
|
* Do not make direct changes to the file.
|
|
1006
1006
|
*/
|
|
1007
|
-
interface paths {
|
|
1007
|
+
interface paths$1 {
|
|
1008
1008
|
"/users": {
|
|
1009
1009
|
parameters: {
|
|
1010
1010
|
query?: never;
|
|
@@ -1013,10 +1013,10 @@ interface paths {
|
|
|
1013
1013
|
cookie?: never;
|
|
1014
1014
|
};
|
|
1015
1015
|
/** @description Gets all users */
|
|
1016
|
-
get: operations["getUsers"];
|
|
1016
|
+
get: operations$1["getUsers"];
|
|
1017
1017
|
put?: never;
|
|
1018
1018
|
/** @description Adds a new user */
|
|
1019
|
-
post: operations["addUser"];
|
|
1019
|
+
post: operations$1["addUser"];
|
|
1020
1020
|
delete?: never;
|
|
1021
1021
|
options?: never;
|
|
1022
1022
|
head?: never;
|
|
@@ -1031,9 +1031,9 @@ interface paths {
|
|
|
1031
1031
|
cookie?: never;
|
|
1032
1032
|
};
|
|
1033
1033
|
/** @description Gets a user */
|
|
1034
|
-
get: operations["getUser"];
|
|
1034
|
+
get: operations$1["getUser"];
|
|
1035
1035
|
/** @description Updates an existing user */
|
|
1036
|
-
put: operations["updateUser"];
|
|
1036
|
+
put: operations$1["updateUser"];
|
|
1037
1037
|
post?: never;
|
|
1038
1038
|
delete?: never;
|
|
1039
1039
|
options?: never;
|
|
@@ -1042,7 +1042,7 @@ interface paths {
|
|
|
1042
1042
|
trace?: never;
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
interface components {
|
|
1045
|
+
interface components$1 {
|
|
1046
1046
|
schemas: {
|
|
1047
1047
|
/** @description Payload to add a new user */
|
|
1048
1048
|
AddUserPayload: {
|
|
@@ -1056,9 +1056,9 @@ interface components {
|
|
|
1056
1056
|
imageUrl?: string;
|
|
1057
1057
|
};
|
|
1058
1058
|
/** @description Payload to update an existing user */
|
|
1059
|
-
UpdateUserPayload: components["schemas"]["AddUserPayload"];
|
|
1059
|
+
UpdateUserPayload: components$1["schemas"]["AddUserPayload"];
|
|
1060
1060
|
/** @description A user */
|
|
1061
|
-
User: components["schemas"]["AddUserPayload"] & {
|
|
1061
|
+
User: components$1["schemas"]["AddUserPayload"] & {
|
|
1062
1062
|
/** @example 123456 */
|
|
1063
1063
|
id: string;
|
|
1064
1064
|
/**
|
|
@@ -1080,7 +1080,7 @@ interface components {
|
|
|
1080
1080
|
*/
|
|
1081
1081
|
status: number;
|
|
1082
1082
|
/** @example ERROR */
|
|
1083
|
-
code: components["schemas"]["ErrorCode"];
|
|
1083
|
+
code: components$1["schemas"]["ErrorCode"];
|
|
1084
1084
|
/** @example Error */
|
|
1085
1085
|
message: string;
|
|
1086
1086
|
};
|
|
@@ -1101,7 +1101,7 @@ interface components {
|
|
|
1101
1101
|
[name: string]: unknown;
|
|
1102
1102
|
};
|
|
1103
1103
|
content: {
|
|
1104
|
-
"application/json": components["schemas"]["Error"];
|
|
1104
|
+
"application/json": components$1["schemas"]["Error"];
|
|
1105
1105
|
};
|
|
1106
1106
|
};
|
|
1107
1107
|
/** @description Invalid request payload */
|
|
@@ -1110,7 +1110,7 @@ interface components {
|
|
|
1110
1110
|
[name: string]: unknown;
|
|
1111
1111
|
};
|
|
1112
1112
|
content: {
|
|
1113
|
-
"application/json": components["schemas"]["Error"];
|
|
1113
|
+
"application/json": components$1["schemas"]["Error"];
|
|
1114
1114
|
};
|
|
1115
1115
|
};
|
|
1116
1116
|
/** @description There was an internal server error */
|
|
@@ -1119,7 +1119,7 @@ interface components {
|
|
|
1119
1119
|
[name: string]: unknown;
|
|
1120
1120
|
};
|
|
1121
1121
|
content: {
|
|
1122
|
-
"application/json": components["schemas"]["Error"];
|
|
1122
|
+
"application/json": components$1["schemas"]["Error"];
|
|
1123
1123
|
};
|
|
1124
1124
|
};
|
|
1125
1125
|
};
|
|
@@ -1128,7 +1128,7 @@ interface components {
|
|
|
1128
1128
|
headers: never;
|
|
1129
1129
|
pathItems: never;
|
|
1130
1130
|
}
|
|
1131
|
-
interface operations {
|
|
1131
|
+
interface operations$1 {
|
|
1132
1132
|
getUsers: {
|
|
1133
1133
|
parameters: {
|
|
1134
1134
|
query?: never;
|
|
@@ -1144,11 +1144,11 @@ interface operations {
|
|
|
1144
1144
|
[name: string]: unknown;
|
|
1145
1145
|
};
|
|
1146
1146
|
content: {
|
|
1147
|
-
"application/json": components["schemas"]["User"][];
|
|
1147
|
+
"application/json": components$1["schemas"]["User"][];
|
|
1148
1148
|
};
|
|
1149
1149
|
};
|
|
1150
|
-
404: components["responses"]["NotFound"];
|
|
1151
|
-
500: components["responses"]["InternalServerError"];
|
|
1150
|
+
404: components$1["responses"]["NotFound"];
|
|
1151
|
+
500: components$1["responses"]["InternalServerError"];
|
|
1152
1152
|
};
|
|
1153
1153
|
};
|
|
1154
1154
|
addUser: {
|
|
@@ -1161,7 +1161,7 @@ interface operations {
|
|
|
1161
1161
|
/** @description The request body to add a user */
|
|
1162
1162
|
requestBody: {
|
|
1163
1163
|
content: {
|
|
1164
|
-
"application/json": components["schemas"]["AddUserPayload"];
|
|
1164
|
+
"application/json": components$1["schemas"]["AddUserPayload"];
|
|
1165
1165
|
};
|
|
1166
1166
|
};
|
|
1167
1167
|
responses: {
|
|
@@ -1171,11 +1171,11 @@ interface operations {
|
|
|
1171
1171
|
[name: string]: unknown;
|
|
1172
1172
|
};
|
|
1173
1173
|
content: {
|
|
1174
|
-
"application/json": components["schemas"]["User"];
|
|
1174
|
+
"application/json": components$1["schemas"]["User"];
|
|
1175
1175
|
};
|
|
1176
1176
|
};
|
|
1177
|
-
400: components["responses"]["BadRequest"];
|
|
1178
|
-
500: components["responses"]["InternalServerError"];
|
|
1177
|
+
400: components$1["responses"]["BadRequest"];
|
|
1178
|
+
500: components$1["responses"]["InternalServerError"];
|
|
1179
1179
|
};
|
|
1180
1180
|
};
|
|
1181
1181
|
getUser: {
|
|
@@ -1196,11 +1196,11 @@ interface operations {
|
|
|
1196
1196
|
[name: string]: unknown;
|
|
1197
1197
|
};
|
|
1198
1198
|
content: {
|
|
1199
|
-
"application/json": components["schemas"]["User"];
|
|
1199
|
+
"application/json": components$1["schemas"]["User"];
|
|
1200
1200
|
};
|
|
1201
1201
|
};
|
|
1202
|
-
404: components["responses"]["NotFound"];
|
|
1203
|
-
500: components["responses"]["InternalServerError"];
|
|
1202
|
+
404: components$1["responses"]["NotFound"];
|
|
1203
|
+
500: components$1["responses"]["InternalServerError"];
|
|
1204
1204
|
};
|
|
1205
1205
|
};
|
|
1206
1206
|
updateUser: {
|
|
@@ -1216,7 +1216,7 @@ interface operations {
|
|
|
1216
1216
|
/** @description The request body to update a user */
|
|
1217
1217
|
requestBody: {
|
|
1218
1218
|
content: {
|
|
1219
|
-
"application/json": components["schemas"]["UpdateUserPayload"];
|
|
1219
|
+
"application/json": components$1["schemas"]["UpdateUserPayload"];
|
|
1220
1220
|
};
|
|
1221
1221
|
};
|
|
1222
1222
|
responses: {
|
|
@@ -1226,19 +1226,168 @@ interface operations {
|
|
|
1226
1226
|
[name: string]: unknown;
|
|
1227
1227
|
};
|
|
1228
1228
|
content: {
|
|
1229
|
-
"application/json": components["schemas"]["User"];
|
|
1229
|
+
"application/json": components$1["schemas"]["User"];
|
|
1230
|
+
};
|
|
1231
|
+
};
|
|
1232
|
+
400: components$1["responses"]["BadRequest"];
|
|
1233
|
+
404: components$1["responses"]["NotFound"];
|
|
1234
|
+
500: components$1["responses"]["InternalServerError"];
|
|
1235
|
+
};
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* This file was auto-generated by openapi-typescript.
|
|
1241
|
+
* Do not make direct changes to the file.
|
|
1242
|
+
*/
|
|
1243
|
+
interface paths {
|
|
1244
|
+
"/images": {
|
|
1245
|
+
parameters: {
|
|
1246
|
+
query?: never;
|
|
1247
|
+
header?: never;
|
|
1248
|
+
path?: never;
|
|
1249
|
+
cookie?: never;
|
|
1250
|
+
};
|
|
1251
|
+
get?: never;
|
|
1252
|
+
/** @description Uploads an image */
|
|
1253
|
+
put: operations["uploadImage"];
|
|
1254
|
+
post?: never;
|
|
1255
|
+
/** @description Deletes an image */
|
|
1256
|
+
delete: operations["deleteImage"];
|
|
1257
|
+
options?: never;
|
|
1258
|
+
head?: never;
|
|
1259
|
+
patch?: never;
|
|
1260
|
+
trace?: never;
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
interface components {
|
|
1264
|
+
schemas: {
|
|
1265
|
+
/** @description Payload to upload an image */
|
|
1266
|
+
UploadImagePayload: {
|
|
1267
|
+
/** Format: binary */
|
|
1268
|
+
file: string;
|
|
1269
|
+
type: components["schemas"]["ImageType"];
|
|
1270
|
+
};
|
|
1271
|
+
/** @description Response from uploading an image */
|
|
1272
|
+
UploadImageResponse: {
|
|
1273
|
+
/** @example https://bucket.s3.region.amazonaws.com/key */
|
|
1274
|
+
url: string;
|
|
1275
|
+
};
|
|
1276
|
+
DeleteImagePayload: {
|
|
1277
|
+
/** @example https://bucket.s3.region.amazonaws.com/key */
|
|
1278
|
+
url: string;
|
|
1279
|
+
};
|
|
1280
|
+
/** @description A generic error */
|
|
1281
|
+
Error: {
|
|
1282
|
+
/**
|
|
1283
|
+
* Format: int64
|
|
1284
|
+
* @example 500
|
|
1285
|
+
*/
|
|
1286
|
+
status: number;
|
|
1287
|
+
/** @example ERROR */
|
|
1288
|
+
code: components["schemas"]["ErrorCode"];
|
|
1289
|
+
/** @example Error */
|
|
1290
|
+
message: string;
|
|
1291
|
+
};
|
|
1292
|
+
/** @enum {string} */
|
|
1293
|
+
ErrorCode: "ERROR";
|
|
1294
|
+
/** @enum {string} */
|
|
1295
|
+
ImageType: "USER_IMAGE";
|
|
1296
|
+
};
|
|
1297
|
+
responses: {
|
|
1298
|
+
/** @description No content */
|
|
1299
|
+
NoContent: {
|
|
1300
|
+
headers: {
|
|
1301
|
+
[name: string]: unknown;
|
|
1302
|
+
};
|
|
1303
|
+
content?: never;
|
|
1304
|
+
};
|
|
1305
|
+
/** @description Invalid request payload */
|
|
1306
|
+
BadRequest: {
|
|
1307
|
+
headers: {
|
|
1308
|
+
[name: string]: unknown;
|
|
1309
|
+
};
|
|
1310
|
+
content: {
|
|
1311
|
+
"application/json": components["schemas"]["Error"];
|
|
1312
|
+
};
|
|
1313
|
+
};
|
|
1314
|
+
/** @description The resource was not found */
|
|
1315
|
+
NotFound: {
|
|
1316
|
+
headers: {
|
|
1317
|
+
[name: string]: unknown;
|
|
1318
|
+
};
|
|
1319
|
+
content: {
|
|
1320
|
+
"application/json": components["schemas"]["Error"];
|
|
1321
|
+
};
|
|
1322
|
+
};
|
|
1323
|
+
/** @description There was an internal server error */
|
|
1324
|
+
InternalServerError: {
|
|
1325
|
+
headers: {
|
|
1326
|
+
[name: string]: unknown;
|
|
1327
|
+
};
|
|
1328
|
+
content: {
|
|
1329
|
+
"application/json": components["schemas"]["Error"];
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
};
|
|
1333
|
+
parameters: never;
|
|
1334
|
+
requestBodies: never;
|
|
1335
|
+
headers: never;
|
|
1336
|
+
pathItems: never;
|
|
1337
|
+
}
|
|
1338
|
+
interface operations {
|
|
1339
|
+
uploadImage: {
|
|
1340
|
+
parameters: {
|
|
1341
|
+
query?: never;
|
|
1342
|
+
header?: never;
|
|
1343
|
+
path?: never;
|
|
1344
|
+
cookie?: never;
|
|
1345
|
+
};
|
|
1346
|
+
/** @description The request body to upload an image */
|
|
1347
|
+
requestBody: {
|
|
1348
|
+
content: {
|
|
1349
|
+
"multipart/form-data": components["schemas"]["UploadImagePayload"];
|
|
1350
|
+
};
|
|
1351
|
+
};
|
|
1352
|
+
responses: {
|
|
1353
|
+
/** @description Success */
|
|
1354
|
+
200: {
|
|
1355
|
+
headers: {
|
|
1356
|
+
[name: string]: unknown;
|
|
1357
|
+
};
|
|
1358
|
+
content: {
|
|
1359
|
+
"application/json": components["schemas"]["UploadImageResponse"];
|
|
1230
1360
|
};
|
|
1231
1361
|
};
|
|
1232
1362
|
400: components["responses"]["BadRequest"];
|
|
1363
|
+
500: components["responses"]["InternalServerError"];
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
deleteImage: {
|
|
1367
|
+
parameters: {
|
|
1368
|
+
query?: never;
|
|
1369
|
+
header?: never;
|
|
1370
|
+
path?: never;
|
|
1371
|
+
cookie?: never;
|
|
1372
|
+
};
|
|
1373
|
+
/** @description The request body to delete an image */
|
|
1374
|
+
requestBody: {
|
|
1375
|
+
content: {
|
|
1376
|
+
"application/json": components["schemas"]["DeleteImagePayload"];
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
responses: {
|
|
1380
|
+
204: components["responses"]["NoContent"];
|
|
1233
1381
|
404: components["responses"]["NotFound"];
|
|
1234
1382
|
500: components["responses"]["InternalServerError"];
|
|
1235
1383
|
};
|
|
1236
1384
|
};
|
|
1237
1385
|
}
|
|
1238
1386
|
|
|
1239
|
-
declare const createMarketServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$
|
|
1240
|
-
declare const createTradeServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$
|
|
1241
|
-
declare const createUserServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
1387
|
+
declare const createMarketServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$3, `${string}/${string}`>;
|
|
1388
|
+
declare const createTradeServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$2, `${string}/${string}`>;
|
|
1389
|
+
declare const createUserServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$1, `${string}/${string}`>;
|
|
1390
|
+
declare const createAssetServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
1242
1391
|
|
|
1243
1392
|
declare const isMarketServiceError: (error: unknown) => error is {
|
|
1244
1393
|
status: number;
|
|
@@ -1255,10 +1404,16 @@ declare const isUserServiceError: (error: unknown) => error is {
|
|
|
1255
1404
|
code: "ERROR";
|
|
1256
1405
|
message: string;
|
|
1257
1406
|
};
|
|
1407
|
+
declare const isAssetServiceError: (error: unknown) => error is {
|
|
1408
|
+
status: number;
|
|
1409
|
+
code: "ERROR";
|
|
1410
|
+
message: string;
|
|
1411
|
+
};
|
|
1258
1412
|
|
|
1259
|
-
type MarketServiceSchemas = components$
|
|
1260
|
-
type TradeServiceSchemas = components$
|
|
1261
|
-
type UserServiceSchemas = components['schemas'];
|
|
1413
|
+
type MarketServiceSchemas = components$3['schemas'];
|
|
1414
|
+
type TradeServiceSchemas = components$2['schemas'];
|
|
1415
|
+
type UserServiceSchemas = components$1['schemas'];
|
|
1416
|
+
type AssetServiceSchemas = components['schemas'];
|
|
1262
1417
|
type SimpleQuote = MarketServiceSchemas['SimpleQuote'];
|
|
1263
1418
|
type FullQuote = MarketServiceSchemas['FullQuote'];
|
|
1264
1419
|
type NewsArticle = MarketServiceSchemas['NewsArticle'];
|
|
@@ -1277,5 +1432,7 @@ type User = UserServiceSchemas['User'];
|
|
|
1277
1432
|
type AddUserPayload = UserServiceSchemas['AddUserPayload'];
|
|
1278
1433
|
type UpdateUserPayload = UserServiceSchemas['UpdateUserPayload'];
|
|
1279
1434
|
type UserServiceError = UserServiceSchemas['Error'];
|
|
1435
|
+
type AssetServiceError = AssetServiceSchemas['Error'];
|
|
1436
|
+
type ImageType = AssetServiceSchemas['ImageType'];
|
|
1280
1437
|
|
|
1281
|
-
export { type AddOrderPayload, type AddUserPayload, type FullQuote, type Holding, type MarketServiceError, type NewsArticle, type Order, type OrderType, type Portfolio, type PortfolioType, type SimpleQuote, type StockHistoryEntry, type StockHistoryTimeframe, type StockNewsArticle, type TradeServiceError, type UpdateUserPayload, type User, type UserServiceError, createMarketServiceClient, createTradeServiceClient, createUserServiceClient, isMarketServiceError, isTradeServiceError, isUserServiceError };
|
|
1438
|
+
export { type AddOrderPayload, type AddUserPayload, type AssetServiceError, type FullQuote, type Holding, type ImageType, type MarketServiceError, type NewsArticle, type Order, type OrderType, type Portfolio, type PortfolioType, type SimpleQuote, type StockHistoryEntry, type StockHistoryTimeframe, type StockNewsArticle, type TradeServiceError, type UpdateUserPayload, type User, type UserServiceError, createAssetServiceClient, createMarketServiceClient, createTradeServiceClient, createUserServiceClient, isAssetServiceError, isMarketServiceError, isTradeServiceError, isUserServiceError };
|
package/dist/index.esm.js
CHANGED
|
@@ -488,9 +488,11 @@ function mergeHeaders(...allHeaders) {
|
|
|
488
488
|
const createMarketServiceClient = (options) => createClient(options);
|
|
489
489
|
const createTradeServiceClient = (options) => createClient(options);
|
|
490
490
|
const createUserServiceClient = (options) => createClient(options);
|
|
491
|
+
const createAssetServiceClient = (options) => createClient(options);
|
|
491
492
|
|
|
492
493
|
const isMarketServiceError = (error) => typeof error === 'object';
|
|
493
494
|
const isTradeServiceError = (error) => typeof error === 'object';
|
|
494
495
|
const isUserServiceError = (error) => typeof error === 'object';
|
|
496
|
+
const isAssetServiceError = (error) => typeof error === 'object';
|
|
495
497
|
|
|
496
|
-
export { createMarketServiceClient, createTradeServiceClient, createUserServiceClient, isMarketServiceError, isTradeServiceError, isUserServiceError };
|
|
498
|
+
export { createAssetServiceClient, createMarketServiceClient, createTradeServiceClient, createUserServiceClient, isAssetServiceError, isMarketServiceError, isTradeServiceError, isUserServiceError };
|
package/package.json
CHANGED
package/redocly.yaml
CHANGED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
openapi: 3.0.0
|
|
2
|
+
|
|
3
|
+
info:
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
title: Dream Trade Asset Service
|
|
6
|
+
description: Manage assets across services.
|
|
7
|
+
servers:
|
|
8
|
+
- url: http://localhost:8085/v1
|
|
9
|
+
|
|
10
|
+
paths:
|
|
11
|
+
/images:
|
|
12
|
+
put:
|
|
13
|
+
description: Uploads an image
|
|
14
|
+
operationId: uploadImage
|
|
15
|
+
tags:
|
|
16
|
+
- Images
|
|
17
|
+
requestBody:
|
|
18
|
+
description: The request body to upload an image
|
|
19
|
+
required: true
|
|
20
|
+
content:
|
|
21
|
+
multipart/form-data:
|
|
22
|
+
schema:
|
|
23
|
+
$ref: '#/components/schemas/UploadImagePayload'
|
|
24
|
+
responses:
|
|
25
|
+
200:
|
|
26
|
+
description: Success
|
|
27
|
+
content:
|
|
28
|
+
application/json:
|
|
29
|
+
schema:
|
|
30
|
+
$ref: '#/components/schemas/UploadImageResponse'
|
|
31
|
+
400:
|
|
32
|
+
$ref: '#/components/responses/BadRequest'
|
|
33
|
+
500:
|
|
34
|
+
$ref: '#/components/responses/InternalServerError'
|
|
35
|
+
delete:
|
|
36
|
+
description: Deletes an image
|
|
37
|
+
operationId: deleteImage
|
|
38
|
+
tags:
|
|
39
|
+
- Images
|
|
40
|
+
requestBody:
|
|
41
|
+
description: The request body to delete an image
|
|
42
|
+
required: true
|
|
43
|
+
content:
|
|
44
|
+
application/json:
|
|
45
|
+
schema:
|
|
46
|
+
$ref: '#/components/schemas/DeleteImagePayload'
|
|
47
|
+
responses:
|
|
48
|
+
204:
|
|
49
|
+
$ref: '#/components/responses/NoContent'
|
|
50
|
+
404:
|
|
51
|
+
$ref: '#/components/responses/NotFound'
|
|
52
|
+
500:
|
|
53
|
+
$ref: '#/components/responses/InternalServerError'
|
|
54
|
+
|
|
55
|
+
components:
|
|
56
|
+
schemas:
|
|
57
|
+
UploadImagePayload:
|
|
58
|
+
description: Payload to upload an image
|
|
59
|
+
type: object
|
|
60
|
+
properties:
|
|
61
|
+
file:
|
|
62
|
+
type: string
|
|
63
|
+
format: binary
|
|
64
|
+
type:
|
|
65
|
+
$ref: '#/components/schemas/ImageType'
|
|
66
|
+
required:
|
|
67
|
+
- file
|
|
68
|
+
- type
|
|
69
|
+
|
|
70
|
+
UploadImageResponse:
|
|
71
|
+
description: Response from uploading an image
|
|
72
|
+
type: object
|
|
73
|
+
properties:
|
|
74
|
+
url:
|
|
75
|
+
type: string
|
|
76
|
+
example: https://bucket.s3.region.amazonaws.com/key
|
|
77
|
+
required:
|
|
78
|
+
- url
|
|
79
|
+
|
|
80
|
+
DeleteImagePayload:
|
|
81
|
+
type: object
|
|
82
|
+
properties:
|
|
83
|
+
url:
|
|
84
|
+
type: string
|
|
85
|
+
example: https://bucket.s3.region.amazonaws.com/key
|
|
86
|
+
required:
|
|
87
|
+
- url
|
|
88
|
+
|
|
89
|
+
Error:
|
|
90
|
+
description: A generic error
|
|
91
|
+
properties:
|
|
92
|
+
status:
|
|
93
|
+
type: integer
|
|
94
|
+
format: int64
|
|
95
|
+
example: 500
|
|
96
|
+
code:
|
|
97
|
+
$ref: '#/components/schemas/ErrorCode'
|
|
98
|
+
example: ERROR
|
|
99
|
+
message:
|
|
100
|
+
type: string
|
|
101
|
+
example: Error
|
|
102
|
+
required:
|
|
103
|
+
- status
|
|
104
|
+
- code
|
|
105
|
+
- message
|
|
106
|
+
|
|
107
|
+
ErrorCode:
|
|
108
|
+
type: string
|
|
109
|
+
enum:
|
|
110
|
+
- ERROR
|
|
111
|
+
|
|
112
|
+
ImageType:
|
|
113
|
+
type: string
|
|
114
|
+
enum:
|
|
115
|
+
- USER_IMAGE
|
|
116
|
+
|
|
117
|
+
responses:
|
|
118
|
+
NoContent:
|
|
119
|
+
description: No content
|
|
120
|
+
|
|
121
|
+
BadRequest:
|
|
122
|
+
description: Invalid request payload
|
|
123
|
+
content:
|
|
124
|
+
application/json:
|
|
125
|
+
schema:
|
|
126
|
+
$ref: '#/components/schemas/Error'
|
|
127
|
+
|
|
128
|
+
NotFound:
|
|
129
|
+
description: The resource was not found
|
|
130
|
+
content:
|
|
131
|
+
application/json:
|
|
132
|
+
schema:
|
|
133
|
+
$ref: '#/components/schemas/Error'
|
|
134
|
+
|
|
135
|
+
InternalServerError:
|
|
136
|
+
description: There was an internal server error
|
|
137
|
+
content:
|
|
138
|
+
application/json:
|
|
139
|
+
schema:
|
|
140
|
+
$ref: '#/components/schemas/Error'
|
package/ts/clients/clients.ts
CHANGED
|
@@ -3,6 +3,7 @@ import createClient, { ClientOptions } from 'openapi-fetch';
|
|
|
3
3
|
import { paths as MarketServicePaths } from '@ts/services/dt-market-service';
|
|
4
4
|
import { paths as TradeServicePaths } from '@ts/services/dt-trade-service';
|
|
5
5
|
import { paths as UserServicePaths } from '@ts/services/dt-user-service';
|
|
6
|
+
import { paths as AssetServicePaths } from '@ts/services/dt-asset-service';
|
|
6
7
|
|
|
7
8
|
export const createMarketServiceClient = (options: ClientOptions) =>
|
|
8
9
|
createClient<MarketServicePaths>(options);
|
|
@@ -12,3 +13,6 @@ export const createTradeServiceClient = (options: ClientOptions) =>
|
|
|
12
13
|
|
|
13
14
|
export const createUserServiceClient = (options: ClientOptions) =>
|
|
14
15
|
createClient<UserServicePaths>(options);
|
|
16
|
+
|
|
17
|
+
export const createAssetServiceClient = (options: ClientOptions) =>
|
|
18
|
+
createClient<AssetServicePaths>(options);
|
package/ts/clients/errors.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
MarketServiceError,
|
|
3
|
+
TradeServiceError,
|
|
4
|
+
UserServiceError,
|
|
5
|
+
AssetServiceError,
|
|
6
|
+
} from '@ts/types';
|
|
2
7
|
|
|
3
8
|
export const isMarketServiceError = (error: unknown): error is MarketServiceError =>
|
|
4
9
|
typeof error === 'object';
|
|
@@ -8,3 +13,6 @@ export const isTradeServiceError = (error: unknown): error is TradeServiceError
|
|
|
8
13
|
|
|
9
14
|
export const isUserServiceError = (error: unknown): error is UserServiceError =>
|
|
10
15
|
typeof error === 'object';
|
|
16
|
+
|
|
17
|
+
export const isAssetServiceError = (error: unknown): error is AssetServiceError =>
|
|
18
|
+
typeof error === 'object';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface paths {
|
|
7
|
+
"/images": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
get?: never;
|
|
15
|
+
/** @description Uploads an image */
|
|
16
|
+
put: operations["uploadImage"];
|
|
17
|
+
post?: never;
|
|
18
|
+
/** @description Deletes an image */
|
|
19
|
+
delete: operations["deleteImage"];
|
|
20
|
+
options?: never;
|
|
21
|
+
head?: never;
|
|
22
|
+
patch?: never;
|
|
23
|
+
trace?: never;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export type webhooks = Record<string, never>;
|
|
27
|
+
export interface components {
|
|
28
|
+
schemas: {
|
|
29
|
+
/** @description Payload to upload an image */
|
|
30
|
+
UploadImagePayload: {
|
|
31
|
+
/** Format: binary */
|
|
32
|
+
file: string;
|
|
33
|
+
type: components["schemas"]["ImageType"];
|
|
34
|
+
};
|
|
35
|
+
/** @description Response from uploading an image */
|
|
36
|
+
UploadImageResponse: {
|
|
37
|
+
/** @example https://bucket.s3.region.amazonaws.com/key */
|
|
38
|
+
url: string;
|
|
39
|
+
};
|
|
40
|
+
DeleteImagePayload: {
|
|
41
|
+
/** @example https://bucket.s3.region.amazonaws.com/key */
|
|
42
|
+
url: string;
|
|
43
|
+
};
|
|
44
|
+
/** @description A generic error */
|
|
45
|
+
Error: {
|
|
46
|
+
/**
|
|
47
|
+
* Format: int64
|
|
48
|
+
* @example 500
|
|
49
|
+
*/
|
|
50
|
+
status: number;
|
|
51
|
+
/** @example ERROR */
|
|
52
|
+
code: components["schemas"]["ErrorCode"];
|
|
53
|
+
/** @example Error */
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
/** @enum {string} */
|
|
57
|
+
ErrorCode: "ERROR";
|
|
58
|
+
/** @enum {string} */
|
|
59
|
+
ImageType: "USER_IMAGE";
|
|
60
|
+
};
|
|
61
|
+
responses: {
|
|
62
|
+
/** @description No content */
|
|
63
|
+
NoContent: {
|
|
64
|
+
headers: {
|
|
65
|
+
[name: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
content?: never;
|
|
68
|
+
};
|
|
69
|
+
/** @description Invalid request payload */
|
|
70
|
+
BadRequest: {
|
|
71
|
+
headers: {
|
|
72
|
+
[name: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
content: {
|
|
75
|
+
"application/json": components["schemas"]["Error"];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/** @description The resource was not found */
|
|
79
|
+
NotFound: {
|
|
80
|
+
headers: {
|
|
81
|
+
[name: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
content: {
|
|
84
|
+
"application/json": components["schemas"]["Error"];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** @description There was an internal server error */
|
|
88
|
+
InternalServerError: {
|
|
89
|
+
headers: {
|
|
90
|
+
[name: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
content: {
|
|
93
|
+
"application/json": components["schemas"]["Error"];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
parameters: never;
|
|
98
|
+
requestBodies: never;
|
|
99
|
+
headers: never;
|
|
100
|
+
pathItems: never;
|
|
101
|
+
}
|
|
102
|
+
export type $defs = Record<string, never>;
|
|
103
|
+
export interface operations {
|
|
104
|
+
uploadImage: {
|
|
105
|
+
parameters: {
|
|
106
|
+
query?: never;
|
|
107
|
+
header?: never;
|
|
108
|
+
path?: never;
|
|
109
|
+
cookie?: never;
|
|
110
|
+
};
|
|
111
|
+
/** @description The request body to upload an image */
|
|
112
|
+
requestBody: {
|
|
113
|
+
content: {
|
|
114
|
+
"multipart/form-data": components["schemas"]["UploadImagePayload"];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
responses: {
|
|
118
|
+
/** @description Success */
|
|
119
|
+
200: {
|
|
120
|
+
headers: {
|
|
121
|
+
[name: string]: unknown;
|
|
122
|
+
};
|
|
123
|
+
content: {
|
|
124
|
+
"application/json": components["schemas"]["UploadImageResponse"];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
400: components["responses"]["BadRequest"];
|
|
128
|
+
500: components["responses"]["InternalServerError"];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
deleteImage: {
|
|
132
|
+
parameters: {
|
|
133
|
+
query?: never;
|
|
134
|
+
header?: never;
|
|
135
|
+
path?: never;
|
|
136
|
+
cookie?: never;
|
|
137
|
+
};
|
|
138
|
+
/** @description The request body to delete an image */
|
|
139
|
+
requestBody: {
|
|
140
|
+
content: {
|
|
141
|
+
"application/json": components["schemas"]["DeleteImagePayload"];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
responses: {
|
|
145
|
+
204: components["responses"]["NoContent"];
|
|
146
|
+
404: components["responses"]["NotFound"];
|
|
147
|
+
500: components["responses"]["InternalServerError"];
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
}
|
package/ts/types/types.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { components as MarketServiceComponents } from '@ts/services/dt-market-service';
|
|
2
2
|
import { components as TradeServiceComponents } from '@ts/services/dt-trade-service';
|
|
3
3
|
import { components as UserServiceComponents } from '@ts/services/dt-user-service';
|
|
4
|
+
import { components as AssetServiceComponents } from '@ts/services/dt-asset-service';
|
|
4
5
|
|
|
5
6
|
type MarketServiceSchemas = MarketServiceComponents['schemas'];
|
|
6
7
|
type TradeServiceSchemas = TradeServiceComponents['schemas'];
|
|
7
8
|
type UserServiceSchemas = UserServiceComponents['schemas'];
|
|
9
|
+
type AssetServiceSchemas = AssetServiceComponents['schemas'];
|
|
8
10
|
|
|
9
11
|
// Market Service Types
|
|
10
12
|
export type SimpleQuote = MarketServiceSchemas['SimpleQuote'];
|
|
@@ -29,3 +31,7 @@ export type User = UserServiceSchemas['User'];
|
|
|
29
31
|
export type AddUserPayload = UserServiceSchemas['AddUserPayload'];
|
|
30
32
|
export type UpdateUserPayload = UserServiceSchemas['UpdateUserPayload'];
|
|
31
33
|
export type UserServiceError = UserServiceSchemas['Error'];
|
|
34
|
+
|
|
35
|
+
// Asset Service Types
|
|
36
|
+
export type AssetServiceError = AssetServiceSchemas['Error'];
|
|
37
|
+
export type ImageType = AssetServiceSchemas['ImageType'];
|