@liqhtworks/sophon-sdk 0.1.0
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/.github/workflows/publish.yml +56 -0
- package/.openapi-generator/FILES +73 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/LICENSE +12 -0
- package/README.md +164 -0
- package/dist/apis/DownloadsApi.d.ts +63 -0
- package/dist/apis/DownloadsApi.js +58 -0
- package/dist/apis/HealthApi.d.ts +92 -0
- package/dist/apis/HealthApi.js +85 -0
- package/dist/apis/JobsApi.d.ts +225 -0
- package/dist/apis/JobsApi.js +245 -0
- package/dist/apis/UploadsApi.d.ts +228 -0
- package/dist/apis/UploadsApi.js +255 -0
- package/dist/apis/WebhooksApi.d.ts +138 -0
- package/dist/apis/WebhooksApi.js +152 -0
- package/dist/apis/index.d.ts +5 -0
- package/dist/apis/index.js +23 -0
- package/dist/esm/apis/DownloadsApi.d.ts +63 -0
- package/dist/esm/apis/DownloadsApi.js +54 -0
- package/dist/esm/apis/HealthApi.d.ts +92 -0
- package/dist/esm/apis/HealthApi.js +81 -0
- package/dist/esm/apis/JobsApi.d.ts +225 -0
- package/dist/esm/apis/JobsApi.js +241 -0
- package/dist/esm/apis/UploadsApi.d.ts +228 -0
- package/dist/esm/apis/UploadsApi.js +251 -0
- package/dist/esm/apis/WebhooksApi.d.ts +138 -0
- package/dist/esm/apis/WebhooksApi.js +148 -0
- package/dist/esm/apis/index.d.ts +5 -0
- package/dist/esm/apis/index.js +7 -0
- package/dist/esm/helpers/index.d.ts +3 -0
- package/dist/esm/helpers/index.js +3 -0
- package/dist/esm/helpers/jobs.d.ts +48 -0
- package/dist/esm/helpers/jobs.js +61 -0
- package/dist/esm/helpers/uploads.d.ts +71 -0
- package/dist/esm/helpers/uploads.js +146 -0
- package/dist/esm/helpers/webhooks.d.ts +23 -0
- package/dist/esm/helpers/webhooks.js +84 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/models/CompleteUploadResponse.d.ts +57 -0
- package/dist/esm/models/CompleteUploadResponse.js +63 -0
- package/dist/esm/models/CreateJobOutputOptions.d.ts +55 -0
- package/dist/esm/models/CreateJobOutputOptions.js +46 -0
- package/dist/esm/models/CreateJobRequest.d.ts +61 -0
- package/dist/esm/models/CreateJobRequest.js +56 -0
- package/dist/esm/models/CreateUploadRequest.d.ts +44 -0
- package/dist/esm/models/CreateUploadRequest.js +51 -0
- package/dist/esm/models/CreateUploadResponse.d.ts +52 -0
- package/dist/esm/models/CreateUploadResponse.js +55 -0
- package/dist/esm/models/CreateWebhookRequest.d.ts +40 -0
- package/dist/esm/models/CreateWebhookRequest.js +45 -0
- package/dist/esm/models/ErrorBody.d.ts +72 -0
- package/dist/esm/models/ErrorBody.js +74 -0
- package/dist/esm/models/ErrorEnvelope.d.ts +33 -0
- package/dist/esm/models/ErrorEnvelope.js +44 -0
- package/dist/esm/models/JobOutputInfo.d.ts +95 -0
- package/dist/esm/models/JobOutputInfo.js +72 -0
- package/dist/esm/models/JobProfile.d.ts +49 -0
- package/dist/esm/models/JobProfile.js +69 -0
- package/dist/esm/models/JobProgress.d.ts +75 -0
- package/dist/esm/models/JobProgress.js +60 -0
- package/dist/esm/models/JobResponse.d.ts +134 -0
- package/dist/esm/models/JobResponse.js +94 -0
- package/dist/esm/models/JobSourceInfo.d.ts +62 -0
- package/dist/esm/models/JobSourceInfo.js +53 -0
- package/dist/esm/models/JobSourceType.d.ts +24 -0
- package/dist/esm/models/JobSourceType.js +44 -0
- package/dist/esm/models/JobStatus.d.ts +31 -0
- package/dist/esm/models/JobStatus.js +51 -0
- package/dist/esm/models/ListJobsResponse.d.ts +45 -0
- package/dist/esm/models/ListJobsResponse.js +50 -0
- package/dist/esm/models/OutputContainer.d.ts +27 -0
- package/dist/esm/models/OutputContainer.js +47 -0
- package/dist/esm/models/ReadyResponse.d.ts +38 -0
- package/dist/esm/models/ReadyResponse.js +45 -0
- package/dist/esm/models/UploadJobSource.d.ts +39 -0
- package/dist/esm/models/UploadJobSource.js +48 -0
- package/dist/esm/models/UploadPartResponse.d.ts +38 -0
- package/dist/esm/models/UploadPartResponse.js +47 -0
- package/dist/esm/models/UploadStatusResponse.d.ts +96 -0
- package/dist/esm/models/UploadStatusResponse.js +80 -0
- package/dist/esm/models/WebhookDeliveryPayload.d.ts +85 -0
- package/dist/esm/models/WebhookDeliveryPayload.js +83 -0
- package/dist/esm/models/WebhookListItem.d.ts +50 -0
- package/dist/esm/models/WebhookListItem.js +55 -0
- package/dist/esm/models/WebhookListResponse.d.ts +33 -0
- package/dist/esm/models/WebhookListResponse.js +44 -0
- package/dist/esm/models/WebhookResponse.d.ts +58 -0
- package/dist/esm/models/WebhookResponse.js +59 -0
- package/dist/esm/models/index.d.ts +25 -0
- package/dist/esm/models/index.js +27 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +348 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +19 -0
- package/dist/helpers/jobs.d.ts +48 -0
- package/dist/helpers/jobs.js +67 -0
- package/dist/helpers/uploads.d.ts +71 -0
- package/dist/helpers/uploads.js +149 -0
- package/dist/helpers/webhooks.d.ts +23 -0
- package/dist/helpers/webhooks.js +89 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/models/CompleteUploadResponse.d.ts +57 -0
- package/dist/models/CompleteUploadResponse.js +71 -0
- package/dist/models/CreateJobOutputOptions.d.ts +55 -0
- package/dist/models/CreateJobOutputOptions.js +53 -0
- package/dist/models/CreateJobRequest.d.ts +61 -0
- package/dist/models/CreateJobRequest.js +63 -0
- package/dist/models/CreateUploadRequest.d.ts +44 -0
- package/dist/models/CreateUploadRequest.js +58 -0
- package/dist/models/CreateUploadResponse.d.ts +52 -0
- package/dist/models/CreateUploadResponse.js +62 -0
- package/dist/models/CreateWebhookRequest.d.ts +40 -0
- package/dist/models/CreateWebhookRequest.js +52 -0
- package/dist/models/ErrorBody.d.ts +72 -0
- package/dist/models/ErrorBody.js +82 -0
- package/dist/models/ErrorEnvelope.d.ts +33 -0
- package/dist/models/ErrorEnvelope.js +51 -0
- package/dist/models/JobOutputInfo.d.ts +95 -0
- package/dist/models/JobOutputInfo.js +80 -0
- package/dist/models/JobProfile.d.ts +49 -0
- package/dist/models/JobProfile.js +77 -0
- package/dist/models/JobProgress.d.ts +75 -0
- package/dist/models/JobProgress.js +67 -0
- package/dist/models/JobResponse.d.ts +134 -0
- package/dist/models/JobResponse.js +101 -0
- package/dist/models/JobSourceInfo.d.ts +62 -0
- package/dist/models/JobSourceInfo.js +60 -0
- package/dist/models/JobSourceType.d.ts +24 -0
- package/dist/models/JobSourceType.js +52 -0
- package/dist/models/JobStatus.d.ts +31 -0
- package/dist/models/JobStatus.js +59 -0
- package/dist/models/ListJobsResponse.d.ts +45 -0
- package/dist/models/ListJobsResponse.js +57 -0
- package/dist/models/OutputContainer.d.ts +27 -0
- package/dist/models/OutputContainer.js +55 -0
- package/dist/models/ReadyResponse.d.ts +38 -0
- package/dist/models/ReadyResponse.js +52 -0
- package/dist/models/UploadJobSource.d.ts +39 -0
- package/dist/models/UploadJobSource.js +55 -0
- package/dist/models/UploadPartResponse.d.ts +38 -0
- package/dist/models/UploadPartResponse.js +54 -0
- package/dist/models/UploadStatusResponse.d.ts +96 -0
- package/dist/models/UploadStatusResponse.js +88 -0
- package/dist/models/WebhookDeliveryPayload.d.ts +85 -0
- package/dist/models/WebhookDeliveryPayload.js +91 -0
- package/dist/models/WebhookListItem.d.ts +50 -0
- package/dist/models/WebhookListItem.js +62 -0
- package/dist/models/WebhookListResponse.d.ts +33 -0
- package/dist/models/WebhookListResponse.js +51 -0
- package/dist/models/WebhookResponse.d.ts +58 -0
- package/dist/models/WebhookResponse.js +66 -0
- package/dist/models/index.d.ts +25 -0
- package/dist/models/index.js +43 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +364 -0
- package/docs/CompleteUploadResponse.md +40 -0
- package/docs/CreateJobOutputOptions.md +39 -0
- package/docs/CreateJobRequest.md +42 -0
- package/docs/CreateUploadRequest.md +38 -0
- package/docs/CreateUploadResponse.md +40 -0
- package/docs/CreateWebhookRequest.md +36 -0
- package/docs/DownloadsApi.md +78 -0
- package/docs/ErrorBody.md +40 -0
- package/docs/ErrorEnvelope.md +34 -0
- package/docs/HealthApi.md +129 -0
- package/docs/JobOutputInfo.md +50 -0
- package/docs/JobProfile.md +33 -0
- package/docs/JobProgress.md +48 -0
- package/docs/JobResponse.md +62 -0
- package/docs/JobSourceInfo.md +44 -0
- package/docs/JobSourceType.md +33 -0
- package/docs/JobStatus.md +33 -0
- package/docs/JobsApi.md +407 -0
- package/docs/ListJobsResponse.md +38 -0
- package/docs/OutputContainer.md +33 -0
- package/docs/ReadyResponse.md +36 -0
- package/docs/UploadJobSource.md +37 -0
- package/docs/UploadPartResponse.md +36 -0
- package/docs/UploadStatusResponse.md +50 -0
- package/docs/UploadsApi.md +415 -0
- package/docs/WebhookDeliveryPayload.md +45 -0
- package/docs/WebhookEventsApi.md +91 -0
- package/docs/WebhookListItem.md +40 -0
- package/docs/WebhookListResponse.md +34 -0
- package/docs/WebhookResponse.md +42 -0
- package/docs/WebhooksApi.md +235 -0
- package/package.json +24 -0
- package/src/apis/DownloadsApi.ts +114 -0
- package/src/apis/HealthApi.ts +160 -0
- package/src/apis/JobsApi.ts +491 -0
- package/src/apis/UploadsApi.ts +522 -0
- package/src/apis/WebhooksApi.ts +298 -0
- package/src/apis/index.ts +7 -0
- package/src/helpers/index.ts +3 -0
- package/src/helpers/jobs.ts +112 -0
- package/src/helpers/uploads.ts +243 -0
- package/src/helpers/webhooks.ts +134 -0
- package/src/index.ts +7 -0
- package/src/models/CompleteUploadResponse.ts +102 -0
- package/src/models/CreateJobOutputOptions.ts +101 -0
- package/src/models/CreateJobRequest.ts +123 -0
- package/src/models/CreateUploadRequest.ts +84 -0
- package/src/models/CreateUploadResponse.ts +95 -0
- package/src/models/CreateWebhookRequest.ts +76 -0
- package/src/models/ErrorBody.ts +116 -0
- package/src/models/ErrorEnvelope.ts +74 -0
- package/src/models/JobOutputInfo.ts +149 -0
- package/src/models/JobProfile.ts +76 -0
- package/src/models/JobProgress.ts +133 -0
- package/src/models/JobResponse.ts +236 -0
- package/src/models/JobSourceInfo.ts +106 -0
- package/src/models/JobSourceType.ts +51 -0
- package/src/models/JobStatus.ts +58 -0
- package/src/models/ListJobsResponse.ts +91 -0
- package/src/models/OutputContainer.ts +54 -0
- package/src/models/ReadyResponse.ts +74 -0
- package/src/models/UploadJobSource.ts +85 -0
- package/src/models/UploadPartResponse.ts +75 -0
- package/src/models/UploadStatusResponse.ts +153 -0
- package/src/models/WebhookDeliveryPayload.ts +134 -0
- package/src/models/WebhookListItem.ts +93 -0
- package/src/models/WebhookListResponse.ts +74 -0
- package/src/models/WebhookResponse.ts +104 -0
- package/src/models/index.ts +27 -0
- package/src/runtime.ts +450 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# WebhookListItem
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`url` | string
|
|
11
|
+
`active` | boolean
|
|
12
|
+
`created_at` | Date
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { WebhookListItem } from '@liqhtworks/sophon-sdk'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"id": null,
|
|
22
|
+
"url": null,
|
|
23
|
+
"active": null,
|
|
24
|
+
"created_at": null,
|
|
25
|
+
} satisfies WebhookListItem
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as WebhookListItem
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# WebhookListResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`webhooks` | [Array<WebhookListItem>](WebhookListItem.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { WebhookListResponse } from '@liqhtworks/sophon-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"webhooks": null,
|
|
19
|
+
} satisfies WebhookListResponse
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as WebhookListResponse
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
# WebhookResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`url` | string
|
|
11
|
+
`secret` | string
|
|
12
|
+
`active` | boolean
|
|
13
|
+
`created_at` | Date
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { WebhookResponse } from '@liqhtworks/sophon-sdk'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"id": wh_abc123def456,
|
|
23
|
+
"url": null,
|
|
24
|
+
"secret": null,
|
|
25
|
+
"active": null,
|
|
26
|
+
"created_at": null,
|
|
27
|
+
} satisfies WebhookResponse
|
|
28
|
+
|
|
29
|
+
console.log(example)
|
|
30
|
+
|
|
31
|
+
// Convert the instance to a JSON string
|
|
32
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
33
|
+
console.log(exampleJSON)
|
|
34
|
+
|
|
35
|
+
// Parse the JSON string back to an object
|
|
36
|
+
const exampleParsed = JSON.parse(exampleJSON) as WebhookResponse
|
|
37
|
+
console.log(exampleParsed)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# WebhooksApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.liqhtworks.xyz*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createWebhook**](WebhooksApi.md#createwebhookoperation) | **POST** /v1/webhooks | Register a webhook endpoint |
|
|
8
|
+
| [**deleteWebhook**](WebhooksApi.md#deletewebhook) | **DELETE** /v1/webhooks/{id} | Soft-delete a webhook endpoint |
|
|
9
|
+
| [**listWebhooks**](WebhooksApi.md#listwebhooks) | **GET** /v1/webhooks | List active webhook endpoints |
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## createWebhook
|
|
14
|
+
|
|
15
|
+
> WebhookResponse createWebhook(idempotencyKey, createWebhookRequest)
|
|
16
|
+
|
|
17
|
+
Register a webhook endpoint
|
|
18
|
+
|
|
19
|
+
Registers an HTTPS endpoint for terminal job events and returns the HMAC signing secret once at creation time.
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
Configuration,
|
|
26
|
+
WebhooksApi,
|
|
27
|
+
} from '@liqhtworks/sophon-sdk';
|
|
28
|
+
import type { CreateWebhookOperationRequest } from '@liqhtworks/sophon-sdk';
|
|
29
|
+
|
|
30
|
+
async function example() {
|
|
31
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
32
|
+
const config = new Configuration({
|
|
33
|
+
// To configure API key authorization: sessionCookie
|
|
34
|
+
apiKey: "YOUR API KEY",
|
|
35
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
36
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
37
|
+
});
|
|
38
|
+
const api = new WebhooksApi(config);
|
|
39
|
+
|
|
40
|
+
const body = {
|
|
41
|
+
// string | Client-generated UUID or string for exactly-once semantics. Required on all POST endpoints. Replaying the same key with the same request body returns the original response without side effects.
|
|
42
|
+
idempotencyKey: idempotencyKey_example,
|
|
43
|
+
// CreateWebhookRequest
|
|
44
|
+
createWebhookRequest: ...,
|
|
45
|
+
} satisfies CreateWebhookOperationRequest;
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const data = await api.createWebhook(body);
|
|
49
|
+
console.log(data);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error(error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Run the test
|
|
56
|
+
example().catch(console.error);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Parameters
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
| Name | Type | Description | Notes |
|
|
63
|
+
|------------- | ------------- | ------------- | -------------|
|
|
64
|
+
| **idempotencyKey** | `string` | Client-generated UUID or string for exactly-once semantics. Required on all POST endpoints. Replaying the same key with the same request body returns the original response without side effects. | [Defaults to `undefined`] |
|
|
65
|
+
| **createWebhookRequest** | [CreateWebhookRequest](CreateWebhookRequest.md) | | |
|
|
66
|
+
|
|
67
|
+
### Return type
|
|
68
|
+
|
|
69
|
+
[**WebhookResponse**](WebhookResponse.md)
|
|
70
|
+
|
|
71
|
+
### Authorization
|
|
72
|
+
|
|
73
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
74
|
+
|
|
75
|
+
### HTTP request headers
|
|
76
|
+
|
|
77
|
+
- **Content-Type**: `application/json`
|
|
78
|
+
- **Accept**: `application/json`
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### HTTP response details
|
|
82
|
+
| Status code | Description | Response headers |
|
|
83
|
+
|-------------|-------------|------------------|
|
|
84
|
+
| **201** | Webhook registered. The response includes the HMAC secret (shown only once). | * X-Request-Id - <br> |
|
|
85
|
+
| **400** | Invalid URL (non-HTTPS, private IP, userinfo, etc.). | * X-Request-Id - <br> |
|
|
86
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
87
|
+
| **403** | Insufficient scope (requires webhooks:manage). | * X-Request-Id - <br> |
|
|
88
|
+
| **409** | Idempotency conflict. | * X-Request-Id - <br> |
|
|
89
|
+
| **429** | Rate limited. | * X-Request-Id - <br> |
|
|
90
|
+
|
|
91
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## deleteWebhook
|
|
95
|
+
|
|
96
|
+
> deleteWebhook(id)
|
|
97
|
+
|
|
98
|
+
Soft-delete a webhook endpoint
|
|
99
|
+
|
|
100
|
+
Sets the webhook to inactive. It will no longer receive deliveries.
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import {
|
|
106
|
+
Configuration,
|
|
107
|
+
WebhooksApi,
|
|
108
|
+
} from '@liqhtworks/sophon-sdk';
|
|
109
|
+
import type { DeleteWebhookRequest } from '@liqhtworks/sophon-sdk';
|
|
110
|
+
|
|
111
|
+
async function example() {
|
|
112
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
113
|
+
const config = new Configuration({
|
|
114
|
+
// To configure API key authorization: sessionCookie
|
|
115
|
+
apiKey: "YOUR API KEY",
|
|
116
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
117
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
118
|
+
});
|
|
119
|
+
const api = new WebhooksApi(config);
|
|
120
|
+
|
|
121
|
+
const body = {
|
|
122
|
+
// string
|
|
123
|
+
id: id_example,
|
|
124
|
+
} satisfies DeleteWebhookRequest;
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
const data = await api.deleteWebhook(body);
|
|
128
|
+
console.log(data);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.error(error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Run the test
|
|
135
|
+
example().catch(console.error);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Parameters
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description | Notes |
|
|
142
|
+
|------------- | ------------- | ------------- | -------------|
|
|
143
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
`void` (Empty response body)
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: Not defined
|
|
156
|
+
- **Accept**: `application/json`
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### HTTP response details
|
|
160
|
+
| Status code | Description | Response headers |
|
|
161
|
+
|-------------|-------------|------------------|
|
|
162
|
+
| **204** | Webhook deactivated. No content returned. | * X-Request-Id - <br> |
|
|
163
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
164
|
+
| **403** | Insufficient scope (requires webhooks:manage). | * X-Request-Id - <br> |
|
|
165
|
+
| **404** | Webhook not found or already inactive. | * X-Request-Id - <br> |
|
|
166
|
+
|
|
167
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## listWebhooks
|
|
171
|
+
|
|
172
|
+
> WebhookListResponse listWebhooks()
|
|
173
|
+
|
|
174
|
+
List active webhook endpoints
|
|
175
|
+
|
|
176
|
+
Lists active webhook endpoints for the authenticated organization.
|
|
177
|
+
|
|
178
|
+
### Example
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import {
|
|
182
|
+
Configuration,
|
|
183
|
+
WebhooksApi,
|
|
184
|
+
} from '@liqhtworks/sophon-sdk';
|
|
185
|
+
import type { ListWebhooksRequest } from '@liqhtworks/sophon-sdk';
|
|
186
|
+
|
|
187
|
+
async function example() {
|
|
188
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
189
|
+
const config = new Configuration({
|
|
190
|
+
// To configure API key authorization: sessionCookie
|
|
191
|
+
apiKey: "YOUR API KEY",
|
|
192
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
193
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
194
|
+
});
|
|
195
|
+
const api = new WebhooksApi(config);
|
|
196
|
+
|
|
197
|
+
try {
|
|
198
|
+
const data = await api.listWebhooks();
|
|
199
|
+
console.log(data);
|
|
200
|
+
} catch (error) {
|
|
201
|
+
console.error(error);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Run the test
|
|
206
|
+
example().catch(console.error);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Parameters
|
|
210
|
+
|
|
211
|
+
This endpoint does not need any parameter.
|
|
212
|
+
|
|
213
|
+
### Return type
|
|
214
|
+
|
|
215
|
+
[**WebhookListResponse**](WebhookListResponse.md)
|
|
216
|
+
|
|
217
|
+
### Authorization
|
|
218
|
+
|
|
219
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
220
|
+
|
|
221
|
+
### HTTP request headers
|
|
222
|
+
|
|
223
|
+
- **Content-Type**: Not defined
|
|
224
|
+
- **Accept**: `application/json`
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### HTTP response details
|
|
228
|
+
| Status code | Description | Response headers |
|
|
229
|
+
|-------------|-------------|------------------|
|
|
230
|
+
| **200** | List of active webhooks for the authenticated organization. | * X-Request-Id - <br> |
|
|
231
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
232
|
+
| **403** | Insufficient scope (requires webhooks:manage). | * X-Request-Id - <br> |
|
|
233
|
+
|
|
234
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
235
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liqhtworks/sophon-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OpenAPI client for @liqhtworks/sophon-sdk",
|
|
5
|
+
"author": "OpenAPI-Generator",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/Liqhtworks/sophon-sdk-typescript.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
16
|
+
"prepare": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^4.0 || ^5.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"registry": "https://github.com/Liqhtworks/sophon-sdk-typescript"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* SOPHON Encoding API
|
|
5
|
+
* REST API for submitting, monitoring, and retrieving SOPHON encoding jobs. Authentication is via Bearer API key or session cookie. All POST endpoints require an Idempotency-Key header. List endpoints use opaque cursor-based pagination.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ErrorEnvelope,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
ErrorEnvelopeFromJSON,
|
|
22
|
+
ErrorEnvelopeToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface DownloadRequest {
|
|
26
|
+
token: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* DownloadsApi - interface
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
* @interface DownloadsApiInterface
|
|
34
|
+
*/
|
|
35
|
+
export interface DownloadsApiInterface {
|
|
36
|
+
/**
|
|
37
|
+
* Creates request options for download without sending the request
|
|
38
|
+
* @param {string} token HMAC-signed download token encoding the object key and expiry.
|
|
39
|
+
* @throws {RequiredError}
|
|
40
|
+
* @memberof DownloadsApiInterface
|
|
41
|
+
*/
|
|
42
|
+
downloadRequestOpts(requestParameters: DownloadRequest): Promise<runtime.RequestOpts>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
46
|
+
* @summary Download an output file via signed token
|
|
47
|
+
* @param {string} token HMAC-signed download token encoding the object key and expiry.
|
|
48
|
+
* @param {*} [options] Override http request option.
|
|
49
|
+
* @throws {RequiredError}
|
|
50
|
+
* @memberof DownloadsApiInterface
|
|
51
|
+
*/
|
|
52
|
+
downloadRaw(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
56
|
+
* Download an output file via signed token
|
|
57
|
+
*/
|
|
58
|
+
download(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export class DownloadsApi extends runtime.BaseAPI implements DownloadsApiInterface {
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for download without sending the request
|
|
69
|
+
*/
|
|
70
|
+
async downloadRequestOpts(requestParameters: DownloadRequest): Promise<runtime.RequestOpts> {
|
|
71
|
+
if (requestParameters['token'] == null) {
|
|
72
|
+
throw new runtime.RequiredError(
|
|
73
|
+
'token',
|
|
74
|
+
'Required parameter "token" was null or undefined when calling download().'
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const queryParameters: any = {};
|
|
79
|
+
|
|
80
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
let urlPath = `/v1/downloads/{token}`;
|
|
84
|
+
urlPath = urlPath.replace(`{${"token"}}`, encodeURIComponent(String(requestParameters['token'])));
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
path: urlPath,
|
|
88
|
+
method: 'GET',
|
|
89
|
+
headers: headerParameters,
|
|
90
|
+
query: queryParameters,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
96
|
+
* Download an output file via signed token
|
|
97
|
+
*/
|
|
98
|
+
async downloadRaw(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
|
99
|
+
const requestOptions = await this.downloadRequestOpts(requestParameters);
|
|
100
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
101
|
+
|
|
102
|
+
return new runtime.BlobApiResponse(response);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
107
|
+
* Download an output file via signed token
|
|
108
|
+
*/
|
|
109
|
+
async download(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
|
110
|
+
const response = await this.downloadRaw(requestParameters, initOverrides);
|
|
111
|
+
return await response.value();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* SOPHON Encoding API
|
|
5
|
+
* REST API for submitting, monitoring, and retrieving SOPHON encoding jobs. Authentication is via Bearer API key or session cookie. All POST endpoints require an Idempotency-Key header. List endpoints use opaque cursor-based pagination.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ReadyResponse,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
ReadyResponseFromJSON,
|
|
22
|
+
ReadyResponseToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* HealthApi - interface
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @interface HealthApiInterface
|
|
30
|
+
*/
|
|
31
|
+
export interface HealthApiInterface {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for healthz without sending the request
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
* @memberof HealthApiInterface
|
|
36
|
+
*/
|
|
37
|
+
healthzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
41
|
+
* @summary Liveness probe
|
|
42
|
+
* @param {*} [options] Override http request option.
|
|
43
|
+
* @throws {RequiredError}
|
|
44
|
+
* @memberof HealthApiInterface
|
|
45
|
+
*/
|
|
46
|
+
healthzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
50
|
+
* Liveness probe
|
|
51
|
+
*/
|
|
52
|
+
healthz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Creates request options for readyz without sending the request
|
|
56
|
+
* @throws {RequiredError}
|
|
57
|
+
* @memberof HealthApiInterface
|
|
58
|
+
*/
|
|
59
|
+
readyzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
63
|
+
* @summary Readiness probe
|
|
64
|
+
* @param {*} [options] Override http request option.
|
|
65
|
+
* @throws {RequiredError}
|
|
66
|
+
* @memberof HealthApiInterface
|
|
67
|
+
*/
|
|
68
|
+
readyzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReadyResponse>>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
72
|
+
* Readiness probe
|
|
73
|
+
*/
|
|
74
|
+
readyz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReadyResponse>;
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
export class HealthApi extends runtime.BaseAPI implements HealthApiInterface {
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Creates request options for healthz without sending the request
|
|
85
|
+
*/
|
|
86
|
+
async healthzRequestOpts(): Promise<runtime.RequestOpts> {
|
|
87
|
+
const queryParameters: any = {};
|
|
88
|
+
|
|
89
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
let urlPath = `/healthz`;
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
path: urlPath,
|
|
96
|
+
method: 'GET',
|
|
97
|
+
headers: headerParameters,
|
|
98
|
+
query: queryParameters,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
104
|
+
* Liveness probe
|
|
105
|
+
*/
|
|
106
|
+
async healthzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
107
|
+
const requestOptions = await this.healthzRequestOpts();
|
|
108
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
109
|
+
|
|
110
|
+
return new runtime.VoidApiResponse(response);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
115
|
+
* Liveness probe
|
|
116
|
+
*/
|
|
117
|
+
async healthz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
118
|
+
await this.healthzRaw(initOverrides);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates request options for readyz without sending the request
|
|
123
|
+
*/
|
|
124
|
+
async readyzRequestOpts(): Promise<runtime.RequestOpts> {
|
|
125
|
+
const queryParameters: any = {};
|
|
126
|
+
|
|
127
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
let urlPath = `/readyz`;
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
path: urlPath,
|
|
134
|
+
method: 'GET',
|
|
135
|
+
headers: headerParameters,
|
|
136
|
+
query: queryParameters,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
142
|
+
* Readiness probe
|
|
143
|
+
*/
|
|
144
|
+
async readyzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReadyResponse>> {
|
|
145
|
+
const requestOptions = await this.readyzRequestOpts();
|
|
146
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
147
|
+
|
|
148
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ReadyResponseFromJSON(jsonValue));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
153
|
+
* Readiness probe
|
|
154
|
+
*/
|
|
155
|
+
async readyz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReadyResponse> {
|
|
156
|
+
const response = await this.readyzRaw(initOverrides);
|
|
157
|
+
return await response.value();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
}
|