@iflyrpa/playwright 4.0.9-beta.3 → 4.0.9-beta.5
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 +14 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -202
- package/dist/index.js +14 -140
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4e521c11-ad66-587a-bfbf-dbebca199974")}catch(e){}}();
|
|
1
3
|
var __webpack_modules__ = {
|
|
2
4
|
"../../node_modules/.pnpm/cross-fetch@4.1.0_encoding@0.1.13/node_modules/cross-fetch/dist/node-ponyfill.js": function(module, exports1, __webpack_require__) {
|
|
3
5
|
const nodeFetch = __webpack_require__("../../node_modules/.pnpm/node-fetch@2.7.0_encoding@0.1.13/node_modules/node-fetch/lib/index.mjs");
|
|
@@ -2553,17 +2555,11 @@ var __webpack_exports__ = {};
|
|
|
2553
2555
|
"use strict";
|
|
2554
2556
|
__webpack_require__.r(__webpack_exports__);
|
|
2555
2557
|
__webpack_require__.d(__webpack_exports__, {
|
|
2556
|
-
getLatestVersionRecord: ()=>getLatestVersionRecord,
|
|
2557
|
-
getMaxUpdateLevel: ()=>getMaxUpdateLevel,
|
|
2558
|
-
getVersionRecord: ()=>getVersionRecord,
|
|
2559
|
-
RpaTask: ()=>RpaTask,
|
|
2560
2558
|
version: ()=>src_version,
|
|
2561
|
-
|
|
2562
|
-
getVersionRecordsSince: ()=>getVersionRecordsSince,
|
|
2563
|
-
getVersionHistory: ()=>getVersionHistory
|
|
2559
|
+
RpaTask: ()=>RpaTask
|
|
2564
2560
|
});
|
|
2565
2561
|
const actions_namespaceObject = require("@iflyrpa/actions");
|
|
2566
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.
|
|
2562
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.5"}');
|
|
2567
2563
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
2568
2564
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
2569
2565
|
const external_node_path_namespaceObject = require("node:path");
|
|
@@ -5389,45 +5385,10 @@ app.on("window-all-closed", (e) => e.preventDefault());
|
|
|
5389
5385
|
return obj;
|
|
5390
5386
|
}
|
|
5391
5387
|
const NPM_REGISTRY = "https://registry.npmmirror.com/";
|
|
5392
|
-
const LATEST_TAG = "latest";
|
|
5393
|
-
const BETA_TAG = "beta";
|
|
5394
|
-
function compareVersion(a, b) {
|
|
5395
|
-
const parse = (v)=>{
|
|
5396
|
-
const [core, pre] = v.split("-");
|
|
5397
|
-
const nums = core.split(".").map(Number);
|
|
5398
|
-
return {
|
|
5399
|
-
nums,
|
|
5400
|
-
pre
|
|
5401
|
-
};
|
|
5402
|
-
};
|
|
5403
|
-
const va = parse(a);
|
|
5404
|
-
const vb = parse(b);
|
|
5405
|
-
for(let i = 0; i < 3; i++){
|
|
5406
|
-
const diff = (va.nums[i] ?? 0) - (vb.nums[i] ?? 0);
|
|
5407
|
-
if (0 !== diff) return diff;
|
|
5408
|
-
}
|
|
5409
|
-
if (!va.pre && !vb.pre) return 0;
|
|
5410
|
-
if (!va.pre) return 1;
|
|
5411
|
-
if (!vb.pre) return -1;
|
|
5412
|
-
const pa = va.pre.split(".");
|
|
5413
|
-
const pb = vb.pre.split(".");
|
|
5414
|
-
for(let i = 0; i < Math.max(pa.length, pb.length); i++){
|
|
5415
|
-
const sa = pa[i];
|
|
5416
|
-
const sb = pb[i];
|
|
5417
|
-
if (void 0 === sa) return -1;
|
|
5418
|
-
if (void 0 === sb) return 1;
|
|
5419
|
-
const na = Number(sa);
|
|
5420
|
-
const nb = Number(sb);
|
|
5421
|
-
const bothNumeric = !Number.isNaN(na) && !Number.isNaN(nb);
|
|
5422
|
-
const diff = bothNumeric ? na - nb : sa.localeCompare(sb);
|
|
5423
|
-
if (0 !== diff) return diff;
|
|
5424
|
-
}
|
|
5425
|
-
return 0;
|
|
5426
|
-
}
|
|
5427
5388
|
class PackageManager {
|
|
5428
5389
|
async getManifest(module) {
|
|
5429
5390
|
try {
|
|
5430
|
-
return
|
|
5391
|
+
return pacote_default().manifest(module, {
|
|
5431
5392
|
registry: NPM_REGISTRY
|
|
5432
5393
|
});
|
|
5433
5394
|
} catch (error) {
|
|
@@ -5458,25 +5419,9 @@ app.on("window-all-closed", (e) => e.preventDefault());
|
|
|
5458
5419
|
const plugin = this.require(packageName);
|
|
5459
5420
|
if (!plugin) await this.extract(name, version);
|
|
5460
5421
|
}
|
|
5461
|
-
async
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
return manifest.version;
|
|
5465
|
-
} catch (error) {
|
|
5466
|
-
if (distTag === LATEST_TAG) throw error;
|
|
5467
|
-
this.task.logger.warn(`${name}@${distTag} 不存在,回退到 ${LATEST_TAG}`);
|
|
5468
|
-
const manifest = await this.getManifest(`${name}@${LATEST_TAG}`);
|
|
5469
|
-
return manifest.version;
|
|
5470
|
-
}
|
|
5471
|
-
}
|
|
5472
|
-
async getLatestVersion(name, useBeta = false) {
|
|
5473
|
-
const latest = await this.getVersionByTag(name, LATEST_TAG);
|
|
5474
|
-
if (!useBeta) return latest;
|
|
5475
|
-
const beta = await this.getVersionByTag(name, BETA_TAG);
|
|
5476
|
-
return compareVersion(beta, latest) > 0 ? beta : latest;
|
|
5477
|
-
}
|
|
5478
|
-
async update(name, useBeta = false) {
|
|
5479
|
-
const version = await this.getLatestVersion(name, useBeta);
|
|
5422
|
+
async update(name) {
|
|
5423
|
+
const manifest = await this.getManifest(`${name}@latest`);
|
|
5424
|
+
const version = manifest.version;
|
|
5480
5425
|
const plugin = this.require(`${name}@${version}/package.json`);
|
|
5481
5426
|
if (!plugin) await this.extract(name, version);
|
|
5482
5427
|
return version;
|
|
@@ -5692,25 +5637,6 @@ app.on("window-all-closed", (e) => e.preventDefault());
|
|
|
5692
5637
|
this.electronPackage = this.installElectron();
|
|
5693
5638
|
}
|
|
5694
5639
|
}
|
|
5695
|
-
var version_history_namespaceObject = JSON.parse('{"name":"@iflyrpa/playwright","currentVersion":"4.0.9-beta.3","lastUpdate":"2026-08-14","maxVersions":10,"versions":[{"version":"4.0.9-beta.3","releaseDate":"2026-08-14","releaseNote":["1. 测试更新","2. 重要修复,需要更新"],"updateLevel":2,"updateStrategy":"强制更新并重启","changeType":"patch"},{"version":"4.0.9-beta.2","releaseDate":"2026-08-13","releaseNote":["1.增加版本更新记录","2.优化错误提示"],"updateLevel":1,"updateStrategy":"建议更新","changeType":"patch"},{"version":"4.0.9-beta.1","releaseDate":"2024-08-10","releaseNote":["改进多个 action 的用户错误提示信息"],"updateLevel":1,"updateStrategy":"建议更新","changeType":"patch"}]}');
|
|
5696
|
-
function getVersionHistory() {
|
|
5697
|
-
return version_history_namespaceObject;
|
|
5698
|
-
}
|
|
5699
|
-
function getLatestVersionRecord() {
|
|
5700
|
-
return getVersionHistory().versions[0] ?? null;
|
|
5701
|
-
}
|
|
5702
|
-
function getVersionRecord(version) {
|
|
5703
|
-
return getVersionHistory().versions.find((v)=>v.version === version) ?? null;
|
|
5704
|
-
}
|
|
5705
|
-
function getVersionRecordsSince(fromVersion) {
|
|
5706
|
-
const { versions } = getVersionHistory();
|
|
5707
|
-
const index = versions.findIndex((v)=>v.version === fromVersion);
|
|
5708
|
-
return -1 === index ? versions : versions.slice(0, index);
|
|
5709
|
-
}
|
|
5710
|
-
function getMaxUpdateLevel(records) {
|
|
5711
|
-
if (0 === records.length) return null;
|
|
5712
|
-
return records.reduce((max, r)=>r.updateLevel > max ? r.updateLevel : max, 0);
|
|
5713
|
-
}
|
|
5714
5640
|
function src_define_property(obj, key, value) {
|
|
5715
5641
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
5716
5642
|
value: value,
|
|
@@ -5724,80 +5650,21 @@ app.on("window-all-closed", (e) => e.preventDefault());
|
|
|
5724
5650
|
class RpaTask extends Task {
|
|
5725
5651
|
registerActions(rpaAction) {
|
|
5726
5652
|
this.actions = new rpaAction.Action(this);
|
|
5727
|
-
this.currentActionVersion = rpaAction.version;
|
|
5728
5653
|
this.setActionVersion(rpaAction.version);
|
|
5729
5654
|
}
|
|
5730
|
-
getActionVersion() {
|
|
5731
|
-
return this.currentActionVersion;
|
|
5732
|
-
}
|
|
5733
|
-
getActionVersionInfo() {
|
|
5734
|
-
return {
|
|
5735
|
-
current: this.currentActionVersion,
|
|
5736
|
-
bundled: this.bundledActionVersion,
|
|
5737
|
-
latest: this.latestActionVersion,
|
|
5738
|
-
hasUpdate: !!this.latestActionVersion && this.latestActionVersion !== this.currentActionVersion,
|
|
5739
|
-
applied: this.appliedUpdate,
|
|
5740
|
-
channel: this.updateChannel,
|
|
5741
|
-
error: this.updateError
|
|
5742
|
-
};
|
|
5743
|
-
}
|
|
5744
|
-
useBetaChannel() {
|
|
5745
|
-
const useBeta = this.isFeatOn(actions_namespaceObject.BetaFlag);
|
|
5746
|
-
this.updateChannel = useBeta ? "beta" : "latest";
|
|
5747
|
-
return useBeta;
|
|
5748
|
-
}
|
|
5749
|
-
async checkActionUpdate() {
|
|
5750
|
-
try {
|
|
5751
|
-
this.latestActionVersion = await this.packageManager.getLatestVersion(this.actionName, this.useBetaChannel());
|
|
5752
|
-
this.updateError = void 0;
|
|
5753
|
-
} catch (error) {
|
|
5754
|
-
this.updateError = error instanceof Error ? error.message : String(error);
|
|
5755
|
-
this.logger.error("检查脚本版本失败", error);
|
|
5756
|
-
}
|
|
5757
|
-
return this.getActionVersionInfo();
|
|
5758
|
-
}
|
|
5759
|
-
waitForActionUpdate() {
|
|
5760
|
-
if (!this.updateTask) this.updateTask = this.update();
|
|
5761
|
-
return this.updateTask;
|
|
5762
|
-
}
|
|
5763
5655
|
async update() {
|
|
5764
5656
|
try {
|
|
5765
|
-
const version = await this.packageManager.update(this.actionName
|
|
5766
|
-
this.latestActionVersion = version;
|
|
5767
|
-
if (version === this.currentActionVersion) {
|
|
5768
|
-
this.appliedUpdate = false;
|
|
5769
|
-
return this.getActionVersionInfo();
|
|
5770
|
-
}
|
|
5657
|
+
const version = await this.packageManager.update(this.actionName);
|
|
5771
5658
|
const rpaPackage = this.packageManager.require(`${this.actionName}@${version}/dist/bundle.js`);
|
|
5772
|
-
|
|
5773
|
-
this.registerActions(rpaPackage);
|
|
5774
|
-
this.appliedUpdate = true;
|
|
5775
|
-
this.updateError = void 0;
|
|
5776
|
-
this.logger.info(`脚本已热更新至 ${version}`);
|
|
5777
|
-
} else {
|
|
5778
|
-
this.appliedUpdate = false;
|
|
5779
|
-
this.updateError = `加载 ${this.actionName}@${version} 失败`;
|
|
5780
|
-
this.logger.warn(this.updateError);
|
|
5781
|
-
}
|
|
5659
|
+
(null == rpaPackage ? void 0 : rpaPackage.Action) && this.registerActions(rpaPackage);
|
|
5782
5660
|
} catch (error) {
|
|
5783
|
-
this.appliedUpdate = false;
|
|
5784
|
-
this.updateError = error instanceof Error ? error.message : String(error);
|
|
5785
5661
|
this.logger.error("更新依赖失败", error);
|
|
5786
5662
|
}
|
|
5787
|
-
return this.getActionVersionInfo();
|
|
5788
|
-
}
|
|
5789
|
-
verifyActionMemoryUpdate() {
|
|
5790
|
-
var _this_actions;
|
|
5791
|
-
if (!(null === (_this_actions = this.actions) || void 0 === _this_actions ? void 0 : _this_actions.getActionVersionMarker)) return {
|
|
5792
|
-
error: "getActionVersionMarker 方法不存在,可能是旧版本的 @iflyrpa/actions",
|
|
5793
|
-
currentVersion: this.currentActionVersion
|
|
5794
|
-
};
|
|
5795
|
-
return this.actions.getActionVersionMarker();
|
|
5796
5663
|
}
|
|
5797
5664
|
constructor(params){
|
|
5798
|
-
super(params), src_define_property(this, "actions", void 0), src_define_property(this, "actionName", "@iflyrpa/actions")
|
|
5665
|
+
super(params), src_define_property(this, "actions", void 0), src_define_property(this, "actionName", "@iflyrpa/actions");
|
|
5799
5666
|
this.registerActions(actions_namespaceObject);
|
|
5800
|
-
|
|
5667
|
+
params.forceUpdate && this.update();
|
|
5801
5668
|
}
|
|
5802
5669
|
}
|
|
5803
5670
|
const src_version = package_namespaceObject.i8;
|
|
@@ -5808,4 +5675,5 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
5808
5675
|
value: true
|
|
5809
5676
|
});
|
|
5810
5677
|
|
|
5811
|
-
//# sourceMappingURL=index.cjs.map
|
|
5678
|
+
//# sourceMappingURL=index.cjs.map
|
|
5679
|
+
//# debugId=4e521c11-ad66-587a-bfbf-dbebca199974
|