@databolsa/sdk 1.0.10 → 1.0.11

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
@@ -146,6 +146,58 @@ export interface CommunityFeedParams {
146
146
  q?: string;
147
147
  cursor?: string;
148
148
  }
149
+ export type PortfolioListItem = Schemas["PortfolioListItem"];
150
+ export type PortfolioDetail = Schemas["PortfolioDetail"];
151
+ export type PortfolioTransaction = Schemas["PortfolioTransaction"];
152
+ export type PortfolioHistoryResponse = Ok<"getPortfolioHistory">;
153
+ export type PortfoliosResponse = Ok<"listPortfolios">;
154
+ export type PortfolioTransactionsResponse = Ok<"listPortfolioTransactions">;
155
+ export type PortfolioImportsResponse = Ok<"listPortfolioImports">;
156
+ export type PortfolioImportRowsResponse = Ok<"listPortfolioImportRows">;
157
+ export type CreatePortfolioResponse = Created<"createPortfolio">;
158
+ export type AddPortfolioTransactionResponse = Created<"addPortfolioTransaction">;
159
+ export type PortfolioImportSummary = Schemas["PortfolioImportSummary"];
160
+ /** Referência de ativo dentro de uma carteira (chave natural). */
161
+ export interface PortfolioAssetRef {
162
+ assetType: "stock" | "fii" | "bdr" | "index" | "tesouro" | "crypto" | "option" | "renda_fixa";
163
+ /** Ticker (PETR4) ou, para Tesouro, o nome oficial do título. */
164
+ symbol: string;
165
+ }
166
+ /** Campos de uma transação — `POST /v1/portfolios/{id}/transactions`. */
167
+ export interface PortfolioTransactionInput {
168
+ kind: "buy" | "sell" | "split";
169
+ /** Data do negócio (AAAA-MM-DD). */
170
+ tradeDate: string;
171
+ /** Obrigatória em buy/sell (> 0). */
172
+ quantity?: number;
173
+ /** Preço unitário em BRL (omita se desconhecido). */
174
+ price?: number | null;
175
+ fees?: number;
176
+ /** Fator do split (2 = 2:1; 0.5 = grupamento 1:2). */
177
+ ratio?: number;
178
+ note?: string;
179
+ }
180
+ /** Patch parcial de uma transação — `PATCH /v1/portfolios/{id}/transactions/{txId}`. */
181
+ export type PortfolioTransactionPatch = Partial<PortfolioTransactionInput>;
182
+ /** Ajustes de uma carteira — `PATCH /v1/portfolios/{id}`. */
183
+ export interface PortfolioPatch {
184
+ name?: string;
185
+ visibility?: "private" | "unlisted" | "public";
186
+ /** true = carteira de simulação (fora do consolidado). */
187
+ excludeFromConsolidated?: boolean;
188
+ }
189
+ /** Import de planilha — `POST /v1/portfolios/{id}/imports`. */
190
+ export interface PortfolioImportInput {
191
+ /** Conteúdo do arquivo (xlsx da B3 ou CSV do template) em base64. Máx. 8 MB. */
192
+ contentBase64: string;
193
+ filename?: string;
194
+ }
195
+ /** Taxa contratada de renda fixa — `PATCH /v1/portfolios/{id}/assets`. */
196
+ export interface PortfolioRfContract {
197
+ /** cdi = % do CDI; prefixado = % a.a.; ipca = IPCA + % a.a.; none limpa. */
198
+ indexer: "cdi" | "prefixado" | "ipca" | "none";
199
+ rate?: number;
200
+ }
149
201
  /** Filtros da busca semântica de documentos — `GET /v1/documents/search`. */
150
202
  export interface SearchDocumentsParams {
151
203
  /** 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.11",
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.",