universal-picgo 1.11.6 → 1.12.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.11.6" }, te = Object.getOwnPropertyDescriptors || function(pt) {
25652
+ var $ = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.12.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;
@@ -60490,7 +60490,7 @@ ${pe}
60490
60490
  const ie = _.area, se = _.path || "";
60491
60491
  return !_.version || _.version === "v4" ? {
60492
60492
  method: "POST",
60493
- url: `http://${ie}.file.myqcloud.com/files/v2/${te.appId}/${te.bucket}/${encodeURI(
60493
+ url: `https://${ie}.file.myqcloud.com/files/v2/${te.appId}/${te.bucket}/${encodeURI(
60494
60494
  se
60495
60495
  )}${$}`,
60496
60496
  headers: {
@@ -60507,7 +60507,7 @@ ${pe}
60507
60507
  resolveWithFullResponse: !0
60508
60508
  } : {
60509
60509
  method: "PUT",
60510
- url: `http://${_.bucket}.cos.${_.area}.myqcloud.com/${encodeURIComponent(se)}${encodeURIComponent(
60510
+ url: `https://${_.bucket}.cos.${_.area}.myqcloud.com/${encodeURIComponent(se)}${encodeURIComponent(
60511
60511
  $
60512
60512
  )}`,
60513
60513
  headers: {
@@ -60766,7 +60766,7 @@ function postOptions$4(_, $, te, ee) {
60766
60766
  const ne = selectArea(_.area || "z0"), ie = _.path || "", se = Buffer$E.from(ie + $, "utf-8").toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
60767
60767
  return {
60768
60768
  method: "POST",
60769
- url: `http://upload${ne}.qiniup.com/putb64/-1/key/${se}`,
60769
+ url: `https://upload${ne}.qiniup.com/putb64/-1/key/${se}`,
60770
60770
  headers: {
60771
60771
  Authorization: `UpToken ${te}`,
60772
60772
  "Content-Type": mime$1.lookup($) || "application/octet-stream"
@@ -60934,7 +60934,7 @@ const getSignature = (_, $, te, ee, ne, ie = null) => {
60934
60934
  }, ue = Buffer$1$1.from(JSON.stringify(oe)).toString("base64"), fe = calculateMD5(_.password), le = getSignature(fe, "POST", `/${_.bucket}`, se, ue), de = new FormData();
60935
60935
  return de.append("authorization", `UPYUN ${_.operator}:${le}`), de.append("file", new Blob([ee], { type: "image/png" }), $), de.append("policy", ue), {
60936
60936
  method: "POST",
60937
- url: `http://v0.api.upyun.com/${_.bucket}`,
60937
+ url: `https://v0.api.upyun.com/${_.bucket}`,
60938
60938
  headers: {
60939
60939
  // multipart/form-data 是自动设置的,这里不需要
60940
60940
  // "Content-Type": "multipart/form-data",
@@ -61182,7 +61182,7 @@ const postOptions$1 = (_, $, te) => {
61182
61182
  throw _.emit(IBuildInEvent.NOTIFICATION, {
61183
61183
  title: _.i18n.translate("UPLOAD_FAILED"),
61184
61184
  body: _.i18n.translate("CHECK_SETTINGS_AND_NETWORK"),
61185
- text: "http://docs.imgur.com/api/errno/"
61185
+ text: "https://docs.imgur.com/api/errno/"
61186
61186
  }), le != null && le.statusCode ? de = ((ne = (ee = le.response) == null ? void 0 : ee.body) == null ? void 0 : ne.data.error) ?? ((se = (ie = le.response) == null ? void 0 : ie.body) == null ? void 0 : se.data) ?? le.stack ?? "unknown error" : de = le.toString(), _.log.error(de), de;
61187
61187
  }
61188
61188
  }
@@ -61389,7 +61389,7 @@ const hostHeaderMiddleware = (_) => ($) => async (te) => {
61389
61389
  $.add(loggerMiddleware(), loggerMiddlewareOptions);
61390
61390
  }
61391
61391
  });
61392
- var define_process_env_default$2 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.11.6" };
61392
+ var define_process_env_default$2 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.12.1" };
61393
61393
  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) => {
61394
61394
  const { request: ee } = te;
61395
61395
  if (!HttpRequest.isInstance(ee) || _.runtime !== "node" || ee.headers.hasOwnProperty(TRACE_ID_HEADER_NAME))
@@ -64093,6 +64093,15 @@ class NoSuchUpload extends S3ServiceException {
64093
64093
  }), this.name = "NoSuchUpload", this.$fault = "client", Object.setPrototypeOf(this, NoSuchUpload.prototype);
64094
64094
  }
64095
64095
  }
64096
+ const ObjectCannedACL = {
64097
+ authenticated_read: "authenticated-read",
64098
+ aws_exec_read: "aws-exec-read",
64099
+ bucket_owner_full_control: "bucket-owner-full-control",
64100
+ bucket_owner_read: "bucket-owner-read",
64101
+ private: "private",
64102
+ public_read: "public-read",
64103
+ public_read_write: "public-read-write"
64104
+ };
64096
64105
  class ObjectNotInActiveTierError extends S3ServiceException {
64097
64106
  constructor($) {
64098
64107
  super({
@@ -73765,7 +73774,7 @@ const uploader = {
73765
73774
  bucketName: $.bucketName,
73766
73775
  path: formatPath(se, $.uploadPath || ""),
73767
73776
  item: se,
73768
- acl: $.acl || "public-read",
73777
+ acl: $.acl || ObjectCannedACL.public_read,
73769
73778
  customUrl: $.customUrl || "",
73770
73779
  corsProxy: $.corsProxy
73771
73780
  })
@@ -81146,7 +81155,7 @@ logger.logger = new Logger();
81146
81155
  (function(_) {
81147
81156
  Object.defineProperty(_, "__esModule", { value: !0 }), (0, require$$0.__exportStar)(logger, _);
81148
81157
  })(utils$2);
81149
- var define_process_env_default$1 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.11.6" };
81158
+ var define_process_env_default$1 = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.12.1" };
81150
81159
  Object.defineProperty(fileSync, "__esModule", { value: !0 });
81151
81160
  fileSync.FileSyncAdapter = void 0;
81152
81161
  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;
@@ -84899,7 +84908,7 @@ class PicGoRequestWrapper {
84899
84908
  }
84900
84909
  }
84901
84910
  }
84902
- var define_process_env_default = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.11.6" };
84911
+ var define_process_env_default = { DEV_MODE: "false", NODE_ENV: "production", PICGO_VERSION: "1.12.1" };
84903
84912
  class UniversalPicGo extends eventsExports.EventEmitter {
84904
84913
  constructor(te, ee, ne, ie) {
84905
84914
  super();
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-picgo",
3
- "version": "1.11.6",
3
+ "version": "1.12.1",
4
4
  "type": "module",
5
5
  "description": "picgo lib for node, browser and electron",
6
6
  "main": "./dist/index.js",
@@ -1,5 +1,5 @@
1
1
  import { IAwsS3Config, IImgInfo, IPicGo } from '../../../types';
2
- import { S3Client } from '@aws-sdk/client-s3';
2
+ import { S3Client, ObjectCannedACL } from '@aws-sdk/client-s3';
3
3
 
4
4
  export interface IUploadResult {
5
5
  index: number;
@@ -16,7 +16,7 @@ interface createUploadTaskOpts {
16
16
  path: string;
17
17
  item: IImgInfo;
18
18
  index: number;
19
- acl: string;
19
+ acl: ObjectCannedACL | undefined;
20
20
  customUrl?: string;
21
21
  corsProxy?: boolean;
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-picgo",
3
- "version": "1.11.6",
3
+ "version": "1.12.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.11.6"
44
+ "universal-picgo-store": "1.12.1"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"