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