// import {
//   downloadImage,
//   downloadOtherImage,
//   toSend,
//   writeProfileXml,
// } from "@/server/utils";
// const {
//   cropImageTransparentEdges,
//   cropTransparentEdges,
//   processImages,
// } = require("../utils/setImage");
import axios from "../utils/axios";
// import { returnLogFilePath } from "../utils/log";
// var request = require("request");
// const compressing = require("compressing");
// const uuid = require("uuid");
// const path = require("path");
// const fs = require("fs");
// const os = require("os");
// const { app } = require("electron");

axios.defaults.timeout = 12600000;
// const multiparty = require("multiparty");

export function getProductCnByFactorySubOrderNumberApi(factorySubOrderNumber) {
  // let env = getHostApi().apiApiHost;
  const url =
    "factory/podJomallOrderProductCn/getProductCnByFactorySubOrderNumber";
  return axios.get(url, {
    params: {
      factorySubOrderNumber,
    },
  });
}

export function getProductUsByFactorySubOrderNumberApi(factorySubOrderNumber) {
  return axios.get(
    `factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber`,
    {
      params: {
        factorySubOrderNumber,
      },
    },
  );
}

export function getSubOrderByThirdSubOrderNumberApi(thirdSubOrderNumber) {
  return axios.get(
    `factory/podJomallOrderProduct/getSubOrderByThirdSubOrderNumber`,
    {
      params: {
        thirdSubOrderNumber,
      },
    },
  );
}

export function checkUpdate(version) {
  return axios.get(
    `https://admin.jomalls.com/api/manage/rest/app/checkUpdate`,
    {
      params: {
        businessType: "production_assistant",
        version,
      },
    },
  );
}

export function getAllCountryApi(thirdSubOrderNumber) {
  return axios.get(`logisticsAddress/getAllCountry`, {
    params: {
      thirdSubOrderNumber,
    },
  });
}
