glitch-javascript-sdk 0.3.6 → 0.3.8

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 CHANGED
@@ -16005,8 +16005,8 @@ var Auth = /** @class */ (function () {
16005
16005
  *
16006
16006
  * @returns promise
16007
16007
  */
16008
- Auth.oneTimeLogin = function () {
16009
- return Requests.processRoute(AuthRoutes.routes.one_time_login, {});
16008
+ Auth.oneTimeLogin = function (token) {
16009
+ return Requests.processRoute(AuthRoutes.routes.one_time_login, { token: token });
16010
16010
  };
16011
16011
  /**
16012
16012
  * Execute the password reset process using a user's email address.
@@ -16661,6 +16661,7 @@ var CommunitiesRoute = /** @class */ (function () {
16661
16661
  listInvites: { url: '/communities/{community_id}/invites', method: HTTP_METHODS.GET },
16662
16662
  sendInvite: { url: '/communities/{community_id}/sendInvite', method: HTTP_METHODS.POST },
16663
16663
  acceptInvite: { url: '/communities/{community_id}/acceptInvite', method: HTTP_METHODS.POST },
16664
+ retrieveInvite: { url: '/communities/{community_id}/invites/{token}', method: HTTP_METHODS.GET },
16664
16665
  listUsers: { url: '/communities/{community_id}/users', method: HTTP_METHODS.GET },
16665
16666
  addUser: { url: '/communities/{community_id}/users', method: HTTP_METHODS.POST },
16666
16667
  showUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.GET },
@@ -16853,7 +16854,20 @@ var Communities = /** @class */ (function () {
16853
16854
  * @returns promise
16854
16855
  */
16855
16856
  Communities.acceptInvite = function (community_id, token, params) {
16856
- 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);
16857
16871
  };
16858
16872
  /**
16859
16873
  * List the users who are currently associated with the community.
@@ -17793,6 +17807,7 @@ var PostsRoute = /** @class */ (function () {
17793
17807
  view: { url: '/posts/{post_id}', method: HTTP_METHODS.GET },
17794
17808
  update: { url: '/posts/{post_id}', method: HTTP_METHODS.PUT },
17795
17809
  delete: { url: '/posts/{post_id}', method: HTTP_METHODS.DELETE },
17810
+ toggleInteraction: { url: '/posts/{post_id}/toggleInteraction', method: HTTP_METHODS.POST },
17796
17811
  };
17797
17812
  return PostsRoute;
17798
17813
  }());
@@ -17884,6 +17899,18 @@ var Posts = /** @class */ (function () {
17884
17899
  Posts.delete = function (post_id, params) {
17885
17900
  return Requests.processRoute(PostsRoute.routes.delete, {}, { post_id: post_id }, params);
17886
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
+ };
17887
17914
  return Posts;
17888
17915
  }());
17889
17916
 
@@ -18022,6 +18049,31 @@ var Templates = /** @class */ (function () {
18022
18049
  return Templates;
18023
18050
  }());
18024
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
+
18025
18077
  var Parser = /** @class */ (function () {
18026
18078
  function Parser() {
18027
18079
  }
@@ -18159,12 +18211,14 @@ var Session = /** @class */ (function () {
18159
18211
  Storage.set(Session._first_name_key, null);
18160
18212
  Storage.set(Session._last_name_key, null);
18161
18213
  Storage.set(Session._email_key, null);
18214
+ Storage.set(Session._username_key, null);
18162
18215
  };
18163
18216
  Session.processAuthentication = function (data) {
18164
18217
  Storage.setAuthToken(data.token.access_token);
18165
18218
  Storage.set(Session._id_key, data.id);
18166
18219
  Storage.set(Session._first_name_key, data.first_name);
18167
18220
  Storage.set(Session._last_name_key, data.last_name);
18221
+ Storage.set(Session._username_key, data.username);
18168
18222
  Storage.set(Session._email_key, data.email);
18169
18223
  Config.setAuthToken(data.token.access_token);
18170
18224
  };
@@ -18286,6 +18340,138 @@ var TeamJoinProcess;
18286
18340
  TeamJoinProcess[TeamJoinProcess["APPROVAL"] = 3] = "APPROVAL";
18287
18341
  })(TeamJoinProcess || (TeamJoinProcess = {}));
18288
18342
 
18343
+ var SocialInteractions;
18344
+ (function (SocialInteractions) {
18345
+ SocialInteractions["LIKE"] = "\uD83D\uDC4D";
18346
+ SocialInteractions["LOVE"] = "\u2764\uFE0F";
18347
+ SocialInteractions["CARE"] = "\uD83E\uDD70";
18348
+ SocialInteractions["HAHA"] = "\uD83D\uDE02";
18349
+ SocialInteractions["WOW"] = "\uD83D\uDE2E";
18350
+ SocialInteractions["SAD"] = "\uD83D\uDE1E";
18351
+ SocialInteractions["CRY"] = "\uD83D\uDE22";
18352
+ SocialInteractions["ANGRY"] = "\uD83D\uDE21";
18353
+ SocialInteractions["THUMBS_UP"] = "\uD83D\uDC4D";
18354
+ SocialInteractions["THUMBS_DOWN"] = "\uD83D\uDC4E";
18355
+ SocialInteractions["SMILE"] = "\uD83D\uDE0A";
18356
+ SocialInteractions["GRIN"] = "\uD83D\uDE01";
18357
+ SocialInteractions["LAUGH"] = "\uD83D\uDE04";
18358
+ SocialInteractions["JOY"] = "\uD83D\uDE03";
18359
+ SocialInteractions["BLUSH"] = "\uD83D\uDE0A";
18360
+ SocialInteractions["SURPRISE"] = "\uD83D\uDE2E";
18361
+ SocialInteractions["SHOCK"] = "\uD83D\uDE32";
18362
+ SocialInteractions["WOW_FACE"] = "\uD83D\uDE2F";
18363
+ SocialInteractions["MIND_BLOWN"] = "\uD83E\uDD2F";
18364
+ SocialInteractions["ASTONISHED"] = "\uD83D\uDE33";
18365
+ SocialInteractions["CLAP"] = "\uD83D\uDC4F";
18366
+ SocialInteractions["PARTY"] = "\uD83C\uDF89";
18367
+ SocialInteractions["FIRE"] = "\uD83D\uDD25";
18368
+ SocialInteractions["COOL"] = "\uD83D\uDE0E";
18369
+ SocialInteractions["OK"] = "\uD83D\uDC4C";
18370
+ SocialInteractions["EYES"] = "\uD83D\uDC40";
18371
+ SocialInteractions["WINK"] = "\uD83D\uDE09";
18372
+ SocialInteractions["TONGUE_OUT"] = "\uD83D\uDE1C";
18373
+ SocialInteractions["SILLY"] = "\uD83E\uDD2A";
18374
+ SocialInteractions["COFFEE"] = "\u2615";
18375
+ SocialInteractions["TEA"] = "\uD83C\uDF75";
18376
+ SocialInteractions["BEER"] = "\uD83C\uDF7A";
18377
+ SocialInteractions["WINE"] = "\uD83C\uDF77";
18378
+ SocialInteractions["COCKTAIL"] = "\uD83C\uDF78";
18379
+ SocialInteractions["BALLOON"] = "\uD83C\uDF88";
18380
+ SocialInteractions["GIFT"] = "\uD83C\uDF81";
18381
+ SocialInteractions["CAMERA"] = "\uD83D\uDCF7";
18382
+ SocialInteractions["VIDEO_CAMERA"] = "\uD83D\uDCF9";
18383
+ SocialInteractions["MUSIC"] = "\uD83C\uDFB5";
18384
+ SocialInteractions["HEADPHONES"] = "\uD83C\uDFA7";
18385
+ SocialInteractions["TV"] = "\uD83D\uDCFA";
18386
+ SocialInteractions["BOOK"] = "\uD83D\uDCDA";
18387
+ SocialInteractions["PEN"] = "\uD83D\uDD8A\uFE0F";
18388
+ SocialInteractions["PAPERCLIP"] = "\uD83D\uDCCE";
18389
+ SocialInteractions["LOCK"] = "\uD83D\uDD12";
18390
+ SocialInteractions["KEY"] = "\uD83D\uDD11";
18391
+ SocialInteractions["MAGNIFYING_GLASS"] = "\uD83D\uDD0D";
18392
+ SocialInteractions["EARTH_GLOBE"] = "\uD83C\uDF0D";
18393
+ SocialInteractions["MAP"] = "\uD83D\uDDFA\uFE0F";
18394
+ SocialInteractions["SUN"] = "\u2600\uFE0F";
18395
+ SocialInteractions["MOON"] = "\uD83C\uDF19";
18396
+ SocialInteractions["STARS"] = "\uD83C\uDF1F";
18397
+ SocialInteractions["UMBRELLA"] = "\u2602\uFE0F";
18398
+ SocialInteractions["RAINBOW"] = "\uD83C\uDF08";
18399
+ SocialInteractions["CLOCK"] = "\u23F0";
18400
+ SocialInteractions["HOURGLASS"] = "\u231B";
18401
+ SocialInteractions["MONEY_BAG"] = "\uD83D\uDCB0";
18402
+ SocialInteractions["SHOPPING_CART"] = "\uD83D\uDED2";
18403
+ SocialInteractions["THUMBS_UP_SIGN"] = "\uD83D\uDC4D\uD83C\uDFFB";
18404
+ SocialInteractions["THUMBS_DOWN_SIGN"] = "\uD83D\uDC4E\uD83C\uDFFB";
18405
+ SocialInteractions["SMILING_FACE_WITH_HALO"] = "\uD83D\uDE07";
18406
+ SocialInteractions["NERD_FACE"] = "\uD83E\uDD13";
18407
+ SocialInteractions["ROLLING_ON_THE_FLOOR_LAUGHING"] = "\uD83E\uDD23";
18408
+ SocialInteractions["UPSIDE_DOWN_FACE"] = "\uD83D\uDE43";
18409
+ SocialInteractions["WAVING_HAND"] = "\uD83D\uDC4B";
18410
+ SocialInteractions["RAISED_HAND"] = "\u270B";
18411
+ SocialInteractions["VICTORY_HAND"] = "\u270C\uFE0F";
18412
+ SocialInteractions["FOLDED_HANDS"] = "\uD83D\uDE4F";
18413
+ SocialInteractions["PERSON_RAISING_HAND"] = "\uD83D\uDE4B";
18414
+ SocialInteractions["PERSON_BOWING"] = "\uD83D\uDE47";
18415
+ SocialInteractions["PERSON_SHRUGGING"] = "\uD83E\uDD37";
18416
+ SocialInteractions["PERSON_WALKING"] = "\uD83D\uDEB6";
18417
+ SocialInteractions["PERSON_RUNNING"] = "\uD83C\uDFC3";
18418
+ SocialInteractions["PERSON_SWIMMING"] = "\uD83C\uDFCA";
18419
+ SocialInteractions["PERSON_BIKING"] = "\uD83D\uDEB4";
18420
+ SocialInteractions["PERSON_DANCING"] = "\uD83D\uDC83";
18421
+ SocialInteractions["PEOPLE_HUGGING"] = "\uD83E\uDD17";
18422
+ SocialInteractions["SPEECH_BUBBLE"] = "\uD83D\uDCAC";
18423
+ SocialInteractions["THOUGHT_BUBBLE"] = "\uD83D\uDCAD";
18424
+ SocialInteractions["BUST_IN_SILHOUETTE"] = "\uD83D\uDC64";
18425
+ SocialInteractions["BUSTS_IN_SILHOUETTE"] = "\uD83D\uDC65";
18426
+ SocialInteractions["MONKEY_FACE"] = "\uD83D\uDC35";
18427
+ SocialInteractions["DOG_FACE"] = "\uD83D\uDC36";
18428
+ SocialInteractions["CAT_FACE"] = "\uD83D\uDC31";
18429
+ SocialInteractions["PIG_FACE"] = "\uD83D\uDC37";
18430
+ SocialInteractions["COW_FACE"] = "\uD83D\uDC2E";
18431
+ SocialInteractions["RABBIT_FACE"] = "\uD83D\uDC30";
18432
+ SocialInteractions["BEAR_FACE"] = "\uD83D\uDC3B";
18433
+ SocialInteractions["PANDA_FACE"] = "\uD83D\uDC3C";
18434
+ SocialInteractions["PENGUIN"] = "\uD83D\uDC27";
18435
+ SocialInteractions["BIRD"] = "\uD83D\uDC26";
18436
+ SocialInteractions["BABY_CHICK"] = "\uD83D\uDC24";
18437
+ SocialInteractions["HATCHING_CHICK"] = "\uD83D\uDC23";
18438
+ SocialInteractions["BUG"] = "\uD83D\uDC1B";
18439
+ SocialInteractions["BUTTERFLY"] = "\uD83E\uDD8B";
18440
+ SocialInteractions["SNAIL"] = "\uD83D\uDC0C";
18441
+ SocialInteractions["LADY_BEETLE"] = "\uD83D\uDC1E";
18442
+ SocialInteractions["SPIDER"] = "\uD83D\uDD77\uFE0F";
18443
+ SocialInteractions["WEB"] = "\uD83D\uDD78\uFE0F";
18444
+ SocialInteractions["TURTLE"] = "\uD83D\uDC22";
18445
+ SocialInteractions["FISH"] = "\uD83D\uDC1F";
18446
+ SocialInteractions["WHALE"] = "\uD83D\uDC33";
18447
+ SocialInteractions["DOLPHIN"] = "\uD83D\uDC2C";
18448
+ SocialInteractions["OCTOPUS"] = "\uD83D\uDC19";
18449
+ SocialInteractions["CACTUS"] = "\uD83C\uDF35";
18450
+ SocialInteractions["TULIP"] = "\uD83C\uDF37";
18451
+ SocialInteractions["ROSE"] = "\uD83C\uDF39";
18452
+ SocialInteractions["SUNFLOWER"] = "\uD83C\uDF3B";
18453
+ SocialInteractions["PALM_TREE"] = "\uD83C\uDF34";
18454
+ SocialInteractions["EVERGREEN_TREE"] = "\uD83C\uDF32";
18455
+ SocialInteractions["DECIDUOUS_TREE"] = "\uD83C\uDF33";
18456
+ SocialInteractions["EGGPLANT"] = "\uD83C\uDF46";
18457
+ SocialInteractions["TOMATO"] = "\uD83C\uDF45";
18458
+ SocialInteractions["CARROT"] = "\uD83E\uDD55";
18459
+ SocialInteractions["BROCCOLI"] = "\uD83E\uDD66";
18460
+ SocialInteractions["CORN"] = "\uD83C\uDF3D";
18461
+ SocialInteractions["HOT_PEPPER"] = "\uD83C\uDF36\uFE0F";
18462
+ SocialInteractions["BREAD"] = "\uD83C\uDF5E";
18463
+ SocialInteractions["CHEESE"] = "\uD83E\uDDC0";
18464
+ SocialInteractions["HAMBURGER"] = "\uD83C\uDF54";
18465
+ SocialInteractions["PIZZA"] = "\uD83C\uDF55";
18466
+ SocialInteractions["TACO"] = "\uD83C\uDF2E";
18467
+ SocialInteractions["SUSHI"] = "\uD83C\uDF63";
18468
+ SocialInteractions["CUPCAKE"] = "\uD83E\uDDC1";
18469
+ SocialInteractions["ICE_CREAM"] = "\uD83C\uDF68";
18470
+ SocialInteractions["DONUT"] = "\uD83C\uDF69";
18471
+ SocialInteractions["CAKE"] = "\uD83C\uDF82";
18472
+ SocialInteractions["COOKIES"] = "\uD83C\uDF6A";
18473
+ })(SocialInteractions || (SocialInteractions = {}));
18474
+
18289
18475
  var TicketTypes;
18290
18476
  (function (TicketTypes) {
18291
18477
  TicketTypes[TicketTypes["PAID"] = 1] = "PAID";
@@ -18344,7 +18530,8 @@ var Glitch = /** @class */ (function () {
18344
18530
  Teams: Teams,
18345
18531
  Posts: Posts,
18346
18532
  Templates: Templates,
18347
- Waitlists: Waitlists
18533
+ Waitlists: Waitlists,
18534
+ Utility: Utility,
18348
18535
  };
18349
18536
  Glitch.util = {
18350
18537
  Requests: Requests,
@@ -18362,6 +18549,7 @@ var Glitch = /** @class */ (function () {
18362
18549
  Modes: Modes,
18363
18550
  PostTypes: PostTypes,
18364
18551
  Roles: Roles,
18552
+ SocialInteractions: SocialInteractions,
18365
18553
  TeamJoinProcess: TeamJoinProcess,
18366
18554
  TicketTypes: TicketTypes$1,
18367
18555
  TicketUsageTypes: TicketUsageTypes,