@orbis-systems/orbis-api-clients 0.4.4 → 0.5.0

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.
@@ -1,7 +1,7 @@
1
1
  import { AxiosError, AxiosInstance, AxiosRequestConfig, HttpStatusCode } from "axios";
2
2
  interface BaseClientConfig<HandleError extends boolean = boolean> {
3
3
  baseUrl: string;
4
- errorHandling?: HandleError;
4
+ handleError?: HandleError;
5
5
  storage?: Storage;
6
6
  defaultHeaders?: Record<string, string>;
7
7
  defaultSecure?: boolean;
@@ -18,6 +18,7 @@ enum ContentType {
18
18
  type RequestConfig<Body = unknown> = AxiosRequestConfig<Body> & {
19
19
  secure?: boolean;
20
20
  contentType?: ContentType;
21
+ handleError?: boolean;
21
22
  };
22
23
  type ResponseStatus = {
23
24
  status: HttpStatusCode | -1;
@@ -52,7 +53,7 @@ declare abstract class BaseClient<HandleError extends boolean = boolean, AuthDat
52
53
  setAuthData(data: AuthData | null): void;
53
54
  getAuthData(): AuthData | null;
54
55
  getConfig(): BaseClientConfig<HandleError>;
55
- abstract prepareAuthRequestConfig(): Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>;
56
+ protected abstract prepareAuthRequestConfig(): Promise<Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>>;
56
57
  }
57
58
  declare class BaseApi<HandleError extends boolean = boolean, ApiClient extends BaseClient<HandleError> = BaseClient<HandleError>> {
58
59
  protected readonly apiClient: ApiClient;
@@ -61,18 +62,19 @@ declare class BaseApi<HandleError extends boolean = boolean, ApiClient extends B
61
62
  }
62
63
  interface JwtClientConfig<HandleError extends boolean = boolean> extends BaseClientConfig<HandleError> {
63
64
  authSchema?: string;
65
+ autoRenewToken?: boolean;
64
66
  }
65
67
  interface JwtAuthData {
66
68
  accessToken: string;
67
- refreshToken: string;
69
+ refreshToken?: string;
68
70
  }
69
- declare class JwtClient<HandleError extends boolean = boolean> extends BaseClient<HandleError, JwtAuthData> {
71
+ declare class JwtClient<HandleError extends boolean = boolean, AuthData extends JwtAuthData = JwtAuthData> extends BaseClient<HandleError, AuthData> {
70
72
  protected readonly config: JwtClientConfig<HandleError>;
71
73
  constructor(config: JwtClientConfig<HandleError>);
72
74
  getConfig(): JwtClientConfig<HandleError>;
73
- prepareAuthRequestConfig(): Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>;
74
- scheduleTokenRenewal(renewTokenCallback: () => Promise<JwtAuthData>): void;
75
- cancelTokenRenewal(): void;
75
+ setRenewTokenCallback(renewTokenCallback: () => Promise<AuthData>): void;
76
+ protected prepareAuthRequestConfig(): Promise<Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>>;
77
+ renewToken(): Promise<void>;
76
78
  }
77
79
  export interface AesMidasActionLog {
78
80
  id?: string | null;
@@ -219,6 +221,43 @@ export interface AesMidasBond {
219
221
  source?: string | null;
220
222
  settlement_convention?: string | null;
221
223
  }
224
+ export interface AesMidasBondMarksApex {
225
+ isin?: string | null;
226
+ cusip?: string | null;
227
+ timestamp?: string | null;
228
+ /** @format double */
229
+ price?: number | null;
230
+ /** @format double */
231
+ dirty_price?: number | null;
232
+ /** @format double */
233
+ accrued_interest?: number | null;
234
+ /** @format double */
235
+ yield_to_worst?: number | null;
236
+ error?: string | null;
237
+ }
238
+ export interface AesMidasBondQuotesApex {
239
+ timestamp?: string | null;
240
+ /** @format double */
241
+ bid_price?: number | null;
242
+ /** @format double */
243
+ bid_yield_to_worst?: number | null;
244
+ /** @format double */
245
+ bid_size?: number | null;
246
+ /** @format double */
247
+ bid_min_size?: number | null;
248
+ /** @format double */
249
+ ask_price?: number | null;
250
+ /** @format double */
251
+ ask_yield_to_worst?: number | null;
252
+ /** @format double */
253
+ ask_size?: number | null;
254
+ /** @format double */
255
+ ask_min_size?: number | null;
256
+ /** @format double */
257
+ bid_yield_to_maturity?: number | null;
258
+ /** @format double */
259
+ ask_yield_to_maturity?: number | null;
260
+ }
222
261
  export interface AesMidasBondReformat {
223
262
  symbol?: string | null;
224
263
  not_permissioned?: boolean;
@@ -403,6 +442,11 @@ export interface AesMidasBondReformat {
403
442
  issue_minimum_denomination?: number | null;
404
443
  puttable?: boolean | null;
405
444
  }
445
+ export interface AesMidasBondWholeApex {
446
+ basic?: AesMidasBond;
447
+ mark?: AesMidasBondMarksApex;
448
+ quote?: AesMidasBondQuotesApex;
449
+ }
406
450
  export interface AesMidasCandelstick {
407
451
  /** @format double */
408
452
  open?: number;
@@ -1059,51 +1103,56 @@ export interface AesMidasOptionChain {
1059
1103
  vol?: number;
1060
1104
  /** @format int32 */
1061
1105
  open_inst?: number;
1106
+ /** @format double */
1107
+ strike?: number;
1108
+ expire?: string | null;
1062
1109
  data_source?: string | null;
1063
1110
  }
1064
- export interface AesMidasOptionChainResponsewithPagination {
1065
- /** @format int32 */
1066
- total_items?: number;
1067
- /** @format int32 */
1068
- total_pages?: number;
1069
- /** @format int32 */
1070
- current_pages?: number;
1071
- /** @format int32 */
1072
- page_size?: number;
1073
- data?: AesMidasOptionChain[] | null;
1111
+ export interface AesMidasOptionChainDates {
1112
+ dates_dictionary?: Record<string, string | null>;
1113
+ }
1114
+ export interface AesMidasOptionChainDatesReformat {
1115
+ quarterlys?: string[] | null;
1116
+ weeklies?: string[] | null;
1117
+ monthlies?: string[] | null;
1118
+ leaps?: string[] | null;
1119
+ dates?: string[] | null;
1120
+ first?: string | null;
1074
1121
  }
1075
1122
  export interface AesMidasOptionGreek {
1076
1123
  /** @format double */
1077
- delta?: number;
1124
+ delta?: number | null;
1078
1125
  /** @format double */
1079
- gamma?: number;
1126
+ gamma?: number | null;
1080
1127
  /** @format double */
1081
- theta?: number;
1128
+ theta?: number | null;
1082
1129
  /** @format double */
1083
- vega?: number;
1130
+ vega?: number | null;
1084
1131
  /** @format double */
1085
- rho?: number;
1132
+ rho?: number | null;
1086
1133
  /** @format double */
1087
- implied_volatility?: number;
1134
+ implied_volatility?: number | null;
1088
1135
  /** @format double */
1089
- risk_free_rate?: number;
1136
+ risk_free_rate?: number | null;
1090
1137
  not_found?: boolean;
1091
1138
  }
1092
1139
  export interface AesMidasOptionGreekReformat {
1093
1140
  /** @format double */
1094
- delta?: number;
1141
+ delta?: number | null;
1095
1142
  /** @format double */
1096
- gamma?: number;
1143
+ gamma?: number | null;
1097
1144
  /** @format double */
1098
- theta?: number;
1145
+ theta?: number | null;
1099
1146
  /** @format double */
1100
- vega?: number;
1147
+ vega?: number | null;
1101
1148
  /** @format double */
1102
- rho?: number;
1149
+ rho?: number | null;
1103
1150
  not_found?: boolean;
1104
1151
  }
1105
1152
  export interface AesMidasOptionL1 {
1106
1153
  symbol?: string | null;
1154
+ not_found?: boolean;
1155
+ exch?: string | null;
1107
1156
  bid_exch?: string | null;
1108
1157
  /** @format double */
1109
1158
  bid_px?: number;
@@ -1136,6 +1185,8 @@ export interface AesMidasOptionL1 {
1136
1185
  strike?: number;
1137
1186
  /** @format int32 */
1138
1187
  prime_share?: number;
1188
+ prime_exch?: string | null;
1189
+ prime_exch_name?: string | null;
1139
1190
  expire?: string | null;
1140
1191
  data_source?: string | null;
1141
1192
  }
@@ -2727,36 +2778,14 @@ export class Quote<HandleError extends boolean = boolean> {
2727
2778
  }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasTop20[], HandleError>>;
2728
2779
  /**
2729
2780
  * @tags Quote
2730
- * @name GetOptionChain
2731
- * @summary Query Option Chain data - All users - available in Microservice
2732
- * @request GET:/api/quote/option-chain
2781
+ * @name GetOptionChainDates
2782
+ * @summary Query Option Chain dates - All users - available in Microservice
2783
+ * @request GET:/api/quote/option-chain-dates
2733
2784
  * @secure
2734
2785
  */
2735
- getOptionChain(query?: {
2786
+ getOptionChainDates(query?: {
2736
2787
  /** Allow one underlying symbol */
2737
- underlying?: string;
2738
- /**
2739
- * optional
2740
- * @format double
2741
- * @default -1
2742
- */
2743
- strike_low?: number;
2744
- /**
2745
- * optional
2746
- * @format double
2747
- * @default -1
2748
- */
2749
- strike_high?: number;
2750
- /**
2751
- * optional
2752
- * @format date-time
2753
- */
2754
- 'start_date(UTC)'?: string;
2755
- /**
2756
- * optional
2757
- * @format date-time
2758
- */
2759
- 'end_date(UTC)'?: string;
2788
+ symbol?: string;
2760
2789
  /**
2761
2790
  * Optional. Default is false. If true, response will be camel case
2762
2791
  * @default false
@@ -2769,39 +2798,19 @@ export class Quote<HandleError extends boolean = boolean> {
2769
2798
  user_name?: string;
2770
2799
  /** @default "" */
2771
2800
  platform?: string;
2772
- }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionChain[], HandleError>>;
2801
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionChainDates[], HandleError>>;
2773
2802
  /**
2774
2803
  * @tags Quote
2775
- * @name GetOptionChainWithPaging
2804
+ * @name GetOptionChain
2776
2805
  * @summary Query Option Chain data - All users - available in Microservice
2777
- * @request GET:/api/quote/option-chain-with-paging
2806
+ * @request GET:/api/quote/option-chain
2778
2807
  * @secure
2779
2808
  */
2780
- getOptionChainWithPaging(data: AesMidasQueryPostBody, query?: {
2809
+ getOptionChain(query?: {
2781
2810
  /** Allow one underlying symbol */
2782
2811
  underlying?: string;
2783
- /**
2784
- * optional
2785
- * @format double
2786
- * @default -1
2787
- */
2788
- strike_low?: number;
2789
- /**
2790
- * optional
2791
- * @format double
2792
- * @default -1
2793
- */
2794
- strike_high?: number;
2795
- /**
2796
- * optional
2797
- * @format date-time
2798
- */
2799
- 'start_date(UTC)'?: string;
2800
- /**
2801
- * optional
2802
- * @format date-time
2803
- */
2804
- 'end_date(UTC)'?: string;
2812
+ /** allow one date, format YYYY-MM-DD */
2813
+ date?: string;
2805
2814
  /**
2806
2815
  * Optional. Default is false. If true, response will be camel case
2807
2816
  * @default false
@@ -2814,7 +2823,7 @@ export class Quote<HandleError extends boolean = boolean> {
2814
2823
  user_name?: string;
2815
2824
  /** @default "" */
2816
2825
  platform?: string;
2817
- }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionChainResponsewithPagination, HandleError>>;
2826
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionChain[], HandleError>>;
2818
2827
  /**
2819
2828
  * @tags Quote
2820
2829
  * @name GetOptionLevel1
@@ -2823,8 +2832,8 @@ export class Quote<HandleError extends boolean = boolean> {
2823
2832
  * @secure
2824
2833
  */
2825
2834
  getOptionLevel1(query?: {
2826
- /** Allow one option symbol. Format {Underlying Symbol}yymmdd{C/P}{Strike price*1000, total 8 digits} */
2827
- option_name?: string;
2835
+ /** Allow multiple option symbols, separated by ','. Format {Underlying Symbol}yymmdd{C/P}{Strike price*1000, total 8 digits} */
2836
+ option_names?: string;
2828
2837
  /**
2829
2838
  * Optional. Default is false. If true, response will be camel case
2830
2839
  * @default false
@@ -2837,7 +2846,7 @@ export class Quote<HandleError extends boolean = boolean> {
2837
2846
  user_name?: string;
2838
2847
  /** @default "" */
2839
2848
  platform?: string;
2840
- }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionL1, HandleError>>;
2849
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionL1[], HandleError>>;
2841
2850
  /**
2842
2851
  * @tags Quote
2843
2852
  * @name GetOptionLevel1WithGreek
@@ -2846,8 +2855,8 @@ export class Quote<HandleError extends boolean = boolean> {
2846
2855
  * @secure
2847
2856
  */
2848
2857
  getOptionLevel1WithGreek(query?: {
2849
- /** Allow one option symbol. Format {Underlying Symbol}yymmdd{C/P}{Strike price*1000, total 8 digits} */
2850
- option_name?: string;
2858
+ /** Allow multiple symbols, separated by ','. Format {Underlying Symbol}yymmdd{C/P}{Strike price*1000, total 8 digits} */
2859
+ option_names?: string;
2851
2860
  /**
2852
2861
  * Optional. Default is false. If true, response will be camel case
2853
2862
  * @default false
@@ -2865,7 +2874,7 @@ export class Quote<HandleError extends boolean = boolean> {
2865
2874
  user_name?: string;
2866
2875
  /** @default "" */
2867
2876
  platform?: string;
2868
- }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionL1WithGreeks, HandleError>>;
2877
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasOptionL1WithGreeks[], HandleError>>;
2869
2878
  /**
2870
2879
  * @tags Quote
2871
2880
  * @name GetEquiductLevel1
@@ -2906,7 +2915,7 @@ export class Quote<HandleError extends boolean = boolean> {
2906
2915
  response_camel_case?: boolean;
2907
2916
  /** @default "" */
2908
2917
  platform?: string;
2909
- }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasBond[], HandleError>>;
2918
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<AesMidasBondWholeApex[], HandleError>>;
2910
2919
  /**
2911
2920
  * @tags Quote
2912
2921
  * @name GetBondsSearch
@@ -3190,6 +3199,17 @@ export class QuotesReformat<HandleError extends boolean = boolean> {
3190
3199
  /** @default "" */
3191
3200
  platform?: string;
3192
3201
  }, config?: RequestConfig<HandleError>): Promise<ClientResponse<any, HandleError>>;
3202
+ /**
3203
+ * @tags QuotesReformat
3204
+ * @name GetOptionChainDates
3205
+ * @summary Query Option Chain dates - All users - available in Microservice
3206
+ * @request GET:/api/quotes/option/chain/dates/{symbol}
3207
+ * @secure
3208
+ */
3209
+ getOptionChainDates(symbol: string, query?: {
3210
+ /** @default "" */
3211
+ platform?: string;
3212
+ }, config?: RequestConfig<HandleError>): Promise<ClientResponse<any, HandleError>>;
3193
3213
  /**
3194
3214
  * @tags QuotesReformat
3195
3215
  * @name GetOptionChain