glitch-javascript-sdk 0.3.3 → 0.3.5
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 +49 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +12 -0
- package/dist/esm/api/Posts.d.ts +22 -0
- package/dist/esm/index.js +49 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +34 -0
- package/package.json +1 -1
- package/src/api/Events.ts +17 -0
- package/src/api/Posts.ts +31 -0
- package/src/routes/RecordingRoute.ts +1 -5
package/dist/index.d.ts
CHANGED
|
@@ -1163,6 +1163,18 @@ declare class Events {
|
|
|
1163
1163
|
static disableDonations<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1164
1164
|
static sendInvite<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1165
1165
|
static acceptInvite<T>(event_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1166
|
+
/**
|
|
1167
|
+
* Update a recording related to an event.
|
|
1168
|
+
*
|
|
1169
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
1170
|
+
*
|
|
1171
|
+
* @param event_id The id of the event to update.
|
|
1172
|
+
* @param recording_id The id of the recording to update.
|
|
1173
|
+
* @param data The data to update.
|
|
1174
|
+
*
|
|
1175
|
+
* @returns promise
|
|
1176
|
+
*/
|
|
1177
|
+
static updateRecording<T>(event_id: string, recording_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1166
1178
|
}
|
|
1167
1179
|
|
|
1168
1180
|
declare class Teams {
|
|
@@ -1412,6 +1424,28 @@ declare class Posts {
|
|
|
1412
1424
|
* @returns Promise
|
|
1413
1425
|
*/
|
|
1414
1426
|
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Create a new post with a file. The file should either be an image or video.
|
|
1429
|
+
*
|
|
1430
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
1431
|
+
*
|
|
1432
|
+
* @param file The file object to upload.
|
|
1433
|
+
* @param data Any additional data to pass along to the upload.
|
|
1434
|
+
*
|
|
1435
|
+
* @returns promise
|
|
1436
|
+
*/
|
|
1437
|
+
static createWithFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Create a new post with a blob. The blob should either be an image or video.
|
|
1440
|
+
*
|
|
1441
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
1442
|
+
*
|
|
1443
|
+
* @param file The blob to upload.
|
|
1444
|
+
* @param data Any additional data to pass along to the upload.
|
|
1445
|
+
*
|
|
1446
|
+
* @returns promise
|
|
1447
|
+
*/
|
|
1448
|
+
static createWithBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
1415
1449
|
/**
|
|
1416
1450
|
* Update a post.
|
|
1417
1451
|
*
|
package/package.json
CHANGED
package/src/api/Events.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import EventsRoutes from "../routes/EventsRoute";
|
|
2
|
+
import RecordingsRoute from "../routes/RecordingRoute";
|
|
2
3
|
import Requests from "../util/Requests";
|
|
3
4
|
import Response from "../util/Response";
|
|
4
5
|
import { AxiosPromise } from "axios";
|
|
@@ -373,6 +374,22 @@ class Events {
|
|
|
373
374
|
return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id }, params);
|
|
374
375
|
}
|
|
375
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Update a recording related to an event.
|
|
379
|
+
*
|
|
380
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventRecording
|
|
381
|
+
*
|
|
382
|
+
* @param event_id The id of the event to update.
|
|
383
|
+
* @param recording_id The id of the recording to update.
|
|
384
|
+
* @param data The data to update.
|
|
385
|
+
*
|
|
386
|
+
* @returns promise
|
|
387
|
+
*/
|
|
388
|
+
public static updateRecording<T>(event_id: string, recording_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
389
|
+
|
|
390
|
+
return Requests.processRoute(RecordingsRoute.routes.update, data, { event_id: event_id, recording_id : recording_id }, params);
|
|
391
|
+
}
|
|
392
|
+
|
|
376
393
|
|
|
377
394
|
}
|
|
378
395
|
|
package/src/api/Posts.ts
CHANGED
|
@@ -30,6 +30,37 @@ class Posts {
|
|
|
30
30
|
return Requests.processRoute(PostsRoute.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Create a new post with a file. The file should either be an image or video.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
37
|
+
*
|
|
38
|
+
* @param file The file object to upload.
|
|
39
|
+
* @param data Any additional data to pass along to the upload.
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
public static createWithFile<T>(file : File, data? : object): AxiosPromise<Response<T>> {
|
|
44
|
+
|
|
45
|
+
return Requests.uploadFile(PostsRoute.routes.create.url, 'file', file, data);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Create a new post with a blob. The blob should either be an image or video.
|
|
50
|
+
*
|
|
51
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
52
|
+
*
|
|
53
|
+
* @param file The blob to upload.
|
|
54
|
+
* @param data Any additional data to pass along to the upload.
|
|
55
|
+
*
|
|
56
|
+
* @returns promise
|
|
57
|
+
*/
|
|
58
|
+
public static createWithBlob<T>(blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
59
|
+
|
|
60
|
+
return Requests.uploadBlob(PostsRoute.routes.create.url, 'file', blob, data);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
33
64
|
/**
|
|
34
65
|
* Update a post.
|
|
35
66
|
*
|
|
@@ -4,11 +4,7 @@ import HTTP_METHODS from "../constants/HttpMethods";
|
|
|
4
4
|
class RecordingsRoute {
|
|
5
5
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
|
-
|
|
8
|
-
register: { url: '/auth/register', method: HTTP_METHODS.POST },
|
|
9
|
-
one_time_login : { url: '/auth/oneTimeLoginWithToken', method: HTTP_METHODS.POST },
|
|
10
|
-
forgot_password :{ url: '/auth/forgotpassword', method: HTTP_METHODS.POST },
|
|
11
|
-
reset_password : { url: '/auth/resetpassword', method: HTTP_METHODS.POST },
|
|
7
|
+
update: { url: '/events/{event_id}/recording/{recording_id}', method: HTTP_METHODS.PUT },
|
|
12
8
|
};
|
|
13
9
|
|
|
14
10
|
}
|