@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,62 @@
|
|
|
1
|
+
|
|
2
|
+
# JobResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`status` | [JobStatus](JobStatus.md)
|
|
11
|
+
`status_reason` | string
|
|
12
|
+
`attempt` | number
|
|
13
|
+
`retryable` | boolean
|
|
14
|
+
`profile` | [JobProfile](JobProfile.md)
|
|
15
|
+
`effective_profile_id` | string
|
|
16
|
+
`source` | [JobSourceInfo](JobSourceInfo.md)
|
|
17
|
+
`progress` | [JobProgress](JobProgress.md)
|
|
18
|
+
`output` | [JobOutputInfo](JobOutputInfo.md)
|
|
19
|
+
`metadata` | { [key: string]: any; }
|
|
20
|
+
`created_at` | Date
|
|
21
|
+
`started_at` | Date
|
|
22
|
+
`completed_at` | Date
|
|
23
|
+
`error` | string
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import type { JobResponse } from '@liqhtworks/sophon-sdk'
|
|
29
|
+
|
|
30
|
+
// TODO: Update the object below with actual values
|
|
31
|
+
const example = {
|
|
32
|
+
"id": job_abc123def456,
|
|
33
|
+
"status": null,
|
|
34
|
+
"status_reason": null,
|
|
35
|
+
"attempt": null,
|
|
36
|
+
"retryable": null,
|
|
37
|
+
"profile": null,
|
|
38
|
+
"effective_profile_id": null,
|
|
39
|
+
"source": null,
|
|
40
|
+
"progress": null,
|
|
41
|
+
"output": null,
|
|
42
|
+
"metadata": null,
|
|
43
|
+
"created_at": null,
|
|
44
|
+
"started_at": null,
|
|
45
|
+
"completed_at": null,
|
|
46
|
+
"error": null,
|
|
47
|
+
} satisfies JobResponse
|
|
48
|
+
|
|
49
|
+
console.log(example)
|
|
50
|
+
|
|
51
|
+
// Convert the instance to a JSON string
|
|
52
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
53
|
+
console.log(exampleJSON)
|
|
54
|
+
|
|
55
|
+
// Parse the JSON string back to an object
|
|
56
|
+
const exampleParsed = JSON.parse(exampleJSON) as JobResponse
|
|
57
|
+
console.log(exampleParsed)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
61
|
+
|
|
62
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
# JobSourceInfo
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`bytes` | number
|
|
11
|
+
`sha256` | string
|
|
12
|
+
`duration_seconds` | number
|
|
13
|
+
`resolution` | string
|
|
14
|
+
`frame_rate` | string
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { JobSourceInfo } from '@liqhtworks/sophon-sdk'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"name": null,
|
|
24
|
+
"bytes": null,
|
|
25
|
+
"sha256": null,
|
|
26
|
+
"duration_seconds": null,
|
|
27
|
+
"resolution": 1920x1080,
|
|
28
|
+
"frame_rate": 23.976,
|
|
29
|
+
} satisfies JobSourceInfo
|
|
30
|
+
|
|
31
|
+
console.log(example)
|
|
32
|
+
|
|
33
|
+
// Convert the instance to a JSON string
|
|
34
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
35
|
+
console.log(exampleJSON)
|
|
36
|
+
|
|
37
|
+
// Parse the JSON string back to an object
|
|
38
|
+
const exampleParsed = JSON.parse(exampleJSON) as JobSourceInfo
|
|
39
|
+
console.log(exampleParsed)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# JobSourceType
|
|
3
|
+
|
|
4
|
+
Discriminator for `JobSource` variants.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { JobSourceType } from '@liqhtworks/sophon-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
} satisfies JobSourceType
|
|
19
|
+
|
|
20
|
+
console.log(example)
|
|
21
|
+
|
|
22
|
+
// Convert the instance to a JSON string
|
|
23
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
24
|
+
console.log(exampleJSON)
|
|
25
|
+
|
|
26
|
+
// Parse the JSON string back to an object
|
|
27
|
+
const exampleParsed = JSON.parse(exampleJSON) as JobSourceType
|
|
28
|
+
console.log(exampleParsed)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# JobStatus
|
|
3
|
+
|
|
4
|
+
Lifecycle status for an encoding job.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { JobStatus } from '@liqhtworks/sophon-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
} satisfies JobStatus
|
|
19
|
+
|
|
20
|
+
console.log(example)
|
|
21
|
+
|
|
22
|
+
// Convert the instance to a JSON string
|
|
23
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
24
|
+
console.log(exampleJSON)
|
|
25
|
+
|
|
26
|
+
// Parse the JSON string back to an object
|
|
27
|
+
const exampleParsed = JSON.parse(exampleJSON) as JobStatus
|
|
28
|
+
console.log(exampleParsed)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
32
|
+
|
|
33
|
+
|
package/docs/JobsApi.md
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# JobsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.liqhtworks.xyz*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**cancelJob**](JobsApi.md#canceljob) | **DELETE** /v1/jobs/{id} | Cancel a job |
|
|
8
|
+
| [**createJob**](JobsApi.md#createjoboperation) | **POST** /v1/jobs | Submit an encoding job |
|
|
9
|
+
| [**getJob**](JobsApi.md#getjob) | **GET** /v1/jobs/{id} | Get a single job by ID |
|
|
10
|
+
| [**getJobOutput**](JobsApi.md#getjoboutput) | **GET** /v1/jobs/{id}/output | Get the encoded output file |
|
|
11
|
+
| [**listJobs**](JobsApi.md#listjobs) | **GET** /v1/jobs | List jobs with cursor pagination |
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## cancelJob
|
|
16
|
+
|
|
17
|
+
> JobResponse cancelJob(id)
|
|
18
|
+
|
|
19
|
+
Cancel a job
|
|
20
|
+
|
|
21
|
+
Cancels a job in a non-terminal state (queued, probing, encoding, muxing, uploading_output). Returns 409 if the job is already completed, failed, or canceled.
|
|
22
|
+
|
|
23
|
+
### Example
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {
|
|
27
|
+
Configuration,
|
|
28
|
+
JobsApi,
|
|
29
|
+
} from '@liqhtworks/sophon-sdk';
|
|
30
|
+
import type { CancelJobRequest } from '@liqhtworks/sophon-sdk';
|
|
31
|
+
|
|
32
|
+
async function example() {
|
|
33
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
34
|
+
const config = new Configuration({
|
|
35
|
+
// To configure API key authorization: sessionCookie
|
|
36
|
+
apiKey: "YOUR API KEY",
|
|
37
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
38
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
39
|
+
});
|
|
40
|
+
const api = new JobsApi(config);
|
|
41
|
+
|
|
42
|
+
const body = {
|
|
43
|
+
// string
|
|
44
|
+
id: id_example,
|
|
45
|
+
} satisfies CancelJobRequest;
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const data = await api.cancelJob(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
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
65
|
+
|
|
66
|
+
### Return type
|
|
67
|
+
|
|
68
|
+
[**JobResponse**](JobResponse.md)
|
|
69
|
+
|
|
70
|
+
### Authorization
|
|
71
|
+
|
|
72
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
73
|
+
|
|
74
|
+
### HTTP request headers
|
|
75
|
+
|
|
76
|
+
- **Content-Type**: Not defined
|
|
77
|
+
- **Accept**: `application/json`
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### HTTP response details
|
|
81
|
+
| Status code | Description | Response headers |
|
|
82
|
+
|-------------|-------------|------------------|
|
|
83
|
+
| **200** | Job canceled. Returns the updated job. | * X-Request-Id - <br> |
|
|
84
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
85
|
+
| **403** | Insufficient scope (requires jobs:cancel). | * X-Request-Id - <br> |
|
|
86
|
+
| **404** | Job not found. | * X-Request-Id - <br> |
|
|
87
|
+
| **409** | Job is in a terminal state and cannot be canceled (job_not_cancelable). | * X-Request-Id - <br> |
|
|
88
|
+
|
|
89
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## createJob
|
|
93
|
+
|
|
94
|
+
> JobResponse createJob(idempotencyKey, createJobRequest)
|
|
95
|
+
|
|
96
|
+
Submit an encoding job
|
|
97
|
+
|
|
98
|
+
Creates a queued encoding job from a completed upload source. The `profile` field accepts explicit coffee profiles or `sophon-auto`, and `output.target_height` can request aspect-preserving downscale.
|
|
99
|
+
|
|
100
|
+
### Example
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import {
|
|
104
|
+
Configuration,
|
|
105
|
+
JobsApi,
|
|
106
|
+
} from '@liqhtworks/sophon-sdk';
|
|
107
|
+
import type { CreateJobOperationRequest } from '@liqhtworks/sophon-sdk';
|
|
108
|
+
|
|
109
|
+
async function example() {
|
|
110
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
111
|
+
const config = new Configuration({
|
|
112
|
+
// To configure API key authorization: sessionCookie
|
|
113
|
+
apiKey: "YOUR API KEY",
|
|
114
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
115
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
116
|
+
});
|
|
117
|
+
const api = new JobsApi(config);
|
|
118
|
+
|
|
119
|
+
const body = {
|
|
120
|
+
// 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.
|
|
121
|
+
idempotencyKey: idempotencyKey_example,
|
|
122
|
+
// CreateJobRequest
|
|
123
|
+
createJobRequest: ...,
|
|
124
|
+
} satisfies CreateJobOperationRequest;
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
const data = await api.createJob(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
|
+
| **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`] |
|
|
144
|
+
| **createJobRequest** | [CreateJobRequest](CreateJobRequest.md) | | |
|
|
145
|
+
|
|
146
|
+
### Return type
|
|
147
|
+
|
|
148
|
+
[**JobResponse**](JobResponse.md)
|
|
149
|
+
|
|
150
|
+
### Authorization
|
|
151
|
+
|
|
152
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
153
|
+
|
|
154
|
+
### HTTP request headers
|
|
155
|
+
|
|
156
|
+
- **Content-Type**: `application/json`
|
|
157
|
+
- **Accept**: `application/json`
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### HTTP response details
|
|
161
|
+
| Status code | Description | Response headers |
|
|
162
|
+
|-------------|-------------|------------------|
|
|
163
|
+
| **201** | Job created. | * X-Request-Id - <br> |
|
|
164
|
+
| **400** | Validation error (bad profile, source, container, metadata, or webhook_ids). | * X-Request-Id - <br> |
|
|
165
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
166
|
+
| **403** | Insufficient scope (requires jobs:create). | * X-Request-Id - <br> |
|
|
167
|
+
| **409** | Idempotency conflict (same key, different request body). | * X-Request-Id - <br> |
|
|
168
|
+
| **422** | Source is invalid or unsupported. | * X-Request-Id - <br> |
|
|
169
|
+
| **429** | Rate limited or quota exceeded. | * X-Request-Id - <br> |
|
|
170
|
+
|
|
171
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## getJob
|
|
175
|
+
|
|
176
|
+
> JobResponse getJob(id)
|
|
177
|
+
|
|
178
|
+
Get a single job by ID
|
|
179
|
+
|
|
180
|
+
Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
181
|
+
|
|
182
|
+
### Example
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
import {
|
|
186
|
+
Configuration,
|
|
187
|
+
JobsApi,
|
|
188
|
+
} from '@liqhtworks/sophon-sdk';
|
|
189
|
+
import type { GetJobRequest } from '@liqhtworks/sophon-sdk';
|
|
190
|
+
|
|
191
|
+
async function example() {
|
|
192
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
193
|
+
const config = new Configuration({
|
|
194
|
+
// To configure API key authorization: sessionCookie
|
|
195
|
+
apiKey: "YOUR API KEY",
|
|
196
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
197
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
198
|
+
});
|
|
199
|
+
const api = new JobsApi(config);
|
|
200
|
+
|
|
201
|
+
const body = {
|
|
202
|
+
// string
|
|
203
|
+
id: id_example,
|
|
204
|
+
} satisfies GetJobRequest;
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
const data = await api.getJob(body);
|
|
208
|
+
console.log(data);
|
|
209
|
+
} catch (error) {
|
|
210
|
+
console.error(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Run the test
|
|
215
|
+
example().catch(console.error);
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Parameters
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
| Name | Type | Description | Notes |
|
|
222
|
+
|------------- | ------------- | ------------- | -------------|
|
|
223
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
224
|
+
|
|
225
|
+
### Return type
|
|
226
|
+
|
|
227
|
+
[**JobResponse**](JobResponse.md)
|
|
228
|
+
|
|
229
|
+
### Authorization
|
|
230
|
+
|
|
231
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
232
|
+
|
|
233
|
+
### HTTP request headers
|
|
234
|
+
|
|
235
|
+
- **Content-Type**: Not defined
|
|
236
|
+
- **Accept**: `application/json`
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
### HTTP response details
|
|
240
|
+
| Status code | Description | Response headers |
|
|
241
|
+
|-------------|-------------|------------------|
|
|
242
|
+
| **200** | Job details. | * X-Request-Id - <br> |
|
|
243
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
244
|
+
| **403** | Insufficient scope (requires jobs:read). | * X-Request-Id - <br> |
|
|
245
|
+
| **404** | Job not found. | * X-Request-Id - <br> |
|
|
246
|
+
|
|
247
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## getJobOutput
|
|
251
|
+
|
|
252
|
+
> getJobOutput(id)
|
|
253
|
+
|
|
254
|
+
Get the encoded output file
|
|
255
|
+
|
|
256
|
+
Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
257
|
+
|
|
258
|
+
### Example
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
import {
|
|
262
|
+
Configuration,
|
|
263
|
+
JobsApi,
|
|
264
|
+
} from '@liqhtworks/sophon-sdk';
|
|
265
|
+
import type { GetJobOutputRequest } from '@liqhtworks/sophon-sdk';
|
|
266
|
+
|
|
267
|
+
async function example() {
|
|
268
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
269
|
+
const config = new Configuration({
|
|
270
|
+
// To configure API key authorization: sessionCookie
|
|
271
|
+
apiKey: "YOUR API KEY",
|
|
272
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
273
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
274
|
+
});
|
|
275
|
+
const api = new JobsApi(config);
|
|
276
|
+
|
|
277
|
+
const body = {
|
|
278
|
+
// string
|
|
279
|
+
id: id_example,
|
|
280
|
+
} satisfies GetJobOutputRequest;
|
|
281
|
+
|
|
282
|
+
try {
|
|
283
|
+
const data = await api.getJobOutput(body);
|
|
284
|
+
console.log(data);
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error(error);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Run the test
|
|
291
|
+
example().catch(console.error);
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Parameters
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
| Name | Type | Description | Notes |
|
|
298
|
+
|------------- | ------------- | ------------- | -------------|
|
|
299
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
300
|
+
|
|
301
|
+
### Return type
|
|
302
|
+
|
|
303
|
+
`void` (Empty response body)
|
|
304
|
+
|
|
305
|
+
### Authorization
|
|
306
|
+
|
|
307
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
308
|
+
|
|
309
|
+
### HTTP request headers
|
|
310
|
+
|
|
311
|
+
- **Content-Type**: Not defined
|
|
312
|
+
- **Accept**: `application/json`
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
### HTTP response details
|
|
316
|
+
| Status code | Description | Response headers |
|
|
317
|
+
|-------------|-------------|------------------|
|
|
318
|
+
| **302** | Redirect to signed download URL. The resolved resource is a video/mp4 file. | * Location - Signed download URL (24-hour TTL). Resolves to video/mp4. <br> * X-Request-Id - <br> |
|
|
319
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
320
|
+
| **403** | Insufficient scope (requires outputs:read). | * X-Request-Id - <br> |
|
|
321
|
+
| **404** | Job not found. | * X-Request-Id - <br> |
|
|
322
|
+
| **409** | Output not ready (job not in completed state). | * X-Request-Id - <br> |
|
|
323
|
+
|
|
324
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
## listJobs
|
|
328
|
+
|
|
329
|
+
> ListJobsResponse listJobs(status, limit, cursor)
|
|
330
|
+
|
|
331
|
+
List jobs with cursor pagination
|
|
332
|
+
|
|
333
|
+
Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
334
|
+
|
|
335
|
+
### Example
|
|
336
|
+
|
|
337
|
+
```ts
|
|
338
|
+
import {
|
|
339
|
+
Configuration,
|
|
340
|
+
JobsApi,
|
|
341
|
+
} from '@liqhtworks/sophon-sdk';
|
|
342
|
+
import type { ListJobsRequest } from '@liqhtworks/sophon-sdk';
|
|
343
|
+
|
|
344
|
+
async function example() {
|
|
345
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
346
|
+
const config = new Configuration({
|
|
347
|
+
// To configure API key authorization: sessionCookie
|
|
348
|
+
apiKey: "YOUR API KEY",
|
|
349
|
+
// Configure HTTP bearer authorization: bearerApiKey
|
|
350
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
351
|
+
});
|
|
352
|
+
const api = new JobsApi(config);
|
|
353
|
+
|
|
354
|
+
const body = {
|
|
355
|
+
// JobStatus | Filter by job status. (optional)
|
|
356
|
+
status: ...,
|
|
357
|
+
// number | Maximum number of items to return per page. (optional)
|
|
358
|
+
limit: 56,
|
|
359
|
+
// string | Opaque pagination cursor returned in a previous response\'s `next_cursor` field. (optional)
|
|
360
|
+
cursor: cursor_example,
|
|
361
|
+
} satisfies ListJobsRequest;
|
|
362
|
+
|
|
363
|
+
try {
|
|
364
|
+
const data = await api.listJobs(body);
|
|
365
|
+
console.log(data);
|
|
366
|
+
} catch (error) {
|
|
367
|
+
console.error(error);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Run the test
|
|
372
|
+
example().catch(console.error);
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Parameters
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
| Name | Type | Description | Notes |
|
|
379
|
+
|------------- | ------------- | ------------- | -------------|
|
|
380
|
+
| **status** | `JobStatus` | Filter by job status. | [Optional] [Defaults to `undefined`] [Enum: queued, probing, encoding, muxing, uploading_output, completed, failed, canceled] |
|
|
381
|
+
| **limit** | `number` | Maximum number of items to return per page. | [Optional] [Defaults to `20`] |
|
|
382
|
+
| **cursor** | `string` | Opaque pagination cursor returned in a previous response\'s `next_cursor` field. | [Optional] [Defaults to `undefined`] |
|
|
383
|
+
|
|
384
|
+
### Return type
|
|
385
|
+
|
|
386
|
+
[**ListJobsResponse**](ListJobsResponse.md)
|
|
387
|
+
|
|
388
|
+
### Authorization
|
|
389
|
+
|
|
390
|
+
[sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
|
|
391
|
+
|
|
392
|
+
### HTTP request headers
|
|
393
|
+
|
|
394
|
+
- **Content-Type**: Not defined
|
|
395
|
+
- **Accept**: `application/json`
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
### HTTP response details
|
|
399
|
+
| Status code | Description | Response headers |
|
|
400
|
+
|-------------|-------------|------------------|
|
|
401
|
+
| **200** | Paginated list of jobs, ordered by created_at descending. | * X-Request-Id - <br> |
|
|
402
|
+
| **400** | Invalid status filter or cursor. | * X-Request-Id - <br> |
|
|
403
|
+
| **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
|
|
404
|
+
| **403** | Insufficient scope (requires jobs:read). | * X-Request-Id - <br> |
|
|
405
|
+
|
|
406
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
407
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ListJobsResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`jobs` | [Array<JobResponse>](JobResponse.md)
|
|
10
|
+
`next_cursor` | string
|
|
11
|
+
`has_more` | boolean
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ListJobsResponse } from '@liqhtworks/sophon-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"jobs": null,
|
|
21
|
+
"next_cursor": null,
|
|
22
|
+
"has_more": null,
|
|
23
|
+
} satisfies ListJobsResponse
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ListJobsResponse
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# OutputContainer
|
|
3
|
+
|
|
4
|
+
Output container format. MP4 is widely compatible; MKV supports a broader range of audio codecs for passthrough.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { OutputContainer } from '@liqhtworks/sophon-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
} satisfies OutputContainer
|
|
19
|
+
|
|
20
|
+
console.log(example)
|
|
21
|
+
|
|
22
|
+
// Convert the instance to a JSON string
|
|
23
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
24
|
+
console.log(exampleJSON)
|
|
25
|
+
|
|
26
|
+
// Parse the JSON string back to an object
|
|
27
|
+
const exampleParsed = JSON.parse(exampleJSON) as OutputContainer
|
|
28
|
+
console.log(exampleParsed)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ReadyResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`ready` | boolean
|
|
10
|
+
`checks_failed` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ReadyResponse } from '@liqhtworks/sophon-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"ready": null,
|
|
20
|
+
"checks_failed": null,
|
|
21
|
+
} satisfies ReadyResponse
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as ReadyResponse
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|