@hautechai/sdk 2.4.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.js CHANGED
@@ -10502,6 +10502,10 @@ __export(index_exports, {
10502
10502
  ListOperationsParamsDtoOrderBy: () => ListOperationsParamsDtoOrderBy,
10503
10503
  ListPosesParamsDtoOrderBy: () => ListPosesParamsDtoOrderBy,
10504
10504
  ListStacksParamsDtoOrderBy: () => ListStacksParamsDtoOrderBy,
10505
+ LoraControllerListV1OrderBy: () => LoraControllerListV1OrderBy,
10506
+ LoraControllerListV1Status: () => LoraControllerListV1Status,
10507
+ LoraDtoStatus: () => LoraDtoStatus,
10508
+ LoraWebhookDtoStatus: () => LoraWebhookDtoStatus,
10505
10509
  LumaPhotonV1InputAspectRatio: () => LumaPhotonV1InputAspectRatio,
10506
10510
  LumaPhotonV1ResponseKind: () => LumaPhotonV1ResponseKind,
10507
10511
  LumaPhotonV1ResponseStatus: () => LumaPhotonV1ResponseStatus,
@@ -10803,11 +10807,11 @@ var useVideosApi = () => {
10803
10807
  const sdk = this;
10804
10808
  const isBrowser = typeof window !== "undefined" && typeof Blob !== "undefined";
10805
10809
  if (isBrowser) {
10806
- const response = await import_axios2.default.get(fileUrl, { responseType: "blob", timeout: 3e4 });
10810
+ const response = await import_axios2.default.get(fileUrl, { responseType: "blob", timeout: 6e4 });
10807
10811
  const blob = new Blob([response.data], { type: response.headers["content-type"] });
10808
10812
  return sdk.videos.createFromFile(blob);
10809
10813
  } else {
10810
- const response = await import_axios2.default.get(fileUrl, { responseType: "stream", timeout: 3e4 });
10814
+ const response = await import_axios2.default.get(fileUrl, { responseType: "stream", timeout: 6e4 });
10811
10815
  return sdk.videos.createFromFile({
10812
10816
  stream: response.data,
10813
10817
  filename: fileUrl.split("/").pop(),
@@ -11694,7 +11698,7 @@ var getOperations = () => {
11694
11698
  // src/sdk/api-definitions/operations.ts
11695
11699
  var waitOperation = wrapCustomMethod(async function(operation, timeoutMs = 6e4) {
11696
11700
  const deadline = Date.now() + timeoutMs;
11697
- const delay = 1e3;
11701
+ const delay = 3e3;
11698
11702
  const sdk = this;
11699
11703
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
11700
11704
  const poll = async (id) => {
@@ -13459,6 +13463,39 @@ var ListStacksParamsDtoOrderBy = {
13459
13463
  updatedAt_DESC: "updatedAt_DESC"
13460
13464
  };
13461
13465
 
13466
+ // src/autogenerated/schemas/loraControllerListV1OrderBy.ts
13467
+ var LoraControllerListV1OrderBy = {
13468
+ createdAt_ASC: "createdAt_ASC",
13469
+ createdAt_DESC: "createdAt_DESC"
13470
+ };
13471
+
13472
+ // src/autogenerated/schemas/loraControllerListV1Status.ts
13473
+ var LoraControllerListV1Status = {
13474
+ starting: "starting",
13475
+ processing: "processing",
13476
+ succeeded: "succeeded",
13477
+ failed: "failed",
13478
+ canceled: "canceled"
13479
+ };
13480
+
13481
+ // src/autogenerated/schemas/loraDtoStatus.ts
13482
+ var LoraDtoStatus = {
13483
+ starting: "starting",
13484
+ processing: "processing",
13485
+ succeeded: "succeeded",
13486
+ failed: "failed",
13487
+ canceled: "canceled"
13488
+ };
13489
+
13490
+ // src/autogenerated/schemas/loraWebhookDtoStatus.ts
13491
+ var LoraWebhookDtoStatus = {
13492
+ starting: "starting",
13493
+ processing: "processing",
13494
+ succeeded: "succeeded",
13495
+ failed: "failed",
13496
+ canceled: "canceled"
13497
+ };
13498
+
13462
13499
  // src/autogenerated/schemas/lumaPhotonV1InputAspectRatio.ts
13463
13500
  var LumaPhotonV1InputAspectRatio = {
13464
13501
  "1:1": "1:1",
@@ -15201,7 +15238,7 @@ var usePipelinesApi = () => {
15201
15238
  wait: wrapCustomMethod(async function(pipeline, timeoutMs = 6e4) {
15202
15239
  const sdk = this;
15203
15240
  const deadline = Date.now() + timeoutMs;
15204
- const delay = 1e3;
15241
+ const delay = 3e3;
15205
15242
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15206
15243
  const poll = async (id) => {
15207
15244
  const pipeline2 = await sdk.pipelines.get(id);
@@ -15222,6 +15259,114 @@ var usePipelinesApi = () => {
15222
15259
  return useApi(api);
15223
15260
  };
15224
15261
 
15262
+ // src/autogenerated/lora/lora.ts
15263
+ var getLora = () => {
15264
+ const loraControllerStartV1 = (startLoraTrainingParamsDto, options) => {
15265
+ return axiosMutator(
15266
+ {
15267
+ url: `/v1/lora/train`,
15268
+ method: "POST",
15269
+ headers: { "Content-Type": "application/json" },
15270
+ data: startLoraTrainingParamsDto
15271
+ },
15272
+ options
15273
+ );
15274
+ };
15275
+ const loraControllerListV1 = (params, options) => {
15276
+ return axiosMutator(
15277
+ {
15278
+ url: `/v1/lora`,
15279
+ method: "GET",
15280
+ params
15281
+ },
15282
+ options
15283
+ );
15284
+ };
15285
+ const loraControllerGetV1 = (id, options) => {
15286
+ return axiosMutator(
15287
+ {
15288
+ url: `/v1/lora/${id}`,
15289
+ method: "GET"
15290
+ },
15291
+ options
15292
+ );
15293
+ };
15294
+ const loraControllerTrainingsWebhookV1 = (loraWebhookDto, options) => {
15295
+ return axiosMutator(
15296
+ {
15297
+ url: `/v1/lora/trainings/webhook`,
15298
+ method: "POST",
15299
+ headers: { "Content-Type": "application/json" },
15300
+ data: loraWebhookDto
15301
+ },
15302
+ options
15303
+ );
15304
+ };
15305
+ return { loraControllerStartV1, loraControllerListV1, loraControllerGetV1, loraControllerTrainingsWebhookV1 };
15306
+ };
15307
+
15308
+ // src/sdk/api-definitions/lora.ts
15309
+ var waitLoraStatusChange = wrapCustomMethod(async function(lora, timeoutMs = 12e4) {
15310
+ const sdk = this;
15311
+ const initialStatus = lora.status;
15312
+ const deadline = Date.now() + timeoutMs;
15313
+ const delay = 3e3;
15314
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15315
+ while (Date.now() < deadline) {
15316
+ const current = await sdk.lora.get(lora.id);
15317
+ if (!current) throw new Error("LoRA not found");
15318
+ if (current.status !== initialStatus || ["succeeded", "failed", "canceled"].includes(current.status)) {
15319
+ return current;
15320
+ }
15321
+ await sleep(delay);
15322
+ }
15323
+ throw new Error("LoRA wait timed out");
15324
+ });
15325
+ var useLoraApi = () => {
15326
+ const hautechApi = getLora();
15327
+ return useApi({
15328
+ start: hautechApi.loraControllerStartV1,
15329
+ list: hautechApi.loraControllerListV1,
15330
+ get: hautechApi.loraControllerGetV1,
15331
+ wait: waitLoraStatusChange
15332
+ });
15333
+ };
15334
+
15335
+ // src/autogenerated/upload/upload.ts
15336
+ var getUpload = () => {
15337
+ const uploadControllerInitUploadV1 = (initializeGenericUploadParamsDto, options) => {
15338
+ return axiosMutator(
15339
+ {
15340
+ url: `/v1/upload/init`,
15341
+ method: "POST",
15342
+ headers: { "Content-Type": "application/json" },
15343
+ data: initializeGenericUploadParamsDto
15344
+ },
15345
+ options
15346
+ );
15347
+ };
15348
+ const uploadControllerGetUploadedFileUrlV1 = (params, options) => {
15349
+ return axiosMutator(
15350
+ {
15351
+ url: `/v1/upload/url`,
15352
+ method: "GET",
15353
+ params
15354
+ },
15355
+ options
15356
+ );
15357
+ };
15358
+ return { uploadControllerInitUploadV1, uploadControllerGetUploadedFileUrlV1 };
15359
+ };
15360
+
15361
+ // src/sdk/api-definitions/upload.ts
15362
+ var useUploadApi = () => {
15363
+ const hautechApi = getUpload();
15364
+ return useApi({
15365
+ initUpload: hautechApi.uploadControllerInitUploadV1,
15366
+ getUploadedFileUrl: hautechApi.uploadControllerGetUploadedFileUrlV1
15367
+ });
15368
+ };
15369
+
15225
15370
  // src/sdk/ws-client.ts
15226
15371
  var import_socket = require("socket.io-client");
15227
15372
  var useWsClient = (config) => new WsClient(config);
@@ -15312,7 +15457,9 @@ var apiDefinitions = {
15312
15457
  collections: useCollectionsApi(),
15313
15458
  balances: useBalancesApi(),
15314
15459
  access: useAccessApi(),
15315
- pipelines: usePipelinesApi()
15460
+ pipelines: usePipelinesApi(),
15461
+ lora: useLoraApi(),
15462
+ upload: useUploadApi()
15316
15463
  };
15317
15464
  var pipelineDefinitions = usePipelineDefinitions();
15318
15465
  var getWsClientDefinitions = (config) => ({
@@ -15593,6 +15740,10 @@ var createTokenSigner = (options) => {
15593
15740
  ListOperationsParamsDtoOrderBy,
15594
15741
  ListPosesParamsDtoOrderBy,
15595
15742
  ListStacksParamsDtoOrderBy,
15743
+ LoraControllerListV1OrderBy,
15744
+ LoraControllerListV1Status,
15745
+ LoraDtoStatus,
15746
+ LoraWebhookDtoStatus,
15596
15747
  LumaPhotonV1InputAspectRatio,
15597
15748
  LumaPhotonV1ResponseKind,
15598
15749
  LumaPhotonV1ResponseStatus,