@timbro/invoices 0.9.0-next.1 → 0.10.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/LICENSE +219 -0
- package/README.md +23 -0
- package/dist/admin.d.ts +2 -2
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +1 -1
- package/dist/generated/hosted/sdk.gen.js +1 -1
- package/dist/generated/hosted/types.gen.d.ts +2 -2
- package/dist/generated/hosted/types.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod-response.gen.d.ts +4007 -0
- package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -0
- package/dist/generated/hosted/zod-response.gen.js +1967 -0
- package/dist/generated/hosted/zod.gen.d.ts +3 -0
- package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
- package/dist/generated/hosted/zod.gen.js +3 -0
- package/dist/generated/sdk.gen.js +1 -1
- package/dist/generated/zod-response.gen.d.ts +87940 -0
- package/dist/generated/zod-response.gen.d.ts.map +1 -0
- package/dist/generated/zod-response.gen.js +4946 -0
- package/dist/generated-problem.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/invoice-receipt.d.ts.map +1 -1
- package/dist/invoice-receipt.js +2 -1
- package/dist/invoice.d.ts +2 -2
- package/dist/invoice.d.ts.map +1 -1
- package/dist/invoice.js +1 -1
- package/dist/source-connection-activation.d.ts.map +1 -1
- package/dist/source-connection-activation.js +2 -1
- package/dist/timbro-client.d.ts +2 -2
- package/dist/timbro-client.d.ts.map +1 -1
- package/dist/webhook-event.d.ts +4680 -1983
- package/dist/webhook-event.d.ts.map +1 -1
- package/dist/webhook-event.js +27 -1
- package/dist/webhook-verification.d.ts +4 -2
- package/dist/webhook-verification.d.ts.map +1 -1
- package/dist/webhook-verification.js +4 -2
- package/package.json +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-event.d.ts","sourceRoot":"","sources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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAEhE;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB,CAIlF;AAED;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;iBAIzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,iGAAiG;AACjG,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,wBAAwB,CAAC;AAIpF,+EAA+E;AAC/E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,oBAAoB,GAC1B,KAAK,IAAI,qBAAqB,CAEhC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAOhF"}
|
package/dist/webhook-event.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { zInvoiceWebhookEvent, zInvoiceWebhookEventEnvelope, zReceptionWebhookEventEnvelope, zWebhookEventEnvelope, } from "./generated/
|
|
2
|
+
import { recognizedWebhookEventTypes, zInvoiceWebhookEvent, zInvoiceWebhookEventEnvelope, zReceptionWebhookEventEnvelope, zWebhookEventEnvelope, } from "./generated/zod-response.gen.js";
|
|
3
3
|
export const webhookEventSchema = zWebhookEventEnvelope;
|
|
4
4
|
export const receptionWebhookEventSchema = zReceptionWebhookEventEnvelope;
|
|
5
5
|
export const invoiceWebhookEventSchema = zInvoiceWebhookEvent;
|
|
@@ -15,3 +15,29 @@ export function parseWebhookEvent(payload) {
|
|
|
15
15
|
export function parseDeliveredWebhookEvent(payload) {
|
|
16
16
|
return deliveredWebhookEventSchema.parse(typeof payload === "string" ? JSON.parse(payload) : payload);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A signed event whose type this SDK version does not know. Its envelope carries at least an
|
|
20
|
+
* `id` and a `type`; every other field arrives untouched so a receiver can log or ignore it.
|
|
21
|
+
*/
|
|
22
|
+
export const unrecognizedWebhookEventSchema = z.looseObject({
|
|
23
|
+
id: z.string().min(1),
|
|
24
|
+
type: z.string().min(1),
|
|
25
|
+
data: z.unknown(),
|
|
26
|
+
});
|
|
27
|
+
const RECOGNIZED_WEBHOOK_EVENT_TYPES = new Set(recognizedWebhookEventTypes);
|
|
28
|
+
/** Narrows a received event to the types this SDK version decodes strictly. */
|
|
29
|
+
export function isRecognizedWebhookEvent(event) {
|
|
30
|
+
return RECOGNIZED_WEBHOOK_EVENT_TYPES.has(event.type);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Decodes a verified delivery body. A known event type must satisfy its schema; an unknown
|
|
34
|
+
* type is returned as an {@link UnrecognizedWebhookEvent} instead of throwing.
|
|
35
|
+
*/
|
|
36
|
+
export function parseReceivedWebhookEvent(payload) {
|
|
37
|
+
const value = typeof payload === "string" ? JSON.parse(payload) : payload;
|
|
38
|
+
const envelope = unrecognizedWebhookEventSchema.safeParse(value);
|
|
39
|
+
if (!(envelope.success && !RECOGNIZED_WEBHOOK_EVENT_TYPES.has(envelope.data.type))) {
|
|
40
|
+
return deliveredWebhookEventSchema.parse(value);
|
|
41
|
+
}
|
|
42
|
+
return envelope.data;
|
|
43
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReceivedWebhookEvent } from "./webhook-event.ts";
|
|
2
2
|
export type WebhookVerificationRejection = "invalid_secret" | "missing_header" | "malformed_header" | "stale_timestamp" | "future_timestamp" | "signature_mismatch" | "unreadable_envelope" | "id_mismatch";
|
|
3
3
|
export type WebhookVerificationErrorDetail = ErrorOptions & {
|
|
4
4
|
readonly rejection: WebhookVerificationRejection;
|
|
@@ -20,6 +20,8 @@ export type WebhookVerificationCommand = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Verifies a Standard Webhooks delivery over the exact bytes the receiver was sent.
|
|
22
22
|
* Re-serializing a parsed body before verifying changes those bytes and always rejects.
|
|
23
|
+
* An event type this SDK does not know is returned, not rejected; narrow with
|
|
24
|
+
* `isRecognizedWebhookEvent` before reading `data`.
|
|
23
25
|
*/
|
|
24
|
-
export declare function verifyWebhookDelivery(command: WebhookVerificationCommand): Promise<
|
|
26
|
+
export declare function verifyWebhookDelivery(command: WebhookVerificationCommand): Promise<ReceivedWebhookEvent>;
|
|
25
27
|
//# sourceMappingURL=webhook-verification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-verification.d.ts","sourceRoot":"","sources":["../src/webhook-verification.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"webhook-verification.d.ts","sourceRoot":"","sources":["../src/webhook-verification.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,MAAM,MAAM,4BAA4B,GACpC,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,aAAa,CAAC;AAElB,MAAM,MAAM,8BAA8B,GAAG,YAAY,GAAG;IAC1D,QAAQ,CAAC,SAAS,EAAE,4BAA4B,CAAC;CAClD,CAAC;AAEF,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,SAAS,EAAE,4BAA4B,CAAC;IAEjD,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B,EAIlE;CACF;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,CACvD,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,GAAG,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CA6B/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardWebhookVerificationError, verifyStandardWebhookSignature } from "@timbro/protocol";
|
|
2
|
-
import {
|
|
2
|
+
import { parseReceivedWebhookEvent } from "./webhook-event.js";
|
|
3
3
|
export class WebhookVerificationError extends Error {
|
|
4
4
|
rejection;
|
|
5
5
|
constructor(message, detail) {
|
|
@@ -11,6 +11,8 @@ export class WebhookVerificationError extends Error {
|
|
|
11
11
|
/**
|
|
12
12
|
* Verifies a Standard Webhooks delivery over the exact bytes the receiver was sent.
|
|
13
13
|
* Re-serializing a parsed body before verifying changes those bytes and always rejects.
|
|
14
|
+
* An event type this SDK does not know is returned, not rejected; narrow with
|
|
15
|
+
* `isRecognizedWebhookEvent` before reading `data`.
|
|
14
16
|
*/
|
|
15
17
|
export async function verifyWebhookDelivery(command) {
|
|
16
18
|
const secrets = "secret" in command ? [command.secret] : command.secrets;
|
|
@@ -42,7 +44,7 @@ export async function verifyWebhookDelivery(command) {
|
|
|
42
44
|
}
|
|
43
45
|
function readEnvelope(body) {
|
|
44
46
|
try {
|
|
45
|
-
return
|
|
47
|
+
return parseReceivedWebhookEvent(body);
|
|
46
48
|
}
|
|
47
49
|
catch (cause) {
|
|
48
50
|
throw new WebhookVerificationError("the signed body is not a Timbro webhook event", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timbro/invoices",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
4
5
|
"private": false,
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./dist/index.js",
|
|
@@ -21,6 +22,10 @@
|
|
|
21
22
|
"types": "./dist/generated/index.d.ts",
|
|
22
23
|
"import": "./dist/generated/index.js"
|
|
23
24
|
},
|
|
25
|
+
"./admin/generated/response": {
|
|
26
|
+
"types": "./dist/generated/zod-response.gen.d.ts",
|
|
27
|
+
"import": "./dist/generated/zod-response.gen.js"
|
|
28
|
+
},
|
|
24
29
|
"./document": {
|
|
25
30
|
"types": "./dist/document.d.ts",
|
|
26
31
|
"import": "./dist/document.js"
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
}
|
|
64
69
|
},
|
|
65
70
|
"dependencies": {
|
|
66
|
-
"@timbro/protocol": "0.
|
|
71
|
+
"@timbro/protocol": "0.10.0",
|
|
67
72
|
"zod": "4.4.3"
|
|
68
73
|
},
|
|
69
74
|
"devDependencies": {
|