@rivascva/dt-idl 1.1.37 → 1.1.39
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 -4
- package/dist/index.d.ts +8 -219
- package/dist/index.esm.js +3 -3
- package/package.json +1 -1
- package/redocly.yaml +3 -3
- package/services/dt-trade-service.yaml +0 -178
- package/services/{dt-app-service.yaml → dt-user-service.yaml} +2 -3
- package/ts/clients/clients.ts +3 -3
- package/ts/clients/errors.ts +2 -2
- package/ts/services/dt-trade-service.ts +0 -211
- package/ts/types/types.ts +7 -7
- /package/ts/services/{dt-app-service.ts → dt-user-service.ts} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -489,15 +489,15 @@ function mergeHeaders(...allHeaders) {
|
|
|
489
489
|
|
|
490
490
|
const createMarketServiceClient = (options) => createClient(options);
|
|
491
491
|
const createTradeServiceClient = (options) => createClient(options);
|
|
492
|
-
const
|
|
492
|
+
const createUserServiceClient = (options) => createClient(options);
|
|
493
493
|
|
|
494
494
|
const isMarketServiceError = (error) => typeof error === 'object';
|
|
495
495
|
const isTradeServiceError = (error) => typeof error === 'object';
|
|
496
|
-
const
|
|
496
|
+
const isUserServiceError = (error) => typeof error === 'object';
|
|
497
497
|
|
|
498
|
-
exports.createAppServiceClient = createAppServiceClient;
|
|
499
498
|
exports.createMarketServiceClient = createMarketServiceClient;
|
|
500
499
|
exports.createTradeServiceClient = createTradeServiceClient;
|
|
501
|
-
exports.
|
|
500
|
+
exports.createUserServiceClient = createUserServiceClient;
|
|
502
501
|
exports.isMarketServiceError = isMarketServiceError;
|
|
503
502
|
exports.isTradeServiceError = isTradeServiceError;
|
|
503
|
+
exports.isUserServiceError = isUserServiceError;
|
package/dist/index.d.ts
CHANGED
|
@@ -617,59 +617,6 @@ interface operations$2 {
|
|
|
617
617
|
* Do not make direct changes to the file.
|
|
618
618
|
*/
|
|
619
619
|
interface paths$1 {
|
|
620
|
-
"/users": {
|
|
621
|
-
parameters: {
|
|
622
|
-
query?: never;
|
|
623
|
-
header?: never;
|
|
624
|
-
path?: never;
|
|
625
|
-
cookie?: never;
|
|
626
|
-
};
|
|
627
|
-
/** @description Gets all users */
|
|
628
|
-
get: operations$1["getUsers"];
|
|
629
|
-
put?: never;
|
|
630
|
-
/** @description Adds a new user */
|
|
631
|
-
post: operations$1["addUser"];
|
|
632
|
-
delete?: never;
|
|
633
|
-
options?: never;
|
|
634
|
-
head?: never;
|
|
635
|
-
patch?: never;
|
|
636
|
-
trace?: never;
|
|
637
|
-
};
|
|
638
|
-
"/users/{userId}": {
|
|
639
|
-
parameters: {
|
|
640
|
-
query?: never;
|
|
641
|
-
header?: never;
|
|
642
|
-
path?: never;
|
|
643
|
-
cookie?: never;
|
|
644
|
-
};
|
|
645
|
-
/** @description Gets a user */
|
|
646
|
-
get: operations$1["getUser"];
|
|
647
|
-
/** @description Updates an existing user */
|
|
648
|
-
put: operations$1["updateUser"];
|
|
649
|
-
post?: never;
|
|
650
|
-
delete?: never;
|
|
651
|
-
options?: never;
|
|
652
|
-
head?: never;
|
|
653
|
-
patch?: never;
|
|
654
|
-
trace?: never;
|
|
655
|
-
};
|
|
656
|
-
"/users/{userId}/portfolios": {
|
|
657
|
-
parameters: {
|
|
658
|
-
query?: never;
|
|
659
|
-
header?: never;
|
|
660
|
-
path?: never;
|
|
661
|
-
cookie?: never;
|
|
662
|
-
};
|
|
663
|
-
/** @description Gets all portfolios of a user */
|
|
664
|
-
get: operations$1["getUserPortfolios"];
|
|
665
|
-
put?: never;
|
|
666
|
-
post?: never;
|
|
667
|
-
delete?: never;
|
|
668
|
-
options?: never;
|
|
669
|
-
head?: never;
|
|
670
|
-
patch?: never;
|
|
671
|
-
trace?: never;
|
|
672
|
-
};
|
|
673
620
|
"/portfolios": {
|
|
674
621
|
parameters: {
|
|
675
622
|
query?: never;
|
|
@@ -758,34 +705,6 @@ interface paths$1 {
|
|
|
758
705
|
}
|
|
759
706
|
interface components$1 {
|
|
760
707
|
schemas: {
|
|
761
|
-
/** @description Payload to add a new user */
|
|
762
|
-
AddUserPayload: {
|
|
763
|
-
/** @example sam.smith@example.com */
|
|
764
|
-
email: string;
|
|
765
|
-
/** @example Sam Smith */
|
|
766
|
-
name: string;
|
|
767
|
-
/** @example USA */
|
|
768
|
-
country: string;
|
|
769
|
-
/** @example https://www.assets.com/image.png */
|
|
770
|
-
imageUrl?: string;
|
|
771
|
-
};
|
|
772
|
-
/** @description Payload to update an existing user */
|
|
773
|
-
UpdateUserPayload: components$1["schemas"]["AddUserPayload"];
|
|
774
|
-
/** @description A user */
|
|
775
|
-
User: components$1["schemas"]["AddUserPayload"] & {
|
|
776
|
-
/** @example 123456 */
|
|
777
|
-
id: string;
|
|
778
|
-
/**
|
|
779
|
-
* Format: int64
|
|
780
|
-
* @example 1713398544000
|
|
781
|
-
*/
|
|
782
|
-
dateCreated: number;
|
|
783
|
-
/**
|
|
784
|
-
* Format: int64
|
|
785
|
-
* @example 1713398544000
|
|
786
|
-
*/
|
|
787
|
-
dateUpdated: number;
|
|
788
|
-
};
|
|
789
708
|
/** @description Payload to add a new portfolio */
|
|
790
709
|
AddPortfolioPayload: {
|
|
791
710
|
/** @example 123456 */
|
|
@@ -949,136 +868,6 @@ interface components$1 {
|
|
|
949
868
|
pathItems: never;
|
|
950
869
|
}
|
|
951
870
|
interface operations$1 {
|
|
952
|
-
getUsers: {
|
|
953
|
-
parameters: {
|
|
954
|
-
query?: never;
|
|
955
|
-
header?: never;
|
|
956
|
-
path?: never;
|
|
957
|
-
cookie?: never;
|
|
958
|
-
};
|
|
959
|
-
requestBody?: never;
|
|
960
|
-
responses: {
|
|
961
|
-
/** @description Success */
|
|
962
|
-
200: {
|
|
963
|
-
headers: {
|
|
964
|
-
[name: string]: unknown;
|
|
965
|
-
};
|
|
966
|
-
content: {
|
|
967
|
-
"application/json": components$1["schemas"]["User"][];
|
|
968
|
-
};
|
|
969
|
-
};
|
|
970
|
-
404: components$1["responses"]["NotFound"];
|
|
971
|
-
500: components$1["responses"]["InternalServerError"];
|
|
972
|
-
};
|
|
973
|
-
};
|
|
974
|
-
addUser: {
|
|
975
|
-
parameters: {
|
|
976
|
-
query?: never;
|
|
977
|
-
header?: never;
|
|
978
|
-
path?: never;
|
|
979
|
-
cookie?: never;
|
|
980
|
-
};
|
|
981
|
-
/** @description The request body to add a user */
|
|
982
|
-
requestBody: {
|
|
983
|
-
content: {
|
|
984
|
-
"application/json": components$1["schemas"]["AddUserPayload"];
|
|
985
|
-
};
|
|
986
|
-
};
|
|
987
|
-
responses: {
|
|
988
|
-
/** @description Added */
|
|
989
|
-
201: {
|
|
990
|
-
headers: {
|
|
991
|
-
[name: string]: unknown;
|
|
992
|
-
};
|
|
993
|
-
content: {
|
|
994
|
-
"application/json": components$1["schemas"]["User"];
|
|
995
|
-
};
|
|
996
|
-
};
|
|
997
|
-
400: components$1["responses"]["BadRequest"];
|
|
998
|
-
500: components$1["responses"]["InternalServerError"];
|
|
999
|
-
};
|
|
1000
|
-
};
|
|
1001
|
-
getUser: {
|
|
1002
|
-
parameters: {
|
|
1003
|
-
query?: never;
|
|
1004
|
-
header?: never;
|
|
1005
|
-
path: {
|
|
1006
|
-
/** @description The user id */
|
|
1007
|
-
userId: string;
|
|
1008
|
-
};
|
|
1009
|
-
cookie?: never;
|
|
1010
|
-
};
|
|
1011
|
-
requestBody?: never;
|
|
1012
|
-
responses: {
|
|
1013
|
-
/** @description Success */
|
|
1014
|
-
200: {
|
|
1015
|
-
headers: {
|
|
1016
|
-
[name: string]: unknown;
|
|
1017
|
-
};
|
|
1018
|
-
content: {
|
|
1019
|
-
"application/json": components$1["schemas"]["User"];
|
|
1020
|
-
};
|
|
1021
|
-
};
|
|
1022
|
-
404: components$1["responses"]["NotFound"];
|
|
1023
|
-
500: components$1["responses"]["InternalServerError"];
|
|
1024
|
-
};
|
|
1025
|
-
};
|
|
1026
|
-
updateUser: {
|
|
1027
|
-
parameters: {
|
|
1028
|
-
query?: never;
|
|
1029
|
-
header?: never;
|
|
1030
|
-
path: {
|
|
1031
|
-
/** @description The user id */
|
|
1032
|
-
userId: string;
|
|
1033
|
-
};
|
|
1034
|
-
cookie?: never;
|
|
1035
|
-
};
|
|
1036
|
-
/** @description The request body to update a user */
|
|
1037
|
-
requestBody: {
|
|
1038
|
-
content: {
|
|
1039
|
-
"application/json": components$1["schemas"]["UpdateUserPayload"];
|
|
1040
|
-
};
|
|
1041
|
-
};
|
|
1042
|
-
responses: {
|
|
1043
|
-
/** @description Success */
|
|
1044
|
-
200: {
|
|
1045
|
-
headers: {
|
|
1046
|
-
[name: string]: unknown;
|
|
1047
|
-
};
|
|
1048
|
-
content: {
|
|
1049
|
-
"application/json": components$1["schemas"]["User"];
|
|
1050
|
-
};
|
|
1051
|
-
};
|
|
1052
|
-
400: components$1["responses"]["BadRequest"];
|
|
1053
|
-
404: components$1["responses"]["NotFound"];
|
|
1054
|
-
500: components$1["responses"]["InternalServerError"];
|
|
1055
|
-
};
|
|
1056
|
-
};
|
|
1057
|
-
getUserPortfolios: {
|
|
1058
|
-
parameters: {
|
|
1059
|
-
query?: never;
|
|
1060
|
-
header?: never;
|
|
1061
|
-
path: {
|
|
1062
|
-
/** @description The user id */
|
|
1063
|
-
userId: string;
|
|
1064
|
-
};
|
|
1065
|
-
cookie?: never;
|
|
1066
|
-
};
|
|
1067
|
-
requestBody?: never;
|
|
1068
|
-
responses: {
|
|
1069
|
-
/** @description Success */
|
|
1070
|
-
200: {
|
|
1071
|
-
headers: {
|
|
1072
|
-
[name: string]: unknown;
|
|
1073
|
-
};
|
|
1074
|
-
content: {
|
|
1075
|
-
"application/json": components$1["schemas"]["Portfolio"][];
|
|
1076
|
-
};
|
|
1077
|
-
};
|
|
1078
|
-
404: components$1["responses"]["NotFound"];
|
|
1079
|
-
500: components$1["responses"]["InternalServerError"];
|
|
1080
|
-
};
|
|
1081
|
-
};
|
|
1082
871
|
addPortfolio: {
|
|
1083
872
|
parameters: {
|
|
1084
873
|
query?: never;
|
|
@@ -1448,7 +1237,7 @@ interface operations {
|
|
|
1448
1237
|
|
|
1449
1238
|
declare const createMarketServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$2, `${string}/${string}`>;
|
|
1450
1239
|
declare const createTradeServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$1, `${string}/${string}`>;
|
|
1451
|
-
declare const
|
|
1240
|
+
declare const createUserServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
1452
1241
|
|
|
1453
1242
|
declare const isMarketServiceError: (error: unknown) => error is {
|
|
1454
1243
|
status: number;
|
|
@@ -1460,7 +1249,7 @@ declare const isTradeServiceError: (error: unknown) => error is {
|
|
|
1460
1249
|
code: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "UNDELETABLE";
|
|
1461
1250
|
message: string;
|
|
1462
1251
|
};
|
|
1463
|
-
declare const
|
|
1252
|
+
declare const isUserServiceError: (error: unknown) => error is {
|
|
1464
1253
|
status: number;
|
|
1465
1254
|
code: "ERROR";
|
|
1466
1255
|
message: string;
|
|
@@ -1468,7 +1257,7 @@ declare const isAppServiceError: (error: unknown) => error is {
|
|
|
1468
1257
|
|
|
1469
1258
|
type MarketServiceSchemas = components$2['schemas'];
|
|
1470
1259
|
type TradeServiceSchemas = components$1['schemas'];
|
|
1471
|
-
type
|
|
1260
|
+
type UserServiceSchemas = components['schemas'];
|
|
1472
1261
|
type SimpleQuote = MarketServiceSchemas['SimpleQuote'];
|
|
1473
1262
|
type FullQuote = MarketServiceSchemas['FullQuote'];
|
|
1474
1263
|
type NewsArticle = MarketServiceSchemas['NewsArticle'];
|
|
@@ -1483,9 +1272,9 @@ type Order = TradeServiceSchemas['Order'];
|
|
|
1483
1272
|
type OrderType = TradeServiceSchemas['OrderType'];
|
|
1484
1273
|
type Holding = TradeServiceSchemas['Holding'];
|
|
1485
1274
|
type TradeServiceError = TradeServiceSchemas['Error'];
|
|
1486
|
-
type User =
|
|
1487
|
-
type AddUserPayload =
|
|
1488
|
-
type UpdateUserPayload =
|
|
1489
|
-
type
|
|
1275
|
+
type User = UserServiceSchemas['User'];
|
|
1276
|
+
type AddUserPayload = UserServiceSchemas['AddUserPayload'];
|
|
1277
|
+
type UpdateUserPayload = UserServiceSchemas['UpdateUserPayload'];
|
|
1278
|
+
type UserServiceError = UserServiceSchemas['Error'];
|
|
1490
1279
|
|
|
1491
|
-
export { type AddOrderPayload, type AddUserPayload, type
|
|
1280
|
+
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 };
|
package/dist/index.esm.js
CHANGED
|
@@ -487,10 +487,10 @@ function mergeHeaders(...allHeaders) {
|
|
|
487
487
|
|
|
488
488
|
const createMarketServiceClient = (options) => createClient(options);
|
|
489
489
|
const createTradeServiceClient = (options) => createClient(options);
|
|
490
|
-
const
|
|
490
|
+
const createUserServiceClient = (options) => createClient(options);
|
|
491
491
|
|
|
492
492
|
const isMarketServiceError = (error) => typeof error === 'object';
|
|
493
493
|
const isTradeServiceError = (error) => typeof error === 'object';
|
|
494
|
-
const
|
|
494
|
+
const isUserServiceError = (error) => typeof error === 'object';
|
|
495
495
|
|
|
496
|
-
export {
|
|
496
|
+
export { createMarketServiceClient, createTradeServiceClient, createUserServiceClient, isMarketServiceError, isTradeServiceError, isUserServiceError };
|
package/package.json
CHANGED
package/redocly.yaml
CHANGED
|
@@ -7,7 +7,7 @@ apis:
|
|
|
7
7
|
root: ./services/dt-trade-service.yaml
|
|
8
8
|
x-openapi-ts:
|
|
9
9
|
output: ./ts/services/dt-trade-service.ts
|
|
10
|
-
dt-
|
|
11
|
-
root: ./services/dt-
|
|
10
|
+
dt-user-service@v1:
|
|
11
|
+
root: ./services/dt-user-service.yaml
|
|
12
12
|
x-openapi-ts:
|
|
13
|
-
output: ./ts/services/dt-
|
|
13
|
+
output: ./ts/services/dt-user-service.ts
|
|
@@ -9,137 +9,6 @@ servers:
|
|
|
9
9
|
- url: http://localhost:8083/v1
|
|
10
10
|
|
|
11
11
|
paths:
|
|
12
|
-
/users:
|
|
13
|
-
get:
|
|
14
|
-
description: Gets all users
|
|
15
|
-
operationId: getUsers
|
|
16
|
-
tags:
|
|
17
|
-
- Users
|
|
18
|
-
responses:
|
|
19
|
-
200:
|
|
20
|
-
description: Success
|
|
21
|
-
content:
|
|
22
|
-
application/json:
|
|
23
|
-
schema:
|
|
24
|
-
type: array
|
|
25
|
-
items:
|
|
26
|
-
$ref: '#/components/schemas/User'
|
|
27
|
-
404:
|
|
28
|
-
$ref: '#/components/responses/NotFound'
|
|
29
|
-
500:
|
|
30
|
-
$ref: '#/components/responses/InternalServerError'
|
|
31
|
-
post:
|
|
32
|
-
description: Adds a new user
|
|
33
|
-
operationId: addUser
|
|
34
|
-
tags:
|
|
35
|
-
- Users
|
|
36
|
-
requestBody:
|
|
37
|
-
description: The request body to add a user
|
|
38
|
-
required: true
|
|
39
|
-
content:
|
|
40
|
-
application/json:
|
|
41
|
-
schema:
|
|
42
|
-
$ref: '#/components/schemas/AddUserPayload'
|
|
43
|
-
responses:
|
|
44
|
-
201:
|
|
45
|
-
description: Added
|
|
46
|
-
content:
|
|
47
|
-
application/json:
|
|
48
|
-
schema:
|
|
49
|
-
$ref: '#/components/schemas/User'
|
|
50
|
-
400:
|
|
51
|
-
$ref: '#/components/responses/BadRequest'
|
|
52
|
-
500:
|
|
53
|
-
$ref: '#/components/responses/InternalServerError'
|
|
54
|
-
|
|
55
|
-
/users/{userId}:
|
|
56
|
-
get:
|
|
57
|
-
description: Gets a user
|
|
58
|
-
operationId: getUser
|
|
59
|
-
tags:
|
|
60
|
-
- Users
|
|
61
|
-
parameters:
|
|
62
|
-
- in: path
|
|
63
|
-
name: userId
|
|
64
|
-
description: The user id
|
|
65
|
-
required: true
|
|
66
|
-
schema:
|
|
67
|
-
type: string
|
|
68
|
-
example: 123456
|
|
69
|
-
responses:
|
|
70
|
-
200:
|
|
71
|
-
description: Success
|
|
72
|
-
content:
|
|
73
|
-
application/json:
|
|
74
|
-
schema:
|
|
75
|
-
type: object
|
|
76
|
-
$ref: '#/components/schemas/User'
|
|
77
|
-
404:
|
|
78
|
-
$ref: '#/components/responses/NotFound'
|
|
79
|
-
500:
|
|
80
|
-
$ref: '#/components/responses/InternalServerError'
|
|
81
|
-
put:
|
|
82
|
-
description: Updates an existing user
|
|
83
|
-
operationId: updateUser
|
|
84
|
-
tags:
|
|
85
|
-
- Users
|
|
86
|
-
parameters:
|
|
87
|
-
- in: path
|
|
88
|
-
name: userId
|
|
89
|
-
description: The user id
|
|
90
|
-
required: true
|
|
91
|
-
schema:
|
|
92
|
-
type: string
|
|
93
|
-
example: 123456
|
|
94
|
-
requestBody:
|
|
95
|
-
description: The request body to update a user
|
|
96
|
-
required: true
|
|
97
|
-
content:
|
|
98
|
-
application/json:
|
|
99
|
-
schema:
|
|
100
|
-
$ref: '#/components/schemas/UpdateUserPayload'
|
|
101
|
-
responses:
|
|
102
|
-
200:
|
|
103
|
-
description: Success
|
|
104
|
-
content:
|
|
105
|
-
application/json:
|
|
106
|
-
schema:
|
|
107
|
-
$ref: '#/components/schemas/User'
|
|
108
|
-
400:
|
|
109
|
-
$ref: '#/components/responses/BadRequest'
|
|
110
|
-
404:
|
|
111
|
-
$ref: '#/components/responses/NotFound'
|
|
112
|
-
500:
|
|
113
|
-
$ref: '#/components/responses/InternalServerError'
|
|
114
|
-
|
|
115
|
-
/users/{userId}/portfolios:
|
|
116
|
-
get:
|
|
117
|
-
description: Gets all portfolios of a user
|
|
118
|
-
operationId: getUserPortfolios
|
|
119
|
-
tags:
|
|
120
|
-
- Users
|
|
121
|
-
parameters:
|
|
122
|
-
- in: path
|
|
123
|
-
name: userId
|
|
124
|
-
description: The user id
|
|
125
|
-
required: true
|
|
126
|
-
schema:
|
|
127
|
-
type: string
|
|
128
|
-
example: 123456
|
|
129
|
-
responses:
|
|
130
|
-
200:
|
|
131
|
-
description: Success
|
|
132
|
-
content:
|
|
133
|
-
application/json:
|
|
134
|
-
schema:
|
|
135
|
-
type: array
|
|
136
|
-
items:
|
|
137
|
-
$ref: '#/components/schemas/Portfolio'
|
|
138
|
-
404:
|
|
139
|
-
$ref: '#/components/responses/NotFound'
|
|
140
|
-
500:
|
|
141
|
-
$ref: '#/components/responses/InternalServerError'
|
|
142
|
-
|
|
143
12
|
/portfolios:
|
|
144
13
|
post:
|
|
145
14
|
description: Adds a new portfolio
|
|
@@ -281,53 +150,6 @@ paths:
|
|
|
281
150
|
|
|
282
151
|
components:
|
|
283
152
|
schemas:
|
|
284
|
-
AddUserPayload:
|
|
285
|
-
description: Payload to add a new user
|
|
286
|
-
properties:
|
|
287
|
-
email:
|
|
288
|
-
type: string
|
|
289
|
-
example: sam.smith@example.com
|
|
290
|
-
name:
|
|
291
|
-
type: string
|
|
292
|
-
example: Sam Smith
|
|
293
|
-
country:
|
|
294
|
-
type: string
|
|
295
|
-
example: USA
|
|
296
|
-
imageUrl:
|
|
297
|
-
type: string
|
|
298
|
-
example: https://www.assets.com/image.png
|
|
299
|
-
required:
|
|
300
|
-
- email
|
|
301
|
-
- name
|
|
302
|
-
- country
|
|
303
|
-
|
|
304
|
-
UpdateUserPayload:
|
|
305
|
-
description: Payload to update an existing user
|
|
306
|
-
allOf:
|
|
307
|
-
- $ref: '#/components/schemas/AddUserPayload'
|
|
308
|
-
|
|
309
|
-
User:
|
|
310
|
-
description: A user
|
|
311
|
-
allOf:
|
|
312
|
-
- $ref: '#/components/schemas/AddUserPayload'
|
|
313
|
-
- type: object
|
|
314
|
-
properties:
|
|
315
|
-
id:
|
|
316
|
-
type: string
|
|
317
|
-
example: 123456
|
|
318
|
-
dateCreated:
|
|
319
|
-
type: integer
|
|
320
|
-
format: int64
|
|
321
|
-
example: 1713398544000
|
|
322
|
-
dateUpdated:
|
|
323
|
-
type: integer
|
|
324
|
-
format: int64
|
|
325
|
-
example: 1713398544000
|
|
326
|
-
required:
|
|
327
|
-
- id
|
|
328
|
-
- dateCreated
|
|
329
|
-
- dateUpdated
|
|
330
|
-
|
|
331
153
|
AddPortfolioPayload:
|
|
332
154
|
description: Payload to add a new portfolio
|
|
333
155
|
properties:
|
package/ts/clients/clients.ts
CHANGED
|
@@ -2,7 +2,7 @@ import createClient, { ClientOptions } from 'openapi-fetch';
|
|
|
2
2
|
|
|
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
|
-
import { paths as
|
|
5
|
+
import { paths as UserServicePaths } from '@ts/services/dt-user-service';
|
|
6
6
|
|
|
7
7
|
export const createMarketServiceClient = (options: ClientOptions) =>
|
|
8
8
|
createClient<MarketServicePaths>(options);
|
|
@@ -10,5 +10,5 @@ export const createMarketServiceClient = (options: ClientOptions) =>
|
|
|
10
10
|
export const createTradeServiceClient = (options: ClientOptions) =>
|
|
11
11
|
createClient<TradeServicePaths>(options);
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
createClient<
|
|
13
|
+
export const createUserServiceClient = (options: ClientOptions) =>
|
|
14
|
+
createClient<UserServicePaths>(options);
|
package/ts/clients/errors.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarketServiceError, TradeServiceError,
|
|
1
|
+
import { MarketServiceError, TradeServiceError, UserServiceError } from '@ts/types';
|
|
2
2
|
|
|
3
3
|
export const isMarketServiceError = (error: unknown): error is MarketServiceError =>
|
|
4
4
|
typeof error === 'object';
|
|
@@ -6,5 +6,5 @@ export const isMarketServiceError = (error: unknown): error is MarketServiceErro
|
|
|
6
6
|
export const isTradeServiceError = (error: unknown): error is TradeServiceError =>
|
|
7
7
|
typeof error === 'object';
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const isUserServiceError = (error: unknown): error is UserServiceError =>
|
|
10
10
|
typeof error === 'object';
|
|
@@ -4,59 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface paths {
|
|
7
|
-
"/users": {
|
|
8
|
-
parameters: {
|
|
9
|
-
query?: never;
|
|
10
|
-
header?: never;
|
|
11
|
-
path?: never;
|
|
12
|
-
cookie?: never;
|
|
13
|
-
};
|
|
14
|
-
/** @description Gets all users */
|
|
15
|
-
get: operations["getUsers"];
|
|
16
|
-
put?: never;
|
|
17
|
-
/** @description Adds a new user */
|
|
18
|
-
post: operations["addUser"];
|
|
19
|
-
delete?: never;
|
|
20
|
-
options?: never;
|
|
21
|
-
head?: never;
|
|
22
|
-
patch?: never;
|
|
23
|
-
trace?: never;
|
|
24
|
-
};
|
|
25
|
-
"/users/{userId}": {
|
|
26
|
-
parameters: {
|
|
27
|
-
query?: never;
|
|
28
|
-
header?: never;
|
|
29
|
-
path?: never;
|
|
30
|
-
cookie?: never;
|
|
31
|
-
};
|
|
32
|
-
/** @description Gets a user */
|
|
33
|
-
get: operations["getUser"];
|
|
34
|
-
/** @description Updates an existing user */
|
|
35
|
-
put: operations["updateUser"];
|
|
36
|
-
post?: never;
|
|
37
|
-
delete?: never;
|
|
38
|
-
options?: never;
|
|
39
|
-
head?: never;
|
|
40
|
-
patch?: never;
|
|
41
|
-
trace?: never;
|
|
42
|
-
};
|
|
43
|
-
"/users/{userId}/portfolios": {
|
|
44
|
-
parameters: {
|
|
45
|
-
query?: never;
|
|
46
|
-
header?: never;
|
|
47
|
-
path?: never;
|
|
48
|
-
cookie?: never;
|
|
49
|
-
};
|
|
50
|
-
/** @description Gets all portfolios of a user */
|
|
51
|
-
get: operations["getUserPortfolios"];
|
|
52
|
-
put?: never;
|
|
53
|
-
post?: never;
|
|
54
|
-
delete?: never;
|
|
55
|
-
options?: never;
|
|
56
|
-
head?: never;
|
|
57
|
-
patch?: never;
|
|
58
|
-
trace?: never;
|
|
59
|
-
};
|
|
60
7
|
"/portfolios": {
|
|
61
8
|
parameters: {
|
|
62
9
|
query?: never;
|
|
@@ -146,34 +93,6 @@ export interface paths {
|
|
|
146
93
|
export type webhooks = Record<string, never>;
|
|
147
94
|
export interface components {
|
|
148
95
|
schemas: {
|
|
149
|
-
/** @description Payload to add a new user */
|
|
150
|
-
AddUserPayload: {
|
|
151
|
-
/** @example sam.smith@example.com */
|
|
152
|
-
email: string;
|
|
153
|
-
/** @example Sam Smith */
|
|
154
|
-
name: string;
|
|
155
|
-
/** @example USA */
|
|
156
|
-
country: string;
|
|
157
|
-
/** @example https://www.assets.com/image.png */
|
|
158
|
-
imageUrl?: string;
|
|
159
|
-
};
|
|
160
|
-
/** @description Payload to update an existing user */
|
|
161
|
-
UpdateUserPayload: components["schemas"]["AddUserPayload"];
|
|
162
|
-
/** @description A user */
|
|
163
|
-
User: components["schemas"]["AddUserPayload"] & {
|
|
164
|
-
/** @example 123456 */
|
|
165
|
-
id: string;
|
|
166
|
-
/**
|
|
167
|
-
* Format: int64
|
|
168
|
-
* @example 1713398544000
|
|
169
|
-
*/
|
|
170
|
-
dateCreated: number;
|
|
171
|
-
/**
|
|
172
|
-
* Format: int64
|
|
173
|
-
* @example 1713398544000
|
|
174
|
-
*/
|
|
175
|
-
dateUpdated: number;
|
|
176
|
-
};
|
|
177
96
|
/** @description Payload to add a new portfolio */
|
|
178
97
|
AddPortfolioPayload: {
|
|
179
98
|
/** @example 123456 */
|
|
@@ -338,136 +257,6 @@ export interface components {
|
|
|
338
257
|
}
|
|
339
258
|
export type $defs = Record<string, never>;
|
|
340
259
|
export interface operations {
|
|
341
|
-
getUsers: {
|
|
342
|
-
parameters: {
|
|
343
|
-
query?: never;
|
|
344
|
-
header?: never;
|
|
345
|
-
path?: never;
|
|
346
|
-
cookie?: never;
|
|
347
|
-
};
|
|
348
|
-
requestBody?: never;
|
|
349
|
-
responses: {
|
|
350
|
-
/** @description Success */
|
|
351
|
-
200: {
|
|
352
|
-
headers: {
|
|
353
|
-
[name: string]: unknown;
|
|
354
|
-
};
|
|
355
|
-
content: {
|
|
356
|
-
"application/json": components["schemas"]["User"][];
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
404: components["responses"]["NotFound"];
|
|
360
|
-
500: components["responses"]["InternalServerError"];
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
addUser: {
|
|
364
|
-
parameters: {
|
|
365
|
-
query?: never;
|
|
366
|
-
header?: never;
|
|
367
|
-
path?: never;
|
|
368
|
-
cookie?: never;
|
|
369
|
-
};
|
|
370
|
-
/** @description The request body to add a user */
|
|
371
|
-
requestBody: {
|
|
372
|
-
content: {
|
|
373
|
-
"application/json": components["schemas"]["AddUserPayload"];
|
|
374
|
-
};
|
|
375
|
-
};
|
|
376
|
-
responses: {
|
|
377
|
-
/** @description Added */
|
|
378
|
-
201: {
|
|
379
|
-
headers: {
|
|
380
|
-
[name: string]: unknown;
|
|
381
|
-
};
|
|
382
|
-
content: {
|
|
383
|
-
"application/json": components["schemas"]["User"];
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
400: components["responses"]["BadRequest"];
|
|
387
|
-
500: components["responses"]["InternalServerError"];
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
getUser: {
|
|
391
|
-
parameters: {
|
|
392
|
-
query?: never;
|
|
393
|
-
header?: never;
|
|
394
|
-
path: {
|
|
395
|
-
/** @description The user id */
|
|
396
|
-
userId: string;
|
|
397
|
-
};
|
|
398
|
-
cookie?: never;
|
|
399
|
-
};
|
|
400
|
-
requestBody?: never;
|
|
401
|
-
responses: {
|
|
402
|
-
/** @description Success */
|
|
403
|
-
200: {
|
|
404
|
-
headers: {
|
|
405
|
-
[name: string]: unknown;
|
|
406
|
-
};
|
|
407
|
-
content: {
|
|
408
|
-
"application/json": components["schemas"]["User"];
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
|
-
404: components["responses"]["NotFound"];
|
|
412
|
-
500: components["responses"]["InternalServerError"];
|
|
413
|
-
};
|
|
414
|
-
};
|
|
415
|
-
updateUser: {
|
|
416
|
-
parameters: {
|
|
417
|
-
query?: never;
|
|
418
|
-
header?: never;
|
|
419
|
-
path: {
|
|
420
|
-
/** @description The user id */
|
|
421
|
-
userId: string;
|
|
422
|
-
};
|
|
423
|
-
cookie?: never;
|
|
424
|
-
};
|
|
425
|
-
/** @description The request body to update a user */
|
|
426
|
-
requestBody: {
|
|
427
|
-
content: {
|
|
428
|
-
"application/json": components["schemas"]["UpdateUserPayload"];
|
|
429
|
-
};
|
|
430
|
-
};
|
|
431
|
-
responses: {
|
|
432
|
-
/** @description Success */
|
|
433
|
-
200: {
|
|
434
|
-
headers: {
|
|
435
|
-
[name: string]: unknown;
|
|
436
|
-
};
|
|
437
|
-
content: {
|
|
438
|
-
"application/json": components["schemas"]["User"];
|
|
439
|
-
};
|
|
440
|
-
};
|
|
441
|
-
400: components["responses"]["BadRequest"];
|
|
442
|
-
404: components["responses"]["NotFound"];
|
|
443
|
-
500: components["responses"]["InternalServerError"];
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
getUserPortfolios: {
|
|
447
|
-
parameters: {
|
|
448
|
-
query?: never;
|
|
449
|
-
header?: never;
|
|
450
|
-
path: {
|
|
451
|
-
/** @description The user id */
|
|
452
|
-
userId: string;
|
|
453
|
-
};
|
|
454
|
-
cookie?: never;
|
|
455
|
-
};
|
|
456
|
-
requestBody?: never;
|
|
457
|
-
responses: {
|
|
458
|
-
/** @description Success */
|
|
459
|
-
200: {
|
|
460
|
-
headers: {
|
|
461
|
-
[name: string]: unknown;
|
|
462
|
-
};
|
|
463
|
-
content: {
|
|
464
|
-
"application/json": components["schemas"]["Portfolio"][];
|
|
465
|
-
};
|
|
466
|
-
};
|
|
467
|
-
404: components["responses"]["NotFound"];
|
|
468
|
-
500: components["responses"]["InternalServerError"];
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
260
|
addPortfolio: {
|
|
472
261
|
parameters: {
|
|
473
262
|
query?: never;
|
package/ts/types/types.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
import { components as
|
|
3
|
+
import { components as UserServiceComponents } from '@ts/services/dt-user-service';
|
|
4
4
|
|
|
5
5
|
type MarketServiceSchemas = MarketServiceComponents['schemas'];
|
|
6
6
|
type TradeServiceSchemas = TradeServiceComponents['schemas'];
|
|
7
|
-
type
|
|
7
|
+
type UserServiceSchemas = UserServiceComponents['schemas'];
|
|
8
8
|
|
|
9
9
|
// Market Service Types
|
|
10
10
|
export type SimpleQuote = MarketServiceSchemas['SimpleQuote'];
|
|
@@ -24,8 +24,8 @@ export type OrderType = TradeServiceSchemas['OrderType'];
|
|
|
24
24
|
export type Holding = TradeServiceSchemas['Holding'];
|
|
25
25
|
export type TradeServiceError = TradeServiceSchemas['Error'];
|
|
26
26
|
|
|
27
|
-
//
|
|
28
|
-
export type User =
|
|
29
|
-
export type AddUserPayload =
|
|
30
|
-
export type UpdateUserPayload =
|
|
31
|
-
export type
|
|
27
|
+
// User Service Types
|
|
28
|
+
export type User = UserServiceSchemas['User'];
|
|
29
|
+
export type AddUserPayload = UserServiceSchemas['AddUserPayload'];
|
|
30
|
+
export type UpdateUserPayload = UserServiceSchemas['UpdateUserPayload'];
|
|
31
|
+
export type UserServiceError = UserServiceSchemas['Error'];
|
|
File without changes
|