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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class UtilityRoutes {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default UtilityRoutes;
@@ -19,6 +19,7 @@ declare class Session {
19
19
  first_name: string;
20
20
  last_name: string;
21
21
  email: string;
22
+ username: string;
22
23
  }): void;
23
24
  }
24
25
  export default Session;
package/dist/index.d.ts CHANGED
@@ -97,7 +97,7 @@ declare class Auth {
97
97
  *
98
98
  * @returns promise
99
99
  */
100
- static oneTimeLogin<T>(): AxiosPromise<Response<T>>;
100
+ static oneTimeLogin<T>(token: string): AxiosPromise<Response<T>>;
101
101
  /**
102
102
  * Execute the password reset process using a user's email address.
103
103
  *
@@ -726,6 +726,17 @@ declare class Communities {
726
726
  * @returns promise
727
727
  */
728
728
  static acceptInvite<T>(community_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
729
+ /**
730
+ * Retrieves a user's invite that have been sent.
731
+ *
732
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
733
+ *
734
+ * @param community_id The id of the community
735
+ * @param token The token required to get the invite.
736
+ *
737
+ * @returns promise
738
+ */
739
+ static retrieveInvite<T>(community_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
729
740
  /**
730
741
  * List the users who are currently associated with the community.
731
742
  *
@@ -1476,6 +1487,16 @@ declare class Posts {
1476
1487
  * @returns promise
1477
1488
  */
1478
1489
  static delete<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1490
+ /**
1491
+ * Toggle a social interaction and off for a post.
1492
+ *
1493
+ * @see hhttps://api.glitch.fun/api/documentation#/Post%20Route/postToggleInteraction
1494
+ *
1495
+ * @param data The data to be passed when toggling the interaction.
1496
+ *
1497
+ * @returns Promise
1498
+ */
1499
+ static toggleInteraction<T>(post_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1479
1500
  }
1480
1501
 
1481
1502
  declare class Templates {
@@ -1573,6 +1594,17 @@ declare class Templates {
1573
1594
  static uploadMainImageBlob<T>(template_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1574
1595
  }
1575
1596
 
1597
+ declare class Utility {
1598
+ /**
1599
+ * Get all the social interactions and emojis that are available.
1600
+ *
1601
+ * @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilSocialInteraction
1602
+ *
1603
+ * @returns promise
1604
+ */
1605
+ static listSocialInteractions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1606
+ }
1607
+
1576
1608
  interface Route {
1577
1609
  url: string;
1578
1610
  method: string;
@@ -1660,6 +1692,7 @@ declare class Session {
1660
1692
  first_name: string;
1661
1693
  last_name: string;
1662
1694
  email: string;
1695
+ username: string;
1663
1696
  }): void;
1664
1697
  }
1665
1698
 
@@ -1716,6 +1749,137 @@ declare enum TeamJoinProcess {
1716
1749
  APPROVAL = 3
1717
1750
  }
1718
1751
 
1752
+ declare enum SocialInteractions {
1753
+ LIKE = "\uD83D\uDC4D",
1754
+ LOVE = "\u2764\uFE0F",
1755
+ CARE = "\uD83E\uDD70",
1756
+ HAHA = "\uD83D\uDE02",
1757
+ WOW = "\uD83D\uDE2E",
1758
+ SAD = "\uD83D\uDE1E",
1759
+ CRY = "\uD83D\uDE22",
1760
+ ANGRY = "\uD83D\uDE21",
1761
+ THUMBS_UP = "\uD83D\uDC4D",
1762
+ THUMBS_DOWN = "\uD83D\uDC4E",
1763
+ SMILE = "\uD83D\uDE0A",
1764
+ GRIN = "\uD83D\uDE01",
1765
+ LAUGH = "\uD83D\uDE04",
1766
+ JOY = "\uD83D\uDE03",
1767
+ BLUSH = "\uD83D\uDE0A",
1768
+ SURPRISE = "\uD83D\uDE2E",
1769
+ SHOCK = "\uD83D\uDE32",
1770
+ WOW_FACE = "\uD83D\uDE2F",
1771
+ MIND_BLOWN = "\uD83E\uDD2F",
1772
+ ASTONISHED = "\uD83D\uDE33",
1773
+ CLAP = "\uD83D\uDC4F",
1774
+ PARTY = "\uD83C\uDF89",
1775
+ FIRE = "\uD83D\uDD25",
1776
+ COOL = "\uD83D\uDE0E",
1777
+ OK = "\uD83D\uDC4C",
1778
+ EYES = "\uD83D\uDC40",
1779
+ WINK = "\uD83D\uDE09",
1780
+ TONGUE_OUT = "\uD83D\uDE1C",
1781
+ SILLY = "\uD83E\uDD2A",
1782
+ COFFEE = "\u2615",
1783
+ TEA = "\uD83C\uDF75",
1784
+ BEER = "\uD83C\uDF7A",
1785
+ WINE = "\uD83C\uDF77",
1786
+ COCKTAIL = "\uD83C\uDF78",
1787
+ BALLOON = "\uD83C\uDF88",
1788
+ GIFT = "\uD83C\uDF81",
1789
+ CAMERA = "\uD83D\uDCF7",
1790
+ VIDEO_CAMERA = "\uD83D\uDCF9",
1791
+ MUSIC = "\uD83C\uDFB5",
1792
+ HEADPHONES = "\uD83C\uDFA7",
1793
+ TV = "\uD83D\uDCFA",
1794
+ BOOK = "\uD83D\uDCDA",
1795
+ PEN = "\uD83D\uDD8A\uFE0F",
1796
+ PAPERCLIP = "\uD83D\uDCCE",
1797
+ LOCK = "\uD83D\uDD12",
1798
+ KEY = "\uD83D\uDD11",
1799
+ MAGNIFYING_GLASS = "\uD83D\uDD0D",
1800
+ EARTH_GLOBE = "\uD83C\uDF0D",
1801
+ MAP = "\uD83D\uDDFA\uFE0F",
1802
+ SUN = "\u2600\uFE0F",
1803
+ MOON = "\uD83C\uDF19",
1804
+ STARS = "\uD83C\uDF1F",
1805
+ UMBRELLA = "\u2602\uFE0F",
1806
+ RAINBOW = "\uD83C\uDF08",
1807
+ CLOCK = "\u23F0",
1808
+ HOURGLASS = "\u231B",
1809
+ MONEY_BAG = "\uD83D\uDCB0",
1810
+ SHOPPING_CART = "\uD83D\uDED2",
1811
+ THUMBS_UP_SIGN = "\uD83D\uDC4D\uD83C\uDFFB",
1812
+ THUMBS_DOWN_SIGN = "\uD83D\uDC4E\uD83C\uDFFB",
1813
+ SMILING_FACE_WITH_HALO = "\uD83D\uDE07",
1814
+ NERD_FACE = "\uD83E\uDD13",
1815
+ ROLLING_ON_THE_FLOOR_LAUGHING = "\uD83E\uDD23",
1816
+ UPSIDE_DOWN_FACE = "\uD83D\uDE43",
1817
+ WAVING_HAND = "\uD83D\uDC4B",
1818
+ RAISED_HAND = "\u270B",
1819
+ VICTORY_HAND = "\u270C\uFE0F",
1820
+ FOLDED_HANDS = "\uD83D\uDE4F",
1821
+ PERSON_RAISING_HAND = "\uD83D\uDE4B",
1822
+ PERSON_BOWING = "\uD83D\uDE47",
1823
+ PERSON_SHRUGGING = "\uD83E\uDD37",
1824
+ PERSON_WALKING = "\uD83D\uDEB6",
1825
+ PERSON_RUNNING = "\uD83C\uDFC3",
1826
+ PERSON_SWIMMING = "\uD83C\uDFCA",
1827
+ PERSON_BIKING = "\uD83D\uDEB4",
1828
+ PERSON_DANCING = "\uD83D\uDC83",
1829
+ PEOPLE_HUGGING = "\uD83E\uDD17",
1830
+ SPEECH_BUBBLE = "\uD83D\uDCAC",
1831
+ THOUGHT_BUBBLE = "\uD83D\uDCAD",
1832
+ BUST_IN_SILHOUETTE = "\uD83D\uDC64",
1833
+ BUSTS_IN_SILHOUETTE = "\uD83D\uDC65",
1834
+ MONKEY_FACE = "\uD83D\uDC35",
1835
+ DOG_FACE = "\uD83D\uDC36",
1836
+ CAT_FACE = "\uD83D\uDC31",
1837
+ PIG_FACE = "\uD83D\uDC37",
1838
+ COW_FACE = "\uD83D\uDC2E",
1839
+ RABBIT_FACE = "\uD83D\uDC30",
1840
+ BEAR_FACE = "\uD83D\uDC3B",
1841
+ PANDA_FACE = "\uD83D\uDC3C",
1842
+ PENGUIN = "\uD83D\uDC27",
1843
+ BIRD = "\uD83D\uDC26",
1844
+ BABY_CHICK = "\uD83D\uDC24",
1845
+ HATCHING_CHICK = "\uD83D\uDC23",
1846
+ BUG = "\uD83D\uDC1B",
1847
+ BUTTERFLY = "\uD83E\uDD8B",
1848
+ SNAIL = "\uD83D\uDC0C",
1849
+ LADY_BEETLE = "\uD83D\uDC1E",
1850
+ SPIDER = "\uD83D\uDD77\uFE0F",
1851
+ WEB = "\uD83D\uDD78\uFE0F",
1852
+ TURTLE = "\uD83D\uDC22",
1853
+ FISH = "\uD83D\uDC1F",
1854
+ WHALE = "\uD83D\uDC33",
1855
+ DOLPHIN = "\uD83D\uDC2C",
1856
+ OCTOPUS = "\uD83D\uDC19",
1857
+ CACTUS = "\uD83C\uDF35",
1858
+ TULIP = "\uD83C\uDF37",
1859
+ ROSE = "\uD83C\uDF39",
1860
+ SUNFLOWER = "\uD83C\uDF3B",
1861
+ PALM_TREE = "\uD83C\uDF34",
1862
+ EVERGREEN_TREE = "\uD83C\uDF32",
1863
+ DECIDUOUS_TREE = "\uD83C\uDF33",
1864
+ EGGPLANT = "\uD83C\uDF46",
1865
+ TOMATO = "\uD83C\uDF45",
1866
+ CARROT = "\uD83E\uDD55",
1867
+ BROCCOLI = "\uD83E\uDD66",
1868
+ CORN = "\uD83C\uDF3D",
1869
+ HOT_PEPPER = "\uD83C\uDF36\uFE0F",
1870
+ BREAD = "\uD83C\uDF5E",
1871
+ CHEESE = "\uD83E\uDDC0",
1872
+ HAMBURGER = "\uD83C\uDF54",
1873
+ PIZZA = "\uD83C\uDF55",
1874
+ TACO = "\uD83C\uDF2E",
1875
+ SUSHI = "\uD83C\uDF63",
1876
+ CUPCAKE = "\uD83E\uDDC1",
1877
+ ICE_CREAM = "\uD83C\uDF68",
1878
+ DONUT = "\uD83C\uDF69",
1879
+ CAKE = "\uD83C\uDF82",
1880
+ COOKIES = "\uD83C\uDF6A"
1881
+ }
1882
+
1719
1883
  declare enum TicketTypes {
1720
1884
  PAID = 1,
1721
1885
  FREE = 2,
@@ -1767,6 +1931,7 @@ declare class Glitch {
1767
1931
  Posts: typeof Posts;
1768
1932
  Templates: typeof Templates;
1769
1933
  Waitlists: typeof Waitlists;
1934
+ Utility: typeof Utility;
1770
1935
  };
1771
1936
  static util: {
1772
1937
  Requests: typeof Requests;
@@ -1821,6 +1986,7 @@ declare class Glitch {
1821
1986
  VIDEO: "video";
1822
1987
  }>;
1823
1988
  Roles: typeof Roles;
1989
+ SocialInteractions: typeof SocialInteractions;
1824
1990
  TeamJoinProcess: typeof TeamJoinProcess;
1825
1991
  TicketTypes: typeof TicketTypes;
1826
1992
  TicketUsageTypes: typeof TicketUsageTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Auth.ts CHANGED
@@ -53,8 +53,8 @@ class Auth {
53
53
  *
54
54
  * @returns promise
55
55
  */
56
- public static oneTimeLogin<T>() : AxiosPromise<Response<T>> {
57
- return Requests.processRoute(AuthRoutes.routes.one_time_login, {});
56
+ public static oneTimeLogin<T>(token : string) : AxiosPromise<Response<T>> {
57
+ return Requests.processRoute(AuthRoutes.routes.one_time_login, {token : token});
58
58
  }
59
59
 
60
60
  /**
@@ -212,7 +212,21 @@ class Communities {
212
212
  * @returns promise
213
213
  */
214
214
  public static acceptInvite<T>(community_id : string, token : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
215
- return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, {}, {community_id : community_id}, params);
215
+ return Requests.processRoute(CommunitiesRoute.routes.acceptInvite, {token : token}, {community_id : community_id}, params);
216
+ }
217
+
218
+ /**
219
+ * Retrieves a user's invite that have been sent.
220
+ *
221
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
222
+ *
223
+ * @param community_id The id of the community
224
+ * @param token The token required to get the invite.
225
+ *
226
+ * @returns promise
227
+ */
228
+ public static retrieveInvite<T>(community_id : string, token : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
229
+ return Requests.processRoute(CommunitiesRoute.routes.retrieveInvite, {}, {community_id : community_id, token : token}, params);
216
230
  }
217
231
 
218
232
  /**
package/src/api/Posts.ts CHANGED
@@ -103,6 +103,20 @@ class Posts {
103
103
  return Requests.processRoute(PostsRoute.routes.delete, {}, {post_id : post_id}, params);
104
104
  }
105
105
 
106
+ /**
107
+ * Toggle a social interaction and off for a post.
108
+ *
109
+ * @see hhttps://api.glitch.fun/api/documentation#/Post%20Route/postToggleInteraction
110
+ *
111
+ * @param data The data to be passed when toggling the interaction.
112
+ *
113
+ * @returns Promise
114
+ */
115
+ public static toggleInteraction<T>(post_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
116
+
117
+ return Requests.processRoute(PostsRoute.routes.toggleInteraction, data, {post_id : post_id}, params);
118
+ }
119
+
106
120
  }
107
121
 
108
122
  export default Posts;
@@ -0,0 +1,21 @@
1
+ import UtilityRoutes from "../routes/UtilityRoutes";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class Utility {
7
+
8
+ /**
9
+ * Get all the social interactions and emojis that are available.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilSocialInteraction
12
+ *
13
+ * @returns promise
14
+ */
15
+ public static listSocialInteractions<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
16
+ return Requests.processRoute(UtilityRoutes.routes.social_interactions, undefined, undefined, params);
17
+ }
18
+
19
+ }
20
+
21
+ export default Utility;
package/src/api/index.ts CHANGED
@@ -7,6 +7,7 @@ import Teams from "./Teams";
7
7
  import Waitlists from "./Waitlist";
8
8
  import Posts from "./Posts";
9
9
  import Templates from "./Templates";
10
+ import Utility from "./Utility";
10
11
 
11
12
 
12
13
  export {Auth};
@@ -17,4 +18,5 @@ export {Events};
17
18
  export {Teams};
18
19
  export {Waitlists};
19
20
  export {Posts};
20
- export {Templates};
21
+ export {Templates};
22
+ export {Utility};
@@ -0,0 +1,131 @@
1
+ export enum SocialInteractions {
2
+ LIKE = '👍',
3
+ LOVE = '❤️',
4
+ CARE = '🥰',
5
+ HAHA = '😂',
6
+ WOW = '😮',
7
+ SAD = '😞',
8
+ CRY = '😢',
9
+ ANGRY = '😡',
10
+ THUMBS_UP = '👍',
11
+ THUMBS_DOWN = '👎',
12
+ SMILE = '😊',
13
+ GRIN = '😁',
14
+ LAUGH = '😄',
15
+ JOY = '😃',
16
+ BLUSH = '😊',
17
+ SURPRISE = '😮',
18
+ SHOCK = '😲',
19
+ WOW_FACE = '😯',
20
+ MIND_BLOWN = '🤯',
21
+ ASTONISHED = '😳',
22
+ CLAP = '👏',
23
+ PARTY = '🎉',
24
+ FIRE = '🔥',
25
+ COOL = '😎',
26
+ OK = '👌',
27
+ EYES = '👀',
28
+ WINK = '😉',
29
+ TONGUE_OUT = '😜',
30
+ SILLY = '🤪',
31
+ COFFEE = '☕',
32
+ TEA = '🍵',
33
+ BEER = '🍺',
34
+ WINE = '🍷',
35
+ COCKTAIL = '🍸',
36
+ BALLOON = '🎈',
37
+ GIFT = '🎁',
38
+ CAMERA = '📷',
39
+ VIDEO_CAMERA = '📹',
40
+ MUSIC = '🎵',
41
+ HEADPHONES = '🎧',
42
+ TV = '📺',
43
+ BOOK = '📚',
44
+ PEN = '🖊️',
45
+ PAPERCLIP = '📎',
46
+ LOCK = '🔒',
47
+ KEY = '🔑',
48
+ MAGNIFYING_GLASS = '🔍',
49
+ EARTH_GLOBE = '🌍',
50
+ MAP = '🗺️',
51
+ SUN = '☀️',
52
+ MOON = '🌙',
53
+ STARS = '🌟',
54
+ UMBRELLA = '☂️',
55
+ RAINBOW = '🌈',
56
+ CLOCK = '⏰',
57
+ HOURGLASS = '⌛',
58
+ MONEY_BAG = '💰',
59
+ SHOPPING_CART = '🛒',
60
+ THUMBS_UP_SIGN = '👍🏻',
61
+ THUMBS_DOWN_SIGN = '👎🏻',
62
+ SMILING_FACE_WITH_HALO = '😇',
63
+ NERD_FACE = '🤓',
64
+ ROLLING_ON_THE_FLOOR_LAUGHING = '🤣',
65
+ UPSIDE_DOWN_FACE = '🙃',
66
+ WAVING_HAND = '👋',
67
+ RAISED_HAND = '✋',
68
+ VICTORY_HAND = '✌️',
69
+ FOLDED_HANDS = '🙏',
70
+ PERSON_RAISING_HAND = '🙋',
71
+ PERSON_BOWING = '🙇',
72
+ PERSON_SHRUGGING = '🤷',
73
+ PERSON_WALKING = '🚶',
74
+ PERSON_RUNNING = '🏃',
75
+ PERSON_SWIMMING = '🏊',
76
+ PERSON_BIKING = '🚴',
77
+ PERSON_DANCING = '💃',
78
+ PEOPLE_HUGGING = '🤗',
79
+ SPEECH_BUBBLE = '💬',
80
+ THOUGHT_BUBBLE = '💭',
81
+ BUST_IN_SILHOUETTE = '👤',
82
+ BUSTS_IN_SILHOUETTE = '👥',
83
+ MONKEY_FACE = '🐵',
84
+ DOG_FACE = '🐶',
85
+ CAT_FACE = '🐱',
86
+ PIG_FACE = '🐷',
87
+ COW_FACE = '🐮',
88
+ RABBIT_FACE = '🐰',
89
+ BEAR_FACE = '🐻',
90
+ PANDA_FACE = '🐼',
91
+ PENGUIN = '🐧',
92
+ BIRD = '🐦',
93
+ BABY_CHICK = '🐤',
94
+ HATCHING_CHICK = '🐣',
95
+ BUG = '🐛',
96
+ BUTTERFLY = '🦋',
97
+ SNAIL = '🐌',
98
+ LADY_BEETLE = '🐞',
99
+ SPIDER = '🕷️',
100
+ WEB = '🕸️',
101
+ TURTLE = '🐢',
102
+ FISH = '🐟',
103
+ WHALE = '🐳',
104
+ DOLPHIN = '🐬',
105
+ OCTOPUS = '🐙',
106
+ CACTUS = '🌵',
107
+ TULIP = '🌷',
108
+ ROSE = '🌹',
109
+ SUNFLOWER = '🌻',
110
+ PALM_TREE = '🌴',
111
+ EVERGREEN_TREE = '🌲',
112
+ DECIDUOUS_TREE = '🌳',
113
+ EGGPLANT = '🍆',
114
+ TOMATO = '🍅',
115
+ CARROT = '🥕',
116
+ BROCCOLI = '🥦',
117
+ CORN = '🌽',
118
+ HOT_PEPPER = '🌶️',
119
+ BREAD = '🍞',
120
+ CHEESE = '🧀',
121
+ HAMBURGER = '🍔',
122
+ PIZZA = '🍕',
123
+ TACO = '🌮',
124
+ SUSHI = '🍣',
125
+ CUPCAKE = '🧁',
126
+ ICE_CREAM = '🍨',
127
+ DONUT = '🍩',
128
+ CAKE = '🎂',
129
+ COOKIES = '🍪',
130
+ }
131
+
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ import { Teams } from "./api";
12
12
  import { Posts } from "./api";
13
13
  import {Templates} from "./api";
14
14
  import { Waitlists } from "./api";
15
+ import { Utility } from "./api";
15
16
 
16
17
  import Requests from "./util/Requests";
17
18
  import Parser from "./util/Parser";
@@ -28,6 +29,7 @@ import { Modes } from "./constants/Modes";
28
29
  import { PostTypes } from "./constants/PostTypes";
29
30
  import { Roles } from "./constants/Roles";
30
31
  import { TeamJoinProcess } from "./constants/TeamJoinProcess";
32
+ import {SocialInteractions} from "./constants/SocialInteractions"
31
33
  import TicketTypes from "./constants/TicketTypes";
32
34
  import { TicketUsageTypes } from "./constants/TicketUsageTypes";
33
35
  import { TicketVisibility } from "./constants/TicketVisbility";
@@ -48,7 +50,8 @@ class Glitch {
48
50
  Teams: Teams,
49
51
  Posts: Posts,
50
52
  Templates : Templates,
51
- Waitlists: Waitlists
53
+ Waitlists: Waitlists,
54
+ Utility : Utility,
52
55
  }
53
56
 
54
57
  public static util = {
@@ -68,6 +71,7 @@ class Glitch {
68
71
  Modes : Modes,
69
72
  PostTypes : PostTypes,
70
73
  Roles: Roles,
74
+ SocialInteractions : SocialInteractions,
71
75
  TeamJoinProcess : TeamJoinProcess,
72
76
  TicketTypes : TicketTypes,
73
77
  TicketUsageTypes : TicketUsageTypes,
@@ -15,6 +15,7 @@ class CommunitiesRoute {
15
15
  listInvites : {url : '/communities/{community_id}/invites', method : HTTP_METHODS.GET },
16
16
  sendInvite : {url: '/communities/{community_id}/sendInvite', method : HTTP_METHODS.POST},
17
17
  acceptInvite : {url : '/communities/{community_id}/acceptInvite', method: HTTP_METHODS.POST},
18
+ retrieveInvite : {url : '/communities/{community_id}/invites/{token}', method: HTTP_METHODS.GET},
18
19
  listUsers : {url : '/communities/{community_id}/users', method : HTTP_METHODS.GET},
19
20
  addUser : {url : '/communities/{community_id}/users', method : HTTP_METHODS.POST},
20
21
  showUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.GET},
@@ -9,6 +9,7 @@ class PostsRoute {
9
9
  view : { url: '/posts/{post_id}', method: HTTP_METHODS.GET },
10
10
  update :{ url: '/posts/{post_id}', method: HTTP_METHODS.PUT },
11
11
  delete : { url: '/posts/{post_id}', method: HTTP_METHODS.DELETE },
12
+ toggleInteraction : { url: '/posts/{post_id}/toggleInteraction', method: HTTP_METHODS.POST },
12
13
  };
13
14
 
14
15
  }
@@ -0,0 +1,12 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class UtilityRoutes {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
8
+ };
9
+
10
+ }
11
+
12
+ export default UtilityRoutes;
@@ -40,13 +40,15 @@ class Session {
40
40
  Storage.set(Session._first_name_key, null);
41
41
  Storage.set(Session._last_name_key, null);
42
42
  Storage.set(Session._email_key, null);
43
+ Storage.set(Session._username_key, null);
43
44
  }
44
45
 
45
- public static processAuthentication(data: { token: { access_token: string }, id: string, first_name: string, last_name: string, email: string }): void {
46
+ public static processAuthentication(data: { token: { access_token: string }, id: string, first_name: string, last_name: string, email: string, username: string }): void {
46
47
  Storage.setAuthToken(data.token.access_token);
47
48
  Storage.set(Session._id_key, data.id);
48
49
  Storage.set(Session._first_name_key, data.first_name);
49
50
  Storage.set(Session._last_name_key, data.last_name);
51
+ Storage.set(Session._username_key, data.username);
50
52
  Storage.set(Session._email_key, data.email);
51
53
 
52
54
  Config.setAuthToken(data.token.access_token);