glitch-javascript-sdk 0.3.5 → 0.3.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 +196 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +11 -0
- package/dist/esm/api/Posts.d.ts +10 -0
- package/dist/esm/api/Utility.d.ts +13 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/constants/SocialInteractions.d.ts +130 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +196 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/UtilityRoutes.d.ts +7 -0
- package/dist/index.d.ts +165 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +15 -1
- package/src/api/Posts.ts +14 -0
- package/src/api/Utility.ts +21 -0
- package/src/api/index.ts +3 -1
- package/src/constants/SocialInteractions.ts +131 -0
- package/src/index.ts +5 -1
- package/src/routes/CommunitiesRoute.ts +1 -0
- package/src/routes/PostsRoute.ts +1 -0
- package/src/routes/UtilityRoutes.ts +12 -0
- package/src/util/Requests.ts +17 -0
package/dist/cjs/index.js
CHANGED
|
@@ -15787,6 +15787,10 @@ var Requests = /** @class */ (function () {
|
|
|
15787
15787
|
}
|
|
15788
15788
|
var formData = new FormData();
|
|
15789
15789
|
formData.append(filename, file);
|
|
15790
|
+
if (this.community_id) {
|
|
15791
|
+
// Add the community_id to the request body
|
|
15792
|
+
data = __assign(__assign({}, data), { communities: [this.community_id] });
|
|
15793
|
+
}
|
|
15790
15794
|
for (var key in data) {
|
|
15791
15795
|
formData.append(key, data[key]);
|
|
15792
15796
|
}
|
|
@@ -15804,6 +15808,10 @@ var Requests = /** @class */ (function () {
|
|
|
15804
15808
|
}
|
|
15805
15809
|
var formData = new FormData();
|
|
15806
15810
|
formData.append(filename, blob);
|
|
15811
|
+
if (this.community_id) {
|
|
15812
|
+
// Add the community_id to the request body
|
|
15813
|
+
data = __assign(__assign({}, data), { communities: [this.community_id] });
|
|
15814
|
+
}
|
|
15807
15815
|
for (var key in data) {
|
|
15808
15816
|
formData.append(key, data[key]);
|
|
15809
15817
|
}
|
|
@@ -16653,6 +16661,7 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
16653
16661
|
listInvites: { url: '/communities/{community_id}/invites', method: HTTP_METHODS.GET },
|
|
16654
16662
|
sendInvite: { url: '/communities/{community_id}/sendInvite', method: HTTP_METHODS.POST },
|
|
16655
16663
|
acceptInvite: { url: '/communities/{community_id}/acceptInvite', method: HTTP_METHODS.POST },
|
|
16664
|
+
retrieveInvite: { url: '/communities/{community_id}/invites/{token}', method: HTTP_METHODS.GET },
|
|
16656
16665
|
listUsers: { url: '/communities/{community_id}/users', method: HTTP_METHODS.GET },
|
|
16657
16666
|
addUser: { url: '/communities/{community_id}/users', method: HTTP_METHODS.POST },
|
|
16658
16667
|
showUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.GET },
|
|
@@ -16845,7 +16854,20 @@ var Communities = /** @class */ (function () {
|
|
|
16845
16854
|
* @returns promise
|
|
16846
16855
|
*/
|
|
16847
16856
|
Communities.acceptInvite = function (community_id, token, params) {
|
|
16848
|
-
return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, {}, { community_id: community_id }, params);
|
|
16857
|
+
return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, { token: token }, { community_id: community_id }, params);
|
|
16858
|
+
};
|
|
16859
|
+
/**
|
|
16860
|
+
* Retrieves a user's invite that have been sent.
|
|
16861
|
+
*
|
|
16862
|
+
* @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
|
|
16863
|
+
*
|
|
16864
|
+
* @param community_id The id of the community
|
|
16865
|
+
* @param token The token required to get the invite.
|
|
16866
|
+
*
|
|
16867
|
+
* @returns promise
|
|
16868
|
+
*/
|
|
16869
|
+
Communities.retrieveInvite = function (community_id, token, params) {
|
|
16870
|
+
return Requests.processRoute(CommunitiesRoute.routes.retrieveInvite, {}, { community_id: community_id, token: token }, params);
|
|
16849
16871
|
};
|
|
16850
16872
|
/**
|
|
16851
16873
|
* List the users who are currently associated with the community.
|
|
@@ -17785,6 +17807,7 @@ var PostsRoute = /** @class */ (function () {
|
|
|
17785
17807
|
view: { url: '/posts/{post_id}', method: HTTP_METHODS.GET },
|
|
17786
17808
|
update: { url: '/posts/{post_id}', method: HTTP_METHODS.PUT },
|
|
17787
17809
|
delete: { url: '/posts/{post_id}', method: HTTP_METHODS.DELETE },
|
|
17810
|
+
toggleInteraction: { url: '/posts/{post_id}/toggleInteraction', method: HTTP_METHODS.POST },
|
|
17788
17811
|
};
|
|
17789
17812
|
return PostsRoute;
|
|
17790
17813
|
}());
|
|
@@ -17876,6 +17899,18 @@ var Posts = /** @class */ (function () {
|
|
|
17876
17899
|
Posts.delete = function (post_id, params) {
|
|
17877
17900
|
return Requests.processRoute(PostsRoute.routes.delete, {}, { post_id: post_id }, params);
|
|
17878
17901
|
};
|
|
17902
|
+
/**
|
|
17903
|
+
* Toggle a social interaction and off for a post.
|
|
17904
|
+
*
|
|
17905
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Post%20Route/postToggleInteraction
|
|
17906
|
+
*
|
|
17907
|
+
* @param data The data to be passed when toggling the interaction.
|
|
17908
|
+
*
|
|
17909
|
+
* @returns Promise
|
|
17910
|
+
*/
|
|
17911
|
+
Posts.toggleInteraction = function (post_id, data, params) {
|
|
17912
|
+
return Requests.processRoute(PostsRoute.routes.toggleInteraction, data, { post_id: post_id }, params);
|
|
17913
|
+
};
|
|
17879
17914
|
return Posts;
|
|
17880
17915
|
}());
|
|
17881
17916
|
|
|
@@ -18014,6 +18049,31 @@ var Templates = /** @class */ (function () {
|
|
|
18014
18049
|
return Templates;
|
|
18015
18050
|
}());
|
|
18016
18051
|
|
|
18052
|
+
var UtilityRoutes = /** @class */ (function () {
|
|
18053
|
+
function UtilityRoutes() {
|
|
18054
|
+
}
|
|
18055
|
+
UtilityRoutes.routes = {
|
|
18056
|
+
social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
|
|
18057
|
+
};
|
|
18058
|
+
return UtilityRoutes;
|
|
18059
|
+
}());
|
|
18060
|
+
|
|
18061
|
+
var Utility = /** @class */ (function () {
|
|
18062
|
+
function Utility() {
|
|
18063
|
+
}
|
|
18064
|
+
/**
|
|
18065
|
+
* Get all the social interactions and emojis that are available.
|
|
18066
|
+
*
|
|
18067
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilSocialInteraction
|
|
18068
|
+
*
|
|
18069
|
+
* @returns promise
|
|
18070
|
+
*/
|
|
18071
|
+
Utility.listSocialInteractions = function (params) {
|
|
18072
|
+
return Requests.processRoute(UtilityRoutes.routes.social_interactions, undefined, undefined, params);
|
|
18073
|
+
};
|
|
18074
|
+
return Utility;
|
|
18075
|
+
}());
|
|
18076
|
+
|
|
18017
18077
|
var Parser = /** @class */ (function () {
|
|
18018
18078
|
function Parser() {
|
|
18019
18079
|
}
|
|
@@ -18278,6 +18338,138 @@ var TeamJoinProcess;
|
|
|
18278
18338
|
TeamJoinProcess[TeamJoinProcess["APPROVAL"] = 3] = "APPROVAL";
|
|
18279
18339
|
})(TeamJoinProcess || (TeamJoinProcess = {}));
|
|
18280
18340
|
|
|
18341
|
+
var SocialInteractions;
|
|
18342
|
+
(function (SocialInteractions) {
|
|
18343
|
+
SocialInteractions["LIKE"] = "\uD83D\uDC4D";
|
|
18344
|
+
SocialInteractions["LOVE"] = "\u2764\uFE0F";
|
|
18345
|
+
SocialInteractions["CARE"] = "\uD83E\uDD70";
|
|
18346
|
+
SocialInteractions["HAHA"] = "\uD83D\uDE02";
|
|
18347
|
+
SocialInteractions["WOW"] = "\uD83D\uDE2E";
|
|
18348
|
+
SocialInteractions["SAD"] = "\uD83D\uDE1E";
|
|
18349
|
+
SocialInteractions["CRY"] = "\uD83D\uDE22";
|
|
18350
|
+
SocialInteractions["ANGRY"] = "\uD83D\uDE21";
|
|
18351
|
+
SocialInteractions["THUMBS_UP"] = "\uD83D\uDC4D";
|
|
18352
|
+
SocialInteractions["THUMBS_DOWN"] = "\uD83D\uDC4E";
|
|
18353
|
+
SocialInteractions["SMILE"] = "\uD83D\uDE0A";
|
|
18354
|
+
SocialInteractions["GRIN"] = "\uD83D\uDE01";
|
|
18355
|
+
SocialInteractions["LAUGH"] = "\uD83D\uDE04";
|
|
18356
|
+
SocialInteractions["JOY"] = "\uD83D\uDE03";
|
|
18357
|
+
SocialInteractions["BLUSH"] = "\uD83D\uDE0A";
|
|
18358
|
+
SocialInteractions["SURPRISE"] = "\uD83D\uDE2E";
|
|
18359
|
+
SocialInteractions["SHOCK"] = "\uD83D\uDE32";
|
|
18360
|
+
SocialInteractions["WOW_FACE"] = "\uD83D\uDE2F";
|
|
18361
|
+
SocialInteractions["MIND_BLOWN"] = "\uD83E\uDD2F";
|
|
18362
|
+
SocialInteractions["ASTONISHED"] = "\uD83D\uDE33";
|
|
18363
|
+
SocialInteractions["CLAP"] = "\uD83D\uDC4F";
|
|
18364
|
+
SocialInteractions["PARTY"] = "\uD83C\uDF89";
|
|
18365
|
+
SocialInteractions["FIRE"] = "\uD83D\uDD25";
|
|
18366
|
+
SocialInteractions["COOL"] = "\uD83D\uDE0E";
|
|
18367
|
+
SocialInteractions["OK"] = "\uD83D\uDC4C";
|
|
18368
|
+
SocialInteractions["EYES"] = "\uD83D\uDC40";
|
|
18369
|
+
SocialInteractions["WINK"] = "\uD83D\uDE09";
|
|
18370
|
+
SocialInteractions["TONGUE_OUT"] = "\uD83D\uDE1C";
|
|
18371
|
+
SocialInteractions["SILLY"] = "\uD83E\uDD2A";
|
|
18372
|
+
SocialInteractions["COFFEE"] = "\u2615";
|
|
18373
|
+
SocialInteractions["TEA"] = "\uD83C\uDF75";
|
|
18374
|
+
SocialInteractions["BEER"] = "\uD83C\uDF7A";
|
|
18375
|
+
SocialInteractions["WINE"] = "\uD83C\uDF77";
|
|
18376
|
+
SocialInteractions["COCKTAIL"] = "\uD83C\uDF78";
|
|
18377
|
+
SocialInteractions["BALLOON"] = "\uD83C\uDF88";
|
|
18378
|
+
SocialInteractions["GIFT"] = "\uD83C\uDF81";
|
|
18379
|
+
SocialInteractions["CAMERA"] = "\uD83D\uDCF7";
|
|
18380
|
+
SocialInteractions["VIDEO_CAMERA"] = "\uD83D\uDCF9";
|
|
18381
|
+
SocialInteractions["MUSIC"] = "\uD83C\uDFB5";
|
|
18382
|
+
SocialInteractions["HEADPHONES"] = "\uD83C\uDFA7";
|
|
18383
|
+
SocialInteractions["TV"] = "\uD83D\uDCFA";
|
|
18384
|
+
SocialInteractions["BOOK"] = "\uD83D\uDCDA";
|
|
18385
|
+
SocialInteractions["PEN"] = "\uD83D\uDD8A\uFE0F";
|
|
18386
|
+
SocialInteractions["PAPERCLIP"] = "\uD83D\uDCCE";
|
|
18387
|
+
SocialInteractions["LOCK"] = "\uD83D\uDD12";
|
|
18388
|
+
SocialInteractions["KEY"] = "\uD83D\uDD11";
|
|
18389
|
+
SocialInteractions["MAGNIFYING_GLASS"] = "\uD83D\uDD0D";
|
|
18390
|
+
SocialInteractions["EARTH_GLOBE"] = "\uD83C\uDF0D";
|
|
18391
|
+
SocialInteractions["MAP"] = "\uD83D\uDDFA\uFE0F";
|
|
18392
|
+
SocialInteractions["SUN"] = "\u2600\uFE0F";
|
|
18393
|
+
SocialInteractions["MOON"] = "\uD83C\uDF19";
|
|
18394
|
+
SocialInteractions["STARS"] = "\uD83C\uDF1F";
|
|
18395
|
+
SocialInteractions["UMBRELLA"] = "\u2602\uFE0F";
|
|
18396
|
+
SocialInteractions["RAINBOW"] = "\uD83C\uDF08";
|
|
18397
|
+
SocialInteractions["CLOCK"] = "\u23F0";
|
|
18398
|
+
SocialInteractions["HOURGLASS"] = "\u231B";
|
|
18399
|
+
SocialInteractions["MONEY_BAG"] = "\uD83D\uDCB0";
|
|
18400
|
+
SocialInteractions["SHOPPING_CART"] = "\uD83D\uDED2";
|
|
18401
|
+
SocialInteractions["THUMBS_UP_SIGN"] = "\uD83D\uDC4D\uD83C\uDFFB";
|
|
18402
|
+
SocialInteractions["THUMBS_DOWN_SIGN"] = "\uD83D\uDC4E\uD83C\uDFFB";
|
|
18403
|
+
SocialInteractions["SMILING_FACE_WITH_HALO"] = "\uD83D\uDE07";
|
|
18404
|
+
SocialInteractions["NERD_FACE"] = "\uD83E\uDD13";
|
|
18405
|
+
SocialInteractions["ROLLING_ON_THE_FLOOR_LAUGHING"] = "\uD83E\uDD23";
|
|
18406
|
+
SocialInteractions["UPSIDE_DOWN_FACE"] = "\uD83D\uDE43";
|
|
18407
|
+
SocialInteractions["WAVING_HAND"] = "\uD83D\uDC4B";
|
|
18408
|
+
SocialInteractions["RAISED_HAND"] = "\u270B";
|
|
18409
|
+
SocialInteractions["VICTORY_HAND"] = "\u270C\uFE0F";
|
|
18410
|
+
SocialInteractions["FOLDED_HANDS"] = "\uD83D\uDE4F";
|
|
18411
|
+
SocialInteractions["PERSON_RAISING_HAND"] = "\uD83D\uDE4B";
|
|
18412
|
+
SocialInteractions["PERSON_BOWING"] = "\uD83D\uDE47";
|
|
18413
|
+
SocialInteractions["PERSON_SHRUGGING"] = "\uD83E\uDD37";
|
|
18414
|
+
SocialInteractions["PERSON_WALKING"] = "\uD83D\uDEB6";
|
|
18415
|
+
SocialInteractions["PERSON_RUNNING"] = "\uD83C\uDFC3";
|
|
18416
|
+
SocialInteractions["PERSON_SWIMMING"] = "\uD83C\uDFCA";
|
|
18417
|
+
SocialInteractions["PERSON_BIKING"] = "\uD83D\uDEB4";
|
|
18418
|
+
SocialInteractions["PERSON_DANCING"] = "\uD83D\uDC83";
|
|
18419
|
+
SocialInteractions["PEOPLE_HUGGING"] = "\uD83E\uDD17";
|
|
18420
|
+
SocialInteractions["SPEECH_BUBBLE"] = "\uD83D\uDCAC";
|
|
18421
|
+
SocialInteractions["THOUGHT_BUBBLE"] = "\uD83D\uDCAD";
|
|
18422
|
+
SocialInteractions["BUST_IN_SILHOUETTE"] = "\uD83D\uDC64";
|
|
18423
|
+
SocialInteractions["BUSTS_IN_SILHOUETTE"] = "\uD83D\uDC65";
|
|
18424
|
+
SocialInteractions["MONKEY_FACE"] = "\uD83D\uDC35";
|
|
18425
|
+
SocialInteractions["DOG_FACE"] = "\uD83D\uDC36";
|
|
18426
|
+
SocialInteractions["CAT_FACE"] = "\uD83D\uDC31";
|
|
18427
|
+
SocialInteractions["PIG_FACE"] = "\uD83D\uDC37";
|
|
18428
|
+
SocialInteractions["COW_FACE"] = "\uD83D\uDC2E";
|
|
18429
|
+
SocialInteractions["RABBIT_FACE"] = "\uD83D\uDC30";
|
|
18430
|
+
SocialInteractions["BEAR_FACE"] = "\uD83D\uDC3B";
|
|
18431
|
+
SocialInteractions["PANDA_FACE"] = "\uD83D\uDC3C";
|
|
18432
|
+
SocialInteractions["PENGUIN"] = "\uD83D\uDC27";
|
|
18433
|
+
SocialInteractions["BIRD"] = "\uD83D\uDC26";
|
|
18434
|
+
SocialInteractions["BABY_CHICK"] = "\uD83D\uDC24";
|
|
18435
|
+
SocialInteractions["HATCHING_CHICK"] = "\uD83D\uDC23";
|
|
18436
|
+
SocialInteractions["BUG"] = "\uD83D\uDC1B";
|
|
18437
|
+
SocialInteractions["BUTTERFLY"] = "\uD83E\uDD8B";
|
|
18438
|
+
SocialInteractions["SNAIL"] = "\uD83D\uDC0C";
|
|
18439
|
+
SocialInteractions["LADY_BEETLE"] = "\uD83D\uDC1E";
|
|
18440
|
+
SocialInteractions["SPIDER"] = "\uD83D\uDD77\uFE0F";
|
|
18441
|
+
SocialInteractions["WEB"] = "\uD83D\uDD78\uFE0F";
|
|
18442
|
+
SocialInteractions["TURTLE"] = "\uD83D\uDC22";
|
|
18443
|
+
SocialInteractions["FISH"] = "\uD83D\uDC1F";
|
|
18444
|
+
SocialInteractions["WHALE"] = "\uD83D\uDC33";
|
|
18445
|
+
SocialInteractions["DOLPHIN"] = "\uD83D\uDC2C";
|
|
18446
|
+
SocialInteractions["OCTOPUS"] = "\uD83D\uDC19";
|
|
18447
|
+
SocialInteractions["CACTUS"] = "\uD83C\uDF35";
|
|
18448
|
+
SocialInteractions["TULIP"] = "\uD83C\uDF37";
|
|
18449
|
+
SocialInteractions["ROSE"] = "\uD83C\uDF39";
|
|
18450
|
+
SocialInteractions["SUNFLOWER"] = "\uD83C\uDF3B";
|
|
18451
|
+
SocialInteractions["PALM_TREE"] = "\uD83C\uDF34";
|
|
18452
|
+
SocialInteractions["EVERGREEN_TREE"] = "\uD83C\uDF32";
|
|
18453
|
+
SocialInteractions["DECIDUOUS_TREE"] = "\uD83C\uDF33";
|
|
18454
|
+
SocialInteractions["EGGPLANT"] = "\uD83C\uDF46";
|
|
18455
|
+
SocialInteractions["TOMATO"] = "\uD83C\uDF45";
|
|
18456
|
+
SocialInteractions["CARROT"] = "\uD83E\uDD55";
|
|
18457
|
+
SocialInteractions["BROCCOLI"] = "\uD83E\uDD66";
|
|
18458
|
+
SocialInteractions["CORN"] = "\uD83C\uDF3D";
|
|
18459
|
+
SocialInteractions["HOT_PEPPER"] = "\uD83C\uDF36\uFE0F";
|
|
18460
|
+
SocialInteractions["BREAD"] = "\uD83C\uDF5E";
|
|
18461
|
+
SocialInteractions["CHEESE"] = "\uD83E\uDDC0";
|
|
18462
|
+
SocialInteractions["HAMBURGER"] = "\uD83C\uDF54";
|
|
18463
|
+
SocialInteractions["PIZZA"] = "\uD83C\uDF55";
|
|
18464
|
+
SocialInteractions["TACO"] = "\uD83C\uDF2E";
|
|
18465
|
+
SocialInteractions["SUSHI"] = "\uD83C\uDF63";
|
|
18466
|
+
SocialInteractions["CUPCAKE"] = "\uD83E\uDDC1";
|
|
18467
|
+
SocialInteractions["ICE_CREAM"] = "\uD83C\uDF68";
|
|
18468
|
+
SocialInteractions["DONUT"] = "\uD83C\uDF69";
|
|
18469
|
+
SocialInteractions["CAKE"] = "\uD83C\uDF82";
|
|
18470
|
+
SocialInteractions["COOKIES"] = "\uD83C\uDF6A";
|
|
18471
|
+
})(SocialInteractions || (SocialInteractions = {}));
|
|
18472
|
+
|
|
18281
18473
|
var TicketTypes;
|
|
18282
18474
|
(function (TicketTypes) {
|
|
18283
18475
|
TicketTypes[TicketTypes["PAID"] = 1] = "PAID";
|
|
@@ -18336,7 +18528,8 @@ var Glitch = /** @class */ (function () {
|
|
|
18336
18528
|
Teams: Teams,
|
|
18337
18529
|
Posts: Posts,
|
|
18338
18530
|
Templates: Templates,
|
|
18339
|
-
Waitlists: Waitlists
|
|
18531
|
+
Waitlists: Waitlists,
|
|
18532
|
+
Utility: Utility,
|
|
18340
18533
|
};
|
|
18341
18534
|
Glitch.util = {
|
|
18342
18535
|
Requests: Requests,
|
|
@@ -18354,6 +18547,7 @@ var Glitch = /** @class */ (function () {
|
|
|
18354
18547
|
Modes: Modes,
|
|
18355
18548
|
PostTypes: PostTypes,
|
|
18356
18549
|
Roles: Roles,
|
|
18550
|
+
SocialInteractions: SocialInteractions,
|
|
18357
18551
|
TeamJoinProcess: TeamJoinProcess,
|
|
18358
18552
|
TicketTypes: TicketTypes$1,
|
|
18359
18553
|
TicketUsageTypes: TicketUsageTypes,
|