picgo-plugin-s3 1.2.0 → 1.2.2

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
@@ -49,14 +49,6 @@ module.exports = (ctx) => {
49
49
  required: true,
50
50
  alias: "文件路径",
51
51
  },
52
- {
53
- name: "acl",
54
- type: "input",
55
- default: userConfig.acl,
56
- message: "文件访问权限",
57
- required: true,
58
- alias: "权限",
59
- },
60
52
  {
61
53
  name: "region",
62
54
  type: "input",
@@ -1,4 +1,4 @@
1
- import S3 from "aws-sdk/clients/s3";
1
+ import { S3 } from "aws-sdk";
2
2
  import { IImgInfo } from "picgo/dist/src/types";
3
3
  import { IS3UserConfig } from "./config";
4
4
  export interface IUploadResult {
package/dist/uploader.js CHANGED
@@ -3,13 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const s3_1 = __importDefault(require("aws-sdk/clients/s3"));
6
+ const aws_sdk_1 = require("aws-sdk");
7
7
  const utils_1 = require("./utils");
8
+ const url_1 = __importDefault(require("url"));
8
9
  function createS3Client(opts) {
9
- const endpointURL = new URL(opts.endpoint);
10
- const sslEnabled = endpointURL.protocol === "https";
10
+ let sslEnabled = true;
11
+ try {
12
+ const u = url_1.default.parse(opts.endpoint);
13
+ sslEnabled = u.protocol === "https:";
14
+ }
15
+ catch (_a) {
16
+ // eslint-disable-next-line no-empty
17
+ }
11
18
  const http = sslEnabled ? require("https") : require("http");
12
- const s3 = new s3_1.default({
19
+ const s3 = new aws_sdk_1.S3({
13
20
  region: opts.region,
14
21
  endpoint: opts.endpoint,
15
22
  accessKeyId: opts.accessKeyID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picgo-plugin-s3",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "picgo amazon s3 uploader",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {