component-shipinlv 2.2.23 → 2.2.27
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/VideoPublish/lib/chrome-quit.d.ts +2 -0
- package/dist/VideoPublish/lib/chrome-quit.js +20 -0
- package/dist/VideoPublish/publish-task-plan/tool.d.ts +3 -0
- package/dist/VideoPublish/publish-task-plan/tool.js +181 -96
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/service/local/LocalServerController.d.ts +1 -0
- package/dist/service/local/LocalServerController.js +32 -0
- package/dist/types/LocalServer.d.ts +7 -0
- package/dist/types/LocalServer.js +0 -0
- package/package.json +1 -1
@@ -0,0 +1,20 @@
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
|
+
import * as LocalServerController from "../../service/local/LocalServerController";
|
4
|
+
var chromeQuit = /*#__PURE__*/function () {
|
5
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query) {
|
6
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
7
|
+
while (1) switch (_context.prev = _context.next) {
|
8
|
+
case 0:
|
9
|
+
return _context.abrupt("return", LocalServerController.chromeQuit(query));
|
10
|
+
case 1:
|
11
|
+
case "end":
|
12
|
+
return _context.stop();
|
13
|
+
}
|
14
|
+
}, _callee);
|
15
|
+
}));
|
16
|
+
return function chromeQuit(_x) {
|
17
|
+
return _ref.apply(this, arguments);
|
18
|
+
};
|
19
|
+
}();
|
20
|
+
export default chromeQuit;
|
@@ -3,6 +3,9 @@ declare class PublishTaskPlanClass {
|
|
3
3
|
isPublishing: boolean;
|
4
4
|
env: Global.Env | '';
|
5
5
|
clientIdentity: string;
|
6
|
+
lastPublishHeart: number;
|
7
|
+
MaxNotHeartSecond: number;
|
8
|
+
taskDetail: PublishTaskPlan.TaskDetail;
|
6
9
|
options: PublishTaskPlan.Options;
|
7
10
|
constructor(env: Global.Env | '', clientIdentity: string | undefined, options: PublishTaskPlan.Options);
|
8
11
|
onInit(): void;
|
@@ -15,6 +15,8 @@ import { notification } from "antd";
|
|
15
15
|
import openChrome from "../../lib/openChrome";
|
16
16
|
import * as LocalVideoPublishTaskController from "../../service/local/VideoPublishTaskController";
|
17
17
|
import isFileExist from "../../component/isFileExist";
|
18
|
+
import Tool from "../../lib/Tool";
|
19
|
+
import chromeQuit from "../lib/chrome-quit";
|
18
20
|
var PublishTaskPlanClass = /*#__PURE__*/function () {
|
19
21
|
function PublishTaskPlanClass(env) {
|
20
22
|
var clientIdentity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
@@ -24,6 +26,20 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
24
26
|
_defineProperty(this, "isPublishing", false);
|
25
27
|
_defineProperty(this, "env", '');
|
26
28
|
_defineProperty(this, "clientIdentity", '');
|
29
|
+
_defineProperty(this, "lastPublishHeart", 0);
|
30
|
+
_defineProperty(this, "MaxNotHeartSecond", 2 * 60);
|
31
|
+
_defineProperty(this, "taskDetail", {
|
32
|
+
emptyLoopTimeSecond: 10,
|
33
|
+
platformVideoAccountId: '',
|
34
|
+
platform: 'douyin',
|
35
|
+
nickname: '',
|
36
|
+
chromeProfileName: '',
|
37
|
+
taskInfo: {
|
38
|
+
taskType: '',
|
39
|
+
taskId: 0
|
40
|
+
},
|
41
|
+
proxyInfo: {}
|
42
|
+
});
|
27
43
|
_defineProperty(this, "options", {
|
28
44
|
// onVideoPublish: ( proxyInfo, query ) => {
|
29
45
|
// return Promise.resolve( true );
|
@@ -38,12 +54,78 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
38
54
|
key: "onInit",
|
39
55
|
value: function onInit() {
|
40
56
|
var _this2 = this;
|
41
|
-
|
42
|
-
|
57
|
+
var _this = this;
|
58
|
+
Tool.event.on('ws-message.publish-video-publish-heart', function (data) {
|
59
|
+
if (data.dataType !== "publish-video-publish-heart") {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
if (_this.lastPublishHeart <= 0) {
|
63
|
+
console.log('last published heart empty:', data);
|
43
64
|
return;
|
44
65
|
}
|
45
|
-
|
46
|
-
|
66
|
+
console.log('last published heart up:', data);
|
67
|
+
_this.lastPublishHeart = Date.now();
|
68
|
+
});
|
69
|
+
setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
70
|
+
var errLog;
|
71
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
73
|
+
case 0:
|
74
|
+
if (!_this.isPublishing) {
|
75
|
+
_context.next = 13;
|
76
|
+
break;
|
77
|
+
}
|
78
|
+
if (!(_this.lastPublishHeart > 0)) {
|
79
|
+
_context.next = 12;
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
if (!(_this.lastPublishHeart + _this.MaxNotHeartSecond * 1e3 < Date.now())) {
|
83
|
+
_context.next = 12;
|
84
|
+
break;
|
85
|
+
}
|
86
|
+
_this.lastPublishHeart = 0;
|
87
|
+
// 浏览器卡住了
|
88
|
+
errLog = {
|
89
|
+
platform: _this.taskDetail.platform,
|
90
|
+
platformAccountId: _this.taskDetail.platformVideoAccountId,
|
91
|
+
code: 'chrome-block',
|
92
|
+
message: '浏览器因为某种原因卡住了',
|
93
|
+
nickname: _this.taskDetail.nickname,
|
94
|
+
status: 'fail',
|
95
|
+
taskId: _this.taskDetail.taskInfo.taskId,
|
96
|
+
eventType: _this.taskDetail.taskInfo.taskType
|
97
|
+
}; // event.run('lo g', errL og);
|
98
|
+
_this.onLog(errLog);
|
99
|
+
_context.next = 8;
|
100
|
+
return _this.onReport(false, errLog.code, errLog.message, {
|
101
|
+
taskType: _this.taskDetail.taskInfo.taskType,
|
102
|
+
taskId: _this.taskDetail.taskInfo.taskId,
|
103
|
+
platform: _this.taskDetail.platform,
|
104
|
+
platformAccountId: _this.taskDetail.platformVideoAccountId
|
105
|
+
}).catch(function (err) {});
|
106
|
+
case 8:
|
107
|
+
_context.next = 10;
|
108
|
+
return chromeQuit({
|
109
|
+
platform: _this.taskDetail.platform,
|
110
|
+
platformVideoAccountId: _this.taskDetail.platformVideoAccountId,
|
111
|
+
chromeProfileName: _this.taskDetail.chromeProfileName
|
112
|
+
}).catch(function (err) {});
|
113
|
+
case 10:
|
114
|
+
// 关闭浏览器,需要时间
|
115
|
+
setTimeout(function () {
|
116
|
+
_this.isPublishing = false;
|
117
|
+
}, 10e3);
|
118
|
+
return _context.abrupt("return");
|
119
|
+
case 12:
|
120
|
+
return _context.abrupt("return");
|
121
|
+
case 13:
|
122
|
+
_this2.getWork();
|
123
|
+
case 14:
|
124
|
+
case "end":
|
125
|
+
return _context.stop();
|
126
|
+
}
|
127
|
+
}, _callee);
|
128
|
+
})), 3e3);
|
47
129
|
|
48
130
|
// chrome 提交的 用户信息;
|
49
131
|
event.on('ws-message.chrome-publish-video-account-info', function (result) {
|
@@ -86,39 +168,40 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
86
168
|
}, {
|
87
169
|
key: "getWork",
|
88
170
|
value: function () {
|
89
|
-
var _getWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
171
|
+
var _getWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
90
172
|
var settingConfig, taskDetail;
|
91
|
-
return _regeneratorRuntime().wrap(function
|
92
|
-
while (1) switch (
|
173
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
174
|
+
while (1) switch (_context2.prev = _context2.next) {
|
93
175
|
case 0:
|
94
176
|
settingConfig = AccountManageSettingConfig();
|
95
177
|
if (!settingConfig.disabledApplyTask) {
|
96
|
-
|
178
|
+
_context2.next = 3;
|
97
179
|
break;
|
98
180
|
}
|
99
|
-
return
|
181
|
+
return _context2.abrupt("return");
|
100
182
|
case 3:
|
101
183
|
this.isPublishing = true;
|
102
|
-
|
184
|
+
_context2.next = 6;
|
103
185
|
return this.onTaskGet().catch(function (err) {});
|
104
186
|
case 6:
|
105
|
-
taskDetail =
|
187
|
+
taskDetail = _context2.sent;
|
106
188
|
if (taskDetail) {
|
107
|
-
|
189
|
+
_context2.next = 12;
|
108
190
|
break;
|
109
191
|
}
|
110
|
-
|
192
|
+
_context2.next = 10;
|
111
193
|
return sleep(this.timeLoopMillisecond);
|
112
194
|
case 10:
|
113
195
|
this.isPublishing = false;
|
114
|
-
return
|
196
|
+
return _context2.abrupt("return");
|
115
197
|
case 12:
|
198
|
+
this.taskDetail = taskDetail;
|
116
199
|
this.doWork(taskDetail);
|
117
|
-
case
|
200
|
+
case 14:
|
118
201
|
case "end":
|
119
|
-
return
|
202
|
+
return _context2.stop();
|
120
203
|
}
|
121
|
-
},
|
204
|
+
}, _callee2, this);
|
122
205
|
}));
|
123
206
|
function getWork() {
|
124
207
|
return _getWork.apply(this, arguments);
|
@@ -128,10 +211,10 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
128
211
|
}, {
|
129
212
|
key: "doWork",
|
130
213
|
value: function () {
|
131
|
-
var _doWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
214
|
+
var _doWork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(taskDetail) {
|
132
215
|
var item, saveBaseData, errExistLog, coverExist, errVideoExistLog, videoExist, result, errMessage, code, errLog;
|
133
|
-
return _regeneratorRuntime().wrap(function
|
134
|
-
while (1) switch (
|
216
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
217
|
+
while (1) switch (_context3.prev = _context3.next) {
|
135
218
|
case 0:
|
136
219
|
if (taskDetail.emptyLoopTimeSecond > 10) {
|
137
220
|
this.timeLoopMillisecond = taskDetail.emptyLoopTimeSecond * 1e3;
|
@@ -139,14 +222,14 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
139
222
|
console.log("taskDetail;", taskDetail);
|
140
223
|
item = taskDetail.taskInfo;
|
141
224
|
if (!(item.taskType === '')) {
|
142
|
-
|
225
|
+
_context3.next = 8;
|
143
226
|
break;
|
144
227
|
}
|
145
228
|
console.log('无任务');
|
146
|
-
|
229
|
+
_context3.next = 7;
|
147
230
|
return this.doWorkWait();
|
148
231
|
case 7:
|
149
|
-
return
|
232
|
+
return _context3.abrupt("return");
|
150
233
|
case 8:
|
151
234
|
saveBaseData = {
|
152
235
|
taskType: item.taskType,
|
@@ -154,20 +237,20 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
154
237
|
platform: taskDetail.platform,
|
155
238
|
platformAccountId: taskDetail.platformVideoAccountId
|
156
239
|
};
|
157
|
-
|
158
|
-
|
240
|
+
_context3.t0 = item.taskType;
|
241
|
+
_context3.next = _context3.t0 === "publish-video" ? 12 : 37;
|
159
242
|
break;
|
160
243
|
case 12:
|
161
244
|
if (item.publishVideo) {
|
162
|
-
|
245
|
+
_context3.next = 16;
|
163
246
|
break;
|
164
247
|
}
|
165
248
|
console.warn("item publishVideo is empty!");
|
166
249
|
this.onReport(false, '', "publishVideo 不存在", saveBaseData);
|
167
|
-
return
|
250
|
+
return _context3.abrupt("break", 43);
|
168
251
|
case 16:
|
169
252
|
if (!item.publishVideo.publishCoverUrl) {
|
170
|
-
|
253
|
+
_context3.next = 22;
|
171
254
|
break;
|
172
255
|
}
|
173
256
|
errExistLog = {
|
@@ -180,10 +263,10 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
180
263
|
taskId: item.taskId,
|
181
264
|
eventType: 'task-kind'
|
182
265
|
};
|
183
|
-
|
266
|
+
_context3.next = 20;
|
184
267
|
return isFileExist(item.publishVideo.publishCoverUrl).catch(function (err) {});
|
185
268
|
case 20:
|
186
|
-
coverExist =
|
269
|
+
coverExist = _context3.sent;
|
187
270
|
if (!coverExist || !coverExist.isExist) {
|
188
271
|
item.publishVideo.publishCoverUrl = '';
|
189
272
|
errExistLog.message = '预判定:封面文件 本身已经不存在(可能被清理删除),将采用系统推荐封面<Divider />';
|
@@ -191,7 +274,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
191
274
|
}
|
192
275
|
case 22:
|
193
276
|
if (!item.publishVideo.videoUrl) {
|
194
|
-
|
277
|
+
_context3.next = 33;
|
195
278
|
break;
|
196
279
|
}
|
197
280
|
errVideoExistLog = {
|
@@ -204,28 +287,28 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
204
287
|
taskId: item.taskId,
|
205
288
|
eventType: 'task-kind'
|
206
289
|
};
|
207
|
-
|
290
|
+
_context3.next = 26;
|
208
291
|
return isFileExist(item.publishVideo.videoUrl).catch(function (err) {});
|
209
292
|
case 26:
|
210
|
-
videoExist =
|
293
|
+
videoExist = _context3.sent;
|
211
294
|
if (!(!videoExist || !videoExist.isExist)) {
|
212
|
-
|
295
|
+
_context3.next = 33;
|
213
296
|
break;
|
214
297
|
}
|
215
298
|
item.publishVideo.publishCoverUrl = '';
|
216
299
|
errVideoExistLog.message = '视频文件 本身已经不存在(可能被清理删除),任务失败';
|
217
300
|
this.onLog(errVideoExistLog);
|
218
301
|
this.onReport(false, '', errVideoExistLog.message, saveBaseData);
|
219
|
-
return
|
302
|
+
return _context3.abrupt("break", 43);
|
220
303
|
case 33:
|
221
|
-
|
304
|
+
_context3.next = 35;
|
222
305
|
return this.onPublishVideo(taskDetail.platform, taskDetail.platformVideoAccountId, taskDetail.nickname, taskDetail.chromeProfileName, taskDetail.taskInfo, taskDetail.proxyInfo).catch(function (err) {
|
223
306
|
console.warn("onPublishVideo err:", err);
|
224
307
|
// this.on Report(false, err?.message, saveBaseData );
|
225
308
|
});
|
226
309
|
case 35:
|
227
|
-
result =
|
228
|
-
return
|
310
|
+
result = _context3.sent;
|
311
|
+
return _context3.abrupt("break", 43);
|
229
312
|
case 37:
|
230
313
|
errMessage = '暂不支持 类型:' + item.taskType;
|
231
314
|
console.log(errMessage);
|
@@ -243,13 +326,13 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
243
326
|
this.onLog(errLog);
|
244
327
|
this.onReport(false, code, errMessage, saveBaseData);
|
245
328
|
case 43:
|
246
|
-
|
329
|
+
_context3.next = 45;
|
247
330
|
return this.doWorkWait();
|
248
331
|
case 45:
|
249
332
|
case "end":
|
250
|
-
return
|
333
|
+
return _context3.stop();
|
251
334
|
}
|
252
|
-
},
|
335
|
+
}, _callee3, this);
|
253
336
|
}));
|
254
337
|
function doWork(_x) {
|
255
338
|
return _doWork.apply(this, arguments);
|
@@ -259,17 +342,17 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
259
342
|
}, {
|
260
343
|
key: "onLog",
|
261
344
|
value: function () {
|
262
|
-
var _onLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
263
|
-
return _regeneratorRuntime().wrap(function
|
264
|
-
while (1) switch (
|
345
|
+
var _onLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {
|
346
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
347
|
+
while (1) switch (_context4.prev = _context4.next) {
|
265
348
|
case 0:
|
266
349
|
event.run('publish-video-log-publish-video', query);
|
267
350
|
this.options.onLog(query);
|
268
351
|
case 2:
|
269
352
|
case "end":
|
270
|
-
return
|
353
|
+
return _context4.stop();
|
271
354
|
}
|
272
|
-
},
|
355
|
+
}, _callee4, this);
|
273
356
|
}));
|
274
357
|
function onLog(_x2) {
|
275
358
|
return _onLog.apply(this, arguments);
|
@@ -279,19 +362,19 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
279
362
|
}, {
|
280
363
|
key: "doWorkWait",
|
281
364
|
value: function () {
|
282
|
-
var _doWorkWait = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
283
|
-
return _regeneratorRuntime().wrap(function
|
284
|
-
while (1) switch (
|
365
|
+
var _doWorkWait = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
366
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
367
|
+
while (1) switch (_context5.prev = _context5.next) {
|
285
368
|
case 0:
|
286
|
-
|
369
|
+
_context5.next = 2;
|
287
370
|
return sleep(this.timeLoopMillisecond);
|
288
371
|
case 2:
|
289
372
|
this.isPublishing = false;
|
290
373
|
case 3:
|
291
374
|
case "end":
|
292
|
-
return
|
375
|
+
return _context5.stop();
|
293
376
|
}
|
294
|
-
},
|
377
|
+
}, _callee5, this);
|
295
378
|
}));
|
296
379
|
function doWorkWait() {
|
297
380
|
return _doWorkWait.apply(this, arguments);
|
@@ -320,24 +403,24 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
320
403
|
}, {
|
321
404
|
key: "onTaskGet",
|
322
405
|
value: function () {
|
323
|
-
var _onTaskGet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
406
|
+
var _onTaskGet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
324
407
|
var env;
|
325
|
-
return _regeneratorRuntime().wrap(function
|
326
|
-
while (1) switch (
|
408
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
409
|
+
while (1) switch (_context6.prev = _context6.next) {
|
327
410
|
case 0:
|
328
411
|
event.run('task-apply');
|
329
412
|
env = this.env;
|
330
|
-
|
413
|
+
_context6.next = 4;
|
331
414
|
return VideoPublishCrawlerTaskController.apply({}, {
|
332
415
|
env: env
|
333
416
|
});
|
334
417
|
case 4:
|
335
|
-
return
|
418
|
+
return _context6.abrupt("return", _context6.sent);
|
336
419
|
case 5:
|
337
420
|
case "end":
|
338
|
-
return
|
421
|
+
return _context6.stop();
|
339
422
|
}
|
340
|
-
},
|
423
|
+
}, _callee6, this);
|
341
424
|
}));
|
342
425
|
function onTaskGet() {
|
343
426
|
return _onTaskGet.apply(this, arguments);
|
@@ -347,25 +430,26 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
347
430
|
}, {
|
348
431
|
key: "onPublishVideo",
|
349
432
|
value: function () {
|
350
|
-
var _onPublishVideo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
433
|
+
var _onPublishVideo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(platform, platformVideoAccountId, nickname, chromeProfileName, taskInfo, proxyInfo) {
|
351
434
|
var _this3 = this;
|
352
435
|
var _this;
|
353
|
-
return _regeneratorRuntime().wrap(function
|
354
|
-
while (1) switch (
|
436
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
437
|
+
while (1) switch (_context9.prev = _context9.next) {
|
355
438
|
case 0:
|
356
439
|
_this = this; // 发布抖音视频
|
357
|
-
|
440
|
+
_context9.next = 3;
|
358
441
|
return sleep(1);
|
359
442
|
case 3:
|
360
|
-
return
|
361
|
-
var
|
443
|
+
return _context9.abrupt("return", new Promise( /*#__PURE__*/function () {
|
444
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(resolve, reject) {
|
362
445
|
var settingConfig, publishResult, finishLog;
|
363
|
-
return _regeneratorRuntime().wrap(function
|
364
|
-
while (1) switch (
|
446
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
447
|
+
while (1) switch (_context8.prev = _context8.next) {
|
365
448
|
case 0:
|
366
449
|
settingConfig = AccountManageSettingConfig();
|
367
450
|
console.log('settingConfig 1:', settingConfig);
|
368
|
-
|
451
|
+
_this.lastPublishHeart = Date.now();
|
452
|
+
_context8.next = 5;
|
369
453
|
return _this.onPublishVideoDo(proxyInfo, {
|
370
454
|
platformVideoAccountId: platformVideoAccountId,
|
371
455
|
platform: platform,
|
@@ -388,11 +472,11 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
388
472
|
// }
|
389
473
|
// },
|
390
474
|
}, settingConfig).catch( /*#__PURE__*/function () {
|
391
|
-
var
|
475
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err) {
|
392
476
|
var _err$message;
|
393
477
|
var msgInfo, code, message, errLog, errNew;
|
394
|
-
return _regeneratorRuntime().wrap(function
|
395
|
-
while (1) switch (
|
478
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
479
|
+
while (1) switch (_context7.prev = _context7.next) {
|
396
480
|
case 0:
|
397
481
|
// 基本不会到这里
|
398
482
|
console.warn('bridge. video Publish err:', err.code, err);
|
@@ -424,7 +508,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
424
508
|
});
|
425
509
|
|
426
510
|
// 等一会,清理现场,关闭 chrome
|
427
|
-
|
511
|
+
_context7.next = 10;
|
428
512
|
return sleep(10e3);
|
429
513
|
case 10:
|
430
514
|
errNew = new Error(err === null || err === void 0 ? void 0 : err.message);
|
@@ -434,23 +518,24 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
434
518
|
// resolve( err );
|
435
519
|
case 13:
|
436
520
|
case "end":
|
437
|
-
return
|
521
|
+
return _context7.stop();
|
438
522
|
}
|
439
|
-
},
|
523
|
+
}, _callee7);
|
440
524
|
}));
|
441
525
|
return function (_x11) {
|
442
|
-
return
|
526
|
+
return _ref3.apply(this, arguments);
|
443
527
|
};
|
444
528
|
}());
|
445
|
-
case
|
446
|
-
publishResult =
|
529
|
+
case 5:
|
530
|
+
publishResult = _context8.sent;
|
531
|
+
_this.lastPublishHeart = 0;
|
447
532
|
if (publishResult) {
|
448
|
-
|
533
|
+
_context8.next = 10;
|
449
534
|
break;
|
450
535
|
}
|
451
536
|
console.log('publishResult empty');
|
452
|
-
return
|
453
|
-
case
|
537
|
+
return _context8.abrupt("return", publishResult);
|
538
|
+
case 10:
|
454
539
|
console.log("publishResult:", publishResult);
|
455
540
|
finishLog = {
|
456
541
|
platform: platform,
|
@@ -463,9 +548,9 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
463
548
|
eventType: 'publish-video'
|
464
549
|
}; // event.run('lo g', errLog);
|
465
550
|
_this3.onLog(finishLog);
|
466
|
-
|
551
|
+
_context8.next = 15;
|
467
552
|
return sleep(1);
|
468
|
-
case
|
553
|
+
case 15:
|
469
554
|
_this3.onReport(true, '', '', {
|
470
555
|
taskType: taskInfo.taskType,
|
471
556
|
taskId: taskInfo.taskId,
|
@@ -474,25 +559,25 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
474
559
|
});
|
475
560
|
|
476
561
|
// 等一会,清理现场,关闭 chrome
|
477
|
-
|
562
|
+
_context8.next = 18;
|
478
563
|
return sleep(10e3);
|
479
|
-
case
|
564
|
+
case 18:
|
480
565
|
resolve(true);
|
481
|
-
case
|
566
|
+
case 19:
|
482
567
|
case "end":
|
483
|
-
return
|
568
|
+
return _context8.stop();
|
484
569
|
}
|
485
|
-
},
|
570
|
+
}, _callee8);
|
486
571
|
}));
|
487
572
|
return function (_x9, _x10) {
|
488
|
-
return
|
573
|
+
return _ref2.apply(this, arguments);
|
489
574
|
};
|
490
575
|
}()));
|
491
576
|
case 4:
|
492
577
|
case "end":
|
493
|
-
return
|
578
|
+
return _context9.stop();
|
494
579
|
}
|
495
|
-
},
|
580
|
+
}, _callee9, this);
|
496
581
|
}));
|
497
582
|
function onPublishVideo(_x3, _x4, _x5, _x6, _x7, _x8) {
|
498
583
|
return _onPublishVideo.apply(this, arguments);
|
@@ -502,14 +587,14 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
502
587
|
}, {
|
503
588
|
key: "onPublishVideoDo",
|
504
589
|
value: function () {
|
505
|
-
var _onPublishVideoDo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
590
|
+
var _onPublishVideoDo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(proxyInfo, query, settingConfig) {
|
506
591
|
var _this4 = this;
|
507
592
|
var _this;
|
508
|
-
return _regeneratorRuntime().wrap(function
|
509
|
-
while (1) switch (
|
593
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
594
|
+
while (1) switch (_context10.prev = _context10.next) {
|
510
595
|
case 0:
|
511
596
|
_this = this;
|
512
|
-
return
|
597
|
+
return _context10.abrupt("return", new Promise(function (resolve, reject) {
|
513
598
|
var isOpened = false;
|
514
599
|
var sse = new SSE("http://localhost:".concat(window.__ShipinlvLocalServerPort || 61805, "/").concat("chrome/applyForPublishTaskSse".toLocaleLowerCase(), "?") + param({
|
515
600
|
data: JSON.stringify(_objectSpread(_objectSpread({}, query), {}, {
|
@@ -615,9 +700,9 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
|
|
615
700
|
}));
|
616
701
|
case 2:
|
617
702
|
case "end":
|
618
|
-
return
|
703
|
+
return _context10.stop();
|
619
704
|
}
|
620
|
-
},
|
705
|
+
}, _callee10, this);
|
621
706
|
}));
|
622
707
|
function onPublishVideoDo(_x12, _x13, _x14) {
|
623
708
|
return _onPublishVideoDo.apply(this, arguments);
|
package/dist/lib/Tool.d.ts
CHANGED
@@ -162,7 +162,7 @@ declare const Tool: {
|
|
162
162
|
getTitleByPath(path: string): string;
|
163
163
|
getDirByPath(path: string): string;
|
164
164
|
h5Pay(query: Pay.H5PayQuery): void;
|
165
|
-
notification(type: "
|
165
|
+
notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
166
166
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
167
167
|
notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
168
168
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function chromeQuit(body: LocalServer.ChromeQuitQuery, options?: Global.RequestOptions): Promise<PublishTaskPlan.TaskDetail>;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
|
+
import request from "../../lib/request";
|
5
|
+
import AccountManageSettingConfig from "../../lib/accountManageSettingConfig";
|
6
|
+
export function chromeQuit(_x, _x2) {
|
7
|
+
return _chromeQuit.apply(this, arguments);
|
8
|
+
}
|
9
|
+
function _chromeQuit() {
|
10
|
+
_chromeQuit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
11
|
+
var setting;
|
12
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
13
|
+
while (1) switch (_context.prev = _context.next) {
|
14
|
+
case 0:
|
15
|
+
setting = AccountManageSettingConfig();
|
16
|
+
return _context.abrupt("return", request("http://127.0.0.1:".concat(window.__ShipinlvLocalServerPort, "/chrome/quit"), _objectSpread({
|
17
|
+
method: 'POST',
|
18
|
+
headers: {
|
19
|
+
'Content-Type': 'application/json'
|
20
|
+
},
|
21
|
+
data: _objectSpread({}, body),
|
22
|
+
timeout: 10e3,
|
23
|
+
silent: true
|
24
|
+
}, options || {})));
|
25
|
+
case 2:
|
26
|
+
case "end":
|
27
|
+
return _context.stop();
|
28
|
+
}
|
29
|
+
}, _callee);
|
30
|
+
}));
|
31
|
+
return _chromeQuit.apply(this, arguments);
|
32
|
+
}
|
File without changes
|