@rivascva/dt-idl 1.1.25 → 1.1.27
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.d.ts +25 -20
- package/package.json +1 -1
- package/services/dt-trade-service.yaml +28 -18
- package/ts/services/dt-trade-service.ts +21 -17
- package/ts/types/types.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -679,9 +679,9 @@ interface paths {
|
|
|
679
679
|
};
|
|
680
680
|
get?: never;
|
|
681
681
|
put?: never;
|
|
682
|
-
/** @description
|
|
682
|
+
/** @description Adds a new order */
|
|
683
683
|
post: operations["addOrder"];
|
|
684
|
-
/** @description
|
|
684
|
+
/** @description Deletes an existing order */
|
|
685
685
|
delete: operations["deleteOrder"];
|
|
686
686
|
options?: never;
|
|
687
687
|
head?: never;
|
|
@@ -691,15 +691,17 @@ interface paths {
|
|
|
691
691
|
}
|
|
692
692
|
interface components {
|
|
693
693
|
schemas: {
|
|
694
|
-
/** @description
|
|
695
|
-
|
|
694
|
+
/** @description Payload to add a new user */
|
|
695
|
+
AddUserPayload: {
|
|
696
696
|
/** @example sam.smith@example.com */
|
|
697
697
|
email: string;
|
|
698
698
|
/** @example Sam Smith */
|
|
699
699
|
name: string;
|
|
700
700
|
};
|
|
701
|
+
/** @description Payload to update an existing user */
|
|
702
|
+
UpdateUserPayload: components["schemas"]["AddUserPayload"];
|
|
701
703
|
/** @description A user */
|
|
702
|
-
User: components["schemas"]["
|
|
704
|
+
User: components["schemas"]["AddUserPayload"] & {
|
|
703
705
|
/** @example 123456 */
|
|
704
706
|
id: string;
|
|
705
707
|
/**
|
|
@@ -766,8 +768,8 @@ interface components {
|
|
|
766
768
|
*/
|
|
767
769
|
dateUpdated: number;
|
|
768
770
|
};
|
|
769
|
-
/** @description
|
|
770
|
-
|
|
771
|
+
/** @description Payload to add a new order */
|
|
772
|
+
AddOrderPayload: {
|
|
771
773
|
/** @example 123456 */
|
|
772
774
|
portfolioId: string;
|
|
773
775
|
/** @example BUY */
|
|
@@ -785,8 +787,13 @@ interface components {
|
|
|
785
787
|
*/
|
|
786
788
|
shares: number;
|
|
787
789
|
};
|
|
788
|
-
/** @description
|
|
789
|
-
|
|
790
|
+
/** @description Payload to delete an existing order */
|
|
791
|
+
DeleteOrderPayload: {
|
|
792
|
+
/** @example 123456 */
|
|
793
|
+
id: string;
|
|
794
|
+
};
|
|
795
|
+
/** @description An order */
|
|
796
|
+
Order: components["schemas"]["AddOrderPayload"] & {
|
|
790
797
|
/** @example 123456 */
|
|
791
798
|
id: string;
|
|
792
799
|
/**
|
|
@@ -823,7 +830,7 @@ interface components {
|
|
|
823
830
|
message: string;
|
|
824
831
|
};
|
|
825
832
|
/** @enum {string} */
|
|
826
|
-
ErrorCode: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES";
|
|
833
|
+
ErrorCode: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "UNDELETABLE";
|
|
827
834
|
/** @enum {string} */
|
|
828
835
|
PortfolioType: "PERSONAL" | "COMPETITIVE";
|
|
829
836
|
/** @enum {string} */
|
|
@@ -903,7 +910,7 @@ interface operations {
|
|
|
903
910
|
/** @description The request body to add a user */
|
|
904
911
|
requestBody: {
|
|
905
912
|
content: {
|
|
906
|
-
"application/json": components["schemas"]["
|
|
913
|
+
"application/json": components["schemas"]["AddUserPayload"];
|
|
907
914
|
};
|
|
908
915
|
};
|
|
909
916
|
responses: {
|
|
@@ -958,7 +965,7 @@ interface operations {
|
|
|
958
965
|
/** @description The request body to updated a user */
|
|
959
966
|
requestBody: {
|
|
960
967
|
content: {
|
|
961
|
-
"application/json": components["schemas"]["
|
|
968
|
+
"application/json": components["schemas"]["UpdateUserPayload"];
|
|
962
969
|
};
|
|
963
970
|
};
|
|
964
971
|
responses: {
|
|
@@ -1011,7 +1018,7 @@ interface operations {
|
|
|
1011
1018
|
/** @description The request body to add an order */
|
|
1012
1019
|
requestBody: {
|
|
1013
1020
|
content: {
|
|
1014
|
-
"application/json": components["schemas"]["
|
|
1021
|
+
"application/json": components["schemas"]["AddOrderPayload"];
|
|
1015
1022
|
};
|
|
1016
1023
|
};
|
|
1017
1024
|
responses: {
|
|
@@ -1039,10 +1046,7 @@ interface operations {
|
|
|
1039
1046
|
/** @description The request body to delete an existing order */
|
|
1040
1047
|
requestBody: {
|
|
1041
1048
|
content: {
|
|
1042
|
-
"application/json":
|
|
1043
|
-
/** @example 123456 */
|
|
1044
|
-
id: string;
|
|
1045
|
-
};
|
|
1049
|
+
"application/json": components["schemas"]["DeleteOrderPayload"];
|
|
1046
1050
|
};
|
|
1047
1051
|
};
|
|
1048
1052
|
responses: {
|
|
@@ -1064,7 +1068,7 @@ declare const isMarketServiceError: (error: unknown) => error is {
|
|
|
1064
1068
|
};
|
|
1065
1069
|
declare const isTradeServiceError: (error: unknown) => error is {
|
|
1066
1070
|
status: number;
|
|
1067
|
-
code: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES";
|
|
1071
|
+
code: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "UNDELETABLE";
|
|
1068
1072
|
message: string;
|
|
1069
1073
|
};
|
|
1070
1074
|
|
|
@@ -1078,10 +1082,11 @@ type MarketServiceError = MarketServiceSchemas['Error'];
|
|
|
1078
1082
|
type User = TradeServiceSchemas['User'];
|
|
1079
1083
|
type Portfolio = TradeServiceSchemas['Portfolio'];
|
|
1080
1084
|
type PortfolioType = TradeServiceSchemas['PortfolioType'];
|
|
1081
|
-
type
|
|
1085
|
+
type AddOrderPayload = TradeServiceSchemas['AddOrderPayload'];
|
|
1086
|
+
type DeleteOrderPayload = TradeServiceSchemas['DeleteOrderPayload'];
|
|
1082
1087
|
type Order = TradeServiceSchemas['Order'];
|
|
1083
1088
|
type OrderType = TradeServiceSchemas['OrderType'];
|
|
1084
1089
|
type Holding = TradeServiceSchemas['Holding'];
|
|
1085
1090
|
type TradeServiceError = TradeServiceSchemas['Error'];
|
|
1086
1091
|
|
|
1087
|
-
export { type FullQuote, type Holding, type MarketServiceError, type NewsArticle, type Order, type
|
|
1092
|
+
export { type AddOrderPayload, type DeleteOrderPayload, type FullQuote, type Holding, type MarketServiceError, type NewsArticle, type Order, type OrderType, type Portfolio, type PortfolioType, type SimpleQuote, type StockNewsArticle, type TradeServiceError, type User, createMarketServiceClient, createTradeServiceClient, isMarketServiceError, isTradeServiceError };
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ paths:
|
|
|
39
39
|
content:
|
|
40
40
|
application/json:
|
|
41
41
|
schema:
|
|
42
|
-
$ref: '#/components/schemas/
|
|
42
|
+
$ref: '#/components/schemas/AddUserPayload'
|
|
43
43
|
responses:
|
|
44
44
|
201:
|
|
45
45
|
description: Added
|
|
@@ -97,7 +97,7 @@ paths:
|
|
|
97
97
|
content:
|
|
98
98
|
application/json:
|
|
99
99
|
schema:
|
|
100
|
-
$ref: '#/components/schemas/
|
|
100
|
+
$ref: '#/components/schemas/UpdateUserPayload'
|
|
101
101
|
responses:
|
|
102
102
|
200:
|
|
103
103
|
description: Success
|
|
@@ -142,7 +142,7 @@ paths:
|
|
|
142
142
|
|
|
143
143
|
/orders:
|
|
144
144
|
post:
|
|
145
|
-
description:
|
|
145
|
+
description: Adds a new order
|
|
146
146
|
operationId: addOrder
|
|
147
147
|
tags:
|
|
148
148
|
- Orders
|
|
@@ -152,7 +152,7 @@ paths:
|
|
|
152
152
|
content:
|
|
153
153
|
application/json:
|
|
154
154
|
schema:
|
|
155
|
-
$ref: '#/components/schemas/
|
|
155
|
+
$ref: '#/components/schemas/AddOrderPayload'
|
|
156
156
|
responses:
|
|
157
157
|
201:
|
|
158
158
|
description: Added
|
|
@@ -167,7 +167,7 @@ paths:
|
|
|
167
167
|
500:
|
|
168
168
|
$ref: '#/components/responses/InternalServerError'
|
|
169
169
|
delete:
|
|
170
|
-
description:
|
|
170
|
+
description: Deletes an existing order
|
|
171
171
|
operationId: deleteOrder
|
|
172
172
|
tags:
|
|
173
173
|
- Orders
|
|
@@ -177,12 +177,7 @@ paths:
|
|
|
177
177
|
content:
|
|
178
178
|
application/json:
|
|
179
179
|
schema:
|
|
180
|
-
|
|
181
|
-
id:
|
|
182
|
-
type: string
|
|
183
|
-
example: 123456
|
|
184
|
-
required:
|
|
185
|
-
- id
|
|
180
|
+
$ref: '#/components/schemas/DeleteOrderPayload'
|
|
186
181
|
responses:
|
|
187
182
|
204:
|
|
188
183
|
$ref: '#/components/responses/NoContent'
|
|
@@ -195,8 +190,8 @@ paths:
|
|
|
195
190
|
|
|
196
191
|
components:
|
|
197
192
|
schemas:
|
|
198
|
-
|
|
199
|
-
description:
|
|
193
|
+
AddUserPayload:
|
|
194
|
+
description: Payload to add a new user
|
|
200
195
|
properties:
|
|
201
196
|
email:
|
|
202
197
|
type: string
|
|
@@ -208,10 +203,15 @@ components:
|
|
|
208
203
|
- email
|
|
209
204
|
- name
|
|
210
205
|
|
|
206
|
+
UpdateUserPayload:
|
|
207
|
+
description: Payload to update an existing user
|
|
208
|
+
allOf:
|
|
209
|
+
- $ref: '#/components/schemas/AddUserPayload'
|
|
210
|
+
|
|
211
211
|
User:
|
|
212
212
|
description: A user
|
|
213
213
|
allOf:
|
|
214
|
-
- $ref: '#/components/schemas/
|
|
214
|
+
- $ref: '#/components/schemas/AddUserPayload'
|
|
215
215
|
- type: object
|
|
216
216
|
properties:
|
|
217
217
|
id:
|
|
@@ -305,8 +305,8 @@ components:
|
|
|
305
305
|
- dateCreated
|
|
306
306
|
- dateUpdated
|
|
307
307
|
|
|
308
|
-
|
|
309
|
-
description:
|
|
308
|
+
AddOrderPayload:
|
|
309
|
+
description: Payload to add a new order
|
|
310
310
|
properties:
|
|
311
311
|
portfolioId:
|
|
312
312
|
type: string
|
|
@@ -332,10 +332,19 @@ components:
|
|
|
332
332
|
- targetPrice
|
|
333
333
|
- shares
|
|
334
334
|
|
|
335
|
+
DeleteOrderPayload:
|
|
336
|
+
description: Payload to delete an existing order
|
|
337
|
+
properties:
|
|
338
|
+
id:
|
|
339
|
+
type: string
|
|
340
|
+
example: 123456
|
|
341
|
+
required:
|
|
342
|
+
- id
|
|
343
|
+
|
|
335
344
|
Order:
|
|
336
|
-
description:
|
|
345
|
+
description: An order
|
|
337
346
|
allOf:
|
|
338
|
-
- $ref: '#/components/schemas/
|
|
347
|
+
- $ref: '#/components/schemas/AddOrderPayload'
|
|
339
348
|
- type: object
|
|
340
349
|
properties:
|
|
341
350
|
id:
|
|
@@ -390,6 +399,7 @@ components:
|
|
|
390
399
|
- ERROR
|
|
391
400
|
- NOT_ENOUGH_CASH
|
|
392
401
|
- NOT_ENOUGH_SHARES
|
|
402
|
+
- UNDELETABLE
|
|
393
403
|
|
|
394
404
|
PortfolioType:
|
|
395
405
|
type: string
|
|
@@ -66,9 +66,9 @@ export interface paths {
|
|
|
66
66
|
};
|
|
67
67
|
get?: never;
|
|
68
68
|
put?: never;
|
|
69
|
-
/** @description
|
|
69
|
+
/** @description Adds a new order */
|
|
70
70
|
post: operations["addOrder"];
|
|
71
|
-
/** @description
|
|
71
|
+
/** @description Deletes an existing order */
|
|
72
72
|
delete: operations["deleteOrder"];
|
|
73
73
|
options?: never;
|
|
74
74
|
head?: never;
|
|
@@ -79,15 +79,17 @@ export interface paths {
|
|
|
79
79
|
export type webhooks = Record<string, never>;
|
|
80
80
|
export interface components {
|
|
81
81
|
schemas: {
|
|
82
|
-
/** @description
|
|
83
|
-
|
|
82
|
+
/** @description Payload to add a new user */
|
|
83
|
+
AddUserPayload: {
|
|
84
84
|
/** @example sam.smith@example.com */
|
|
85
85
|
email: string;
|
|
86
86
|
/** @example Sam Smith */
|
|
87
87
|
name: string;
|
|
88
88
|
};
|
|
89
|
+
/** @description Payload to update an existing user */
|
|
90
|
+
UpdateUserPayload: components["schemas"]["AddUserPayload"];
|
|
89
91
|
/** @description A user */
|
|
90
|
-
User: components["schemas"]["
|
|
92
|
+
User: components["schemas"]["AddUserPayload"] & {
|
|
91
93
|
/** @example 123456 */
|
|
92
94
|
id: string;
|
|
93
95
|
/**
|
|
@@ -154,8 +156,8 @@ export interface components {
|
|
|
154
156
|
*/
|
|
155
157
|
dateUpdated: number;
|
|
156
158
|
};
|
|
157
|
-
/** @description
|
|
158
|
-
|
|
159
|
+
/** @description Payload to add a new order */
|
|
160
|
+
AddOrderPayload: {
|
|
159
161
|
/** @example 123456 */
|
|
160
162
|
portfolioId: string;
|
|
161
163
|
/** @example BUY */
|
|
@@ -173,8 +175,13 @@ export interface components {
|
|
|
173
175
|
*/
|
|
174
176
|
shares: number;
|
|
175
177
|
};
|
|
176
|
-
/** @description
|
|
177
|
-
|
|
178
|
+
/** @description Payload to delete an existing order */
|
|
179
|
+
DeleteOrderPayload: {
|
|
180
|
+
/** @example 123456 */
|
|
181
|
+
id: string;
|
|
182
|
+
};
|
|
183
|
+
/** @description An order */
|
|
184
|
+
Order: components["schemas"]["AddOrderPayload"] & {
|
|
178
185
|
/** @example 123456 */
|
|
179
186
|
id: string;
|
|
180
187
|
/**
|
|
@@ -211,7 +218,7 @@ export interface components {
|
|
|
211
218
|
message: string;
|
|
212
219
|
};
|
|
213
220
|
/** @enum {string} */
|
|
214
|
-
ErrorCode: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES";
|
|
221
|
+
ErrorCode: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "UNDELETABLE";
|
|
215
222
|
/** @enum {string} */
|
|
216
223
|
PortfolioType: "PERSONAL" | "COMPETITIVE";
|
|
217
224
|
/** @enum {string} */
|
|
@@ -292,7 +299,7 @@ export interface operations {
|
|
|
292
299
|
/** @description The request body to add a user */
|
|
293
300
|
requestBody: {
|
|
294
301
|
content: {
|
|
295
|
-
"application/json": components["schemas"]["
|
|
302
|
+
"application/json": components["schemas"]["AddUserPayload"];
|
|
296
303
|
};
|
|
297
304
|
};
|
|
298
305
|
responses: {
|
|
@@ -347,7 +354,7 @@ export interface operations {
|
|
|
347
354
|
/** @description The request body to updated a user */
|
|
348
355
|
requestBody: {
|
|
349
356
|
content: {
|
|
350
|
-
"application/json": components["schemas"]["
|
|
357
|
+
"application/json": components["schemas"]["UpdateUserPayload"];
|
|
351
358
|
};
|
|
352
359
|
};
|
|
353
360
|
responses: {
|
|
@@ -400,7 +407,7 @@ export interface operations {
|
|
|
400
407
|
/** @description The request body to add an order */
|
|
401
408
|
requestBody: {
|
|
402
409
|
content: {
|
|
403
|
-
"application/json": components["schemas"]["
|
|
410
|
+
"application/json": components["schemas"]["AddOrderPayload"];
|
|
404
411
|
};
|
|
405
412
|
};
|
|
406
413
|
responses: {
|
|
@@ -428,10 +435,7 @@ export interface operations {
|
|
|
428
435
|
/** @description The request body to delete an existing order */
|
|
429
436
|
requestBody: {
|
|
430
437
|
content: {
|
|
431
|
-
"application/json":
|
|
432
|
-
/** @example 123456 */
|
|
433
|
-
id: string;
|
|
434
|
-
};
|
|
438
|
+
"application/json": components["schemas"]["DeleteOrderPayload"];
|
|
435
439
|
};
|
|
436
440
|
};
|
|
437
441
|
responses: {
|
package/ts/types/types.ts
CHANGED
|
@@ -15,7 +15,8 @@ export type MarketServiceError = MarketServiceSchemas['Error'];
|
|
|
15
15
|
export type User = TradeServiceSchemas['User'];
|
|
16
16
|
export type Portfolio = TradeServiceSchemas['Portfolio'];
|
|
17
17
|
export type PortfolioType = TradeServiceSchemas['PortfolioType'];
|
|
18
|
-
export type
|
|
18
|
+
export type AddOrderPayload = TradeServiceSchemas['AddOrderPayload'];
|
|
19
|
+
export type DeleteOrderPayload = TradeServiceSchemas['DeleteOrderPayload'];
|
|
19
20
|
export type Order = TradeServiceSchemas['Order'];
|
|
20
21
|
export type OrderType = TradeServiceSchemas['OrderType'];
|
|
21
22
|
export type Holding = TradeServiceSchemas['Holding'];
|