@mediaviz/react-native-sdk 1.10.0-dev.120 → 1.10.0-dev.122

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
 
@@ -2959,6 +2987,7 @@ exports.ValidationError = ValidationError;
2959
2987
  exports.WEBHOOK_MODEL_COLUMNS = WEBHOOK_MODEL_COLUMNS;
2960
2988
  exports.WEBHOOK_OUTCOME_MODELS = WEBHOOK_OUTCOME_MODELS;
2961
2989
  exports.WebhookConsumer = WebhookConsumer;
2990
+ exports.Webhookreceiver = Webhookreceiver;
2962
2991
  exports.configureCrypto = configureCrypto;
2963
2992
  exports.createCryptoProvider = createCryptoProvider;
2964
2993
  exports.createKeychainTokenStore = createKeychainTokenStore;
package/dist/sdk.d.cts CHANGED
@@ -410,7 +410,7 @@ export interface SubscriptionActivated {
410
410
  export interface SubscriptionDisplay {
411
411
  id: string;
412
412
  project_table_name: string;
413
- callback_url: string;
413
+ callback_url?: string;
414
414
  targets: string[];
415
415
  status: string;
416
416
  consecutive_failures: number;
@@ -581,7 +581,7 @@ export class Search {
581
581
  }
582
582
 
583
583
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
584
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
585
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
586
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
587
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +601,10 @@ export class Users {
601
601
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
602
  }
603
603
 
604
+ export class Webhookreceiver {
605
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
606
+ }
607
+
604
608
  export class MediaViz {
605
609
  constructor(config?: MediaVizConfig);
606
610
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +631,7 @@ export class MediaViz {
627
631
  readonly search: Search;
628
632
  readonly subscription: Subscription;
629
633
  readonly users: Users;
634
+ readonly webhookReceiver: Webhookreceiver;
630
635
  readonly webhooks: WebhookConsumer;
631
636
  }
632
637
 
package/dist/sdk.d.ts CHANGED
@@ -410,7 +410,7 @@ export interface SubscriptionActivated {
410
410
  export interface SubscriptionDisplay {
411
411
  id: string;
412
412
  project_table_name: string;
413
- callback_url: string;
413
+ callback_url?: string;
414
414
  targets: string[];
415
415
  status: string;
416
416
  consecutive_failures: number;
@@ -581,7 +581,7 @@ export class Search {
581
581
  }
582
582
 
583
583
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
584
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
585
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
586
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
587
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +601,10 @@ export class Users {
601
601
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
602
  }
603
603
 
604
+ export class Webhookreceiver {
605
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
606
+ }
607
+
604
608
  export class MediaViz {
605
609
  constructor(config?: MediaVizConfig);
606
610
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +631,7 @@ export class MediaViz {
627
631
  readonly search: Search;
628
632
  readonly subscription: Subscription;
629
633
  readonly users: Users;
634
+ readonly webhookReceiver: Webhookreceiver;
630
635
  readonly webhooks: WebhookConsumer;
631
636
  }
632
637
 
package/dist/sdk.esm.d.ts CHANGED
@@ -410,7 +410,7 @@ export interface SubscriptionActivated {
410
410
  export interface SubscriptionDisplay {
411
411
  id: string;
412
412
  project_table_name: string;
413
- callback_url: string;
413
+ callback_url?: string;
414
414
  targets: string[];
415
415
  status: string;
416
416
  consecutive_failures: number;
@@ -581,7 +581,7 @@ export class Search {
581
581
  }
582
582
 
583
583
  export class Subscription {
584
- createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<SubscriptionActivated>;
584
+ createSubscription(projectTableName: string, targets: string[], callbackUrl?: string): Promise<SubscriptionActivated>;
585
585
  verifySubscription(subscriptionId: string): Promise<SubscriptionActivated>;
586
586
  listSubscriptions(): Promise<SubscriptionDisplay[]>;
587
587
  listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
@@ -601,6 +601,10 @@ export class Users {
601
601
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
602
602
  }
603
603
 
604
+ export class Webhookreceiver {
605
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
606
+ }
607
+
604
608
  export class MediaViz {
605
609
  constructor(config?: MediaVizConfig);
606
610
  authenticate(): Promise<TokenResponse>;
@@ -627,6 +631,7 @@ export class MediaViz {
627
631
  readonly search: Search;
628
632
  readonly subscription: Subscription;
629
633
  readonly users: Users;
634
+ readonly webhookReceiver: Webhookreceiver;
630
635
  readonly webhooks: WebhookConsumer;
631
636
  }
632
637
 
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
 
@@ -2924,4 +2952,4 @@ var _react_native = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
2924
2952
  // Auto-generated — do not edit
2925
2953
  const { createCryptoProvider, MemoryTokenStore, createSecureTokenStore, createKeychainTokenStore, startAuthSession, parseRedirectUrl, AuthSessionError, createSession } = _react_native;
2926
2954
 
2927
- export { Admin, AiModelCredits, ApiError, AuthSessionError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, MemoryTokenStore, 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, createCryptoProvider, createKeychainTokenStore, createSecureTokenStore, createSession, handleResponse, parseRedirectUrl, selectResultColumns, signWebhookPayload, startAuthSession, verifyWebhookSignature };
2955
+ export { Admin, AiModelCredits, ApiError, AuthSessionError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, MemoryTokenStore, 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, createCryptoProvider, createKeychainTokenStore, createSecureTokenStore, createSession, handleResponse, parseRedirectUrl, selectResultColumns, signWebhookPayload, startAuthSession, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/react-native-sdk",
3
- "version": "1.10.0-dev.120",
3
+ "version": "1.10.0-dev.122",
4
4
  "description": "MediaViz React Native SDK \u2014 auto-generated endpoint client for React Native and Expo.",
5
5
  "license": "MIT",
6
6
  "repository": {