@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,56 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
# Fires when the sophon-api "Publish SDKs" workflow pushes a v<version> tag
|
|
4
|
+
# into this repo. The tag commit already contains the fully-generated SDK;
|
|
5
|
+
# this workflow installs, builds, and publishes to npm.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags:
|
|
10
|
+
- "v*"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
tag:
|
|
14
|
+
description: Tag to publish (e.g. v0.1.0). Defaults to the current ref.
|
|
15
|
+
required: false
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
id-token: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
publish:
|
|
23
|
+
name: npm publish
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout tag
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
30
|
+
fetch-depth: 1
|
|
31
|
+
|
|
32
|
+
- name: Set up Node
|
|
33
|
+
uses: actions/setup-node@v4
|
|
34
|
+
with:
|
|
35
|
+
node-version: "20"
|
|
36
|
+
registry-url: "https://registry.npmjs.org"
|
|
37
|
+
|
|
38
|
+
- name: Verify tag matches package.json
|
|
39
|
+
shell: bash
|
|
40
|
+
run: |
|
|
41
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
42
|
+
pkg="$(node -p "require('./package.json').version")"
|
|
43
|
+
if [ "${tag}" != "${pkg}" ]; then
|
|
44
|
+
echo "::error::tag v${tag} does not match package.json version ${pkg}" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
- name: Install + build
|
|
49
|
+
run: |
|
|
50
|
+
npm ci || npm install
|
|
51
|
+
npm run build
|
|
52
|
+
|
|
53
|
+
- name: Publish
|
|
54
|
+
env:
|
|
55
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
56
|
+
run: npm publish --access public --provenance
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
.openapi-generator-ignore
|
|
4
|
+
README.md
|
|
5
|
+
docs/CompleteUploadResponse.md
|
|
6
|
+
docs/CreateJobOutputOptions.md
|
|
7
|
+
docs/CreateJobRequest.md
|
|
8
|
+
docs/CreateUploadRequest.md
|
|
9
|
+
docs/CreateUploadResponse.md
|
|
10
|
+
docs/CreateWebhookRequest.md
|
|
11
|
+
docs/DownloadsApi.md
|
|
12
|
+
docs/ErrorBody.md
|
|
13
|
+
docs/ErrorEnvelope.md
|
|
14
|
+
docs/HealthApi.md
|
|
15
|
+
docs/JobOutputInfo.md
|
|
16
|
+
docs/JobProfile.md
|
|
17
|
+
docs/JobProgress.md
|
|
18
|
+
docs/JobResponse.md
|
|
19
|
+
docs/JobSourceInfo.md
|
|
20
|
+
docs/JobSourceType.md
|
|
21
|
+
docs/JobStatus.md
|
|
22
|
+
docs/JobsApi.md
|
|
23
|
+
docs/ListJobsResponse.md
|
|
24
|
+
docs/OutputContainer.md
|
|
25
|
+
docs/ReadyResponse.md
|
|
26
|
+
docs/UploadJobSource.md
|
|
27
|
+
docs/UploadPartResponse.md
|
|
28
|
+
docs/UploadStatusResponse.md
|
|
29
|
+
docs/UploadsApi.md
|
|
30
|
+
docs/WebhookDeliveryPayload.md
|
|
31
|
+
docs/WebhookEventsApi.md
|
|
32
|
+
docs/WebhookListItem.md
|
|
33
|
+
docs/WebhookListResponse.md
|
|
34
|
+
docs/WebhookResponse.md
|
|
35
|
+
docs/WebhooksApi.md
|
|
36
|
+
package.json
|
|
37
|
+
src/apis/DownloadsApi.ts
|
|
38
|
+
src/apis/HealthApi.ts
|
|
39
|
+
src/apis/JobsApi.ts
|
|
40
|
+
src/apis/UploadsApi.ts
|
|
41
|
+
src/apis/WebhookEventsApi.ts
|
|
42
|
+
src/apis/WebhooksApi.ts
|
|
43
|
+
src/apis/index.ts
|
|
44
|
+
src/index.ts
|
|
45
|
+
src/models/CompleteUploadResponse.ts
|
|
46
|
+
src/models/CreateJobOutputOptions.ts
|
|
47
|
+
src/models/CreateJobRequest.ts
|
|
48
|
+
src/models/CreateUploadRequest.ts
|
|
49
|
+
src/models/CreateUploadResponse.ts
|
|
50
|
+
src/models/CreateWebhookRequest.ts
|
|
51
|
+
src/models/ErrorBody.ts
|
|
52
|
+
src/models/ErrorEnvelope.ts
|
|
53
|
+
src/models/JobOutputInfo.ts
|
|
54
|
+
src/models/JobProfile.ts
|
|
55
|
+
src/models/JobProgress.ts
|
|
56
|
+
src/models/JobResponse.ts
|
|
57
|
+
src/models/JobSourceInfo.ts
|
|
58
|
+
src/models/JobSourceType.ts
|
|
59
|
+
src/models/JobStatus.ts
|
|
60
|
+
src/models/ListJobsResponse.ts
|
|
61
|
+
src/models/OutputContainer.ts
|
|
62
|
+
src/models/ReadyResponse.ts
|
|
63
|
+
src/models/UploadJobSource.ts
|
|
64
|
+
src/models/UploadPartResponse.ts
|
|
65
|
+
src/models/UploadStatusResponse.ts
|
|
66
|
+
src/models/WebhookDeliveryPayload.ts
|
|
67
|
+
src/models/WebhookListItem.ts
|
|
68
|
+
src/models/WebhookListResponse.ts
|
|
69
|
+
src/models/WebhookResponse.ts
|
|
70
|
+
src/models/index.ts
|
|
71
|
+
src/runtime.ts
|
|
72
|
+
tsconfig.esm.json
|
|
73
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.21.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2026 Liqhtworks
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Use of this software is governed by a proprietary license. Redistribution
|
|
6
|
+
of this package outside of its intended use (consuming the SOPHON Encoding
|
|
7
|
+
API via a valid API key) is prohibited without prior written consent from
|
|
8
|
+
Liqhtworks.
|
|
9
|
+
|
|
10
|
+
This package is generated from the SOPHON OpenAPI specification at
|
|
11
|
+
https://github.com/Liqhtworks/sophon-api. Do not edit it by hand — changes
|
|
12
|
+
are overwritten on every release.
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# @liqhtworks/sophon-sdk@0.1.0
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK client for the api.liqhtworks.xyz API.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
First, install the SDK from npm.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @liqhtworks/sophon-sdk --save
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Next, try it out.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import {
|
|
18
|
+
Configuration,
|
|
19
|
+
DownloadsApi,
|
|
20
|
+
} from '@liqhtworks/sophon-sdk';
|
|
21
|
+
import type { DownloadRequest } from '@liqhtworks/sophon-sdk';
|
|
22
|
+
|
|
23
|
+
async function example() {
|
|
24
|
+
console.log("🚀 Testing @liqhtworks/sophon-sdk SDK...");
|
|
25
|
+
const api = new DownloadsApi();
|
|
26
|
+
|
|
27
|
+
const body = {
|
|
28
|
+
// string | HMAC-signed download token encoding the object key and expiry.
|
|
29
|
+
token: token_example,
|
|
30
|
+
} satisfies DownloadRequest;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const data = await api.download(body);
|
|
34
|
+
console.log(data);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Run the test
|
|
41
|
+
example().catch(console.error);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
### API Endpoints
|
|
48
|
+
|
|
49
|
+
All URIs are relative to *https://api.liqhtworks.xyz*
|
|
50
|
+
|
|
51
|
+
| Class | Method | HTTP request | Description
|
|
52
|
+
| ----- | ------ | ------------ | -------------
|
|
53
|
+
*DownloadsApi* | [**download**](docs/DownloadsApi.md#download) | **GET** /v1/downloads/{token} | Download an output file via signed token
|
|
54
|
+
*HealthApi* | [**healthz**](docs/HealthApi.md#healthz) | **GET** /healthz | Liveness probe
|
|
55
|
+
*HealthApi* | [**readyz**](docs/HealthApi.md#readyz) | **GET** /readyz | Readiness probe
|
|
56
|
+
*JobsApi* | [**cancelJob**](docs/JobsApi.md#canceljob) | **DELETE** /v1/jobs/{id} | Cancel a job
|
|
57
|
+
*JobsApi* | [**createJob**](docs/JobsApi.md#createjoboperation) | **POST** /v1/jobs | Submit an encoding job
|
|
58
|
+
*JobsApi* | [**getJob**](docs/JobsApi.md#getjob) | **GET** /v1/jobs/{id} | Get a single job by ID
|
|
59
|
+
*JobsApi* | [**getJobOutput**](docs/JobsApi.md#getjoboutput) | **GET** /v1/jobs/{id}/output | Get the encoded output file
|
|
60
|
+
*JobsApi* | [**listJobs**](docs/JobsApi.md#listjobs) | **GET** /v1/jobs | List jobs with cursor pagination
|
|
61
|
+
*UploadsApi* | [**cancelUpload**](docs/UploadsApi.md#cancelupload) | **DELETE** /v1/uploads/{id} | Cancel an upload session
|
|
62
|
+
*UploadsApi* | [**completeUpload**](docs/UploadsApi.md#completeupload) | **POST** /v1/uploads/{id}/complete | Finalize a chunked upload
|
|
63
|
+
*UploadsApi* | [**createUpload**](docs/UploadsApi.md#createuploadoperation) | **POST** /v1/uploads | Initialize a chunked upload session
|
|
64
|
+
*UploadsApi* | [**getUpload**](docs/UploadsApi.md#getupload) | **GET** /v1/uploads/{id} | Get upload session status
|
|
65
|
+
*UploadsApi* | [**uploadPart**](docs/UploadsApi.md#uploadpart) | **PUT** /v1/uploads/{id}/parts/{part_number} | Upload a single chunk
|
|
66
|
+
*WebhooksApi* | [**createWebhook**](docs/WebhooksApi.md#createwebhookoperation) | **POST** /v1/webhooks | Register a webhook endpoint
|
|
67
|
+
*WebhooksApi* | [**deleteWebhook**](docs/WebhooksApi.md#deletewebhook) | **DELETE** /v1/webhooks/{id} | Soft-delete a webhook endpoint
|
|
68
|
+
*WebhooksApi* | [**listWebhooks**](docs/WebhooksApi.md#listwebhooks) | **GET** /v1/webhooks | List active webhook endpoints
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Models
|
|
72
|
+
|
|
73
|
+
- [CompleteUploadResponse](docs/CompleteUploadResponse.md)
|
|
74
|
+
- [CreateJobOutputOptions](docs/CreateJobOutputOptions.md)
|
|
75
|
+
- [CreateJobRequest](docs/CreateJobRequest.md)
|
|
76
|
+
- [CreateUploadRequest](docs/CreateUploadRequest.md)
|
|
77
|
+
- [CreateUploadResponse](docs/CreateUploadResponse.md)
|
|
78
|
+
- [CreateWebhookRequest](docs/CreateWebhookRequest.md)
|
|
79
|
+
- [ErrorBody](docs/ErrorBody.md)
|
|
80
|
+
- [ErrorEnvelope](docs/ErrorEnvelope.md)
|
|
81
|
+
- [JobOutputInfo](docs/JobOutputInfo.md)
|
|
82
|
+
- [JobProfile](docs/JobProfile.md)
|
|
83
|
+
- [JobProgress](docs/JobProgress.md)
|
|
84
|
+
- [JobResponse](docs/JobResponse.md)
|
|
85
|
+
- [JobSourceInfo](docs/JobSourceInfo.md)
|
|
86
|
+
- [JobSourceType](docs/JobSourceType.md)
|
|
87
|
+
- [JobStatus](docs/JobStatus.md)
|
|
88
|
+
- [ListJobsResponse](docs/ListJobsResponse.md)
|
|
89
|
+
- [OutputContainer](docs/OutputContainer.md)
|
|
90
|
+
- [ReadyResponse](docs/ReadyResponse.md)
|
|
91
|
+
- [UploadJobSource](docs/UploadJobSource.md)
|
|
92
|
+
- [UploadPartResponse](docs/UploadPartResponse.md)
|
|
93
|
+
- [UploadStatusResponse](docs/UploadStatusResponse.md)
|
|
94
|
+
- [WebhookDeliveryPayload](docs/WebhookDeliveryPayload.md)
|
|
95
|
+
- [WebhookListItem](docs/WebhookListItem.md)
|
|
96
|
+
- [WebhookListResponse](docs/WebhookListResponse.md)
|
|
97
|
+
- [WebhookResponse](docs/WebhookResponse.md)
|
|
98
|
+
|
|
99
|
+
### Authorization
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
Authentication schemes defined for the API:
|
|
103
|
+
<a id="bearerApiKey"></a>
|
|
104
|
+
#### bearerApiKey
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
- **Type**: HTTP Bearer Token authentication
|
|
108
|
+
<a id="sessionCookie"></a>
|
|
109
|
+
#### sessionCookie
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
- **Type**: API key
|
|
113
|
+
- **API key parameter name**: `sophon_api_session`
|
|
114
|
+
- **Location**:
|
|
115
|
+
|
|
116
|
+
## About
|
|
117
|
+
|
|
118
|
+
This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
|
|
119
|
+
and is automatically generated by the
|
|
120
|
+
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
121
|
+
|
|
122
|
+
- API version: `1.0.0`
|
|
123
|
+
- Package version: `0.1.0`
|
|
124
|
+
- Generator version: `7.21.0`
|
|
125
|
+
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
126
|
+
|
|
127
|
+
The generated npm module supports the following:
|
|
128
|
+
|
|
129
|
+
- Environments
|
|
130
|
+
* Node.js
|
|
131
|
+
* Webpack
|
|
132
|
+
* Browserify
|
|
133
|
+
- Language levels
|
|
134
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
135
|
+
* ES6
|
|
136
|
+
- Module systems
|
|
137
|
+
* CommonJS
|
|
138
|
+
* ES6 module system
|
|
139
|
+
|
|
140
|
+
For more information, please visit [https://liqhtworks.xyz](https://liqhtworks.xyz)
|
|
141
|
+
|
|
142
|
+
## Development
|
|
143
|
+
|
|
144
|
+
### Building
|
|
145
|
+
|
|
146
|
+
To build the TypeScript source code, you need to have Node.js and npm installed.
|
|
147
|
+
After cloning the repository, navigate to the project directory and run:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm install
|
|
151
|
+
npm run build
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Publishing
|
|
155
|
+
|
|
156
|
+
Once you've built the package, you can publish it to npm:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm publish
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
[Proprietary]()
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
export interface DownloadRequest {
|
|
14
|
+
token: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DownloadsApi - interface
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface DownloadsApiInterface
|
|
21
|
+
*/
|
|
22
|
+
export interface DownloadsApiInterface {
|
|
23
|
+
/**
|
|
24
|
+
* Creates request options for download without sending the request
|
|
25
|
+
* @param {string} token HMAC-signed download token encoding the object key and expiry.
|
|
26
|
+
* @throws {RequiredError}
|
|
27
|
+
* @memberof DownloadsApiInterface
|
|
28
|
+
*/
|
|
29
|
+
downloadRequestOpts(requestParameters: DownloadRequest): Promise<runtime.RequestOpts>;
|
|
30
|
+
/**
|
|
31
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
32
|
+
* @summary Download an output file via signed token
|
|
33
|
+
* @param {string} token HMAC-signed download token encoding the object key and expiry.
|
|
34
|
+
* @param {*} [options] Override http request option.
|
|
35
|
+
* @throws {RequiredError}
|
|
36
|
+
* @memberof DownloadsApiInterface
|
|
37
|
+
*/
|
|
38
|
+
downloadRaw(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
39
|
+
/**
|
|
40
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
41
|
+
* Download an output file via signed token
|
|
42
|
+
*/
|
|
43
|
+
download(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export declare class DownloadsApi extends runtime.BaseAPI implements DownloadsApiInterface {
|
|
49
|
+
/**
|
|
50
|
+
* Creates request options for download without sending the request
|
|
51
|
+
*/
|
|
52
|
+
downloadRequestOpts(requestParameters: DownloadRequest): Promise<runtime.RequestOpts>;
|
|
53
|
+
/**
|
|
54
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
55
|
+
* Download an output file via signed token
|
|
56
|
+
*/
|
|
57
|
+
downloadRaw(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
58
|
+
/**
|
|
59
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
60
|
+
* Download an output file via signed token
|
|
61
|
+
*/
|
|
62
|
+
download(requestParameters: DownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.DownloadsApi = void 0;
|
|
17
|
+
const runtime = require("../runtime");
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
class DownloadsApi extends runtime.BaseAPI {
|
|
22
|
+
/**
|
|
23
|
+
* Creates request options for download without sending the request
|
|
24
|
+
*/
|
|
25
|
+
async downloadRequestOpts(requestParameters) {
|
|
26
|
+
if (requestParameters['token'] == null) {
|
|
27
|
+
throw new runtime.RequiredError('token', 'Required parameter "token" was null or undefined when calling download().');
|
|
28
|
+
}
|
|
29
|
+
const queryParameters = {};
|
|
30
|
+
const headerParameters = {};
|
|
31
|
+
let urlPath = `/v1/downloads/{token}`;
|
|
32
|
+
urlPath = urlPath.replace(`{${"token"}}`, encodeURIComponent(String(requestParameters['token'])));
|
|
33
|
+
return {
|
|
34
|
+
path: urlPath,
|
|
35
|
+
method: 'GET',
|
|
36
|
+
headers: headerParameters,
|
|
37
|
+
query: queryParameters,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
42
|
+
* Download an output file via signed token
|
|
43
|
+
*/
|
|
44
|
+
async downloadRaw(requestParameters, initOverrides) {
|
|
45
|
+
const requestOptions = await this.downloadRequestOpts(requestParameters);
|
|
46
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
47
|
+
return new runtime.BlobApiResponse(response);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Serves the encoded output file. No Authorization header required -- the HMAC-signed token (generated by GET /v1/jobs/{id}/output) IS the credential. Tokens expire after 24 hours.
|
|
51
|
+
* Download an output file via signed token
|
|
52
|
+
*/
|
|
53
|
+
async download(requestParameters, initOverrides) {
|
|
54
|
+
const response = await this.downloadRaw(requestParameters, initOverrides);
|
|
55
|
+
return await response.value();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.DownloadsApi = DownloadsApi;
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { ReadyResponse } from '../models/index';
|
|
14
|
+
/**
|
|
15
|
+
* HealthApi - interface
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @interface HealthApiInterface
|
|
19
|
+
*/
|
|
20
|
+
export interface HealthApiInterface {
|
|
21
|
+
/**
|
|
22
|
+
* Creates request options for healthz without sending the request
|
|
23
|
+
* @throws {RequiredError}
|
|
24
|
+
* @memberof HealthApiInterface
|
|
25
|
+
*/
|
|
26
|
+
healthzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
27
|
+
/**
|
|
28
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
29
|
+
* @summary Liveness probe
|
|
30
|
+
* @param {*} [options] Override http request option.
|
|
31
|
+
* @throws {RequiredError}
|
|
32
|
+
* @memberof HealthApiInterface
|
|
33
|
+
*/
|
|
34
|
+
healthzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
35
|
+
/**
|
|
36
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
37
|
+
* Liveness probe
|
|
38
|
+
*/
|
|
39
|
+
healthz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Creates request options for readyz without sending the request
|
|
42
|
+
* @throws {RequiredError}
|
|
43
|
+
* @memberof HealthApiInterface
|
|
44
|
+
*/
|
|
45
|
+
readyzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
48
|
+
* @summary Readiness probe
|
|
49
|
+
* @param {*} [options] Override http request option.
|
|
50
|
+
* @throws {RequiredError}
|
|
51
|
+
* @memberof HealthApiInterface
|
|
52
|
+
*/
|
|
53
|
+
readyzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReadyResponse>>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
56
|
+
* Readiness probe
|
|
57
|
+
*/
|
|
58
|
+
readyz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReadyResponse>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export declare class HealthApi extends runtime.BaseAPI implements HealthApiInterface {
|
|
64
|
+
/**
|
|
65
|
+
* Creates request options for healthz without sending the request
|
|
66
|
+
*/
|
|
67
|
+
healthzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
68
|
+
/**
|
|
69
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
70
|
+
* Liveness probe
|
|
71
|
+
*/
|
|
72
|
+
healthzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
73
|
+
/**
|
|
74
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
75
|
+
* Liveness probe
|
|
76
|
+
*/
|
|
77
|
+
healthz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates request options for readyz without sending the request
|
|
80
|
+
*/
|
|
81
|
+
readyzRequestOpts(): Promise<runtime.RequestOpts>;
|
|
82
|
+
/**
|
|
83
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
84
|
+
* Readiness probe
|
|
85
|
+
*/
|
|
86
|
+
readyzRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReadyResponse>>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
89
|
+
* Readiness probe
|
|
90
|
+
*/
|
|
91
|
+
readyz(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReadyResponse>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.HealthApi = void 0;
|
|
17
|
+
const runtime = require("../runtime");
|
|
18
|
+
const index_1 = require("../models/index");
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
class HealthApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Creates request options for healthz without sending the request
|
|
25
|
+
*/
|
|
26
|
+
async healthzRequestOpts() {
|
|
27
|
+
const queryParameters = {};
|
|
28
|
+
const headerParameters = {};
|
|
29
|
+
let urlPath = `/healthz`;
|
|
30
|
+
return {
|
|
31
|
+
path: urlPath,
|
|
32
|
+
method: 'GET',
|
|
33
|
+
headers: headerParameters,
|
|
34
|
+
query: queryParameters,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
39
|
+
* Liveness probe
|
|
40
|
+
*/
|
|
41
|
+
async healthzRaw(initOverrides) {
|
|
42
|
+
const requestOptions = await this.healthzRequestOpts();
|
|
43
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
44
|
+
return new runtime.VoidApiResponse(response);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Always returns 200. Used by load balancers and orchestrators.
|
|
48
|
+
* Liveness probe
|
|
49
|
+
*/
|
|
50
|
+
async healthz(initOverrides) {
|
|
51
|
+
await this.healthzRaw(initOverrides);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates request options for readyz without sending the request
|
|
55
|
+
*/
|
|
56
|
+
async readyzRequestOpts() {
|
|
57
|
+
const queryParameters = {};
|
|
58
|
+
const headerParameters = {};
|
|
59
|
+
let urlPath = `/readyz`;
|
|
60
|
+
return {
|
|
61
|
+
path: urlPath,
|
|
62
|
+
method: 'GET',
|
|
63
|
+
headers: headerParameters,
|
|
64
|
+
query: queryParameters,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
69
|
+
* Readiness probe
|
|
70
|
+
*/
|
|
71
|
+
async readyzRaw(initOverrides) {
|
|
72
|
+
const requestOptions = await this.readyzRequestOpts();
|
|
73
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
74
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ReadyResponseFromJSON)(jsonValue));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns 200 when the service is ready to accept traffic. Checks database connectivity, disk headroom (warning and critical thresholds), worker liveness, and drain state.
|
|
78
|
+
* Readiness probe
|
|
79
|
+
*/
|
|
80
|
+
async readyz(initOverrides) {
|
|
81
|
+
const response = await this.readyzRaw(initOverrides);
|
|
82
|
+
return await response.value();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.HealthApi = HealthApi;
|