@iflyrpa/actions 1.0.2 → 1.0.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/dist/index.cjs
CHANGED
|
@@ -11,8 +11,7 @@ const require$$4 = require('https');
|
|
|
11
11
|
const require$$0 = require('url');
|
|
12
12
|
const require$$6 = require('fs');
|
|
13
13
|
const require$$4$1 = require('assert');
|
|
14
|
-
const require$$1
|
|
15
|
-
const require$$0$1 = require('os');
|
|
14
|
+
const require$$0$1 = require('tty');
|
|
16
15
|
const zlib = require('zlib');
|
|
17
16
|
const events$1 = require('events');
|
|
18
17
|
|
|
@@ -29,7 +28,6 @@ const require$$4__default = /*#__PURE__*/_interopDefaultCompat(require$$4);
|
|
|
29
28
|
const require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);
|
|
30
29
|
const require$$6__default = /*#__PURE__*/_interopDefaultCompat(require$$6);
|
|
31
30
|
const require$$4__default$1 = /*#__PURE__*/_interopDefaultCompat(require$$4$1);
|
|
32
|
-
const require$$1__default$2 = /*#__PURE__*/_interopDefaultCompat(require$$1$2);
|
|
33
31
|
const require$$0__default$1 = /*#__PURE__*/_interopDefaultCompat(require$$0$1);
|
|
34
32
|
const zlib__default = /*#__PURE__*/_interopDefaultCompat(zlib);
|
|
35
33
|
|
|
@@ -14406,7 +14404,7 @@ var followRedirects$1 = {exports: {}};
|
|
|
14406
14404
|
|
|
14407
14405
|
var src = {exports: {}};
|
|
14408
14406
|
|
|
14409
|
-
var browser = {exports: {}};
|
|
14407
|
+
var browser$1 = {exports: {}};
|
|
14410
14408
|
|
|
14411
14409
|
/**
|
|
14412
14410
|
* Helpers.
|
|
@@ -14863,11 +14861,11 @@ function requireCommon () {
|
|
|
14863
14861
|
|
|
14864
14862
|
/* eslint-env browser */
|
|
14865
14863
|
|
|
14866
|
-
var hasRequiredBrowser;
|
|
14864
|
+
var hasRequiredBrowser$1;
|
|
14867
14865
|
|
|
14868
|
-
function requireBrowser () {
|
|
14869
|
-
if (hasRequiredBrowser) return browser.exports;
|
|
14870
|
-
hasRequiredBrowser = 1;
|
|
14866
|
+
function requireBrowser$1 () {
|
|
14867
|
+
if (hasRequiredBrowser$1) return browser$1.exports;
|
|
14868
|
+
hasRequiredBrowser$1 = 1;
|
|
14871
14869
|
(function (module, exports) {
|
|
14872
14870
|
/**
|
|
14873
14871
|
* This is the web browser implementation of `debug()`.
|
|
@@ -15138,169 +15136,43 @@ function requireBrowser () {
|
|
|
15138
15136
|
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
15139
15137
|
}
|
|
15140
15138
|
};
|
|
15141
|
-
} (browser, browser.exports));
|
|
15142
|
-
return browser.exports;
|
|
15139
|
+
} (browser$1, browser$1.exports));
|
|
15140
|
+
return browser$1.exports;
|
|
15143
15141
|
}
|
|
15144
15142
|
|
|
15145
15143
|
var node = {exports: {}};
|
|
15146
15144
|
|
|
15147
|
-
|
|
15148
|
-
var hasRequiredHasFlag;
|
|
15149
|
-
|
|
15150
|
-
function requireHasFlag () {
|
|
15151
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
15152
|
-
hasRequiredHasFlag = 1;
|
|
15153
|
-
|
|
15154
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
15155
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
15156
|
-
const position = argv.indexOf(prefix + flag);
|
|
15157
|
-
const terminatorPosition = argv.indexOf('--');
|
|
15158
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
15159
|
-
};
|
|
15160
|
-
return hasFlag;
|
|
15161
|
-
}
|
|
15162
|
-
|
|
15163
|
-
var supportsColor_1;
|
|
15164
|
-
var hasRequiredSupportsColor;
|
|
15165
|
-
|
|
15166
|
-
function requireSupportsColor () {
|
|
15167
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
15168
|
-
hasRequiredSupportsColor = 1;
|
|
15169
|
-
const os = require$$0__default$1;
|
|
15170
|
-
const tty = require$$1__default$2;
|
|
15171
|
-
const hasFlag = requireHasFlag();
|
|
15172
|
-
|
|
15173
|
-
const {env} = process;
|
|
15174
|
-
|
|
15175
|
-
let forceColor;
|
|
15176
|
-
if (hasFlag('no-color') ||
|
|
15177
|
-
hasFlag('no-colors') ||
|
|
15178
|
-
hasFlag('color=false') ||
|
|
15179
|
-
hasFlag('color=never')) {
|
|
15180
|
-
forceColor = 0;
|
|
15181
|
-
} else if (hasFlag('color') ||
|
|
15182
|
-
hasFlag('colors') ||
|
|
15183
|
-
hasFlag('color=true') ||
|
|
15184
|
-
hasFlag('color=always')) {
|
|
15185
|
-
forceColor = 1;
|
|
15186
|
-
}
|
|
15187
|
-
|
|
15188
|
-
if ('FORCE_COLOR' in env) {
|
|
15189
|
-
if (env.FORCE_COLOR === 'true') {
|
|
15190
|
-
forceColor = 1;
|
|
15191
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
15192
|
-
forceColor = 0;
|
|
15193
|
-
} else {
|
|
15194
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
15195
|
-
}
|
|
15196
|
-
}
|
|
15197
|
-
|
|
15198
|
-
function translateLevel(level) {
|
|
15199
|
-
if (level === 0) {
|
|
15200
|
-
return false;
|
|
15201
|
-
}
|
|
15202
|
-
|
|
15203
|
-
return {
|
|
15204
|
-
level,
|
|
15205
|
-
hasBasic: true,
|
|
15206
|
-
has256: level >= 2,
|
|
15207
|
-
has16m: level >= 3
|
|
15208
|
-
};
|
|
15209
|
-
}
|
|
15210
|
-
|
|
15211
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
15212
|
-
if (forceColor === 0) {
|
|
15213
|
-
return 0;
|
|
15214
|
-
}
|
|
15215
|
-
|
|
15216
|
-
if (hasFlag('color=16m') ||
|
|
15217
|
-
hasFlag('color=full') ||
|
|
15218
|
-
hasFlag('color=truecolor')) {
|
|
15219
|
-
return 3;
|
|
15220
|
-
}
|
|
15221
|
-
|
|
15222
|
-
if (hasFlag('color=256')) {
|
|
15223
|
-
return 2;
|
|
15224
|
-
}
|
|
15225
|
-
|
|
15226
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
15227
|
-
return 0;
|
|
15228
|
-
}
|
|
15229
|
-
|
|
15230
|
-
const min = forceColor || 0;
|
|
15231
|
-
|
|
15232
|
-
if (env.TERM === 'dumb') {
|
|
15233
|
-
return min;
|
|
15234
|
-
}
|
|
15235
|
-
|
|
15236
|
-
if (process.platform === 'win32') {
|
|
15237
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
15238
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
15239
|
-
const osRelease = os.release().split('.');
|
|
15240
|
-
if (
|
|
15241
|
-
Number(osRelease[0]) >= 10 &&
|
|
15242
|
-
Number(osRelease[2]) >= 10586
|
|
15243
|
-
) {
|
|
15244
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
15245
|
-
}
|
|
15246
|
-
|
|
15247
|
-
return 1;
|
|
15248
|
-
}
|
|
15249
|
-
|
|
15250
|
-
if ('CI' in env) {
|
|
15251
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
15252
|
-
return 1;
|
|
15253
|
-
}
|
|
15254
|
-
|
|
15255
|
-
return min;
|
|
15256
|
-
}
|
|
15257
|
-
|
|
15258
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
15259
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
15260
|
-
}
|
|
15261
|
-
|
|
15262
|
-
if (env.COLORTERM === 'truecolor') {
|
|
15263
|
-
return 3;
|
|
15264
|
-
}
|
|
15265
|
-
|
|
15266
|
-
if ('TERM_PROGRAM' in env) {
|
|
15267
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
15145
|
+
/* eslint-env browser */
|
|
15268
15146
|
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
return version >= 3 ? 3 : 2;
|
|
15272
|
-
case 'Apple_Terminal':
|
|
15273
|
-
return 2;
|
|
15274
|
-
// No default
|
|
15275
|
-
}
|
|
15276
|
-
}
|
|
15147
|
+
var browser;
|
|
15148
|
+
var hasRequiredBrowser;
|
|
15277
15149
|
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15150
|
+
function requireBrowser () {
|
|
15151
|
+
if (hasRequiredBrowser) return browser;
|
|
15152
|
+
hasRequiredBrowser = 1;
|
|
15281
15153
|
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
}
|
|
15154
|
+
function getChromeVersion() {
|
|
15155
|
+
const matches = /(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);
|
|
15285
15156
|
|
|
15286
|
-
if (
|
|
15287
|
-
return
|
|
15157
|
+
if (!matches) {
|
|
15158
|
+
return;
|
|
15288
15159
|
}
|
|
15289
15160
|
|
|
15290
|
-
return
|
|
15161
|
+
return Number.parseInt(matches.groups.chromeVersion, 10);
|
|
15291
15162
|
}
|
|
15292
15163
|
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15164
|
+
const colorSupport = getChromeVersion() >= 69 ? {
|
|
15165
|
+
level: 1,
|
|
15166
|
+
hasBasic: true,
|
|
15167
|
+
has256: false,
|
|
15168
|
+
has16m: false
|
|
15169
|
+
} : false;
|
|
15297
15170
|
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
15171
|
+
browser = {
|
|
15172
|
+
stdout: colorSupport,
|
|
15173
|
+
stderr: colorSupport
|
|
15302
15174
|
};
|
|
15303
|
-
return
|
|
15175
|
+
return browser;
|
|
15304
15176
|
}
|
|
15305
15177
|
|
|
15306
15178
|
/**
|
|
@@ -15313,7 +15185,7 @@ function requireNode () {
|
|
|
15313
15185
|
if (hasRequiredNode) return node.exports;
|
|
15314
15186
|
hasRequiredNode = 1;
|
|
15315
15187
|
(function (module, exports) {
|
|
15316
|
-
const tty = require$$
|
|
15188
|
+
const tty = require$$0__default$1;
|
|
15317
15189
|
const util = require$$1__default;
|
|
15318
15190
|
|
|
15319
15191
|
/**
|
|
@@ -15340,7 +15212,7 @@ function requireNode () {
|
|
|
15340
15212
|
try {
|
|
15341
15213
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
15342
15214
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
15343
|
-
const supportsColor =
|
|
15215
|
+
const supportsColor = requireBrowser();
|
|
15344
15216
|
|
|
15345
15217
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
15346
15218
|
exports.colors = [
|
|
@@ -15587,7 +15459,7 @@ function requireSrc () {
|
|
|
15587
15459
|
if (hasRequiredSrc) return src.exports;
|
|
15588
15460
|
hasRequiredSrc = 1;
|
|
15589
15461
|
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
15590
|
-
src.exports = requireBrowser();
|
|
15462
|
+
src.exports = requireBrowser$1();
|
|
15591
15463
|
} else {
|
|
15592
15464
|
src.exports = requireNode();
|
|
15593
15465
|
}
|
|
@@ -21798,7 +21670,8 @@ const mockAction$5 = async (task, params) => {
|
|
|
21798
21670
|
defaultErrorMsg: "\u83B7\u53D6\u767E\u5BB6\u53F7appid\u63A5\u53E3\u62A5\u9519"
|
|
21799
21671
|
});
|
|
21800
21672
|
const appId = appIdInfo.data.data.user.app_id;
|
|
21801
|
-
const uploadImages = async (
|
|
21673
|
+
const uploadImages = async (_images) => {
|
|
21674
|
+
const images = _images.filter((url) => !!url && url.trim() !== "");
|
|
21802
21675
|
const localImages = await Promise.all(
|
|
21803
21676
|
images.map((url) => {
|
|
21804
21677
|
const fileName = getFilenameFromUrl(url);
|
|
@@ -22575,8 +22448,8 @@ const mockAction = async (task, params) => {
|
|
|
22575
22448
|
};
|
|
22576
22449
|
|
|
22577
22450
|
const visibleRangeTexts = {
|
|
22578
|
-
public: "\u516C\u5F00",
|
|
22579
|
-
private: "\
|
|
22451
|
+
public: "\u516C\u5F00\u53EF\u89C1",
|
|
22452
|
+
private: "\u4EC5\u81EA\u5DF1\u53EF\u89C1"
|
|
22580
22453
|
};
|
|
22581
22454
|
const rpaAction = async (task, params) => {
|
|
22582
22455
|
const commonCookies = {
|
|
@@ -22597,9 +22470,7 @@ const rpaAction = async (task, params) => {
|
|
|
22597
22470
|
const instance = typeof selector === "string" ? page.locator(selector) : selector;
|
|
22598
22471
|
await instance.click();
|
|
22599
22472
|
await instance.locator("input").fill(address);
|
|
22600
|
-
const poperInstance = page.locator(
|
|
22601
|
-
'.d-popover:not([style*="display: none"]) .d-options .d-grid-item'
|
|
22602
|
-
);
|
|
22473
|
+
const poperInstance = page.locator('.d-popover:not([style*="display: none"]) .d-options .d-grid-item');
|
|
22603
22474
|
await poperInstance.first().waitFor();
|
|
22604
22475
|
await poperInstance.first().click();
|
|
22605
22476
|
};
|
|
@@ -22631,7 +22502,7 @@ const rpaAction = async (task, params) => {
|
|
|
22631
22502
|
const titleInstance = page.locator(".input.titleInput input");
|
|
22632
22503
|
await titleInstance.click();
|
|
22633
22504
|
await titleInstance.fill(params.title);
|
|
22634
|
-
const descInstance = page.locator("#
|
|
22505
|
+
const descInstance = page.locator(".editor-container #quillEditor .ql-editor");
|
|
22635
22506
|
await descInstance.click();
|
|
22636
22507
|
await descInstance.fill(params.content);
|
|
22637
22508
|
const container = page.locator(".creator-container .content .scroll-content");
|
|
@@ -22645,9 +22516,7 @@ const rpaAction = async (task, params) => {
|
|
|
22645
22516
|
}
|
|
22646
22517
|
if (params.selfDeclaration) {
|
|
22647
22518
|
await page.locator(".declaration-wrapper").click();
|
|
22648
|
-
const selfDeclarationInstance = page.locator(
|
|
22649
|
-
".el-popper[aria-hidden=false] ul li[role=menuitem]"
|
|
22650
|
-
);
|
|
22519
|
+
const selfDeclarationInstance = page.locator(".el-popper[aria-hidden=false] ul li[role=menuitem]");
|
|
22651
22520
|
if (params.selfDeclaration.type === "fictional-rendition") {
|
|
22652
22521
|
await selfDeclarationInstance.filter({ hasText: "\u865A\u6784\u6F14\u7ECE\uFF0C\u4EC5\u4F9B\u5A31\u4E50" }).click();
|
|
22653
22522
|
} else if (params.selfDeclaration.type === "ai-generated") {
|
|
@@ -22657,7 +22526,7 @@ const rpaAction = async (task, params) => {
|
|
|
22657
22526
|
const selfDeclarationSecondaryMenuInstance = page.locator(".el-popper[aria-hidden=false] .el-cascader-menu").nth(1).locator("ul li[role=menuitem]");
|
|
22658
22527
|
await selfDeclarationSecondaryMenuInstance.first().waitFor();
|
|
22659
22528
|
if (params.selfDeclaration.childType === "self-labeling") {
|
|
22660
|
-
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u5DF2\u81EA\u4E3B\u6807\u6CE8" }).click();
|
|
22529
|
+
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u5DF2\u5728\u6B63\u6587\u4E2D\u81EA\u4E3B\u6807\u6CE8" }).click();
|
|
22661
22530
|
} else if (params.selfDeclaration.childType === "self-shooting") {
|
|
22662
22531
|
const { shootingDate, shootingLocation } = params.selfDeclaration;
|
|
22663
22532
|
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u81EA\u4E3B\u62CD\u6444" }).click();
|
|
@@ -22665,16 +22534,10 @@ const rpaAction = async (task, params) => {
|
|
|
22665
22534
|
await selfShootingPopup.waitFor();
|
|
22666
22535
|
const hasCustomContent = shootingDate || shootingLocation;
|
|
22667
22536
|
if (shootingLocation) {
|
|
22668
|
-
await selectAddress(
|
|
22669
|
-
selfShootingPopup.locator(".address-input"),
|
|
22670
|
-
shootingLocation
|
|
22671
|
-
);
|
|
22537
|
+
await selectAddress(selfShootingPopup.locator(".address-input"), shootingLocation);
|
|
22672
22538
|
}
|
|
22673
22539
|
if (shootingDate) {
|
|
22674
|
-
await selectDate(
|
|
22675
|
-
selfShootingPopup.locator(".date-picker input"),
|
|
22676
|
-
shootingDate
|
|
22677
|
-
);
|
|
22540
|
+
await selectDate(selfShootingPopup.locator(".date-picker input"), shootingDate);
|
|
22678
22541
|
}
|
|
22679
22542
|
await selfShootingPopup.locator("footer button").filter({ hasText: hasCustomContent ? "\u786E\u8BA4" : "\u53D6\u6D88" }).click();
|
|
22680
22543
|
} else if (params.selfDeclaration.childType === "transshipment") {
|
package/dist/index.mjs
CHANGED
|
@@ -9,8 +9,7 @@ import require$$4 from 'https';
|
|
|
9
9
|
import require$$0 from 'url';
|
|
10
10
|
import require$$6 from 'fs';
|
|
11
11
|
import require$$4$1 from 'assert';
|
|
12
|
-
import require$$1
|
|
13
|
-
import require$$0$1 from 'os';
|
|
12
|
+
import require$$0$1 from 'tty';
|
|
14
13
|
import zlib from 'zlib';
|
|
15
14
|
import { EventEmitter } from 'events';
|
|
16
15
|
|
|
@@ -14387,7 +14386,7 @@ var followRedirects$1 = {exports: {}};
|
|
|
14387
14386
|
|
|
14388
14387
|
var src = {exports: {}};
|
|
14389
14388
|
|
|
14390
|
-
var browser = {exports: {}};
|
|
14389
|
+
var browser$1 = {exports: {}};
|
|
14391
14390
|
|
|
14392
14391
|
/**
|
|
14393
14392
|
* Helpers.
|
|
@@ -14844,11 +14843,11 @@ function requireCommon () {
|
|
|
14844
14843
|
|
|
14845
14844
|
/* eslint-env browser */
|
|
14846
14845
|
|
|
14847
|
-
var hasRequiredBrowser;
|
|
14846
|
+
var hasRequiredBrowser$1;
|
|
14848
14847
|
|
|
14849
|
-
function requireBrowser () {
|
|
14850
|
-
if (hasRequiredBrowser) return browser.exports;
|
|
14851
|
-
hasRequiredBrowser = 1;
|
|
14848
|
+
function requireBrowser$1 () {
|
|
14849
|
+
if (hasRequiredBrowser$1) return browser$1.exports;
|
|
14850
|
+
hasRequiredBrowser$1 = 1;
|
|
14852
14851
|
(function (module, exports) {
|
|
14853
14852
|
/**
|
|
14854
14853
|
* This is the web browser implementation of `debug()`.
|
|
@@ -15119,169 +15118,43 @@ function requireBrowser () {
|
|
|
15119
15118
|
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
15120
15119
|
}
|
|
15121
15120
|
};
|
|
15122
|
-
} (browser, browser.exports));
|
|
15123
|
-
return browser.exports;
|
|
15121
|
+
} (browser$1, browser$1.exports));
|
|
15122
|
+
return browser$1.exports;
|
|
15124
15123
|
}
|
|
15125
15124
|
|
|
15126
15125
|
var node = {exports: {}};
|
|
15127
15126
|
|
|
15128
|
-
|
|
15129
|
-
var hasRequiredHasFlag;
|
|
15130
|
-
|
|
15131
|
-
function requireHasFlag () {
|
|
15132
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
15133
|
-
hasRequiredHasFlag = 1;
|
|
15134
|
-
|
|
15135
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
15136
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
15137
|
-
const position = argv.indexOf(prefix + flag);
|
|
15138
|
-
const terminatorPosition = argv.indexOf('--');
|
|
15139
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
15140
|
-
};
|
|
15141
|
-
return hasFlag;
|
|
15142
|
-
}
|
|
15143
|
-
|
|
15144
|
-
var supportsColor_1;
|
|
15145
|
-
var hasRequiredSupportsColor;
|
|
15146
|
-
|
|
15147
|
-
function requireSupportsColor () {
|
|
15148
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
15149
|
-
hasRequiredSupportsColor = 1;
|
|
15150
|
-
const os = require$$0$1;
|
|
15151
|
-
const tty = require$$1$2;
|
|
15152
|
-
const hasFlag = requireHasFlag();
|
|
15153
|
-
|
|
15154
|
-
const {env} = process;
|
|
15155
|
-
|
|
15156
|
-
let forceColor;
|
|
15157
|
-
if (hasFlag('no-color') ||
|
|
15158
|
-
hasFlag('no-colors') ||
|
|
15159
|
-
hasFlag('color=false') ||
|
|
15160
|
-
hasFlag('color=never')) {
|
|
15161
|
-
forceColor = 0;
|
|
15162
|
-
} else if (hasFlag('color') ||
|
|
15163
|
-
hasFlag('colors') ||
|
|
15164
|
-
hasFlag('color=true') ||
|
|
15165
|
-
hasFlag('color=always')) {
|
|
15166
|
-
forceColor = 1;
|
|
15167
|
-
}
|
|
15168
|
-
|
|
15169
|
-
if ('FORCE_COLOR' in env) {
|
|
15170
|
-
if (env.FORCE_COLOR === 'true') {
|
|
15171
|
-
forceColor = 1;
|
|
15172
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
15173
|
-
forceColor = 0;
|
|
15174
|
-
} else {
|
|
15175
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
15176
|
-
}
|
|
15177
|
-
}
|
|
15178
|
-
|
|
15179
|
-
function translateLevel(level) {
|
|
15180
|
-
if (level === 0) {
|
|
15181
|
-
return false;
|
|
15182
|
-
}
|
|
15183
|
-
|
|
15184
|
-
return {
|
|
15185
|
-
level,
|
|
15186
|
-
hasBasic: true,
|
|
15187
|
-
has256: level >= 2,
|
|
15188
|
-
has16m: level >= 3
|
|
15189
|
-
};
|
|
15190
|
-
}
|
|
15191
|
-
|
|
15192
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
15193
|
-
if (forceColor === 0) {
|
|
15194
|
-
return 0;
|
|
15195
|
-
}
|
|
15196
|
-
|
|
15197
|
-
if (hasFlag('color=16m') ||
|
|
15198
|
-
hasFlag('color=full') ||
|
|
15199
|
-
hasFlag('color=truecolor')) {
|
|
15200
|
-
return 3;
|
|
15201
|
-
}
|
|
15202
|
-
|
|
15203
|
-
if (hasFlag('color=256')) {
|
|
15204
|
-
return 2;
|
|
15205
|
-
}
|
|
15206
|
-
|
|
15207
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
15208
|
-
return 0;
|
|
15209
|
-
}
|
|
15210
|
-
|
|
15211
|
-
const min = forceColor || 0;
|
|
15212
|
-
|
|
15213
|
-
if (env.TERM === 'dumb') {
|
|
15214
|
-
return min;
|
|
15215
|
-
}
|
|
15216
|
-
|
|
15217
|
-
if (process.platform === 'win32') {
|
|
15218
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
15219
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
15220
|
-
const osRelease = os.release().split('.');
|
|
15221
|
-
if (
|
|
15222
|
-
Number(osRelease[0]) >= 10 &&
|
|
15223
|
-
Number(osRelease[2]) >= 10586
|
|
15224
|
-
) {
|
|
15225
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
15226
|
-
}
|
|
15227
|
-
|
|
15228
|
-
return 1;
|
|
15229
|
-
}
|
|
15230
|
-
|
|
15231
|
-
if ('CI' in env) {
|
|
15232
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
15233
|
-
return 1;
|
|
15234
|
-
}
|
|
15235
|
-
|
|
15236
|
-
return min;
|
|
15237
|
-
}
|
|
15238
|
-
|
|
15239
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
15240
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
15241
|
-
}
|
|
15242
|
-
|
|
15243
|
-
if (env.COLORTERM === 'truecolor') {
|
|
15244
|
-
return 3;
|
|
15245
|
-
}
|
|
15246
|
-
|
|
15247
|
-
if ('TERM_PROGRAM' in env) {
|
|
15248
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
15127
|
+
/* eslint-env browser */
|
|
15249
15128
|
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
return version >= 3 ? 3 : 2;
|
|
15253
|
-
case 'Apple_Terminal':
|
|
15254
|
-
return 2;
|
|
15255
|
-
// No default
|
|
15256
|
-
}
|
|
15257
|
-
}
|
|
15129
|
+
var browser;
|
|
15130
|
+
var hasRequiredBrowser;
|
|
15258
15131
|
|
|
15259
|
-
|
|
15260
|
-
|
|
15261
|
-
|
|
15132
|
+
function requireBrowser () {
|
|
15133
|
+
if (hasRequiredBrowser) return browser;
|
|
15134
|
+
hasRequiredBrowser = 1;
|
|
15262
15135
|
|
|
15263
|
-
|
|
15264
|
-
|
|
15265
|
-
}
|
|
15136
|
+
function getChromeVersion() {
|
|
15137
|
+
const matches = /(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);
|
|
15266
15138
|
|
|
15267
|
-
if (
|
|
15268
|
-
return
|
|
15139
|
+
if (!matches) {
|
|
15140
|
+
return;
|
|
15269
15141
|
}
|
|
15270
15142
|
|
|
15271
|
-
return
|
|
15143
|
+
return Number.parseInt(matches.groups.chromeVersion, 10);
|
|
15272
15144
|
}
|
|
15273
15145
|
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15146
|
+
const colorSupport = getChromeVersion() >= 69 ? {
|
|
15147
|
+
level: 1,
|
|
15148
|
+
hasBasic: true,
|
|
15149
|
+
has256: false,
|
|
15150
|
+
has16m: false
|
|
15151
|
+
} : false;
|
|
15278
15152
|
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
15153
|
+
browser = {
|
|
15154
|
+
stdout: colorSupport,
|
|
15155
|
+
stderr: colorSupport
|
|
15283
15156
|
};
|
|
15284
|
-
return
|
|
15157
|
+
return browser;
|
|
15285
15158
|
}
|
|
15286
15159
|
|
|
15287
15160
|
/**
|
|
@@ -15294,7 +15167,7 @@ function requireNode () {
|
|
|
15294
15167
|
if (hasRequiredNode) return node.exports;
|
|
15295
15168
|
hasRequiredNode = 1;
|
|
15296
15169
|
(function (module, exports) {
|
|
15297
|
-
const tty = require$$1
|
|
15170
|
+
const tty = require$$0$1;
|
|
15298
15171
|
const util = require$$1;
|
|
15299
15172
|
|
|
15300
15173
|
/**
|
|
@@ -15321,7 +15194,7 @@ function requireNode () {
|
|
|
15321
15194
|
try {
|
|
15322
15195
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
15323
15196
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
15324
|
-
const supportsColor =
|
|
15197
|
+
const supportsColor = requireBrowser();
|
|
15325
15198
|
|
|
15326
15199
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
15327
15200
|
exports.colors = [
|
|
@@ -15568,7 +15441,7 @@ function requireSrc () {
|
|
|
15568
15441
|
if (hasRequiredSrc) return src.exports;
|
|
15569
15442
|
hasRequiredSrc = 1;
|
|
15570
15443
|
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
15571
|
-
src.exports = requireBrowser();
|
|
15444
|
+
src.exports = requireBrowser$1();
|
|
15572
15445
|
} else {
|
|
15573
15446
|
src.exports = requireNode();
|
|
15574
15447
|
}
|
|
@@ -21779,7 +21652,8 @@ const mockAction$5 = async (task, params) => {
|
|
|
21779
21652
|
defaultErrorMsg: "\u83B7\u53D6\u767E\u5BB6\u53F7appid\u63A5\u53E3\u62A5\u9519"
|
|
21780
21653
|
});
|
|
21781
21654
|
const appId = appIdInfo.data.data.user.app_id;
|
|
21782
|
-
const uploadImages = async (
|
|
21655
|
+
const uploadImages = async (_images) => {
|
|
21656
|
+
const images = _images.filter((url) => !!url && url.trim() !== "");
|
|
21783
21657
|
const localImages = await Promise.all(
|
|
21784
21658
|
images.map((url) => {
|
|
21785
21659
|
const fileName = getFilenameFromUrl(url);
|
|
@@ -22556,8 +22430,8 @@ const mockAction = async (task, params) => {
|
|
|
22556
22430
|
};
|
|
22557
22431
|
|
|
22558
22432
|
const visibleRangeTexts = {
|
|
22559
|
-
public: "\u516C\u5F00",
|
|
22560
|
-
private: "\
|
|
22433
|
+
public: "\u516C\u5F00\u53EF\u89C1",
|
|
22434
|
+
private: "\u4EC5\u81EA\u5DF1\u53EF\u89C1"
|
|
22561
22435
|
};
|
|
22562
22436
|
const rpaAction = async (task, params) => {
|
|
22563
22437
|
const commonCookies = {
|
|
@@ -22578,9 +22452,7 @@ const rpaAction = async (task, params) => {
|
|
|
22578
22452
|
const instance = typeof selector === "string" ? page.locator(selector) : selector;
|
|
22579
22453
|
await instance.click();
|
|
22580
22454
|
await instance.locator("input").fill(address);
|
|
22581
|
-
const poperInstance = page.locator(
|
|
22582
|
-
'.d-popover:not([style*="display: none"]) .d-options .d-grid-item'
|
|
22583
|
-
);
|
|
22455
|
+
const poperInstance = page.locator('.d-popover:not([style*="display: none"]) .d-options .d-grid-item');
|
|
22584
22456
|
await poperInstance.first().waitFor();
|
|
22585
22457
|
await poperInstance.first().click();
|
|
22586
22458
|
};
|
|
@@ -22612,7 +22484,7 @@ const rpaAction = async (task, params) => {
|
|
|
22612
22484
|
const titleInstance = page.locator(".input.titleInput input");
|
|
22613
22485
|
await titleInstance.click();
|
|
22614
22486
|
await titleInstance.fill(params.title);
|
|
22615
|
-
const descInstance = page.locator("#
|
|
22487
|
+
const descInstance = page.locator(".editor-container #quillEditor .ql-editor");
|
|
22616
22488
|
await descInstance.click();
|
|
22617
22489
|
await descInstance.fill(params.content);
|
|
22618
22490
|
const container = page.locator(".creator-container .content .scroll-content");
|
|
@@ -22626,9 +22498,7 @@ const rpaAction = async (task, params) => {
|
|
|
22626
22498
|
}
|
|
22627
22499
|
if (params.selfDeclaration) {
|
|
22628
22500
|
await page.locator(".declaration-wrapper").click();
|
|
22629
|
-
const selfDeclarationInstance = page.locator(
|
|
22630
|
-
".el-popper[aria-hidden=false] ul li[role=menuitem]"
|
|
22631
|
-
);
|
|
22501
|
+
const selfDeclarationInstance = page.locator(".el-popper[aria-hidden=false] ul li[role=menuitem]");
|
|
22632
22502
|
if (params.selfDeclaration.type === "fictional-rendition") {
|
|
22633
22503
|
await selfDeclarationInstance.filter({ hasText: "\u865A\u6784\u6F14\u7ECE\uFF0C\u4EC5\u4F9B\u5A31\u4E50" }).click();
|
|
22634
22504
|
} else if (params.selfDeclaration.type === "ai-generated") {
|
|
@@ -22638,7 +22508,7 @@ const rpaAction = async (task, params) => {
|
|
|
22638
22508
|
const selfDeclarationSecondaryMenuInstance = page.locator(".el-popper[aria-hidden=false] .el-cascader-menu").nth(1).locator("ul li[role=menuitem]");
|
|
22639
22509
|
await selfDeclarationSecondaryMenuInstance.first().waitFor();
|
|
22640
22510
|
if (params.selfDeclaration.childType === "self-labeling") {
|
|
22641
|
-
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u5DF2\u81EA\u4E3B\u6807\u6CE8" }).click();
|
|
22511
|
+
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u5DF2\u5728\u6B63\u6587\u4E2D\u81EA\u4E3B\u6807\u6CE8" }).click();
|
|
22642
22512
|
} else if (params.selfDeclaration.childType === "self-shooting") {
|
|
22643
22513
|
const { shootingDate, shootingLocation } = params.selfDeclaration;
|
|
22644
22514
|
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "\u81EA\u4E3B\u62CD\u6444" }).click();
|
|
@@ -22646,16 +22516,10 @@ const rpaAction = async (task, params) => {
|
|
|
22646
22516
|
await selfShootingPopup.waitFor();
|
|
22647
22517
|
const hasCustomContent = shootingDate || shootingLocation;
|
|
22648
22518
|
if (shootingLocation) {
|
|
22649
|
-
await selectAddress(
|
|
22650
|
-
selfShootingPopup.locator(".address-input"),
|
|
22651
|
-
shootingLocation
|
|
22652
|
-
);
|
|
22519
|
+
await selectAddress(selfShootingPopup.locator(".address-input"), shootingLocation);
|
|
22653
22520
|
}
|
|
22654
22521
|
if (shootingDate) {
|
|
22655
|
-
await selectDate(
|
|
22656
|
-
selfShootingPopup.locator(".date-picker input"),
|
|
22657
|
-
shootingDate
|
|
22658
|
-
);
|
|
22522
|
+
await selectDate(selfShootingPopup.locator(".date-picker input"), shootingDate);
|
|
22659
22523
|
}
|
|
22660
22524
|
await selfShootingPopup.locator("footer button").filter({ hasText: hasCustomContent ? "\u786E\u8BA4" : "\u53D6\u6D88" }).click();
|
|
22661
22525
|
} else if (params.selfDeclaration.childType === "transshipment") {
|
package/package.json
CHANGED
|
@@ -81,7 +81,10 @@ export const mockAction: PublishAction = async (task, params) => {
|
|
|
81
81
|
|
|
82
82
|
const appId = appIdInfo.data.data.user.app_id;
|
|
83
83
|
|
|
84
|
-
const uploadImages = async (
|
|
84
|
+
const uploadImages = async (_images: string[]) => {
|
|
85
|
+
// 过滤掉空字符串
|
|
86
|
+
const images = _images.filter((url) => !!url && url.trim() !== "");
|
|
87
|
+
|
|
85
88
|
// 下载图片到本地
|
|
86
89
|
const localImages = await Promise.all(
|
|
87
90
|
images.map((url) => {
|
|
@@ -22,8 +22,7 @@ interface SourceStatement {
|
|
|
22
22
|
|
|
23
23
|
type SelfDeclaration = FictionalRendition | AIGenerated | SourceStatement;
|
|
24
24
|
|
|
25
|
-
export interface XiaohongshuPublishParams
|
|
26
|
-
extends Omit<ActiomCommonParams, "cookies"> {
|
|
25
|
+
export interface XiaohongshuPublishParams extends Omit<ActiomCommonParams, "cookies"> {
|
|
27
26
|
cookies: Partial<CookiesSetDetails>[];
|
|
28
27
|
banners: string[]; // 图片
|
|
29
28
|
title: string; // 标题
|
|
@@ -4,12 +4,9 @@ import { downloadImage, getFilenameFromUrl } from "@iflyrpa/share";
|
|
|
4
4
|
|
|
5
5
|
import type { PublishAction, XiaohongshuPublishParams } from "./index";
|
|
6
6
|
|
|
7
|
-
const visibleRangeTexts: Record<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> = {
|
|
11
|
-
public: "公开",
|
|
12
|
-
private: "私密",
|
|
7
|
+
const visibleRangeTexts: Record<XiaohongshuPublishParams["visibleRange"], string> = {
|
|
8
|
+
public: "公开可见",
|
|
9
|
+
private: "仅自己可见",
|
|
13
10
|
};
|
|
14
11
|
|
|
15
12
|
export const rpaAction: PublishAction = async (task, params) => {
|
|
@@ -32,20 +29,16 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
32
29
|
|
|
33
30
|
// 通用的选择地点
|
|
34
31
|
const selectAddress = async (selector: Locator, address: string) => {
|
|
35
|
-
const instance =
|
|
36
|
-
typeof selector === "string" ? page.locator(selector) : selector;
|
|
32
|
+
const instance = typeof selector === "string" ? page.locator(selector) : selector;
|
|
37
33
|
await instance.click();
|
|
38
34
|
await instance.locator("input").fill(address);
|
|
39
|
-
const poperInstance = page.locator(
|
|
40
|
-
'.d-popover:not([style*="display: none"]) .d-options .d-grid-item',
|
|
41
|
-
);
|
|
35
|
+
const poperInstance = page.locator('.d-popover:not([style*="display: none"]) .d-options .d-grid-item');
|
|
42
36
|
await poperInstance.first().waitFor();
|
|
43
37
|
await poperInstance.first().click();
|
|
44
38
|
};
|
|
45
39
|
// 通用的选择日期
|
|
46
40
|
const selectDate = async (selector: string | Locator, date: string) => {
|
|
47
|
-
const instance =
|
|
48
|
-
typeof selector === "string" ? page.locator(selector) : selector;
|
|
41
|
+
const instance = typeof selector === "string" ? page.locator(selector) : selector;
|
|
49
42
|
await instance.click();
|
|
50
43
|
await instance.fill(date);
|
|
51
44
|
await instance.blur();
|
|
@@ -55,11 +48,9 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
55
48
|
// ----------------------------------------------------------------------------------
|
|
56
49
|
|
|
57
50
|
// 等待登录成功
|
|
58
|
-
await page
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
throw new Error("登录失败");
|
|
62
|
-
});
|
|
51
|
+
await page.waitForSelector("#CreatorPlatform", { state: "visible" }).catch(() => {
|
|
52
|
+
throw new Error("登录失败");
|
|
53
|
+
});
|
|
63
54
|
|
|
64
55
|
// 跳转到发布页面
|
|
65
56
|
await page
|
|
@@ -98,7 +89,7 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
98
89
|
await titleInstance.fill(params.title);
|
|
99
90
|
|
|
100
91
|
// 填写正文
|
|
101
|
-
const descInstance = page.locator("#
|
|
92
|
+
const descInstance = page.locator(".editor-container #quillEditor .ql-editor");
|
|
102
93
|
await descInstance.click();
|
|
103
94
|
await descInstance.fill(params.content);
|
|
104
95
|
|
|
@@ -110,9 +101,7 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
110
101
|
if (params.address) {
|
|
111
102
|
// 填写地点
|
|
112
103
|
await selectAddress(
|
|
113
|
-
page
|
|
114
|
-
.locator(".media-extension .address-input")
|
|
115
|
-
.filter({ hasText: "添加地点" }),
|
|
104
|
+
page.locator(".media-extension .address-input").filter({ hasText: "添加地点" }),
|
|
116
105
|
params.address,
|
|
117
106
|
);
|
|
118
107
|
}
|
|
@@ -120,17 +109,11 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
120
109
|
if (params.selfDeclaration) {
|
|
121
110
|
// 自主声明
|
|
122
111
|
await page.locator(".declaration-wrapper").click();
|
|
123
|
-
const selfDeclarationInstance = page.locator(
|
|
124
|
-
".el-popper[aria-hidden=false] ul li[role=menuitem]",
|
|
125
|
-
);
|
|
112
|
+
const selfDeclarationInstance = page.locator(".el-popper[aria-hidden=false] ul li[role=menuitem]");
|
|
126
113
|
if (params.selfDeclaration.type === "fictional-rendition") {
|
|
127
|
-
await selfDeclarationInstance
|
|
128
|
-
.filter({ hasText: "虚构演绎,仅供娱乐" })
|
|
129
|
-
.click();
|
|
114
|
+
await selfDeclarationInstance.filter({ hasText: "虚构演绎,仅供娱乐" }).click();
|
|
130
115
|
} else if (params.selfDeclaration.type === "ai-generated") {
|
|
131
|
-
await selfDeclarationInstance
|
|
132
|
-
.filter({ hasText: "笔记含AI合成内容" })
|
|
133
|
-
.click();
|
|
116
|
+
await selfDeclarationInstance.filter({ hasText: "笔记含AI合成内容" }).click();
|
|
134
117
|
} else if (params.selfDeclaration.type === "source-statement") {
|
|
135
118
|
await selfDeclarationInstance.filter({ hasText: "内容来源声明" }).click();
|
|
136
119
|
// 内容来源声明二级菜单
|
|
@@ -141,14 +124,10 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
141
124
|
// 等待元素出现
|
|
142
125
|
await selfDeclarationSecondaryMenuInstance.first().waitFor();
|
|
143
126
|
if (params.selfDeclaration.childType === "self-labeling") {
|
|
144
|
-
await selfDeclarationSecondaryMenuInstance
|
|
145
|
-
.filter({ hasText: "已自主标注" })
|
|
146
|
-
.click();
|
|
127
|
+
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "已在正文中自主标注" }).click();
|
|
147
128
|
} else if (params.selfDeclaration.childType === "self-shooting") {
|
|
148
129
|
const { shootingDate, shootingLocation } = params.selfDeclaration;
|
|
149
|
-
await selfDeclarationSecondaryMenuInstance
|
|
150
|
-
.filter({ hasText: "自主拍摄" })
|
|
151
|
-
.click();
|
|
130
|
+
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "自主拍摄" }).click();
|
|
152
131
|
|
|
153
132
|
// 自主拍摄弹窗
|
|
154
133
|
const selfShootingPopup = page
|
|
@@ -160,17 +139,11 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
160
139
|
|
|
161
140
|
// 选择拍摄地点
|
|
162
141
|
if (shootingLocation) {
|
|
163
|
-
await selectAddress(
|
|
164
|
-
selfShootingPopup.locator(".address-input"),
|
|
165
|
-
shootingLocation,
|
|
166
|
-
);
|
|
142
|
+
await selectAddress(selfShootingPopup.locator(".address-input"), shootingLocation);
|
|
167
143
|
}
|
|
168
144
|
// 选择拍摄日期
|
|
169
145
|
if (shootingDate) {
|
|
170
|
-
await selectDate(
|
|
171
|
-
selfShootingPopup.locator(".date-picker input"),
|
|
172
|
-
shootingDate,
|
|
173
|
-
);
|
|
146
|
+
await selectDate(selfShootingPopup.locator(".date-picker input"), shootingDate);
|
|
174
147
|
}
|
|
175
148
|
|
|
176
149
|
await selfShootingPopup
|
|
@@ -178,9 +151,7 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
178
151
|
.filter({ hasText: hasCustomContent ? "确认" : "取消" })
|
|
179
152
|
.click();
|
|
180
153
|
} else if (params.selfDeclaration.childType === "transshipment") {
|
|
181
|
-
await selfDeclarationSecondaryMenuInstance
|
|
182
|
-
.filter({ hasText: "来源转载" })
|
|
183
|
-
.click();
|
|
154
|
+
await selfDeclarationSecondaryMenuInstance.filter({ hasText: "来源转载" }).click();
|
|
184
155
|
// 来源媒体弹窗
|
|
185
156
|
const selfShootingPopup = page
|
|
186
157
|
.locator(".el-overlay-dialog[aria-modal=true][role=dialog]")
|
|
@@ -201,9 +172,7 @@ export const rpaAction: PublishAction = async (task, params) => {
|
|
|
201
172
|
}
|
|
202
173
|
|
|
203
174
|
// 可见范围
|
|
204
|
-
const publicLabelInstance = page
|
|
205
|
-
.locator("label")
|
|
206
|
-
.filter({ hasText: visibleRangeTexts[params.visibleRange] });
|
|
175
|
+
const publicLabelInstance = page.locator("label").filter({ hasText: visibleRangeTexts[params.visibleRange] });
|
|
207
176
|
await publicLabelInstance.click();
|
|
208
177
|
|
|
209
178
|
const releaseTimeInstance = page
|