@hautechai/sdk 0.3.26 → 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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {