glitch-javascript-sdk 0.2.0 → 0.2.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 +409 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +201 -0
- package/dist/esm/api/Templates.d.ts +97 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +409 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/CommunitiesRoute.d.ts +7 -0
- package/dist/esm/routes/TemplatesRoute.d.ts +7 -0
- package/dist/index.d.ts +296 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +290 -0
- package/src/api/Templates.ts +145 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +4 -0
- package/src/routes/CommunitiesRoute.ts +27 -0
- package/src/routes/TemplatesRoute.ts +18 -0
- package/src/util/Requests.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -568,6 +568,205 @@ declare class Competitions {
|
|
|
568
568
|
static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
+
declare class Communities {
|
|
572
|
+
/**
|
|
573
|
+
* List all the communities.
|
|
574
|
+
*
|
|
575
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/resourceCommunityList
|
|
576
|
+
*
|
|
577
|
+
* @returns promise
|
|
578
|
+
*/
|
|
579
|
+
static list<T>(): AxiosPromise<Response<T>>;
|
|
580
|
+
/**
|
|
581
|
+
* Create a new community.
|
|
582
|
+
*
|
|
583
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/newCommunityResourceStorage
|
|
584
|
+
*
|
|
585
|
+
* @param data The data to be passed when creating a community.
|
|
586
|
+
*
|
|
587
|
+
* @returns Promise
|
|
588
|
+
*/
|
|
589
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
590
|
+
/**
|
|
591
|
+
* Update a community.
|
|
592
|
+
*
|
|
593
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
|
|
594
|
+
*
|
|
595
|
+
* @param community_id The id of the community to update.
|
|
596
|
+
* @param data The data to update.
|
|
597
|
+
*
|
|
598
|
+
* @returns promise
|
|
599
|
+
*/
|
|
600
|
+
static update<T>(community_id: string, data: object): AxiosPromise<Response<T>>;
|
|
601
|
+
/**
|
|
602
|
+
* Retrieve the information for a single community.
|
|
603
|
+
*
|
|
604
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/showCommunityStorage
|
|
605
|
+
*
|
|
606
|
+
* @param community_id The id fo the community to retrieve.
|
|
607
|
+
*
|
|
608
|
+
* @returns promise
|
|
609
|
+
*/
|
|
610
|
+
static view<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
611
|
+
/**
|
|
612
|
+
* Deletes a community.
|
|
613
|
+
*
|
|
614
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/destoryCommunityStorage
|
|
615
|
+
*
|
|
616
|
+
* @param community_id The id of the community to delete.
|
|
617
|
+
* @returns promise
|
|
618
|
+
*/
|
|
619
|
+
static delete<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
620
|
+
/**
|
|
621
|
+
* Updates the main image for the community using a File object.
|
|
622
|
+
*
|
|
623
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
|
|
624
|
+
*
|
|
625
|
+
* @param file The file object to upload.
|
|
626
|
+
* @param data Any additional data to pass along to the upload.
|
|
627
|
+
*
|
|
628
|
+
* @returns promise
|
|
629
|
+
*/
|
|
630
|
+
static uploadLogoFile<T>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
631
|
+
/**
|
|
632
|
+
* Updates the main image for the community using a Blob.
|
|
633
|
+
*
|
|
634
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
|
|
635
|
+
*
|
|
636
|
+
* @param blob The blob to upload.
|
|
637
|
+
* @param data Any additional data to pass along to the upload
|
|
638
|
+
*
|
|
639
|
+
* @returns promise
|
|
640
|
+
*/
|
|
641
|
+
static uploadLogoBlob<T>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
642
|
+
/**
|
|
643
|
+
* Updates the banner image for the community using a File object.
|
|
644
|
+
*
|
|
645
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
646
|
+
*
|
|
647
|
+
* @param file The file object to upload.
|
|
648
|
+
* @param data Any additional data to pass along to the upload.
|
|
649
|
+
*
|
|
650
|
+
* @returns promise
|
|
651
|
+
*/
|
|
652
|
+
static uploadBannerImageFile<T>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
653
|
+
/**
|
|
654
|
+
* Updates the banner image for the community using a Blob.
|
|
655
|
+
*
|
|
656
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
657
|
+
*
|
|
658
|
+
* @param blob The blob to upload.
|
|
659
|
+
* @param data Any additional data to pass along to the upload
|
|
660
|
+
*
|
|
661
|
+
* @returns promise
|
|
662
|
+
*/
|
|
663
|
+
static uploadBannerImageBlob<T>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
664
|
+
/**
|
|
665
|
+
* Updates the banner image for the community using a File object.
|
|
666
|
+
*
|
|
667
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
668
|
+
*
|
|
669
|
+
* @param file The file object to upload.
|
|
670
|
+
* @param data Any additional data to pass along to the upload.
|
|
671
|
+
*
|
|
672
|
+
* @returns promise
|
|
673
|
+
*/
|
|
674
|
+
static uploadVideoLogoFile<T>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
675
|
+
/**
|
|
676
|
+
* Updates the banner image for the community using a Blob.
|
|
677
|
+
*
|
|
678
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
679
|
+
*
|
|
680
|
+
* @param blob The blob to upload.
|
|
681
|
+
* @param data Any additional data to pass along to the upload
|
|
682
|
+
*
|
|
683
|
+
* @returns promise
|
|
684
|
+
*/
|
|
685
|
+
static uploadVideoLogoBlob<T>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
686
|
+
/**
|
|
687
|
+
* List the invites that have been sent for the community to users.
|
|
688
|
+
*
|
|
689
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
690
|
+
*
|
|
691
|
+
* @param community_id The id of the community
|
|
692
|
+
*
|
|
693
|
+
* @returns promise
|
|
694
|
+
*/
|
|
695
|
+
static listInvites<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
696
|
+
/**
|
|
697
|
+
* Send an invitation to a user to join the community.
|
|
698
|
+
*
|
|
699
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitySendInvite
|
|
700
|
+
*
|
|
701
|
+
* @param community_id The id of the community.
|
|
702
|
+
* @param data The data that will be passed into sending an invite.
|
|
703
|
+
*
|
|
704
|
+
* @returns promise
|
|
705
|
+
*/
|
|
706
|
+
static sendInvite<T>(community_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
707
|
+
/**
|
|
708
|
+
* Accept an invite to a community. The JSON Web Token (JWT) must be related to the token.
|
|
709
|
+
*
|
|
710
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
|
|
711
|
+
*
|
|
712
|
+
* @param community_id The id of the community
|
|
713
|
+
* @param token The token required to accept the user.
|
|
714
|
+
*
|
|
715
|
+
* @returns promise
|
|
716
|
+
*/
|
|
717
|
+
static acceptInvite<T>(community_id: string, token: string): AxiosPromise<Response<T>>;
|
|
718
|
+
/**
|
|
719
|
+
* List the users who are currently associated with the community.
|
|
720
|
+
*
|
|
721
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityUserList
|
|
722
|
+
*
|
|
723
|
+
* @param community_id The id of the community.
|
|
724
|
+
*
|
|
725
|
+
* @returns promise
|
|
726
|
+
*/
|
|
727
|
+
static listUsers<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
728
|
+
/**
|
|
729
|
+
* Add a user to a community.
|
|
730
|
+
*
|
|
731
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/createcommunityUser
|
|
732
|
+
*
|
|
733
|
+
* @param community_id The id of the community.
|
|
734
|
+
* @param data The data to be passed when adding a user.
|
|
735
|
+
*
|
|
736
|
+
* @returns promise
|
|
737
|
+
*/
|
|
738
|
+
static addUser<T>(community_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
739
|
+
/**
|
|
740
|
+
* Retrieves a single user and their information that is associated with a community.
|
|
741
|
+
*
|
|
742
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/showcommunityUser
|
|
743
|
+
*
|
|
744
|
+
* @param community_id The id of the community.
|
|
745
|
+
* @param user_id The id of the user.
|
|
746
|
+
*
|
|
747
|
+
* @returns promise
|
|
748
|
+
*/
|
|
749
|
+
static getUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
750
|
+
/**
|
|
751
|
+
* Updates the users information associated with the community.
|
|
752
|
+
*
|
|
753
|
+
* @param community_id The id of the community.
|
|
754
|
+
* @param user_id The id of the user.
|
|
755
|
+
*
|
|
756
|
+
* @returns promise
|
|
757
|
+
*/
|
|
758
|
+
static updatetUser<T>(community_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
759
|
+
/**
|
|
760
|
+
* Removes a user from a community.
|
|
761
|
+
*
|
|
762
|
+
* @param community_id The id of community.
|
|
763
|
+
* @param user_id The id of the user.
|
|
764
|
+
*
|
|
765
|
+
* @returns promise
|
|
766
|
+
*/
|
|
767
|
+
static removetUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
768
|
+
}
|
|
769
|
+
|
|
571
770
|
declare class Users {
|
|
572
771
|
/**
|
|
573
772
|
* List all the users.
|
|
@@ -1165,6 +1364,101 @@ declare class Waitlists {
|
|
|
1165
1364
|
static delete<T>(waitlist_id: string): AxiosPromise<Response<T>>;
|
|
1166
1365
|
}
|
|
1167
1366
|
|
|
1367
|
+
declare class Templates {
|
|
1368
|
+
/**
|
|
1369
|
+
* List all the templates.
|
|
1370
|
+
*
|
|
1371
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/resourceTemplateList
|
|
1372
|
+
*
|
|
1373
|
+
* @returns promise
|
|
1374
|
+
*/
|
|
1375
|
+
static list<T>(): AxiosPromise<Response<T>>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Create a new template.
|
|
1378
|
+
*
|
|
1379
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/newTemplateResourceStorage
|
|
1380
|
+
*
|
|
1381
|
+
* @param data The data to be passed when creating a template.
|
|
1382
|
+
*
|
|
1383
|
+
* @returns Promise
|
|
1384
|
+
*/
|
|
1385
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
1386
|
+
/**
|
|
1387
|
+
* Update a template.
|
|
1388
|
+
*
|
|
1389
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/updateTemplateStorage
|
|
1390
|
+
*
|
|
1391
|
+
* @param template_id The id of the template to update.
|
|
1392
|
+
* @param data The data to update.
|
|
1393
|
+
*
|
|
1394
|
+
* @returns promise
|
|
1395
|
+
*/
|
|
1396
|
+
static update<T>(template_id: string, data: object): AxiosPromise<Response<T>>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Retrieve the information for a single template.
|
|
1399
|
+
*
|
|
1400
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/showTemplateStorage
|
|
1401
|
+
*
|
|
1402
|
+
* @param template_id The id fo the template to retrieve.
|
|
1403
|
+
*
|
|
1404
|
+
* @returns promise
|
|
1405
|
+
*/
|
|
1406
|
+
static view<T>(template_id: string): AxiosPromise<Response<T>>;
|
|
1407
|
+
/**
|
|
1408
|
+
* Deletes a template.
|
|
1409
|
+
*
|
|
1410
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/destoryTemplateStorage
|
|
1411
|
+
*
|
|
1412
|
+
* @param template_id The id of the template to delete.
|
|
1413
|
+
* @returns promise
|
|
1414
|
+
*/
|
|
1415
|
+
static delete<T>(template_id: string): AxiosPromise<Response<T>>;
|
|
1416
|
+
/**
|
|
1417
|
+
* Updates the logo for the template using a File object.
|
|
1418
|
+
*
|
|
1419
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadLogoTemplateImage
|
|
1420
|
+
*
|
|
1421
|
+
* @param file The file object to upload.
|
|
1422
|
+
* @param data Any additional data to pass along to the upload.
|
|
1423
|
+
*
|
|
1424
|
+
* @returns promise
|
|
1425
|
+
*/
|
|
1426
|
+
static uploadLogoFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Updates the logo for the template using a Blob.
|
|
1429
|
+
*
|
|
1430
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadLogoTemplateImage
|
|
1431
|
+
*
|
|
1432
|
+
* @param blob The blob to upload.
|
|
1433
|
+
* @param data Any additional data to pass along to the upload
|
|
1434
|
+
*
|
|
1435
|
+
* @returns promise
|
|
1436
|
+
*/
|
|
1437
|
+
static uploadLogoBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Updates the main image for the template using a File object.
|
|
1440
|
+
*
|
|
1441
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadMainTemplateImage
|
|
1442
|
+
*
|
|
1443
|
+
* @param file The file object to upload.
|
|
1444
|
+
* @param data Any additional data to pass along to the upload.
|
|
1445
|
+
*
|
|
1446
|
+
* @returns promise
|
|
1447
|
+
*/
|
|
1448
|
+
static uploadMainImageFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Updates the main image for the template using a Blob.
|
|
1451
|
+
*
|
|
1452
|
+
* @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadMainTemplateImage
|
|
1453
|
+
*
|
|
1454
|
+
* @param blob The blob to upload.
|
|
1455
|
+
* @param data Any additional data to pass along to the upload
|
|
1456
|
+
*
|
|
1457
|
+
* @returns promise
|
|
1458
|
+
*/
|
|
1459
|
+
static uploadMainImageBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1168
1462
|
interface Route {
|
|
1169
1463
|
url: string;
|
|
1170
1464
|
method: string;
|
|
@@ -1332,9 +1626,11 @@ declare class Glitch {
|
|
|
1332
1626
|
static api: {
|
|
1333
1627
|
Auth: typeof Auth;
|
|
1334
1628
|
Competitions: typeof Competitions;
|
|
1629
|
+
Communities: typeof Communities;
|
|
1335
1630
|
Users: typeof Users;
|
|
1336
1631
|
Events: typeof Events;
|
|
1337
1632
|
Teams: typeof Teams;
|
|
1633
|
+
Templates: typeof Templates;
|
|
1338
1634
|
Waitlists: typeof Waitlists;
|
|
1339
1635
|
};
|
|
1340
1636
|
static util: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import CommunitiesRoute from "../routes/CommunitiesRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class Communities {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* List all the communities.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/resourceCommunityList
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static list<T>() : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(CommunitiesRoute.routes.list);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new community.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/newCommunityResourceStorage
|
|
23
|
+
*
|
|
24
|
+
* @param data The data to be passed when creating a community.
|
|
25
|
+
*
|
|
26
|
+
* @returns Promise
|
|
27
|
+
*/
|
|
28
|
+
public static create<T>(data : object) : AxiosPromise<Response<T>> {
|
|
29
|
+
|
|
30
|
+
return Requests.processRoute(CommunitiesRoute.routes.create, data);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Update a community.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
|
|
37
|
+
*
|
|
38
|
+
* @param community_id The id of the community to update.
|
|
39
|
+
* @param data The data to update.
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
public static update<T>(community_id : string, data : object) : AxiosPromise<Response<T>>{
|
|
44
|
+
|
|
45
|
+
return Requests.processRoute(CommunitiesRoute.routes.create, data, {community_id : community_id});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve the information for a single community.
|
|
50
|
+
*
|
|
51
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/showCommunityStorage
|
|
52
|
+
*
|
|
53
|
+
* @param community_id The id fo the community to retrieve.
|
|
54
|
+
*
|
|
55
|
+
* @returns promise
|
|
56
|
+
*/
|
|
57
|
+
public static view<T>(community_id : string) : AxiosPromise<Response<T>> {
|
|
58
|
+
|
|
59
|
+
return Requests.processRoute(CommunitiesRoute.routes.view, {}, {community_id : community_id});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a community.
|
|
64
|
+
*
|
|
65
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/destoryCommunityStorage
|
|
66
|
+
*
|
|
67
|
+
* @param community_id The id of the community to delete.
|
|
68
|
+
* @returns promise
|
|
69
|
+
*/
|
|
70
|
+
public static delete<T>(community_id : string) : AxiosPromise<Response<T>> {
|
|
71
|
+
|
|
72
|
+
return Requests.processRoute(CommunitiesRoute.routes.delete, {}, {community_id : community_id});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Updates the main image for the community using a File object.
|
|
77
|
+
*
|
|
78
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
|
|
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>(community_id: string, file : File, data? : object): AxiosPromise<Response<T>> {
|
|
86
|
+
|
|
87
|
+
let url = CommunitiesRoute.routes.uploadLogo.url.replace('{community_id}', community_id);
|
|
88
|
+
|
|
89
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Updates the main image for the community using a Blob.
|
|
94
|
+
*
|
|
95
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
|
|
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>(community_id: string, blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
103
|
+
|
|
104
|
+
let url = CommunitiesRoute.routes.uploadLogo.url.replace('{community_id}', community_id);
|
|
105
|
+
|
|
106
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Updates the banner image for the community using a File object.
|
|
111
|
+
*
|
|
112
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
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>(community_id: string, file : File, data? : object): AxiosPromise<Response<T>> {
|
|
120
|
+
|
|
121
|
+
let url = CommunitiesRoute.routes.uploadBannerImage.url.replace('{community_id}', community_id);
|
|
122
|
+
|
|
123
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Updates the banner image for the community using a Blob.
|
|
128
|
+
*
|
|
129
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
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>(community_id: string, blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
137
|
+
|
|
138
|
+
let url = CommunitiesRoute.routes.uploadBannerImage.url.replace('{community_id}', community_id);
|
|
139
|
+
|
|
140
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Updates the banner image for the community using a File object.
|
|
145
|
+
*
|
|
146
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
147
|
+
*
|
|
148
|
+
* @param file The file object to upload.
|
|
149
|
+
* @param data Any additional data to pass along to the upload.
|
|
150
|
+
*
|
|
151
|
+
* @returns promise
|
|
152
|
+
*/
|
|
153
|
+
public static uploadVideoLogoFile<T>(community_id: string, file : File, data? : object): AxiosPromise<Response<T>> {
|
|
154
|
+
|
|
155
|
+
let url = CommunitiesRoute.routes.uploadVideoLogo.url.replace('{community_id}', community_id);
|
|
156
|
+
|
|
157
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Updates the banner image for the community using a Blob.
|
|
162
|
+
*
|
|
163
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
|
|
164
|
+
*
|
|
165
|
+
* @param blob The blob to upload.
|
|
166
|
+
* @param data Any additional data to pass along to the upload
|
|
167
|
+
*
|
|
168
|
+
* @returns promise
|
|
169
|
+
*/
|
|
170
|
+
public static uploadVideoLogoBlob<T>(community_id: string, blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
171
|
+
|
|
172
|
+
let url = CommunitiesRoute.routes.uploadVideoLogo.url.replace('{community_id}', community_id);
|
|
173
|
+
|
|
174
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* List the invites that have been sent for the community to users.
|
|
179
|
+
*
|
|
180
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
|
|
181
|
+
*
|
|
182
|
+
* @param community_id The id of the community
|
|
183
|
+
*
|
|
184
|
+
* @returns promise
|
|
185
|
+
*/
|
|
186
|
+
public static listInvites<T>(community_id : string): AxiosPromise<Response<T>> {
|
|
187
|
+
return Requests.processRoute(CommunitiesRoute.routes.listInvites, {}, {community_id : community_id});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Send an invitation to a user to join the community.
|
|
192
|
+
*
|
|
193
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitySendInvite
|
|
194
|
+
*
|
|
195
|
+
* @param community_id The id of the community.
|
|
196
|
+
* @param data The data that will be passed into sending an invite.
|
|
197
|
+
*
|
|
198
|
+
* @returns promise
|
|
199
|
+
*/
|
|
200
|
+
public static sendInvite<T>(community_id : string, data? : object): AxiosPromise<Response<T>> {
|
|
201
|
+
return Requests.processRoute(CommunitiesRoute.routes.sendInvite, data, {community_id : community_id});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Accept an invite to a community. The JSON Web Token (JWT) must be related to the token.
|
|
206
|
+
*
|
|
207
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
|
|
208
|
+
*
|
|
209
|
+
* @param community_id The id of the community
|
|
210
|
+
* @param token The token required to accept the user.
|
|
211
|
+
*
|
|
212
|
+
* @returns promise
|
|
213
|
+
*/
|
|
214
|
+
public static acceptInvite<T>(community_id : string, token : string): AxiosPromise<Response<T>> {
|
|
215
|
+
return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, {}, {community_id : community_id});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* List the users who are currently associated with the community.
|
|
220
|
+
*
|
|
221
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityUserList
|
|
222
|
+
*
|
|
223
|
+
* @param community_id The id of the community.
|
|
224
|
+
*
|
|
225
|
+
* @returns promise
|
|
226
|
+
*/
|
|
227
|
+
public static listUsers<T>(community_id : string): AxiosPromise<Response<T>> {
|
|
228
|
+
return Requests.processRoute(CommunitiesRoute.routes.listUsers, {}, {community_id : community_id});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Add a user to a community.
|
|
233
|
+
*
|
|
234
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/createcommunityUser
|
|
235
|
+
*
|
|
236
|
+
* @param community_id The id of the community.
|
|
237
|
+
* @param data The data to be passed when adding a user.
|
|
238
|
+
*
|
|
239
|
+
* @returns promise
|
|
240
|
+
*/
|
|
241
|
+
public static addUser<T>(community_id : string, data? : object): AxiosPromise<Response<T>> {
|
|
242
|
+
return Requests.processRoute(CommunitiesRoute.routes.addUser, data, {community_id : community_id});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Retrieves a single user and their information that is associated with a community.
|
|
247
|
+
*
|
|
248
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/showcommunityUser
|
|
249
|
+
*
|
|
250
|
+
* @param community_id The id of the community.
|
|
251
|
+
* @param user_id The id of the user.
|
|
252
|
+
*
|
|
253
|
+
* @returns promise
|
|
254
|
+
*/
|
|
255
|
+
public static getUser<T>(community_id : string, user_id : string): AxiosPromise<Response<T>> {
|
|
256
|
+
return Requests.processRoute(CommunitiesRoute.routes.showUser, {}, {community_id : community_id, user_id});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Updates the users information associated with the community.
|
|
261
|
+
*
|
|
262
|
+
* @param community_id The id of the community.
|
|
263
|
+
* @param user_id The id of the user.
|
|
264
|
+
*
|
|
265
|
+
* @returns promise
|
|
266
|
+
*/
|
|
267
|
+
public static updatetUser<T>(community_id : string, user_id : string, data? : object): AxiosPromise<Response<T>> {
|
|
268
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateUser, data, {community_id : community_id, user_id});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Removes a user from a community.
|
|
273
|
+
*
|
|
274
|
+
* @param community_id The id of community.
|
|
275
|
+
* @param user_id The id of the user.
|
|
276
|
+
*
|
|
277
|
+
* @returns promise
|
|
278
|
+
*/
|
|
279
|
+
public static removetUser<T>(community_id : string, user_id : string): AxiosPromise<Response<T>> {
|
|
280
|
+
return Requests.processRoute(CommunitiesRoute.routes.removeUser, {}, {community_id : community_id, user_id});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export default Communities;
|