@iflyrpa/playwright 4.0.9-beta.1 → 4.0.9-beta.2
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 +27 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +99 -0
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,62 @@ export declare interface ActionVersionInfo {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function compareVersion(a: string, b: string): number;
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* 获取最新版本记录
|
|
43
|
+
*
|
|
44
|
+
* @returns 最新的版本记录,无历史记录时返回 null
|
|
45
|
+
*/
|
|
46
|
+
export declare function getLatestVersionRecord(): VersionRecord | null;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 取一组版本记录中的最高价值等级
|
|
50
|
+
*
|
|
51
|
+
* 跨多个版本升级时,应按其中最严格的等级决定更新策略:
|
|
52
|
+
* 只要期间有过一个 LEVEL_2 版本,就必须强制更新重启。
|
|
53
|
+
*
|
|
54
|
+
* @returns 最高等级,records 为空时返回 null
|
|
55
|
+
*/
|
|
56
|
+
export declare function getMaxUpdateLevel(records: VersionRecord[]): UpdateLevel | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 获取版本历史信息
|
|
60
|
+
*
|
|
61
|
+
* 数据来自随包发布的 version-history.json,同步返回,不发起网络请求。
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { getVersionHistory } from "@iflyrpa/playwright";
|
|
66
|
+
*
|
|
67
|
+
* const history = getVersionHistory();
|
|
68
|
+
* console.log("当前版本:", history.currentVersion);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function getVersionHistory(): VersionHistory;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 获取指定版本的详细信息
|
|
75
|
+
*
|
|
76
|
+
* @param version - 版本号,如 "4.1.0"
|
|
77
|
+
* @returns 版本记录,版本不存在时返回 null
|
|
78
|
+
*/
|
|
79
|
+
export declare function getVersionRecord(version: string): VersionRecord | null;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 获取从 fromVersion(不含)到最新版本(含)之间的所有版本记录
|
|
83
|
+
*
|
|
84
|
+
* 三方升级后可用它一次性展示期间累积的全部更新内容。
|
|
85
|
+
* fromVersion 不在历史记录中时(跨度超过保留的 10 个版本),返回全部记录。
|
|
86
|
+
*
|
|
87
|
+
* @param fromVersion - 用户当前所在版本
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const notes = getVersionRecordsSince("4.0.8");
|
|
92
|
+
* // 展示 4.0.9 ~ 4.1.0 之间的所有更新说明
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function getVersionRecordsSince(fromVersion: string): VersionRecord[];
|
|
96
|
+
|
|
41
97
|
declare class Logger extends SentryInstance implements LoggerImplement {
|
|
42
98
|
private stream;
|
|
43
99
|
constructor(taskParams: TaskParams);
|
|
@@ -205,6 +261,49 @@ declare interface TaskParams {
|
|
|
205
261
|
|
|
206
262
|
declare type TimeConsuming = Record<string, number>;
|
|
207
263
|
|
|
264
|
+
/**
|
|
265
|
+
* 版本价值等级
|
|
266
|
+
*
|
|
267
|
+
* - 0 细微:修复小问题、文档更新、轻微优化,可选更新
|
|
268
|
+
* - 1 一般:新功能、常规优化、非关键修复,建议更新
|
|
269
|
+
* - 2 强烈:重大功能、安全修复、关键性能优化,强制更新并重启
|
|
270
|
+
*/
|
|
271
|
+
export declare type UpdateLevel = 0 | 1 | 2;
|
|
272
|
+
|
|
208
273
|
export declare const version: string;
|
|
209
274
|
|
|
275
|
+
/**
|
|
276
|
+
* 版本历史数据
|
|
277
|
+
*/
|
|
278
|
+
export declare interface VersionHistory {
|
|
279
|
+
/** 包名 */
|
|
280
|
+
name: string;
|
|
281
|
+
/** 当前版本 */
|
|
282
|
+
currentVersion: string;
|
|
283
|
+
/** 最后更新日期 */
|
|
284
|
+
lastUpdate: string;
|
|
285
|
+
/** 保留的最大版本数 */
|
|
286
|
+
maxVersions: number;
|
|
287
|
+
/** 版本记录列表(从新到旧) */
|
|
288
|
+
versions: VersionRecord[];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 单个版本记录
|
|
293
|
+
*/
|
|
294
|
+
export declare interface VersionRecord {
|
|
295
|
+
/** 版本号 */
|
|
296
|
+
version: string;
|
|
297
|
+
/** 发布日期 YYYY-MM-DD */
|
|
298
|
+
releaseDate: string;
|
|
299
|
+
/** 版本更新说明 */
|
|
300
|
+
releaseNote: string[];
|
|
301
|
+
/** 版本价值等级 0-细微 1-一般 2-强烈 */
|
|
302
|
+
updateLevel: UpdateLevel;
|
|
303
|
+
/** 更新策略建议 */
|
|
304
|
+
updateStrategy: string;
|
|
305
|
+
/** 变更类型 */
|
|
306
|
+
changeType: "patch" | "minor" | "major";
|
|
307
|
+
}
|
|
308
|
+
|
|
210
309
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -2550,7 +2550,7 @@ function __webpack_require__(moduleId) {
|
|
|
2550
2550
|
});
|
|
2551
2551
|
};
|
|
2552
2552
|
})();
|
|
2553
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.
|
|
2553
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.2"}');
|
|
2554
2554
|
function _define_property(obj, key, value) {
|
|
2555
2555
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
2556
2556
|
value: value,
|
|
@@ -5662,6 +5662,25 @@ class Task {
|
|
|
5662
5662
|
this.electronPackage = this.installElectron();
|
|
5663
5663
|
}
|
|
5664
5664
|
}
|
|
5665
|
+
var version_history_namespaceObject = JSON.parse('{"name":"@iflyrpa/playwright","currentVersion":"4.0.9-beta.2","lastUpdate":"2026-08-13","maxVersions":10,"versions":[{"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"}]}');
|
|
5666
|
+
function getVersionHistory() {
|
|
5667
|
+
return version_history_namespaceObject;
|
|
5668
|
+
}
|
|
5669
|
+
function getLatestVersionRecord() {
|
|
5670
|
+
return getVersionHistory().versions[0] ?? null;
|
|
5671
|
+
}
|
|
5672
|
+
function getVersionRecord(version) {
|
|
5673
|
+
return getVersionHistory().versions.find((v)=>v.version === version) ?? null;
|
|
5674
|
+
}
|
|
5675
|
+
function getVersionRecordsSince(fromVersion) {
|
|
5676
|
+
const { versions } = getVersionHistory();
|
|
5677
|
+
const index = versions.findIndex((v)=>v.version === fromVersion);
|
|
5678
|
+
return -1 === index ? versions : versions.slice(0, index);
|
|
5679
|
+
}
|
|
5680
|
+
function getMaxUpdateLevel(records) {
|
|
5681
|
+
if (0 === records.length) return null;
|
|
5682
|
+
return records.reduce((max, r)=>r.updateLevel > max ? r.updateLevel : max, 0);
|
|
5683
|
+
}
|
|
5665
5684
|
function src_define_property(obj, key, value) {
|
|
5666
5685
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
5667
5686
|
value: value,
|
|
@@ -5741,6 +5760,6 @@ class RpaTask extends Task {
|
|
|
5741
5760
|
}
|
|
5742
5761
|
}
|
|
5743
5762
|
const src_version = package_namespaceObject.i8;
|
|
5744
|
-
export { RpaTask, compareVersion, src_version as version };
|
|
5763
|
+
export { RpaTask, compareVersion, getLatestVersionRecord, getMaxUpdateLevel, getVersionHistory, getVersionRecord, getVersionRecordsSince, src_version as version };
|
|
5745
5764
|
|
|
5746
5765
|
//# sourceMappingURL=index.js.map
|