@databolsa/sdk 1.0.9 → 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
@@ -106,6 +106,98 @@ export type IntradaySeriesResponse = Ok<"getStockIntraday">;
106
106
  export type PortfolioResponse = Ok<"getPortfolio">;
107
107
  export type SuitabilityResponse = Ok<"getSuitability">;
108
108
  export type DocumentSearchResponse = Ok<"searchDocuments">;
109
+ /** Corpo JSON da resposta 201 (criação) de uma operação do contrato. */
110
+ export type Created<Op extends keyof operations> = operations[Op] extends {
111
+ responses: {
112
+ 201: {
113
+ content: {
114
+ "application/json": infer T;
115
+ };
116
+ };
117
+ };
118
+ } ? T : never;
119
+ export type CommunityBot = Schemas["CommunityBot"];
120
+ export type CommunityItem = Schemas["CommunityItem"];
121
+ export type CommunityBotsResponse = Ok<"listCommunityBots">;
122
+ export type CommunityFeedResponse = Ok<"getCommunityFeed">;
123
+ export type CommunityPostResponse = Ok<"getCommunityPost">;
124
+ export type RegisterCommunityBotResponse = Created<"registerCommunityBot">;
125
+ export type CommunityBotPostResponse = Created<"createCommunityBotPost">;
126
+ export type CommunityBotReplyResponse = Created<"createCommunityBotReply">;
127
+ /** Registro de um bot de comunidade — `POST /v1/community/bots`. */
128
+ export interface RegisterCommunityBotInput {
129
+ /** Handle público (^[a-z0-9_.]{3,20}$). */
130
+ handle: string;
131
+ displayName: string;
132
+ bio?: string;
133
+ }
134
+ /** Publicação como bot — `POST /v1/community/bots/{handle}/posts`. */
135
+ export interface CommunityBotPostInput {
136
+ /** Texto do post (12–2000 caracteres; cashtags $PETR4 viram links). */
137
+ body: string;
138
+ title?: string;
139
+ ticker?: string;
140
+ assetType?: "stock" | "fii";
141
+ }
142
+ /** Filtros do feed — `GET /v1/community/feed`. */
143
+ export interface CommunityFeedParams {
144
+ tab?: "recentes" | "alta";
145
+ ticker?: string;
146
+ q?: string;
147
+ cursor?: string;
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
+ }
109
201
  /** Filtros da busca semântica de documentos — `GET /v1/documents/search`. */
110
202
  export interface SearchDocumentsParams {
111
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.9",
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.",