nfets 0.0.138 → 0.0.140
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/core/index.cjs +78 -78
- package/dist/core/index.d.cts +13 -3
- package/dist/core/index.d.ts +13 -3
- package/dist/core/index.mjs +63 -63
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/nfe/index.cjs +56 -34
- package/dist/nfe/index.d.cts +422 -10
- package/dist/nfe/index.d.ts +422 -10
- package/dist/nfe/index.mjs +38 -16
- package/dist/{src-NRIPS2N7.mjs → src-6IMZY2I2.mjs} +1 -1
- package/dist/{types-BlTnVW8U.d.cts → types-B8bOrWDU.d.cts} +17 -1
- package/dist/{types-BlTnVW8U.d.ts → types-B8bOrWDU.d.ts} +17 -1
- package/package.json +1 -1
package/dist/nfe/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, l as Signature, i as StateAcronym, x as NFeTsError, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client,
|
|
1
|
+
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, l as Signature, i as StateAcronym, x as NFeTsError, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client, a3 as RequestConfig, a8 as SignedEntity, ad as Either, a as ReadCertificateResponse, O as RowBuilderOptions, Y as PdfBuilder, ai as DeepPartial, w as XmlToolkit, R as ReadCertificateRequest, a5 as HttpClient, Z as CacheAdapter, $ as CertificateRepository, a6 as RemoteTransmissionRepository, ab as EntitySigner, ac as XmlSigner, ae as Left, af as Right, N as Namespaced, d as SignatureAlgorithm } from '../types-B8bOrWDU.cjs';
|
|
2
2
|
import { Writable } from 'node:stream';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
3
4
|
import 'node:crypto';
|
|
4
5
|
|
|
5
6
|
interface AccessKey {
|
|
@@ -28,6 +29,28 @@ interface EventoCancelamento extends DetEventoCancelamento {
|
|
|
28
29
|
dhEvento?: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
declare enum TpEvent {
|
|
33
|
+
Cancelamento = "110111",
|
|
34
|
+
CancelamentoSubstituicao = "110112",
|
|
35
|
+
ConfirmacaoOperacao = "210200",
|
|
36
|
+
CienciaOperacao = "210210",
|
|
37
|
+
DesconhecimentoOperacao = "210220",
|
|
38
|
+
OperacaoNaoRealizada = "210240"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type TpEventManifestacao = TpEvent.ConfirmacaoOperacao | TpEvent.CienciaOperacao | TpEvent.DesconhecimentoOperacao | TpEvent.OperacaoNaoRealizada;
|
|
42
|
+
interface DetEventoManifestacao {
|
|
43
|
+
xJust?: string;
|
|
44
|
+
}
|
|
45
|
+
interface EventoManifestacao extends DetEventoManifestacao {
|
|
46
|
+
chNFe: string;
|
|
47
|
+
identification: string;
|
|
48
|
+
tpEvento: TpEventManifestacao;
|
|
49
|
+
nSeqEvento?: number;
|
|
50
|
+
idLote?: string;
|
|
51
|
+
dhEvento?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
31
54
|
declare enum TpEmis {
|
|
32
55
|
Normal = "1",
|
|
33
56
|
EPEC = "4",
|
|
@@ -1566,11 +1589,6 @@ interface ConsultaCadastroResponse {
|
|
|
1566
1589
|
};
|
|
1567
1590
|
}
|
|
1568
1591
|
|
|
1569
|
-
declare enum TpEvent {
|
|
1570
|
-
Cancelamento = "110111",
|
|
1571
|
-
CancelamentoSubstituicao = "110112"
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
1592
|
interface EventoPayload<T> {
|
|
1575
1593
|
idLote: string;
|
|
1576
1594
|
evento: EventoItem<T>;
|
|
@@ -1584,7 +1602,7 @@ interface InfEventoAttributes {
|
|
|
1584
1602
|
}
|
|
1585
1603
|
interface InfEvento<T> {
|
|
1586
1604
|
$: InfEventoAttributes;
|
|
1587
|
-
cOrgao: StateCode;
|
|
1605
|
+
cOrgao: StateCode | '91';
|
|
1588
1606
|
tpAmb: EnvironmentCode;
|
|
1589
1607
|
CNPJ?: string;
|
|
1590
1608
|
CPF?: string;
|
|
@@ -1743,6 +1761,57 @@ interface ConsultaProtocoloResponse {
|
|
|
1743
1761
|
};
|
|
1744
1762
|
}
|
|
1745
1763
|
|
|
1764
|
+
interface ConsChNFe {
|
|
1765
|
+
chNFe: string;
|
|
1766
|
+
}
|
|
1767
|
+
interface DistribuicaoDFePayload {
|
|
1768
|
+
tpAmb: EnvironmentCode;
|
|
1769
|
+
cUFAutor: StateCode;
|
|
1770
|
+
CNPJ?: string;
|
|
1771
|
+
CPF?: string;
|
|
1772
|
+
consChNFe: ConsChNFe;
|
|
1773
|
+
}
|
|
1774
|
+
interface DistribuicaoDFeRequest {
|
|
1775
|
+
nfeDadosMsg: {
|
|
1776
|
+
distDFeInt: DistribuicaoDFePayload;
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
interface RetDistDFeInt {
|
|
1780
|
+
$: {
|
|
1781
|
+
versao: string;
|
|
1782
|
+
};
|
|
1783
|
+
tpAmb: string;
|
|
1784
|
+
verAplic: string;
|
|
1785
|
+
cStat: string;
|
|
1786
|
+
xMotivo: string;
|
|
1787
|
+
dhResp: string;
|
|
1788
|
+
ultNSU: string;
|
|
1789
|
+
maxNSU: string;
|
|
1790
|
+
loteDistDFeInt?: {
|
|
1791
|
+
docZip: {
|
|
1792
|
+
$: {
|
|
1793
|
+
NSU: string;
|
|
1794
|
+
schema: string;
|
|
1795
|
+
};
|
|
1796
|
+
$value: string;
|
|
1797
|
+
};
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
interface DistribuicaoDFeResponse {
|
|
1801
|
+
nfeDistDFeInteresseResult: {
|
|
1802
|
+
retDistDFeInt: RetDistDFeInt;
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
interface ConsultaChaveDistribuicaoDFe {
|
|
1806
|
+
chNFe: string;
|
|
1807
|
+
identification: string;
|
|
1808
|
+
cUFAutor: StateCode;
|
|
1809
|
+
}
|
|
1810
|
+
interface PipelineDistribuicaoDFeResponse {
|
|
1811
|
+
response: RetDistDFeInt;
|
|
1812
|
+
xml?: string;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1746
1815
|
interface VoidRangePayload {
|
|
1747
1816
|
tpAmb?: EnvironmentCode;
|
|
1748
1817
|
ano?: string;
|
|
@@ -1902,7 +1971,7 @@ interface ContingencyOptions {
|
|
|
1902
1971
|
dhCont: string;
|
|
1903
1972
|
}
|
|
1904
1973
|
interface NfeTransmitterOptions extends TransmitterOptions {
|
|
1905
|
-
cUF: StateCode;
|
|
1974
|
+
cUF: StateCode | '91';
|
|
1906
1975
|
schema?: Schema;
|
|
1907
1976
|
tpAmb: EnvironmentCode;
|
|
1908
1977
|
contingency?: ContingencyOptions;
|
|
@@ -1918,6 +1987,7 @@ interface NfeTransmitter extends Transmitter<NfeRemoteClient> {
|
|
|
1918
1987
|
retAutorizacao(payload: RetAutorizacaoPayload): Promise<Either<NFeTsError, RetAutorizacaoResponse>>;
|
|
1919
1988
|
recepcaoEvento<T>(payload: EventoPayload<T>): Promise<Either<NFeTsError, EventoResponse>>;
|
|
1920
1989
|
consultaCadastro(payload: ConsultaCadastroPayload): Promise<Either<NFeTsError, ConsultaCadastroResponse>>;
|
|
1990
|
+
distribuicaoDFe(payload: DistribuicaoDFePayload): Promise<Either<NFeTsError, DistribuicaoDFeResponse>>;
|
|
1921
1991
|
}
|
|
1922
1992
|
interface NfeRemoteClient extends Client {
|
|
1923
1993
|
nfeStatusServicoNF(args: ConsultStatusRequest, opt?: RequestConfig): Promise<ConsultStatusResponse>;
|
|
@@ -1935,6 +2005,7 @@ interface NfeRemoteClient extends Client {
|
|
|
1935
2005
|
consultaCadastro(args: ConsultaCadastroRequest, opt?: RequestConfig): Promise<ConsultaCadastroResponse>;
|
|
1936
2006
|
consultaCadastro4(args: ConsultaCadastroRequest, opt?: RequestConfig): Promise<ConsultaCadastroResponse>;
|
|
1937
2007
|
ConsultaCadastro(args: ConsultaCadastroRequest, opt?: RequestConfig): Promise<ConsultaCadastroResponse>;
|
|
2008
|
+
nfeDistDFeInteresse(args: DistribuicaoDFeRequest, opt?: RequestConfig): Promise<DistribuicaoDFeResponse>;
|
|
1938
2009
|
}
|
|
1939
2010
|
|
|
1940
2011
|
interface NfceQrcodeOptionsBase {
|
|
@@ -1972,6 +2043,70 @@ interface Builder {
|
|
|
1972
2043
|
height?: () => number;
|
|
1973
2044
|
}
|
|
1974
2045
|
|
|
2046
|
+
declare const ptPerMm: number;
|
|
2047
|
+
declare const mm: (value: number) => number;
|
|
2048
|
+
declare const DanfeSize: {
|
|
2049
|
+
readonly A4: readonly [number, number];
|
|
2050
|
+
};
|
|
2051
|
+
declare const DanfeMargins: {
|
|
2052
|
+
readonly top: number;
|
|
2053
|
+
readonly right: number;
|
|
2054
|
+
readonly bottom: number;
|
|
2055
|
+
readonly left: number;
|
|
2056
|
+
};
|
|
2057
|
+
type DanfeLayout = 'portrait' | 'landscape';
|
|
2058
|
+
interface DanfeOptions {
|
|
2059
|
+
size: keyof typeof DanfeSize;
|
|
2060
|
+
layout: DanfeLayout;
|
|
2061
|
+
qComDecimals: number;
|
|
2062
|
+
vUnComDecimals: number;
|
|
2063
|
+
showCanhoto: boolean;
|
|
2064
|
+
showItemBatch: boolean;
|
|
2065
|
+
showItemComplement: boolean;
|
|
2066
|
+
showItemOrderNumber: boolean;
|
|
2067
|
+
breakItemDescription: boolean;
|
|
2068
|
+
hideTaxUnit: boolean;
|
|
2069
|
+
logo?: string;
|
|
2070
|
+
credits?: string;
|
|
2071
|
+
}
|
|
2072
|
+
interface DanfeArea {
|
|
2073
|
+
x: number;
|
|
2074
|
+
y: number;
|
|
2075
|
+
width: number;
|
|
2076
|
+
height?: number;
|
|
2077
|
+
}
|
|
2078
|
+
interface DanfeFieldCell {
|
|
2079
|
+
label: string;
|
|
2080
|
+
value?: string;
|
|
2081
|
+
weight: number;
|
|
2082
|
+
align?: 'left' | 'center' | 'right';
|
|
2083
|
+
bold?: boolean;
|
|
2084
|
+
valueSize?: number;
|
|
2085
|
+
}
|
|
2086
|
+
interface DanfeItemsColumn {
|
|
2087
|
+
label: string;
|
|
2088
|
+
weight: number;
|
|
2089
|
+
align?: 'left' | 'center' | 'right';
|
|
2090
|
+
}
|
|
2091
|
+
interface DanfeItemsPairsCell {
|
|
2092
|
+
pairs: [string, string][];
|
|
2093
|
+
columns?: number;
|
|
2094
|
+
muted?: boolean;
|
|
2095
|
+
}
|
|
2096
|
+
interface DanfeTextRun {
|
|
2097
|
+
text: string;
|
|
2098
|
+
color?: string;
|
|
2099
|
+
align?: 'left' | 'center' | 'right';
|
|
2100
|
+
blankBefore?: boolean;
|
|
2101
|
+
fit?: boolean;
|
|
2102
|
+
}
|
|
2103
|
+
type DanfeItemsCell = string | DanfeTextRun[] | DanfeItemsPairsCell;
|
|
2104
|
+
interface DanfePageSlice<T> {
|
|
2105
|
+
items: T[];
|
|
2106
|
+
isFirst: boolean;
|
|
2107
|
+
isLast: boolean;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
1975
2110
|
interface VItem {
|
|
1976
2111
|
vItem: DecimalValue;
|
|
1977
2112
|
}
|
|
@@ -3542,6 +3677,7 @@ declare const webservices$1: {
|
|
|
3542
3677
|
readonly "28": "SVRS";
|
|
3543
3678
|
readonly "35": "SP";
|
|
3544
3679
|
readonly "17": "SVRS";
|
|
3680
|
+
readonly 91: "AN";
|
|
3545
3681
|
readonly AN: "AN";
|
|
3546
3682
|
readonly SVAN: "SVAN";
|
|
3547
3683
|
readonly SVRS: "SVRS";
|
|
@@ -3572,6 +3708,7 @@ declare class NfeRemoteTransmitter implements NfeTransmitter {
|
|
|
3572
3708
|
retAutorizacao(payload: RetAutorizacaoPayload): Promise<Either<NFeTsError, RetAutorizacaoResponse>>;
|
|
3573
3709
|
recepcaoEvento<T>(payload: EventoRequest<T>['envEvento']): Promise<Either<NFeTsError, EventoResponse>>;
|
|
3574
3710
|
consultaCadastro(payload: ConsultaCadastroPayload): Promise<Either<NFeTsError, ConsultaCadastroResponse>>;
|
|
3711
|
+
distribuicaoDFe(payload: DistribuicaoDFePayload): Promise<Either<NFeTsError, DistribuicaoDFeResponse>>;
|
|
3575
3712
|
}
|
|
3576
3713
|
|
|
3577
3714
|
interface IssuerIdentification {
|
|
@@ -3589,6 +3726,7 @@ declare abstract class TransmissionPipeline extends Pipeline {
|
|
|
3589
3726
|
declare abstract class EventPipeline extends TransmissionPipeline {
|
|
3590
3727
|
protected event<T>(tpEvento: TpEvent, payload: Pick<EventoItem<T>['infEvento'], 'nSeqEvento' | 'dhEvento' | 'chNFe' | 'detEvento'> & {
|
|
3591
3728
|
identification: string;
|
|
3729
|
+
cOrgao?: '91';
|
|
3592
3730
|
}, options: Pick<NfeTransmitterOptions, 'tpAmb'>): Promise<Either<NFeTsError, SignedEntity<EventoItem<{
|
|
3593
3731
|
descEvento: string;
|
|
3594
3732
|
} & T>>>>;
|
|
@@ -3642,7 +3780,9 @@ declare class NfeAuthorizerPipeline extends TransmissionPipeline {
|
|
|
3642
3780
|
}
|
|
3643
3781
|
|
|
3644
3782
|
declare class NfeVoidRangePipeline extends TransmissionPipeline {
|
|
3645
|
-
execute(payload: VoidRangePayload, options: Pick<NfeTransmitterOptions, 'tpAmb'
|
|
3783
|
+
execute(payload: VoidRangePayload, options: Pick<NfeTransmitterOptions, 'tpAmb'> & {
|
|
3784
|
+
cUF: StateCode;
|
|
3785
|
+
}): Promise<Left<NFeTsError> | Right<{
|
|
3646
3786
|
xml: string;
|
|
3647
3787
|
response: InutilizacaoResponse;
|
|
3648
3788
|
}>>;
|
|
@@ -3665,6 +3805,20 @@ declare class NfeAuthorizationResponsePipeline extends TransmissionPipeline {
|
|
|
3665
3805
|
}): Promise<Either<NFeTsError, RetAutorizacaoResponse>>;
|
|
3666
3806
|
}
|
|
3667
3807
|
|
|
3808
|
+
declare class NfeManifestacaoPipeline extends EventPipeline {
|
|
3809
|
+
execute(payload: EventoManifestacao, options: Pick<NfeTransmitterOptions, 'tpAmb'>): Promise<Left<NFeTsError> | Right<{
|
|
3810
|
+
xml: string;
|
|
3811
|
+
response: EventoResponse;
|
|
3812
|
+
}>>;
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
declare class NfeDistribuicaoDFePipeline extends TransmissionPipeline {
|
|
3816
|
+
execute(payload: ConsultaChaveDistribuicaoDFe, options: Pick<NfeTransmitterOptions, 'tpAmb'>): Promise<Left<NFeTsError> | Right<{
|
|
3817
|
+
response: RetDistDFeInt;
|
|
3818
|
+
xml: string | undefined;
|
|
3819
|
+
}>>;
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3668
3822
|
declare class NfceQrcode {
|
|
3669
3823
|
private readonly certificateRepository;
|
|
3670
3824
|
constructor(certificateRepository: CertificateRepository);
|
|
@@ -5039,6 +5193,264 @@ declare class DanfceReducedPdfDocument extends DanfcePdfDocument {
|
|
|
5039
5193
|
protected get builders(): Builder[];
|
|
5040
5194
|
}
|
|
5041
5195
|
|
|
5196
|
+
declare class DanfeFormatter {
|
|
5197
|
+
private readonly context;
|
|
5198
|
+
constructor(context: DanfePdfDocument);
|
|
5199
|
+
isNotEmpty(value?: DecimalValue): value is DecimalValue;
|
|
5200
|
+
emitted(value: DecimalValue | undefined, max: number): string;
|
|
5201
|
+
decimal(value?: DecimalValue, minimumFractionDigits?: number, maximumFractionDigits?: number): string;
|
|
5202
|
+
currency(value?: DecimalValue): string;
|
|
5203
|
+
percent(value?: DecimalValue): string;
|
|
5204
|
+
document(cnpj?: string, cpf?: string): string;
|
|
5205
|
+
cep(value?: string): string;
|
|
5206
|
+
phone(value?: string): string;
|
|
5207
|
+
number(nNF: string): string;
|
|
5208
|
+
serie(serie: string): string;
|
|
5209
|
+
blank(value?: string): string;
|
|
5210
|
+
accessKey(): string;
|
|
5211
|
+
accessKeyDigits(): string;
|
|
5212
|
+
protected tz(value: string): dayjs.Dayjs;
|
|
5213
|
+
date(value?: string): string;
|
|
5214
|
+
time(value?: string): string;
|
|
5215
|
+
dateTime(value?: string): string;
|
|
5216
|
+
plainDate(value?: string): string;
|
|
5217
|
+
now(): string;
|
|
5218
|
+
sanitize(value?: string): string;
|
|
5219
|
+
}
|
|
5220
|
+
|
|
5221
|
+
interface FieldTextOptions {
|
|
5222
|
+
size: number;
|
|
5223
|
+
bold?: boolean;
|
|
5224
|
+
color?: string;
|
|
5225
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
5226
|
+
lineBreak?: boolean;
|
|
5227
|
+
}
|
|
5228
|
+
type FieldBoxCell = Omit<DanfeFieldCell, 'weight'>;
|
|
5229
|
+
declare class FieldBox {
|
|
5230
|
+
private readonly context;
|
|
5231
|
+
readonly labelSize = 5;
|
|
5232
|
+
readonly valueSize = 8;
|
|
5233
|
+
readonly titleSize = 6.5;
|
|
5234
|
+
readonly muted = "#595959";
|
|
5235
|
+
readonly padding = 2.5;
|
|
5236
|
+
readonly rowHeight: number;
|
|
5237
|
+
readonly radius: number;
|
|
5238
|
+
constructor(context: DanfePdfDocument);
|
|
5239
|
+
protected get builder(): PdfBuilder;
|
|
5240
|
+
get titleHeight(): number;
|
|
5241
|
+
get labelHeight(): number;
|
|
5242
|
+
text(text: string, x: number, y: number, width: number, height: number, options: FieldTextOptions): void;
|
|
5243
|
+
measure(text: string, width: number, options: FieldTextOptions): number;
|
|
5244
|
+
rect(x: number, y: number, width: number, height: number): void;
|
|
5245
|
+
box(x: number, y: number, width: number, height: number, cell: FieldBoxCell): void;
|
|
5246
|
+
widths(width: number, weights: number[]): number[];
|
|
5247
|
+
row(x: number, y: number, width: number, height: number, cells: DanfeFieldCell[]): number;
|
|
5248
|
+
grid(x: number, y: number, width: number, cells: FieldBoxCell[], perRow: number, height?: number): number;
|
|
5249
|
+
gridRows(count: number, perRow: number): number;
|
|
5250
|
+
widthOf(text: string, options: FieldTextOptions): number;
|
|
5251
|
+
title(x: number, y: number, width: number, text: string): number;
|
|
5252
|
+
}
|
|
5253
|
+
|
|
5254
|
+
declare abstract class DanfeBlock implements Builder {
|
|
5255
|
+
protected readonly context: DanfePdfDocument;
|
|
5256
|
+
constructor(context: DanfePdfDocument);
|
|
5257
|
+
protected get builder(): PdfBuilder;
|
|
5258
|
+
protected get fields(): FieldBox;
|
|
5259
|
+
protected get format(): DanfeFormatter;
|
|
5260
|
+
protected get infNFe(): InfNFe;
|
|
5261
|
+
visible(): boolean;
|
|
5262
|
+
prepare(): Promise<void>;
|
|
5263
|
+
abstract height(): number;
|
|
5264
|
+
protected abstract draw(area: DanfeArea): void;
|
|
5265
|
+
setup(): void;
|
|
5266
|
+
build(options?: DanfeArea): PdfBuilder;
|
|
5267
|
+
end(): void;
|
|
5268
|
+
}
|
|
5269
|
+
|
|
5270
|
+
interface DetIcmsValues {
|
|
5271
|
+
orig?: string;
|
|
5272
|
+
CST?: string;
|
|
5273
|
+
CSOSN?: string;
|
|
5274
|
+
vBC?: DecimalValue;
|
|
5275
|
+
pICMS?: DecimalValue;
|
|
5276
|
+
vICMS?: DecimalValue;
|
|
5277
|
+
vBCFCP?: DecimalValue;
|
|
5278
|
+
pFCP?: DecimalValue;
|
|
5279
|
+
vFCP?: DecimalValue;
|
|
5280
|
+
pRedBC?: DecimalValue;
|
|
5281
|
+
pMVAST?: DecimalValue;
|
|
5282
|
+
pICMSST?: DecimalValue;
|
|
5283
|
+
vBCST?: DecimalValue;
|
|
5284
|
+
vICMSST?: DecimalValue;
|
|
5285
|
+
vBCFCPST?: DecimalValue;
|
|
5286
|
+
pFCPST?: DecimalValue;
|
|
5287
|
+
vFCPST?: DecimalValue;
|
|
5288
|
+
vBCSTRet?: DecimalValue;
|
|
5289
|
+
pST?: DecimalValue;
|
|
5290
|
+
vICMSSubstituto?: DecimalValue;
|
|
5291
|
+
vICMSSTRet?: DecimalValue;
|
|
5292
|
+
}
|
|
5293
|
+
|
|
5294
|
+
type Labels = Partial<Record<string, string>>;
|
|
5295
|
+
declare class ItemDescription {
|
|
5296
|
+
private readonly context;
|
|
5297
|
+
protected readonly maxAdditionalInfo = 500;
|
|
5298
|
+
protected readonly icmsTaxes: [keyof DetIcmsValues, string][];
|
|
5299
|
+
protected readonly icmsUfDestTaxes: [keyof ICMSUFDest, string][];
|
|
5300
|
+
protected readonly operations: Labels;
|
|
5301
|
+
protected readonly fuels: Labels;
|
|
5302
|
+
protected readonly species: Labels;
|
|
5303
|
+
protected readonly vehicles: Labels;
|
|
5304
|
+
protected readonly colors: Labels;
|
|
5305
|
+
protected readonly conditions: Labels;
|
|
5306
|
+
protected readonly restrictions: Labels;
|
|
5307
|
+
protected readonly weaponTypes: Labels;
|
|
5308
|
+
constructor(context: DanfePdfDocument);
|
|
5309
|
+
protected get options(): DanfeOptions;
|
|
5310
|
+
protected tax(value: DecimalValue | undefined, template: string): string;
|
|
5311
|
+
protected taxes(det: Det): string;
|
|
5312
|
+
infAdProd(det: Det): string;
|
|
5313
|
+
protected additionalInfo(det: Det): string;
|
|
5314
|
+
protected anvisa(det: Det): string;
|
|
5315
|
+
protected batch(det: Det): string;
|
|
5316
|
+
protected fci(det: Det): string;
|
|
5317
|
+
protected label(labels: Labels, code: string): string;
|
|
5318
|
+
protected lines(entries: [string, string | undefined][]): string;
|
|
5319
|
+
vehicle(det: Det): string;
|
|
5320
|
+
weapons(det: Det): string;
|
|
5321
|
+
productName(det: Det): string;
|
|
5322
|
+
protected narrative(det: Det): string;
|
|
5323
|
+
extras(det: Det): string;
|
|
5324
|
+
details(det: Det): string;
|
|
5325
|
+
build(det: Det): string;
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
declare abstract class DanfeItemsBlock extends DanfeBlock {
|
|
5329
|
+
protected readonly description: ItemDescription;
|
|
5330
|
+
slice: DanfePageSlice<Det>;
|
|
5331
|
+
boxHeight: number;
|
|
5332
|
+
protected readonly title = "DADOS DOS PRODUTOS / SERVI\u00C7OS";
|
|
5333
|
+
protected readonly fontSize: number;
|
|
5334
|
+
protected readonly headerFontSize: number;
|
|
5335
|
+
protected get cellPadding(): number;
|
|
5336
|
+
protected readonly columnLabelColor: string;
|
|
5337
|
+
protected abstract get columns(): DanfeItemsColumn[];
|
|
5338
|
+
protected abstract cells(det: Det): DanfeItemsCell[];
|
|
5339
|
+
protected widths(): number[];
|
|
5340
|
+
protected labelsHeight(): number;
|
|
5341
|
+
headerHeight(): number;
|
|
5342
|
+
protected isRuns(cell: DanfeItemsCell): cell is DanfeTextRun[];
|
|
5343
|
+
protected isPairs(cell: DanfeItemsCell): cell is Exclude<DanfeItemsCell, string | DanfeTextRun[]>;
|
|
5344
|
+
protected lineHeight(): number;
|
|
5345
|
+
protected fitSize(text: string, width: number, size: number): number;
|
|
5346
|
+
protected cellHeight(cell: DanfeItemsCell, width: number): number;
|
|
5347
|
+
itemHeight(det: Det): number;
|
|
5348
|
+
height(): number;
|
|
5349
|
+
protected drawLabels(x: number, y: number, height: number): void;
|
|
5350
|
+
protected drawColumnLines(x: number, top: number, bottom: number): void;
|
|
5351
|
+
protected drawPairs(cell: DanfeItemsPairsCell, x: number, y: number, width: number): void;
|
|
5352
|
+
protected drawRuns(runs: DanfeTextRun[], x: number, y: number, width: number, align: 'left' | 'center' | 'right'): void;
|
|
5353
|
+
protected drawItem(det: Det, x: number, y: number, height: number): void;
|
|
5354
|
+
protected drawSeparator(x: number, y: number, width: number): void;
|
|
5355
|
+
protected draw({ x, y, width }: DanfeArea): void;
|
|
5356
|
+
}
|
|
5357
|
+
|
|
5358
|
+
interface DanfeStatus {
|
|
5359
|
+
messages: string[];
|
|
5360
|
+
detail?: string;
|
|
5361
|
+
valid: boolean;
|
|
5362
|
+
}
|
|
5363
|
+
declare class StatusMarks {
|
|
5364
|
+
private readonly context;
|
|
5365
|
+
protected readonly cancelled: string[];
|
|
5366
|
+
protected readonly denied: string[];
|
|
5367
|
+
protected readonly invalid = "SEM VALOR FISCAL";
|
|
5368
|
+
protected readonly messageSize = 40;
|
|
5369
|
+
protected readonly detailSize = 16;
|
|
5370
|
+
protected readonly lineHeight = 1.3;
|
|
5371
|
+
constructor(context: DanfePdfDocument);
|
|
5372
|
+
get isHomolog(): boolean;
|
|
5373
|
+
get isContingency(): boolean;
|
|
5374
|
+
get isProtocoled(): boolean;
|
|
5375
|
+
get cStat(): string | undefined;
|
|
5376
|
+
get cancellation(): RetEvento['infEvento'] | undefined;
|
|
5377
|
+
status(): DanfeStatus;
|
|
5378
|
+
protected fit(text: string, size: number, width: number): number;
|
|
5379
|
+
watermark(x: number, y: number, width: number, height: number): void;
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
interface DanfeBlocks {
|
|
5383
|
+
canhoto?: DanfeBlock;
|
|
5384
|
+
header: DanfeBlock;
|
|
5385
|
+
firstPage: DanfeBlock[];
|
|
5386
|
+
items: DanfeItemsBlock;
|
|
5387
|
+
lastPage: DanfeBlock[];
|
|
5388
|
+
footer: DanfeBlock;
|
|
5389
|
+
}
|
|
5390
|
+
interface DanfePage {
|
|
5391
|
+
number: number;
|
|
5392
|
+
total: number;
|
|
5393
|
+
}
|
|
5394
|
+
declare abstract class DanfePdfDocument {
|
|
5395
|
+
protected readonly stream: Writable;
|
|
5396
|
+
data: NFe$1;
|
|
5397
|
+
protNFe?: ProtNFe;
|
|
5398
|
+
events: RetEvento[];
|
|
5399
|
+
readonly builder: PdfBuilder;
|
|
5400
|
+
readonly toolkit: XmlToolkit;
|
|
5401
|
+
readonly format: DanfeFormatter;
|
|
5402
|
+
readonly fields: FieldBox;
|
|
5403
|
+
readonly status: StatusMarks;
|
|
5404
|
+
readonly defaults: {
|
|
5405
|
+
displayTitle: true;
|
|
5406
|
+
font: string;
|
|
5407
|
+
info: {
|
|
5408
|
+
Author: string;
|
|
5409
|
+
Creator: string;
|
|
5410
|
+
Keywords: string;
|
|
5411
|
+
Title: string;
|
|
5412
|
+
Subject: string;
|
|
5413
|
+
};
|
|
5414
|
+
};
|
|
5415
|
+
options: DanfeOptions;
|
|
5416
|
+
readonly margins: {
|
|
5417
|
+
readonly top: number;
|
|
5418
|
+
readonly right: number;
|
|
5419
|
+
readonly bottom: number;
|
|
5420
|
+
readonly left: number;
|
|
5421
|
+
};
|
|
5422
|
+
readonly gap: number;
|
|
5423
|
+
page: DanfePage;
|
|
5424
|
+
private _blocks?;
|
|
5425
|
+
protected abstract createBlocks(): DanfeBlocks;
|
|
5426
|
+
protected get blocks(): DanfeBlocks;
|
|
5427
|
+
constructor(stream: Writable);
|
|
5428
|
+
get bold(): string;
|
|
5429
|
+
protected readonly sideCanhotoWidth: number;
|
|
5430
|
+
get contentWidth(): number;
|
|
5431
|
+
get det(): Det[];
|
|
5432
|
+
asArray<T>(value?: T | T[]): T[];
|
|
5433
|
+
protected apply(): void;
|
|
5434
|
+
protected parse(xml: string): Promise<void>;
|
|
5435
|
+
protected visible(blocks: (DanfeBlock | undefined)[]): DanfeBlock[];
|
|
5436
|
+
protected stackHeight(blocks: DanfeBlock[]): number;
|
|
5437
|
+
protected get canhoto(): DanfeBlock | undefined;
|
|
5438
|
+
protected get pageTop(): number;
|
|
5439
|
+
protected get pageBottom(): number;
|
|
5440
|
+
protected paginate(): DanfePageSlice<Det>[];
|
|
5441
|
+
protected draw(slice: DanfePageSlice<Det>): void;
|
|
5442
|
+
build(xml: string): Promise<this>;
|
|
5443
|
+
end(): void;
|
|
5444
|
+
}
|
|
5445
|
+
|
|
5446
|
+
declare class DanfeDefaultPdfDocument extends DanfePdfDocument {
|
|
5447
|
+
protected createBlocks(): DanfeBlocks;
|
|
5448
|
+
}
|
|
5449
|
+
|
|
5450
|
+
declare class DanfeRtcPdfDocument extends DanfePdfDocument {
|
|
5451
|
+
protected createBlocks(): DanfeBlocks;
|
|
5452
|
+
}
|
|
5453
|
+
|
|
5042
5454
|
declare class NfeXmlBuilder<T extends object = NFe$1, S extends Schema = typeof DefaultSchema> implements INfeXmlBuilder<T, S> {
|
|
5043
5455
|
protected readonly builder: XmlToolkit;
|
|
5044
5456
|
protected contingency?: ContingencyOptions | undefined;
|
|
@@ -5131,4 +5543,4 @@ declare class NFCe implements NFe$1 {
|
|
|
5131
5543
|
Signature?: Signature;
|
|
5132
5544
|
}
|
|
5133
5545
|
|
|
5134
|
-
export { type AccessKey, AccessKeyBuilder, type AgropecuarioBuilder, type AssembleDetXmlBuilder, type AssembleNfeBuilder, type AsynchronousAutorizacaoResponse, type AutXMLBuilder, type AutorizacaoPayload, type AutorizacaoRequest, type AutorizacaoResponse, type AvulsaBuilder, type Builder, type CanaBuilder, type CobrBuilder, type CofinsBuilder, type CofinsStBuilder, type CompraBuilder, type ConsultStatusPayload, type ConsultStatusRequest, type ConsultStatusResponse, type ConsultaCadastroPayload, type ConsultaCadastroRequest, type ConsultaCadastroResponse, type ConsultaProtocoloPayload, type ConsultaProtocoloRequest, type ConsultaProtocoloResponse, type ContingencyOptions, type DFeReferenciadoBuilder, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, DefaultDetBuilderAggregator, DefaultSchema, DefaultTotalBuilderAggregator, type DestBuilder, type DetBuilder, type DetBuilderAggregator, type DetEventoCancelamento, type DetGroupBuilder, type EmitBuilder, type EntregaBuilder, type EventoCancelamento, EventoCstatToCancelRegister, EventoCstatToProtocol, type EventoItem, type EventoItemAttributes, type EventoLotePayload, type EventoLoteResponse, type EventoPayload, type EventoRequest, type EventoResponse, type ExportaBuilder, type ICMS, type ICMS00, type ICMS02, type ICMS10, type ICMS15, type ICMS20, type ICMS30, type ICMS40, type ICMS51, type ICMS53, type ICMS60, type ICMS61, type ICMS70, type ICMS90, type ICMSPart, type ICMSSN, type ICMSSN101, type ICMSSN102, type ICMSSN201, type ICMSSN202, type ICMSSN500, type ICMSSN900, type ICMSST, type ICMSStandard, type IIBuilder, type INfeDetXmlBuilder, type INfeXmlBuilder, type IbsCbsTotBuilder, type IbscbsBuilder, type IcmsBuilder, type IcmsIpiBuilder, type IcmsOrIssQnBuilder, type IcmsufdestBuilder, type IdeBuilder, type ImpostoBuilder, type InfAdicBuilder, type InfEvento, type InfEventoAttributes, type InfIntermedBuilder, type InfInut, type InfInutAttributes, type InfNFeBuilder, type InfPAABuilder, type InfProt, type InfRespTecBuilder, type InfSolicNFFBuilder, InutCstatToProtocol, type InutNFeAttributes, type InutilizacaoPayload, type InutilizacaoRequest, type InutilizacaoResponse, type IsBuilder, type IsTotBuilder, type IssIpiBuilder, type IssQnBuilder, type NFCe$1 as NFCe, NFCe as NFCeDto, type NFCeProc, type NFe$1 as NFe, type NFeAttributes, NFe as NFeDto, type NFeProc, type NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, type NfceQrcodeOptions, type NfceQrcodeOptions200, type NfceQrcodeOptions300, type NfceQrcodeOptionsBase, type NfceRemoteClient, NfceRemoteTransmitter, type NfceTransmitter, type NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, type NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeComplements, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, type NfeRemoteClient, NfeRemoteTransmitter, type NfeTransmitter, type NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, type OptionalSharedImpostoBuilder, PL_009, PL_010, type PagBuilder, type PipelineAuthorizerResponse, type PipelineEventResponse, type PipelineInutilizacaoResponse, type PisBuilder, type PisStBuilder, type ProcEventoNFe, type ProcInutNFe, type ProdBuilder, type ProtNFe, type ProtNFeAttributes, type RetAutorizacaoPayload, type RetAutorizacaoRequest, type RetAutorizacaoResponse, type RetCancNFe, type RetEvento, type RetEventoItem, type RetInutNFe, type RetiradaBuilder, type Schema, type SynchronousAutorizacaoResponse, type TotalBuilder, type TotalBuilderAggregator, type TotalIncrementHost, TpEmis, TpEvent, type TranspBuilder, type VItemBuilder, type VerifiedAccessKey, type VoidRangePayload, XmlValidationError, schemas };
|
|
5546
|
+
export { type AccessKey, AccessKeyBuilder, type AgropecuarioBuilder, type AssembleDetXmlBuilder, type AssembleNfeBuilder, type AsynchronousAutorizacaoResponse, type AutXMLBuilder, type AutorizacaoPayload, type AutorizacaoRequest, type AutorizacaoResponse, type AvulsaBuilder, type Builder, type CanaBuilder, type CobrBuilder, type CofinsBuilder, type CofinsStBuilder, type CompraBuilder, type ConsChNFe, type ConsultStatusPayload, type ConsultStatusRequest, type ConsultStatusResponse, type ConsultaCadastroPayload, type ConsultaCadastroRequest, type ConsultaCadastroResponse, type ConsultaChaveDistribuicaoDFe, type ConsultaProtocoloPayload, type ConsultaProtocoloRequest, type ConsultaProtocoloResponse, type ContingencyOptions, type DFeReferenciadoBuilder, DanfceDefaultPdfDocument, DanfceReducedPdfDocument, type DanfeArea, DanfeDefaultPdfDocument, type DanfeFieldCell, type DanfeItemsCell, type DanfeItemsColumn, type DanfeItemsPairsCell, type DanfeLayout, DanfeMargins, type DanfeOptions, type DanfePageSlice, DanfeRtcPdfDocument, DanfeSize, type DanfeTextRun, DefaultDetBuilderAggregator, DefaultSchema, DefaultTotalBuilderAggregator, type DestBuilder, type DetBuilder, type DetBuilderAggregator, type DetEventoCancelamento, type DetEventoManifestacao, type DetGroupBuilder, type DistribuicaoDFePayload, type DistribuicaoDFeRequest, type DistribuicaoDFeResponse, type EmitBuilder, type EntregaBuilder, type EventoCancelamento, EventoCstatToCancelRegister, EventoCstatToProtocol, type EventoItem, type EventoItemAttributes, type EventoLotePayload, type EventoLoteResponse, type EventoManifestacao, type EventoPayload, type EventoRequest, type EventoResponse, type ExportaBuilder, type ICMS, type ICMS00, type ICMS02, type ICMS10, type ICMS15, type ICMS20, type ICMS30, type ICMS40, type ICMS51, type ICMS53, type ICMS60, type ICMS61, type ICMS70, type ICMS90, type ICMSPart, type ICMSSN, type ICMSSN101, type ICMSSN102, type ICMSSN201, type ICMSSN202, type ICMSSN500, type ICMSSN900, type ICMSST, type ICMSStandard, type IIBuilder, type INfeDetXmlBuilder, type INfeXmlBuilder, type IbsCbsTotBuilder, type IbscbsBuilder, type IcmsBuilder, type IcmsIpiBuilder, type IcmsOrIssQnBuilder, type IcmsufdestBuilder, type IdeBuilder, type ImpostoBuilder, type InfAdicBuilder, type InfEvento, type InfEventoAttributes, type InfIntermedBuilder, type InfInut, type InfInutAttributes, type InfNFeBuilder, type InfPAABuilder, type InfProt, type InfRespTecBuilder, type InfSolicNFFBuilder, InutCstatToProtocol, type InutNFeAttributes, type InutilizacaoPayload, type InutilizacaoRequest, type InutilizacaoResponse, type IsBuilder, type IsTotBuilder, type IssIpiBuilder, type IssQnBuilder, type NFCe$1 as NFCe, NFCe as NFCeDto, type NFCeProc, type NFe$1 as NFe, type NFeAttributes, NFe as NFeDto, type NFeProc, type NFeProcAttributes, NfceAuthorizerPipeline, NfceCancelPipeline, NfceConsultProtocoloPipeline, NfceConsultStatusPipeline, NfceContingencyXmlAuthorizerPipeline, NfceQrcode, type NfceQrcodeOptions, type NfceQrcodeOptions200, type NfceQrcodeOptions300, type NfceQrcodeOptionsBase, type NfceRemoteClient, NfceRemoteTransmitter, type NfceTransmitter, type NfceTransmitterOptions, NfceVoidRangePipeline, NfceXmlBuilder, NfceXmlBuilderPipeline, NfeAuthorizationResponsePipeline, type NfeAuthorizerPayload, NfeAuthorizerPipeline, NfeCancelPipeline, NfeComplements, NfeConsultProtocoloPipeline, NfeConsultStatusPipeline, NfeCstatToProtocol, NfeDetXmlBuilder, NfeDistribuicaoDFePipeline, NfeManifestacaoPipeline, type NfeRemoteClient, NfeRemoteTransmitter, type NfeTransmitter, type NfeTransmitterOptions, NfeVoidRangePipeline, NfeXmlBuilder, NfeXmlBuilderPipeline, type OptionalSharedImpostoBuilder, PL_009, PL_010, type PagBuilder, type PipelineAuthorizerResponse, type PipelineDistribuicaoDFeResponse, type PipelineEventResponse, type PipelineInutilizacaoResponse, type PisBuilder, type PisStBuilder, type ProcEventoNFe, type ProcInutNFe, type ProdBuilder, type ProtNFe, type ProtNFeAttributes, type RetAutorizacaoPayload, type RetAutorizacaoRequest, type RetAutorizacaoResponse, type RetCancNFe, type RetDistDFeInt, type RetEvento, type RetEventoItem, type RetInutNFe, type RetiradaBuilder, type Schema, type SynchronousAutorizacaoResponse, type TotalBuilder, type TotalBuilderAggregator, type TotalIncrementHost, TpEmis, TpEvent, type TpEventManifestacao, type TranspBuilder, type VItemBuilder, type VerifiedAccessKey, type VoidRangePayload, XmlValidationError, mm, ptPerMm, schemas };
|