@usethrottle/webhook-types 5.0.0 → 5.0.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/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -957,7 +957,7 @@ export type ThrottleEventOfType<T extends WebhookEventType> = Extract<ThrottleEv
|
|
|
957
957
|
* from the @core/scopes canonical registry. */
|
|
958
958
|
export declare const WEBHOOK_EVENT_TYPES: readonly ["cart.created", "cart.updated", "cart.item_added", "cart.item_updated", "cart.item_removed", "cart.shipping_selected", "cart.shipping_cleared", "cart.discount_applied", "cart.discount_removed", "cart.tax_recomputed", "cart.checkout_started", "cart.converted", "cart.abandoned", "cart.merged", "order.created", "order.updated", "order.fulfilled", "order.cancelled", "order.closed", "order.sync_failed", "order.sync_conflict", "order.comped", "order.comp_reversed", "order.held", "order.hold_released", "return.created", "return.updated", "quote.requested", "quote.proposed", "quote.viewed", "quote.comment_added", "quote.revision_requested", "quote.declined", "quote.accepted", "quote.converted", "quote.expired", "payment.pending", "payment.authorized", "payment.processing", "payment.captured", "payment.failed", "payment.voided", "payment.expired", "payment.recorded", "payment.refunded", "payment.partially_refunded", "payment.refund_failed", "payment.vaulted", "payment.disputed", "payment.dispute_cleared", "fulfillment.created", "fulfillment.completed", "fulfillment.cancelled", "fulfillment.shipment.shipped", "fulfillment.shipment.delivered", "fulfillment.digital.delivered", "subscription.created", "subscription.activated", "subscription.updated", "subscription.plan_changed", "subscription.plan_change_scheduled", "subscription.paused", "subscription.resumed", "subscription.cancelled", "subscription.completed", "subscription.renewed", "subscription.past_due", "subscription.payment_failed", "subscription.backup_pm_used", "subscription.create_failed", "subscription.trial_blocked", "discount.applied", "discount.removed", "customer.created", "customer.updated", "customer.deleted", "customer.payment_method_added", "customer.payment_method_removed", "customer.registered", "customer.email_verified", "customer.password_changed", "customer.sessions_revoked", "invoice.past_due", "import.completed", "shipping_tax.provider_connection.unhealthy", "workspace.payment_method.added", "workspace.payment_method.removed", "workspace.payment_method.default_changed", "workspace.payment_method.backup_set", "workspace.payment_method.backup_used", "workspace.platform_charge.succeeded", "workspace.platform_charge.failed", "workspace.trial_expired"];
|
|
959
959
|
/**
|
|
960
|
-
* Verifies the `Throttle-Signature` header against the raw request body.
|
|
960
|
+
* Verifies the `X-Throttle-Signature` header against the raw request body.
|
|
961
961
|
* Use this from your webhook handler BEFORE parsing the JSON.
|
|
962
962
|
*
|
|
963
963
|
* Header format: `t=<timestamp>,v1=<hex>` — or `t=<timestamp>,v1=<hex>,v1=<hex>`
|
|
@@ -965,7 +965,7 @@ export declare const WEBHOOK_EVENT_TYPES: readonly ["cart.created", "cart.update
|
|
|
965
965
|
* last); any matching digest verifies. The HMAC is computed over
|
|
966
966
|
* `${timestamp}.${rawBody}` with the endpoint's signing secret
|
|
967
967
|
* (returned as `signingSecret` when you created the endpoint via
|
|
968
|
-
* POST /api/v1/
|
|
968
|
+
* POST /api/v1/webhook-endpoints). Reject if the timestamp is more than
|
|
969
969
|
* `toleranceSeconds` old (default 5 minutes) — protects against replay.
|
|
970
970
|
*/
|
|
971
971
|
export declare function verifyWebhookSignature(args: {
|
package/dist/index.js
CHANGED
|
@@ -157,7 +157,7 @@ const _assertAllEventsListed = true;
|
|
|
157
157
|
// Signature verification (Stripe-compatible scheme)
|
|
158
158
|
// ----------------------------------------------------------------------------
|
|
159
159
|
/**
|
|
160
|
-
* Verifies the `Throttle-Signature` header against the raw request body.
|
|
160
|
+
* Verifies the `X-Throttle-Signature` header against the raw request body.
|
|
161
161
|
* Use this from your webhook handler BEFORE parsing the JSON.
|
|
162
162
|
*
|
|
163
163
|
* Header format: `t=<timestamp>,v1=<hex>` — or `t=<timestamp>,v1=<hex>,v1=<hex>`
|
|
@@ -165,7 +165,7 @@ const _assertAllEventsListed = true;
|
|
|
165
165
|
* last); any matching digest verifies. The HMAC is computed over
|
|
166
166
|
* `${timestamp}.${rawBody}` with the endpoint's signing secret
|
|
167
167
|
* (returned as `signingSecret` when you created the endpoint via
|
|
168
|
-
* POST /api/v1/
|
|
168
|
+
* POST /api/v1/webhook-endpoints). Reject if the timestamp is more than
|
|
169
169
|
* `toleranceSeconds` old (default 5 minutes) — protects against replay.
|
|
170
170
|
*/
|
|
171
171
|
export function verifyWebhookSignature(args) {
|