@curviate/sdk 0.14.0 → 0.14.1
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/dist/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/generated/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ Versioning: semantic — minor for additive changes, patch for bug fixes; no sta
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [0.14.1] — 2026-07-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`constructEvent` examples referenced a wrong header name (`X-Curviate-Signature` → `Curviate-Signature`); corrected a stale default-count description.** The JSDoc and both code examples (Express/Node, Hono) for `constructEvent` named the header `X-Curviate-Signature`; the dispatcher actually sends `Curviate-Signature` (Node lowercases it to `curviate-signature` on `req.headers`), so integrators copying the examples verbatim got `undefined` for the signature header. Also corrected the generated `events` field description on the webhook-create schema from a stale "default: all 7" to "default: all 11 lifecycle events", matching the account_status catalogue.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
10
18
|
## [0.14.0] — 2026-07-07
|
|
11
19
|
|
|
12
20
|
Webhooks surface re-based onto the v2 catalogue. Additive minor: one new method,
|
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ import { constructEvent, WebhookSignatureError } from "@curviate/sdk";
|
|
|
154
154
|
|
|
155
155
|
// Express (Node 18+)
|
|
156
156
|
app.post("/webhook", express.raw({ type: "application/json" }), async (req, res) => {
|
|
157
|
-
const sig = req.headers["
|
|
157
|
+
const sig = req.headers["curviate-signature"] as string;
|
|
158
158
|
const secret = process.env.CURVIATE_WEBHOOK_SECRET!;
|
|
159
159
|
|
|
160
160
|
let event;
|
|
@@ -185,7 +185,7 @@ app.post("/webhook", express.raw({ type: "application/json" }), async (req, res)
|
|
|
185
185
|
// Hono / Vercel Edge — always await (Web Crypto is async)
|
|
186
186
|
app.post("/webhook", async (c) => {
|
|
187
187
|
const rawBody = await c.req.text();
|
|
188
|
-
const event = await constructEvent(rawBody, c.req.header("
|
|
188
|
+
const event = await constructEvent(rawBody, c.req.header("curviate-signature")!, secret);
|
|
189
189
|
return c.text("ok");
|
|
190
190
|
});
|
|
191
191
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -16795,7 +16795,7 @@ interface paths {
|
|
|
16795
16795
|
key: string;
|
|
16796
16796
|
value: string;
|
|
16797
16797
|
}[];
|
|
16798
|
-
/** @description Account-status events to subscribe to (default: all
|
|
16798
|
+
/** @description Account-status events to subscribe to (default: all 11 lifecycle events) */
|
|
16799
16799
|
events?: ("account.created" | "account.connected" | "account.synced" | "account.reconnected" | "account.reconnect_needed" | "account.creation_failed" | "account.disconnected" | "account.error" | "account.paused" | "account.connecting" | "account.permission_revoked" | "account.initial_sync.running" | "account.initial_sync.completed" | "account.initial_sync.failed")[];
|
|
16800
16800
|
};
|
|
16801
16801
|
};
|
|
@@ -18894,7 +18894,7 @@ interface ConstructEventOptions {
|
|
|
18894
18894
|
*
|
|
18895
18895
|
* @param rawBody - The raw (un-parsed) request body as a string or Buffer.
|
|
18896
18896
|
* **Must be the exact bytes received** — do not JSON.parse then re-serialize.
|
|
18897
|
-
* @param signatureHeader - Full value of the `
|
|
18897
|
+
* @param signatureHeader - Full value of the `Curviate-Signature` header.
|
|
18898
18898
|
* @param secret - The webhook signing secret from your webhook registration.
|
|
18899
18899
|
* @param opts - Optional verification settings.
|
|
18900
18900
|
* @returns `Promise<CurviateEvent>` — a typed event once verified.
|
|
@@ -18904,7 +18904,7 @@ interface ConstructEventOptions {
|
|
|
18904
18904
|
* @example
|
|
18905
18905
|
* // Express handler (Node 18+)
|
|
18906
18906
|
* app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
18907
|
-
* const sig = req.headers['
|
|
18907
|
+
* const sig = req.headers['curviate-signature'] as string;
|
|
18908
18908
|
* let event;
|
|
18909
18909
|
* try {
|
|
18910
18910
|
* event = await constructEvent(req.body, sig, secret);
|
|
@@ -18922,7 +18922,7 @@ interface ConstructEventOptions {
|
|
|
18922
18922
|
* // Hono / Vercel Edge
|
|
18923
18923
|
* app.post('/webhook', async (c) => {
|
|
18924
18924
|
* const rawBody = await c.req.text();
|
|
18925
|
-
* const event = await constructEvent(rawBody, c.req.header('
|
|
18925
|
+
* const event = await constructEvent(rawBody, c.req.header('curviate-signature')!, secret);
|
|
18926
18926
|
* return c.text('ok');
|
|
18927
18927
|
* });
|
|
18928
18928
|
*/
|
package/package.json
CHANGED
package/src/generated/types.ts
CHANGED
|
@@ -16686,7 +16686,7 @@ export interface paths {
|
|
|
16686
16686
|
key: string;
|
|
16687
16687
|
value: string;
|
|
16688
16688
|
}[];
|
|
16689
|
-
/** @description Account-status events to subscribe to (default: all
|
|
16689
|
+
/** @description Account-status events to subscribe to (default: all 11 lifecycle events) */
|
|
16690
16690
|
events?: ("account.created" | "account.connected" | "account.synced" | "account.reconnected" | "account.reconnect_needed" | "account.creation_failed" | "account.disconnected" | "account.error" | "account.paused" | "account.connecting" | "account.permission_revoked" | "account.initial_sync.running" | "account.initial_sync.completed" | "account.initial_sync.failed")[];
|
|
16691
16691
|
};
|
|
16692
16692
|
};
|