@kokimoki/app 1.8.3 → 1.9.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.
@@ -130,5 +130,11 @@ export declare class KokimokiClient<ClientContextT = any> extends KokimokiClient
130
130
  score: number;
131
131
  metadata: MetadataT;
132
132
  }>;
133
+ /**
134
+ * Send app data via webhook
135
+ */
136
+ sendWebhook<T>(event: string, data: T): Promise<{
137
+ jobId: string;
138
+ }>;
133
139
  }
134
140
  export {};
@@ -681,4 +681,15 @@ export class KokimokiClient extends EventEmitter {
681
681
  });
682
682
  return await res.json();
683
683
  }
684
+ /**
685
+ * Send app data via webhook
686
+ */
687
+ async sendWebhook(event, data) {
688
+ const res = await fetch(`${this._apiUrl}/webhooks`, {
689
+ method: "POST",
690
+ headers: this.apiHeaders,
691
+ body: JSON.stringify({ event, data }),
692
+ });
693
+ return await res.json();
694
+ }
684
695
  }
@@ -353,6 +353,12 @@ declare class KokimokiClient<ClientContextT = any> extends KokimokiClient_base {
353
353
  score: number;
354
354
  metadata: MetadataT;
355
355
  }>;
356
+ /**
357
+ * Send app data via webhook
358
+ */
359
+ sendWebhook<T>(event: string, data: T): Promise<{
360
+ jobId: string;
361
+ }>;
356
362
  }
357
363
 
358
364
  declare class RoomSubscription {
@@ -486,7 +486,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
486
486
  var eventsExports = events.exports;
487
487
  var EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs(eventsExports);
488
488
 
489
- const KOKIMOKI_APP_VERSION = "1.8.3";
489
+ const KOKIMOKI_APP_VERSION = "1.9.0";
490
490
 
491
491
  /**
492
492
  * Utility module to work with key-value stores.
@@ -15311,6 +15311,17 @@ class KokimokiClient extends EventEmitter$1 {
15311
15311
  });
15312
15312
  return await res.json();
15313
15313
  }
15314
+ /**
15315
+ * Send app data via webhook
15316
+ */
15317
+ async sendWebhook(event, data) {
15318
+ const res = await fetch(`${this._apiUrl}/webhooks`, {
15319
+ method: "POST",
15320
+ headers: this.apiHeaders,
15321
+ body: JSON.stringify({ event, data }),
15322
+ });
15323
+ return await res.json();
15324
+ }
15314
15325
  }
15315
15326
 
15316
15327
  export { KokimokiAwareness, KokimokiClient, KokimokiQueue, KokimokiSchema, KokimokiStore, RoomSubscription, RoomSubscriptionMode };