@plusscommunities/pluss-core-app 1.4.7 → 1.5.0

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.
Files changed (184) hide show
  1. package/dist/module/actions/FollowerActions.js +34 -0
  2. package/dist/module/actions/FollowerActions.js.map +1 -0
  3. package/dist/module/actions/MediaActions.js +20 -0
  4. package/dist/module/actions/MediaActions.js.map +1 -0
  5. package/dist/module/actions/ResidentActions.js +26 -0
  6. package/dist/module/actions/ResidentActions.js.map +1 -0
  7. package/dist/module/actions/UserActions.js +214 -0
  8. package/dist/module/actions/UserActions.js.map +1 -0
  9. package/dist/module/actions/index.js +5 -0
  10. package/dist/module/actions/index.js.map +1 -0
  11. package/dist/module/actions/types.js +14 -0
  12. package/dist/module/actions/types.js.map +1 -0
  13. package/dist/module/apis/analyticsActions.js +20 -0
  14. package/dist/module/apis/analyticsActions.js.map +1 -0
  15. package/dist/module/apis/contactActions.js +27 -0
  16. package/dist/module/apis/contactActions.js.map +1 -0
  17. package/dist/module/apis/eventActions.js +163 -0
  18. package/dist/module/apis/eventActions.js.map +1 -0
  19. package/dist/module/apis/fileActions.js +96 -0
  20. package/dist/module/apis/fileActions.js.map +1 -0
  21. package/dist/module/apis/followerActions.js +38 -0
  22. package/dist/module/apis/followerActions.js.map +1 -0
  23. package/dist/module/apis/index.js +11 -0
  24. package/dist/module/apis/index.js.map +1 -0
  25. package/dist/module/apis/notificationActions.js +60 -0
  26. package/dist/module/apis/notificationActions.js.map +1 -0
  27. package/dist/module/apis/profileActions.js +14 -0
  28. package/dist/module/apis/profileActions.js.map +1 -0
  29. package/dist/module/apis/reactionActions.js +78 -0
  30. package/dist/module/apis/reactionActions.js.map +1 -0
  31. package/dist/module/apis/typeActions.js +15 -0
  32. package/dist/module/apis/typeActions.js.map +1 -0
  33. package/dist/module/apis/userActions.js +104 -0
  34. package/dist/module/apis/userActions.js.map +1 -0
  35. package/{assets → dist/module/assets}/icons/reactions/heart.png +0 -0
  36. package/{assets → dist/module/assets}/icons/reactions/party.png +0 -0
  37. package/{assets → dist/module/assets}/icons/reactions/sad.png +0 -0
  38. package/{assets → dist/module/assets}/icons/reactions/smile.png +0 -0
  39. package/dist/module/colours.js +149 -0
  40. package/dist/module/colours.js.map +1 -0
  41. package/dist/module/components/AddButton.js +45 -0
  42. package/dist/module/components/AddButton.js.map +1 -0
  43. package/dist/module/components/Attachment.js +59 -0
  44. package/dist/module/components/Attachment.js.map +1 -0
  45. package/dist/module/components/AudienceSelectorLauncher.js +70 -0
  46. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
  47. package/dist/module/components/AudienceSelectorPage.js +376 -0
  48. package/dist/module/components/AudienceSelectorPage.js.map +1 -0
  49. package/dist/module/components/BackButton.js +62 -0
  50. package/dist/module/components/BackButton.js.map +1 -0
  51. package/dist/module/components/CategoryTabs.js +171 -0
  52. package/dist/module/components/CategoryTabs.js.map +1 -0
  53. package/dist/module/components/CommentReply.js +363 -0
  54. package/dist/module/components/CommentReply.js.map +1 -0
  55. package/dist/module/components/CommentSection.js +785 -0
  56. package/dist/module/components/CommentSection.js.map +1 -0
  57. package/dist/module/components/ConfirmPopup.js +85 -0
  58. package/dist/module/components/ConfirmPopup.js.map +1 -0
  59. package/dist/module/components/ConfirmationPopup.js +77 -0
  60. package/dist/module/components/ConfirmationPopup.js.map +1 -0
  61. package/dist/module/components/DropDownItem.js +82 -0
  62. package/dist/module/components/DropDownItem.js.map +1 -0
  63. package/dist/module/components/DropDownMenu.js +46 -0
  64. package/dist/module/components/DropDownMenu.js.map +1 -0
  65. package/dist/module/components/EmptyStateMain.js +50 -0
  66. package/dist/module/components/EmptyStateMain.js.map +1 -0
  67. package/dist/module/components/EmptyStateWidget.js +52 -0
  68. package/dist/module/components/EmptyStateWidget.js.map +1 -0
  69. package/dist/module/components/FontScaleButton.js +37 -0
  70. package/dist/module/components/FontScaleButton.js.map +1 -0
  71. package/dist/module/components/FontScalePopup.js +77 -0
  72. package/dist/module/components/FontScalePopup.js.map +1 -0
  73. package/dist/module/components/FormCard.js +28 -0
  74. package/dist/module/components/FormCard.js.map +1 -0
  75. package/dist/module/components/FormCardSection.js +240 -0
  76. package/dist/module/components/FormCardSection.js.map +1 -0
  77. package/dist/module/components/FormCardSectionOptionLauncher.js +77 -0
  78. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
  79. package/dist/module/components/FormattedText.js +145 -0
  80. package/dist/module/components/FormattedText.js.map +1 -0
  81. package/dist/module/components/GenericInput.js +161 -0
  82. package/dist/module/components/GenericInput.js.map +1 -0
  83. package/dist/module/components/GenericInputSection.js +174 -0
  84. package/dist/module/components/GenericInputSection.js.map +1 -0
  85. package/dist/module/components/Header.js +491 -0
  86. package/dist/module/components/Header.js.map +1 -0
  87. package/dist/module/components/ImagePopup.js +257 -0
  88. package/dist/module/components/ImagePopup.js.map +1 -0
  89. package/dist/module/components/ImageUploadProgress.js +72 -0
  90. package/dist/module/components/ImageUploadProgress.js.map +1 -0
  91. package/dist/module/components/ImageUploader.js +850 -0
  92. package/dist/module/components/ImageUploader.js.map +1 -0
  93. package/dist/module/components/InlineButton.js +72 -0
  94. package/dist/module/components/InlineButton.js.map +1 -0
  95. package/dist/module/components/Input.js +164 -0
  96. package/dist/module/components/Input.js.map +1 -0
  97. package/dist/module/components/LoadingCircles.js +224 -0
  98. package/dist/module/components/LoadingCircles.js.map +1 -0
  99. package/dist/module/components/LoadingIndicator.js +95 -0
  100. package/dist/module/components/LoadingIndicator.js.map +1 -0
  101. package/dist/module/components/LoadingStateWidget.js +51 -0
  102. package/dist/module/components/LoadingStateWidget.js.map +1 -0
  103. package/dist/module/components/MediaPlayer.js +440 -0
  104. package/dist/module/components/MediaPlayer.js.map +1 -0
  105. package/dist/module/components/MiddlePopup.js +46 -0
  106. package/dist/module/components/MiddlePopup.js.map +1 -0
  107. package/dist/module/components/PDFPopup.js +188 -0
  108. package/dist/module/components/PDFPopup.js.map +1 -0
  109. package/dist/module/components/PlussChat.js +997 -0
  110. package/dist/module/components/PlussChat.js.map +1 -0
  111. package/dist/module/components/PlussChatMessage.js +204 -0
  112. package/dist/module/components/PlussChatMessage.js.map +1 -0
  113. package/dist/module/components/PlussChatTime.js +66 -0
  114. package/dist/module/components/PlussChatTime.js.map +1 -0
  115. package/dist/module/components/Popup.js +138 -0
  116. package/dist/module/components/Popup.js.map +1 -0
  117. package/dist/module/components/PopupMenu.js +128 -0
  118. package/dist/module/components/PopupMenu.js.map +1 -0
  119. package/dist/module/components/PositionedImage.js +333 -0
  120. package/dist/module/components/PositionedImage.js.map +1 -0
  121. package/dist/module/components/ProfilePic.js +119 -0
  122. package/dist/module/components/ProfilePic.js.map +1 -0
  123. package/dist/module/components/RadioButton.js +84 -0
  124. package/dist/module/components/RadioButton.js.map +1 -0
  125. package/dist/module/components/Reaction.js +129 -0
  126. package/dist/module/components/Reaction.js.map +1 -0
  127. package/dist/module/components/Reactions.js +84 -0
  128. package/dist/module/components/Reactions.js.map +1 -0
  129. package/dist/module/components/SharingTools.js +162 -0
  130. package/dist/module/components/SharingTools.js.map +1 -0
  131. package/dist/module/components/Spinner.js +25 -0
  132. package/dist/module/components/Spinner.js.map +1 -0
  133. package/dist/module/components/StickyFooter.js +37 -0
  134. package/dist/module/components/StickyFooter.js.map +1 -0
  135. package/dist/module/components/TextStyle.js +34 -0
  136. package/dist/module/components/TextStyle.js.map +1 -0
  137. package/dist/module/components/Toggle.js +70 -0
  138. package/dist/module/components/Toggle.js.map +1 -0
  139. package/dist/module/components/TouchableSearchBar.js +73 -0
  140. package/dist/module/components/TouchableSearchBar.js.map +1 -0
  141. package/dist/module/components/UserListPopup.js +146 -0
  142. package/dist/module/components/UserListPopup.js.map +1 -0
  143. package/dist/module/components/UserListing.js +291 -0
  144. package/dist/module/components/UserListing.js.map +1 -0
  145. package/dist/module/components/VideoPopup.js +123 -0
  146. package/dist/module/components/VideoPopup.js.map +1 -0
  147. package/dist/module/components/WarningPopup.js +87 -0
  148. package/dist/module/components/WarningPopup.js.map +1 -0
  149. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +325 -0
  150. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
  151. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +123 -0
  152. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
  153. package/dist/module/components/index.js +53 -0
  154. package/dist/module/components/index.js.map +1 -0
  155. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +416 -0
  156. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
  157. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +405 -0
  158. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
  159. package/dist/module/config.js +27 -0
  160. package/dist/module/config.js.map +1 -0
  161. package/dist/module/constants.js +16 -0
  162. package/dist/module/constants.js.map +1 -0
  163. package/dist/module/fonts/index.js +2 -0
  164. package/dist/module/fonts/index.js.map +1 -0
  165. package/dist/module/fonts/pluss60-icons.js +5 -0
  166. package/dist/module/fonts/pluss60-icons.js.map +1 -0
  167. package/dist/module/fonts/pluss60-icons.json +1097 -0
  168. package/dist/module/helper.js +436 -0
  169. package/dist/module/helper.js.map +1 -0
  170. package/dist/module/index.js +13 -0
  171. package/dist/module/index.js.map +1 -0
  172. package/dist/module/session.js +54 -0
  173. package/dist/module/session.js.map +1 -0
  174. package/dist/module/styles.js +67 -0
  175. package/dist/module/styles.js.map +1 -0
  176. package/package.json +24 -7
  177. package/src/assets/icons/reactions/heart.png +0 -0
  178. package/src/assets/icons/reactions/party.png +0 -0
  179. package/src/assets/icons/reactions/sad.png +0 -0
  180. package/src/assets/icons/reactions/smile.png +0 -0
  181. package/src/components/CommentReply.js +3 -5
  182. package/src/components/CommentSection.js +4 -4
  183. package/src/constants.js +4 -4
  184. package/src/helper.js +4 -4
@@ -0,0 +1,34 @@
1
+ import _ from 'lodash';
2
+ import { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from './types';
3
+ import { followerActions } from '../apis/followerActions';
4
+ export const loadFollowers = followers => {
5
+ return {
6
+ type: LOAD_FOLLOWERS,
7
+ payload: followers
8
+ };
9
+ };
10
+ export const getFollowers = userId => {
11
+ return async dispatch => {
12
+ followerActions.getFollowing(userId).then(res => {
13
+ // console.log('getFollowing', res.data);
14
+ if (res.data != null && res.data.Items != null && !_.isEmpty(res.data.Items)) {
15
+ dispatch(loadFollowers(res.data.Items));
16
+ }
17
+ }).catch(error => {
18
+ console.log('getFollowing', error);
19
+ });
20
+ };
21
+ };
22
+ export const addFollower = user => {
23
+ return {
24
+ type: ADD_FOLLOWER,
25
+ payload: user
26
+ };
27
+ };
28
+ export const removeFollower = userId => {
29
+ return {
30
+ type: REMOVE_FOLLOWER,
31
+ payload: userId
32
+ };
33
+ };
34
+ //# sourceMappingURL=FollowerActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["FollowerActions.js"],"names":["_","LOAD_FOLLOWERS","ADD_FOLLOWER","REMOVE_FOLLOWER","followerActions","loadFollowers","followers","type","payload","getFollowers","userId","dispatch","getFollowing","then","res","data","Items","isEmpty","catch","error","console","log","addFollower","user","removeFollower"],"mappings":"AAAA,OAAOA,CAAP,MAAc,QAAd;AACA,SAASC,cAAT,EAAyBC,YAAzB,EAAuCC,eAAvC,QAA8D,SAA9D;AACA,SAASC,eAAT,QAAgC,yBAAhC;AAEA,OAAO,MAAMC,aAAa,GAAGC,SAAS,IAAI;AACxC,SAAO;AACLC,IAAAA,IAAI,EAAEN,cADD;AAELO,IAAAA,OAAO,EAAEF;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMG,YAAY,GAAGC,MAAM,IAAI;AACpC,SAAO,MAAMC,QAAN,IAAkB;AACvBP,IAAAA,eAAe,CACZQ,YADH,CACgBF,MADhB,EAEGG,IAFH,CAEQC,GAAG,IAAI;AACX;AACA,UAAIA,GAAG,CAACC,IAAJ,IAAY,IAAZ,IAAoBD,GAAG,CAACC,IAAJ,CAASC,KAAT,IAAkB,IAAtC,IAA8C,CAAChB,CAAC,CAACiB,OAAF,CAAUH,GAAG,CAACC,IAAJ,CAASC,KAAnB,CAAnD,EAA8E;AAC5EL,QAAAA,QAAQ,CAACN,aAAa,CAACS,GAAG,CAACC,IAAJ,CAASC,KAAV,CAAd,CAAR;AACD;AACF,KAPH,EAQGE,KARH,CAQSC,KAAK,IAAI;AACdC,MAAAA,OAAO,CAACC,GAAR,CAAY,cAAZ,EAA4BF,KAA5B;AACD,KAVH;AAWD,GAZD;AAaD,CAdM;AAgBP,OAAO,MAAMG,WAAW,GAAGC,IAAI,IAAI;AACjC,SAAO;AACLhB,IAAAA,IAAI,EAAEL,YADD;AAELM,IAAAA,OAAO,EAAEe;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMC,cAAc,GAAGd,MAAM,IAAI;AACtC,SAAO;AACLH,IAAAA,IAAI,EAAEJ,eADD;AAELK,IAAAA,OAAO,EAAEE;AAFJ,GAAP;AAID,CALM","sourcesContent":["import _ from 'lodash';\nimport { LOAD_FOLLOWERS, ADD_FOLLOWER, REMOVE_FOLLOWER } from './types';\nimport { followerActions } from '../apis/followerActions';\n\nexport const loadFollowers = followers => {\n return {\n type: LOAD_FOLLOWERS,\n payload: followers,\n };\n};\n\nexport const getFollowers = userId => {\n return async dispatch => {\n followerActions\n .getFollowing(userId)\n .then(res => {\n // console.log('getFollowing', res.data);\n if (res.data != null && res.data.Items != null && !_.isEmpty(res.data.Items)) {\n dispatch(loadFollowers(res.data.Items));\n }\n })\n .catch(error => {\n console.log('getFollowing', error);\n });\n };\n};\n\nexport const addFollower = user => {\n return {\n type: ADD_FOLLOWER,\n payload: user,\n };\n};\n\nexport const removeFollower = userId => {\n return {\n type: REMOVE_FOLLOWER,\n payload: userId,\n };\n};\n"]}
@@ -0,0 +1,20 @@
1
+ import { IMAGE_LIBRARY_LOADED, STOCK_IMAGES_LOADED, IMAGE_FOLDER_UPDATED } from './types';
2
+ export const stockImagesLoaded = images => {
3
+ return {
4
+ type: STOCK_IMAGES_LOADED,
5
+ payload: images
6
+ };
7
+ };
8
+ export const imageLibraryLoaded = library => {
9
+ return {
10
+ type: IMAGE_LIBRARY_LOADED,
11
+ payload: library
12
+ };
13
+ };
14
+ export const imageFolderUpdated = folder => {
15
+ return {
16
+ type: IMAGE_FOLDER_UPDATED,
17
+ payload: folder
18
+ };
19
+ };
20
+ //# sourceMappingURL=MediaActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["MediaActions.js"],"names":["IMAGE_LIBRARY_LOADED","STOCK_IMAGES_LOADED","IMAGE_FOLDER_UPDATED","stockImagesLoaded","images","type","payload","imageLibraryLoaded","library","imageFolderUpdated","folder"],"mappings":"AAAA,SAASA,oBAAT,EAA+BC,mBAA/B,EAAoDC,oBAApD,QAAgF,SAAhF;AAEA,OAAO,MAAMC,iBAAiB,GAAGC,MAAM,IAAI;AACzC,SAAO;AACLC,IAAAA,IAAI,EAAEJ,mBADD;AAELK,IAAAA,OAAO,EAAEF;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMG,kBAAkB,GAAGC,OAAO,IAAI;AAC3C,SAAO;AACLH,IAAAA,IAAI,EAAEL,oBADD;AAELM,IAAAA,OAAO,EAAEE;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMC,kBAAkB,GAAGC,MAAM,IAAI;AAC1C,SAAO;AACLL,IAAAA,IAAI,EAAEH,oBADD;AAELI,IAAAA,OAAO,EAAEI;AAFJ,GAAP;AAID,CALM","sourcesContent":["import { IMAGE_LIBRARY_LOADED, STOCK_IMAGES_LOADED, IMAGE_FOLDER_UPDATED } from './types';\n\nexport const stockImagesLoaded = images => {\n return {\n type: STOCK_IMAGES_LOADED,\n payload: images,\n };\n};\n\nexport const imageLibraryLoaded = library => {\n return {\n type: IMAGE_LIBRARY_LOADED,\n payload: library,\n };\n};\n\nexport const imageFolderUpdated = folder => {\n return {\n type: IMAGE_FOLDER_UPDATED,\n payload: folder,\n };\n};\n"]}
@@ -0,0 +1,26 @@
1
+ import { UPDATE_RESIDENTS, LOADED_RESIDENTS, LOADED_LINKED_USERS, LOADED_LINKED_TO_USERS } from './types';
2
+ export const updateResidents = userContact => {
3
+ return {
4
+ type: UPDATE_RESIDENTS,
5
+ payload: userContact
6
+ };
7
+ };
8
+ export const residentsLoaded = list => {
9
+ return {
10
+ type: LOADED_RESIDENTS,
11
+ payload: list
12
+ };
13
+ };
14
+ export const linkedUsersLoaded = linkedUsers => {
15
+ return {
16
+ type: LOADED_LINKED_USERS,
17
+ payload: linkedUsers
18
+ };
19
+ };
20
+ export const linkedToUsersLoaded = linkedToUsers => {
21
+ return {
22
+ type: LOADED_LINKED_TO_USERS,
23
+ payload: linkedToUsers
24
+ };
25
+ };
26
+ //# sourceMappingURL=ResidentActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ResidentActions.js"],"names":["UPDATE_RESIDENTS","LOADED_RESIDENTS","LOADED_LINKED_USERS","LOADED_LINKED_TO_USERS","updateResidents","userContact","type","payload","residentsLoaded","list","linkedUsersLoaded","linkedUsers","linkedToUsersLoaded","linkedToUsers"],"mappings":"AAAA,SAASA,gBAAT,EAA2BC,gBAA3B,EAA6CC,mBAA7C,EAAkEC,sBAAlE,QAAgG,SAAhG;AAEA,OAAO,MAAMC,eAAe,GAAGC,WAAW,IAAI;AAC5C,SAAO;AACLC,IAAAA,IAAI,EAAEN,gBADD;AAELO,IAAAA,OAAO,EAAEF;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMG,eAAe,GAAGC,IAAI,IAAI;AACrC,SAAO;AACLH,IAAAA,IAAI,EAAEL,gBADD;AAELM,IAAAA,OAAO,EAAEE;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMC,iBAAiB,GAAGC,WAAW,IAAI;AAC9C,SAAO;AACLL,IAAAA,IAAI,EAAEJ,mBADD;AAELK,IAAAA,OAAO,EAAEI;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMC,mBAAmB,GAAGC,aAAa,IAAI;AAClD,SAAO;AACLP,IAAAA,IAAI,EAAEH,sBADD;AAELI,IAAAA,OAAO,EAAEM;AAFJ,GAAP;AAID,CALM","sourcesContent":["import { UPDATE_RESIDENTS, LOADED_RESIDENTS, LOADED_LINKED_USERS, LOADED_LINKED_TO_USERS } from './types';\n\nexport const updateResidents = userContact => {\n return {\n type: UPDATE_RESIDENTS,\n payload: userContact,\n };\n};\n\nexport const residentsLoaded = list => {\n return {\n type: LOADED_RESIDENTS,\n payload: list,\n };\n};\n\nexport const linkedUsersLoaded = linkedUsers => {\n return {\n type: LOADED_LINKED_USERS,\n payload: linkedUsers,\n };\n};\n\nexport const linkedToUsersLoaded = linkedToUsers => {\n return {\n type: LOADED_LINKED_TO_USERS,\n payload: linkedToUsers,\n };\n};\n"]}
@@ -0,0 +1,214 @@
1
+ // import axios from 'axios';
2
+ import { // SAVE_PROFILE_PIC_SUCCESS,
3
+ // SAVE_PROFILE_PIC_FAIL,
4
+ // ONBOARDING_UPDATE,
5
+ // HOME_ONBOARDING_UPDATE,
6
+ // USER_UPDATED,
7
+ UPDATE_USER_STATE // UPDATE_USER_STATE_FAIL,
8
+ } from './types'; // import { baseUrl } from '../config';
9
+ // import { userActions } from '../webapi';
10
+ // const ROOT_URL = baseUrl;
11
+ // export const updateProfilePic = uri => {
12
+ // return async dispatch => {
13
+ // let userID = null;
14
+ // let token = null;
15
+ // if (userID) {
16
+ // dispatch({
17
+ // type: SAVE_PROFILE_PIC_SUCCESS,
18
+ // payload: { profilePic: uri },
19
+ // });
20
+ // await axios({
21
+ // method: 'post',
22
+ // url: `${ROOT_URL}/updateProfilePic`,
23
+ // data: {
24
+ // uri,
25
+ // userID,
26
+ // },
27
+ // headers: {
28
+ // authorization: `Bearer ${token}`,
29
+ // },
30
+ // })
31
+ // .then(() => {
32
+ // dispatch({
33
+ // type: SAVE_PROFILE_PIC_SUCCESS,
34
+ // payload: { profilePic: uri },
35
+ // });
36
+ // })
37
+ // .catch(error => {
38
+ // console.log(error.response.data);
39
+ // dispatch({ type: SAVE_PROFILE_PIC_FAIL });
40
+ // });
41
+ // }
42
+ // };
43
+ // };
44
+ // export const updateUser = (input, callback) => {
45
+ // return async dispatch => {
46
+ // console.log('update User Action hit');
47
+ // dispatch({
48
+ // type: USER_UPDATED,
49
+ // payload: input,
50
+ // });
51
+ // };
52
+ // };
53
+
54
+ export const softUpdateUser = input => {
55
+ return {
56
+ type: UPDATE_USER_STATE,
57
+ payload: input
58
+ };
59
+ };
60
+ export const updateNavRead = input => {
61
+ return async dispatch => {
62
+ setTimeout(() => {
63
+ dispatch({
64
+ type: UPDATE_USER_STATE,
65
+ payload: {
66
+ openedNotifs: input
67
+ }
68
+ });
69
+ }, 500);
70
+ };
71
+ };
72
+ /*
73
+ Update user data without triggering uploadingProfile or uploadingProfilePic
74
+ */
75
+ // export const silentUpdateUser = (input, immediate) => {
76
+ // return async dispatch => {
77
+ // if (immediate) {
78
+ // dispatch({
79
+ // type: UPDATE_USER_STATE,
80
+ // payload: input,
81
+ // });
82
+ // }
83
+ // userActions
84
+ // .updateProfile(input)
85
+ // .then(res => {
86
+ // if (res.data.userCreationFail) {
87
+ // console.log('user update failed', res.data.message);
88
+ // dispatch({
89
+ // type: UPDATE_USER_STATE_FAIL,
90
+ // payload: res.data.message,
91
+ // });
92
+ // } else {
93
+ // dispatch({
94
+ // type: UPDATE_USER_STATE,
95
+ // payload: input,
96
+ // });
97
+ // }
98
+ // })
99
+ // .catch(err => {
100
+ // console.log('user update fail -- Silent Upate', err);
101
+ // });
102
+ // };
103
+ // };
104
+ // export const seenOnboarding = () => {
105
+ // return async dispatch => {
106
+ // dispatch({ type: ONBOARDING_UPDATE });
107
+ // let userID = null;
108
+ // let token = null;
109
+ // if (userID) {
110
+ // await axios({
111
+ // method: 'post',
112
+ // url: `${ROOT_URL}/updateProfile`,
113
+ // data: {
114
+ // userID,
115
+ // details: {
116
+ // onBoardingSeen: true,
117
+ // },
118
+ // },
119
+ // headers: {
120
+ // authorization: `Bearer ${token}`,
121
+ // },
122
+ // })
123
+ // .then(() => {})
124
+ // .catch(() => {
125
+ // console.log('onBoarding update fail');
126
+ // });
127
+ // }
128
+ // };
129
+ // };
130
+
131
+ /*
132
+ Will combine this eventually with above function
133
+ */
134
+ // export const seenHomeOnboarding = () => {
135
+ // return async dispatch => {
136
+ // dispatch({ type: HOME_ONBOARDING_UPDATE });
137
+ // let userID = null;
138
+ // let token = null;
139
+ // if (userID) {
140
+ // await axios({
141
+ // method: 'post',
142
+ // url: `${ROOT_URL}/updateProfile`,
143
+ // data: {
144
+ // userID,
145
+ // details: {
146
+ // homeOnboardingSeen: true,
147
+ // },
148
+ // },
149
+ // headers: {
150
+ // authorization: `Bearer ${token}`,
151
+ // },
152
+ // })
153
+ // .then(() => {})
154
+ // .catch(() => {
155
+ // console.log('onBoarding update fail');
156
+ // });
157
+ // }
158
+ // };
159
+ // };
160
+
161
+ /*
162
+ Triggered at app startup for saving user current home takeover.
163
+ */
164
+ // export const updateUserStartupTakeover = async input => {
165
+ // let userID = null;
166
+ // let token = null;
167
+ // if (userID) {
168
+ // await axios({
169
+ // method: 'post',
170
+ // url: `${ROOT_URL}/updateProfile`,
171
+ // data: {
172
+ // userID,
173
+ // details: input,
174
+ // },
175
+ // headers: {
176
+ // authorization: `Bearer ${token}`,
177
+ // },
178
+ // })
179
+ // .then(() => {})
180
+ // .catch(() => {
181
+ // console.log('startup takeover save fail -- Update User Startup Takeover');
182
+ // });
183
+ // }
184
+ // };
185
+ // export const registerStandaloneUser = takeover => {
186
+ // return async dispatch => {
187
+ // let userObj = null;
188
+ // if (userObj && takeover) {
189
+ // await axios({
190
+ // method: 'post',
191
+ // url: `${ROOT_URL}/registerStandaloneUser`,
192
+ // data: {
193
+ // userObj,
194
+ // takeoverKey: takeover.Key,
195
+ // },
196
+ // headers: {
197
+ // authorization: 'Gweg',
198
+ // },
199
+ // })
200
+ // .then(() => {
201
+ // dispatch({
202
+ // type: UPDATE_USER_STATE,
203
+ // payload: { standaloneRegistered: true },
204
+ // });
205
+ // })
206
+ // .catch(() => {
207
+ // console.log('register standalone user -- fail');
208
+ // });
209
+ // } else {
210
+ // console.log('Failed to detect user for takeover registration');
211
+ // }
212
+ // };
213
+ // };
214
+ //# sourceMappingURL=UserActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["UserActions.js"],"names":["UPDATE_USER_STATE","softUpdateUser","input","type","payload","updateNavRead","dispatch","setTimeout","openedNotifs"],"mappings":"AAAA;AACA,SACE;AACA;AACA;AACA;AACA;AACAA,iBANF,CAOE;AAPF,OAQO,SARP,C,CASA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,cAAc,GAAGC,KAAK,IAAI;AACrC,SAAO;AACLC,IAAAA,IAAI,EAAEH,iBADD;AAELI,IAAAA,OAAO,EAAEF;AAFJ,GAAP;AAID,CALM;AAOP,OAAO,MAAMG,aAAa,GAAGH,KAAK,IAAI;AACpC,SAAO,MAAMI,QAAN,IAAkB;AACvBC,IAAAA,UAAU,CAAC,MAAM;AACfD,MAAAA,QAAQ,CAAC;AACPH,QAAAA,IAAI,EAAEH,iBADC;AAEPI,QAAAA,OAAO,EAAE;AAAEI,UAAAA,YAAY,EAAEN;AAAhB;AAFF,OAAD,CAAR;AAID,KALS,EAKP,GALO,CAAV;AAMD,GAPD;AAQD,CATM;AAWP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["// import axios from 'axios';\nimport {\n // SAVE_PROFILE_PIC_SUCCESS,\n // SAVE_PROFILE_PIC_FAIL,\n // ONBOARDING_UPDATE,\n // HOME_ONBOARDING_UPDATE,\n // USER_UPDATED,\n UPDATE_USER_STATE,\n // UPDATE_USER_STATE_FAIL,\n} from './types';\n// import { baseUrl } from '../config';\n// import { userActions } from '../webapi';\n\n// const ROOT_URL = baseUrl;\n\n// export const updateProfilePic = uri => {\n// return async dispatch => {\n// let userID = null;\n// let token = null;\n// if (userID) {\n// dispatch({\n// type: SAVE_PROFILE_PIC_SUCCESS,\n// payload: { profilePic: uri },\n// });\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfilePic`,\n// data: {\n// uri,\n// userID,\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {\n// dispatch({\n// type: SAVE_PROFILE_PIC_SUCCESS,\n// payload: { profilePic: uri },\n// });\n// })\n// .catch(error => {\n// console.log(error.response.data);\n// dispatch({ type: SAVE_PROFILE_PIC_FAIL });\n// });\n// }\n// };\n// };\n\n// export const updateUser = (input, callback) => {\n// return async dispatch => {\n// console.log('update User Action hit');\n// dispatch({\n// type: USER_UPDATED,\n// payload: input,\n// });\n// };\n// };\n\nexport const softUpdateUser = input => {\n return {\n type: UPDATE_USER_STATE,\n payload: input,\n };\n};\n\nexport const updateNavRead = input => {\n return async dispatch => {\n setTimeout(() => {\n dispatch({\n type: UPDATE_USER_STATE,\n payload: { openedNotifs: input },\n });\n }, 500);\n };\n};\n\n/* \nUpdate user data without triggering uploadingProfile or uploadingProfilePic\n*/\n// export const silentUpdateUser = (input, immediate) => {\n// return async dispatch => {\n// if (immediate) {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: input,\n// });\n// }\n// userActions\n// .updateProfile(input)\n// .then(res => {\n// if (res.data.userCreationFail) {\n// console.log('user update failed', res.data.message);\n// dispatch({\n// type: UPDATE_USER_STATE_FAIL,\n// payload: res.data.message,\n// });\n// } else {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: input,\n// });\n// }\n// })\n// .catch(err => {\n// console.log('user update fail -- Silent Upate', err);\n// });\n// };\n// };\n\n// export const seenOnboarding = () => {\n// return async dispatch => {\n// dispatch({ type: ONBOARDING_UPDATE });\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: {\n// onBoardingSeen: true,\n// },\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('onBoarding update fail');\n// });\n// }\n// };\n// };\n\n/* \n Will combine this eventually with above function\n*/\n// export const seenHomeOnboarding = () => {\n// return async dispatch => {\n// dispatch({ type: HOME_ONBOARDING_UPDATE });\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: {\n// homeOnboardingSeen: true,\n// },\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('onBoarding update fail');\n// });\n// }\n// };\n// };\n\n/* \nTriggered at app startup for saving user current home takeover. \n*/\n// export const updateUserStartupTakeover = async input => {\n// let userID = null;\n// let token = null;\n// if (userID) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/updateProfile`,\n// data: {\n// userID,\n// details: input,\n// },\n// headers: {\n// authorization: `Bearer ${token}`,\n// },\n// })\n// .then(() => {})\n// .catch(() => {\n// console.log('startup takeover save fail -- Update User Startup Takeover');\n// });\n// }\n// };\n\n// export const registerStandaloneUser = takeover => {\n// return async dispatch => {\n// let userObj = null;\n// if (userObj && takeover) {\n// await axios({\n// method: 'post',\n// url: `${ROOT_URL}/registerStandaloneUser`,\n// data: {\n// userObj,\n// takeoverKey: takeover.Key,\n// },\n// headers: {\n// authorization: 'Gweg',\n// },\n// })\n// .then(() => {\n// dispatch({\n// type: UPDATE_USER_STATE,\n// payload: { standaloneRegistered: true },\n// });\n// })\n// .catch(() => {\n// console.log('register standalone user -- fail');\n// });\n// } else {\n// console.log('Failed to detect user for takeover registration');\n// }\n// };\n// };\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './MediaActions';
2
+ export * from './FollowerActions';
3
+ export * from './ResidentActions';
4
+ export * from './UserActions';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"names":[],"mappings":"AAAA,cAAc,gBAAd;AACA,cAAc,mBAAd;AACA,cAAc,mBAAd;AACA,cAAc,eAAd","sourcesContent":["export * from './MediaActions';\nexport * from './FollowerActions';\nexport * from './ResidentActions';\nexport * from './UserActions';\n"]}
@@ -0,0 +1,14 @@
1
+ export const LOGOUT = 'LOGOUT';
2
+ export const CHANGE_ROLE = 'CHANGE_ROLE';
3
+ export const IMAGE_LIBRARY_LOADED = 'IMAGE_LIBRARY_LOADED';
4
+ export const STOCK_IMAGES_LOADED = 'STOCK_IMAGES_LOADED';
5
+ export const IMAGE_FOLDER_UPDATED = 'IMAGE_FOLDER_UPDATED';
6
+ export const LOAD_FOLLOWERS = 'LOAD_FOLLOWERS';
7
+ export const ADD_FOLLOWER = 'ADD_FOLLOWER';
8
+ export const REMOVE_FOLLOWER = 'REMOVE_FOLLOWER';
9
+ export const UPDATE_RESIDENTS = 'UPDATE_RESIDENTS';
10
+ export const LOADED_RESIDENTS = 'LOADED_RESIDENTS';
11
+ export const LOADED_LINKED_USERS = 'LOADED_LINKED_USERS';
12
+ export const LOADED_LINKED_TO_USERS = 'LOADED_LINKED_TO_USERS';
13
+ export const UPDATE_USER_STATE = 'UPDATE_USER_STATE';
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["types.js"],"names":["LOGOUT","CHANGE_ROLE","IMAGE_LIBRARY_LOADED","STOCK_IMAGES_LOADED","IMAGE_FOLDER_UPDATED","LOAD_FOLLOWERS","ADD_FOLLOWER","REMOVE_FOLLOWER","UPDATE_RESIDENTS","LOADED_RESIDENTS","LOADED_LINKED_USERS","LOADED_LINKED_TO_USERS","UPDATE_USER_STATE"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG,QAAf;AACP,OAAO,MAAMC,WAAW,GAAG,aAApB;AACP,OAAO,MAAMC,oBAAoB,GAAG,sBAA7B;AACP,OAAO,MAAMC,mBAAmB,GAAG,qBAA5B;AACP,OAAO,MAAMC,oBAAoB,GAAG,sBAA7B;AACP,OAAO,MAAMC,cAAc,GAAG,gBAAvB;AACP,OAAO,MAAMC,YAAY,GAAG,cAArB;AACP,OAAO,MAAMC,eAAe,GAAG,iBAAxB;AACP,OAAO,MAAMC,gBAAgB,GAAG,kBAAzB;AACP,OAAO,MAAMC,gBAAgB,GAAG,kBAAzB;AACP,OAAO,MAAMC,mBAAmB,GAAG,qBAA5B;AACP,OAAO,MAAMC,sBAAsB,GAAG,wBAA/B;AACP,OAAO,MAAMC,iBAAiB,GAAG,mBAA1B","sourcesContent":["export const LOGOUT = 'LOGOUT';\nexport const CHANGE_ROLE = 'CHANGE_ROLE';\nexport const IMAGE_LIBRARY_LOADED = 'IMAGE_LIBRARY_LOADED';\nexport const STOCK_IMAGES_LOADED = 'STOCK_IMAGES_LOADED';\nexport const IMAGE_FOLDER_UPDATED = 'IMAGE_FOLDER_UPDATED';\nexport const LOAD_FOLLOWERS = 'LOAD_FOLLOWERS';\nexport const ADD_FOLLOWER = 'ADD_FOLLOWER';\nexport const REMOVE_FOLLOWER = 'REMOVE_FOLLOWER';\nexport const UPDATE_RESIDENTS = 'UPDATE_RESIDENTS';\nexport const LOADED_RESIDENTS = 'LOADED_RESIDENTS';\nexport const LOADED_LINKED_USERS = 'LOADED_LINKED_USERS';\nexport const LOADED_LINKED_TO_USERS = 'LOADED_LINKED_TO_USERS';\nexport const UPDATE_USER_STATE = 'UPDATE_USER_STATE';\n"]}
@@ -0,0 +1,20 @@
1
+ import { getUrl } from '../helper';
2
+ import { authedFunction } from '../session';
3
+ export const analyticsActions = {
4
+ log: (site, actionType, entityType, entityId, data) => {
5
+ return authedFunction({
6
+ method: 'POST',
7
+ url: getUrl('analytics', 'log'),
8
+ data: {
9
+ site,
10
+ actionType,
11
+ entityType,
12
+ entityId,
13
+ data
14
+ }
15
+ }).catch(error => {
16
+ console.log('log error', error);
17
+ });
18
+ }
19
+ };
20
+ //# sourceMappingURL=analyticsActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["analyticsActions.js"],"names":["getUrl","authedFunction","analyticsActions","log","site","actionType","entityType","entityId","data","method","url","catch","error","console"],"mappings":"AAAA,SAASA,MAAT,QAAuB,WAAvB;AACA,SAASC,cAAT,QAA+B,YAA/B;AAEA,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,GAAG,EAAE,CAACC,IAAD,EAAOC,UAAP,EAAmBC,UAAnB,EAA+BC,QAA/B,EAAyCC,IAAzC,KAAkD;AACrD,WAAOP,cAAc,CAAC;AACpBQ,MAAAA,MAAM,EAAE,MADY;AAEpBC,MAAAA,GAAG,EAAEV,MAAM,CAAC,WAAD,EAAc,KAAd,CAFS;AAGpBQ,MAAAA,IAAI,EAAE;AACJJ,QAAAA,IADI;AAEJC,QAAAA,UAFI;AAGJC,QAAAA,UAHI;AAIJC,QAAAA,QAJI;AAKJC,QAAAA;AALI;AAHc,KAAD,CAAd,CAUJG,KAVI,CAUEC,KAAK,IAAI;AAChBC,MAAAA,OAAO,CAACV,GAAR,CAAY,WAAZ,EAAyBS,KAAzB;AACD,KAZM,CAAP;AAaD;AAf6B,CAAzB","sourcesContent":["import { getUrl } from '../helper';\nimport { authedFunction } from '../session';\n\nexport const analyticsActions = {\n log: (site, actionType, entityType, entityId, data) => {\n return authedFunction({\n method: 'POST',\n url: getUrl('analytics', 'log'),\n data: {\n site,\n actionType,\n entityType,\n entityId,\n data,\n },\n }).catch(error => {\n console.log('log error', error);\n });\n },\n};\n"]}
@@ -0,0 +1,27 @@
1
+ import { getUrl } from '../helper';
2
+ import { authedFunction } from '../session';
3
+ export const contactActions = {
4
+ getSiteResidents: async site => {
5
+ return authedFunction({
6
+ method: 'POST',
7
+ url: getUrl('users', 'getexp'),
8
+ data: {
9
+ site
10
+ }
11
+ });
12
+ },
13
+ getSingleExpoResidents: async id => {
14
+ return authedFunction({
15
+ method: 'POST',
16
+ url: getUrl('users', 'getexpsingle'),
17
+ data: {
18
+ id
19
+ }
20
+ });
21
+ },
22
+ syncContacts: async (userKey, contacts) => {
23
+ // deprecated
24
+ return null;
25
+ }
26
+ };
27
+ //# sourceMappingURL=contactActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["contactActions.js"],"names":["getUrl","authedFunction","contactActions","getSiteResidents","site","method","url","data","getSingleExpoResidents","id","syncContacts","userKey","contacts"],"mappings":"AAAA,SAASA,MAAT,QAAuB,WAAvB;AACA,SAASC,cAAT,QAA+B,YAA/B;AAEA,OAAO,MAAMC,cAAc,GAAG;AAC5BC,EAAAA,gBAAgB,EAAE,MAAMC,IAAN,IAAc;AAC9B,WAAOH,cAAc,CAAC;AACpBI,MAAAA,MAAM,EAAE,MADY;AAEpBC,MAAAA,GAAG,EAAEN,MAAM,CAAC,OAAD,EAAU,QAAV,CAFS;AAGpBO,MAAAA,IAAI,EAAE;AAAEH,QAAAA;AAAF;AAHc,KAAD,CAArB;AAKD,GAP2B;AAQ5BI,EAAAA,sBAAsB,EAAE,MAAMC,EAAN,IAAY;AAClC,WAAOR,cAAc,CAAC;AACpBI,MAAAA,MAAM,EAAE,MADY;AAEpBC,MAAAA,GAAG,EAAEN,MAAM,CAAC,OAAD,EAAU,cAAV,CAFS;AAGpBO,MAAAA,IAAI,EAAE;AAAEE,QAAAA;AAAF;AAHc,KAAD,CAArB;AAKD,GAd2B;AAe5BC,EAAAA,YAAY,EAAE,OAAOC,OAAP,EAAgBC,QAAhB,KAA6B;AACzC;AACA,WAAO,IAAP;AACD;AAlB2B,CAAvB","sourcesContent":["import { getUrl } from '../helper';\nimport { authedFunction } from '../session';\n\nexport const contactActions = {\n getSiteResidents: async site => {\n return authedFunction({\n method: 'POST',\n url: getUrl('users', 'getexp'),\n data: { site },\n });\n },\n getSingleExpoResidents: async id => {\n return authedFunction({\n method: 'POST',\n url: getUrl('users', 'getexpsingle'),\n data: { id },\n });\n },\n syncContacts: async (userKey, contacts) => {\n // deprecated\n return null;\n },\n};\n"]}
@@ -0,0 +1,163 @@
1
+ import { getUrl, getAuthTokenHeader } from '../helper';
2
+ import { authedFunction } from '../session';
3
+ export const eventActions = {
4
+ addEvent: data => {
5
+ const request = {
6
+ method: 'POST',
7
+ url: getUrl('events', 'add'),
8
+ data: {
9
+ event: data
10
+ }
11
+ };
12
+ return authedFunction(request);
13
+ },
14
+ getEvents: (site, time) => {
15
+ const query = {
16
+ site
17
+ };
18
+
19
+ if (time) {
20
+ query.time = time;
21
+ }
22
+
23
+ return authedFunction({
24
+ method: 'GET',
25
+ url: getUrl('events', 'get', query)
26
+ });
27
+ },
28
+ getEvent: (site, id) => {
29
+ const query = {
30
+ site
31
+ };
32
+ return authedFunction({
33
+ method: 'GET',
34
+ url: getUrl('events', `get/${id}`, query)
35
+ });
36
+ },
37
+ getEventReps: (site, eventId) => {
38
+ return authedFunction({
39
+ method: 'GET',
40
+ url: getUrl('eventreps', 'get', {
41
+ site,
42
+ eventId
43
+ })
44
+ });
45
+ },
46
+ getUserEventReps: async time => {
47
+ const request = {
48
+ method: 'GET',
49
+ url: getUrl('usereventreps', 'get', time ? {
50
+ time
51
+ } : null),
52
+ headers: {}
53
+ };
54
+ request.headers.authorization = await getAuthTokenHeader();
55
+ return authedFunction(request);
56
+ },
57
+ getUpcomingUserEventReps: async (userId, time) => {
58
+ const request = {
59
+ method: 'GET',
60
+ url: getUrl('usereventreps', 'getupcoming', {
61
+ userId,
62
+ time
63
+ }),
64
+ headers: {}
65
+ };
66
+ return authedFunction(request);
67
+ },
68
+ getSubmissions: async site => {
69
+ return authedFunction({
70
+ method: 'GET',
71
+ url: getUrl('events', 'submissions/get', {
72
+ site
73
+ })
74
+ });
75
+ },
76
+ handleEventSubmission: (site, id, action) => {
77
+ return authedFunction({
78
+ method: 'POST',
79
+ url: getUrl('events', 'submissions/handle'),
80
+ data: {
81
+ site,
82
+ id,
83
+ action
84
+ }
85
+ });
86
+ },
87
+ getEventInvites: async () => {
88
+ const request = {
89
+ method: 'GET',
90
+ url: getUrl('eventinvites', 'get'),
91
+ headers: {}
92
+ };
93
+ request.headers.authorization = await getAuthTokenHeader();
94
+ return authedFunction(request);
95
+ },
96
+ registerForEvent: async (site, userID, eventId, repId, count, notes, waitlistCount, user) => {
97
+ const request = {
98
+ method: 'POST',
99
+ url: getUrl('eventreps', 'register'),
100
+ data: {
101
+ userID,
102
+ eventId,
103
+ repId,
104
+ site,
105
+ count,
106
+ notes,
107
+ waitlistCount,
108
+ user
109
+ }
110
+ };
111
+ return authedFunction(request);
112
+ },
113
+ removeEventAttendee: async (site, userID, eventId, repId) => {
114
+ const request = {
115
+ method: 'POST',
116
+ url: getUrl('eventreps', 'remove'),
117
+ data: {
118
+ site,
119
+ userID,
120
+ eventId,
121
+ repId
122
+ },
123
+ headers: {}
124
+ };
125
+ request.headers.authorization = await getAuthTokenHeader();
126
+ return authedFunction(request);
127
+ },
128
+ addEventFeedback: async (site, userID, eventId, repId, feedback, rating) => {
129
+ // deprecated
130
+ return null;
131
+ },
132
+ sendEventInvite: async (site, userID, inviteId, eventId, repId) => {
133
+ const request = {
134
+ method: 'POST',
135
+ url: getUrl('eventinvites', 'send'),
136
+ data: {
137
+ site,
138
+ userID,
139
+ inviteId,
140
+ eventId,
141
+ repId
142
+ },
143
+ headers: {}
144
+ };
145
+ request.headers.authorization = await getAuthTokenHeader();
146
+ return authedFunction(request);
147
+ },
148
+ removeEventInvite: async (userID, site, eventId, repId) => {
149
+ const request = {
150
+ method: 'POST',
151
+ url: getUrl('eventinvites', 'remove'),
152
+ data: {
153
+ site,
154
+ eventId,
155
+ repId
156
+ },
157
+ headers: {}
158
+ };
159
+ request.headers.authorization = await getAuthTokenHeader();
160
+ return authedFunction(request);
161
+ }
162
+ };
163
+ //# sourceMappingURL=eventActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["eventActions.js"],"names":["getUrl","getAuthTokenHeader","authedFunction","eventActions","addEvent","data","request","method","url","event","getEvents","site","time","query","getEvent","id","getEventReps","eventId","getUserEventReps","headers","authorization","getUpcomingUserEventReps","userId","getSubmissions","handleEventSubmission","action","getEventInvites","registerForEvent","userID","repId","count","notes","waitlistCount","user","removeEventAttendee","addEventFeedback","feedback","rating","sendEventInvite","inviteId","removeEventInvite"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,kBAAjB,QAA2C,WAA3C;AACA,SAASC,cAAT,QAA+B,YAA/B;AAEA,OAAO,MAAMC,YAAY,GAAG;AAC1BC,EAAAA,QAAQ,EAAEC,IAAI,IAAI;AAChB,UAAMC,OAAO,GAAG;AACdC,MAAAA,MAAM,EAAE,MADM;AAEdC,MAAAA,GAAG,EAAER,MAAM,CAAC,QAAD,EAAW,KAAX,CAFG;A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AAOxB,IAAP,EAAaiB,MAAb,EAAqBX,OAArB,EAA8BY,KAA9B,EAAqCO,QAArC,EAA+CC,MAA/C,KAA0D;AAC1E;AACA,WAAO,IAAP;AACD,GApHyB;AAqH1BC,EAAAA,eAAe,EAAE,OAAO3B,IAAP,EAAaiB,MAAb,EAAqBW,QAArB,EAA+BtB,OAA/B,EAAwCY,KAAxC,KAAkD;AACjE,UAAMvB,OAAO,GAAG;AACdC,MAAAA,MAAM,EAAE,MADM;AAEdC,MAAAA,GAAG,EAAER,MAAM,CAAC,cAAD,EAAiB,MAAjB,CAFG;AAGdK,MAAAA,IAAI,EAAE;AACJM,QAAAA,IADI;AAEJiB,QAAAA,MAFI;AAGJW,QAAAA,QAHI;AAIJtB,QAAAA,OAJI;AAKJY,QAAAA;AALI,OAHQ;AAUdV,MAAAA,OAAO,EAAE;AAVK,KAAhB;AAYAb,IAAAA,OAAO,CAACa,OAAR,CAAgBC,aAAhB,GAAgC,MAAMnB,kBAAkB,EAAxD;AACA,WAAOC,cAAc,CAACI,OAAD,CAArB;AACD,GApIyB;AAqI1BkC,EAAAA,iBAAiB,EAAE,OAAOZ,MAAP,EAAejB,IAAf,EAAqBM,OAArB,EAA8BY,KAA9B,KAAwC;AACzD,UAAMvB,OAAO,GAAG;AACdC,MAAAA,MAAM,EAAE,MADM;AAEdC,MAAAA,GAAG,EAAER,MAAM,CAAC,cAAD,EAAiB,QAAjB,CAFG;AAGdK,MAAAA,IAAI,EAAE;AAAEM,QAAAA,IAAF;AAAQM,QAAAA,OAAR;AAAiBY,QAAAA;AAAjB,OAHQ;AAIdV,MAAAA,OAAO,EAAE;AAJK,KAAhB;AAMAb,IAAAA,OAAO,CAACa,OAAR,CAAgBC,aAAhB,GAAgC,MAAMnB,kBAAkB,EAAxD;AACA,WAAOC,cAAc,CAACI,OAAD,CAArB;AACD;AA9IyB,CAArB","sourcesContent":["import { getUrl, getAuthTokenHeader } from '../helper';\nimport { authedFunction } from '../session';\n\nexport const eventActions = {\n addEvent: data => {\n const request = {\n method: 'POST',\n url: getUrl('events', 'add'),\n data: {\n event: data,\n },\n };\n return authedFunction(request);\n },\n getEvents: (site, time) => {\n const query = {\n site,\n };\n if (time) {\n query.time = time;\n }\n return authedFunction({\n method: 'GET',\n url: getUrl('events', 'get', query),\n });\n },\n getEvent: (site, id) => {\n const query = {\n site,\n };\n return authedFunction({\n method: 'GET',\n url: getUrl('events', `get/${id}`, query),\n });\n },\n getEventReps: (site, eventId) => {\n return authedFunction({\n method: 'GET',\n url: getUrl('eventreps', 'get', { site, eventId }),\n });\n },\n getUserEventReps: async time => {\n const request = {\n method: 'GET',\n url: getUrl('usereventreps', 'get', time ? { time } : null),\n headers: {},\n };\n request.headers.authorization = await getAuthTokenHeader();\n return authedFunction(request);\n },\n getUpcomingUserEventReps: async (userId, time) => {\n const request = {\n method: 'GET',\n url: getUrl('usereventreps', 'getupcoming', { userId, time }),\n headers: {},\n };\n return authedFunction(request);\n },\n getSubmissions: async site => {\n return authedFunction({\n method: 'GET',\n url: getUrl('events', 'submissions/get', { site }),\n });\n },\n handleEventSubmission: (site, id, action) => {\n return authedFunction({\n method: 'POST',\n url: getUrl('events', 'submissions/handle'),\n data: {\n site,\n id,\n action,\n },\n });\n },\n getEventInvites: async () => {\n const request = {\n method: 'GET',\n url: getUrl('eventinvites', 'get'),\n headers: {},\n };\n request.headers.authorization = await getAuthTokenHeader();\n return authedFunction(request);\n },\n registerForEvent: async (site, userID, eventId, repId, count, notes, waitlistCount, user) => {\n const request = {\n method: 'POST',\n url: getUrl('eventreps', 'register'),\n data: {\n userID,\n eventId,\n repId,\n site,\n count,\n notes,\n waitlistCount,\n user,\n },\n };\n return authedFunction(request);\n },\n removeEventAttendee: async (site, userID, eventId, repId) => {\n const request = {\n method: 'POST',\n url: getUrl('eventreps', 'remove'),\n data: {\n site,\n userID,\n eventId,\n repId,\n },\n headers: {},\n };\n request.headers.authorization = await getAuthTokenHeader();\n return authedFunction(request);\n },\n addEventFeedback: async (site, userID, eventId, repId, feedback, rating) => {\n // deprecated\n return null;\n },\n sendEventInvite: async (site, userID, inviteId, eventId, repId) => {\n const request = {\n method: 'POST',\n url: getUrl('eventinvites', 'send'),\n data: {\n site,\n userID,\n inviteId,\n eventId,\n repId,\n },\n headers: {},\n };\n request.headers.authorization = await getAuthTokenHeader();\n return authedFunction(request);\n },\n removeEventInvite: async (userID, site, eventId, repId) => {\n const request = {\n method: 'POST',\n url: getUrl('eventinvites', 'remove'),\n data: { site, eventId, repId },\n headers: {},\n };\n request.headers.authorization = await getAuthTokenHeader();\n return authedFunction(request);\n },\n};\n"]}