@weftlabs/sdk 0.32.1 → 0.32.2
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/facilitator/middleware/index.js +1 -1
- package/dist/facilitator/middleware/index.js.map +1 -1
- package/dist/facilitator/middleware/index.mjs +1 -1
- package/dist/facilitator/middleware/index.mjs.map +1 -1
- package/dist/index.d.mts +315 -211
- package/dist/index.d.ts +315 -211
- package/dist/index.js +228 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +228 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +1 -1
- package/dist/server.mjs.map +1 -1
- package/docs/APIKeysApi.md +3 -1
- package/docs/AuthApi.md +3 -0
- package/docs/PaymentsApi.md +3 -1
- package/docs/WebhooksApi.md +435 -0
- package/package.json +1 -1
package/docs/APIKeysApi.md
CHANGED
|
@@ -79,6 +79,7 @@ example().catch(console.error);
|
|
|
79
79
|
| **201** | API key created (includes raw key, shown only once) | - |
|
|
80
80
|
| **401** | Unauthorized | - |
|
|
81
81
|
| **422** | Validation error | - |
|
|
82
|
+
| **403** | The credential authenticated but cannot administer organization keys. Account-scoped keys have no organization context (`ORGANIZATION_REQUIRED`). A resource key with `product_id` set is product-scoped (`ORGANIZATION_SCOPE_REQUIRED`). A resource key with `product_id` nil keeps organization scope. | - |
|
|
82
83
|
|
|
83
84
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
84
85
|
|
|
@@ -143,7 +144,7 @@ This endpoint does not need any parameter.
|
|
|
143
144
|
|-------------|-------------|------------------|
|
|
144
145
|
| **200** | List of API keys | - |
|
|
145
146
|
| **401** | Unauthorized | - |
|
|
146
|
-
| **403** | The credential authenticated but
|
|
147
|
+
| **403** | The credential authenticated but cannot administer organization keys. Account-scoped keys have no organization context (`ORGANIZATION_REQUIRED`). A resource key with `product_id` set is product-scoped (`ORGANIZATION_SCOPE_REQUIRED`). A resource key with `product_id` nil keeps organization scope. | - |
|
|
147
148
|
|
|
148
149
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
149
150
|
|
|
@@ -215,5 +216,6 @@ example().catch(console.error);
|
|
|
215
216
|
| **200** | API key revoked | - |
|
|
216
217
|
| **401** | Unauthorized | - |
|
|
217
218
|
| **404** | API key not found | - |
|
|
219
|
+
| **403** | The credential authenticated but cannot administer organization keys. Account-scoped keys have no organization context (`ORGANIZATION_REQUIRED`). A resource key with `product_id` set is product-scoped (`ORGANIZATION_SCOPE_REQUIRED`). A resource key with `product_id` nil keeps organization scope. | - |
|
|
218
220
|
|
|
219
221
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
package/docs/AuthApi.md
CHANGED
|
@@ -140,6 +140,7 @@ No authorization required
|
|
|
140
140
|
| Status code | Description | Response headers |
|
|
141
141
|
|-------------|-------------|------------------|
|
|
142
142
|
| **200** | Reset email sent | - |
|
|
143
|
+
| **413** | Request body exceeds the 4 KiB limit | - |
|
|
143
144
|
|
|
144
145
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
145
146
|
|
|
@@ -205,6 +206,7 @@ No authorization required
|
|
|
205
206
|
| Status code | Description | Response headers |
|
|
206
207
|
|-------------|-------------|------------------|
|
|
207
208
|
| **200** | Confirmation sent | - |
|
|
209
|
+
| **413** | Request body exceeds the 4 KiB limit | - |
|
|
208
210
|
|
|
209
211
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
210
212
|
|
|
@@ -271,6 +273,7 @@ No authorization required
|
|
|
271
273
|
|-------------|-------------|------------------|
|
|
272
274
|
| **200** | Signed in | - |
|
|
273
275
|
| **401** | Invalid credentials | - |
|
|
276
|
+
| **413** | Request body exceeds the 4 KiB limit | - |
|
|
274
277
|
|
|
275
278
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
276
279
|
|
package/docs/PaymentsApi.md
CHANGED
|
@@ -75,7 +75,7 @@ example().catch(console.error);
|
|
|
75
75
|
|-------------|-------------|------------------|
|
|
76
76
|
| **200** | Payment details | - |
|
|
77
77
|
| **401** | Unauthorized | - |
|
|
78
|
-
| **404** | Payment not found | - |
|
|
78
|
+
| **404** | Payment not found, including a payment outside the key\'s product scope. | - |
|
|
79
79
|
|
|
80
80
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
81
81
|
|
|
@@ -86,6 +86,8 @@ example().catch(console.error);
|
|
|
86
86
|
|
|
87
87
|
List payments
|
|
88
88
|
|
|
89
|
+
Seller payment receipts for the authenticated organization. A resource key with `product_id` set returns only payments whose `product_id` is that product. A resource key with `product_id` nil returns the organization. A payment outside that scope is not found.
|
|
90
|
+
|
|
89
91
|
### Example
|
|
90
92
|
|
|
91
93
|
```ts
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# WebhooksApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://weft.network*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createWebhookEndpoint**](WebhooksApi.md#createwebhookendpoint) | **POST** /api/v1/webhook_endpoints | Create a webhook endpoint |
|
|
8
|
+
| [**deleteWebhookEndpoint**](WebhooksApi.md#deletewebhookendpoint) | **DELETE** /api/v1/webhook_endpoints/{id} | Delete a webhook endpoint |
|
|
9
|
+
| [**getWebhookEndpoint**](WebhooksApi.md#getwebhookendpoint) | **GET** /api/v1/webhook_endpoints/{id} | Get a webhook endpoint |
|
|
10
|
+
| [**listWebhookEndpoints**](WebhooksApi.md#listwebhookendpoints) | **GET** /api/v1/webhook_endpoints | List webhook endpoints |
|
|
11
|
+
| [**replaceWebhookEndpoint**](WebhooksApi.md#replacewebhookendpoint) | **PUT** /api/v1/webhook_endpoints/{id} | Replace a webhook endpoint |
|
|
12
|
+
| [**updateWebhookEndpoint**](WebhooksApi.md#updatewebhookendpoint) | **PATCH** /api/v1/webhook_endpoints/{id} | Update a webhook endpoint |
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## createWebhookEndpoint
|
|
17
|
+
|
|
18
|
+
> createWebhookEndpoint()
|
|
19
|
+
|
|
20
|
+
Create a webhook endpoint
|
|
21
|
+
|
|
22
|
+
Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
23
|
+
|
|
24
|
+
### Example
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import {
|
|
28
|
+
Configuration,
|
|
29
|
+
WebhooksApi,
|
|
30
|
+
} from '@weftlabs/sdk';
|
|
31
|
+
import type { CreateWebhookEndpointRequest } from '@weftlabs/sdk';
|
|
32
|
+
|
|
33
|
+
async function example() {
|
|
34
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
35
|
+
const config = new Configuration({
|
|
36
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
37
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
38
|
+
});
|
|
39
|
+
const api = new WebhooksApi(config);
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const data = await api.createWebhookEndpoint();
|
|
43
|
+
console.log(data);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Run the test
|
|
50
|
+
example().catch(console.error);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Parameters
|
|
54
|
+
|
|
55
|
+
This endpoint does not need any parameter.
|
|
56
|
+
|
|
57
|
+
### Return type
|
|
58
|
+
|
|
59
|
+
`void` (Empty response body)
|
|
60
|
+
|
|
61
|
+
### Authorization
|
|
62
|
+
|
|
63
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
64
|
+
|
|
65
|
+
### HTTP request headers
|
|
66
|
+
|
|
67
|
+
- **Content-Type**: Not defined
|
|
68
|
+
- **Accept**: `application/json`
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### HTTP response details
|
|
72
|
+
| Status code | Description | Response headers |
|
|
73
|
+
|-------------|-------------|------------------|
|
|
74
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
75
|
+
| **401** | Unauthorized | - |
|
|
76
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
77
|
+
|
|
78
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## deleteWebhookEndpoint
|
|
82
|
+
|
|
83
|
+
> deleteWebhookEndpoint(id)
|
|
84
|
+
|
|
85
|
+
Delete a webhook endpoint
|
|
86
|
+
|
|
87
|
+
Retired. Returns HTTP 410 with error code `gone`. Stored rows are kept.
|
|
88
|
+
|
|
89
|
+
### Example
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import {
|
|
93
|
+
Configuration,
|
|
94
|
+
WebhooksApi,
|
|
95
|
+
} from '@weftlabs/sdk';
|
|
96
|
+
import type { DeleteWebhookEndpointRequest } from '@weftlabs/sdk';
|
|
97
|
+
|
|
98
|
+
async function example() {
|
|
99
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
100
|
+
const config = new Configuration({
|
|
101
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
102
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
103
|
+
});
|
|
104
|
+
const api = new WebhooksApi(config);
|
|
105
|
+
|
|
106
|
+
const body = {
|
|
107
|
+
// number | Webhook endpoint ID. Ignored. The response is always HTTP 410.
|
|
108
|
+
id: 56,
|
|
109
|
+
} satisfies DeleteWebhookEndpointRequest;
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
const data = await api.deleteWebhookEndpoint(body);
|
|
113
|
+
console.log(data);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error(error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Run the test
|
|
120
|
+
example().catch(console.error);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Parameters
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
| Name | Type | Description | Notes |
|
|
127
|
+
|------------- | ------------- | ------------- | -------------|
|
|
128
|
+
| **id** | `number` | Webhook endpoint ID. Ignored. The response is always HTTP 410. | [Defaults to `undefined`] |
|
|
129
|
+
|
|
130
|
+
### Return type
|
|
131
|
+
|
|
132
|
+
`void` (Empty response body)
|
|
133
|
+
|
|
134
|
+
### Authorization
|
|
135
|
+
|
|
136
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
137
|
+
|
|
138
|
+
### HTTP request headers
|
|
139
|
+
|
|
140
|
+
- **Content-Type**: Not defined
|
|
141
|
+
- **Accept**: `application/json`
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### HTTP response details
|
|
145
|
+
| Status code | Description | Response headers |
|
|
146
|
+
|-------------|-------------|------------------|
|
|
147
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
148
|
+
| **401** | Unauthorized | - |
|
|
149
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
150
|
+
|
|
151
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## getWebhookEndpoint
|
|
155
|
+
|
|
156
|
+
> getWebhookEndpoint(id)
|
|
157
|
+
|
|
158
|
+
Get a webhook endpoint
|
|
159
|
+
|
|
160
|
+
Retired. Returns HTTP 410 with error code `gone`.
|
|
161
|
+
|
|
162
|
+
### Example
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
import {
|
|
166
|
+
Configuration,
|
|
167
|
+
WebhooksApi,
|
|
168
|
+
} from '@weftlabs/sdk';
|
|
169
|
+
import type { GetWebhookEndpointRequest } from '@weftlabs/sdk';
|
|
170
|
+
|
|
171
|
+
async function example() {
|
|
172
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
173
|
+
const config = new Configuration({
|
|
174
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
175
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
176
|
+
});
|
|
177
|
+
const api = new WebhooksApi(config);
|
|
178
|
+
|
|
179
|
+
const body = {
|
|
180
|
+
// number | Webhook endpoint ID. Ignored. The response is always HTTP 410.
|
|
181
|
+
id: 56,
|
|
182
|
+
} satisfies GetWebhookEndpointRequest;
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const data = await api.getWebhookEndpoint(body);
|
|
186
|
+
console.log(data);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error(error);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Run the test
|
|
193
|
+
example().catch(console.error);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Parameters
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
| Name | Type | Description | Notes |
|
|
200
|
+
|------------- | ------------- | ------------- | -------------|
|
|
201
|
+
| **id** | `number` | Webhook endpoint ID. Ignored. The response is always HTTP 410. | [Defaults to `undefined`] |
|
|
202
|
+
|
|
203
|
+
### Return type
|
|
204
|
+
|
|
205
|
+
`void` (Empty response body)
|
|
206
|
+
|
|
207
|
+
### Authorization
|
|
208
|
+
|
|
209
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
210
|
+
|
|
211
|
+
### HTTP request headers
|
|
212
|
+
|
|
213
|
+
- **Content-Type**: Not defined
|
|
214
|
+
- **Accept**: `application/json`
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### HTTP response details
|
|
218
|
+
| Status code | Description | Response headers |
|
|
219
|
+
|-------------|-------------|------------------|
|
|
220
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
221
|
+
| **401** | Unauthorized | - |
|
|
222
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
223
|
+
|
|
224
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
## listWebhookEndpoints
|
|
228
|
+
|
|
229
|
+
> listWebhookEndpoints()
|
|
230
|
+
|
|
231
|
+
List webhook endpoints
|
|
232
|
+
|
|
233
|
+
Retired. Returns HTTP 410 with error code `gone`.
|
|
234
|
+
|
|
235
|
+
### Example
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
import {
|
|
239
|
+
Configuration,
|
|
240
|
+
WebhooksApi,
|
|
241
|
+
} from '@weftlabs/sdk';
|
|
242
|
+
import type { ListWebhookEndpointsRequest } from '@weftlabs/sdk';
|
|
243
|
+
|
|
244
|
+
async function example() {
|
|
245
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
246
|
+
const config = new Configuration({
|
|
247
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
248
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
249
|
+
});
|
|
250
|
+
const api = new WebhooksApi(config);
|
|
251
|
+
|
|
252
|
+
try {
|
|
253
|
+
const data = await api.listWebhookEndpoints();
|
|
254
|
+
console.log(data);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.error(error);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Run the test
|
|
261
|
+
example().catch(console.error);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Parameters
|
|
265
|
+
|
|
266
|
+
This endpoint does not need any parameter.
|
|
267
|
+
|
|
268
|
+
### Return type
|
|
269
|
+
|
|
270
|
+
`void` (Empty response body)
|
|
271
|
+
|
|
272
|
+
### Authorization
|
|
273
|
+
|
|
274
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
275
|
+
|
|
276
|
+
### HTTP request headers
|
|
277
|
+
|
|
278
|
+
- **Content-Type**: Not defined
|
|
279
|
+
- **Accept**: `application/json`
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
### HTTP response details
|
|
283
|
+
| Status code | Description | Response headers |
|
|
284
|
+
|-------------|-------------|------------------|
|
|
285
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
286
|
+
| **401** | Unauthorized | - |
|
|
287
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
288
|
+
|
|
289
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
## replaceWebhookEndpoint
|
|
293
|
+
|
|
294
|
+
> replaceWebhookEndpoint(id)
|
|
295
|
+
|
|
296
|
+
Replace a webhook endpoint
|
|
297
|
+
|
|
298
|
+
Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
299
|
+
|
|
300
|
+
### Example
|
|
301
|
+
|
|
302
|
+
```ts
|
|
303
|
+
import {
|
|
304
|
+
Configuration,
|
|
305
|
+
WebhooksApi,
|
|
306
|
+
} from '@weftlabs/sdk';
|
|
307
|
+
import type { ReplaceWebhookEndpointRequest } from '@weftlabs/sdk';
|
|
308
|
+
|
|
309
|
+
async function example() {
|
|
310
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
311
|
+
const config = new Configuration({
|
|
312
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
313
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
314
|
+
});
|
|
315
|
+
const api = new WebhooksApi(config);
|
|
316
|
+
|
|
317
|
+
const body = {
|
|
318
|
+
// number | Webhook endpoint ID. Ignored. The response is always HTTP 410.
|
|
319
|
+
id: 56,
|
|
320
|
+
} satisfies ReplaceWebhookEndpointRequest;
|
|
321
|
+
|
|
322
|
+
try {
|
|
323
|
+
const data = await api.replaceWebhookEndpoint(body);
|
|
324
|
+
console.log(data);
|
|
325
|
+
} catch (error) {
|
|
326
|
+
console.error(error);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Run the test
|
|
331
|
+
example().catch(console.error);
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Parameters
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
| Name | Type | Description | Notes |
|
|
338
|
+
|------------- | ------------- | ------------- | -------------|
|
|
339
|
+
| **id** | `number` | Webhook endpoint ID. Ignored. The response is always HTTP 410. | [Defaults to `undefined`] |
|
|
340
|
+
|
|
341
|
+
### Return type
|
|
342
|
+
|
|
343
|
+
`void` (Empty response body)
|
|
344
|
+
|
|
345
|
+
### Authorization
|
|
346
|
+
|
|
347
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
348
|
+
|
|
349
|
+
### HTTP request headers
|
|
350
|
+
|
|
351
|
+
- **Content-Type**: Not defined
|
|
352
|
+
- **Accept**: `application/json`
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
### HTTP response details
|
|
356
|
+
| Status code | Description | Response headers |
|
|
357
|
+
|-------------|-------------|------------------|
|
|
358
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
359
|
+
| **401** | Unauthorized | - |
|
|
360
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
361
|
+
|
|
362
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
## updateWebhookEndpoint
|
|
366
|
+
|
|
367
|
+
> updateWebhookEndpoint(id)
|
|
368
|
+
|
|
369
|
+
Update a webhook endpoint
|
|
370
|
+
|
|
371
|
+
Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
372
|
+
|
|
373
|
+
### Example
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
import {
|
|
377
|
+
Configuration,
|
|
378
|
+
WebhooksApi,
|
|
379
|
+
} from '@weftlabs/sdk';
|
|
380
|
+
import type { UpdateWebhookEndpointRequest } from '@weftlabs/sdk';
|
|
381
|
+
|
|
382
|
+
async function example() {
|
|
383
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
384
|
+
const config = new Configuration({
|
|
385
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
386
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
387
|
+
});
|
|
388
|
+
const api = new WebhooksApi(config);
|
|
389
|
+
|
|
390
|
+
const body = {
|
|
391
|
+
// number | Webhook endpoint ID. Ignored. The response is always HTTP 410.
|
|
392
|
+
id: 56,
|
|
393
|
+
} satisfies UpdateWebhookEndpointRequest;
|
|
394
|
+
|
|
395
|
+
try {
|
|
396
|
+
const data = await api.updateWebhookEndpoint(body);
|
|
397
|
+
console.log(data);
|
|
398
|
+
} catch (error) {
|
|
399
|
+
console.error(error);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Run the test
|
|
404
|
+
example().catch(console.error);
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Parameters
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
| Name | Type | Description | Notes |
|
|
411
|
+
|------------- | ------------- | ------------- | -------------|
|
|
412
|
+
| **id** | `number` | Webhook endpoint ID. Ignored. The response is always HTTP 410. | [Defaults to `undefined`] |
|
|
413
|
+
|
|
414
|
+
### Return type
|
|
415
|
+
|
|
416
|
+
`void` (Empty response body)
|
|
417
|
+
|
|
418
|
+
### Authorization
|
|
419
|
+
|
|
420
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
421
|
+
|
|
422
|
+
### HTTP request headers
|
|
423
|
+
|
|
424
|
+
- **Content-Type**: Not defined
|
|
425
|
+
- **Accept**: `application/json`
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
### HTTP response details
|
|
429
|
+
| Status code | Description | Response headers |
|
|
430
|
+
|-------------|-------------|------------------|
|
|
431
|
+
| **410** | Webhook endpoint management is retired. `error.code` is `gone`. | - |
|
|
432
|
+
| **401** | Unauthorized | - |
|
|
433
|
+
| **403** | The credential authenticated but has no organization context (`ORGANIZATION_REQUIRED`). | - |
|
|
434
|
+
|
|
435
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|