@timbro/invoices 0.8.3 → 0.9.0-next.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 (102) hide show
  1. package/README.md +95 -258
  2. package/dist/admin.d.ts +44 -0
  3. package/dist/admin.d.ts.map +1 -0
  4. package/dist/admin.js +16 -0
  5. package/dist/certificate-custody-import.d.ts +4 -2
  6. package/dist/certificate-custody-import.d.ts.map +1 -1
  7. package/dist/certificate-custody-import.js +1 -1
  8. package/dist/collection.d.ts +1 -1
  9. package/dist/collection.js +4 -4
  10. package/dist/fiscal-engine-runtime.manifest.json +16 -16
  11. package/dist/fiscal-engine-runtime.provenance.json +17 -17
  12. package/dist/generated/hosted/index.d.ts +4 -0
  13. package/dist/generated/hosted/index.d.ts.map +1 -0
  14. package/dist/generated/hosted/index.js +3 -0
  15. package/dist/generated/hosted/sdk.gen.d.ts +106 -0
  16. package/dist/generated/hosted/sdk.gen.d.ts.map +1 -0
  17. package/dist/generated/hosted/sdk.gen.js +1049 -0
  18. package/dist/generated/hosted/types.gen.d.ts +2425 -0
  19. package/dist/generated/hosted/types.gen.d.ts.map +1 -0
  20. package/dist/generated/hosted/types.gen.js +2 -0
  21. package/dist/generated/hosted/zod.gen.d.ts +1772 -0
  22. package/dist/generated/hosted/zod.gen.d.ts.map +1 -0
  23. package/dist/generated/hosted/zod.gen.js +2269 -0
  24. package/dist/generated/index.d.ts +3 -3
  25. package/dist/generated/index.d.ts.map +1 -1
  26. package/dist/generated/index.js +2 -2
  27. package/dist/generated/invoice-api-contract.d.ts +6348 -0
  28. package/dist/generated/invoice-api-contract.d.ts.map +1 -0
  29. package/dist/generated/invoice-api-contract.js +11004 -0
  30. package/dist/generated/problem-catalog.d.ts.map +1 -1
  31. package/dist/generated/problem-catalog.js +6 -3
  32. package/dist/generated/sdk.gen.d.ts +70 -38
  33. package/dist/generated/sdk.gen.d.ts.map +1 -1
  34. package/dist/generated/sdk.gen.js +1261 -251
  35. package/dist/generated/types.gen.d.ts +4349 -2686
  36. package/dist/generated/types.gen.d.ts.map +1 -1
  37. package/dist/generated/zod.gen.d.ts +53875 -22747
  38. package/dist/generated/zod.gen.d.ts.map +1 -1
  39. package/dist/generated/zod.gen.js +5730 -665
  40. package/dist/generated-operation-client.d.ts +1 -0
  41. package/dist/generated-operation-client.d.ts.map +1 -1
  42. package/dist/generated-operation-client.js +3 -2
  43. package/dist/generated-problem.d.ts +1 -1
  44. package/dist/generated-problem.d.ts.map +1 -1
  45. package/dist/generated-problem.js +4 -4
  46. package/dist/index.d.ts +8 -37
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +2 -12
  49. package/dist/{fiscal-error.d.ts → invoice-error.d.ts} +10 -9
  50. package/dist/invoice-error.d.ts.map +1 -0
  51. package/dist/{fiscal-error.js → invoice-error.js} +7 -4
  52. package/dist/invoice-hosted-controls.d.ts +62 -0
  53. package/dist/invoice-hosted-controls.d.ts.map +1 -0
  54. package/dist/invoice-hosted-controls.js +188 -0
  55. package/dist/invoice-receipt.d.ts +10 -0
  56. package/dist/invoice-receipt.d.ts.map +1 -0
  57. package/dist/invoice-receipt.js +49 -0
  58. package/dist/invoice-replacement.d.ts +8 -0
  59. package/dist/invoice-replacement.d.ts.map +1 -0
  60. package/dist/invoice-replacement.js +18 -0
  61. package/dist/invoice.d.ts +94 -0
  62. package/dist/invoice.d.ts.map +1 -0
  63. package/dist/invoice.js +251 -0
  64. package/dist/printed-representation.d.ts +0 -1
  65. package/dist/printed-representation.d.ts.map +1 -1
  66. package/dist/printed-representation.js +3 -3
  67. package/dist/problem-contract.d.ts +14 -117
  68. package/dist/problem-contract.d.ts.map +1 -1
  69. package/dist/public-case.d.ts +1 -1
  70. package/dist/received-documents.d.ts +13 -12
  71. package/dist/received-documents.d.ts.map +1 -1
  72. package/dist/received-documents.js +26 -20
  73. package/dist/source-connection.d.ts +5 -5
  74. package/dist/source-connection.d.ts.map +1 -1
  75. package/dist/source-connection.js +8 -9
  76. package/dist/stamp-server-http-transport.js +6 -6
  77. package/dist/timbro-client.d.ts +5 -37
  78. package/dist/timbro-client.d.ts.map +1 -1
  79. package/dist/timbro-client.js +4 -20
  80. package/dist/timbro_fiscal_engine_bg.wasm +0 -0
  81. package/dist/transport-contract.d.ts +1 -1
  82. package/dist/transport-contract.d.ts.map +1 -1
  83. package/dist/webhook-delivery.js +1 -1
  84. package/dist/webhook-event.d.ts +124 -842
  85. package/dist/webhook-event.d.ts.map +1 -1
  86. package/dist/webhook-event.js +3 -1
  87. package/dist/webhook-registration.d.ts +1 -2
  88. package/dist/webhook-registration.d.ts.map +1 -1
  89. package/dist/webhook-registration.js +1 -2
  90. package/dist/webhook-replay.d.ts +1 -2
  91. package/dist/webhook-replay.d.ts.map +1 -1
  92. package/dist/webhook-replay.js +3 -4
  93. package/dist/workspace.d.ts.map +1 -1
  94. package/dist/workspace.js +2 -2
  95. package/package.json +26 -16
  96. package/dist/fiscal-delivery.d.ts +0 -12
  97. package/dist/fiscal-delivery.d.ts.map +0 -1
  98. package/dist/fiscal-delivery.js +0 -45
  99. package/dist/fiscal-error.d.ts.map +0 -1
  100. package/dist/fiscal-receipt.d.ts +0 -19
  101. package/dist/fiscal-receipt.d.ts.map +0 -1
  102. package/dist/fiscal-receipt.js +0 -66
@@ -1,9 +1,8 @@
1
1
  import { createArtifactHeaderReader } from "./artifact-headers.js";
2
- import { downloadSourceReceivedDocumentSignedXml, getSourceReceivedDocument, listSourceReceivedDocuments, respondToReceivedDocument as respondToReceivedDocumentOperation, } from "./generated/index.js";
3
- import { throwGeneratedProblem } from "./generated-problem.js";
4
- import { toPublicCase } from "./public-case.js";
2
+ import { downloadSourceReceivedDocumentXml, getSourceReceivedDocument, listSourceReceivedDocuments, respondToReceivedDocument as respondToReceivedDocumentOperation, } from "./generated/index.js";
3
+ import { isExpectedNotFoundProblem, throwGeneratedProblem } from "./generated-problem.js";
5
4
  import { digestSha256Hex } from "./sha256.js";
6
- export async function listReceivedDocumentResources(client, command = {}) {
5
+ export async function listReceivedDocuments(client, command = {}) {
7
6
  const response = await listSourceReceivedDocuments({
8
7
  client,
9
8
  query: {
@@ -18,43 +17,50 @@ export async function listReceivedDocumentResources(client, command = {}) {
18
17
  if (response.status !== 200) {
19
18
  throwGeneratedProblem(response, "Received document listing failed");
20
19
  }
21
- return toPublicCase(response.body);
20
+ return response.body;
22
21
  }
23
- export async function getReceivedDocumentResource(client, fiscalReceptionId, signal) {
24
- validateReceptionId(fiscalReceptionId);
22
+ export async function retrieveReceivedDocument(client, receivedDocumentId, signal) {
23
+ validateReceivedDocumentId(receivedDocumentId);
25
24
  const response = await getSourceReceivedDocument({
26
25
  client,
27
- path: { fiscal_reception_id: fiscalReceptionId },
26
+ path: { receivedDocumentId },
28
27
  ...(signal === undefined ? {} : { signal }),
29
28
  });
30
29
  if (response.status !== 200) {
30
+ if (isExpectedNotFoundProblem(response, "received_document_not_found", "Received document lookup failed")) {
31
+ return;
32
+ }
31
33
  throwGeneratedProblem(response, "Received document lookup failed");
32
34
  }
33
- return toPublicCase(response.body);
35
+ return response.body;
34
36
  }
35
- export async function respondToReceivedDocument(client, fiscalReceptionId, responseBody, signal) {
36
- validateReceptionId(fiscalReceptionId);
37
+ export async function respondToReceivedDocument(client, receivedDocumentId, responseBody, signal) {
38
+ validateReceivedDocumentId(receivedDocumentId);
37
39
  const response = await respondToReceivedDocumentOperation({
38
40
  client,
39
- path: { fiscal_reception_id: fiscalReceptionId },
41
+ path: { receivedDocumentId },
40
42
  body: responseBody,
41
43
  ...(signal === undefined ? {} : { signal }),
42
44
  });
43
45
  if (response.status !== 200) {
44
46
  throwGeneratedProblem(response, "Received document response failed");
45
47
  }
46
- return toPublicCase(response.body);
48
+ return response.body;
47
49
  }
48
- export async function downloadReceivedDocumentSignedDocument(client, fiscalReceptionId, signal) {
49
- validateReceptionId(fiscalReceptionId);
50
- const response = await downloadSourceReceivedDocumentSignedXml({
50
+ export async function downloadReceivedDocument(client, receivedDocumentId, signal) {
51
+ validateReceivedDocumentId(receivedDocumentId);
52
+ const response = await downloadSourceReceivedDocumentXml({
51
53
  client,
52
- path: { fiscal_reception_id: fiscalReceptionId },
54
+ path: { receivedDocumentId },
53
55
  ...(signal === undefined ? {} : { signal }),
54
56
  });
55
57
  if (response.status !== 200) {
56
58
  throwGeneratedProblem(response, "Received document download failed");
57
59
  }
60
+ return verifyReceivedDocumentXmlDownload(response, receivedDocumentId);
61
+ }
62
+ export async function verifyReceivedDocumentXmlDownload(response, receivedDocumentId) {
63
+ validateReceivedDocumentId(receivedDocumentId);
58
64
  if (!(response.body instanceof Uint8Array)) {
59
65
  throw new TypeError("Timbro returned a non-binary received document");
60
66
  }
@@ -73,11 +79,11 @@ export async function downloadReceivedDocumentSignedDocument(client, fiscalRecep
73
79
  byteLength,
74
80
  contentSha256,
75
81
  mediaType: "application/xml",
76
- fiscalReceptionId,
82
+ receivedDocumentId,
77
83
  };
78
84
  }
79
- function validateReceptionId(value) {
85
+ function validateReceivedDocumentId(value) {
80
86
  if (value.trim() === "") {
81
- throw new TypeError("fiscalReceptionId must not be blank");
87
+ throw new TypeError("receivedDocumentId must not be blank");
82
88
  }
83
89
  }
@@ -1,5 +1,5 @@
1
1
  import type { HostedFiscalTenant } from "./fiscal-operation.ts";
2
- import { type CompleteActivationVerificationRequest, type HostedSourceCredentialResponse } from "./generated/index.ts";
2
+ import { type CompleteActivationVerificationRequest, type HostedInvoiceCredentialEnvironment, type HostedInvoiceCredentialResponse } from "./generated/index.ts";
3
3
  import type { Client } from "./generated-operation-client.ts";
4
4
  import { type ReadonlyCamelCase } from "./public-case.ts";
5
5
  export type SourceConnectionActivationVerificationCommand = {
@@ -8,11 +8,11 @@ export type SourceConnectionActivationVerificationCommand = {
8
8
  readonly signal?: AbortSignal;
9
9
  };
10
10
  export declare function completeSourceConnectionActivationVerificationResource(client: Client, command: SourceConnectionActivationVerificationCommand): Promise<void>;
11
- export type HostedSandboxSourceCredentialIssueCommand = {
11
+ export type HostedInvoiceCredentialIssueCommand = {
12
12
  readonly hosted: Pick<HostedFiscalTenant, "checkoutTenantId">;
13
- readonly environment?: HostedFiscalTenant["environment"];
13
+ readonly environment: HostedInvoiceCredentialEnvironment;
14
14
  readonly signal?: AbortSignal;
15
15
  };
16
- export type HostedSandboxSourceCredential = ReadonlyCamelCase<HostedSourceCredentialResponse>;
17
- export declare function issueHostedSandboxSourceCredentialResource(client: Client, command: HostedSandboxSourceCredentialIssueCommand): Promise<HostedSandboxSourceCredential>;
16
+ export type HostedInvoiceCredential = ReadonlyCamelCase<HostedInvoiceCredentialResponse>;
17
+ export declare function issueHostedInvoiceCredentialResource(client: Client, command: HostedInvoiceCredentialIssueCommand): Promise<HostedInvoiceCredential>;
18
18
  //# sourceMappingURL=source-connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-connection.d.ts","sourceRoot":"","sources":["../src/source-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,KAAK,qCAAqC,EAE1C,KAAK,8BAA8B,EAEpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,KAAK,iBAAiB,EAAgB,MAAM,kBAAkB,CAAC;AAExE,MAAM,MAAM,6CAA6C,GAAG;IAC1D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,qCAAqC,CAAC;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,CAAC;AAEF,wBAAsB,sDAAsD,CAC1E,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,6CAA6C,GACrD,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,MAAM,MAAM,yCAAyC,GAAG;IACtD,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC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AC,+BAA+B,CAAC,CAAC;AAEzF,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC,uBAAuB,CAAC,CAgBlC"}
@@ -1,4 +1,4 @@
1
- import { completeSourceConnectionActivationVerification, issueHostedSandboxSourceCredential, } from "./generated/index.js";
1
+ import { completeSourceConnectionActivationVerification, issueHostedInvoiceCredential, } from "./generated/index.js";
2
2
  import { throwGeneratedProblem } from "./generated-problem.js";
3
3
  import { toPublicCase } from "./public-case.js";
4
4
  export async function completeSourceConnectionActivationVerificationResource(client, command) {
@@ -15,21 +15,20 @@ export async function completeSourceConnectionActivationVerificationResource(cli
15
15
  throwGeneratedProblem(response, "Source connection activation verification failed");
16
16
  }
17
17
  }
18
- export async function issueHostedSandboxSourceCredentialResource(client, command) {
18
+ export async function issueHostedInvoiceCredentialResource(client, command) {
19
19
  if (command.hosted.checkoutTenantId.trim() === "") {
20
20
  throw new TypeError("hosted.checkoutTenantId must not be blank");
21
21
  }
22
- const environment = command.environment ?? "sandbox";
23
- if (environment !== "sandbox") {
24
- throw new TypeError("environment must be sandbox");
25
- }
26
- const response = await issueHostedSandboxSourceCredential({
22
+ const response = await issueHostedInvoiceCredential({
27
23
  client,
28
- body: { checkout_tenant_id: command.hosted.checkoutTenantId, environment },
24
+ body: {
25
+ checkout_tenant_id: command.hosted.checkoutTenantId,
26
+ environment: command.environment,
27
+ },
29
28
  ...(command.signal === undefined ? {} : { signal: command.signal }),
30
29
  });
31
30
  if (response.status !== 201) {
32
- throwGeneratedProblem(response, "Sandbox Source credential issuance failed");
31
+ throwGeneratedProblem(response, "Hosted invoice credential issuance failed");
33
32
  }
34
33
  return toPublicCase(response.body);
35
34
  }
@@ -1,4 +1,4 @@
1
- import { FiscalError } from "./fiscal-error.js";
1
+ import { InvoiceError } from "./invoice-error.js";
2
2
  const CONTENT_TYPE_HEADER = "content-type";
3
3
  const JSON_MEDIA_TYPE = "application/json";
4
4
  const DECIMAL_INTEGER_PATTERN = /^\d+$/;
@@ -29,8 +29,8 @@ export function createStampServerHttpTransport(options) {
29
29
  }
30
30
  catch (cause) {
31
31
  if (cause instanceof ResponseBodyTooLarge) {
32
- // biome-ignore lint/style/useErrorCause: FiscalError already exposes the bounded transport failure detail.
33
- throw new FiscalError(cause.message, { failure: "server_processing" }, { cause });
32
+ // biome-ignore lint/style/useErrorCause: InvoiceError already exposes the bounded transport failure detail.
33
+ throw new InvoiceError(cause.message, { failure: "server_processing" }, { cause });
34
34
  }
35
35
  throw describeTransportFailure(cause, request.signal, url);
36
36
  }
@@ -83,12 +83,12 @@ function callerHeaders(headers) {
83
83
  }
84
84
  function describeTransportFailure(cause, signal, url) {
85
85
  if (signal?.aborted === true && signal.reason?.name === "TimeoutError") {
86
- return new FiscalError(`the request to ${url} timed out`, { failure: "timeout" }, { cause });
86
+ return new InvoiceError(`the request to ${url} timed out`, { failure: "timeout" }, { cause });
87
87
  }
88
88
  if (signal?.aborted === true) {
89
- return new FiscalError(`the request to ${url} was cancelled`, { failure: "cancelled" }, { cause });
89
+ return new InvoiceError(`the request to ${url} was cancelled`, { failure: "cancelled" }, { cause });
90
90
  }
91
- return new FiscalError(`the request to ${url} could not reach Timbro`, { failure: "connectivity" }, { cause });
91
+ return new InvoiceError(`the request to ${url} could not reach Timbro`, { failure: "connectivity" }, { cause });
92
92
  }
93
93
  async function decodeResponseBody(response, maxBinaryResponseBytes) {
94
94
  if (response.status === 204 || response.status === 205) {
@@ -1,16 +1,14 @@
1
1
  import { type CertificateCustodyImportCommand, type CertificateCustodyImportResult } from "./certificate-custody-import.ts";
2
2
  import { type CertificateCustodyReadiness } from "./certificate-custody-readiness.ts";
3
- import { type FiscalDeliveryCreateCommand } from "./fiscal-delivery.ts";
4
3
  import { type FiscalNumberingReadiness } from "./fiscal-numbering-readiness.ts";
5
4
  import type { FiscalOperationResource } from "./fiscal-operation.ts";
6
5
  import { type FiscalDocumentIssueCommand, type FiscalDocumentListCommand, type FiscalDocumentPage, type HostedFiscalTenant } from "./fiscal-operation.ts";
7
6
  import { type FiscalOperationTimingReport } from "./fiscal-operation-timing.ts";
8
- import { type FiscalReceiptCommand, type FiscalReceiptReference, type FiscalReceiptResource } from "./fiscal-receipt.ts";
9
- import type { FiscalDeliveryResource, WebhookDelivery, WebhookDeliveryPage } from "./generated/index.ts";
7
+ import type { WebhookDelivery, WebhookDeliveryPage } from "./generated/index.ts";
8
+ import { type TimbroInvoices } from "./invoice.ts";
10
9
  import { type PrintedRepresentationDownload } from "./printed-representation.ts";
11
- import { type CommercialResponse, type ReceivedDocumentListCommand, type ReceivedDocumentPage, type ReceivedDocumentResource, type ReceivedDocumentSignedDocumentDownload } from "./received-documents.ts";
12
10
  import { type SignedDocumentDownload } from "./signed-document.ts";
13
- import { type HostedSandboxSourceCredential, type HostedSandboxSourceCredentialIssueCommand, type SourceConnectionActivationVerificationCommand } from "./source-connection.ts";
11
+ import { type HostedInvoiceCredential, type HostedInvoiceCredentialIssueCommand, type SourceConnectionActivationVerificationCommand } from "./source-connection.ts";
14
12
  import { type StampServerBearerTokenProvider } from "./stamp-server-http-transport.ts";
15
13
  import { type WebhookDeliveryListCommand } from "./webhook-delivery.ts";
16
14
  import type { DeliveredWebhookEvent } from "./webhook-event.ts";
@@ -34,11 +32,8 @@ export type TimbroClientAuthentication = {
34
32
  readonly token: StampServerBearerTokenProvider;
35
33
  };
36
34
  export type TimbroClient = {
35
+ readonly invoices: TimbroInvoices["invoices"];
37
36
  readonly fiscalDocuments: {
38
- readonly shareReceipt: (command: {
39
- readonly fiscalOperationId: string;
40
- readonly signal?: AbortSignal;
41
- }) => Promise<FiscalReceiptReference>;
42
37
  readonly issue: (command: FiscalDocumentIssueCommand) => Promise<FiscalOperationResource>;
43
38
  readonly get: (command: {
44
39
  readonly fiscalOperationId: string;
@@ -79,36 +74,9 @@ export type TimbroClient = {
79
74
  readonly signal?: AbortSignal;
80
75
  }) => Promise<PrintedRepresentationDownload>;
81
76
  };
82
- readonly fiscalReceipts: {
83
- readonly get: (command: FiscalReceiptCommand) => Promise<FiscalReceiptResource | undefined>;
84
- readonly downloadPrintedRepresentation: (command: FiscalReceiptCommand) => Promise<PrintedRepresentationDownload>;
85
- };
86
- readonly fiscalDeliveries: {
87
- readonly create: (command: FiscalDeliveryCreateCommand) => Promise<FiscalDeliveryResource>;
88
- readonly get: (command: {
89
- readonly deliveryId: string;
90
- readonly signal?: AbortSignal;
91
- }) => Promise<FiscalDeliveryResource | undefined>;
92
- };
93
- readonly receivedDocuments: {
94
- readonly list: (command?: ReceivedDocumentListCommand) => Promise<ReceivedDocumentPage>;
95
- readonly get: (command: {
96
- readonly fiscalReceptionId: string;
97
- readonly signal?: AbortSignal;
98
- }) => Promise<ReceivedDocumentResource>;
99
- readonly respond: (command: {
100
- readonly fiscalReceptionId: string;
101
- readonly response: CommercialResponse;
102
- readonly signal?: AbortSignal;
103
- }) => Promise<ReceivedDocumentResource>;
104
- readonly downloadSignedDocument: (command: {
105
- readonly fiscalReceptionId: string;
106
- readonly signal?: AbortSignal;
107
- }) => Promise<ReceivedDocumentSignedDocumentDownload>;
108
- };
109
77
  readonly sourceConnections: {
110
78
  readonly completeActivationVerification: (command: SourceConnectionActivationVerificationCommand) => Promise<void>;
111
- readonly issueSandboxCredential: (command: HostedSandboxSourceCredentialIssueCommand) => Promise<HostedSandboxSourceCredential>;
79
+ readonly issueInvoiceCredential: (command: HostedInvoiceCredentialIssueCommand) => Promise<HostedInvoiceCredential>;
112
80
  };
113
81
  readonly webhookDeliveries: {
114
82
  readonly list: (command: WebhookDeliveryListCommand) => Promise<WebhookDeliveryPage>;
@@ -1 +1 @@
1
- {"version":3,"file":"timbro-client.d.ts","sourceRoot":"","sources":["../src/timbro-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEpC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,oCAA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AAC,CAAC;KAC9C,CAAC;IACF,QAAQ,CAAC,iBAAiB,EAAE;QAC1B,QAAQ,CAAC,8BAA8B,EAAE,CACvC,OAAO,EAAE,6CAA6C,KACnD,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,sBAAsB,EAAE,CAC/B,OAAO,EAAE,mCAAmC,KACzC,OAAO,CAAC,uBAAuB,CAAC,CAAC;KACvC,CAAC;IACF,QAAQ,CAAC,iBAAiB,EAAE;QAC1B,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACrF,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC;KAC3F,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACzF,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;QAC3E,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;KAC1F,CAAC;CACH,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAiE7E"}
@@ -1,15 +1,13 @@
1
1
  import { importHostedCertificateCustodyResource, } from "./certificate-custody-import.js";
2
2
  import { readCertificateCustodyReadinessResource, } from "./certificate-custody-readiness.js";
3
- import { createFiscalDeliveryResource, getFiscalDeliveryResource, } from "./fiscal-delivery.js";
4
3
  import { readFiscalNumberingReadinessResource, } from "./fiscal-numbering-readiness.js";
5
4
  import { findFiscalOperationBySourceResource, getFiscalOperationResource, issueFiscalDocumentResource, listFiscalOperationResources, } from "./fiscal-operation.js";
6
5
  import { getFiscalOperationTimingResource, } from "./fiscal-operation-timing.js";
7
- import { downloadFiscalReceiptPrintedRepresentation, getFiscalReceiptResource, shareFiscalReceiptResource, } from "./fiscal-receipt.js";
8
6
  import { createGeneratedOperationClient } from "./generated-operation-client.js";
7
+ import { createInvoiceResources } from "./invoice.js";
9
8
  import { downloadPrintedRepresentationResource, } from "./printed-representation.js";
10
- import { downloadReceivedDocumentSignedDocument, getReceivedDocumentResource, listReceivedDocumentResources, respondToReceivedDocument, } from "./received-documents.js";
11
9
  import { downloadSignedDocumentResource } from "./signed-document.js";
12
- import { completeSourceConnectionActivationVerificationResource, issueHostedSandboxSourceCredentialResource, } from "./source-connection.js";
10
+ import { completeSourceConnectionActivationVerificationResource, issueHostedInvoiceCredentialResource, } from "./source-connection.js";
13
11
  import { createStampServerHttpTransport, } from "./stamp-server-http-transport.js";
14
12
  import { readEveryWebhookDelivery, readWebhookDeliveryPage, } from "./webhook-delivery.js";
15
13
  import { registerWebhookResource, } from "./webhook-registration.js";
@@ -22,8 +20,8 @@ export function createTimbroClient(options) {
22
20
  ...(options.fetch === undefined ? {} : { fetch: options.fetch }),
23
21
  }));
24
22
  return {
23
+ invoices: createInvoiceResources(operationClient, options),
25
24
  fiscalDocuments: {
26
- shareReceipt: (command) => shareFiscalReceiptResource(operationClient, command.fiscalOperationId, command.signal),
27
25
  issue: (command) => issueFiscalDocumentResource(operationClient, command),
28
26
  get: (command) => getFiscalOperationResource(operationClient, command.fiscalOperationId, command.signal),
29
27
  list: (command) => listFiscalOperationResources(operationClient, command),
@@ -41,23 +39,9 @@ export function createTimbroClient(options) {
41
39
  downloadSignedDocument: (command) => downloadSignedDocumentResource(operationClient, command.fiscalOperationId, command.signal),
42
40
  downloadPrintedRepresentation: (command) => downloadPrintedRepresentationResource(operationClient, command.fiscalOperationId, command.signal),
43
41
  },
44
- receivedDocuments: {
45
- list: (command) => listReceivedDocumentResources(operationClient, command),
46
- get: (command) => getReceivedDocumentResource(operationClient, command.fiscalReceptionId, command.signal),
47
- respond: (command) => respondToReceivedDocument(operationClient, command.fiscalReceptionId, command.response, command.signal),
48
- downloadSignedDocument: (command) => downloadReceivedDocumentSignedDocument(operationClient, command.fiscalReceptionId, command.signal),
49
- },
50
- fiscalReceipts: {
51
- get: (command) => getFiscalReceiptResource(options, command),
52
- downloadPrintedRepresentation: (command) => downloadFiscalReceiptPrintedRepresentation(options, command),
53
- },
54
- fiscalDeliveries: {
55
- create: (command) => createFiscalDeliveryResource(operationClient, command),
56
- get: (command) => getFiscalDeliveryResource(operationClient, command.deliveryId, command.signal),
57
- },
58
42
  sourceConnections: {
59
43
  completeActivationVerification: (command) => completeSourceConnectionActivationVerificationResource(operationClient, command),
60
- issueSandboxCredential: (command) => issueHostedSandboxSourceCredentialResource(operationClient, command),
44
+ issueInvoiceCredential: (command) => issueHostedInvoiceCredentialResource(operationClient, command),
61
45
  },
62
46
  webhookDeliveries: {
63
47
  list: (command) => readWebhookDeliveryPage(operationClient, command),
Binary file
@@ -1,5 +1,5 @@
1
1
  export type TimbroTransportRequest = {
2
- readonly method: "DELETE" | "GET" | "POST" | "PUT";
2
+ readonly method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
3
3
  readonly path: string;
4
4
  readonly headers: Readonly<Record<string, string>>;
5
5
  readonly body: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"transport-contract.d.ts","sourceRoot":"","sources":["../src/transport-contract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE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(client, command) {
7
7
  }
8
8
  const response = await listWebhookDeliveries({
9
9
  client,
10
- path: { webhook_endpoint_id: command.webhookEndpointId },
10
+ path: { webhookEndpointId: command.webhookEndpointId },
11
11
  query: {
12
12
  ...(command.cursor === undefined ? {} : { cursor: command.cursor }),
13
13
  ...(command.limit === undefined ? {} : { limit: command.limit }),