@databolsa/sdk 1.0.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.
- package/LICENSE +201 -0
- package/README.md +56 -0
- package/package.json +45 -0
- package/src/client.ts +148 -0
- package/src/http-client.ts +412 -0
- package/src/index.ts +26 -0
- package/src/schema.ts +2466 -0
- package/src/types.ts +90 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { components, operations } from "./schema";
|
|
2
|
+
|
|
3
|
+
/** Corpo JSON da resposta 200 de uma operação do contrato. */
|
|
4
|
+
export type Ok<Op extends keyof operations> = operations[Op] extends {
|
|
5
|
+
responses: { 200: { content: { "application/json": infer T } } };
|
|
6
|
+
}
|
|
7
|
+
? T
|
|
8
|
+
: never;
|
|
9
|
+
|
|
10
|
+
/** Parâmetros de query de uma operação do contrato (sem o `| undefined`). */
|
|
11
|
+
export type Query<Op extends keyof operations> = operations[Op] extends {
|
|
12
|
+
parameters: { query?: infer Q };
|
|
13
|
+
}
|
|
14
|
+
? NonNullable<Q>
|
|
15
|
+
: never;
|
|
16
|
+
|
|
17
|
+
export type Schemas = components["schemas"];
|
|
18
|
+
|
|
19
|
+
// --- objetos de domínio (schemas do contrato) -----------------------------
|
|
20
|
+
export type Lineage = Schemas["Lineage"];
|
|
21
|
+
export type Company = Schemas["Company"];
|
|
22
|
+
export type Stock = Schemas["Stock"];
|
|
23
|
+
export type Quote = Schemas["Quote"];
|
|
24
|
+
export type IndicatorValue = Schemas["IndicatorValue"];
|
|
25
|
+
export type Observation = Schemas["Observation"];
|
|
26
|
+
export type Document = Schemas["Document"];
|
|
27
|
+
export type Dividend = Schemas["Dividend"];
|
|
28
|
+
export type CorporateEvent = Schemas["CorporateEvent"];
|
|
29
|
+
export type Fii = Schemas["Fii"];
|
|
30
|
+
export type FiiDistribution = Schemas["FiiDistribution"];
|
|
31
|
+
export type FiiMonthlyReport = Schemas["FiiMonthlyReport"];
|
|
32
|
+
export type FiiListRow = Schemas["FiiListRow"];
|
|
33
|
+
export type SeriesMeta = Schemas["SeriesMeta"];
|
|
34
|
+
export type TesouroBondQuote = Schemas["TesouroBondQuote"];
|
|
35
|
+
export type IndexMeta = Schemas["IndexMeta"];
|
|
36
|
+
export type Expectation = Schemas["Expectation"];
|
|
37
|
+
export type RegimeSnapshot = Schemas["RegimeSnapshot"];
|
|
38
|
+
export type RegimeSignal = Schemas["RegimeSignal"];
|
|
39
|
+
export type ScreenerRow = Schemas["ScreenerRow"];
|
|
40
|
+
export type CryptoCandle = Schemas["CryptoCandle"];
|
|
41
|
+
export type SearchResult = Schemas["SearchResult"];
|
|
42
|
+
export type InsiderMove = Schemas["InsiderMove"];
|
|
43
|
+
export type OptionContract = Schemas["OptionContract"];
|
|
44
|
+
export type OptionExpiry = Schemas["OptionExpiries"]["expiries"][number];
|
|
45
|
+
export type OptionQuote = Schemas["OptionQuote"];
|
|
46
|
+
export type BdrProfile = Schemas["BdrProfile"];
|
|
47
|
+
export type BdrQuote = Schemas["BdrQuote"];
|
|
48
|
+
export type IngestSourceStatus = Schemas["IngestSourceHealth"]["status"];
|
|
49
|
+
export type IngestSourceHealth = Schemas["IngestSourceHealth"];
|
|
50
|
+
export type IngestRunSummary = Schemas["IngestRunSummary"];
|
|
51
|
+
|
|
52
|
+
// --- respostas (corpo 200 de cada operação) -------------------------------
|
|
53
|
+
export type HealthResponse = Ok<"getHealth">;
|
|
54
|
+
export type IngestHealthResponse = Ok<"getIngestHealth">;
|
|
55
|
+
export type ScreenStocksResponse = Ok<"screenStocks">;
|
|
56
|
+
export type FiiScreenResponse = Ok<"screenFiis">;
|
|
57
|
+
export type QuotesResponse = Ok<"listQuotes">;
|
|
58
|
+
export type StockIndicatorsResponse = Ok<"getStockIndicators">;
|
|
59
|
+
export type IndicatorHistoryResponse = Ok<"getStockIndicatorHistory">;
|
|
60
|
+
export type DividendsResponse = Ok<"listDividends">;
|
|
61
|
+
export type CorporateEventsResponse = Ok<"listCorporateEvents">;
|
|
62
|
+
export type DocumentsResponse = Ok<"listCompanyDocuments">;
|
|
63
|
+
export type InsiderResponse = Ok<"listInsiderMoves">;
|
|
64
|
+
export type FiiIndicatorsResponse = Ok<"getFiiIndicators">;
|
|
65
|
+
export type FiiDistributionsResponse = Ok<"listFiiDistributions">;
|
|
66
|
+
export type FiiReportsResponse = Ok<"listFiiReports">;
|
|
67
|
+
export type SeriesResponse = Ok<"getSeries">;
|
|
68
|
+
export type IndexQuotesResponse = Ok<"listIndexQuotes">;
|
|
69
|
+
export type IndexCompositionResponse = Ok<"getIndexComposition">;
|
|
70
|
+
export type YieldCurveResponse = Ok<"getYieldCurve">;
|
|
71
|
+
export type TesouroBondsResponse = Ok<"listTesouroBonds">;
|
|
72
|
+
export type ExpectationsResponse = Ok<"getMarketExpectations">;
|
|
73
|
+
export type MacroGearsResponse = Ok<"getMacroGears">;
|
|
74
|
+
export type CryptoQuotesResponse = Ok<"listCryptoQuotes">;
|
|
75
|
+
export type SearchResponse = Ok<"search">;
|
|
76
|
+
export type OptionsChainResponse = Ok<"getOptionsChain">;
|
|
77
|
+
export type OptionExpiriesResponse = Ok<"listOptionExpiries">;
|
|
78
|
+
export type OptionsQuotesResponse = Ok<"listOptionQuotes">;
|
|
79
|
+
export type BdrListResponse = Ok<"listBdrs">;
|
|
80
|
+
export type BdrQuotesResponse = Ok<"listBdrQuotes">;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Agrupamento client-side de `from`/`to` (datas ISO) — não é um schema do
|
|
84
|
+
* contrato; os endpoints os recebem como query params soltos. Único tipo
|
|
85
|
+
* mantido à mão de propósito.
|
|
86
|
+
*/
|
|
87
|
+
export interface RangeParams {
|
|
88
|
+
from?: string;
|
|
89
|
+
to?: string;
|
|
90
|
+
}
|