@easybits.cloud/mailmask 0.4.8 → 0.4.10
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 +9 -0
- package/dist/client.d.ts +427 -0
- package/dist/index.cjs +27 -2
- package/dist/index.d.ts +4 -1189
- package/dist/index.js +27 -2
- package/dist/types.d.ts +867 -0
- package/dist/verify.d.ts +12 -0
- package/package.json +6 -3
- package/dist/index.d.cts +0 -1189
package/dist/verify.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WebhookSignatureHeaders {
|
|
2
|
+
/** Header `X-MailMask-Signature`, con forma `sha256=<hex>`. */
|
|
3
|
+
signature: string;
|
|
4
|
+
/** Header `X-MailMask-Timestamp`, milisegundos Unix. */
|
|
5
|
+
timestamp: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Comprueba que `rawBody` (el cuerpo tal cual llegó, sin parsear) fue firmado
|
|
9
|
+
* con `secret`. Rechaza timestamps con más de `toleranceMs` de diferencia para
|
|
10
|
+
* frenar repeticiones.
|
|
11
|
+
*/
|
|
12
|
+
export declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easybits.cloud/mailmask",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"description": "Official SDK for the MailMask email alias/forwarding API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "tsup",
|
|
21
|
+
"build": "tsup && tsc -p tsconfig.json --emitDeclarationOnly && node scripts/postbuild-dts.mjs",
|
|
22
|
+
"check:exports": "node scripts/check-exports.mjs",
|
|
23
|
+
"check:runtime": "node scripts/check-runtime.mjs",
|
|
24
|
+
"check:consumer": "node scripts/check-consumer-legacy.mjs",
|
|
22
25
|
"prepublishOnly": "npm run build"
|
|
23
26
|
},
|
|
24
27
|
"devDependencies": {
|
|
25
28
|
"tsup": "^8.0.0",
|
|
26
|
-
"typescript": "^
|
|
29
|
+
"typescript": "^7.0.2"
|
|
27
30
|
},
|
|
28
31
|
"keywords": [
|
|
29
32
|
"mailmask",
|