glitch-javascript-sdk 1.2.6 → 1.2.7
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 +148 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/GameShows.d.ts +97 -0
- package/dist/esm/api/Influencers.d.ts +8 -0
- package/dist/esm/api/Publications.d.ts +1 -1
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +148 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/GameShowsRoute.d.ts +7 -0
- package/dist/index.d.ts +104 -0
- package/package.json +1 -1
- package/src/api/GameShows.ts +145 -0
- package/src/api/Influencers.ts +11 -0
- package/src/api/Publications.ts +1 -1
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/GameShowsRoute.ts +18 -0
- package/src/routes/InfluencerRoutes.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -3333,6 +3333,14 @@ declare class Influencers {
|
|
|
3333
3333
|
* @returns promise
|
|
3334
3334
|
*/
|
|
3335
3335
|
static listContracts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3336
|
+
/**
|
|
3337
|
+
* Download the influencer work
|
|
3338
|
+
*
|
|
3339
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/downloadInfluencersWorkbook
|
|
3340
|
+
*
|
|
3341
|
+
* @returns promise
|
|
3342
|
+
*/
|
|
3343
|
+
static workbook<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3336
3344
|
}
|
|
3337
3345
|
|
|
3338
3346
|
declare class Games {
|
|
@@ -3380,7 +3388,102 @@ declare class Publications {
|
|
|
3380
3388
|
*
|
|
3381
3389
|
* @returns Promise
|
|
3382
3390
|
*/
|
|
3391
|
+
static download<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
declare class GameShows {
|
|
3395
|
+
/**
|
|
3396
|
+
* List all the GameShows.
|
|
3397
|
+
*
|
|
3398
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/getGameShows
|
|
3399
|
+
*
|
|
3400
|
+
* @returns promise
|
|
3401
|
+
*/
|
|
3402
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3403
|
+
/**
|
|
3404
|
+
* Create a new game show.
|
|
3405
|
+
*
|
|
3406
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/createGameShow
|
|
3407
|
+
*
|
|
3408
|
+
* @param data The data to be passed when creating a game show.
|
|
3409
|
+
*
|
|
3410
|
+
* @returns Promise
|
|
3411
|
+
*/
|
|
3383
3412
|
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3413
|
+
/**
|
|
3414
|
+
* Update a game show.
|
|
3415
|
+
*
|
|
3416
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/updateGameShow
|
|
3417
|
+
*
|
|
3418
|
+
* @param show_id The id of the game show to update.
|
|
3419
|
+
* @param data The data to update.
|
|
3420
|
+
*
|
|
3421
|
+
* @returns promise
|
|
3422
|
+
*/
|
|
3423
|
+
static update<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3424
|
+
/**
|
|
3425
|
+
* Retrieve the information for a single game show.
|
|
3426
|
+
*
|
|
3427
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/getGameShowByUuid
|
|
3428
|
+
*
|
|
3429
|
+
* @param show_id The id fo the game show to retrieve.
|
|
3430
|
+
*
|
|
3431
|
+
* @returns promise
|
|
3432
|
+
*/
|
|
3433
|
+
static view<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3434
|
+
/**
|
|
3435
|
+
* Deletes a game show.
|
|
3436
|
+
*
|
|
3437
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/deleteGameShow
|
|
3438
|
+
*
|
|
3439
|
+
* @param show_id The id of the game show to delete.
|
|
3440
|
+
* @returns promise
|
|
3441
|
+
*/
|
|
3442
|
+
static delete<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3443
|
+
/**
|
|
3444
|
+
* Updates the main image for the game show using a File object.
|
|
3445
|
+
*
|
|
3446
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowLogo
|
|
3447
|
+
*
|
|
3448
|
+
* @param file The file object to upload.
|
|
3449
|
+
* @param data Any additional data to pass along to the upload.
|
|
3450
|
+
*
|
|
3451
|
+
* @returns promise
|
|
3452
|
+
*/
|
|
3453
|
+
static uploadLogoFile<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3454
|
+
/**
|
|
3455
|
+
* Updates the main image for the game show using a Blob.
|
|
3456
|
+
*
|
|
3457
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowLogo
|
|
3458
|
+
*
|
|
3459
|
+
* @param blob The blob to upload.
|
|
3460
|
+
* @param data Any additional data to pass along to the upload
|
|
3461
|
+
*
|
|
3462
|
+
* @returns promise
|
|
3463
|
+
*/
|
|
3464
|
+
static uploadLogoBlob<T>(show_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3465
|
+
/**
|
|
3466
|
+
* Updates the banner image for the game show using a File object.
|
|
3467
|
+
*
|
|
3468
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
3469
|
+
*
|
|
3470
|
+
* @param file The file object to upload.
|
|
3471
|
+
* @param data Any additional data to pass along to the upload.
|
|
3472
|
+
*
|
|
3473
|
+
* @returns promise
|
|
3474
|
+
*/
|
|
3475
|
+
static uploadBannerImageFile<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3476
|
+
/**
|
|
3477
|
+
* Updates the banner image for the game show using a Blob.
|
|
3478
|
+
*
|
|
3479
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
3480
|
+
*
|
|
3481
|
+
* @param blob The blob to upload.
|
|
3482
|
+
* @param data Any additional data to pass along to the upload
|
|
3483
|
+
*
|
|
3484
|
+
* @returns promise
|
|
3485
|
+
*/
|
|
3486
|
+
static uploadBannerImageBlob<T>(show_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3384
3487
|
}
|
|
3385
3488
|
|
|
3386
3489
|
interface Route {
|
|
@@ -3689,6 +3792,7 @@ declare class Glitch {
|
|
|
3689
3792
|
Users: typeof Users;
|
|
3690
3793
|
Events: typeof Events;
|
|
3691
3794
|
Games: typeof Games;
|
|
3795
|
+
GameShows: typeof GameShows;
|
|
3692
3796
|
Feedback: typeof Feedback;
|
|
3693
3797
|
Influencers: typeof Influencers;
|
|
3694
3798
|
Teams: typeof Teams;
|
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import GameShowsRoute from "../routes/GameShowsRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class GameShows {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* List all the GameShows.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/getGameShows
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(GameShowsRoute.routes.list, undefined, undefined, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new game show.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/createGameShow
|
|
23
|
+
*
|
|
24
|
+
* @param data The data to be passed when creating a game show.
|
|
25
|
+
*
|
|
26
|
+
* @returns Promise
|
|
27
|
+
*/
|
|
28
|
+
public static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
29
|
+
|
|
30
|
+
return Requests.processRoute(GameShowsRoute.routes.create, data, undefined, params);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Update a game show.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/updateGameShow
|
|
37
|
+
*
|
|
38
|
+
* @param show_id The id of the game show to update.
|
|
39
|
+
* @param data The data to update.
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
public static update<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
44
|
+
|
|
45
|
+
return Requests.processRoute(GameShowsRoute.routes.update, data, { show_id: show_id }, params);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve the information for a single game show.
|
|
50
|
+
*
|
|
51
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/getGameShowByUuid
|
|
52
|
+
*
|
|
53
|
+
* @param show_id The id fo the game show to retrieve.
|
|
54
|
+
*
|
|
55
|
+
* @returns promise
|
|
56
|
+
*/
|
|
57
|
+
public static view<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
58
|
+
|
|
59
|
+
return Requests.processRoute(GameShowsRoute.routes.view, {}, { show_id: show_id }, params);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a game show.
|
|
64
|
+
*
|
|
65
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/deleteGameShow
|
|
66
|
+
*
|
|
67
|
+
* @param show_id The id of the game show to delete.
|
|
68
|
+
* @returns promise
|
|
69
|
+
*/
|
|
70
|
+
public static delete<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
|
+
|
|
72
|
+
return Requests.processRoute(GameShowsRoute.routes.delete, {}, { show_id: show_id }, params);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Updates the main image for the game show using a File object.
|
|
77
|
+
*
|
|
78
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowLogo
|
|
79
|
+
*
|
|
80
|
+
* @param file The file object to upload.
|
|
81
|
+
* @param data Any additional data to pass along to the upload.
|
|
82
|
+
*
|
|
83
|
+
* @returns promise
|
|
84
|
+
*/
|
|
85
|
+
public static uploadLogoFile<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
86
|
+
|
|
87
|
+
let url = GameShowsRoute.routes.uploadLogo.url.replace('{show_id}', show_id);
|
|
88
|
+
|
|
89
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Updates the main image for the game show using a Blob.
|
|
94
|
+
*
|
|
95
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowLogo
|
|
96
|
+
*
|
|
97
|
+
* @param blob The blob to upload.
|
|
98
|
+
* @param data Any additional data to pass along to the upload
|
|
99
|
+
*
|
|
100
|
+
* @returns promise
|
|
101
|
+
*/
|
|
102
|
+
public static uploadLogoBlob<T>(show_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
103
|
+
|
|
104
|
+
let url = GameShowsRoute.routes.uploadLogo.url.replace('{show_id}', show_id);
|
|
105
|
+
|
|
106
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Updates the banner image for the game show using a File object.
|
|
111
|
+
*
|
|
112
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
113
|
+
*
|
|
114
|
+
* @param file The file object to upload.
|
|
115
|
+
* @param data Any additional data to pass along to the upload.
|
|
116
|
+
*
|
|
117
|
+
* @returns promise
|
|
118
|
+
*/
|
|
119
|
+
public static uploadBannerImageFile<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
120
|
+
|
|
121
|
+
let url = GameShowsRoute.routes.uploadBannerImage.url.replace('{show_id}', show_id);
|
|
122
|
+
|
|
123
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Updates the banner image for the game show using a Blob.
|
|
128
|
+
*
|
|
129
|
+
* @see https://api.glitch.fun/api/documentation#/GameShows/uploadGameShowBannerImage
|
|
130
|
+
*
|
|
131
|
+
* @param blob The blob to upload.
|
|
132
|
+
* @param data Any additional data to pass along to the upload
|
|
133
|
+
*
|
|
134
|
+
* @returns promise
|
|
135
|
+
*/
|
|
136
|
+
public static uploadBannerImageBlob<T>(show_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
137
|
+
|
|
138
|
+
let url = GameShowsRoute.routes.uploadBannerImage.url.replace('{show_id}', show_id);
|
|
139
|
+
|
|
140
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default GameShows;
|
package/src/api/Influencers.ts
CHANGED
|
@@ -115,6 +115,17 @@ class Influencers {
|
|
|
115
115
|
return Requests.processRoute(InfluencerRoutes.routes.listContracts, undefined, undefined, params);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Download the influencer work
|
|
120
|
+
*
|
|
121
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/downloadInfluencersWorkbook
|
|
122
|
+
*
|
|
123
|
+
* @returns promise
|
|
124
|
+
*/
|
|
125
|
+
public static workbook<T>(data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
126
|
+
return Requests.processRoute(InfluencerRoutes.routes.workbook, data, {}, params);
|
|
127
|
+
}
|
|
128
|
+
|
|
118
129
|
|
|
119
130
|
}
|
|
120
131
|
|
package/src/api/Publications.ts
CHANGED
|
@@ -25,7 +25,7 @@ class Publications {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static
|
|
28
|
+
public static download<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
30
|
return Requests.processRoute(PublicationsRoutes.routes.download, data, undefined, params);
|
|
31
31
|
}
|
package/src/api/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import Feedback from "./Feedback";
|
|
|
22
22
|
import Influencers from "./Influencers";
|
|
23
23
|
import Games from "./Games";
|
|
24
24
|
import Publications from "./Publications";
|
|
25
|
+
import GameShows from "./GameShows";
|
|
25
26
|
|
|
26
27
|
export {Auth};
|
|
27
28
|
export {Competitions};
|
|
@@ -46,4 +47,5 @@ export {Messages};
|
|
|
46
47
|
export {Feedback};
|
|
47
48
|
export {Influencers};
|
|
48
49
|
export {Games};
|
|
49
|
-
export {Publications};
|
|
50
|
+
export {Publications};
|
|
51
|
+
export {GameShows};
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {Feedback} from "./api";
|
|
|
26
26
|
import {Influencers} from "./api";
|
|
27
27
|
import {Games} from "./api";
|
|
28
28
|
import {Publications} from "./api";
|
|
29
|
+
import {GameShows} from "./api";
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
@@ -66,6 +67,7 @@ class Glitch {
|
|
|
66
67
|
Users: Users,
|
|
67
68
|
Events: Events,
|
|
68
69
|
Games : Games,
|
|
70
|
+
GameShows : GameShows,
|
|
69
71
|
Feedback : Feedback,
|
|
70
72
|
Influencers : Influencers,
|
|
71
73
|
Teams: Teams,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class GameShowsRoute {
|
|
5
|
+
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
list: { url: '/gameshows', method: HTTP_METHODS.GET },
|
|
8
|
+
create: { url: '/gameshows', method: HTTP_METHODS.POST },
|
|
9
|
+
view : { url: '/gameshows/{show_id}', method: HTTP_METHODS.GET },
|
|
10
|
+
update :{ url: '/gameshows/{show_id}', method: HTTP_METHODS.PUT },
|
|
11
|
+
delete : { url: '/gameshows/{show_id}', method: HTTP_METHODS.DELETE },
|
|
12
|
+
uploadLogo : {url : '/gameshows/{show_id}/uploadLogo', method: HTTP_METHODS.POST},
|
|
13
|
+
uploadBannerImage : {url : '/gameshows/{show_id}/uploadBannerImage', method: HTTP_METHODS.POST},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default GameShowsRoute;
|
|
@@ -14,6 +14,7 @@ class InfluencerRoutes {
|
|
|
14
14
|
updateNote: { url: '/influencers/{influencer_id}/notes/{note_id}', method: HTTP_METHODS.PUT },
|
|
15
15
|
deleteNote: { url: '/influencers/{influencer_id}/notes/{note_id}', method: HTTP_METHODS.DELETE },
|
|
16
16
|
listContracts: { url: '/influencers/contracts', method: HTTP_METHODS.GET },
|
|
17
|
+
workbook : { url: '/influencers/workbook', method: HTTP_METHODS.POST },
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
}
|