@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,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SOPHON Encoding API
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CreateJobRequest, JobResponse, JobStatus, ListJobsResponse } from '../models/index';
|
|
14
|
+
export interface CancelJobRequest {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateJobOperationRequest {
|
|
18
|
+
idempotencyKey: string;
|
|
19
|
+
createJobRequest: CreateJobRequest;
|
|
20
|
+
}
|
|
21
|
+
export interface GetJobRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GetJobOutputRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ListJobsRequest {
|
|
28
|
+
status?: JobStatus;
|
|
29
|
+
limit?: number;
|
|
30
|
+
cursor?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* JobsApi - interface
|
|
34
|
+
*
|
|
35
|
+
* @export
|
|
36
|
+
* @interface JobsApiInterface
|
|
37
|
+
*/
|
|
38
|
+
export interface JobsApiInterface {
|
|
39
|
+
/**
|
|
40
|
+
* Creates request options for cancelJob without sending the request
|
|
41
|
+
* @param {string} id
|
|
42
|
+
* @throws {RequiredError}
|
|
43
|
+
* @memberof JobsApiInterface
|
|
44
|
+
*/
|
|
45
|
+
cancelJobRequestOpts(requestParameters: CancelJobRequest): Promise<runtime.RequestOpts>;
|
|
46
|
+
/**
|
|
47
|
+
* 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.
|
|
48
|
+
* @summary Cancel a job
|
|
49
|
+
* @param {string} id
|
|
50
|
+
* @param {*} [options] Override http request option.
|
|
51
|
+
* @throws {RequiredError}
|
|
52
|
+
* @memberof JobsApiInterface
|
|
53
|
+
*/
|
|
54
|
+
cancelJobRaw(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
55
|
+
/**
|
|
56
|
+
* 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.
|
|
57
|
+
* Cancel a job
|
|
58
|
+
*/
|
|
59
|
+
cancelJob(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Creates request options for createJob without sending the request
|
|
62
|
+
* @param {string} idempotencyKey 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.
|
|
63
|
+
* @param {CreateJobRequest} createJobRequest
|
|
64
|
+
* @throws {RequiredError}
|
|
65
|
+
* @memberof JobsApiInterface
|
|
66
|
+
*/
|
|
67
|
+
createJobRequestOpts(requestParameters: CreateJobOperationRequest): Promise<runtime.RequestOpts>;
|
|
68
|
+
/**
|
|
69
|
+
* 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.
|
|
70
|
+
* @summary Submit an encoding job
|
|
71
|
+
* @param {string} idempotencyKey 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.
|
|
72
|
+
* @param {CreateJobRequest} createJobRequest
|
|
73
|
+
* @param {*} [options] Override http request option.
|
|
74
|
+
* @throws {RequiredError}
|
|
75
|
+
* @memberof JobsApiInterface
|
|
76
|
+
*/
|
|
77
|
+
createJobRaw(requestParameters: CreateJobOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
78
|
+
/**
|
|
79
|
+
* 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.
|
|
80
|
+
* Submit an encoding job
|
|
81
|
+
*/
|
|
82
|
+
createJob(requestParameters: CreateJobOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Creates request options for getJob without sending the request
|
|
85
|
+
* @param {string} id
|
|
86
|
+
* @throws {RequiredError}
|
|
87
|
+
* @memberof JobsApiInterface
|
|
88
|
+
*/
|
|
89
|
+
getJobRequestOpts(requestParameters: GetJobRequest): Promise<runtime.RequestOpts>;
|
|
90
|
+
/**
|
|
91
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
92
|
+
* @summary Get a single job by ID
|
|
93
|
+
* @param {string} id
|
|
94
|
+
* @param {*} [options] Override http request option.
|
|
95
|
+
* @throws {RequiredError}
|
|
96
|
+
* @memberof JobsApiInterface
|
|
97
|
+
*/
|
|
98
|
+
getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
99
|
+
/**
|
|
100
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
101
|
+
* Get a single job by ID
|
|
102
|
+
*/
|
|
103
|
+
getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Creates request options for getJobOutput without sending the request
|
|
106
|
+
* @param {string} id
|
|
107
|
+
* @throws {RequiredError}
|
|
108
|
+
* @memberof JobsApiInterface
|
|
109
|
+
*/
|
|
110
|
+
getJobOutputRequestOpts(requestParameters: GetJobOutputRequest): Promise<runtime.RequestOpts>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
113
|
+
* @summary Get the encoded output file
|
|
114
|
+
* @param {string} id
|
|
115
|
+
* @param {*} [options] Override http request option.
|
|
116
|
+
* @throws {RequiredError}
|
|
117
|
+
* @memberof JobsApiInterface
|
|
118
|
+
*/
|
|
119
|
+
getJobOutputRaw(requestParameters: GetJobOutputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
122
|
+
* Get the encoded output file
|
|
123
|
+
*/
|
|
124
|
+
getJobOutput(requestParameters: GetJobOutputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Creates request options for listJobs without sending the request
|
|
127
|
+
* @param {JobStatus} [status] Filter by job status.
|
|
128
|
+
* @param {number} [limit] Maximum number of items to return per page.
|
|
129
|
+
* @param {string} [cursor] Opaque pagination cursor returned in a previous response\'s `next_cursor` field.
|
|
130
|
+
* @throws {RequiredError}
|
|
131
|
+
* @memberof JobsApiInterface
|
|
132
|
+
*/
|
|
133
|
+
listJobsRequestOpts(requestParameters: ListJobsRequest): Promise<runtime.RequestOpts>;
|
|
134
|
+
/**
|
|
135
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
136
|
+
* @summary List jobs with cursor pagination
|
|
137
|
+
* @param {JobStatus} [status] Filter by job status.
|
|
138
|
+
* @param {number} [limit] Maximum number of items to return per page.
|
|
139
|
+
* @param {string} [cursor] Opaque pagination cursor returned in a previous response\'s `next_cursor` field.
|
|
140
|
+
* @param {*} [options] Override http request option.
|
|
141
|
+
* @throws {RequiredError}
|
|
142
|
+
* @memberof JobsApiInterface
|
|
143
|
+
*/
|
|
144
|
+
listJobsRaw(requestParameters: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListJobsResponse>>;
|
|
145
|
+
/**
|
|
146
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
147
|
+
* List jobs with cursor pagination
|
|
148
|
+
*/
|
|
149
|
+
listJobs(requestParameters: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListJobsResponse>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
export declare class JobsApi extends runtime.BaseAPI implements JobsApiInterface {
|
|
155
|
+
/**
|
|
156
|
+
* Creates request options for cancelJob without sending the request
|
|
157
|
+
*/
|
|
158
|
+
cancelJobRequestOpts(requestParameters: CancelJobRequest): Promise<runtime.RequestOpts>;
|
|
159
|
+
/**
|
|
160
|
+
* 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.
|
|
161
|
+
* Cancel a job
|
|
162
|
+
*/
|
|
163
|
+
cancelJobRaw(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
164
|
+
/**
|
|
165
|
+
* 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.
|
|
166
|
+
* Cancel a job
|
|
167
|
+
*/
|
|
168
|
+
cancelJob(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Creates request options for createJob without sending the request
|
|
171
|
+
*/
|
|
172
|
+
createJobRequestOpts(requestParameters: CreateJobOperationRequest): Promise<runtime.RequestOpts>;
|
|
173
|
+
/**
|
|
174
|
+
* 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.
|
|
175
|
+
* Submit an encoding job
|
|
176
|
+
*/
|
|
177
|
+
createJobRaw(requestParameters: CreateJobOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
178
|
+
/**
|
|
179
|
+
* 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.
|
|
180
|
+
* Submit an encoding job
|
|
181
|
+
*/
|
|
182
|
+
createJob(requestParameters: CreateJobOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Creates request options for getJob without sending the request
|
|
185
|
+
*/
|
|
186
|
+
getJobRequestOpts(requestParameters: GetJobRequest): Promise<runtime.RequestOpts>;
|
|
187
|
+
/**
|
|
188
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
189
|
+
* Get a single job by ID
|
|
190
|
+
*/
|
|
191
|
+
getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobResponse>>;
|
|
192
|
+
/**
|
|
193
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
194
|
+
* Get a single job by ID
|
|
195
|
+
*/
|
|
196
|
+
getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobResponse>;
|
|
197
|
+
/**
|
|
198
|
+
* Creates request options for getJobOutput without sending the request
|
|
199
|
+
*/
|
|
200
|
+
getJobOutputRequestOpts(requestParameters: GetJobOutputRequest): Promise<runtime.RequestOpts>;
|
|
201
|
+
/**
|
|
202
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
203
|
+
* Get the encoded output file
|
|
204
|
+
*/
|
|
205
|
+
getJobOutputRaw(requestParameters: GetJobOutputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
206
|
+
/**
|
|
207
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
208
|
+
* Get the encoded output file
|
|
209
|
+
*/
|
|
210
|
+
getJobOutput(requestParameters: GetJobOutputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
211
|
+
/**
|
|
212
|
+
* Creates request options for listJobs without sending the request
|
|
213
|
+
*/
|
|
214
|
+
listJobsRequestOpts(requestParameters: ListJobsRequest): Promise<runtime.RequestOpts>;
|
|
215
|
+
/**
|
|
216
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
217
|
+
* List jobs with cursor pagination
|
|
218
|
+
*/
|
|
219
|
+
listJobsRaw(requestParameters: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListJobsResponse>>;
|
|
220
|
+
/**
|
|
221
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
222
|
+
* List jobs with cursor pagination
|
|
223
|
+
*/
|
|
224
|
+
listJobs(requestParameters?: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListJobsResponse>;
|
|
225
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* SOPHON Encoding API
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.JobsApi = void 0;
|
|
17
|
+
const runtime = require("../runtime");
|
|
18
|
+
const index_1 = require("../models/index");
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
class JobsApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Creates request options for cancelJob without sending the request
|
|
25
|
+
*/
|
|
26
|
+
async cancelJobRequestOpts(requestParameters) {
|
|
27
|
+
if (requestParameters['id'] == null) {
|
|
28
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling cancelJob().');
|
|
29
|
+
}
|
|
30
|
+
const queryParameters = {};
|
|
31
|
+
const headerParameters = {};
|
|
32
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
33
|
+
const token = this.configuration.accessToken;
|
|
34
|
+
const tokenString = await token("bearerApiKey", []);
|
|
35
|
+
if (tokenString) {
|
|
36
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
let urlPath = `/v1/jobs/{id}`;
|
|
40
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
41
|
+
return {
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: 'DELETE',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 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.
|
|
50
|
+
* Cancel a job
|
|
51
|
+
*/
|
|
52
|
+
async cancelJobRaw(requestParameters, initOverrides) {
|
|
53
|
+
const requestOptions = await this.cancelJobRequestOpts(requestParameters);
|
|
54
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
55
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JobResponseFromJSON)(jsonValue));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
* Cancel a job
|
|
60
|
+
*/
|
|
61
|
+
async cancelJob(requestParameters, initOverrides) {
|
|
62
|
+
const response = await this.cancelJobRaw(requestParameters, initOverrides);
|
|
63
|
+
return await response.value();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates request options for createJob without sending the request
|
|
67
|
+
*/
|
|
68
|
+
async createJobRequestOpts(requestParameters) {
|
|
69
|
+
if (requestParameters['idempotencyKey'] == null) {
|
|
70
|
+
throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling createJob().');
|
|
71
|
+
}
|
|
72
|
+
if (requestParameters['createJobRequest'] == null) {
|
|
73
|
+
throw new runtime.RequiredError('createJobRequest', 'Required parameter "createJobRequest" was null or undefined when calling createJob().');
|
|
74
|
+
}
|
|
75
|
+
const queryParameters = {};
|
|
76
|
+
const headerParameters = {};
|
|
77
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
78
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
79
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
80
|
+
}
|
|
81
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
82
|
+
const token = this.configuration.accessToken;
|
|
83
|
+
const tokenString = await token("bearerApiKey", []);
|
|
84
|
+
if (tokenString) {
|
|
85
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
let urlPath = `/v1/jobs`;
|
|
89
|
+
return {
|
|
90
|
+
path: urlPath,
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: headerParameters,
|
|
93
|
+
query: queryParameters,
|
|
94
|
+
body: (0, index_1.CreateJobRequestToJSON)(requestParameters['createJobRequest']),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
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
|
+
* Submit an encoding job
|
|
100
|
+
*/
|
|
101
|
+
async createJobRaw(requestParameters, initOverrides) {
|
|
102
|
+
const requestOptions = await this.createJobRequestOpts(requestParameters);
|
|
103
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
104
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JobResponseFromJSON)(jsonValue));
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 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.
|
|
108
|
+
* Submit an encoding job
|
|
109
|
+
*/
|
|
110
|
+
async createJob(requestParameters, initOverrides) {
|
|
111
|
+
const response = await this.createJobRaw(requestParameters, initOverrides);
|
|
112
|
+
return await response.value();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates request options for getJob without sending the request
|
|
116
|
+
*/
|
|
117
|
+
async getJobRequestOpts(requestParameters) {
|
|
118
|
+
if (requestParameters['id'] == null) {
|
|
119
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJob().');
|
|
120
|
+
}
|
|
121
|
+
const queryParameters = {};
|
|
122
|
+
const headerParameters = {};
|
|
123
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
124
|
+
const token = this.configuration.accessToken;
|
|
125
|
+
const tokenString = await token("bearerApiKey", []);
|
|
126
|
+
if (tokenString) {
|
|
127
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
let urlPath = `/v1/jobs/{id}`;
|
|
131
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
132
|
+
return {
|
|
133
|
+
path: urlPath,
|
|
134
|
+
method: 'GET',
|
|
135
|
+
headers: headerParameters,
|
|
136
|
+
query: queryParameters,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
141
|
+
* Get a single job by ID
|
|
142
|
+
*/
|
|
143
|
+
async getJobRaw(requestParameters, initOverrides) {
|
|
144
|
+
const requestOptions = await this.getJobRequestOpts(requestParameters);
|
|
145
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JobResponseFromJSON)(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Returns current job state, progress, source metadata, resolved adaptive profile information, and output availability for one job.
|
|
150
|
+
* Get a single job by ID
|
|
151
|
+
*/
|
|
152
|
+
async getJob(requestParameters, initOverrides) {
|
|
153
|
+
const response = await this.getJobRaw(requestParameters, initOverrides);
|
|
154
|
+
return await response.value();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Creates request options for getJobOutput without sending the request
|
|
158
|
+
*/
|
|
159
|
+
async getJobOutputRequestOpts(requestParameters) {
|
|
160
|
+
if (requestParameters['id'] == null) {
|
|
161
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJobOutput().');
|
|
162
|
+
}
|
|
163
|
+
const queryParameters = {};
|
|
164
|
+
const headerParameters = {};
|
|
165
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
166
|
+
const token = this.configuration.accessToken;
|
|
167
|
+
const tokenString = await token("bearerApiKey", []);
|
|
168
|
+
if (tokenString) {
|
|
169
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
let urlPath = `/v1/jobs/{id}/output`;
|
|
173
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
174
|
+
return {
|
|
175
|
+
path: urlPath,
|
|
176
|
+
method: 'GET',
|
|
177
|
+
headers: headerParameters,
|
|
178
|
+
query: queryParameters,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
183
|
+
* Get the encoded output file
|
|
184
|
+
*/
|
|
185
|
+
async getJobOutputRaw(requestParameters, initOverrides) {
|
|
186
|
+
const requestOptions = await this.getJobOutputRequestOpts(requestParameters);
|
|
187
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
188
|
+
return new runtime.VoidApiResponse(response);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Returns a 302 redirect to a signed download URL for the job\'s output file. The signed URL is valid for 24 hours.
|
|
192
|
+
* Get the encoded output file
|
|
193
|
+
*/
|
|
194
|
+
async getJobOutput(requestParameters, initOverrides) {
|
|
195
|
+
await this.getJobOutputRaw(requestParameters, initOverrides);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates request options for listJobs without sending the request
|
|
199
|
+
*/
|
|
200
|
+
async listJobsRequestOpts(requestParameters) {
|
|
201
|
+
const queryParameters = {};
|
|
202
|
+
if (requestParameters['status'] != null) {
|
|
203
|
+
queryParameters['status'] = requestParameters['status'];
|
|
204
|
+
}
|
|
205
|
+
if (requestParameters['limit'] != null) {
|
|
206
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
207
|
+
}
|
|
208
|
+
if (requestParameters['cursor'] != null) {
|
|
209
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
210
|
+
}
|
|
211
|
+
const headerParameters = {};
|
|
212
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
213
|
+
const token = this.configuration.accessToken;
|
|
214
|
+
const tokenString = await token("bearerApiKey", []);
|
|
215
|
+
if (tokenString) {
|
|
216
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
let urlPath = `/v1/jobs`;
|
|
220
|
+
return {
|
|
221
|
+
path: urlPath,
|
|
222
|
+
method: 'GET',
|
|
223
|
+
headers: headerParameters,
|
|
224
|
+
query: queryParameters,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
229
|
+
* List jobs with cursor pagination
|
|
230
|
+
*/
|
|
231
|
+
async listJobsRaw(requestParameters, initOverrides) {
|
|
232
|
+
const requestOptions = await this.listJobsRequestOpts(requestParameters);
|
|
233
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
234
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ListJobsResponseFromJSON)(jsonValue));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Returns jobs for the authenticated organization ordered by creation time, with optional status filtering and opaque cursor pagination.
|
|
238
|
+
* List jobs with cursor pagination
|
|
239
|
+
*/
|
|
240
|
+
async listJobs(requestParameters = {}, initOverrides) {
|
|
241
|
+
const response = await this.listJobsRaw(requestParameters, initOverrides);
|
|
242
|
+
return await response.value();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
exports.JobsApi = JobsApi;
|