@databolsa/sdk 1.0.12 → 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 +24 -1
- package/dist/http-client.d.ts +16 -1
- package/dist/index.js +36 -0
- package/dist/schema.d.ts +464 -5
- package/dist/types.d.ts +17 -5
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 } 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
|
/**
|
|
@@ -238,6 +238,29 @@ export interface DataBolsaClient {
|
|
|
238
238
|
deletePortfolio(id: string): Promise<{
|
|
239
239
|
deleted?: boolean;
|
|
240
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>;
|
|
241
264
|
/** Histórico mensal de UMA carteira. */
|
|
242
265
|
getPortfolioHistoryById(id: string): Promise<PortfolioHistoryResponse>;
|
|
243
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, 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 } 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.
|
|
@@ -207,6 +207,21 @@ export declare class HttpClient implements DataBolsaClient {
|
|
|
207
207
|
deletePortfolio(id: string): Promise<{
|
|
208
208
|
deleted?: boolean;
|
|
209
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>;
|
|
210
225
|
getPortfolioHistoryById(id: string): Promise<PortfolioHistoryResponse>;
|
|
211
226
|
addPortfolioAsset(id: string, asset: PortfolioAssetRef): Promise<unknown>;
|
|
212
227
|
removePortfolioAsset(id: string, asset: PortfolioAssetRef): Promise<unknown>;
|
package/dist/index.js
CHANGED
|
@@ -494,6 +494,42 @@ class HttpClient {
|
|
|
494
494
|
deletePortfolio(id) {
|
|
495
495
|
return this.request(`/portfolios/${enc(id)}`, undefined, { method: "DELETE" });
|
|
496
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
|
+
}
|
|
497
533
|
getPortfolioHistoryById(id) {
|
|
498
534
|
return this.request(`/portfolios/${enc(id)}/history`);
|
|
499
535
|
}
|
package/dist/schema.d.ts
CHANGED
|
@@ -1628,6 +1628,115 @@ export interface paths {
|
|
|
1628
1628
|
patch?: never;
|
|
1629
1629
|
trace?: never;
|
|
1630
1630
|
};
|
|
1631
|
+
"/v1/theses": {
|
|
1632
|
+
parameters: {
|
|
1633
|
+
query?: never;
|
|
1634
|
+
header?: never;
|
|
1635
|
+
path?: never;
|
|
1636
|
+
cookie?: never;
|
|
1637
|
+
};
|
|
1638
|
+
/**
|
|
1639
|
+
* Minhas teses
|
|
1640
|
+
* @description Lista as teses do dono da chave (resumo: título, ticker, visibilidade, status de export) e o teto do plano. O documento completo vem no getThesis.
|
|
1641
|
+
*/
|
|
1642
|
+
get: operations["listMyTheses"];
|
|
1643
|
+
put?: never;
|
|
1644
|
+
/**
|
|
1645
|
+
* Criar tese
|
|
1646
|
+
* @description Cria uma tese a partir de um documento de report estruturado (`doc`). O doc é validado no servidor contra o schema de reports (seções → blocos: cover, rating, summary, keyStats, prose, chart, table, callout, scenarios, sources, disclaimer…); erros voltam com o caminho do campo. Título/ticker/tipo são derivados do próprio doc. Respeita o limite de teses do plano (402 plan_required ao estourar).
|
|
1647
|
+
*/
|
|
1648
|
+
post: operations["createThesis"];
|
|
1649
|
+
delete?: never;
|
|
1650
|
+
options?: never;
|
|
1651
|
+
head?: never;
|
|
1652
|
+
patch?: never;
|
|
1653
|
+
trace?: never;
|
|
1654
|
+
};
|
|
1655
|
+
"/v1/theses/import": {
|
|
1656
|
+
parameters: {
|
|
1657
|
+
query?: never;
|
|
1658
|
+
header?: never;
|
|
1659
|
+
path?: never;
|
|
1660
|
+
cookie?: never;
|
|
1661
|
+
};
|
|
1662
|
+
get?: never;
|
|
1663
|
+
put?: never;
|
|
1664
|
+
/**
|
|
1665
|
+
* Importar tese de arquivo JSON
|
|
1666
|
+
* @description Cria uma tese enviando o ARQUIVO JSON do documento em base64 (`content_base64`) — o caminho natural para CLI e automações (`--file tese.json`). Mesma validação e limites do createThesis.
|
|
1667
|
+
*/
|
|
1668
|
+
post: operations["importThesisFile"];
|
|
1669
|
+
delete?: never;
|
|
1670
|
+
options?: never;
|
|
1671
|
+
head?: never;
|
|
1672
|
+
patch?: never;
|
|
1673
|
+
trace?: never;
|
|
1674
|
+
};
|
|
1675
|
+
"/v1/theses/{id}": {
|
|
1676
|
+
parameters: {
|
|
1677
|
+
query?: never;
|
|
1678
|
+
header?: never;
|
|
1679
|
+
path?: never;
|
|
1680
|
+
cookie?: never;
|
|
1681
|
+
};
|
|
1682
|
+
/**
|
|
1683
|
+
* Detalhe de uma tese
|
|
1684
|
+
* @description Documento completo + visibilidade + status do export (quando `ready`, `pdfUrl`/`previewUrl` apontam para a mídia pública).
|
|
1685
|
+
*/
|
|
1686
|
+
get: operations["getThesis"];
|
|
1687
|
+
/**
|
|
1688
|
+
* Atualizar tese
|
|
1689
|
+
* @description Atualiza o documento e/ou a visibilidade. O doc, quando enviado, passa pela mesma validação do create.
|
|
1690
|
+
*/
|
|
1691
|
+
put: operations["updateThesis"];
|
|
1692
|
+
post?: never;
|
|
1693
|
+
/** Excluir tese */
|
|
1694
|
+
delete: operations["deleteThesis"];
|
|
1695
|
+
options?: never;
|
|
1696
|
+
head?: never;
|
|
1697
|
+
patch?: never;
|
|
1698
|
+
trace?: never;
|
|
1699
|
+
};
|
|
1700
|
+
"/v1/theses/{id}/publish": {
|
|
1701
|
+
parameters: {
|
|
1702
|
+
query?: never;
|
|
1703
|
+
header?: never;
|
|
1704
|
+
path?: never;
|
|
1705
|
+
cookie?: never;
|
|
1706
|
+
};
|
|
1707
|
+
get?: never;
|
|
1708
|
+
put?: never;
|
|
1709
|
+
/**
|
|
1710
|
+
* Publicar / mudar visibilidade
|
|
1711
|
+
* @description Define a visibilidade: `public` aparece no perfil e tem página própria; `unlisted` só por link; `private` volta a ser só sua. Por default as seções pessoais (posição, preço médio, P&L) são REMOVIDAS da leitura pública — `show_personal: true` as exibe (opt-in).
|
|
1712
|
+
*/
|
|
1713
|
+
post: operations["publishThesis"];
|
|
1714
|
+
delete?: never;
|
|
1715
|
+
options?: never;
|
|
1716
|
+
head?: never;
|
|
1717
|
+
patch?: never;
|
|
1718
|
+
trace?: never;
|
|
1719
|
+
};
|
|
1720
|
+
"/v1/theses/{id}/export": {
|
|
1721
|
+
parameters: {
|
|
1722
|
+
query?: never;
|
|
1723
|
+
header?: never;
|
|
1724
|
+
path?: never;
|
|
1725
|
+
cookie?: never;
|
|
1726
|
+
};
|
|
1727
|
+
get?: never;
|
|
1728
|
+
put?: never;
|
|
1729
|
+
/**
|
|
1730
|
+
* Exportar em PDF (plano pago)
|
|
1731
|
+
* @description Gera o PDF (A4, com preview PNG) da tese e publica num link público de mídia. Assíncrono: responde 202 {status: queued} e o getThesis passa a devolver `pdfUrl` quando pronto; se o conteúdo não mudou desde o último export, responde 200 direto com o link. Exporta a MESMA visão do link compartilhado (seções pessoais redigidas, salvo show_personal).
|
|
1732
|
+
*/
|
|
1733
|
+
post: operations["exportThesis"];
|
|
1734
|
+
delete?: never;
|
|
1735
|
+
options?: never;
|
|
1736
|
+
head?: never;
|
|
1737
|
+
patch?: never;
|
|
1738
|
+
trace?: never;
|
|
1739
|
+
};
|
|
1631
1740
|
}
|
|
1632
1741
|
export type webhooks = Record<string, never>;
|
|
1633
1742
|
export interface components {
|
|
@@ -2298,6 +2407,40 @@ export interface components {
|
|
|
2298
2407
|
rows: number;
|
|
2299
2408
|
duration_s: number | null;
|
|
2300
2409
|
};
|
|
2410
|
+
ThesisSummary: {
|
|
2411
|
+
id?: string;
|
|
2412
|
+
/** @description Slug estável por usuário — compõe a URL pública /teses/{handle}/{slug}. */
|
|
2413
|
+
slug?: string;
|
|
2414
|
+
title?: string;
|
|
2415
|
+
subtitle?: string | null;
|
|
2416
|
+
ticker?: string | null;
|
|
2417
|
+
/** @description equity | fii | macro | setor | carta | carteira */
|
|
2418
|
+
kind?: string;
|
|
2419
|
+
/** @enum {string} */
|
|
2420
|
+
visibility?: "private" | "unlisted" | "public";
|
|
2421
|
+
show_personal?: boolean;
|
|
2422
|
+
/** @description idle | queued | processing | ready | failed */
|
|
2423
|
+
export_status?: string;
|
|
2424
|
+
pdf_url?: string | null;
|
|
2425
|
+
preview_url?: string | null;
|
|
2426
|
+
published_at?: string | null;
|
|
2427
|
+
created_at?: string;
|
|
2428
|
+
updated_at?: string;
|
|
2429
|
+
};
|
|
2430
|
+
ThesisDetail: components["schemas"]["ThesisSummary"] & {
|
|
2431
|
+
doc?: components["schemas"]["ReportDocInput"];
|
|
2432
|
+
export_error?: string | null;
|
|
2433
|
+
};
|
|
2434
|
+
ThesisExportStatus: {
|
|
2435
|
+
/** @enum {string} */
|
|
2436
|
+
status?: "ready" | "queued";
|
|
2437
|
+
pdfUrl?: string;
|
|
2438
|
+
previewUrl?: string;
|
|
2439
|
+
};
|
|
2440
|
+
/** @description Documento de report estruturado (JSON): { id, kind, title, subtitle?, date, authors[], ticker?, tags?, sections[] } onde cada section tem { id, title?, blocks[] } e cada block é um dos tipos cover, rating, summary, keyStats, prose (markdown), chart, table, callout, scenarios, quote, figure, columns, sources, disclaimer ou pageBreak. Validado integralmente no servidor; erros voltam com o caminho do campo violado. */
|
|
2441
|
+
ReportDocInput: {
|
|
2442
|
+
[key: string]: unknown;
|
|
2443
|
+
};
|
|
2301
2444
|
CommunityBot: {
|
|
2302
2445
|
id?: string;
|
|
2303
2446
|
handle?: string;
|
|
@@ -2327,6 +2470,14 @@ export interface components {
|
|
|
2327
2470
|
views?: number;
|
|
2328
2471
|
replyCount?: number;
|
|
2329
2472
|
replies?: Record<string, never>[];
|
|
2473
|
+
/** @description Cashtags do texto com tipo resolvido no servidor (ausente em posts antigos). */
|
|
2474
|
+
cashtags?: {
|
|
2475
|
+
symbol: string;
|
|
2476
|
+
/** @description stock | fii | index | crypto | us */
|
|
2477
|
+
kind: string;
|
|
2478
|
+
/** @description Rota da página do ativo no site. */
|
|
2479
|
+
href: string;
|
|
2480
|
+
}[];
|
|
2330
2481
|
};
|
|
2331
2482
|
PortfolioHolding: {
|
|
2332
2483
|
symbol: string;
|
|
@@ -2361,7 +2512,7 @@ export interface components {
|
|
|
2361
2512
|
unrealizedPL?: number;
|
|
2362
2513
|
unrealizedPct?: number;
|
|
2363
2514
|
realizedPL?: number;
|
|
2364
|
-
/** @description Posições com qty, preço médio, valor de mercado, P&L, proventos e peso. */
|
|
2515
|
+
/** @description Posições com qty, preço médio, valor de mercado, P&L, proventos e peso. Valores monetários sempre em BRL; ativos em moeda estrangeira (asset_type=us) expõem também currency, priceNative (US$) e fxRate. */
|
|
2365
2516
|
holdings?: Record<string, never>[];
|
|
2366
2517
|
};
|
|
2367
2518
|
PortfolioTransaction: {
|
|
@@ -5367,7 +5518,7 @@ export interface operations {
|
|
|
5367
5518
|
* @description Tipo do ativo.
|
|
5368
5519
|
* @enum {string}
|
|
5369
5520
|
*/
|
|
5370
|
-
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa";
|
|
5521
|
+
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa" | "us";
|
|
5371
5522
|
/** @description Ticker (ex.: PETR4) ou nome oficial do título do Tesouro. */
|
|
5372
5523
|
symbol: string;
|
|
5373
5524
|
};
|
|
@@ -5398,7 +5549,7 @@ export interface operations {
|
|
|
5398
5549
|
parameters: {
|
|
5399
5550
|
query: {
|
|
5400
5551
|
/** @description Tipo do ativo. */
|
|
5401
|
-
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa";
|
|
5552
|
+
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa" | "us";
|
|
5402
5553
|
/** @description Ticker ou nome do título. */
|
|
5403
5554
|
symbol: string;
|
|
5404
5555
|
};
|
|
@@ -5536,7 +5687,7 @@ export interface operations {
|
|
|
5536
5687
|
* @description Tipo do ativo.
|
|
5537
5688
|
* @enum {string}
|
|
5538
5689
|
*/
|
|
5539
|
-
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa";
|
|
5690
|
+
asset_type: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa" | "us";
|
|
5540
5691
|
/** @description Ticker (ex.: PETR4) ou nome oficial do título do Tesouro. */
|
|
5541
5692
|
symbol: string;
|
|
5542
5693
|
/**
|
|
@@ -6038,7 +6189,7 @@ export interface operations {
|
|
|
6038
6189
|
* @description Tipo do ativo principal.
|
|
6039
6190
|
* @enum {string}
|
|
6040
6191
|
*/
|
|
6041
|
-
asset_type?: "stock" | "fii";
|
|
6192
|
+
asset_type?: "stock" | "fii" | "crypto" | "us";
|
|
6042
6193
|
};
|
|
6043
6194
|
};
|
|
6044
6195
|
};
|
|
@@ -6183,4 +6334,312 @@ export interface operations {
|
|
|
6183
6334
|
};
|
|
6184
6335
|
};
|
|
6185
6336
|
};
|
|
6337
|
+
listMyTheses: {
|
|
6338
|
+
parameters: {
|
|
6339
|
+
query?: never;
|
|
6340
|
+
header?: never;
|
|
6341
|
+
path?: never;
|
|
6342
|
+
cookie?: never;
|
|
6343
|
+
};
|
|
6344
|
+
requestBody?: never;
|
|
6345
|
+
responses: {
|
|
6346
|
+
/** @description Teses + limite do plano (null = ilimitado). */
|
|
6347
|
+
200: {
|
|
6348
|
+
headers: {
|
|
6349
|
+
[name: string]: unknown;
|
|
6350
|
+
};
|
|
6351
|
+
content: {
|
|
6352
|
+
"application/json": {
|
|
6353
|
+
theses?: components["schemas"]["ThesisSummary"][];
|
|
6354
|
+
limit?: number | null;
|
|
6355
|
+
};
|
|
6356
|
+
};
|
|
6357
|
+
};
|
|
6358
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6359
|
+
default: {
|
|
6360
|
+
headers: {
|
|
6361
|
+
[name: string]: unknown;
|
|
6362
|
+
};
|
|
6363
|
+
content: {
|
|
6364
|
+
"application/problem+json": Record<string, never>;
|
|
6365
|
+
};
|
|
6366
|
+
};
|
|
6367
|
+
};
|
|
6368
|
+
};
|
|
6369
|
+
createThesis: {
|
|
6370
|
+
parameters: {
|
|
6371
|
+
query?: never;
|
|
6372
|
+
header?: never;
|
|
6373
|
+
path?: never;
|
|
6374
|
+
cookie?: never;
|
|
6375
|
+
};
|
|
6376
|
+
requestBody: {
|
|
6377
|
+
content: {
|
|
6378
|
+
"application/json": {
|
|
6379
|
+
doc: components["schemas"]["ReportDocInput"];
|
|
6380
|
+
/**
|
|
6381
|
+
* @description Default: private.
|
|
6382
|
+
* @enum {string}
|
|
6383
|
+
*/
|
|
6384
|
+
visibility?: "private" | "unlisted" | "public";
|
|
6385
|
+
/** @description Exibir seções pessoais (minha-posicao) na leitura pública. Default: false (redigidas). */
|
|
6386
|
+
show_personal?: boolean;
|
|
6387
|
+
};
|
|
6388
|
+
};
|
|
6389
|
+
};
|
|
6390
|
+
responses: {
|
|
6391
|
+
/** @description Tese criada. */
|
|
6392
|
+
201: {
|
|
6393
|
+
headers: {
|
|
6394
|
+
[name: string]: unknown;
|
|
6395
|
+
};
|
|
6396
|
+
content: {
|
|
6397
|
+
"application/json": {
|
|
6398
|
+
thesis?: components["schemas"]["ThesisDetail"];
|
|
6399
|
+
};
|
|
6400
|
+
};
|
|
6401
|
+
};
|
|
6402
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6403
|
+
default: {
|
|
6404
|
+
headers: {
|
|
6405
|
+
[name: string]: unknown;
|
|
6406
|
+
};
|
|
6407
|
+
content: {
|
|
6408
|
+
"application/problem+json": Record<string, never>;
|
|
6409
|
+
};
|
|
6410
|
+
};
|
|
6411
|
+
};
|
|
6412
|
+
};
|
|
6413
|
+
importThesisFile: {
|
|
6414
|
+
parameters: {
|
|
6415
|
+
query?: never;
|
|
6416
|
+
header?: never;
|
|
6417
|
+
path?: never;
|
|
6418
|
+
cookie?: never;
|
|
6419
|
+
};
|
|
6420
|
+
requestBody: {
|
|
6421
|
+
content: {
|
|
6422
|
+
"application/json": {
|
|
6423
|
+
/** @description Nome do arquivo (informativo). */
|
|
6424
|
+
filename?: string;
|
|
6425
|
+
/** @description JSON do ReportDoc codificado em base64. */
|
|
6426
|
+
content_base64: string;
|
|
6427
|
+
/** @enum {string} */
|
|
6428
|
+
visibility?: "private" | "unlisted" | "public";
|
|
6429
|
+
show_personal?: boolean;
|
|
6430
|
+
};
|
|
6431
|
+
};
|
|
6432
|
+
};
|
|
6433
|
+
responses: {
|
|
6434
|
+
/** @description Tese criada. */
|
|
6435
|
+
201: {
|
|
6436
|
+
headers: {
|
|
6437
|
+
[name: string]: unknown;
|
|
6438
|
+
};
|
|
6439
|
+
content: {
|
|
6440
|
+
"application/json": {
|
|
6441
|
+
thesis?: components["schemas"]["ThesisDetail"];
|
|
6442
|
+
};
|
|
6443
|
+
};
|
|
6444
|
+
};
|
|
6445
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6446
|
+
default: {
|
|
6447
|
+
headers: {
|
|
6448
|
+
[name: string]: unknown;
|
|
6449
|
+
};
|
|
6450
|
+
content: {
|
|
6451
|
+
"application/problem+json": Record<string, never>;
|
|
6452
|
+
};
|
|
6453
|
+
};
|
|
6454
|
+
};
|
|
6455
|
+
};
|
|
6456
|
+
getThesis: {
|
|
6457
|
+
parameters: {
|
|
6458
|
+
query?: never;
|
|
6459
|
+
header?: never;
|
|
6460
|
+
path: {
|
|
6461
|
+
id: string;
|
|
6462
|
+
};
|
|
6463
|
+
cookie?: never;
|
|
6464
|
+
};
|
|
6465
|
+
requestBody?: never;
|
|
6466
|
+
responses: {
|
|
6467
|
+
/** @description Tese. */
|
|
6468
|
+
200: {
|
|
6469
|
+
headers: {
|
|
6470
|
+
[name: string]: unknown;
|
|
6471
|
+
};
|
|
6472
|
+
content: {
|
|
6473
|
+
"application/json": {
|
|
6474
|
+
thesis?: components["schemas"]["ThesisDetail"];
|
|
6475
|
+
};
|
|
6476
|
+
};
|
|
6477
|
+
};
|
|
6478
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6479
|
+
default: {
|
|
6480
|
+
headers: {
|
|
6481
|
+
[name: string]: unknown;
|
|
6482
|
+
};
|
|
6483
|
+
content: {
|
|
6484
|
+
"application/problem+json": Record<string, never>;
|
|
6485
|
+
};
|
|
6486
|
+
};
|
|
6487
|
+
};
|
|
6488
|
+
};
|
|
6489
|
+
updateThesis: {
|
|
6490
|
+
parameters: {
|
|
6491
|
+
query?: never;
|
|
6492
|
+
header?: never;
|
|
6493
|
+
path: {
|
|
6494
|
+
id: string;
|
|
6495
|
+
};
|
|
6496
|
+
cookie?: never;
|
|
6497
|
+
};
|
|
6498
|
+
requestBody: {
|
|
6499
|
+
content: {
|
|
6500
|
+
"application/json": {
|
|
6501
|
+
doc?: components["schemas"]["ReportDocInput"];
|
|
6502
|
+
/** @enum {string} */
|
|
6503
|
+
visibility?: "private" | "unlisted" | "public";
|
|
6504
|
+
show_personal?: boolean;
|
|
6505
|
+
};
|
|
6506
|
+
};
|
|
6507
|
+
};
|
|
6508
|
+
responses: {
|
|
6509
|
+
/** @description Tese atualizada. */
|
|
6510
|
+
200: {
|
|
6511
|
+
headers: {
|
|
6512
|
+
[name: string]: unknown;
|
|
6513
|
+
};
|
|
6514
|
+
content: {
|
|
6515
|
+
"application/json": {
|
|
6516
|
+
thesis?: components["schemas"]["ThesisDetail"];
|
|
6517
|
+
};
|
|
6518
|
+
};
|
|
6519
|
+
};
|
|
6520
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6521
|
+
default: {
|
|
6522
|
+
headers: {
|
|
6523
|
+
[name: string]: unknown;
|
|
6524
|
+
};
|
|
6525
|
+
content: {
|
|
6526
|
+
"application/problem+json": Record<string, never>;
|
|
6527
|
+
};
|
|
6528
|
+
};
|
|
6529
|
+
};
|
|
6530
|
+
};
|
|
6531
|
+
deleteThesis: {
|
|
6532
|
+
parameters: {
|
|
6533
|
+
query?: never;
|
|
6534
|
+
header?: never;
|
|
6535
|
+
path: {
|
|
6536
|
+
id: string;
|
|
6537
|
+
};
|
|
6538
|
+
cookie?: never;
|
|
6539
|
+
};
|
|
6540
|
+
requestBody?: never;
|
|
6541
|
+
responses: {
|
|
6542
|
+
/** @description Excluída. */
|
|
6543
|
+
200: {
|
|
6544
|
+
headers: {
|
|
6545
|
+
[name: string]: unknown;
|
|
6546
|
+
};
|
|
6547
|
+
content: {
|
|
6548
|
+
"application/json": {
|
|
6549
|
+
deleted?: boolean;
|
|
6550
|
+
};
|
|
6551
|
+
};
|
|
6552
|
+
};
|
|
6553
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6554
|
+
default: {
|
|
6555
|
+
headers: {
|
|
6556
|
+
[name: string]: unknown;
|
|
6557
|
+
};
|
|
6558
|
+
content: {
|
|
6559
|
+
"application/problem+json": Record<string, never>;
|
|
6560
|
+
};
|
|
6561
|
+
};
|
|
6562
|
+
};
|
|
6563
|
+
};
|
|
6564
|
+
publishThesis: {
|
|
6565
|
+
parameters: {
|
|
6566
|
+
query?: never;
|
|
6567
|
+
header?: never;
|
|
6568
|
+
path: {
|
|
6569
|
+
id: string;
|
|
6570
|
+
};
|
|
6571
|
+
cookie?: never;
|
|
6572
|
+
};
|
|
6573
|
+
requestBody: {
|
|
6574
|
+
content: {
|
|
6575
|
+
"application/json": {
|
|
6576
|
+
/** @enum {string} */
|
|
6577
|
+
visibility: "private" | "unlisted" | "public";
|
|
6578
|
+
show_personal?: boolean;
|
|
6579
|
+
};
|
|
6580
|
+
};
|
|
6581
|
+
};
|
|
6582
|
+
responses: {
|
|
6583
|
+
/** @description Visibilidade atualizada. */
|
|
6584
|
+
200: {
|
|
6585
|
+
headers: {
|
|
6586
|
+
[name: string]: unknown;
|
|
6587
|
+
};
|
|
6588
|
+
content: {
|
|
6589
|
+
"application/json": {
|
|
6590
|
+
thesis?: components["schemas"]["ThesisDetail"];
|
|
6591
|
+
};
|
|
6592
|
+
};
|
|
6593
|
+
};
|
|
6594
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6595
|
+
default: {
|
|
6596
|
+
headers: {
|
|
6597
|
+
[name: string]: unknown;
|
|
6598
|
+
};
|
|
6599
|
+
content: {
|
|
6600
|
+
"application/problem+json": Record<string, never>;
|
|
6601
|
+
};
|
|
6602
|
+
};
|
|
6603
|
+
};
|
|
6604
|
+
};
|
|
6605
|
+
exportThesis: {
|
|
6606
|
+
parameters: {
|
|
6607
|
+
query?: never;
|
|
6608
|
+
header?: never;
|
|
6609
|
+
path: {
|
|
6610
|
+
id: string;
|
|
6611
|
+
};
|
|
6612
|
+
cookie?: never;
|
|
6613
|
+
};
|
|
6614
|
+
requestBody?: never;
|
|
6615
|
+
responses: {
|
|
6616
|
+
/** @description Já exportada (conteúdo inalterado). */
|
|
6617
|
+
200: {
|
|
6618
|
+
headers: {
|
|
6619
|
+
[name: string]: unknown;
|
|
6620
|
+
};
|
|
6621
|
+
content: {
|
|
6622
|
+
"application/json": components["schemas"]["ThesisExportStatus"];
|
|
6623
|
+
};
|
|
6624
|
+
};
|
|
6625
|
+
/** @description Export enfileirado. */
|
|
6626
|
+
202: {
|
|
6627
|
+
headers: {
|
|
6628
|
+
[name: string]: unknown;
|
|
6629
|
+
};
|
|
6630
|
+
content: {
|
|
6631
|
+
"application/json": components["schemas"]["ThesisExportStatus"];
|
|
6632
|
+
};
|
|
6633
|
+
};
|
|
6634
|
+
/** @description Erro (RFC 9457 application/problem+json) */
|
|
6635
|
+
default: {
|
|
6636
|
+
headers: {
|
|
6637
|
+
[name: string]: unknown;
|
|
6638
|
+
};
|
|
6639
|
+
content: {
|
|
6640
|
+
"application/problem+json": Record<string, never>;
|
|
6641
|
+
};
|
|
6642
|
+
};
|
|
6643
|
+
};
|
|
6644
|
+
};
|
|
6186
6645
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -140,11 +140,11 @@ export interface RegisterCommunityBotInput {
|
|
|
140
140
|
}
|
|
141
141
|
/** Publicação como bot — `POST /v1/community/bots/{handle}/posts`. */
|
|
142
142
|
export interface CommunityBotPostInput {
|
|
143
|
-
/** Texto do post (12–2000 caracteres; cashtags $PETR4 viram links). */
|
|
143
|
+
/** Texto do post (12–2000 caracteres; cashtags $PETR4, $BTC, $AAPL viram links). */
|
|
144
144
|
body: string;
|
|
145
145
|
title?: string;
|
|
146
146
|
ticker?: string;
|
|
147
|
-
assetType?: "stock" | "fii";
|
|
147
|
+
assetType?: "stock" | "fii" | "crypto" | "us";
|
|
148
148
|
}
|
|
149
149
|
/** Filtros do feed — `GET /v1/community/feed`. */
|
|
150
150
|
export interface CommunityFeedParams {
|
|
@@ -164,10 +164,22 @@ export type PortfolioImportRowsResponse = Ok<"listPortfolioImportRows">;
|
|
|
164
164
|
export type CreatePortfolioResponse = Created<"createPortfolio">;
|
|
165
165
|
export type AddPortfolioTransactionResponse = Created<"addPortfolioTransaction">;
|
|
166
166
|
export type PortfolioImportSummary = Schemas["PortfolioImportSummary"];
|
|
167
|
+
export type ThesisSummary = Schemas["ThesisSummary"];
|
|
168
|
+
export type ThesisDetail = Schemas["ThesisDetail"];
|
|
169
|
+
export type ThesesResponse = Ok<"listMyTheses">;
|
|
170
|
+
export type ThesisResponse = Ok<"getThesis">;
|
|
171
|
+
export type CreateThesisResponse = Created<"createThesis">;
|
|
172
|
+
export type ThesisExportStatus = Schemas["ThesisExportStatus"];
|
|
173
|
+
export interface ThesisWriteInput {
|
|
174
|
+
/** O ReportDoc completo (JSON) — validado no servidor. */
|
|
175
|
+
doc: Record<string, unknown>;
|
|
176
|
+
visibility?: "private" | "unlisted" | "public";
|
|
177
|
+
showPersonal?: boolean;
|
|
178
|
+
}
|
|
167
179
|
/** Referência de ativo dentro de uma carteira (chave natural). */
|
|
168
180
|
export interface PortfolioAssetRef {
|
|
169
|
-
assetType: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa";
|
|
170
|
-
/** Ticker (PETR4) ou, para Tesouro, o nome oficial do título. */
|
|
181
|
+
assetType: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa" | "us";
|
|
182
|
+
/** Ticker (PETR4, AAPL) ou, para Tesouro, o nome oficial do título. */
|
|
171
183
|
symbol: string;
|
|
172
184
|
}
|
|
173
185
|
/** Campos de uma transação — `POST /v1/portfolios/{id}/transactions`. */
|
|
@@ -177,7 +189,7 @@ export interface PortfolioTransactionInput {
|
|
|
177
189
|
tradeDate: string;
|
|
178
190
|
/** Obrigatória em buy/sell (> 0). */
|
|
179
191
|
quantity?: number;
|
|
180
|
-
/** Preço unitário
|
|
192
|
+
/** Preço unitário na moeda de negociação do ativo: BRL, ou USD para asset_type=us (omita se desconhecido). */
|
|
181
193
|
price?: number | null;
|
|
182
194
|
fees?: number;
|
|
183
195
|
/** Fator do split (2 = 2:1; 0.5 = grupamento 1:2). */
|
package/package.json
CHANGED