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.
- package/dist/cjs/index.js +28 -30
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +12 -12
- package/dist/esm/index.js +28 -30
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/package.json +1 -1
- package/src/api/Events.ts +29 -29
- package/src/util/Requests.ts +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -992,7 +992,7 @@ declare class Events {
|
|
|
992
992
|
*
|
|
993
993
|
* @returns promise
|
|
994
994
|
*/
|
|
995
|
-
static removeRTMPSource<T>(event_id: string, stream_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
995
|
+
static removeRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
996
996
|
/**
|
|
997
997
|
* A function that should be run on an interval to set the event as live when the live stream is active.
|
|
998
998
|
*
|
|
@@ -1002,7 +1002,7 @@ declare class Events {
|
|
|
1002
1002
|
*
|
|
1003
1003
|
* @returns promise
|
|
1004
1004
|
*/
|
|
1005
|
-
static syncAsLive<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1005
|
+
static syncAsLive<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1006
1006
|
/**
|
|
1007
1007
|
* Updates the main image for the event using a File object.
|
|
1008
1008
|
*
|
|
@@ -1057,7 +1057,7 @@ declare class Events {
|
|
|
1057
1057
|
*
|
|
1058
1058
|
* @returns promise
|
|
1059
1059
|
*/
|
|
1060
|
-
static enableBroadcastMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1060
|
+
static enableBroadcastMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
|
|
1063
1063
|
* streaming.
|
|
@@ -1066,7 +1066,7 @@ declare class Events {
|
|
|
1066
1066
|
*
|
|
1067
1067
|
* @returns promise
|
|
1068
1068
|
*/
|
|
1069
|
-
static enableLivestreamMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1069
|
+
static enableLivestreamMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Sends content that will appear on-screen to the user.
|
|
1072
1072
|
*
|
|
@@ -1101,7 +1101,7 @@ declare class Events {
|
|
|
1101
1101
|
*
|
|
1102
1102
|
* @returns promise
|
|
1103
1103
|
*/
|
|
1104
|
-
static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
1104
|
+
static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1105
1105
|
/**
|
|
1106
1106
|
* Deletes an overlay image.
|
|
1107
1107
|
*
|
|
@@ -1112,7 +1112,7 @@ declare class Events {
|
|
|
1112
1112
|
*
|
|
1113
1113
|
* @returns promise
|
|
1114
1114
|
*/
|
|
1115
|
-
static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
1115
|
+
static removeOverlay<T>(event_id: string, overlay_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1116
1116
|
/**
|
|
1117
1117
|
* Enables an overlay so that it will appear on screen.
|
|
1118
1118
|
*
|
|
@@ -1123,7 +1123,7 @@ declare class Events {
|
|
|
1123
1123
|
*
|
|
1124
1124
|
* @returns promise
|
|
1125
1125
|
*/
|
|
1126
|
-
static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
1126
|
+
static enableOverlay<T>(event_id: string, overlay_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1127
1127
|
/**
|
|
1128
1128
|
* Disables the overlay so it no longer appears on-screen.
|
|
1129
1129
|
*
|
|
@@ -1133,7 +1133,7 @@ declare class Events {
|
|
|
1133
1133
|
*
|
|
1134
1134
|
* @returns promise
|
|
1135
1135
|
*/
|
|
1136
|
-
static disableOverlay<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
1136
|
+
static disableOverlay<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1137
1137
|
/**
|
|
1138
1138
|
* Enable the donations to appear on-screen
|
|
1139
1139
|
*
|
|
@@ -1143,16 +1143,16 @@ declare class Events {
|
|
|
1143
1143
|
*
|
|
1144
1144
|
* @returns promise
|
|
1145
1145
|
*/
|
|
1146
|
-
static enableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
1146
|
+
static enableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1147
1147
|
/**
|
|
1148
1148
|
* Disable the donations and remove from the screen.
|
|
1149
1149
|
*
|
|
1150
1150
|
* @param event_id
|
|
1151
1151
|
* @returns
|
|
1152
1152
|
*/
|
|
1153
|
-
static disableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
1154
|
-
static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
1155
|
-
static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>>;
|
|
1153
|
+
static disableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1154
|
+
static sendInvite<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1155
|
+
static acceptInvite<T>(event_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
1158
|
declare class Teams {
|
package/package.json
CHANGED
package/src/api/Events.ts
CHANGED
|
@@ -69,7 +69,7 @@ class Events {
|
|
|
69
69
|
*/
|
|
70
70
|
public static delete<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
|
-
return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id });
|
|
72
|
+
return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id }, params);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -85,7 +85,7 @@ class Events {
|
|
|
85
85
|
*/
|
|
86
86
|
public static updateInvirtuEvent<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
87
87
|
|
|
88
|
-
return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id });
|
|
88
|
+
return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id }, params);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/**
|
|
@@ -100,7 +100,7 @@ class Events {
|
|
|
100
100
|
*/
|
|
101
101
|
public static addRTMPSource<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
102
102
|
|
|
103
|
-
return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id });
|
|
103
|
+
return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id }, params);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -115,7 +115,7 @@ class Events {
|
|
|
115
115
|
*/
|
|
116
116
|
public static updateRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
117
117
|
|
|
118
|
-
return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id });
|
|
118
|
+
return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -128,9 +128,9 @@ class Events {
|
|
|
128
128
|
*
|
|
129
129
|
* @returns promise
|
|
130
130
|
*/
|
|
131
|
-
public static removeRTMPSource<T>(event_id: string, stream_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
131
|
+
public static removeRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
132
132
|
|
|
133
|
-
return Requests.processRoute(EventsRoutes.routes.removeRTMPSource,
|
|
133
|
+
return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
@@ -142,9 +142,9 @@ class Events {
|
|
|
142
142
|
*
|
|
143
143
|
* @returns promise
|
|
144
144
|
*/
|
|
145
|
-
public static syncAsLive<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
145
|
+
public static syncAsLive<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
146
146
|
|
|
147
|
-
return Requests.processRoute(EventsRoutes.routes.syncAsLive,
|
|
147
|
+
return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
@@ -225,9 +225,9 @@ class Events {
|
|
|
225
225
|
*
|
|
226
226
|
* @returns promise
|
|
227
227
|
*/
|
|
228
|
-
public static enableBroadcastMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
228
|
+
public static enableBroadcastMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
229
229
|
|
|
230
|
-
return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode,
|
|
230
|
+
return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, data, { event_id: event_id }, params);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/**
|
|
@@ -238,9 +238,9 @@ class Events {
|
|
|
238
238
|
*
|
|
239
239
|
* @returns promise
|
|
240
240
|
*/
|
|
241
|
-
public static enableLivestreamMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
241
|
+
public static enableLivestreamMode<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
242
242
|
|
|
243
|
-
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode,
|
|
243
|
+
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
@@ -255,7 +255,7 @@ class Events {
|
|
|
255
255
|
*/
|
|
256
256
|
public static sendOnScreenContent<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
257
257
|
|
|
258
|
-
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id });
|
|
258
|
+
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }, params);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
/**
|
|
@@ -287,7 +287,7 @@ class Events {
|
|
|
287
287
|
*
|
|
288
288
|
* @returns promise
|
|
289
289
|
*/
|
|
290
|
-
public static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
|
|
290
|
+
public static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
291
291
|
|
|
292
292
|
let url = EventsRoutes.routes.addOverlay.url.replace('{event_id}', event_id);
|
|
293
293
|
|
|
@@ -304,9 +304,9 @@ class Events {
|
|
|
304
304
|
*
|
|
305
305
|
* @returns promise
|
|
306
306
|
*/
|
|
307
|
-
public static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>> {
|
|
307
|
+
public static removeOverlay<T>(event_id: string, overlay_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
308
308
|
|
|
309
|
-
return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id });
|
|
309
|
+
return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id }, params);
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
/**
|
|
@@ -319,9 +319,9 @@ class Events {
|
|
|
319
319
|
*
|
|
320
320
|
* @returns promise
|
|
321
321
|
*/
|
|
322
|
-
public static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>> {
|
|
322
|
+
public static enableOverlay<T>(event_id: string, overlay_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
323
323
|
|
|
324
|
-
return Requests.processRoute(EventsRoutes.routes.enableOverlay,
|
|
324
|
+
return Requests.processRoute(EventsRoutes.routes.enableOverlay, data, { event_id: event_id, subid: overlay_id }, params);
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
/**
|
|
@@ -333,9 +333,9 @@ class Events {
|
|
|
333
333
|
*
|
|
334
334
|
* @returns promise
|
|
335
335
|
*/
|
|
336
|
-
public static disableOverlay<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
336
|
+
public static disableOverlay<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
337
337
|
|
|
338
|
-
return Requests.processRoute(EventsRoutes.routes.disableOverlay,
|
|
338
|
+
return Requests.processRoute(EventsRoutes.routes.disableOverlay, data, { event_id: event_id }, params);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
/**
|
|
@@ -347,30 +347,30 @@ class Events {
|
|
|
347
347
|
*
|
|
348
348
|
* @returns promise
|
|
349
349
|
*/
|
|
350
|
-
public static enableDonations<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
350
|
+
public static enableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
351
351
|
|
|
352
|
-
return Requests.processRoute(EventsRoutes.routes.enableDonations,
|
|
352
|
+
return Requests.processRoute(EventsRoutes.routes.enableDonations, data, { event_id: event_id }, params);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
/**
|
|
356
356
|
* Disable the donations and remove from the screen.
|
|
357
357
|
*
|
|
358
358
|
* @param event_id
|
|
359
|
-
* @returns
|
|
359
|
+
* @returns
|
|
360
360
|
*/
|
|
361
|
-
public static disableDonations<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
361
|
+
public static disableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
362
362
|
|
|
363
|
-
return Requests.processRoute(EventsRoutes.routes.disableDonations,
|
|
363
|
+
return Requests.processRoute(EventsRoutes.routes.disableDonations, data, { event_id: event_id }, params);
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
public static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>> {
|
|
366
|
+
public static sendInvite<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
367
367
|
|
|
368
|
-
return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id });
|
|
368
|
+
return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id }, params);
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
public static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>> {
|
|
371
|
+
public static acceptInvite<T>(event_id: string, token: string , params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
372
372
|
|
|
373
|
-
return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id });
|
|
373
|
+
return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id }, params);
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
|
package/src/util/Requests.ts
CHANGED
|
@@ -46,7 +46,6 @@ class Requests {
|
|
|
46
46
|
* @param token
|
|
47
47
|
*/
|
|
48
48
|
public static setCommunityID(community_id : string | undefined) {
|
|
49
|
-
console.log("setting communty_id", community_id);
|
|
50
49
|
this.community_id = community_id;
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -103,8 +102,7 @@ class Requests {
|
|
|
103
102
|
.join('&');
|
|
104
103
|
url = `${url}?${queryString}`;
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
console.log("Community ID in Request", this.community_id);
|
|
105
|
+
|
|
108
106
|
if (this.community_id) {
|
|
109
107
|
// Check if the URL already contains query parameters
|
|
110
108
|
const separator = url.includes('?') ? '&' : '?';
|