File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "bugs" : " https://github.com/TRUEPIC/webhook-verifier-nodejs/issues" ,
77 "license" : " MIT" ,
88 "main" : " ./src/main.js" ,
9+ "types" : " ./src/main.d.ts" ,
910 "repository" : {
1011 "type" : " git" ,
1112 "url" : " git+https://github.com/TRUEPIC/webhook-verifier-nodejs.git"
Original file line number Diff line number Diff line change 1+ /**
2+ * Options for verifying a Truepic webhook.
3+ */
4+ interface VerifyTruepicWebhookOptions {
5+ /** The full URL that received the request and is registered with Truepic. */
6+ url : string
7+ /** The shared secret that's registered with Truepic. */
8+ secret : string
9+ /** The value of the `truepic-signature` header from the request. */
10+ header : string
11+ /** The raw body (unparsed JSON) from the request. */
12+ body : string
13+ /** The number of minutes allowed between the request being sent and received. Defaults to `5`. */
14+ leewayMinutes ?: number
15+ }
16+
17+ /**
18+ * The custom error thrown when webhook verification fails.
19+ */
20+ declare class TruepicWebhookVerifierError extends Error {
21+ constructor ( message : string )
22+ name : 'TruepicWebhookVerifierError'
23+ }
24+
25+ /**
26+ * Verify a webhook from Truepic Vision or Lens.
27+ */
28+ declare function verifyTruepicWebhook (
29+ options : VerifyTruepicWebhookOptions ,
30+ ) : true
31+
32+ declare namespace verifyTruepicWebhook {
33+ export { TruepicWebhookVerifierError }
34+ }
35+
36+ export = verifyTruepicWebhook
You can’t perform that action at this time.
0 commit comments