@jswork/weibo-ckeditor-upload-adpater 1.0.9 → 1.0.10

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.
@@ -2,15 +2,16 @@
2
2
  * name: @jswork/weibo-ckeditor-upload-adpater
3
3
  * description: Weibo ckeditor upload adapter.
4
4
  * homepage:
5
- * version: 1.0.9
6
- * date: 2021-10-18 17:16:08
5
+ * version: 1.0.10
6
+ * date: 2023-02-05 14:38:12
7
7
  * license: MIT
8
8
  */
9
9
  export default class {
10
10
  private loader;
11
11
  private lcOpts;
12
+ private options;
12
13
  private weiboOss;
13
- constructor(inLoader: any);
14
+ constructor(inLoader: any, inOptions: any);
14
15
  upload(): Promise<unknown>;
15
16
  private weiboOssClient;
16
17
  }
package/dist/cjs/index.js CHANGED
@@ -3,10 +3,21 @@
3
3
  * name: @jswork/weibo-ckeditor-upload-adpater
4
4
  * description: Weibo ckeditor upload adapter.
5
5
  * homepage:
6
- * version: 1.0.9
7
- * date: 2021-10-18 17:16:08
6
+ * version: 1.0.10
7
+ * date: 2023-02-05 14:38:12
8
8
  * license: MIT
9
9
  */
10
+ var __assign = (this && this.__assign) || function () {
11
+ __assign = Object.assign || function(t) {
12
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13
+ s = arguments[i];
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
15
+ t[p] = s[p];
16
+ }
17
+ return t;
18
+ };
19
+ return __assign.apply(this, arguments);
20
+ };
10
21
  var __importDefault = (this && this.__importDefault) || function (mod) {
11
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
12
23
  };
@@ -15,10 +26,14 @@ var next_weibo_oss_1 = __importDefault(require("@jswork/next-weibo-oss"));
15
26
  var next_leancloud_options_1 = __importDefault(require("@afeiship/next-leancloud-options"));
16
27
  var WEIBO_LC_ID = '60f768f6d9f1465d3b1d5c43';
17
28
  var fetch = window.fetch.bind(window);
29
+ var defaults = {
30
+ baseURL: 'https://tva1.js.work'
31
+ };
18
32
  var default_1 = /** @class */ (function () {
19
- function default_1(inLoader) {
33
+ function default_1(inLoader, inOptions) {
20
34
  this.loader = inLoader;
21
35
  this.lcOpts = new next_leancloud_options_1.default({ fetch: fetch, id: WEIBO_LC_ID });
36
+ this.options = __assign(__assign({}, defaults), inOptions);
22
37
  }
23
38
  default_1.prototype.upload = function () {
24
39
  var _this = this;
@@ -41,9 +56,10 @@ var default_1 = /** @class */ (function () {
41
56
  var _this = this;
42
57
  if (this.weiboOss)
43
58
  return Promise.resolve(this.weiboOss);
59
+ var baseURL = this.options.baseURL;
44
60
  return new Promise(function (resolve) {
45
61
  _this.lcOpts.get().then(function (res) {
46
- _this.weiboOss = new next_weibo_oss_1.default(res.value);
62
+ _this.weiboOss = new next_weibo_oss_1.default(res.value, { baseURL: baseURL });
47
63
  resolve(_this.weiboOss);
48
64
  });
49
65
  });
@@ -2,15 +2,16 @@
2
2
  * name: @jswork/weibo-ckeditor-upload-adpater
3
3
  * description: Weibo ckeditor upload adapter.
4
4
  * homepage:
5
- * version: 1.0.9
6
- * date: 2021-10-18 17:16:11
5
+ * version: 1.0.10
6
+ * date: 2023-02-05 14:38:16
7
7
  * license: MIT
8
8
  */
9
9
  export default class {
10
10
  private loader;
11
11
  private lcOpts;
12
+ private options;
12
13
  private weiboOss;
13
- constructor(inLoader: any);
14
+ constructor(inLoader: any, inOptions: any);
14
15
  upload(): Promise<unknown>;
15
16
  private weiboOssClient;
16
17
  }
package/dist/esm/index.js CHANGED
@@ -2,18 +2,33 @@
2
2
  * name: @jswork/weibo-ckeditor-upload-adpater
3
3
  * description: Weibo ckeditor upload adapter.
4
4
  * homepage:
5
- * version: 1.0.9
6
- * date: 2021-10-18 17:16:11
5
+ * version: 1.0.10
6
+ * date: 2023-02-05 14:38:16
7
7
  * license: MIT
8
8
  */
9
+ var __assign = (this && this.__assign) || function () {
10
+ __assign = Object.assign || function(t) {
11
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
12
+ s = arguments[i];
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
14
+ t[p] = s[p];
15
+ }
16
+ return t;
17
+ };
18
+ return __assign.apply(this, arguments);
19
+ };
9
20
  import NxWeiboOss from '@jswork/next-weibo-oss';
10
21
  import NxLcOptions from '@afeiship/next-leancloud-options';
11
22
  var WEIBO_LC_ID = '60f768f6d9f1465d3b1d5c43';
12
23
  var fetch = window.fetch.bind(window);
24
+ var defaults = {
25
+ baseURL: 'https://tva1.js.work'
26
+ };
13
27
  var default_1 = /** @class */ (function () {
14
- function default_1(inLoader) {
28
+ function default_1(inLoader, inOptions) {
15
29
  this.loader = inLoader;
16
30
  this.lcOpts = new NxLcOptions({ fetch: fetch, id: WEIBO_LC_ID });
31
+ this.options = __assign(__assign({}, defaults), inOptions);
17
32
  }
18
33
  default_1.prototype.upload = function () {
19
34
  var _this = this;
@@ -36,9 +51,10 @@ var default_1 = /** @class */ (function () {
36
51
  var _this = this;
37
52
  if (this.weiboOss)
38
53
  return Promise.resolve(this.weiboOss);
54
+ var baseURL = this.options.baseURL;
39
55
  return new Promise(function (resolve) {
40
56
  _this.lcOpts.get().then(function (res) {
41
- _this.weiboOss = new NxWeiboOss(res.value);
57
+ _this.weiboOss = new NxWeiboOss(res.value, { baseURL: baseURL });
42
58
  resolve(_this.weiboOss);
43
59
  });
44
60
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/weibo-ckeditor-upload-adpater",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Weibo ckeditor upload adapter.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -30,7 +30,7 @@
30
30
  "gulp-uglify": "^3.0.2",
31
31
  "jest": "^26.6.3",
32
32
  "prettier": "^2.2.1",
33
- "release-it": "^14.2.1",
33
+ "release-it": "^15.6.0",
34
34
  "typescript": "^4.1.3"
35
35
  },
36
36
  "publishConfig": {
@@ -38,9 +38,9 @@
38
38
  "registry": "https://registry.npmjs.org"
39
39
  },
40
40
  "dependencies": {
41
- "@afeiship/next-leancloud-options": "^1.0.4",
42
- "@jswork/next": "^1.0.9",
43
- "@jswork/next-weibo-oss": "^1.0.1"
41
+ "@afeiship/next-leancloud-options": "^1.0.13",
42
+ "@jswork/next": "^1.1.5",
43
+ "@jswork/next-weibo-oss": "^1.0.3"
44
44
  },
45
45
  "keywords": [
46
46
  "weibo",