@hautechai/sdk 0.1.4 → 0.2.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/.github/workflows/main.yml +31 -31
- package/.github/workflows/test.yml +30 -30
- package/.prettierignore +1 -0
- package/dist/autogenerated/api.d.ts +981 -23
- package/dist/autogenerated/api.js +1110 -161
- package/dist/sdk/api.d.ts +2 -0
- package/dist/sdk/api.js +10 -10
- package/dist/sdk/exceptions/index.d.ts +3 -0
- package/dist/sdk/exceptions/index.js +6 -0
- package/dist/sdk/index.d.ts +763 -142
- package/dist/sdk/index.js +18 -1
- package/dist/sdk/listeners/index.d.ts +25 -0
- package/dist/sdk/listeners/index.js +81 -0
- package/dist/sdk/operations/index.d.ts +3 -2
- package/dist/sdk/operations/index.js +18 -14
- package/dist/sdk/pipelines/index.d.ts +760 -140
- package/dist/sdk/pipelines/index.js +59 -2
- package/dist/sdk/pipelines/pipelines.d.ts +0 -0
- package/dist/sdk/pipelines/pipelines.js +1 -0
- package/dist/token/index.js +32 -21
- package/dist/types.d.ts +1 -0
- package/openapitools.json +5 -5
- package/package.json +5 -3
package/dist/sdk/api.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { AxiosPromise } from 'axios';
|
|
|
2
2
|
import { BaseAPI } from '../autogenerated/base';
|
|
3
3
|
import { SDKOptions } from '../types';
|
|
4
4
|
import { Configuration } from '../autogenerated';
|
|
5
|
+
export declare const getBaseUrl: (options: SDKOptions) => string;
|
|
6
|
+
export declare const getAPI: <T>(API: new (configuration?: Configuration, basePath?: string, axios?: any) => T, options: SDKOptions) => Promise<T>;
|
|
5
7
|
export declare const useAutogeneratedAPI: <T extends BaseAPI>(baseProps: {
|
|
6
8
|
API: new (configuration?: Configuration, basePath?: string, axios?: any) => T;
|
|
7
9
|
options: SDKOptions;
|
package/dist/sdk/api.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const getBaseUrl = (options) => options.endpoint ?? 'https://api.hautech.ai';
|
|
2
|
-
export const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
isJsonMime: (mime) => true,
|
|
8
|
-
};
|
|
9
|
-
return new baseProps.API(config);
|
|
1
|
+
export const getBaseUrl = (options) => options.endpoint ?? 'https://api.hautech.ai';
|
|
2
|
+
export const getAPI = async (API, options) => {
|
|
3
|
+
const config = {
|
|
4
|
+
accessToken: await options.authToken(),
|
|
5
|
+
basePath: getBaseUrl(options),
|
|
6
|
+
isJsonMime: (mime) => true,
|
|
10
7
|
};
|
|
8
|
+
return new API(config);
|
|
9
|
+
};
|
|
10
|
+
export const useAutogeneratedAPI = (baseProps) => {
|
|
11
11
|
const call = async (props) => {
|
|
12
|
-
const api = await getAPI();
|
|
12
|
+
const api = await getAPI(baseProps.API, baseProps.options);
|
|
13
13
|
try {
|
|
14
14
|
const response = await props.run(api);
|
|
15
15
|
if (props.returnUndefinedOn404 && response.status === 404)
|