glitch-javascript-sdk 0.2.7 → 0.2.8

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.
@@ -93,7 +93,7 @@ declare class Events {
93
93
  *
94
94
  * @returns promise
95
95
  */
96
- static removeRTMPSource<T>(event_id: string, stream_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
96
+ static removeRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
97
97
  /**
98
98
  * A function that should be run on an interval to set the event as live when the live stream is active.
99
99
  *
@@ -103,7 +103,7 @@ declare class Events {
103
103
  *
104
104
  * @returns promise
105
105
  */
106
- static syncAsLive<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
106
+ static syncAsLive<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
107
107
  /**
108
108
  * Updates the main image for the event using a File object.
109
109
  *
@@ -158,7 +158,7 @@ declare class Events {
158
158
  *
159
159
  * @returns promise
160
160
  */
161
- static enableBroadcastMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
161
+ static enableBroadcastMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
162
162
  /**
163
163
  * Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
164
164
  * streaming.
@@ -167,7 +167,7 @@ declare class Events {
167
167
  *
168
168
  * @returns promise
169
169
  */
170
- static enableLivestreamMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
170
+ static enableLivestreamMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
171
171
  /**
172
172
  * Sends content that will appear on-screen to the user.
173
173
  *
@@ -202,7 +202,7 @@ declare class Events {
202
202
  *
203
203
  * @returns promise
204
204
  */
205
- static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
205
+ static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
206
206
  /**
207
207
  * Deletes an overlay image.
208
208
  *
@@ -213,7 +213,7 @@ declare class Events {
213
213
  *
214
214
  * @returns promise
215
215
  */
216
- static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
216
+ static removeOverlay<T>(event_id: string, overlay_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
217
217
  /**
218
218
  * Enables an overlay so that it will appear on screen.
219
219
  *
@@ -224,7 +224,7 @@ declare class Events {
224
224
  *
225
225
  * @returns promise
226
226
  */
227
- static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
227
+ static enableOverlay<T>(event_id: string, overlay_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
228
228
  /**
229
229
  * Disables the overlay so it no longer appears on-screen.
230
230
  *
@@ -234,7 +234,7 @@ declare class Events {
234
234
  *
235
235
  * @returns promise
236
236
  */
237
- static disableOverlay<T>(event_id: string): AxiosPromise<Response<T>>;
237
+ static disableOverlay<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
238
238
  /**
239
239
  * Enable the donations to appear on-screen
240
240
  *
@@ -244,15 +244,15 @@ declare class Events {
244
244
  *
245
245
  * @returns promise
246
246
  */
247
- static enableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
247
+ static enableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
248
248
  /**
249
249
  * Disable the donations and remove from the screen.
250
250
  *
251
251
  * @param event_id
252
252
  * @returns
253
253
  */
254
- static disableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
255
- static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
256
- static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>>;
254
+ static disableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
255
+ static sendInvite<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
256
+ static acceptInvite<T>(event_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
257
257
  }
258
258
  export default Events;
package/dist/esm/index.js CHANGED
@@ -29868,7 +29868,6 @@ var Requests = /** @class */ (function () {
29868
29868
  * @param token
29869
29869
  */
29870
29870
  Requests.setCommunityID = function (community_id) {
29871
- console.log("setting communty_id", community_id);
29872
29871
  this.community_id = community_id;
29873
29872
  };
29874
29873
  Requests.request = function (method, url, data, fileData) {
@@ -29909,7 +29908,6 @@ var Requests = /** @class */ (function () {
29909
29908
  .join('&');
29910
29909
  url = "".concat(url, "?").concat(queryString);
29911
29910
  }
29912
- console.log("Community ID in Request", this.community_id);
29913
29911
  if (this.community_id) {
29914
29912
  // Check if the URL already contains query parameters
29915
29913
  var separator = url.includes('?') ? '&' : '?';
@@ -31356,7 +31354,7 @@ var Events = /** @class */ (function () {
31356
31354
  * @returns promise
31357
31355
  */
31358
31356
  Events.delete = function (event_id, params) {
31359
- return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id });
31357
+ return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id }, params);
31360
31358
  };
31361
31359
  /**
31362
31360
  * The event is synced with Invirtu for the lie streams. This will allow you to update
@@ -31370,7 +31368,7 @@ var Events = /** @class */ (function () {
31370
31368
  * @returns promise
31371
31369
  */
31372
31370
  Events.updateInvirtuEvent = function (event_id, data, params) {
31373
- return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id });
31371
+ return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id }, params);
31374
31372
  };
31375
31373
  /**
31376
31374
  * Add an RTMP source to multicast a stream too.
@@ -31383,7 +31381,7 @@ var Events = /** @class */ (function () {
31383
31381
  * @returns promise
31384
31382
  */
31385
31383
  Events.addRTMPSource = function (event_id, data, params) {
31386
- return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id });
31384
+ return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id }, params);
31387
31385
  };
31388
31386
  /**
31389
31387
  * Update an RTMP Source for multicasing.
@@ -31396,7 +31394,7 @@ var Events = /** @class */ (function () {
31396
31394
  * @returns promise
31397
31395
  */
31398
31396
  Events.updateRTMPSource = function (event_id, stream_id, data, params) {
31399
- return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id });
31397
+ return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
31400
31398
  };
31401
31399
  /**
31402
31400
  * Remove a RTMP source for multicasing.
@@ -31408,8 +31406,8 @@ var Events = /** @class */ (function () {
31408
31406
  *
31409
31407
  * @returns promise
31410
31408
  */
31411
- Events.removeRTMPSource = function (event_id, stream_id, params) {
31412
- return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, {}, { event_id: event_id, subid: stream_id });
31409
+ Events.removeRTMPSource = function (event_id, stream_id, data, params) {
31410
+ return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
31413
31411
  };
31414
31412
  /**
31415
31413
  * A function that should be run on an interval to set the event as live when the live stream is active.
@@ -31420,8 +31418,8 @@ var Events = /** @class */ (function () {
31420
31418
  *
31421
31419
  * @returns promise
31422
31420
  */
31423
- Events.syncAsLive = function (event_id, params) {
31424
- return Requests.processRoute(EventsRoutes.routes.syncAsLive, {}, { event_id: event_id });
31421
+ Events.syncAsLive = function (event_id, data, params) {
31422
+ return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
31425
31423
  };
31426
31424
  /**
31427
31425
  * Updates the main image for the event using a File object.
@@ -31489,8 +31487,8 @@ var Events = /** @class */ (function () {
31489
31487
  *
31490
31488
  * @returns promise
31491
31489
  */
31492
- Events.enableBroadcastMode = function (event_id, params) {
31493
- return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, {}, { event_id: event_id });
31490
+ Events.enableBroadcastMode = function (event_id, data, params) {
31491
+ return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, data, { event_id: event_id }, params);
31494
31492
  };
31495
31493
  /**
31496
31494
  * Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
@@ -31500,8 +31498,8 @@ var Events = /** @class */ (function () {
31500
31498
  *
31501
31499
  * @returns promise
31502
31500
  */
31503
- Events.enableLivestreamMode = function (event_id, params) {
31504
- return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, {}, { event_id: event_id });
31501
+ Events.enableLivestreamMode = function (event_id, data, params) {
31502
+ return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
31505
31503
  };
31506
31504
  /**
31507
31505
  * Sends content that will appear on-screen to the user.
@@ -31514,7 +31512,7 @@ var Events = /** @class */ (function () {
31514
31512
  * @returns promise
31515
31513
  */
31516
31514
  Events.sendOnScreenContent = function (event_id, data, params) {
31517
- return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id });
31515
+ return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
31518
31516
  };
31519
31517
  /**
31520
31518
  * Uploads an image that can be used and overlay later. A File object is used.
@@ -31542,7 +31540,7 @@ var Events = /** @class */ (function () {
31542
31540
  *
31543
31541
  * @returns promise
31544
31542
  */
31545
- Events.addOverlayAsBlob = function (event_id, blob, data) {
31543
+ Events.addOverlayAsBlob = function (event_id, blob, data, params) {
31546
31544
  var url = EventsRoutes.routes.addOverlay.url.replace('{event_id}', event_id);
31547
31545
  return Requests.uploadBlob(url, 'image', blob, data);
31548
31546
  };
@@ -31556,8 +31554,8 @@ var Events = /** @class */ (function () {
31556
31554
  *
31557
31555
  * @returns promise
31558
31556
  */
31559
- Events.removeOverlay = function (event_id, overlay_id) {
31560
- return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id });
31557
+ Events.removeOverlay = function (event_id, overlay_id, params) {
31558
+ return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id }, params);
31561
31559
  };
31562
31560
  /**
31563
31561
  * Enables an overlay so that it will appear on screen.
@@ -31569,8 +31567,8 @@ var Events = /** @class */ (function () {
31569
31567
  *
31570
31568
  * @returns promise
31571
31569
  */
31572
- Events.enableOverlay = function (event_id, overlay_id) {
31573
- return Requests.processRoute(EventsRoutes.routes.enableOverlay, {}, { event_id: event_id, subid: overlay_id });
31570
+ Events.enableOverlay = function (event_id, overlay_id, data, params) {
31571
+ return Requests.processRoute(EventsRoutes.routes.enableOverlay, data, { event_id: event_id, subid: overlay_id }, params);
31574
31572
  };
31575
31573
  /**
31576
31574
  * Disables the overlay so it no longer appears on-screen.
@@ -31581,8 +31579,8 @@ var Events = /** @class */ (function () {
31581
31579
  *
31582
31580
  * @returns promise
31583
31581
  */
31584
- Events.disableOverlay = function (event_id) {
31585
- return Requests.processRoute(EventsRoutes.routes.disableOverlay, {}, { event_id: event_id });
31582
+ Events.disableOverlay = function (event_id, data, params) {
31583
+ return Requests.processRoute(EventsRoutes.routes.disableOverlay, data, { event_id: event_id }, params);
31586
31584
  };
31587
31585
  /**
31588
31586
  * Enable the donations to appear on-screen
@@ -31593,8 +31591,8 @@ var Events = /** @class */ (function () {
31593
31591
  *
31594
31592
  * @returns promise
31595
31593
  */
31596
- Events.enableDonations = function (event_id) {
31597
- return Requests.processRoute(EventsRoutes.routes.enableDonations, {}, { event_id: event_id });
31594
+ Events.enableDonations = function (event_id, data, params) {
31595
+ return Requests.processRoute(EventsRoutes.routes.enableDonations, data, { event_id: event_id }, params);
31598
31596
  };
31599
31597
  /**
31600
31598
  * Disable the donations and remove from the screen.
@@ -31602,14 +31600,14 @@ var Events = /** @class */ (function () {
31602
31600
  * @param event_id
31603
31601
  * @returns
31604
31602
  */
31605
- Events.disableDonations = function (event_id) {
31606
- return Requests.processRoute(EventsRoutes.routes.disableDonations, {}, { event_id: event_id });
31603
+ Events.disableDonations = function (event_id, data, params) {
31604
+ return Requests.processRoute(EventsRoutes.routes.disableDonations, data, { event_id: event_id }, params);
31607
31605
  };
31608
- Events.sendInvite = function (event_id, data) {
31609
- return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id });
31606
+ Events.sendInvite = function (event_id, data, params) {
31607
+ return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id }, params);
31610
31608
  };
31611
- Events.acceptInvite = function (event_id, token) {
31612
- return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id });
31609
+ Events.acceptInvite = function (event_id, token, params) {
31610
+ return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id }, params);
31613
31611
  };
31614
31612
  return Events;
31615
31613
  }());