@aviaryhq/cloudglue-js 0.4.11 → 0.4.13
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/Chat.d.ts +8 -8
- package/dist/generated/Chat.js +30 -30
- package/dist/generated/Collections.d.ts +25 -23
- package/dist/generated/Collections.js +266 -264
- package/dist/generated/Describe.d.ts +7 -7
- package/dist/generated/Describe.js +58 -58
- package/dist/generated/Extract.d.ts +6 -6
- package/dist/generated/Extract.js +52 -52
- package/dist/generated/Face_Detection.d.ts +6 -6
- package/dist/generated/Face_Detection.js +25 -25
- package/dist/generated/Face_Match.d.ts +6 -6
- package/dist/generated/Face_Match.js +26 -26
- package/dist/generated/Files.d.ts +1009 -10
- package/dist/generated/Files.js +247 -115
- package/dist/generated/Frames.d.ts +2 -2
- package/dist/generated/Frames.js +17 -17
- package/dist/generated/Search.d.ts +212 -19
- package/dist/generated/Search.js +143 -30
- package/dist/generated/Segmentations.d.ts +208 -2
- package/dist/generated/Segmentations.js +34 -29
- package/dist/generated/Segments.d.ts +13 -13
- package/dist/generated/Segments.js +49 -49
- package/dist/generated/Tags.d.ts +660 -0
- package/dist/generated/Tags.js +160 -0
- package/dist/generated/Transcribe.d.ts +7 -7
- package/dist/generated/Transcribe.js +46 -46
- package/dist/generated/Webhooks.d.ts +5 -5
- package/dist/generated/Webhooks.js +61 -61
- package/dist/generated/common.d.ts +391 -11
- package/dist/generated/common.js +63 -28
- package/dist/generated/index.d.ts +14 -13
- package/dist/generated/index.js +3 -1
- package/dist/src/api/chat-completion.api.d.ts +38 -0
- package/dist/src/api/chat-completion.api.js +15 -0
- package/dist/src/api/collections.api.d.ts +666 -0
- package/dist/src/api/collections.api.js +134 -0
- package/dist/src/api/describe.api.d.ts +153 -0
- package/dist/src/api/describe.api.js +57 -0
- package/dist/src/api/extract.api.d.ts +144 -0
- package/dist/src/api/extract.api.js +55 -0
- package/dist/src/api/face-detection.api.d.ts +77 -0
- package/dist/src/api/face-detection.api.js +41 -0
- package/dist/src/api/face-match.api.d.ts +94 -0
- package/dist/src/api/face-match.api.js +41 -0
- package/dist/src/api/files.api.d.ts +705 -0
- package/dist/src/api/files.api.js +146 -0
- package/dist/src/api/frame-extraction.api.d.ts +264 -0
- package/dist/src/api/frame-extraction.api.js +37 -0
- package/dist/src/api/search.api.d.ts +316 -0
- package/dist/src/api/search.api.js +22 -0
- package/dist/src/api/segmentations.api.d.ts +395 -0
- package/dist/src/api/segmentations.api.js +36 -0
- package/dist/src/api/segments.api.d.ts +141 -0
- package/dist/src/api/segments.api.js +40 -0
- package/dist/src/api/tags.api.d.ts +71 -0
- package/dist/src/api/tags.api.js +31 -0
- package/dist/src/api/transcribe.api.d.ts +150 -0
- package/dist/src/api/transcribe.api.js +65 -0
- package/dist/src/api/webhooks.api.d.ts +69 -0
- package/dist/src/api/webhooks.api.js +28 -0
- package/dist/src/client.d.ts +20 -2967
- package/dist/src/client.js +55 -643
- package/dist/src/error.d.ts +7 -0
- package/dist/src/error.js +14 -0
- package/dist/src/types.d.ts +20 -8
- package/package.json +2 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Face_MatchApi } from '../../generated';
|
|
2
|
+
import { FrameExtractionConfig } from '../types';
|
|
3
|
+
import { WaitForReadyOptions } from '../types';
|
|
4
|
+
export declare class EnhancedFaceMatchApi {
|
|
5
|
+
private readonly api;
|
|
6
|
+
constructor(api: typeof Face_MatchApi);
|
|
7
|
+
createFaceMatch(params: {
|
|
8
|
+
source_image: {
|
|
9
|
+
url?: string;
|
|
10
|
+
base64_image?: string;
|
|
11
|
+
file_path?: string;
|
|
12
|
+
};
|
|
13
|
+
target_video_url: string;
|
|
14
|
+
max_faces?: number;
|
|
15
|
+
face_detection_id?: string;
|
|
16
|
+
frame_extraction_id?: string;
|
|
17
|
+
frame_extraction_config?: FrameExtractionConfig;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
face_match_id: string;
|
|
20
|
+
face_detection_id?: string | undefined;
|
|
21
|
+
frame_extraction_id?: string | undefined;
|
|
22
|
+
file_id?: string | undefined;
|
|
23
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
24
|
+
created_at: number;
|
|
25
|
+
source_face_bounding_box?: (import("../../generated/common").FaceBoundingBox | null) | undefined;
|
|
26
|
+
data?: Partial<{
|
|
27
|
+
object: "list";
|
|
28
|
+
total: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
offset: number;
|
|
31
|
+
faces_matches: Array<{
|
|
32
|
+
id: string;
|
|
33
|
+
face_bounding_box: import("../../generated/common").FaceBoundingBox;
|
|
34
|
+
similarity: number;
|
|
35
|
+
frame_id: string;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
thumbnail_url?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
getFaceMatch(faceMatchId: string, params?: {
|
|
42
|
+
limit?: number;
|
|
43
|
+
offset?: number;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
face_match_id: string;
|
|
46
|
+
face_detection_id?: string | undefined;
|
|
47
|
+
frame_extraction_id?: string | undefined;
|
|
48
|
+
file_id?: string | undefined;
|
|
49
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
50
|
+
created_at: number;
|
|
51
|
+
source_face_bounding_box?: (import("../../generated/common").FaceBoundingBox | null) | undefined;
|
|
52
|
+
data?: Partial<{
|
|
53
|
+
object: "list";
|
|
54
|
+
total: number;
|
|
55
|
+
limit: number;
|
|
56
|
+
offset: number;
|
|
57
|
+
faces_matches: Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
face_bounding_box: import("../../generated/common").FaceBoundingBox;
|
|
60
|
+
similarity: number;
|
|
61
|
+
frame_id: string;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
thumbnail_url?: string | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
}> | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
deleteFaceMatch(faceMatchId: string): Promise<import("zod").objectOutputType<{
|
|
68
|
+
face_match_id: import("zod").ZodString;
|
|
69
|
+
object: import("zod").ZodLiteral<"face_match">;
|
|
70
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
71
|
+
waitForReady(faceMatchId: string, options?: WaitForReadyOptions): Promise<{
|
|
72
|
+
face_match_id: string;
|
|
73
|
+
face_detection_id?: string | undefined;
|
|
74
|
+
frame_extraction_id?: string | undefined;
|
|
75
|
+
file_id?: string | undefined;
|
|
76
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
77
|
+
created_at: number;
|
|
78
|
+
source_face_bounding_box?: (import("../../generated/common").FaceBoundingBox | null) | undefined;
|
|
79
|
+
data?: Partial<{
|
|
80
|
+
object: "list";
|
|
81
|
+
total: number;
|
|
82
|
+
limit: number;
|
|
83
|
+
offset: number;
|
|
84
|
+
faces_matches: Array<{
|
|
85
|
+
id: string;
|
|
86
|
+
face_bounding_box: import("../../generated/common").FaceBoundingBox;
|
|
87
|
+
similarity: number;
|
|
88
|
+
frame_id: string;
|
|
89
|
+
timestamp: number;
|
|
90
|
+
thumbnail_url?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
}> | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnhancedFaceMatchApi = void 0;
|
|
4
|
+
const error_1 = require("../error");
|
|
5
|
+
class EnhancedFaceMatchApi {
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async createFaceMatch(params) {
|
|
10
|
+
return this.api.createFaceMatch(params);
|
|
11
|
+
}
|
|
12
|
+
async getFaceMatch(faceMatchId, params = {}) {
|
|
13
|
+
const { limit, offset } = params;
|
|
14
|
+
return this.api.getFaceMatch({
|
|
15
|
+
params: { face_match_id: faceMatchId },
|
|
16
|
+
queries: { limit, offset },
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async deleteFaceMatch(faceMatchId) {
|
|
20
|
+
return this.api.deleteFaceMatch(undefined, {
|
|
21
|
+
params: { face_match_id: faceMatchId },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async waitForReady(faceMatchId, options = {}) {
|
|
25
|
+
const { pollingInterval = 5000, maxAttempts = 36 } = options;
|
|
26
|
+
let attempts = 0;
|
|
27
|
+
while (attempts < maxAttempts) {
|
|
28
|
+
const job = await this.getFaceMatch(faceMatchId);
|
|
29
|
+
if (['completed', 'failed'].includes(job.status)) {
|
|
30
|
+
if (job.status === 'failed') {
|
|
31
|
+
throw new error_1.CloudGlueError(`Face match job failed: ${faceMatchId}`);
|
|
32
|
+
}
|
|
33
|
+
return job;
|
|
34
|
+
}
|
|
35
|
+
await new Promise((resolve) => setTimeout(resolve, pollingInterval));
|
|
36
|
+
attempts++;
|
|
37
|
+
}
|
|
38
|
+
throw new error_1.CloudGlueError(`Face match job did not complete within ${(maxAttempts * pollingInterval) / 1000} seconds: ${faceMatchId}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.EnhancedFaceMatchApi = EnhancedFaceMatchApi;
|