@ekwo-ai/core 0.11.0 → 0.12.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.
Files changed (48) hide show
  1. package/README.md +5 -0
  2. package/dist/books/document-pdf.d.ts +87 -0
  3. package/dist/books/document-pdf.d.ts.map +1 -0
  4. package/dist/books/document-pdf.js +222 -0
  5. package/dist/books/document-pdf.js.map +1 -0
  6. package/dist/books/index.d.ts +1 -0
  7. package/dist/books/index.d.ts.map +1 -1
  8. package/dist/books/index.js +1 -0
  9. package/dist/books/index.js.map +1 -1
  10. package/dist/einvoicing/directory.d.ts +38 -0
  11. package/dist/einvoicing/directory.d.ts.map +1 -0
  12. package/dist/einvoicing/directory.js +121 -0
  13. package/dist/einvoicing/directory.js.map +1 -0
  14. package/dist/einvoicing/formats.d.ts +65 -0
  15. package/dist/einvoicing/formats.d.ts.map +1 -0
  16. package/dist/einvoicing/formats.js +380 -0
  17. package/dist/einvoicing/formats.js.map +1 -0
  18. package/dist/einvoicing/index.d.ts +11 -0
  19. package/dist/einvoicing/index.d.ts.map +1 -0
  20. package/dist/einvoicing/index.js +11 -0
  21. package/dist/einvoicing/index.js.map +1 -0
  22. package/dist/einvoicing/issue.d.ts +98 -0
  23. package/dist/einvoicing/issue.d.ts.map +1 -0
  24. package/dist/einvoicing/issue.js +398 -0
  25. package/dist/einvoicing/issue.js.map +1 -0
  26. package/dist/einvoicing/transport.d.ts +130 -0
  27. package/dist/einvoicing/transport.d.ts.map +1 -0
  28. package/dist/einvoicing/transport.js +60 -0
  29. package/dist/einvoicing/transport.js.map +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/proofs/filing-proofs.d.ts +93 -0
  35. package/dist/proofs/filing-proofs.d.ts.map +1 -0
  36. package/dist/proofs/filing-proofs.js +161 -0
  37. package/dist/proofs/filing-proofs.js.map +1 -0
  38. package/dist/proofs/index.d.ts +7 -0
  39. package/dist/proofs/index.d.ts.map +1 -0
  40. package/dist/proofs/index.js +7 -0
  41. package/dist/proofs/index.js.map +1 -0
  42. package/dist/proofs/opentimestamps.d.ts +185 -0
  43. package/dist/proofs/opentimestamps.d.ts.map +1 -0
  44. package/dist/proofs/opentimestamps.js +508 -0
  45. package/dist/proofs/opentimestamps.js.map +1 -0
  46. package/dist/schema.d.ts +1 -1
  47. package/dist/schema.js +1 -1
  48. package/package.json +14 -11
@@ -0,0 +1,398 @@
1
+ /**
2
+ * Issuing the electronic invoice of a posted sale, for every surface at once.
3
+ *
4
+ * The MCP server and the command line call these four functions with their
5
+ * own `Backend`, which acts as the person signed in:
6
+ *
7
+ * - `validateEinvoice()` writes the file and says what is wrong with it,
8
+ * and records nothing. A question, asked as often as one likes.
9
+ * - `issueEinvoice()` writes it and keeps it — the exact text, its
10
+ * checksum, the rules it breaks — through `einvoicing.record_issue()`;
11
+ * and, given a transport and asked to, sends it: a transmission recorded
12
+ * as prepared, the file handed over, and what the transport answered
13
+ * recorded beside it, in its own words.
14
+ * - `einvoiceStatus()` is what is known of a document: its files, its
15
+ * sendings and every answer; given the transport that sent it, it asks
16
+ * that transport again and records what it says.
17
+ * - `listEinvoiceTransmissions()` is every sending of a company, or of one
18
+ * document.
19
+ *
20
+ * The rules that matter are the database's: a document that is not a posted
21
+ * sale, a profile that is not the pack's, a file that breaks a rule, a second
22
+ * sending of a document already on its way, a state that would move backwards
23
+ * — each is refused there, by name, for this code and for any other client.
24
+ * What is here is what only a program can do: run the brick, compute a
25
+ * checksum, call a transport.
26
+ */
27
+ import { createHash } from 'node:crypto';
28
+ import { BooksError } from '../books/backend.js';
29
+ import { onlyVisible } from '../books/shared.js';
30
+ import { einvoiceFormat } from './formats.js';
31
+ import { CLOSED_STATES, TransportError, } from './transport.js';
32
+ const SCHEMA = 'einvoicing';
33
+ /** What the bricks read of `document_header`, every date and amount as the text the database holds. */
34
+ const HEADER = [
35
+ 'document_id', 'company_id', 'doc_type', 'state', 'number', 'language',
36
+ 'document_date::text', 'due_date::text', 'delivery_date::text', 'tax_point_date::text',
37
+ 'currency_code', 'amount_untaxed::text', 'amount_tax::text', 'amount_total::text', 'amount_paid::text',
38
+ 'amount_residual::text', 'payment_terms', 'payment_means_code', 'payment_reference', 'payee_iban', 'payee_bic',
39
+ 'buyer_reference', 'order_reference', 'contract_reference', 'project_reference', 'note',
40
+ 'seller_name', 'seller_legal_name', 'seller_legal_form', 'seller_vat_number', 'seller_registration_number',
41
+ 'seller_address_line1', 'seller_address_line2', 'seller_postal_code', 'seller_city', 'seller_country',
42
+ 'seller_region', 'seller_email', 'seller_phone',
43
+ 'buyer_name', 'buyer_vat_number', 'buyer_registration_number', 'buyer_address_line1', 'buyer_address_line2',
44
+ 'buyer_postal_code', 'buyer_city', 'buyer_country', 'buyer_region', 'buyer_email',
45
+ 'delivery_address_line1', 'delivery_postal_code', 'delivery_city', 'delivery_country',
46
+ 'seller_peppol_scheme', 'seller_peppol_identifier', 'buyer_peppol_scheme', 'buyer_peppol_identifier',
47
+ 'einvoice_profile',
48
+ ];
49
+ /** What the bricks read of `document_line_items`. */
50
+ const LINES = [
51
+ 'sequence', 'line_type', 'item_name', 'item_description', 'seller_item_identifier',
52
+ 'quantity::text', 'unit_code', 'unit_price::text', 'discount_percent::text', 'unit_price_includes_tax',
53
+ 'amount_untaxed::text', 'vat_category', 'vat_rate::text', 'tax_exemption_code',
54
+ ];
55
+ /** What the bricks read of `document_tax_summary`. */
56
+ const TAXES = [
57
+ 'tax_code', 'vat_category', 'tax_rate::text', 'base_amount::text', 'tax_charged::text',
58
+ 'exemption_code', 'exemption_reason',
59
+ ];
60
+ /** An issue as it is handed back: everything but the file itself, which is asked for by name. */
61
+ const ISSUE = [
62
+ 'id', 'company_id', 'document_id', 'sequence', 'profile', 'brick', 'specification', 'filename',
63
+ 'media_type', 'byte_size', 'checksum', 'violations', 'sendable', 'issued_at', 'issued_by',
64
+ ];
65
+ const TRANSMISSION = [
66
+ 'id', 'company_id', 'document_id', 'issue_id', 'sequence', 'channel', 'service', 'reference',
67
+ 'state', 'state_at', 'message', 'prepared_at', 'prepared_by',
68
+ ];
69
+ const EVENT = [
70
+ 'transmission_id', 'sequence', 'state', 'reference', 'message', 'detail', 'occurred_at', 'recorded_at',
71
+ 'recorded_by',
72
+ ];
73
+ /** SHA-256 of a file as UTF-8, in lower-case hexadecimal: what the database computes again. */
74
+ export function einvoiceChecksum(content) {
75
+ return createHash('sha256').update(content, 'utf8').digest('hex');
76
+ }
77
+ /** The three views of one document, and the invoice it credits where it is a credit note. */
78
+ export async function readEinvoiceSource(backend, documentId) {
79
+ const header = onlyVisible(await backend.select({
80
+ table: 'document_header',
81
+ columns: HEADER,
82
+ where: [{ column: 'document_id', op: 'eq', value: documentId }],
83
+ }), `document ${documentId}`);
84
+ const [lines, taxes, documents] = await Promise.all([
85
+ backend.select({
86
+ table: 'document_line_items',
87
+ columns: LINES,
88
+ where: [{ column: 'document_id', op: 'eq', value: documentId }],
89
+ order: [{ column: 'sequence' }],
90
+ }),
91
+ backend.select({
92
+ table: 'document_tax_summary',
93
+ columns: TAXES,
94
+ where: [{ column: 'document_id', op: 'eq', value: documentId }],
95
+ order: [{ column: 'tax_code' }],
96
+ }),
97
+ backend.select({
98
+ table: 'documents',
99
+ columns: ['reversed_document_id'],
100
+ where: [{ column: 'id', op: 'eq', value: documentId }],
101
+ }),
102
+ ]);
103
+ let preceding = null;
104
+ const credited = documents[0]?.reversed_document_id ?? null;
105
+ if (credited !== null) {
106
+ const [original] = await backend.select({
107
+ table: 'documents',
108
+ columns: ['number', 'document_date::text'],
109
+ where: [{ column: 'id', op: 'eq', value: credited }],
110
+ });
111
+ if (original?.number)
112
+ preceding = { number: original.number, issueDate: original.document_date ?? null };
113
+ }
114
+ return { header, lines, taxes, preceding };
115
+ }
116
+ function addressOf(header, side) {
117
+ const scheme = header[`${side}_peppol_scheme`];
118
+ const id = header[`${side}_peppol_identifier`];
119
+ return typeof scheme === 'string' && typeof id === 'string' ? { scheme, id } : null;
120
+ }
121
+ /**
122
+ * Writes the file of a posted sale, in the profile of its company's country
123
+ * pack, and says which rules it breaks. Records nothing.
124
+ */
125
+ export async function produceEinvoice(backend, documentId) {
126
+ const source = await readEinvoiceSource(backend, documentId);
127
+ const { header } = source;
128
+ const what = `${String(header['doc_type'])} ${String(header['number'] ?? documentId)}`;
129
+ if (header['doc_type'] !== 'sale_invoice' && header['doc_type'] !== 'sale_credit_note') {
130
+ throw new BooksError(`document_not_a_sale: ${what} is not a sale invoice or a sale credit note, and only a sale is issued electronically by its seller.`);
131
+ }
132
+ if (header['state'] !== 'posted') {
133
+ throw new BooksError(`document_not_posted: ${what} is ${String(header['state'])}, and only a posted document is issued: post it first, and the file says what the books say.`, { hint: 'post_document (ekwo post <document>) books it; --dry-run shows the entry first.' });
134
+ }
135
+ const format = einvoiceFormat(header['einvoice_profile']);
136
+ const written = format.write(source);
137
+ return {
138
+ document_id: documentId,
139
+ company_id: String(header['company_id']),
140
+ doc_type: String(header['doc_type']),
141
+ number: header['number'] ?? null,
142
+ profile: format.profile,
143
+ brick: format.brick,
144
+ syntax: format.syntax,
145
+ specification: format.specification,
146
+ filename: written.filename,
147
+ media_type: format.mediaType,
148
+ checksum: einvoiceChecksum(written.content),
149
+ byte_size: Buffer.byteLength(written.content, 'utf8'),
150
+ violations: written.violations,
151
+ sendable: written.violations.length === 0,
152
+ content: written.content,
153
+ sender: addressOf(header, 'seller'),
154
+ recipient: addressOf(header, 'buyer'),
155
+ };
156
+ }
157
+ /** The file a posted sale would be issued as, and every rule it breaks. Nothing is recorded. */
158
+ export async function validateEinvoice(backend, args) {
159
+ const produced = await produceEinvoice(backend, args.document_id);
160
+ const { content, sender, recipient, ...rest } = produced;
161
+ return {
162
+ ...rest,
163
+ sender,
164
+ recipient,
165
+ ...(args.include_file === true ? { file: content } : {}),
166
+ note: produced.sendable
167
+ ? 'The file breaks no rule this release re-reads. Nothing was recorded: einvoicing_issue keeps it and sends it.'
168
+ : 'The file breaks the rules listed, and a file that breaks one is not sent. They are completed in the books — an address, a due date, a reference — not in the file. Nothing was recorded.',
169
+ };
170
+ }
171
+ /** Every column of an issue but the file. */
172
+ function withoutContent(issue) {
173
+ return Object.fromEntries(Object.entries(issue).filter(([key]) => key !== 'content'));
174
+ }
175
+ async function rpcOne(backend, fn, args) {
176
+ const [row] = await backend.rpc(fn, args, SCHEMA);
177
+ if (row === undefined)
178
+ throw new BooksError(`einvoicing_no_answer: ${SCHEMA}.${fn} answered nothing`);
179
+ return row;
180
+ }
181
+ async function recordOutcome(backend, transmissionId, outcome) {
182
+ return rpcOne(backend, 'record_transmission_outcome', {
183
+ p_transmission_id: transmissionId,
184
+ p_state: outcome.state,
185
+ p_reference: outcome.reference ?? null,
186
+ p_message: outcome.message ?? null,
187
+ p_detail: outcome.detail === undefined || outcome.detail === null ? null : outcome.detail,
188
+ p_occurred_at: outcome.occurredAt ?? null,
189
+ });
190
+ }
191
+ /**
192
+ * Hands one recorded file to a transport, and records what it answered — or
193
+ * that it could not take the file, in the words of the error.
194
+ */
195
+ async function sendThrough(backend, transport, produced, issue) {
196
+ const transmission = await rpcOne(backend, 'record_transmission', {
197
+ p_issue_id: issue['id'],
198
+ p_channel: transport.channel,
199
+ p_service: transport.service,
200
+ });
201
+ const file = {
202
+ filename: produced.filename,
203
+ mediaType: produced.media_type,
204
+ content: produced.content,
205
+ checksum: produced.checksum,
206
+ profile: produced.profile,
207
+ };
208
+ let answer;
209
+ try {
210
+ answer = await transport.send(file, {
211
+ companyId: produced.company_id,
212
+ documentId: produced.document_id,
213
+ documentNumber: produced.number,
214
+ docType: produced.doc_type,
215
+ issueId: String(issue['id']),
216
+ transmissionId: String(transmission['id']),
217
+ sender: produced.sender,
218
+ recipient: produced.recipient,
219
+ });
220
+ }
221
+ catch (error) {
222
+ const refused = error instanceof TransportError ? error : null;
223
+ return recordOutcome(backend, String(transmission['id']), {
224
+ state: refused?.state ?? 'failed',
225
+ message: error instanceof Error ? error.message : String(error),
226
+ detail: refused?.detail ?? null,
227
+ });
228
+ }
229
+ return recordOutcome(backend, String(transmission['id']), {
230
+ state: answer.state ?? 'submitted',
231
+ reference: answer.reference,
232
+ message: answer.message ?? null,
233
+ detail: answer.detail ?? null,
234
+ });
235
+ }
236
+ /**
237
+ * Writes the file of a posted sale and keeps it; sends it too when asked and
238
+ * given a transport. The same file twice is one issue, and a document already
239
+ * on its way is refused by the database rather than sent twice.
240
+ */
241
+ export async function issueEinvoice(backend, args, transport) {
242
+ if (args.send === true && transport === undefined) {
243
+ throw new BooksError('no_transport: sending was asked for and no transport is configured. The file can be issued and kept without one; sending it needs one — the directory transport writes it to a folder.', { hint: 'ekwo einvoice issue <document> --send --to <directory>; for the MCP server, EKWO_EINVOICE_DIRECTORY.' });
244
+ }
245
+ const produced = await produceEinvoice(backend, args.document_id);
246
+ const issue = await rpcOne(backend, 'record_issue', {
247
+ p_document_id: produced.document_id,
248
+ p_profile: produced.profile,
249
+ p_brick: produced.brick,
250
+ p_specification: produced.specification,
251
+ p_filename: produced.filename,
252
+ p_media_type: produced.media_type,
253
+ p_content: produced.content,
254
+ p_checksum: produced.checksum,
255
+ p_violations: produced.violations,
256
+ });
257
+ const transmission = args.send === true && transport !== undefined ? await sendThrough(backend, transport, produced, issue) : null;
258
+ return {
259
+ document_id: produced.document_id,
260
+ number: produced.number,
261
+ doc_type: produced.doc_type,
262
+ issue: withoutContent(issue),
263
+ violations: produced.violations,
264
+ sendable: produced.sendable,
265
+ transmission,
266
+ ...(args.include_file === true ? { file: produced.content } : {}),
267
+ note: transmission === null
268
+ ? produced.sendable
269
+ ? 'Issued and kept, and nothing has left. Sending it is einvoicing_issue with send, or ekwo einvoice issue --send.'
270
+ : 'Kept as it was written, with the rules it breaks; a file that breaks one is not sent. Complete the books and issue it again: the new file is a new issue.'
271
+ : CLOSED_STATES.includes(transmission['state'])
272
+ ? `The sending is ${String(transmission['state'])}: ${String(transmission['message'] ?? 'no word came with it')}. It is recorded, and the document may be sent again.`
273
+ : `Handed over, as ${String(transmission['reference'])}. A reference is not a delivery: einvoicing_status asks again.`,
274
+ };
275
+ }
276
+ /**
277
+ * Everything known of the electronic invoice of one document: its files,
278
+ * every sending and every answer. Asked to refresh and given the transport the
279
+ * open sending went through, asks it again and records the answer.
280
+ */
281
+ export async function einvoiceStatus(backend, args, transport) {
282
+ const transmissionsOf = () => backend.select({
283
+ schema: SCHEMA,
284
+ table: 'transmissions',
285
+ columns: TRANSMISSION,
286
+ where: [{ column: 'document_id', op: 'eq', value: args.document_id }],
287
+ order: [{ column: 'sequence' }],
288
+ });
289
+ let transmissions = await transmissionsOf();
290
+ const open = transmissions.find((t) => !CLOSED_STATES.includes(t['state']));
291
+ let asked = null;
292
+ if (args.refresh === true && open !== undefined) {
293
+ if (transport === undefined) {
294
+ throw new BooksError('no_transport: asking again was requested and no transport is configured to ask.');
295
+ }
296
+ if (open['channel'] !== transport.channel || (open['service'] ?? null) !== transport.service || open['reference'] === null) {
297
+ asked = {
298
+ asked: false,
299
+ why: open['reference'] === null
300
+ ? 'the open sending has no reference yet, so there is nothing to ask about'
301
+ : `the open sending went through ${String(open['service'] ?? open['channel'])}, and the transport configured here is ${String(transport.service ?? transport.channel)}`,
302
+ };
303
+ }
304
+ else {
305
+ let outcome;
306
+ try {
307
+ outcome = await transport.status(String(open['reference']));
308
+ }
309
+ catch (error) {
310
+ // The transport could not be asked: nothing about the sending changed.
311
+ asked = { asked: true, answered: false, message: error instanceof Error ? error.message : String(error) };
312
+ outcome = { state: open['state'] };
313
+ }
314
+ if (asked === null) {
315
+ await recordOutcome(backend, String(open['id']), {
316
+ state: outcome.state,
317
+ message: outcome.message ?? null,
318
+ detail: outcome.detail ?? null,
319
+ occurredAt: outcome.occurredAt ?? null,
320
+ });
321
+ asked = { asked: true, answered: true, state: outcome.state, message: outcome.message ?? null };
322
+ transmissions = await transmissionsOf();
323
+ }
324
+ }
325
+ }
326
+ const [issues, events] = await Promise.all([
327
+ backend.select({
328
+ schema: SCHEMA,
329
+ table: 'issues',
330
+ columns: ISSUE,
331
+ where: [{ column: 'document_id', op: 'eq', value: args.document_id }],
332
+ order: [{ column: 'sequence' }],
333
+ }),
334
+ transmissions.length === 0
335
+ ? Promise.resolve([])
336
+ : backend.select({
337
+ schema: SCHEMA,
338
+ table: 'transmission_events',
339
+ columns: EVENT,
340
+ where: [{ column: 'transmission_id', op: 'in', value: transmissions.map((t) => String(t['id'])) }],
341
+ order: [{ column: 'recorded_at' }, { column: 'sequence' }],
342
+ }),
343
+ ]);
344
+ const current = transmissions[transmissions.length - 1] ?? null;
345
+ return {
346
+ document_id: args.document_id,
347
+ issues,
348
+ transmissions: transmissions.map((t) => ({ ...t, events: events.filter((e) => e['transmission_id'] === t['id']) })),
349
+ state: current === null ? (issues.length === 0 ? 'not_issued' : 'issued') : current['state'],
350
+ ...(asked === null ? {} : { refresh: asked }),
351
+ };
352
+ }
353
+ /** Every sending of a company, or of one of its documents, the latest first, with the file each one sent. */
354
+ export async function listEinvoiceTransmissions(backend, args) {
355
+ const where = [{ column: 'company_id', op: 'eq', value: args.company_id }];
356
+ if (args.document_id !== undefined)
357
+ where.push({ column: 'document_id', op: 'eq', value: args.document_id });
358
+ if (args.state !== undefined)
359
+ where.push({ column: 'state', op: 'eq', value: args.state });
360
+ const transmissions = await backend.select({
361
+ schema: SCHEMA,
362
+ table: 'transmissions',
363
+ columns: TRANSMISSION,
364
+ where,
365
+ order: [{ column: 'prepared_at', ascending: false }, { column: 'sequence', ascending: false }],
366
+ limit: args.limit ?? 100,
367
+ });
368
+ const issueIds = [...new Set(transmissions.map((t) => String(t['issue_id'])))];
369
+ const documentIds = [...new Set(transmissions.map((t) => String(t['document_id'])))];
370
+ const [issues, documents] = await Promise.all([
371
+ issueIds.length === 0
372
+ ? Promise.resolve([])
373
+ : backend.select({
374
+ schema: SCHEMA,
375
+ table: 'issues',
376
+ columns: ['id', 'profile', 'filename', 'checksum', 'sequence'],
377
+ where: [{ column: 'id', op: 'in', value: issueIds }],
378
+ }),
379
+ documentIds.length === 0
380
+ ? Promise.resolve([])
381
+ : backend.select({
382
+ table: 'documents',
383
+ columns: ['id', 'doc_type', 'number'],
384
+ where: [{ column: 'id', op: 'in', value: documentIds }],
385
+ }),
386
+ ]);
387
+ const issueById = new Map(issues.map((issue) => [issue['id'], issue]));
388
+ const documentById = new Map(documents.map((document) => [document['id'], document]));
389
+ return {
390
+ transmissions: transmissions.map((t) => ({
391
+ ...t,
392
+ document: documentById.get(t['document_id']) ?? null,
393
+ file: issueById.get(t['issue_id']) ?? null,
394
+ })),
395
+ count: transmissions.length,
396
+ };
397
+ }
398
+ //# sourceMappingURL=issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue.js","sourceRoot":"","sources":["../../src/einvoicing/issue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAA0B,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAA+C,MAAM,cAAc,CAAC;AAC3F,OAAO,EACL,aAAa,EACb,cAAc,GAMf,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,GAAG,YAAY,CAAC;AAE5B,uGAAuG;AACvG,MAAM,MAAM,GAAG;IACb,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;IACtE,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,sBAAsB;IACtF,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB;IACtG,uBAAuB,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,WAAW;IAC9G,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB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;IACtF,OAAO;QACL,aAAa,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,GAAG,CAAC;YACJ,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,IAAI;YACpD,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,IAAI;SAC3C,CAAC,CAAC;QACH,KAAK,EAAE,aAAa,CAAC,MAAM;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The contract every way of sending an electronic invoice answers to.
3
+ *
4
+ * A file leaves a company through somebody: a folder another program reads, a
5
+ * Peppol access point, a national platform, a person uploading it on a portal.
6
+ * None of them is named in this repository, and none of them needs to be. What
7
+ * the books need from each is four questions, asked the same way whoever
8
+ * answers them:
9
+ *
10
+ * - `send(file, metadata)` — take this file; what do you call it now? The
11
+ * answer is a reference, and **a reference is not a delivery**: it says
12
+ * the transport took the file, nothing more. A transport that knows more
13
+ * at once may say so in `state`.
14
+ * - `status(reference)` — where is it? An answer in the closed vocabulary of
15
+ * `einvoicing.transmission_state`, with the service's own words beside it,
16
+ * untouched.
17
+ * - `receive()` — what has arrived for us? The files as they came. Turning
18
+ * one into a purchase draft is the reader's job, and not this version's.
19
+ * - `lookup(address)` — can this electronic address be reached at all?
20
+ * `null` where the transport cannot tell, which is an answer and not a
21
+ * failure.
22
+ *
23
+ * **No credential crosses this interface.** A transport is built by whoever
24
+ * operates it, with what it needs, outside the books; the books record the
25
+ * channel in two words, the service by name and what came back. Nothing here
26
+ * is ever written to the database but those.
27
+ *
28
+ * This file is the seam for the transports that are not written yet — an
29
+ * access point, a platform, the operated service — and the directory transport
30
+ * beside it is the one that ships: it writes the file to a folder and says so,
31
+ * with no network at all.
32
+ */
33
+ /** The states a transport may answer with: everything but `prepared`, which is where a sending starts. */
34
+ export declare const TRANSMISSION_STATES: readonly ["prepared", "submitted", "accepted_by_access_point", "delivered", "rejected", "failed"];
35
+ export type TransmissionState = (typeof TRANSMISSION_STATES)[number];
36
+ /** The states that close a sending. A closed sending does not move; the document is sent again by a new one. */
37
+ export declare const CLOSED_STATES: readonly TransmissionState[];
38
+ /** `self`: the company takes the file where it goes itself. `service`: somebody operates the transmission. */
39
+ export type TransmissionChannel = 'self' | 'service';
40
+ /** An electronic address (EN 16931 BT-34, BT-49): a scheme of the EAS list and a value. */
41
+ export interface ElectronicAddress {
42
+ scheme: string;
43
+ id: string;
44
+ }
45
+ /** The file, exactly as it was issued and kept. */
46
+ export interface EinvoiceFile {
47
+ filename: string;
48
+ mediaType: string;
49
+ /** The text of the file. Every format this version issues is text. */
50
+ content: string;
51
+ /** SHA-256 of `content` as UTF-8, lower-case hexadecimal — what the database checked. */
52
+ checksum: string;
53
+ /** The profile of the country pack it was written in. */
54
+ profile: string;
55
+ }
56
+ /** What a transport is told beside the file. Facts of the books, never a credential. */
57
+ export interface SendMetadata {
58
+ companyId: string;
59
+ documentId: string;
60
+ documentNumber: string | null;
61
+ docType: string;
62
+ issueId: string;
63
+ transmissionId: string;
64
+ /** BT-34, where the books hold one. */
65
+ sender: ElectronicAddress | null;
66
+ /** BT-49, where the books hold one. */
67
+ recipient: ElectronicAddress | null;
68
+ }
69
+ /** What `send()` answers: the transport's name for the sending, and how far it knows it went. */
70
+ export interface Submission {
71
+ reference: string;
72
+ /** `submitted` where left out: taking a file is all a reference proves. */
73
+ state?: Exclude<TransmissionState, 'prepared' | 'failed'>;
74
+ /** The service's words, verbatim, where it said any. */
75
+ message?: string | null;
76
+ /** Its structured answer, as it came. */
77
+ detail?: unknown;
78
+ }
79
+ /** What `status()` answers. */
80
+ export interface TransmissionOutcome {
81
+ state: Exclude<TransmissionState, 'prepared'>;
82
+ message?: string | null;
83
+ detail?: unknown;
84
+ /** When the service says it happened, ISO 8601, where it says. */
85
+ occurredAt?: string | null;
86
+ }
87
+ /** A file that arrived, as it came. */
88
+ export interface ReceivedFile {
89
+ reference: string;
90
+ filename: string;
91
+ mediaType: string;
92
+ content: string;
93
+ receivedAt: string | null;
94
+ }
95
+ /** Whether an address can be reached: `null` where the transport cannot tell. */
96
+ export interface Reachability {
97
+ reachable: boolean | null;
98
+ message?: string | null;
99
+ }
100
+ /**
101
+ * One way of sending. Implemented beside the books, never inside them: an
102
+ * access point's adapter lives in its own package or in the operated service,
103
+ * and is handed to `issueEinvoice()` by whoever built it.
104
+ */
105
+ export interface EinvoiceTransport {
106
+ /** How the act is recorded: `self` or `service`. */
107
+ readonly channel: TransmissionChannel;
108
+ /** The service by name, recorded as free text. Required where `channel` is `service`. */
109
+ readonly service: string | null;
110
+ send(file: EinvoiceFile, metadata: SendMetadata): Promise<Submission>;
111
+ status(reference: string): Promise<TransmissionOutcome>;
112
+ receive(): Promise<ReceivedFile[]>;
113
+ lookup(address: ElectronicAddress): Promise<Reachability>;
114
+ }
115
+ /**
116
+ * What a transport throws when it did not take the file. `failed` — it could
117
+ * not hand it over — is recorded with this message, verbatim, and so is
118
+ * anything else a transport throws. `rejected` is for a service that read the
119
+ * file and refused it at the door, in words worth keeping.
120
+ */
121
+ export declare class TransportError extends Error {
122
+ name: string;
123
+ readonly state: 'failed' | 'rejected';
124
+ readonly detail: unknown;
125
+ constructor(message: string, options?: {
126
+ state?: 'failed' | 'rejected';
127
+ detail?: unknown;
128
+ });
129
+ }
130
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/einvoicing/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,mGAOtB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,gHAAgH;AAChH,eAAO,MAAM,aAAa,EAAE,S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A;KAAO;CAK/F"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The contract every way of sending an electronic invoice answers to.
3
+ *
4
+ * A file leaves a company through somebody: a folder another program reads, a
5
+ * Peppol access point, a national platform, a person uploading it on a portal.
6
+ * None of them is named in this repository, and none of them needs to be. What
7
+ * the books need from each is four questions, asked the same way whoever
8
+ * answers them:
9
+ *
10
+ * - `send(file, metadata)` — take this file; what do you call it now? The
11
+ * answer is a reference, and **a reference is not a delivery**: it says
12
+ * the transport took the file, nothing more. A transport that knows more
13
+ * at once may say so in `state`.
14
+ * - `status(reference)` — where is it? An answer in the closed vocabulary of
15
+ * `einvoicing.transmission_state`, with the service's own words beside it,
16
+ * untouched.
17
+ * - `receive()` — what has arrived for us? The files as they came. Turning
18
+ * one into a purchase draft is the reader's job, and not this version's.
19
+ * - `lookup(address)` — can this electronic address be reached at all?
20
+ * `null` where the transport cannot tell, which is an answer and not a
21
+ * failure.
22
+ *
23
+ * **No credential crosses this interface.** A transport is built by whoever
24
+ * operates it, with what it needs, outside the books; the books record the
25
+ * channel in two words, the service by name and what came back. Nothing here
26
+ * is ever written to the database but those.
27
+ *
28
+ * This file is the seam for the transports that are not written yet — an
29
+ * access point, a platform, the operated service — and the directory transport
30
+ * beside it is the one that ships: it writes the file to a folder and says so,
31
+ * with no network at all.
32
+ */
33
+ /** The states a transport may answer with: everything but `prepared`, which is where a sending starts. */
34
+ export const TRANSMISSION_STATES = [
35
+ 'prepared',
36
+ 'submitted',
37
+ 'accepted_by_access_point',
38
+ 'delivered',
39
+ 'rejected',
40
+ 'failed',
41
+ ];
42
+ /** The states that close a sending. A closed sending does not move; the document is sent again by a new one. */
43
+ export const CLOSED_STATES = ['delivered', 'rejected', 'failed'];
44
+ /**
45
+ * What a transport throws when it did not take the file. `failed` — it could
46
+ * not hand it over — is recorded with this message, verbatim, and so is
47
+ * anything else a transport throws. `rejected` is for a service that read the
48
+ * file and refused it at the door, in words worth keeping.
49
+ */
50
+ export class TransportError extends Error {
51
+ name = 'TransportError';
52
+ state;
53
+ detail;
54
+ constructor(message, options = {}) {
55
+ super(message);
56
+ this.state = options.state ?? 'failed';
57
+ this.detail = options.detail;
58
+ }
59
+ }
60
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/einvoicing/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,0GAA0G;AAC1G,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,WAAW;IACX,0BAA0B;IAC1B,WAAW;IACX,UAAU;IACV,QAAQ;CACA,CAAC;AAGX,gHAAgH;AAChH,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAwF/F;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,GAAG,gBAAgB,CAAC;IACxB,KAAK,CAAwB;IAC7B,MAAM,CAAU;IAEzB,YAAY,OAAe,EAAE,UAA+D,EAAE;QAC5F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -12,4 +12,6 @@ export { isRefusalState, socleCode } from './refusal.js';
12
12
  export { IDENTITY_ENV, isServiceRoleKey, serviceRoleRefusal, type KeySlot } from './identity.js';
13
13
  export { REGISTER_INVITE_ENV, REGISTRATION_INVITATION, registerInviteSilenced, registrationInvitation, relayableInvitation, type EnvironmentVariables, type RegistrationInvitation, } from './registration.js';
14
14
  export * from './books/index.js';
15
+ export * from './proofs/index.js';
16
+ export * from './einvoicing/index.js';
15
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -12,4 +12,6 @@ export { isRefusalState, socleCode } from './refusal.js';
12
12
  export { IDENTITY_ENV, isServiceRoleKey, serviceRoleRefusal } from './identity.js';
13
13
  export { REGISTER_INVITE_ENV, REGISTRATION_INVITATION, registerInviteSilenced, registrationInvitation, relayableInvitation, } from './registration.js';
14
14
  export * from './books/index.js';
15
+ export * from './proofs/index.js';
16
+ export * from './einvoicing/index.js';
15
17
  //# sourceMappingURL=index.js.map