universal-picgo 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25649,7 +25649,7 @@ var isBufferBrowser = function($) {
25649
25649
  return $ && typeof $ == "object" && typeof $.copy == "function" && typeof $.fill == "function" && typeof $.readUInt8 == "function";
25650
25650
  };
25651
25651
  (function(_) {
25652
- var $ = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.0" }, te = Object.getOwnPropertyDescriptors || function(pt) {
25652
+ var $ = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.1" }, te = Object.getOwnPropertyDescriptors || function(pt) {
25653
25653
  for (var dt = Object.keys(pt), tt = {}, Je = 0; Je < dt.length; Je++)
25654
25654
  tt[dt[Je]] = Object.getOwnPropertyDescriptor(pt, dt[Je]);
25655
25655
  return tt;
@@ -60751,6 +60751,16 @@ class PutPolicy {
60751
60751
  return [$.accessKey, ie, ee].join(":");
60752
60752
  }
60753
60753
  }
60754
+ const getBrowserDirectoryPath = (_) => {
60755
+ const $ = _.split("/");
60756
+ return $.pop(), $.join("/");
60757
+ }, browserPathJoin = (..._) => {
60758
+ const $ = _.filter((ee) => ee && ee.trim() !== "");
60759
+ if ($.length === 0)
60760
+ return "";
60761
+ let te = $.join("/");
60762
+ return te = te.replace(/([^:/]|^)\/{2,}/g, "$1/"), te;
60763
+ };
60754
60764
  function postOptions$3(_, $, te, ee) {
60755
60765
  const ne = selectArea(_.area || "z0"), ie = _.path || "", se = Buffer$E.from(ie + $, "utf-8").toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
60756
60766
  return {
@@ -60790,7 +60800,7 @@ const handle$6 = async (_) => {
60790
60800
  if (oe != null && oe.key) {
60791
60801
  delete ee.base64Image, delete ee.buffer;
60792
60802
  const ue = $.url, fe = $.options;
60793
- ee.imgUrl = `${ue}/${oe.key}${fe}`;
60803
+ ee.imgUrl = browserPathJoin(ue, oe.key, fe);
60794
60804
  } else
60795
60805
  throw _.emit(IBuildInEvent.NOTIFICATION, {
60796
60806
  title: _.i18n.translate("UPLOAD_FAILED"),
@@ -61378,7 +61388,7 @@ const hostHeaderMiddleware = (_) => ($) => async (te) => {
61378
61388
  $.add(loggerMiddleware(), loggerMiddlewareOptions);
61379
61389
  }
61380
61390
  });
61381
- var define_process_env_default$2 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.0" };
61391
+ var define_process_env_default$2 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.1" };
61382
61392
  const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id", ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME", ENV_TRACE_ID = "_X_AMZN_TRACE_ID", recursionDetectionMiddleware = (_) => ($) => async (te) => {
61383
61393
  const { request: ee } = te;
61384
61394
  if (!HttpRequest.isInstance(ee) || _.runtime !== "node" || ee.headers.hasOwnProperty(TRACE_ID_HEADER_NAME))
@@ -74121,16 +74131,7 @@ const dayjs = /* @__PURE__ */ getDefaultExportFromCjs$1(dayjs_minExports), handl
74121
74131
  register(_) {
74122
74132
  _.helper.transformer.register("path", ImgFromPath), _.helper.transformer.register("base64", ImgFromBase64);
74123
74133
  }
74124
- }), getBrowserDirectoryPath = (_) => {
74125
- const $ = _.split("/");
74126
- return $.pop(), $.join("/");
74127
- }, browserPathJoin = (..._) => {
74128
- const $ = _.filter((ee) => ee && ee.trim() !== "");
74129
- if ($.length === 0)
74130
- return "";
74131
- let te = $.join("/");
74132
- return te = te.replace(/([^:/]|^)\/{2,}/g, "$1/"), te;
74133
- };
74134
+ });
74134
74135
  class PluginLoaderDb {
74135
74136
  constructor($) {
74136
74137
  Gr(this, "ctx");
@@ -80852,7 +80853,7 @@ logger.logger = new Logger();
80852
80853
  (function(_) {
80853
80854
  Object.defineProperty(_, "__esModule", { value: !0 }), (0, require$$0.__exportStar)(logger, _);
80854
80855
  })(utils$2);
80855
- var define_process_env_default$1 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.0" };
80856
+ var define_process_env_default$1 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.1" };
80856
80857
  Object.defineProperty(fileSync, "__esModule", { value: !0 });
80857
80858
  fileSync.FileSyncAdapter = void 0;
80858
80859
  const tslib_1 = require$$0, fs = (0, tslib_1.__importStar)(require$$1), path = (0, tslib_1.__importStar)(pathBrowserify), base_1$1 = base, utils_1$1 = utils$2, types_1 = types$1;
@@ -84578,7 +84579,7 @@ class PicGoRequestWrapper {
84578
84579
  }
84579
84580
  }
84580
84581
  }
84581
- var define_process_env_default = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.0" };
84582
+ var define_process_env_default = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.10.1" };
84582
84583
  class UniversalPicGo extends eventsExports.EventEmitter {
84583
84584
  constructor(te, ee, ne, ie) {
84584
84585
  super();
@@ -84814,16 +84815,21 @@ class ExternalPicgo {
84814
84815
  throw new Error("bundled picgo cannot use extenal picgo api");
84815
84816
  if (ee !== PicgoTypeEnum.App)
84816
84817
  throw new Error(`picgoType ${ee} is not supported via external picgo api`);
84817
- let ne = !1;
84818
+ const ne = [];
84818
84819
  if ($) {
84819
84820
  for (const de of $)
84820
- if (isFileOrBlob(de) || typeof de != "string") {
84821
- ne = !0;
84822
- break;
84823
- }
84821
+ if (isFileOrBlob(de)) {
84822
+ if (this.logger.warn("try to get path from blob", de.path), de.path.trim() === "") {
84823
+ this.logger.warn("blob path is empty");
84824
+ continue;
84825
+ }
84826
+ ne.push(de.path);
84827
+ } else
84828
+ ne.push(de);
84829
+ $ = ne;
84824
84830
  }
84825
- if (ne)
84826
- throw new Error("blob is not supported via external picgo api");
84831
+ if (($ == null ? void 0 : $.length) === 0)
84832
+ throw new Error("cannot not find valid image");
84827
84833
  this.requestUrl = this.db.get("extPicgoApiUrl") ?? this.requestUrl;
84828
84834
  let ie = [];
84829
84835
  const se = {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-picgo",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "type": "module",
5
5
  "description": "picgo lib for node, browser and electron",
6
6
  "main": "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-picgo",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "type": "module",
5
5
  "description": "picgo lib for node, browser and electron",
6
6
  "main": "./dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "queue": "^7.0.0",
42
42
  "zhi-lib-base": "^0.8.0",
43
43
  "file-type": "^16.2.0",
44
- "universal-picgo-store": "1.10.0"
44
+ "universal-picgo-store": "1.10.1"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"