@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,37 @@
1
+
2
+ # UploadJobSource
3
+
4
+ Source backed by a completed chunked upload session.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | [JobSourceType](JobSourceType.md)
11
+ `upload_id` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { UploadJobSource } from '@liqhtworks/sophon-sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "type": null,
21
+ "upload_id": upl_01JQ8abc123,
22
+ } satisfies UploadJobSource
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as UploadJobSource
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -0,0 +1,36 @@
1
+
2
+ # UploadPartResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `part_number` | number
10
+ `received` | boolean
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { UploadPartResponse } from '@liqhtworks/sophon-sdk'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "part_number": null,
20
+ "received": null,
21
+ } satisfies UploadPartResponse
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 UploadPartResponse
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
+
@@ -0,0 +1,50 @@
1
+
2
+ # UploadStatusResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `status` | string
11
+ `file_name` | string
12
+ `total_chunks` | number
13
+ `received_chunks` | Array<number>
14
+ `expires_at` | Date
15
+ `source_width` | number
16
+ `source_height` | number
17
+ `source_duration_seconds` | number
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import type { UploadStatusResponse } from '@liqhtworks/sophon-sdk'
23
+
24
+ // TODO: Update the object below with actual values
25
+ const example = {
26
+ "id": null,
27
+ "status": null,
28
+ "file_name": null,
29
+ "total_chunks": null,
30
+ "received_chunks": null,
31
+ "expires_at": null,
32
+ "source_width": 3840,
33
+ "source_height": 2160,
34
+ "source_duration_seconds": 600.0,
35
+ } satisfies UploadStatusResponse
36
+
37
+ console.log(example)
38
+
39
+ // Convert the instance to a JSON string
40
+ const exampleJSON: string = JSON.stringify(example)
41
+ console.log(exampleJSON)
42
+
43
+ // Parse the JSON string back to an object
44
+ const exampleParsed = JSON.parse(exampleJSON) as UploadStatusResponse
45
+ console.log(exampleParsed)
46
+ ```
47
+
48
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
49
+
50
+
@@ -0,0 +1,415 @@
1
+ # UploadsApi
2
+
3
+ All URIs are relative to *https://api.liqhtworks.xyz*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**cancelUpload**](UploadsApi.md#cancelupload) | **DELETE** /v1/uploads/{id} | Cancel an upload session |
8
+ | [**completeUpload**](UploadsApi.md#completeupload) | **POST** /v1/uploads/{id}/complete | Finalize a chunked upload |
9
+ | [**createUpload**](UploadsApi.md#createuploadoperation) | **POST** /v1/uploads | Initialize a chunked upload session |
10
+ | [**getUpload**](UploadsApi.md#getupload) | **GET** /v1/uploads/{id} | Get upload session status |
11
+ | [**uploadPart**](UploadsApi.md#uploadpart) | **PUT** /v1/uploads/{id}/parts/{part_number} | Upload a single chunk |
12
+
13
+
14
+
15
+ ## cancelUpload
16
+
17
+ > cancelUpload(id)
18
+
19
+ Cancel an upload session
20
+
21
+ Sets the upload session to canceled and deletes staged chunks from disk.
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ import {
27
+ Configuration,
28
+ UploadsApi,
29
+ } from '@liqhtworks/sophon-sdk';
30
+ import type { CancelUploadRequest } 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 UploadsApi(config);
41
+
42
+ const body = {
43
+ // string
44
+ id: id_example,
45
+ } satisfies CancelUploadRequest;
46
+
47
+ try {
48
+ const data = await api.cancelUpload(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
+ `void` (Empty response body)
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
+ | **204** | Upload canceled. No content returned. | * X-Request-Id - <br> |
84
+ | **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
85
+ | **403** | Insufficient scope (requires uploads:write). | * X-Request-Id - <br> |
86
+ | **404** | Upload session not found. | * X-Request-Id - <br> |
87
+
88
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
89
+
90
+
91
+ ## completeUpload
92
+
93
+ > CompleteUploadResponse completeUpload(id, idempotencyKey)
94
+
95
+ Finalize a chunked upload
96
+
97
+ Assembles all received chunks into a single file, validates size matches the declared file_size, probes with ffprobe, and transitions the session to completed.
98
+
99
+ ### Example
100
+
101
+ ```ts
102
+ import {
103
+ Configuration,
104
+ UploadsApi,
105
+ } from '@liqhtworks/sophon-sdk';
106
+ import type { CompleteUploadRequest } from '@liqhtworks/sophon-sdk';
107
+
108
+ async function example() {
109
+ console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
110
+ const config = new Configuration({
111
+ // To configure API key authorization: sessionCookie
112
+ apiKey: "YOUR API KEY",
113
+ // Configure HTTP bearer authorization: bearerApiKey
114
+ accessToken: "YOUR BEARER TOKEN",
115
+ });
116
+ const api = new UploadsApi(config);
117
+
118
+ const body = {
119
+ // string
120
+ id: id_example,
121
+ // 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.
122
+ idempotencyKey: idempotencyKey_example,
123
+ } satisfies CompleteUploadRequest;
124
+
125
+ try {
126
+ const data = await api.completeUpload(body);
127
+ console.log(data);
128
+ } catch (error) {
129
+ console.error(error);
130
+ }
131
+ }
132
+
133
+ // Run the test
134
+ example().catch(console.error);
135
+ ```
136
+
137
+ ### Parameters
138
+
139
+
140
+ | Name | Type | Description | Notes |
141
+ |------------- | ------------- | ------------- | -------------|
142
+ | **id** | `string` | | [Defaults to `undefined`] |
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
+
145
+ ### Return type
146
+
147
+ [**CompleteUploadResponse**](CompleteUploadResponse.md)
148
+
149
+ ### Authorization
150
+
151
+ [sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
152
+
153
+ ### HTTP request headers
154
+
155
+ - **Content-Type**: Not defined
156
+ - **Accept**: `application/json`
157
+
158
+
159
+ ### HTTP response details
160
+ | Status code | Description | Response headers |
161
+ |-------------|-------------|------------------|
162
+ | **200** | Upload assembled and validated. | * X-Request-Id - <br> |
163
+ | **400** | Not all chunks received. | * X-Request-Id - <br> |
164
+ | **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
165
+ | **403** | Insufficient scope (requires uploads:write). | * X-Request-Id - <br> |
166
+ | **404** | Upload session not found. | * X-Request-Id - <br> |
167
+ | **409** | Upload session is not in \&quot;uploading\&quot; state. | * X-Request-Id - <br> |
168
+ | **422** | Assembled file size mismatch or not a valid video file (source_invalid). | * X-Request-Id - <br> |
169
+ | **503** | Disk capacity exceeded; cannot assemble. | * 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
+ ## createUpload
175
+
176
+ > CreateUploadResponse createUpload(idempotencyKey, createUploadRequest)
177
+
178
+ Initialize a chunked upload session
179
+
180
+ Starts a resumable source upload and returns the chunk size, chunk count, session ID, and expiration timestamp.
181
+
182
+ ### Example
183
+
184
+ ```ts
185
+ import {
186
+ Configuration,
187
+ UploadsApi,
188
+ } from '@liqhtworks/sophon-sdk';
189
+ import type { CreateUploadOperationRequest } 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 UploadsApi(config);
200
+
201
+ const body = {
202
+ // 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.
203
+ idempotencyKey: idempotencyKey_example,
204
+ // CreateUploadRequest
205
+ createUploadRequest: ...,
206
+ } satisfies CreateUploadOperationRequest;
207
+
208
+ try {
209
+ const data = await api.createUpload(body);
210
+ console.log(data);
211
+ } catch (error) {
212
+ console.error(error);
213
+ }
214
+ }
215
+
216
+ // Run the test
217
+ example().catch(console.error);
218
+ ```
219
+
220
+ ### Parameters
221
+
222
+
223
+ | Name | Type | Description | Notes |
224
+ |------------- | ------------- | ------------- | -------------|
225
+ | **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`] |
226
+ | **createUploadRequest** | [CreateUploadRequest](CreateUploadRequest.md) | | |
227
+
228
+ ### Return type
229
+
230
+ [**CreateUploadResponse**](CreateUploadResponse.md)
231
+
232
+ ### Authorization
233
+
234
+ [sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
235
+
236
+ ### HTTP request headers
237
+
238
+ - **Content-Type**: `application/json`
239
+ - **Accept**: `application/json`
240
+
241
+
242
+ ### HTTP response details
243
+ | Status code | Description | Response headers |
244
+ |-------------|-------------|------------------|
245
+ | **201** | Upload session created. | * X-Request-Id - <br> |
246
+ | **400** | Validation error (empty file_name, zero file_size, exceeds max). | * X-Request-Id - <br> |
247
+ | **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
248
+ | **403** | Insufficient scope (requires uploads:create). | * X-Request-Id - <br> |
249
+ | **409** | Idempotency conflict. | * X-Request-Id - <br> |
250
+ | **429** | Rate limited or quota exceeded. | * X-Request-Id - <br> |
251
+ | **503** | Disk capacity exceeded; uploads paused. | * X-Request-Id - <br> |
252
+
253
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
254
+
255
+
256
+ ## getUpload
257
+
258
+ > UploadStatusResponse getUpload(id)
259
+
260
+ Get upload session status
261
+
262
+ Returns received chunks and, after assembly/probe, source dimensions and duration used by downstream budget and encoding decisions.
263
+
264
+ ### Example
265
+
266
+ ```ts
267
+ import {
268
+ Configuration,
269
+ UploadsApi,
270
+ } from '@liqhtworks/sophon-sdk';
271
+ import type { GetUploadRequest } from '@liqhtworks/sophon-sdk';
272
+
273
+ async function example() {
274
+ console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
275
+ const config = new Configuration({
276
+ // To configure API key authorization: sessionCookie
277
+ apiKey: "YOUR API KEY",
278
+ // Configure HTTP bearer authorization: bearerApiKey
279
+ accessToken: "YOUR BEARER TOKEN",
280
+ });
281
+ const api = new UploadsApi(config);
282
+
283
+ const body = {
284
+ // string
285
+ id: id_example,
286
+ } satisfies GetUploadRequest;
287
+
288
+ try {
289
+ const data = await api.getUpload(body);
290
+ console.log(data);
291
+ } catch (error) {
292
+ console.error(error);
293
+ }
294
+ }
295
+
296
+ // Run the test
297
+ example().catch(console.error);
298
+ ```
299
+
300
+ ### Parameters
301
+
302
+
303
+ | Name | Type | Description | Notes |
304
+ |------------- | ------------- | ------------- | -------------|
305
+ | **id** | `string` | | [Defaults to `undefined`] |
306
+
307
+ ### Return type
308
+
309
+ [**UploadStatusResponse**](UploadStatusResponse.md)
310
+
311
+ ### Authorization
312
+
313
+ [sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
314
+
315
+ ### HTTP request headers
316
+
317
+ - **Content-Type**: Not defined
318
+ - **Accept**: `application/json`
319
+
320
+
321
+ ### HTTP response details
322
+ | Status code | Description | Response headers |
323
+ |-------------|-------------|------------------|
324
+ | **200** | Upload session status. | * X-Request-Id - <br> |
325
+ | **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
326
+ | **403** | Insufficient scope (requires uploads:read). | * X-Request-Id - <br> |
327
+ | **404** | Upload session not found. | * X-Request-Id - <br> |
328
+
329
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
330
+
331
+
332
+ ## uploadPart
333
+
334
+ > UploadPartResponse uploadPart(id, partNumber, body)
335
+
336
+ Upload a single chunk
337
+
338
+ Streams the chunk body to disk. Part numbers are 0-indexed. Uploading the same part number again is idempotent (returns success without re-writing).
339
+
340
+ ### Example
341
+
342
+ ```ts
343
+ import {
344
+ Configuration,
345
+ UploadsApi,
346
+ } from '@liqhtworks/sophon-sdk';
347
+ import type { UploadPartRequest } from '@liqhtworks/sophon-sdk';
348
+
349
+ async function example() {
350
+ console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
351
+ const config = new Configuration({
352
+ // To configure API key authorization: sessionCookie
353
+ apiKey: "YOUR API KEY",
354
+ // Configure HTTP bearer authorization: bearerApiKey
355
+ accessToken: "YOUR BEARER TOKEN",
356
+ });
357
+ const api = new UploadsApi(config);
358
+
359
+ const body = {
360
+ // string
361
+ id: id_example,
362
+ // number
363
+ partNumber: 56,
364
+ // Blob
365
+ body: BINARY_DATA_HERE,
366
+ } satisfies UploadPartRequest;
367
+
368
+ try {
369
+ const data = await api.uploadPart(body);
370
+ console.log(data);
371
+ } catch (error) {
372
+ console.error(error);
373
+ }
374
+ }
375
+
376
+ // Run the test
377
+ example().catch(console.error);
378
+ ```
379
+
380
+ ### Parameters
381
+
382
+
383
+ | Name | Type | Description | Notes |
384
+ |------------- | ------------- | ------------- | -------------|
385
+ | **id** | `string` | | [Defaults to `undefined`] |
386
+ | **partNumber** | `number` | | [Defaults to `undefined`] |
387
+ | **body** | `Blob` | | |
388
+
389
+ ### Return type
390
+
391
+ [**UploadPartResponse**](UploadPartResponse.md)
392
+
393
+ ### Authorization
394
+
395
+ [sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
396
+
397
+ ### HTTP request headers
398
+
399
+ - **Content-Type**: `application/octet-stream`
400
+ - **Accept**: `application/json`
401
+
402
+
403
+ ### HTTP response details
404
+ | Status code | Description | Response headers |
405
+ |-------------|-------------|------------------|
406
+ | **200** | Chunk received. | * X-Request-Id - <br> |
407
+ | **400** | Part number out of range. | * X-Request-Id - <br> |
408
+ | **401** | Missing or invalid credentials. | * X-Request-Id - <br> |
409
+ | **403** | Insufficient scope (requires uploads:write). | * X-Request-Id - <br> |
410
+ | **404** | Upload session not found. | * X-Request-Id - <br> |
411
+ | **409** | Upload session is not in \&quot;uploading\&quot; state. | * X-Request-Id - <br> |
412
+ | **503** | Disk capacity exceeded. | * X-Request-Id - <br> |
413
+
414
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
415
+
@@ -0,0 +1,45 @@
1
+
2
+ # WebhookDeliveryPayload
3
+
4
+ Payload delivered to registered webhook endpoints on terminal job events. Signed with HMAC-SHA256 over `\"{timestamp}.{raw_body}\"` using the per-webhook secret. Consumers must verify the signature before processing.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `event_id` | string
11
+ `type` | string
12
+ `timestamp` | Date
13
+ `job_id` | string
14
+ `status` | string
15
+ `metadata` | { [key: string]: any; }
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { WebhookDeliveryPayload } from '@liqhtworks/sophon-sdk'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "event_id": evt_01JQabc123,
25
+ "type": null,
26
+ "timestamp": null,
27
+ "job_id": job_01JQ8C4K4W6YQ7M4M0A5K9T6RF,
28
+ "status": null,
29
+ "metadata": null,
30
+ } satisfies WebhookDeliveryPayload
31
+
32
+ console.log(example)
33
+
34
+ // Convert the instance to a JSON string
35
+ const exampleJSON: string = JSON.stringify(example)
36
+ console.log(exampleJSON)
37
+
38
+ // Parse the JSON string back to an object
39
+ const exampleParsed = JSON.parse(exampleJSON) as WebhookDeliveryPayload
40
+ console.log(exampleParsed)
41
+ ```
42
+
43
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
44
+
45
+
@@ -0,0 +1,91 @@
1
+ # WebhookEventsApi
2
+
3
+ All URIs are relative to *https://api.liqhtworks.xyz*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**receiveJobTerminalWebhook**](WebhookEventsApi.md#receivejobterminalwebhook) | **POST** /jobTerminalEvent | Receive a terminal job webhook |
8
+
9
+
10
+
11
+ ## receiveJobTerminalWebhook
12
+
13
+ > receiveJobTerminalWebhook(xTurboSignature256, xTurboEventId, xTurboTimestamp, webhookDeliveryPayload)
14
+
15
+ Receive a terminal job webhook
16
+
17
+ Outbound webhook delivery sent to registered webhook endpoints when a job reaches &#x60;completed&#x60;, &#x60;failed&#x60;, or &#x60;canceled&#x60;. Consumers should verify &#x60;X-Turbo-Signature-256&#x60; before processing.
18
+
19
+ ### Example
20
+
21
+ ```ts
22
+ import {
23
+ Configuration,
24
+ WebhookEventsApi,
25
+ } from '@liqhtworks/sophon-sdk';
26
+ import type { ReceiveJobTerminalWebhookRequest } from '@liqhtworks/sophon-sdk';
27
+
28
+ async function example() {
29
+ console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
30
+ const config = new Configuration({
31
+ // To configure API key authorization: sessionCookie
32
+ apiKey: "YOUR API KEY",
33
+ // Configure HTTP bearer authorization: bearerApiKey
34
+ accessToken: "YOUR BEARER TOKEN",
35
+ });
36
+ const api = new WebhookEventsApi(config);
37
+
38
+ const body = {
39
+ // string | `sha256={hex}` — HMAC-SHA256 of `\"{X-Turbo-Timestamp}.{raw_body}\"` using the webhook\'s secret key.
40
+ xTurboSignature256: sha256=abc123def456...,
41
+ // string | Unique event ID for consumer deduplication.
42
+ xTurboEventId: evt_01JQabc123,
43
+ // Date | Timestamp used in signature computation. Check for replay.
44
+ xTurboTimestamp: 2013-10-20T19:20:30+01:00,
45
+ // WebhookDeliveryPayload
46
+ webhookDeliveryPayload: ...,
47
+ } satisfies ReceiveJobTerminalWebhookRequest;
48
+
49
+ try {
50
+ const data = await api.receiveJobTerminalWebhook(body);
51
+ console.log(data);
52
+ } catch (error) {
53
+ console.error(error);
54
+ }
55
+ }
56
+
57
+ // Run the test
58
+ example().catch(console.error);
59
+ ```
60
+
61
+ ### Parameters
62
+
63
+
64
+ | Name | Type | Description | Notes |
65
+ |------------- | ------------- | ------------- | -------------|
66
+ | **xTurboSignature256** | `string` | &#x60;sha256&#x3D;{hex}&#x60; — HMAC-SHA256 of &#x60;\&quot;{X-Turbo-Timestamp}.{raw_body}\&quot;&#x60; using the webhook\&#39;s secret key. | [Defaults to `undefined`] |
67
+ | **xTurboEventId** | `string` | Unique event ID for consumer deduplication. | [Defaults to `undefined`] |
68
+ | **xTurboTimestamp** | `Date` | Timestamp used in signature computation. Check for replay. | [Defaults to `undefined`] |
69
+ | **webhookDeliveryPayload** | [WebhookDeliveryPayload](WebhookDeliveryPayload.md) | | |
70
+
71
+ ### Return type
72
+
73
+ `void` (Empty response body)
74
+
75
+ ### Authorization
76
+
77
+ [sessionCookie](../README.md#sessionCookie), [bearerApiKey](../README.md#bearerApiKey)
78
+
79
+ ### HTTP request headers
80
+
81
+ - **Content-Type**: `application/json`
82
+ - **Accept**: Not defined
83
+
84
+
85
+ ### HTTP response details
86
+ | Status code | Description | Response headers |
87
+ |-------------|-------------|------------------|
88
+ | **200** | Webhook accepted by the consumer. | - |
89
+
90
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
91
+