@iflyrpa/playwright 1.0.15-beta.1 → 1.0.15-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 +122 -459
- package/dist/index.d.cts +35 -89
- package/dist/index.d.mts +35 -89
- package/dist/index.d.ts +35 -89
- package/dist/index.mjs +119 -455
- package/package.json +37 -31
package/dist/index.d.cts
CHANGED
|
@@ -1,86 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
2
|
+
export { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
3
|
+
import * as playwright_core from 'playwright-core';
|
|
4
|
+
import { LoggerImplement, AutomateTask, ElectronApplication, PageParams } from '@iflyrpa/share';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The value of the cookie. Empty by default if omitted.
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The domain of the cookie; this will be normalized with a preceding dot so that
|
|
19
|
-
* it's also valid for subdomains. Empty by default if omitted.
|
|
20
|
-
*/
|
|
21
|
-
domain?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The path of the cookie. Empty by default if omitted.
|
|
24
|
-
*/
|
|
25
|
-
path?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the cookie should be marked as Secure. Defaults to false unless Same
|
|
28
|
-
* Site=None attribute is used.
|
|
29
|
-
*/
|
|
30
|
-
secure?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the cookie should be marked as HTTP only. Defaults to false.
|
|
33
|
-
*/
|
|
34
|
-
httpOnly?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
|
37
|
-
* If omitted then the cookie becomes a session cookie and will not be retained
|
|
38
|
-
* between sessions.
|
|
39
|
-
*/
|
|
40
|
-
expirationDate?: number;
|
|
41
|
-
/**
|
|
42
|
-
* The Same Site policy to apply to this cookie. Can be `unspecified`,
|
|
43
|
-
* `no_restriction`, `lax` or `strict`. Default is `lax`.
|
|
44
|
-
*/
|
|
45
|
-
sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
|
|
6
|
+
declare class Logger implements LoggerImplement {
|
|
7
|
+
static instance: Logger | null;
|
|
8
|
+
private stream;
|
|
9
|
+
constructor(cachePath: string);
|
|
10
|
+
static getInstance(cachePath: string): Logger;
|
|
11
|
+
debug(...msg: any[]): void;
|
|
12
|
+
info(...msg: any[]): void;
|
|
13
|
+
warn(...msg: any[]): void;
|
|
14
|
+
error(prefix: string, err?: unknown): void;
|
|
15
|
+
close(): void;
|
|
46
16
|
}
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
interface SourceStatement {
|
|
59
|
-
type: "source-statement"; // 内容来源声明
|
|
60
|
-
childType: "self-labeling" | "self-shooting" | "transshipment"; // 已自主标注 / 自助拍摄 / 转载
|
|
61
|
-
shootingLocation?: string; // 拍摄地点
|
|
62
|
-
shootingDate?: string; // 拍摄日期
|
|
63
|
-
sourceMedia?: string; // 来源媒体
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
type SelfDeclaration = FictionalRendition | AIGenerated | SourceStatement;
|
|
67
|
-
|
|
68
|
-
interface ActiomCommonParams {
|
|
69
|
-
url?: string;
|
|
70
|
-
cookies?: CookieMap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface XiaohonshuPublishParams
|
|
74
|
-
extends Omit<ActiomCommonParams, "cookies"> {
|
|
75
|
-
cookies: Partial<CookiesSetDetails>[];
|
|
76
|
-
banners: string[]; // 图片
|
|
77
|
-
title: string; // 标题
|
|
78
|
-
content: string; // 正文
|
|
79
|
-
address?: string; // 地点
|
|
80
|
-
selfDeclaration?: SelfDeclaration; // 自主声明
|
|
81
|
-
visibleRange: "public" | "private"; // 可见范围
|
|
82
|
-
isImmediatelyPublish?: boolean; // 是否立即发布
|
|
83
|
-
scheduledPublish?: string; // 定时发布时间
|
|
18
|
+
declare class PackageManager {
|
|
19
|
+
private task;
|
|
20
|
+
constructor(task: Task);
|
|
21
|
+
private getManifest;
|
|
22
|
+
private extract;
|
|
23
|
+
require(module: string): any;
|
|
24
|
+
install(name: string, version: string): Promise<void>;
|
|
25
|
+
update(name: string): Promise<string>;
|
|
84
26
|
}
|
|
85
27
|
|
|
86
28
|
interface TaskParams {
|
|
@@ -88,10 +30,12 @@ interface TaskParams {
|
|
|
88
30
|
cachePath: string;
|
|
89
31
|
forceUpdate?: boolean;
|
|
90
32
|
}
|
|
91
|
-
declare class
|
|
92
|
-
|
|
33
|
+
declare class Task implements AutomateTask {
|
|
34
|
+
logger: Logger;
|
|
93
35
|
cachePath: string;
|
|
94
36
|
debug: boolean;
|
|
37
|
+
packagesDir: string;
|
|
38
|
+
packageManager: PackageManager;
|
|
95
39
|
private playwrightPackage;
|
|
96
40
|
private electronPackage;
|
|
97
41
|
private _electronApp;
|
|
@@ -119,7 +63,7 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
119
63
|
* 临时文件目录
|
|
120
64
|
* @returns
|
|
121
65
|
*/
|
|
122
|
-
|
|
66
|
+
getTmpPath(): string;
|
|
123
67
|
/**
|
|
124
68
|
* 清空临时文件
|
|
125
69
|
*/
|
|
@@ -129,13 +73,15 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
129
73
|
* @returns
|
|
130
74
|
*/
|
|
131
75
|
close(): Promise<void>;
|
|
132
|
-
|
|
133
|
-
* 小红书自动化发布
|
|
134
|
-
*/
|
|
135
|
-
xiaohongshuPublish(params: XiaohonshuPublishParams): Promise<string>;
|
|
76
|
+
createPage(pageParams: PageParams): Promise<playwright_core.Page>;
|
|
136
77
|
}
|
|
137
|
-
declare const RpaTask: (params: TaskParams) => LocalAutomateTask;
|
|
138
78
|
|
|
79
|
+
declare class RpaTask extends Task {
|
|
80
|
+
private actions;
|
|
81
|
+
constructor(params: TaskParams);
|
|
82
|
+
private update;
|
|
83
|
+
xiaohongshuPublish(params: XiaohongshuPublishParams): Promise<string>;
|
|
84
|
+
}
|
|
139
85
|
declare const version: string;
|
|
140
86
|
|
|
141
|
-
export {
|
|
87
|
+
export { RpaTask, version };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,86 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
2
|
+
export { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
3
|
+
import * as playwright_core from 'playwright-core';
|
|
4
|
+
import { LoggerImplement, AutomateTask, ElectronApplication, PageParams } from '@iflyrpa/share';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The value of the cookie. Empty by default if omitted.
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The domain of the cookie; this will be normalized with a preceding dot so that
|
|
19
|
-
* it's also valid for subdomains. Empty by default if omitted.
|
|
20
|
-
*/
|
|
21
|
-
domain?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The path of the cookie. Empty by default if omitted.
|
|
24
|
-
*/
|
|
25
|
-
path?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the cookie should be marked as Secure. Defaults to false unless Same
|
|
28
|
-
* Site=None attribute is used.
|
|
29
|
-
*/
|
|
30
|
-
secure?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the cookie should be marked as HTTP only. Defaults to false.
|
|
33
|
-
*/
|
|
34
|
-
httpOnly?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
|
37
|
-
* If omitted then the cookie becomes a session cookie and will not be retained
|
|
38
|
-
* between sessions.
|
|
39
|
-
*/
|
|
40
|
-
expirationDate?: number;
|
|
41
|
-
/**
|
|
42
|
-
* The Same Site policy to apply to this cookie. Can be `unspecified`,
|
|
43
|
-
* `no_restriction`, `lax` or `strict`. Default is `lax`.
|
|
44
|
-
*/
|
|
45
|
-
sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
|
|
6
|
+
declare class Logger implements LoggerImplement {
|
|
7
|
+
static instance: Logger | null;
|
|
8
|
+
private stream;
|
|
9
|
+
constructor(cachePath: string);
|
|
10
|
+
static getInstance(cachePath: string): Logger;
|
|
11
|
+
debug(...msg: any[]): void;
|
|
12
|
+
info(...msg: any[]): void;
|
|
13
|
+
warn(...msg: any[]): void;
|
|
14
|
+
error(prefix: string, err?: unknown): void;
|
|
15
|
+
close(): void;
|
|
46
16
|
}
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
interface SourceStatement {
|
|
59
|
-
type: "source-statement"; // 内容来源声明
|
|
60
|
-
childType: "self-labeling" | "self-shooting" | "transshipment"; // 已自主标注 / 自助拍摄 / 转载
|
|
61
|
-
shootingLocation?: string; // 拍摄地点
|
|
62
|
-
shootingDate?: string; // 拍摄日期
|
|
63
|
-
sourceMedia?: string; // 来源媒体
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
type SelfDeclaration = FictionalRendition | AIGenerated | SourceStatement;
|
|
67
|
-
|
|
68
|
-
interface ActiomCommonParams {
|
|
69
|
-
url?: string;
|
|
70
|
-
cookies?: CookieMap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface XiaohonshuPublishParams
|
|
74
|
-
extends Omit<ActiomCommonParams, "cookies"> {
|
|
75
|
-
cookies: Partial<CookiesSetDetails>[];
|
|
76
|
-
banners: string[]; // 图片
|
|
77
|
-
title: string; // 标题
|
|
78
|
-
content: string; // 正文
|
|
79
|
-
address?: string; // 地点
|
|
80
|
-
selfDeclaration?: SelfDeclaration; // 自主声明
|
|
81
|
-
visibleRange: "public" | "private"; // 可见范围
|
|
82
|
-
isImmediatelyPublish?: boolean; // 是否立即发布
|
|
83
|
-
scheduledPublish?: string; // 定时发布时间
|
|
18
|
+
declare class PackageManager {
|
|
19
|
+
private task;
|
|
20
|
+
constructor(task: Task);
|
|
21
|
+
private getManifest;
|
|
22
|
+
private extract;
|
|
23
|
+
require(module: string): any;
|
|
24
|
+
install(name: string, version: string): Promise<void>;
|
|
25
|
+
update(name: string): Promise<string>;
|
|
84
26
|
}
|
|
85
27
|
|
|
86
28
|
interface TaskParams {
|
|
@@ -88,10 +30,12 @@ interface TaskParams {
|
|
|
88
30
|
cachePath: string;
|
|
89
31
|
forceUpdate?: boolean;
|
|
90
32
|
}
|
|
91
|
-
declare class
|
|
92
|
-
|
|
33
|
+
declare class Task implements AutomateTask {
|
|
34
|
+
logger: Logger;
|
|
93
35
|
cachePath: string;
|
|
94
36
|
debug: boolean;
|
|
37
|
+
packagesDir: string;
|
|
38
|
+
packageManager: PackageManager;
|
|
95
39
|
private playwrightPackage;
|
|
96
40
|
private electronPackage;
|
|
97
41
|
private _electronApp;
|
|
@@ -119,7 +63,7 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
119
63
|
* 临时文件目录
|
|
120
64
|
* @returns
|
|
121
65
|
*/
|
|
122
|
-
|
|
66
|
+
getTmpPath(): string;
|
|
123
67
|
/**
|
|
124
68
|
* 清空临时文件
|
|
125
69
|
*/
|
|
@@ -129,13 +73,15 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
129
73
|
* @returns
|
|
130
74
|
*/
|
|
131
75
|
close(): Promise<void>;
|
|
132
|
-
|
|
133
|
-
* 小红书自动化发布
|
|
134
|
-
*/
|
|
135
|
-
xiaohongshuPublish(params: XiaohonshuPublishParams): Promise<string>;
|
|
76
|
+
createPage(pageParams: PageParams): Promise<playwright_core.Page>;
|
|
136
77
|
}
|
|
137
|
-
declare const RpaTask: (params: TaskParams) => LocalAutomateTask;
|
|
138
78
|
|
|
79
|
+
declare class RpaTask extends Task {
|
|
80
|
+
private actions;
|
|
81
|
+
constructor(params: TaskParams);
|
|
82
|
+
private update;
|
|
83
|
+
xiaohongshuPublish(params: XiaohongshuPublishParams): Promise<string>;
|
|
84
|
+
}
|
|
139
85
|
declare const version: string;
|
|
140
86
|
|
|
141
|
-
export {
|
|
87
|
+
export { RpaTask, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,86 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
2
|
+
export { XiaohongshuPublishParams } from '@iflyrpa/actions';
|
|
3
|
+
import * as playwright_core from 'playwright-core';
|
|
4
|
+
import { LoggerImplement, AutomateTask, ElectronApplication, PageParams } from '@iflyrpa/share';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The value of the cookie. Empty by default if omitted.
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The domain of the cookie; this will be normalized with a preceding dot so that
|
|
19
|
-
* it's also valid for subdomains. Empty by default if omitted.
|
|
20
|
-
*/
|
|
21
|
-
domain?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The path of the cookie. Empty by default if omitted.
|
|
24
|
-
*/
|
|
25
|
-
path?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the cookie should be marked as Secure. Defaults to false unless Same
|
|
28
|
-
* Site=None attribute is used.
|
|
29
|
-
*/
|
|
30
|
-
secure?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the cookie should be marked as HTTP only. Defaults to false.
|
|
33
|
-
*/
|
|
34
|
-
httpOnly?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
|
37
|
-
* If omitted then the cookie becomes a session cookie and will not be retained
|
|
38
|
-
* between sessions.
|
|
39
|
-
*/
|
|
40
|
-
expirationDate?: number;
|
|
41
|
-
/**
|
|
42
|
-
* The Same Site policy to apply to this cookie. Can be `unspecified`,
|
|
43
|
-
* `no_restriction`, `lax` or `strict`. Default is `lax`.
|
|
44
|
-
*/
|
|
45
|
-
sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
|
|
6
|
+
declare class Logger implements LoggerImplement {
|
|
7
|
+
static instance: Logger | null;
|
|
8
|
+
private stream;
|
|
9
|
+
constructor(cachePath: string);
|
|
10
|
+
static getInstance(cachePath: string): Logger;
|
|
11
|
+
debug(...msg: any[]): void;
|
|
12
|
+
info(...msg: any[]): void;
|
|
13
|
+
warn(...msg: any[]): void;
|
|
14
|
+
error(prefix: string, err?: unknown): void;
|
|
15
|
+
close(): void;
|
|
46
16
|
}
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
interface SourceStatement {
|
|
59
|
-
type: "source-statement"; // 内容来源声明
|
|
60
|
-
childType: "self-labeling" | "self-shooting" | "transshipment"; // 已自主标注 / 自助拍摄 / 转载
|
|
61
|
-
shootingLocation?: string; // 拍摄地点
|
|
62
|
-
shootingDate?: string; // 拍摄日期
|
|
63
|
-
sourceMedia?: string; // 来源媒体
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
type SelfDeclaration = FictionalRendition | AIGenerated | SourceStatement;
|
|
67
|
-
|
|
68
|
-
interface ActiomCommonParams {
|
|
69
|
-
url?: string;
|
|
70
|
-
cookies?: CookieMap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface XiaohonshuPublishParams
|
|
74
|
-
extends Omit<ActiomCommonParams, "cookies"> {
|
|
75
|
-
cookies: Partial<CookiesSetDetails>[];
|
|
76
|
-
banners: string[]; // 图片
|
|
77
|
-
title: string; // 标题
|
|
78
|
-
content: string; // 正文
|
|
79
|
-
address?: string; // 地点
|
|
80
|
-
selfDeclaration?: SelfDeclaration; // 自主声明
|
|
81
|
-
visibleRange: "public" | "private"; // 可见范围
|
|
82
|
-
isImmediatelyPublish?: boolean; // 是否立即发布
|
|
83
|
-
scheduledPublish?: string; // 定时发布时间
|
|
18
|
+
declare class PackageManager {
|
|
19
|
+
private task;
|
|
20
|
+
constructor(task: Task);
|
|
21
|
+
private getManifest;
|
|
22
|
+
private extract;
|
|
23
|
+
require(module: string): any;
|
|
24
|
+
install(name: string, version: string): Promise<void>;
|
|
25
|
+
update(name: string): Promise<string>;
|
|
84
26
|
}
|
|
85
27
|
|
|
86
28
|
interface TaskParams {
|
|
@@ -88,10 +30,12 @@ interface TaskParams {
|
|
|
88
30
|
cachePath: string;
|
|
89
31
|
forceUpdate?: boolean;
|
|
90
32
|
}
|
|
91
|
-
declare class
|
|
92
|
-
|
|
33
|
+
declare class Task implements AutomateTask {
|
|
34
|
+
logger: Logger;
|
|
93
35
|
cachePath: string;
|
|
94
36
|
debug: boolean;
|
|
37
|
+
packagesDir: string;
|
|
38
|
+
packageManager: PackageManager;
|
|
95
39
|
private playwrightPackage;
|
|
96
40
|
private electronPackage;
|
|
97
41
|
private _electronApp;
|
|
@@ -119,7 +63,7 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
119
63
|
* 临时文件目录
|
|
120
64
|
* @returns
|
|
121
65
|
*/
|
|
122
|
-
|
|
66
|
+
getTmpPath(): string;
|
|
123
67
|
/**
|
|
124
68
|
* 清空临时文件
|
|
125
69
|
*/
|
|
@@ -129,13 +73,15 @@ declare class LocalAutomateTask implements TaskParams {
|
|
|
129
73
|
* @returns
|
|
130
74
|
*/
|
|
131
75
|
close(): Promise<void>;
|
|
132
|
-
|
|
133
|
-
* 小红书自动化发布
|
|
134
|
-
*/
|
|
135
|
-
xiaohongshuPublish(params: XiaohonshuPublishParams): Promise<string>;
|
|
76
|
+
createPage(pageParams: PageParams): Promise<playwright_core.Page>;
|
|
136
77
|
}
|
|
137
|
-
declare const RpaTask: (params: TaskParams) => LocalAutomateTask;
|
|
138
78
|
|
|
79
|
+
declare class RpaTask extends Task {
|
|
80
|
+
private actions;
|
|
81
|
+
constructor(params: TaskParams);
|
|
82
|
+
private update;
|
|
83
|
+
xiaohongshuPublish(params: XiaohongshuPublishParams): Promise<string>;
|
|
84
|
+
}
|
|
139
85
|
declare const version: string;
|
|
140
86
|
|
|
141
|
-
export {
|
|
87
|
+
export { RpaTask, version };
|