@databolsa/sdk 1.0.11 → 1.0.13
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/client.d.ts +54 -1
- package/dist/http-client.d.ts +40 -1
- package/dist/index.js +76 -0
- package/dist/schema.d.ts +963 -34
- package/dist/types.d.ts +24 -5
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CorporateEventsResponse, CryptoQuotesResponse, DividendsResponse, DocumentsResponse, EtfListResponse, EtfProfile, ExpectationsResponse, Fii, FiiDistributionsResponse, FiiIndicatorsResponse, FiiReportsResponse, FiiScreenResponse, FundHoldersResponse, FundHoldingsResponse, FundListResponse, FundProfile, FundQuotesResponse, FundScreenerResponse, HealthResponse, IngestHealthResponse, IndexCompositionResponse, IndexMeta, IndexQuotesResponse, IndicatorHistoryResponse, IntradaySeriesResponse, LiveQuotesResponse, BdrListResponse, BdrProfile, BdrQuotesResponse, InsiderResponse, InvestorFlowMonthlyResponse, InvestorFlowResponse, MacroGearsResponse, OfferingsResponse, OptionExpiriesResponse, OptionsChainResponse, OptionsQuotesResponse, DocumentSearchResponse, PortfolioResponse, CommunityBotsResponse, CommunityBotPostInput, CommunityBotPostResponse, CommunityBotReplyResponse, CommunityFeedParams, CommunityFeedResponse, CommunityPostResponse, RegisterCommunityBotInput, RegisterCommunityBotResponse, Query, QuotesResponse, RangeParams, RegimeSnapshot, ScreenStocksResponse, SearchDocumentsParams, SearchResult, SeriesResponse, Stock, StockIndicatorsResponse, SuitabilityResponse, TesouroBondsResponse, TradeStatsResponse, YieldCurveResponse, AddPortfolioTransactionResponse, CreatePortfolioResponse, PortfolioAssetRef, PortfolioDetail, PortfolioHistoryResponse, PortfolioImportInput, PortfolioImportRowsResponse, PortfolioImportsResponse, PortfolioImportSummary, PortfolioPatch, PortfolioRfContract, PortfolioTransaction, PortfolioTransactionInput, PortfolioTransactionPatch, PortfoliosResponse, PortfolioTransactionsResponse } from "./types";
|
|
1
|
+
import type { CorporateEventsResponse, CryptoAsset, CryptoListResponse, CryptoLiveResponse, CryptoQuotesResponse, UsAssetsResponse, UsAssetDetail, UsQuotesResponse, UsFilingsResponse, DividendsResponse, DocumentsResponse, EtfListResponse, EtfProfile, ExpectationsResponse, Fii, FiiDistributionsResponse, FiiIndicatorsResponse, FiiReportsResponse, FiiScreenResponse, FundHoldersResponse, FundHoldingsResponse, FundListResponse, FundProfile, FundQuotesResponse, FundScreenerResponse, HealthResponse, IngestHealthResponse, IndexCompositionResponse, IndexMeta, IndexQuotesResponse, IndicatorHistoryResponse, IntradaySeriesResponse, LiveQuotesResponse, BdrListResponse, BdrProfile, BdrQuotesResponse, InsiderResponse, InvestorFlowMonthlyResponse, InvestorFlowResponse, MacroGearsResponse, OfferingsResponse, OptionExpiriesResponse, OptionsChainResponse, OptionsQuotesResponse, DocumentSearchResponse, PortfolioResponse, CommunityBotsResponse, CommunityBotPostInput, CommunityBotPostResponse, CommunityBotReplyResponse, CommunityFeedParams, CommunityFeedResponse, CommunityPostResponse, RegisterCommunityBotInput, RegisterCommunityBotResponse, Query, QuotesResponse, RangeParams, RegimeSnapshot, ScreenStocksResponse, SearchDocumentsParams, SearchResult, SeriesResponse, Stock, StockIndicatorsResponse, SuitabilityResponse, TesouroBondsResponse, TradeStatsResponse, YieldCurveResponse, AddPortfolioTransactionResponse, CreatePortfolioResponse, PortfolioAssetRef, PortfolioDetail, PortfolioHistoryResponse, PortfolioImportInput, PortfolioImportRowsResponse, PortfolioImportsResponse, PortfolioImportSummary, PortfolioPatch, PortfolioRfContract, PortfolioTransaction, PortfolioTransactionInput, PortfolioTransactionPatch, PortfoliosResponse, PortfolioTransactionsResponse, ThesesResponse, ThesisResponse, CreateThesisResponse, ThesisExportStatus, ThesisWriteInput } from "./types";
|
|
2
2
|
/** Filtros do screener de ações — derivados de `GET /v1/screener/stocks`. */
|
|
3
3
|
export type ScreenStocksParams = Query<"screenStocks">;
|
|
4
4
|
/**
|
|
@@ -155,10 +155,40 @@ export interface DataBolsaClient {
|
|
|
155
155
|
getMacroGears(params?: {
|
|
156
156
|
gear?: string;
|
|
157
157
|
}): Promise<MacroGearsResponse>;
|
|
158
|
+
/** Catálogo de criptoativos (paginado; busca por símbolo/nome). */
|
|
159
|
+
listCrypto(params?: {
|
|
160
|
+
search?: string;
|
|
161
|
+
limit?: number;
|
|
162
|
+
cursor?: string;
|
|
163
|
+
}): Promise<CryptoListResponse>;
|
|
164
|
+
getCrypto(symbol: string): Promise<CryptoAsset>;
|
|
165
|
+
/** Snapshot quase-live (~1 min, 24/7) de todo o universo de cripto. */
|
|
166
|
+
listCryptoLive(): Promise<CryptoLiveResponse>;
|
|
158
167
|
listCryptoQuotes(symbol: string, params?: RangeParams & {
|
|
159
168
|
interval?: "1d" | "1h";
|
|
160
169
|
limit?: number;
|
|
161
170
|
}): Promise<CryptoQuotesResponse>;
|
|
171
|
+
/** Catálogo de ativos dos EUA (paginado; filtra por tipo, busca por ticker/nome). */
|
|
172
|
+
listUsAssets(params?: {
|
|
173
|
+
search?: string;
|
|
174
|
+
type?: "stock" | "etf";
|
|
175
|
+
bdr?: string;
|
|
176
|
+
limit?: number;
|
|
177
|
+
cursor?: string;
|
|
178
|
+
}): Promise<UsAssetsResponse>;
|
|
179
|
+
/** Perfil de um ativo dos EUA com fundamentos SEC inline. */
|
|
180
|
+
getUsAsset(ticker: string): Promise<UsAssetDetail>;
|
|
181
|
+
/** Cotações EOD em USD (ajustadas por desdobramento na fonte). */
|
|
182
|
+
listUsAssetQuotes(ticker: string, params?: RangeParams & {
|
|
183
|
+
limit?: number;
|
|
184
|
+
cursor?: string;
|
|
185
|
+
}): Promise<UsQuotesResponse>;
|
|
186
|
+
/** Filings SEC (10-K/10-Q/8-K…) com link do documento no EDGAR. */
|
|
187
|
+
listUsFilings(ticker: string, params?: {
|
|
188
|
+
form?: string;
|
|
189
|
+
limit?: number;
|
|
190
|
+
cursor?: string;
|
|
191
|
+
}): Promise<UsFilingsResponse>;
|
|
162
192
|
/** Cadeia viva de um subjacente (séries não vencidas, mais negociadas). Filtra por vencimento/tipo. */
|
|
163
193
|
listOptionsChain(underlying: string, params?: {
|
|
164
194
|
expiry?: string;
|
|
@@ -208,6 +238,29 @@ export interface DataBolsaClient {
|
|
|
208
238
|
deletePortfolio(id: string): Promise<{
|
|
209
239
|
deleted?: boolean;
|
|
210
240
|
}>;
|
|
241
|
+
/** Lista as suas teses (resumo + limite do plano). */
|
|
242
|
+
listMyTheses(): Promise<ThesesResponse>;
|
|
243
|
+
/** Cria uma tese a partir de um ReportDoc (validado no servidor; 402 no teto do plano). */
|
|
244
|
+
createThesis(input: ThesisWriteInput): Promise<CreateThesisResponse>;
|
|
245
|
+
/** Cria uma tese enviando o arquivo JSON do doc em base64 (caminho do CLI `--file`). */
|
|
246
|
+
importThesisFile(input: {
|
|
247
|
+
filename?: string;
|
|
248
|
+
contentBase64: string;
|
|
249
|
+
visibility?: "private" | "unlisted" | "public";
|
|
250
|
+
showPersonal?: boolean;
|
|
251
|
+
}): Promise<CreateThesisResponse>;
|
|
252
|
+
/** Documento completo + status do export. */
|
|
253
|
+
getThesis(id: string): Promise<ThesisResponse>;
|
|
254
|
+
/** Atualiza doc e/ou visibilidade. */
|
|
255
|
+
updateThesis(id: string, patch: Partial<ThesisWriteInput>): Promise<ThesisResponse>;
|
|
256
|
+
/** APAGA a tese (irreversível). */
|
|
257
|
+
deleteThesis(id: string): Promise<{
|
|
258
|
+
deleted?: boolean;
|
|
259
|
+
}>;
|
|
260
|
+
/** Muda a visibilidade (public aparece no perfil; seções pessoais redigidas por default). */
|
|
261
|
+
publishThesis(id: string, visibility: "private" | "unlisted" | "public", showPersonal?: boolean): Promise<ThesisResponse>;
|
|
262
|
+
/** Exporta em PDF (plano pago): 202 queued ou 200 ready com o link. */
|
|
263
|
+
exportThesis(id: string): Promise<ThesisExportStatus>;
|
|
211
264
|
/** Histórico mensal de UMA carteira. */
|
|
212
265
|
getPortfolioHistoryById(id: string): Promise<PortfolioHistoryResponse>;
|
|
213
266
|
/** Adiciona um ativo à carteira (idempotente; sem transações = watchlist). */
|
package/dist/http-client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DataBolsaClient, type LiveQuotesParams, type ScreenFiisParams, type ScreenFundsParams, type ScreenStocksParams } from "./client";
|
|
2
|
-
import type { AddPortfolioTransactionResponse, CreatePortfolioResponse, PortfolioAssetRef, PortfolioDetail, PortfolioHistoryResponse, PortfolioImportInput, PortfolioImportRowsResponse, PortfolioImportsResponse, PortfolioImportSummary, PortfolioPatch, PortfolioRfContract, PortfolioTransaction, PortfolioTransactionInput, PortfolioTransactionPatch, PortfoliosResponse, PortfolioTransactionsResponse, CorporateEventsResponse, CryptoQuotesResponse, DividendsResponse, DocumentSearchResponse, DocumentsResponse, EtfListResponse, EtfProfile, ExpectationsResponse, Fii, FiiDistributionsResponse, FiiIndicatorsResponse, FiiReportsResponse, FiiScreenResponse, FundHoldersResponse, FundHoldingsResponse, FundListResponse, FundProfile, FundQuotesResponse, FundScreenerResponse, HealthResponse, IngestHealthResponse, IndexCompositionResponse, IndexMeta, IndexQuotesResponse, IndicatorHistoryResponse, IntradaySeriesResponse, LiveQuotesResponse, BdrListResponse, BdrProfile, BdrQuotesResponse, InsiderResponse, InvestorFlowMonthlyResponse, InvestorFlowResponse, MacroGearsResponse, OfferingsResponse, OptionExpiriesResponse, OptionsChainResponse, OptionsQuotesResponse, PortfolioResponse, CommunityBotsResponse, CommunityBotPostInput, CommunityBotPostResponse, CommunityBotReplyResponse, CommunityFeedParams, CommunityFeedResponse, CommunityPostResponse, RegisterCommunityBotInput, RegisterCommunityBotResponse, QuotesResponse, RangeParams, RegimeSnapshot, ScreenStocksResponse, SearchDocumentsParams, SearchResult, SeriesResponse, Stock, StockIndicatorsResponse, SuitabilityResponse, TesouroBondsResponse, TradeStatsResponse, YieldCurveResponse } from "./types";
|
|
2
|
+
import type { AddPortfolioTransactionResponse, CreatePortfolioResponse, PortfolioAssetRef, PortfolioDetail, PortfolioHistoryResponse, PortfolioImportInput, PortfolioImportRowsResponse, PortfolioImportsResponse, PortfolioImportSummary, PortfolioPatch, PortfolioRfContract, PortfolioTransaction, PortfolioTransactionInput, PortfolioTransactionPatch, PortfoliosResponse, PortfolioTransactionsResponse, CorporateEventsResponse, CryptoAsset, CryptoListResponse, CryptoLiveResponse, CryptoQuotesResponse, UsAssetsResponse, UsAssetDetail, UsQuotesResponse, UsFilingsResponse, DividendsResponse, DocumentSearchResponse, DocumentsResponse, EtfListResponse, EtfProfile, ExpectationsResponse, Fii, FiiDistributionsResponse, FiiIndicatorsResponse, FiiReportsResponse, FiiScreenResponse, FundHoldersResponse, FundHoldingsResponse, FundListResponse, FundProfile, FundQuotesResponse, FundScreenerResponse, HealthResponse, IngestHealthResponse, IndexCompositionResponse, IndexMeta, IndexQuotesResponse, IndicatorHistoryResponse, IntradaySeriesResponse, LiveQuotesResponse, BdrListResponse, BdrProfile, BdrQuotesResponse, InsiderResponse, InvestorFlowMonthlyResponse, InvestorFlowResponse, MacroGearsResponse, OfferingsResponse, OptionExpiriesResponse, OptionsChainResponse, OptionsQuotesResponse, PortfolioResponse, CommunityBotsResponse, CommunityBotPostInput, CommunityBotPostResponse, CommunityBotReplyResponse, CommunityFeedParams, CommunityFeedResponse, CommunityPostResponse, RegisterCommunityBotInput, RegisterCommunityBotResponse, QuotesResponse, RangeParams, RegimeSnapshot, ScreenStocksResponse, SearchDocumentsParams, SearchResult, SeriesResponse, Stock, StockIndicatorsResponse, SuitabilityResponse, TesouroBondsResponse, TradeStatsResponse, YieldCurveResponse, ThesesResponse, ThesisResponse, CreateThesisResponse, ThesisExportStatus, ThesisWriteInput } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Cliente HTTP da Serving API do DataBolsa. Os métodos públicos espelham os
|
|
5
5
|
* operationIds do OpenAPI e retornam tipos gerados.
|
|
@@ -137,10 +137,34 @@ export declare class HttpClient implements DataBolsaClient {
|
|
|
137
137
|
getMacroGears(params?: {
|
|
138
138
|
gear?: string;
|
|
139
139
|
}): Promise<MacroGearsResponse>;
|
|
140
|
+
listCrypto(params?: {
|
|
141
|
+
search?: string;
|
|
142
|
+
limit?: number;
|
|
143
|
+
cursor?: string;
|
|
144
|
+
}): Promise<CryptoListResponse>;
|
|
145
|
+
getCrypto(symbol: string): Promise<CryptoAsset>;
|
|
146
|
+
listCryptoLive(): Promise<CryptoLiveResponse>;
|
|
140
147
|
listCryptoQuotes(symbol: string, params?: RangeParams & {
|
|
141
148
|
interval?: "1d" | "1h";
|
|
142
149
|
limit?: number;
|
|
143
150
|
}): Promise<CryptoQuotesResponse>;
|
|
151
|
+
listUsAssets(params?: {
|
|
152
|
+
search?: string;
|
|
153
|
+
type?: "stock" | "etf";
|
|
154
|
+
bdr?: string;
|
|
155
|
+
limit?: number;
|
|
156
|
+
cursor?: string;
|
|
157
|
+
}): Promise<UsAssetsResponse>;
|
|
158
|
+
getUsAsset(ticker: string): Promise<UsAssetDetail>;
|
|
159
|
+
listUsAssetQuotes(ticker: string, params?: RangeParams & {
|
|
160
|
+
limit?: number;
|
|
161
|
+
cursor?: string;
|
|
162
|
+
}): Promise<UsQuotesResponse>;
|
|
163
|
+
listUsFilings(ticker: string, params?: {
|
|
164
|
+
form?: string;
|
|
165
|
+
limit?: number;
|
|
166
|
+
cursor?: string;
|
|
167
|
+
}): Promise<UsFilingsResponse>;
|
|
144
168
|
listOptionsChain(underlying: string, params?: {
|
|
145
169
|
expiry?: string;
|
|
146
170
|
type?: "call" | "put";
|
|
@@ -183,6 +207,21 @@ export declare class HttpClient implements DataBolsaClient {
|
|
|
183
207
|
deletePortfolio(id: string): Promise<{
|
|
184
208
|
deleted?: boolean;
|
|
185
209
|
}>;
|
|
210
|
+
listMyTheses(): Promise<ThesesResponse>;
|
|
211
|
+
createThesis(input: ThesisWriteInput): Promise<CreateThesisResponse>;
|
|
212
|
+
importThesisFile(input: {
|
|
213
|
+
filename?: string;
|
|
214
|
+
contentBase64: string;
|
|
215
|
+
visibility?: "private" | "unlisted" | "public";
|
|
216
|
+
showPersonal?: boolean;
|
|
217
|
+
}): Promise<CreateThesisResponse>;
|
|
218
|
+
getThesis(id: string): Promise<ThesisResponse>;
|
|
219
|
+
updateThesis(id: string, patch: Partial<ThesisWriteInput>): Promise<ThesisResponse>;
|
|
220
|
+
deleteThesis(id: string): Promise<{
|
|
221
|
+
deleted?: boolean;
|
|
222
|
+
}>;
|
|
223
|
+
publishThesis(id: string, visibility: "private" | "unlisted" | "public", showPersonal?: boolean): Promise<ThesisResponse>;
|
|
224
|
+
exportThesis(id: string): Promise<ThesisExportStatus>;
|
|
186
225
|
getPortfolioHistoryById(id: string): Promise<PortfolioHistoryResponse>;
|
|
187
226
|
addPortfolioAsset(id: string, asset: PortfolioAssetRef): Promise<unknown>;
|
|
188
227
|
removePortfolioAsset(id: string, asset: PortfolioAssetRef): Promise<unknown>;
|
package/dist/index.js
CHANGED
|
@@ -336,6 +336,19 @@ class HttpClient {
|
|
|
336
336
|
getMacroGears(params) {
|
|
337
337
|
return this.request("/macro/gears", { gear: params?.gear });
|
|
338
338
|
}
|
|
339
|
+
listCrypto(params) {
|
|
340
|
+
return this.request("/crypto", {
|
|
341
|
+
search: params?.search,
|
|
342
|
+
limit: params?.limit,
|
|
343
|
+
cursor: params?.cursor
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
getCrypto(symbol) {
|
|
347
|
+
return this.request(`/crypto/${enc(symbol)}`);
|
|
348
|
+
}
|
|
349
|
+
listCryptoLive() {
|
|
350
|
+
return this.request("/crypto/live");
|
|
351
|
+
}
|
|
339
352
|
listCryptoQuotes(symbol, params) {
|
|
340
353
|
return this.request(`/crypto/${enc(symbol)}/quotes`, {
|
|
341
354
|
interval: params?.interval,
|
|
@@ -344,6 +357,33 @@ class HttpClient {
|
|
|
344
357
|
limit: params?.limit
|
|
345
358
|
});
|
|
346
359
|
}
|
|
360
|
+
listUsAssets(params) {
|
|
361
|
+
return this.request("/us/assets", {
|
|
362
|
+
search: params?.search,
|
|
363
|
+
type: params?.type,
|
|
364
|
+
bdr: params?.bdr,
|
|
365
|
+
limit: params?.limit,
|
|
366
|
+
cursor: params?.cursor
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
getUsAsset(ticker) {
|
|
370
|
+
return this.request(`/us/assets/${enc(ticker)}`);
|
|
371
|
+
}
|
|
372
|
+
listUsAssetQuotes(ticker, params) {
|
|
373
|
+
return this.request(`/us/assets/${enc(ticker)}/quotes`, {
|
|
374
|
+
from: params?.from,
|
|
375
|
+
to: params?.to,
|
|
376
|
+
limit: params?.limit,
|
|
377
|
+
cursor: params?.cursor
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
listUsFilings(ticker, params) {
|
|
381
|
+
return this.request(`/us/assets/${enc(ticker)}/filings`, {
|
|
382
|
+
form: params?.form,
|
|
383
|
+
limit: params?.limit,
|
|
384
|
+
cursor: params?.cursor
|
|
385
|
+
});
|
|
386
|
+
}
|
|
347
387
|
listOptionsChain(underlying, params) {
|
|
348
388
|
return this.request(`/options/${enc(underlying)}/chain`, {
|
|
349
389
|
expiry: params?.expiry,
|
|
@@ -454,6 +494,42 @@ class HttpClient {
|
|
|
454
494
|
deletePortfolio(id) {
|
|
455
495
|
return this.request(`/portfolios/${enc(id)}`, undefined, { method: "DELETE" });
|
|
456
496
|
}
|
|
497
|
+
listMyTheses() {
|
|
498
|
+
return this.request("/theses");
|
|
499
|
+
}
|
|
500
|
+
createThesis(input) {
|
|
501
|
+
return this.request("/theses", undefined, {
|
|
502
|
+
method: "POST",
|
|
503
|
+
body: { doc: input.doc, visibility: input.visibility, show_personal: input.showPersonal }
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
importThesisFile(input) {
|
|
507
|
+
return this.request("/theses/import", undefined, {
|
|
508
|
+
method: "POST",
|
|
509
|
+
body: { filename: input.filename, content_base64: input.contentBase64, visibility: input.visibility, show_personal: input.showPersonal }
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
getThesis(id) {
|
|
513
|
+
return this.request(`/theses/${enc(id)}`);
|
|
514
|
+
}
|
|
515
|
+
updateThesis(id, patch) {
|
|
516
|
+
return this.request(`/theses/${enc(id)}`, undefined, {
|
|
517
|
+
method: "PUT",
|
|
518
|
+
body: { doc: patch.doc, visibility: patch.visibility, show_personal: patch.showPersonal }
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
deleteThesis(id) {
|
|
522
|
+
return this.request(`/theses/${enc(id)}`, undefined, { method: "DELETE" });
|
|
523
|
+
}
|
|
524
|
+
publishThesis(id, visibility, showPersonal) {
|
|
525
|
+
return this.request(`/theses/${enc(id)}/publish`, undefined, {
|
|
526
|
+
method: "POST",
|
|
527
|
+
body: { visibility, show_personal: showPersonal }
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
exportThesis(id) {
|
|
531
|
+
return this.request(`/theses/${enc(id)}/export`, undefined, { method: "POST", body: {} });
|
|
532
|
+
}
|
|
457
533
|
getPortfolioHistoryById(id) {
|
|
458
534
|
return this.request(`/portfolios/${enc(id)}/history`);
|
|
459
535
|
}
|