@iflyrpa/playwright 4.0.9-beta.4 → 4.0.9

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]="10485e63-d196-5082-84d7-9cdceb7a1130")}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,13 @@ 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 = {
2563
+ i8: "4.0.9"
2564
+ };
2569
2565
  const external_node_fs_namespaceObject = require("node:fs");
2570
2566
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
2571
2567
  const external_node_path_namespaceObject = require("node:path");
@@ -5391,45 +5387,10 @@ app.on("window-all-closed", (e) => e.preventDefault());
5391
5387
  return obj;
5392
5388
  }
5393
5389
  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
5390
  class PackageManager {
5430
5391
  async getManifest(module) {
5431
5392
  try {
5432
- return await pacote_default().manifest(module, {
5393
+ return pacote_default().manifest(module, {
5433
5394
  registry: NPM_REGISTRY
5434
5395
  });
5435
5396
  } catch (error) {
@@ -5460,25 +5421,9 @@ app.on("window-all-closed", (e) => e.preventDefault());
5460
5421
  const plugin = this.require(packageName);
5461
5422
  if (!plugin) await this.extract(name, version);
5462
5423
  }
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);
5424
+ async update(name) {
5425
+ const manifest = await this.getManifest(`${name}@latest`);
5426
+ const version = manifest.version;
5482
5427
  const plugin = this.require(`${name}@${version}/package.json`);
5483
5428
  if (!plugin) await this.extract(name, version);
5484
5429
  return version;
@@ -5694,25 +5639,6 @@ app.on("window-all-closed", (e) => e.preventDefault());
5694
5639
  this.electronPackage = this.installElectron();
5695
5640
  }
5696
5641
  }
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
5642
  function src_define_property(obj, key, value) {
5717
5643
  if (key in obj) Object.defineProperty(obj, key, {
5718
5644
  value: value,
@@ -5726,80 +5652,21 @@ app.on("window-all-closed", (e) => e.preventDefault());
5726
5652
  class RpaTask extends Task {
5727
5653
  registerActions(rpaAction) {
5728
5654
  this.actions = new rpaAction.Action(this);
5729
- this.currentActionVersion = rpaAction.version;
5730
5655
  this.setActionVersion(rpaAction.version);
5731
5656
  }
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
5657
  async update() {
5766
5658
  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
- }
5659
+ const version = await this.packageManager.update(this.actionName);
5773
5660
  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
- }
5661
+ (null == rpaPackage ? void 0 : rpaPackage.Action) && this.registerActions(rpaPackage);
5784
5662
  } catch (error) {
5785
- this.appliedUpdate = false;
5786
- this.updateError = error instanceof Error ? error.message : String(error);
5787
5663
  this.logger.error("更新依赖失败", error);
5788
5664
  }
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
5665
  }
5799
5666
  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);
5667
+ super(params), src_define_property(this, "actions", void 0), src_define_property(this, "actionName", "@iflyrpa/actions");
5801
5668
  this.registerActions(actions_namespaceObject);
5802
- if (params.forceUpdate) this.updateTask = this.update();
5669
+ params.forceUpdate && this.update();
5803
5670
  }
5804
5671
  }
5805
5672
  const src_version = package_namespaceObject.i8;
@@ -5811,4 +5678,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
5811
5678
  });
5812
5679
 
5813
5680
  //# sourceMappingURL=index.cjs.map
5814
- //# debugId=d3aada0e-06e9-513f-bfca-6baab8e99f26
5681
+ //# debugId=10485e63-d196-5082-84d7-9cdceb7a1130