@aviaryhq/cloudglue-js 0.5.0 → 0.5.2

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.
@@ -2,6 +2,7 @@ import { type ZodiosOptions } from '@zodios/core';
2
2
  import { z } from 'zod';
3
3
  import { FaceBoundingBox } from './common';
4
4
  import { FrameExtractionConfig } from './common';
5
+ import { PaginationResponse } from './common';
5
6
  type FaceDetection = {
6
7
  face_detection_id: string;
7
8
  frame_extraction_id?: string | undefined;
@@ -28,13 +29,25 @@ type DetectedFace = {
28
29
  timestamp: number;
29
30
  thumbnail_url?: string | undefined;
30
31
  };
32
+ type FaceDetectionListResponse = PaginationResponse & Partial<{
33
+ data: Array<{
34
+ job_id: string;
35
+ frame_extraction_id?: string | undefined;
36
+ file_id?: string | undefined;
37
+ status: 'pending' | 'processing' | 'completed' | 'failed';
38
+ created_at: number;
39
+ total_faces?: number | undefined;
40
+ }>;
41
+ }>;
31
42
  declare const FaceDetectionRequest: z.ZodType<FaceDetectionRequest>;
32
43
  declare const DetectedFace: z.ZodType<DetectedFace>;
33
44
  declare const FaceDetection: z.ZodType<FaceDetection>;
45
+ declare const FaceDetectionListResponse: z.ZodType<FaceDetectionListResponse>;
34
46
  export declare const schemas: {
35
47
  FaceDetectionRequest: z.ZodType<FaceDetectionRequest, z.ZodTypeDef, FaceDetectionRequest>;
36
48
  DetectedFace: z.ZodType<DetectedFace, z.ZodTypeDef, DetectedFace>;
37
49
  FaceDetection: z.ZodType<FaceDetection, z.ZodTypeDef, FaceDetection>;
50
+ FaceDetectionListResponse: z.ZodType<FaceDetectionListResponse, z.ZodTypeDef, FaceDetectionListResponse>;
38
51
  };
39
52
  export declare const Face_DetectionApi: import("@zodios/core").ZodiosInstance<[{
40
53
  method: "post";
@@ -90,6 +103,34 @@ export declare const Face_DetectionApi: import("@zodios/core").ZodiosInstance<[{
90
103
  error: z.ZodString;
91
104
  }, z.ZodTypeAny, "passthrough">>;
92
105
  }];
106
+ }, {
107
+ method: "get";
108
+ path: "/face-detect";
109
+ alias: "listFaceDetection";
110
+ description: "List all face detection jobs";
111
+ requestFormat: "json";
112
+ parameters: [{
113
+ name: "limit";
114
+ type: "Query";
115
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
116
+ }, {
117
+ name: "offset";
118
+ type: "Query";
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"]>>;
132
+ }];
133
+ response: z.ZodType<FaceDetectionListResponse, z.ZodTypeDef, FaceDetectionListResponse>;
93
134
  }, {
94
135
  method: "get";
95
136
  path: "/face-detect/:face_detection_id";
@@ -225,6 +266,34 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
225
266
  error: z.ZodString;
226
267
  }, z.ZodTypeAny, "passthrough">>;
227
268
  }];
269
+ }, {
270
+ method: "get";
271
+ path: "/face-detect";
272
+ alias: "listFaceDetection";
273
+ description: "List all face detection jobs";
274
+ requestFormat: "json";
275
+ parameters: [{
276
+ name: "limit";
277
+ type: "Query";
278
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
279
+ }, {
280
+ name: "offset";
281
+ type: "Query";
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"]>>;
295
+ }];
296
+ response: z.ZodType<FaceDetectionListResponse, z.ZodTypeDef, FaceDetectionListResponse>;
228
297
  }, {
229
298
  method: "get";
230
299
  path: "/face-detect/:face_detection_id";
@@ -6,6 +6,7 @@ const core_1 = require("@zodios/core");
6
6
  const zod_1 = require("zod");
7
7
  const common_1 = require("./common");
8
8
  const common_2 = require("./common");
9
+ const common_3 = require("./common");
9
10
  const FaceDetectionRequest = zod_1.z
10
11
  .object({
11
12
  url: zod_1.z.string(),
@@ -46,10 +47,28 @@ const FaceDetection = zod_1.z
46
47
  })
47
48
  .strict()
48
49
  .passthrough();
50
+ const FaceDetectionListResponse = common_3.PaginationResponse.and(zod_1.z
51
+ .object({
52
+ data: zod_1.z.array(zod_1.z
53
+ .object({
54
+ job_id: zod_1.z.string().uuid(),
55
+ frame_extraction_id: zod_1.z.string().uuid().optional(),
56
+ file_id: zod_1.z.string().uuid().optional(),
57
+ status: zod_1.z.enum(['pending', 'processing', 'completed', 'failed']),
58
+ created_at: zod_1.z.number(),
59
+ total_faces: zod_1.z.number().int().optional(),
60
+ })
61
+ .strict()
62
+ .passthrough()),
63
+ })
64
+ .partial()
65
+ .strict()
66
+ .passthrough());
49
67
  exports.schemas = {
50
68
  FaceDetectionRequest,
51
69
  DetectedFace,
52
70
  FaceDetection,
71
+ FaceDetectionListResponse,
53
72
  };
54
73
  const endpoints = (0, core_1.makeApi)([
55
74
  {
@@ -90,6 +109,43 @@ const endpoints = (0, core_1.makeApi)([
90
109
  },
91
110
  ],
92
111
  },
112
+ {
113
+ method: 'get',
114
+ path: '/face-detect',
115
+ alias: 'listFaceDetection',
116
+ description: `List all face detection jobs`,
117
+ requestFormat: 'json',
118
+ parameters: [
119
+ {
120
+ name: 'limit',
121
+ type: 'Query',
122
+ schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
123
+ },
124
+ {
125
+ name: 'offset',
126
+ type: 'Query',
127
+ schema: zod_1.z.number().int().gte(0).optional().default(0),
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
+ },
146
+ ],
147
+ response: FaceDetectionListResponse,
148
+ },
93
149
  {
94
150
  method: 'get',
95
151
  path: '/face-detect/:face_detection_id',
@@ -2,6 +2,7 @@ import { type ZodiosOptions } from '@zodios/core';
2
2
  import { z } from 'zod';
3
3
  import { FaceBoundingBox } from './common';
4
4
  import { FrameExtractionConfig } from './common';
5
+ import { PaginationResponse } from './common';
5
6
  type FaceMatch = {
6
7
  face_match_id: string;
7
8
  face_detection_id?: string | undefined;
@@ -38,10 +39,23 @@ type SourceImage = Partial<{
38
39
  url: string;
39
40
  base64_image: string;
40
41
  }>;
42
+ type FaceMatchListResponse = PaginationResponse & Partial<{
43
+ data: Array<{
44
+ job_id: string;
45
+ face_detection_id?: string | undefined;
46
+ frame_extraction_id?: string | undefined;
47
+ file_id?: string | undefined;
48
+ status: 'pending' | 'processing' | 'completed' | 'failed';
49
+ created_at: number;
50
+ source_face_bounding_box?: (FaceBoundingBox | null) | undefined;
51
+ match_count?: number | undefined;
52
+ }>;
53
+ }>;
41
54
  declare const SourceImage: z.ZodType<SourceImage>;
42
55
  declare const FaceMatchRequest: z.ZodType<FaceMatchRequest>;
43
56
  declare const FaceMatchResult: z.ZodType<FaceMatchResult>;
44
57
  declare const FaceMatch: z.ZodType<FaceMatch>;
58
+ declare const FaceMatchListResponse: z.ZodType<FaceMatchListResponse>;
45
59
  export declare const schemas: {
46
60
  SourceImage: z.ZodType<Partial<{
47
61
  url: string;
@@ -53,6 +67,7 @@ export declare const schemas: {
53
67
  FaceMatchRequest: z.ZodType<FaceMatchRequest, z.ZodTypeDef, FaceMatchRequest>;
54
68
  FaceMatchResult: z.ZodType<FaceMatchResult, z.ZodTypeDef, FaceMatchResult>;
55
69
  FaceMatch: z.ZodType<FaceMatch, z.ZodTypeDef, FaceMatch>;
70
+ FaceMatchListResponse: z.ZodType<FaceMatchListResponse, z.ZodTypeDef, FaceMatchListResponse>;
56
71
  };
57
72
  export declare const Face_MatchApi: import("@zodios/core").ZodiosInstance<[{
58
73
  method: "post";
@@ -108,6 +123,34 @@ export declare const Face_MatchApi: import("@zodios/core").ZodiosInstance<[{
108
123
  error: z.ZodString;
109
124
  }, z.ZodTypeAny, "passthrough">>;
110
125
  }];
126
+ }, {
127
+ method: "get";
128
+ path: "/face-match";
129
+ alias: "listFaceMatch";
130
+ description: "List all face match jobs";
131
+ requestFormat: "json";
132
+ parameters: [{
133
+ name: "limit";
134
+ type: "Query";
135
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
136
+ }, {
137
+ name: "offset";
138
+ type: "Query";
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"]>>;
152
+ }];
153
+ response: z.ZodType<FaceMatchListResponse, z.ZodTypeDef, FaceMatchListResponse>;
111
154
  }, {
112
155
  method: "get";
113
156
  path: "/face-match/:face_match_id";
@@ -246,6 +289,34 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
246
289
  error: z.ZodString;
247
290
  }, z.ZodTypeAny, "passthrough">>;
248
291
  }];
292
+ }, {
293
+ method: "get";
294
+ path: "/face-match";
295
+ alias: "listFaceMatch";
296
+ description: "List all face match jobs";
297
+ requestFormat: "json";
298
+ parameters: [{
299
+ name: "limit";
300
+ type: "Query";
301
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
302
+ }, {
303
+ name: "offset";
304
+ type: "Query";
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"]>>;
318
+ }];
319
+ response: z.ZodType<FaceMatchListResponse, z.ZodTypeDef, FaceMatchListResponse>;
249
320
  }, {
250
321
  method: "get";
251
322
  path: "/face-match/:face_match_id";
@@ -6,6 +6,7 @@ const core_1 = require("@zodios/core");
6
6
  const zod_1 = require("zod");
7
7
  const common_1 = require("./common");
8
8
  const common_2 = require("./common");
9
+ const common_3 = require("./common");
9
10
  const SourceImage = zod_1.z
10
11
  .object({ url: zod_1.z.string(), base64_image: zod_1.z.string() })
11
12
  .partial()
@@ -57,11 +58,31 @@ const FaceMatch = zod_1.z
57
58
  })
58
59
  .strict()
59
60
  .passthrough();
61
+ const FaceMatchListResponse = common_3.PaginationResponse.and(zod_1.z
62
+ .object({
63
+ data: zod_1.z.array(zod_1.z
64
+ .object({
65
+ job_id: zod_1.z.string().uuid(),
66
+ face_detection_id: zod_1.z.string().uuid().optional(),
67
+ frame_extraction_id: zod_1.z.string().uuid().optional(),
68
+ file_id: zod_1.z.string().uuid().optional(),
69
+ status: zod_1.z.enum(['pending', 'processing', 'completed', 'failed']),
70
+ created_at: zod_1.z.number(),
71
+ source_face_bounding_box: common_1.FaceBoundingBox.nullish(),
72
+ match_count: zod_1.z.number().int().optional(),
73
+ })
74
+ .strict()
75
+ .passthrough()),
76
+ })
77
+ .partial()
78
+ .strict()
79
+ .passthrough());
60
80
  exports.schemas = {
61
81
  SourceImage,
62
82
  FaceMatchRequest,
63
83
  FaceMatchResult,
64
84
  FaceMatch,
85
+ FaceMatchListResponse,
65
86
  };
66
87
  const endpoints = (0, core_1.makeApi)([
67
88
  {
@@ -102,6 +123,43 @@ const endpoints = (0, core_1.makeApi)([
102
123
  },
103
124
  ],
104
125
  },
126
+ {
127
+ method: 'get',
128
+ path: '/face-match',
129
+ alias: 'listFaceMatch',
130
+ description: `List all face match jobs`,
131
+ requestFormat: 'json',
132
+ parameters: [
133
+ {
134
+ name: 'limit',
135
+ type: 'Query',
136
+ schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
137
+ },
138
+ {
139
+ name: 'offset',
140
+ type: 'Query',
141
+ schema: zod_1.z.number().int().gte(0).optional().default(0),
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
+ },
160
+ ],
161
+ response: FaceMatchListResponse,
162
+ },
105
163
  {
106
164
  method: 'get',
107
165
  path: '/face-match/:face_match_id',
@@ -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: [
@@ -54,6 +54,22 @@ export declare class EnhancedFaceDetectionApi {
54
54
  deleteFaceDetection(faceDetectionId: string): Promise<import("zod").objectOutputType<{
55
55
  id: import("zod").ZodString;
56
56
  }, import("zod").ZodTypeAny, "passthrough">>;
57
+ listFaceDetections(params?: {
58
+ limit?: number;
59
+ offset?: number;
60
+ created_before?: string;
61
+ created_after?: string;
62
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
63
+ }): Promise<import("../../generated/common").PaginationResponse & Partial<{
64
+ data: Array<{
65
+ job_id: string;
66
+ frame_extraction_id?: string | undefined;
67
+ file_id?: string | undefined;
68
+ status: "pending" | "processing" | "completed" | "failed";
69
+ created_at: number;
70
+ total_faces?: number | undefined;
71
+ }>;
72
+ }>>;
57
73
  waitForReady(faceDetectionId: string, options?: WaitForReadyOptions): Promise<{
58
74
  face_detection_id: string;
59
75
  frame_extraction_id?: string | undefined;
@@ -21,6 +21,9 @@ class EnhancedFaceDetectionApi {
21
21
  params: { face_detection_id: faceDetectionId },
22
22
  });
23
23
  }
24
+ async listFaceDetections(params = {}) {
25
+ return this.api.listFaceDetection({ queries: params });
26
+ }
24
27
  async waitForReady(faceDetectionId, options = {}) {
25
28
  const { pollingInterval = 5000, maxAttempts = 36 } = options;
26
29
  let attempts = 0;
@@ -68,6 +68,24 @@ export declare class EnhancedFaceMatchApi {
68
68
  face_match_id: import("zod").ZodString;
69
69
  object: import("zod").ZodLiteral<"face_match">;
70
70
  }, import("zod").ZodTypeAny, "passthrough">>;
71
+ listFaceMatches(params?: {
72
+ offset?: number;
73
+ limit?: number;
74
+ created_before?: string;
75
+ created_after?: string;
76
+ status?: 'pending' | 'processing' | 'completed' | 'failed';
77
+ }): Promise<import("../../generated/common").PaginationResponse & Partial<{
78
+ data: Array<{
79
+ job_id: string;
80
+ face_detection_id?: string | undefined;
81
+ frame_extraction_id?: string | undefined;
82
+ file_id?: string | undefined;
83
+ status: "pending" | "processing" | "completed" | "failed";
84
+ created_at: number;
85
+ source_face_bounding_box?: (import("../../generated/common").FaceBoundingBox | null) | undefined;
86
+ match_count?: number | undefined;
87
+ }>;
88
+ }>>;
71
89
  waitForReady(faceMatchId: string, options?: WaitForReadyOptions): Promise<{
72
90
  face_match_id: string;
73
91
  face_detection_id?: string | undefined;
@@ -21,6 +21,9 @@ class EnhancedFaceMatchApi {
21
21
  params: { face_match_id: faceMatchId },
22
22
  });
23
23
  }
24
+ async listFaceMatches(params = {}) {
25
+ return this.api.listFaceMatch({ queries: params });
26
+ }
24
27
  async waitForReady(faceMatchId, options = {}) {
25
28
  const { pollingInterval = 5000, maxAttempts = 36 } = options;
26
29
  let attempts = 0;
@@ -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.0',
49
+ 'x-sdk-version': '0.5.2',
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.0",
3
+ "version": "0.5.2",
4
4
  "description": "Cloudglue API client for Node.js",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",