@convertrilo/sdk 0.0.6 → 0.0.8
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/src/types.d.ts +16 -5
- package/docs/WEBHOOKS.md +24 -1
- package/openapi.yaml +14 -9
- package/package.json +1 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -564,7 +564,7 @@ export interface paths {
|
|
|
564
564
|
};
|
|
565
565
|
/**
|
|
566
566
|
* List webhooks
|
|
567
|
-
* @description List managed webhook subscriptions for the authenticated user. Managed webhook deliveries include HMAC-SHA256 signatures.
|
|
567
|
+
* @description List managed webhook subscriptions for the authenticated user. API keys need the `webhooks:manage` scope. Managed webhook deliveries include HMAC-SHA256 signatures.
|
|
568
568
|
*/
|
|
569
569
|
get: {
|
|
570
570
|
parameters: {
|
|
@@ -591,6 +591,7 @@ export interface paths {
|
|
|
591
591
|
* Create a webhook
|
|
592
592
|
* @description Create a managed webhook subscription. The response includes `secret` exactly once.
|
|
593
593
|
* Store it securely and use it to verify `X-Webhook-Signature`.
|
|
594
|
+
* API keys need the `webhooks:manage` scope.
|
|
594
595
|
*/
|
|
595
596
|
post: {
|
|
596
597
|
parameters: {
|
|
@@ -633,7 +634,7 @@ export interface paths {
|
|
|
633
634
|
put?: never;
|
|
634
635
|
/**
|
|
635
636
|
* Test a webhook
|
|
636
|
-
* @description Sends a `webhook.test` event to the configured URL using the same HMAC signature header as managed deliveries.
|
|
637
|
+
* @description Sends a `webhook.test` event to the configured URL using the same HMAC signature header as managed deliveries. API keys need the `webhooks:manage` scope.
|
|
637
638
|
*/
|
|
638
639
|
post: {
|
|
639
640
|
parameters: {
|
|
@@ -655,7 +656,10 @@ export interface paths {
|
|
|
655
656
|
};
|
|
656
657
|
};
|
|
657
658
|
};
|
|
658
|
-
/**
|
|
659
|
+
/**
|
|
660
|
+
* Delete a webhook
|
|
661
|
+
* @description API keys need the `webhooks:manage` scope.
|
|
662
|
+
*/
|
|
659
663
|
delete: {
|
|
660
664
|
parameters: {
|
|
661
665
|
query?: never;
|
|
@@ -678,7 +682,10 @@ export interface paths {
|
|
|
678
682
|
};
|
|
679
683
|
options?: never;
|
|
680
684
|
head?: never;
|
|
681
|
-
/**
|
|
685
|
+
/**
|
|
686
|
+
* Update a webhook
|
|
687
|
+
* @description API keys need the `webhooks:manage` scope.
|
|
688
|
+
*/
|
|
682
689
|
patch: {
|
|
683
690
|
parameters: {
|
|
684
691
|
query?: never;
|
|
@@ -716,7 +723,7 @@ export interface paths {
|
|
|
716
723
|
};
|
|
717
724
|
/**
|
|
718
725
|
* List webhook delivery attempts
|
|
719
|
-
* @description Returns the 50 most recent managed or test delivery attempts for this webhook.
|
|
726
|
+
* @description Returns the 50 most recent managed or test delivery attempts for this webhook. API keys need the `webhooks:manage` scope.
|
|
720
727
|
*/
|
|
721
728
|
get: {
|
|
722
729
|
parameters: {
|
|
@@ -1723,6 +1730,10 @@ export interface components {
|
|
|
1723
1730
|
error?: string | null;
|
|
1724
1731
|
attempt?: number;
|
|
1725
1732
|
/** Format: date-time */
|
|
1733
|
+
nextRetryAt?: string | null;
|
|
1734
|
+
/** Format: date-time */
|
|
1735
|
+
retriedAt?: string | null;
|
|
1736
|
+
/** Format: date-time */
|
|
1726
1737
|
createdAt?: string;
|
|
1727
1738
|
};
|
|
1728
1739
|
WebhookDeliveryListResponse: {
|
package/docs/WEBHOOKS.md
CHANGED
|
@@ -127,7 +127,28 @@ export async function POST(req: NextRequest) {
|
|
|
127
127
|
- A webhook is automatically disabled after 10 consecutive failures
|
|
128
128
|
- Re-enable it with `PATCH /webhooks/{id}` and `{ "isActive": true }`
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
Failed managed deliveries are scheduled for retry when possible.
|
|
131
|
+
|
|
132
|
+
Retry schedule:
|
|
133
|
+
|
|
134
|
+
- Attempt 2: about 1 minute after the failed attempt
|
|
135
|
+
- Attempt 3: about 5 minutes after the failed attempt
|
|
136
|
+
- Attempt 4: about 30 minutes after the failed attempt
|
|
137
|
+
|
|
138
|
+
Run due retries with:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pnpm run webhooks:retry
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use `--limit` to cap one run:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pnpm run webhooks:retry -- --limit=50
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Schedule this command every minute in production. Webhooks are still disabled after
|
|
151
|
+
10 consecutive failures.
|
|
131
152
|
|
|
132
153
|
## Delivery History
|
|
133
154
|
|
|
@@ -153,6 +174,8 @@ The response includes the 50 most recent attempts for that webhook:
|
|
|
153
174
|
"responseBody": null,
|
|
154
175
|
"error": null,
|
|
155
176
|
"attempt": 1,
|
|
177
|
+
"nextRetryAt": null,
|
|
178
|
+
"retriedAt": null,
|
|
156
179
|
"createdAt": "2026-06-09T07:30:00.000Z"
|
|
157
180
|
}
|
|
158
181
|
]
|
package/openapi.yaml
CHANGED
|
@@ -364,6 +364,8 @@ components:
|
|
|
364
364
|
nullable: true
|
|
365
365
|
description: Network, timeout, or delivery error, truncated to 2048 characters.
|
|
366
366
|
attempt: { type: integer }
|
|
367
|
+
nextRetryAt: { type: string, format: date-time, nullable: true }
|
|
368
|
+
retriedAt: { type: string, format: date-time, nullable: true }
|
|
367
369
|
createdAt: { type: string, format: date-time }
|
|
368
370
|
WebhookDeliveryListResponse:
|
|
369
371
|
type: object
|
|
@@ -837,9 +839,9 @@ paths:
|
|
|
837
839
|
|
|
838
840
|
/webhooks:
|
|
839
841
|
get:
|
|
840
|
-
security: [{ BearerAuth: [] }]
|
|
842
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
841
843
|
summary: List webhooks
|
|
842
|
-
description: List managed webhook subscriptions for the authenticated user. Managed webhook deliveries include HMAC-SHA256 signatures.
|
|
844
|
+
description: List managed webhook subscriptions for the authenticated user. API keys need the `webhooks:manage` scope. Managed webhook deliveries include HMAC-SHA256 signatures.
|
|
843
845
|
responses:
|
|
844
846
|
"200":
|
|
845
847
|
description: List of webhooks
|
|
@@ -848,11 +850,12 @@ paths:
|
|
|
848
850
|
schema:
|
|
849
851
|
$ref: "#/components/schemas/WebhookListResponse"
|
|
850
852
|
post:
|
|
851
|
-
security: [{ BearerAuth: [] }]
|
|
853
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
852
854
|
summary: Create a webhook
|
|
853
855
|
description: |
|
|
854
856
|
Create a managed webhook subscription. The response includes `secret` exactly once.
|
|
855
857
|
Store it securely and use it to verify `X-Webhook-Signature`.
|
|
858
|
+
API keys need the `webhooks:manage` scope.
|
|
856
859
|
requestBody:
|
|
857
860
|
required: true
|
|
858
861
|
content:
|
|
@@ -874,8 +877,9 @@ paths:
|
|
|
874
877
|
$ref: "#/components/schemas/WebhookResponse"
|
|
875
878
|
/webhooks/{id}:
|
|
876
879
|
patch:
|
|
877
|
-
security: [{ BearerAuth: [] }]
|
|
880
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
878
881
|
summary: Update a webhook
|
|
882
|
+
description: API keys need the `webhooks:manage` scope.
|
|
879
883
|
parameters:
|
|
880
884
|
- in: path
|
|
881
885
|
name: id
|
|
@@ -904,8 +908,9 @@ paths:
|
|
|
904
908
|
schema:
|
|
905
909
|
$ref: "#/components/schemas/WebhookResponse"
|
|
906
910
|
delete:
|
|
907
|
-
security: [{ BearerAuth: [] }]
|
|
911
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
908
912
|
summary: Delete a webhook
|
|
913
|
+
description: API keys need the `webhooks:manage` scope.
|
|
909
914
|
parameters:
|
|
910
915
|
- in: path
|
|
911
916
|
name: id
|
|
@@ -914,9 +919,9 @@ paths:
|
|
|
914
919
|
responses:
|
|
915
920
|
"204": { description: Deleted }
|
|
916
921
|
post:
|
|
917
|
-
security: [{ BearerAuth: [] }]
|
|
922
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
918
923
|
summary: Test a webhook
|
|
919
|
-
description: Sends a `webhook.test` event to the configured URL using the same HMAC signature header as managed deliveries.
|
|
924
|
+
description: Sends a `webhook.test` event to the configured URL using the same HMAC signature header as managed deliveries. API keys need the `webhooks:manage` scope.
|
|
920
925
|
parameters:
|
|
921
926
|
- in: path
|
|
922
927
|
name: id
|
|
@@ -926,9 +931,9 @@ paths:
|
|
|
926
931
|
"200": { description: Test event sent }
|
|
927
932
|
/webhooks/{id}/deliveries:
|
|
928
933
|
get:
|
|
929
|
-
security: [{ BearerAuth: [] }]
|
|
934
|
+
security: [{ BearerAuth: [] }, { ApiKeyAuth: [] }]
|
|
930
935
|
summary: List webhook delivery attempts
|
|
931
|
-
description: Returns the 50 most recent managed or test delivery attempts for this webhook.
|
|
936
|
+
description: Returns the 50 most recent managed or test delivery attempts for this webhook. API keys need the `webhooks:manage` scope.
|
|
932
937
|
parameters:
|
|
933
938
|
- in: path
|
|
934
939
|
name: id
|