@databolsa/sdk 1.0.10 → 1.0.12

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/types.d.ts CHANGED
@@ -85,6 +85,13 @@ export type TesouroBondsResponse = Ok<"listTesouroBonds">;
85
85
  export type ExpectationsResponse = Ok<"getMarketExpectations">;
86
86
  export type MacroGearsResponse = Ok<"getMacroGears">;
87
87
  export type CryptoQuotesResponse = Ok<"listCryptoQuotes">;
88
+ export type CryptoListResponse = Ok<"listCrypto">;
89
+ export type CryptoAsset = Ok<"getCrypto">;
90
+ export type CryptoLiveResponse = Ok<"listCryptoLive">;
91
+ export type UsAssetsResponse = Ok<"listUsAssets">;
92
+ export type UsAssetDetail = Ok<"getUsAsset">;
93
+ export type UsQuotesResponse = Ok<"listUsAssetQuotes">;
94
+ export type UsFilingsResponse = Ok<"listUsFilings">;
88
95
  export type SearchResponse = Ok<"search">;
89
96
  export type OptionsChainResponse = Ok<"getOptionsChain">;
90
97
  export type OptionExpiriesResponse = Ok<"listOptionExpiries">;
@@ -146,6 +153,58 @@ export interface CommunityFeedParams {
146
153
  q?: string;
147
154
  cursor?: string;
148
155
  }
156
+ export type PortfolioListItem = Schemas["PortfolioListItem"];
157
+ export type PortfolioDetail = Schemas["PortfolioDetail"];
158
+ export type PortfolioTransaction = Schemas["PortfolioTransaction"];
159
+ export type PortfolioHistoryResponse = Ok<"getPortfolioHistory">;
160
+ export type PortfoliosResponse = Ok<"listPortfolios">;
161
+ export type PortfolioTransactionsResponse = Ok<"listPortfolioTransactions">;
162
+ export type PortfolioImportsResponse = Ok<"listPortfolioImports">;
163
+ export type PortfolioImportRowsResponse = Ok<"listPortfolioImportRows">;
164
+ export type CreatePortfolioResponse = Created<"createPortfolio">;
165
+ export type AddPortfolioTransactionResponse = Created<"addPortfolioTransaction">;
166
+ export type PortfolioImportSummary = Schemas["PortfolioImportSummary"];
167
+ /** Referência de ativo dentro de uma carteira (chave natural). */
168
+ 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. */
171
+ symbol: string;
172
+ }
173
+ /** Campos de uma transação — `POST /v1/portfolios/{id}/transactions`. */
174
+ export interface PortfolioTransactionInput {
175
+ kind: "buy" | "sell" | "split";
176
+ /** Data do negócio (AAAA-MM-DD). */
177
+ tradeDate: string;
178
+ /** Obrigatória em buy/sell (> 0). */
179
+ quantity?: number;
180
+ /** Preço unitário em BRL (omita se desconhecido). */
181
+ price?: number | null;
182
+ fees?: number;
183
+ /** Fator do split (2 = 2:1; 0.5 = grupamento 1:2). */
184
+ ratio?: number;
185
+ note?: string;
186
+ }
187
+ /** Patch parcial de uma transação — `PATCH /v1/portfolios/{id}/transactions/{txId}`. */
188
+ export type PortfolioTransactionPatch = Partial<PortfolioTransactionInput>;
189
+ /** Ajustes de uma carteira — `PATCH /v1/portfolios/{id}`. */
190
+ export interface PortfolioPatch {
191
+ name?: string;
192
+ visibility?: "private" | "unlisted" | "public";
193
+ /** true = carteira de simulação (fora do consolidado). */
194
+ excludeFromConsolidated?: boolean;
195
+ }
196
+ /** Import de planilha — `POST /v1/portfolios/{id}/imports`. */
197
+ export interface PortfolioImportInput {
198
+ /** Conteúdo do arquivo (xlsx da B3 ou CSV do template) em base64. Máx. 8 MB. */
199
+ contentBase64: string;
200
+ filename?: string;
201
+ }
202
+ /** Taxa contratada de renda fixa — `PATCH /v1/portfolios/{id}/assets`. */
203
+ export interface PortfolioRfContract {
204
+ /** cdi = % do CDI; prefixado = % a.a.; ipca = IPCA + % a.a.; none limpa. */
205
+ indexer: "cdi" | "prefixado" | "ipca" | "none";
206
+ rate?: number;
207
+ }
149
208
  /** Filtros da busca semântica de documentos — `GET /v1/documents/search`. */
150
209
  export interface SearchDocumentsParams {
151
210
  /** Papéis a filtrar; array serializado em CSV pelo HttpClient. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databolsa/sdk",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "SDK TypeScript tipado para a Serving API pública do DataBolsa, gerado a partir do contrato OpenAPI.",