@aviaryhq/cloudglue-js 0.1.3 → 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.
- package/dist/generated/Collections.d.ts +4 -2
- package/dist/generated/Collections.js +4 -3
- package/dist/generated/Describe.d.ts +7027 -0
- package/dist/generated/Describe.js +159 -0
- package/dist/generated/Search.d.ts +190 -0
- package/dist/generated/Search.js +173 -0
- package/dist/src/client.d.ts +24 -0
- package/dist/src/client.js +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DescribeApi = exports.schemas = void 0;
|
|
4
|
+
exports.createApiClient = createApiClient;
|
|
5
|
+
const core_1 = require("@zodios/core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const Describe = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
job_id: zod_1.z.string(),
|
|
10
|
+
status: zod_1.z.enum([
|
|
11
|
+
"pending",
|
|
12
|
+
"processing",
|
|
13
|
+
"ready",
|
|
14
|
+
"completed",
|
|
15
|
+
"failed",
|
|
16
|
+
"not_applicable",
|
|
17
|
+
]),
|
|
18
|
+
data: zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
url: zod_1.z.string(),
|
|
21
|
+
title: zod_1.z.string(),
|
|
22
|
+
summary: zod_1.z.string(),
|
|
23
|
+
segment_docs: zod_1.z.array(zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
segment_id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]),
|
|
26
|
+
start_time: zod_1.z.number(),
|
|
27
|
+
end_time: zod_1.z.number(),
|
|
28
|
+
title: zod_1.z.string(),
|
|
29
|
+
summary: zod_1.z.string(),
|
|
30
|
+
visual_description: zod_1.z.array(zod_1.z
|
|
31
|
+
.object({
|
|
32
|
+
text: zod_1.z.string(),
|
|
33
|
+
start_time: zod_1.z.number(),
|
|
34
|
+
end_time: zod_1.z.number(),
|
|
35
|
+
})
|
|
36
|
+
.partial()
|
|
37
|
+
.strict()
|
|
38
|
+
.passthrough()),
|
|
39
|
+
scene_text: zod_1.z.array(zod_1.z
|
|
40
|
+
.object({
|
|
41
|
+
text: zod_1.z.string(),
|
|
42
|
+
start_time: zod_1.z.number(),
|
|
43
|
+
end_time: zod_1.z.number(),
|
|
44
|
+
})
|
|
45
|
+
.partial()
|
|
46
|
+
.strict()
|
|
47
|
+
.passthrough()),
|
|
48
|
+
speech: zod_1.z.array(zod_1.z
|
|
49
|
+
.object({
|
|
50
|
+
speaker: zod_1.z.string(),
|
|
51
|
+
text: zod_1.z.string(),
|
|
52
|
+
start_time: zod_1.z.number(),
|
|
53
|
+
end_time: zod_1.z.number(),
|
|
54
|
+
})
|
|
55
|
+
.partial()
|
|
56
|
+
.strict()
|
|
57
|
+
.passthrough()),
|
|
58
|
+
})
|
|
59
|
+
.partial()
|
|
60
|
+
.strict()
|
|
61
|
+
.passthrough()),
|
|
62
|
+
})
|
|
63
|
+
.partial()
|
|
64
|
+
.strict()
|
|
65
|
+
.passthrough()
|
|
66
|
+
.optional(),
|
|
67
|
+
error: zod_1.z.string().optional(),
|
|
68
|
+
})
|
|
69
|
+
.strict()
|
|
70
|
+
.passthrough();
|
|
71
|
+
const NewDescribe = zod_1.z
|
|
72
|
+
.object({
|
|
73
|
+
url: zod_1.z.string(),
|
|
74
|
+
enable_speech: zod_1.z.boolean().optional().default(true),
|
|
75
|
+
enable_scene_text: zod_1.z.boolean().optional().default(true),
|
|
76
|
+
enable_visual_scene_description: zod_1.z.boolean().optional().default(true),
|
|
77
|
+
})
|
|
78
|
+
.strict()
|
|
79
|
+
.passthrough();
|
|
80
|
+
exports.schemas = {
|
|
81
|
+
Describe,
|
|
82
|
+
NewDescribe,
|
|
83
|
+
};
|
|
84
|
+
const endpoints = (0, core_1.makeApi)([
|
|
85
|
+
{
|
|
86
|
+
method: "post",
|
|
87
|
+
path: "/describe",
|
|
88
|
+
alias: "createDescribe",
|
|
89
|
+
description: `Creates a new describe job for comprehensive video description and transcription`,
|
|
90
|
+
requestFormat: "json",
|
|
91
|
+
parameters: [
|
|
92
|
+
{
|
|
93
|
+
name: "body",
|
|
94
|
+
description: `Generate rich, multimodal descriptions of video content`,
|
|
95
|
+
type: "Body",
|
|
96
|
+
schema: NewDescribe,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
response: Describe,
|
|
100
|
+
errors: [
|
|
101
|
+
{
|
|
102
|
+
status: 400,
|
|
103
|
+
description: `Invalid request or describe config requires at least one option enabled`,
|
|
104
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
status: 404,
|
|
108
|
+
description: `Describe job not found`,
|
|
109
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
status: 429,
|
|
113
|
+
description: `Too many requests`,
|
|
114
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
status: 500,
|
|
118
|
+
description: `An unexpected error occurred on the server`,
|
|
119
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
status: 509,
|
|
123
|
+
description: `Monthly describe jobs limit reached`,
|
|
124
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
method: "get",
|
|
130
|
+
path: "/describe/:job_id",
|
|
131
|
+
alias: "getDescribe",
|
|
132
|
+
description: `Retrieve the current state of a describe job`,
|
|
133
|
+
requestFormat: "json",
|
|
134
|
+
parameters: [
|
|
135
|
+
{
|
|
136
|
+
name: "job_id",
|
|
137
|
+
type: "Path",
|
|
138
|
+
schema: zod_1.z.string(),
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
response: Describe,
|
|
142
|
+
errors: [
|
|
143
|
+
{
|
|
144
|
+
status: 404,
|
|
145
|
+
description: `Job not found`,
|
|
146
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
status: 500,
|
|
150
|
+
description: `An unexpected error occurred on the server`,
|
|
151
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
]);
|
|
156
|
+
exports.DescribeApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
|
|
157
|
+
function createApiClient(baseUrl, options) {
|
|
158
|
+
return new core_1.Zodios(baseUrl, endpoints, options);
|
|
159
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { type ZodiosOptions } from "@zodios/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
type SearchResponse = {
|
|
4
|
+
object: "search";
|
|
5
|
+
query: string;
|
|
6
|
+
scope: "file" | "segment";
|
|
7
|
+
results: Array<FileSearchResult | SegmentSearchResult>;
|
|
8
|
+
total: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
};
|
|
11
|
+
type SearchRequest = {
|
|
12
|
+
scope: "file" | "segment";
|
|
13
|
+
collections: Array<string>;
|
|
14
|
+
query: string;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
filter?: SearchFilter | undefined;
|
|
17
|
+
};
|
|
18
|
+
type FileSearchResult = {
|
|
19
|
+
type: "file";
|
|
20
|
+
file_id: string;
|
|
21
|
+
collection_id: string;
|
|
22
|
+
id: string;
|
|
23
|
+
score: number;
|
|
24
|
+
filename?: (string | null) | undefined;
|
|
25
|
+
summary?: (string | null) | undefined;
|
|
26
|
+
generated_title?: (string | null) | undefined;
|
|
27
|
+
};
|
|
28
|
+
type SegmentSearchResult = {
|
|
29
|
+
type: "segment";
|
|
30
|
+
file_id: string;
|
|
31
|
+
collection_id: string;
|
|
32
|
+
segment_id: string;
|
|
33
|
+
id: string;
|
|
34
|
+
score: number;
|
|
35
|
+
start_time: number;
|
|
36
|
+
end_time: number;
|
|
37
|
+
title?: (string | null) | undefined;
|
|
38
|
+
filename?: (string | null) | undefined;
|
|
39
|
+
visual_description?: Array<Partial<{
|
|
40
|
+
text: string;
|
|
41
|
+
start_time: number;
|
|
42
|
+
end_time: number;
|
|
43
|
+
}>> | undefined;
|
|
44
|
+
scene_text?: Array<Partial<{
|
|
45
|
+
text: string;
|
|
46
|
+
start_time: number;
|
|
47
|
+
end_time: number;
|
|
48
|
+
}>> | undefined;
|
|
49
|
+
speech?: Array<Partial<{
|
|
50
|
+
text: string;
|
|
51
|
+
start_time: number;
|
|
52
|
+
end_time: number;
|
|
53
|
+
}>> | undefined;
|
|
54
|
+
};
|
|
55
|
+
type SearchFilter = Partial<{
|
|
56
|
+
metadata: Array<SearchFilterCriteria>;
|
|
57
|
+
video_info: Array<SearchFilterCriteria & Partial<{
|
|
58
|
+
path: "duration_seconds" | "has_audio";
|
|
59
|
+
}>>;
|
|
60
|
+
file: Array<SearchFilterCriteria & Partial<{
|
|
61
|
+
path: "bytes" | "filename" | "uri" | "created_at" | "id";
|
|
62
|
+
}>>;
|
|
63
|
+
}>;
|
|
64
|
+
type SearchFilterCriteria = {
|
|
65
|
+
path: string;
|
|
66
|
+
operator: "NotEqual" | "Equal" | "LessThan" | "GreaterThan" | "ContainsAny" | "ContainsAll" | "In";
|
|
67
|
+
valueText?: string | undefined;
|
|
68
|
+
valueTextArray?: Array<string> | undefined;
|
|
69
|
+
};
|
|
70
|
+
declare const SearchFilterCriteria: z.ZodType<SearchFilterCriteria>;
|
|
71
|
+
declare const SearchFilter: z.ZodType<SearchFilter>;
|
|
72
|
+
declare const SearchRequest: z.ZodType<SearchRequest>;
|
|
73
|
+
declare const FileSearchResult: z.ZodType<FileSearchResult>;
|
|
74
|
+
declare const SegmentSearchResult: z.ZodType<SegmentSearchResult>;
|
|
75
|
+
declare const SearchResponse: z.ZodType<SearchResponse>;
|
|
76
|
+
export declare const schemas: {
|
|
77
|
+
SearchFilterCriteria: z.ZodType<SearchFilterCriteria, z.ZodTypeDef, SearchFilterCriteria>;
|
|
78
|
+
SearchFilter: z.ZodType<Partial<{
|
|
79
|
+
metadata: Array<SearchFilterCriteria>;
|
|
80
|
+
video_info: Array<SearchFilterCriteria & Partial<{
|
|
81
|
+
path: "duration_seconds" | "has_audio";
|
|
82
|
+
}>>;
|
|
83
|
+
file: Array<SearchFilterCriteria & Partial<{
|
|
84
|
+
path: "bytes" | "filename" | "uri" | "created_at" | "id";
|
|
85
|
+
}>>;
|
|
86
|
+
}>, z.ZodTypeDef, Partial<{
|
|
87
|
+
metadata: Array<SearchFilterCriteria>;
|
|
88
|
+
video_info: Array<SearchFilterCriteria & Partial<{
|
|
89
|
+
path: "duration_seconds" | "has_audio";
|
|
90
|
+
}>>;
|
|
91
|
+
file: Array<SearchFilterCriteria & Partial<{
|
|
92
|
+
path: "bytes" | "filename" | "uri" | "created_at" | "id";
|
|
93
|
+
}>>;
|
|
94
|
+
}>>;
|
|
95
|
+
SearchRequest: z.ZodType<SearchRequest, z.ZodTypeDef, SearchRequest>;
|
|
96
|
+
FileSearchResult: z.ZodType<FileSearchResult, z.ZodTypeDef, FileSearchResult>;
|
|
97
|
+
SegmentSearchResult: z.ZodType<SegmentSearchResult, z.ZodTypeDef, SegmentSearchResult>;
|
|
98
|
+
SearchResponse: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
99
|
+
};
|
|
100
|
+
export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
|
|
101
|
+
method: "post";
|
|
102
|
+
path: "/search";
|
|
103
|
+
alias: "searchContent";
|
|
104
|
+
description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.\n\n**Important:** Currently only rich-transcript collections support search. For file-level search (scope='file'), the collection must be configured with 'enable_summary: true' in the transcribe_config.";
|
|
105
|
+
requestFormat: "json";
|
|
106
|
+
parameters: [{
|
|
107
|
+
name: "body";
|
|
108
|
+
description: string;
|
|
109
|
+
type: "Body";
|
|
110
|
+
schema: z.ZodType<SearchRequest, z.ZodTypeDef, SearchRequest>;
|
|
111
|
+
}];
|
|
112
|
+
response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
113
|
+
errors: [{
|
|
114
|
+
status: 400;
|
|
115
|
+
description: string;
|
|
116
|
+
schema: z.ZodObject<{
|
|
117
|
+
error: z.ZodString;
|
|
118
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
119
|
+
error: z.ZodString;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
121
|
+
error: z.ZodString;
|
|
122
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
123
|
+
}, {
|
|
124
|
+
status: 404;
|
|
125
|
+
description: string;
|
|
126
|
+
schema: z.ZodObject<{
|
|
127
|
+
error: z.ZodString;
|
|
128
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
129
|
+
error: z.ZodString;
|
|
130
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
131
|
+
error: z.ZodString;
|
|
132
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
133
|
+
}, {
|
|
134
|
+
status: 500;
|
|
135
|
+
description: string;
|
|
136
|
+
schema: z.ZodObject<{
|
|
137
|
+
error: z.ZodString;
|
|
138
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
139
|
+
error: z.ZodString;
|
|
140
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
141
|
+
error: z.ZodString;
|
|
142
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
143
|
+
}];
|
|
144
|
+
}]>;
|
|
145
|
+
export declare function createApiClient(baseUrl: string, options?: ZodiosOptions): import("@zodios/core").ZodiosInstance<[{
|
|
146
|
+
method: "post";
|
|
147
|
+
path: "/search";
|
|
148
|
+
alias: "searchContent";
|
|
149
|
+
description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.\n\n**Important:** Currently only rich-transcript collections support search. For file-level search (scope='file'), the collection must be configured with 'enable_summary: true' in the transcribe_config.";
|
|
150
|
+
requestFormat: "json";
|
|
151
|
+
parameters: [{
|
|
152
|
+
name: "body";
|
|
153
|
+
description: string;
|
|
154
|
+
type: "Body";
|
|
155
|
+
schema: z.ZodType<SearchRequest, z.ZodTypeDef, SearchRequest>;
|
|
156
|
+
}];
|
|
157
|
+
response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
158
|
+
errors: [{
|
|
159
|
+
status: 400;
|
|
160
|
+
description: string;
|
|
161
|
+
schema: z.ZodObject<{
|
|
162
|
+
error: z.ZodString;
|
|
163
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
164
|
+
error: z.ZodString;
|
|
165
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
166
|
+
error: z.ZodString;
|
|
167
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
168
|
+
}, {
|
|
169
|
+
status: 404;
|
|
170
|
+
description: string;
|
|
171
|
+
schema: z.ZodObject<{
|
|
172
|
+
error: z.ZodString;
|
|
173
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
174
|
+
error: z.ZodString;
|
|
175
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
176
|
+
error: z.ZodString;
|
|
177
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
178
|
+
}, {
|
|
179
|
+
status: 500;
|
|
180
|
+
description: string;
|
|
181
|
+
schema: z.ZodObject<{
|
|
182
|
+
error: z.ZodString;
|
|
183
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
184
|
+
error: z.ZodString;
|
|
185
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
186
|
+
error: z.ZodString;
|
|
187
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
188
|
+
}];
|
|
189
|
+
}]>;
|
|
190
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchApi = exports.schemas = void 0;
|
|
4
|
+
exports.createApiClient = createApiClient;
|
|
5
|
+
const core_1 = require("@zodios/core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const SearchFilterCriteria = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
path: zod_1.z.string(),
|
|
10
|
+
operator: zod_1.z.enum([
|
|
11
|
+
"NotEqual",
|
|
12
|
+
"Equal",
|
|
13
|
+
"LessThan",
|
|
14
|
+
"GreaterThan",
|
|
15
|
+
"ContainsAny",
|
|
16
|
+
"ContainsAll",
|
|
17
|
+
"In",
|
|
18
|
+
]),
|
|
19
|
+
valueText: zod_1.z.string().optional(),
|
|
20
|
+
valueTextArray: zod_1.z.array(zod_1.z.string()).optional(),
|
|
21
|
+
})
|
|
22
|
+
.strict()
|
|
23
|
+
.passthrough();
|
|
24
|
+
const SearchFilter = zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
metadata: zod_1.z.array(SearchFilterCriteria),
|
|
27
|
+
video_info: zod_1.z.array(SearchFilterCriteria.and(zod_1.z
|
|
28
|
+
.object({ path: zod_1.z.enum(["duration_seconds", "has_audio"]) })
|
|
29
|
+
.partial()
|
|
30
|
+
.strict()
|
|
31
|
+
.passthrough())),
|
|
32
|
+
file: zod_1.z.array(SearchFilterCriteria.and(zod_1.z
|
|
33
|
+
.object({
|
|
34
|
+
path: zod_1.z.enum(["bytes", "filename", "uri", "created_at", "id"]),
|
|
35
|
+
})
|
|
36
|
+
.partial()
|
|
37
|
+
.strict()
|
|
38
|
+
.passthrough())),
|
|
39
|
+
})
|
|
40
|
+
.partial()
|
|
41
|
+
.strict()
|
|
42
|
+
.passthrough();
|
|
43
|
+
const SearchRequest = zod_1.z
|
|
44
|
+
.object({
|
|
45
|
+
scope: zod_1.z.enum(["file", "segment"]),
|
|
46
|
+
collections: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
47
|
+
query: zod_1.z.string().min(1),
|
|
48
|
+
limit: zod_1.z.number().int().gte(1).lte(100).optional().default(10),
|
|
49
|
+
filter: SearchFilter.optional(),
|
|
50
|
+
})
|
|
51
|
+
.strict()
|
|
52
|
+
.passthrough();
|
|
53
|
+
const FileSearchResult = zod_1.z
|
|
54
|
+
.object({
|
|
55
|
+
type: zod_1.z.literal("file"),
|
|
56
|
+
file_id: zod_1.z.string().uuid(),
|
|
57
|
+
collection_id: zod_1.z.string().uuid(),
|
|
58
|
+
id: zod_1.z.string().uuid(),
|
|
59
|
+
score: zod_1.z.number().gte(0).lte(1),
|
|
60
|
+
filename: zod_1.z.string().nullish(),
|
|
61
|
+
summary: zod_1.z.string().nullish(),
|
|
62
|
+
generated_title: zod_1.z.string().nullish(),
|
|
63
|
+
})
|
|
64
|
+
.strict()
|
|
65
|
+
.passthrough();
|
|
66
|
+
const SegmentSearchResult = zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
type: zod_1.z.literal("segment"),
|
|
69
|
+
file_id: zod_1.z.string().uuid(),
|
|
70
|
+
collection_id: zod_1.z.string().uuid(),
|
|
71
|
+
segment_id: zod_1.z.string().uuid(),
|
|
72
|
+
id: zod_1.z.string().uuid(),
|
|
73
|
+
score: zod_1.z.number().gte(0).lte(1),
|
|
74
|
+
start_time: zod_1.z.number(),
|
|
75
|
+
end_time: zod_1.z.number(),
|
|
76
|
+
title: zod_1.z.string().nullish(),
|
|
77
|
+
filename: zod_1.z.string().nullish(),
|
|
78
|
+
visual_description: zod_1.z
|
|
79
|
+
.array(zod_1.z
|
|
80
|
+
.object({
|
|
81
|
+
text: zod_1.z.string(),
|
|
82
|
+
start_time: zod_1.z.number(),
|
|
83
|
+
end_time: zod_1.z.number(),
|
|
84
|
+
})
|
|
85
|
+
.partial()
|
|
86
|
+
.strict()
|
|
87
|
+
.passthrough())
|
|
88
|
+
.optional(),
|
|
89
|
+
scene_text: zod_1.z
|
|
90
|
+
.array(zod_1.z
|
|
91
|
+
.object({
|
|
92
|
+
text: zod_1.z.string(),
|
|
93
|
+
start_time: zod_1.z.number(),
|
|
94
|
+
end_time: zod_1.z.number(),
|
|
95
|
+
})
|
|
96
|
+
.partial()
|
|
97
|
+
.strict()
|
|
98
|
+
.passthrough())
|
|
99
|
+
.optional(),
|
|
100
|
+
speech: zod_1.z
|
|
101
|
+
.array(zod_1.z
|
|
102
|
+
.object({
|
|
103
|
+
text: zod_1.z.string(),
|
|
104
|
+
start_time: zod_1.z.number(),
|
|
105
|
+
end_time: zod_1.z.number(),
|
|
106
|
+
})
|
|
107
|
+
.partial()
|
|
108
|
+
.strict()
|
|
109
|
+
.passthrough())
|
|
110
|
+
.optional(),
|
|
111
|
+
})
|
|
112
|
+
.strict()
|
|
113
|
+
.passthrough();
|
|
114
|
+
const SearchResponse = zod_1.z
|
|
115
|
+
.object({
|
|
116
|
+
object: zod_1.z.literal("search"),
|
|
117
|
+
query: zod_1.z.string(),
|
|
118
|
+
scope: zod_1.z.enum(["file", "segment"]),
|
|
119
|
+
results: zod_1.z.array(zod_1.z.union([FileSearchResult, SegmentSearchResult])),
|
|
120
|
+
total: zod_1.z.number().int(),
|
|
121
|
+
limit: zod_1.z.number().int(),
|
|
122
|
+
})
|
|
123
|
+
.strict()
|
|
124
|
+
.passthrough();
|
|
125
|
+
exports.schemas = {
|
|
126
|
+
SearchFilterCriteria,
|
|
127
|
+
SearchFilter,
|
|
128
|
+
SearchRequest,
|
|
129
|
+
FileSearchResult,
|
|
130
|
+
SegmentSearchResult,
|
|
131
|
+
SearchResponse,
|
|
132
|
+
};
|
|
133
|
+
const endpoints = (0, core_1.makeApi)([
|
|
134
|
+
{
|
|
135
|
+
method: "post",
|
|
136
|
+
path: "/search",
|
|
137
|
+
alias: "searchContent",
|
|
138
|
+
description: `Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.
|
|
139
|
+
|
|
140
|
+
**Important:** Currently only rich-transcript collections support search. For file-level search (scope='file'), the collection must be configured with 'enable_summary: true' in the transcribe_config.`,
|
|
141
|
+
requestFormat: "json",
|
|
142
|
+
parameters: [
|
|
143
|
+
{
|
|
144
|
+
name: "body",
|
|
145
|
+
description: `Search parameters`,
|
|
146
|
+
type: "Body",
|
|
147
|
+
schema: SearchRequest,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
response: SearchResponse,
|
|
151
|
+
errors: [
|
|
152
|
+
{
|
|
153
|
+
status: 400,
|
|
154
|
+
description: `Invalid request parameters`,
|
|
155
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
status: 404,
|
|
159
|
+
description: `Collection not found`,
|
|
160
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
status: 500,
|
|
164
|
+
description: `An unexpected error occurred on the server`,
|
|
165
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
]);
|
|
170
|
+
exports.SearchApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
|
|
171
|
+
function createApiClient(baseUrl, options) {
|
|
172
|
+
return new core_1.Zodios(baseUrl, endpoints, options);
|
|
173
|
+
}
|
package/dist/src/client.d.ts
CHANGED
|
@@ -474,6 +474,27 @@ declare class EnhancedCollectionsApi {
|
|
|
474
474
|
id: import("zod").ZodString;
|
|
475
475
|
object: import("zod").ZodLiteral<"collection">;
|
|
476
476
|
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
477
|
+
addVideoByUrl({ collectionId, url, params }: {
|
|
478
|
+
collectionId: string;
|
|
479
|
+
url: string;
|
|
480
|
+
params: {
|
|
481
|
+
segmentation_config?: SegmentationConfig;
|
|
482
|
+
metadata?: Record<string, any>;
|
|
483
|
+
};
|
|
484
|
+
}): Promise<{
|
|
485
|
+
collection_id: string;
|
|
486
|
+
file_id: string;
|
|
487
|
+
object: "collection_file";
|
|
488
|
+
added_at: number;
|
|
489
|
+
status: "pending" | "processing" | "completed" | "failed" | "not_applicable";
|
|
490
|
+
file?: File | undefined;
|
|
491
|
+
segmentation?: {
|
|
492
|
+
id: string;
|
|
493
|
+
status: "pending" | "processing" | "completed" | "failed" | "not_applicable";
|
|
494
|
+
file_id: string;
|
|
495
|
+
segmentation_config: import("../generated/common").SegmentationConfig;
|
|
496
|
+
} | undefined;
|
|
497
|
+
}>;
|
|
477
498
|
addVideo(collectionId: string, fileId: string, params?: {
|
|
478
499
|
segmentation_config?: SegmentationConfig;
|
|
479
500
|
metadata?: Record<string, any>;
|
|
@@ -594,6 +615,9 @@ declare class EnhancedCollectionsApi {
|
|
|
594
615
|
end_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
595
616
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
596
617
|
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
618
|
+
/**
|
|
619
|
+
* @deprecated Use addVideoByUrl instead
|
|
620
|
+
*/
|
|
597
621
|
addYouTubeVideo(collectionId: string, url: string, params?: {
|
|
598
622
|
metadata?: Record<string, any>;
|
|
599
623
|
segmentation_config?: SegmentationConfig;
|
package/dist/src/client.js
CHANGED
|
@@ -117,6 +117,9 @@ class EnhancedCollectionsApi {
|
|
|
117
117
|
async deleteCollection(collectionId) {
|
|
118
118
|
return this.api.deleteCollection(undefined, { params: { collection_id: collectionId } });
|
|
119
119
|
}
|
|
120
|
+
async addVideoByUrl({ collectionId, url, params }) {
|
|
121
|
+
return this.api.addVideo({ url, ...params }, { params: { collection_id: collectionId, ...params } });
|
|
122
|
+
}
|
|
120
123
|
async addVideo(collectionId, fileId, params = {}) {
|
|
121
124
|
return this.api.addVideo({ file_id: fileId, ...params }, { params: { collection_id: collectionId, ...params } });
|
|
122
125
|
}
|
|
@@ -145,6 +148,9 @@ class EnhancedCollectionsApi {
|
|
|
145
148
|
queries: { limit, offset, response_format },
|
|
146
149
|
});
|
|
147
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* @deprecated Use addVideoByUrl instead
|
|
153
|
+
*/
|
|
148
154
|
async addYouTubeVideo(collectionId, url, params = {}) {
|
|
149
155
|
return this.api.addYouTubeVideo({ url, ...params }, { params: { collection_id: collectionId, ...params } });
|
|
150
156
|
}
|
|
@@ -323,7 +329,7 @@ class CloudGlue {
|
|
|
323
329
|
headers: {
|
|
324
330
|
Authorization: `Bearer ${this.apiKey}`,
|
|
325
331
|
'x-sdk-client': 'cloudglue-js',
|
|
326
|
-
'x-sdk-version': '0.1.
|
|
332
|
+
'x-sdk-version': '0.1.4',
|
|
327
333
|
},
|
|
328
334
|
baseURL: this.baseUrl,
|
|
329
335
|
timeout: this.timeout,
|