@aviaryhq/cloudglue-js 0.4.3 → 0.4.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.
@@ -5,8 +5,9 @@ type SearchResponse = {
5
5
  object: "search";
6
6
  query?: string | undefined;
7
7
  scope: "file" | "segment" | "face";
8
- search_target?: ("file" | "segment") | undefined;
9
- results: Array<FileSearchResult | SegmentSearchResult | FaceSearchResult>;
8
+ group_by_key?: "file" | undefined;
9
+ group_count?: number | undefined;
10
+ results: Array<FileSearchResult | SegmentSearchResult | FaceSearchResult | SegmentGroupResult | FaceGroupResult>;
10
11
  total: number;
11
12
  limit: number;
12
13
  };
@@ -66,6 +67,20 @@ type FaceSearchResult = {
66
67
  } | undefined;
67
68
  thumbnail_url?: string | undefined;
68
69
  };
70
+ type SegmentGroupResult = {
71
+ type: "segment_group";
72
+ matched_items: Array<SegmentSearchResult>;
73
+ file_id: string;
74
+ item_count: number;
75
+ best_score: number;
76
+ };
77
+ type FaceGroupResult = {
78
+ type: "face_group";
79
+ matched_items: Array<FaceSearchResult>;
80
+ file_id: string;
81
+ item_count: number;
82
+ best_score: number;
83
+ };
69
84
  type SearchFilter = Partial<{
70
85
  metadata: Array<SearchFilterCriteria>;
71
86
  video_info: Array<SearchFilterCriteria & Partial<{
@@ -86,6 +101,8 @@ declare const SearchFilter: z.ZodType<SearchFilter>;
86
101
  declare const FileSearchResult: z.ZodType<FileSearchResult>;
87
102
  declare const SegmentSearchResult: z.ZodType<SegmentSearchResult>;
88
103
  declare const FaceSearchResult: z.ZodType<FaceSearchResult>;
104
+ declare const SegmentGroupResult: z.ZodType<SegmentGroupResult>;
105
+ declare const FaceGroupResult: z.ZodType<FaceGroupResult>;
89
106
  declare const SearchResponse: z.ZodType<SearchResponse>;
90
107
  export declare const schemas: {
91
108
  SearchFilterCriteria: z.ZodType<SearchFilterCriteria, z.ZodTypeDef, SearchFilterCriteria>;
@@ -116,6 +133,9 @@ export declare const schemas: {
116
133
  }>;
117
134
  limit: number;
118
135
  filter: SearchFilter;
136
+ threshold: number;
137
+ group_by_key: "file";
138
+ sort_by: "score" | "item_count";
119
139
  }>, z.ZodTypeDef, Partial<{
120
140
  scope: "file" | "segment" | "face";
121
141
  collections: Array<string>;
@@ -126,10 +146,15 @@ export declare const schemas: {
126
146
  }>;
127
147
  limit: number;
128
148
  filter: SearchFilter;
149
+ threshold: number;
150
+ group_by_key: "file";
151
+ sort_by: "score" | "item_count";
129
152
  }>>;
130
153
  FileSearchResult: z.ZodType<FileSearchResult, z.ZodTypeDef, FileSearchResult>;
131
154
  SegmentSearchResult: z.ZodType<SegmentSearchResult, z.ZodTypeDef, SegmentSearchResult>;
132
155
  FaceSearchResult: z.ZodType<FaceSearchResult, z.ZodTypeDef, FaceSearchResult>;
156
+ SegmentGroupResult: z.ZodType<SegmentGroupResult, z.ZodTypeDef, SegmentGroupResult>;
157
+ FaceGroupResult: z.ZodType<FaceGroupResult, z.ZodTypeDef, FaceGroupResult>;
133
158
  SearchResponse: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
134
159
  };
135
160
  export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
@@ -152,6 +177,9 @@ export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
152
177
  }>;
153
178
  limit: number;
154
179
  filter: SearchFilter;
180
+ threshold: number;
181
+ group_by_key: "file";
182
+ sort_by: "score" | "item_count";
155
183
  }>, z.ZodTypeDef, Partial<{
156
184
  scope: "file" | "segment" | "face";
157
185
  collections: Array<string>;
@@ -162,6 +190,9 @@ export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
162
190
  }>;
163
191
  limit: number;
164
192
  filter: SearchFilter;
193
+ threshold: number;
194
+ group_by_key: "file";
195
+ sort_by: "score" | "item_count";
165
196
  }>>;
166
197
  }];
167
198
  response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
@@ -217,6 +248,9 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
217
248
  }>;
218
249
  limit: number;
219
250
  filter: SearchFilter;
251
+ threshold: number;
252
+ group_by_key: "file";
253
+ sort_by: "score" | "item_count";
220
254
  }>, z.ZodTypeDef, Partial<{
221
255
  scope: "file" | "segment" | "face";
222
256
  collections: Array<string>;
@@ -227,6 +261,9 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
227
261
  }>;
228
262
  limit: number;
229
263
  filter: SearchFilter;
264
+ threshold: number;
265
+ group_by_key: "file";
266
+ sort_by: "score" | "item_count";
230
267
  }>>;
231
268
  }];
232
269
  response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
@@ -53,6 +53,9 @@ const SearchRequest = zod_1.z
53
53
  .passthrough(),
54
54
  limit: zod_1.z.number().int().gte(1).lte(100).default(10),
55
55
  filter: SearchFilter,
56
+ threshold: zod_1.z.number(),
57
+ group_by_key: zod_1.z.literal("file"),
58
+ sort_by: zod_1.z.enum(["score", "item_count"]).default("score"),
56
59
  })
57
60
  .partial()
58
61
  .strict()
@@ -128,7 +131,7 @@ const FaceSearchResult = zod_1.z
128
131
  collection_id: zod_1.z.string().uuid(),
129
132
  face_id: zod_1.z.string().uuid(),
130
133
  frame_id: zod_1.z.string().uuid(),
131
- score: zod_1.z.number().gte(0).lte(100),
134
+ score: zod_1.z.number(),
132
135
  timestamp: zod_1.z.number().gte(0),
133
136
  face_bounding_box: zod_1.z
134
137
  .object({
@@ -144,14 +147,41 @@ const FaceSearchResult = zod_1.z
144
147
  })
145
148
  .strict()
146
149
  .passthrough();
150
+ const SegmentGroupResult = zod_1.z
151
+ .object({
152
+ type: zod_1.z.literal("segment_group"),
153
+ matched_items: zod_1.z.array(SegmentSearchResult),
154
+ file_id: zod_1.z.string().uuid(),
155
+ item_count: zod_1.z.number().int(),
156
+ best_score: zod_1.z.number(),
157
+ })
158
+ .strict()
159
+ .passthrough();
160
+ const FaceGroupResult = zod_1.z
161
+ .object({
162
+ type: zod_1.z.literal("face_group"),
163
+ matched_items: zod_1.z.array(FaceSearchResult),
164
+ file_id: zod_1.z.string().uuid(),
165
+ item_count: zod_1.z.number().int(),
166
+ best_score: zod_1.z.number(),
167
+ })
168
+ .strict()
169
+ .passthrough();
147
170
  const SearchResponse = zod_1.z
148
171
  .object({
149
172
  id: zod_1.z.string().uuid(),
150
173
  object: zod_1.z.literal("search"),
151
174
  query: zod_1.z.string().optional(),
152
175
  scope: zod_1.z.enum(["file", "segment", "face"]),
153
- search_target: zod_1.z.enum(["file", "segment"]).optional(),
154
- results: zod_1.z.array(zod_1.z.union([FileSearchResult, SegmentSearchResult, FaceSearchResult])),
176
+ group_by_key: zod_1.z.literal("file").optional(),
177
+ group_count: zod_1.z.number().int().optional(),
178
+ results: zod_1.z.array(zod_1.z.union([
179
+ FileSearchResult,
180
+ SegmentSearchResult,
181
+ FaceSearchResult,
182
+ SegmentGroupResult,
183
+ FaceGroupResult,
184
+ ])),
155
185
  total: zod_1.z.number().int(),
156
186
  limit: zod_1.z.number().int(),
157
187
  })
@@ -164,6 +194,8 @@ exports.schemas = {
164
194
  FileSearchResult,
165
195
  SegmentSearchResult,
166
196
  FaceSearchResult,
197
+ SegmentGroupResult,
198
+ FaceGroupResult,
167
199
  SearchResponse,
168
200
  };
169
201
  const endpoints = (0, core_1.makeApi)([