@hautechai/sdk 0.1.2 → 0.1.4

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.
@@ -1,5 +1,5 @@
1
- import { AccountEntity } from '../../autogenerated';
2
- import { SDKOptions } from '../../types';
1
+ import { AccountEntity, ListAccountsParamsDto } from '../../autogenerated';
2
+ import { ListResponse, SDKOptions } from '../../types';
3
3
  declare const accounts: (options: SDKOptions) => {
4
4
  create: (props?: {
5
5
  alias?: string;
@@ -10,6 +10,6 @@ declare const accounts: (options: SDKOptions) => {
10
10
  getByAlias: (props: {
11
11
  alias: string;
12
12
  }) => Promise<AccountEntity | undefined>;
13
- list: () => Promise<AccountEntity[]>;
13
+ list: (props?: ListAccountsParamsDto) => Promise<ListResponse<AccountEntity>>;
14
14
  };
15
15
  export default accounts;
@@ -1,5 +1,6 @@
1
1
  import { AccountsApi } from '../../autogenerated';
2
2
  import { useAutogeneratedAPI } from '../api';
3
+ import { transformToListResponse } from '../transformers';
3
4
  const accounts = (options) => {
4
5
  const api = useAutogeneratedAPI({ API: AccountsApi, options });
5
6
  return {
@@ -12,9 +13,10 @@ const accounts = (options) => {
12
13
  getByAlias: async (props) => api.callWithReturningUndefinedOn404({
13
14
  run: (methods) => methods.accountsControllerGetAccountByAliasV1(props.alias),
14
15
  }),
15
- list: async () => api.call({
16
- run: (methods) => methods.accountsControllerListAccountsV1(),
17
- })
16
+ list: async (props = {}) => api.call({
17
+ run: (methods) => methods.accountsControllerListAccountsV1(props.orderBy, props.limit, props.cursor),
18
+ transform: transformToListResponse,
19
+ }),
18
20
  };
19
21
  };
20
22
  export default accounts;
@@ -18,7 +18,7 @@ export declare const createSDK: (options: SDKOptions) => {
18
18
  getByAlias: (props: {
19
19
  alias: string;
20
20
  }) => Promise<import("../types").AccountEntity | undefined>;
21
- list: () => Promise<import("../types").AccountEntity[]>;
21
+ list: (props?: import("../autogenerated").ListAccountsParamsDto) => Promise<import("../types").ListResponse<import("../types").AccountEntity>>;
22
22
  };
23
23
  balances: {
24
24
  add: (props: {
@@ -204,13 +204,13 @@ export declare const createSDK: (options: SDKOptions) => {
204
204
  id: string;
205
205
  }>(props: T) => Promise<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity) & ({
206
206
  status: "failed";
207
- output: Extract<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity)["output"], undefined>;
207
+ output: null;
208
208
  } | {
209
209
  status: "pending";
210
- output: Extract<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity)["output"], undefined>;
210
+ output: null;
211
211
  } | {
212
212
  status: "finished";
213
- output: Exclude<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity)["output"], undefined>;
213
+ output: NonNullable<(T extends import("../types").OperationEntity ? T : import("../types").OperationEntity)["output"]>;
214
214
  })>;
215
215
  };
216
216
  pipelines: {
@@ -2,13 +2,13 @@ import { CompositeV1Input, CompositeV1Response, CutV1Input, CutV1Response, Gisel
2
2
  import { ListProps, ListResponse, SDKOptions } from '../../types';
3
3
  type Waited<T extends OperationEntity> = T & ({
4
4
  status: typeof OperationEntityStatusEnum.Failed;
5
- output: Extract<T['output'], undefined>;
5
+ output: null;
6
6
  } | {
7
7
  status: typeof OperationEntityStatusEnum.Pending;
8
- output: Extract<T['output'], undefined>;
8
+ output: null;
9
9
  } | {
10
10
  status: typeof OperationEntityStatusEnum.Finished;
11
- output: Exclude<T['output'], undefined>;
11
+ output: NonNullable<T['output']>;
12
12
  });
13
13
  declare const operations: (options: SDKOptions) => {
14
14
  run: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {