glitch-javascript-sdk 0.2.7 → 0.2.9

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.
@@ -205,5 +205,15 @@ declare class Communities {
205
205
  * @returns promise
206
206
  */
207
207
  static findByDomain<T>(domain: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
208
+ /**
209
+ * Has a user join a community. The join is executed using the current user's authentication token.
210
+ *
211
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
212
+ *
213
+ * @param community_id The id of the community to update.
214
+ *
215
+ * @returns promise
216
+ */
217
+ static join<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
208
218
  }
209
219
  export default Communities;
@@ -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('?') ? '&' : '?';
@@ -30850,6 +30848,7 @@ var CommunitiesRoute = /** @class */ (function () {
30850
30848
  showUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.GET },
30851
30849
  updateUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.PUT },
30852
30850
  removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
30851
+ join: { url: '/communities/{community_id}/join', method: HTTP_METHODS.POST },
30853
30852
  findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET }
30854
30853
  };
30855
30854
  return CommunitiesRoute;
@@ -31108,6 +31107,18 @@ var Communities = /** @class */ (function () {
31108
31107
  Communities.findByDomain = function (domain, params) {
31109
31108
  return Requests.processRoute(CommunitiesRoute.routes.findByDomain, {}, { domain: domain }, params);
31110
31109
  };
31110
+ /**
31111
+ * Has a user join a community. The join is executed using the current user's authentication token.
31112
+ *
31113
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
31114
+ *
31115
+ * @param community_id The id of the community to update.
31116
+ *
31117
+ * @returns promise
31118
+ */
31119
+ Communities.join = function (community_id, data, params) {
31120
+ return Requests.processRoute(CommunitiesRoute.routes.join, data, { community_id: community_id }, params);
31121
+ };
31111
31122
  return Communities;
31112
31123
  }());
31113
31124
 
@@ -31356,7 +31367,7 @@ var Events = /** @class */ (function () {
31356
31367
  * @returns promise
31357
31368
  */
31358
31369
  Events.delete = function (event_id, params) {
31359
- return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id });
31370
+ return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id }, params);
31360
31371
  };
31361
31372
  /**
31362
31373
  * The event is synced with Invirtu for the lie streams. This will allow you to update
@@ -31370,7 +31381,7 @@ var Events = /** @class */ (function () {
31370
31381
  * @returns promise
31371
31382
  */
31372
31383
  Events.updateInvirtuEvent = function (event_id, data, params) {
31373
- return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id });
31384
+ return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id }, params);
31374
31385
  };
31375
31386
  /**
31376
31387
  * Add an RTMP source to multicast a stream too.
@@ -31383,7 +31394,7 @@ var Events = /** @class */ (function () {
31383
31394
  * @returns promise
31384
31395
  */
31385
31396
  Events.addRTMPSource = function (event_id, data, params) {
31386
- return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id });
31397
+ return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id }, params);
31387
31398
  };
31388
31399
  /**
31389
31400
  * Update an RTMP Source for multicasing.
@@ -31396,7 +31407,7 @@ var Events = /** @class */ (function () {
31396
31407
  * @returns promise
31397
31408
  */
31398
31409
  Events.updateRTMPSource = function (event_id, stream_id, data, params) {
31399
- return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id });
31410
+ return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
31400
31411
  };
31401
31412
  /**
31402
31413
  * Remove a RTMP source for multicasing.
@@ -31408,8 +31419,8 @@ var Events = /** @class */ (function () {
31408
31419
  *
31409
31420
  * @returns promise
31410
31421
  */
31411
- Events.removeRTMPSource = function (event_id, stream_id, params) {
31412
- return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, {}, { event_id: event_id, subid: stream_id });
31422
+ Events.removeRTMPSource = function (event_id, stream_id, data, params) {
31423
+ return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
31413
31424
  };
31414
31425
  /**
31415
31426
  * A function that should be run on an interval to set the event as live when the live stream is active.
@@ -31420,8 +31431,8 @@ var Events = /** @class */ (function () {
31420
31431
  *
31421
31432
  * @returns promise
31422
31433
  */
31423
- Events.syncAsLive = function (event_id, params) {
31424
- return Requests.processRoute(EventsRoutes.routes.syncAsLive, {}, { event_id: event_id });
31434
+ Events.syncAsLive = function (event_id, data, params) {
31435
+ return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
31425
31436
  };
31426
31437
  /**
31427
31438
  * Updates the main image for the event using a File object.
@@ -31489,8 +31500,8 @@ var Events = /** @class */ (function () {
31489
31500
  *
31490
31501
  * @returns promise
31491
31502
  */
31492
- Events.enableBroadcastMode = function (event_id, params) {
31493
- return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, {}, { event_id: event_id });
31503
+ Events.enableBroadcastMode = function (event_id, data, params) {
31504
+ return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, data, { event_id: event_id }, params);
31494
31505
  };
31495
31506
  /**
31496
31507
  * Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
@@ -31500,8 +31511,8 @@ var Events = /** @class */ (function () {
31500
31511
  *
31501
31512
  * @returns promise
31502
31513
  */
31503
- Events.enableLivestreamMode = function (event_id, params) {
31504
- return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, {}, { event_id: event_id });
31514
+ Events.enableLivestreamMode = function (event_id, data, params) {
31515
+ return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
31505
31516
  };
31506
31517
  /**
31507
31518
  * Sends content that will appear on-screen to the user.
@@ -31514,7 +31525,7 @@ var Events = /** @class */ (function () {
31514
31525
  * @returns promise
31515
31526
  */
31516
31527
  Events.sendOnScreenContent = function (event_id, data, params) {
31517
- return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id });
31528
+ return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
31518
31529
  };
31519
31530
  /**
31520
31531
  * Uploads an image that can be used and overlay later. A File object is used.
@@ -31542,7 +31553,7 @@ var Events = /** @class */ (function () {
31542
31553
  *
31543
31554
  * @returns promise
31544
31555
  */
31545
- Events.addOverlayAsBlob = function (event_id, blob, data) {
31556
+ Events.addOverlayAsBlob = function (event_id, blob, data, params) {
31546
31557
  var url = EventsRoutes.routes.addOverlay.url.replace('{event_id}', event_id);
31547
31558
  return Requests.uploadBlob(url, 'image', blob, data);
31548
31559
  };
@@ -31556,8 +31567,8 @@ var Events = /** @class */ (function () {
31556
31567
  *
31557
31568
  * @returns promise
31558
31569
  */
31559
- Events.removeOverlay = function (event_id, overlay_id) {
31560
- return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id });
31570
+ Events.removeOverlay = function (event_id, overlay_id, params) {
31571
+ return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id }, params);
31561
31572
  };
31562
31573
  /**
31563
31574
  * Enables an overlay so that it will appear on screen.
@@ -31569,8 +31580,8 @@ var Events = /** @class */ (function () {
31569
31580
  *
31570
31581
  * @returns promise
31571
31582
  */
31572
- Events.enableOverlay = function (event_id, overlay_id) {
31573
- return Requests.processRoute(EventsRoutes.routes.enableOverlay, {}, { event_id: event_id, subid: overlay_id });
31583
+ Events.enableOverlay = function (event_id, overlay_id, data, params) {
31584
+ return Requests.processRoute(EventsRoutes.routes.enableOverlay, data, { event_id: event_id, subid: overlay_id }, params);
31574
31585
  };
31575
31586
  /**
31576
31587
  * Disables the overlay so it no longer appears on-screen.
@@ -31581,8 +31592,8 @@ var Events = /** @class */ (function () {
31581
31592
  *
31582
31593
  * @returns promise
31583
31594
  */
31584
- Events.disableOverlay = function (event_id) {
31585
- return Requests.processRoute(EventsRoutes.routes.disableOverlay, {}, { event_id: event_id });
31595
+ Events.disableOverlay = function (event_id, data, params) {
31596
+ return Requests.processRoute(EventsRoutes.routes.disableOverlay, data, { event_id: event_id }, params);
31586
31597
  };
31587
31598
  /**
31588
31599
  * Enable the donations to appear on-screen
@@ -31593,8 +31604,8 @@ var Events = /** @class */ (function () {
31593
31604
  *
31594
31605
  * @returns promise
31595
31606
  */
31596
- Events.enableDonations = function (event_id) {
31597
- return Requests.processRoute(EventsRoutes.routes.enableDonations, {}, { event_id: event_id });
31607
+ Events.enableDonations = function (event_id, data, params) {
31608
+ return Requests.processRoute(EventsRoutes.routes.enableDonations, data, { event_id: event_id }, params);
31598
31609
  };
31599
31610
  /**
31600
31611
  * Disable the donations and remove from the screen.
@@ -31602,14 +31613,14 @@ var Events = /** @class */ (function () {
31602
31613
  * @param event_id
31603
31614
  * @returns
31604
31615
  */
31605
- Events.disableDonations = function (event_id) {
31606
- return Requests.processRoute(EventsRoutes.routes.disableDonations, {}, { event_id: event_id });
31616
+ Events.disableDonations = function (event_id, data, params) {
31617
+ return Requests.processRoute(EventsRoutes.routes.disableDonations, data, { event_id: event_id }, params);
31607
31618
  };
31608
- Events.sendInvite = function (event_id, data) {
31609
- return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id });
31619
+ Events.sendInvite = function (event_id, data, params) {
31620
+ return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id }, params);
31610
31621
  };
31611
- Events.acceptInvite = function (event_id, token) {
31612
- return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id });
31622
+ Events.acceptInvite = function (event_id, token, params) {
31623
+ return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id }, params);
31613
31624
  };
31614
31625
  return Events;
31615
31626
  }());