@aviaryhq/cloudglue-js 0.1.4 → 0.1.5

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.
@@ -8,7 +8,7 @@ type Collection = {
8
8
  object: "collection";
9
9
  name: string;
10
10
  description?: (string | null) | undefined;
11
- collection_type: "entities" | "rich-transcripts";
11
+ collection_type: "entities" | "rich-transcripts" | "media-descriptions";
12
12
  extract_config?: Partial<{
13
13
  prompt: string;
14
14
  schema: {};
@@ -2044,7 +2044,7 @@ export declare const CollectionsApi: import("@zodios/core").ZodiosInstance<[{
2044
2044
  }, {
2045
2045
  name: "collection_type";
2046
2046
  type: "Query";
2047
- schema: z.ZodOptional<z.ZodEnum<["entities", "rich-transcripts"]>>;
2047
+ schema: z.ZodOptional<z.ZodEnum<["entities", "rich-transcripts", "media-descriptions"]>>;
2048
2048
  }];
2049
2049
  response: z.ZodType<CollectionList, z.ZodTypeDef, CollectionList>;
2050
2050
  errors: [{
@@ -4534,7 +4534,7 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
4534
4534
  }, {
4535
4535
  name: "collection_type";
4536
4536
  type: "Query";
4537
- schema: z.ZodOptional<z.ZodEnum<["entities", "rich-transcripts"]>>;
4537
+ schema: z.ZodOptional<z.ZodEnum<["entities", "rich-transcripts", "media-descriptions"]>>;
4538
4538
  }];
4539
4539
  response: z.ZodType<CollectionList, z.ZodTypeDef, CollectionList>;
4540
4540
  errors: [{
@@ -13,7 +13,11 @@ const Collection = zod_1.z
13
13
  object: zod_1.z.literal("collection"),
14
14
  name: zod_1.z.string(),
15
15
  description: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(),
16
- collection_type: zod_1.z.enum(["entities", "rich-transcripts"]),
16
+ collection_type: zod_1.z.enum([
17
+ "entities",
18
+ "rich-transcripts",
19
+ "media-descriptions",
20
+ ]),
17
21
  extract_config: zod_1.z
18
22
  .object({
19
23
  prompt: zod_1.z.string(),
@@ -381,7 +385,9 @@ const endpoints = (0, core_1.makeApi)([
381
385
  {
382
386
  name: "collection_type",
383
387
  type: "Query",
384
- schema: zod_1.z.enum(["entities", "rich-transcripts"]).optional(),
388
+ schema: zod_1.z
389
+ .enum(["entities", "rich-transcripts", "media-descriptions"])
390
+ .optional(),
385
391
  },
386
392
  ],
387
393
  response: CollectionList,
@@ -4,4 +4,5 @@ export { CollectionsApi } from "./Collections";
4
4
  export { ChatApi } from "./Chat";
5
5
  export { TranscribeApi } from "./Transcribe";
6
6
  export { WebhooksApi } from "./Webhooks";
7
+ export { SearchApi } from "./Search";
7
8
  export { SegmentationsApi } from "./Segmentations";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SegmentationsApi = exports.WebhooksApi = exports.TranscribeApi = exports.ChatApi = exports.CollectionsApi = exports.FilesApi = exports.ExtractApi = void 0;
3
+ exports.SegmentationsApi = exports.SearchApi = exports.WebhooksApi = exports.TranscribeApi = exports.ChatApi = exports.CollectionsApi = exports.FilesApi = exports.ExtractApi = void 0;
4
4
  var Extract_1 = require("./Extract");
5
5
  Object.defineProperty(exports, "ExtractApi", { enumerable: true, get: function () { return Extract_1.ExtractApi; } });
6
6
  var Files_1 = require("./Files");
@@ -13,5 +13,7 @@ var Transcribe_1 = require("./Transcribe");
13
13
  Object.defineProperty(exports, "TranscribeApi", { enumerable: true, get: function () { return Transcribe_1.TranscribeApi; } });
14
14
  var Webhooks_1 = require("./Webhooks");
15
15
  Object.defineProperty(exports, "WebhooksApi", { enumerable: true, get: function () { return Webhooks_1.WebhooksApi; } });
16
+ var Search_1 = require("./Search");
17
+ Object.defineProperty(exports, "SearchApi", { enumerable: true, get: function () { return Search_1.SearchApi; } });
16
18
  var Segmentations_1 = require("./Segmentations");
17
19
  Object.defineProperty(exports, "SegmentationsApi", { enumerable: true, get: function () { return Segmentations_1.SegmentationsApi; } });
@@ -1,4 +1,4 @@
1
- import { FilesApi, CollectionsApi, ChatApi, TranscribeApi, ExtractApi } from "../generated";
1
+ import { FilesApi, CollectionsApi, ChatApi, TranscribeApi, ExtractApi, SearchApi } from "../generated";
2
2
  import type { File, SegmentationConfig, UpdateFileParams } from "./types";
3
3
  import { SegmentationsApi } from "../generated/Segmentations";
4
4
  export declare class CloudGlueError extends Error {
@@ -117,6 +117,32 @@ interface ChatCompletionParams {
117
117
  top_p?: number;
118
118
  max_tokens?: number;
119
119
  }
120
+ interface SearchParams {
121
+ scope: "file" | "segment";
122
+ collections: string[];
123
+ query: string;
124
+ limit?: number;
125
+ filter?: {
126
+ metadata?: Array<{
127
+ path: string;
128
+ operator: "NotEqual" | "Equal" | "LessThan" | "GreaterThan" | "ContainsAny" | "ContainsAll" | "In";
129
+ valueText?: string;
130
+ valueTextArray?: string[];
131
+ }>;
132
+ video_info?: Array<{
133
+ path: "duration_seconds" | "has_audio";
134
+ operator: "NotEqual" | "Equal" | "LessThan" | "GreaterThan" | "ContainsAny" | "ContainsAll" | "In";
135
+ valueText?: string;
136
+ valueTextArray?: string[];
137
+ }>;
138
+ file?: Array<{
139
+ path: "bytes" | "filename" | "uri" | "created_at" | "id";
140
+ operator: "NotEqual" | "Equal" | "LessThan" | "GreaterThan" | "ContainsAny" | "ContainsAll" | "In";
141
+ valueText?: string;
142
+ valueTextArray?: string[];
143
+ }>;
144
+ };
145
+ }
120
146
  interface WaitForReadyOptions {
121
147
  /** Interval in milliseconds between polling attempts. Defaults to 5000ms (5 seconds). */
122
148
  pollingInterval?: number;
@@ -405,7 +431,7 @@ declare class EnhancedCollectionsApi {
405
431
  object: "collection";
406
432
  name: string;
407
433
  description?: (string | null) | undefined;
408
- collection_type: "entities" | "rich-transcripts";
434
+ collection_type: "entities" | "rich-transcripts" | "media-descriptions";
409
435
  extract_config?: Partial<{
410
436
  prompt: string;
411
437
  schema: {};
@@ -431,7 +457,7 @@ declare class EnhancedCollectionsApi {
431
457
  object: "collection";
432
458
  name: string;
433
459
  description?: (string | null) | undefined;
434
- collection_type: "entities" | "rich-transcripts";
460
+ collection_type: "entities" | "rich-transcripts" | "media-descriptions";
435
461
  extract_config?: Partial<{
436
462
  prompt: string;
437
463
  schema: {};
@@ -453,7 +479,7 @@ declare class EnhancedCollectionsApi {
453
479
  object: "collection";
454
480
  name: string;
455
481
  description?: (string | null) | undefined;
456
- collection_type: "entities" | "rich-transcripts";
482
+ collection_type: "entities" | "rich-transcripts" | "media-descriptions";
457
483
  extract_config?: Partial<{
458
484
  prompt: string;
459
485
  schema: {};
@@ -1712,6 +1738,53 @@ declare class EnhancedSegmentationsApi {
1712
1738
  id: import("zod").ZodString;
1713
1739
  }, import("zod").ZodTypeAny, "passthrough">>;
1714
1740
  }
1741
+ declare class EnhancedSearchApi {
1742
+ private readonly api;
1743
+ constructor(api: typeof SearchApi);
1744
+ searchContent(params: SearchParams): Promise<{
1745
+ object: "search";
1746
+ query: string;
1747
+ scope: "file" | "segment";
1748
+ results: Array<{
1749
+ type: "file";
1750
+ file_id: string;
1751
+ collection_id: string;
1752
+ id: string;
1753
+ score: number;
1754
+ filename?: (string | null) | undefined;
1755
+ summary?: (string | null) | undefined;
1756
+ generated_title?: (string | null) | undefined;
1757
+ } | {
1758
+ type: "segment";
1759
+ file_id: string;
1760
+ collection_id: string;
1761
+ segment_id: string;
1762
+ id: string;
1763
+ score: number;
1764
+ start_time: number;
1765
+ end_time: number;
1766
+ title?: (string | null) | undefined;
1767
+ filename?: (string | null) | undefined;
1768
+ visual_description?: Array<Partial<{
1769
+ text: string;
1770
+ start_time: number;
1771
+ end_time: number;
1772
+ }>> | undefined;
1773
+ scene_text?: Array<Partial<{
1774
+ text: string;
1775
+ start_time: number;
1776
+ end_time: number;
1777
+ }>> | undefined;
1778
+ speech?: Array<Partial<{
1779
+ text: string;
1780
+ start_time: number;
1781
+ end_time: number;
1782
+ }>> | undefined;
1783
+ }>;
1784
+ total: number;
1785
+ limit: number;
1786
+ }>;
1787
+ }
1715
1788
  /**
1716
1789
  * Main CloudGlue client class that provides access to all API functionality
1717
1790
  * through enhanced, user-friendly interfaces
@@ -1750,6 +1823,11 @@ export declare class CloudGlue {
1750
1823
  * Provides methods for segmenting videos into shots
1751
1824
  */
1752
1825
  readonly segmentations: EnhancedSegmentationsApi;
1826
+ /**
1827
+ * Search API for searching video content
1828
+ * Provides methods for searching videos and video segments in collections
1829
+ */
1830
+ readonly search: EnhancedSearchApi;
1753
1831
  constructor(config?: CloudGlueConfig);
1754
1832
  }
1755
1833
  export {};
@@ -7,6 +7,7 @@ const Chat_1 = require("../generated/Chat");
7
7
  const Transcribe_1 = require("../generated/Transcribe");
8
8
  const Extract_1 = require("../generated/Extract");
9
9
  const Segmentations_1 = require("../generated/Segmentations");
10
+ const Search_1 = require("../generated/Search");
10
11
  class CloudGlueError extends Error {
11
12
  constructor(message, statusCode, data, headers, responseData) {
12
13
  super(message);
@@ -313,6 +314,14 @@ class EnhancedSegmentationsApi {
313
314
  });
314
315
  }
315
316
  }
317
+ class EnhancedSearchApi {
318
+ constructor(api) {
319
+ this.api = api;
320
+ }
321
+ async searchContent(params) {
322
+ return this.api.searchContent(params);
323
+ }
324
+ }
316
325
  /**
317
326
  * Main CloudGlue client class that provides access to all API functionality
318
327
  * through enhanced, user-friendly interfaces
@@ -329,7 +338,7 @@ class CloudGlue {
329
338
  headers: {
330
339
  Authorization: `Bearer ${this.apiKey}`,
331
340
  'x-sdk-client': 'cloudglue-js',
332
- 'x-sdk-version': '0.1.4',
341
+ 'x-sdk-version': '0.1.5',
333
342
  },
334
343
  baseURL: this.baseUrl,
335
344
  timeout: this.timeout,
@@ -347,8 +356,9 @@ class CloudGlue {
347
356
  const transcribeApi = (0, Transcribe_1.createApiClient)(this.baseUrl, sharedConfig);
348
357
  const extractApi = (0, Extract_1.createApiClient)(this.baseUrl, sharedConfig);
349
358
  const segmentationsApi = (0, Segmentations_1.createApiClient)(this.baseUrl, sharedConfig);
359
+ const searchApi = (0, Search_1.createApiClient)(this.baseUrl, sharedConfig);
350
360
  // Configure base URL and axios config for all clients
351
- [filesApi, collectionsApi, chatApi, transcribeApi, extractApi, segmentationsApi].forEach((client) => {
361
+ [filesApi, collectionsApi, chatApi, transcribeApi, extractApi, segmentationsApi, searchApi].forEach((client) => {
352
362
  Object.assign(client.axios.defaults, axiosConfig);
353
363
  client.axios.interceptors.response.use((response) => {
354
364
  return response;
@@ -370,6 +380,7 @@ class CloudGlue {
370
380
  this.transcribe = new EnhancedTranscribeApi(transcribeApi);
371
381
  this.extract = new EnhancedExtractApi(extractApi);
372
382
  this.segmentations = new EnhancedSegmentationsApi(segmentationsApi);
383
+ this.search = new EnhancedSearchApi(searchApi);
373
384
  }
374
385
  }
375
386
  exports.CloudGlue = CloudGlue;
@@ -3,6 +3,7 @@ import { schemas as collectionsSchemas } from '../generated/Collections';
3
3
  import { schemas as chatSchemas } from '../generated/Chat';
4
4
  import { schemas as transcribeSchemas } from '../generated/Transcribe';
5
5
  import { schemas as extractSchemas } from '../generated/Extract';
6
+ import { schemas as searchSchemas } from '../generated/Search';
6
7
  import { SegmentationUniformConfig as SegmentationUniformConfigType, SegmentationShotDetectorConfig as SegmentationShotDetectorConfigType, SegmentationConfig as SegmentationConfigType } from '../generated/common';
7
8
  /**
8
9
  * Represents a video file in the Cloudglue system
@@ -101,3 +102,28 @@ export type SegmentationUniformConfig = z.infer<typeof SegmentationUniformConfig
101
102
  */
102
103
  export type SegmentationShotDetectorConfig = z.infer<typeof SegmentationShotDetectorConfigType>;
103
104
  export type SegmentationConfig = z.infer<typeof SegmentationConfigType>;
105
+ /**
106
+ * Represents a search request for finding videos or video segments
107
+ */
108
+ export type SearchRequest = z.infer<typeof searchSchemas.SearchRequest>;
109
+ /**
110
+ * Represents the response from a search request
111
+ * Contains search results with file or segment matches
112
+ */
113
+ export type SearchResponse = z.infer<typeof searchSchemas.SearchResponse>;
114
+ /**
115
+ * Represents a file-level search result
116
+ */
117
+ export type FileSearchResult = z.infer<typeof searchSchemas.FileSearchResult>;
118
+ /**
119
+ * Represents a segment-level search result
120
+ */
121
+ export type SegmentSearchResult = z.infer<typeof searchSchemas.SegmentSearchResult>;
122
+ /**
123
+ * Represents search filter criteria for filtering results
124
+ */
125
+ export type SearchFilterCriteria = z.infer<typeof searchSchemas.SearchFilterCriteria>;
126
+ /**
127
+ * Represents search filter options for metadata, video info, and file properties
128
+ */
129
+ export type SearchFilter = z.infer<typeof searchSchemas.SearchFilter>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaryhq/cloudglue-js",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Cloudglue API client for Node.js",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",