@hautechai/sdk 2.5.0 → 2.7.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
@@ -10328,6 +10328,7 @@ __export(index_exports, {
10328
10328
  AnimateKling21V1InputDuration: () => AnimateKling21V1InputDuration,
10329
10329
  AnimateKling21V1ResponseKind: () => AnimateKling21V1ResponseKind,
10330
10330
  AnimateKling21V1ResponseStatus: () => AnimateKling21V1ResponseStatus,
10331
+ ChatControllerListChatsV1OrderBy: () => ChatControllerListChatsV1OrderBy,
10331
10332
  CollectionEntityKind: () => CollectionEntityKind,
10332
10333
  CollectionsControllerListCollectionsV1OrderBy: () => CollectionsControllerListCollectionsV1OrderBy,
10333
10334
  CollectionsControllerListItemsV1Kind: () => CollectionsControllerListItemsV1Kind,
@@ -10502,6 +10503,10 @@ __export(index_exports, {
10502
10503
  ListOperationsParamsDtoOrderBy: () => ListOperationsParamsDtoOrderBy,
10503
10504
  ListPosesParamsDtoOrderBy: () => ListPosesParamsDtoOrderBy,
10504
10505
  ListStacksParamsDtoOrderBy: () => ListStacksParamsDtoOrderBy,
10506
+ LoraControllerListV1OrderBy: () => LoraControllerListV1OrderBy,
10507
+ LoraControllerListV1Status: () => LoraControllerListV1Status,
10508
+ LoraDtoStatus: () => LoraDtoStatus,
10509
+ LoraWebhookDtoStatus: () => LoraWebhookDtoStatus,
10505
10510
  LumaPhotonV1InputAspectRatio: () => LumaPhotonV1InputAspectRatio,
10506
10511
  LumaPhotonV1ResponseKind: () => LumaPhotonV1ResponseKind,
10507
10512
  LumaPhotonV1ResponseStatus: () => LumaPhotonV1ResponseStatus,
@@ -10803,11 +10808,11 @@ var useVideosApi = () => {
10803
10808
  const sdk = this;
10804
10809
  const isBrowser = typeof window !== "undefined" && typeof Blob !== "undefined";
10805
10810
  if (isBrowser) {
10806
- const response = await import_axios2.default.get(fileUrl, { responseType: "blob", timeout: 3e4 });
10811
+ const response = await import_axios2.default.get(fileUrl, { responseType: "blob", timeout: 6e4 });
10807
10812
  const blob = new Blob([response.data], { type: response.headers["content-type"] });
10808
10813
  return sdk.videos.createFromFile(blob);
10809
10814
  } else {
10810
- const response = await import_axios2.default.get(fileUrl, { responseType: "stream", timeout: 3e4 });
10815
+ const response = await import_axios2.default.get(fileUrl, { responseType: "stream", timeout: 6e4 });
10811
10816
  return sdk.videos.createFromFile({
10812
10817
  stream: response.data,
10813
10818
  filename: fileUrl.split("/").pop(),
@@ -11694,7 +11699,7 @@ var getOperations = () => {
11694
11699
  // src/sdk/api-definitions/operations.ts
11695
11700
  var waitOperation = wrapCustomMethod(async function(operation, timeoutMs = 6e4) {
11696
11701
  const deadline = Date.now() + timeoutMs;
11697
- const delay = 1e3;
11702
+ const delay = 3e3;
11698
11703
  const sdk = this;
11699
11704
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
11700
11705
  const poll = async (id) => {
@@ -12353,6 +12358,14 @@ var AnimateKling21V1ResponseStatus = {
12353
12358
  failed: "failed"
12354
12359
  };
12355
12360
 
12361
+ // src/autogenerated/schemas/chatControllerListChatsV1OrderBy.ts
12362
+ var ChatControllerListChatsV1OrderBy = {
12363
+ createdAt_ASC: "createdAt_ASC",
12364
+ createdAt_DESC: "createdAt_DESC",
12365
+ updatedAt_ASC: "updatedAt_ASC",
12366
+ updatedAt_DESC: "updatedAt_DESC"
12367
+ };
12368
+
12356
12369
  // src/autogenerated/schemas/collectionEntityKind.ts
12357
12370
  var CollectionEntityKind = {
12358
12371
  collection: "collection",
@@ -13459,6 +13472,39 @@ var ListStacksParamsDtoOrderBy = {
13459
13472
  updatedAt_DESC: "updatedAt_DESC"
13460
13473
  };
13461
13474
 
13475
+ // src/autogenerated/schemas/loraControllerListV1OrderBy.ts
13476
+ var LoraControllerListV1OrderBy = {
13477
+ createdAt_ASC: "createdAt_ASC",
13478
+ createdAt_DESC: "createdAt_DESC"
13479
+ };
13480
+
13481
+ // src/autogenerated/schemas/loraControllerListV1Status.ts
13482
+ var LoraControllerListV1Status = {
13483
+ starting: "starting",
13484
+ processing: "processing",
13485
+ succeeded: "succeeded",
13486
+ failed: "failed",
13487
+ canceled: "canceled"
13488
+ };
13489
+
13490
+ // src/autogenerated/schemas/loraDtoStatus.ts
13491
+ var LoraDtoStatus = {
13492
+ starting: "starting",
13493
+ processing: "processing",
13494
+ succeeded: "succeeded",
13495
+ failed: "failed",
13496
+ canceled: "canceled"
13497
+ };
13498
+
13499
+ // src/autogenerated/schemas/loraWebhookDtoStatus.ts
13500
+ var LoraWebhookDtoStatus = {
13501
+ starting: "starting",
13502
+ processing: "processing",
13503
+ succeeded: "succeeded",
13504
+ failed: "failed",
13505
+ canceled: "canceled"
13506
+ };
13507
+
13462
13508
  // src/autogenerated/schemas/lumaPhotonV1InputAspectRatio.ts
13463
13509
  var LumaPhotonV1InputAspectRatio = {
13464
13510
  "1:1": "1:1",
@@ -15201,7 +15247,7 @@ var usePipelinesApi = () => {
15201
15247
  wait: wrapCustomMethod(async function(pipeline, timeoutMs = 6e4) {
15202
15248
  const sdk = this;
15203
15249
  const deadline = Date.now() + timeoutMs;
15204
- const delay = 1e3;
15250
+ const delay = 3e3;
15205
15251
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15206
15252
  const poll = async (id) => {
15207
15253
  const pipeline2 = await sdk.pipelines.get(id);
@@ -15222,6 +15268,181 @@ var usePipelinesApi = () => {
15222
15268
  return useApi(api);
15223
15269
  };
15224
15270
 
15271
+ // src/autogenerated/lora/lora.ts
15272
+ var getLora = () => {
15273
+ const loraControllerStartV1 = (startLoraTrainingParamsDto, options) => {
15274
+ return axiosMutator(
15275
+ {
15276
+ url: `/v1/lora/train`,
15277
+ method: "POST",
15278
+ headers: { "Content-Type": "application/json" },
15279
+ data: startLoraTrainingParamsDto
15280
+ },
15281
+ options
15282
+ );
15283
+ };
15284
+ const loraControllerListV1 = (params, options) => {
15285
+ return axiosMutator(
15286
+ {
15287
+ url: `/v1/lora`,
15288
+ method: "GET",
15289
+ params
15290
+ },
15291
+ options
15292
+ );
15293
+ };
15294
+ const loraControllerGetV1 = (id, options) => {
15295
+ return axiosMutator(
15296
+ {
15297
+ url: `/v1/lora/${id}`,
15298
+ method: "GET"
15299
+ },
15300
+ options
15301
+ );
15302
+ };
15303
+ const loraControllerTrainingsWebhookV1 = (loraWebhookDto, options) => {
15304
+ return axiosMutator(
15305
+ {
15306
+ url: `/v1/lora/trainings/webhook`,
15307
+ method: "POST",
15308
+ headers: { "Content-Type": "application/json" },
15309
+ data: loraWebhookDto
15310
+ },
15311
+ options
15312
+ );
15313
+ };
15314
+ return { loraControllerStartV1, loraControllerListV1, loraControllerGetV1, loraControllerTrainingsWebhookV1 };
15315
+ };
15316
+
15317
+ // src/sdk/api-definitions/lora.ts
15318
+ var waitLoraStatusChange = wrapCustomMethod(async function(lora, timeoutMs = 12e4) {
15319
+ const sdk = this;
15320
+ const initialStatus = lora.status;
15321
+ const deadline = Date.now() + timeoutMs;
15322
+ const delay = 3e3;
15323
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15324
+ while (Date.now() < deadline) {
15325
+ const current = await sdk.lora.get(lora.id);
15326
+ if (!current) throw new Error("LoRA not found");
15327
+ if (current.status !== initialStatus || ["succeeded", "failed", "canceled"].includes(current.status)) {
15328
+ return current;
15329
+ }
15330
+ await sleep(delay);
15331
+ }
15332
+ throw new Error("LoRA wait timed out");
15333
+ });
15334
+ var useLoraApi = () => {
15335
+ const hautechApi = getLora();
15336
+ return useApi({
15337
+ start: hautechApi.loraControllerStartV1,
15338
+ list: hautechApi.loraControllerListV1,
15339
+ get: hautechApi.loraControllerGetV1,
15340
+ wait: waitLoraStatusChange
15341
+ });
15342
+ };
15343
+
15344
+ // src/autogenerated/upload/upload.ts
15345
+ var getUpload = () => {
15346
+ const uploadControllerInitUploadV1 = (initializeGenericUploadParamsDto, options) => {
15347
+ return axiosMutator(
15348
+ {
15349
+ url: `/v1/upload/init`,
15350
+ method: "POST",
15351
+ headers: { "Content-Type": "application/json" },
15352
+ data: initializeGenericUploadParamsDto
15353
+ },
15354
+ options
15355
+ );
15356
+ };
15357
+ const uploadControllerGetUploadedFileUrlV1 = (params, options) => {
15358
+ return axiosMutator(
15359
+ {
15360
+ url: `/v1/upload/url`,
15361
+ method: "GET",
15362
+ params
15363
+ },
15364
+ options
15365
+ );
15366
+ };
15367
+ return { uploadControllerInitUploadV1, uploadControllerGetUploadedFileUrlV1 };
15368
+ };
15369
+
15370
+ // src/sdk/api-definitions/upload.ts
15371
+ var useUploadApi = () => {
15372
+ const hautechApi = getUpload();
15373
+ return useApi({
15374
+ initUpload: hautechApi.uploadControllerInitUploadV1,
15375
+ getUploadedFileUrl: hautechApi.uploadControllerGetUploadedFileUrlV1
15376
+ });
15377
+ };
15378
+
15379
+ // src/autogenerated/chat/chat.ts
15380
+ var getChat = () => {
15381
+ const chatControllerCreateChatV1 = (createChatParamsDto, options) => {
15382
+ return axiosMutator(
15383
+ {
15384
+ url: `/v1/chat`,
15385
+ method: "POST",
15386
+ headers: { "Content-Type": "application/json" },
15387
+ data: createChatParamsDto
15388
+ },
15389
+ options
15390
+ );
15391
+ };
15392
+ const chatControllerListChatsV1 = (params, options) => {
15393
+ return axiosMutator(
15394
+ {
15395
+ url: `/v1/chat`,
15396
+ method: "GET",
15397
+ params
15398
+ },
15399
+ options
15400
+ );
15401
+ };
15402
+ const chatControllerGetChatV1 = (id, options) => {
15403
+ return axiosMutator(
15404
+ {
15405
+ url: `/v1/chat/${id}`,
15406
+ method: "GET"
15407
+ },
15408
+ options
15409
+ );
15410
+ };
15411
+ const chatControllerDeleteChatV1 = (id, options) => {
15412
+ return axiosMutator(
15413
+ {
15414
+ url: `/v1/chat/${id}`,
15415
+ method: "DELETE"
15416
+ },
15417
+ options
15418
+ );
15419
+ };
15420
+ const chatControllerAddItemsToChatV1 = (chatId, addChatItemsDto, options) => {
15421
+ return axiosMutator(
15422
+ {
15423
+ url: `/v1/chat/${chatId}/items`,
15424
+ method: "POST",
15425
+ headers: { "Content-Type": "application/json" },
15426
+ data: addChatItemsDto
15427
+ },
15428
+ options
15429
+ );
15430
+ };
15431
+ return { chatControllerCreateChatV1, chatControllerListChatsV1, chatControllerGetChatV1, chatControllerDeleteChatV1, chatControllerAddItemsToChatV1 };
15432
+ };
15433
+
15434
+ // src/sdk/api-definitions/chats.ts
15435
+ var useChatsApi = () => {
15436
+ const api = getChat();
15437
+ return useApi({
15438
+ create: api.chatControllerCreateChatV1,
15439
+ list: api.chatControllerListChatsV1,
15440
+ get: wrapApiCallNullable(api.chatControllerGetChatV1),
15441
+ delete: api.chatControllerDeleteChatV1,
15442
+ addItems: api.chatControllerAddItemsToChatV1
15443
+ });
15444
+ };
15445
+
15225
15446
  // src/sdk/ws-client.ts
15226
15447
  var import_socket = require("socket.io-client");
15227
15448
  var useWsClient = (config) => new WsClient(config);
@@ -15310,9 +15531,12 @@ var apiDefinitions = {
15310
15531
  groups: useGroupsApi(),
15311
15532
  accounts: useAccountsApi(),
15312
15533
  collections: useCollectionsApi(),
15534
+ chats: useChatsApi(),
15313
15535
  balances: useBalancesApi(),
15314
15536
  access: useAccessApi(),
15315
- pipelines: usePipelinesApi()
15537
+ pipelines: usePipelinesApi(),
15538
+ lora: useLoraApi(),
15539
+ upload: useUploadApi()
15316
15540
  };
15317
15541
  var pipelineDefinitions = usePipelineDefinitions();
15318
15542
  var getWsClientDefinitions = (config) => ({
@@ -15419,6 +15643,7 @@ var createTokenSigner = (options) => {
15419
15643
  AnimateKling21V1InputDuration,
15420
15644
  AnimateKling21V1ResponseKind,
15421
15645
  AnimateKling21V1ResponseStatus,
15646
+ ChatControllerListChatsV1OrderBy,
15422
15647
  CollectionEntityKind,
15423
15648
  CollectionsControllerListCollectionsV1OrderBy,
15424
15649
  CollectionsControllerListItemsV1Kind,
@@ -15593,6 +15818,10 @@ var createTokenSigner = (options) => {
15593
15818
  ListOperationsParamsDtoOrderBy,
15594
15819
  ListPosesParamsDtoOrderBy,
15595
15820
  ListStacksParamsDtoOrderBy,
15821
+ LoraControllerListV1OrderBy,
15822
+ LoraControllerListV1Status,
15823
+ LoraDtoStatus,
15824
+ LoraWebhookDtoStatus,
15596
15825
  LumaPhotonV1InputAspectRatio,
15597
15826
  LumaPhotonV1ResponseKind,
15598
15827
  LumaPhotonV1ResponseStatus,