Skip to content
Snippets Groups Projects
onDeleteAccount.js 7.54 MiB
Newer Older
  • Learn to ignore specific revisions
  • Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    223001 223002 223003 223004 223005 223006 223007 223008 223009 223010 223011 223012 223013 223014 223015 223016 223017 223018 223019 223020 223021 223022 223023 223024 223025 223026 223027 223028 223029 223030 223031 223032 223033 223034 223035 223036 223037 223038 223039 223040 223041 223042 223043 223044 223045 223046 223047 223048 223049 223050 223051 223052 223053 223054 223055 223056 223057 223058 223059 223060 223061 223062 223063 223064 223065 223066 223067 223068 223069 223070 223071 223072 223073 223074 223075 223076 223077 223078 223079 223080 223081 223082 223083 223084 223085 223086 223087 223088 223089 223090 223091 223092 223093 223094 223095 223096 223097 223098 223099 223100 223101 223102 223103 223104 223105 223106 223107 223108 223109 223110 223111 223112 223113 223114 223115 223116 223117 223118 223119 223120 223121 223122 223123 223124 223125 223126 223127 223128 223129 223130 223131 223132 223133 223134 223135 223136 223137 223138 223139 223140 223141 223142 223143 223144 223145 223146 223147 223148 223149 223150 223151 223152 223153 223154 223155 223156 223157 223158 223159 223160 223161 223162 223163 223164 223165 223166 223167 223168 223169 223170 223171 223172 223173 223174 223175 223176 223177 223178 223179 223180 223181 223182 223183 223184 223185 223186 223187 223188 223189 223190 223191 223192 223193 223194 223195 223196 223197 223198 223199 223200 223201 223202 223203 223204 223205 223206 223207 223208 223209 223210 223211 223212 223213 223214 223215 223216 223217 223218 223219 223220 223221 223222 223223 223224 223225 223226 223227 223228 223229 223230 223231 223232 223233 223234 223235 223236 223237 223238 223239 223240 223241 223242 223243 223244 223245 223246 223247 223248 223249 223250 223251 223252 223253 223254 223255 223256 223257 223258 223259 223260 223261 223262 223263 223264 223265 223266 223267 223268 223269 223270 223271 223272 223273 223274 223275 223276 223277 223278 223279 223280 223281 223282 223283 223284 223285 223286 223287 223288 223289 223290 223291 223292 223293 223294 223295 223296 223297 223298 223299 223300
        'info',
        `Query consultationMesuresDetaillees - ${mesureType}/${unit} between ${startDate} and ${endDate}`
      )
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/services/consultationmesuresdetaillees/v2.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
         <soapenv:Header/>
         <soapenv:Body>
            <v2:consulterMesuresDetaillees>
               <demande>
                  <initiateurLogin>${appLogin}</initiateurLogin>
                  <pointId>${pointId}</pointId>
                  <mesuresTypeCode>${mesureType}</mesuresTypeCode>
                  <grandeurPhysique>${unit}</grandeurPhysique>
                  <soutirage>true</soutirage>
                  <injection>false</injection>
                  <dateDebut>${startDate}</dateDebut>
                  <dateFin>${endDate}</dateFin>
                  <mesuresCorrigees>false</mesuresCorrigees>
                  <accordClient>true</accordClient>
               </demande>
            </v2:consulterMesuresDetaillees>
         </soapenv:Body>
      </soapenv:Envelope>
      `
    }
    
    /**
     * Get user max power
     * @param {number} pointId
     * @param {string} appLogin
     * @param {string} startDate
     * @param {string} endDate
     * @param {'COURBE' | 'ENERGIE' | 'PMAX'} mesureType
     * @param {'EA' | 'PA' | 'PMA'} unit
     * @returns {string}
     */
    function consultationMesuresDetailleesMaxPower(
      pointId,
      appLogin,
      startDate,
      endDate,
      mesureType = 'PMAX',
      unit = 'PMA'
    ) {
      log(
        'info',
        `Query consultationMesuresDetaillees - ${mesureType}/${unit} between ${startDate} and ${endDate}`
      )
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/services/consultationmesuresdetaillees/v2.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
          <soapenv:Header/>
          <soapenv:Body>
              <v2:consulterMesuresDetaillees>
                  <demande>
                      <initiateurLogin>${appLogin}</initiateurLogin>
                      <pointId>${pointId}</pointId>
                      <mesuresTypeCode>${mesureType}</mesuresTypeCode>
                      <grandeurPhysique>${unit}</grandeurPhysique>
                      <soutirage>true</soutirage>
                      <injection>false</injection>
                      <dateDebut>${startDate}</dateDebut>
                      <dateFin>${endDate}</dateFin>
                      <mesuresPas>P1D</mesuresPas>
                      <mesuresCorrigees>false</mesuresCorrigees>
                      <accordClient>true</accordClient>
                  </demande>
              </v2:consulterMesuresDetaillees>
          </soapenv:Body>
      </soapenv:Envelope>
      `
    }
    
    /**
     * Get user technical data (contract start date)
     * @param {number} pointId
     * @param {string} appLogin
     * @returns {string}
     */
    function consulterDonneesTechniquesContractuelles(pointId, appLogin) {
      log('info', `Query consulterDonneesTechniquesContractuelles`)
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/services/consulterdonneestechniquescontractuelles/v1.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
         <soapenv:Header/>
         <soapenv:Body>
            <v2:consulterDonneesTechniquesContractuelles>
               <pointId>${pointId}</pointId>
               <loginUtilisateur>${appLogin}</loginUtilisateur>
               <autorisationClient>true</autorisationClient>
            </v2:consulterDonneesTechniquesContractuelles>
         </soapenv:Body>
      </soapenv:Envelope>
      `
    }
    
    /**
     * Use rechercherPoint to find user PDL if exist
     * @param {string} name
     * @param {string} postalCode
     * @param {string} inseeCode
     * @param {string} [address]
     * @returns {string} PDL
     */
    function rechercherPoint(appLogin, name, postalCode, inseeCode, address) {
      log(
        'info',
        `Query rechercherPoint - postal code / insee code: ${postalCode} / ${inseeCode}`
      )
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/services/rechercherpoint/v2.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
         <soapenv:Header/>
         <soapenv:Body>
            <v2:rechercherPoint>
               <criteres>
                  <adresseInstallation>
                     <numeroEtNomVoie>${address}</numeroEtNomVoie>
                     <codePostal>${postalCode}</codePostal>
                     <codeInseeCommune>${inseeCode}</codeInseeCommune>
                  </adresseInstallation>
                  <nomClientFinalOuDenominationSociale>${name}</nomClientFinalOuDenominationSociale>
                  <rechercheHorsPerimetre>true</rechercheHorsPerimetre>
               </criteres>
               <loginUtilisateur>${appLogin}</loginUtilisateur>
            </v2:rechercherPoint>
         </soapenv:Body>
      </soapenv:Envelope>`
    }
    
    /**
     * Search if user as a service
     * @param {string} appLogin
     * @param {string} contractId
     * @param {number} pointId
     * @returns {*}
     */
    function rechercherServicesSouscritsMesures(appLogin, contractId, pointId) {
      log('info', `Query rechercherServicesSouscritsMesures`)
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/rechercherservicessouscritsmesures/v1.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
          <soapenv:Header/>
          <soapenv:Body>
              <v2:rechercherServicesSouscritsMesures>
                <criteres>
                  <pointId>${pointId}</pointId>
                  <contratId>${contractId}</contratId>
                </criteres>
                <loginUtilisateur>${appLogin}</loginUtilisateur>
              </v2:rechercherServicesSouscritsMesures>
          </soapenv:Body>
      </soapenv:Envelope>`
    }
    
    /**
     * Activate half hour data collect for user
     * @param {string} appLogin
     * @param {string} contractId
     * @param {number} pointId
     * @param {string} name
     * @param {string} startDate
     * @param {string} endDate
     * @returns {*}
     */
    function commanderCollectePublicationMesures(
      appLogin,
      contractId,
      pointId,
      name,
      startDate,
      endDate
    ) {
      log(
        'info',
        `Query commanderCollectePublicationMesures - between ${startDate} and ${endDate}`
      )
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/commandercollectepublicationmesures/v3.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
          <soapenv:Header/>
          <soapenv:Body>
              <v2:commanderCollectePublicationMesures>
                  <demande>
                      <donneesGenerales>
                          <objetCode>AME</objetCode>
                          <pointId>${pointId}</pointId>
                          <initiateurLogin>${appLogin}</initiateurLogin>
                          <contratId>${contractId}</contratId>
                      </donneesGenerales>
                      <accesMesures>
                          <dateDebut>${startDate}</dateDebut>
                          <dateFin>${endDate}</dateFin>
                          <declarationAccordClient>
                              <accord>true</accord>
                              <personnePhysique>
                                  <nom>${name}</nom>
                              </personnePhysique>
                          </declarationAccordClient>
                          <mesuresTypeCode>CDC</mesuresTypeCode>
                          <soutirage>true</soutirage>
                          <injection>false</injection>
                          <mesuresPas>PT30M</mesuresPas>
                          <mesuresCorrigees>false</mesuresCorrigees>
                          <transmissionRecurrente>true</transmissionRecurrente>
                          <periodiciteTransmission>P1D</periodiciteTransmission>
                      </accesMesures>
                  </demande>
              </v2:commanderCollectePublicationMesures>
          </soapenv:Body>
      </soapenv:Envelope>`
    }
    
    /**
     * Stop the user consent
     * @param {string} appLogin
     * @param {string} contractId
     * @param {number} pointId
     * @param {number} serviceSouscritId
     * @returns {*}
     */
    function commanderArretServiceSouscritMesures(
      appLogin,
      contractId,
      pointId,
      serviceSouscritId
    ) {
      log(
        'info',
        `Query commanderArretServiceSouscritMesures - serviceSouscritId: ${serviceSouscritId}`
      )
      return `<?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:v2="http://www.enedis.fr/sge/b2b/commanderarretservicesouscritmesures/v1.0"
         xmlns:v1="http://www.enedis.fr/sge/b2b/technique/v1.0">
          <soapenv:Header/>
          <soapenv:Body>
              <v2:commanderArretServiceSouscritMesures>
                  <demande>
                      <donneesGenerales>
                          <objetCode>ASS</objetCode>
                          <pointId>${pointId}</pointId>
                          <initiateurLogin>${appLogin}</initiateurLogin>
                          <contratId>${contractId}</contratId>
                      </donneesGenerales>
                      <arretServiceSouscrit>
                      <serviceSouscritId>${serviceSouscritId}</serviceSouscritId>
                      </arretServiceSouscrit>
                  </demande>
              </v2:commanderArretServiceSouscritMesures>
          </soapenv:Body>
      </soapenv:Envelope>`
    }
    
    module.exports = {
      consulterDonneesTechniquesContractuelles,
      consultationMesuresDetailleesMaxPower,
      consultationMesuresDetaillees,
      rechercherPoint,
      rechercherServicesSouscritsMesures,
      commanderCollectePublicationMesures,
      commanderArretServiceSouscritMesures,
    }
    
    
    /***/ }),
    /* 1557 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    // @ts-check
    const { log, errors } = __webpack_require__(1)
    const { default: axios } = __webpack_require__(1558)
    
    /**
     * @param {number} pointID
     * @param {string} lastname
     * @param {string} firstname
     * @param {string} address
     * @param {string} postalCode
     * @param {string} inseeCode
     * @returns {Promise<Consent>}
     */
    async function createBoConsent(
      url,
      token,
      pointID,
      lastname,
      firstname,
      address,
      postalCode,
      inseeCode
    ) {
      log('info', `Query createBoConsent`)
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      const headers = {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      }
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      try {
        const { data } = await axios.post(
          `${url}/consent`,
          {
            pointID,
            lastname,
            firstname,
            address,
            postalCode,
            inseeCode,
          },
          headers
        )
        return data
      } catch (e) {
        log('error', `BO replied with ${e}`)
        throw errors.MAINTENANCE
      }
    }
    
    /**
     * @param {string} url
     * @param {string} token
     * @param {Consent} consent
     * @param {string} serviceId
     * @returns {Promise<Consent>}
     */
    async function updateBoConsent(url, token, consent, serviceId) {
      log('info', `Query updateBoConsent`)
      const headers = {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      }
    
      try {
    
        let consentId = ''
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        if (consent.ID) {
          consentId = consent.ID.toString()
        }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        const { data } = await axios.put(
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          `${url}/consent/${consentId}`,
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    223349 223350 223351 223352 223353 223354 223355 223356 223357 223358 223359 223360 223361 223362 223363 223364 223365 223366 223367 223368 223369 223370 223371 223372 223373 223374 223375 223376 223377 223378 223379 223380 223381 223382 223383 223384 223385 223386 223387 223388 223389 223390 223391 223392 223393 223394 223395 223396 223397 223398 223399 223400 223401 223402 223403 223404 223405 223406 223407 223408 223409 223410 223411 223412 223413 223414 223415 223416 223417 223418 223419 223420 223421 223422 223423 223424 223425 223426 223427 223428 223429 223430 223431 223432 223433 223434 223435 223436 223437 223438 223439 223440 223441 223442 223443 223444 223445 223446 223447 223448 223449 223450 223451 223452 223453 223454 223455 223456 223457 223458 223459 223460 223461 223462 223463 223464 223465 223466 223467 223468 223469 223470 223471 223472 223473 223474 223475 223476 223477 223478 223479 223480 223481 223482 223483 223484 223485 223486 223487 223488 223489 223490 223491 223492 223493 223494 223495 223496 223497 223498 223499 223500 223501 223502 223503 223504 223505 223506 223507 223508 223509 223510 223511 223512 223513 223514 223515 223516 223517 223518 223519 223520 223521 223522 223523 223524 223525 223526 223527 223528 223529 223530 223531 223532 223533 223534 223535 223536 223537 223538 223539 223540 223541 223542 223543 223544 223545 223546 223547 223548 223549 223550 223551 223552 223553 223554 223555 223556 223557 223558 223559 223560 223561 223562 223563 223564 223565 223566 223567 223568 223569 223570 223571 223572 223573 223574 223575 223576 223577 223578 223579 223580 223581 223582 223583 223584 223585 223586 223587 223588 223589 223590 223591 223592 223593 223594 223595 223596 223597 223598 223599 223600 223601 223602 223603 223604 223605 223606 223607 223608 223609 223610 223611 223612 223613 223614 223615 223616 223617 223618 223619 223620 223621 223622 223623 223624 223625 223626 223627 223628 223629 223630 223631 223632 223633 223634 223635 223636 223637 223638 223639 223640 223641 223642 223643 223644 223645 223646 223647 223648 223649 223650 223651 223652 223653 223654 223655 223656 223657 223658 223659 223660 223661 223662 223663 223664 223665 223666 223667 223668 223669 223670 223671 223672 223673 223674 223675 223676 223677 223678 223679 223680 223681 223682 223683 223684 223685 223686 223687 223688 223689 223690 223691 223692 223693 223694 223695 223696 223697 223698 223699 223700 223701 223702 223703 223704 223705 223706 223707 223708 223709 223710 223711 223712 223713 223714 223715 223716 223717 223718 223719 223720 223721 223722 223723 223724 223725 223726 223727 223728 223729 223730 223731 223732 223733 223734 223735 223736 223737 223738 223739 223740 223741 223742 223743 223744 223745 223746 223747 223748 223749 223750 223751 223752 223753 223754 223755 223756 223757 223758 223759 223760 223761 223762 223763 223764 223765 223766 223767 223768 223769 223770 223771 223772 223773 223774 223775 223776 223777 223778 223779 223780 223781 223782 223783 223784 223785 223786 223787 223788 223789 223790 223791 223792 223793 223794 223795 223796 223797 223798 223799 223800 223801 223802 223803 223804 223805 223806 223807 223808 223809 223810 223811 223812 223813 223814 223815 223816 223817 223818 223819 223820 223821 223822 223823 223824 223825 223826 223827 223828 223829 223830 223831 223832 223833 223834 223835 223836 223837 223838 223839 223840 223841 223842 223843 223844 223845 223846 223847 223848 223849 223850 223851 223852 223853 223854 223855 223856 223857 223858 223859 223860 223861 223862 223863 223864 223865 223866 223867 223868 223869 223870 223871 223872 223873 223874 223875 223876 223877 223878 223879 223880 223881 223882 223883 223884 223885 223886 223887 223888 223889 223890 223891 223892 223893 223894 223895 223896 223897 223898 223899 223900 223901 223902 223903 223904 223905 223906 223907 223908 223909 223910 223911 223912 223913 223914 223915 223916 223917 223918 223919 223920 223921 223922 223923 223924 223925 223926 223927 223928 223929 223930 223931 223932 223933 223934 223935 223936 223937 223938 223939 223940 223941 223942 223943 223944 223945 223946 223947 223948 223949 223950 223951 223952 223953 223954 223955 223956 223957 223958 223959 223960 223961 223962 223963 223964 223965 223966 223967 223968 223969 223970 223971 223972 223973 223974 223975 223976 223977 223978 223979 223980 223981 223982 223983 223984 223985 223986 223987 223988 223989 223990 223991 223992 223993 223994 223995 223996 223997 223998 223999 224000
          {
            ...consent,
            serviceId: parseInt(serviceId),
          },
          headers
        )
        return data
      } catch (e) {
        log('error', `BO replied with ${e}`)
        throw errors.MAINTENANCE
      }
    }
    
    /**
     * @param {number} boId
     * @returns {Promise<Consent>}
     */
    async function getBoConsent(url, token, boId) {
      log('info', `Query getBoConsent ${boId}`)
      const headers = {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      }
      try {
        const { data } = await axios.get(`${url}/consent/${boId}`, headers)
        return data
      } catch (e) {
        log('error', `BO replied with ${e}`)
        throw errors.MAINTENANCE
      }
    }
    
    /**
     * Delete BO consent
     * @param {string} url
     * @param {string} token
     * @param {number} boId
     * @returns
     */
    async function deleteBoConsent(url, token, boId) {
      log('info', `Query deleteBoConsent ${boId}`)
      const headers = {
        headers: {
          Authorization: `Bearer ${token}`,
        },
      }
      try {
        const { data } = await axios.delete(`${url}/consent/${boId}`, headers)
        return data
      } catch (e) {
        log('error', `BO replied with ${e}`)
        throw errors.MAINTENANCE
      }
    }
    
    module.exports = {
      createBoConsent,
      updateBoConsent,
      getBoConsent,
      deleteBoConsent,
    }
    
    
    /***/ }),
    /* 1558 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    module.exports = __webpack_require__(1559);
    
    /***/ }),
    /* 1559 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    "use strict";
    
    
    var utils = __webpack_require__(1560);
    var bind = __webpack_require__(1561);
    var Axios = __webpack_require__(1562);
    var mergeConfig = __webpack_require__(1590);
    var defaults = __webpack_require__(1567);
    
    /**
     * Create an instance of Axios
     *
     * @param {Object} defaultConfig The default config for the instance
     * @return {Axios} A new instance of Axios
     */
    function createInstance(defaultConfig) {
      var context = new Axios(defaultConfig);
      var instance = bind(Axios.prototype.request, context);
    
      // Copy axios.prototype to instance
      utils.extend(instance, Axios.prototype, context);
    
      // Copy context to instance
      utils.extend(instance, context);
    
      // Factory for creating new instances
      instance.create = function create(instanceConfig) {
        return createInstance(mergeConfig(defaultConfig, instanceConfig));
      };
    
      return instance;
    }
    
    // Create the default instance to be exported
    var axios = createInstance(defaults);
    
    // Expose Axios class to allow class inheritance
    axios.Axios = Axios;
    
    // Expose Cancel & CancelToken
    axios.CanceledError = __webpack_require__(1580);
    axios.CancelToken = __webpack_require__(1592);
    axios.isCancel = __webpack_require__(1589);
    axios.VERSION = (__webpack_require__(1585).version);
    axios.toFormData = __webpack_require__(1571);
    
    // Expose AxiosError class
    axios.AxiosError = __webpack_require__(1569);
    
    // alias for CanceledError for backward compatibility
    axios.Cancel = axios.CanceledError;
    
    // Expose all/spread
    axios.all = function all(promises) {
      return Promise.all(promises);
    };
    axios.spread = __webpack_require__(1593);
    
    // Expose isAxiosError
    axios.isAxiosError = __webpack_require__(1594);
    
    module.exports = axios;
    
    // Allow use of default import syntax in TypeScript
    module.exports["default"] = axios;
    
    
    /***/ }),
    /* 1560 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    "use strict";
    
    
    var bind = __webpack_require__(1561);
    
    // utils is a library of generic helper functions non-specific to axios
    
    var toString = Object.prototype.toString;
    
    // eslint-disable-next-line func-names
    var kindOf = (function(cache) {
      // eslint-disable-next-line func-names
      return function(thing) {
        var str = toString.call(thing);
        return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
      };
    })(Object.create(null));
    
    function kindOfTest(type) {
      type = type.toLowerCase();
      return function isKindOf(thing) {
        return kindOf(thing) === type;
      };
    }
    
    /**
     * Determine if a value is an Array
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an Array, otherwise false
     */
    function isArray(val) {
      return Array.isArray(val);
    }
    
    /**
     * Determine if a value is undefined
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if the value is undefined, otherwise false
     */
    function isUndefined(val) {
      return typeof val === 'undefined';
    }
    
    /**
     * Determine if a value is a Buffer
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Buffer, otherwise false
     */
    function isBuffer(val) {
      return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
        && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
    }
    
    /**
     * Determine if a value is an ArrayBuffer
     *
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an ArrayBuffer, otherwise false
     */
    var isArrayBuffer = kindOfTest('ArrayBuffer');
    
    
    /**
     * Determine if a value is a view on an ArrayBuffer
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
     */
    function isArrayBufferView(val) {
      var result;
      if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
        result = ArrayBuffer.isView(val);
      } else {
        result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
      }
      return result;
    }
    
    /**
     * Determine if a value is a String
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a String, otherwise false
     */
    function isString(val) {
      return typeof val === 'string';
    }
    
    /**
     * Determine if a value is a Number
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Number, otherwise false
     */
    function isNumber(val) {
      return typeof val === 'number';
    }
    
    /**
     * Determine if a value is an Object
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an Object, otherwise false
     */
    function isObject(val) {
      return val !== null && typeof val === 'object';
    }
    
    /**
     * Determine if a value is a plain Object
     *
     * @param {Object} val The value to test
     * @return {boolean} True if value is a plain Object, otherwise false
     */
    function isPlainObject(val) {
      if (kindOf(val) !== 'object') {
        return false;
      }
    
      var prototype = Object.getPrototypeOf(val);
      return prototype === null || prototype === Object.prototype;
    }
    
    /**
     * Determine if a value is a Date
     *
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Date, otherwise false
     */
    var isDate = kindOfTest('Date');
    
    /**
     * Determine if a value is a File
     *
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a File, otherwise false
     */
    var isFile = kindOfTest('File');
    
    /**
     * Determine if a value is a Blob
     *
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Blob, otherwise false
     */
    var isBlob = kindOfTest('Blob');
    
    /**
     * Determine if a value is a FileList
     *
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a File, otherwise false
     */
    var isFileList = kindOfTest('FileList');
    
    /**
     * Determine if a value is a Function
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Function, otherwise false
     */
    function isFunction(val) {
      return toString.call(val) === '[object Function]';
    }
    
    /**
     * Determine if a value is a Stream
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Stream, otherwise false
     */
    function isStream(val) {
      return isObject(val) && isFunction(val.pipe);
    }
    
    /**
     * Determine if a value is a FormData
     *
     * @param {Object} thing The value to test
     * @returns {boolean} True if value is an FormData, otherwise false
     */
    function isFormData(thing) {
      var pattern = '[object FormData]';
      return thing && (
        (typeof FormData === 'function' && thing instanceof FormData) ||
        toString.call(thing) === pattern ||
        (isFunction(thing.toString) && thing.toString() === pattern)
      );
    }
    
    /**
     * Determine if a value is a URLSearchParams object
     * @function
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a URLSearchParams object, otherwise false
     */
    var isURLSearchParams = kindOfTest('URLSearchParams');
    
    /**
     * Trim excess whitespace off the beginning and end of a string
     *
     * @param {String} str The String to trim
     * @returns {String} The String freed of excess whitespace
     */
    function trim(str) {
      return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
    }
    
    /**
     * Determine if we're running in a standard browser environment
     *
     * This allows axios to run in a web worker, and react-native.
     * Both environments support XMLHttpRequest, but not fully standard globals.
     *
     * web workers:
     *  typeof window -> undefined
     *  typeof document -> undefined
     *
     * react-native:
     *  navigator.product -> 'ReactNative'
     * nativescript
     *  navigator.product -> 'NativeScript' or 'NS'
     */
    function isStandardBrowserEnv() {
      if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
                                               navigator.product === 'NativeScript' ||
                                               navigator.product === 'NS')) {
        return false;
      }
      return (
        typeof window !== 'undefined' &&
        typeof document !== 'undefined'
      );
    }
    
    /**
     * Iterate over an Array or an Object invoking a function for each item.
     *
     * If `obj` is an Array callback will be called passing
     * the value, index, and complete array for each item.
     *
     * If 'obj' is an Object callback will be called passing
     * the value, key, and complete object for each property.
     *
     * @param {Object|Array} obj The object to iterate
     * @param {Function} fn The callback to invoke for each item
     */
    function forEach(obj, fn) {
      // Don't bother if no value provided
      if (obj === null || typeof obj === 'undefined') {
        return;
      }
    
      // Force an array if not already something iterable
      if (typeof obj !== 'object') {
        /*eslint no-param-reassign:0*/
        obj = [obj];
      }
    
      if (isArray(obj)) {
        // Iterate over array values
        for (var i = 0, l = obj.length; i < l; i++) {
          fn.call(null, obj[i], i, obj);
        }
      } else {
        // Iterate over object keys
        for (var key in obj) {
          if (Object.prototype.hasOwnProperty.call(obj, key)) {
            fn.call(null, obj[key], key, obj);
          }
        }
      }
    }
    
    /**
     * Accepts varargs expecting each argument to be an object, then
     * immutably merges the properties of each object and returns result.
     *
     * When multiple objects contain the same key the later object in
     * the arguments list will take precedence.
     *
     * Example:
     *
     * ```js
     * var result = merge({foo: 123}, {foo: 456});
     * console.log(result.foo); // outputs 456
     * ```
     *
     * @param {Object} obj1 Object to merge
     * @returns {Object} Result of all merge properties
     */
    function merge(/* obj1, obj2, obj3, ... */) {
      var result = {};
      function assignValue(val, key) {
        if (isPlainObject(result[key]) && isPlainObject(val)) {
          result[key] = merge(result[key], val);
        } else if (isPlainObject(val)) {
          result[key] = merge({}, val);
        } else if (isArray(val)) {
          result[key] = val.slice();
        } else {
          result[key] = val;
        }
      }
    
      for (var i = 0, l = arguments.length; i < l; i++) {
        forEach(arguments[i], assignValue);
      }
      return result;
    }
    
    /**
     * Extends object a by mutably adding to it the properties of object b.
     *
     * @param {Object} a The object to be extended
     * @param {Object} b The object to copy properties from
     * @param {Object} thisArg The object to bind function to
     * @return {Object} The resulting value of object a
     */
    function extend(a, b, thisArg) {
      forEach(b, function assignValue(val, key) {
        if (thisArg && typeof val === 'function') {
          a[key] = bind(val, thisArg);
        } else {
          a[key] = val;
        }
      });
      return a;
    }
    
    /**
     * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
     *
     * @param {string} content with BOM
     * @return {string} content value without BOM
     */
    function stripBOM(content) {
      if (content.charCodeAt(0) === 0xFEFF) {
        content = content.slice(1);
      }
      return content;
    }
    
    /**
     * Inherit the prototype methods from one constructor into another
     * @param {function} constructor
     * @param {function} superConstructor
     * @param {object} [props]
     * @param {object} [descriptors]
     */
    
    function inherits(constructor, superConstructor, props, descriptors) {
      constructor.prototype = Object.create(superConstructor.prototype, descriptors);
      constructor.prototype.constructor = constructor;
      props && Object.assign(constructor.prototype, props);
    }
    
    /**
     * Resolve object with deep prototype chain to a flat object
     * @param {Object} sourceObj source object
     * @param {Object} [destObj]
     * @param {Function} [filter]
     * @returns {Object}
     */
    
    function toFlatObject(sourceObj, destObj, filter) {
      var props;
      var i;
      var prop;
      var merged = {};
    
      destObj = destObj || {};
    
      do {
        props = Object.getOwnPropertyNames(sourceObj);
        i = props.length;
        while (i-- > 0) {
          prop = props[i];
          if (!merged[prop]) {
            destObj[prop] = sourceObj[prop];
            merged[prop] = true;
          }
        }
        sourceObj = Object.getPrototypeOf(sourceObj);
      } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
    
      return destObj;
    }
    
    /*
     * determines whether a string ends with the characters of a specified string
     * @param {String} str
     * @param {String} searchString
     * @param {Number} [position= 0]
     * @returns {boolean}
     */
    function endsWith(str, searchString, position) {
      str = String(str);
      if (position === undefined || position > str.length) {
        position = str.length;
      }
      position -= searchString.length;
      var lastIndex = str.indexOf(searchString, position);
      return lastIndex !== -1 && lastIndex === position;
    }
    
    
    /**
     * Returns new array from array like object
     * @param {*} [thing]
     * @returns {Array}
     */
    function toArray(thing) {
      if (!thing) return null;
      var i = thing.length;
      if (isUndefined(i)) return null;
      var arr = new Array(i);
      while (i-- > 0) {
        arr[i] = thing[i];
      }
      return arr;
    }
    
    // eslint-disable-next-line func-names
    var isTypedArray = (function(TypedArray) {
      // eslint-disable-next-line func-names
      return function(thing) {
        return TypedArray && thing instanceof TypedArray;
      };
    })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
    
    module.exports = {
      isArray: isArray,
      isArrayBuffer: isArrayBuffer,
      isBuffer: isBuffer,
      isFormData: isFormData,
      isArrayBufferView: isArrayBufferView,
      isString: isString,
      isNumber: isNumber,
      isObject: isObject,
      isPlainObject: isPlainObject,
      isUndefined: isUndefined,
      isDate: isDate,
      isFile: isFile,
      isBlob: isBlob,
      isFunction: isFunction,
      isStream: isStream,
      isURLSearchParams: isURLSearchParams,
      isStandardBrowserEnv: isStandardBrowserEnv,
      forEach: forEach,
      merge: merge,
      extend: extend,
      trim: trim,
      stripBOM: stripBOM,
      inherits: inherits,
      toFlatObject: toFlatObject,
      kindOf: kindOf,
      kindOfTest: kindOfTest,
      endsWith: endsWith,
      toArray: toArray,
      isTypedArray: isTypedArray,
      isFileList: isFileList
    };
    
    
    /***/ }),
    /* 1561 */
    /***/ ((module) => {
    
    "use strict";
    
    
    module.exports = function bind(fn, thisArg) {
      return function wrap() {
        var args = new Array(arguments.length);
        for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i];
        }
        return fn.apply(thisArg, args);
      };
    };
    
    
    /***/ }),
    /* 1562 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    "use strict";
    
    
    var utils = __webpack_require__(1560);
    var buildURL = __webpack_require__(1563);
    var InterceptorManager = __webpack_require__(1564);
    var dispatchRequest = __webpack_require__(1565);
    var mergeConfig = __webpack_require__(1590);
    var buildFullPath = __webpack_require__(1575);
    var validator = __webpack_require__(1591);
    
    var validators = validator.validators;