@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.
Files changed (230) hide show
  1. package/.github/workflows/publish.yml +56 -0
  2. package/.openapi-generator/FILES +73 -0
  3. package/.openapi-generator/VERSION +1 -0
  4. package/.openapi-generator-ignore +23 -0
  5. package/LICENSE +12 -0
  6. package/README.md +164 -0
  7. package/dist/apis/DownloadsApi.d.ts +63 -0
  8. package/dist/apis/DownloadsApi.js +58 -0
  9. package/dist/apis/HealthApi.d.ts +92 -0
  10. package/dist/apis/HealthApi.js +85 -0
  11. package/dist/apis/JobsApi.d.ts +225 -0
  12. package/dist/apis/JobsApi.js +245 -0
  13. package/dist/apis/UploadsApi.d.ts +228 -0
  14. package/dist/apis/UploadsApi.js +255 -0
  15. package/dist/apis/WebhooksApi.d.ts +138 -0
  16. package/dist/apis/WebhooksApi.js +152 -0
  17. package/dist/apis/index.d.ts +5 -0
  18. package/dist/apis/index.js +23 -0
  19. package/dist/esm/apis/DownloadsApi.d.ts +63 -0
  20. package/dist/esm/apis/DownloadsApi.js +54 -0
  21. package/dist/esm/apis/HealthApi.d.ts +92 -0
  22. package/dist/esm/apis/HealthApi.js +81 -0
  23. package/dist/esm/apis/JobsApi.d.ts +225 -0
  24. package/dist/esm/apis/JobsApi.js +241 -0
  25. package/dist/esm/apis/UploadsApi.d.ts +228 -0
  26. package/dist/esm/apis/UploadsApi.js +251 -0
  27. package/dist/esm/apis/WebhooksApi.d.ts +138 -0
  28. package/dist/esm/apis/WebhooksApi.js +148 -0
  29. package/dist/esm/apis/index.d.ts +5 -0
  30. package/dist/esm/apis/index.js +7 -0
  31. package/dist/esm/helpers/index.d.ts +3 -0
  32. package/dist/esm/helpers/index.js +3 -0
  33. package/dist/esm/helpers/jobs.d.ts +48 -0
  34. package/dist/esm/helpers/jobs.js +61 -0
  35. package/dist/esm/helpers/uploads.d.ts +71 -0
  36. package/dist/esm/helpers/uploads.js +146 -0
  37. package/dist/esm/helpers/webhooks.d.ts +23 -0
  38. package/dist/esm/helpers/webhooks.js +84 -0
  39. package/dist/esm/index.d.ts +4 -0
  40. package/dist/esm/index.js +6 -0
  41. package/dist/esm/models/CompleteUploadResponse.d.ts +57 -0
  42. package/dist/esm/models/CompleteUploadResponse.js +63 -0
  43. package/dist/esm/models/CreateJobOutputOptions.d.ts +55 -0
  44. package/dist/esm/models/CreateJobOutputOptions.js +46 -0
  45. package/dist/esm/models/CreateJobRequest.d.ts +61 -0
  46. package/dist/esm/models/CreateJobRequest.js +56 -0
  47. package/dist/esm/models/CreateUploadRequest.d.ts +44 -0
  48. package/dist/esm/models/CreateUploadRequest.js +51 -0
  49. package/dist/esm/models/CreateUploadResponse.d.ts +52 -0
  50. package/dist/esm/models/CreateUploadResponse.js +55 -0
  51. package/dist/esm/models/CreateWebhookRequest.d.ts +40 -0
  52. package/dist/esm/models/CreateWebhookRequest.js +45 -0
  53. package/dist/esm/models/ErrorBody.d.ts +72 -0
  54. package/dist/esm/models/ErrorBody.js +74 -0
  55. package/dist/esm/models/ErrorEnvelope.d.ts +33 -0
  56. package/dist/esm/models/ErrorEnvelope.js +44 -0
  57. package/dist/esm/models/JobOutputInfo.d.ts +95 -0
  58. package/dist/esm/models/JobOutputInfo.js +72 -0
  59. package/dist/esm/models/JobProfile.d.ts +49 -0
  60. package/dist/esm/models/JobProfile.js +69 -0
  61. package/dist/esm/models/JobProgress.d.ts +75 -0
  62. package/dist/esm/models/JobProgress.js +60 -0
  63. package/dist/esm/models/JobResponse.d.ts +134 -0
  64. package/dist/esm/models/JobResponse.js +94 -0
  65. package/dist/esm/models/JobSourceInfo.d.ts +62 -0
  66. package/dist/esm/models/JobSourceInfo.js +53 -0
  67. package/dist/esm/models/JobSourceType.d.ts +24 -0
  68. package/dist/esm/models/JobSourceType.js +44 -0
  69. package/dist/esm/models/JobStatus.d.ts +31 -0
  70. package/dist/esm/models/JobStatus.js +51 -0
  71. package/dist/esm/models/ListJobsResponse.d.ts +45 -0
  72. package/dist/esm/models/ListJobsResponse.js +50 -0
  73. package/dist/esm/models/OutputContainer.d.ts +27 -0
  74. package/dist/esm/models/OutputContainer.js +47 -0
  75. package/dist/esm/models/ReadyResponse.d.ts +38 -0
  76. package/dist/esm/models/ReadyResponse.js +45 -0
  77. package/dist/esm/models/UploadJobSource.d.ts +39 -0
  78. package/dist/esm/models/UploadJobSource.js +48 -0
  79. package/dist/esm/models/UploadPartResponse.d.ts +38 -0
  80. package/dist/esm/models/UploadPartResponse.js +47 -0
  81. package/dist/esm/models/UploadStatusResponse.d.ts +96 -0
  82. package/dist/esm/models/UploadStatusResponse.js +80 -0
  83. package/dist/esm/models/WebhookDeliveryPayload.d.ts +85 -0
  84. package/dist/esm/models/WebhookDeliveryPayload.js +83 -0
  85. package/dist/esm/models/WebhookListItem.d.ts +50 -0
  86. package/dist/esm/models/WebhookListItem.js +55 -0
  87. package/dist/esm/models/WebhookListResponse.d.ts +33 -0
  88. package/dist/esm/models/WebhookListResponse.js +44 -0
  89. package/dist/esm/models/WebhookResponse.d.ts +58 -0
  90. package/dist/esm/models/WebhookResponse.js +59 -0
  91. package/dist/esm/models/index.d.ts +25 -0
  92. package/dist/esm/models/index.js +27 -0
  93. package/dist/esm/runtime.d.ts +184 -0
  94. package/dist/esm/runtime.js +348 -0
  95. package/dist/helpers/index.d.ts +3 -0
  96. package/dist/helpers/index.js +19 -0
  97. package/dist/helpers/jobs.d.ts +48 -0
  98. package/dist/helpers/jobs.js +67 -0
  99. package/dist/helpers/uploads.d.ts +71 -0
  100. package/dist/helpers/uploads.js +149 -0
  101. package/dist/helpers/webhooks.d.ts +23 -0
  102. package/dist/helpers/webhooks.js +89 -0
  103. package/dist/index.d.ts +4 -0
  104. package/dist/index.js +22 -0
  105. package/dist/models/CompleteUploadResponse.d.ts +57 -0
  106. package/dist/models/CompleteUploadResponse.js +71 -0
  107. package/dist/models/CreateJobOutputOptions.d.ts +55 -0
  108. package/dist/models/CreateJobOutputOptions.js +53 -0
  109. package/dist/models/CreateJobRequest.d.ts +61 -0
  110. package/dist/models/CreateJobRequest.js +63 -0
  111. package/dist/models/CreateUploadRequest.d.ts +44 -0
  112. package/dist/models/CreateUploadRequest.js +58 -0
  113. package/dist/models/CreateUploadResponse.d.ts +52 -0
  114. package/dist/models/CreateUploadResponse.js +62 -0
  115. package/dist/models/CreateWebhookRequest.d.ts +40 -0
  116. package/dist/models/CreateWebhookRequest.js +52 -0
  117. package/dist/models/ErrorBody.d.ts +72 -0
  118. package/dist/models/ErrorBody.js +82 -0
  119. package/dist/models/ErrorEnvelope.d.ts +33 -0
  120. package/dist/models/ErrorEnvelope.js +51 -0
  121. package/dist/models/JobOutputInfo.d.ts +95 -0
  122. package/dist/models/JobOutputInfo.js +80 -0
  123. package/dist/models/JobProfile.d.ts +49 -0
  124. package/dist/models/JobProfile.js +77 -0
  125. package/dist/models/JobProgress.d.ts +75 -0
  126. package/dist/models/JobProgress.js +67 -0
  127. package/dist/models/JobResponse.d.ts +134 -0
  128. package/dist/models/JobResponse.js +101 -0
  129. package/dist/models/JobSourceInfo.d.ts +62 -0
  130. package/dist/models/JobSourceInfo.js +60 -0
  131. package/dist/models/JobSourceType.d.ts +24 -0
  132. package/dist/models/JobSourceType.js +52 -0
  133. package/dist/models/JobStatus.d.ts +31 -0
  134. package/dist/models/JobStatus.js +59 -0
  135. package/dist/models/ListJobsResponse.d.ts +45 -0
  136. package/dist/models/ListJobsResponse.js +57 -0
  137. package/dist/models/OutputContainer.d.ts +27 -0
  138. package/dist/models/OutputContainer.js +55 -0
  139. package/dist/models/ReadyResponse.d.ts +38 -0
  140. package/dist/models/ReadyResponse.js +52 -0
  141. package/dist/models/UploadJobSource.d.ts +39 -0
  142. package/dist/models/UploadJobSource.js +55 -0
  143. package/dist/models/UploadPartResponse.d.ts +38 -0
  144. package/dist/models/UploadPartResponse.js +54 -0
  145. package/dist/models/UploadStatusResponse.d.ts +96 -0
  146. package/dist/models/UploadStatusResponse.js +88 -0
  147. package/dist/models/WebhookDeliveryPayload.d.ts +85 -0
  148. package/dist/models/WebhookDeliveryPayload.js +91 -0
  149. package/dist/models/WebhookListItem.d.ts +50 -0
  150. package/dist/models/WebhookListItem.js +62 -0
  151. package/dist/models/WebhookListResponse.d.ts +33 -0
  152. package/dist/models/WebhookListResponse.js +51 -0
  153. package/dist/models/WebhookResponse.d.ts +58 -0
  154. package/dist/models/WebhookResponse.js +66 -0
  155. package/dist/models/index.d.ts +25 -0
  156. package/dist/models/index.js +43 -0
  157. package/dist/runtime.d.ts +184 -0
  158. package/dist/runtime.js +364 -0
  159. package/docs/CompleteUploadResponse.md +40 -0
  160. package/docs/CreateJobOutputOptions.md +39 -0
  161. package/docs/CreateJobRequest.md +42 -0
  162. package/docs/CreateUploadRequest.md +38 -0
  163. package/docs/CreateUploadResponse.md +40 -0
  164. package/docs/CreateWebhookRequest.md +36 -0
  165. package/docs/DownloadsApi.md +78 -0
  166. package/docs/ErrorBody.md +40 -0
  167. package/docs/ErrorEnvelope.md +34 -0
  168. package/docs/HealthApi.md +129 -0
  169. package/docs/JobOutputInfo.md +50 -0
  170. package/docs/JobProfile.md +33 -0
  171. package/docs/JobProgress.md +48 -0
  172. package/docs/JobResponse.md +62 -0
  173. package/docs/JobSourceInfo.md +44 -0
  174. package/docs/JobSourceType.md +33 -0
  175. package/docs/JobStatus.md +33 -0
  176. package/docs/JobsApi.md +407 -0
  177. package/docs/ListJobsResponse.md +38 -0
  178. package/docs/OutputContainer.md +33 -0
  179. package/docs/ReadyResponse.md +36 -0
  180. package/docs/UploadJobSource.md +37 -0
  181. package/docs/UploadPartResponse.md +36 -0
  182. package/docs/UploadStatusResponse.md +50 -0
  183. package/docs/UploadsApi.md +415 -0
  184. package/docs/WebhookDeliveryPayload.md +45 -0
  185. package/docs/WebhookEventsApi.md +91 -0
  186. package/docs/WebhookListItem.md +40 -0
  187. package/docs/WebhookListResponse.md +34 -0
  188. package/docs/WebhookResponse.md +42 -0
  189. package/docs/WebhooksApi.md +235 -0
  190. package/package.json +24 -0
  191. package/src/apis/DownloadsApi.ts +114 -0
  192. package/src/apis/HealthApi.ts +160 -0
  193. package/src/apis/JobsApi.ts +491 -0
  194. package/src/apis/UploadsApi.ts +522 -0
  195. package/src/apis/WebhooksApi.ts +298 -0
  196. package/src/apis/index.ts +7 -0
  197. package/src/helpers/index.ts +3 -0
  198. package/src/helpers/jobs.ts +112 -0
  199. package/src/helpers/uploads.ts +243 -0
  200. package/src/helpers/webhooks.ts +134 -0
  201. package/src/index.ts +7 -0
  202. package/src/models/CompleteUploadResponse.ts +102 -0
  203. package/src/models/CreateJobOutputOptions.ts +101 -0
  204. package/src/models/CreateJobRequest.ts +123 -0
  205. package/src/models/CreateUploadRequest.ts +84 -0
  206. package/src/models/CreateUploadResponse.ts +95 -0
  207. package/src/models/CreateWebhookRequest.ts +76 -0
  208. package/src/models/ErrorBody.ts +116 -0
  209. package/src/models/ErrorEnvelope.ts +74 -0
  210. package/src/models/JobOutputInfo.ts +149 -0
  211. package/src/models/JobProfile.ts +76 -0
  212. package/src/models/JobProgress.ts +133 -0
  213. package/src/models/JobResponse.ts +236 -0
  214. package/src/models/JobSourceInfo.ts +106 -0
  215. package/src/models/JobSourceType.ts +51 -0
  216. package/src/models/JobStatus.ts +58 -0
  217. package/src/models/ListJobsResponse.ts +91 -0
  218. package/src/models/OutputContainer.ts +54 -0
  219. package/src/models/ReadyResponse.ts +74 -0
  220. package/src/models/UploadJobSource.ts +85 -0
  221. package/src/models/UploadPartResponse.ts +75 -0
  222. package/src/models/UploadStatusResponse.ts +153 -0
  223. package/src/models/WebhookDeliveryPayload.ts +134 -0
  224. package/src/models/WebhookListItem.ts +93 -0
  225. package/src/models/WebhookListResponse.ts +74 -0
  226. package/src/models/WebhookResponse.ts +104 -0
  227. package/src/models/index.ts +27 -0
  228. package/src/runtime.ts +450 -0
  229. package/tsconfig.esm.json +7 -0
  230. package/tsconfig.json +20 -0
@@ -0,0 +1,228 @@
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 { CompleteUploadResponse, CreateUploadRequest, CreateUploadResponse, UploadPartResponse, UploadStatusResponse } from '../models/index';
14
+ export interface CancelUploadRequest {
15
+ id: string;
16
+ }
17
+ export interface CompleteUploadRequest {
18
+ id: string;
19
+ idempotencyKey: string;
20
+ }
21
+ export interface CreateUploadOperationRequest {
22
+ idempotencyKey: string;
23
+ createUploadRequest: CreateUploadRequest;
24
+ }
25
+ export interface GetUploadRequest {
26
+ id: string;
27
+ }
28
+ export interface UploadPartRequest {
29
+ id: string;
30
+ partNumber: number;
31
+ body: Blob;
32
+ }
33
+ /**
34
+ * UploadsApi - interface
35
+ *
36
+ * @export
37
+ * @interface UploadsApiInterface
38
+ */
39
+ export interface UploadsApiInterface {
40
+ /**
41
+ * Creates request options for cancelUpload without sending the request
42
+ * @param {string} id
43
+ * @throws {RequiredError}
44
+ * @memberof UploadsApiInterface
45
+ */
46
+ cancelUploadRequestOpts(requestParameters: CancelUploadRequest): Promise<runtime.RequestOpts>;
47
+ /**
48
+ * Sets the upload session to canceled and deletes staged chunks from disk.
49
+ * @summary Cancel an upload session
50
+ * @param {string} id
51
+ * @param {*} [options] Override http request option.
52
+ * @throws {RequiredError}
53
+ * @memberof UploadsApiInterface
54
+ */
55
+ cancelUploadRaw(requestParameters: CancelUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
56
+ /**
57
+ * Sets the upload session to canceled and deletes staged chunks from disk.
58
+ * Cancel an upload session
59
+ */
60
+ cancelUpload(requestParameters: CancelUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
61
+ /**
62
+ * Creates request options for completeUpload without sending the request
63
+ * @param {string} id
64
+ * @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.
65
+ * @throws {RequiredError}
66
+ * @memberof UploadsApiInterface
67
+ */
68
+ completeUploadRequestOpts(requestParameters: CompleteUploadRequest): Promise<runtime.RequestOpts>;
69
+ /**
70
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
71
+ * @summary Finalize a chunked upload
72
+ * @param {string} id
73
+ * @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.
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ * @memberof UploadsApiInterface
77
+ */
78
+ completeUploadRaw(requestParameters: CompleteUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompleteUploadResponse>>;
79
+ /**
80
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
81
+ * Finalize a chunked upload
82
+ */
83
+ completeUpload(requestParameters: CompleteUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompleteUploadResponse>;
84
+ /**
85
+ * Creates request options for createUpload without sending the request
86
+ * @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.
87
+ * @param {CreateUploadRequest} createUploadRequest
88
+ * @throws {RequiredError}
89
+ * @memberof UploadsApiInterface
90
+ */
91
+ createUploadRequestOpts(requestParameters: CreateUploadOperationRequest): Promise<runtime.RequestOpts>;
92
+ /**
93
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
94
+ * @summary Initialize a chunked upload session
95
+ * @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.
96
+ * @param {CreateUploadRequest} createUploadRequest
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ * @memberof UploadsApiInterface
100
+ */
101
+ createUploadRaw(requestParameters: CreateUploadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>>;
102
+ /**
103
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
104
+ * Initialize a chunked upload session
105
+ */
106
+ createUpload(requestParameters: CreateUploadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse>;
107
+ /**
108
+ * Creates request options for getUpload without sending the request
109
+ * @param {string} id
110
+ * @throws {RequiredError}
111
+ * @memberof UploadsApiInterface
112
+ */
113
+ getUploadRequestOpts(requestParameters: GetUploadRequest): Promise<runtime.RequestOpts>;
114
+ /**
115
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
116
+ * @summary Get upload session status
117
+ * @param {string} id
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ * @memberof UploadsApiInterface
121
+ */
122
+ getUploadRaw(requestParameters: GetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>>;
123
+ /**
124
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
125
+ * Get upload session status
126
+ */
127
+ getUpload(requestParameters: GetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse>;
128
+ /**
129
+ * Creates request options for uploadPart without sending the request
130
+ * @param {string} id
131
+ * @param {number} partNumber
132
+ * @param {Blob} body
133
+ * @throws {RequiredError}
134
+ * @memberof UploadsApiInterface
135
+ */
136
+ uploadPartRequestOpts(requestParameters: UploadPartRequest): Promise<runtime.RequestOpts>;
137
+ /**
138
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
139
+ * @summary Upload a single chunk
140
+ * @param {string} id
141
+ * @param {number} partNumber
142
+ * @param {Blob} body
143
+ * @param {*} [options] Override http request option.
144
+ * @throws {RequiredError}
145
+ * @memberof UploadsApiInterface
146
+ */
147
+ uploadPartRaw(requestParameters: UploadPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>>;
148
+ /**
149
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
150
+ * Upload a single chunk
151
+ */
152
+ uploadPart(requestParameters: UploadPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse>;
153
+ }
154
+ /**
155
+ *
156
+ */
157
+ export declare class UploadsApi extends runtime.BaseAPI implements UploadsApiInterface {
158
+ /**
159
+ * Creates request options for cancelUpload without sending the request
160
+ */
161
+ cancelUploadRequestOpts(requestParameters: CancelUploadRequest): Promise<runtime.RequestOpts>;
162
+ /**
163
+ * Sets the upload session to canceled and deletes staged chunks from disk.
164
+ * Cancel an upload session
165
+ */
166
+ cancelUploadRaw(requestParameters: CancelUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
167
+ /**
168
+ * Sets the upload session to canceled and deletes staged chunks from disk.
169
+ * Cancel an upload session
170
+ */
171
+ cancelUpload(requestParameters: CancelUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
172
+ /**
173
+ * Creates request options for completeUpload without sending the request
174
+ */
175
+ completeUploadRequestOpts(requestParameters: CompleteUploadRequest): Promise<runtime.RequestOpts>;
176
+ /**
177
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
178
+ * Finalize a chunked upload
179
+ */
180
+ completeUploadRaw(requestParameters: CompleteUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompleteUploadResponse>>;
181
+ /**
182
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
183
+ * Finalize a chunked upload
184
+ */
185
+ completeUpload(requestParameters: CompleteUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompleteUploadResponse>;
186
+ /**
187
+ * Creates request options for createUpload without sending the request
188
+ */
189
+ createUploadRequestOpts(requestParameters: CreateUploadOperationRequest): Promise<runtime.RequestOpts>;
190
+ /**
191
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
192
+ * Initialize a chunked upload session
193
+ */
194
+ createUploadRaw(requestParameters: CreateUploadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>>;
195
+ /**
196
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
197
+ * Initialize a chunked upload session
198
+ */
199
+ createUpload(requestParameters: CreateUploadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse>;
200
+ /**
201
+ * Creates request options for getUpload without sending the request
202
+ */
203
+ getUploadRequestOpts(requestParameters: GetUploadRequest): Promise<runtime.RequestOpts>;
204
+ /**
205
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
206
+ * Get upload session status
207
+ */
208
+ getUploadRaw(requestParameters: GetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>>;
209
+ /**
210
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
211
+ * Get upload session status
212
+ */
213
+ getUpload(requestParameters: GetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse>;
214
+ /**
215
+ * Creates request options for uploadPart without sending the request
216
+ */
217
+ uploadPartRequestOpts(requestParameters: UploadPartRequest): Promise<runtime.RequestOpts>;
218
+ /**
219
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
220
+ * Upload a single chunk
221
+ */
222
+ uploadPartRaw(requestParameters: UploadPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>>;
223
+ /**
224
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
225
+ * Upload a single chunk
226
+ */
227
+ uploadPart(requestParameters: UploadPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse>;
228
+ }
@@ -0,0 +1,255 @@
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.UploadsApi = void 0;
17
+ const runtime = require("../runtime");
18
+ const index_1 = require("../models/index");
19
+ /**
20
+ *
21
+ */
22
+ class UploadsApi extends runtime.BaseAPI {
23
+ /**
24
+ * Creates request options for cancelUpload without sending the request
25
+ */
26
+ async cancelUploadRequestOpts(requestParameters) {
27
+ if (requestParameters['id'] == null) {
28
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling cancelUpload().');
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/uploads/{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
+ * Sets the upload session to canceled and deletes staged chunks from disk.
50
+ * Cancel an upload session
51
+ */
52
+ async cancelUploadRaw(requestParameters, initOverrides) {
53
+ const requestOptions = await this.cancelUploadRequestOpts(requestParameters);
54
+ const response = await this.request(requestOptions, initOverrides);
55
+ return new runtime.VoidApiResponse(response);
56
+ }
57
+ /**
58
+ * Sets the upload session to canceled and deletes staged chunks from disk.
59
+ * Cancel an upload session
60
+ */
61
+ async cancelUpload(requestParameters, initOverrides) {
62
+ await this.cancelUploadRaw(requestParameters, initOverrides);
63
+ }
64
+ /**
65
+ * Creates request options for completeUpload without sending the request
66
+ */
67
+ async completeUploadRequestOpts(requestParameters) {
68
+ if (requestParameters['id'] == null) {
69
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling completeUpload().');
70
+ }
71
+ if (requestParameters['idempotencyKey'] == null) {
72
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling completeUpload().');
73
+ }
74
+ const queryParameters = {};
75
+ const headerParameters = {};
76
+ if (requestParameters['idempotencyKey'] != null) {
77
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
78
+ }
79
+ if (this.configuration && this.configuration.accessToken) {
80
+ const token = this.configuration.accessToken;
81
+ const tokenString = await token("bearerApiKey", []);
82
+ if (tokenString) {
83
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
84
+ }
85
+ }
86
+ let urlPath = `/v1/uploads/{id}/complete`;
87
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
88
+ return {
89
+ path: urlPath,
90
+ method: 'POST',
91
+ headers: headerParameters,
92
+ query: queryParameters,
93
+ };
94
+ }
95
+ /**
96
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
97
+ * Finalize a chunked upload
98
+ */
99
+ async completeUploadRaw(requestParameters, initOverrides) {
100
+ const requestOptions = await this.completeUploadRequestOpts(requestParameters);
101
+ const response = await this.request(requestOptions, initOverrides);
102
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompleteUploadResponseFromJSON)(jsonValue));
103
+ }
104
+ /**
105
+ * Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
106
+ * Finalize a chunked upload
107
+ */
108
+ async completeUpload(requestParameters, initOverrides) {
109
+ const response = await this.completeUploadRaw(requestParameters, initOverrides);
110
+ return await response.value();
111
+ }
112
+ /**
113
+ * Creates request options for createUpload without sending the request
114
+ */
115
+ async createUploadRequestOpts(requestParameters) {
116
+ if (requestParameters['idempotencyKey'] == null) {
117
+ throw new runtime.RequiredError('idempotencyKey', 'Required parameter "idempotencyKey" was null or undefined when calling createUpload().');
118
+ }
119
+ if (requestParameters['createUploadRequest'] == null) {
120
+ throw new runtime.RequiredError('createUploadRequest', 'Required parameter "createUploadRequest" was null or undefined when calling createUpload().');
121
+ }
122
+ const queryParameters = {};
123
+ const headerParameters = {};
124
+ headerParameters['Content-Type'] = 'application/json';
125
+ if (requestParameters['idempotencyKey'] != null) {
126
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
127
+ }
128
+ if (this.configuration && this.configuration.accessToken) {
129
+ const token = this.configuration.accessToken;
130
+ const tokenString = await token("bearerApiKey", []);
131
+ if (tokenString) {
132
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
133
+ }
134
+ }
135
+ let urlPath = `/v1/uploads`;
136
+ return {
137
+ path: urlPath,
138
+ method: 'POST',
139
+ headers: headerParameters,
140
+ query: queryParameters,
141
+ body: (0, index_1.CreateUploadRequestToJSON)(requestParameters['createUploadRequest']),
142
+ };
143
+ }
144
+ /**
145
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
146
+ * Initialize a chunked upload session
147
+ */
148
+ async createUploadRaw(requestParameters, initOverrides) {
149
+ const requestOptions = await this.createUploadRequestOpts(requestParameters);
150
+ const response = await this.request(requestOptions, initOverrides);
151
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateUploadResponseFromJSON)(jsonValue));
152
+ }
153
+ /**
154
+ * Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
155
+ * Initialize a chunked upload session
156
+ */
157
+ async createUpload(requestParameters, initOverrides) {
158
+ const response = await this.createUploadRaw(requestParameters, initOverrides);
159
+ return await response.value();
160
+ }
161
+ /**
162
+ * Creates request options for getUpload without sending the request
163
+ */
164
+ async getUploadRequestOpts(requestParameters) {
165
+ if (requestParameters['id'] == null) {
166
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getUpload().');
167
+ }
168
+ const queryParameters = {};
169
+ const headerParameters = {};
170
+ if (this.configuration && this.configuration.accessToken) {
171
+ const token = this.configuration.accessToken;
172
+ const tokenString = await token("bearerApiKey", []);
173
+ if (tokenString) {
174
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
175
+ }
176
+ }
177
+ let urlPath = `/v1/uploads/{id}`;
178
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
179
+ return {
180
+ path: urlPath,
181
+ method: 'GET',
182
+ headers: headerParameters,
183
+ query: queryParameters,
184
+ };
185
+ }
186
+ /**
187
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
188
+ * Get upload session status
189
+ */
190
+ async getUploadRaw(requestParameters, initOverrides) {
191
+ const requestOptions = await this.getUploadRequestOpts(requestParameters);
192
+ const response = await this.request(requestOptions, initOverrides);
193
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadStatusResponseFromJSON)(jsonValue));
194
+ }
195
+ /**
196
+ * Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
197
+ * Get upload session status
198
+ */
199
+ async getUpload(requestParameters, initOverrides) {
200
+ const response = await this.getUploadRaw(requestParameters, initOverrides);
201
+ return await response.value();
202
+ }
203
+ /**
204
+ * Creates request options for uploadPart without sending the request
205
+ */
206
+ async uploadPartRequestOpts(requestParameters) {
207
+ if (requestParameters['id'] == null) {
208
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling uploadPart().');
209
+ }
210
+ if (requestParameters['partNumber'] == null) {
211
+ throw new runtime.RequiredError('partNumber', 'Required parameter "partNumber" was null or undefined when calling uploadPart().');
212
+ }
213
+ if (requestParameters['body'] == null) {
214
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling uploadPart().');
215
+ }
216
+ const queryParameters = {};
217
+ const headerParameters = {};
218
+ headerParameters['Content-Type'] = 'application/octet-stream';
219
+ if (this.configuration && this.configuration.accessToken) {
220
+ const token = this.configuration.accessToken;
221
+ const tokenString = await token("bearerApiKey", []);
222
+ if (tokenString) {
223
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
224
+ }
225
+ }
226
+ let urlPath = `/v1/uploads/{id}/parts/{part_number}`;
227
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
228
+ urlPath = urlPath.replace(`{${"part_number"}}`, encodeURIComponent(String(requestParameters['partNumber'])));
229
+ return {
230
+ path: urlPath,
231
+ method: 'PUT',
232
+ headers: headerParameters,
233
+ query: queryParameters,
234
+ body: requestParameters['body'],
235
+ };
236
+ }
237
+ /**
238
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
239
+ * Upload a single chunk
240
+ */
241
+ async uploadPartRaw(requestParameters, initOverrides) {
242
+ const requestOptions = await this.uploadPartRequestOpts(requestParameters);
243
+ const response = await this.request(requestOptions, initOverrides);
244
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadPartResponseFromJSON)(jsonValue));
245
+ }
246
+ /**
247
+ * Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
248
+ * Upload a single chunk
249
+ */
250
+ async uploadPart(requestParameters, initOverrides) {
251
+ const response = await this.uploadPartRaw(requestParameters, initOverrides);
252
+ return await response.value();
253
+ }
254
+ }
255
+ exports.UploadsApi = UploadsApi;
@@ -0,0 +1,138 @@
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 { CreateWebhookRequest, WebhookListResponse, WebhookResponse } from '../models/index';
14
+ export interface CreateWebhookOperationRequest {
15
+ idempotencyKey: string;
16
+ createWebhookRequest: CreateWebhookRequest;
17
+ }
18
+ export interface DeleteWebhookRequest {
19
+ id: string;
20
+ }
21
+ /**
22
+ * WebhooksApi - interface
23
+ *
24
+ * @export
25
+ * @interface WebhooksApiInterface
26
+ */
27
+ export interface WebhooksApiInterface {
28
+ /**
29
+ * Creates request options for createWebhook without sending the request
30
+ * @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.
31
+ * @param {CreateWebhookRequest} createWebhookRequest
32
+ * @throws {RequiredError}
33
+ * @memberof WebhooksApiInterface
34
+ */
35
+ createWebhookRequestOpts(requestParameters: CreateWebhookOperationRequest): Promise<runtime.RequestOpts>;
36
+ /**
37
+ * Registers an HTTPS endpoint for terminal job events and returns the HMAC signing secret once at creation time.
38
+ * @summary Register a webhook endpoint
39
+ * @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.
40
+ * @param {CreateWebhookRequest} createWebhookRequest
41
+ * @param {*} [options] Override http request option.
42
+ * @throws {RequiredError}
43
+ * @memberof WebhooksApiInterface
44
+ */
45
+ createWebhookRaw(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookResponse>>;
46
+ /**
47
+ * Registers an HTTPS endpoint for terminal job events and returns the HMAC signing secret once at creation time.
48
+ * Register a webhook endpoint
49
+ */
50
+ createWebhook(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookResponse>;
51
+ /**
52
+ * Creates request options for deleteWebhook without sending the request
53
+ * @param {string} id
54
+ * @throws {RequiredError}
55
+ * @memberof WebhooksApiInterface
56
+ */
57
+ deleteWebhookRequestOpts(requestParameters: DeleteWebhookRequest): Promise<runtime.RequestOpts>;
58
+ /**
59
+ * Sets the webhook to inactive. It will no longer receive deliveries.
60
+ * @summary Soft-delete a webhook endpoint
61
+ * @param {string} id
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof WebhooksApiInterface
65
+ */
66
+ deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+ /**
68
+ * Sets the webhook to inactive. It will no longer receive deliveries.
69
+ * Soft-delete a webhook endpoint
70
+ */
71
+ deleteWebhook(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
72
+ /**
73
+ * Creates request options for listWebhooks without sending the request
74
+ * @throws {RequiredError}
75
+ * @memberof WebhooksApiInterface
76
+ */
77
+ listWebhooksRequestOpts(): Promise<runtime.RequestOpts>;
78
+ /**
79
+ * Lists active webhook endpoints for the authenticated organization.
80
+ * @summary List active webhook endpoints
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ * @memberof WebhooksApiInterface
84
+ */
85
+ listWebhooksRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookListResponse>>;
86
+ /**
87
+ * Lists active webhook endpoints for the authenticated organization.
88
+ * List active webhook endpoints
89
+ */
90
+ listWebhooks(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookListResponse>;
91
+ }
92
+ /**
93
+ *
94
+ */
95
+ export declare class WebhooksApi extends runtime.BaseAPI implements WebhooksApiInterface {
96
+ /**
97
+ * Creates request options for createWebhook without sending the request
98
+ */
99
+ createWebhookRequestOpts(requestParameters: CreateWebhookOperationRequest): Promise<runtime.RequestOpts>;
100
+ /**
101
+ * Registers an HTTPS endpoint for terminal job events and returns the HMAC signing secret once at creation time.
102
+ * Register a webhook endpoint
103
+ */
104
+ createWebhookRaw(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookResponse>>;
105
+ /**
106
+ * Registers an HTTPS endpoint for terminal job events and returns the HMAC signing secret once at creation time.
107
+ * Register a webhook endpoint
108
+ */
109
+ createWebhook(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookResponse>;
110
+ /**
111
+ * Creates request options for deleteWebhook without sending the request
112
+ */
113
+ deleteWebhookRequestOpts(requestParameters: DeleteWebhookRequest): Promise<runtime.RequestOpts>;
114
+ /**
115
+ * Sets the webhook to inactive. It will no longer receive deliveries.
116
+ * Soft-delete a webhook endpoint
117
+ */
118
+ deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
119
+ /**
120
+ * Sets the webhook to inactive. It will no longer receive deliveries.
121
+ * Soft-delete a webhook endpoint
122
+ */
123
+ deleteWebhook(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
124
+ /**
125
+ * Creates request options for listWebhooks without sending the request
126
+ */
127
+ listWebhooksRequestOpts(): Promise<runtime.RequestOpts>;
128
+ /**
129
+ * Lists active webhook endpoints for the authenticated organization.
130
+ * List active webhook endpoints
131
+ */
132
+ listWebhooksRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookListResponse>>;
133
+ /**
134
+ * Lists active webhook endpoints for the authenticated organization.
135
+ * List active webhook endpoints
136
+ */
137
+ listWebhooks(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookListResponse>;
138
+ }