@mediaviz/sdk 1.10.0-dev.121 → 1.10.0-dev.123

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
@@ -2266,7 +2266,7 @@ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefin
2266
2266
  class Subscription {
2267
2267
  constructor(ctx) { this._ctx = ctx; }
2268
2268
 
2269
- async createSubscription(projectTableName, callbackUrl, targets) {
2269
+ async createSubscription(projectTableName, targets, callbackUrl = undefined) {
2270
2270
  this._ctx.requireTokens();
2271
2271
  const path = `/api/v1/subscriptions`;
2272
2272
  const body = stripUndef$1({
@@ -2436,6 +2436,32 @@ class Users {
2436
2436
  }
2437
2437
  }
2438
2438
 
2439
+ class Webhookreceiver {
2440
+ constructor(ctx) { this._ctx = ctx; }
2441
+
2442
+ async listSubscriptionEvents(subscriptionId, { since, limit, wait, includeHeavy } = {}) {
2443
+ this._ctx.requireTokens();
2444
+ const baseUrl = this._ctx.requireHost('webhookReceiver');
2445
+ const headers = {
2446
+ 'Content-Type': 'application/json',
2447
+ 'Authorization': `Bearer ${this._ctx.accessToken}`,
2448
+ };
2449
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
2450
+ const query = new URLSearchParams();
2451
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
2452
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
2453
+ if (wait !== undefined) (Array.isArray(wait) ? wait : [wait]).forEach(v => query.append('wait', v));
2454
+ if (includeHeavy !== undefined) (Array.isArray(includeHeavy) ? includeHeavy : [includeHeavy]).forEach(v => query.append('include_heavy', v));
2455
+ const qs = query.toString();
2456
+ if (qs) path += '?' + qs;
2457
+ const resp = await fetch(baseUrl + path, {
2458
+ method: 'GET',
2459
+ headers,
2460
+ });
2461
+ return handleResponse(resp);
2462
+ }
2463
+ }
2464
+
2439
2465
  // Auto-generated — do not edit
2440
2466
 
2441
2467
  function _env(key) {
@@ -2482,6 +2508,7 @@ class MediaViz {
2482
2508
  };
2483
2509
  this._hosts = {
2484
2510
  photoUpload: config.hosts?.photoUpload ?? _env('MEDIAVIZ_PHOTO_UPLOAD_URL'),
2511
+ webhookReceiver: config.hosts?.webhookReceiver ?? _env('MEDIAVIZ_WEBHOOK_RECEIVER_URL'),
2485
2512
  ...(config.hosts || {}),
2486
2513
  };
2487
2514
  this._accessToken = config.accessToken ?? null;
@@ -2515,6 +2542,7 @@ class MediaViz {
2515
2542
  this.search = new Search(_ctx);
2516
2543
  this.subscription = new Subscription(_ctx);
2517
2544
  this.users = new Users(_ctx);
2545
+ this.webhookReceiver = new Webhookreceiver(_ctx);
2518
2546
  this.webhooks = new WebhookConsumer(_ctx, this.subscription);
2519
2547
  }
2520
2548
 
@@ -2576,6 +2604,7 @@ exports.ValidationError = ValidationError;
2576
2604
  exports.WEBHOOK_MODEL_COLUMNS = WEBHOOK_MODEL_COLUMNS;
2577
2605
  exports.WEBHOOK_OUTCOME_MODELS = WEBHOOK_OUTCOME_MODELS;
2578
2606
  exports.WebhookConsumer = WebhookConsumer;
2607
+ exports.Webhookreceiver = Webhookreceiver;
2579
2608
  exports.configureCrypto = configureCrypto;
2580
2609
  exports.handleResponse = handleResponse;
2581
2610
  exports.selectResultColumns = selectResultColumns;
package/dist/sdk.d.cts CHANGED
@@ -330,6 +330,7 @@ export interface PhotoPersonWithS3Link {
330
330
  confidence: number;
331
331
  person_name: string;
332
332
  photo_s3_link: string;
333
+ number_of_photos: number;
333
334
  }
334
335
 
335
336
  export interface ProjectRunDisplay {
@@ -410,7 +411,7 @@ export interface SubscriptionActivated {
410
411
  export interface SubscriptionDisplay {
411
412
  id: string;
412
413
  project_table_name: string;
413
- callback_url: string;
414
+ callback_url?: string;
414
415
  targets: string[];
415
416
  status: string;
416
417
  consecutive_failures: number;
@@ -581,7 +582,7 @@ export class Search {
581
582
  }
582
583
 
583
584
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
585
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
586
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
587
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
588
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +602,10 @@ export class Users {
601
602
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
603
  }
603
604
 
605
+ export class Webhookreceiver {
606
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
607
+ }
608
+
604
609
  export class MediaViz {
605
610
  constructor(config?: MediaVizConfig);
606
611
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +632,7 @@ export class MediaViz {
627
632
  readonly search: Search;
628
633
  readonly subscription: Subscription;
629
634
  readonly users: Users;
635
+ readonly webhookReceiver: Webhookreceiver;
630
636
  readonly webhooks: WebhookConsumer;
631
637
  }
632
638
 
package/dist/sdk.d.ts CHANGED
@@ -330,6 +330,7 @@ export interface PhotoPersonWithS3Link {
330
330
  confidence: number;
331
331
  person_name: string;
332
332
  photo_s3_link: string;
333
+ number_of_photos: number;
333
334
  }
334
335
 
335
336
  export interface ProjectRunDisplay {
@@ -410,7 +411,7 @@ export interface SubscriptionActivated {
410
411
  export interface SubscriptionDisplay {
411
412
  id: string;
412
413
  project_table_name: string;
413
- callback_url: string;
414
+ callback_url?: string;
414
415
  targets: string[];
415
416
  status: string;
416
417
  consecutive_failures: number;
@@ -581,7 +582,7 @@ export class Search {
581
582
  }
582
583
 
583
584
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
585
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
586
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
587
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
588
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +602,10 @@ export class Users {
601
602
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
603
  }
603
604
 
605
+ export class Webhookreceiver {
606
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
607
+ }
608
+
604
609
  export class MediaViz {
605
610
  constructor(config?: MediaVizConfig);
606
611
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +632,7 @@ export class MediaViz {
627
632
  readonly search: Search;
628
633
  readonly subscription: Subscription;
629
634
  readonly users: Users;
635
+ readonly webhookReceiver: Webhookreceiver;
630
636
  readonly webhooks: WebhookConsumer;
631
637
  }
632
638
 
package/dist/sdk.esm.d.ts CHANGED
@@ -330,6 +330,7 @@ export interface PhotoPersonWithS3Link {
330
330
  confidence: number;
331
331
  person_name: string;
332
332
  photo_s3_link: string;
333
+ number_of_photos: number;
333
334
  }
334
335
 
335
336
  export interface ProjectRunDisplay {
@@ -410,7 +411,7 @@ export interface SubscriptionActivated {
410
411
  export interface SubscriptionDisplay {
411
412
  id: string;
412
413
  project_table_name: string;
413
- callback_url: string;
414
+ callback_url?: string;
414
415
  targets: string[];
415
416
  status: string;
416
417
  consecutive_failures: number;
@@ -581,7 +582,7 @@ export class Search {
581
582
  }
582
583
 
583
584
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
585
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
586
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
587
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
588
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +602,10 @@ export class Users {
601
602
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
603
  }
603
604
 
605
+ export class Webhookreceiver {
606
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
607
+ }
608
+
604
609
  export class MediaViz {
605
610
  constructor(config?: MediaVizConfig);
606
611
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +632,7 @@ export class MediaViz {
627
632
  readonly search: Search;
628
633
  readonly subscription: Subscription;
629
634
  readonly users: Users;
635
+ readonly webhookReceiver: Webhookreceiver;
630
636
  readonly webhooks: WebhookConsumer;
631
637
  }
632
638
 
package/dist/sdk.esm.js CHANGED
@@ -2264,7 +2264,7 @@ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefin
2264
2264
  class Subscription {
2265
2265
  constructor(ctx) { this._ctx = ctx; }
2266
2266
 
2267
- async createSubscription(projectTableName, callbackUrl, targets) {
2267
+ async createSubscription(projectTableName, targets, callbackUrl = undefined) {
2268
2268
  this._ctx.requireTokens();
2269
2269
  const path = `/api/v1/subscriptions`;
2270
2270
  const body = stripUndef$1({
@@ -2434,6 +2434,32 @@ class Users {
2434
2434
  }
2435
2435
  }
2436
2436
 
2437
+ class Webhookreceiver {
2438
+ constructor(ctx) { this._ctx = ctx; }
2439
+
2440
+ async listSubscriptionEvents(subscriptionId, { since, limit, wait, includeHeavy } = {}) {
2441
+ this._ctx.requireTokens();
2442
+ const baseUrl = this._ctx.requireHost('webhookReceiver');
2443
+ const headers = {
2444
+ 'Content-Type': 'application/json',
2445
+ 'Authorization': `Bearer ${this._ctx.accessToken}`,
2446
+ };
2447
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
2448
+ const query = new URLSearchParams();
2449
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
2450
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
2451
+ if (wait !== undefined) (Array.isArray(wait) ? wait : [wait]).forEach(v => query.append('wait', v));
2452
+ if (includeHeavy !== undefined) (Array.isArray(includeHeavy) ? includeHeavy : [includeHeavy]).forEach(v => query.append('include_heavy', v));
2453
+ const qs = query.toString();
2454
+ if (qs) path += '?' + qs;
2455
+ const resp = await fetch(baseUrl + path, {
2456
+ method: 'GET',
2457
+ headers,
2458
+ });
2459
+ return handleResponse(resp);
2460
+ }
2461
+ }
2462
+
2437
2463
  // Auto-generated — do not edit
2438
2464
 
2439
2465
  function _env(key) {
@@ -2480,6 +2506,7 @@ class MediaViz {
2480
2506
  };
2481
2507
  this._hosts = {
2482
2508
  photoUpload: config.hosts?.photoUpload ?? _env('MEDIAVIZ_PHOTO_UPLOAD_URL'),
2509
+ webhookReceiver: config.hosts?.webhookReceiver ?? _env('MEDIAVIZ_WEBHOOK_RECEIVER_URL'),
2483
2510
  ...(config.hosts || {}),
2484
2511
  };
2485
2512
  this._accessToken = config.accessToken ?? null;
@@ -2513,6 +2540,7 @@ class MediaViz {
2513
2540
  this.search = new Search(_ctx);
2514
2541
  this.subscription = new Subscription(_ctx);
2515
2542
  this.users = new Users(_ctx);
2543
+ this.webhookReceiver = new Webhookreceiver(_ctx);
2516
2544
  this.webhooks = new WebhookConsumer(_ctx, this.subscription);
2517
2545
  }
2518
2546
 
@@ -2543,4 +2571,4 @@ class MediaViz {
2543
2571
  get refreshToken() { return this._refreshToken; }
2544
2572
  }
2545
2573
 
2546
- export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, configureCrypto, handleResponse, selectResultColumns, signWebhookPayload, verifyWebhookSignature };
2574
+ export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, Webhookreceiver, configureCrypto, handleResponse, selectResultColumns, signWebhookPayload, verifyWebhookSignature };
package/dist/sdk.umd.js CHANGED
@@ -2270,7 +2270,7 @@
2270
2270
  class Subscription {
2271
2271
  constructor(ctx) { this._ctx = ctx; }
2272
2272
 
2273
- async createSubscription(projectTableName, callbackUrl, targets) {
2273
+ async createSubscription(projectTableName, targets, callbackUrl = undefined) {
2274
2274
  this._ctx.requireTokens();
2275
2275
  const path = `/api/v1/subscriptions`;
2276
2276
  const body = stripUndef$1({
@@ -2440,6 +2440,32 @@
2440
2440
  }
2441
2441
  }
2442
2442
 
2443
+ class Webhookreceiver {
2444
+ constructor(ctx) { this._ctx = ctx; }
2445
+
2446
+ async listSubscriptionEvents(subscriptionId, { since, limit, wait, includeHeavy } = {}) {
2447
+ this._ctx.requireTokens();
2448
+ const baseUrl = this._ctx.requireHost('webhookReceiver');
2449
+ const headers = {
2450
+ 'Content-Type': 'application/json',
2451
+ 'Authorization': `Bearer ${this._ctx.accessToken}`,
2452
+ };
2453
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
2454
+ const query = new URLSearchParams();
2455
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
2456
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
2457
+ if (wait !== undefined) (Array.isArray(wait) ? wait : [wait]).forEach(v => query.append('wait', v));
2458
+ if (includeHeavy !== undefined) (Array.isArray(includeHeavy) ? includeHeavy : [includeHeavy]).forEach(v => query.append('include_heavy', v));
2459
+ const qs = query.toString();
2460
+ if (qs) path += '?' + qs;
2461
+ const resp = await fetch(baseUrl + path, {
2462
+ method: 'GET',
2463
+ headers,
2464
+ });
2465
+ return handleResponse(resp);
2466
+ }
2467
+ }
2468
+
2443
2469
  // Auto-generated — do not edit
2444
2470
 
2445
2471
  function _env(key) {
@@ -2486,6 +2512,7 @@
2486
2512
  };
2487
2513
  this._hosts = {
2488
2514
  photoUpload: config.hosts?.photoUpload ?? _env('MEDIAVIZ_PHOTO_UPLOAD_URL'),
2515
+ webhookReceiver: config.hosts?.webhookReceiver ?? _env('MEDIAVIZ_WEBHOOK_RECEIVER_URL'),
2489
2516
  ...(config.hosts || {}),
2490
2517
  };
2491
2518
  this._accessToken = config.accessToken ?? null;
@@ -2519,6 +2546,7 @@
2519
2546
  this.search = new Search(_ctx);
2520
2547
  this.subscription = new Subscription(_ctx);
2521
2548
  this.users = new Users(_ctx);
2549
+ this.webhookReceiver = new Webhookreceiver(_ctx);
2522
2550
  this.webhooks = new WebhookConsumer(_ctx, this.subscription);
2523
2551
  }
2524
2552
 
@@ -2580,6 +2608,7 @@
2580
2608
  exports.WEBHOOK_MODEL_COLUMNS = WEBHOOK_MODEL_COLUMNS;
2581
2609
  exports.WEBHOOK_OUTCOME_MODELS = WEBHOOK_OUTCOME_MODELS;
2582
2610
  exports.WebhookConsumer = WebhookConsumer;
2611
+ exports.Webhookreceiver = Webhookreceiver;
2583
2612
  exports.configureCrypto = configureCrypto;
2584
2613
  exports.handleResponse = handleResponse;
2585
2614
  exports.selectResultColumns = selectResultColumns;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.10.0-dev.121",
3
+ "version": "1.10.0-dev.123",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {