UNPKG

@hhgtech/hhg-components

Version:
172 lines (170 loc) 9.48 kB
const PATHS = { BASE_API_PATH: '/', PROFILE: 'profile?website_url={website_url}', SEARCH_USER: 'profile/search?website_url={website_url}&name={name}', FETCH_PREVIEW: 'fetch/preview?website_url={website_url}', FETCH_POST_OR_TOPIC: 'fetch/{slug}?website_url={website_url}&community_slug={communitySlug}', POST: { LIST: 'post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}', DETAIL_BY_ID_OR_SLUG: 'post/{idSlug}?website_url={website_url}', CREATE: 'post/create?website_url={website_url}', LIKE: 'post/{id}/like?website_url={website_url}', DELETE: 'post/{id}/delete?website_url={website_url}', REPORT: 'post/{id}/report?website_url={website_url}', UPDATE: 'post/{id}/update?website_url={website_url}', FOLLOW: 'post/{id}/follow?website_url={website_url}', CREATE_ARTICLE_COMMENT: 'article-comment/create?website_url={website_url}', }, COMMENT: { LIST: 'comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}', CREATE: 'comment/create?website_url={website_url}', REPLY: 'comment/reply?website_url={website_url}', DELETE: 'comment/{id}/delete?website_url={website_url}', LIKE: 'comment/{id}/like?website_url={website_url}', UNLIKE: 'comment/{id}/unlike?website_url={website_url}', IMAGE_UPLOAD: 'comment/image/upload?website_url={website_url}', }, COMMUNITY: { LIST: 'community?website_url={website_url}&page={page}&items_per_page={pageSize}', DETAIL_BY_ID_OR_SLUG: 'community/{idSlug}?website_url={website_url}', JOIN: 'community/join?website_url={website_url}', LEAVE: 'community/leave?website_url={website_url}', GET_UNCATEGORIZED: 'community/uncategorized?website_url={website_url}', }, TOPIC: { LIST: 'topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}&items_per_page={pageSize}&topic_in={topic_in}', DETAIL_BY_ID_OR_SLUG: 'topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}', HEALTH_TOOLS: 'tools?topic_id={topicId}&website_url={website_url}', SUBOTS: 'subots?topic_id={topicId}&website_url={website_url}', SUGGESTED_POSTS: 'suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}', JOIN: 'topic/join?website_url={website_url}', LEAVE: 'topic/leave?website_url={website_url}', }, BOOKMARK: { LIST: 'bookmark?user_id={userId}&website_url={website_url}', CREATE: 'bookmark/create?website_url={website_url}', DELETE: 'bookmark/delete?website_url={website_url}', }, // OLD UPLOAD_IMAGE: 'auth/comment/image/upload?website_url={website_url}', GET_DUE_DATE_INFO: 'health-tools/due-date-calculator/info', USER: { DETAIL: 'profile/user/detail?website_url={website_url}&user_id={id}', COUNT_TABS: 'profile/user/counting?website_url={website_url}&user_id={id}&total_post={post}&total_comment={comment}&total_community={community}&total_reply={reply}&total_question={question}', LIST_POST: 'profile/user/posts?website_url={website_url}&user_id={id}&is_anonymous={isAnonymous}&paging=none', LIST_QUESTION_NEED_REPLY: 'questions/no-reply?website_url={website_url}', LIST_QUESTION: 'question/{id}?website_url={website_url}&is_reply={isReply}&is_question={isQuestion}&is_ignore={isIgnore}&group_by={groupBy}', SKIP_QUESTION: 'questions/ignore?website_url={website_url}&question_id={id}', LIST_ANSWERS: 'replied/{id}?website_url={website_url}&paging=1&items_per_page={pageSize}', }, HEALTH_TOOL: { CREATE: 'health-profile/{type}/create?website_url={website_url}', GET_STATUS: 'health-profile/get-status-for-user?website_url={website_url}', }, CHATBOT: { PROFILE: 'chatbox/get-profile?website_url={website_url}', FAQS_LIST: 'chatbox/get-faq?website_url={website_url}', GET_SUGGEST_COMMUNITY: 'v2/community/topic', }, }; const SUBOT_PATHS = { TOGETHER: { SURVEY: { GET_FIRST_NODE: 'frontend/api/bots/{botId}', CHAT_WITH_BOT: 'frontend/api/inline/messages', }, }, }; const CARE_PATHS = { GET_DOCTOR_INFO: 'api/doctors/{doctorId}?site={website_url}', GET_HOSPITAL_INFO: 'api/hospital/branch/{hospital_branch_id}?site={website_url}', }; const DISCOVER_PATHS = { BASE_API_PATH: '/', GET_SEARCH_ARTICLES: 'search?s={keyword}&page={page}', // GET_TOP_CATEGORIES: 'categories', GET_ALL_CATEGORIES: 'categories?type=all', GET_HOMEPAGE_POSTS: 'home/trending-post?type={type}', GET_HOMEPAGE_LATEST_POSTS: 'articles?page=1&_islatest=1', GET_ARTICLE_DETAIL: 'article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}', GET_CATEGORY_DETAIL: 'category/{slug}', GET_CATEGORY_OR_ARTICLE_DETAIL: 'fetch/{fullSlug}', GET_PREVIEW_ARTICLE: 'fetch/{fullSlug}?preview_nonce={nonce}&preview=true', GET_ARTICLE_OF_CATEGORY: 'articles?category_id={categoryId}&page={currentPage}', GET_PAGE_STATIC: 'page/{slug}', GET_ALL_HEALTH_TOOLS: 'healthtools', GET_ALL_MARRYBABY_HEALTH_TOOLS: 'health-tools', GET_HEALTH_TOOLS_BY_CATEGORY: 'healthtools?_hasgroup=1', GET_AUTHOR: 'author/{slug}', GET_ALL_EXPERTS: 'experts', GET_ALL_EXPERTS_PAGING: 'experts?page={page}', GET_EXPERT: 'expert/{slug}', GET_EXPERT_POST: 'expert/article?page={page}', POST_ARTICLE_FEEDBACK: 'article/feedback/{id}', GET_AZ_DRUGS: 'category/a-z/{category}', GET_HOMEPAGE_MEDICAL_REVIEWED: 'home/medical-reviewed', GET_ARTICLES_BY_IDS: 'articles?ids={ids}', GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS: 'articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}', GET_EXPERT_OF_CATEGORY: 'category/expert/?id={id}', GET_DUE_DATE_INFO: 'health-tools/due-date-calculator/info', GET_DUE_DATE_ALL_WEEKS: 'health-tools/due-date-calculator/all', GET_DUE_DATE_SUGGESTED_ARTICLES: 'health-tools/due-date-calculator/result?from_week={from}&to_week={to}', GET_PROFILE: 'user/profile', GET_ADMIN_PROFILE: 'GET_ADMIN_PROFILE', GET_FEATURE: 'feature', POST_NEW_FEATURE: 'feature/update', CREATE_BOOKMARK: 'bookmark/create', DELETE_BOOKMARK: 'bookmark/delete', DELETE_ALL_BOOKMARK: 'bookmark/delete-all', GET_ALL_BOOKMARK: 'bookmark', SSO_USER_PROFILE: 'user', SSO_USER_BOOKMARKS: 'user/bookmarks', SSO_USER_PASSWORD: 'user/settings/password', SSO_USER_EMAIL: 'user/settings/update-email', SSO_CLOSE_ACCOUNT: 'user/settings/close-account', SSO_HELP: 'user/settings/help', GET_HEALTH_TOOL_OVULATION_INFO: 'health-tools/ovulation-calculator/info', GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES: 'health-tools/ovulation-calculator/result?method={method}', GET_HEALTH_TOOL_BMI_INFO: 'health-tools/bmi-calculator/info', GET_HEALTH_TOOL_BMI_RESULT: 'health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}', GET_HEALTH_TOOL_BMR_INFO: 'health-tools/bmr-calculator/info', GET_HEALTH_TOOL_BMR_RESULT: 'health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}', GET_HEALTH_TOOL_PWG_INFO: 'health-tools/preweight-gain-calculator/info', GET_HEALTH_TOOL_THR_INFO: 'health-tools/target-heart-rate/info', GET_HEALTH_TOOL_BABY_GROWTH_INFO: 'health-tools/baby-growth-tracking/info', POST_UPDATE_LOCATION: 'tracking/geo/', // SIDIS GET_SIDIS_DUE_DATE: 'frontend/tools/due_date', GET_SIDIS_OVULATION: 'frontend/tools/ovulation', GET_SIDIS_BMI: 'frontend/tools/bmi', GET_SIDIS_BMR: 'frontend/tools/bmr', POST_LOGOUT: 'user/logout', OVULATION_CREATE_EVENT: 'ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}', GET_ALL_SPOTLIGHT: 'spotlights?per_page={perPage}&order_by={orderBy}', SSO_UPDATE_FIRST_TIME_BOOKMARK: 'bookmark/update-first-time', POST_COMMENT_NOTIFICATION: 'comment/notification', GET_ABOUT_US_DATA: 'about', POST_LEAD_IMPRESSION: 'campaign/{campaignCode}/impression', POST_LEAD_POPUP_EXIT: 'campaign/{campaignCode}/popup_exit', POST_LEAD_LEAD: 'campaign/{campaignCode}/lead', POST_SSO_VERIFY_TOKEN: 'verify-id-token', GET_LANDING_PAGE_FIRST_NODE: 'landing_page/bot', GET_LANDING_PAGE_NEXT_NODE: 'landing_page/messages', POST_LANDING_PAGE_IMPRESSION: 'landing_page/impressions', POST_LANDING_PAGE_CLICK: 'landing_page/clicks', FETCH_URL_DATA: 'preview', GET_SPOTLIGHT_LANDING: 'spotlight/{slug}', GET_FOOTER_INFO: 'footer', CHECK_SSO_EMAIL: 'member/check-email', GET_HOMEPAGE_SITEWIDE_BANNER: 'home/sitewide-banner', GET_DYNAMIC_FOOTER: 'menu/footer', GET_EXPERTS: 'experts?page={page}&number={perPage}&s={search}', GET_EXPERT_BY_ID: 'expert/{id}', }; const ADMIN_PATHS = { SEARCH_USER: 'admin/profile/search?website_url={website_url}&name={name}', COMMENT: { IMAGE_UPLOAD: 'admin/comment/image/upload?website_url={website_url}', }, }; export { ADMIN_PATHS, CARE_PATHS, DISCOVER_PATHS, PATHS, SUBOT_PATHS };