@12-apps/fiscal 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -4
- package/dist/{chunk-HMTPJWXM.js → chunk-2JVTHJAU.js} +2 -2
- package/dist/{chunk-3E3NBXSW.js → chunk-CEK2GDRY.js} +5 -3
- package/dist/chunk-CEK2GDRY.js.map +1 -0
- package/dist/{chunk-MGTROA7K.js → chunk-OAQSGDZ7.js} +11 -7
- package/dist/chunk-OAQSGDZ7.js.map +1 -0
- package/dist/{chunk-G6QNU4FD.js → chunk-P7CRGZGO.js} +2 -2
- package/dist/{chunk-H33BK623.js → chunk-WRYCYXRA.js} +1 -1
- package/dist/{chunk-H33BK623.js.map → chunk-WRYCYXRA.js.map} +1 -1
- package/dist/{chunk-TJCUO6D6.js → chunk-YHSO3476.js} +6 -5
- package/dist/chunk-YHSO3476.js.map +1 -0
- package/dist/{context-CwZiHLnY.d.ts → context-Cyvfr2YB.d.ts} +155 -19
- package/dist/danfe/index.d.ts +7 -0
- package/dist/danfe/index.js +2 -2
- package/dist/documents/index.d.ts +152 -34
- package/dist/documents/index.js +1103 -305
- package/dist/documents/index.js.map +1 -1
- package/dist/engine/index.d.ts +2 -2
- package/dist/http.d.ts +6 -5
- package/dist/http.js +4 -4
- package/dist/issuer/index.d.ts +10 -3
- package/dist/issuer/index.js +18 -3
- package/dist/issuer/index.js.map +1 -1
- package/dist/jobs.d.ts +5 -5
- package/dist/jobs.js +3 -3
- package/dist/manifest/index.d.ts +6 -4
- package/dist/manifest/index.js.map +1 -1
- package/dist/manifest/server.d.ts +5 -5
- package/dist/manifest/server.js +6 -6
- package/dist/notifications.d.ts +4 -4
- package/dist/notifications.js +2 -2
- package/dist/{service-Cz2O84Xr.d.ts → service-BCK9aXop.d.ts} +64 -5
- package/dist/sidecar/index.d.ts +38 -249
- package/dist/sidecar/index.js +29 -1
- package/dist/sidecar/index.js.map +1 -1
- package/dist/{types-B1b8LIWX.d.ts → types-BLdkww6G.d.ts} +1 -1
- package/dist/{types-DSYwap42.d.ts → types-Sk010Em2.d.ts} +2 -2
- package/dist/types-Z5E14EPw.d.ts +254 -0
- package/package.json +2 -1
- package/prisma/fiscal.prisma +50 -1
- package/prisma/migrations/20261118180000_fiscal_contingency_blocks/migration.sql +64 -0
- package/sidecar/README.md +52 -1
- package/sidecar/bin/check-platform.php +29 -0
- package/sidecar/extensions.json +12 -0
- package/sidecar/src/Http/Request.php +6 -1
- package/sidecar/src/Kernel.php +39 -1
- package/sidecar/src/Platform.php +84 -0
- package/src/danfe/render.ts +16 -5
- package/src/documents/contingency-gaps.ts +88 -0
- package/src/documents/contingency-pass.ts +157 -0
- package/src/documents/contingency-xml.ts +136 -0
- package/src/documents/contingency.ts +257 -0
- package/src/documents/errors.ts +8 -1
- package/src/documents/helpers.ts +3 -0
- package/src/documents/index.ts +23 -1
- package/src/documents/memory-blocks.ts +118 -0
- package/src/documents/memory.ts +6 -2
- package/src/documents/ports.ts +163 -13
- package/src/documents/service.ts +10 -0
- package/src/documents/sql-blocks.ts +202 -0
- package/src/documents/sql-store.ts +4 -3
- package/src/http.ts +1 -0
- package/src/issuer/sidecar.ts +27 -3
- package/src/manifest/index.ts +6 -4
- package/src/sidecar/index.ts +2 -0
- package/src/sidecar/platform.ts +55 -0
- package/dist/chunk-3E3NBXSW.js.map +0 -1
- package/dist/chunk-MGTROA7K.js.map +0 -1
- package/dist/chunk-TJCUO6D6.js.map +0 -1
- /package/dist/{chunk-HMTPJWXM.js.map → chunk-2JVTHJAU.js.map} +0 -0
- /package/dist/{chunk-G6QNU4FD.js.map → chunk-P7CRGZGO.js.map} +0 -0
package/dist/sidecar/index.d.ts
CHANGED
|
@@ -1,254 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
export { C as CancelBySubstitutionRequest, a as CancelRequest, b as CancelledDocument, c as ContingencyEntry, d as ContingencySignedDocument, e as Csc, D as DocumentModelPath, I as InutilizeRequest, f as InutilizedRange, g as IssueRequest, h as IssuedDocument, L as LinkPaymentRequest, i as LookedUpDocument, j as LookupRequest, R as RegisteredPaymentLink, S as SIDECAR_ERROR_CLASSES, k as SefazAnswer, l as SefazEnvironment, m as SidecarErrorBody, n as SidecarErrorClass, o as SidecarHealth, p as SignContingencyRequest, q as SigningCertificate, T as TransmitRequest } from '../types-Z5E14EPw.js';
|
|
2
|
+
import '../sale/index.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* What a PHP must carry to run the fiscal service outside its Docker image
|
|
6
|
+
* (FUT-4717: a desktop install bundles a static PHP): the minor version and
|
|
7
|
+
* the extensions, the same list as `sidecar/extensions.json`
|
|
8
|
+
* (`@12-apps/fiscal/sidecar/extensions.json`), which `sidecar/bin/check-platform.php`
|
|
9
|
+
* checks a PHP against and a PHPUnit test keeps equal to every `ext-*` the
|
|
10
|
+
* service and its locked libraries require. A test keeps this copy equal to
|
|
11
|
+
* the file.
|
|
6
12
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* service keeps nothing between calls, writes nothing to disk and never logs
|
|
10
|
-
* any of the three.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/** The path segment of a document model: `nfe` is model 55, `nfce` model 65. */
|
|
14
|
-
type DocumentModelPath = "nfe" | "nfce";
|
|
15
|
-
/** The SEFAZ environment (`tpAmb` 2 and 1). */
|
|
16
|
-
type SefazEnvironment = "homologacao" | "producao";
|
|
17
|
-
/** The A1 certificate, per call. */
|
|
18
|
-
interface SigningCertificate {
|
|
19
|
-
/** The `.pfx` (PKCS#12) bytes, base64. */
|
|
20
|
-
readonly pfxBase64: string;
|
|
21
|
-
readonly password: string;
|
|
22
|
-
}
|
|
23
|
-
/** The NFC-e's Código de Segurança do Contribuinte and its id. */
|
|
24
|
-
interface Csc {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
readonly token: string;
|
|
27
|
-
}
|
|
28
|
-
interface Authenticated {
|
|
29
|
-
readonly environment: SefazEnvironment;
|
|
30
|
-
readonly certificate: SigningCertificate;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* `POST /<model>/issue`: builds, signs and transmits. `csc` is required for
|
|
34
|
-
* `nfce` and refused for `nfe`.
|
|
35
|
-
*/
|
|
36
|
-
interface IssueRequest extends Authenticated {
|
|
37
|
-
readonly csc: Csc | null;
|
|
38
|
-
readonly document: SaleForDocument;
|
|
39
|
-
}
|
|
40
|
-
/** Why and since when the caixa issues offline (`dhCont`, `xJust`). */
|
|
41
|
-
interface ContingencyEntry {
|
|
42
|
-
/** ISO 8601 with the UTC offset. */
|
|
43
|
-
readonly since: string;
|
|
44
|
-
/** 15–256 characters. */
|
|
45
|
-
readonly reason: string;
|
|
46
|
-
}
|
|
47
|
-
/** `POST /nfce/sign-contingency`: builds and signs with `tpEmis = 9`; does NOT transmit. */
|
|
48
|
-
interface SignContingencyRequest extends IssueRequest {
|
|
49
|
-
readonly contingency: ContingencyEntry;
|
|
50
|
-
}
|
|
51
|
-
/** `POST /<model>/transmit`: an already signed XML (from `/nfce/sign-contingency`, say). */
|
|
52
|
-
interface TransmitRequest extends Authenticated {
|
|
53
|
-
readonly signedXml: string;
|
|
54
|
-
}
|
|
55
|
-
/** `POST /<model>/cancel`: the UF and the issuer come from the access key. */
|
|
56
|
-
interface CancelRequest extends Authenticated {
|
|
57
|
-
readonly accessKey: string;
|
|
58
|
-
/** The authorisation protocol (`nProt`). */
|
|
59
|
-
readonly protocol: string;
|
|
60
|
-
/** 15–255 characters. */
|
|
61
|
-
readonly reason: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* `POST /nfce/cancel-substitution`: the NFC-e "cancelamento por substituição"
|
|
65
|
-
* (event 110112) — an online NFC-e found authorised after its sale was issued
|
|
66
|
-
* again in contingency, cancelled naming the substitute. Answers as `/cancel`.
|
|
67
|
-
*/
|
|
68
|
-
interface CancelBySubstitutionRequest extends CancelRequest {
|
|
69
|
-
/** The contingency document that replaced it (`chNFeRef`). */
|
|
70
|
-
readonly substituteAccessKey: string;
|
|
71
|
-
}
|
|
72
|
-
/** `POST /<model>/link-payment`: the event 110300 for one transaction (NT 2026.006 v1.00). */
|
|
73
|
-
interface LinkPaymentRequest extends Authenticated {
|
|
74
|
-
readonly accessKey: string;
|
|
75
|
-
/** The authorisation protocol (`nProt`). */
|
|
76
|
-
readonly protocol: string;
|
|
77
|
-
/** `nSeqEvento`, 1–20: this document's how-manieth 110300. */
|
|
78
|
-
readonly sequence: number;
|
|
79
|
-
/** Exactly one entry: the event's schema carries a single `gPgto`. */
|
|
80
|
-
readonly payments: ReadonlyArray<{
|
|
81
|
-
readonly transactionId: string;
|
|
82
|
-
readonly meansCode: string;
|
|
83
|
-
readonly pspCnpjBase: string;
|
|
84
|
-
readonly receiverCnpj: string;
|
|
85
|
-
}>;
|
|
86
|
-
}
|
|
87
|
-
/** `POST /<model>/lookup`. */
|
|
88
|
-
interface LookupRequest extends Authenticated {
|
|
89
|
-
readonly accessKey: string;
|
|
90
|
-
}
|
|
91
|
-
/** `POST /inutilize`: voids a range of unused numbers. */
|
|
92
|
-
interface InutilizeRequest extends Authenticated {
|
|
93
|
-
readonly model: DocumentModelPath;
|
|
94
|
-
readonly uf: string;
|
|
95
|
-
readonly cnpj: string;
|
|
96
|
-
/** The year of the numbers, four digits. */
|
|
97
|
-
readonly year: number;
|
|
98
|
-
readonly series: number;
|
|
99
|
-
readonly from: number;
|
|
100
|
-
readonly to: number;
|
|
101
|
-
/** 15–255 characters. */
|
|
102
|
-
readonly reason: string;
|
|
103
|
-
}
|
|
104
|
-
/** What SEFAZ answered, as the service read it. */
|
|
105
|
-
interface SefazAnswer {
|
|
106
|
-
/** `cStat`. */
|
|
107
|
-
readonly statusCode: string;
|
|
108
|
-
/** `xMotivo`. */
|
|
109
|
-
readonly statusReason: string;
|
|
110
|
-
/** The SOAP body SEFAZ returned, verbatim. */
|
|
111
|
-
readonly sefazReply: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* `/issue` and `/transmit`: SEFAZ's final answer on the document.
|
|
115
|
-
*
|
|
116
|
-
* - `AUTHORIZED` (100, 120, 150).
|
|
117
|
-
* - `DENIED` (110, 301, 302, 303): a denial of use. The number is SPENT and
|
|
118
|
-
* the denial is kept like an authorisation (its `authorizedXml` carries the
|
|
119
|
-
* denial protocol); it is not a rejection, which leaves the number free.
|
|
120
|
-
*
|
|
121
|
-
* A retried call answers the same: SEFAZ's "already authorised" (204) and
|
|
122
|
-
* "already denied" (205), and a request sent with no answer, are settled by
|
|
123
|
-
* looking the key up, so a retry never turns an authorised document into an error.
|
|
124
|
-
*/
|
|
125
|
-
interface IssuedDocument extends SefazAnswer {
|
|
126
|
-
readonly status: "AUTHORIZED" | "DENIED";
|
|
127
|
-
readonly accessKey: string;
|
|
128
|
-
readonly protocol: string;
|
|
129
|
-
/** `dhRecbto` of the protocol. */
|
|
130
|
-
readonly authorizedAt: string;
|
|
131
|
-
readonly signedXml: string;
|
|
132
|
-
/** The `nfeProc`: the signed XML with its protocol (of authorisation or of denial), what is stored. */
|
|
133
|
-
readonly authorizedXml: string;
|
|
134
|
-
}
|
|
135
|
-
/** `/nfce/sign-contingency`. */
|
|
136
|
-
interface ContingencySignedDocument {
|
|
137
|
-
readonly status: "SIGNED";
|
|
138
|
-
readonly accessKey: string;
|
|
139
|
-
/** Carries `tpEmis = 9` and the QR code; transmit it later through `/nfce/transmit`. */
|
|
140
|
-
readonly signedXml: string;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* `/cancel`. A retried cancel (SEFAZ's 218 "already cancelled" or 573
|
|
144
|
-
* "duplicate event", or a cancel sent with no answer) is settled by looking
|
|
145
|
-
* the key up, and answers CANCELLED with what the lookup carries: the event's
|
|
146
|
-
* protocol and XML when SEFAZ returns them, `null` when it does not.
|
|
147
|
-
*/
|
|
148
|
-
interface CancelledDocument extends SefazAnswer {
|
|
149
|
-
readonly status: "CANCELLED";
|
|
150
|
-
readonly accessKey: string;
|
|
151
|
-
/** The event's protocol. */
|
|
152
|
-
readonly protocol: string | null;
|
|
153
|
-
readonly registeredAt: string | null;
|
|
154
|
-
/** The `procEventoNFe`. */
|
|
155
|
-
readonly eventXml: string | null;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* `/link-payment`: the event registered. On 573 "Duplicidade de Evento" the
|
|
159
|
-
* service looks the key up and answers the event SEFAZ already holds at that
|
|
160
|
-
* `nSeqEvento`, with its own XML and the transaction it carries — which may be
|
|
161
|
-
* another transaction than the one sent (`statusCode` "573" tells the two apart).
|
|
162
|
-
*/
|
|
163
|
-
interface RegisteredPaymentLink extends SefazAnswer {
|
|
164
|
-
readonly status: "REGISTERED";
|
|
165
|
-
readonly accessKey: string;
|
|
166
|
-
readonly protocol: string | null;
|
|
167
|
-
readonly registeredAt: string | null;
|
|
168
|
-
/** The `procEventoNFe`. */
|
|
169
|
-
readonly eventXml: string | null;
|
|
170
|
-
/** The `gPgto` SEFAZ registered at this `nSeqEvento`. */
|
|
171
|
-
readonly transaction: {
|
|
172
|
-
readonly transactionId: string;
|
|
173
|
-
readonly meansCode: string;
|
|
174
|
-
readonly pspCnpjBase: string;
|
|
175
|
-
readonly receiverCnpj: string;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
/** `/lookup`: what SEFAZ knows of the key. `NOT_FOUND` is an answer, not an error. */
|
|
179
|
-
interface LookedUpDocument extends SefazAnswer {
|
|
180
|
-
readonly status: "AUTHORIZED" | "CANCELLED" | "DENIED" | "NOT_FOUND";
|
|
181
|
-
readonly accessKey: string;
|
|
182
|
-
readonly protocol: string | null;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* `/inutilize`. A retried inutilização (563, "a request for the same range
|
|
186
|
-
* already exists") answers INUTILIZED too, with `protocol` and
|
|
187
|
-
* `inutilizationXml` `null`: the range is void at SEFAZ, and SEFAZ offers no
|
|
188
|
-
* query that would return the first protocol.
|
|
189
|
-
*/
|
|
190
|
-
interface InutilizedRange extends SefazAnswer {
|
|
191
|
-
readonly status: "INUTILIZED";
|
|
192
|
-
readonly protocol: string | null;
|
|
193
|
-
readonly registeredAt: string | null;
|
|
194
|
-
/** The signed request with its reply (`procInutNFe`). */
|
|
195
|
-
readonly inutilizationXml: string | null;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* How a failed call is classified — the issuer port's own classes:
|
|
13
|
+
* Launch it bound to the loopback only, with a token minted per launch and
|
|
14
|
+
* the image's safety settings as `-d` flags ({@link SIDECAR_PHP_LAUNCH_FLAGS}):
|
|
199
15
|
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
readonly
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* a document issued on or after 2027-01-01, which needs NT 2026.008's
|
|
227
|
-
* `vProdLiq`; `RETURN_ON_NFCE`: a return asked of an NFC-e, which has no
|
|
228
|
-
* return purpose; `RETURN_NEEDS_REFERENCE`: a return quoting no
|
|
229
|
-
* `referencedDocuments`); `null` otherwise.
|
|
230
|
-
*/
|
|
231
|
-
readonly code: string | null;
|
|
232
|
-
readonly message: string;
|
|
233
|
-
/** Per-field problems of an `INVALID` request. */
|
|
234
|
-
readonly details: readonly string[];
|
|
235
|
-
/** When the call got as far as building and signing: keep it, the key is now spoken for. */
|
|
236
|
-
readonly accessKey: string | null;
|
|
237
|
-
readonly signedXml: string | null;
|
|
238
|
-
readonly sefazReply: string | null;
|
|
239
|
-
/** The request went out and its outcome is still unknown: look the key up before sending it again. */
|
|
240
|
-
readonly outcomeUnknown: boolean;
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
/** `GET /health`. */
|
|
244
|
-
interface SidecarHealth {
|
|
245
|
-
readonly status: "ok";
|
|
246
|
-
/** The libraries the service runs, by name, with the version installed. */
|
|
247
|
-
readonly libraries: Readonly<Record<string, string>>;
|
|
248
|
-
/** The schema package the NF-e layout is validated against. */
|
|
249
|
-
readonly nfeSchemas: string;
|
|
250
|
-
/** Whether SEFAZ's server certificate is verified; `false` only with `FISCAL_SEFAZ_TLS_VERIFY=off`. */
|
|
251
|
-
readonly sefazTlsVerify: boolean;
|
|
252
|
-
}
|
|
16
|
+
* ```sh
|
|
17
|
+
* FISCAL_SIDECAR_TOKEN=<random, 32+ chars> php -d display_errors=0 -d log_errors=1 \
|
|
18
|
+
* -d zend.exception_ignore_args=1 -d zend.exception_string_param_max_len=0 -d file_uploads=0 \
|
|
19
|
+
* -S 127.0.0.1:<port> -t sidecar/public sidecar/public/index.php
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const SIDECAR_PHP_VERSION = "8.3";
|
|
23
|
+
declare const SIDECAR_PHP_EXTENSIONS: readonly ["curl", "dom", "filter", "json", "libxml", "mbstring", "openssl", "reflection", "simplexml", "soap", "zlib"];
|
|
24
|
+
type SidecarPhpExtension = (typeof SIDECAR_PHP_EXTENSIONS)[number];
|
|
25
|
+
/**
|
|
26
|
+
* What the image's `docker/php.ini` guarantees, which a bundled PHP gets only
|
|
27
|
+
* from its launch line (`extensions.json`'s `ini`): no error printed into a
|
|
28
|
+
* response (the issuer would read it as an unanswered call), a stack trace
|
|
29
|
+
* with no arguments (a password, a certificate, the launch token), no upload
|
|
30
|
+
* spooled to disk. `-d` flags, not `-c docker/php.ini`: that file logs to
|
|
31
|
+
* `/dev/stderr`, which a Windows desktop does not have.
|
|
32
|
+
*/
|
|
33
|
+
declare const SIDECAR_PHP_SETTINGS: {
|
|
34
|
+
readonly display_errors: "0";
|
|
35
|
+
readonly log_errors: "1";
|
|
36
|
+
readonly "zend.exception_ignore_args": "1";
|
|
37
|
+
readonly "zend.exception_string_param_max_len": "0";
|
|
38
|
+
readonly file_uploads: "0";
|
|
39
|
+
};
|
|
40
|
+
/** {@link SIDECAR_PHP_SETTINGS} as the argv a launcher puts before `-S` (and before `bin/check-platform.php`). */
|
|
41
|
+
declare const SIDECAR_PHP_LAUNCH_FLAGS: readonly string[];
|
|
253
42
|
|
|
254
|
-
export {
|
|
43
|
+
export { SIDECAR_PHP_EXTENSIONS, SIDECAR_PHP_LAUNCH_FLAGS, SIDECAR_PHP_SETTINGS, SIDECAR_PHP_VERSION, type SidecarPhpExtension };
|
package/dist/sidecar/index.js
CHANGED
|
@@ -2,7 +2,35 @@ import {
|
|
|
2
2
|
SIDECAR_ERROR_CLASSES
|
|
3
3
|
} from "../chunk-ZKWVKCGJ.js";
|
|
4
4
|
import "../chunk-7QVYU63E.js";
|
|
5
|
+
|
|
6
|
+
// src/sidecar/platform.ts
|
|
7
|
+
var SIDECAR_PHP_VERSION = "8.3";
|
|
8
|
+
var SIDECAR_PHP_EXTENSIONS = [
|
|
9
|
+
"curl",
|
|
10
|
+
"dom",
|
|
11
|
+
"filter",
|
|
12
|
+
"json",
|
|
13
|
+
"libxml",
|
|
14
|
+
"mbstring",
|
|
15
|
+
"openssl",
|
|
16
|
+
"reflection",
|
|
17
|
+
"simplexml",
|
|
18
|
+
"soap",
|
|
19
|
+
"zlib"
|
|
20
|
+
];
|
|
21
|
+
var SIDECAR_PHP_SETTINGS = {
|
|
22
|
+
display_errors: "0",
|
|
23
|
+
log_errors: "1",
|
|
24
|
+
"zend.exception_ignore_args": "1",
|
|
25
|
+
"zend.exception_string_param_max_len": "0",
|
|
26
|
+
file_uploads: "0"
|
|
27
|
+
};
|
|
28
|
+
var SIDECAR_PHP_LAUNCH_FLAGS = Object.entries(SIDECAR_PHP_SETTINGS).flatMap(([name, value]) => ["-d", `${name}=${value}`]);
|
|
5
29
|
export {
|
|
6
|
-
SIDECAR_ERROR_CLASSES
|
|
30
|
+
SIDECAR_ERROR_CLASSES,
|
|
31
|
+
SIDECAR_PHP_EXTENSIONS,
|
|
32
|
+
SIDECAR_PHP_LAUNCH_FLAGS,
|
|
33
|
+
SIDECAR_PHP_SETTINGS,
|
|
34
|
+
SIDECAR_PHP_VERSION
|
|
7
35
|
};
|
|
8
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/sidecar/platform.ts"],"sourcesContent":["/**\n * What a PHP must carry to run the fiscal service outside its Docker image\n * (FUT-4717: a desktop install bundles a static PHP): the minor version and\n * the extensions, the same list as `sidecar/extensions.json`\n * (`@12-apps/fiscal/sidecar/extensions.json`), which `sidecar/bin/check-platform.php`\n * checks a PHP against and a PHPUnit test keeps equal to every `ext-*` the\n * service and its locked libraries require. A test keeps this copy equal to\n * the file.\n *\n * Launch it bound to the loopback only, with a token minted per launch and\n * the image's safety settings as `-d` flags ({@link SIDECAR_PHP_LAUNCH_FLAGS}):\n *\n * ```sh\n * FISCAL_SIDECAR_TOKEN=<random, 32+ chars> php -d display_errors=0 -d log_errors=1 \\\n * -d zend.exception_ignore_args=1 -d zend.exception_string_param_max_len=0 -d file_uploads=0 \\\n * -S 127.0.0.1:<port> -t sidecar/public sidecar/public/index.php\n * ```\n */\n\nexport const SIDECAR_PHP_VERSION = \"8.3\";\n\nexport const SIDECAR_PHP_EXTENSIONS = [\n \"curl\",\n \"dom\",\n \"filter\",\n \"json\",\n \"libxml\",\n \"mbstring\",\n \"openssl\",\n \"reflection\",\n \"simplexml\",\n \"soap\",\n \"zlib\",\n] as const;\n\nexport type SidecarPhpExtension = (typeof SIDECAR_PHP_EXTENSIONS)[number];\n\n/**\n * What the image's `docker/php.ini` guarantees, which a bundled PHP gets only\n * from its launch line (`extensions.json`'s `ini`): no error printed into a\n * response (the issuer would read it as an unanswered call), a stack trace\n * with no arguments (a password, a certificate, the launch token), no upload\n * spooled to disk. `-d` flags, not `-c docker/php.ini`: that file logs to\n * `/dev/stderr`, which a Windows desktop does not have.\n */\nexport const SIDECAR_PHP_SETTINGS = {\n display_errors: \"0\",\n log_errors: \"1\",\n \"zend.exception_ignore_args\": \"1\",\n \"zend.exception_string_param_max_len\": \"0\",\n file_uploads: \"0\",\n} as const;\n\n/** {@link SIDECAR_PHP_SETTINGS} as the argv a launcher puts before `-S` (and before `bin/check-platform.php`). */\nexport const SIDECAR_PHP_LAUNCH_FLAGS: readonly string[] = Object.entries(SIDECAR_PHP_SETTINGS).flatMap(([name, value]) => [\"-d\", `${name}=${value}`]);\n"],"mappings":";;;;;;AAmBO,IAAM,sBAAsB;AAE5B,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAYO,IAAM,uBAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,8BAA8B;AAAA,EAC9B,uCAAuC;AAAA,EACvC,cAAc;AAChB;AAGO,IAAM,2BAA8C,OAAO,QAAQ,oBAAoB,EAAE,QAAQ,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;","names":[]}
|
|
@@ -244,4 +244,4 @@ interface TaxBreakdown {
|
|
|
244
244
|
readonly tablesVersion: string;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
export type { IbsMunRates as I, LineFigures as L, RatePeriod as R, SellerProfile as S, TaxRegime as T,
|
|
247
|
+
export type { IbsMunRates as I, LineFigures as L, RatePeriod as R, SellerProfile as S, TaxRegime as T, TaxInput as a, TaxBreakdown as b, RateTables as c, IbsSphereRates as d, IbsUfRates as e, IsoDate as f, LineSource as g, LineTax as h, RegimeEspecifico as i, RetainedIntermediationInput as j, ServiceChargeInput as k, TaxClass as l, TaxClassCode as m, TaxExclusions as n, TaxLineInput as o, TaxTreatment as p };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SaleForDocument, LinkedTransaction } from './sale/index.js';
|
|
2
|
-
import { SidecarErrorBody, SefazEnvironment, SigningCertificate, Csc, IssuedDocument, ContingencyEntry, ContingencySignedDocument, CancelledDocument, LookedUpDocument, RegisteredPaymentLink, InutilizedRange, SidecarHealth, SidecarErrorClass } from './
|
|
2
|
+
import { m as SidecarErrorBody, l as SefazEnvironment, q as SigningCertificate, e as Csc, h as IssuedDocument, c as ContingencyEntry, d as ContingencySignedDocument, b as CancelledDocument, i as LookedUpDocument, R as RegisteredPaymentLink, f as InutilizedRange, o as SidecarHealth, n as SidecarErrorClass } from './types-Z5E14EPw.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The Issuer port: what the document service asks of whoever talks to SEFAZ.
|
|
@@ -276,4 +276,4 @@ interface CancelOrReturnResult {
|
|
|
276
276
|
readonly failure: IssuerFailure | null;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
export { type CancelBySubstitutionCall as C, type
|
|
279
|
+
export { type CancelBySubstitutionCall as C, type DocumentTotals as D, type FiscalDocumentModel as F, type Issuer as I, type LinkPaymentCall as L, type NumberVoid as N, OWED_VOIDS as O, type SignContingencyCall as S, type TransmitCall as T, type CancelCall as a, type InutilizeCall as b, type IssueCall as c, type IssuerFailure as d, type IssuerOutcome as e, type LookupCall as f, type SigningMaterial as g, type FiscalDocumentStatus as h, type FiscalDocument as i, type CancelOrReturnInput as j, type CancelOrReturnResult as k, type FiscalDocumentEvent as l, modelPath as m, type DocumentEventKind as n, type SeriesKind as o, FISCAL_DOCUMENT_MODELS as p, FISCAL_DOCUMENT_STATUSES as q, isLive as r };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { SaleForDocument } from './sale/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The wire contract of the fiscal service (`sidecar/` in this package): a
|
|
5
|
+
* stateless HTTP door in front of sped-nfe. JSON in, JSON out.
|
|
6
|
+
*
|
|
7
|
+
* Stateless means every call carries what it needs: the signing certificate
|
|
8
|
+
* (an A1 `.pfx` as base64 and its password) and, for an NFC-e, the CSC. The
|
|
9
|
+
* service keeps nothing between calls, writes nothing to disk and never logs
|
|
10
|
+
* any of the three.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** The path segment of a document model: `nfe` is model 55, `nfce` model 65. */
|
|
14
|
+
type DocumentModelPath = "nfe" | "nfce";
|
|
15
|
+
/** The SEFAZ environment (`tpAmb` 2 and 1). */
|
|
16
|
+
type SefazEnvironment = "homologacao" | "producao";
|
|
17
|
+
/** The A1 certificate, per call. */
|
|
18
|
+
interface SigningCertificate {
|
|
19
|
+
/** The `.pfx` (PKCS#12) bytes, base64. */
|
|
20
|
+
readonly pfxBase64: string;
|
|
21
|
+
readonly password: string;
|
|
22
|
+
}
|
|
23
|
+
/** The NFC-e's Código de Segurança do Contribuinte and its id. */
|
|
24
|
+
interface Csc {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly token: string;
|
|
27
|
+
}
|
|
28
|
+
interface Authenticated {
|
|
29
|
+
readonly environment: SefazEnvironment;
|
|
30
|
+
readonly certificate: SigningCertificate;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `POST /<model>/issue`: builds, signs and transmits. `csc` is required for
|
|
34
|
+
* `nfce` and refused for `nfe`.
|
|
35
|
+
*/
|
|
36
|
+
interface IssueRequest extends Authenticated {
|
|
37
|
+
readonly csc: Csc | null;
|
|
38
|
+
readonly document: SaleForDocument;
|
|
39
|
+
}
|
|
40
|
+
/** Why and since when the caixa issues offline (`dhCont`, `xJust`). */
|
|
41
|
+
interface ContingencyEntry {
|
|
42
|
+
/** ISO 8601 with the UTC offset. */
|
|
43
|
+
readonly since: string;
|
|
44
|
+
/** 15–256 characters. */
|
|
45
|
+
readonly reason: string;
|
|
46
|
+
}
|
|
47
|
+
/** `POST /nfce/sign-contingency`: builds and signs with `tpEmis = 9`; does NOT transmit. */
|
|
48
|
+
interface SignContingencyRequest extends IssueRequest {
|
|
49
|
+
readonly contingency: ContingencyEntry;
|
|
50
|
+
}
|
|
51
|
+
/** `POST /<model>/transmit`: an already signed XML (from `/nfce/sign-contingency`, say). */
|
|
52
|
+
interface TransmitRequest extends Authenticated {
|
|
53
|
+
readonly signedXml: string;
|
|
54
|
+
}
|
|
55
|
+
/** `POST /<model>/cancel`: the UF and the issuer come from the access key. */
|
|
56
|
+
interface CancelRequest extends Authenticated {
|
|
57
|
+
readonly accessKey: string;
|
|
58
|
+
/** The authorisation protocol (`nProt`). */
|
|
59
|
+
readonly protocol: string;
|
|
60
|
+
/** 15–255 characters. */
|
|
61
|
+
readonly reason: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `POST /nfce/cancel-substitution`: the NFC-e "cancelamento por substituição"
|
|
65
|
+
* (event 110112) — an online NFC-e found authorised after its sale was issued
|
|
66
|
+
* again in contingency, cancelled naming the substitute. Answers as `/cancel`.
|
|
67
|
+
*/
|
|
68
|
+
interface CancelBySubstitutionRequest extends CancelRequest {
|
|
69
|
+
/** The contingency document that replaced it (`chNFeRef`). */
|
|
70
|
+
readonly substituteAccessKey: string;
|
|
71
|
+
}
|
|
72
|
+
/** `POST /<model>/link-payment`: the event 110300 for one transaction (NT 2026.006 v1.00). */
|
|
73
|
+
interface LinkPaymentRequest extends Authenticated {
|
|
74
|
+
readonly accessKey: string;
|
|
75
|
+
/** The authorisation protocol (`nProt`). */
|
|
76
|
+
readonly protocol: string;
|
|
77
|
+
/** `nSeqEvento`, 1–20: this document's how-manieth 110300. */
|
|
78
|
+
readonly sequence: number;
|
|
79
|
+
/** Exactly one entry: the event's schema carries a single `gPgto`. */
|
|
80
|
+
readonly payments: ReadonlyArray<{
|
|
81
|
+
readonly transactionId: string;
|
|
82
|
+
readonly meansCode: string;
|
|
83
|
+
readonly pspCnpjBase: string;
|
|
84
|
+
readonly receiverCnpj: string;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
/** `POST /<model>/lookup`. */
|
|
88
|
+
interface LookupRequest extends Authenticated {
|
|
89
|
+
readonly accessKey: string;
|
|
90
|
+
}
|
|
91
|
+
/** `POST /inutilize`: voids a range of unused numbers. */
|
|
92
|
+
interface InutilizeRequest extends Authenticated {
|
|
93
|
+
readonly model: DocumentModelPath;
|
|
94
|
+
readonly uf: string;
|
|
95
|
+
readonly cnpj: string;
|
|
96
|
+
/** The year of the numbers, four digits. */
|
|
97
|
+
readonly year: number;
|
|
98
|
+
readonly series: number;
|
|
99
|
+
readonly from: number;
|
|
100
|
+
readonly to: number;
|
|
101
|
+
/** 15–255 characters. */
|
|
102
|
+
readonly reason: string;
|
|
103
|
+
}
|
|
104
|
+
/** What SEFAZ answered, as the service read it. */
|
|
105
|
+
interface SefazAnswer {
|
|
106
|
+
/** `cStat`. */
|
|
107
|
+
readonly statusCode: string;
|
|
108
|
+
/** `xMotivo`. */
|
|
109
|
+
readonly statusReason: string;
|
|
110
|
+
/** The SOAP body SEFAZ returned, verbatim. */
|
|
111
|
+
readonly sefazReply: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* `/issue` and `/transmit`: SEFAZ's final answer on the document.
|
|
115
|
+
*
|
|
116
|
+
* - `AUTHORIZED` (100, 120, 150).
|
|
117
|
+
* - `DENIED` (110, 301, 302, 303): a denial of use. The number is SPENT and
|
|
118
|
+
* the denial is kept like an authorisation (its `authorizedXml` carries the
|
|
119
|
+
* denial protocol); it is not a rejection, which leaves the number free.
|
|
120
|
+
*
|
|
121
|
+
* A retried call answers the same: SEFAZ's "already authorised" (204) and
|
|
122
|
+
* "already denied" (205), and a request sent with no answer, are settled by
|
|
123
|
+
* looking the key up, so a retry never turns an authorised document into an error.
|
|
124
|
+
*/
|
|
125
|
+
interface IssuedDocument extends SefazAnswer {
|
|
126
|
+
readonly status: "AUTHORIZED" | "DENIED";
|
|
127
|
+
readonly accessKey: string;
|
|
128
|
+
readonly protocol: string;
|
|
129
|
+
/** `dhRecbto` of the protocol. */
|
|
130
|
+
readonly authorizedAt: string;
|
|
131
|
+
readonly signedXml: string;
|
|
132
|
+
/** The `nfeProc`: the signed XML with its protocol (of authorisation or of denial), what is stored. */
|
|
133
|
+
readonly authorizedXml: string;
|
|
134
|
+
}
|
|
135
|
+
/** `/nfce/sign-contingency`. */
|
|
136
|
+
interface ContingencySignedDocument {
|
|
137
|
+
readonly status: "SIGNED";
|
|
138
|
+
readonly accessKey: string;
|
|
139
|
+
/** Carries `tpEmis = 9` and the QR code; transmit it later through `/nfce/transmit`. */
|
|
140
|
+
readonly signedXml: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* `/cancel`. A retried cancel (SEFAZ's 218 "already cancelled" or 573
|
|
144
|
+
* "duplicate event", or a cancel sent with no answer) is settled by looking
|
|
145
|
+
* the key up, and answers CANCELLED with what the lookup carries: the event's
|
|
146
|
+
* protocol and XML when SEFAZ returns them, `null` when it does not.
|
|
147
|
+
*/
|
|
148
|
+
interface CancelledDocument extends SefazAnswer {
|
|
149
|
+
readonly status: "CANCELLED";
|
|
150
|
+
readonly accessKey: string;
|
|
151
|
+
/** The event's protocol. */
|
|
152
|
+
readonly protocol: string | null;
|
|
153
|
+
readonly registeredAt: string | null;
|
|
154
|
+
/** The `procEventoNFe`. */
|
|
155
|
+
readonly eventXml: string | null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* `/link-payment`: the event registered. On 573 "Duplicidade de Evento" the
|
|
159
|
+
* service looks the key up and answers the event SEFAZ already holds at that
|
|
160
|
+
* `nSeqEvento`, with its own XML and the transaction it carries — which may be
|
|
161
|
+
* another transaction than the one sent (`statusCode` "573" tells the two apart).
|
|
162
|
+
*/
|
|
163
|
+
interface RegisteredPaymentLink extends SefazAnswer {
|
|
164
|
+
readonly status: "REGISTERED";
|
|
165
|
+
readonly accessKey: string;
|
|
166
|
+
readonly protocol: string | null;
|
|
167
|
+
readonly registeredAt: string | null;
|
|
168
|
+
/** The `procEventoNFe`. */
|
|
169
|
+
readonly eventXml: string | null;
|
|
170
|
+
/** The `gPgto` SEFAZ registered at this `nSeqEvento`. */
|
|
171
|
+
readonly transaction: {
|
|
172
|
+
readonly transactionId: string;
|
|
173
|
+
readonly meansCode: string;
|
|
174
|
+
readonly pspCnpjBase: string;
|
|
175
|
+
readonly receiverCnpj: string;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** `/lookup`: what SEFAZ knows of the key. `NOT_FOUND` is an answer, not an error. */
|
|
179
|
+
interface LookedUpDocument extends SefazAnswer {
|
|
180
|
+
readonly status: "AUTHORIZED" | "CANCELLED" | "DENIED" | "NOT_FOUND";
|
|
181
|
+
readonly accessKey: string;
|
|
182
|
+
readonly protocol: string | null;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* `/inutilize`. A retried inutilização (563, "a request for the same range
|
|
186
|
+
* already exists") answers INUTILIZED too, with `protocol` and
|
|
187
|
+
* `inutilizationXml` `null`: the range is void at SEFAZ, and SEFAZ offers no
|
|
188
|
+
* query that would return the first protocol.
|
|
189
|
+
*/
|
|
190
|
+
interface InutilizedRange extends SefazAnswer {
|
|
191
|
+
readonly status: "INUTILIZED";
|
|
192
|
+
readonly protocol: string | null;
|
|
193
|
+
readonly registeredAt: string | null;
|
|
194
|
+
/** The signed request with its reply (`procInutNFe`). */
|
|
195
|
+
readonly inutilizationXml: string | null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* How a failed call is classified — the issuer port's own classes:
|
|
199
|
+
*
|
|
200
|
+
* - `REJECTED`: SEFAZ refused the document or the event; `code` is its `cStat`.
|
|
201
|
+
* The number is NOT spent (a denial is not an error: it answers `DENIED`).
|
|
202
|
+
* - `RETRYABLE`: try the same call again later. When `outcomeUnknown` is true
|
|
203
|
+
* the request went out and neither it nor the lookup that would settle it
|
|
204
|
+
* was answered: look the key up before sending it again.
|
|
205
|
+
* - `CONTINGENCY`: SEFAZ is unavailable. For an NFC-e being issued, nothing
|
|
206
|
+
* reached SEFAZ (or the lookup after an unanswered request could not reach
|
|
207
|
+
* it): go offline through `/nfce/sign-contingency`. For an NF-e (model 55)
|
|
208
|
+
* the service has no offline path (no SVC, no EPEC): treat it as RETRYABLE.
|
|
209
|
+
* - `AUTH`: the certificate is unreadable, the password wrong, the certificate
|
|
210
|
+
* expired, or SEFAZ refused it.
|
|
211
|
+
* - `INVALID`: the request itself is malformed (the schema, a missing CSC, an
|
|
212
|
+
* XML the layout refuses, a document the layout version cannot express).
|
|
213
|
+
* Fix the input; never retry it as is.
|
|
214
|
+
* - `INTERNAL`: a defect of the service, or a 4xx other than 403/408/429 from
|
|
215
|
+
* the verified SEFAZ host (a wrong web-service address). A retry would only repeat it.
|
|
216
|
+
*/
|
|
217
|
+
type SidecarErrorClass = "REJECTED" | "RETRYABLE" | "CONTINGENCY" | "AUTH" | "INVALID" | "INTERNAL";
|
|
218
|
+
declare const SIDECAR_ERROR_CLASSES: readonly SidecarErrorClass[];
|
|
219
|
+
/** The body of every non-2xx answer. */
|
|
220
|
+
interface SidecarErrorBody {
|
|
221
|
+
readonly error: {
|
|
222
|
+
readonly class: SidecarErrorClass;
|
|
223
|
+
/**
|
|
224
|
+
* The SEFAZ `cStat` when SEFAZ answered (always for `REJECTED`); for
|
|
225
|
+
* `INVALID`, a named code where one applies (`NT_2026_008_NOT_SUPPORTED`:
|
|
226
|
+
* a document issued on or after 2027-01-01, which needs NT 2026.008's
|
|
227
|
+
* `vProdLiq`; `RETURN_ON_NFCE`: a return asked of an NFC-e, which has no
|
|
228
|
+
* return purpose; `RETURN_NEEDS_REFERENCE`: a return quoting no
|
|
229
|
+
* `referencedDocuments`); `null` otherwise.
|
|
230
|
+
*/
|
|
231
|
+
readonly code: string | null;
|
|
232
|
+
readonly message: string;
|
|
233
|
+
/** Per-field problems of an `INVALID` request. */
|
|
234
|
+
readonly details: readonly string[];
|
|
235
|
+
/** When the call got as far as building and signing: keep it, the key is now spoken for. */
|
|
236
|
+
readonly accessKey: string | null;
|
|
237
|
+
readonly signedXml: string | null;
|
|
238
|
+
readonly sefazReply: string | null;
|
|
239
|
+
/** The request went out and its outcome is still unknown: look the key up before sending it again. */
|
|
240
|
+
readonly outcomeUnknown: boolean;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/** `GET /health`. */
|
|
244
|
+
interface SidecarHealth {
|
|
245
|
+
readonly status: "ok";
|
|
246
|
+
/** The libraries the service runs, by name, with the version installed. */
|
|
247
|
+
readonly libraries: Readonly<Record<string, string>>;
|
|
248
|
+
/** The schema package the NF-e layout is validated against. */
|
|
249
|
+
readonly nfeSchemas: string;
|
|
250
|
+
/** Whether SEFAZ's server certificate is verified; `false` only with `FISCAL_SEFAZ_TLS_VERIFY=off`. */
|
|
251
|
+
readonly sefazTlsVerify: boolean;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export { type CancelBySubstitutionRequest as C, type DocumentModelPath as D, type InutilizeRequest as I, type LinkPaymentRequest as L, type RegisteredPaymentLink as R, SIDECAR_ERROR_CLASSES as S, type TransmitRequest as T, type CancelRequest as a, type CancelledDocument as b, type ContingencyEntry as c, type ContingencySignedDocument as d, type Csc as e, type InutilizedRange as f, type IssueRequest as g, type IssuedDocument as h, type LookedUpDocument as i, type LookupRequest as j, type SefazAnswer as k, type SefazEnvironment as l, type SidecarErrorBody as m, type SidecarErrorClass as n, type SidecarHealth as o, type SignContingencyRequest as p, type SigningCertificate as q };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/fiscal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "Brazilian consumption-tax machinery and fiscal documents for any host that sells. The IBS/CBS engine (./engine): a pure function from priced lines, the seller's regime, the destination, the exclusions, a versioned rate table and the date of the supply to a per-line and per-order breakdown. The neutral sale document (./sale) and a stateless HTTP service over sped-nfe that issues NF-e and NFC-e, shipped with its Dockerfile in sidecar/ (./sidecar types its wire contract). The fiscal document module (./documents): the state machine, the per-series number counters, the issuer port and its sidecar adapter (./issuer), the signing identity, and the DANFE NFC-e as ESC/POS-ready lines (./danfe). Implements @12-apps/wiring (./manifest): db, http, jobs, permissions.",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"types": "./dist/sidecar/index.d.ts",
|
|
58
58
|
"default": "./dist/sidecar/index.js"
|
|
59
59
|
},
|
|
60
|
+
"./sidecar/extensions.json": "./sidecar/extensions.json",
|
|
60
61
|
"./sidecar/schema/*": "./sidecar/schema/*",
|
|
61
62
|
"./tables/*": "./tables/*",
|
|
62
63
|
"./package.json": "./package.json"
|