epii-types-rpa 1.3.2 → 1.3.3
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/package.json +9 -9
- package/rpa.d.ts +204 -199
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "epii-types-rpa",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "rpa-types",
|
|
5
|
-
"author": "MrRen",
|
|
6
|
-
"license": "ISC",
|
|
7
|
-
"types": "rpa.d.ts",
|
|
8
|
-
"typings": "rpa.d.ts"
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "epii-types-rpa",
|
|
3
|
+
"version": "1.3.3",
|
|
4
|
+
"description": "rpa-types",
|
|
5
|
+
"author": "MrRen",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"types": "rpa.d.ts",
|
|
8
|
+
"typings": "rpa.d.ts"
|
|
9
|
+
}
|
package/rpa.d.ts
CHANGED
|
@@ -1,199 +1,204 @@
|
|
|
1
|
-
interface UploadFile {
|
|
2
|
-
postname: String,
|
|
3
|
-
path: String,
|
|
4
|
-
filename: String
|
|
5
|
-
}
|
|
6
|
-
interface RequestHandler {
|
|
7
|
-
reg: String,
|
|
8
|
-
type: "file" | "content" | "abort" | "redirect",
|
|
9
|
-
file?: String,
|
|
10
|
-
content?: String,
|
|
11
|
-
getLocation?: (url: string) => string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface FormItem {
|
|
15
|
-
key: String,
|
|
16
|
-
title?: String,
|
|
17
|
-
value?: any
|
|
18
|
-
}
|
|
19
|
-
type RunInPage = "activated" | "incognito" | "newPage" | "opened" | "";
|
|
20
|
-
type ExtObject = {
|
|
21
|
-
getProperty:(key:string)=>Promise<any>,
|
|
22
|
-
keys:()=>Promise<Array<string>>,
|
|
23
|
-
[any:string]:(...params:any[])=>Promise<any>
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
function
|
|
36
|
-
function
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
function
|
|
41
|
-
function
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function
|
|
46
|
-
function
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
function
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
namespace
|
|
73
|
-
function
|
|
74
|
-
function
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
function
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function
|
|
83
|
-
function
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
function
|
|
88
|
-
function
|
|
89
|
-
function
|
|
90
|
-
function
|
|
91
|
-
function
|
|
92
|
-
function
|
|
93
|
-
function
|
|
94
|
-
function
|
|
95
|
-
function
|
|
96
|
-
function
|
|
97
|
-
function
|
|
98
|
-
function
|
|
99
|
-
function
|
|
100
|
-
function
|
|
101
|
-
function
|
|
102
|
-
function
|
|
103
|
-
function
|
|
104
|
-
function
|
|
105
|
-
function
|
|
106
|
-
function
|
|
107
|
-
function
|
|
108
|
-
function
|
|
109
|
-
function
|
|
110
|
-
function
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
function
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
function
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
function
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
function
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
function
|
|
142
|
-
function
|
|
143
|
-
function
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
function
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
function
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
function
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
function
|
|
163
|
-
function
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
function
|
|
169
|
-
function
|
|
170
|
-
function
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
function
|
|
174
|
-
function
|
|
175
|
-
function
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
1
|
+
interface UploadFile {
|
|
2
|
+
postname: String,
|
|
3
|
+
path: String,
|
|
4
|
+
filename: String
|
|
5
|
+
}
|
|
6
|
+
interface RequestHandler {
|
|
7
|
+
reg: String,
|
|
8
|
+
type: "file" | "content" | "abort" | "redirect",
|
|
9
|
+
file?: String,
|
|
10
|
+
content?: String,
|
|
11
|
+
getLocation?: (url: string) => string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface FormItem {
|
|
15
|
+
key: String,
|
|
16
|
+
title?: String,
|
|
17
|
+
value?: any
|
|
18
|
+
}
|
|
19
|
+
type RunInPage = "activated" | "incognito" | "newPage" | "opened" | "";
|
|
20
|
+
type ExtObject = {
|
|
21
|
+
getProperty:(key:string)=>Promise<any>,
|
|
22
|
+
keys:()=>Promise<Array<string>>,
|
|
23
|
+
[any:string]:(...params:any[])=>Promise<any>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type ReturnBoolFunc = ()=>boolean;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
namespace rpa {
|
|
31
|
+
function ext(mName: string):ExtObject;
|
|
32
|
+
function ready(isReady = 1);
|
|
33
|
+
|
|
34
|
+
function args(key, dvalue);
|
|
35
|
+
function args(key);
|
|
36
|
+
function setArgs(key, value): Promise;
|
|
37
|
+
function setPathAlias(key, value): Promise;
|
|
38
|
+
function mergeArgs(map: Object): Promise;
|
|
39
|
+
function require(path: String): Promise;
|
|
40
|
+
function success(data: any, exit: boolean);
|
|
41
|
+
function exec(script: String, params: Object = {}, runInPage: RunInPage = "");
|
|
42
|
+
function execScript(script: String, params: Object = {}, runInPage: RunInPage = "");
|
|
43
|
+
|
|
44
|
+
function execPuppeteer(script: String, params: Object = {});
|
|
45
|
+
function error(msg: String, code: number = - 1);
|
|
46
|
+
function exit();
|
|
47
|
+
function restartAndExecRpa();
|
|
48
|
+
function restartRpa();
|
|
49
|
+
|
|
50
|
+
function onDialog(callback: Function);
|
|
51
|
+
function waitForRpaReady(): Promise;
|
|
52
|
+
function run(func: Function, data: Object = {}): Promise;
|
|
53
|
+
namespace http {
|
|
54
|
+
function uploadFile(url: String, file: UploadFile, params: Object = {}): Promise;
|
|
55
|
+
function get(url: String): Promise;
|
|
56
|
+
function post(url: String, data: Object): Promise;
|
|
57
|
+
function getBase64(url: String): Promise;
|
|
58
|
+
namespace api {
|
|
59
|
+
function post(url: String, data: Object): Promise;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
namespace ajax {
|
|
64
|
+
function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
|
|
65
|
+
function get(url: String, headers: Object = {}): Promise;
|
|
66
|
+
function getBase64(url: String, headers: Object = {}): Promise;
|
|
67
|
+
function download(url: String, path: String): Promise;
|
|
68
|
+
function setApiBase(_url_pre: String);
|
|
69
|
+
function setBaseData(data: Object);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
namespace console {
|
|
73
|
+
function log(object: any): Promise;
|
|
74
|
+
function error(error): Promise;
|
|
75
|
+
function readline(tip: String = "", dvalue = ""): Promise;
|
|
76
|
+
}
|
|
77
|
+
namespace thread {
|
|
78
|
+
function lockThread(tag: String): Promise;
|
|
79
|
+
function lock(tag: String = 'main'): Promise;
|
|
80
|
+
function unlock(tag: String = 'main');
|
|
81
|
+
function resetlock(tag: String = 'main');
|
|
82
|
+
function singleThread(tag: String): Promise;
|
|
83
|
+
function singleTask(func: Function, waitTimeout: Number = 10, tag: String = 'main'): Promise;
|
|
84
|
+
function clearTask(tag: String = 'main');
|
|
85
|
+
}
|
|
86
|
+
namespace tools {
|
|
87
|
+
function keep(maxTime: Number, promise: Promise, errorMsg: String = null): Promise<any>
|
|
88
|
+
function getUrlHost(url: String): String;
|
|
89
|
+
function addRequestHandler(r: RequestHandler): Promise
|
|
90
|
+
function uploadFile(domOrSelector: | String | Element, path: String | Array<String>): Promise
|
|
91
|
+
function log(object: any): Promise;
|
|
92
|
+
function getAbsolutePath(path: String): Promise;
|
|
93
|
+
function getHtml(url: String): Promise;
|
|
94
|
+
function getResponseContentOnPage(pageUrl: String, urlOrurls: String | Array<String>): Promise;
|
|
95
|
+
function waitForResponseContent(url: String): Promise;
|
|
96
|
+
function execSystem(cmd: String): Promise;
|
|
97
|
+
function fileGetContent(path: String): Promise;
|
|
98
|
+
function fileGetContentBase64(path: String): Promise;
|
|
99
|
+
function getScriptContent(path: String): Promise;
|
|
100
|
+
function download(url: String, path: String): Promise;
|
|
101
|
+
function sleep(time: Number): Promise;
|
|
102
|
+
function setInterval(callback: Function, interval: Number): Promise;
|
|
103
|
+
function writeFile(filePath: String, content: String, isBase64: boolean = false): Promise;
|
|
104
|
+
function forEach(list: Array, callback: Function): Promise;
|
|
105
|
+
function mkdir(path: String): Promise;
|
|
106
|
+
function randomString(len: Number): Promise;
|
|
107
|
+
function function2string(func: Function, data: Object): String;
|
|
108
|
+
function waitForTrue(func: Function, interval = 500): Promise;
|
|
109
|
+
function encodeURI(str: String, charset: String = "utf-8"): Promise;
|
|
110
|
+
function decodeURI(str: String, charset: String = "utf-8"): Promise;
|
|
111
|
+
function replace(str: String, regex: RegExp, asyncFn: Function): Promise;
|
|
112
|
+
function arrayBufferToBase64(buffer: String): String;
|
|
113
|
+
function waitForSelector(selectorOrFunction: String | Function): Promise<Element>;
|
|
114
|
+
function waitForSelectors(selectorOrFunction: String | Function): Promise<Array<Element>>
|
|
115
|
+
function getAppDataDir(subDir:string):Promise<string>;
|
|
116
|
+
function unlink(filepath:string):Promise<string>;
|
|
117
|
+
}
|
|
118
|
+
namespace page {
|
|
119
|
+
|
|
120
|
+
function screenshot(options: Object): Promise;
|
|
121
|
+
function pdf(options): Promise;
|
|
122
|
+
|
|
123
|
+
function waitForNavigation(options = {});
|
|
124
|
+
function waitForSelector(selector, timeout = 30000);
|
|
125
|
+
function waitForXPath(xpath);
|
|
126
|
+
function waitForTimeout(timeout);
|
|
127
|
+
function script(func, data = {});
|
|
128
|
+
|
|
129
|
+
function newIframeAndEvaluate(urlOrFunction:String | Function, func: Function,removeOnFinish:boolean = true, loadCountOrLoadCheckFunc:number | ReturnBoolFunc = 1): Promise;
|
|
130
|
+
|
|
131
|
+
function download(url: String, path: String): Promise;
|
|
132
|
+
function closeActivated(): Promise;
|
|
133
|
+
namespace stracing {
|
|
134
|
+
function start(filePath: String): Promise;
|
|
135
|
+
function stop(): Promise;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
namespace browser {
|
|
140
|
+
function newPageAndDownLoad(url: String, path: String): Promise;
|
|
141
|
+
function newPageAndGetBase64(url: String): Promise;
|
|
142
|
+
function newPageAndEvaluate(url: String, func: Function, data: Object = {}): Promise;
|
|
143
|
+
function waitOpenedPageAndEvaluate(invokeFun: Function, func: Function, data: Object = {}): Promise;
|
|
144
|
+
function waitOpenedPageAndExec(invokeFun: Function, script: String, params: Object = {}): Promise;
|
|
145
|
+
|
|
146
|
+
function getNextWindowOpenUrl(beforFunc: Function, cancel: boolean): Promise;
|
|
147
|
+
function getNextWindowOpenUrl(beforFunc: Function): Promise;
|
|
148
|
+
function newIncognitoPageAndEvaluate(url: String, func: Function, data: Object = {}): Promise;
|
|
149
|
+
function download(invokeFun:Function, toFilePathOrExt:string|null = null,timeout:string=20000) : Promise;
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
namespace runtime {
|
|
153
|
+
function get(key: String = null): Promise;
|
|
154
|
+
function set(map: Object): Promise;
|
|
155
|
+
}
|
|
156
|
+
namespace frame {
|
|
157
|
+
function newIframeAndEvaluate(urlOrFunction:String | Function, func: Function,removeOnFinish:boolean = true, loadCountOrLoadCheckFunc:number | ReturnBoolFunc = 1): Promise;
|
|
158
|
+
function newCrossIframeContext(host: String, func: Function, data: Object = {}, removeOnFinish: Boolean = true): Promise;
|
|
159
|
+
function newIframeAndevaluateCross(urlOrFunction:String | Function, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
|
|
160
|
+
function evaluateCross(name: String, func: Function, data = {}): Promise;
|
|
161
|
+
function evaluate(name: String, func: Function): Promise;
|
|
162
|
+
function evaluateOnNextFrame(invokeFun: Function, func: Function, remove: boolean): Promise;
|
|
163
|
+
function evaluateOnNextFrame(invokeFun: Function, func: Function): Promise;
|
|
164
|
+
function evaluateOnNextFrameCross(invokeFun: Function, func: Function, data: Object = {}, remove: Boolean = false)
|
|
165
|
+
}
|
|
166
|
+
namespace localStorage {
|
|
167
|
+
function setItem(key: String, value): Promise;
|
|
168
|
+
function getItem(key: String): Promise;
|
|
169
|
+
function clear(): Promise;
|
|
170
|
+
function removeItem(key: String): Promise;
|
|
171
|
+
}
|
|
172
|
+
namespace view {
|
|
173
|
+
function alert(message?: any): Promise;
|
|
174
|
+
function confirm(message?: string): Promise;
|
|
175
|
+
function getCustomValue(keysOrOptions: Array<String> | Array<FormItem>, autoNextCount: Number = 5, title = ""): Promise<Object>;
|
|
176
|
+
function showConsoleView(title: String = null, clearTime: Number = 600000, zIndex: Number = 10000, clearKeepNum: Number = 50): Promise;
|
|
177
|
+
function hideConsoleView();
|
|
178
|
+
function console(msg: String, color: String = "#ffffff");
|
|
179
|
+
function consoleClear();
|
|
180
|
+
function showMaskView(title: String = "");
|
|
181
|
+
function hideMaskView();
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
namespace process {
|
|
185
|
+
function exit(): Promise;
|
|
186
|
+
}
|
|
187
|
+
namespace cross {
|
|
188
|
+
function newIframeContextAndEvaluate(host: String, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
|
|
189
|
+
function newIframeAndEvaluate(urlOrFunction: String | Function, func: Function, data = {}, removeOnFinish: Boolean = true): Promise;
|
|
190
|
+
namespace ajax {
|
|
191
|
+
function post(url: String, data: Object | String = "", headers: Object = {}): Promise;
|
|
192
|
+
function get(url: String, headers: Object = {}): Promise;
|
|
193
|
+
function getBase64(url: String, headers: Object = {}): Promise;
|
|
194
|
+
function download(url: String, path: String): Promise
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare function require(path: String, readCache: Boolean = true): Promise;
|
|
201
|
+
// declare let args: Object;
|
|
202
|
+
namespace args {
|
|
203
|
+
function get(key: String, dvalue: any = null): any;
|
|
204
|
+
}
|