@mediaviz/sdk 1.0.65 → 1.0.68

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/sdk.cjs CHANGED
@@ -458,6 +458,17 @@ class AiModelCredits {
458
458
  }
459
459
  }
460
460
 
461
+ class Admin {
462
+ constructor(ctx) { this._ctx = ctx; }
463
+
464
+ async getCategoryLabels(category) {
465
+ this._ctx.requireTokens();
466
+ const path = `/api/v1/admin/category_labels/${encodeURIComponent(category)}`;
467
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
468
+ return data;
469
+ }
470
+ }
471
+
461
472
  class Company {
462
473
  constructor(ctx) { this._ctx = ctx; }
463
474
 
@@ -1659,6 +1670,17 @@ class Users {
1659
1670
  const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
1660
1671
  return data;
1661
1672
  }
1673
+
1674
+ async deleteUser(userId, { newCompanyOwnerId } = {}) {
1675
+ this._ctx.requireTokens();
1676
+ let path = `/api/v1/users/delete/${encodeURIComponent(userId)}`;
1677
+ const query = new URLSearchParams();
1678
+ if (newCompanyOwnerId !== undefined) (Array.isArray(newCompanyOwnerId) ? newCompanyOwnerId : [newCompanyOwnerId]).forEach(v => query.append('new_company_owner_id', v));
1679
+ const qs = query.toString();
1680
+ if (qs) path += '?' + qs;
1681
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1682
+ return data;
1683
+ }
1662
1684
  }
1663
1685
 
1664
1686
  // Auto-generated — do not edit
@@ -1723,6 +1745,7 @@ class MediaViz {
1723
1745
 
1724
1746
  const _ctx = new _Context(this);
1725
1747
  this.aiModelCredits = new AiModelCredits(_ctx);
1748
+ this.admin = new Admin(_ctx);
1726
1749
  this.company = new Company(_ctx);
1727
1750
  this.curatedAlbums = new CuratedAlbums(_ctx);
1728
1751
  this.customAlbums = new CustomAlbums(_ctx);
@@ -1767,6 +1790,7 @@ class MediaViz {
1767
1790
  get refreshToken() { return this._refreshToken; }
1768
1791
  }
1769
1792
 
1793
+ exports.Admin = Admin;
1770
1794
  exports.AiModelCredits = AiModelCredits;
1771
1795
  exports.ApiError = ApiError;
1772
1796
  exports.Company = Company;
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,503 @@
1
+ // Auto-generated — do not edit. TypeScript declarations for the MediaViz SDK.
2
+ export interface TokenResponse {
3
+ access_token: string;
4
+ token_type: string;
5
+ expires_in: number;
6
+ refresh_token: string;
7
+ }
8
+
9
+ export interface AuthorizationUrlResult {
10
+ url: string;
11
+ state: string;
12
+ code_verifier: string;
13
+ }
14
+
15
+ export interface MediaVizConfig {
16
+ clientId?: string;
17
+ clientSecret?: string;
18
+ baseUrl?: string;
19
+ redirectUri?: string;
20
+ hosts?: Record<string, string>;
21
+ accessToken?: string;
22
+ refreshToken?: string;
23
+ onTokenRefresh?: (tokens: TokenResponse) => void;
24
+ }
25
+
26
+ export class OAuthClient {
27
+ constructor(config: { baseUrl?: string; clientId?: string; clientSecret?: string; redirectUri?: string });
28
+ }
29
+
30
+ export class OAuthError extends Error {
31
+ code: string;
32
+ }
33
+
34
+ export const OAuthErrorCode: { [key: string]: string };
35
+
36
+ export class ApiError extends Error {
37
+ status: number;
38
+ requestId: string | null;
39
+ body: any;
40
+ constructor(message: string, status: number, requestId: string | null, body: any);
41
+ }
42
+
43
+ export class ValidationError extends ApiError {
44
+ fieldErrors: Array<{ loc: (string | number)[]; msg: string; type: string }>;
45
+ constructor(body: any, status: number, requestId: string | null);
46
+ }
47
+
48
+ export class NotFoundError extends ApiError {
49
+ constructor(body: any, status: number, requestId: string | null);
50
+ }
51
+
52
+ export class RateLimitError extends ApiError {
53
+ retryAfter: number | null;
54
+ constructor(body: any, status: number, requestId: string | null, headers: Headers);
55
+ }
56
+
57
+ export class ServerError extends ApiError {
58
+ constructor(body: any, status: number, requestId: string | null);
59
+ }
60
+
61
+ export function handleResponse(response: Response): Promise<any>;
62
+
63
+ // ── response schemas ──
64
+ export interface AlbumDisplay {
65
+ name?: string;
66
+ description?: string;
67
+ id: number;
68
+ project_table_name: string;
69
+ }
70
+
71
+ export interface AnalysisStatusResponse {
72
+ project_table_name: string;
73
+ model_or_process: string;
74
+ status: string;
75
+ last_updated_at: string;
76
+ }
77
+
78
+ export interface CompanyDisplay {
79
+ name: string;
80
+ id: number;
81
+ owner_id: number;
82
+ users?: number[];
83
+ active: boolean;
84
+ payment_plan_type: string;
85
+ }
86
+
87
+ export interface CompanyKeywordListOverview {
88
+ id: number;
89
+ name: string;
90
+ active_keywords: number;
91
+ excluded_keywords: number;
92
+ project_ids?: string[];
93
+ }
94
+
95
+ export interface CreditBalanceOutput {
96
+ sufficient_credits: boolean;
97
+ current_credit_balance: number;
98
+ credit_cost: number;
99
+ required_credits: number;
100
+ }
101
+
102
+ export interface CuratedAlbumDisplay {
103
+ id: number;
104
+ project_table_name: string;
105
+ name: string;
106
+ description?: string;
107
+ confidence_value?: number;
108
+ }
109
+
110
+ export interface HealthCheck {
111
+ status?: string;
112
+ timestamp?: string;
113
+ checks?: Record<string, any>;
114
+ }
115
+
116
+ export interface KeywordListDisplayWithList {
117
+ id: number;
118
+ user_id: number;
119
+ company_id: number;
120
+ name: string;
121
+ date_created: string;
122
+ date_last_updated: string;
123
+ is_inclusion?: boolean;
124
+ gsheet_view_link?: string;
125
+ gsheet_csv_link?: string;
126
+ gsheet_xlsx_link?: string;
127
+ list_keywords_included_or_excluded?: number[];
128
+ }
129
+
130
+ export interface KeywordListDisplayWithProjects {
131
+ id: number;
132
+ user_id: number;
133
+ company_id: number;
134
+ name: string;
135
+ date_created: string;
136
+ date_last_updated: string;
137
+ is_inclusion?: boolean;
138
+ list_projects_associated?: string[];
139
+ }
140
+
141
+ export interface PhotoDisplay {
142
+ photo_s3_link: string;
143
+ client_side_id?: string;
144
+ moment_id?: number;
145
+ file_path?: string;
146
+ image_metadata?: Record<string, any>;
147
+ tags?: string[];
148
+ title?: string;
149
+ description?: string;
150
+ format?: string;
151
+ size?: string;
152
+ source_resolution_x?: number;
153
+ source_resolution_y?: number;
154
+ date_taken?: string;
155
+ date_modified?: string;
156
+ date_guessed?: string;
157
+ date_uploaded?: string;
158
+ latitude?: number;
159
+ longitude?: number;
160
+ country_code?: string;
161
+ country?: string;
162
+ state?: string;
163
+ city?: string;
164
+ average_hash?: string;
165
+ perceptual_hash?: string;
166
+ difference_hash?: string;
167
+ wavelet_hash_haar?: string;
168
+ color_hash?: string;
169
+ reference_1_average_distance?: number;
170
+ reference_2_average_distance?: number;
171
+ reference_3_average_distance?: number;
172
+ main_color_palette?: string[];
173
+ color_averages?: string[];
174
+ labels_from_classifications_model?: Record<string, any>;
175
+ ocr_output?: Record<string, any>;
176
+ bounding_boxes_from_faces_model?: Record<string, any>[];
177
+ number_of_faces?: number;
178
+ blur_value?: number;
179
+ feature_extraction_output?: number[];
180
+ similar_photo_ids_high?: number[];
181
+ similar_photo_ids_medium?: number[];
182
+ similar_photo_ids_low?: number[];
183
+ evidence_score?: number;
184
+ face_score?: number;
185
+ content_score?: number;
186
+ aesthetic_score?: number;
187
+ similarity_set_ranking?: number;
188
+ topic?: string;
189
+ rank?: number;
190
+ hue_values?: number[];
191
+ light_values?: number[];
192
+ saturation_values?: number[];
193
+ user_id: number;
194
+ company_id: number;
195
+ id: number;
196
+ project_table_name: string;
197
+ }
198
+
199
+ export interface PhotoFace {
200
+ smile_value?: boolean;
201
+ smile_confidence?: number;
202
+ eyeglasses_value?: boolean;
203
+ eyeglasses_confidence?: number;
204
+ sunglasses_value?: boolean;
205
+ sunglasses_confidence?: number;
206
+ eyes_open_value?: boolean;
207
+ eyes_open_confidence?: number;
208
+ emotion_happy_confidence?: number;
209
+ emotion_sad_confidence?: number;
210
+ landmark_eyeleft_x?: number;
211
+ landmark_eyeleft_y?: number;
212
+ landmark_eyeright_x?: number;
213
+ landmark_eyeright_y?: number;
214
+ landmark_mouthleft_x?: number;
215
+ landmark_mouthleft_y?: number;
216
+ landmark_mouthright_x?: number;
217
+ landmark_mouthright_y?: number;
218
+ landmark_nose_x?: number;
219
+ landmark_nose_y?: number;
220
+ pose_roll?: number;
221
+ pose_yaw?: number;
222
+ pose_pitch?: number;
223
+ quality_brightness?: number;
224
+ quality_sharpness?: number;
225
+ face_occluded_value?: boolean;
226
+ eye_direction_yaw?: number;
227
+ eye_direction_pitch?: number;
228
+ eye_direction_confidence?: number;
229
+ }
230
+
231
+ export interface PhotoPersonLight {
232
+ id: number;
233
+ person_id: string;
234
+ bounding_box: Record<string, any>;
235
+ confidence: number;
236
+ person_name: string;
237
+ }
238
+
239
+ export interface PhotoPersonWithS3Link {
240
+ id: number;
241
+ person_id: string;
242
+ bounding_box: Record<string, any>;
243
+ confidence: number;
244
+ person_name: string;
245
+ photo_s3_link: string;
246
+ }
247
+
248
+ export interface ProjectRunDisplay {
249
+ name: string;
250
+ private?: boolean;
251
+ type?: number;
252
+ description?: string;
253
+ directory?: string;
254
+ photo_upload_vector?: number;
255
+ thumbnail?: string;
256
+ run_name?: string;
257
+ id: string;
258
+ user_id: number;
259
+ company_id: number;
260
+ active: boolean;
261
+ project_table_name: string;
262
+ date_created: string;
263
+ number_of_photos?: number;
264
+ date_photos_uploaded?: string;
265
+ date_deleted?: string;
266
+ top_tier?: number;
267
+ tier_2?: number;
268
+ total_photos_uploaded?: number;
269
+ gsheet_view_link?: string;
270
+ gsheet_csv_link?: string;
271
+ gsheet_xlsx_link?: string;
272
+ insights_view_link?: string;
273
+ similarity_level?: string;
274
+ blur_model?: boolean;
275
+ colors_model?: boolean;
276
+ face_recognition_model?: boolean;
277
+ image_classification_model?: boolean;
278
+ image_comparison_model?: boolean;
279
+ image_describe_model?: boolean;
280
+ ocr_model?: boolean;
281
+ similarity_model?: boolean;
282
+ personhood_model?: boolean;
283
+ evidence_model?: boolean;
284
+ insights_model?: boolean;
285
+ normalize?: boolean;
286
+ }
287
+
288
+ export interface SearchDisplay {
289
+ id: number;
290
+ project_table_name: string;
291
+ search_name: string;
292
+ and_params?: string[];
293
+ and_string_params?: string[];
294
+ or_params?: string[];
295
+ or_string_params?: string[];
296
+ not_params?: string[];
297
+ not_string_params?: string[];
298
+ date_min?: string;
299
+ date_max?: string;
300
+ date_null_and?: boolean;
301
+ date_null_or?: boolean;
302
+ date_order?: string;
303
+ custom_album_id?: number;
304
+ best_of_similar_sets_only?: boolean;
305
+ curated_album_id?: number;
306
+ }
307
+
308
+ export interface UserDisplay {
309
+ id: number;
310
+ company_id: number;
311
+ name: string;
312
+ email: string;
313
+ account_type: number;
314
+ location?: string;
315
+ phone_number?: string;
316
+ birthday?: string;
317
+ profile_picture?: string;
318
+ }
319
+
320
+ export class AiModelCredits {
321
+ getModelCreditRelationship(modelName: string): Promise<Record<string, any>>;
322
+ }
323
+
324
+ export class Admin {
325
+ getCategoryLabels(category: string): Promise<Record<string, any>>;
326
+ }
327
+
328
+ export class Company {
329
+ getCompanyById(companyId: number): Promise<CompanyDisplay>;
330
+ confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
331
+ }
332
+
333
+ export class CuratedAlbums {
334
+ createCuratedAlbum(projectTableName: string, name: string, description?: string, confidenceValue?: number): Promise<CuratedAlbumDisplay>;
335
+ getAllProjectCuratedAlbums(projectTableName: string): Promise<CuratedAlbumDisplay[]>;
336
+ getCuratedAlbumPhotos(albumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], confidenceValue?: number | number[] }): Promise<any[]>;
337
+ getCuratedAlbumPhotosRanked(albumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], confidenceValue?: number | number[] }): Promise<Record<string, any>>;
338
+ getCuratedAlbumById(albumId: number): Promise<CuratedAlbumDisplay>;
339
+ updateCuratedAlbum(albumId: number, body?: { name?: string, description?: string, confidenceValue?: number }): Promise<CuratedAlbumDisplay>;
340
+ deleteCuratedAlbum(albumId: number): Promise<Record<string, any>>;
341
+ convertCuratedAlbumToCustom(albumId: number): Promise<CuratedAlbumDisplay>;
342
+ }
343
+
344
+ export class CustomAlbums {
345
+ getCustomAlbumDetailById(customAlbumId: number): Promise<AlbumDisplay>;
346
+ getAllProjectCustomAlbums(projectTableName: string): Promise<AlbumDisplay[]>;
347
+ getCustomAlbumPhotosById(customAlbumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
348
+ getRankedCustomAlbumById(customAlbumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>>;
349
+ createProjectCustomAlbum(projectTableName: string, body?: { name?: string, description?: string, photoIdInclusionList?: number[], photoIdRemovalList?: number[] }): Promise<AlbumDisplay>;
350
+ updateCustomAlbum(albumId: number, body?: { name?: string, description?: string, photoIdInclusionList?: number[], photoIdRemovalList?: number[] }): Promise<AlbumDisplay>;
351
+ deleteCustomAlbum(albumId: number): Promise<Record<string, any>>;
352
+ }
353
+
354
+ export class EmailTokens {
355
+ requestEmailVerification(options?: { email?: string | string[] }): Promise<Record<string, any>>;
356
+ verifyEmail(token: string): Promise<Record<string, any>>;
357
+ requestPasswordReset(options?: { email?: string | string[] }): Promise<Record<string, any>>;
358
+ validateToken(token: string): Promise<Record<string, any>>;
359
+ resetPassword(token: string, newPassword: string): Promise<Record<string, any>>;
360
+ deleteUserEmailTokens(userId: number): Promise<Record<string, any>>;
361
+ }
362
+
363
+ export class Health {
364
+ healthCheck(): Promise<HealthCheck>;
365
+ livenessCheck(): Promise<HealthCheck>;
366
+ readinessCheck(): Promise<HealthCheck>;
367
+ }
368
+
369
+ export class Keywords {
370
+ createKeywordFilteringList(name: string, projectList?: string[]): Promise<KeywordListDisplayWithProjects>;
371
+ getUserKeywordFilteringLists(): Promise<KeywordListDisplayWithProjects[]>;
372
+ getCompanyKeywordLists(companyId: number): Promise<CompanyKeywordListOverview[]>;
373
+ getKeywordFilteringListAndProjectsById(keywordListId: number): Promise<KeywordListDisplayWithProjects>;
374
+ getKeywordFilteringListById(keywordListId: number): Promise<KeywordListDisplayWithList>;
375
+ getExistingKeywordFilteringListByProject(projectTableName: string): Promise<Record<string, any>>;
376
+ getDefaultKeywordFilteringListByProject(projectTableName: string): Promise<Record<string, any>>;
377
+ updateKeywordFilteringListLabels(keywordListId: number, listKeywordsToInclude: number[], listKeywordsToExclude: number[]): Promise<KeywordListDisplayWithList>;
378
+ updateKeywordFilteringListDetails(keywordListId: number, body?: { name?: string, projectList?: string[] }): Promise<KeywordListDisplayWithProjects>;
379
+ addProjectsToKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
380
+ requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
381
+ requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
382
+ getKeywordsAndIds(): Promise<any>;
383
+ removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
384
+ deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
385
+ }
386
+
387
+ export class OauthAuthorization {
388
+ authorize(options?: { responseType?: string | string[], clientId?: string | string[], redirectUri?: string | string[], state?: string | string[], codeChallenge?: string | string[], codeChallengeMethod?: string | string[] }): Promise<any>;
389
+ getConsent(sessionId: string): Promise<any>;
390
+ postApproveConsent(sessionId: string, body: { restartUrl: string }): Promise<any>;
391
+ postDenyConsent(sessionId: string, body: { restartUrl: string }): Promise<any>;
392
+ getSwitchUser(sessionId: string, options?: { restartUrl?: string | string[] }): Promise<any>;
393
+ }
394
+
395
+ export class OauthToken {
396
+ token(body: { grantType: string, code: string, redirectUri: string, clientId: string, codeVerifier: string, refreshToken: string, clientSecret: string }): Promise<Record<string, any>>;
397
+ adminRevokeUserTokens(userId: number): Promise<Record<string, any>>;
398
+ revoke(body: { token: string, tokenTypeHint: string, clientId: string }): Promise<any>;
399
+ }
400
+
401
+ export class OauthLogin {
402
+ getLogin(options?: { next?: string | string[] }): Promise<any>;
403
+ postLogin(body: { email: string, password: string, next: string }): Promise<any>;
404
+ }
405
+
406
+ export class Person {
407
+ updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
408
+ combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
409
+ splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
410
+ getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
411
+ getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
412
+ getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonLight[]>;
413
+ }
414
+
415
+ export class Photoupload {
416
+ uploadPhotoToMediaviz(companyId: string, userId: string, projectTableName: string, title: string, body: { fileContent: string, mimetype: string, filePath: string }, headerOptions?: { clientSideId?: string, blur?: string, colors?: string, faceRecognition?: string, imageDescribe?: string, imageClassification?: string, imageComparison?: string, size?: string, sourceResolutionX?: string, sourceResolutionY?: string, dateTaken?: string, latitude?: string, longitude?: string, ocr?: string }): Promise<any>;
417
+ uploadPhoto(projectTableName: string, companyId: string, userId: string, photoIndex: number, photo: Record<string, any>): Promise<any>;
418
+ }
419
+
420
+ export class Photos {
421
+ getPhotoFromProject(tableName: string, photoId: number, options?: { keywordListId?: number | number[] }): Promise<PhotoDisplay>;
422
+ getPhotoFaceDetailsFromProject(tableName: string, photoId: number): Promise<PhotoFace[]>;
423
+ getProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], includeAll?: boolean | boolean[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<any>;
424
+ getRankedProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<Record<string, any>>;
425
+ getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
426
+ getProjectThumbnail(tableName: string): Promise<any>;
427
+ updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
428
+ updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
429
+ deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
430
+ }
431
+
432
+ export class Projects {
433
+ createProjectAndRun(name: string, private_?: boolean, type?: number, description?: string, directory?: string, photoUploadVector?: number, thumbnail?: string, runName?: string, options?: { outcomes?: any, models?: any }): Promise<ProjectRunDisplay>;
434
+ markProjectUploadComplete(projectTableName: string, options?: { skippedFileCount?: number | number[] }): Promise<any>;
435
+ checkProjectStatus(projectTableName: string): Promise<any>;
436
+ getProjectPrelimModelRequestTemplate(projectTableName: string): Promise<Record<string, any>>;
437
+ getUserProjects(): Promise<ProjectRunDisplay[]>;
438
+ getAdminProjects(): Promise<ProjectRunDisplay[]>;
439
+ getProjectById(projectId: string): Promise<ProjectRunDisplay>;
440
+ getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
441
+ updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
442
+ updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
443
+ updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
444
+ requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
445
+ requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
446
+ requestProjectPersonhoodQueue(projectTableName: string): Promise<Record<string, any>>;
447
+ requestInsightsQueue(analysisLevel: string, identifier: string): Promise<Record<string, any>>;
448
+ requestProjectExport(projectTableName: string): Promise<Record<string, any>>;
449
+ getProjectDataExportUploadStatus(projectTableName: string, modelName: string): Promise<AnalysisStatusResponse>;
450
+ addProjectEvent(projectTableName: string, event: string, detail?: string): Promise<Record<string, any>>;
451
+ deleteProject(projectId: string): Promise<Record<string, any>>;
452
+ }
453
+
454
+ export class Search {
455
+ searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
456
+ searchProjectPhotosText(projectTableName: string, searchText: string, size?: number): Promise<any>;
457
+ searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number): Promise<any>;
458
+ searchProjectPhotosNaturalLanguageHybrid(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
459
+ searchProjectPhotosNaturalLanguageAuto(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[] }): Promise<Record<string, any>>;
460
+ getProjectSavedSearches(projectTableName: string): Promise<any>;
461
+ getSavedSearchById(searchId: number): Promise<SearchDisplay>;
462
+ saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
463
+ deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
464
+ }
465
+
466
+ export class Users {
467
+ createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
468
+ createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
469
+ changePassword(oldPassword: string, newPassword: string): Promise<Record<string, any>>;
470
+ getUserId(): Promise<Record<string, any>>;
471
+ getUser(userId: number): Promise<UserDisplay>;
472
+ getAllUsersByCompany(companyId: number): Promise<UserDisplay[]>;
473
+ updateUser(userId: number, body?: { name?: string, email?: string, password?: string, companyId?: number, accountType?: number, profilePicture?: string, location?: string, phoneNumber?: string, birthday?: string }): Promise<UserDisplay>;
474
+ deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
475
+ }
476
+
477
+ export class MediaViz {
478
+ constructor(config?: MediaVizConfig);
479
+ authenticate(): Promise<TokenResponse>;
480
+ getAuthorizationUrl(state?: string): Promise<AuthorizationUrlResult>;
481
+ handleCallback(code: string, codeVerifier: string): Promise<TokenResponse>;
482
+ setTokens(accessToken: string, refreshToken: string): void;
483
+ readonly accessToken: string | null;
484
+ readonly refreshToken: string | null;
485
+ readonly aiModelCredits: AiModelCredits;
486
+ readonly admin: Admin;
487
+ readonly company: Company;
488
+ readonly curatedAlbums: CuratedAlbums;
489
+ readonly customAlbums: CustomAlbums;
490
+ readonly emailTokens: EmailTokens;
491
+ readonly health: Health;
492
+ readonly keywords: Keywords;
493
+ readonly oAuthAuthorization: OauthAuthorization;
494
+ readonly oAuthToken: OauthToken;
495
+ readonly oauthLogin: OauthLogin;
496
+ readonly person: Person;
497
+ readonly photoUpload: Photoupload;
498
+ readonly photos: Photos;
499
+ readonly projects: Projects;
500
+ readonly search: Search;
501
+ readonly users: Users;
502
+ }
503
+
@@ -0,0 +1,503 @@
1
+ // Auto-generated — do not edit. TypeScript declarations for the MediaViz SDK.
2
+ export interface TokenResponse {
3
+ access_token: string;
4
+ token_type: string;
5
+ expires_in: number;
6
+ refresh_token: string;
7
+ }
8
+
9
+ export interface AuthorizationUrlResult {
10
+ url: string;
11
+ state: string;
12
+ code_verifier: string;
13
+ }
14
+
15
+ export interface MediaVizConfig {
16
+ clientId?: string;
17
+ clientSecret?: string;
18
+ baseUrl?: string;
19
+ redirectUri?: string;
20
+ hosts?: Record<string, string>;
21
+ accessToken?: string;
22
+ refreshToken?: string;
23
+ onTokenRefresh?: (tokens: TokenResponse) => void;
24
+ }
25
+
26
+ export class OAuthClient {
27
+ constructor(config: { baseUrl?: string; clientId?: string; clientSecret?: string; redirectUri?: string });
28
+ }
29
+
30
+ export class OAuthError extends Error {
31
+ code: string;
32
+ }
33
+
34
+ export const OAuthErrorCode: { [key: string]: string };
35
+
36
+ export class ApiError extends Error {
37
+ status: number;
38
+ requestId: string | null;
39
+ body: any;
40
+ constructor(message: string, status: number, requestId: string | null, body: any);
41
+ }
42
+
43
+ export class ValidationError extends ApiError {
44
+ fieldErrors: Array<{ loc: (string | number)[]; msg: string; type: string }>;
45
+ constructor(body: any, status: number, requestId: string | null);
46
+ }
47
+
48
+ export class NotFoundError extends ApiError {
49
+ constructor(body: any, status: number, requestId: string | null);
50
+ }
51
+
52
+ export class RateLimitError extends ApiError {
53
+ retryAfter: number | null;
54
+ constructor(body: any, status: number, requestId: string | null, headers: Headers);
55
+ }
56
+
57
+ export class ServerError extends ApiError {
58
+ constructor(body: any, status: number, requestId: string | null);
59
+ }
60
+
61
+ export function handleResponse(response: Response): Promise<any>;
62
+
63
+ // ── response schemas ──
64
+ export interface AlbumDisplay {
65
+ name?: string;
66
+ description?: string;
67
+ id: number;
68
+ project_table_name: string;
69
+ }
70
+
71
+ export interface AnalysisStatusResponse {
72
+ project_table_name: string;
73
+ model_or_process: string;
74
+ status: string;
75
+ last_updated_at: string;
76
+ }
77
+
78
+ export interface CompanyDisplay {
79
+ name: string;
80
+ id: number;
81
+ owner_id: number;
82
+ users?: number[];
83
+ active: boolean;
84
+ payment_plan_type: string;
85
+ }
86
+
87
+ export interface CompanyKeywordListOverview {
88
+ id: number;
89
+ name: string;
90
+ active_keywords: number;
91
+ excluded_keywords: number;
92
+ project_ids?: string[];
93
+ }
94
+
95
+ export interface CreditBalanceOutput {
96
+ sufficient_credits: boolean;
97
+ current_credit_balance: number;
98
+ credit_cost: number;
99
+ required_credits: number;
100
+ }
101
+
102
+ export interface CuratedAlbumDisplay {
103
+ id: number;
104
+ project_table_name: string;
105
+ name: string;
106
+ description?: string;
107
+ confidence_value?: number;
108
+ }
109
+
110
+ export interface HealthCheck {
111
+ status?: string;
112
+ timestamp?: string;
113
+ checks?: Record<string, any>;
114
+ }
115
+
116
+ export interface KeywordListDisplayWithList {
117
+ id: number;
118
+ user_id: number;
119
+ company_id: number;
120
+ name: string;
121
+ date_created: string;
122
+ date_last_updated: string;
123
+ is_inclusion?: boolean;
124
+ gsheet_view_link?: string;
125
+ gsheet_csv_link?: string;
126
+ gsheet_xlsx_link?: string;
127
+ list_keywords_included_or_excluded?: number[];
128
+ }
129
+
130
+ export interface KeywordListDisplayWithProjects {
131
+ id: number;
132
+ user_id: number;
133
+ company_id: number;
134
+ name: string;
135
+ date_created: string;
136
+ date_last_updated: string;
137
+ is_inclusion?: boolean;
138
+ list_projects_associated?: string[];
139
+ }
140
+
141
+ export interface PhotoDisplay {
142
+ photo_s3_link: string;
143
+ client_side_id?: string;
144
+ moment_id?: number;
145
+ file_path?: string;
146
+ image_metadata?: Record<string, any>;
147
+ tags?: string[];
148
+ title?: string;
149
+ description?: string;
150
+ format?: string;
151
+ size?: string;
152
+ source_resolution_x?: number;
153
+ source_resolution_y?: number;
154
+ date_taken?: string;
155
+ date_modified?: string;
156
+ date_guessed?: string;
157
+ date_uploaded?: string;
158
+ latitude?: number;
159
+ longitude?: number;
160
+ country_code?: string;
161
+ country?: string;
162
+ state?: string;
163
+ city?: string;
164
+ average_hash?: string;
165
+ perceptual_hash?: string;
166
+ difference_hash?: string;
167
+ wavelet_hash_haar?: string;
168
+ color_hash?: string;
169
+ reference_1_average_distance?: number;
170
+ reference_2_average_distance?: number;
171
+ reference_3_average_distance?: number;
172
+ main_color_palette?: string[];
173
+ color_averages?: string[];
174
+ labels_from_classifications_model?: Record<string, any>;
175
+ ocr_output?: Record<string, any>;
176
+ bounding_boxes_from_faces_model?: Record<string, any>[];
177
+ number_of_faces?: number;
178
+ blur_value?: number;
179
+ feature_extraction_output?: number[];
180
+ similar_photo_ids_high?: number[];
181
+ similar_photo_ids_medium?: number[];
182
+ similar_photo_ids_low?: number[];
183
+ evidence_score?: number;
184
+ face_score?: number;
185
+ content_score?: number;
186
+ aesthetic_score?: number;
187
+ similarity_set_ranking?: number;
188
+ topic?: string;
189
+ rank?: number;
190
+ hue_values?: number[];
191
+ light_values?: number[];
192
+ saturation_values?: number[];
193
+ user_id: number;
194
+ company_id: number;
195
+ id: number;
196
+ project_table_name: string;
197
+ }
198
+
199
+ export interface PhotoFace {
200
+ smile_value?: boolean;
201
+ smile_confidence?: number;
202
+ eyeglasses_value?: boolean;
203
+ eyeglasses_confidence?: number;
204
+ sunglasses_value?: boolean;
205
+ sunglasses_confidence?: number;
206
+ eyes_open_value?: boolean;
207
+ eyes_open_confidence?: number;
208
+ emotion_happy_confidence?: number;
209
+ emotion_sad_confidence?: number;
210
+ landmark_eyeleft_x?: number;
211
+ landmark_eyeleft_y?: number;
212
+ landmark_eyeright_x?: number;
213
+ landmark_eyeright_y?: number;
214
+ landmark_mouthleft_x?: number;
215
+ landmark_mouthleft_y?: number;
216
+ landmark_mouthright_x?: number;
217
+ landmark_mouthright_y?: number;
218
+ landmark_nose_x?: number;
219
+ landmark_nose_y?: number;
220
+ pose_roll?: number;
221
+ pose_yaw?: number;
222
+ pose_pitch?: number;
223
+ quality_brightness?: number;
224
+ quality_sharpness?: number;
225
+ face_occluded_value?: boolean;
226
+ eye_direction_yaw?: number;
227
+ eye_direction_pitch?: number;
228
+ eye_direction_confidence?: number;
229
+ }
230
+
231
+ export interface PhotoPersonLight {
232
+ id: number;
233
+ person_id: string;
234
+ bounding_box: Record<string, any>;
235
+ confidence: number;
236
+ person_name: string;
237
+ }
238
+
239
+ export interface PhotoPersonWithS3Link {
240
+ id: number;
241
+ person_id: string;
242
+ bounding_box: Record<string, any>;
243
+ confidence: number;
244
+ person_name: string;
245
+ photo_s3_link: string;
246
+ }
247
+
248
+ export interface ProjectRunDisplay {
249
+ name: string;
250
+ private?: boolean;
251
+ type?: number;
252
+ description?: string;
253
+ directory?: string;
254
+ photo_upload_vector?: number;
255
+ thumbnail?: string;
256
+ run_name?: string;
257
+ id: string;
258
+ user_id: number;
259
+ company_id: number;
260
+ active: boolean;
261
+ project_table_name: string;
262
+ date_created: string;
263
+ number_of_photos?: number;
264
+ date_photos_uploaded?: string;
265
+ date_deleted?: string;
266
+ top_tier?: number;
267
+ tier_2?: number;
268
+ total_photos_uploaded?: number;
269
+ gsheet_view_link?: string;
270
+ gsheet_csv_link?: string;
271
+ gsheet_xlsx_link?: string;
272
+ insights_view_link?: string;
273
+ similarity_level?: string;
274
+ blur_model?: boolean;
275
+ colors_model?: boolean;
276
+ face_recognition_model?: boolean;
277
+ image_classification_model?: boolean;
278
+ image_comparison_model?: boolean;
279
+ image_describe_model?: boolean;
280
+ ocr_model?: boolean;
281
+ similarity_model?: boolean;
282
+ personhood_model?: boolean;
283
+ evidence_model?: boolean;
284
+ insights_model?: boolean;
285
+ normalize?: boolean;
286
+ }
287
+
288
+ export interface SearchDisplay {
289
+ id: number;
290
+ project_table_name: string;
291
+ search_name: string;
292
+ and_params?: string[];
293
+ and_string_params?: string[];
294
+ or_params?: string[];
295
+ or_string_params?: string[];
296
+ not_params?: string[];
297
+ not_string_params?: string[];
298
+ date_min?: string;
299
+ date_max?: string;
300
+ date_null_and?: boolean;
301
+ date_null_or?: boolean;
302
+ date_order?: string;
303
+ custom_album_id?: number;
304
+ best_of_similar_sets_only?: boolean;
305
+ curated_album_id?: number;
306
+ }
307
+
308
+ export interface UserDisplay {
309
+ id: number;
310
+ company_id: number;
311
+ name: string;
312
+ email: string;
313
+ account_type: number;
314
+ location?: string;
315
+ phone_number?: string;
316
+ birthday?: string;
317
+ profile_picture?: string;
318
+ }
319
+
320
+ export class AiModelCredits {
321
+ getModelCreditRelationship(modelName: string): Promise<Record<string, any>>;
322
+ }
323
+
324
+ export class Admin {
325
+ getCategoryLabels(category: string): Promise<Record<string, any>>;
326
+ }
327
+
328
+ export class Company {
329
+ getCompanyById(companyId: number): Promise<CompanyDisplay>;
330
+ confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
331
+ }
332
+
333
+ export class CuratedAlbums {
334
+ createCuratedAlbum(projectTableName: string, name: string, description?: string, confidenceValue?: number): Promise<CuratedAlbumDisplay>;
335
+ getAllProjectCuratedAlbums(projectTableName: string): Promise<CuratedAlbumDisplay[]>;
336
+ getCuratedAlbumPhotos(albumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], confidenceValue?: number | number[] }): Promise<any[]>;
337
+ getCuratedAlbumPhotosRanked(albumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], confidenceValue?: number | number[] }): Promise<Record<string, any>>;
338
+ getCuratedAlbumById(albumId: number): Promise<CuratedAlbumDisplay>;
339
+ updateCuratedAlbum(albumId: number, body?: { name?: string, description?: string, confidenceValue?: number }): Promise<CuratedAlbumDisplay>;
340
+ deleteCuratedAlbum(albumId: number): Promise<Record<string, any>>;
341
+ convertCuratedAlbumToCustom(albumId: number): Promise<CuratedAlbumDisplay>;
342
+ }
343
+
344
+ export class CustomAlbums {
345
+ getCustomAlbumDetailById(customAlbumId: number): Promise<AlbumDisplay>;
346
+ getAllProjectCustomAlbums(projectTableName: string): Promise<AlbumDisplay[]>;
347
+ getCustomAlbumPhotosById(customAlbumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
348
+ getRankedCustomAlbumById(customAlbumId: number, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>>;
349
+ createProjectCustomAlbum(projectTableName: string, body?: { name?: string, description?: string, photoIdInclusionList?: number[], photoIdRemovalList?: number[] }): Promise<AlbumDisplay>;
350
+ updateCustomAlbum(albumId: number, body?: { name?: string, description?: string, photoIdInclusionList?: number[], photoIdRemovalList?: number[] }): Promise<AlbumDisplay>;
351
+ deleteCustomAlbum(albumId: number): Promise<Record<string, any>>;
352
+ }
353
+
354
+ export class EmailTokens {
355
+ requestEmailVerification(options?: { email?: string | string[] }): Promise<Record<string, any>>;
356
+ verifyEmail(token: string): Promise<Record<string, any>>;
357
+ requestPasswordReset(options?: { email?: string | string[] }): Promise<Record<string, any>>;
358
+ validateToken(token: string): Promise<Record<string, any>>;
359
+ resetPassword(token: string, newPassword: string): Promise<Record<string, any>>;
360
+ deleteUserEmailTokens(userId: number): Promise<Record<string, any>>;
361
+ }
362
+
363
+ export class Health {
364
+ healthCheck(): Promise<HealthCheck>;
365
+ livenessCheck(): Promise<HealthCheck>;
366
+ readinessCheck(): Promise<HealthCheck>;
367
+ }
368
+
369
+ export class Keywords {
370
+ createKeywordFilteringList(name: string, projectList?: string[]): Promise<KeywordListDisplayWithProjects>;
371
+ getUserKeywordFilteringLists(): Promise<KeywordListDisplayWithProjects[]>;
372
+ getCompanyKeywordLists(companyId: number): Promise<CompanyKeywordListOverview[]>;
373
+ getKeywordFilteringListAndProjectsById(keywordListId: number): Promise<KeywordListDisplayWithProjects>;
374
+ getKeywordFilteringListById(keywordListId: number): Promise<KeywordListDisplayWithList>;
375
+ getExistingKeywordFilteringListByProject(projectTableName: string): Promise<Record<string, any>>;
376
+ getDefaultKeywordFilteringListByProject(projectTableName: string): Promise<Record<string, any>>;
377
+ updateKeywordFilteringListLabels(keywordListId: number, listKeywordsToInclude: number[], listKeywordsToExclude: number[]): Promise<KeywordListDisplayWithList>;
378
+ updateKeywordFilteringListDetails(keywordListId: number, body?: { name?: string, projectList?: string[] }): Promise<KeywordListDisplayWithProjects>;
379
+ addProjectsToKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
380
+ requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
381
+ requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
382
+ getKeywordsAndIds(): Promise<any>;
383
+ removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
384
+ deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
385
+ }
386
+
387
+ export class OauthAuthorization {
388
+ authorize(options?: { responseType?: string | string[], clientId?: string | string[], redirectUri?: string | string[], state?: string | string[], codeChallenge?: string | string[], codeChallengeMethod?: string | string[] }): Promise<any>;
389
+ getConsent(sessionId: string): Promise<any>;
390
+ postApproveConsent(sessionId: string, body: { restartUrl: string }): Promise<any>;
391
+ postDenyConsent(sessionId: string, body: { restartUrl: string }): Promise<any>;
392
+ getSwitchUser(sessionId: string, options?: { restartUrl?: string | string[] }): Promise<any>;
393
+ }
394
+
395
+ export class OauthToken {
396
+ token(body: { grantType: string, code: string, redirectUri: string, clientId: string, codeVerifier: string, refreshToken: string, clientSecret: string }): Promise<Record<string, any>>;
397
+ adminRevokeUserTokens(userId: number): Promise<Record<string, any>>;
398
+ revoke(body: { token: string, tokenTypeHint: string, clientId: string }): Promise<any>;
399
+ }
400
+
401
+ export class OauthLogin {
402
+ getLogin(options?: { next?: string | string[] }): Promise<any>;
403
+ postLogin(body: { email: string, password: string, next: string }): Promise<any>;
404
+ }
405
+
406
+ export class Person {
407
+ updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
408
+ combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
409
+ splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
410
+ getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
411
+ getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
412
+ getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonLight[]>;
413
+ }
414
+
415
+ export class Photoupload {
416
+ uploadPhotoToMediaviz(companyId: string, userId: string, projectTableName: string, title: string, body: { fileContent: string, mimetype: string, filePath: string }, headerOptions?: { clientSideId?: string, blur?: string, colors?: string, faceRecognition?: string, imageDescribe?: string, imageClassification?: string, imageComparison?: string, size?: string, sourceResolutionX?: string, sourceResolutionY?: string, dateTaken?: string, latitude?: string, longitude?: string, ocr?: string }): Promise<any>;
417
+ uploadPhoto(projectTableName: string, companyId: string, userId: string, photoIndex: number, photo: Record<string, any>): Promise<any>;
418
+ }
419
+
420
+ export class Photos {
421
+ getPhotoFromProject(tableName: string, photoId: number, options?: { keywordListId?: number | number[] }): Promise<PhotoDisplay>;
422
+ getPhotoFaceDetailsFromProject(tableName: string, photoId: number): Promise<PhotoFace[]>;
423
+ getProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], includeAll?: boolean | boolean[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<any>;
424
+ getRankedProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<Record<string, any>>;
425
+ getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
426
+ getProjectThumbnail(tableName: string): Promise<any>;
427
+ updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
428
+ updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
429
+ deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
430
+ }
431
+
432
+ export class Projects {
433
+ createProjectAndRun(name: string, private_?: boolean, type?: number, description?: string, directory?: string, photoUploadVector?: number, thumbnail?: string, runName?: string, options?: { outcomes?: any, models?: any }): Promise<ProjectRunDisplay>;
434
+ markProjectUploadComplete(projectTableName: string, options?: { skippedFileCount?: number | number[] }): Promise<any>;
435
+ checkProjectStatus(projectTableName: string): Promise<any>;
436
+ getProjectPrelimModelRequestTemplate(projectTableName: string): Promise<Record<string, any>>;
437
+ getUserProjects(): Promise<ProjectRunDisplay[]>;
438
+ getAdminProjects(): Promise<ProjectRunDisplay[]>;
439
+ getProjectById(projectId: string): Promise<ProjectRunDisplay>;
440
+ getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
441
+ updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
442
+ updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
443
+ updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
444
+ requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
445
+ requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
446
+ requestProjectPersonhoodQueue(projectTableName: string): Promise<Record<string, any>>;
447
+ requestInsightsQueue(analysisLevel: string, identifier: string): Promise<Record<string, any>>;
448
+ requestProjectExport(projectTableName: string): Promise<Record<string, any>>;
449
+ getProjectDataExportUploadStatus(projectTableName: string, modelName: string): Promise<AnalysisStatusResponse>;
450
+ addProjectEvent(projectTableName: string, event: string, detail?: string): Promise<Record<string, any>>;
451
+ deleteProject(projectId: string): Promise<Record<string, any>>;
452
+ }
453
+
454
+ export class Search {
455
+ searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
456
+ searchProjectPhotosText(projectTableName: string, searchText: string, size?: number): Promise<any>;
457
+ searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number): Promise<any>;
458
+ searchProjectPhotosNaturalLanguageHybrid(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
459
+ searchProjectPhotosNaturalLanguageAuto(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[] }): Promise<Record<string, any>>;
460
+ getProjectSavedSearches(projectTableName: string): Promise<any>;
461
+ getSavedSearchById(searchId: number): Promise<SearchDisplay>;
462
+ saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
463
+ deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
464
+ }
465
+
466
+ export class Users {
467
+ createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
468
+ createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
469
+ changePassword(oldPassword: string, newPassword: string): Promise<Record<string, any>>;
470
+ getUserId(): Promise<Record<string, any>>;
471
+ getUser(userId: number): Promise<UserDisplay>;
472
+ getAllUsersByCompany(companyId: number): Promise<UserDisplay[]>;
473
+ updateUser(userId: number, body?: { name?: string, email?: string, password?: string, companyId?: number, accountType?: number, profilePicture?: string, location?: string, phoneNumber?: string, birthday?: string }): Promise<UserDisplay>;
474
+ deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
475
+ }
476
+
477
+ export class MediaViz {
478
+ constructor(config?: MediaVizConfig);
479
+ authenticate(): Promise<TokenResponse>;
480
+ getAuthorizationUrl(state?: string): Promise<AuthorizationUrlResult>;
481
+ handleCallback(code: string, codeVerifier: string): Promise<TokenResponse>;
482
+ setTokens(accessToken: string, refreshToken: string): void;
483
+ readonly accessToken: string | null;
484
+ readonly refreshToken: string | null;
485
+ readonly aiModelCredits: AiModelCredits;
486
+ readonly admin: Admin;
487
+ readonly company: Company;
488
+ readonly curatedAlbums: CuratedAlbums;
489
+ readonly customAlbums: CustomAlbums;
490
+ readonly emailTokens: EmailTokens;
491
+ readonly health: Health;
492
+ readonly keywords: Keywords;
493
+ readonly oAuthAuthorization: OauthAuthorization;
494
+ readonly oAuthToken: OauthToken;
495
+ readonly oauthLogin: OauthLogin;
496
+ readonly person: Person;
497
+ readonly photoUpload: Photoupload;
498
+ readonly photos: Photos;
499
+ readonly projects: Projects;
500
+ readonly search: Search;
501
+ readonly users: Users;
502
+ }
503
+
package/dist/sdk.esm.js CHANGED
@@ -456,6 +456,17 @@ class AiModelCredits {
456
456
  }
457
457
  }
458
458
 
459
+ class Admin {
460
+ constructor(ctx) { this._ctx = ctx; }
461
+
462
+ async getCategoryLabels(category) {
463
+ this._ctx.requireTokens();
464
+ const path = `/api/v1/admin/category_labels/${encodeURIComponent(category)}`;
465
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
466
+ return data;
467
+ }
468
+ }
469
+
459
470
  class Company {
460
471
  constructor(ctx) { this._ctx = ctx; }
461
472
 
@@ -1657,6 +1668,17 @@ class Users {
1657
1668
  const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
1658
1669
  return data;
1659
1670
  }
1671
+
1672
+ async deleteUser(userId, { newCompanyOwnerId } = {}) {
1673
+ this._ctx.requireTokens();
1674
+ let path = `/api/v1/users/delete/${encodeURIComponent(userId)}`;
1675
+ const query = new URLSearchParams();
1676
+ if (newCompanyOwnerId !== undefined) (Array.isArray(newCompanyOwnerId) ? newCompanyOwnerId : [newCompanyOwnerId]).forEach(v => query.append('new_company_owner_id', v));
1677
+ const qs = query.toString();
1678
+ if (qs) path += '?' + qs;
1679
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1680
+ return data;
1681
+ }
1660
1682
  }
1661
1683
 
1662
1684
  // Auto-generated — do not edit
@@ -1721,6 +1743,7 @@ class MediaViz {
1721
1743
 
1722
1744
  const _ctx = new _Context(this);
1723
1745
  this.aiModelCredits = new AiModelCredits(_ctx);
1746
+ this.admin = new Admin(_ctx);
1724
1747
  this.company = new Company(_ctx);
1725
1748
  this.curatedAlbums = new CuratedAlbums(_ctx);
1726
1749
  this.customAlbums = new CustomAlbums(_ctx);
@@ -1765,4 +1788,4 @@ class MediaViz {
1765
1788
  get refreshToken() { return this._refreshToken; }
1766
1789
  }
1767
1790
 
1768
- export { AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Users, ValidationError, handleResponse };
1791
+ export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Users, ValidationError, handleResponse };
package/dist/sdk.umd.js CHANGED
@@ -462,6 +462,17 @@
462
462
  }
463
463
  }
464
464
 
465
+ class Admin {
466
+ constructor(ctx) { this._ctx = ctx; }
467
+
468
+ async getCategoryLabels(category) {
469
+ this._ctx.requireTokens();
470
+ const path = `/api/v1/admin/category_labels/${encodeURIComponent(category)}`;
471
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
472
+ return data;
473
+ }
474
+ }
475
+
465
476
  class Company {
466
477
  constructor(ctx) { this._ctx = ctx; }
467
478
 
@@ -1663,6 +1674,17 @@
1663
1674
  const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
1664
1675
  return data;
1665
1676
  }
1677
+
1678
+ async deleteUser(userId, { newCompanyOwnerId } = {}) {
1679
+ this._ctx.requireTokens();
1680
+ let path = `/api/v1/users/delete/${encodeURIComponent(userId)}`;
1681
+ const query = new URLSearchParams();
1682
+ if (newCompanyOwnerId !== undefined) (Array.isArray(newCompanyOwnerId) ? newCompanyOwnerId : [newCompanyOwnerId]).forEach(v => query.append('new_company_owner_id', v));
1683
+ const qs = query.toString();
1684
+ if (qs) path += '?' + qs;
1685
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1686
+ return data;
1687
+ }
1666
1688
  }
1667
1689
 
1668
1690
  // Auto-generated — do not edit
@@ -1727,6 +1749,7 @@
1727
1749
 
1728
1750
  const _ctx = new _Context(this);
1729
1751
  this.aiModelCredits = new AiModelCredits(_ctx);
1752
+ this.admin = new Admin(_ctx);
1730
1753
  this.company = new Company(_ctx);
1731
1754
  this.curatedAlbums = new CuratedAlbums(_ctx);
1732
1755
  this.customAlbums = new CustomAlbums(_ctx);
@@ -1771,6 +1794,7 @@
1771
1794
  get refreshToken() { return this._refreshToken; }
1772
1795
  }
1773
1796
 
1797
+ exports.Admin = Admin;
1774
1798
  exports.AiModelCredits = AiModelCredits;
1775
1799
  exports.ApiError = ApiError;
1776
1800
  exports.Company = Company;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.0.65",
3
+ "version": "1.0.68",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -11,10 +11,15 @@
11
11
  "main": "./dist/sdk.cjs",
12
12
  "module": "./dist/sdk.esm.js",
13
13
  "browser": "./dist/sdk.umd.js",
14
+ "types": "./dist/sdk.d.ts",
14
15
  "exports": {
15
16
  ".": {
17
+ "types": "./dist/sdk.d.ts",
16
18
  "browser": "./dist/sdk.umd.js",
17
- "import": "./dist/sdk.esm.js",
19
+ "import": {
20
+ "types": "./dist/sdk.esm.d.ts",
21
+ "default": "./dist/sdk.esm.js"
22
+ },
18
23
  "require": "./dist/sdk.cjs",
19
24
  "default": "./dist/sdk.cjs"
20
25
  }