@aviaryhq/cloudglue-js 0.5.1 → 0.5.3

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.
@@ -32,8 +32,30 @@ type ChatMessage = {
32
32
  content: string;
33
33
  name?: string | undefined;
34
34
  };
35
+ type ChatCompletionList = {
36
+ object: 'list';
37
+ data: Array<{
38
+ id: string;
39
+ created: number;
40
+ object: 'chat.completion';
41
+ model: string;
42
+ usage: Partial<{
43
+ prompt_tokens: number;
44
+ completion_tokens: number;
45
+ total_tokens: number;
46
+ }>;
47
+ choices: Array<{
48
+ index: number;
49
+ message: ChatMessage;
50
+ }>;
51
+ }>;
52
+ total: number;
53
+ limit: number;
54
+ offset: number;
55
+ };
35
56
  declare const ChatMessage: z.ZodType<ChatMessage>;
36
57
  declare const ChatCompletionRequest: z.ZodType<ChatCompletionRequest>;
58
+ declare const ChatCompletionList: z.ZodType<ChatCompletionList>;
37
59
  export declare const schemas: {
38
60
  ChatMessage: z.ZodType<ChatMessage, z.ZodTypeDef, ChatMessage>;
39
61
  ChatCompletionRequest: z.ZodType<ChatCompletionRequest, z.ZodTypeDef, ChatCompletionRequest>;
@@ -90,6 +112,7 @@ export declare const schemas: {
90
112
  total_tokens: number;
91
113
  }>;
92
114
  }>>;
115
+ ChatCompletionList: z.ZodType<ChatCompletionList, z.ZodTypeDef, ChatCompletionList>;
93
116
  };
94
117
  export declare const ChatApi: import("@zodios/core").ZodiosInstance<[{
95
118
  method: "post";
@@ -197,6 +220,105 @@ export declare const ChatApi: import("@zodios/core").ZodiosInstance<[{
197
220
  error: z.ZodString;
198
221
  }, z.ZodTypeAny, "passthrough">>;
199
222
  }];
223
+ }, {
224
+ method: "get";
225
+ path: "/chat/completions";
226
+ alias: "listChatCompletions";
227
+ description: "List all chat completions with optional filtering";
228
+ requestFormat: "json";
229
+ parameters: [{
230
+ name: "limit";
231
+ type: "Query";
232
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
233
+ }, {
234
+ name: "offset";
235
+ type: "Query";
236
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
237
+ }, {
238
+ name: "created_before";
239
+ type: "Query";
240
+ schema: z.ZodOptional<z.ZodString>;
241
+ }, {
242
+ name: "created_after";
243
+ type: "Query";
244
+ schema: z.ZodOptional<z.ZodString>;
245
+ }];
246
+ response: z.ZodType<ChatCompletionList, z.ZodTypeDef, ChatCompletionList>;
247
+ }, {
248
+ method: "get";
249
+ path: "/chat/completions/:id";
250
+ alias: "getChatCompletion";
251
+ description: "Retrieve a chat completion";
252
+ requestFormat: "json";
253
+ parameters: [{
254
+ name: "id";
255
+ type: "Path";
256
+ schema: z.ZodString;
257
+ }];
258
+ response: z.ZodType<Partial<{
259
+ id: string;
260
+ object: string;
261
+ created: number;
262
+ model: string;
263
+ choices: Array<Partial<{
264
+ index: number;
265
+ message: ChatMessage;
266
+ citations: Array<Partial<{
267
+ collection_id: string;
268
+ file_id: string;
269
+ segment_id: string;
270
+ start_time: string | number;
271
+ end_time: string | number;
272
+ text: string;
273
+ context: string;
274
+ relevant_sources: Array<Partial<{
275
+ text: string;
276
+ }>>;
277
+ }> & DescribeOutput>;
278
+ }>>;
279
+ usage: Partial<{
280
+ prompt_tokens: number;
281
+ completion_tokens: number;
282
+ total_tokens: number;
283
+ }>;
284
+ }>, z.ZodTypeDef, Partial<{
285
+ id: string;
286
+ object: string;
287
+ created: number;
288
+ model: string;
289
+ choices: Array<Partial<{
290
+ index: number;
291
+ message: ChatMessage;
292
+ citations: Array<Partial<{
293
+ collection_id: string;
294
+ file_id: string;
295
+ segment_id: string;
296
+ start_time: string | number;
297
+ end_time: string | number;
298
+ text: string;
299
+ context: string;
300
+ relevant_sources: Array<Partial<{
301
+ text: string;
302
+ }>>;
303
+ }> & DescribeOutput>;
304
+ }>>;
305
+ usage: Partial<{
306
+ prompt_tokens: number;
307
+ completion_tokens: number;
308
+ total_tokens: number;
309
+ }>;
310
+ }>>;
311
+ errors: [{
312
+ status: 404;
313
+ description: string;
314
+ schema: z.ZodObject<{
315
+ error: z.ZodString;
316
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
317
+ error: z.ZodString;
318
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
319
+ error: z.ZodString;
320
+ }, z.ZodTypeAny, "passthrough">>;
321
+ }];
200
322
  }]>;
201
323
  export declare function createApiClient(baseUrl: string, options?: ZodiosOptions): import("@zodios/core").ZodiosInstance<[{
202
324
  method: "post";
@@ -304,5 +426,104 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
304
426
  error: z.ZodString;
305
427
  }, z.ZodTypeAny, "passthrough">>;
306
428
  }];
429
+ }, {
430
+ method: "get";
431
+ path: "/chat/completions";
432
+ alias: "listChatCompletions";
433
+ description: "List all chat completions with optional filtering";
434
+ requestFormat: "json";
435
+ parameters: [{
436
+ name: "limit";
437
+ type: "Query";
438
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
439
+ }, {
440
+ name: "offset";
441
+ type: "Query";
442
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
443
+ }, {
444
+ name: "created_before";
445
+ type: "Query";
446
+ schema: z.ZodOptional<z.ZodString>;
447
+ }, {
448
+ name: "created_after";
449
+ type: "Query";
450
+ schema: z.ZodOptional<z.ZodString>;
451
+ }];
452
+ response: z.ZodType<ChatCompletionList, z.ZodTypeDef, ChatCompletionList>;
453
+ }, {
454
+ method: "get";
455
+ path: "/chat/completions/:id";
456
+ alias: "getChatCompletion";
457
+ description: "Retrieve a chat completion";
458
+ requestFormat: "json";
459
+ parameters: [{
460
+ name: "id";
461
+ type: "Path";
462
+ schema: z.ZodString;
463
+ }];
464
+ response: z.ZodType<Partial<{
465
+ id: string;
466
+ object: string;
467
+ created: number;
468
+ model: string;
469
+ choices: Array<Partial<{
470
+ index: number;
471
+ message: ChatMessage;
472
+ citations: Array<Partial<{
473
+ collection_id: string;
474
+ file_id: string;
475
+ segment_id: string;
476
+ start_time: string | number;
477
+ end_time: string | number;
478
+ text: string;
479
+ context: string;
480
+ relevant_sources: Array<Partial<{
481
+ text: string;
482
+ }>>;
483
+ }> & DescribeOutput>;
484
+ }>>;
485
+ usage: Partial<{
486
+ prompt_tokens: number;
487
+ completion_tokens: number;
488
+ total_tokens: number;
489
+ }>;
490
+ }>, z.ZodTypeDef, Partial<{
491
+ id: string;
492
+ object: string;
493
+ created: number;
494
+ model: string;
495
+ choices: Array<Partial<{
496
+ index: number;
497
+ message: ChatMessage;
498
+ citations: Array<Partial<{
499
+ collection_id: string;
500
+ file_id: string;
501
+ segment_id: string;
502
+ start_time: string | number;
503
+ end_time: string | number;
504
+ text: string;
505
+ context: string;
506
+ relevant_sources: Array<Partial<{
507
+ text: string;
508
+ }>>;
509
+ }> & DescribeOutput>;
510
+ }>>;
511
+ usage: Partial<{
512
+ prompt_tokens: number;
513
+ completion_tokens: number;
514
+ total_tokens: number;
515
+ }>;
516
+ }>>;
517
+ errors: [{
518
+ status: 404;
519
+ description: string;
520
+ schema: z.ZodObject<{
521
+ error: z.ZodString;
522
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
523
+ error: z.ZodString;
524
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
525
+ error: z.ZodString;
526
+ }, z.ZodTypeAny, "passthrough">>;
527
+ }];
307
528
  }]>;
308
529
  export {};
@@ -126,10 +126,42 @@ const ChatCompletionResponse = zod_1.z
126
126
  .partial()
127
127
  .strict()
128
128
  .passthrough();
129
+ const ChatCompletionList = zod_1.z
130
+ .object({
131
+ object: zod_1.z.literal('list'),
132
+ data: zod_1.z.array(zod_1.z
133
+ .object({
134
+ id: zod_1.z.string().uuid(),
135
+ created: zod_1.z.number(),
136
+ object: zod_1.z.literal('chat.completion'),
137
+ model: zod_1.z.string(),
138
+ usage: zod_1.z
139
+ .object({
140
+ prompt_tokens: zod_1.z.number().int(),
141
+ completion_tokens: zod_1.z.number().int(),
142
+ total_tokens: zod_1.z.number().int(),
143
+ })
144
+ .partial()
145
+ .strict()
146
+ .passthrough(),
147
+ choices: zod_1.z.array(zod_1.z
148
+ .object({ index: zod_1.z.number().int(), message: ChatMessage })
149
+ .strict()
150
+ .passthrough()),
151
+ })
152
+ .strict()
153
+ .passthrough()),
154
+ total: zod_1.z.number().int(),
155
+ limit: zod_1.z.number().int(),
156
+ offset: zod_1.z.number().int(),
157
+ })
158
+ .strict()
159
+ .passthrough();
129
160
  exports.schemas = {
130
161
  ChatMessage,
131
162
  ChatCompletionRequest,
132
163
  ChatCompletionResponse,
164
+ ChatCompletionList,
133
165
  };
134
166
  const endpoints = (0, core_1.makeApi)([
135
167
  {
@@ -170,6 +202,58 @@ const endpoints = (0, core_1.makeApi)([
170
202
  },
171
203
  ],
172
204
  },
205
+ {
206
+ method: 'get',
207
+ path: '/chat/completions',
208
+ alias: 'listChatCompletions',
209
+ description: `List all chat completions with optional filtering`,
210
+ requestFormat: 'json',
211
+ parameters: [
212
+ {
213
+ name: 'limit',
214
+ type: 'Query',
215
+ schema: zod_1.z.number().int().lte(100).optional().default(20),
216
+ },
217
+ {
218
+ name: 'offset',
219
+ type: 'Query',
220
+ schema: zod_1.z.number().int().optional().default(0),
221
+ },
222
+ {
223
+ name: 'created_before',
224
+ type: 'Query',
225
+ schema: zod_1.z.string().optional(),
226
+ },
227
+ {
228
+ name: 'created_after',
229
+ type: 'Query',
230
+ schema: zod_1.z.string().optional(),
231
+ },
232
+ ],
233
+ response: ChatCompletionList,
234
+ },
235
+ {
236
+ method: 'get',
237
+ path: '/chat/completions/:id',
238
+ alias: 'getChatCompletion',
239
+ description: `Retrieve a chat completion`,
240
+ requestFormat: 'json',
241
+ parameters: [
242
+ {
243
+ name: 'id',
244
+ type: 'Path',
245
+ schema: zod_1.z.string(),
246
+ },
247
+ ],
248
+ response: ChatCompletionResponse,
249
+ errors: [
250
+ {
251
+ status: 404,
252
+ description: `Chat completion not found`,
253
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
254
+ },
255
+ ],
256
+ },
173
257
  ]);
174
258
  exports.ChatApi = new core_1.Zodios('https://api.cloudglue.dev/v1', endpoints);
175
259
  function createApiClient(baseUrl, options) {
@@ -117,6 +117,18 @@ export declare const Face_DetectionApi: import("@zodios/core").ZodiosInstance<[{
117
117
  name: "offset";
118
118
  type: "Query";
119
119
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
120
+ }, {
121
+ name: "created_before";
122
+ type: "Query";
123
+ schema: z.ZodOptional<z.ZodString>;
124
+ }, {
125
+ name: "created_after";
126
+ type: "Query";
127
+ schema: z.ZodOptional<z.ZodString>;
128
+ }, {
129
+ name: "status";
130
+ type: "Query";
131
+ schema: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
120
132
  }];
121
133
  response: z.ZodType<FaceDetectionListResponse, z.ZodTypeDef, FaceDetectionListResponse>;
122
134
  }, {
@@ -268,6 +280,18 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
268
280
  name: "offset";
269
281
  type: "Query";
270
282
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
283
+ }, {
284
+ name: "created_before";
285
+ type: "Query";
286
+ schema: z.ZodOptional<z.ZodString>;
287
+ }, {
288
+ name: "created_after";
289
+ type: "Query";
290
+ schema: z.ZodOptional<z.ZodString>;
291
+ }, {
292
+ name: "status";
293
+ type: "Query";
294
+ schema: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
271
295
  }];
272
296
  response: z.ZodType<FaceDetectionListResponse, z.ZodTypeDef, FaceDetectionListResponse>;
273
297
  }, {
@@ -126,6 +126,23 @@ const endpoints = (0, core_1.makeApi)([
126
126
  type: 'Query',
127
127
  schema: zod_1.z.number().int().gte(0).optional().default(0),
128
128
  },
129
+ {
130
+ name: 'created_before',
131
+ type: 'Query',
132
+ schema: zod_1.z.string().optional(),
133
+ },
134
+ {
135
+ name: 'created_after',
136
+ type: 'Query',
137
+ schema: zod_1.z.string().optional(),
138
+ },
139
+ {
140
+ name: 'status',
141
+ type: 'Query',
142
+ schema: zod_1.z
143
+ .enum(['pending', 'processing', 'completed', 'failed'])
144
+ .optional(),
145
+ },
129
146
  ],
130
147
  response: FaceDetectionListResponse,
131
148
  },
@@ -137,6 +137,18 @@ export declare const Face_MatchApi: import("@zodios/core").ZodiosInstance<[{
137
137
  name: "offset";
138
138
  type: "Query";
139
139
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
140
+ }, {
141
+ name: "created_before";
142
+ type: "Query";
143
+ schema: z.ZodOptional<z.ZodString>;
144
+ }, {
145
+ name: "created_after";
146
+ type: "Query";
147
+ schema: z.ZodOptional<z.ZodString>;
148
+ }, {
149
+ name: "status";
150
+ type: "Query";
151
+ schema: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
140
152
  }];
141
153
  response: z.ZodType<FaceMatchListResponse, z.ZodTypeDef, FaceMatchListResponse>;
142
154
  }, {
@@ -291,6 +303,18 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
291
303
  name: "offset";
292
304
  type: "Query";
293
305
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
306
+ }, {
307
+ name: "created_before";
308
+ type: "Query";
309
+ schema: z.ZodOptional<z.ZodString>;
310
+ }, {
311
+ name: "created_after";
312
+ type: "Query";
313
+ schema: z.ZodOptional<z.ZodString>;
314
+ }, {
315
+ name: "status";
316
+ type: "Query";
317
+ schema: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>;
294
318
  }];
295
319
  response: z.ZodType<FaceMatchListResponse, z.ZodTypeDef, FaceMatchListResponse>;
296
320
  }, {
@@ -140,6 +140,23 @@ const endpoints = (0, core_1.makeApi)([
140
140
  type: 'Query',
141
141
  schema: zod_1.z.number().int().gte(0).optional().default(0),
142
142
  },
143
+ {
144
+ name: 'created_before',
145
+ type: 'Query',
146
+ schema: zod_1.z.string().optional(),
147
+ },
148
+ {
149
+ name: 'created_after',
150
+ type: 'Query',
151
+ schema: zod_1.z.string().optional(),
152
+ },
153
+ {
154
+ name: 'status',
155
+ type: 'Query',
156
+ schema: zod_1.z
157
+ .enum(['pending', 'processing', 'completed', 'failed'])
158
+ .optional(),
159
+ },
143
160
  ],
144
161
  response: FaceMatchListResponse,
145
162
  },
@@ -300,6 +300,14 @@ export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
300
300
  name: "offset";
301
301
  type: "Query";
302
302
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
303
+ }, {
304
+ name: "created_before";
305
+ type: "Query";
306
+ schema: z.ZodOptional<z.ZodString>;
307
+ }, {
308
+ name: "created_after";
309
+ type: "Query";
310
+ schema: z.ZodOptional<z.ZodString>;
303
311
  }];
304
312
  response: z.ZodType<SearchResponseList, z.ZodTypeDef, SearchResponseList>;
305
313
  errors: [{
@@ -445,6 +453,14 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
445
453
  name: "offset";
446
454
  type: "Query";
447
455
  schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
456
+ }, {
457
+ name: "created_before";
458
+ type: "Query";
459
+ schema: z.ZodOptional<z.ZodString>;
460
+ }, {
461
+ name: "created_after";
462
+ type: "Query";
463
+ schema: z.ZodOptional<z.ZodString>;
448
464
  }];
449
465
  response: z.ZodType<SearchResponseList, z.ZodTypeDef, SearchResponseList>;
450
466
  errors: [{
@@ -307,6 +307,16 @@ const endpoints = (0, core_1.makeApi)([
307
307
  type: 'Query',
308
308
  schema: zod_1.z.number().int().gte(0).optional().default(0),
309
309
  },
310
+ {
311
+ name: 'created_before',
312
+ type: 'Query',
313
+ schema: zod_1.z.string().optional(),
314
+ },
315
+ {
316
+ name: 'created_after',
317
+ type: 'Query',
318
+ schema: zod_1.z.string().optional(),
319
+ },
310
320
  ],
311
321
  response: SearchResponseList,
312
322
  errors: [
@@ -35,4 +35,60 @@ export declare class EnhancedChatApi {
35
35
  total_tokens: number;
36
36
  }>;
37
37
  }>>;
38
+ getCompletion(id: string): Promise<Partial<{
39
+ id: string;
40
+ object: string;
41
+ created: number;
42
+ model: string;
43
+ choices: Array<Partial<{
44
+ index: number;
45
+ message: {
46
+ role: "system" | "user" | "assistant";
47
+ content: string;
48
+ name?: string | undefined;
49
+ };
50
+ citations: Array<Partial<{
51
+ collection_id: string;
52
+ file_id: string;
53
+ segment_id: string;
54
+ start_time: string | number;
55
+ end_time: string | number;
56
+ text: string;
57
+ context: string;
58
+ relevant_sources: Array<Partial<{
59
+ text: string;
60
+ }>>;
61
+ }> & import("../../generated/common").DescribeOutput>;
62
+ }>>;
63
+ usage: Partial<{
64
+ prompt_tokens: number;
65
+ completion_tokens: number;
66
+ total_tokens: number;
67
+ }>;
68
+ }>>;
69
+ listCompletions(params: z.infer<typeof chatSchemas.ChatCompletionList>): Promise<{
70
+ object: "list";
71
+ data: Array<{
72
+ id: string;
73
+ created: number;
74
+ object: "chat.completion";
75
+ model: string;
76
+ usage: Partial<{
77
+ prompt_tokens: number;
78
+ completion_tokens: number;
79
+ total_tokens: number;
80
+ }>;
81
+ choices: Array<{
82
+ index: number;
83
+ message: {
84
+ role: "system" | "user" | "assistant";
85
+ content: string;
86
+ name?: string | undefined;
87
+ };
88
+ }>;
89
+ }>;
90
+ total: number;
91
+ limit: number;
92
+ offset: number;
93
+ }>;
38
94
  }
@@ -11,5 +11,17 @@ class EnhancedChatApi {
11
11
  ...params,
12
12
  });
13
13
  }
14
+ async getCompletion(id) {
15
+ return this.api.getChatCompletion({
16
+ params: {
17
+ id,
18
+ },
19
+ });
20
+ }
21
+ async listCompletions(params) {
22
+ return this.api.listChatCompletions({
23
+ queries: params,
24
+ });
25
+ }
14
26
  }
15
27
  exports.EnhancedChatApi = EnhancedChatApi;
@@ -57,6 +57,9 @@ export declare class EnhancedFaceDetectionApi {
57
57
  listFaceDetections(params?: {
58
58
  limit?: number;
59
59
  offset?: number;
60
+ created_before?: string;
61
+ created_after?: string;
62
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
60
63
  }): Promise<import("../../generated/common").PaginationResponse & Partial<{
61
64
  data: Array<{
62
65
  job_id: string;
@@ -69,8 +69,11 @@ export declare class EnhancedFaceMatchApi {
69
69
  object: import("zod").ZodLiteral<"face_match">;
70
70
  }, import("zod").ZodTypeAny, "passthrough">>;
71
71
  listFaceMatches(params?: {
72
- limit?: number;
73
72
  offset?: number;
73
+ limit?: number;
74
+ created_before?: string;
75
+ created_after?: string;
76
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
74
77
  }): Promise<import("../../generated/common").PaginationResponse & Partial<{
75
78
  data: Array<{
76
79
  job_id: string;
@@ -151,6 +151,8 @@ export declare class EnhancedSearchApi {
151
151
  listSearchResponses(params: {
152
152
  limit?: number;
153
153
  offset?: number;
154
+ created_before?: string;
155
+ created_after?: string;
154
156
  }): Promise<{
155
157
  object: "list";
156
158
  data: Array<{
@@ -46,7 +46,7 @@ class CloudGlue {
46
46
  headers: {
47
47
  Authorization: `Bearer ${this.apiKey}`,
48
48
  'x-sdk-client': 'cloudglue-js',
49
- 'x-sdk-version': '0.5.1',
49
+ 'x-sdk-version': '0.5.3',
50
50
  },
51
51
  baseURL: this.baseUrl,
52
52
  timeout: this.timeout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaryhq/cloudglue-js",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Cloudglue API client for Node.js",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",