@likeminds.community/feed-js
Version:
LikeMinds Javascript SDK for chat APIs
1 lines • 54.8 kB
JavaScript
import t from"axios";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var i in s)({}).hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t},e.apply(null,arguments)}class s{constructor(){this.convertedModel=void 0}static requestBodyGenerator(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map(t=>this.requestBodyGenerator(t));const e={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s.replace(/([A-Z])/g,(t,e)=>`_${e.toLowerCase()}`)]=this.requestBodyGenerator(t[s]));return e}static responseBodyParser(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map(t=>this.responseBodyParser(t));const e={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e["_id"==s?"id":"_lm_meta"==s?"lmMeta":s.replace(/_([a-z])/g,(t,e)=>e.toUpperCase())]=this.responseBodyParser(t[s]));return e}}s.versionCode="rt";class i{constructor(t,e,i){this.data=void 0,this.errorMessage=void 0,this.success=void 0;const r=s.responseBodyParser(t.data);this.data=r,this.errorMessage=e,this.success=i}}const r="https://auth.likeminds.community",o={SDK_INITIATE:"/sdk/initiate",USER_LOGOUT:"/user/logout",COMMUNITY_MEMBER_STATE:"/community/member/state",FEED_UNIVERSAL:"/feed/universal",FEED_PERSONALISED:"/feed/personalised",FEED_POST:"/feed/post",FEED_TOPIC:"/feed/topic",HELPER_URL:"/helper/url",FEEDROOM:"/feedroom",FEED_GROUP:"/feed/group",REFRESH_TOKEN_API:"/user/refresh",CHATROOM_GET_TAGGINNG_LIST:"/community/tag",COMMUNITY_TAG:"/community/tag",COMMUNITY_CONFIGURATIONS:"/community/configurations",GET_REPORT_TAGS:"/community/report/tag",GET_REPORTS:"/community/report",UPDATE_REPORT:"/community/report",POST_REPORT:"/community/report",CLOSE_REPORT:"/community/report",GET_MEMBER_RIGHTS:"/moderation/rights",UPDATE_MEMBER_RIGHTS:"/moderation/rights",NOTIFICATION_FEED:"/feed/user/activity",COMMUNITY_MEMBER_PROFILE:"/community/member/profile",CHATROOM_SECRET_LEAVE:"/chatroom/secret/leave",DM_ALL_MEMBERS:"/community/member",COLLABCARD_SEEN:"/chatroom/seen",FETCH_DM_FEED:"/community/dm/feed",CONVERSATION_META:"/conversation",HOME_COMMUNITIES:"/home/fetch_communities",FETCH_CHATROOM_HOME:"/chatroom/home",MARK_READ:"/mark_read",UPLOAD_FILES:"/v1/upload_files",SEARCH_CHATROOM:"/chatroom/search",CHANNEL_INVITES:"/channel/invites",CHANNEL_INVITE:"/channel/invite",USER_DEVICE_PUSH:"/user/device/push",POLL:"/poll",SEARCH:"/search/post",POST_SEEN:"/feed/post/seen"};var n,a,h,d,c;!function(t){t.LOCAL_ACCESS_TOKEN="LOCAL_ACCESS_TOKEN",t.LOCAL_REFRESH_TOKEN="LOCAL_REFRESH_TOKEN",t.LOCAL_USER="LOCAL_USER",t.LOCAL_API_KEY="LOCAL_API_KEY"}(n||(n={}));class u{constructor(t){this.accessToken=void 0,this.refreshToken=void 0,this.xVersionCode=void 0,this.xPlatformCode=void 0,this.xSDKSource="feed",this.lmSdkCallback=void 0,this.lmSdkCallback=t,this.accessToken=null,this.refreshToken=null}setLMSdkCallbacks(t){this.lmSdkCallback=t}setAccessToken(t){this.accessToken=t}getAccessToken(){return this.accessToken}setRefreshToken(t){this.refreshToken=t}getRefreshToken(){return this.refreshToken}setPlatformCode(t){s.versionCode=t,this.xPlatformCode=t}getPlatformCode(){return this.xPlatformCode}setVersionCode(t){this.xVersionCode=t}getVersionCode(){return this.xVersionCode}clearTokenManager(){this.accessToken=null,this.refreshToken=null}async refreshAccessToken(){try{var e;const s=`${r}${o.REFRESH_TOKEN_API}`,i={headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getRefreshToken()}`,"x-platform-code":this.getPlatformCode(),"x-version-code":this.getVersionCode()}},a=await t.post(s,{},i),h=a.data.data||a.data;return this.accessToken=h.access_token,this.setRefreshToken(h.refresh_token),this.setAccessToken(h.access_token),"rt"===this.xPlatformCode&&(localStorage.setItem(n.LOCAL_ACCESS_TOKEN,h.access_token),localStorage.setItem(n.LOCAL_REFRESH_TOKEN,h.refresh_token)),null!=(e=this.lmSdkCallback)&&e.onAccessTokenExpiredAndRefreshed&&this.lmSdkCallback.onAccessTokenExpiredAndRefreshed(this.accessToken,this.refreshToken),h.access_token}catch(t){var s;console.error("Failed to refresh access token:",t);const{accessToken:e,refreshToken:i}=await this.lmSdkCallback.onRefreshTokenExpired();if(this.setAccessToken(e),this.setRefreshToken(i),"rt"===this.xPlatformCode&&(localStorage.setItem(n.LOCAL_ACCESS_TOKEN,e),localStorage.setItem(n.LOCAL_REFRESH_TOKEN,i)),null!=t&&t.response&&(null==t||null==(s=t.response)?void 0:s.status)>=500)throw t}}}class l{constructor(t){this.tokenManager=void 0,this.xApiKey=void 0,this.lmSdkCallbacks=void 0,this.lmSdkCallbacks=t,this.tokenManager=new u(t)}setAccessToken(t){this.tokenManager.setAccessToken(t)}setRefreshToken(t){this.tokenManager.setRefreshToken(t)}getAccessToken(){return this.tokenManager.getAccessToken()}getRefreshToken(){return this.tokenManager.getRefreshToken()}onRefreshAccessToken(){return this.tokenManager.refreshAccessToken()}setUserInLocalStorage(t){localStorage.setItem(n.LOCAL_USER,t)}setApiKeyInLocalStorage(t){localStorage.setItem(n.LOCAL_API_KEY,t)}setAccessTokenInLocalStorage(t){localStorage.setItem(n.LOCAL_ACCESS_TOKEN,t)}setRefreshTokenInLocalStorage(t){localStorage.setItem(n.LOCAL_REFRESH_TOKEN,t)}getAccessTokenFromLocalStorage(){return localStorage.getItem(n.LOCAL_ACCESS_TOKEN)}getRefreshTokenFromLocalStorage(){return localStorage.getItem(n.LOCAL_REFRESH_TOKEN)}getApiKeyFromLocalStorage(){return localStorage.getItem(n.LOCAL_API_KEY)}getUserFromLocalStorage(){return localStorage.getItem(n.LOCAL_USER)}setPlatformCode(t){this.tokenManager.setPlatformCode(t)}setVersionCode(t){this.tokenManager.setVersionCode(t)}setApiKey(t){this.xApiKey=t}getApiKey(){return this.xApiKey}setLMSDKCallbacks(t){this.lmSdkCallbacks=t,this.tokenManager.setLMSdkCallbacks(t)}clearLocalStorage(){localStorage.removeItem(n.LOCAL_ACCESS_TOKEN),localStorage.removeItem(n.LOCAL_REFRESH_TOKEN),localStorage.removeItem(n.LOCAL_USER),localStorage.removeItem(n.LOCAL_API_KEY),this.tokenManager.clearTokenManager()}async makeRequest(s,i){const o=r+s;return t.interceptors.response.use(void 0,async function(e){var s;const i=e.config,r="Network Error"===(null==e?void 0:e.message),o=[500,502,503,504,408,429].includes(null==e||null==(s=e.response)?void 0:s.status);if(!r&&!o)return Promise.reject(e);if(i._retry=!0,i.retryCount=i.retryCount||0,i.retryCount<3){i.retryCount+=1;const e=1e3*2**(i.retryCount-1);return await new Promise(t=>setTimeout(t,e)),t(i)}return Promise.reject(e)}),t.request(e({url:o},i))}async makeAuthenticatedRequest(t,s){const r=e({},s,{headers:e({},null==s?void 0:s.headers,{"x-sdk-source":"feed"})}),o=t.includes("initiate");if(r.headers["Content-Type"]="application/json",r.headers["x-version-code"]=this.tokenManager.getVersionCode(),t.includes("user/device/push")||(r.headers["x-platform-code"]=this.tokenManager.getPlatformCode()),t.includes("community/feed")&&(r.headers["x-accept-version"]="v2"),t.includes("mark_read")&&(r.headers["Content-Type"]="application/x-www-form-urlencoded"),this.tokenManager.getAccessToken()&&this.tokenManager.getAccessToken().length&&(r.headers.Authorization=`Bearer ${this.tokenManager.getAccessToken()}`),o&&"POST"===s.method)if("rt"===this.tokenManager.getPlatformCode()){if(!this.xApiKey||!this.xApiKey.length)throw"Please provide the Api Key";r.headers["x-api-key"]=this.xApiKey}else r.headers["x-api-key"]=this.xApiKey;try{const e=await this.makeRequest(t,r);return new i(e.data,null,!0)}catch(s){var n,a;if(null!=s&&s.response&&401===(null==s||null==(n=s.response)?void 0:n.status)){if(t.includes("user/refresh")){const{accessToken:t,refreshToken:e}=await this.lmSdkCallbacks.onRefreshTokenExpired();this.tokenManager.setAccessToken(t),this.tokenManager.setRefreshToken(e),this.setAccessTokenInLocalStorage(t),this.setRefreshTokenInLocalStorage(e)}else await this.tokenManager.refreshAccessToken();const s=e({},r);return s.headers.Authorization=`Bearer ${this.tokenManager.getAccessToken()}`,this.makeRequest(t,s).then(t=>new i(t.data,null,!0)).catch(t=>{var e;if(console.log(t),null!=t&&t.response&&(null==t||null==(e=t.response)?void 0:e.status)>=500)return new i(void 0,t.message,!1)})}if(null!=s&&s.response&&(null==s||null==(a=s.response)?void 0:a.status)>=500)return new i(void 0,s.message,!1);throw s}}}class p{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}async validateUser(t){return this.networkLibrary.setAccessToken(t.accessToken),this.networkLibrary.setRefreshToken(t.refreshToken),this.networkLibrary.makeAuthenticatedRequest(`${o.SDK_INITIATE}`,{method:"GET"})}async initiateUser(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.setApiKey(t.apikey),this.networkLibrary.makeAuthenticatedRequest(`${o.SDK_INITIATE}`,{method:"POST",data:e}).then(t=>{var e,s;const i=null==t||null==(e=t.data)?void 0:e.accessToken;this.networkLibrary.setAccessToken(i);const r=null==t||null==(s=t.data)?void 0:s.refreshToken;return this.networkLibrary.setRefreshToken(r),t})}async getCommunityConfigurations(){return this.networkLibrary.makeAuthenticatedRequest(`${o.COMMUNITY_CONFIGURATIONS}`).then(t=>t).catch(t=>new i(null,t.message||"An error occurred",!1))}async getMemberState(){return this.networkLibrary.makeAuthenticatedRequest(`${o.COMMUNITY_MEMBER_STATE}`)}async getAllMembers(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.DM_ALL_MEMBERS}?page=${t.page}`)}async logoutUser(t){this.networkLibrary.getRefreshToken();const e=this.networkLibrary.getAccessTokenFromLocalStorage(),s=this.networkLibrary.getRefreshTokenFromLocalStorage();if(!e&&!s)return this.networkLibrary.clearLocalStorage(),new i("",null,!0);if(null==t||null==t||null==(null==t?void 0:t.deviceId)||null==(null==t?void 0:t.deviceId))return this.networkLibrary.clearLocalStorage(),new i("",null,!0);try{var r;const e=await this.networkLibrary.makeAuthenticatedRequest(`${o.USER_LOGOUT}`,{method:"POST",headers:{"x-device-id":null!=(r=null==t?void 0:t.deviceId)?r:""},data:{refresh_token:s}});return e?(this.networkLibrary.clearLocalStorage(),new i("",null,!0)):new i("",null==e?void 0:e.errorMessage,!1)}catch(t){return new i("",t,!1)}}async editProfile(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.COMMUNITY_MEMBER_PROFILE}`,{method:"PUT",data:e}).then(t=>t).catch(t=>new i(null,t.message||"An error occurred",!1))}}class m{constructor(t,e,s,i,r){this.userName=void 0,this.uuid=void 0,this.isGuest=void 0,this.apikey=void 0,this.imageUrl=void 0,this.userName=t,this.uuid=e,this.isGuest=s,this.apikey=i,this.imageUrl=r}static builder(){return new g}}class g{constructor(){this.userName=void 0,this.uuid=void 0,this.isGuest=void 0,this.apiKey=void 0,this.imageUrl=void 0}setUserName(t){return this.userName=t,this}setUUID(t){return this.uuid=t,this}setApiKey(t){return this.apiKey=t,this}setIsGuest(t){return this.isGuest=t,this}setImageUrl(t){return this.imageUrl=t,this}build(){return new m(this.userName,this.uuid,this.isGuest||!1,this.apiKey,this.imageUrl)}}!function(t){t.POST="post",t.COMMENT="comment",t.REPLY="reply",t.PENDING_POST="pending_post"}(a||(a={})),function(t){t.EDIT_MEMBER_PERMISSION="EDIT_MEMBER_PERMISSION",t.PENDING_POST_APPROVED="PENDING_POST_APPROVED",t.PENDING_POST_REJECTED="PENDING_POST_REJECTED",t.POST_APPROVED="POST_APPROVED",t.POST_REJECTED="POST_REJECTED",t.COMMENT_APPROVED="COMMENT_APPROVED",t.COMMENT_REJECTED="COMMENT_REJECTED"}(h||(h={})),function(t){t.CHATROOM="chatroom",t.MEMBER="member",t.CONVERSATION="conversation",t.POST="post",t.COMMENT="comment",t.REPLY="reply"}(d||(d={})),function(t){t.TEMPORARY_POST="temporaryPosts"}(c||(c={}));let T=null,E=null;async function y(){return T||E||(E=new Promise((t,e)=>{const s=indexedDB.open("FeedDB",1);s.onerror=()=>{E=null,e(s.error)},s.onsuccess=()=>{T=s.result,t(s.result)},s.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(c.TEMPORARY_POST)||e.createObjectStore(c.TEMPORARY_POST)}}),E)}class I{constructor(t){this.networkLibrary=void 0,this.dbPromise=void 0,this.networkLibrary=t,this.dbPromise=y()}async addPost(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}`,{method:"POST",data:e,headers:{"x-accept-version":"v1"}})}async getPost(t){return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}?page=${t.page}&page_size=${t.pageSize}`,{method:"GET",headers:{"x-accept-version":"v1"}})}async savePost(t){const e=t;return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/save`,{method:"PUT",data:e,headers:{"x-accept-version":"v1"}})}async getPostLikes(t){return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/like?page=${t.page}&page_size=${t.pageSize}`,{method:"GET",headers:{"x-accept-version":"v1"}})}async likePost(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/like`,{method:"PUT",data:e,headers:{"x-accept-version":"v1"}})}async pinPost(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/pin`,{method:"PUT",data:e,headers:{"x-accept-version":"v1"}})}async editPost(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}`,{method:"PUT",data:e,headers:{"x-accept-version":"v1"}})}async deletePost(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}`,{method:"DELETE",data:e,headers:{"x-accept-version":"v1"}})}async hidePost(t){return await this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/hide`,{method:"PUT",headers:{"x-accept-version":"v1"}})}async decodeUrl(t){return await this.networkLibrary.makeAuthenticatedRequest(`${o.HELPER_URL}?url=${t.url}`)}async getTaggingList(t){return await this.networkLibrary.makeAuthenticatedRequest(`${o.CHATROOM_GET_TAGGINNG_LIST}?page=${t.page}&page_size=${t.pageSize}&search_name=${t.searchName}`)}async getTopics(t){let e=`${o.FEED_TOPIC}?page=${t.page}&page_size=${t.pageSize}`;return t.isEnabled&&(e=e.concat(`&is_enabled=${t.isEnabled}`)),t.search&&(e=e.concat(`&search=${t.search}`)),t.searchType&&(e=e.concat(`&search_type=${t.searchType}`)),t.parentIds&&t.parentIds.length>0&&(e=e.concat(`&parent_ids=${JSON.stringify(t.parentIds)}`)),t.orderBy&&t.orderBy.length>0&&(e=e.concat(`&order_by=${JSON.stringify(t.orderBy)}`)),this.networkLibrary.makeAuthenticatedRequest(e)}async updateUserTopics(t){const{uuid:e,topicsIds:s}=t;return await this.networkLibrary.makeAuthenticatedRequest(`/feed/user/${e}/topics`,{method:"PATCH",headers:{"Content-Type":"application/json"},data:JSON.stringify({topic_ids:s})}).then(()=>({success:!0})).catch(t=>({success:!1,errorMessage:t}))}async getUserTopics(t){const{uuids:e}=t;return await this.networkLibrary.makeAuthenticatedRequest(`/feed/user/topics?uuids=${JSON.stringify(e)}`)}async postSeen(t){const e=s.requestBodyGenerator(t);return await this.networkLibrary.makeAuthenticatedRequest(`${o.POST_SEEN}`,{method:"POST",data:e})}async saveTemporaryPost(t){try{const e=(await this.dbPromise).transaction([c.TEMPORARY_POST],"readwrite"),s=e.objectStore(c.TEMPORARY_POST);return await new Promise((e,i)=>{const r=s.put(t.tempPost,t.tempPost.post.id);r.onsuccess=()=>e(),r.onerror=()=>i(r.error)}),await new Promise((t,s)=>{e.oncomplete=()=>{t()},e.onerror=()=>s(e.error)}),new i("",null,!0)}catch(t){return new i("",t instanceof Error?t.message:"Error while saving post",!1)}}async deleteTemporaryPost(t){try{const e=(await this.dbPromise).transaction([c.TEMPORARY_POST],"readwrite").objectStore(c.TEMPORARY_POST);return await new Promise((s,i)=>{const r=e.delete(t.temporaryPostId);r.onsuccess=()=>s(),r.onerror=()=>{i(r.error)}}),new i("",null,!0)}catch(t){return new i("",t instanceof Error?t.message:"Error while deleting post",!1)}}async getTemporaryPost(){try{const t=(await this.dbPromise).transaction([c.TEMPORARY_POST],"readonly").objectStore(c.TEMPORARY_POST),e=await new Promise((e,s)=>{const i=t.getAll();i.onsuccess=()=>e(i.result),i.onerror=()=>{s(i.error)}});return new i({data:{tempPost:e.length>0?e[e.length-1]:null},success:!0,errorMessage:null},null,!0)}catch(t){const e=t instanceof Error?t.message:"Error while fetching temporary post";return new i({data:{tempPost:null},success:!1,errorMessage:e},e,!1)}}}class v{constructor(t,e,s,i,r,o,n){this.text=void 0,this.attachments=void 0,this.heading=void 0,this.topicIds=void 0,this.tempId=void 0,this.onBehalfOfUuid=void 0,this.isAnonymous=void 0,this.text=t,this.attachments=e,this.heading=s,this.topicIds=i,this.tempId=r,this.isAnonymous=o,this.onBehalfOfUuid=n}static builder(){return new w}}class w{constructor(){this.text=void 0,this.attachments=void 0,this.heading=void 0,this.topicIds=void 0,this.tempId=void 0,this.isAnonymous=!1,this.onBehalfOfUUID=void 0}setText(t){return this.text=t,this}setHeading(t){return this.heading=t,this}setAttachments(t){return this.attachments=t,this}setTopicIds(t){return this.topicIds=t,this}setOnBehalfOfUUID(t){return this.onBehalfOfUUID=t,this}setTempId(t){return this.tempId=t,this}setIsAnonymous(t){return this.isAnonymous=t,this}build(){if(!this.text&&!this.attachments)throw new Error("text and attachments are required.");return new v(this.text,this.attachments,this.heading,this.topicIds,this.tempId,this.isAnonymous,this.onBehalfOfUUID)}}class S{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}async getFeed(t){const e=t.topicIds?`${o.FEED_UNIVERSAL}?page=${t.page}&page_size=${t.pageSize}&topic_ids=${JSON.stringify(t.topicIds)}`:`${o.FEED_UNIVERSAL}?page=${t.page}&page_size=${t.pageSize}`;return await this.networkLibrary.makeAuthenticatedRequest(e,{method:"GET",headers:{"x-accept-version":"v1"}})}async getFeedWithSearchParams(t){var e;let s;s=(null==t||null==(e=t.topicIds)?void 0:e.length)>0?new URLSearchParams({page:t.page.toString(),page_size:t.pageSize.toString(),topic_ids:JSON.stringify(t.topicIds)}):new URLSearchParams({page:t.page.toString(),page_size:t.pageSize.toString()});const i=`${o.FEED_UNIVERSAL}?${s.toString()}`;return await this.networkLibrary.makeAuthenticatedRequest(i,{method:"GET",headers:{"x-accept-version":"v1"}})}async getPersonalisedFeed(t){const e=`${o.FEED_PERSONALISED}?page=${t.page}&page_size=${t.pageSize?t.pageSize:20}&should_recompute=${!!t.shouldRecompute&&t.shouldRecompute}&should_reorder=${!!t.shouldReorder&&t.shouldReorder}`;return await this.networkLibrary.makeAuthenticatedRequest(e)}async searchPosts(t){const e=`${o.SEARCH}?page=${t.page}&page_size=${t.pageSize}&search=${t.search}&search_type=${t.searchType}`;return await this.networkLibrary.makeAuthenticatedRequest(e,{headers:{"x-accept-version":"v1"}})}}class _{constructor(t,e){this.type=void 0,this.metaData=void 0,this.type=t,this.metaData=e}static builder(){return new P}}class P{constructor(){this.type=void 0,this.metaData=void 0}setType(t){return this.type=t,this}setMetadata(t){return this.metaData=t,this}build(){if(!this.type||!this.metaData)throw new Error("type and metadata are required.");return new _(this.type,this.metaData)}}class k{constructor(t,e,s,i,r,o,n,a,h,d,c,u,l,p,m,g,T,E,y,I,v,w,S){this.name=void 0,this.url=void 0,this.format=void 0,this.size=void 0,this.duration=void 0,this.pageCount=void 0,this.ogTags=void 0,this.coverImageUrl=void 0,this.title=void 0,this.body=void 0,this.thumbnailUrl=void 0,this.pollQuestion=void 0,this.expiryTime=void 0,this.options=void 0,this.multipleSelectState=void 0,this.pollType=void 0,this.multipleSelectNumber=void 0,this.isAnonymous=void 0,this.allowAddOption=void 0,this.entityId=void 0,this.widgetMeta=void 0,this.height=void 0,this.width=void 0,this.name=t,this.url=e,this.format=s,this.size=i,this.duration=r,this.pageCount=o,this.ogTags=n,this.coverImageUrl=a,this.title=h,this.pollQuestion=d,this.expiryTime=c,this.options=u,this.multipleSelectState=l,this.pollType=p,this.multipleSelectNumber=m,this.isAnonymous=g,this.allowAddOption=T,this.body=E,this.thumbnailUrl=y,this.entityId=I,this.widgetMeta=v,this.height=w,this.width=S}static builder(){return new C}}class C{constructor(){this.name=void 0,this.url=void 0,this.format=void 0,this.size=void 0,this.duration=void 0,this.pageCount=void 0,this.ogTags=void 0,this.title=void 0,this.coverImageUrl=void 0,this.body=void 0,this.thumbnailUrl=void 0,this.pollQuestion=void 0,this.expiryTime=void 0,this.options=void 0,this.multipleSelectState=void 0,this.pollType=void 0,this.multipleSelectNumber=void 0,this.isAnonymous=void 0,this.allowAddOption=void 0,this.entityId=void 0,this.widgetMeta=void 0,this.height=void 0,this.width=void 0}setName(t){return this.name=t,this}setThumbnailUrl(t){return this.thumbnailUrl=t,this}setUrl(t){return this.url=t,this}setFormat(t){return this.format=t,this}setSize(t){return this.size=t,this}setDuration(t){return this.duration=t,this}setPageCount(t){return this.pageCount=t,this}setOgTags(t){return this.ogTags=t,this}setTitle(t){return this.title=t,this}setBody(t){return this.body=t,this}setCoverImageUrl(t){return this.coverImageUrl=t,this}setPollQuestion(t){return this.pollQuestion=t,this}setExpiryTime(t){return this.expiryTime=t,this}setOptions(t){return this.options=t,this}setMultipleSelectState(t){return this.multipleSelectState=t,this}setPollType(t){return this.pollType=t,this}setHeight(t){return this.height=t,this}setWidth(t){return this.width=t,this}setMultipleSelectNumber(t){return this.multipleSelectNumber=t,this}setIsAnonymous(t){return this.isAnonymous=t,this}setAllowAddOption(t){return this.allowAddOption=t,this}setEntityId(t){return this.entityId=t,this}setWidgetMeta(t){return this.widgetMeta=t,this}build(){return new k(this.name,this.url,this.format,this.size,this.duration,this.pageCount,this.ogTags,this.coverImageUrl,this.title,this.pollQuestion,this.expiryTime,this.options,this.multipleSelectState,this.pollType,this.multipleSelectNumber,this.isAnonymous,this.allowAddOption,this.body,this.thumbnailUrl,this.entityId,this.widgetMeta,this.height,this.width)}}class R{constructor(t){this.url=void 0,this.url=t}static builder(){return new O}}class O{constructor(){this.url=void 0}setURL(t){return this.url=t,this}build(){if(!this.url)throw new Error("URL is required.");return new R(this.url)}}class b{constructor(t,e){this.postId=void 0,this.deleteReason=void 0,this.postId=t,this.deleteReason=e}static builder(){return new A}}class A{constructor(){this.postId=void 0,this.deleteReason=void 0}setPostId(t){return this.postId=t,this}setDeleteReason(t){return this.deleteReason=t,this}build(){if(!this.postId)throw new Error("attachmentType and DeletePostRequest are required.");return new b(this.postId,this.deleteReason)}}class L{constructor(t,e,s,i,r){this.postId=void 0,this.text=void 0,this.attachments=void 0,this.heading=void 0,this.topic_ids=void 0,this.postId=t,this.text=e,this.attachments=s,this.heading=i,this.topic_ids=r}static builder(){return new f}}class f{constructor(){this.postId=void 0,this.text=void 0,this.attachments=void 0,this.heading=void 0,this.topic_ids=void 0}setPostId(t){return this.postId=t,this}setText(t){return this.text=t,this}setHeading(t){return this.heading=t,this}setTopicIds(t){return this.topic_ids=t,this}setAttachments(t){return this.attachments=t,this}build(){if(!this.postId)throw new Error("attachmentType and EditPostRequest are required.");return new L(this.postId,this.text,this.attachments,this.heading,this.topic_ids)}}class M{constructor(t,e,s){this.postId=void 0,this.page=void 0,this.pageSize=void 0,this.postId=t,this.page=e,this.pageSize=s}static builder(){return new N}}class N{constructor(){this.postId=void 0,this.page=void 0,this.pageSize=void 0}setPostId(t){return this.postId=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.postId||!this.page||!this.pageSize)throw new Error("postId, page and pageSize are required.");return new M(this.postId,this.page,this.pageSize)}}class D{constructor(t,e,s){this.postId=void 0,this.page=void 0,this.pageSize=void 0,this.postId=t,this.page=e,this.pageSize=s}static builder(){return new U}}class U{constructor(){this.postId=void 0,this.page=void 0,this.pageSize=void 0}setPostId(t){return this.postId=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.postId||!this.page||!this.pageSize)throw new Error("postId, page and pageSize are required.");return new D(this.postId,this.page,this.pageSize)}}class z{constructor(t){this.postId=void 0,this.postId=t}static builder(){return new $}}class ${constructor(){this.postId=void 0}setPostId(t){return this.postId=t,this}build(){if(!this.postId)throw new Error("postId is required.");return new z(this.postId)}}class q{constructor(t){this.postId=void 0,this.postId=t}static builder(){return new F}}class F{constructor(){this.postId=void 0}setPostId(t){return this.postId=t,this}build(){if(!this.postId)throw new Error("postId is required.");return new q(this.postId)}}class x{constructor(t){this.postId=void 0,this.postId=t}static builder(){return new G}}class G{constructor(){this.postId=void 0}setPostId(t){return this.postId=t,this}build(){if(!this.postId)throw new Error("postId is required.");return new x(this.postId)}}class B{constructor(t,e,s){this.searchName=void 0,this.page=void 0,this.pageSize=void 0,this.searchName=t,this.page=e,this.pageSize=s}static builder(){return new K}}class K{constructor(){this.searchName=void 0,this.page=void 0,this.pageSize=void 0}setSearchName(t){return this.searchName=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.page||!this.pageSize)throw new Error("searchName, page and pageSize are required.");return new B(this.searchName,this.page,this.pageSize)}}class Y{constructor(t,e,s){this.page=void 0,this.pageSize=void 0,this.topicIds=void 0,this.page=t,this.pageSize=e,this.topicIds=s}static builder(){return new H}}class H{constructor(){this.page=void 0,this.pageSize=void 0,this.topicIds=void 0}setPage(t){return this.page=t,this}setTopicIds(t){return this.topicIds=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.page||!this.pageSize)throw new Error("page and pageSize are required.");return new Y(this.page,this.pageSize,this.topicIds)}}class V{constructor(t,e=10,s,i){this.page=void 0,this.pageSize=void 0,this.search=void 0,this.searchType=void 0,this.page=t,this.pageSize=e,this.search=s,this.searchType=i}static builder(){return new J}}class J{constructor(){this.page=void 0,this.pageSize=void 0,this.search=void 0,this.searchType=void 0}setPage(t){return this.page=t,this}setSearch(t){return this.search=t,this}setPageSize(t){return this.pageSize=t,this}setSearchType(t){return this.searchType=t,this}build(){if(!this.page||!this.pageSize)throw new Error("page and pageSize are required.");if(!this.search||!this.searchType)throw new Error("search and searchType are required.");return new V(this.page,this.pageSize,this.search,this.searchType)}}class j{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}getReportTags(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.GET_REPORT_TAGS}?entity_type=${t.entityType}`,{method:"GET",headers:{"x-accept-version":"v1"}})}getReports(t){const e=JSON.stringify(t.filterType);return this.networkLibrary.makeAuthenticatedRequest(`${o.GET_REPORTS}?page=${t.page}&page_size=${t.pageSize}&filter_type=${e}&is_closed=${t.isClosed}`,{method:"GET",headers:{"x-accept-version":"v1"}})}updateReportStatus(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.UPDATE_REPORT}`,{data:s.requestBodyGenerator(t),method:"PATCH",headers:{"x-accept-version":"v1"}})}getReportsForPostAndComments(t){const e=JSON.stringify([a.POST,a.COMMENT,a.REPLY]);return this.networkLibrary.makeAuthenticatedRequest(`${o.GET_REPORTS}?page=${t.page}&page_size=${t.pageSize}&filter_type=${e}&is_closed=false`,{method:"GET",headers:{"x-accept-version":"v1"}})}getMemberRights(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.GET_MEMBER_RIGHTS}?uuid=${t.uuid}&is_cm=${t.isCM}`,{method:"GET",headers:{"x-accept-version":"v1"}})}updateMemberRights(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.UPDATE_MEMBER_RIGHTS}`,{method:"PATCH",headers:{"x-accept-version":"v1"},data:s.requestBodyGenerator(t)})}postReport(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.POST_REPORT}`,{data:s.requestBodyGenerator(t),method:"POST",headers:{"x-accept-version":"v1"}})}}class Q{constructor(t){this.entityType=void 0,this.entityType=t}static builder(){return new W}}class W{constructor(){this.entityType=void 0}setEntityType(t){return this.entityType=t,this}build(){if(!this.entityType)throw new Error("entityType is required");return new Q(this.entityType)}}class Z{constructor(t,e,s,i,r){this.entityId=void 0,this.accusedUuid=void 0,this.entityType=void 0,this.tagId=void 0,this.reason=void 0,this.entityId=t,this.accusedUuid=e,this.entityType=s,this.tagId=i,this.reason=r}static builder(){return new X}}class X{constructor(){this.entityId=void 0,this.accusedUuid=void 0,this.entityType=void 0,this.tagId=void 0,this.reason=void 0}setEntityId(t){return this.entityId=t,this}setAccusedUUID(t){return this.accusedUuid=t,this}setEntityType(t){return this.entityType=t,this}setTagId(t){return this.tagId=t,this}setReason(t){return this.reason=t,this}build(){if(!this.entityId||!this.accusedUuid||void 0===this.entityType||void 0===this.tagId)throw new Error("entityId, accusedUUID, entityType, and tagId are required.");return new Z(this.entityId,this.accusedUuid,this.entityType,this.tagId,this.reason)}}class tt{constructor(t,e,s,i){this.page=void 0,this.pageSize=void 0,this.filterType=void 0,this.isClosed=void 0,this.page=t,this.pageSize=e,this.filterType=s,this.isClosed=i}static builder(){return new et}}class et{constructor(){this.page=void 0,this.pageSize=void 0,this.filterType=void 0,this.isClosed=void 0}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}setFilterType(t){return this.filterType=t,this}setIsClosed(t){return this.isClosed=t,this}build(){return new tt(this.page,this.pageSize,this.filterType,this.isClosed)}}class st{constructor(t,e){this.page=void 0,this.pageSize=void 0,this.page=t,this.pageSize=e}static builder(){return new it}}class it{constructor(){this.page=void 0,this.pageSize=void 0}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(void 0===this.page)throw new Error("Page is required.");return new st(this.page,this.pageSize)}}class rt{constructor(t,e){this.page=void 0,this.pageSize=void 0,this.page=t,this.pageSize=e}static builder(){return new ot}}class ot{constructor(){this.page=void 0,this.pageSize=void 0}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){return new rt(this.page,this.pageSize)}}class nt{constructor(t,e){this.uuid=void 0,this.isCM=void 0,this.uuid=t,this.isCM=e}static builder(){return new at}}class at{constructor(){this.uuid=void 0,this.isCM=void 0}setUuid(t){return this.uuid=t,this}setIsCM(t){return this.isCM=t,this}build(){return new nt(this.uuid,this.isCM)}}class ht{constructor(t,e,s,i){this.uuid=void 0,this.isCM=void 0,this.rights=void 0,this.customTitle=void 0,this.uuid=t,this.isCM=e,this.rights=s,this.customTitle=i}static builder(){return new dt}}class dt{constructor(){this.uuid=void 0,this.isCM=void 0,this.rights=void 0,this.customTitle=void 0}setUuid(t){return this.uuid=t,this}setIsCM(t){return this.isCM=t,this}setRights(t){return this.rights=t,this}setCustomTitle(t){return this.customTitle=t,this}build(){return new ht(this.uuid,this.isCM,this.rights,this.customTitle)}}class ct{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}async addComment(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment`,{method:"POST",data:e,headers:{"x-accept-version":"v1"}}).then(t=>s.responseBodyParser(t))}async getComment(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}?page=${t.page}&page_size=${t.pageSize}`,{method:"GET",headers:{"x-accept-version":"v1"}}).then(t=>s.responseBodyParser(t))}async getCommentLikes(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}/like?page=${t.page}&page_size=${t.pageSize}`,{method:"GET",headers:{"x-accept-version":"v1"}})}async likeComment(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}/like`,{method:"PUT",data:s.requestBodyGenerator(t),headers:{"x-accept-version":"v1"}})}async replyComment(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}/comment`,{method:"POST",data:e,headers:{"x-accept-version":"v1"}})}async editComment(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}`,{method:"PUT",data:e,headers:{"x-accept-version":"v1"}})}async deleteComment(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.FEED_POST}/${t.postId}/comment/${t.commentId}`,{method:"DELETE",data:e,headers:{"x-accept-version":"v1"}})}}class ut{constructor(t){this.deviceId=void 0,this.deviceId=t}static builder(){return new lt}}class lt{constructor(){this.deviceId=void 0}setDeviceId(t){return this.deviceId=t,this}build(){return new ut(this.deviceId)}}class pt{constructor(t,e,s){this.postId=void 0,this.text=void 0,this.tempId=void 0,this.postId=t,this.text=e,this.tempId=s}static builder(){return new mt}}class mt{constructor(){this.postId=void 0,this.text=void 0,this.tempId=void 0}setPostId(t){return this.postId=t,this}setText(t){return this.text=t,this}setTempId(t){return this.tempId=t,this}build(){if(!this.postId||!this.text)throw new Error("postId and text are required.");return new pt(this.postId,this.text,this.tempId)}}class gt{constructor(t){this.page=void 0,this.page=t}static builder(){return new Tt}}class Tt{constructor(){this.page=void 0}setPage(t){return this.page=t,this}build(){return new gt(this.page)}}class Et{constructor(t,e,s,i){this.postId=void 0,this.commentId=void 0,this.text=void 0,this.tempId=void 0,this.postId=t,this.commentId=e,this.text=s,this.tempId=i}static builder(){return new yt}}class yt{constructor(){this.postId=void 0,this.commentId=void 0,this.text=void 0,this.tempId=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}setText(t){return this.text=t,this}setTempId(t){return this.tempId=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new Et(this.postId,this.commentId,this.text,this.tempId)}}class It{constructor(t,e,s,i){this.postId=void 0,this.commentId=void 0,this.page=void 0,this.pageSize=void 0,this.postId=t,this.commentId=e,this.page=s,this.pageSize=i}static builder(){return new vt}}class vt{constructor(){this.postId=void 0,this.commentId=void 0,this.page=void 0,this.pageSize=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new It(this.postId,this.commentId,this.page,this.pageSize)}}class wt{constructor(t,e){this.reportIds=void 0,this.actionTaken=void 0,this.reportIds=t,this.actionTaken=e}static builder(){return new St}}class St{constructor(){this.reportIds=void 0,this.actionTaken=void 0}setReportIds(t){return this.reportIds=t,this}setActionTaken(t){return this.actionTaken=t,this}build(){return new wt(this.reportIds,this.actionTaken)}}class _t{constructor(t,e,s,i){this.postId=void 0,this.commentId=void 0,this.page=void 0,this.pageSize=void 0,this.postId=t,this.commentId=e,this.page=s,this.pageSize=i}static builder(){return new Pt}}class Pt{constructor(){this.postId=void 0,this.commentId=void 0,this.page=void 0,this.pageSize=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new _t(this.postId,this.commentId,this.page,this.pageSize)}}class kt{constructor(t,e){this.postId=void 0,this.commentId=void 0,this.postId=t,this.commentId=e}static builder(){return new Ct}}class Ct{constructor(){this.postId=void 0,this.commentId=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new kt(this.postId,this.commentId)}}class Rt{constructor(t,e,s){this.postId=void 0,this.commentId=void 0,this.reason=void 0,this.postId=t,this.commentId=e,this.reason=s}static builder(){return new Ot}}class Ot{constructor(){this.postId=void 0,this.commentId=void 0,this.reason=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}setReason(t){return this.reason=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new Rt(this.postId,this.commentId,this.reason)}}class bt{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}getNotificationFeed(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.NOTIFICATION_FEED}?page=${t.page}&page_size=${t.pageSize}`,{method:"GET",headers:{"x-accept-version":"v1"}})}markReadNotification(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.NOTIFICATION_FEED}/${t.activityId}/mark_read`,{method:"POST",data:e})}getUnreadNotificationCount(){return this.networkLibrary.makeAuthenticatedRequest(`${o.NOTIFICATION_FEED}/unread_count`)}}class At{constructor(t,e){this.page=void 0,this.pageSize=void 0,this.page=t,this.pageSize=e}static builder(){return new Lt}}class Lt{constructor(){this.page=void 0,this.pageSize=void 0}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}build(){if(!this.page||!this.pageSize)throw new Error("UUID and DeviceI are required.");return new At(this.page,this.pageSize)}}class ft{constructor(t){this.activityId=void 0,this.activityId=t}static builder(){return new Mt}}class Mt{constructor(){this.activityId=void 0}setActivityId(t){return this.activityId=t,this}build(){if(!this.activityId)throw new Error("activityId is required.");return new ft(this.activityId)}}class Nt{constructor(t,e,s){this.postId=void 0,this.commentId=void 0,this.text=void 0,this.postId=t,this.commentId=e,this.text=s}static builder(){return new Dt}}class Dt{constructor(){this.postId=void 0,this.commentId=void 0,this.text=void 0}setPostId(t){return this.postId=t,this}setCommentId(t){return this.commentId=t,this}setText(t){return this.text=t,this}build(){if(!this.postId||!this.commentId)throw new Error("postId and commentId are required.");return new Nt(this.postId,this.commentId,this.text)}}class Ut{constructor(t,e,s,i,r,o,n){this.isEnabled=void 0,this.page=void 0,this.pageSize=void 0,this.search=void 0,this.searchType=void 0,this.parentIds=void 0,this.orderBy=void 0,this.isEnabled=t,this.search=i,this.page=e,this.pageSize=s,this.searchType=r,this.parentIds=o,this.orderBy=n}static builder(){return new zt}}class zt{constructor(){this.isEnabled=void 0,this.page=void 0,this.pageSize=void 0,this.search=void 0,this.searchType=void 0,this.parentIds=void 0,this.orderBy=void 0}setIsEnabled(t){return this.isEnabled=t,this}setSearch(t){return this.search=t,this}setSearchType(t){return this.searchType=t,this}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}setParentIds(t){return this.parentIds=t,this}setOrderBy(t){return this.orderBy=t,this}build(){if(!this.page||!this.pageSize)throw new Error("Some parameters are missing");return new Ut(this.isEnabled,this.page,this.pageSize,this.search,this.searchType,this.parentIds,this.orderBy)}}class $t{constructor(t,e){this.accessToken=void 0,this.refreshToken=void 0,this.accessToken=t,this.refreshToken=e}static builder(){return new qt}}class qt{constructor(){this.accessToken=void 0,this.refreshToken=void 0}setAccessToken(t){return this.accessToken=t,this}setRefreshToken(t){return this.refreshToken=t,this}build(){if(!this.accessToken||!this.refreshToken)throw new Error("Access Token and Refresh Token are required.");return new $t(this.accessToken,this.refreshToken)}}class Ft{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}async decodeUrl(){return this.networkLibrary.makeAuthenticatedRequest(`${o.HELPER_URL}`)}async getTaggingList(){return this.networkLibrary.makeAuthenticatedRequest(`${o.COMMUNITY_TAG}`)}async registerDevice(){return this.networkLibrary.makeAuthenticatedRequest(`${o.USER_DEVICE_PUSH}`).then(t=>{const e=s.responseBodyParser(t.data);return new i(e,null,!0)}).catch(t=>new i(null,t.message||"An error occurred",!1))}async validateRegisterDeviceRequest(t){const e=s.requestBodyGenerator(t);return this.networkLibrary.makeAuthenticatedRequest(`${o.USER_DEVICE_PUSH}`,{method:"POST",data:e}).then(t=>{const e=s.responseBodyParser(t.data);return new i(e,null,!0)}).catch(t=>new i(null,t.message||"An error occurred",!1))}}class xt{constructor(t,e){this.token=void 0,this.deviceId=void 0,this.token=t,this.deviceId=e}static builder(){return new Gt}}class Gt{constructor(){this.token=void 0,this.deviceId=void 0}setToken(t){return this.token=t,this}setDeviceId(t){return this.deviceId=t,this}build(){if(!this.token||!this.deviceId)throw new Error("UUID and DeviceI are required.");return new xt(this.token,this.deviceId)}}class Bt{constructor(){}}class Kt{constructor(t){this.networkLibrary=void 0,this.networkLibrary=t}submitPollVote(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.POLL}/${t.pollId}/vote`,{method:"PUT",data:s.requestBodyGenerator(t)})}addPollOption(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.POLL}/${t.pollId}`,{method:"PUT",data:s.requestBodyGenerator(t)})}getPollVotes(t){return this.networkLibrary.makeAuthenticatedRequest(`${o.POLL}/${t.pollId}/vote?votes=${t.votes}&page=${t.page}&page_size=${t.pageSize}`)}}var Yt,Ht,Vt,Jt;!function(t){t.CREATE_POST_PERMIT_ADDED="create_post_permit_added",t.CREATE_POST_PERMIT_REMOVED="create_post_permit_removed",t.CREATE_COMMENT_PERMIT_ADDED="create_comment_permit_added",t.CREATE_COMMENT_PERMIT_REMOVED="create_comment_permit_removed",t.CM_DELETED_YOUR_POST="cm_deleted_your_post",t.CM_DELETED_YOUR_COMMENT="cm_deleted_your_comment",t.LIKE_ON_YOUR_POST="like_on_your_post",t.COMMENT_ON_YOUR_POST="comment_on_your_post",t.LIKE_ON_YOUR_COMMENT="like_on_your_comment",t.COMMENT_ON_YOUR_COMMENT="comment_on_your_comment",t.TAGGED_YOU_ON_POST="tagged_you_on_post",t.TAGGED_YOU_ON_COMMENT="tagged_you_on_comment",t.ALSO_COMMENTED_ON_POST_YOU_COMMENTED="also_commented_on_post_you_commented",t.REPOSTED_YOUR_POST="reposted_your_post",t.LIKE_ON_POST="like_on_post",t.LIKE_ON_COMMENT="like_on_comment",t.COMMENT_ON_POST="comment_on_post",t.COMMENT_ON_COMMENT="comment_on_comment"}(Yt||(Yt={})),function(t){t.POST="post",t.COMMENT="comment",t.USER="user",t.PENDING_POST="pending_post"}(Ht||(Ht={})),function(t){t.IMAGE="image",t.VIDEO="video",t.DOCUMENT="document",t.LINK="link",t.CUSTOM="custom",t.POLL="poll",t.ARTICLE="article",t.POST="post",t.REPOST="repost",t.GIF="gif",t.REEL="reel"}(Vt||(Vt={})),function(t){t[t.EDIT_MEMBER_PERMISSION=0]="EDIT_MEMBER_PERMISSION",t[t.REMOVE_FROM_COMMUNITY=1]="REMOVE_FROM_COMMUNITY",t[t.LEFT_THE_COMMUNITY=2]="LEFT_THE_COMMUNITY",t[t.RESPONSE_DELETED_BY_CM=3]="RESPONSE_DELETED_BY_CM",t[t.RESPONSE_DELETED_BY_CREATOR=4]="RESPONSE_DELETED_BY_CREATOR",t[t.CHATROOM_DELETED_BY_CM=5]="CHATROOM_DELETED_BY_CM",t[t.CHATROOM_DELETED_BY_CREATOR=6]="CHATROOM_DELETED_BY_CREATOR",t[t.PENDING_POST_APPROVED=7]="PENDING_POST_APPROVED",t[t.PENDING_POST_REJECTED=8]="PENDING_POST_REJECTED",t[t.POST_APPROVED=9]="POST_APPROVED",t[t.POST_REJECTED=10]="POST_REJECTED",t[t.COMMENT_APPROVED=11]="COMMENT_APPROVED",t[t.COMMENT_REJECTED=12]="COMMENT_REJECTED"}(Jt||(Jt={}));class jt{constructor(t){this.postId=void 0,this.postId=t}static builder(){return new Qt}}class Qt{constructor(){this.postId=void 0}setPostId(t){return this.postId=t,this}build(){return new jt(this.postId)}}class Wt{constructor(t,e){this.uuid=void 0,this.topicsIds=void 0,this.uuid=t,this.topicsIds=e}static builder(){return new Zt}}class Zt{constructor(){this.uuid=void 0,this.topicsIds=void 0}setUuid(t){return this.uuid=t,this}setTopicsIds(t){return this.topicsIds=t,this}build(){if(!this.uuid||!this.topicsIds)throw new Error("Missing required parameters: uuid and topicsIds are mandatory.");return new Wt(this.uuid,this.topicsIds)}}class Xt{constructor(t){this.uuids=void 0,this.uuids=t}static builder(){return new te}}class te{constructor(){this.uuids=void 0}setUuids(t){return this.uuids=t,this}build(){if(!this.uuids||0===this.uuids.length)throw new Error("Missing required parameter: uuids must not be empty.");return new Xt(this.uuids)}}class ee{constructor(t,e,s,i){this.page=void 0,this.pageSize=void 0,this.shouldRecompute=void 0,this.shouldReorder=void 0,this.page=t,this.pageSize=e,this.shouldRecompute=s,this.shouldReorder=i}static builder(){return new se}}class se{constructor(){this.page=void 0,this.pageSize=void 0,this.shouldRecompute=void 0,this.shouldReorder=void 0}setPage(t){return this.page=t,this}setPageSize(t){return this.pageSize=t,this}setShouldRecompute(t){return this.shouldRecompute=t,this}setShouldReorder(t){return this.shouldReorder=t,this}build(){if(void 0===this.page)throw new Error("page is required.");return new ee(this.page,this.pageSize,this.shouldRecompute,this.shouldReorder)}}class ie{constructor(t){this.postIds=void 0,this.postIds=t}static builder(){return new re}}class re{constructor(){this.postIds=void 0}setPostIds(t){return this.postIds=t,this}build(){if(!this.postIds||0===this.postIds.length)throw new Error("postIds is required and cannot be empty.");return new ie(this.postIds)}}class oe{constructor(t){this.tempPost=void 0,this.tempPost=t}static builder(){return new ne}}class ne{constructor(){this.tempPost=void 0}setTempPost(t){return this.tempPost=t,this}build(){if(!this.tempPost)throw new Error("tempPost is required.");return new oe(this.tempPost)}}class ae{constructor(t){this.temporaryPostId=void 0,this.temporaryPostId=t}static builder(){return new he}}class he{constructor(){this.temporaryPostId=void 0}setTemporaryPostId(t){return this.temporaryPostId=t,this}build(){if(!this.temporaryPostId)throw new Error("temporaryPostId is required.");return new ae(this.temporaryPostId)}}class de{constructor(){this.initiateUserClient=void 0,this.postClient=void 0,this.moderationClient=void 0,this.commentClient=void 0,this.networkLibrary=void 0,this.notificationFeedClient=void 0,this.feedClient=void 0,this.platformCode=null,this.versionCode=null,this.apiKey=null,this.helperClient=void 0,this.LMSDKCallbacks=void 0,this.pollFeedClient=void 0,this.networkLibrary=new l(this.LMSDKCallbacks),this.initiateUserClient=new p(this.networkLibrary),this.postClient=new I(this.networkLibrary),this.moderationClient=new j(this.networkLibrary),this.feedClient=new S(this.networkLibrary),this.moderationClient=new j(this.networkLibrary),this.commentClient=new ct(this.networkLibrary),this.notificationFeedClient=new bt(this.networkLibrary),this.helperClient=new Ft(this.networkLibrary),this.pollFeedClient=new Kt(this.networkLibrary)}getNetworkLibrary(){return this.networkLibrary}static Builder(){return new de}setPlatformCode(t){return this.platformCode=t,this}setVersionCode(t){return this.versionCode=t,this}setApiKey(t){return this.apiKey=t,this}static getIdentityPoolId(){return"ap-south-1:d73bc2ed-bede-42c8-bab7-0abe0a001325"}static getBucketId(){return"prod-likeminds-media"}static getRegion(){return"ap-south-1"}setLMSDKCallbacks(t){this.LMSDKCallbacks=t,this.networkLibrary.setLMSDKCallbacks(t)}build(){if(!this.platformCode)throw new Error("Please provide platformCode before building the LMFeedClient.");if(!this.versionCode)throw new Error("Please provide versionCode before building the LMFeedClient.");return this.networkLibrary.setPlatformCode(this.platformCode),this.networkLibrary.setVersionCode(this.versionCode),this.networkLibrary.setApiKey(this.apiKey),this}setAccessTokenInLocalStorage(t){this.networkLibrary.setAccessTokenInLocalStorage(t)}setRefreshTokenInLocalStorage(t){this.networkLibrary.setRefreshTokenInLocalStorage(t)}setApiKeyInLocalStorage(t){this.networkLibrary.setApiKeyInLocalStorage(t)}setUserInLocalStorage(t){this.networkLibrary.setUserInLocalStorage(t)}getUserFromLocalStorage(){return this.networkLibrary.getUserFromLocalStorage()}getApiKeyFromLocalStorage(){return this.networkLibrary.getApiKeyFromLocalStorage()}getAccessTokenFromLocalStorage(){return this.networkLibrary.getAccessTokenFromLocalStorage()}getRefreshTokenFromLocalStorage(){return this.networkLibrary.getRefreshTokenFromLocalStorage()}getAccessToken(){return this.networkLibrary.getAccessToken()}getRefreshToken(){return this.networkLibrary.getRefreshToken()}async validateUser(t){return await this.initiateUserClient.validateUser(t)}async initiateUser(t){return await this.initiateUserClient.initiateUser(t)}async initializeDatabase(){return await y()}async hidePost(t){return await this.postClient.hidePost(t)}async editProfile(t){return this.initiateUserClient.editProfile(t)}async addPost(t){return await this.postClient.addPost(t)}async decodeURL(t){return await this.postClient.decodeUrl(t)}async deletePost(t){return await this.postClient.deletePost(t)}async editPost(t){return await this.postClient.editPost(t)}async getPostLikes(t){return await this.postClient.getPostLikes(t)}async getPost(t){return await this.postClient.getPost(t)}async getTopics(t){return await thi