nfets 0.0.45 → 0.0.46
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/build/addons/win32-x64/wincrypt_certificate_store.node +0 -0
- package/build/addons/win32-x64/winhttp_ssl_client.node +0 -0
- package/build/addons/win32-x64/xml_validator.node +0 -0
- package/dist/chunk-EG7US67K.mjs +277 -0
- package/dist/chunk-LP4JOWRA.mjs +2 -0
- package/dist/core/index.cjs +86 -79
- package/dist/core/index.d.cts +11 -6
- package/dist/core/index.d.ts +11 -6
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +61 -60
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +64 -63
- package/dist/nfe/index.d.cts +6 -1
- package/dist/nfe/index.d.ts +6 -1
- package/dist/nfe/index.mjs +1 -1
- package/dist/{xml-signer-BmpwXTKY.d.cts → xml-signer-Cu3OlWV1.d.cts} +7 -4
- package/dist/{xml-signer-BmpwXTKY.d.ts → xml-signer-Cu3OlWV1.d.ts} +7 -4
- package/package.json +2 -1
- package/dist/chunk-XGHTJXFZ.mjs +0 -270
- package/dist/chunk-ZRYCG7PM.mjs +0 -8
package/dist/nfe/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, i as StateAcronym, l as Signature, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client, G as RequestConfig, O as SignedEntity,
|
|
1
|
+
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, i as StateAcronym, l as Signature, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client, G as RequestConfig, O as SignedEntity, Z as Either, x as NFeTsError, a as ReadCertificateResponse, Q as SignerRepository, d as SignatureAlgorithm, _ as Left, $ as Right, R as ReadCertificateRequest, J as HttpClient, w as XmlToolkit, y as CacheAdapter, z as CertificateRepository, L as RemoteTransmissionRepository, V as EntitySigner, W as XmlSigner, N as Namespaced } from '../xml-signer-Cu3OlWV1.cjs';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
|
|
4
4
|
type DeepPartial<T> = {
|
|
@@ -1623,12 +1623,17 @@ declare class NFe implements NFe$1 {
|
|
|
1623
1623
|
Signature?: Signature;
|
|
1624
1624
|
}
|
|
1625
1625
|
|
|
1626
|
+
declare class CryptoSignerRepository implements SignerRepository {
|
|
1627
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1626
1630
|
declare abstract class Pipeline {
|
|
1627
1631
|
protected readonly certificate?: ReadCertificateRequest | undefined;
|
|
1628
1632
|
protected readonly xmlns = "http://www.portalfiscal.inf.br/nfe";
|
|
1629
1633
|
protected readonly http: HttpClient;
|
|
1630
1634
|
protected readonly toolkit: XmlToolkit;
|
|
1631
1635
|
protected readonly caching: CacheAdapter;
|
|
1636
|
+
protected readonly signerRepository: CryptoSignerRepository;
|
|
1632
1637
|
protected readonly certificates: CertificateRepository;
|
|
1633
1638
|
protected readonly soap: RemoteTransmissionRepository<NfeRemoteClient>;
|
|
1634
1639
|
protected readonly signer: EntitySigner;
|
package/dist/nfe/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, i as StateAcronym, l as Signature, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client, G as RequestConfig, O as SignedEntity,
|
|
1
|
+
import { h as StateCode, j as EnvironmentCode, D as DecimalValue, i as StateAcronym, l as Signature, f as StateCodes, p as TransmitterOptions, q as Transmitter, m as Client, G as RequestConfig, O as SignedEntity, Z as Either, x as NFeTsError, a as ReadCertificateResponse, Q as SignerRepository, d as SignatureAlgorithm, _ as Left, $ as Right, R as ReadCertificateRequest, J as HttpClient, w as XmlToolkit, y as CacheAdapter, z as CertificateRepository, L as RemoteTransmissionRepository, V as EntitySigner, W as XmlSigner, N as Namespaced } from '../xml-signer-Cu3OlWV1.js';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
|
|
4
4
|
type DeepPartial<T> = {
|
|
@@ -1623,12 +1623,17 @@ declare class NFe implements NFe$1 {
|
|
|
1623
1623
|
Signature?: Signature;
|
|
1624
1624
|
}
|
|
1625
1625
|
|
|
1626
|
+
declare class CryptoSignerRepository implements SignerRepository {
|
|
1627
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Left<NFeTsError> | Right<string>>;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1626
1630
|
declare abstract class Pipeline {
|
|
1627
1631
|
protected readonly certificate?: ReadCertificateRequest | undefined;
|
|
1628
1632
|
protected readonly xmlns = "http://www.portalfiscal.inf.br/nfe";
|
|
1629
1633
|
protected readonly http: HttpClient;
|
|
1630
1634
|
protected readonly toolkit: XmlToolkit;
|
|
1631
1635
|
protected readonly caching: CacheAdapter;
|
|
1636
|
+
protected readonly signerRepository: CryptoSignerRepository;
|
|
1632
1637
|
protected readonly certificates: CertificateRepository;
|
|
1633
1638
|
protected readonly soap: RemoteTransmissionRepository<NfeRemoteClient>;
|
|
1634
1639
|
protected readonly signer: EntitySigner;
|
package/dist/nfe/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"../chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"../chunk-LP4JOWRA.mjs";import"../chunk-EG7US67K.mjs";import"../chunk-W6MRGYXP.mjs";export{d as AccessKeyBuilder,e as DefaultDetBuilderAggregator,f as DefaultTotalBuilderAggregator,u as NFCeDto,q as NFeDto,k as NfceAuthorizerPipeline,m as NfceConsultStatusPipeline,j as NfceQrcode,i as NfceRemoteTransmitter,v as NfceXmlBuilder,w as NfceXmlBuilderPipeline,n as NfeAuthorizationResponsePipeline,h as NfeAuthorizerPipeline,l as NfeConsultStatusPipeline,r as NfeDetXmlBuilder,o as NfeNfceCancelPipeline,p as NfeNfceVoidRangePipeline,g as NfeRemoteTransmitter,s as NfeXmlBuilder,t as NfeXmlBuilderPipeline,a as TpEmis,b as TpEvent,c as schemas};
|
|
@@ -67,7 +67,7 @@ interface ReadCertificateResponse {
|
|
|
67
67
|
password: string;
|
|
68
68
|
ca: X509Certificate[];
|
|
69
69
|
certificate: X509Certificate;
|
|
70
|
-
privateKey
|
|
70
|
+
privateKey?: KeyObject;
|
|
71
71
|
}
|
|
72
72
|
interface CertificateInfo {
|
|
73
73
|
CNPJ?: string;
|
|
@@ -313,7 +313,7 @@ interface CacheAdapter {
|
|
|
313
313
|
|
|
314
314
|
interface CertificateRepository {
|
|
315
315
|
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
316
|
-
sign(content: string,
|
|
316
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
|
|
317
317
|
getStringCertificate(certificate: X509Certificate): string;
|
|
318
318
|
getStringPrivateKey(privateKey: KeyObject): string;
|
|
319
319
|
getCertificateInfo(certificate: X509Certificate): CertificateInfo;
|
|
@@ -331,6 +331,9 @@ interface SignerOptions<T = string> {
|
|
|
331
331
|
type SignedEntity<T extends object> = T & {
|
|
332
332
|
Signature: Signature;
|
|
333
333
|
};
|
|
334
|
+
interface SignerRepository {
|
|
335
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
|
|
336
|
+
}
|
|
334
337
|
|
|
335
338
|
declare abstract class Signer {
|
|
336
339
|
protected readonly toolkit: XmlToolkit;
|
|
@@ -385,7 +388,7 @@ declare abstract class Signer {
|
|
|
385
388
|
};
|
|
386
389
|
};
|
|
387
390
|
private digest;
|
|
388
|
-
protected signOrLeft(signedInfo: SignedInfo,
|
|
391
|
+
protected signOrLeft(signedInfo: SignedInfo, cert: ReadCertificateResponse): Promise<Either<NFeTsError, string>>;
|
|
389
392
|
private get transforms();
|
|
390
393
|
private get digestAlgorithm();
|
|
391
394
|
private get signatureMethod();
|
|
@@ -400,4 +403,4 @@ declare class XmlSigner extends Signer {
|
|
|
400
403
|
sign(xml: string, options: SignerOptions, cert: ReadCertificateResponse): Promise<Left<NFeTsError> | Right<string>>;
|
|
401
404
|
}
|
|
402
405
|
|
|
403
|
-
export { type HttpClientHeaders as A, type BuilderOptions as B, type CertificateInfo as C, type DecimalValue as D, Environment as E, type ResponseType as F, type RequestConfig as G, type HeaderValue as H, type HttpResponse as I, type HttpClient as J, type KnownKeys as K, type RemoteTransmissionRepository as L, type SignerOptions as M, type Namespaced as N, type SignedEntity as O, type ParserOptions as P,
|
|
406
|
+
export { Right as $, type HttpClientHeaders as A, type BuilderOptions as B, type CertificateInfo as C, type DecimalValue as D, Environment as E, type ResponseType as F, type RequestConfig as G, type HeaderValue as H, type HttpResponse as I, type HttpClient as J, type KnownKeys as K, type RemoteTransmissionRepository as L, type SignerOptions as M, type Namespaced as N, type SignedEntity as O, type ParserOptions as P, type SignerRepository as Q, type ReadCertificateRequest as R, SignatureNamespace as S, type Transforms as T, Signer as U, EntitySigner as V, XmlSigner as W, type XmlDeclarationAttributes as X, type Decimal as Y, type Either as Z, Left as _, type ReadCertificateResponse as a, CanonicalizationMethod$1 as b, SignatureMethod$1 as c, SignatureAlgorithm as d, DigestAlgorithm as e, StateCodes as f, StateAcronyms as g, type StateCode as h, type StateAcronym as i, type EnvironmentCode as j, type SignedInfo as k, type Signature as l, type Client as m, type SendTransmissionPayload as n, type ExtractReturnType as o, type TransmitterOptions as p, type Transmitter as q, defaultCanonicalizeOptions as r, type CanonicalizeOptions as s, defaultBuilderOptions as t, type RenderOptions as u, defaultParserOptions as v, type XmlToolkit as w, NFeTsError as x, type CacheAdapter as y, type CertificateRepository as z };
|
|
@@ -67,7 +67,7 @@ interface ReadCertificateResponse {
|
|
|
67
67
|
password: string;
|
|
68
68
|
ca: X509Certificate[];
|
|
69
69
|
certificate: X509Certificate;
|
|
70
|
-
privateKey
|
|
70
|
+
privateKey?: KeyObject;
|
|
71
71
|
}
|
|
72
72
|
interface CertificateInfo {
|
|
73
73
|
CNPJ?: string;
|
|
@@ -313,7 +313,7 @@ interface CacheAdapter {
|
|
|
313
313
|
|
|
314
314
|
interface CertificateRepository {
|
|
315
315
|
read(request: ReadCertificateRequest): Promise<Either<NFeTsError, ReadCertificateResponse>>;
|
|
316
|
-
sign(content: string,
|
|
316
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
|
|
317
317
|
getStringCertificate(certificate: X509Certificate): string;
|
|
318
318
|
getStringPrivateKey(privateKey: KeyObject): string;
|
|
319
319
|
getCertificateInfo(certificate: X509Certificate): CertificateInfo;
|
|
@@ -331,6 +331,9 @@ interface SignerOptions<T = string> {
|
|
|
331
331
|
type SignedEntity<T extends object> = T & {
|
|
332
332
|
Signature: Signature;
|
|
333
333
|
};
|
|
334
|
+
interface SignerRepository {
|
|
335
|
+
sign(content: string, cert: ReadCertificateResponse, algorithm: SignatureAlgorithm): Promise<Either<NFeTsError, string>>;
|
|
336
|
+
}
|
|
334
337
|
|
|
335
338
|
declare abstract class Signer {
|
|
336
339
|
protected readonly toolkit: XmlToolkit;
|
|
@@ -385,7 +388,7 @@ declare abstract class Signer {
|
|
|
385
388
|
};
|
|
386
389
|
};
|
|
387
390
|
private digest;
|
|
388
|
-
protected signOrLeft(signedInfo: SignedInfo,
|
|
391
|
+
protected signOrLeft(signedInfo: SignedInfo, cert: ReadCertificateResponse): Promise<Either<NFeTsError, string>>;
|
|
389
392
|
private get transforms();
|
|
390
393
|
private get digestAlgorithm();
|
|
391
394
|
private get signatureMethod();
|
|
@@ -400,4 +403,4 @@ declare class XmlSigner extends Signer {
|
|
|
400
403
|
sign(xml: string, options: SignerOptions, cert: ReadCertificateResponse): Promise<Left<NFeTsError> | Right<string>>;
|
|
401
404
|
}
|
|
402
405
|
|
|
403
|
-
export { type HttpClientHeaders as A, type BuilderOptions as B, type CertificateInfo as C, type DecimalValue as D, Environment as E, type ResponseType as F, type RequestConfig as G, type HeaderValue as H, type HttpResponse as I, type HttpClient as J, type KnownKeys as K, type RemoteTransmissionRepository as L, type SignerOptions as M, type Namespaced as N, type SignedEntity as O, type ParserOptions as P,
|
|
406
|
+
export { Right as $, type HttpClientHeaders as A, type BuilderOptions as B, type CertificateInfo as C, type DecimalValue as D, Environment as E, type ResponseType as F, type RequestConfig as G, type HeaderValue as H, type HttpResponse as I, type HttpClient as J, type KnownKeys as K, type RemoteTransmissionRepository as L, type SignerOptions as M, type Namespaced as N, type SignedEntity as O, type ParserOptions as P, type SignerRepository as Q, type ReadCertificateRequest as R, SignatureNamespace as S, type Transforms as T, Signer as U, EntitySigner as V, XmlSigner as W, type XmlDeclarationAttributes as X, type Decimal as Y, type Either as Z, Left as _, type ReadCertificateResponse as a, CanonicalizationMethod$1 as b, SignatureMethod$1 as c, SignatureAlgorithm as d, DigestAlgorithm as e, StateCodes as f, StateAcronyms as g, type StateCode as h, type StateAcronym as i, type EnvironmentCode as j, type SignedInfo as k, type Signature as l, type Client as m, type SendTransmissionPayload as n, type ExtractReturnType as o, type TransmitterOptions as p, type Transmitter as q, defaultCanonicalizeOptions as r, type CanonicalizeOptions as s, defaultBuilderOptions as t, type RenderOptions as u, defaultParserOptions as v, type XmlToolkit as w, NFeTsError as x, type CacheAdapter as y, type CertificateRepository as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nfets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"description": "typescript libraries for Brazilian's SEFAZ standards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@types/pdfkit": "^0.17.3",
|
|
69
69
|
"@typescript-eslint/parser": "^8.21.0",
|
|
70
70
|
"axios": "^1.7.9",
|
|
71
|
+
"cross-env": "^10.1.0",
|
|
71
72
|
"eslint": "^9.19.0",
|
|
72
73
|
"eslint-plugin-prettier": "^5.2.3",
|
|
73
74
|
"fs-extra": "^11.3.0",
|