@hautechai/sdk 2.5.0 → 2.6.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/dist/index.mjs CHANGED
@@ -10505,11 +10505,11 @@ var useVideosApi = () => {
10505
10505
  const sdk = this;
10506
10506
  const isBrowser = typeof window !== "undefined" && typeof Blob !== "undefined";
10507
10507
  if (isBrowser) {
10508
- const response = await axios2.get(fileUrl, { responseType: "blob", timeout: 3e4 });
10508
+ const response = await axios2.get(fileUrl, { responseType: "blob", timeout: 6e4 });
10509
10509
  const blob = new Blob([response.data], { type: response.headers["content-type"] });
10510
10510
  return sdk.videos.createFromFile(blob);
10511
10511
  } else {
10512
- const response = await axios2.get(fileUrl, { responseType: "stream", timeout: 3e4 });
10512
+ const response = await axios2.get(fileUrl, { responseType: "stream", timeout: 6e4 });
10513
10513
  return sdk.videos.createFromFile({
10514
10514
  stream: response.data,
10515
10515
  filename: fileUrl.split("/").pop(),
@@ -11396,7 +11396,7 @@ var getOperations = () => {
11396
11396
  // src/sdk/api-definitions/operations.ts
11397
11397
  var waitOperation = wrapCustomMethod(async function(operation, timeoutMs = 6e4) {
11398
11398
  const deadline = Date.now() + timeoutMs;
11399
- const delay = 1e3;
11399
+ const delay = 3e3;
11400
11400
  const sdk = this;
11401
11401
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
11402
11402
  const poll = async (id) => {
@@ -13161,6 +13161,39 @@ var ListStacksParamsDtoOrderBy = {
13161
13161
  updatedAt_DESC: "updatedAt_DESC"
13162
13162
  };
13163
13163
 
13164
+ // src/autogenerated/schemas/loraControllerListV1OrderBy.ts
13165
+ var LoraControllerListV1OrderBy = {
13166
+ createdAt_ASC: "createdAt_ASC",
13167
+ createdAt_DESC: "createdAt_DESC"
13168
+ };
13169
+
13170
+ // src/autogenerated/schemas/loraControllerListV1Status.ts
13171
+ var LoraControllerListV1Status = {
13172
+ starting: "starting",
13173
+ processing: "processing",
13174
+ succeeded: "succeeded",
13175
+ failed: "failed",
13176
+ canceled: "canceled"
13177
+ };
13178
+
13179
+ // src/autogenerated/schemas/loraDtoStatus.ts
13180
+ var LoraDtoStatus = {
13181
+ starting: "starting",
13182
+ processing: "processing",
13183
+ succeeded: "succeeded",
13184
+ failed: "failed",
13185
+ canceled: "canceled"
13186
+ };
13187
+
13188
+ // src/autogenerated/schemas/loraWebhookDtoStatus.ts
13189
+ var LoraWebhookDtoStatus = {
13190
+ starting: "starting",
13191
+ processing: "processing",
13192
+ succeeded: "succeeded",
13193
+ failed: "failed",
13194
+ canceled: "canceled"
13195
+ };
13196
+
13164
13197
  // src/autogenerated/schemas/lumaPhotonV1InputAspectRatio.ts
13165
13198
  var LumaPhotonV1InputAspectRatio = {
13166
13199
  "1:1": "1:1",
@@ -14903,7 +14936,7 @@ var usePipelinesApi = () => {
14903
14936
  wait: wrapCustomMethod(async function(pipeline, timeoutMs = 6e4) {
14904
14937
  const sdk = this;
14905
14938
  const deadline = Date.now() + timeoutMs;
14906
- const delay = 1e3;
14939
+ const delay = 3e3;
14907
14940
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
14908
14941
  const poll = async (id) => {
14909
14942
  const pipeline2 = await sdk.pipelines.get(id);
@@ -14924,6 +14957,114 @@ var usePipelinesApi = () => {
14924
14957
  return useApi(api);
14925
14958
  };
14926
14959
 
14960
+ // src/autogenerated/lora/lora.ts
14961
+ var getLora = () => {
14962
+ const loraControllerStartV1 = (startLoraTrainingParamsDto, options) => {
14963
+ return axiosMutator(
14964
+ {
14965
+ url: `/v1/lora/train`,
14966
+ method: "POST",
14967
+ headers: { "Content-Type": "application/json" },
14968
+ data: startLoraTrainingParamsDto
14969
+ },
14970
+ options
14971
+ );
14972
+ };
14973
+ const loraControllerListV1 = (params, options) => {
14974
+ return axiosMutator(
14975
+ {
14976
+ url: `/v1/lora`,
14977
+ method: "GET",
14978
+ params
14979
+ },
14980
+ options
14981
+ );
14982
+ };
14983
+ const loraControllerGetV1 = (id, options) => {
14984
+ return axiosMutator(
14985
+ {
14986
+ url: `/v1/lora/${id}`,
14987
+ method: "GET"
14988
+ },
14989
+ options
14990
+ );
14991
+ };
14992
+ const loraControllerTrainingsWebhookV1 = (loraWebhookDto, options) => {
14993
+ return axiosMutator(
14994
+ {
14995
+ url: `/v1/lora/trainings/webhook`,
14996
+ method: "POST",
14997
+ headers: { "Content-Type": "application/json" },
14998
+ data: loraWebhookDto
14999
+ },
15000
+ options
15001
+ );
15002
+ };
15003
+ return { loraControllerStartV1, loraControllerListV1, loraControllerGetV1, loraControllerTrainingsWebhookV1 };
15004
+ };
15005
+
15006
+ // src/sdk/api-definitions/lora.ts
15007
+ var waitLoraStatusChange = wrapCustomMethod(async function(lora, timeoutMs = 12e4) {
15008
+ const sdk = this;
15009
+ const initialStatus = lora.status;
15010
+ const deadline = Date.now() + timeoutMs;
15011
+ const delay = 3e3;
15012
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15013
+ while (Date.now() < deadline) {
15014
+ const current = await sdk.lora.get(lora.id);
15015
+ if (!current) throw new Error("LoRA not found");
15016
+ if (current.status !== initialStatus || ["succeeded", "failed", "canceled"].includes(current.status)) {
15017
+ return current;
15018
+ }
15019
+ await sleep(delay);
15020
+ }
15021
+ throw new Error("LoRA wait timed out");
15022
+ });
15023
+ var useLoraApi = () => {
15024
+ const hautechApi = getLora();
15025
+ return useApi({
15026
+ start: hautechApi.loraControllerStartV1,
15027
+ list: hautechApi.loraControllerListV1,
15028
+ get: hautechApi.loraControllerGetV1,
15029
+ wait: waitLoraStatusChange
15030
+ });
15031
+ };
15032
+
15033
+ // src/autogenerated/upload/upload.ts
15034
+ var getUpload = () => {
15035
+ const uploadControllerInitUploadV1 = (initializeGenericUploadParamsDto, options) => {
15036
+ return axiosMutator(
15037
+ {
15038
+ url: `/v1/upload/init`,
15039
+ method: "POST",
15040
+ headers: { "Content-Type": "application/json" },
15041
+ data: initializeGenericUploadParamsDto
15042
+ },
15043
+ options
15044
+ );
15045
+ };
15046
+ const uploadControllerGetUploadedFileUrlV1 = (params, options) => {
15047
+ return axiosMutator(
15048
+ {
15049
+ url: `/v1/upload/url`,
15050
+ method: "GET",
15051
+ params
15052
+ },
15053
+ options
15054
+ );
15055
+ };
15056
+ return { uploadControllerInitUploadV1, uploadControllerGetUploadedFileUrlV1 };
15057
+ };
15058
+
15059
+ // src/sdk/api-definitions/upload.ts
15060
+ var useUploadApi = () => {
15061
+ const hautechApi = getUpload();
15062
+ return useApi({
15063
+ initUpload: hautechApi.uploadControllerInitUploadV1,
15064
+ getUploadedFileUrl: hautechApi.uploadControllerGetUploadedFileUrlV1
15065
+ });
15066
+ };
15067
+
14927
15068
  // src/sdk/ws-client.ts
14928
15069
  import { io } from "socket.io-client";
14929
15070
  var useWsClient = (config) => new WsClient(config);
@@ -15014,7 +15155,9 @@ var apiDefinitions = {
15014
15155
  collections: useCollectionsApi(),
15015
15156
  balances: useBalancesApi(),
15016
15157
  access: useAccessApi(),
15017
- pipelines: usePipelinesApi()
15158
+ pipelines: usePipelinesApi(),
15159
+ lora: useLoraApi(),
15160
+ upload: useUploadApi()
15018
15161
  };
15019
15162
  var pipelineDefinitions = usePipelineDefinitions();
15020
15163
  var getWsClientDefinitions = (config) => ({
@@ -15294,6 +15437,10 @@ export {
15294
15437
  ListOperationsParamsDtoOrderBy,
15295
15438
  ListPosesParamsDtoOrderBy,
15296
15439
  ListStacksParamsDtoOrderBy,
15440
+ LoraControllerListV1OrderBy,
15441
+ LoraControllerListV1Status,
15442
+ LoraDtoStatus,
15443
+ LoraWebhookDtoStatus,
15297
15444
  LumaPhotonV1InputAspectRatio,
15298
15445
  LumaPhotonV1ResponseKind,
15299
15446
  LumaPhotonV1ResponseStatus,