picgo-plugin-s3 1.2.2 → 1.2.3

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/.eslintrc CHANGED
@@ -5,7 +5,10 @@
5
5
  "plugin:@typescript-eslint/recommended",
6
6
  "prettier"
7
7
  ],
8
- "plugins": ["prettier", "@typescript-eslint"],
8
+ "plugins": [
9
+ "prettier",
10
+ "@typescript-eslint"
11
+ ],
9
12
  "env": {
10
13
  "es6": true,
11
14
  "node": true
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import picgo from "picgo";
2
- declare const _default: (ctx: picgo) => {
1
+ import { PicGo } from "picgo";
2
+ declare const _default: (ctx: PicGo) => {
3
3
  register: () => void;
4
4
  };
5
5
  export = _default;
@@ -1,5 +1,5 @@
1
1
  import { S3 } from "aws-sdk";
2
- import { IImgInfo } from "picgo/dist/src/types";
2
+ import { IImgInfo } from "picgo";
3
3
  import { IS3UserConfig } from "./config";
4
4
  export interface IUploadResult {
5
5
  url: string;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { IImgInfo } from "picgo/dist/src/types";
2
+ import { IImgInfo } from "picgo";
3
3
  export declare function formatPath(info: IImgInfo, format?: string): string;
4
4
  export declare function extractInfo(info: IImgInfo): Promise<{
5
5
  body?: Buffer;
package/dist/utils.js CHANGED
@@ -37,6 +37,24 @@ class FileNameGenerator {
37
37
  md5() {
38
38
  return crypto_1.default.createHash("md5").update(this.imgBuffer()).digest("hex");
39
39
  }
40
+ md5B64() {
41
+ return crypto_1.default
42
+ .createHash("md5")
43
+ .update(this.imgBuffer())
44
+ .digest("base64")
45
+ .replace(/\+/g, "-")
46
+ .replace(/\//g, "_")
47
+ .replace(/=+$/, "");
48
+ }
49
+ md5B64Short() {
50
+ return crypto_1.default
51
+ .createHash("md5")
52
+ .update(this.imgBuffer())
53
+ .digest("base64")
54
+ .replace(/\+/g, "-")
55
+ .replace(/\//g, "_")
56
+ .slice(0, 7);
57
+ }
40
58
  sha1() {
41
59
  return crypto_1.default.createHash("sha1").update(this.imgBuffer()).digest("hex");
42
60
  }
@@ -55,6 +73,8 @@ FileNameGenerator.fields = [
55
73
  "fileName",
56
74
  "extName",
57
75
  "md5",
76
+ "md5B64",
77
+ "md5B64Short",
58
78
  "sha1",
59
79
  "sha256",
60
80
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picgo-plugin-s3",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "picgo amazon s3 uploader",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
@@ -27,13 +27,14 @@
27
27
  "author": "WayJam So",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
+ "@types/mime": "^3.0.1",
30
31
  "@types/node": "^18.7.23",
31
32
  "@typescript-eslint/eslint-plugin": "^5.38.1",
32
33
  "@typescript-eslint/parser": "^5.38.1",
33
34
  "eslint": "^8.25.0",
34
35
  "eslint-config-prettier": "^8.5.0",
35
36
  "eslint-plugin-prettier": "^4.2.1",
36
- "picgo": "^1.4.0 >1.4.16",
37
+ "picgo": "^1.5.0",
37
38
  "prettier": "^2.7.1",
38
39
  "typescript": "^4.8.4"
39
40
  },