@pairus/product-data 1.4.0 → 1.6.0
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/README.md +434 -407
- package/dist/index.d.mts +226 -104
- package/dist/index.d.ts +226 -104
- package/dist/index.js +141 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +141 -92
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -46,6 +46,12 @@ interface DocumentoDFe {
|
|
|
46
46
|
tipo_documento?: string;
|
|
47
47
|
manifestacao_status?: string;
|
|
48
48
|
tem_xml_completo?: boolean;
|
|
49
|
+
/** Protocolo de autorização da NF-e (resNFe). */
|
|
50
|
+
protocolo?: string;
|
|
51
|
+
cnpj_destinatario?: string;
|
|
52
|
+
ie_emitente?: string;
|
|
53
|
+
ambiente?: string;
|
|
54
|
+
[campo: string]: any;
|
|
49
55
|
}
|
|
50
56
|
interface SincronizarDFeInput {
|
|
51
57
|
cnpj: string;
|
|
@@ -72,12 +78,15 @@ interface ListarDocumentosDFeResponse {
|
|
|
72
78
|
total: number;
|
|
73
79
|
ult_nsu: string;
|
|
74
80
|
max_nsu: string;
|
|
81
|
+
/** Data e hora da última sincronização com a SEFAZ. */
|
|
82
|
+
ultima_sincronizacao?: string | null;
|
|
75
83
|
documentos: DocumentoDFe[];
|
|
76
84
|
}
|
|
77
85
|
interface ManifestarDFeInput {
|
|
78
86
|
cnpj: string;
|
|
79
87
|
chave_acesso: string;
|
|
80
88
|
tipo_evento: TipoManifestacaoDFe | string;
|
|
89
|
+
/** Obrigatória apenas no 210240 (15 a 255 caracteres); a API a descarta nos demais eventos. */
|
|
81
90
|
justificativa?: string;
|
|
82
91
|
ambiente?: 'producao' | 'homologacao';
|
|
83
92
|
}
|
|
@@ -87,6 +96,9 @@ interface ManifestarDFeResponse {
|
|
|
87
96
|
xmotivo: string;
|
|
88
97
|
protocolo?: string;
|
|
89
98
|
tipo_evento?: string;
|
|
99
|
+
chave_acesso?: string;
|
|
100
|
+
/** 'ciencia', 'confirmada', 'desconhecida' ou 'nao_realizada'. */
|
|
101
|
+
manifestacao_status?: string;
|
|
90
102
|
detalhes?: Record<string, any>;
|
|
91
103
|
}
|
|
92
104
|
|
|
@@ -128,110 +140,116 @@ declare class DFeResource extends BaseResource {
|
|
|
128
140
|
baixarDanfe(chaveAcesso: string): Promise<ArrayBuffer>;
|
|
129
141
|
}
|
|
130
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Item da nota fiscal. Os nomes espelham o contrato da API (/v1/nfe/emitir e /v1/nfce/emitir).
|
|
145
|
+
*/
|
|
131
146
|
interface EmissaoItemInput {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
vUnTrib?: number;
|
|
145
|
-
vDesc?: number;
|
|
147
|
+
descricao: string;
|
|
148
|
+
valor_unitario: number;
|
|
149
|
+
quantidade?: number;
|
|
150
|
+
codigo_produto?: string;
|
|
151
|
+
/** Código de barras GTIN/EAN ou 'SEM GTIN'. */
|
|
152
|
+
gtin?: string;
|
|
153
|
+
ncm?: string;
|
|
154
|
+
cest?: string;
|
|
155
|
+
cfop?: string;
|
|
156
|
+
/** '0' Nacional, '1' Importada, etc. */
|
|
157
|
+
origem_mercadoria?: string;
|
|
158
|
+
unidade_comercial?: string;
|
|
146
159
|
/** Desconto concedido no item (R$). */
|
|
147
160
|
desconto?: number;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
pPIS?: number;
|
|
158
|
-
cst_cofins?: string;
|
|
159
|
-
pCOFINS?: number;
|
|
160
|
-
cst_ibscbs?: string;
|
|
161
|
-
cClassTrib?: string;
|
|
162
|
-
infAdProd?: string;
|
|
161
|
+
/** CST (Regime Normal) ou CSOSN (Simples Nacional) do ICMS. */
|
|
162
|
+
icms_cst_csosn?: string;
|
|
163
|
+
icms_aliquota?: number;
|
|
164
|
+
pis_cst?: string;
|
|
165
|
+
pis_aliquota?: number;
|
|
166
|
+
cofins_cst?: string;
|
|
167
|
+
cofins_aliquota?: number;
|
|
168
|
+
informacoes_adicionais?: string;
|
|
169
|
+
[key: string]: any;
|
|
163
170
|
}
|
|
164
171
|
interface EmissaoDestinatarioInput {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
/** CPF (11 dígitos) ou CNPJ (14 dígitos). Obrigatório na NF-e; opcional na NFC-e. */
|
|
173
|
+
cpf_cnpj?: string;
|
|
174
|
+
razao_social?: string;
|
|
175
|
+
/** '1' Contribuinte, '2' Isento, '9' Não Contribuinte. */
|
|
176
|
+
indicador_ie?: string;
|
|
177
|
+
inscricao_estadual?: string;
|
|
178
|
+
consumidor_final?: boolean;
|
|
169
179
|
email?: string;
|
|
170
|
-
telefone?: string;
|
|
171
180
|
logradouro?: string;
|
|
172
181
|
numero?: string;
|
|
182
|
+
complemento?: string;
|
|
173
183
|
bairro?: string;
|
|
174
184
|
codigo_municipio?: string;
|
|
175
|
-
|
|
185
|
+
municipio?: string;
|
|
176
186
|
uf?: string;
|
|
177
187
|
cep?: string;
|
|
188
|
+
[key: string]: any;
|
|
189
|
+
}
|
|
190
|
+
/** Forma de pagamento; acima do total da nota, a API gera o troco (vTroco). */
|
|
191
|
+
interface EmissaoPagamentoInput {
|
|
192
|
+
/** Código SEFAZ: '01' Dinheiro, '03' Crédito, '04' Débito, '17' PIX... */
|
|
193
|
+
forma_pagamento?: string;
|
|
194
|
+
valor: number;
|
|
178
195
|
}
|
|
179
196
|
interface EmissaoNFeInput {
|
|
180
|
-
|
|
197
|
+
cnpj_emitente: string;
|
|
181
198
|
itens: EmissaoItemInput[];
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
199
|
+
tipo_documento?: 'NFE' | 'NFCE';
|
|
200
|
+
modo_emissao?: 'direto' | 'assistido' | 'simulacao';
|
|
201
|
+
ambiente?: 'producao' | 'homologacao';
|
|
202
|
+
natureza_operacao?: string;
|
|
185
203
|
serie?: number;
|
|
204
|
+
/** Omitido: a API reserva o próximo número de forma atômica. */
|
|
186
205
|
numero?: number;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
forma_pagamento?: string;
|
|
192
|
-
valor_pagamento?: number;
|
|
206
|
+
destinatario?: EmissaoDestinatarioInput;
|
|
207
|
+
/** Desconto sobre o total da nota (R$), rateado proporcionalmente entre os itens pela API. */
|
|
208
|
+
desconto_geral?: number;
|
|
209
|
+
pagamentos?: EmissaoPagamentoInput[];
|
|
193
210
|
informacoes_complementares?: string;
|
|
194
|
-
autocura?: boolean;
|
|
195
|
-
modo_emissao?: 'producao' | 'homologacao' | 'simulacao';
|
|
196
211
|
id_token_csc?: string;
|
|
197
212
|
codigo_csc?: string;
|
|
198
213
|
[key: string]: any;
|
|
199
214
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
215
|
+
/** Opções de envio da emissão. */
|
|
216
|
+
interface EmissaoOptions {
|
|
217
|
+
/**
|
|
218
|
+
* Identificador único da venda (8 a 128 caracteres). Se omitido, o SDK gera um UUID e o reutiliza
|
|
219
|
+
* nas retentativas automáticas, impedindo que um timeout emita a mesma venda duas vezes.
|
|
220
|
+
*/
|
|
221
|
+
idempotencyKey?: string;
|
|
205
222
|
}
|
|
206
223
|
interface EmissaoNFeResponse {
|
|
207
|
-
|
|
208
|
-
|
|
224
|
+
sucesso: boolean;
|
|
225
|
+
/** 'AUTORIZADA', 'REJEITADA', 'PENDENTE_RETORNO', 'DENEGADA' ou 'SIMULADA'. */
|
|
226
|
+
status_sefaz: string;
|
|
227
|
+
cStat: number;
|
|
209
228
|
xMotivo: string;
|
|
210
|
-
chave_acesso?: string;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
danfe_url?: string;
|
|
216
|
-
qrcode_url?: string;
|
|
229
|
+
chave_acesso?: string | null;
|
|
230
|
+
protocolo?: string | null;
|
|
231
|
+
numero?: number | null;
|
|
232
|
+
serie?: number | null;
|
|
233
|
+
data_emissao?: string | null;
|
|
217
234
|
ambiente?: string;
|
|
235
|
+
tipo_documento?: string;
|
|
218
236
|
autocura_aplicada?: boolean;
|
|
219
|
-
|
|
220
|
-
|
|
237
|
+
xml_autorizado_base64?: string | null;
|
|
238
|
+
danfe_pdf_base64?: string | null;
|
|
239
|
+
qrcode_url?: string | null;
|
|
221
240
|
consumo_creditos?: number;
|
|
222
|
-
|
|
241
|
+
/** true quando é a repetição de uma emissão já processada com a mesma Idempotency-Key. */
|
|
242
|
+
repeticao_idempotente?: boolean;
|
|
223
243
|
[key: string]: any;
|
|
224
244
|
}
|
|
225
245
|
interface EventoNFeResponse {
|
|
226
|
-
status: string;
|
|
227
246
|
sucesso: boolean;
|
|
228
247
|
cStat: string | number;
|
|
229
248
|
xMotivo: string;
|
|
230
249
|
tipo_evento: string;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
xml_evento_base64?: string;
|
|
250
|
+
protocolo_evento?: string | null;
|
|
251
|
+
data_registro?: string | null;
|
|
252
|
+
xml_evento_base64?: string | null;
|
|
235
253
|
consumo_creditos?: number;
|
|
236
254
|
[key: string]: any;
|
|
237
255
|
}
|
|
@@ -252,18 +270,19 @@ interface InutilizacaoInput {
|
|
|
252
270
|
numero_final: number;
|
|
253
271
|
justificativa: string;
|
|
254
272
|
ano?: number;
|
|
255
|
-
|
|
273
|
+
/** '55' (NF-e) ou '65' (NFC-e). */
|
|
274
|
+
modelo?: '55' | '65' | 55 | 65;
|
|
256
275
|
}
|
|
257
276
|
|
|
258
277
|
declare class EmissaoResource extends BaseResource {
|
|
259
278
|
/**
|
|
260
279
|
* Emite uma Nota Fiscal Eletrônica (NF-e Modelo 55) perante a SEFAZ.
|
|
261
280
|
*/
|
|
262
|
-
emitirNFe(payload: EmissaoNFeInput): Promise<EmissaoNFeResponse>;
|
|
281
|
+
emitirNFe(payload: EmissaoNFeInput, options?: EmissaoOptions): Promise<EmissaoNFeResponse>;
|
|
263
282
|
/**
|
|
264
283
|
* Emite uma Nota Fiscal de Consumidor Eletrônica (NFC-e Modelo 65) perante a SEFAZ.
|
|
265
284
|
*/
|
|
266
|
-
emitirNFCe(payload: EmissaoNFeInput): Promise<EmissaoNFeResponse>;
|
|
285
|
+
emitirNFCe(payload: EmissaoNFeInput, options?: EmissaoOptions): Promise<EmissaoNFeResponse>;
|
|
267
286
|
/**
|
|
268
287
|
* Simula uma emissão fiscal sem transmitir à SEFAZ (custo ZERO de créditos).
|
|
269
288
|
*/
|
|
@@ -282,6 +301,12 @@ declare class EmissaoResource extends BaseResource {
|
|
|
282
301
|
inutilizar(params: InutilizacaoInput): Promise<EventoNFeResponse>;
|
|
283
302
|
}
|
|
284
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Tipos da predição fiscal (/v2/fiscal/predict) e do saneamento em lote (/v2/fiscal/sanitize).
|
|
306
|
+
*
|
|
307
|
+
* Espelham o contrato da API. Os nomes usados até a 1.5 (`cfop`, `avisos`, `imposto_seletivo` e
|
|
308
|
+
* `aliquota_efetiva_unificada` na raiz) continuam preenchidos pelo SDK a partir dos oficiais.
|
|
309
|
+
*/
|
|
285
310
|
interface IBSCBSData {
|
|
286
311
|
cst: string;
|
|
287
312
|
cClassTrib: string;
|
|
@@ -289,16 +314,29 @@ interface IBSCBSData {
|
|
|
289
314
|
cbs_diferimento: number;
|
|
290
315
|
cbs_reducao_aliquota: number;
|
|
291
316
|
cbs_aliquota_efetiva: number;
|
|
317
|
+
aliquota_cbs_estimada?: number;
|
|
292
318
|
ibs_aliquota_estadual: number;
|
|
293
319
|
ibs_aliquota_municipal: number;
|
|
294
320
|
ibs_diferimento: number;
|
|
295
321
|
ibs_reducao_aliquota: number;
|
|
322
|
+
ibs_reducao_aliquota_estadual?: number;
|
|
323
|
+
ibs_reducao_aliquota_municipal?: number;
|
|
296
324
|
ibs_aliquota_efetiva: number;
|
|
325
|
+
aliquota_ibs_estimada?: number;
|
|
326
|
+
aliquota_efetiva_unificada?: number;
|
|
327
|
+
vTotDFe_obrigatorio?: boolean;
|
|
297
328
|
}
|
|
329
|
+
/** Imposto Seletivo: chega na chave `is` de `dados_tributarios`. */
|
|
298
330
|
interface SelectiveTaxData {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
331
|
+
incidencia?: boolean;
|
|
332
|
+
CSTIS?: string | null;
|
|
333
|
+
cClassTribIS?: string | null;
|
|
334
|
+
pIS?: number;
|
|
335
|
+
nota?: string | null;
|
|
336
|
+
/** @deprecated Use `CSTIS`. */
|
|
337
|
+
cst?: string | null;
|
|
338
|
+
/** @deprecated Use `pIS`. */
|
|
339
|
+
aliquota?: number;
|
|
302
340
|
}
|
|
303
341
|
interface FuelData {
|
|
304
342
|
codigo_anp: string;
|
|
@@ -310,30 +348,55 @@ interface FuelData {
|
|
|
310
348
|
}
|
|
311
349
|
interface TaxPredictionData {
|
|
312
350
|
ncm_sugerido: string;
|
|
313
|
-
cest_sugerido?: string;
|
|
314
|
-
|
|
315
|
-
|
|
351
|
+
cest_sugerido?: string | null;
|
|
352
|
+
origem_mercadoria?: string;
|
|
353
|
+
origem_mercadoria_descricao?: string;
|
|
354
|
+
cfop_interno?: string;
|
|
355
|
+
cfop_externo?: string;
|
|
356
|
+
cfop_devolucao_interno?: string | null;
|
|
357
|
+
cfop_devolucao_externo?: string | null;
|
|
316
358
|
icms_cst_csosn: string;
|
|
317
359
|
icms_aliquota: number;
|
|
318
|
-
icms_aliquota_st: number;
|
|
319
|
-
icms_mva_st: number;
|
|
320
360
|
icms_reducao_bc: number;
|
|
361
|
+
icms_sujeito_st?: boolean;
|
|
362
|
+
icms_mva_st: number;
|
|
363
|
+
icms_aliquota_st: number;
|
|
321
364
|
icms_reducao_bc_st: number;
|
|
322
|
-
icms_modalidade_bc
|
|
323
|
-
icms_modalidade_bc_st
|
|
365
|
+
icms_modalidade_bc?: string | null;
|
|
366
|
+
icms_modalidade_bc_st?: string | null;
|
|
367
|
+
icms_credito_aliquota_sn?: number;
|
|
368
|
+
dados_desoneracao_suframa?: Record<string, any> | null;
|
|
324
369
|
pis_cst: string;
|
|
325
370
|
pis_aliquota: number;
|
|
326
371
|
cofins_cst: string;
|
|
327
372
|
cofins_aliquota: number;
|
|
328
|
-
ipi_cst?: string;
|
|
373
|
+
ipi_cst?: string | null;
|
|
329
374
|
ipi_aliquota?: number;
|
|
375
|
+
extipi?: string | null;
|
|
376
|
+
reforma_tributaria_nota?: string;
|
|
330
377
|
ibscbs: IBSCBSData;
|
|
378
|
+
/** Imposto Seletivo (nome oficial da chave na API). */
|
|
379
|
+
is?: SelectiveTaxData;
|
|
380
|
+
combustivel_sujeito_anp?: boolean;
|
|
381
|
+
dados_combustivel?: FuelData | null;
|
|
382
|
+
diagnostico_anti_rejeicao?: Array<Record<string, string>>;
|
|
383
|
+
otimizacao_tributaria?: Record<string, any> | null;
|
|
384
|
+
difal?: Record<string, any> | null;
|
|
385
|
+
motor_ia: string;
|
|
386
|
+
avisos_fiscais?: string[];
|
|
387
|
+
disclaimer?: string;
|
|
388
|
+
/** @deprecated Use `cfop_interno` ou `cfop_externo` conforme a UF de destino (preenchido com `cfop_interno`). */
|
|
389
|
+
cfop?: string;
|
|
390
|
+
/** @deprecated Use `cfop_devolucao_interno` / `cfop_devolucao_externo`. */
|
|
391
|
+
cfop_devolucao?: string | null;
|
|
392
|
+
/** @deprecated Use `is`. */
|
|
331
393
|
imposto_seletivo?: SelectiveTaxData;
|
|
332
|
-
|
|
394
|
+
/** @deprecated Use `ibscbs.aliquota_efetiva_unificada`. */
|
|
395
|
+
aliquota_efetiva_unificada?: number;
|
|
396
|
+
/** @deprecated Use `avisos_fiscais`. */
|
|
397
|
+
avisos?: string[];
|
|
398
|
+
/** @deprecated Não é devolvido pela API. */
|
|
333
399
|
beneficio_fiscal?: string;
|
|
334
|
-
aliquota_efetiva_unificada: number;
|
|
335
|
-
motor_ia: string;
|
|
336
|
-
avisos: string[];
|
|
337
400
|
}
|
|
338
401
|
interface TaxPredictionItemInput {
|
|
339
402
|
xProd?: string;
|
|
@@ -347,6 +410,10 @@ interface TaxPredictionParams {
|
|
|
347
410
|
ufDestino?: string;
|
|
348
411
|
finalidade?: 'revenda' | 'consumo_final' | 'industrializacao' | string;
|
|
349
412
|
destinatarioContribuinte?: boolean;
|
|
413
|
+
/** Alíquota de crédito de ICMS do Simples Nacional (pCredSN). */
|
|
414
|
+
aliquotaCreditoIcmsSn?: number;
|
|
415
|
+
destinatarioSuframa?: boolean;
|
|
416
|
+
inscricaoSuframa?: string;
|
|
350
417
|
xProd?: string;
|
|
351
418
|
gtin?: string;
|
|
352
419
|
ncm?: string;
|
|
@@ -355,38 +422,49 @@ interface TaxPredictionParams {
|
|
|
355
422
|
}
|
|
356
423
|
interface TaxPredictionItemResult {
|
|
357
424
|
item_index: number;
|
|
358
|
-
xProd?: string;
|
|
425
|
+
xProd?: string | null;
|
|
359
426
|
dados_tributarios: TaxPredictionData;
|
|
360
427
|
}
|
|
361
428
|
interface TaxPredictionResponse {
|
|
362
429
|
status: string;
|
|
363
430
|
provider: string;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
431
|
+
timestamp?: string;
|
|
432
|
+
motor_ia?: string | null;
|
|
433
|
+
xProd?: string | null;
|
|
434
|
+
dados_tributarios?: TaxPredictionData | null;
|
|
435
|
+
resultados?: TaxPredictionItemResult[] | null;
|
|
367
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Item do saneamento. A API exige `NCM`/`CEST` em maiúsculas; os nomes `ncm`, `cest`,
|
|
439
|
+
* `descricao` e `gtin` da 1.5 continuam aceitos e são convertidos pelo SDK.
|
|
440
|
+
*/
|
|
368
441
|
interface FiscalSanitizeItemInput {
|
|
369
|
-
|
|
442
|
+
NCM?: string;
|
|
443
|
+
CEST?: string;
|
|
444
|
+
xProd?: string;
|
|
445
|
+
id?: string;
|
|
446
|
+
/** @deprecated Use `NCM`. */
|
|
447
|
+
ncm?: string;
|
|
448
|
+
/** @deprecated Use `CEST`. */
|
|
370
449
|
cest?: string;
|
|
450
|
+
/** @deprecated Use `xProd`. */
|
|
371
451
|
descricao?: string;
|
|
452
|
+
/** @deprecated Use `id`. */
|
|
372
453
|
gtin?: string;
|
|
373
454
|
}
|
|
374
455
|
interface FiscalSanitizeItemResult {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
sujeito_st: boolean;
|
|
381
|
-
aliquotas_sugeridas?: Record<string, any>;
|
|
382
|
-
avisos?: string[];
|
|
456
|
+
id?: string;
|
|
457
|
+
xProd?: string;
|
|
458
|
+
NCM_informado?: string;
|
|
459
|
+
CEST_informado?: string | null;
|
|
460
|
+
auditoria_fiscal: Record<string, any>;
|
|
383
461
|
}
|
|
384
462
|
interface FiscalSanitizeResponse {
|
|
385
463
|
status: string;
|
|
386
464
|
provider: string;
|
|
387
465
|
timestamp?: string;
|
|
388
466
|
total_itens: number;
|
|
389
|
-
itens:
|
|
467
|
+
itens: FiscalSanitizeItemResult[];
|
|
390
468
|
}
|
|
391
469
|
|
|
392
470
|
declare class FiscalResource extends BaseResource {
|
|
@@ -396,8 +474,9 @@ declare class FiscalResource extends BaseResource {
|
|
|
396
474
|
predict(params: TaxPredictionParams): Promise<TaxPredictionResponse>;
|
|
397
475
|
/**
|
|
398
476
|
* Audita e higieniza uma lista de produtos em lote perante as tabelas fiscais vigentes.
|
|
477
|
+
* Cada item precisa de `NCM` (aceita também `ncm`); `CEST`, `xProd` e `id` são opcionais.
|
|
399
478
|
*/
|
|
400
|
-
sanitize(itens:
|
|
479
|
+
sanitize(itens: FiscalSanitizeItemInput[]): Promise<FiscalSanitizeResponse>;
|
|
401
480
|
}
|
|
402
481
|
|
|
403
482
|
interface EnderecoNFSeInput {
|
|
@@ -443,6 +522,14 @@ interface RetencoesFederaisInput {
|
|
|
443
522
|
aliquota_inss?: number;
|
|
444
523
|
valor_inss?: number;
|
|
445
524
|
}
|
|
525
|
+
/** Campos da Reforma Tributária (IBS e CBS) sobre serviços (LC 214/2025). */
|
|
526
|
+
interface ReformaTributariaServicoInput {
|
|
527
|
+
cst_ibs_cbs?: string;
|
|
528
|
+
cClassTrib?: string;
|
|
529
|
+
aliquota_ibs_estadual?: number;
|
|
530
|
+
aliquota_ibs_municipal?: number;
|
|
531
|
+
aliquota_cbs?: number;
|
|
532
|
+
}
|
|
446
533
|
interface ServicoNFSeInput {
|
|
447
534
|
item_lista_servico: string;
|
|
448
535
|
discriminacao: string;
|
|
@@ -455,8 +542,10 @@ interface ServicoNFSeInput {
|
|
|
455
542
|
valor_desconto_condicionado?: number;
|
|
456
543
|
iss_retido?: boolean;
|
|
457
544
|
aliquota_iss?: number;
|
|
545
|
+
/** '1' Exigível, '2' Não incidência, '3' Isenção, '4' Exportação, '5' Imunidade, '6'/'7' Suspensa. */
|
|
458
546
|
exigibilidade_iss?: string;
|
|
459
547
|
retencoes_federais?: RetencoesFederaisInput;
|
|
548
|
+
reforma_tributaria?: ReformaTributariaServicoInput;
|
|
460
549
|
}
|
|
461
550
|
interface NFSeEmissaoInput {
|
|
462
551
|
prestador: PrestadorNFSeInput | Record<string, any>;
|
|
@@ -479,6 +568,8 @@ interface NFSeEmissaoResponse {
|
|
|
479
568
|
data_emissao?: string;
|
|
480
569
|
link_visualizacao?: string;
|
|
481
570
|
danfse_pdf_base64?: string;
|
|
571
|
+
/** Alias de danfse_pdf_base64 devolvido pela API. */
|
|
572
|
+
danfse_base64?: string;
|
|
482
573
|
xml_nfse?: string;
|
|
483
574
|
valor_servicos: number;
|
|
484
575
|
valor_iss: number;
|
|
@@ -487,7 +578,13 @@ interface NFSeEmissaoResponse {
|
|
|
487
578
|
valor_liquido: number;
|
|
488
579
|
erros?: string[];
|
|
489
580
|
alertas?: string[];
|
|
490
|
-
trilha_auditoria?:
|
|
581
|
+
trilha_auditoria?: Array<{
|
|
582
|
+
autor: string;
|
|
583
|
+
acao: string;
|
|
584
|
+
justificativa_legal: string;
|
|
585
|
+
campos_alterados?: Record<string, any>;
|
|
586
|
+
timestamp: string;
|
|
587
|
+
}>;
|
|
491
588
|
creditos_cobrados: number;
|
|
492
589
|
tempo_processamento_ms: number;
|
|
493
590
|
}
|
|
@@ -497,6 +594,7 @@ interface CancelamentoNFSeInput {
|
|
|
497
594
|
inscricao_municipal: string;
|
|
498
595
|
codigo_municipio_ibge: string;
|
|
499
596
|
justificativa: string;
|
|
597
|
+
/** '1' Erro de emissão, '2' Serviço não prestado, '3' Duplicidade, '9' Outros. */
|
|
500
598
|
motivo_codigo?: string;
|
|
501
599
|
codigo_verificacao?: string;
|
|
502
600
|
chave_acesso_nacional?: string;
|
|
@@ -528,6 +626,11 @@ declare class NFSeResource extends BaseResource {
|
|
|
528
626
|
consultar(chaveOuNumero: string): Promise<Record<string, any>>;
|
|
529
627
|
}
|
|
530
628
|
|
|
629
|
+
/**
|
|
630
|
+
* Tipos de produto do SDK. A API devolve o produto no layout da NF-e (`GTIN`, `NCM`, `CEST`) com
|
|
631
|
+
* marca, categoria, imagem e pesos em `infoAdicional` e a IA em `enriquecimentoIA`/`tributacaoIA`;
|
|
632
|
+
* o `ProductsResource` converte esse contrato para os tipos abaixo.
|
|
633
|
+
*/
|
|
531
634
|
interface ProductDetails {
|
|
532
635
|
gtin: string;
|
|
533
636
|
xProd: string;
|
|
@@ -542,10 +645,16 @@ interface ProductDetails {
|
|
|
542
645
|
quantidadeEmbalagem?: number;
|
|
543
646
|
dataCadastro?: string;
|
|
544
647
|
dataAtualizacao?: string;
|
|
648
|
+
tpGTIN?: string;
|
|
649
|
+
fonte?: string;
|
|
650
|
+
/** Bloco `infoAdicional` original da API. */
|
|
651
|
+
infoAdicional?: Record<string, any>;
|
|
545
652
|
}
|
|
546
653
|
interface ProductResponse {
|
|
547
654
|
status: string;
|
|
548
655
|
provider: string;
|
|
656
|
+
cStat?: string;
|
|
657
|
+
xMotivo?: string;
|
|
549
658
|
produto?: ProductDetails;
|
|
550
659
|
raw_data?: Record<string, any>;
|
|
551
660
|
}
|
|
@@ -555,6 +664,8 @@ interface ProductSearchResultItem {
|
|
|
555
664
|
marca?: string;
|
|
556
665
|
categoria?: string;
|
|
557
666
|
score?: number;
|
|
667
|
+
/** Explicação da correspondência semântica. */
|
|
668
|
+
justificativa?: string;
|
|
558
669
|
ncm?: string;
|
|
559
670
|
cest?: string;
|
|
560
671
|
imagem_url?: string;
|
|
@@ -564,12 +675,17 @@ interface ProductSearchResponse {
|
|
|
564
675
|
provider: string;
|
|
565
676
|
total_encontrados: number;
|
|
566
677
|
termo_buscado: string;
|
|
678
|
+
motor_busca?: string;
|
|
567
679
|
produtos: ProductSearchResultItem[];
|
|
568
680
|
}
|
|
569
681
|
interface ProductEnrichedDetails {
|
|
570
682
|
gtin: string;
|
|
571
683
|
xProd: string;
|
|
684
|
+
/** Nome saneado pela IA. */
|
|
685
|
+
xProd_higienizado?: string;
|
|
686
|
+
/** Descrição otimizada para SEO (`enriquecimentoIA.descricao_seo`). */
|
|
572
687
|
descricao_completa?: string;
|
|
688
|
+
/** Atributos técnicos extraídos pela IA (`enriquecimentoIA.atributos`). */
|
|
573
689
|
ficha_tecnica?: Record<string, any>;
|
|
574
690
|
palavras_chave?: string[];
|
|
575
691
|
ncm?: string;
|
|
@@ -579,7 +695,13 @@ interface ProductEnrichedDetails {
|
|
|
579
695
|
imagem_url?: string;
|
|
580
696
|
peso_bruto?: number;
|
|
581
697
|
peso_liquido?: number;
|
|
698
|
+
/** Nó `tributacaoIA` da API. */
|
|
582
699
|
dados_tributarios_sugeridos?: Record<string, any>;
|
|
700
|
+
tpGTIN?: string;
|
|
701
|
+
fonte?: string;
|
|
702
|
+
infoAdicional?: Record<string, any>;
|
|
703
|
+
enriquecimentoIA?: Record<string, any>;
|
|
704
|
+
tributacaoIA?: Record<string, any>;
|
|
583
705
|
}
|
|
584
706
|
|
|
585
707
|
declare class ProductsResource extends BaseResource {
|
|
@@ -665,4 +787,4 @@ declare class NetworkError extends PairusError {
|
|
|
665
787
|
constructor(message: string);
|
|
666
788
|
}
|
|
667
789
|
|
|
668
|
-
export { AuthenticationError, type CancelamentoInput, type CancelamentoNFSeInput, type CancelamentoNFSeResponse, type CartaCorrecaoInput, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, DFeResource, type
|
|
790
|
+
export { AuthenticationError, type CancelamentoInput, type CancelamentoNFSeInput, type CancelamentoNFSeResponse, type CartaCorrecaoInput, DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, DFeResource, type DocumentoDFe, type EmissaoDestinatarioInput, type EmissaoItemInput, type EmissaoNFeInput, type EmissaoNFeResponse, type EmissaoOptions, type EmissaoPagamentoInput, EmissaoResource, type EnderecoNFSeInput, type EventoNFeResponse, FiscalResource, type FiscalSanitizeItemInput, type FiscalSanitizeItemResult, type FiscalSanitizeResponse, type FuelData, type IBSCBSData, type InutilizacaoInput, InvalidSignatureError, type ListarDocumentosDFeParams, type ListarDocumentosDFeResponse, type ManifestarDFeInput, type ManifestarDFeResponse, type NFSeEmissaoInput, type NFSeEmissaoResponse, NFSeResource, NetworkError, PairusAPIError, type PairusClientOptions, PairusError, PairusProductData, type PrestadorNFSeInput, type ProductDetails, type ProductEnrichedDetails, type ProductResponse, type ProductSearchResponse, type ProductSearchResultItem, ProductsResource, RateLimitError, type ReformaTributariaServicoInput, type RetencoesFederaisInput, type SelectiveTaxData, type ServicoNFSeInput, type SincronizarDFeInput, type SincronizarDFeResponse, type TaxPredictionData, type TaxPredictionItemInput, type TaxPredictionItemResult, type TaxPredictionParams, type TaxPredictionResponse, type TipoManifestacaoDFe, type TomadorNFSeInput, type WebhookEvent, Webhooks };
|