@rivascva/dt-idl 1.1.9 → 1.1.11
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/.githooks/pre-commit-config.yaml +21 -0
- package/dist/index.cjs.js +5 -0
- package/dist/index.d.ts +14 -3
- package/dist/index.esm.js +4 -1
- package/package.json +1 -1
- package/services/dt-market-service.yaml +1 -1
- package/ts/clients/errors.ts +7 -0
- package/ts/clients/index.ts +1 -0
- package/ts/services/dt-market-service.ts +2 -2
|
@@ -6,3 +6,24 @@ repos:
|
|
|
6
6
|
name: check newlines
|
|
7
7
|
- id: check-yaml
|
|
8
8
|
name: check yaml
|
|
9
|
+
- repo: local
|
|
10
|
+
hooks:
|
|
11
|
+
- id: gen-services
|
|
12
|
+
name: gen services
|
|
13
|
+
entry: npm run gen
|
|
14
|
+
language: system
|
|
15
|
+
pass_filenames: false
|
|
16
|
+
- repo: local
|
|
17
|
+
hooks:
|
|
18
|
+
- id: lint-check
|
|
19
|
+
name: lint check
|
|
20
|
+
entry: npm run lint
|
|
21
|
+
language: system
|
|
22
|
+
pass_filenames: false
|
|
23
|
+
- repo: local
|
|
24
|
+
hooks:
|
|
25
|
+
- id: ts-check
|
|
26
|
+
name: ts check
|
|
27
|
+
entry: npm run check
|
|
28
|
+
language: system
|
|
29
|
+
pass_filenames: false
|
package/dist/index.cjs.js
CHANGED
|
@@ -490,5 +490,10 @@ function mergeHeaders(...allHeaders) {
|
|
|
490
490
|
const createMarketServiceClient = (options) => createClient(options);
|
|
491
491
|
const createTradeServiceClient = (options) => createClient(options);
|
|
492
492
|
|
|
493
|
+
const isMarketServiceError = (error) => typeof error === 'object';
|
|
494
|
+
const isTradeServiceError = (error) => typeof error === 'object';
|
|
495
|
+
|
|
493
496
|
exports.createMarketServiceClient = createMarketServiceClient;
|
|
494
497
|
exports.createTradeServiceClient = createTradeServiceClient;
|
|
498
|
+
exports.isMarketServiceError = isMarketServiceError;
|
|
499
|
+
exports.isTradeServiceError = isTradeServiceError;
|
package/dist/index.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ interface paths$1 {
|
|
|
82
82
|
cookie?: never;
|
|
83
83
|
};
|
|
84
84
|
/** @description Gets the simple quotes that fuzzy match the search query */
|
|
85
|
-
get: operations$1["
|
|
85
|
+
get: operations$1["getStocksSearch"];
|
|
86
86
|
put?: never;
|
|
87
87
|
post?: never;
|
|
88
88
|
delete?: never;
|
|
@@ -418,7 +418,7 @@ interface operations$1 {
|
|
|
418
418
|
500: components$1["responses"]["InternalServerError"];
|
|
419
419
|
};
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
getStocksSearch: {
|
|
422
422
|
parameters: {
|
|
423
423
|
query: {
|
|
424
424
|
/** @description The search query */
|
|
@@ -902,6 +902,17 @@ interface operations {
|
|
|
902
902
|
declare const createMarketServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths$1, `${string}/${string}`>;
|
|
903
903
|
declare const createTradeServiceClient: (options: ClientOptions) => openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
904
904
|
|
|
905
|
+
declare const isMarketServiceError: (error: unknown) => error is {
|
|
906
|
+
status: number;
|
|
907
|
+
code: "ERROR";
|
|
908
|
+
message: string;
|
|
909
|
+
};
|
|
910
|
+
declare const isTradeServiceError: (error: unknown) => error is {
|
|
911
|
+
status: number;
|
|
912
|
+
code: "ERROR" | "NOT_ENOUGH_CASH" | "NOT_ENOUGH_SHARES" | "REQS_NOT_MET";
|
|
913
|
+
message: string;
|
|
914
|
+
};
|
|
915
|
+
|
|
905
916
|
type MarketServiceSchemas = components$1['schemas'];
|
|
906
917
|
type TradeServiceSchemas = components['schemas'];
|
|
907
918
|
type SimpleQuote = MarketServiceSchemas['SimpleQuote'];
|
|
@@ -917,4 +928,4 @@ type Order = TradeServiceSchemas['Order'];
|
|
|
917
928
|
type OrderType = TradeServiceSchemas['OrderType'];
|
|
918
929
|
type TradeServiceError = TradeServiceSchemas['Error'];
|
|
919
930
|
|
|
920
|
-
export { type FullQuote, type MarketServiceError, type NewsArticle, type Order, type OrderPayload, type OrderType, type Portfolio, type PortfolioType, type SimpleQuote, type StockNewsArticle, type TradeServiceError, type User, createMarketServiceClient, createTradeServiceClient };
|
|
931
|
+
export { type FullQuote, type MarketServiceError, type NewsArticle, type Order, type OrderPayload, type OrderType, type Portfolio, type PortfolioType, type SimpleQuote, type StockNewsArticle, type TradeServiceError, type User, createMarketServiceClient, createTradeServiceClient, isMarketServiceError, isTradeServiceError };
|
package/dist/index.esm.js
CHANGED
|
@@ -488,4 +488,7 @@ function mergeHeaders(...allHeaders) {
|
|
|
488
488
|
const createMarketServiceClient = (options) => createClient(options);
|
|
489
489
|
const createTradeServiceClient = (options) => createClient(options);
|
|
490
490
|
|
|
491
|
-
|
|
491
|
+
const isMarketServiceError = (error) => typeof error === 'object';
|
|
492
|
+
const isTradeServiceError = (error) => typeof error === 'object';
|
|
493
|
+
|
|
494
|
+
export { createMarketServiceClient, createTradeServiceClient, isMarketServiceError, isTradeServiceError };
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MarketServiceError, TradeServiceError } from '@ts/types';
|
|
2
|
+
|
|
3
|
+
export const isMarketServiceError = (error: unknown): error is MarketServiceError =>
|
|
4
|
+
typeof error === 'object';
|
|
5
|
+
|
|
6
|
+
export const isTradeServiceError = (error: unknown): error is TradeServiceError =>
|
|
7
|
+
typeof error === 'object';
|
package/ts/clients/index.ts
CHANGED
|
@@ -80,7 +80,7 @@ export interface paths {
|
|
|
80
80
|
cookie?: never;
|
|
81
81
|
};
|
|
82
82
|
/** @description Gets the simple quotes that fuzzy match the search query */
|
|
83
|
-
get: operations["
|
|
83
|
+
get: operations["getStocksSearch"];
|
|
84
84
|
put?: never;
|
|
85
85
|
post?: never;
|
|
86
86
|
delete?: never;
|
|
@@ -418,7 +418,7 @@ export interface operations {
|
|
|
418
418
|
500: components["responses"]["InternalServerError"];
|
|
419
419
|
};
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
getStocksSearch: {
|
|
422
422
|
parameters: {
|
|
423
423
|
query: {
|
|
424
424
|
/** @description The search query */
|