nfets 0.0.108 → 0.0.110

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.
@@ -1,13 +1,44 @@
1
- import { x as NFeTsError, ab as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ac as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ad as Left, ae as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../xml-signer-C-vXjWBX.cjs';
2
- export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions } from '../xml-signer-C-vXjWBX.cjs';
1
+ import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-U8m3n2L8.cjs';
2
+ export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-U8m3n2L8.cjs';
3
3
  import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
4
4
  import { X509Certificate, KeyObject } from 'node:crypto';
5
+ export { default as dateToolkit } from 'dayjs';
5
6
  import { Decimal as Decimal$1 } from 'decimal.js';
6
7
  import { Writable } from 'node:stream';
7
8
  import { Agent } from 'node:https';
8
9
  import { AxiosInstance } from 'axios';
9
10
  import * as Xml2js from 'xml2js';
10
11
 
12
+ declare const _default: {
13
+ readonly "12": "America/Rio_Branco";
14
+ readonly "27": "America/Maceio";
15
+ readonly "13": "America/Manaus";
16
+ readonly "16": "America/Belem";
17
+ readonly "29": "America/Bahia";
18
+ readonly "23": "America/Fortaleza";
19
+ readonly "53": "America/Sao_Paulo";
20
+ readonly "32": "America/Sao_Paulo";
21
+ readonly "52": "America/Sao_Paulo";
22
+ readonly "21": "America/Fortaleza";
23
+ readonly "31": "America/Sao_Paulo";
24
+ readonly "50": "America/Campo_Grande";
25
+ readonly "51": "America/Cuiaba";
26
+ readonly "15": "America/Belem";
27
+ readonly "25": "America/Fortaleza";
28
+ readonly "26": "America/Recife";
29
+ readonly "22": "America/Fortaleza";
30
+ readonly "41": "America/Sao_Paulo";
31
+ readonly "33": "America/Sao_Paulo";
32
+ readonly "24": "America/Fortaleza";
33
+ readonly "11": "America/Porto_Velho";
34
+ readonly "14": "America/Boa_Vista";
35
+ readonly "43": "America/Sao_Paulo";
36
+ readonly "42": "America/Sao_Paulo";
37
+ readonly "28": "America/Maceio";
38
+ readonly "35": "America/Sao_Paulo";
39
+ readonly "17": "America/Araguaina";
40
+ };
41
+
11
42
  interface StrategyPattern<T, R> {
12
43
  execute(...args: T[]): R;
13
44
  }
@@ -22,128 +53,6 @@ declare class TransmissionTimeoutError extends TransmissionError {
22
53
  declare class ValidationError extends NFeTsError {
23
54
  }
24
55
 
25
- declare class Decimal extends Decimal$1 implements Decimal$2 {
26
- static from(value: DecimalValue | Decimal): Decimal$2;
27
- static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
28
- static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
29
- }
30
-
31
- declare class PdfkitPdfBuilder implements PdfBuilder {
32
- protected readonly defaults: {
33
- autoFirstPage: false;
34
- };
35
- protected readonly doc: PDFKit.PDFDocument;
36
- protected constructor(options?: DocumentOptions);
37
- static new(options?: DocumentOptions): PdfBuilder;
38
- configure(options: DocumentOptions): this;
39
- pipe(stream: Writable): this;
40
- end(): void;
41
- restore(): this;
42
- save(): this;
43
- stroke(color?: ColorValue): this;
44
- page(options?: DocumentOptions): this;
45
- table(options: TableOptionsWithData): this;
46
- text(text: string, options?: TextOptions): this;
47
- fontSize(size: number): this;
48
- font(font: string): this;
49
- image(image: string, options?: ImageOptions): this;
50
- image(image: string, x: number, y: number, options?: ImageOptions): this;
51
- rect(x: number, y: number, w: number, h: number): this;
52
- path(path: string): this;
53
- translate(x: number, y: number): this;
54
- scale(x: number, y?: number): this;
55
- fill(rule: RuleValue): this;
56
- pageWidth(): number;
57
- pageHeight(): number;
58
- heightOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
59
- widthOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
60
- pageMargins(): PDFKit.Mixins.ExpandedSides<number>;
61
- currentLineHeight(includeGap?: boolean): number;
62
- x(): number;
63
- y(): number;
64
- moveDown(amount?: number): this;
65
- row<C extends number>(optionsOrFirstItem?: RowOptions<C> | RowBuilderFunction, ..._items: [...TupleOfLength<C, RowBuilderFunction>]): this;
66
- }
67
-
68
- declare class MemoryCacheAdapter implements CacheAdapter {
69
- private cache;
70
- get<T>(key: string): Promise<T | null>;
71
- has(key: string): Promise<boolean>;
72
- set(key: string, value: unknown): Promise<boolean>;
73
- }
74
-
75
- declare class NativeCertificateRepository implements CertificateRepository {
76
- private readonly httpClient;
77
- private readonly cache;
78
- private readonly signer;
79
- constructor(httpClient: HttpClient, cache?: CacheAdapter, signer?: SignerRepository);
80
- read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
81
- private getPrivateKey;
82
- sign(content: string, cert: ReadCertificateResponse, algorithm?: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
83
- getCertificateInfo(certificate: X509Certificate): {
84
- CNPJ: string | undefined;
85
- CPF: string | undefined;
86
- CN: string | undefined;
87
- O: string | undefined;
88
- OU: string | undefined;
89
- ST: string | undefined;
90
- L: string | undefined;
91
- C: string | undefined;
92
- };
93
- getStringCertificate(certificate: X509Certificate): string;
94
- getStringPrivateKey(privateKey: KeyObject): string;
95
- private getPfxBuffer;
96
- private getCacheKey;
97
- private hitBufferOnCache;
98
- private isValidRemoteUrl;
99
- }
100
-
101
- declare class NullCacheAdapter implements CacheAdapter {
102
- get<T>(_: string): Promise<T | null>;
103
- has(_: string): Promise<boolean>;
104
- set(_: string, __: unknown): Promise<boolean>;
105
- }
106
-
107
- declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
108
- private readonly toolkit;
109
- private readonly certificateRepository;
110
- private certificate?;
111
- constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
112
- setCertificate(certificate: ReadCertificateResponse): this;
113
- private validateCertificatePeriod;
114
- protected get httpsAgent(): Agent;
115
- protected get defaultSoapHeaders(): {
116
- 'Content-Type': string;
117
- };
118
- protected getDefaultRequest(params: {
119
- timeout?: number;
120
- }): AxiosInstance;
121
- protected request(params: {
122
- timeout?: number;
123
- }): AxiosInstance;
124
- send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
125
- }
126
-
127
- declare class Xml2JsToolkit implements XmlToolkit {
128
- private readonly xml2js;
129
- constructor(xml2js?: typeof Xml2js);
130
- validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
131
- parse<T>(xml: string, options?: ParserOptions): Promise<T>;
132
- build(object: object, options?: BuilderOptions): Promise<string>;
133
- digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
134
- canonicalize(xml: string, options?: CanonicalizeOptions): string;
135
- getNode(xml: string, tag: string): string | null;
136
- getFirstNode(xml: string): string | null;
137
- getAttribute(xml: string, tag: string): string | null;
138
- appendNode(xml: string, node: string): string;
139
- insertBefore(xml: string, referenceTag: string, node: string): string;
140
- private hash;
141
- private parseXml;
142
- private getDocumentElement;
143
- private serializeXml;
144
- private clear;
145
- }
146
-
147
56
  declare const ValidateErrorsMetadata = "__ValidateErrors__";
148
57
  declare const mapConstraintsToErrors: (errors: ValidationError$1[], parent?: string) => string[];
149
58
  declare const Validates: <T extends object>(klass: new () => T) => (_target: object, property: string | symbol, descriptor: TypedPropertyDescriptor<(payload: T, ...args: any[]) => any>) => void;
@@ -306,4 +215,138 @@ declare class ASN1 {
306
215
  protected base128(bytes: number[], byte: number, last: boolean): number[];
307
216
  }
308
217
 
309
- export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, ColorValue, Decimal, DecimalValue, DocumentOptions, ExtractReturnType, HttpClient, ImageOptions, IsDecimal, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, PdfBuilder, PdfkitPdfBuilder, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, RowBuilderFunction, RowOptions, RuleValue, SendTransmissionPayload, SignatureAlgorithm, SignerRepository, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, type StrategyPattern, TableOptionsWithData, TextOptions, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, TupleOfLength, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, mapConstraintsToErrors, plainToInstance };
218
+ declare class Decimal extends Decimal$1 implements Decimal$2 {
219
+ static from(value: DecimalValue | Decimal): Decimal$2;
220
+ static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
221
+ static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
222
+ }
223
+
224
+ declare class PdfkitPdfBuilder implements PdfBuilder {
225
+ protected readonly defaults: {
226
+ autoFirstPage: false;
227
+ };
228
+ protected readonly doc: PDFKit.PDFDocument;
229
+ protected constructor(options?: DocumentOptions);
230
+ static new(options?: DocumentOptions): PdfBuilder;
231
+ configure(options: DocumentOptions): this;
232
+ pipe(stream: Writable): this;
233
+ end(): void;
234
+ restore(): this;
235
+ save(): this;
236
+ stroke(color?: ColorValue): this;
237
+ page(options?: DocumentOptions): this;
238
+ table(options: TableOptionsWithData): this;
239
+ text(text: string, options?: TextOptions): this;
240
+ fontSize(size: number): this;
241
+ font(font: string): this;
242
+ image(image: string, options?: ImageOptions): this;
243
+ image(image: string, x: number, y: number, options?: ImageOptions): this;
244
+ rect(x: number, y: number, w: number, h: number): this;
245
+ path(path: string): this;
246
+ translate(x: number, y: number): this;
247
+ scale(x: number, y?: number): this;
248
+ fill(rule: RuleValue): this;
249
+ pageWidth(): number;
250
+ pageHeight(): number;
251
+ heightOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
252
+ widthOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
253
+ pageMargins(): PDFKit.Mixins.ExpandedSides<number>;
254
+ currentLineHeight(includeGap?: boolean): number;
255
+ x(): number;
256
+ y(): number;
257
+ moveDown(amount?: number): this;
258
+ row<C extends number>(optionsOrFirstItem?: RowOptions<C> | RowBuilderFunction, ..._items: [...TupleOfLength<C, RowBuilderFunction>]): this;
259
+ }
260
+
261
+ declare class MemoryCacheAdapter implements CacheAdapter {
262
+ private cache;
263
+ get<T>(key: string): Promise<T | null>;
264
+ has(key: string): Promise<boolean>;
265
+ set(key: string, value: unknown): Promise<boolean>;
266
+ }
267
+
268
+ declare class NativeCertificateRepository implements CertificateRepository {
269
+ private readonly httpClient;
270
+ private readonly cache;
271
+ private readonly signer;
272
+ constructor(httpClient: HttpClient, cache?: CacheAdapter, signer?: SignerRepository);
273
+ read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
274
+ private getPrivateKey;
275
+ sign(content: string, cert: ReadCertificateResponse, algorithm?: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
276
+ getCertificateInfo(certificate: X509Certificate): {
277
+ CNPJ: string | undefined;
278
+ CPF: string | undefined;
279
+ CN: string | undefined;
280
+ O: string | undefined;
281
+ OU: string | undefined;
282
+ ST: string | undefined;
283
+ L: string | undefined;
284
+ C: string | undefined;
285
+ };
286
+ getStringCertificate(certificate: X509Certificate): string;
287
+ getStringPrivateKey(privateKey: KeyObject): string;
288
+ private getPfxBuffer;
289
+ private getCacheKey;
290
+ private hitBufferOnCache;
291
+ private isValidRemoteUrl;
292
+ }
293
+
294
+ declare class NullCacheAdapter implements CacheAdapter {
295
+ get<T>(_: string): Promise<T | null>;
296
+ has(_: string): Promise<boolean>;
297
+ set(_: string, __: unknown): Promise<boolean>;
298
+ }
299
+
300
+ declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
301
+ private readonly toolkit;
302
+ private readonly certificateRepository;
303
+ private certificate?;
304
+ constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
305
+ setCertificate(certificate: ReadCertificateResponse): this;
306
+ private validateCertificatePeriod;
307
+ protected get httpsAgent(): Agent;
308
+ protected get defaultSoapHeaders(): {
309
+ 'Content-Type': string;
310
+ };
311
+ protected getDefaultRequest(params: {
312
+ timeout?: number;
313
+ }): AxiosInstance;
314
+ protected request(params: {
315
+ timeout?: number;
316
+ }): AxiosInstance;
317
+ send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
318
+ }
319
+
320
+ declare class Xml2JsToolkit implements XmlToolkit {
321
+ private readonly xml2js;
322
+ constructor(xml2js?: typeof Xml2js);
323
+ validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
324
+ parse<T>(xml: string, options?: ParserOptions): Promise<T>;
325
+ build(object: object, options?: BuilderOptions): Promise<string>;
326
+ digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
327
+ canonicalize(xml: string, options?: CanonicalizeOptions): string;
328
+ getNode(xml: string, tag: string): string | null;
329
+ getFirstNode(xml: string): string | null;
330
+ getAttribute(xml: string, tag: string): string | null;
331
+ appendNode(xml: string, node: string): string;
332
+ insertBefore(xml: string, referenceTag: string, node: string): string;
333
+ private hash;
334
+ private parseXml;
335
+ private getDocumentElement;
336
+ private serializeXml;
337
+ private clear;
338
+ }
339
+
340
+ declare const leftFromError: (error: unknown) => Left<NFeTsError>;
341
+
342
+ declare const mapTransmissionError: (error: unknown) => Left<NFeTsError>;
343
+ declare const leftFromTransmissionError: (error: unknown) => Left<NFeTsError>;
344
+
345
+ declare const search: <T>(target: string, { onFound, onNotFound, }: {
346
+ onFound: (path: string) => T;
347
+ onNotFound: () => void;
348
+ }) => T;
349
+
350
+ declare const unreachable: (_: never) => never;
351
+
352
+ export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, ColorValue, Decimal, DecimalValue, DocumentOptions, Either, ExtractReturnType, HttpClient, ImageOptions, IsDecimal, Left, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, PdfBuilder, PdfkitPdfBuilder, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, Right, RowBuilderFunction, RowOptions, RuleValue, SendTransmissionPayload, SignatureAlgorithm, SignerRepository, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, type StrategyPattern, TableOptionsWithData, TextOptions, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, TupleOfLength, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, leftFromError, leftFromTransmissionError, mapConstraintsToErrors, mapTransmissionError, plainToInstance, search, _default as timezones, unreachable };
@@ -1,13 +1,44 @@
1
- import { x as NFeTsError, ab as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ac as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ad as Left, ae as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../xml-signer-C-vXjWBX.js';
2
- export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions } from '../xml-signer-C-vXjWBX.js';
1
+ import { x as NFeTsError, ai as Decimal$2, D as DecimalValue, V as PdfBuilder, y as DocumentOptions, A as ColorValue, H as TableOptionsWithData, z as TextOptions, I as ImageOptions, F as RuleValue, Q as RowOptions, U as RowBuilderFunction, M as TupleOfLength, W as CacheAdapter, Y as CertificateRepository, a3 as HttpClient, a7 as SignerRepository, R as ReadCertificateRequest, ab as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, m as Client, a4 as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, ac as Left, ad as Right, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../types-U8m3n2L8.js';
2
+ export { b as CanonicalizationMethod, J as CellOptions, C as CertificateInfo, ag as DeepPartial, e as DigestAlgorithm, a9 as EntitySigner, E as Environment, j as EnvironmentCode, Z as HeaderValue, $ as HttpClientHeaders, a2 as HttpResponse, K as KnownKeys, N as Namespaced, L as PDFTableObject, u as RenderOptions, a1 as RequestConfig, a0 as ResponseType, O as RowBuilderOptions, l as Signature, c as SignatureMethod, S as SignatureNamespace, a6 as SignedEntity, k as SignedInfo, a8 as Signer, a5 as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, G as TableOptions, T as Transforms, q as Transmitter, p as TransmitterOptions, ah as UnionToIntersection, X as XmlDeclarationAttributes, aa as XmlSigner, _ as _TupleOfLength, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions, ae as left, af as right } from '../types-U8m3n2L8.js';
3
3
  import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
4
4
  import { X509Certificate, KeyObject } from 'node:crypto';
5
+ export { default as dateToolkit } from 'dayjs';
5
6
  import { Decimal as Decimal$1 } from 'decimal.js';
6
7
  import { Writable } from 'node:stream';
7
8
  import { Agent } from 'node:https';
8
9
  import { AxiosInstance } from 'axios';
9
10
  import * as Xml2js from 'xml2js';
10
11
 
12
+ declare const _default: {
13
+ readonly "12": "America/Rio_Branco";
14
+ readonly "27": "America/Maceio";
15
+ readonly "13": "America/Manaus";
16
+ readonly "16": "America/Belem";
17
+ readonly "29": "America/Bahia";
18
+ readonly "23": "America/Fortaleza";
19
+ readonly "53": "America/Sao_Paulo";
20
+ readonly "32": "America/Sao_Paulo";
21
+ readonly "52": "America/Sao_Paulo";
22
+ readonly "21": "America/Fortaleza";
23
+ readonly "31": "America/Sao_Paulo";
24
+ readonly "50": "America/Campo_Grande";
25
+ readonly "51": "America/Cuiaba";
26
+ readonly "15": "America/Belem";
27
+ readonly "25": "America/Fortaleza";
28
+ readonly "26": "America/Recife";
29
+ readonly "22": "America/Fortaleza";
30
+ readonly "41": "America/Sao_Paulo";
31
+ readonly "33": "America/Sao_Paulo";
32
+ readonly "24": "America/Fortaleza";
33
+ readonly "11": "America/Porto_Velho";
34
+ readonly "14": "America/Boa_Vista";
35
+ readonly "43": "America/Sao_Paulo";
36
+ readonly "42": "America/Sao_Paulo";
37
+ readonly "28": "America/Maceio";
38
+ readonly "35": "America/Sao_Paulo";
39
+ readonly "17": "America/Araguaina";
40
+ };
41
+
11
42
  interface StrategyPattern<T, R> {
12
43
  execute(...args: T[]): R;
13
44
  }
@@ -22,128 +53,6 @@ declare class TransmissionTimeoutError extends TransmissionError {
22
53
  declare class ValidationError extends NFeTsError {
23
54
  }
24
55
 
25
- declare class Decimal extends Decimal$1 implements Decimal$2 {
26
- static from(value: DecimalValue | Decimal): Decimal$2;
27
- static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
28
- static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
29
- }
30
-
31
- declare class PdfkitPdfBuilder implements PdfBuilder {
32
- protected readonly defaults: {
33
- autoFirstPage: false;
34
- };
35
- protected readonly doc: PDFKit.PDFDocument;
36
- protected constructor(options?: DocumentOptions);
37
- static new(options?: DocumentOptions): PdfBuilder;
38
- configure(options: DocumentOptions): this;
39
- pipe(stream: Writable): this;
40
- end(): void;
41
- restore(): this;
42
- save(): this;
43
- stroke(color?: ColorValue): this;
44
- page(options?: DocumentOptions): this;
45
- table(options: TableOptionsWithData): this;
46
- text(text: string, options?: TextOptions): this;
47
- fontSize(size: number): this;
48
- font(font: string): this;
49
- image(image: string, options?: ImageOptions): this;
50
- image(image: string, x: number, y: number, options?: ImageOptions): this;
51
- rect(x: number, y: number, w: number, h: number): this;
52
- path(path: string): this;
53
- translate(x: number, y: number): this;
54
- scale(x: number, y?: number): this;
55
- fill(rule: RuleValue): this;
56
- pageWidth(): number;
57
- pageHeight(): number;
58
- heightOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
59
- widthOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
60
- pageMargins(): PDFKit.Mixins.ExpandedSides<number>;
61
- currentLineHeight(includeGap?: boolean): number;
62
- x(): number;
63
- y(): number;
64
- moveDown(amount?: number): this;
65
- row<C extends number>(optionsOrFirstItem?: RowOptions<C> | RowBuilderFunction, ..._items: [...TupleOfLength<C, RowBuilderFunction>]): this;
66
- }
67
-
68
- declare class MemoryCacheAdapter implements CacheAdapter {
69
- private cache;
70
- get<T>(key: string): Promise<T | null>;
71
- has(key: string): Promise<boolean>;
72
- set(key: string, value: unknown): Promise<boolean>;
73
- }
74
-
75
- declare class NativeCertificateRepository implements CertificateRepository {
76
- private readonly httpClient;
77
- private readonly cache;
78
- private readonly signer;
79
- constructor(httpClient: HttpClient, cache?: CacheAdapter, signer?: SignerRepository);
80
- read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
81
- private getPrivateKey;
82
- sign(content: string, cert: ReadCertificateResponse, algorithm?: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
83
- getCertificateInfo(certificate: X509Certificate): {
84
- CNPJ: string | undefined;
85
- CPF: string | undefined;
86
- CN: string | undefined;
87
- O: string | undefined;
88
- OU: string | undefined;
89
- ST: string | undefined;
90
- L: string | undefined;
91
- C: string | undefined;
92
- };
93
- getStringCertificate(certificate: X509Certificate): string;
94
- getStringPrivateKey(privateKey: KeyObject): string;
95
- private getPfxBuffer;
96
- private getCacheKey;
97
- private hitBufferOnCache;
98
- private isValidRemoteUrl;
99
- }
100
-
101
- declare class NullCacheAdapter implements CacheAdapter {
102
- get<T>(_: string): Promise<T | null>;
103
- has(_: string): Promise<boolean>;
104
- set(_: string, __: unknown): Promise<boolean>;
105
- }
106
-
107
- declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
108
- private readonly toolkit;
109
- private readonly certificateRepository;
110
- private certificate?;
111
- constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
112
- setCertificate(certificate: ReadCertificateResponse): this;
113
- private validateCertificatePeriod;
114
- protected get httpsAgent(): Agent;
115
- protected get defaultSoapHeaders(): {
116
- 'Content-Type': string;
117
- };
118
- protected getDefaultRequest(params: {
119
- timeout?: number;
120
- }): AxiosInstance;
121
- protected request(params: {
122
- timeout?: number;
123
- }): AxiosInstance;
124
- send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
125
- }
126
-
127
- declare class Xml2JsToolkit implements XmlToolkit {
128
- private readonly xml2js;
129
- constructor(xml2js?: typeof Xml2js);
130
- validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
131
- parse<T>(xml: string, options?: ParserOptions): Promise<T>;
132
- build(object: object, options?: BuilderOptions): Promise<string>;
133
- digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
134
- canonicalize(xml: string, options?: CanonicalizeOptions): string;
135
- getNode(xml: string, tag: string): string | null;
136
- getFirstNode(xml: string): string | null;
137
- getAttribute(xml: string, tag: string): string | null;
138
- appendNode(xml: string, node: string): string;
139
- insertBefore(xml: string, referenceTag: string, node: string): string;
140
- private hash;
141
- private parseXml;
142
- private getDocumentElement;
143
- private serializeXml;
144
- private clear;
145
- }
146
-
147
56
  declare const ValidateErrorsMetadata = "__ValidateErrors__";
148
57
  declare const mapConstraintsToErrors: (errors: ValidationError$1[], parent?: string) => string[];
149
58
  declare const Validates: <T extends object>(klass: new () => T) => (_target: object, property: string | symbol, descriptor: TypedPropertyDescriptor<(payload: T, ...args: any[]) => any>) => void;
@@ -306,4 +215,138 @@ declare class ASN1 {
306
215
  protected base128(bytes: number[], byte: number, last: boolean): number[];
307
216
  }
308
217
 
309
- export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, ColorValue, Decimal, DecimalValue, DocumentOptions, ExtractReturnType, HttpClient, ImageOptions, IsDecimal, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, PdfBuilder, PdfkitPdfBuilder, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, RowBuilderFunction, RowOptions, RuleValue, SendTransmissionPayload, SignatureAlgorithm, SignerRepository, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, type StrategyPattern, TableOptionsWithData, TextOptions, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, TupleOfLength, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, mapConstraintsToErrors, plainToInstance };
218
+ declare class Decimal extends Decimal$1 implements Decimal$2 {
219
+ static from(value: DecimalValue | Decimal): Decimal$2;
220
+ static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
221
+ static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
222
+ }
223
+
224
+ declare class PdfkitPdfBuilder implements PdfBuilder {
225
+ protected readonly defaults: {
226
+ autoFirstPage: false;
227
+ };
228
+ protected readonly doc: PDFKit.PDFDocument;
229
+ protected constructor(options?: DocumentOptions);
230
+ static new(options?: DocumentOptions): PdfBuilder;
231
+ configure(options: DocumentOptions): this;
232
+ pipe(stream: Writable): this;
233
+ end(): void;
234
+ restore(): this;
235
+ save(): this;
236
+ stroke(color?: ColorValue): this;
237
+ page(options?: DocumentOptions): this;
238
+ table(options: TableOptionsWithData): this;
239
+ text(text: string, options?: TextOptions): this;
240
+ fontSize(size: number): this;
241
+ font(font: string): this;
242
+ image(image: string, options?: ImageOptions): this;
243
+ image(image: string, x: number, y: number, options?: ImageOptions): this;
244
+ rect(x: number, y: number, w: number, h: number): this;
245
+ path(path: string): this;
246
+ translate(x: number, y: number): this;
247
+ scale(x: number, y?: number): this;
248
+ fill(rule: RuleValue): this;
249
+ pageWidth(): number;
250
+ pageHeight(): number;
251
+ heightOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
252
+ widthOfString(text: string, options?: PDFKit.Mixins.TextOptions): number;
253
+ pageMargins(): PDFKit.Mixins.ExpandedSides<number>;
254
+ currentLineHeight(includeGap?: boolean): number;
255
+ x(): number;
256
+ y(): number;
257
+ moveDown(amount?: number): this;
258
+ row<C extends number>(optionsOrFirstItem?: RowOptions<C> | RowBuilderFunction, ..._items: [...TupleOfLength<C, RowBuilderFunction>]): this;
259
+ }
260
+
261
+ declare class MemoryCacheAdapter implements CacheAdapter {
262
+ private cache;
263
+ get<T>(key: string): Promise<T | null>;
264
+ has(key: string): Promise<boolean>;
265
+ set(key: string, value: unknown): Promise<boolean>;
266
+ }
267
+
268
+ declare class NativeCertificateRepository implements CertificateRepository {
269
+ private readonly httpClient;
270
+ private readonly cache;
271
+ private readonly signer;
272
+ constructor(httpClient: HttpClient, cache?: CacheAdapter, signer?: SignerRepository);
273
+ read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
274
+ private getPrivateKey;
275
+ sign(content: string, cert: ReadCertificateResponse, algorithm?: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
276
+ getCertificateInfo(certificate: X509Certificate): {
277
+ CNPJ: string | undefined;
278
+ CPF: string | undefined;
279
+ CN: string | undefined;
280
+ O: string | undefined;
281
+ OU: string | undefined;
282
+ ST: string | undefined;
283
+ L: string | undefined;
284
+ C: string | undefined;
285
+ };
286
+ getStringCertificate(certificate: X509Certificate): string;
287
+ getStringPrivateKey(privateKey: KeyObject): string;
288
+ private getPfxBuffer;
289
+ private getCacheKey;
290
+ private hitBufferOnCache;
291
+ private isValidRemoteUrl;
292
+ }
293
+
294
+ declare class NullCacheAdapter implements CacheAdapter {
295
+ get<T>(_: string): Promise<T | null>;
296
+ has(_: string): Promise<boolean>;
297
+ set(_: string, __: unknown): Promise<boolean>;
298
+ }
299
+
300
+ declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
301
+ private readonly toolkit;
302
+ private readonly certificateRepository;
303
+ private certificate?;
304
+ constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
305
+ setCertificate(certificate: ReadCertificateResponse): this;
306
+ private validateCertificatePeriod;
307
+ protected get httpsAgent(): Agent;
308
+ protected get defaultSoapHeaders(): {
309
+ 'Content-Type': string;
310
+ };
311
+ protected getDefaultRequest(params: {
312
+ timeout?: number;
313
+ }): AxiosInstance;
314
+ protected request(params: {
315
+ timeout?: number;
316
+ }): AxiosInstance;
317
+ send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
318
+ }
319
+
320
+ declare class Xml2JsToolkit implements XmlToolkit {
321
+ private readonly xml2js;
322
+ constructor(xml2js?: typeof Xml2js);
323
+ validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
324
+ parse<T>(xml: string, options?: ParserOptions): Promise<T>;
325
+ build(object: object, options?: BuilderOptions): Promise<string>;
326
+ digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
327
+ canonicalize(xml: string, options?: CanonicalizeOptions): string;
328
+ getNode(xml: string, tag: string): string | null;
329
+ getFirstNode(xml: string): string | null;
330
+ getAttribute(xml: string, tag: string): string | null;
331
+ appendNode(xml: string, node: string): string;
332
+ insertBefore(xml: string, referenceTag: string, node: string): string;
333
+ private hash;
334
+ private parseXml;
335
+ private getDocumentElement;
336
+ private serializeXml;
337
+ private clear;
338
+ }
339
+
340
+ declare const leftFromError: (error: unknown) => Left<NFeTsError>;
341
+
342
+ declare const mapTransmissionError: (error: unknown) => Left<NFeTsError>;
343
+ declare const leftFromTransmissionError: (error: unknown) => Left<NFeTsError>;
344
+
345
+ declare const search: <T>(target: string, { onFound, onNotFound, }: {
346
+ onFound: (path: string) => T;
347
+ onNotFound: () => void;
348
+ }) => T;
349
+
350
+ declare const unreachable: (_: never) => never;
351
+
352
+ export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, ColorValue, Decimal, DecimalValue, DocumentOptions, Either, ExtractReturnType, HttpClient, ImageOptions, IsDecimal, Left, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, PdfBuilder, PdfkitPdfBuilder, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, Right, RowBuilderFunction, RowOptions, RuleValue, SendTransmissionPayload, SignatureAlgorithm, SignerRepository, SkipAllValidations, SkipValidation, SkipValidationMetadata, SoapRemoteTransmissionRepository, StateCodeAcValidator, StateCodeAlValidator, StateCodeAmValidator, StateCodeApValidator, StateCodeBaValidator, StateCodeCeValidator, StateCodeDfValidator, StateCodeEsValidator, StateCodeGoValidator, StateCodeMaValidator, StateCodeMgValidator, StateCodeMsValidator, StateCodeMtValidator, StateCodePaValidator, StateCodePbValidator, StateCodePeValidator, StateCodePiValidator, StateCodePrValidator, StateCodeRjValidator, StateCodeRnValidator, StateCodeRoValidator, StateCodeRrValidator, StateCodeRsValidator, StateCodeScValidator, StateCodeSeValidator, StateCodeSpValidator, StateCodeToValidator, type StrategyPattern, TableOptionsWithData, TextOptions, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, TransmissionError, TransmissionHostNotFoundError, TransmissionTimeoutError, TupleOfLength, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, leftFromError, leftFromTransmissionError, mapConstraintsToErrors, mapTransmissionError, plainToInstance, search, _default as timezones, unreachable };