nfets 0.0.39 → 0.0.40
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/{chunk-3LPOEYDL.mjs → chunk-6GXYTBBS.mjs} +2 -2
- package/dist/{chunk-IURMCRIH.mjs → chunk-CNX6WGGL.mjs} +11 -11
- package/dist/core/index.cjs +46 -46
- package/dist/core/index.d.cts +76 -80
- package/dist/core/index.d.ts +76 -80
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +1 -1
- package/dist/nfe/index.d.cts +9 -4
- package/dist/nfe/index.d.ts +9 -4
- package/dist/nfe/index.mjs +1 -1
- package/dist/{types-CwXoUwhL.d.ts → xml-signer-_YzTA_hV.d.cts} +1 -7
- package/dist/{types-CwXoUwhL.d.cts → xml-signer-_YzTA_hV.d.ts} +1 -7
- package/package.json +1 -1
- /package/dist/{chunk-I4KZJHBR.mjs → chunk-23RWB4QQ.mjs} +0 -0
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { x as NFeTsError,
|
|
2
|
-
export { b as CanonicalizationMethod, C as CertificateInfo,
|
|
1
|
+
import { x as NFeTsError, W as Decimal$2, D as DecimalValue, y as CacheAdapter, z as CertificateRepository, J as HttpClient, R as ReadCertificateRequest, Y as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, Z as Left, _ as Right, m as Client, L as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../xml-signer-_YzTA_hV.cjs';
|
|
2
|
+
export { b as CanonicalizationMethod, C as CertificateInfo, e as DigestAlgorithm, U as EntitySigner, E as Environment, j as EnvironmentCode, H as HeaderValue, A as HttpClientHeaders, I as HttpResponse, K as KnownKeys, N as Namespaced, u as RenderOptions, G as RequestConfig, F as ResponseType, l as Signature, c as SignatureMethod, S as SignatureNamespace, O as SignedEntity, k as SignedInfo, Q as Signer, M as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, T as Transforms, q as Transmitter, p as TransmitterOptions, X as XmlDeclarationAttributes, V as XmlSigner, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions } from '../xml-signer-_YzTA_hV.cjs';
|
|
3
3
|
import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
|
|
4
|
-
import {
|
|
4
|
+
import { KeyObject, X509Certificate } from 'node:crypto';
|
|
5
5
|
import { Decimal as Decimal$1 } from 'decimal.js';
|
|
6
6
|
import { Agent } from 'node:https';
|
|
7
7
|
import * as Xml2js from 'xml2js';
|
|
@@ -13,6 +13,78 @@ interface StrategyPattern<T, R> {
|
|
|
13
13
|
declare class ValidationError extends NFeTsError {
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
declare class Decimal extends Decimal$1 implements Decimal$2 {
|
|
17
|
+
static from(value: DecimalValue | Decimal): Decimal$2;
|
|
18
|
+
static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
|
|
19
|
+
static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class MemoryCacheAdapter implements CacheAdapter {
|
|
23
|
+
private cache;
|
|
24
|
+
get<T>(key: string): Promise<T | null>;
|
|
25
|
+
has(key: string): Promise<boolean>;
|
|
26
|
+
set(key: string, value: unknown): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class NativeCertificateRepository implements CertificateRepository {
|
|
30
|
+
private readonly httpClient;
|
|
31
|
+
private readonly cache;
|
|
32
|
+
constructor(httpClient: HttpClient, cache?: CacheAdapter);
|
|
33
|
+
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
34
|
+
sign(content: string, privateKey: KeyObject, algorithm?: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
35
|
+
getCertificateInfo(certificate: X509Certificate): {
|
|
36
|
+
CNPJ: string | undefined;
|
|
37
|
+
CPF: string | undefined;
|
|
38
|
+
CN: string | undefined;
|
|
39
|
+
O: string | undefined;
|
|
40
|
+
OU: string | undefined;
|
|
41
|
+
ST: string | undefined;
|
|
42
|
+
L: string | undefined;
|
|
43
|
+
C: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
getStringCertificate(certificate: X509Certificate): string;
|
|
46
|
+
getStringPrivateKey(privateKey: KeyObject): string;
|
|
47
|
+
private getPfxBuffer;
|
|
48
|
+
private getCacheKey;
|
|
49
|
+
private hitBufferOnCache;
|
|
50
|
+
private isValidRemoteUrl;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare class NullCacheAdapter implements CacheAdapter {
|
|
54
|
+
get<T>(_: string): Promise<T | null>;
|
|
55
|
+
has(_: string): Promise<boolean>;
|
|
56
|
+
set(_: string, __: unknown): Promise<boolean>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
|
|
60
|
+
private readonly toolkit;
|
|
61
|
+
private readonly certificateRepository;
|
|
62
|
+
private certificate?;
|
|
63
|
+
constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
|
|
64
|
+
setCertificate(certificate: ReadCertificateResponse): this;
|
|
65
|
+
protected get httpsAgent(): Agent;
|
|
66
|
+
protected get defaultSoapHeaders(): {
|
|
67
|
+
'Content-Type': string;
|
|
68
|
+
};
|
|
69
|
+
send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare class Xml2JsToolkit implements XmlToolkit {
|
|
73
|
+
private readonly xml2js;
|
|
74
|
+
constructor(xml2js?: typeof Xml2js);
|
|
75
|
+
validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
|
|
76
|
+
parse<T>(xml: string, options?: ParserOptions): Promise<T>;
|
|
77
|
+
build(object: object, options?: BuilderOptions): Promise<string>;
|
|
78
|
+
digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
|
|
79
|
+
canonicalize(xml: string, options?: CanonicalizeOptions): string;
|
|
80
|
+
getNode(xml: string, tag: string): string | null;
|
|
81
|
+
getFirstNode(xml: string): string | null;
|
|
82
|
+
getAttribute(xml: string, tag: string): string | null;
|
|
83
|
+
appendNode(xml: string, node: string): string;
|
|
84
|
+
private hash;
|
|
85
|
+
private clear;
|
|
86
|
+
}
|
|
87
|
+
|
|
16
88
|
declare const ValidateErrorsMetadata = "__ValidateErrors__";
|
|
17
89
|
declare const mapConstraintsToErrors: (errors: ValidationError$1[], parent?: string) => string[];
|
|
18
90
|
declare const Validates: <T extends object>(klass: new () => T) => (_target: object, property: string | symbol, descriptor: TypedPropertyDescriptor<(payload: T, ...args: any[]) => any>) => void;
|
|
@@ -175,80 +247,4 @@ declare class ASN1 {
|
|
|
175
247
|
protected base128(bytes: number[], byte: number, last: boolean): number[];
|
|
176
248
|
}
|
|
177
249
|
|
|
178
|
-
|
|
179
|
-
static from(value: DecimalValue | Decimal): Decimal$2;
|
|
180
|
-
static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
|
|
181
|
-
static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare class MemoryCacheAdapter implements CacheAdapter {
|
|
185
|
-
private cache;
|
|
186
|
-
get<T>(key: string): Promise<T | null>;
|
|
187
|
-
has(key: string): Promise<boolean>;
|
|
188
|
-
set(key: string, value: unknown): Promise<boolean>;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
declare class NativeCertificateRepository implements CertificateRepository {
|
|
192
|
-
private readonly httpClient;
|
|
193
|
-
private readonly cache;
|
|
194
|
-
constructor(httpClient: HttpClient, cache?: CacheAdapter);
|
|
195
|
-
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
196
|
-
sign(content: string, privateKey: KeyObject, algorithm?: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
197
|
-
getCertificateInfo(certificate: X509Certificate): {
|
|
198
|
-
CNPJ: string | undefined;
|
|
199
|
-
CPF: string | undefined;
|
|
200
|
-
CN: string | undefined;
|
|
201
|
-
O: string | undefined;
|
|
202
|
-
OU: string | undefined;
|
|
203
|
-
ST: string | undefined;
|
|
204
|
-
L: string | undefined;
|
|
205
|
-
C: string | undefined;
|
|
206
|
-
};
|
|
207
|
-
getStringCertificate(certificate: X509Certificate): string;
|
|
208
|
-
getStringPrivateKey(privateKey: KeyObject): string;
|
|
209
|
-
private getPfxBuffer;
|
|
210
|
-
private getCacheKey;
|
|
211
|
-
private hitBufferOnCache;
|
|
212
|
-
private isValidRemoteUrl;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
declare class NullCacheAdapter implements CacheAdapter {
|
|
216
|
-
get<T>(_: string): Promise<T | null>;
|
|
217
|
-
has(_: string): Promise<boolean>;
|
|
218
|
-
set(_: string, __: unknown): Promise<boolean>;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
|
|
222
|
-
private readonly toolkit;
|
|
223
|
-
private readonly certificateRepository;
|
|
224
|
-
private certificate?;
|
|
225
|
-
constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
|
|
226
|
-
setCertificate(certificate: ReadCertificateResponse): this;
|
|
227
|
-
protected get httpsAgent(): Agent;
|
|
228
|
-
protected get defaultSoapHeaders(): {
|
|
229
|
-
'Content-Type': string;
|
|
230
|
-
};
|
|
231
|
-
send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare class Xml2JsToolkit implements XmlToolkit {
|
|
235
|
-
private readonly xml2js;
|
|
236
|
-
constructor(xml2js?: typeof Xml2js);
|
|
237
|
-
validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
|
|
238
|
-
parse<T>(xml: string, options?: ParserOptions): Promise<T>;
|
|
239
|
-
build(object: object, options?: BuilderOptions): Promise<string>;
|
|
240
|
-
digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
|
|
241
|
-
canonicalize(xml: string, options?: CanonicalizeOptions): string;
|
|
242
|
-
getNode(xml: string, tag: string): string | null;
|
|
243
|
-
getFirstNode(xml: string): string | null;
|
|
244
|
-
getAttribute(xml: string, tag: string): string | null;
|
|
245
|
-
appendNode(xml: string, node: string): string;
|
|
246
|
-
private hash;
|
|
247
|
-
private clear;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare const leftFromError: (error: unknown) => Left<NFeTsError>;
|
|
251
|
-
|
|
252
|
-
declare const unreachable: (_: never) => never;
|
|
253
|
-
|
|
254
|
-
export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, Decimal, DecimalValue, Either, ExtractReturnType, HttpClient, IsDecimal, Left, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, Right, SendTransmissionPayload, SignatureAlgorithm, 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, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, leftFromError, mapConstraintsToErrors, plainToInstance, unreachable };
|
|
250
|
+
export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, Decimal, DecimalValue, ExtractReturnType, HttpClient, IsDecimal, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, SendTransmissionPayload, SignatureAlgorithm, 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, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, mapConstraintsToErrors, plainToInstance };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { x as NFeTsError,
|
|
2
|
-
export { b as CanonicalizationMethod, C as CertificateInfo,
|
|
1
|
+
import { x as NFeTsError, W as Decimal$2, D as DecimalValue, y as CacheAdapter, z as CertificateRepository, J as HttpClient, R as ReadCertificateRequest, Y as Either, a as ReadCertificateResponse, d as SignatureAlgorithm, Z as Left, _ as Right, m as Client, L as RemoteTransmissionRepository, w as XmlToolkit, n as SendTransmissionPayload, o as ExtractReturnType, P as ParserOptions, B as BuilderOptions, s as CanonicalizeOptions } from '../xml-signer-_YzTA_hV.js';
|
|
2
|
+
export { b as CanonicalizationMethod, C as CertificateInfo, e as DigestAlgorithm, U as EntitySigner, E as Environment, j as EnvironmentCode, H as HeaderValue, A as HttpClientHeaders, I as HttpResponse, K as KnownKeys, N as Namespaced, u as RenderOptions, G as RequestConfig, F as ResponseType, l as Signature, c as SignatureMethod, S as SignatureNamespace, O as SignedEntity, k as SignedInfo, Q as Signer, M as SignerOptions, i as StateAcronym, g as StateAcronyms, h as StateCode, f as StateCodes, T as Transforms, q as Transmitter, p as TransmitterOptions, X as XmlDeclarationAttributes, V as XmlSigner, t as defaultBuilderOptions, r as defaultCanonicalizeOptions, v as defaultParserOptions } from '../xml-signer-_YzTA_hV.js';
|
|
3
3
|
import { ValidationError as ValidationError$1, ValidationOptions } from 'class-validator';
|
|
4
|
-
import {
|
|
4
|
+
import { KeyObject, X509Certificate } from 'node:crypto';
|
|
5
5
|
import { Decimal as Decimal$1 } from 'decimal.js';
|
|
6
6
|
import { Agent } from 'node:https';
|
|
7
7
|
import * as Xml2js from 'xml2js';
|
|
@@ -13,6 +13,78 @@ interface StrategyPattern<T, R> {
|
|
|
13
13
|
declare class ValidationError extends NFeTsError {
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
declare class Decimal extends Decimal$1 implements Decimal$2 {
|
|
17
|
+
static from(value: DecimalValue | Decimal): Decimal$2;
|
|
18
|
+
static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
|
|
19
|
+
static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class MemoryCacheAdapter implements CacheAdapter {
|
|
23
|
+
private cache;
|
|
24
|
+
get<T>(key: string): Promise<T | null>;
|
|
25
|
+
has(key: string): Promise<boolean>;
|
|
26
|
+
set(key: string, value: unknown): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class NativeCertificateRepository implements CertificateRepository {
|
|
30
|
+
private readonly httpClient;
|
|
31
|
+
private readonly cache;
|
|
32
|
+
constructor(httpClient: HttpClient, cache?: CacheAdapter);
|
|
33
|
+
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
34
|
+
sign(content: string, privateKey: KeyObject, algorithm?: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
35
|
+
getCertificateInfo(certificate: X509Certificate): {
|
|
36
|
+
CNPJ: string | undefined;
|
|
37
|
+
CPF: string | undefined;
|
|
38
|
+
CN: string | undefined;
|
|
39
|
+
O: string | undefined;
|
|
40
|
+
OU: string | undefined;
|
|
41
|
+
ST: string | undefined;
|
|
42
|
+
L: string | undefined;
|
|
43
|
+
C: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
getStringCertificate(certificate: X509Certificate): string;
|
|
46
|
+
getStringPrivateKey(privateKey: KeyObject): string;
|
|
47
|
+
private getPfxBuffer;
|
|
48
|
+
private getCacheKey;
|
|
49
|
+
private hitBufferOnCache;
|
|
50
|
+
private isValidRemoteUrl;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare class NullCacheAdapter implements CacheAdapter {
|
|
54
|
+
get<T>(_: string): Promise<T | null>;
|
|
55
|
+
has(_: string): Promise<boolean>;
|
|
56
|
+
set(_: string, __: unknown): Promise<boolean>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
|
|
60
|
+
private readonly toolkit;
|
|
61
|
+
private readonly certificateRepository;
|
|
62
|
+
private certificate?;
|
|
63
|
+
constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
|
|
64
|
+
setCertificate(certificate: ReadCertificateResponse): this;
|
|
65
|
+
protected get httpsAgent(): Agent;
|
|
66
|
+
protected get defaultSoapHeaders(): {
|
|
67
|
+
'Content-Type': string;
|
|
68
|
+
};
|
|
69
|
+
send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare class Xml2JsToolkit implements XmlToolkit {
|
|
73
|
+
private readonly xml2js;
|
|
74
|
+
constructor(xml2js?: typeof Xml2js);
|
|
75
|
+
validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
|
|
76
|
+
parse<T>(xml: string, options?: ParserOptions): Promise<T>;
|
|
77
|
+
build(object: object, options?: BuilderOptions): Promise<string>;
|
|
78
|
+
digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
|
|
79
|
+
canonicalize(xml: string, options?: CanonicalizeOptions): string;
|
|
80
|
+
getNode(xml: string, tag: string): string | null;
|
|
81
|
+
getFirstNode(xml: string): string | null;
|
|
82
|
+
getAttribute(xml: string, tag: string): string | null;
|
|
83
|
+
appendNode(xml: string, node: string): string;
|
|
84
|
+
private hash;
|
|
85
|
+
private clear;
|
|
86
|
+
}
|
|
87
|
+
|
|
16
88
|
declare const ValidateErrorsMetadata = "__ValidateErrors__";
|
|
17
89
|
declare const mapConstraintsToErrors: (errors: ValidationError$1[], parent?: string) => string[];
|
|
18
90
|
declare const Validates: <T extends object>(klass: new () => T) => (_target: object, property: string | symbol, descriptor: TypedPropertyDescriptor<(payload: T, ...args: any[]) => any>) => void;
|
|
@@ -175,80 +247,4 @@ declare class ASN1 {
|
|
|
175
247
|
protected base128(bytes: number[], byte: number, last: boolean): number[];
|
|
176
248
|
}
|
|
177
249
|
|
|
178
|
-
|
|
179
|
-
static from(value: DecimalValue | Decimal): Decimal$2;
|
|
180
|
-
static newOrZero(value?: DecimalValue | Decimal): Decimal$2;
|
|
181
|
-
static newOrUndefined(value?: DecimalValue | Decimal): Decimal$2 | undefined;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare class MemoryCacheAdapter implements CacheAdapter {
|
|
185
|
-
private cache;
|
|
186
|
-
get<T>(key: string): Promise<T | null>;
|
|
187
|
-
has(key: string): Promise<boolean>;
|
|
188
|
-
set(key: string, value: unknown): Promise<boolean>;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
declare class NativeCertificateRepository implements CertificateRepository {
|
|
192
|
-
private readonly httpClient;
|
|
193
|
-
private readonly cache;
|
|
194
|
-
constructor(httpClient: HttpClient, cache?: CacheAdapter);
|
|
195
|
-
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
196
|
-
sign(content: string, privateKey: KeyObject, algorithm?: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
197
|
-
getCertificateInfo(certificate: X509Certificate): {
|
|
198
|
-
CNPJ: string | undefined;
|
|
199
|
-
CPF: string | undefined;
|
|
200
|
-
CN: string | undefined;
|
|
201
|
-
O: string | undefined;
|
|
202
|
-
OU: string | undefined;
|
|
203
|
-
ST: string | undefined;
|
|
204
|
-
L: string | undefined;
|
|
205
|
-
C: string | undefined;
|
|
206
|
-
};
|
|
207
|
-
getStringCertificate(certificate: X509Certificate): string;
|
|
208
|
-
getStringPrivateKey(privateKey: KeyObject): string;
|
|
209
|
-
private getPfxBuffer;
|
|
210
|
-
private getCacheKey;
|
|
211
|
-
private hitBufferOnCache;
|
|
212
|
-
private isValidRemoteUrl;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
declare class NullCacheAdapter implements CacheAdapter {
|
|
216
|
-
get<T>(_: string): Promise<T | null>;
|
|
217
|
-
has(_: string): Promise<boolean>;
|
|
218
|
-
set(_: string, __: unknown): Promise<boolean>;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
declare class SoapRemoteTransmissionRepository<C extends Client> implements RemoteTransmissionRepository<C> {
|
|
222
|
-
private readonly toolkit;
|
|
223
|
-
private readonly certificateRepository;
|
|
224
|
-
private certificate?;
|
|
225
|
-
constructor(toolkit: XmlToolkit, certificateRepository: CertificateRepository);
|
|
226
|
-
setCertificate(certificate: ReadCertificateResponse): this;
|
|
227
|
-
protected get httpsAgent(): Agent;
|
|
228
|
-
protected get defaultSoapHeaders(): {
|
|
229
|
-
'Content-Type': string;
|
|
230
|
-
};
|
|
231
|
-
send<P extends SendTransmissionPayload<C>>(params: P): Promise<Left<NFeTsError> | Right<ExtractReturnType<C, P>>>;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare class Xml2JsToolkit implements XmlToolkit {
|
|
235
|
-
private readonly xml2js;
|
|
236
|
-
constructor(xml2js?: typeof Xml2js);
|
|
237
|
-
validate(xml: string, xsd: string): Promise<Left<NFeTsError> | Right<never>>;
|
|
238
|
-
parse<T>(xml: string, options?: ParserOptions): Promise<T>;
|
|
239
|
-
build(object: object, options?: BuilderOptions): Promise<string>;
|
|
240
|
-
digest(xml: string, algorithm: SignatureAlgorithm, options?: CanonicalizeOptions): string;
|
|
241
|
-
canonicalize(xml: string, options?: CanonicalizeOptions): string;
|
|
242
|
-
getNode(xml: string, tag: string): string | null;
|
|
243
|
-
getFirstNode(xml: string): string | null;
|
|
244
|
-
getAttribute(xml: string, tag: string): string | null;
|
|
245
|
-
appendNode(xml: string, node: string): string;
|
|
246
|
-
private hash;
|
|
247
|
-
private clear;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare const leftFromError: (error: unknown) => Left<NFeTsError>;
|
|
251
|
-
|
|
252
|
-
declare const unreachable: (_: never) => never;
|
|
253
|
-
|
|
254
|
-
export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, Decimal, DecimalValue, Either, ExtractReturnType, HttpClient, IsDecimal, Left, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, Right, SendTransmissionPayload, SignatureAlgorithm, 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, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, leftFromError, mapConstraintsToErrors, plainToInstance, unreachable };
|
|
250
|
+
export { ASN1, BuilderOptions, CacheAdapter, CanonicalizeOptions, CertificateRepository, Choice, type ChoiceOptions, Client, Decimal, DecimalValue, ExtractReturnType, HttpClient, IsDecimal, MemoryCacheAdapter, NFeTsError, NativeCertificateRepository, NullCacheAdapter, ParserOptions, ReadCertificateRequest, ReadCertificateResponse, RemoteTransmissionRepository, SendTransmissionPayload, SignatureAlgorithm, 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, TransformDateString, TransformDecimal, type TransformDecimalArgs, type TransformToDateStringArgs, ValidateErrorsMetadata, Validates, ValidationError, Xml2JsToolkit, XmlToolkit, clearEmptyValues, mapConstraintsToErrors, plainToInstance };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-23RWB4QQ.mjs";import{$ as V,A as x,B as y,F as z,G as A,H as B,I as C,J as D,K as E,L as F,M as G,N as H,O as I,P as J,Q as K,R as L,S as M,T as N,U as O,V as P,W as Q,X as R,Y as S,Z as T,_ as U,a,aa as W,b,ba as X,c,ca as Y,d,da as Z,e,ea as _,f,fa as $,g,ga as aa,h,ha as ba,i,ia as ca,j,ja as da,ka as ea,l as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v,z as w}from"../chunk-CNX6WGGL.mjs";import"../chunk-W6MRGYXP.mjs";export{ea as ASN1,b as CanonicalizationMethod,C as Choice,v as Decimal,e as DigestAlgorithm,l as EntitySigner,h as Environment,B as IsDecimal,w as MemoryCacheAdapter,i as NFeTsError,y as NativeCertificateRepository,x as NullCacheAdapter,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,k as Signer,p as SkipAllValidations,o as SkipValidation,n as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,g as StateAcronyms,F as StateCodeAcValidator,G as StateCodeAlValidator,H as StateCodeAmValidator,I as StateCodeApValidator,J as StateCodeBaValidator,K as StateCodeCeValidator,L as StateCodeDfValidator,M as StateCodeEsValidator,N as StateCodeGoValidator,O as StateCodeMaValidator,P as StateCodeMgValidator,Q as StateCodeMsValidator,R as StateCodeMtValidator,S as StateCodePaValidator,T as StateCodePbValidator,U as StateCodePeValidator,V as StateCodePiValidator,W as StateCodePrValidator,X as StateCodeRjValidator,Y as StateCodeRnValidator,Z as StateCodeRoValidator,_ as StateCodeRrValidator,$ as StateCodeRsValidator,aa as StateCodeScValidator,ba as StateCodeSeValidator,ca as StateCodeSpValidator,da as StateCodeToValidator,f as StateCodes,E as TransformDateString,D as TransformDecimal,s as ValidateErrorsMetadata,u as Validates,j as ValidationError,A as Xml2JsToolkit,m as XmlSigner,q as clearEmptyValues,t as mapConstraintsToErrors,r as plainToInstance};
|