@hautechai/sdk 0.3.25 → 0.3.27
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/autogenerated/api.d.ts +13 -1
- package/dist/sdk/index.d.ts +8 -0
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/videos/index.d.ts +11 -0
- package/dist/sdk/videos/index.js +15 -0
- package/package.json +1 -1
|
@@ -4536,7 +4536,7 @@ export type StackEntityKindEnum = typeof StackEntityKindEnum[keyof typeof StackE
|
|
|
4536
4536
|
* @type StackEntityItemsInner
|
|
4537
4537
|
* @export
|
|
4538
4538
|
*/
|
|
4539
|
-
export type StackEntityItemsInner = ImageEntity | OperationEntity;
|
|
4539
|
+
export type StackEntityItemsInner = ImageEntity | OperationEntity | VideoEntity;
|
|
4540
4540
|
/**
|
|
4541
4541
|
*
|
|
4542
4542
|
* @export
|
|
@@ -4950,6 +4950,18 @@ export interface VideoEntity {
|
|
|
4950
4950
|
* @memberof VideoEntity
|
|
4951
4951
|
*/
|
|
4952
4952
|
'duration': number;
|
|
4953
|
+
/**
|
|
4954
|
+
*
|
|
4955
|
+
* @type {ImageEntity}
|
|
4956
|
+
* @memberof VideoEntity
|
|
4957
|
+
*/
|
|
4958
|
+
'previewImage'?: ImageEntity;
|
|
4959
|
+
/**
|
|
4960
|
+
*
|
|
4961
|
+
* @type {string}
|
|
4962
|
+
* @memberof VideoEntity
|
|
4963
|
+
*/
|
|
4964
|
+
'previewImageId'?: string;
|
|
4953
4965
|
/**
|
|
4954
4966
|
*
|
|
4955
4967
|
* @type {string}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -107,6 +107,14 @@ export declare const createSDK: (options: SDKOptions) => {
|
|
|
107
107
|
ids: string[];
|
|
108
108
|
}) => Promise<Record<string, string>>;
|
|
109
109
|
};
|
|
110
|
+
videos: {
|
|
111
|
+
get: (props: {
|
|
112
|
+
id: string;
|
|
113
|
+
}) => Promise<import("../autogenerated").VideoEntity | undefined>;
|
|
114
|
+
getUrls: (props: {
|
|
115
|
+
ids: string[];
|
|
116
|
+
}) => Promise<Record<string, string>>;
|
|
117
|
+
};
|
|
110
118
|
operations: {
|
|
111
119
|
run: {
|
|
112
120
|
animate: {
|
package/dist/sdk/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { OperationsListener } from './listeners';
|
|
|
14
14
|
import { getAPI, getBaseUrl } from './api';
|
|
15
15
|
import { OperationsApi } from '../autogenerated';
|
|
16
16
|
import poses from './poses';
|
|
17
|
+
import videos from './videos';
|
|
17
18
|
const replaceProtocol = (url, protocol) => {
|
|
18
19
|
const parsed = new URL(url);
|
|
19
20
|
parsed.protocol = protocol;
|
|
@@ -51,6 +52,7 @@ export const createSDK = (options) => {
|
|
|
51
52
|
collections: collections(optionsWithTokenRefresher),
|
|
52
53
|
groups: groups(optionsWithTokenRefresher),
|
|
53
54
|
images: images(optionsWithTokenRefresher),
|
|
55
|
+
videos: videos(optionsWithTokenRefresher),
|
|
54
56
|
operations: operations(optionsWithTokenRefresher, operationsListener),
|
|
55
57
|
pipelines: pipelines(optionsWithTokenRefresher),
|
|
56
58
|
stacks: stacks(optionsWithTokenRefresher),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VideoEntity } from '../../autogenerated';
|
|
2
|
+
import { SDKOptions } from '../../types';
|
|
3
|
+
declare const videos: (options: SDKOptions) => {
|
|
4
|
+
get: (props: {
|
|
5
|
+
id: string;
|
|
6
|
+
}) => Promise<VideoEntity | undefined>;
|
|
7
|
+
getUrls: (props: {
|
|
8
|
+
ids: string[];
|
|
9
|
+
}) => Promise<Record<string, string>>;
|
|
10
|
+
};
|
|
11
|
+
export default videos;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VideosApi } from '../../autogenerated';
|
|
2
|
+
import { useAutogeneratedAPI } from '../api';
|
|
3
|
+
const videos = (options) => {
|
|
4
|
+
const api = useAutogeneratedAPI({ API: VideosApi, options });
|
|
5
|
+
return {
|
|
6
|
+
get: async (props) => api.callWithReturningUndefinedOn404({
|
|
7
|
+
run: (methods) => methods.videosControllerGetVideoV1(props.id),
|
|
8
|
+
}),
|
|
9
|
+
getUrls: async (props) => api.call({
|
|
10
|
+
run: (methods) => methods.videosControllerGetUrlsV1({ ids: props.ids }),
|
|
11
|
+
transform: (data) => data.reduce((acc, { id, url }) => ({ ...acc, [id]: url }), {}),
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default videos;
|