component-shipinlv 2.0.17 → 2.1.0

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.
Files changed (51) hide show
  1. package/dist/ActiveAccountMode/hour-enabled.d.ts +9 -0
  2. package/dist/ActiveAccountMode/hour-enabled.js +42 -0
  3. package/dist/ActiveAccountMode/hour-enabled.less +24 -0
  4. package/dist/ActiveAccountMode/index.d.ts +7 -0
  5. package/dist/ActiveAccountMode/index.js +12 -0
  6. package/dist/ActiveAccountMode/index.less +0 -0
  7. package/dist/ActiveAccountMode/setting.d.ts +8 -0
  8. package/dist/ActiveAccountMode/setting.js +206 -0
  9. package/dist/ActiveAccountMode/setting.less +39 -0
  10. package/dist/ActiveAccountMode/task/index.d.ts +36 -0
  11. package/dist/ActiveAccountMode/task/index.js +811 -0
  12. package/dist/Auth/index.js +2 -0
  13. package/dist/AuthClient/qr/h5-we-public-login.js +1 -1
  14. package/dist/Notice/index.d.ts +4 -0
  15. package/dist/Notice/index.js +36 -0
  16. package/dist/VideoPublish/account-manage/home.js +1 -0
  17. package/dist/VideoPublish/account-manage/list.js +1 -0
  18. package/dist/VideoPublish/create-task/base/index.js +1 -1
  19. package/dist/VideoPublish/index.js +11 -1
  20. package/dist/VideoPublish/index.less +2 -2
  21. package/dist/VideoPublish/publish-task-plan/tool.js +1 -1
  22. package/dist/VideoPublish/video-account/create.js +1 -1
  23. package/dist/VideoPublish/video-account/group.js +1 -1
  24. package/dist/VideoPublish/video-account/index.js +56 -5
  25. package/dist/lib/Tool.js +7 -0
  26. package/dist/lib/allow-mine-type.d.ts +4 -0
  27. package/dist/lib/allow-mine-type.js +19 -0
  28. package/dist/lib/file-type.d.ts +2 -0
  29. package/dist/lib/file-type.js +156 -0
  30. package/dist/lib/fs.d.ts +14 -0
  31. package/dist/lib/fs.js +479 -0
  32. package/dist/lib/getFileExt.d.ts +2 -0
  33. package/dist/lib/getFileExt.js +6 -0
  34. package/dist/lib/save-path.d.ts +17 -0
  35. package/dist/lib/save-path.js +173 -0
  36. package/dist/lib/save-path.less +21 -0
  37. package/dist/service/api/ActiveAccountModeSettingController.d.ts +2 -0
  38. package/dist/service/api/ActiveAccountModeSettingController.js +53 -0
  39. package/dist/service/api/PublishTaskPlanStatisticController.d.ts +1 -0
  40. package/dist/service/api/PublishTaskPlanStatisticController.js +28 -0
  41. package/dist/service/api/VideoPublishController.d.ts +4 -0
  42. package/dist/service/api/VideoPublishController.js +23 -0
  43. package/dist/types/AutoMakeTaskSetting.d.ts +18 -0
  44. package/dist/types/AutoMakeTaskSetting.js +0 -0
  45. package/dist/types/PublishTaskPlanStatistic.d.ts +15 -0
  46. package/dist/types/PublishTaskPlanStatistic.js +0 -0
  47. package/dist/types/VideoPublish.d.ts +1 -0
  48. package/dist/typings/VideoPublishVideoAccount.d.ts +1 -0
  49. package/dist/typings.d.ts +1 -0
  50. package/dist/window.d.ts +5 -0
  51. package/package.json +1 -1
@@ -306,6 +306,8 @@ var Auth = function Auth(_ref) {
306
306
  children: "1\u3001\u628A\u672C\u9875\u7F51\u5740\u590D\u5236\u5230\u5FAE\u4FE1\u91CC\u9762\u6253\u5F00"
307
307
  }), /*#__PURE__*/_jsx("li", {
308
308
  children: "2\u3001\u8BF7\u7528\u5FAE\u4FE1\u626B\u7801\u767B\u5F55"
309
+ }), /*#__PURE__*/_jsx("li", {
310
+ children: "3\u3001\u628A\u672C\u9875\u7F51\u5740\u590D\u5236\u5230\u5FAE\u4FE1\u91CC\u9762\u6253\u5F00"
309
311
  })]
310
312
  })]
311
313
  }) : /*#__PURE__*/_jsx("div", {
@@ -7,7 +7,7 @@ var h5WePublicLogin = /*#__PURE__*/function () {
7
7
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8
8
  while (1) switch (_context.prev = _context.next) {
9
9
  case 0:
10
- document.location.replace("https://auth.shanren.wang/auth/wechat/login?url=".concat(document.location.href));
10
+ document.location.replace("https://wechat-auth.shipinlv.com/auth/wechat/login?url=".concat(encodeURIComponent(document.location.href)));
11
11
  return _context.abrupt("return");
12
12
  case 2:
13
13
  case "end":
@@ -0,0 +1,4 @@
1
+ declare class Product {
2
+ detail(productType: string, env?: Global.Env): Promise<Product.Detail>;
3
+ }
4
+ export default Product;
@@ -0,0 +1,36 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import * as ProductController from "../service/api/ProductController";
6
+ var Product = /*#__PURE__*/function () {
7
+ function Product() {
8
+ _classCallCheck(this, Product);
9
+ }
10
+ _createClass(Product, [{
11
+ key: "detail",
12
+ value: function () {
13
+ var _detail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productType, env) {
14
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ return _context.abrupt("return", ProductController.detail({
18
+ productType: productType
19
+ }, {
20
+ env: env
21
+ }));
22
+ case 1:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }, _callee);
27
+ }));
28
+ function detail(_x, _x2) {
29
+ return _detail.apply(this, arguments);
30
+ }
31
+ return detail;
32
+ }()
33
+ }]);
34
+ return Product;
35
+ }();
36
+ export default Product;
@@ -18,6 +18,7 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
18
18
  onMenu = _ref.onMenu,
19
19
  canPublish = _ref.canPublish;
20
20
  var _useState = useState({
21
+ videoFromFolder: "",
21
22
  id: 0,
22
23
  userId: 0,
23
24
  platform: 'douyin',
@@ -139,6 +139,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
139
139
  created: 0,
140
140
  updated: 0,
141
141
  chromeProfileName: '',
142
+ videoFromFolder: '',
142
143
  proxyInfo: {}
143
144
  });
144
145
  return;
@@ -47,7 +47,7 @@ var VideoPublishCreateTaskBase = function VideoPublishCreateTaskBase(_ref) {
47
47
  title: /*#__PURE__*/_jsxs(_Fragment, {
48
48
  children: [/*#__PURE__*/_jsx(UsergroupAddOutlined, {
49
49
  className: "groupIcon"
50
- }), " ", items.groupName || '默认分组']
50
+ }), " ", items.groupName || '默认']
51
51
  }),
52
52
  value: "group-".concat(items.groupId),
53
53
  key: "group-".concat(items.groupId),
@@ -4,7 +4,7 @@ import "./index.less";
4
4
  import { Menu, Tabs } from "antd";
5
5
  import VideoPublishCreateTask from "./create-task";
6
6
  import isInClient from "../lib/isInClient";
7
- import { BorderlessTableOutlined, ClockCircleOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, QuestionCircleOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
7
+ import { BorderlessTableOutlined, ClockCircleOutlined, FieldTimeOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, QuestionCircleOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
8
8
  import VideoPublishVideoAccount from "./video-account";
9
9
  import VideoPublishTaskList from "./task-list";
10
10
  import VideoPublishLog from "./log";
@@ -17,6 +17,7 @@ import VideoPublishTaskPlanList from "./task-list/plan/list";
17
17
  import VideoPublishStatisticPublish from "./video-publish-statistic";
18
18
  import saveSid from "../lib/saveSid";
19
19
  import VideoStudyPage from "../video-study";
20
+ import ActiveAccountMode from "../ActiveAccountMode";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
23
  var VideoPublish = function VideoPublish(_ref) {
@@ -61,6 +62,15 @@ var VideoPublish = function VideoPublish(_ref) {
61
62
  disabled: disabled,
62
63
  env: env
63
64
  })
65
+ }, {
66
+ key: 'activeAccountMode',
67
+ icon: /*#__PURE__*/_jsx(FieldTimeOutlined, {}),
68
+ label: '养号模式',
69
+ forceRender: true,
70
+ children: /*#__PURE__*/_jsx(ActiveAccountMode, {
71
+ disabled: disabled,
72
+ env: env
73
+ })
64
74
  }, {
65
75
  key: 'topic',
66
76
  icon: /*#__PURE__*/_jsx(BorderlessTableOutlined, {}),
@@ -35,11 +35,11 @@
35
35
  flex: 1;
36
36
  padding: 16px 16px 40px 16px ;
37
37
  overflow-y: auto;
38
-
38
+ min-height: 60vh;
39
39
  .my-tabs {
40
40
  width: 100%;
41
41
  .ktv-ai-pageContentBox{
42
- >h2{
42
+ > h2{
43
43
  margin-top: 0;
44
44
  }
45
45
  }
@@ -511,7 +511,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
511
511
  _this = this;
512
512
  return _context9.abrupt("return", new Promise(function (resolve, reject) {
513
513
  var isOpened = false;
514
- var sse = new SSE("http://localhost:".concat(window.__ShipinlvLocalServerPort || 61806, "/").concat("chrome/applyForPublishTaskSse".toLocaleLowerCase(), "?") + param({
514
+ var sse = new SSE("http://localhost:".concat(window.__ShipinlvLocalServerPort || 61805, "/").concat("chrome/applyForPublishTaskSse".toLocaleLowerCase(), "?") + param({
515
515
  data: JSON.stringify(_objectSpread(_objectSpread({}, query), {}, {
516
516
  proxyInfo: proxyInfo
517
517
  }))
@@ -133,7 +133,7 @@ var VideoAccountCreate = function VideoAccountCreate(_ref) {
133
133
  children: [/*#__PURE__*/_jsx(Select.Option, {
134
134
  value: 0,
135
135
  children: /*#__PURE__*/_jsx(Tag, {
136
- children: "\u9ED8\u8BA4\u5206\u7EC4"
136
+ children: "\u9ED8\u8BA4"
137
137
  })
138
138
  }), groupList.map(function (items, index) {
139
139
  return /*#__PURE__*/_jsx(Select.Option, {
@@ -38,7 +38,7 @@ var VideoAccountGroup = function VideoAccountGroup(_ref) {
38
38
  groupList.push({
39
39
  _key: '-1',
40
40
  id: -1,
41
- name: '默认分组',
41
+ name: '默认',
42
42
  isChange: false
43
43
  });
44
44
  result.forEach(function (items) {
@@ -1,3 +1,4 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
4
  import React, { useState } from "react";
@@ -15,6 +16,7 @@ import Tool from "../../lib/Tool";
15
16
  import VideoAccountGroup from "./group";
16
17
  import VideoAccountCreate from "./create";
17
18
  import VideoPublishVideoAccountProxySelect from "../proxy/select";
19
+ import SavePath from "../../lib/save-path";
18
20
  import { jsx as _jsx } from "react/jsx-runtime";
19
21
  import { Fragment as _Fragment } from "react/jsx-runtime";
20
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -63,7 +65,7 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
63
65
  return /*#__PURE__*/_jsx(Tag, {
64
66
  className: "groupName",
65
67
  color: record !== null && record !== void 0 && record.groupName ? 'blue' : '',
66
- children: (record === null || record === void 0 ? void 0 : record.groupName) || '默认分组'
68
+ children: (record === null || record === void 0 ? void 0 : record.groupName) || '默认'
67
69
  });
68
70
  }
69
71
  }, {
@@ -109,7 +111,7 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
109
111
  });
110
112
  }
111
113
  }, {
112
- title: '网络代理',
114
+ title: '代理',
113
115
  dataIndex: 'proxyInfo',
114
116
  key: 'proxyInfo',
115
117
  render: function render(proxyInfo, record) {
@@ -131,7 +133,7 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
131
133
  }
132
134
  }, {
133
135
  title: /*#__PURE__*/_jsx(_Fragment, {
134
- children: "\u662F\u5426\u767B\u5F55"
136
+ children: "\u767B\u5F55\u6001"
135
137
  }),
136
138
  dataIndex: 'isLoginValid',
137
139
  key: 'isLoginValid',
@@ -146,12 +148,12 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
146
148
  }
147
149
  }, {
148
150
  title: /*#__PURE__*/_jsx(_Fragment, {
149
- children: "\u89C6\u9891\u6570\u91CF"
151
+ children: "\u89C6\u9891\u91CF"
150
152
  }),
151
153
  dataIndex: 'videoCount',
152
154
  key: 'videoCount'
153
155
  }, {
154
- title: '粉丝数',
156
+ title: '粉丝',
155
157
  dataIndex: 'followerCount',
156
158
  key: 'followerCount',
157
159
  render: function render(followerCount) {
@@ -162,6 +164,28 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
162
164
  precision: 1
163
165
  });
164
166
  }
167
+ }, {
168
+ title: '养号模式的视频文件夹',
169
+ dataIndex: 'videoFromFolder',
170
+ key: 'videoFromFolder',
171
+ render: function render(videoFromFolder, record) {
172
+ var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
173
+ return /*#__PURE__*/_jsx("div", {
174
+ className: "videoFromFolder",
175
+ children: /*#__PURE__*/_jsx(SavePath, {
176
+ path: videoFromFolder,
177
+ placeholder: "\u8BF7\u9009\u62E9\u672C\u5730\u89C6\u9891\u6587\u4EF6\u5939",
178
+ hiddenOpenDir: false
179
+ // disabled={ ! enabled }
180
+ ,
181
+ onChange: function onChange(videoFromFolder) {
182
+ console.log('formData:', videoFromFolder);
183
+ // onVideoFromFolderCreate( id, e );
184
+ onVideoFromFolder(i, videoFromFolder);
185
+ }
186
+ })
187
+ });
188
+ }
165
189
  }, {
166
190
  title: '操作',
167
191
  dataIndex: 'id',
@@ -217,10 +241,37 @@ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
217
241
  }),
218
242
  loadingProxyCreate = _useRequest2.loading,
219
243
  runProxyCreate = _useRequest2.run;
244
+ var _useRequest3 = useRequest(function (id, videoFromFolder) {
245
+ return VideoPublishController.videoFromFolderCreate({
246
+ id: id,
247
+ videoFromFolder: videoFromFolder
248
+ }, {
249
+ env: env
250
+ });
251
+ }, {
252
+ manual: true,
253
+ onSuccess: function onSuccess(result) {
254
+ Tool.toast('已保存');
255
+ // listData.forEach( ( items, i) => {
256
+ // if( items.id !== result.id ){
257
+ // return;
258
+ // }
259
+ // listData[ i ].items = result.items;
260
+ // });
261
+ // setListData([...listData]);
262
+ }
263
+ }),
264
+ runVideoFromFolder = _useRequest3.run,
265
+ loadingVideoFromFolder = _useRequest3.loading;
220
266
  var _onQuery = function onQuery(query) {
221
267
  setQuery(_objectSpread({}, query));
222
268
  runVideoAccount(query);
223
269
  };
270
+ var onVideoFromFolder = function onVideoFromFolder(i, videoFromFolder) {
271
+ listData[i].videoFromFolder = videoFromFolder;
272
+ setListData(_toConsumableArray(listData));
273
+ runVideoFromFolder(listData[i].id, videoFromFolder);
274
+ };
224
275
  var onProxyEdit = function onProxyEdit(nickname, videoAccountId) {
225
276
  var videoAccountProxyId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
226
277
  var dialog = Tool.drawer({
package/dist/lib/Tool.js CHANGED
@@ -1163,6 +1163,13 @@ if (window) {
1163
1163
  // Tool.GData = window._GData;
1164
1164
 
1165
1165
  window._Tool = Tool;
1166
+ setTimeout(function () {
1167
+ if (!window.getBridge) {
1168
+ window.getBridge = function () {
1169
+ return window.bridge;
1170
+ };
1171
+ }
1172
+ }, 1e3);
1166
1173
  }
1167
1174
  Tool.onWindowError();
1168
1175
  export default Tool;
@@ -0,0 +1,4 @@
1
+ export declare const SoundMineType: string[];
2
+ export declare const ImageMineType: string[];
3
+ export declare const VideoMineType: string[];
4
+ export declare const GetMineTypeKind: (path: string) => Global.MineTypeKind;
@@ -0,0 +1,19 @@
1
+ import FileType from "./file-type";
2
+ export var SoundMineType = ['mp3', 'wav', 'flac', 'ape', 'alac', 'mp3', 'aac', 'ogg'];
3
+ export var ImageMineType = ['jpg', 'jpeg', 'png', 'webp' // 'gif',
4
+ ];
5
+
6
+ export var VideoMineType = ['mp4', 'mv4', 'wmv', 'rm', 'rmvb', '3gp', 'mpeg', 'mov', 'm4v', 'avi', 'mkv', 'flv', 'vob', 'webm'];
7
+ export var GetMineTypeKind = function GetMineTypeKind(path) {
8
+ var extName = FileType(path);
9
+ if (VideoMineType.includes(extName)) {
10
+ return 'video';
11
+ }
12
+ if (ImageMineType.includes(extName)) {
13
+ return 'image';
14
+ }
15
+ if (SoundMineType.includes(extName)) {
16
+ return 'sound';
17
+ }
18
+ return '';
19
+ };
@@ -0,0 +1,2 @@
1
+ declare const FileType: (fileUrl?: string, mineType?: string) => string;
2
+ export default FileType;
@@ -0,0 +1,156 @@
1
+ var MineTypes = {
2
+ 'image/bmp': 'bmp',
3
+ 'audio/vnd.dolby.dd-raw': 'ac3',
4
+ 'application/x-apple-diskimage': 'dmg',
5
+ 'application/x-msdownload': 'exe',
6
+ 'application/eps': 'eps',
7
+ 'application/postscript': 'ps',
8
+ 'application/x-compress': 'Z',
9
+ 'image/jpeg': 'jpg',
10
+ 'image/vnd.ms-photo': 'jxr',
11
+ 'application/gzip': 'gz',
12
+ 'application/x-bzip2': 'bz2',
13
+ 'audio/mpeg': 'mp3',
14
+ 'audio/x-musepack': 'mpc',
15
+ 'application/x-shockwave-flash': 'swf',
16
+ 'image/gif': 'gif',
17
+ 'image/flif': 'flif',
18
+ 'image/webp': 'webp',
19
+ 'audio/aiff': 'aif',
20
+ 'image/icns': 'icns',
21
+ 'application/x-xpinstall': 'xpi',
22
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',
23
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',
24
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',
25
+ 'model/3mf': '3mf',
26
+ 'application/epub+zip': 'epub',
27
+ 'application/vnd.oasis.opendocument.text': 'odt',
28
+ 'application/vnd.oasis.opendocument.spreadsheet': 'ods',
29
+ 'application/vnd.oasis.opendocument.presentation': 'odp',
30
+ 'application/zip': 'zip',
31
+ 'audio/opus': 'opus',
32
+ 'audio/ogg': 'ogg',
33
+ 'application/ogg': 'ogx',
34
+ 'image/avif': 'avif',
35
+ 'image/heif': 'heic',
36
+ 'image/heif-sequence': 'heic',
37
+ 'image/heic': 'heic',
38
+ 'image/heic-sequence': 'heic',
39
+ 'video/quicktime': 'mov',
40
+ 'video/x-m4v': 'm4v',
41
+ 'audio/mp4': 'm4b',
42
+ 'audio/x-m4a': 'm4a',
43
+ 'image/x-canon-cr3': 'cr3',
44
+ 'video/3gpp2': '3g2',
45
+ 'video/3gpp': '3gp',
46
+ 'video/mp4': 'mp4',
47
+ 'audio/midi': 'mid',
48
+ 'font/woff': 'woff',
49
+ 'font/woff2': 'woff2',
50
+ 'application/vnd.tcpdump.pcap': 'pcap',
51
+ 'audio/x-dsf': 'dsf',
52
+ 'application/x-lzip': 'lz',
53
+ 'audio/x-flac': 'flac',
54
+ 'image/bpg': 'bpg',
55
+ 'audio/wavpack': 'wv',
56
+ 'application/pdf': 'pdf',
57
+ 'application/wasm': 'wasm',
58
+ 'audio/ape': 'ape',
59
+ 'video/webm': 'webm',
60
+ 'video/x-matroska': 'mkv',
61
+ 'video/vnd.avi': 'avi',
62
+ 'audio/vnd.wave': 'wav',
63
+ 'audio/qcelp': 'qcp',
64
+ 'application/x-sqlite3': 'sqlite',
65
+ 'application/x-nintendo-nes-rom': 'nes',
66
+ 'application/x-google-chrome-extension': 'crx',
67
+ 'application/vnd.ms-cab-compressed': 'cab',
68
+ 'application/x-rpm': 'rpm',
69
+ 'application/zstd': 'zst',
70
+ 'font/otf': 'otf',
71
+ 'audio/amr': 'amr',
72
+ 'application/rtf': 'rtf',
73
+ 'video/x-flv': 'flv',
74
+ 'audio/x-it': 'it',
75
+ 'application/x-lzh-compressed': 'lzh',
76
+ 'video/MP1S': 'mpg',
77
+ 'video/MP2P': 'mpg',
78
+ 'application/vnd.ms-htmlhelp': 'chm',
79
+ 'application/x-xz': 'xz',
80
+ 'application/xml': 'xml',
81
+ 'application/x-7z-compressed': '7z',
82
+ 'application/x-rar-compressed': 'rar',
83
+ 'model/stl': 'stl',
84
+ 'application/x-blender': 'blend',
85
+ 'application/x-deb': 'deb',
86
+ 'application/x-unix-archive': 'ar',
87
+ 'image/png': 'png',
88
+ 'image/apng': 'apng',
89
+ 'application/x-apache-arrow': 'arrow',
90
+ 'model/gltf-binary': 'glb',
91
+ 'image/x-olympus-orf': 'orf',
92
+ 'image/x-xcf': 'xcf',
93
+ 'image/x-panasonic-rw2': 'rw2',
94
+ 'audio/x-ms-asf': 'asf',
95
+ 'video/x-ms-asf': 'asf',
96
+ 'application/vnd.ms-asf': 'ktx',
97
+ 'image/ktx': 'mie',
98
+ 'application/x-mie': 'shp',
99
+ 'application/x-esri-shape': 'jp2',
100
+ 'image/jp2': 'jpx',
101
+ 'image/jpx': 'jpm',
102
+ 'image/jpm': 'mj2',
103
+ 'image/mj2': 'jxl',
104
+ 'image/jxl': 'xml',
105
+ 'video/mpeg': 'ttf',
106
+ 'font/ttf': 'ico',
107
+ 'image/x-icon': 'cur',
108
+ 'application/x-cfb': 'vcf',
109
+ 'text/vcard': 'ics',
110
+ 'text/calendar': 'raf',
111
+ 'image/x-fujifilm-raf': 'xm',
112
+ 'audio/x-xm': 'voc',
113
+ 'audio/x-voc': 'asar',
114
+ 'application/x-asar': 'mxf',
115
+ 'application/mxf': 's3m',
116
+ 'audio/x-s3m': 'mts',
117
+ 'video/mp2t': 'mts',
118
+ 'application/x-mobipocket-ebook': 'dcm',
119
+ 'application/dicom': 'lnk',
120
+ 'application/x.ms.shortcut': 'alias',
121
+ 'application/x.apple.alias': 'eot',
122
+ 'application/vnd.ms-fontobject': 'indd',
123
+ 'application/x-indesign': 'tar',
124
+ 'application/x-tar': 'skp',
125
+ 'application/vnd.sketchup.skp': 'pgp',
126
+ 'application/pgp-encrypted': 'aac',
127
+ 'audio/aac': 'mp3',
128
+ 'image/x-sony-arw': 'dng',
129
+ 'image/x-adobe-dng': 'cr2',
130
+ 'image/x-canon-cr2': 'nef',
131
+ 'image/x-nikon-nef': 'tif',
132
+ 'image/tiff': 'tiff'
133
+ };
134
+ var FileType = function FileType() {
135
+ var fileUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
136
+ var mineType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
137
+ // 先从网址获取;
138
+ var url = fileUrl.replace(/#.+/g, '');
139
+ var laseIndex = url.lastIndexOf('.');
140
+ var extName = url.slice(laseIndex + 1).toLocaleLowerCase();
141
+ var matchExtName = '';
142
+ for (var _mineType in MineTypes) {
143
+ var ext = MineTypes[_mineType];
144
+ if (ext === extName) {
145
+ matchExtName = ext;
146
+ break;
147
+ }
148
+ }
149
+
150
+ // 没找到的话 在判断 mineType
151
+ if (!matchExtName) {
152
+ matchExtName = MineTypes[mineType] || extName;
153
+ }
154
+ return matchExtName;
155
+ };
156
+ export default FileType;
@@ -0,0 +1,14 @@
1
+ export declare const fs: () => any;
2
+ export declare function fsDirVideoList(dir: string): string[];
3
+ export declare function getDirSize(dirPath: string): number;
4
+ export declare function isFileExist(filePath: string): Promise<boolean>;
5
+ export declare function isDirExist(dirPath: string): Promise<boolean>;
6
+ export declare function writeFileText(filePath: string, content: any): Promise<true>;
7
+ export declare function getFileText(filePath: string): Promise<string>;
8
+ export declare function fileRename(oldFilePath: string, newFilePath: string): Promise<true>;
9
+ export declare function fileIno(filePath: string): Promise<number>;
10
+ export declare function getFileSize(filePath: string): Promise<number>;
11
+ export declare function delFile(filePath: string): Promise<unknown>;
12
+ export declare function delDirFiles(dirPath: string, oldTime?: number): Promise<unknown>;
13
+ export declare function mkdir(directory: string): Promise<unknown>;
14
+ export declare function isDirExistCreate(directory: string): Promise<boolean>;