How to use crossdomain method in wpt

Best JavaScript code snippet using wpt

index.js

Source:index.js Github

copy

Full Screen

1import axios from "axios";2import config from "./Config";3import configNoProxy from "./Config/noProxy";4import Swal from "sweetalert2";5import moment from 'moment';6import Cookies from 'js-cookie'7const alert = {8 showAlert(message) {9 Swal.fire({10 type: "error",11 text: message,12 animation: false,13 allowOutsideClick: false,14 customClass: {15 popup: "animated tada"16 }17 }).then(result => {18 if (result.value) {19 window.location.reload();20 }21 });22 }23};24const now = moment();25const fow = now.day() - 1;26const eow = 6 - fow;27const firstday = moment().subtract(fow, "days").format("YYYY-MM-DD");28const lastday = moment().add(eow, "days").format("YYYY-MM-DD");29const year = now.format('YYYY');30const month = now.format('MM');31const dayOfMonth = moment().daysInMonth();32const firstDayofMonth = moment(year + "-" + month + "-01").format('YYYY-MM-DD')33const lastDayofMonth = moment(year + "-" + month + "-" + dayOfMonth).format('YYYY-MM-DD')34const client = axios.create(config.api);35const clientNoProxy = axios.create(configNoProxy.api);36const clientForLogin = axios.create(config.login);37const roleId = Cookies.get('roleId');38console.log('roleId : ', roleId);39// Request interceptor40client.interceptors.request.use(41 async function (configuration) {42 const token = Cookies.get("LoginSession");43 if (token !== null) {44 configuration.headers.Authorization = `Bearer ${token}`;45 }46 return configuration47 // if (Cookies.get('lastModifiedOn') && Cookies.get('roleId')) {48 // const valid = await axios(49 // {50 // method: 'get',51 // url: `${config.api.baseURL}/users/${Cookies.get('userId')}`,52 // headers: { 'Authorization': 'Bearer ' + Cookies.get('LoginSession') },53 // },54 // { crossdomain: true }55 // )56 // .then(function (res) {57 // if (res.status == 200 && res.data && res.data.Data && Cookies.get('lastModifiedOn') && Cookies.get('roleId') && (Cookies.get('lastModifiedOn') !== res.data.Data.roleId.lastModifiedOn || Cookies.get('roleId') != res.data.Data.roleId.roleId)) {58 // Cookies.remove('LoginSession', { path: '' })59 // // if (!res.data.Data.approved) {60 // // sessionStorage.setItem('title','Your account has banned')61 // // alert.showAlert("Your account has banned", "Your account has banned");62 // // } else if (Cookies.get('lastModifiedOn') !== res.data.Data.roleId.lastModifiedOn || Cookies.get('roleId') != res.data.Data.roleId.roleId) {63 // sessionStorage.setItem('title', 'Role has been changes')64 // alert.showAlert("Role has been changes", "Role has been changes");65 // // }66 // return false67 // } else {68 // return true69 // }70 // })71 //72 // if (valid)73 // return configuration74 // } else {75 // return configuration76 // }77 },78 function (err) {79 throw new Error(err);80 }81);82// Response interceptor83client.interceptors.response.use(84 response => response,85 error => {86 console.log("Error Message : ", error);87 let err = error.toString();88 if (err.includes("504")) {89 alert.showAlert("Connection time out", "Reload");90 } else if (err.includes("401")) {91 if (sessionStorage.getItem('title')) {92 alert.showAlert(sessionStorage.getItem('title'), sessionStorage.getItem('title'));93 } else {94 Cookies.remove('LoginSession', { path: '' })95 alert.showAlert("Unauthorized", "Unauthorized");96 }97 } else if (err.includes("500")) {98 alert.showAlert("Internal server error", "Reload");99 } else if (err.includes("Network Error", "Reload")) {100 alert.showAlert("Network Error");101 }102 }103);104// Response interceptor105clientNoProxy.interceptors.response.use(106 response => response,107 error => {108 console.log("Error Message : ", error);109 let err = error.toString();110 if (err.includes("504")) {111 alert.showAlert("Connection time out", "Reload");112 } else if (err.includes("500")) {113 alert.showAlert("Internal server error", "Reload");114 } else if (err.includes("Network Error", "Reload")) {115 alert.showAlert("Network Error");116 }117 }118);119clientForLogin.interceptors.response.use(120 response => response,121 error => {122 console.log("Error Message : ", error);123 let err = error.toString();124 if (err.includes("504")) {125 alert.showAlert("Connection time out", "Reload");126 } else if (err.includes("500")) {127 alert.showAlert("Internal server error", "Reload");128 } else if (err.includes("Network Error", "Reload")) {129 alert.showAlert("Network Error");130 }131 }132);133const FSMServices = {134 // authentication135 authenticationLogin(data) {136 return clientForLogin.request(137 {138 method: "post",139 url: `/login`,140 data141 },142 { crossdomain: false }143 );144 },145 register(data) {146 return clientNoProxy.request(147 {148 method: "post",149 url: `${configNoProxy.api.baseURL}/users/register`,150 data151 },152 { crossdomain: false }153 );154 },155 getDataAkun(id) {156 return client.request(157 {158 method: "get",159 url: `/users/${id}`,160 },161 { crossdomain: true }162 );163 },164 postFirebaseToken(params) {165 var data = {166 tokens: params.fcmToken167 }168 return client.request(169 {170 method: "post",171 url: `${config.api.baseURL}/api/users/token?userId=${params.userId}`,172 data173 },174 { crossdomain: true }175 );176 },177 getOptionListRoleRegister() {178 return clientNoProxy.request(179 {180 method: "get",181 url: `/role/readAll?skip=&top=&orderby&filter=is_deleted=false`182 },183 { crossdomain: true }184 )185 },186 forgetPassword(data) {187 return clientNoProxy.request(188 {189 method: "put",190 url: `${configNoProxy.api.baseURL}/api/forgotPassword`,191 data192 }193 )194 },195 getUserById(username) {196 return clientNoProxy.request(197 {198 method: "get",199 url: `${configNoProxy.api.baseURL}/users/readAll?skip=&top=&orderby&filter=userName='${username}'`200 }201 )202 },203 getAllCity() {204 return clientNoProxy.request(205 {206 method: "get",207 url: `${configNoProxy.api.baseURL}/cityRepo/City/all`208 },209 { crossdomain: true }210 )211 },212 getUserIdentity() {213 return clientNoProxy.request(214 {215 method: "get",216 url: `${configNoProxy.api.baseURL}/code/userIdentity`217 },218 { crossdomain: true }219 )220 },221 // END222 // Dashboard223 getTicketOpen(sort) {224 return client.request(225 {226 method: "get",227 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketOpen?sort=${sort}&userId=${Cookies.get('userId')}`228 },229 { crossdomain: true }230 )231 },232 getTicketOpenDetail(id) {233 return client.request(234 {235 method: "get",236 url: `${config.api.baseURL}/api/detailTicket/${id}`237 },238 { crossdomain: true }239 )240 },241 getTicketFinish(sort) {242 return client.request(243 {244 method: "get",245 url: `${config.api.baseURL}/History/getAllFinishedOrder?size=10&search=&sort=${sort}&userId=${Cookies.get('userId')}`246 },247 { crossdomain: true }248 )249 },250 getDetailFinishOrder(orderId) {251 return client.request(252 {253 method: "get",254 url: `${config.api.baseURL}/api/detailFinishOrder/${orderId}`255 },256 { crossdomain: true }257 )258 },259 getTicketConfirmReported(sort) {260 return client.request(261 {262 method: "get",263 url: `${config.api.baseURL}/History/getAllConfirmReportedOrder?size=10&search=&sort=${sort}&userId=${Cookies.get('userId')}`264 },265 { crossdomain: true }266 )267 },268 getDetailConfirmReportedOrder(orderId) {269 return client.request(270 {271 method: "get",272 url: `${config.api.baseURL}/api/detailConfirmReportedOrder/${orderId}`273 },274 { crossdomain: true }275 )276 },277 getTicketCancel(search, sort) {278 return client.request(279 {280 method: "get",281 url: `${config.api.baseURL}/troubleTicket/getAllCanceledTicket?search=${search}&page=0&size=10&sort=${sort}&userId=${Cookies.get('userId')}`282 },283 { crossdomain: true }284 )285 },286 getDetailTicketCancel(ticketId) {287 return client.request(288 {289 method: "get",290 url: `${config.api.baseURL}/troubleTicket/detailCanceledTicket/${ticketId}`291 },292 { crossdomain: true }293 )294 },295 reopenTicket(ticketId, data) {296 return client.request(297 {298 method: "post",299 url: `${config.api.baseURL}/troubleTicket/reOpen/${ticketId}`,300 data301 },302 { crossdomain: true }303 )304 },305 reopenTicketDispatch(ticketId, data) {306 return client.request(307 {308 method: "put",309 url: `${config.api.baseURL}/troubleTicket/reOpenTicket/${ticketId}`,310 data311 },312 { crossdomain: true }313 )314 },315 getDispatchList(data) {316 let params = {317 keyword: data.keyword,318 page: data.page,319 size: data.size,320 sort: data.sort321 }322 return client.request(323 {324 method: "get",325 url: `${config.api.baseURL}/api/listDispatch?search=${params.keyword}&page=${params.page - 1}&size=${params.size}&sort=${params.sort}&userId=${Cookies.get('userId')}`,326 data327 },328 { crossdomain: true }329 )330 },331 getDispatchListFilterSearch(data) {332 let params = {333 filter: data.filter,334 keyword: data.keyword,335 page: data.page,336 size: data.size,337 sort: data.sort338 }339 return client.request(340 {341 method: "get",342 url: `${config.api.baseURL}/api/listDispatchFilter?search=${params.keyword}&filter=${params.filter}&page=${params.page - 1}&size=${params.size}&sort=${params.sort}&userId=${Cookies.get('userId')}`,343 data344 },345 { crossdomain: true }346 )347 },348 getDetailDispatch(orderId) {349 return client.request(350 {351 method: "get",352 url: `${config.api.baseURL}/Dispatch/detailDispatch/${orderId}`353 },354 { crossdomain: true }355 )356 },357 getDetailHistoryDispatch(id) {358 return client.request(359 {360 method: "get",361 url: `${config.api.baseURL}/History/listHistoryDispatch?ticketId=${id}&sort=created_on,desc`362 },363 { crossdomain: true }364 )365 },366 getSearchDispatch(params) {367 return client.request(368 {369 method: "get",370 url: `${config.api.baseURL}/api/listDispatchSearch?page=${params.page}&search=${params.keyword}`371 },372 { crossdomain: true }373 )374 },375 createDispatch(data) {376 return client.request(377 {378 method: "post",379 url: `${config.api.baseURL}/Dispatch/create`,380 data381 },382 { crossdomain: true }383 )384 },385 getAllWorkerForDispatch(ticketId) {386 return client.request(387 {388 method: "get",389 url: `${config.api.baseURL}/worker_repo/getAllWorkerForDispatch?ticketId=${ticketId}`390 },391 { crossdomain: true }392 )393 },394 getAllWorkerForDispatchNew(ticketId, jobId, dispatchDate, dispatchTime, period, showAllWorker) {395 return client.request(396 {397 method: "get",398 url: `${config.api.baseURL}/api/listWorkerForDispatch?userId=${Cookies.get('userId')}&dispatchDate=${dispatchDate}&dispatchTime=${dispatchTime}&ticketId=${ticketId}&jobId=${jobId}&startDate=${period === 'today' ? moment(new Date()).format('YYYY-MM-DD') : period === 'week' ? moment(firstday).format('YYYY-MM-DD') : moment(firstDayofMonth).format('YYYY-MM-DD')}&endDate=${period === 'today' ? moment(new Date()).format('YYYY-MM-DD') : period === 'week' ? moment(lastday).format('YYYY-MM-DD') : moment(lastDayofMonth).format('YYYY-MM-DD')}&showAllWorker=${showAllWorker}`399 },400 { crossdomain: true }401 )402 },403 getAllWorkerForDispatchBoth(ticketId, jobId, dispatchDate, dispatchTime, period, showAllWorker) {404 return client.request(405 {406 method: "get",407 url: `${config.api.baseURL}/api/listWorkerForDispatchBoth?userId=${Cookies.get('userId')}&dispatchDate=${dispatchDate}&dispatchTime=${dispatchTime}&ticketId=${ticketId}&jobId=${jobId}&startDate=${period === 'today' ? moment(new Date()).format('YYYY-MM-DD') : period === 'week' ? moment(firstday).format('YYYY-MM-DD') : moment(firstDayofMonth).format('YYYY-MM-DD')}&endDate=${period === 'today' ? moment(new Date()).format('YYYY-MM-DD') : period === 'week' ? moment(lastday).format('YYYY-MM-DD') : moment(lastDayofMonth).format('YYYY-MM-DD')}&showAllWorker=${showAllWorker}`408 },409 { crossdomain: true }410 )411 },412 getStatusTicket(params) {413 return client.request(414 {415 method: "get",416 url: `${config.api.baseURL}/troubleTicket/totalStatusTicket?period=${params}&userId=${Cookies.get('userId')}`417 },418 { crossdomain: true }419 )420 },421 getChartDispatch(year) {422 return client.request(423 {424 method: "get",425 url: `${config.api.baseURL}/api/chartDispatch?year=${year}&userId=${Cookies.get('userId')}`426 }427 )428 },429 getNumberOfTicket(year, month) {430 return client.request(431 {432 method: "get",433 url: `${config.api.baseURL}/troubleTicket/numberOfTicket?year=${year}&month=${month}&userId=${Cookies.get('userId')}`434 }435 )436 },437 getSolvingTime() {438 return client.request(439 {440 method: "get",441 url: `${config.api.baseURL}/api/avgSolvingTime?period=1&userId=${Cookies.get('userId')}`442 }443 )444 },445 getTicketPriority() {446 return client.request(447 {448 method: "get",449 url: `${config.api.baseURL}/troubleTicket/ticketBaseOnPriority?period=3&userId=${Cookies.get('userId')}`450 }451 )452 },453 getFinishOrderSearch(search, sort) {454 return client.request(455 {456 method: "get",457 url: `${config.api.baseURL}/History/getAllFinishedOrder?size=10&search=${search}&sort=${sort}&userId=${Cookies.get('userId')}`458 }459 )460 },461 getFinishOrderFilter(filter, sort) {462 return client.request(463 {464 method: "get",465 url: `${config.api.baseURL}/History/getAllFinishedOrderFilter?size=10&filter=${filter}&sort=${sort}&userId=${Cookies.get('userId')}`466 }467 )468 },469 getFinishOrderSearchFilter(filter, search, sort) {470 return client.request(471 {472 method: "get",473 url: `${config.api.baseURL}/History/getAllFinishedOrderFilter?size=10&filter=${filter}&search=${search}&sort=${sort}&userId=${Cookies.get('userId')}`474 }475 )476 },477 getConfirmReportedOrderSearch(search, sort) {478 return client.request(479 {480 method: "get",481 url: `${config.api.baseURL}/History/getAllConfirmReportedOrder?size=10&search=${search}&sort=${sort}&userId=${Cookies.get('userId')}`482 }483 )484 },485 getConfirmReportedOrderFilter(filter, sort) {486 return client.request(487 {488 method: "get",489 url: `${config.api.baseURL}/History/getAllConfirmReportedOrderFilter?size=10&filter=${filter}&search=&sort=${sort}&userId=${Cookies.get('userId')}`490 }491 )492 },493 getConfirmReportedOrderSearchFilter(filter, search, sort) {494 return client.request(495 {496 method: "get",497 url: `${config.api.baseURL}/History/getAllConfirmReportedOrderFilter?size=10&filter=${filter}&search=${search}&sort=${sort}&userId=${Cookies.get('userId')}`498 }499 )500 },501 getPriority() {502 return client.request(503 {504 method: "get",505 url: `${config.api.baseURL}/code/priority`506 }507 )508 },509 getReport() {510 return client.request(511 {512 method: "get",513 url: `${config.api.baseURL}/api/listReport`514 }515 )516 },517 getSLAOptions() {518 return client.request(519 {520 method: "get",521 url: `${config.api.baseURL}/SLA/listSLAWithBranchId?userId=${Cookies.get('userId')}`522 }523 )524 },525 // End526 // Ticketing List527 getTicketList(data) {528 let params = {529 keyword: data.keyword,530 page: data.page,531 size: data.size,532 orderBy: data.orderBy533 }534 return client.request(535 {536 method: "get",537 url: `${config.api.baseURL}/troubleTicket/listTroubleTicket?search=${params.keyword}&page=${params.page - 1}&size=${params.size}&sort=${params.orderBy}&userId=${Cookies.get('userId')}`538 },539 { crossdomain: true }540 )541 },542 getTicketListFilter(data) {543 let params = {544 filter: data.filter,545 keyword: data.keyword,546 page: data.page,547 size: data.size,548 orderBy: data.orderBy549 }550 return client.request(551 {552 method: "get",553 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketFilter?search=${params.keyword}&filter=${params.filter}&page=${params.page - 1}&size=${params.size}&sort=${params.orderBy}&userId=${Cookies.get('userId')}`554 },555 { crossdomain: true }556 )557 },558 getOptionListCustomer() {559 return client.request(560 {561 method: "get",562 url: `${config.api.baseURL}/api/listClientCompany?userId=${Cookies.get('userId')}`563 },564 { crossdomain: true }565 )566 },567 getOptionListBranch(companyId) {568 return client.request(569 {570 method: "get",571 url: `${config.api.baseURL}/api/listClientCompanyBranch?userId=${Cookies.get('userId')}&companyId=${companyId}`572 },573 { crossdomain: true }574 )575 },576 getOptionListSLAType() {577 return client.request(578 {579 method: "get",580 url: `${config.api.baseURL}/SLA/getAllListSLAIncludeTypeName`581 },582 { crossdomain: true }583 )584 },585 getOptionListPIC() {586 return client.request(587 {588 method: "get",589 url: `${config.api.baseURL}/api/listClientCompanyPIC`590 },591 { crossdomain: true }592 )593 },594 searchGetListJob(search) {595 return client.request(596 {597 method: "get",598 url: `${config.api.baseURL}/job_repo/listJob/?search=${search}&userId=${Cookies.get('userId')}`599 },600 { crossdomain: true }601 )602 },603 searchGetListRefTicket(search) {604 return client.request(605 {606 method: "get",607 url: `${config.api.baseURL}/troubleTicket/listReferenceTicket?search=${search}&userId=${Cookies.get('userId')}`608 },609 { crossdomain: true }610 )611 },612 getOptionListJob(search) {613 return client.request(614 {615 method: "get",616 url: `${config.api.baseURL}/job_repo/getListJob?userId=${Cookies.get('userId')}&search=${search}`617 },618 { crossdomain: true }619 )620 },621 getOptionListJobCategory() {622 return client.request(623 {624 method: "get",625 url: `${config.api.baseURL}/jobCategory_repo/listJobCategory?userId=${Cookies.get('userId')}`626 },627 { crossdomain: true }628 )629 },630 getOptionListJobClass() {631 return client.request(632 {633 method: "get",634 url: `${config.api.baseURL}/jobClass_repo/listJobClass?userId=${Cookies.get('userId')}`635 },636 { crossdomain: true }637 )638 },639 getOptionListExistingReport() {640 return client.request(641 {642 method: "get",643 url: `${config.api.baseURL}/api/listFields`644 },645 { crossdomain: true }646 )647 },648 getReportByJobCategory(id) {649 return client.request(650 {651 method: "get",652 url: `${config.api.baseURL}/api/listReports/?id=${id}`653 }654 )655 },656 getReportById(id) {657 return client.request(658 {659 method: "get",660 url: `${config.api.baseURL}/jobCategory_repo/jobCategoryReport/${id}`661 }662 )663 },664 //new665 getListChildField(fieldJobCategoryId, fieldOptionParentId, pageNo, pageSize) {666 return client.request(667 {668 method: "get",669 url: `${config.api.baseURL}/api/listFieldLov?fieldJobCategoryId=${fieldJobCategoryId}&fieldOptionParentId=${fieldOptionParentId}&search=&pageNo=${pageNo}&pageSize=${pageSize}`670 }671 )672 },673 getOptionListCategory() {674 return client.request(675 {676 method: "get",677 url: `${config.api.baseURL}/code/category`678 },679 { crossdomain: true }680 )681 },682 createTicket(data) {683 return client.request(684 {685 method: "post",686 url: `${config.api.baseURL}/troubleTicket/create`,687 data688 },689 { crossdomain: true }690 )691 },692 getDetailTicket(id) {693 return client.request(694 {695 method: "get",696 url: `${config.api.baseURL}/api/detailTicket/${id}`697 },698 { crossdomain: true }699 )700 },701 getTicketOnCancelList(search, page, size, sort) {702 return client.request(703 {704 method: "get",705 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketCancel?search=${search}&page=${page - 1}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`706 },707 { crossdomain: true }708 )709 },710 getTroubleTicketById(id) {711 return client.request(712 {713 method: "get",714 url: `${config.api.baseURL}/api/updateDetailTicket/${id}`715 },716 { crossdomain: true }717 )718 },719 editTicket(data, id) {720 return client.request(721 {722 method: "put",723 url: `${config.api.baseURL}/troubleTicket/update/${id}`,724 data725 },726 { crossdomain: true }727 )728 },729 deleteTicket(data, id) {730 return client.request(731 {732 method: 'put',733 url: `${config.api.baseURL}/troubleTicket/delete/${id}`,734 data735 }736 )737 },738 cancelTicket(data, id) {739 return client.request(740 {741 method: 'put',742 url: `${config.api.baseURL}/troubleTicket/cancel/${id}`,743 data744 }745 )746 },747 getBranchByCompany(id) {748 return client.request(749 {750 method: "get",751 url: `${config.api.baseURL}/api/listBranchByCompanyId?companyId=${id}`752 },753 { crossdomain: true }754 )755 },756 getPICByCompany(id) {757 return client.request(758 {759 method: "get",760 url: `${config.api.baseURL}/api/listPICByBranchId?branchId=${id}`761 },762 { crossdomain: true }763 )764 },765 getJobByCategory(id) {766 return client.request(767 {768 method: "get",769 url: `${config.api.baseURL}/job_repo/listJobByJobCategory?jobCategoryId=${id}`770 },771 { crossdomain: true }772 )773 },774 getJobCategoryByClass(id) {775 return client.request(776 {777 method: "get",778 url: `${config.api.baseURL}/jobCategory_repo/listJobCategoryByJobClass?jobClassId=${id}`779 },780 { crossdomain: true }781 )782 },783 getHoldTicketId(id) {784 return client.request(785 {786 method: "get",787 url: `${config.api.baseURL}/History/detailHoldReason/${id}`788 },789 { crossdomain: true }790 )791 },792 getNoteTicketId(id) {793 return client.request(794 {795 method: "get",796 url: `${config.api.baseURL}/api/listDispatchNote?ticketId=${id}&sort=created_on,desc`797 },798 { crossdomain: true }799 )800 },801 // End802 // Finsihed order list803 getTicketOnFinish(search, page, size, order) {804 return client.request(805 {806 method: "get",807 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketFinish?search=${search}&page=${page - 1}&size=${size}&sort=${order}&userId=${Cookies.get('userId')}`808 },809 { crossdomain: true }810 )811 },812 getTicketOnFinishFilter(search, filter, page, size, order) {813 return client.request(814 {815 method: "get",816 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketFinishFilter?filter=${filter}&search=${search}&page=${page - 1}&size=${size}&sort=${order}&userId=${Cookies.get('userId')}`817 },818 { crossdomain: true }819 )820 },821 confirmReport(ticketId, data) {822 return client.request(823 {824 method: "post",825 url: `${config.api.baseURL}/troubleTicket/confirm/${ticketId}`,826 data827 },828 { crossdomain: true }829 )830 },831 // End832 // Confirm Reported order list833 getTicketOnConfirmReported(search, page, size, order) {834 return client.request(835 {836 method: "get",837 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketConfirmReported?search=${search}&page=${page - 1}&size=${size}&sort=${order}&userId=${Cookies.get('userId')}`838 },839 { crossdomain: true }840 )841 },842 getTicketOnConfirmReportedFilter(search, filter, page, size, order) {843 return client.request(844 {845 method: "get",846 url: `${config.api.baseURL}/troubleTicket/listTroubleTicketConfirmReportedFilter?filter=${filter}&search=${search}&page=${page - 1}&size=${size}&sort=${order}&userId=${Cookies.get('userId')}`847 },848 { crossdomain: true }849 )850 },851 // End852 // Monitoring853 getTechnicianAvaibility() {854 return client.request(855 {856 method: "get",857 url: `${config.api.baseURL}/users/getDataWorkerAvaibility?userId=${Cookies.get('userId')}`858 },859 { crossdomain: true }860 )861 },862 getTechnicianStatus() {863 return client.request(864 {865 method: "get",866 url: `${config.api.baseURL}/users/getDataTechnicianOnMonitoring?userId=${Cookies.get('userId')}`867 },868 { crossdomain: true }869 )870 },871 getTechnicianWorkerStandBy(page, size, sort, search) {872 return client.request(873 {874 method: "get",875 url: `${config.api.baseURL}/users/getDataTechnicianStandbyOnMonitoring?search=${search}&page=${page - 1}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`876 },877 { crossdomain: true }878 )879 },880 downloadCSVStandBy() {881 return client.request(882 {883 method: "get",884 url: `${config.api.baseURL}/monitoring/standbyList/csv/tes_csv?userId=${Cookies.get('userId')}`,885 },886 { crossdomain: true }887 )888 },889 downloadExcelStandBy() {890 return client.request(891 {892 method: "get",893 url: `${config.api.baseURL}/monitoring/standbyList/excel/tes?userId=${Cookies.get('userId')}`,894 },895 { crossdomain: true }896 )897 },898 downloadPDFStandBy() {899 return client.request(900 {901 method: "get",902 url: `${config.api.baseURL}/monitoring/standbyList/pdf/tes_pdf26?userId=${Cookies.get('userId')}`,903 },904 { crossdomain: true }905 )906 },907 getTechnicianPosition() {908 return client.request(909 {910 method: "get",911 url: `${config.api.baseURL}/users/getLocationTechnician?userId=${Cookies.get('userId')}`912 },913 { crossdomain: true }914 )915 },916 // End917 // Schedule918 //Faisal919 getAllDataSchedule() {920 return client.request(921 {922 method: "GET",923 url: `${config.api.baseURL}/Dispatch/getDataSchedule?userId=${Cookies.get('userId')}`924 },925 { crossdomain: true }926 )927 },928 getDetailDataSchedule(orderId) {929 return client.request(930 {931 method: "get",932 url: `${config.api.baseURL}/Dispatch/getDetailDataSchedule?orderid=${orderId}`933 },934 { crossdomain: true }935 )936 },937 // Dio938 getScheduleById(orderId) {939 return client.request(940 {941 method: "get",942 url: `${config.api.noProxy}/Dispatch/ScheduleById?orderid=${orderId}`943 },944 { crossdomain: true }945 )946 },947 // End948 // Master Data UOM949 getUOMList(search, page, size, sort) {950 return client.request(951 {952 method: "get",953 url: `${config.api.baseURL}/uom_repo/listUOM?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`954 },955 { crossdomain: true }956 )957 },958 createUOM(data) {959 return client.request(960 {961 method: "post",962 url: `${config.api.baseURL}/uom_repo/UOM/create`,963 data964 },965 { crossdomain: true }966 )967 },968 editUOM(data, id) {969 return client.request(970 {971 method: "put",972 url: `${config.api.baseURL}/uom_repo/UOM/update/${id}`,973 data974 },975 { crossdomain: true }976 )977 },978 deleteUOM(data, id) {979 return client.request(980 {981 method: "put",982 url: `${config.api.baseURL}/uom_repo/UOM/delete/${id}`,983 data984 },985 { crossdomain: true }986 )987 },988 // End989 // Master Data Report990 getReportList(search, page, size, sort) {991 return client.request(992 {993 method: "get",994 url: `${config.api.baseURL}/api/getAllReport?search=${search}&page=${page}&size=${size}&sort=${sort}`995 },996 { crossdomain: true }997 )998 },999 createReport(data) {1000 return client.request(1001 {1002 method: "post",1003 url: `${config.api.baseURL}/api/report/create`,1004 data1005 },1006 { crossdomain: true }1007 )1008 },1009 editReport(data, id) {1010 return client.request(1011 {1012 method: "put",1013 url: `${config.api.baseURL}/api/report/update/${id}`,1014 data1015 },1016 { crossdomain: true }1017 )1018 },1019 deleteReport(data, id) {1020 return client.request(1021 {1022 method: "put",1023 url: `${config.api.baseURL}/api/report/delete/${id}`,1024 data1025 },1026 { crossdomain: true }1027 )1028 },1029 // End1030 // Master Data SLA1031 getSLAList(search, page, size, sort) {1032 return client.request(1033 {1034 method: "get",1035 url: `${config.api.baseURL}/SLA/listSLA?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1036 },1037 { crossdomain: true }1038 )1039 },1040 createSLA(data) {1041 return client.request(1042 {1043 method: "post",1044 url: `${config.api.baseURL}/SLA/create`,1045 data1046 },1047 { crossdomain: true }1048 )1049 },1050 editSLA(data, id) {1051 return client.request(1052 {1053 method: "put",1054 url: `${config.api.baseURL}/SLA/update/${id}`,1055 data1056 },1057 { crossdomain: true }1058 )1059 },1060 deleteSLA(id, data) {1061 return client.request(1062 {1063 method: "put",1064 url: `${config.api.baseURL}/SLA/delete/${id}`,1065 data1066 },1067 { crossdomain: true }1068 )1069 },1070 optionListCompany() {1071 return client.request(1072 {1073 method: "get",1074 url: `${config.api.baseURL}/api/listClientCompany?userId=${Cookies.get('userId')}`1075 },1076 { crossdomain: true }1077 )1078 },1079 optionListBranchByComapany(companyId) {1080 return client.request(1081 {1082 method: "get",1083 url: `${config.api.baseURL}/api/listClientCompanyBranch?userId=${Cookies.get('userId')}&companyId=${companyId}`1084 },1085 { crossdomain: true }1086 )1087 },1088 optionListType() {1089 return client.request(1090 {1091 method: "get",1092 url: `${config.api.baseURL}/slaType/listSLAType`1093 }1094 )1095 },1096 optionListWorkingTime() {1097 return client.request(1098 {1099 method: "get",1100 url: `${config.api.baseURL}/api/listWorkingTime?userId=${Cookies.get('userId')}`1101 },1102 { crossdomain: true }1103 )1104 },1105 optionListCity() {1106 return client.request(1107 {1108 method: "get",1109 url: `${config.api.baseURL}/city/readAll?skip=&top=&orderby=&filter=isDeleted=false`1110 },1111 { crossdomain: true }1112 )1113 },1114 // End1115 // Master Data Job List1116 getJobList(page, size, sort, search) {1117 return client.request(1118 {1119 method: "get",1120 url: `${config.api.baseURL}/job_repo/job/all?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1121 },1122 { crossdomain: true }1123 )1124 },1125 createJobList(data) {1126 return client.request(1127 {1128 method: "post",1129 url: `${config.api.baseURL}/job_repo/job/create`,1130 data1131 },1132 { crossdomain: true }1133 )1134 },1135 editJobList(id, data) {1136 return client.request(1137 {1138 method: "put",1139 url: `${config.api.baseURL}/job_repo/job/update/${id}`,1140 data1141 },1142 { crossdomain: true }1143 )1144 },1145 deleteJobList(id, data) {1146 return client.request(1147 {1148 method: 'put',1149 url: `${config.api.baseURL}/job_repo/deleteJob?jobId=${id}`,1150 data1151 }1152 )1153 },1154 // End1155 // Master Data Job Class1156 getJobClass(page, size, sort, search) {1157 return client.request(1158 {1159 method: "get",1160 url: `${config.api.baseURL}/jobClass_repo/jobClass/all?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1161 },1162 { crossdomain: true }1163 )1164 },1165 createJobClass(data) {1166 return client.request(1167 {1168 method: "post",1169 url: `${config.api.baseURL}/jobClass_repo/jobClass/create`,1170 data1171 },1172 { crossdomain: true }1173 )1174 },1175 editJobClass(id, data) {1176 return client.request(1177 {1178 method: "put",1179 url: `${config.api.baseURL}/jobClass_repo/jobClass/update/${id}`,1180 data1181 },1182 { crossdomain: true }1183 )1184 },1185 deleteJobClass(id, data) {1186 return client.request(1187 {1188 method: 'put',1189 url: `${config.api.baseURL}/jobClass_repo/deleteJobClass?jobClassId=${id}`,1190 data1191 }1192 )1193 },1194 // End1195 // Master Data Working Time1196 createWorkingTime(data) {1197 return client.request(1198 {1199 method: "post",1200 url: `${config.api.baseURL}/api/workingTime/create`,1201 data1202 },1203 { crossdomain: true }1204 )1205 },1206 getWorkingTime(search, page, size, sort) {1207 return client.request(1208 {1209 method: "get",1210 url: `${config.api.baseURL}/api/listWTime?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1211 },1212 { crossdomain: true }1213 )1214 },1215 editWorkingTime(data, id) {1216 return client.request(1217 {1218 method: "put",1219 url: `${config.api.baseURL}/api/workingTime/update/${id}`,1220 data1221 },1222 { crossdomain: true }1223 )1224 },1225 deleteWorkingTime(data, id) {1226 return client.request(1227 {1228 method: "put",1229 url: `${config.api.baseURL}/api/workingTime/delete/${id}`,1230 data1231 },1232 { crossdomain: true }1233 )1234 },1235 // End1236 // Master Data Job Category1237 getJobCategory(page, size, sort, search) {1238 return client.request(1239 {1240 method: "get",1241 url: `${config.api.baseURL}/jobCategory_repo/jobCategory/all?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1242 },1243 { crossdomain: true }1244 )1245 },1246 createJobCategory(data) {1247 return client.request(1248 {1249 method: "post",1250 url: `${config.api.baseURL}/jobCategory_repo/jobCategory/create`,1251 data1252 },1253 { crossdomain: true }1254 )1255 },1256 editJobCategory(id, data) {1257 return client.request(1258 {1259 method: "put",1260 url: `${config.api.baseURL}/jobCategory_repo/jobCategory/update/${id}`,1261 data1262 },1263 { crossdomain: true }1264 )1265 },1266 deleteJobCategory(id, data) {1267 return client.request(1268 {1269 method: 'put',1270 url: `${config.api.baseURL}/jobCategory_repo/deleteJobCategory?jobCategoryId=${id}`,1271 data1272 }1273 )1274 },1275 // End1276 // Master Data Worker1277 createWorker(data) {1278 return client.request(1279 {1280 method: "post",1281 url: `${config.api.baseURL}/users/createWorker`,1282 data1283 }1284 )1285 },1286 getWorker(search, page, size, sort) {1287 return client.request(1288 {1289 method: "get",1290 url: `${config.api.baseURL}/users/listWorker?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1291 },1292 { crossdomain: true }1293 )1294 },1295 getOptionListWorkerGroup() {1296 return client.request(1297 {1298 method: "get",1299 url: `${config.api.baseURL}/user_group/readAll?skip=&top=&orderby=&filter=`1300 },1301 { crossdomain: true }1302 )1303 },1304 getOptionListUserIdentity() {1305 return client.request(1306 {1307 method: "get",1308 url: `${config.api.baseURL}/code/readAll?skip=&top=&orderby&filter=isDeleted=false AND categorycodeid.categoryCodeId=10`1309 },1310 { crossdomain: true }1311 )1312 },1313 // getOptionListJob() {1314 // return client.request(1315 // {1316 // method: "get",1317 // url: `${config.api.baseURL}/job/readAll?skip=&top=&orderby&filter=`1318 // },1319 // { crossdomain: true }1320 // )1321 // },1322 updateWorker(workerId, data) {1323 return client.request(1324 {1325 method: "put",1326 url: `${config.api.baseURL}/users/updateWorker/${workerId}`,1327 data1328 },1329 { crossdomain: true }1330 )1331 },1332 deleteWorker(workerId, data) {1333 return client.request(1334 {1335 method: "put",1336 url: `${config.api.baseURL}/users/deleteWorker/${workerId}`,1337 data1338 },1339 { crossdomain: true }1340 )1341 },1342 getWorkerDetail(workerId) {1343 return client.request(1344 {1345 method: "get",1346 url: `${config.api.baseURL}/users/getWorkerDetail/${workerId}`1347 },1348 { crossdomain: true }1349 )1350 },1351 searchWorker(key) {1352 return client.request(1353 {1354 method: "get",1355 url: `${config.api.baseURL}/users/getAllWorker/${key}`1356 },1357 { crossdomain: true }1358 )1359 },1360 // End1361 // Master Data User1362 getUser(search, page, size, sort) {1363 return client.request(1364 {1365 method: "get",1366 url: `${config.api.baseURL}/users/listUsers?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1367 },1368 { crossdomain: true }1369 )1370 },1371 createUser(data) {1372 return client.request(1373 {1374 method: "post",1375 url: `${config.api.baseURL}/users/createUsers`,1376 data1377 },1378 { crossdomain: true }1379 )1380 },1381 getUserRole(search) {1382 return client.request(1383 {1384 method: "get",1385 url: `${config.api.baseURL}/api/listRoles/4?search=${search}&userId=${Cookies.get('userId')}`1386 },1387 { crossdomain: true }1388 )1389 },1390 updateUser(userId, data) {1391 return client.request(1392 {1393 method: "put",1394 url: `${config.api.baseURL}/users/updateUsers/${userId}`,1395 data1396 },1397 { crossdomain: true }1398 )1399 },1400 deleteUser(userId, data) {1401 return client.request(1402 {1403 method: "put",1404 url: `${config.api.baseURL}/users/deleteUsers/${userId}`,1405 data1406 },1407 { crossdomain: true }1408 )1409 },1410 getUserDetail(userId) {1411 return client.request(1412 {1413 method: "get",1414 url: `${config.api.baseURL}/users/getUserDetail/${userId}`1415 },1416 { crossdomain: true }1417 )1418 },1419 searchUser(key) {1420 return client.request(1421 {1422 method: "get",1423 url: `${config.api.baseURL}/users/getAllUsers/${key}`1424 },1425 { crossdomain: true }1426 )1427 },1428 // End1429 // Master Data Role List1430 getRoleList(search, page, size, sort) {1431 return client.request(1432 {1433 method: "get",1434 url: `${config.api.baseURL}/api/listRole?search=${search}&page=${page}&size=${size}&sort=${sort}`1435 },1436 { crossdomain: true }1437 )1438 },1439 getPrivilege() {1440 return client.request(1441 {1442 method: "get",1443 url: `${config.api.baseURL}/api/listMenu`1444 },1445 { crossdomain: true }1446 )1447 },1448 getRole(id) {1449 return client.request(1450 {1451 method: "get",1452 url: `${config.api.baseURL}/api/role/${id}`1453 },1454 { crossdomain: true }1455 )1456 },1457 createRole(data) {1458 return client.request(1459 {1460 method: "post",1461 url: `${config.api.baseURL}/api/role/create`,1462 data1463 },1464 { crossdomain: true }1465 )1466 },1467 editRole(roleId, data) {1468 return client.request(1469 {1470 method: "put",1471 url: `${config.api.baseURL}/api/role/update/${roleId}`,1472 data1473 },1474 { crossdomain: true }1475 )1476 },1477 deleteRole(id, data) {1478 return client.request(1479 {1480 method: "put",1481 url: `${config.api.baseURL}/api/role/delete/${id}`,1482 data1483 },1484 { crossdomain: true }1485 )1486 },1487 getOptionListUserGroup() {1488 return client.request(1489 {1490 method: "get",1491 url: `${config.api.baseURL}/userGroup/list`1492 },1493 { crossdomain: true }1494 )1495 },1496 // End1497 // Master Data Customer List1498 getClientCompany(search, page, size, sort) {1499 return client.request(1500 {1501 method: "get",1502 url: `${config.api.baseURL}/api/clientCompany?sort=${sort}&size=${size}&page=${page - 1}&search=${search}&userId=${Cookies.get('userId')}`1503 },1504 { crossdomain: true }1505 )1506 },1507 createClientCompany(data) {1508 return client.request(1509 {1510 method: "post",1511 url: `${config.api.baseURL}/api/clientCompany/create`,1512 data1513 },1514 { crossdomain: true }1515 )1516 },1517 editClientCompany(id, data) {1518 return client.request(1519 {1520 method: "put",1521 url: `${config.api.baseURL}/api/clientCompany/update/${id}`,1522 data1523 },1524 { crossdomain: true }1525 )1526 },1527 deleteClientCompany(id, data) {1528 return client.request(1529 {1530 method: "put",1531 url: `${config.api.baseURL}/api/clientCompany/delete/${id}`,1532 data1533 },1534 { crossdomain: true }1535 )1536 },1537 searchClientCompany(key, skip, top, orderBy) {1538 return client.request(1539 {1540 method: "get",1541 url: `${config.api.baseURL}/api/clientCompany/search?companyName=${key}&sort=${orderBy}&size=${top}&page=${skip}`1542 },1543 { crossdomain: true }1544 )1545 },1546 // End1547 // Master Data Customer List Branch1548 getClientCompanyBranch(search, page, size, sort) {1549 return client.request(1550 {1551 method: "get",1552 url: `${config.api.baseURL}/api/getAllClientCompanyBranch?search=${search}&page=${page - 1}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1553 },1554 { crossdomain: true }1555 )1556 },1557 createClientCompanyBranch(data) {1558 return client.request(1559 {1560 method: "post",1561 url: `${config.api.baseURL}/api/createClientCompanyBranch`,1562 data1563 },1564 { crossdomain: true }1565 )1566 },1567 editClientCompanyBranch(id, data) {1568 return client.request(1569 {1570 method: "put",1571 url: `${config.api.baseURL}/api/updateClientCompanyBranch/${id}`,1572 data1573 },1574 { crossdomain: true }1575 )1576 },1577 deleteClientCompanyBranch(id, data) {1578 return client.request(1579 {1580 method: "put",1581 url: `${config.api.baseURL}/api/deleteClientCompanyBranch/${id}`,1582 data1583 },1584 { crossdomain: true }1585 )1586 },1587 getClientCompanyBranchPic(id) {1588 return client.request(1589 {1590 method: "get",1591 url: `${config.api.baseURL}/api/clientCompany/detail/${id}?userId=${Cookies.get('userId')}`1592 },1593 { crossdomain: true }1594 )1595 },1596 searchClientCompanyBranch(key, skip, top, orderBy) {1597 return client.request(1598 {1599 method: "get",1600 url: `${config.api.baseURL}/api/getAllClientCompanyBranch/${key}`1601 },1602 { crossdomain: true }1603 )1604 },1605 // End1606 // Import Service1607 importTicket(userId, data) {1608 return client.request(1609 {1610 method: "post",1611 url: `${config.api.baseURL}/submit/troubleTicket/${userId}`,1612 data1613 },1614 { crossdomain: true }1615 )1616 },1617 importCheckValidation(data) {1618 const headers = {1619 'Content-Type': ''1620 }1621 return client.request(1622 {1623 method: "post",1624 url: `${config.api.baseURL}/import/troubleTicket?userId=${Cookies.get('userId')}`,1625 data,1626 headers1627 },1628 { crossdomain: true }1629 )1630 },1631 // End1632 // Upload Assignment Letter1633 uploadAssignmentLetter(data) {1634 const headers = {1635 'Content-Type': ''1636 }1637 return client.request(1638 {1639 method: "post",1640 url: `${config.api.baseURL}/api/uploadFile/`,1641 data,1642 headers1643 },1644 { crossdomain: true }1645 )1646 },1647 donwloadAssignmentLetter(fileName) {1648 return client.request(1649 {1650 method: "get",1651 url: `${config.api.baseURL}/api/downloadFile/${fileName}`1652 },1653 { crossdomain: true }1654 )1655 },1656 // End1657 // Master Data Action1658 getActionList(page, size, sort, search) {1659 return client.request(1660 {1661 method: "get",1662 url: `${config.api.baseURL}/api/action/all?search=${search}&page=${page}&size=${size}&sort=${sort}`1663 },1664 { crossdomain: true }1665 )1666 },1667 createActionList(data) {1668 return client.request(1669 {1670 method: "post",1671 url: `${config.api.baseURL}/api/action/create`,1672 data1673 },1674 { crossdomain: true }1675 )1676 },1677 editActionList(id, data) {1678 return client.request(1679 {1680 method: "put",1681 url: `${config.api.baseURL}/api/action/update/${id}`,1682 data1683 },1684 { crossdomain: true }1685 )1686 },1687 deleteActionList(id, data) {1688 return client.request(1689 {1690 method: "put",1691 url: `${config.api.baseURL}/api/action/deleteAction?actionId=${id}`,1692 data1693 },1694 { crossdomain: true }1695 )1696 },1697 searchActionList(key, skip, top, orderby) {1698 return client.request(1699 {1700 method: "get",1701 url: `${config.api.baseURL}/api/action/search?search=${key}&page=${skip}&size=${top}&sort=${orderby}`1702 },1703 { crossdomain: true }1704 )1705 },1706 // End1707 // Master Data Failure1708 getFailureList(page, size, sort, search) {1709 return client.request(1710 {1711 method: "get",1712 url: `${config.api.baseURL}/api/failure/all?search=${search}&page=${page}&size=${size}&sort=${sort}`1713 },1714 { crossdomain: true }1715 )1716 },1717 createFailureList(data) {1718 return client.request(1719 {1720 method: "post",1721 url: `${config.api.baseURL}/api/failure/create`,1722 data1723 },1724 { crossdomain: true }1725 )1726 },1727 editFailureList(id, data) {1728 return client.request(1729 {1730 method: "put",1731 url: `${config.api.baseURL}/api/failure/update/${id}`,1732 data1733 },1734 { crossdomain: true }1735 )1736 },1737 deleteFailureList(id, data) {1738 return client.request(1739 {1740 method: "put",1741 url: `${config.api.baseURL}/api/failure/deleteFailure?failureId=${id}`,1742 data1743 },1744 { crossdomain: true }1745 )1746 },1747 searchFailureList(key, skip, top, orderby) {1748 return client.request(1749 {1750 method: "get",1751 url: `${config.api.baseURL}/api/failure/search?search=${key}&page=${skip}&size=${top}&sort=${orderby}`1752 },1753 { crossdomain: true }1754 )1755 },1756 // End1757 // Master Data City1758 getCityList(page, size, sort, search) {1759 return client.request(1760 {1761 method: "get",1762 url: `${config.api.baseURL}/cityRepo/City/all?search=${search}&page=${page}&size=${size}&sort=${sort}`1763 },1764 { crossdomain: true }1765 )1766 },1767 createCityList(data) {1768 return client.request(1769 {1770 method: "post",1771 url: `${config.api.baseURL}/cityRepo/city/create`,1772 data1773 },1774 { crossdomain: true }1775 )1776 },1777 editCityList(id, data) {1778 return client.request(1779 {1780 method: "put",1781 url: `${config.api.baseURL}/cityRepo/city/update/${id}`,1782 data1783 },1784 { crossdomain: true }1785 )1786 },1787 deleteCityList(id, data) {1788 return client.request(1789 {1790 method: "put",1791 url: `${config.api.baseURL}/cityRepo/city/delete/${id}`,1792 data1793 },1794 { crossdomain: true }1795 )1796 },1797 // End1798 // Master Data Province1799 getProvinceList(page, size, sort, search) {1800 return client.request(1801 {1802 method: "get",1803 url: `${config.api.baseURL}/api/listProvince?search=${search}&page=${page}&size=${size}&sort=${sort}`1804 },1805 { crossdomain: true }1806 )1807 },1808 // End1809 // Master Data Diagnosis1810 getDiagnosisList(page, size, sort, search) {1811 return client.request(1812 {1813 method: "get",1814 url: `${config.api.baseURL}/api/diagnosis/all?search=${search}&page=${page}&size=${size}&sort=${sort}`1815 },1816 { crossdomain: true }1817 )1818 },1819 createDiagnosisList(data) {1820 return client.request(1821 {1822 method: "post",1823 url: `${config.api.baseURL}/api/diagnosis/create`,1824 data1825 },1826 { crossdomain: true }1827 )1828 },1829 editDiagnosisList(id, data) {1830 return client.request(1831 {1832 method: "put",1833 url: `${config.api.baseURL}/api/diagnosis/update/${id}`,1834 data1835 },1836 { crossdomain: true }1837 )1838 },1839 deleteDiagnosisList(id, data) {1840 return client.request(1841 {1842 method: "put",1843 url: `${config.api.baseURL}/api/diagnosis/deleteDiagnosis?diagnosisId=${id}`,1844 data1845 },1846 { crossdomain: true }1847 )1848 },1849 searchDiagnosisList(key, skip, top, orderby) {1850 return client.request(1851 {1852 method: "get",1853 url: `${config.api.baseURL}/api/diagnosis/search?search=${key}&page=${skip}&size=${top}&sort=${orderby}`1854 },1855 { crossdomain: true }1856 )1857 },1858 // End1859 // Export1860 searchWorkerList(search) {1861 return client.request(1862 {1863 method: "get",1864 url: `${config.api.baseURL}/users/listUserWorker?page=0&size=10&search=${search}&userId=${Cookies.get('userId')}`1865 },1866 { crossdomain: true }1867 )1868 },1869 searchCityList(search) {1870 return client.request(1871 {1872 method: "get",1873 url: `${config.api.baseURL}/cityRepo/listCity?search=${search}`1874 },1875 { crossdomain: true }1876 )1877 },1878 searchCompanyList(search) {1879 return client.request(1880 {1881 method: "get",1882 url: `${config.api.baseURL}/api/listCompany?page=0&size=10&search=${search}&userId=${Cookies.get('userId')}`1883 },1884 { crossdomain: true }1885 )1886 },1887 getFilterExport(data) {1888 return client.request(1889 {1890 method: "post",1891 url: `${config.api.baseURL}/troubleTicket/exportListTicket`,1892 data,1893 params: {1894 sort: 'ticket_id,desc',1895 userId: Cookies.get('userId')1896 }1897 },1898 { crossdomain: true }1899 )1900 },1901 getWorkloadTask(page, size, sort, search, time) {1902 return client.request(1903 {1904 method: "get",1905 url: `${config.api.baseURL}/api/workload?userId=${Cookies.get('userId')}&time=${time}&pageNo=${page}&pageSize=${size}&sort=${sort}&search=${search}&startDate=${time === 'today' ? moment(new Date()).format('YYYY-MM-DD') : time === 'week' ? moment(firstday).format('YYYY-MM-DD') + `&endDate=${moment(lastday).format('YYYY-MM-DD')}` : moment(firstDayofMonth).format('YYYY-MM-DD') + `&endDate=${moment(lastDayofMonth).format('YYYY-MM-DD')}`}`1906 },1907 { crossdomain: true }1908 )1909 },1910 getWorkloadCalendar(page, size, sort, search, time, date) {1911 return client.request(1912 {1913 method: "get",1914 url: `${config.api.baseURL}/api/workloadCalender?userId=${Cookies.get('userId')}&time=${time}&pageNo=${page}&pageSize=${size}&sort=${sort}&search=${search}&startDate=${time === 'today' ? moment(date).format('YYYY-MM-DD') : time === 'week' ? moment(firstday).format('YYYY-MM-DD') + `&endDate=${moment(lastday).format('YYYY-MM-DD')}` : moment(firstDayofMonth).format('YYYY-MM-DD') + `&endDate=${moment(lastDayofMonth).format('YYYY-MM-DD')}`}`1915 },1916 { crossdomain: true }1917 )1918 },1919 getDetailWorkload(orderId) {1920 return client.request(1921 {1922 method: "get",1923 url: `${config.api.baseURL}/api/workloadCalenderDetail/${orderId}`1924 },1925 { crossdomain: true }1926 )1927 },1928 getDetailWorkloadWeek(workerId, date) {1929 return client.request(1930 {1931 method: "get",1932 url: `${config.api.baseURL}/api/workloadCalenderDetailWeek/${workerId}?date=${moment(date).format('YYYY-MM-DD')}`1933 },1934 { crossdomain: true }1935 )1936 },1937 // Tenant1938 getTenantList(page, size, sort, search) {1939 return client.request(1940 {1941 method: "get",1942 url: `${config.api.baseURL}/mTenant/all?search=${search}&page=${page}&size=${size}&sort=${sort}&userId=${Cookies.get('userId')}`1943 },1944 { crossdomain: true }1945 )1946 },1947 createTenant(data) {1948 return client.request(1949 {1950 method: "post",1951 url: `${config.api.baseURL}/mTenant/create`,1952 data1953 },1954 { crossdomain: true }1955 )1956 },1957 updateTenant(id, data) {1958 return client.request(1959 {1960 method: "put",1961 url: `${config.api.baseURL}/mTenant/update/${id}`,1962 data1963 },1964 { crossdomain: true }1965 )1966 },1967 deleteTenant(id, data = { userId: Cookies.get('userId') }) {1968 return client.request(1969 {1970 method: "put",1971 url: `${config.api.baseURL}/mTenant/delete/${id}`,1972 data1973 },1974 { crossdomain: true }1975 )1976 },1977 getTenantLOV(search) {1978 return client.request(1979 {1980 method: "get",1981 url: `${config.api.baseURL}/mTenant/optionList?search=${search}&userId=${Cookies.get('userId')}`1982 },1983 { crossdomain: true }1984 )1985 },1986 getListUserDetailOnTenant(search, page, size, sort, type, tenantId) {1987 return client.request(1988 {1989 method: "get",1990 url: `${config.api.baseURL}/mTenant/detail/${tenantId}?search=${search}&page=${page}&size=${size}&sort=${sort}&filter=${type}&userId=${Cookies.get('userId')}`1991 },1992 { crossdomain: true }1993 )1994 },1995 getListUserAddMemberOnTenant(search, page, size, sort, type, tenantId) {1996 return client.request(1997 {1998 method: "get",1999 url: `${config.api.baseURL}/mTenant/addMember/${tenantId}?search=${search}&page=${page}&size=${size}&sort=${sort}&filter=${type}&userId=${Cookies.get('userId')}`2000 },2001 { crossdomain: true }2002 )2003 },2004 updateMemberOnTenant(data) {2005 return client.request(2006 {2007 method: "post",2008 url: `${config.api.baseURL}/mTenant/addMember`,2009 data2010 },2011 { crossdomain: true }2012 )2013 },2014 getJobTenant(params) {2015 return client.request(2016 {2017 method: "get",2018 url: `${config.api.baseURL}/job_repo/getJobTenant?tenantId=${params.tenantId}&search=${params.search}`2019 },2020 { crossdomain: true }2021 )2022 },2023};...

Full Screen

Full Screen

rest.ts

Source:rest.ts Github

copy

Full Screen

1/* eslint-disable */2/* tslint:disable */3/*4 * ---------------------------------------------------------------5 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##6 * ## ##7 * ## AUTHOR: acacode ##8 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##9 * ---------------------------------------------------------------10 */11export interface CrossdomainCooperationNetworkFeatures {12 /** @format uint64 */13 depth?: string;14 /** @format uint64 */15 cost?: string;16 interestList?: string[];17 locationList?: string[];18 lastUpdate?: string;19 creator?: string;20}21export interface CrossdomainDecisionPolicy {22 /** @format uint64 */23 depth?: string;24 /** @format uint64 */25 cost?: string;26 location?: string;27 interest?: string;28 validity?: CrossdomainValidity;29 lastUpdate?: string;30 creator?: string;31}32export interface CrossdomainForwardPolicy {33 mode?: string;34 domainList?: string[];35 locationList?: string[];36 creator?: string;37}38export interface CrossdomainLocalDomain {39 name?: string;40 domainType?: string;41 location?: string;42 creator?: string;43}44export interface CrossdomainLocalDomainCertificate {45 value?: string;46 creator?: string;47}48export type CrossdomainMsgConfigureLocalDomainResponse = object;49export type CrossdomainMsgCreateCooperationNetworkFeaturesResponse = object;50export type CrossdomainMsgCreateDecisionPolicyResponse = object;51export type CrossdomainMsgCreateForwardPolicyResponse = object;52export type CrossdomainMsgCreateLocalDomainCertificateResponse = object;53export type CrossdomainMsgCreateLocalDomainResponse = object;54export type CrossdomainMsgCreatePrivateKeyResponse = object;55export type CrossdomainMsgCreateRootCertificateResponse = object;56export interface CrossdomainMsgCreateValidityResponse {57 /** @format uint64 */58 id?: string;59}60export type CrossdomainMsgDeleteCooperationNetworkFeaturesResponse = object;61export type CrossdomainMsgDeleteDecisionPolicyResponse = object;62export type CrossdomainMsgDeleteForwardPolicyResponse = object;63export type CrossdomainMsgDeleteLocalDomainCertificateResponse = object;64export type CrossdomainMsgDeleteLocalDomainResponse = object;65export type CrossdomainMsgDeletePrivateKeyResponse = object;66export type CrossdomainMsgDeleteRootCertificateResponse = object;67export type CrossdomainMsgDeleteValidityResponse = object;68export type CrossdomainMsgUpdateCooperationNetworkFeaturesResponse = object;69export type CrossdomainMsgUpdateDecisionPolicyResponse = object;70export type CrossdomainMsgUpdateForwardPolicyResponse = object;71export type CrossdomainMsgUpdateLocalDomainCertificateResponse = object;72export type CrossdomainMsgUpdateLocalDomainResponse = object;73export type CrossdomainMsgUpdatePrivateKeyResponse = object;74export type CrossdomainMsgUpdateRootCertificateResponse = object;75export type CrossdomainMsgUpdateValidityResponse = object;76/**77 * Params defines the parameters for the module.78 */79export type CrossdomainParams = object;80export interface CrossdomainPrivateKey {81 value?: string;82 creator?: string;83}84export interface CrossdomainQueryAllValidityResponse {85 Validity?: CrossdomainValidity[];86 /**87 * PageResponse is to be embedded in gRPC response messages where the88 * corresponding request message has used PageRequest.89 *90 * message SomeResponse {91 * repeated Bar results = 1;92 * PageResponse page = 2;93 * }94 */95 pagination?: V1Beta1PageResponse;96}97export interface CrossdomainQueryGetCooperationNetworkFeaturesResponse {98 CooperationNetworkFeatures?: CrossdomainCooperationNetworkFeatures;99}100export interface CrossdomainQueryGetDecisionPolicyResponse {101 DecisionPolicy?: CrossdomainDecisionPolicy;102}103export interface CrossdomainQueryGetForwardPolicyResponse {104 ForwardPolicy?: CrossdomainForwardPolicy;105}106export interface CrossdomainQueryGetLocalDomainCertificateResponse {107 LocalDomainCertificate?: CrossdomainLocalDomainCertificate;108}109export interface CrossdomainQueryGetLocalDomainResponse {110 LocalDomain?: CrossdomainLocalDomain;111}112export interface CrossdomainQueryGetPrivateKeyResponse {113 PrivateKey?: CrossdomainPrivateKey;114}115export interface CrossdomainQueryGetRootCertificateResponse {116 RootCertificate?: CrossdomainRootCertificate;117}118export interface CrossdomainQueryGetValidityResponse {119 Validity?: CrossdomainValidity;120}121/**122 * QueryParamsResponse is response type for the Query/Params RPC method.123 */124export interface CrossdomainQueryParamsResponse {125 /** params holds all the parameters of this module. */126 params?: CrossdomainParams;127}128export interface CrossdomainRootCertificate {129 value?: string;130 creator?: string;131}132export interface CrossdomainValidity {133 /** @format uint64 */134 id?: string;135 notBefore?: string;136 notAfter?: string;137 creator?: string;138}139export interface ProtobufAny {140 "@type"?: string;141}142export interface RpcStatus {143 /** @format int32 */144 code?: number;145 message?: string;146 details?: ProtobufAny[];147}148/**149* message SomeRequest {150 Foo some_parameter = 1;151 PageRequest pagination = 2;152 }153*/154export interface V1Beta1PageRequest {155 /**156 * key is a value returned in PageResponse.next_key to begin157 * querying the next page most efficiently. Only one of offset or key158 * should be set.159 * @format byte160 */161 key?: string;162 /**163 * offset is a numeric offset that can be used when key is unavailable.164 * It is less efficient than using key. Only one of offset or key should165 * be set.166 * @format uint64167 */168 offset?: string;169 /**170 * limit is the total number of results to be returned in the result page.171 * If left empty it will default to a value to be set by each app.172 * @format uint64173 */174 limit?: string;175 /**176 * count_total is set to true to indicate that the result set should include177 * a count of the total number of items available for pagination in UIs.178 * count_total is only respected when offset is used. It is ignored when key179 * is set.180 */181 count_total?: boolean;182 /**183 * reverse is set to true if results are to be returned in the descending order.184 *185 * Since: cosmos-sdk 0.43186 */187 reverse?: boolean;188}189/**190* PageResponse is to be embedded in gRPC response messages where the191corresponding request message has used PageRequest.192 message SomeResponse {193 repeated Bar results = 1;194 PageResponse page = 2;195 }196*/197export interface V1Beta1PageResponse {198 /** @format byte */199 next_key?: string;200 /** @format uint64 */201 total?: string;202}203export type QueryParamsType = Record<string | number, any>;204export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;205export interface FullRequestParams extends Omit<RequestInit, "body"> {206 /** set parameter to `true` for call `securityWorker` for this request */207 secure?: boolean;208 /** request path */209 path: string;210 /** content type of request body */211 type?: ContentType;212 /** query params */213 query?: QueryParamsType;214 /** format of response (i.e. response.json() -> format: "json") */215 format?: keyof Omit<Body, "body" | "bodyUsed">;216 /** request body */217 body?: unknown;218 /** base url */219 baseUrl?: string;220 /** request cancellation token */221 cancelToken?: CancelToken;222}223export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;224export interface ApiConfig<SecurityDataType = unknown> {225 baseUrl?: string;226 baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;227 securityWorker?: (securityData: SecurityDataType) => RequestParams | void;228}229export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {230 data: D;231 error: E;232}233type CancelToken = Symbol | string | number;234export enum ContentType {235 Json = "application/json",236 FormData = "multipart/form-data",237 UrlEncoded = "application/x-www-form-urlencoded",238}239export class HttpClient<SecurityDataType = unknown> {240 public baseUrl: string = "";241 private securityData: SecurityDataType = null as any;242 private securityWorker: null | ApiConfig<SecurityDataType>["securityWorker"] = null;243 private abortControllers = new Map<CancelToken, AbortController>();244 private baseApiParams: RequestParams = {245 credentials: "same-origin",246 headers: {},247 redirect: "follow",248 referrerPolicy: "no-referrer",249 };250 constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {251 Object.assign(this, apiConfig);252 }253 public setSecurityData = (data: SecurityDataType) => {254 this.securityData = data;255 };256 private addQueryParam(query: QueryParamsType, key: string) {257 const value = query[key];258 return (259 encodeURIComponent(key) +260 "=" +261 encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`)262 );263 }264 protected toQueryString(rawQuery?: QueryParamsType): string {265 const query = rawQuery || {};266 const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]);267 return keys268 .map((key) =>269 typeof query[key] === "object" && !Array.isArray(query[key])270 ? this.toQueryString(query[key] as QueryParamsType)271 : this.addQueryParam(query, key),272 )273 .join("&");274 }275 protected addQueryParams(rawQuery?: QueryParamsType): string {276 const queryString = this.toQueryString(rawQuery);277 return queryString ? `?${queryString}` : "";278 }279 private contentFormatters: Record<ContentType, (input: any) => any> = {280 [ContentType.Json]: (input: any) =>281 input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,282 [ContentType.FormData]: (input: any) =>283 Object.keys(input || {}).reduce((data, key) => {284 data.append(key, input[key]);285 return data;286 }, new FormData()),287 [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),288 };289 private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams {290 return {291 ...this.baseApiParams,292 ...params1,293 ...(params2 || {}),294 headers: {295 ...(this.baseApiParams.headers || {}),296 ...(params1.headers || {}),297 ...((params2 && params2.headers) || {}),298 },299 };300 }301 private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => {302 if (this.abortControllers.has(cancelToken)) {303 const abortController = this.abortControllers.get(cancelToken);304 if (abortController) {305 return abortController.signal;306 }307 return void 0;308 }309 const abortController = new AbortController();310 this.abortControllers.set(cancelToken, abortController);311 return abortController.signal;312 };313 public abortRequest = (cancelToken: CancelToken) => {314 const abortController = this.abortControllers.get(cancelToken);315 if (abortController) {316 abortController.abort();317 this.abortControllers.delete(cancelToken);318 }319 };320 public request = <T = any, E = any>({321 body,322 secure,323 path,324 type,325 query,326 format = "json",327 baseUrl,328 cancelToken,329 ...params330 }: FullRequestParams): Promise<HttpResponse<T, E>> => {331 const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {};332 const requestParams = this.mergeRequestParams(params, secureParams);333 const queryString = query && this.toQueryString(query);334 const payloadFormatter = this.contentFormatters[type || ContentType.Json];335 return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {336 ...requestParams,337 headers: {338 ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),339 ...(requestParams.headers || {}),340 },341 signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,342 body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),343 }).then(async (response) => {344 const r = response as HttpResponse<T, E>;345 r.data = (null as unknown) as T;346 r.error = (null as unknown) as E;347 const data = await response[format]()348 .then((data) => {349 if (r.ok) {350 r.data = data;351 } else {352 r.error = data;353 }354 return r;355 })356 .catch((e) => {357 r.error = e;358 return r;359 });360 if (cancelToken) {361 this.abortControllers.delete(cancelToken);362 }363 if (!response.ok) throw data;364 return data;365 });366 };367}368/**369 * @title crossdomain/cooperation_network_features.proto370 * @version version not set371 */372export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {373 /**374 * No description375 *376 * @tags Query377 * @name QueryCooperationNetworkFeatures378 * @summary Queries a CooperationNetworkFeatures by index.379 * @request GET:/crossdomain/crossdomain/cooperation_network_features380 */381 queryCooperationNetworkFeatures = (params: RequestParams = {}) =>382 this.request<CrossdomainQueryGetCooperationNetworkFeaturesResponse, RpcStatus>({383 path: `/crossdomain/crossdomain/cooperation_network_features`,384 method: "GET",385 format: "json",386 ...params,387 });388 /**389 * No description390 *391 * @tags Query392 * @name QueryDecisionPolicy393 * @summary Queries a DecisionPolicy by index.394 * @request GET:/crossdomain/crossdomain/decision_policy395 */396 queryDecisionPolicy = (params: RequestParams = {}) =>397 this.request<CrossdomainQueryGetDecisionPolicyResponse, RpcStatus>({398 path: `/crossdomain/crossdomain/decision_policy`,399 method: "GET",400 format: "json",401 ...params,402 });403 /**404 * No description405 *406 * @tags Query407 * @name QueryForwardPolicy408 * @summary Queries a ForwardPolicy by index.409 * @request GET:/crossdomain/crossdomain/forward_policy410 */411 queryForwardPolicy = (params: RequestParams = {}) =>412 this.request<CrossdomainQueryGetForwardPolicyResponse, RpcStatus>({413 path: `/crossdomain/crossdomain/forward_policy`,414 method: "GET",415 format: "json",416 ...params,417 });418 /**419 * No description420 *421 * @tags Query422 * @name QueryLocalDomain423 * @summary Queries a LocalDomain by index.424 * @request GET:/crossdomain/crossdomain/local_domain425 */426 queryLocalDomain = (params: RequestParams = {}) =>427 this.request<CrossdomainQueryGetLocalDomainResponse, RpcStatus>({428 path: `/crossdomain/crossdomain/local_domain`,429 method: "GET",430 format: "json",431 ...params,432 });433 /**434 * No description435 *436 * @tags Query437 * @name QueryLocalDomainCertificate438 * @summary Queries a LocalDomainCertificate by index.439 * @request GET:/crossdomain/crossdomain/local_domain_certificate440 */441 queryLocalDomainCertificate = (params: RequestParams = {}) =>442 this.request<CrossdomainQueryGetLocalDomainCertificateResponse, RpcStatus>({443 path: `/crossdomain/crossdomain/local_domain_certificate`,444 method: "GET",445 format: "json",446 ...params,447 });448 /**449 * No description450 *451 * @tags Query452 * @name QueryParams453 * @summary Parameters queries the parameters of the module.454 * @request GET:/crossdomain/crossdomain/params455 */456 queryParams = (params: RequestParams = {}) =>457 this.request<CrossdomainQueryParamsResponse, RpcStatus>({458 path: `/crossdomain/crossdomain/params`,459 method: "GET",460 format: "json",461 ...params,462 });463 /**464 * No description465 *466 * @tags Query467 * @name QueryPrivateKey468 * @summary Queries a PrivateKey by index.469 * @request GET:/crossdomain/crossdomain/private_key470 */471 queryPrivateKey = (params: RequestParams = {}) =>472 this.request<CrossdomainQueryGetPrivateKeyResponse, RpcStatus>({473 path: `/crossdomain/crossdomain/private_key`,474 method: "GET",475 format: "json",476 ...params,477 });478 /**479 * No description480 *481 * @tags Query482 * @name QueryRootCertificate483 * @summary Queries a RootCertificate by index.484 * @request GET:/crossdomain/crossdomain/root_certificate485 */486 queryRootCertificate = (params: RequestParams = {}) =>487 this.request<CrossdomainQueryGetRootCertificateResponse, RpcStatus>({488 path: `/crossdomain/crossdomain/root_certificate`,489 method: "GET",490 format: "json",491 ...params,492 });493 /**494 * No description495 *496 * @tags Query497 * @name QueryValidityAll498 * @summary Queries a list of Validity items.499 * @request GET:/crossdomain/crossdomain/validity500 */501 queryValidityAll = (502 query?: {503 "pagination.key"?: string;504 "pagination.offset"?: string;505 "pagination.limit"?: string;506 "pagination.count_total"?: boolean;507 "pagination.reverse"?: boolean;508 },509 params: RequestParams = {},510 ) =>511 this.request<CrossdomainQueryAllValidityResponse, RpcStatus>({512 path: `/crossdomain/crossdomain/validity`,513 method: "GET",514 query: query,515 format: "json",516 ...params,517 });518 /**519 * No description520 *521 * @tags Query522 * @name QueryValidity523 * @summary Queries a Validity by id.524 * @request GET:/crossdomain/crossdomain/validity/{id}525 */526 queryValidity = (id: string, params: RequestParams = {}) =>527 this.request<CrossdomainQueryGetValidityResponse, RpcStatus>({528 path: `/crossdomain/crossdomain/validity/${id}`,529 method: "GET",530 format: "json",531 ...params,532 });...

Full Screen

Full Screen

index.ts

Source:index.ts Github

copy

Full Screen

1// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY.2import { StdFee } from "@cosmjs/launchpad";3import { SigningStargateClient } from "@cosmjs/stargate";4import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";5import { Api } from "./rest";6import { MsgCreateLocalDomainCertificate } from "./types/crossdomain/tx";7import { MsgUpdatePrivateKey } from "./types/crossdomain/tx";8import { MsgCreateRootCertificate } from "./types/crossdomain/tx";9import { MsgCreateCooperationNetworkFeatures } from "./types/crossdomain/tx";10import { MsgDeleteLocalDomainCertificate } from "./types/crossdomain/tx";11import { MsgCreateLocalDomain } from "./types/crossdomain/tx";12import { MsgDeleteCooperationNetworkFeatures } from "./types/crossdomain/tx";13import { MsgDeleteLocalDomain } from "./types/crossdomain/tx";14import { MsgDeleteForwardPolicy } from "./types/crossdomain/tx";15import { MsgCreateDecisionPolicy } from "./types/crossdomain/tx";16import { MsgCreateForwardPolicy } from "./types/crossdomain/tx";17import { MsgUpdateForwardPolicy } from "./types/crossdomain/tx";18import { MsgDeleteDecisionPolicy } from "./types/crossdomain/tx";19import { MsgDeleteRootCertificate } from "./types/crossdomain/tx";20import { MsgUpdateLocalDomain } from "./types/crossdomain/tx";21import { MsgConfigureLocalDomain } from "./types/crossdomain/tx";22import { MsgDeleteValidity } from "./types/crossdomain/tx";23import { MsgUpdateCooperationNetworkFeatures } from "./types/crossdomain/tx";24import { MsgDeletePrivateKey } from "./types/crossdomain/tx";25import { MsgUpdateRootCertificate } from "./types/crossdomain/tx";26import { MsgUpdateValidity } from "./types/crossdomain/tx";27import { MsgUpdateDecisionPolicy } from "./types/crossdomain/tx";28import { MsgUpdateLocalDomainCertificate } from "./types/crossdomain/tx";29import { MsgCreatePrivateKey } from "./types/crossdomain/tx";30import { MsgCreateValidity } from "./types/crossdomain/tx";31const types = [32 ["/crossdomain.crossdomain.MsgCreateLocalDomainCertificate", MsgCreateLocalDomainCertificate],33 ["/crossdomain.crossdomain.MsgUpdatePrivateKey", MsgUpdatePrivateKey],34 ["/crossdomain.crossdomain.MsgCreateRootCertificate", MsgCreateRootCertificate],35 ["/crossdomain.crossdomain.MsgCreateCooperationNetworkFeatures", MsgCreateCooperationNetworkFeatures],36 ["/crossdomain.crossdomain.MsgDeleteLocalDomainCertificate", MsgDeleteLocalDomainCertificate],37 ["/crossdomain.crossdomain.MsgCreateLocalDomain", MsgCreateLocalDomain],38 ["/crossdomain.crossdomain.MsgDeleteCooperationNetworkFeatures", MsgDeleteCooperationNetworkFeatures],39 ["/crossdomain.crossdomain.MsgDeleteLocalDomain", MsgDeleteLocalDomain],40 ["/crossdomain.crossdomain.MsgDeleteForwardPolicy", MsgDeleteForwardPolicy],41 ["/crossdomain.crossdomain.MsgCreateDecisionPolicy", MsgCreateDecisionPolicy],42 ["/crossdomain.crossdomain.MsgCreateForwardPolicy", MsgCreateForwardPolicy],43 ["/crossdomain.crossdomain.MsgUpdateForwardPolicy", MsgUpdateForwardPolicy],44 ["/crossdomain.crossdomain.MsgDeleteDecisionPolicy", MsgDeleteDecisionPolicy],45 ["/crossdomain.crossdomain.MsgDeleteRootCertificate", MsgDeleteRootCertificate],46 ["/crossdomain.crossdomain.MsgUpdateLocalDomain", MsgUpdateLocalDomain],47 ["/crossdomain.crossdomain.MsgConfigureLocalDomain", MsgConfigureLocalDomain],48 ["/crossdomain.crossdomain.MsgDeleteValidity", MsgDeleteValidity],49 ["/crossdomain.crossdomain.MsgUpdateCooperationNetworkFeatures", MsgUpdateCooperationNetworkFeatures],50 ["/crossdomain.crossdomain.MsgDeletePrivateKey", MsgDeletePrivateKey],51 ["/crossdomain.crossdomain.MsgUpdateRootCertificate", MsgUpdateRootCertificate],52 ["/crossdomain.crossdomain.MsgUpdateValidity", MsgUpdateValidity],53 ["/crossdomain.crossdomain.MsgUpdateDecisionPolicy", MsgUpdateDecisionPolicy],54 ["/crossdomain.crossdomain.MsgUpdateLocalDomainCertificate", MsgUpdateLocalDomainCertificate],55 ["/crossdomain.crossdomain.MsgCreatePrivateKey", MsgCreatePrivateKey],56 ["/crossdomain.crossdomain.MsgCreateValidity", MsgCreateValidity],57 58];59export const MissingWalletError = new Error("wallet is required");60export const registry = new Registry(<any>types);61const defaultFee = {62 amount: [],63 gas: "200000",64};65interface TxClientOptions {66 addr: string67}68interface SignAndBroadcastOptions {69 fee: StdFee,70 memo?: string71}72const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => {73 if (!wallet) throw MissingWalletError;74 let client;75 if (addr) {76 client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry });77 }else{78 client = await SigningStargateClient.offline( wallet, { registry });79 }80 const { address } = (await wallet.getAccounts())[0];81 return {82 signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo),83 msgCreateLocalDomainCertificate: (data: MsgCreateLocalDomainCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateLocalDomainCertificate", value: MsgCreateLocalDomainCertificate.fromPartial( data ) }),84 msgUpdatePrivateKey: (data: MsgUpdatePrivateKey): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdatePrivateKey", value: MsgUpdatePrivateKey.fromPartial( data ) }),85 msgCreateRootCertificate: (data: MsgCreateRootCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateRootCertificate", value: MsgCreateRootCertificate.fromPartial( data ) }),86 msgCreateCooperationNetworkFeatures: (data: MsgCreateCooperationNetworkFeatures): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateCooperationNetworkFeatures", value: MsgCreateCooperationNetworkFeatures.fromPartial( data ) }),87 msgDeleteLocalDomainCertificate: (data: MsgDeleteLocalDomainCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteLocalDomainCertificate", value: MsgDeleteLocalDomainCertificate.fromPartial( data ) }),88 msgCreateLocalDomain: (data: MsgCreateLocalDomain): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateLocalDomain", value: MsgCreateLocalDomain.fromPartial( data ) }),89 msgDeleteCooperationNetworkFeatures: (data: MsgDeleteCooperationNetworkFeatures): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteCooperationNetworkFeatures", value: MsgDeleteCooperationNetworkFeatures.fromPartial( data ) }),90 msgDeleteLocalDomain: (data: MsgDeleteLocalDomain): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteLocalDomain", value: MsgDeleteLocalDomain.fromPartial( data ) }),91 msgDeleteForwardPolicy: (data: MsgDeleteForwardPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteForwardPolicy", value: MsgDeleteForwardPolicy.fromPartial( data ) }),92 msgCreateDecisionPolicy: (data: MsgCreateDecisionPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateDecisionPolicy", value: MsgCreateDecisionPolicy.fromPartial( data ) }),93 msgCreateForwardPolicy: (data: MsgCreateForwardPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateForwardPolicy", value: MsgCreateForwardPolicy.fromPartial( data ) }),94 msgUpdateForwardPolicy: (data: MsgUpdateForwardPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateForwardPolicy", value: MsgUpdateForwardPolicy.fromPartial( data ) }),95 msgDeleteDecisionPolicy: (data: MsgDeleteDecisionPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteDecisionPolicy", value: MsgDeleteDecisionPolicy.fromPartial( data ) }),96 msgDeleteRootCertificate: (data: MsgDeleteRootCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteRootCertificate", value: MsgDeleteRootCertificate.fromPartial( data ) }),97 msgUpdateLocalDomain: (data: MsgUpdateLocalDomain): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateLocalDomain", value: MsgUpdateLocalDomain.fromPartial( data ) }),98 msgConfigureLocalDomain: (data: MsgConfigureLocalDomain): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgConfigureLocalDomain", value: MsgConfigureLocalDomain.fromPartial( data ) }),99 msgDeleteValidity: (data: MsgDeleteValidity): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeleteValidity", value: MsgDeleteValidity.fromPartial( data ) }),100 msgUpdateCooperationNetworkFeatures: (data: MsgUpdateCooperationNetworkFeatures): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateCooperationNetworkFeatures", value: MsgUpdateCooperationNetworkFeatures.fromPartial( data ) }),101 msgDeletePrivateKey: (data: MsgDeletePrivateKey): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgDeletePrivateKey", value: MsgDeletePrivateKey.fromPartial( data ) }),102 msgUpdateRootCertificate: (data: MsgUpdateRootCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateRootCertificate", value: MsgUpdateRootCertificate.fromPartial( data ) }),103 msgUpdateValidity: (data: MsgUpdateValidity): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateValidity", value: MsgUpdateValidity.fromPartial( data ) }),104 msgUpdateDecisionPolicy: (data: MsgUpdateDecisionPolicy): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateDecisionPolicy", value: MsgUpdateDecisionPolicy.fromPartial( data ) }),105 msgUpdateLocalDomainCertificate: (data: MsgUpdateLocalDomainCertificate): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgUpdateLocalDomainCertificate", value: MsgUpdateLocalDomainCertificate.fromPartial( data ) }),106 msgCreatePrivateKey: (data: MsgCreatePrivateKey): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreatePrivateKey", value: MsgCreatePrivateKey.fromPartial( data ) }),107 msgCreateValidity: (data: MsgCreateValidity): EncodeObject => ({ typeUrl: "/crossdomain.crossdomain.MsgCreateValidity", value: MsgCreateValidity.fromPartial( data ) }),108 109 };110};111interface QueryClientOptions {112 addr: string113}114const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {115 return new Api({ baseUrl: addr });116};117export {118 txClient,119 queryClient,...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var options = {3};4var wiki = new wptools.page('Albert_Einstein', options);5wiki.get(function(err, data) {6 console.log(data);7});8var wptools = require('wptools');9var options = {10};11var wiki = new wptools.page('Albert_Einstein', options);12wiki.get(function(err, data) {13 console.log(data);14});15var wptools = require('wptools');16var wiki = new wptools.page('Albert_Einstein');17wiki.get(function(err, data) {18 console.log(data);19});20var wptools = require('wptools');21var wiki = new wptools.page('Albert_Einstein');22wiki.get(function(err, data) {23 console.log(data);24});25var wptools = require('wptools');26var wiki = new wptools.page('Albert_Einstein');27wiki.get(function(err, data) {28 console.log(data);29});30var wptools = require('wptools');31var wiki = new wptools.page('Albert_Einstein');32wiki.get(function(err, data) {33 console.log(data);34});35var wptools = require('wptools');36var wiki = new wptools.page('Albert_Einstein');37wiki.get(function(err, data) {38 console.log(data);39});40var wptools = require('wptools');41var wiki = new wptools.page('Albert_Einstein');42wiki.get(function(err, data) {43 console.log(data);44});45var wptools = require('wptools');46var wiki = new wptools.page('Albert_Einstein');47wiki.get(function(err, data) {48 console.log(data);49});50var wptools = require('wptools');51var wiki = new wptools.page('Albert_Einstein');52wiki.get(function(err, data) {53 console.log(data);54});55var wptools = require('wptools');56var wiki = new wptools.page('Albert_Einstein');57wiki.get(function(err,

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var api = new wpt('www.webpagetest.org');3 if (err) {4 return console.error(err);5 }6 console.log('Test started: ' + data.data.testId);7 console.log('View your test at: ' + data.data.userUrl);8});9var wpt = require('webpagetest');10var api = new wpt('www.webpagetest.org');11 if (err) {12 return console.error(err);13 }14 console.log('Test started: ' + data.data.testId);15 console.log('View your test at: ' + data.data.userUrl);16});17var wpt = require('webpagetest');18var api = new wpt('www.webpagetest.org');19 if (err) {20 return console.error(err);21 }22 console.log('Test started: ' + data.data.testId);23 console.log('View your test at: ' + data.data.userUrl);24});25var wpt = require('webpagetest');26var api = new wpt('www.webpagetest.org');27 if (err) {28 return console.error(err);29 }30 console.log('Test started: ' + data.data.testId);31 console.log('View your test at

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2 if (err) {3 console.log(err);4 } else {5 console.log(resp);6 }7});8var wptools = require('wptools');9 if (err) {10 console.log(err);11 } else {12 console.log(resp);13 }14});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('localhost', 'A.2e2c8e8e0f1a0c1f1d9e8c8a9b9a3d3f');3var runTest = function() {4 wpt.runTest(url, {5 }, function(err, data) {6 if (err) {7 console.log('Error: ' + err);8 } else {9 console.log('Test Submitted');10 var results = data.data;11 console.log('Test ID: ' + results.testId);12 console.log('Test URL: ' + results.summary);13 console.log('View Test: ' + results.userUrl);14 }15 });16}17runTest();

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful