text: import axios from "axios";
  var formatBasicAuth = function(userName, password) {
    var basicAuthCredential = userName + ":" + password;
    var bace64 = btoa(basicAuthCredential);
    return "Basic " + bace64;
  };
  /**
  var basic = formatBasicAuth("admin", "LEFzLxqQHw");
  /**/
  export default {
    baseUrl: "http://habeukutilites.kksa",
    basicAuth: formatBasicAuth("admin", "LEFzLxqQHw"),
    ModeDebug: true, //sa valeur est prioritaire.
    $bvModal: "",
    formatBasicAuth: formatBasicAuth,
    $bvToast: "",
    ToastDelay: 5000,
    ToastAutoHide: false,
    ajaxTitle: "",
    showAlert: false,
    get: function(request, config = {}) {
      return new Promise(resolv => {
        var params = {};
        if (config.useCredential) {
          params.headers = {
            "Content-Type": "application/json",
            Accept: "application/json",
            Authorization: this.basicAuth
          };
        }
        if (config.params) {
          params.params = config.params;
        }
        axios
          .get(this.baseUrl + request, params)
          .then(reponse => {
            if (this.ModeDebug) {
              console.log("GET success", reponse);
            }
            if (reponse.statusText === "OK" && reponse.status === 200) {
              this.ajaxTitle = "Chargement ok";
            } else {
              this.ajaxTitle = reponse.statusText;
            }
            if (config.showAlert === false || config.showAlert === true) {
              this.showAlert = config.showAlert;
            }
            if (this.showAlert) {
              this.notification(this.ajaxTitle);
              /*
              this.$bvToast.toast(" ", {
                title: this.ajaxTitle,
                variant: "POST success",
                solid: true,
                toaster: "b-toaster-top-right",
                autoHideDelay: this.ToastDelay,
                noAutoHide: this.ToastAutoHide
              });
              /**/
            }
            resolv({ status: true, data: reponse.data, reponse: reponse });
          })
          .catch(error => {
            if (this.ModeDebug) {
              console.log(
                "Error response: ",
                error.response,
                "\n error code : ",
                error.code,
                "\n error.stack : ",
                error.stack
              );
            }
            this.ajaxTitle = error.response
              ? error.response.statusText
              : error.stack;
  
            this.$bvToast.toast("une erreur s'est produite", {
              title: this.ajaxTitle,
              variant: "warning",
              solid: true
            });
            resolv({ status: false, error: error.response });
          });
      });
    },
    post: function(request, datas = {}) {
      console.log("ssss");
      return new Promise(resolv => {
        var configs = {
          headers: {
            //"Content-Type": "application/json",
            Accept: "application/json",
            databaseConfig: "Wbu-Gestion-Tache"
          }
        };
        // if (configsBase.magentoAction) {
        //   configs.headers.MagentoTokenAction = configsBase.magentoAction;
        // }
        // if (configsBase.showAlert === false || configsBase.showAlert === true) {
        //   this.showAlert = configsBase.showAlert;
        // }
  
        axios
          .post(this.baseUrl + request, datas, configs)
          .then(reponse => {
            var ajaxTitle = this.ajaxTitle;
            if (this.ModeDebug) {
              console.log("Success POST", reponse);
            }
            if (reponse.statusText === "OK" && reponse.status === 200) {
              ajaxTitle = "Sauvegarde ok";
            } else {
              ajaxTitle = reponse.statusText;
            }
            if (this.showAlert) {
              this.notification(ajaxTitle);
            }
            resolv({ status: true, data: reponse.data, reponse: reponse });
          })
          .catch(error => {
            if (this.ModeDebug) {
              console.log(
                "Error responsei: ",
                error.response,
                "\n error code : ",
                error.code,
                "\n error.stack : ",
                error.stack
              );
            }
            this.ajaxTitle = error.response
              ? error.response.statusText
              : error.stack;
            this.notification(this.ajaxTitle, "warning");
  
            resolv({ status: false, error: error.response });
          });
      });
    },
    postEntityFile: function(request, file) {
      axios
        .post(this.baseUrl + request, file, {
          headers: {
            "Content-Type": "application/octet-stream",
            "Content-Disposition": 'file ; filename="' + file.name + '"',
            Authorization: this.basicAuth
          }
        })
        .then(response => {
          this.Vmodels.field_image = response.data.fid[0].value;
        });
    },
    /**
     * il faut installer le moduele file_entity sur drupal.
     * pour voir les authorisations : rest.resource.entity.file.yml
     */
    postFile: function(file, request = "/entity/file?_format=hal_json") {
      console.log("file : ", file);
      return new Promise(resolv => {
        this.getBase64(file).then(fileBase64 => {
          console.log("fileBase64 : ", fileBase64);
          var dataToPost = {
            _links: {
              type: {
                href: this.baseUrl + "/rest/type/file/image"
              }
            },
            //filename: [{ value: file.name }],
            //filemime: [{ value: file.type }],
            uri: [{ value: "public://TEST/" + file.name }],
            type: [{ target_id: "image" }],
            data: [{ value: '"' + this.imagetest + '"' }]
          };
          axios
            .post(this.baseUrl + request, dataToPost, {
              headers: {
                "Content-Type": "application/hal+json",
                Authorization: this.basicAuth
              }
            })
            .then(reponse => {
              this.notification(this.ajaxTitle);
              resolv({ status: true, data: reponse.data, reponse: reponse });
            })
            .catch(error => {
              this.ajaxTitle = error.response
                ? error.response.statusText
                : error.stack;
              this.notification(this.ajaxTitle, "warning");
              resolv({ status: false, error: error.response });
            });
        });
      });
    },
    delete: function(request, source) {
      return new Promise(resolv => {
        axios
          .delete(this.baseUrl + request, {
            headers: {
              "Content-Type": "application/json",
              Accept: "application/json",
              Authorization: this.basicAuth
            },
            params: source
          })
          .then(reponse => {
            var ajaxTitle = this.ajaxTitle;
            if (this.ModeDebug) {
              console.log("Delete", reponse);
            }
            if (reponse.statusText === "OK" && reponse.status === 200) {
              ajaxTitle = "Suppression ok";
            } else {
              ajaxTitle = reponse.statusText;
            }
            this.notification(ajaxTitle);
            /*
            this.$bvToast.toast(" ", {
              title: ajaxTitle,
              variant: "success",
              solid: true,
              toaster: "b-toaster-top-right",
              autoHideDelay: this.ToastDelay,
              noAutoHide: this.ToastAutoHide
            });
            /**/
            resolv({ status: true, data: reponse.data, reponse: reponse });
          })
          .catch(error => {
            if (this.ModeDebug) {
              console.log(
                "Error response: ",
                error.response,
                "\n error code : ",
                error.code,
                "\n error.stack : ",
                error.stack
              );
            }
            this.ajaxTitle = error.response
              ? error.response.statusText
              : error.stack;
            this.notification(this.ajaxTitle, "warning");
            /*
            this.$bvToast.toast("une erreur s'est produite", {
              title: this.ajaxTitle,
              variant: "warning",
              solid: true
            });
            /**/
            resolv({ status: false, error: error.response });
          });
      });
    },
    confirmDelete: function(
      title = "Confirmer la suppression",
      body = "Etez vous certains de vouloir supprimer ? cette action est irreversible",
      config = {}
    ) {
      return new Promise(resolv => {
        this.$bvModal
          .msgBoxConfirm(body, {
            title: title,
            size: config.sm ? config.sm : "sm",
            buttonSize: config.sm ? config.sm : "sm",
            okVariant: "danger",
            okTitle: "Supprimer",
            cancelTitle: "Annuler",
            footerClass: "p-2",
            hideHeaderClose: false
          })
          .then(value => {
            resolv({ status: value, value: value });
          })
          .catch(err => {
            resolv({ status: false, value: err });
          });
      });
    },
    notification: function(ajaxTitle, variant = "success") {
      console.log(ajaxTitle, variant);
      /*
      this.$bvToast.toast(" ", {
        title: ajaxTitle,
        variant: variant,
        solid: true,
        toaster: "b-toaster-top-right",
        autoHideDelay: this.ToastDelay,
        noAutoHide: this.ToastAutoHide
      });
      /**/
    },
    getBase64: function(file) {
      return new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.readAsDataURL(file);
        //reader.onload = () => resolve(reader.result);
        reader.onloadend = () => resolve(reader.result);
        reader.onerror = error => reject(error);
      });
    },
    imagetest:
      "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9r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