@timbro/invoices 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.
- package/README.md +20 -0
- package/dist/admin.d.ts +1 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/generated/hosted/index.d.ts +3 -3
- package/dist/generated/hosted/index.d.ts.map +1 -1
- package/dist/generated/hosted/index.js +2 -2
- package/dist/generated/hosted/sdk.gen.d.ts +19 -1
- package/dist/generated/hosted/sdk.gen.d.ts.map +1 -1
- package/dist/generated/hosted/sdk.gen.js +225 -1
- package/dist/generated/hosted/types.gen.d.ts +544 -4
- package/dist/generated/hosted/types.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.d.ts +5734 -223
- package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.js +628 -201
- package/dist/generated/hosted/zod.gen.d.ts +1406 -7
- package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod.gen.js +724 -237
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +1 -1
- package/dist/generated/types.gen.d.ts +11 -2
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/generated/zod-response.gen.d.ts +18 -0
- package/dist/generated/zod-response.gen.d.ts.map +1 -1
- package/dist/generated/zod-response.gen.js +11 -1
- package/dist/generated/zod.gen.d.ts +23 -0
- package/dist/generated/zod.gen.d.ts.map +1 -1
- package/dist/generated/zod.gen.js +16 -2
- package/dist/hosted-tenant.d.ts +9 -0
- package/dist/hosted-tenant.d.ts.map +1 -1
- package/dist/hosted-tenant.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/invoice-hosted-controls.d.ts +22 -3
- package/dist/invoice-hosted-controls.d.ts.map +1 -1
- package/dist/invoice-hosted-controls.js +48 -12
- package/package.json +2 -2
|
@@ -3589,7 +3589,11 @@ export const zHealthReadyResponse = z.strictObject({
|
|
|
3589
3589
|
schema_version: z.int().gte(1).lte(2147483647).nullable(),
|
|
3590
3590
|
status: zHealthStatus,
|
|
3591
3591
|
});
|
|
3592
|
-
export const zHostedCertificateImportEnvironment = z.enum([
|
|
3592
|
+
export const zHostedCertificateImportEnvironment = z.enum([
|
|
3593
|
+
"sandbox",
|
|
3594
|
+
"certification",
|
|
3595
|
+
"production",
|
|
3596
|
+
]);
|
|
3593
3597
|
export const zHostedImportRequest = z.strictObject({
|
|
3594
3598
|
certificate_p12_base64: z.string(),
|
|
3595
3599
|
checkout_tenant_id: z.string(),
|
|
@@ -3604,7 +3608,11 @@ export const zHostedImportResponse = z.strictObject({
|
|
|
3604
3608
|
object: z.string(),
|
|
3605
3609
|
signer_subject_serial_number: z.string(),
|
|
3606
3610
|
});
|
|
3607
|
-
export const zHostedInvoiceCredentialEnvironment = z.enum([
|
|
3611
|
+
export const zHostedInvoiceCredentialEnvironment = z.enum([
|
|
3612
|
+
"sandbox",
|
|
3613
|
+
"certification",
|
|
3614
|
+
"production",
|
|
3615
|
+
]);
|
|
3608
3616
|
export const zHostedInvoiceCredentialRequest = z.strictObject({
|
|
3609
3617
|
checkout_tenant_id: z.string(),
|
|
3610
3618
|
environment: zHostedInvoiceCredentialEnvironment,
|
|
@@ -3615,10 +3623,16 @@ export const zHostedInvoiceCredentialResponse = z.strictObject({
|
|
|
3615
3623
|
object: z.string(),
|
|
3616
3624
|
source_connection_id: z.uuid(),
|
|
3617
3625
|
});
|
|
3626
|
+
export const zHostedReceiverUrls = z.strictObject({
|
|
3627
|
+
base_url: z.string(),
|
|
3628
|
+
commercial_approval_url: z.string(),
|
|
3629
|
+
reception_url: z.string(),
|
|
3630
|
+
});
|
|
3618
3631
|
export const zHostedTenantResource = z.strictObject({
|
|
3619
3632
|
hosted_tenant_binding_id: z.uuid(),
|
|
3620
3633
|
legal_issuer_id: z.uuid(),
|
|
3621
3634
|
organization_id: z.uuid(),
|
|
3635
|
+
receiver_urls: zHostedReceiverUrls,
|
|
3622
3636
|
source_connection_id: z.uuid(),
|
|
3623
3637
|
webhook_endpoint_id: z.uuid(),
|
|
3624
3638
|
webhook_signing_secret: z.string().nullable(),
|
package/dist/hosted-tenant.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CertificateCustodyImportResult } from "./certificate-custody-import.ts";
|
|
1
2
|
import { type CreateHostedTenantRequest, type HostedWebhookSecretRotation as GeneratedHostedWebhookSecretRotation, type ReleasedHostedTenant as GeneratedReleasedHostedTenant, type HostedTenantResource } from "./generated/index.ts";
|
|
2
3
|
import { type ReadonlyCamelCase } from "./public-case.ts";
|
|
3
4
|
import { type StampServerBearerTokenProvider } from "./stamp-server-http-transport.ts";
|
|
@@ -8,6 +9,13 @@ export type HostedTenantCreateCommand = {
|
|
|
8
9
|
readonly rnc: string;
|
|
9
10
|
readonly signal?: AbortSignal;
|
|
10
11
|
};
|
|
12
|
+
export type HostedTenantCertificateImportCommand = {
|
|
13
|
+
readonly checkoutTenantId: string;
|
|
14
|
+
readonly environment: HostedTenantEnvironment;
|
|
15
|
+
readonly certificateP12Base64: string;
|
|
16
|
+
readonly password: string;
|
|
17
|
+
readonly signal?: AbortSignal;
|
|
18
|
+
};
|
|
11
19
|
export type HostedTenantWebhookSecretRotationCommand = {
|
|
12
20
|
readonly sourceConnectionId: string;
|
|
13
21
|
readonly idempotencyKey?: string;
|
|
@@ -30,6 +38,7 @@ export type HostedTenantClientOptions = {
|
|
|
30
38
|
};
|
|
31
39
|
export type HostedTenantClient = {
|
|
32
40
|
readonly create: (command: HostedTenantCreateCommand) => Promise<HostedTenant>;
|
|
41
|
+
readonly importCertificate: (command: HostedTenantCertificateImportCommand) => Promise<CertificateCustodyImportResult>;
|
|
33
42
|
readonly release: (command: HostedTenantReleaseCommand) => Promise<HostedTenantRelease>;
|
|
34
43
|
readonly rotateWebhookSecret: (command: HostedTenantWebhookSecretRotationCommand) => Promise<Hosted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,GAAG;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,8BAA8B,CAAC;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/E,QAAQ,CAAC,iBAAiB,EAAE,CAC1B,OAAO,EAAE,oCAAoC,KAC1C,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxF,QAAQ,CAAC,mBAAmB,EAAE,CAC5B,OAAO,EAAE,wCAAwC,KAC9C,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC3C,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CAyB/F"}
|
package/dist/hosted-tenant.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { importHostedCertificateCustodyResource, } from "./certificate-custody-import.js";
|
|
1
2
|
import { createHostedTenant, createHostedTenantWebhookSecretRotation, releaseHostedTenant, } from "./generated/index.js";
|
|
2
3
|
import { createGeneratedOperationClient } from "./generated-operation-client.js";
|
|
3
4
|
import { throwGeneratedProblem } from "./generated-problem.js";
|
|
@@ -15,6 +16,12 @@ export function createHostedTenantClient(options) {
|
|
|
15
16
|
}));
|
|
16
17
|
return {
|
|
17
18
|
create: (command) => createHostedTenantResource(client, command),
|
|
19
|
+
importCertificate: (command) => importHostedCertificateCustodyResource(client, {
|
|
20
|
+
certificateP12Base64: command.certificateP12Base64,
|
|
21
|
+
password: command.password,
|
|
22
|
+
hosted: { checkoutTenantId: command.checkoutTenantId, environment: command.environment },
|
|
23
|
+
...(command.signal === undefined ? {} : { signal: command.signal }),
|
|
24
|
+
}),
|
|
18
25
|
release: (command) => releaseHostedTenantBinding(client, command),
|
|
19
26
|
rotateWebhookSecret: (command) => rotateHostedTenantWebhookSecret(client, command),
|
|
20
27
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { InvoiceCreateOptions, InvoiceDeliveryCommand, InvoiceDeliveryReadC
|
|
|
3
3
|
export { createTimbroInvoices } from "./invoice.ts";
|
|
4
4
|
export type { InvoiceErrorDetail, InvoiceFailure } from "./invoice-error.ts";
|
|
5
5
|
export { InvoiceError } from "./invoice-error.ts";
|
|
6
|
-
export type { BusinessConfigureInvoicingCommand, BusinessImportSigningCertificateCommand, BusinessIssueInvoiceKeyCommand, BusinessIssueTestInvoiceCommand, BusinessIssueTestInvoiceOptions, BusinessUpdateCommand, InvoiceHostedControls, WebhookEndpointCreateCommand, WebhookEndpointListDeliveriesCommand, WebhookEndpointListFilters, WebhookEndpointReplayCommand, } from "./invoice-hosted-controls.ts";
|
|
6
|
+
export type { BusinessCertification, BusinessConfigureInvoicingCommand, BusinessImportSigningCertificateCommand, BusinessIssueInvoiceKeyCommand, BusinessIssueTestInvoiceCommand, BusinessIssueTestInvoiceOptions, BusinessStartCertificationCommand, BusinessSubmitCertificationEvidenceCommand, BusinessUpdateCommand, InvoiceHostedControls, WebhookEndpointCreateCommand, WebhookEndpointListDeliveriesCommand, WebhookEndpointListFilters, WebhookEndpointReplayCommand, } from "./invoice-hosted-controls.ts";
|
|
7
7
|
export type { ProblemBody, ProblemCatalogEntry, ProblemCode, ProblemFailure, PublicProblemCode, } from "./problem-contract.ts";
|
|
8
8
|
export { PROBLEM_CATALOG } from "./problem-contract.ts";
|
|
9
9
|
export type { CommercialResponse, ReceivedDocumentDownload, ReceivedDocumentListCommand, ReceivedDocumentPage, ReceivedDocumentRecoveryFilter, ReceivedDocumentResource, ReceivedDocumentResponseFilter, ReceivedDocumentStateFilter, ReceivedDocumentSummary, } from "./received-documents.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,WAAW,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EACV,iCAAiC,EACjC,uCAAuC,EACvC,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,oCAAoC,EACpC,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,8BAA8B,EAC9B,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3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Y,EACV,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,8BAA8B,EAC9B,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConfigureInvoicingData, CreateWebhookEndpointData, ImportSigningCertificateData, IssueInvoiceKeyData, IssueTestInvoiceData, ListWebhookDeliveriesData, ListWebhookEndpointsData, ReplayWebhookEventsData, UpdateBusinessData } from "./generated/hosted/index.ts";
|
|
2
|
-
import { configureInvoicing as configureInvoicingOperation, createWebhookEndpoint as createWebhookEndpointOperation,
|
|
1
|
+
import type { ConfigureInvoicingData, CreateWebhookEndpointData, ImportSigningCertificateData, IssueInvoiceKeyData, IssueTestInvoiceData, ListWebhookDeliveriesData, ListWebhookEndpointsData, ReplayWebhookEventsData, StartMerchantBusinessCertificationData, SubmitMerchantBusinessCertificationEvidenceData, UpdateBusinessData } from "./generated/hosted/index.ts";
|
|
2
|
+
import { configureInvoicing as configureInvoicingOperation, createWebhookEndpoint as createWebhookEndpointOperation, issueInvoiceKey as issueInvoiceKeyOperation, issueTestInvoice as issueTestInvoiceOperation, listWebhookDeliveries as listWebhookDeliveriesOperation, listWebhookEndpoints as listWebhookEndpointsOperation, reactivateWebhookEndpoint as reactivateWebhookEndpointOperation, replayWebhookEvents as replayWebhookEventsOperation, retrieveBusiness as retrieveBusinessOperation, retrieveMerchantBusinessCertification as retrieveCertificationOperation, retrieveWebhookEndpoint as retrieveWebhookEndpointOperation, rotateWebhookEndpointSecret as rotateWebhookEndpointSecretOperation, suspendWebhookEndpoint as suspendWebhookEndpointOperation, updateBusiness as updateBusinessOperation } from "./generated/hosted/index.ts";
|
|
3
3
|
import type { Client } from "./generated-operation-client.ts";
|
|
4
4
|
import type { InvoiceRequestOptions } from "./invoice.ts";
|
|
5
5
|
type BodyOf<Data> = Data extends {
|
|
@@ -23,6 +23,13 @@ export type BusinessConfigureInvoicingCommand = BodyOf<ConfigureInvoicingData> &
|
|
|
23
23
|
readonly idempotencyKey: string;
|
|
24
24
|
};
|
|
25
25
|
export type BusinessImportSigningCertificateCommand = BodyOf<ImportSigningCertificateData>;
|
|
26
|
+
export type BusinessCertification = SuccessBody<ReturnType<typeof retrieveCertificationOperation>, 200>;
|
|
27
|
+
export type BusinessStartCertificationCommand = BodyOf<StartMerchantBusinessCertificationData> & {
|
|
28
|
+
readonly idempotencyKey: string;
|
|
29
|
+
};
|
|
30
|
+
export type BusinessSubmitCertificationEvidenceCommand = BodyOf<SubmitMerchantBusinessCertificationEvidenceData> & {
|
|
31
|
+
readonly idempotencyKey: string;
|
|
32
|
+
};
|
|
26
33
|
export type BusinessIssueTestInvoiceCommand = Partial<BodyOf<IssueTestInvoiceData>>;
|
|
27
34
|
export type BusinessIssueTestInvoiceOptions = BusinessIssueTestInvoiceCommand & InvoiceRequestOptions;
|
|
28
35
|
export type BusinessIssueInvoiceKeyCommand = BodyOf<IssueInvoiceKeyData> & {
|
|
@@ -38,10 +45,22 @@ export type WebhookEndpointReplayCommand = PathOf<ReplayWebhookEventsData> & Bod
|
|
|
38
45
|
};
|
|
39
46
|
export type InvoiceHostedControls = {
|
|
40
47
|
readonly business: {
|
|
48
|
+
readonly certification: {
|
|
49
|
+
readonly retrieve: (options?: InvoiceRequestOptions) => Promise<BusinessCertification>;
|
|
50
|
+
readonly start: (command: BusinessStartCertificationCommand, options?: InvoiceRequestOptions) => Promise<BusinessCertification>;
|
|
51
|
+
readonly submitEvidence: (command: BusinessSubmitCertificationEvidenceCommand, options?: InvoiceRequestOptions) => Promise<BusinessCertification>;
|
|
52
|
+
};
|
|
41
53
|
readonly retrieve: (options?: InvoiceRequestOptions) => Promise<SuccessBody<ReturnType<typeof retrieveBusinessOperation>, 200>>;
|
|
42
54
|
readonly update: (command: BusinessUpdateCommand, options?: InvoiceRequestOptions) => Promise<SuccessBody<ReturnType<typeof updateBusinessOperation>, 200>>;
|
|
43
55
|
readonly configureInvoicing: (command: BusinessConfigureInvoicingCommand, options?: InvoiceRequestOptions) => Promise<SuccessBody<ReturnType<typeof configureInvoicingOperation>, 201>>;
|
|
44
|
-
readonly importSigningCertificate:
|
|
56
|
+
readonly importSigningCertificate: {
|
|
57
|
+
(command: Extract<BusinessImportSigningCertificateCommand, {
|
|
58
|
+
purpose: "certification";
|
|
59
|
+
}>, options?: InvoiceRequestOptions): Promise<BusinessCertification>;
|
|
60
|
+
(command: Extract<BusinessImportSigningCertificateCommand, {
|
|
61
|
+
mode: "test" | "live";
|
|
62
|
+
}>, options?: InvoiceRequestOptions): Promise<SuccessBody<ReturnType<typeof retrieveBusinessOperation>, 200>>;
|
|
63
|
+
};
|
|
45
64
|
readonly issueTestInvoice: (options?: BusinessIssueTestInvoiceOptions) => Promise<SuccessBody<ReturnType<typeof issueTestInvoiceOperation>, 200>>;
|
|
46
65
|
readonly issueInvoiceKey: (command: BusinessIssueInvoiceKeyCommand, options?: InvoiceRequestOptions) => Promise<SuccessBody<ReturnType<typeof issueInvoiceKeyOperation>, 201>>;
|
|
47
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-hosted-controls.d.ts","sourceRoot":"","sources":["../src/invoice-hosted-controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,mBAAmB,EACnB,oBAAoB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MAAM,EACzB,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,+BAA+B,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACnF,QAAQ,CAAC,UAAU,EAAE,CACnB,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,kCAAkC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;KACvF,CAAC;CACH,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CA0OjF"}
|
|
@@ -1,8 +1,54 @@
|
|
|
1
|
-
import { configureInvoicing as configureInvoicingOperation, createWebhookEndpoint as createWebhookEndpointOperation, deleteWebhookEndpoint as deleteWebhookEndpointOperation, importSigningCertificate as importSigningCertificateOperation, issueInvoiceKey as issueInvoiceKeyOperation, issueTestInvoice as issueTestInvoiceOperation, listWebhookDeliveries as listWebhookDeliveriesOperation, listWebhookEndpoints as listWebhookEndpointsOperation, reactivateWebhookEndpoint as reactivateWebhookEndpointOperation, replayWebhookEvents as replayWebhookEventsOperation, retrieveBusiness as retrieveBusinessOperation, retrieveWebhookEndpoint as retrieveWebhookEndpointOperation, rotateWebhookEndpointSecret as rotateWebhookEndpointSecretOperation, suspendWebhookEndpoint as suspendWebhookEndpointOperation, updateBusiness as updateBusinessOperation, } from "./generated/hosted/index.js";
|
|
1
|
+
import { configureInvoicing as configureInvoicingOperation, createWebhookEndpoint as createWebhookEndpointOperation, deleteWebhookEndpoint as deleteWebhookEndpointOperation, importSigningCertificate as importSigningCertificateOperation, issueInvoiceKey as issueInvoiceKeyOperation, issueTestInvoice as issueTestInvoiceOperation, listWebhookDeliveries as listWebhookDeliveriesOperation, listWebhookEndpoints as listWebhookEndpointsOperation, reactivateWebhookEndpoint as reactivateWebhookEndpointOperation, replayWebhookEvents as replayWebhookEventsOperation, retrieveBusiness as retrieveBusinessOperation, retrieveMerchantBusinessCertification as retrieveCertificationOperation, retrieveWebhookEndpoint as retrieveWebhookEndpointOperation, rotateWebhookEndpointSecret as rotateWebhookEndpointSecretOperation, startMerchantBusinessCertification as startCertificationOperation, submitMerchantBusinessCertificationEvidence as submitCertificationEvidenceOperation, suspendWebhookEndpoint as suspendWebhookEndpointOperation, updateBusiness as updateBusinessOperation, } from "./generated/hosted/index.js";
|
|
2
2
|
import { throwGeneratedProblem } from "./generated-problem.js";
|
|
3
3
|
export function createInvoiceHostedControls(client) {
|
|
4
|
+
async function importSigningCertificate(command, options) {
|
|
5
|
+
const response = await importSigningCertificateOperation({
|
|
6
|
+
client,
|
|
7
|
+
body: command,
|
|
8
|
+
...options,
|
|
9
|
+
});
|
|
10
|
+
if (response.status === 200) {
|
|
11
|
+
return response.body;
|
|
12
|
+
}
|
|
13
|
+
throwGeneratedProblem(response, "Signing certificate import failed");
|
|
14
|
+
}
|
|
4
15
|
return {
|
|
5
16
|
business: {
|
|
17
|
+
certification: {
|
|
18
|
+
retrieve: async (options) => {
|
|
19
|
+
const response = await retrieveCertificationOperation({ client, ...options });
|
|
20
|
+
if (response.status === 200) {
|
|
21
|
+
return response.body;
|
|
22
|
+
}
|
|
23
|
+
throwGeneratedProblem(response, "Certification retrieval failed");
|
|
24
|
+
},
|
|
25
|
+
start: async (command, options) => {
|
|
26
|
+
const { idempotencyKey, ...body } = command;
|
|
27
|
+
const response = await startCertificationOperation({
|
|
28
|
+
client,
|
|
29
|
+
body,
|
|
30
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
31
|
+
...options,
|
|
32
|
+
});
|
|
33
|
+
if (response.status === 200 || response.status === 201) {
|
|
34
|
+
return response.body;
|
|
35
|
+
}
|
|
36
|
+
throwGeneratedProblem(response, "Certification preparation failed");
|
|
37
|
+
},
|
|
38
|
+
submitEvidence: async (command, options) => {
|
|
39
|
+
const { idempotencyKey, ...body } = command;
|
|
40
|
+
const response = await submitCertificationEvidenceOperation({
|
|
41
|
+
client,
|
|
42
|
+
body,
|
|
43
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
44
|
+
...options,
|
|
45
|
+
});
|
|
46
|
+
if (response.status === 200) {
|
|
47
|
+
return response.body;
|
|
48
|
+
}
|
|
49
|
+
throwGeneratedProblem(response, "Certification evidence submission failed");
|
|
50
|
+
},
|
|
51
|
+
},
|
|
6
52
|
retrieve: async (options) => {
|
|
7
53
|
const response = await retrieveBusinessOperation({ client, ...options });
|
|
8
54
|
if (response.status === 200) {
|
|
@@ -38,17 +84,7 @@ export function createInvoiceHostedControls(client) {
|
|
|
38
84
|
}
|
|
39
85
|
throwGeneratedProblem(response, "Invoice environment configuration failed");
|
|
40
86
|
},
|
|
41
|
-
importSigningCertificate
|
|
42
|
-
const response = await importSigningCertificateOperation({
|
|
43
|
-
client,
|
|
44
|
-
body: command,
|
|
45
|
-
...options,
|
|
46
|
-
});
|
|
47
|
-
if (response.status === 200) {
|
|
48
|
-
return response.body;
|
|
49
|
-
}
|
|
50
|
-
throwGeneratedProblem(response, "Signing certificate import failed");
|
|
51
|
-
},
|
|
87
|
+
importSigningCertificate,
|
|
52
88
|
issueTestInvoice: async (options) => {
|
|
53
89
|
const body = options?.documentType === undefined ? {} : { documentType: options.documentType };
|
|
54
90
|
const response = await issueTestInvoiceOperation({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timbro/invoices",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"generate": "openapi-ts && node ../../scripts/finalize-sdk-operation-bindings.mjs && node ../../scripts/generate-sdk-problem-catalog.mjs && node ../../scripts/generate-invoice-api-contract.mjs && biome check --write src/generated && node ../../scripts/validate-generated-sdk-contract.mjs && pnpm run generate:hosted-controls",
|
|
82
|
-
"generate:hosted-controls": "openapi-ts --file ./openapi-ts.config.ts --input ./openapi/gateway-controls.json --output ./src/generated/hosted && node ../../scripts/finalize-hosted-controls-operation-bindings.mjs",
|
|
82
|
+
"generate:hosted-controls": "openapi-ts --file ./openapi-ts.config.ts --input ./openapi/gateway-controls.json --output ./src/generated/hosted && node ../../scripts/finalize-hosted-controls-operation-bindings.mjs && biome check --write src/generated/hosted",
|
|
83
83
|
"verify:hosted-controls-contract": "node ../../scripts/verify-gateway-hosted-controls-contract.mjs",
|
|
84
84
|
"typecheck": "tsc -p tsconfig.json --pretty false && tsc -p tsconfig.node.json --pretty false && tsc -p tsconfig.worker.json --pretty false && tsc -p tsconfig.receiver.json --pretty false && tsc -p tsconfig.tests.json --pretty false && tsc -p tsconfig.examples.json --pretty false",
|
|
85
85
|
"build": "node scripts/clean-dist.mjs && tsc -p tsconfig.build.json --pretty false && node scripts/stage-fiscal-engine-runtime.mjs",
|