@hautechai/sdk 0.1.1 → 0.1.3

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.
@@ -202,7 +202,16 @@ export declare const createSDK: (options: SDKOptions) => {
202
202
  }) => Promise<void>;
203
203
  wait: <T extends import("../types").OperationEntity | {
204
204
  id: string;
205
- }>(props: T) => Promise<T extends import("../types").OperationEntity ? T : import("../types").OperationEntity>;
205
+ }>(props: T) => Promise<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity) & ({
206
+ status: "failed";
207
+ output: null;
208
+ } | {
209
+ status: "pending";
210
+ output: null;
211
+ } | {
212
+ status: "finished";
213
+ output: NonNullable<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity)["output"]>;
214
+ })>;
206
215
  };
207
216
  pipelines: {
208
217
  constructTemplate: (consructPipeline: (pipeline: import("@hautechai/pipelines").Pipeline<{
@@ -1,5 +1,15 @@
1
- import { CompositeV1Input, CompositeV1Response, CutV1Input, CutV1Response, GiseleVtonV1Input, GPTV1Input, GptV1Response, HauteLindaV1Response, HauteNaomiV1Response, ImagineKateV1Response, KateImagineV1Input, KateInpaintV1Input, LindaHauteV1Input, NaomiHauteV1Input, NegateImageV1Input, NegateImageV1Response, ObjectDetectionV1Input, ObjectDetectionV1Response, OperationEntity, PoseEstimationV1Input, PoseEstimationV1Response, SegmentAnythingEmbeddingsV1Input, SegmentAnythingEmbeddingsV1Response, SegmentAnythingMaskV1Input, SegmentAnythingMaskV1Response, UpscaleV1Input, UpscaleV1Response, VtonGiseleV1Response } from '../../autogenerated';
1
+ import { CompositeV1Input, CompositeV1Response, CutV1Input, CutV1Response, GiseleVtonV1Input, GPTV1Input, GptV1Response, HauteLindaV1Response, HauteNaomiV1Response, ImagineKateV1Response, KateImagineV1Input, KateInpaintV1Input, LindaHauteV1Input, NaomiHauteV1Input, NegateImageV1Input, NegateImageV1Response, ObjectDetectionV1Input, ObjectDetectionV1Response, OperationEntity, OperationEntityStatusEnum, PoseEstimationV1Input, PoseEstimationV1Response, SegmentAnythingEmbeddingsV1Input, SegmentAnythingEmbeddingsV1Response, SegmentAnythingMaskV1Input, SegmentAnythingMaskV1Response, UpscaleV1Input, UpscaleV1Response, VtonGiseleV1Response } from '../../autogenerated';
2
2
  import { ListProps, ListResponse, SDKOptions } from '../../types';
3
+ type Waited<T extends OperationEntity> = T & ({
4
+ status: typeof OperationEntityStatusEnum.Failed;
5
+ output: null;
6
+ } | {
7
+ status: typeof OperationEntityStatusEnum.Pending;
8
+ output: null;
9
+ } | {
10
+ status: typeof OperationEntityStatusEnum.Finished;
11
+ output: NonNullable<T['output']>;
12
+ });
3
13
  declare const operations: (options: SDKOptions) => {
4
14
  run: {
5
15
  haute: {
@@ -110,6 +120,6 @@ declare const operations: (options: SDKOptions) => {
110
120
  }) => Promise<void>;
111
121
  wait: <T extends OperationEntity | {
112
122
  id: string;
113
- }>(props: T) => Promise<T extends OperationEntity ? T : OperationEntity>;
123
+ }>(props: T) => Promise<Waited<T extends OperationEntity ? T : OperationEntity>>;
114
124
  };
115
125
  export default operations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {