@mediaviz/sdk 1.2.0 → 1.3.0

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