glitch-javascript-sdk 0.5.0 → 0.5.2
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 +57 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +33 -0
- package/dist/esm/api/TipPackagePurchases.d.ts +9 -1
- package/dist/esm/index.js +57 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +42 -1
- package/package.json +1 -1
- package/src/api/Events.ts +45 -0
- package/src/api/TipPackagePurchases.ts +13 -2
- package/src/routes/EventsRoute.ts +6 -1
- package/src/routes/TipPackagePurchaseRoute.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1077,6 +1077,39 @@ declare class Events {
|
|
|
1077
1077
|
* @returns promise
|
|
1078
1078
|
*/
|
|
1079
1079
|
static removeRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Add a Twitch Stream to the current event. The user must have authenticatd with Twitch.
|
|
1082
|
+
*
|
|
1083
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
1084
|
+
*
|
|
1085
|
+
* @param event_id The id of the event.
|
|
1086
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns promise
|
|
1089
|
+
*/
|
|
1090
|
+
static addTwitchMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Add a Facebook Stream to the current event. The user must have authenticatd with Facebook.
|
|
1093
|
+
*
|
|
1094
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
1095
|
+
*
|
|
1096
|
+
* @param event_id The id of the event.
|
|
1097
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
1098
|
+
*
|
|
1099
|
+
* @returns promise
|
|
1100
|
+
*/
|
|
1101
|
+
static addFacebookMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Add a Youtube Stream to the current event. The user must have authenticatd with Google.
|
|
1104
|
+
*
|
|
1105
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
1106
|
+
*
|
|
1107
|
+
* @param event_id The id of the event.
|
|
1108
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
1109
|
+
*
|
|
1110
|
+
* @returns promise
|
|
1111
|
+
*/
|
|
1112
|
+
static addYoutubeMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1080
1113
|
/**
|
|
1081
1114
|
* A function that should be run on an interval to set the event as live when the live stream is active.
|
|
1082
1115
|
*
|
|
@@ -1797,7 +1830,15 @@ declare class TipPackagePurchases {
|
|
|
1797
1830
|
*
|
|
1798
1831
|
* @returns A promise
|
|
1799
1832
|
*/
|
|
1800
|
-
static
|
|
1833
|
+
static getStripePaymentIntent<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1834
|
+
/**
|
|
1835
|
+
* Process the stripe payment intent after payment is complete.
|
|
1836
|
+
*
|
|
1837
|
+
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
1838
|
+
*
|
|
1839
|
+
* @returns A promise
|
|
1840
|
+
*/
|
|
1841
|
+
static processStripePaymentIntent<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1801
1842
|
}
|
|
1802
1843
|
|
|
1803
1844
|
interface Route {
|
package/package.json
CHANGED
package/src/api/Events.ts
CHANGED
|
@@ -134,6 +134,51 @@ class Events {
|
|
|
134
134
|
return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, data, { event_id: event_id, subid: stream_id }, params);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Add a Twitch Stream to the current event. The user must have authenticatd with Twitch.
|
|
139
|
+
*
|
|
140
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
141
|
+
*
|
|
142
|
+
* @param event_id The id of the event.
|
|
143
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
144
|
+
*
|
|
145
|
+
* @returns promise
|
|
146
|
+
*/
|
|
147
|
+
public static addTwitchMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
148
|
+
|
|
149
|
+
return Requests.processRoute(EventsRoutes.routes.addTwitchMulticast, data, { event_id: event_id }, params);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Add a Facebook Stream to the current event. The user must have authenticatd with Facebook.
|
|
154
|
+
*
|
|
155
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
156
|
+
*
|
|
157
|
+
* @param event_id The id of the event.
|
|
158
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
159
|
+
*
|
|
160
|
+
* @returns promise
|
|
161
|
+
*/
|
|
162
|
+
public static addFacebookMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
163
|
+
|
|
164
|
+
return Requests.processRoute(EventsRoutes.routes.addFacebookMulticast, data, { event_id: event_id }, params);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Add a Youtube Stream to the current event. The user must have authenticatd with Google.
|
|
169
|
+
*
|
|
170
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
171
|
+
*
|
|
172
|
+
* @param event_id The id of the event.
|
|
173
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
174
|
+
*
|
|
175
|
+
* @returns promise
|
|
176
|
+
*/
|
|
177
|
+
public static addYoutubeMulticast<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
178
|
+
|
|
179
|
+
return Requests.processRoute(EventsRoutes.routes.addYoutubeMulticast, data, { event_id: event_id }, params);
|
|
180
|
+
}
|
|
181
|
+
|
|
137
182
|
/**
|
|
138
183
|
* A function that should be run on an interval to set the event as live when the live stream is active.
|
|
139
184
|
*
|
|
@@ -24,8 +24,19 @@ class TipPackagePurchases {
|
|
|
24
24
|
*
|
|
25
25
|
* @returns A promise
|
|
26
26
|
*/
|
|
27
|
-
public static
|
|
28
|
-
return Requests.processRoute(TipPackagePurchaseRoute.routes.
|
|
27
|
+
public static getStripePaymentIntent<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
28
|
+
return Requests.processRoute(TipPackagePurchaseRoute.routes.getStripePaymentIntent, data, {}, params);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Process the stripe payment intent after payment is complete.
|
|
33
|
+
*
|
|
34
|
+
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
35
|
+
*
|
|
36
|
+
* @returns A promise
|
|
37
|
+
*/
|
|
38
|
+
public static processStripePaymentIntent<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
39
|
+
return Requests.processRoute(TipPackagePurchaseRoute.routes.processStripePaymentIntent, data, {}, params);
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
}
|
|
@@ -26,7 +26,12 @@ class EventsRoutes {
|
|
|
26
26
|
enableDonations : {url : '/events/{event_id}/enableDonations', method: HTTP_METHODS.POST},
|
|
27
27
|
disableDonations : {url : '/events/{event_id}/disableDonations', method : HTTP_METHODS.POST},
|
|
28
28
|
sendInvite : {url : '/events/{event_id}/sendInvite', method : HTTP_METHODS.POST},
|
|
29
|
-
acceptInvite : {url : '/events/{event_id}/acceptInvite', method : HTTP_METHODS.POST}
|
|
29
|
+
acceptInvite : {url : '/events/{event_id}/acceptInvite', method : HTTP_METHODS.POST},
|
|
30
|
+
addTwitchMulticast : {url : '/events/{event_id}/addTwitchMulticast', method : HTTP_METHODS.POST},
|
|
31
|
+
addFacebookMulticast : {url : '/events/{event_id}/addFacebookMulticast', method : HTTP_METHODS.POST},
|
|
32
|
+
addYoutubeMulticast : {url : '/events/{event_id}/addYoutubeMulticast', method : HTTP_METHODS.POST},
|
|
33
|
+
|
|
34
|
+
|
|
30
35
|
|
|
31
36
|
};
|
|
32
37
|
|
|
@@ -5,7 +5,8 @@ class TipPackagePurchaseRoute {
|
|
|
5
5
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
7
|
stripe: { url: '/tipspackagepurchases/stripe', method: HTTP_METHODS.POST },
|
|
8
|
-
|
|
8
|
+
getStripePaymentIntent: { url: '/tipspackagepurchases/getstripepaymentintent', method: HTTP_METHODS.POST },
|
|
9
|
+
processStripePaymentIntent: { url: '/tipspackagepurchases/processstripepaymentintent', method: HTTP_METHODS.POST },
|
|
9
10
|
|
|
10
11
|
};
|
|
11
12
|
|