nothing-browser 0.1.3 → 0.1.4
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 +14 -26
- package/piggy/cache/{memory.ts → memory.js} +5 -10
- package/piggy/captcha/{index.ts → index.js} +19 -28
- package/piggy/capture/index.js +40 -0
- package/piggy/client/{index.ts → index.js} +133 -154
- package/piggy/dialog/{index.ts → index.js} +15 -31
- package/piggy/export/index.js +105 -0
- package/piggy/expose/index.js +24 -0
- package/piggy/find/{index.ts → index.js} +24 -39
- package/piggy/http/{index.ts → index.js} +7 -16
- package/piggy/human/{index.ts → index.js} +18 -49
- package/piggy/iframe/index.js +56 -0
- package/piggy/interactions/{index.ts → index.js} +20 -23
- package/piggy/intercept/{scripts.ts → scripts.js} +4 -13
- package/piggy/launch/{detect.ts → detect.js} +4 -6
- package/piggy/launch/{spawn.ts → spawn.js} +17 -22
- package/piggy/media/{index.ts → index.js} +13 -11
- package/piggy/navigation/{index.ts → index.js} +16 -14
- package/piggy/pool/index.js +76 -0
- package/piggy/provide/index.js +97 -0
- package/piggy/proxy/index.js +95 -0
- package/piggy/register/index.js +543 -0
- package/piggy/router/index.js +44 -0
- package/piggy/server/{index.ts → index.js} +16 -64
- package/piggy/session/index.js +69 -0
- package/piggy/store/{index.ts → index.js} +22 -62
- package/piggy/tabs/index.js +24 -0
- package/piggy/wait/index.js +77 -0
- package/{piggy.ts → piggy.js} +122 -146
- package/dist/cache/memory.js +0 -35
- package/dist/client/index.js +0 -1284
- package/dist/human/index.js +0 -82
- package/dist/launch/detect.js +0 -782
- package/dist/launch/spawn.js +0 -915
- package/dist/logger/index.js +0 -733
- package/dist/piggy/cache/memory.d.ts +0 -7
- package/dist/piggy/cache/memory.d.ts.map +0 -1
- package/dist/piggy/captcha/index.d.ts +0 -39
- package/dist/piggy/captcha/index.d.ts.map +0 -1
- package/dist/piggy/capture/index.d.ts +0 -48
- package/dist/piggy/capture/index.d.ts.map +0 -1
- package/dist/piggy/client/index.d.ts +0 -146
- package/dist/piggy/client/index.d.ts.map +0 -1
- package/dist/piggy/dialog/index.d.ts +0 -28
- package/dist/piggy/dialog/index.d.ts.map +0 -1
- package/dist/piggy/export/index.d.ts +0 -62
- package/dist/piggy/export/index.d.ts.map +0 -1
- package/dist/piggy/expose/index.d.ts +0 -6
- package/dist/piggy/expose/index.d.ts.map +0 -1
- package/dist/piggy/find/index.d.ts +0 -52
- package/dist/piggy/find/index.d.ts.map +0 -1
- package/dist/piggy/http/index.d.ts +0 -14
- package/dist/piggy/http/index.d.ts.map +0 -1
- package/dist/piggy/human/index.d.ts +0 -39
- package/dist/piggy/human/index.d.ts.map +0 -1
- package/dist/piggy/iframe/index.d.ts +0 -53
- package/dist/piggy/iframe/index.d.ts.map +0 -1
- package/dist/piggy/interactions/index.d.ts +0 -24
- package/dist/piggy/interactions/index.d.ts.map +0 -1
- package/dist/piggy/intercept/scripts.d.ts +0 -13
- package/dist/piggy/intercept/scripts.d.ts.map +0 -1
- package/dist/piggy/launch/detect.d.ts +0 -3
- package/dist/piggy/launch/detect.d.ts.map +0 -1
- package/dist/piggy/launch/spawn.d.ts +0 -6
- package/dist/piggy/launch/spawn.d.ts.map +0 -1
- package/dist/piggy/logger/index.d.ts +0 -3
- package/dist/piggy/logger/index.d.ts.map +0 -1
- package/dist/piggy/media/index.d.ts +0 -11
- package/dist/piggy/media/index.d.ts.map +0 -1
- package/dist/piggy/navigation/index.d.ts +0 -16
- package/dist/piggy/navigation/index.d.ts.map +0 -1
- package/dist/piggy/pool/index.d.ts +0 -23
- package/dist/piggy/pool/index.d.ts.map +0 -1
- package/dist/piggy/provide/index.d.ts +0 -98
- package/dist/piggy/provide/index.d.ts.map +0 -1
- package/dist/piggy/proxy/index.d.ts +0 -94
- package/dist/piggy/proxy/index.d.ts.map +0 -1
- package/dist/piggy/register/index.d.ts +0 -9
- package/dist/piggy/register/index.d.ts.map +0 -1
- package/dist/piggy/router/index.d.ts +0 -38
- package/dist/piggy/router/index.d.ts.map +0 -1
- package/dist/piggy/server/index.d.ts +0 -42
- package/dist/piggy/server/index.d.ts.map +0 -1
- package/dist/piggy/session/index.d.ts +0 -27
- package/dist/piggy/session/index.d.ts.map +0 -1
- package/dist/piggy/store/index.d.ts +0 -22
- package/dist/piggy/store/index.d.ts.map +0 -1
- package/dist/piggy/tabs/index.d.ts +0 -12
- package/dist/piggy/tabs/index.d.ts.map +0 -1
- package/dist/piggy/wait/index.d.ts +0 -28
- package/dist/piggy/wait/index.d.ts.map +0 -1
- package/dist/piggy.d.ts +0 -10
- package/dist/piggy.d.ts.map +0 -1
- package/dist/piggy.js +0 -30223
- package/dist/register/index.js +0 -23710
- package/dist/server/index.js +0 -26831
- package/piggy/capture/index.ts +0 -76
- package/piggy/export/index.d.ts +0 -117
- package/piggy/export/index.ts +0 -147
- package/piggy/expose/index.ts +0 -42
- package/piggy/iframe/index.ts +0 -79
- package/piggy/intercept/scripts.d.ts +0 -13
- package/piggy/intercept/scripts.d.ts.map +0 -1
- package/piggy/launch/detect.d.ts +0 -3
- package/piggy/launch/detect.d.ts.map +0 -1
- package/piggy/launch/spawn.d.ts +0 -6
- package/piggy/launch/spawn.d.ts.map +0 -1
- package/piggy/logger/index.d.ts +0 -3
- package/piggy/logger/index.d.ts.map +0 -1
- package/piggy/pool/index.d.ts +0 -12
- package/piggy/pool/index.ts +0 -75
- package/piggy/provide/index.ts +0 -170
- package/piggy/proxy/index.ts +0 -154
- package/piggy/register/index.ts +0 -575
- package/piggy/router/index.ts +0 -69
- package/piggy/session/index.ts +0 -76
- package/piggy/store/index.d.ts +0 -26
- package/piggy/tabs/index.ts +0 -23
- package/piggy/wait/index.ts +0 -90
- /package/piggy/logger/{index.ts → index.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../piggy/launch/spawn.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAQzD,wBAAgB,eAAe,IAAI,IAAI,CAgBtC;AAED,wBAAsB,YAAY,CAAC,IAAI,GAAE,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmEjF;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,UAAuB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,WAAW,IAAI,IAAI,CAmBlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/logger/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM,gCAiDV,CAAC;AAKH,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export declare class MediaClient {
|
|
3
|
-
private client;
|
|
4
|
-
constructor(client: PiggyClient);
|
|
5
|
-
screenshot(filePath?: string, tabId?: string): Promise<string>;
|
|
6
|
-
pdf(filePath?: string, tabId?: string): Promise<string>;
|
|
7
|
-
blockImages(tabId?: string): Promise<void>;
|
|
8
|
-
unblockImages(tabId?: string): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare function createMediaAPI(client: PiggyClient): MediaClient;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/media/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAIjC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAYjE,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAYhE,WAAW,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,aAAa,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAE/D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export declare class NavigationClient {
|
|
3
|
-
private client;
|
|
4
|
-
constructor(client: PiggyClient);
|
|
5
|
-
navigate(url: string, tabId?: string): Promise<void>;
|
|
6
|
-
reload(tabId?: string): Promise<void>;
|
|
7
|
-
goBack(tabId?: string): Promise<void>;
|
|
8
|
-
goForward(tabId?: string): Promise<void>;
|
|
9
|
-
url(tabId?: string): Promise<string>;
|
|
10
|
-
title(tabId?: string): Promise<string>;
|
|
11
|
-
content(tabId?: string): Promise<string>;
|
|
12
|
-
waitForNavigation(tabId?: string): Promise<void>;
|
|
13
|
-
waitForSelector(selector: string, timeout?: number, tabId?: string): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export declare function createNavigationAPI(client: PiggyClient): NavigationClient;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/navigation/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAIvC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,MAAM,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,MAAM,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,SAAS,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,GAAG,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvC,KAAK,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzC,OAAO,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAM3C,iBAAiB,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAQ,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAEzE"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export declare class TabPool {
|
|
3
|
-
private client;
|
|
4
|
-
private size;
|
|
5
|
-
private seedUrl;
|
|
6
|
-
private name;
|
|
7
|
-
private idle;
|
|
8
|
-
private busy;
|
|
9
|
-
private queue;
|
|
10
|
-
constructor(client: PiggyClient, size: number, seedUrl: string, name: string);
|
|
11
|
-
init(): Promise<void>;
|
|
12
|
-
acquire(): Promise<string>;
|
|
13
|
-
release(tabId: string): void;
|
|
14
|
-
withTab<T>(fn: (tabId: string) => Promise<T>): Promise<T>;
|
|
15
|
-
close(): Promise<void>;
|
|
16
|
-
get stats(): {
|
|
17
|
-
idle: number;
|
|
18
|
-
busy: number;
|
|
19
|
-
queued: number;
|
|
20
|
-
total: number;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/pool/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,qBAAa,OAAO;IAMhB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IARd,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,KAAK,CAAmC;gBAGtC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM;IAGhB,IAAI;IASV,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAY1B,OAAO,CAAC,KAAK,EAAE,MAAM;IAWf,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IASzD,KAAK;IASX,IAAI,KAAK;;;;;MAOR;CACF"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export interface ProvideOptions {
|
|
3
|
-
/** CSS selector for the target element(s). */
|
|
4
|
-
selector: string;
|
|
5
|
-
/**
|
|
6
|
-
* Optional parent selector to scope the query under.
|
|
7
|
-
* Equivalent to: parent.querySelector(selector)
|
|
8
|
-
*/
|
|
9
|
-
parent?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ProvideAttrOptions extends ProvideOptions {
|
|
12
|
-
/** The attribute name to extract. */
|
|
13
|
-
attr: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ProvideListOptions extends ProvideOptions {
|
|
16
|
-
/** Optional child selector to scope list items. */
|
|
17
|
-
itemSel?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ProvideTable {
|
|
20
|
-
headers: string[];
|
|
21
|
-
rows: string[][];
|
|
22
|
-
}
|
|
23
|
-
export interface ProvideLink {
|
|
24
|
-
text: string;
|
|
25
|
-
href: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ProvideImage {
|
|
28
|
-
alt: string;
|
|
29
|
-
src: string;
|
|
30
|
-
}
|
|
31
|
-
export interface ProvideForm {
|
|
32
|
-
[name: string]: string;
|
|
33
|
-
}
|
|
34
|
-
export interface ProvidePage {
|
|
35
|
-
title: string;
|
|
36
|
-
url: string;
|
|
37
|
-
html: string;
|
|
38
|
-
text: string;
|
|
39
|
-
}
|
|
40
|
-
export interface ProvideDiv {
|
|
41
|
-
tag: string;
|
|
42
|
-
id: string;
|
|
43
|
-
cls: string;
|
|
44
|
-
text: string;
|
|
45
|
-
html: string;
|
|
46
|
-
children: ProvideDiv[];
|
|
47
|
-
}
|
|
48
|
-
export interface ProvideMeta {
|
|
49
|
-
[name: string]: string;
|
|
50
|
-
}
|
|
51
|
-
export interface ProvideSelectOption {
|
|
52
|
-
text: string;
|
|
53
|
-
value: string;
|
|
54
|
-
selected: boolean;
|
|
55
|
-
}
|
|
56
|
-
export interface ProvideSelect {
|
|
57
|
-
value: string;
|
|
58
|
-
options: ProvideSelectOption[];
|
|
59
|
-
}
|
|
60
|
-
export declare class ProvideClient {
|
|
61
|
-
private client;
|
|
62
|
-
constructor(client: PiggyClient);
|
|
63
|
-
/** innerText of the first matched element. */
|
|
64
|
-
text(opts: ProvideOptions, tabId?: string): Promise<string>;
|
|
65
|
-
/** innerText of all matched elements. */
|
|
66
|
-
textAll(opts: ProvideOptions, tabId?: string): Promise<string[]>;
|
|
67
|
-
/** Single attribute value from the first matched element. */
|
|
68
|
-
attr(opts: ProvideAttrOptions, tabId?: string): Promise<string>;
|
|
69
|
-
/** Attribute value from all matched elements. */
|
|
70
|
-
attrAll(opts: ProvideAttrOptions, tabId?: string): Promise<string[]>;
|
|
71
|
-
/** innerHTML of the first matched element. */
|
|
72
|
-
html(opts: ProvideOptions, tabId?: string): Promise<string>;
|
|
73
|
-
/** Extract a table into headers + rows. */
|
|
74
|
-
table(opts: ProvideOptions, tabId?: string): Promise<ProvideTable>;
|
|
75
|
-
/** Extract a list of text items, optionally scoped to child items. */
|
|
76
|
-
list(opts: ProvideListOptions, tabId?: string): Promise<string[]>;
|
|
77
|
-
/** All links inside the matched selector. */
|
|
78
|
-
links(opts: ProvideOptions, tabId?: string): Promise<ProvideLink[]>;
|
|
79
|
-
/** All images inside the matched selector. */
|
|
80
|
-
images(opts: ProvideOptions, tabId?: string): Promise<ProvideImage[]>;
|
|
81
|
-
/** Form field name→value map. */
|
|
82
|
-
form(opts: ProvideOptions, tabId?: string): Promise<ProvideForm>;
|
|
83
|
-
/** Full page info: title, url, html, text. No selector needed. */
|
|
84
|
-
page(tabId?: string): Promise<ProvidePage>;
|
|
85
|
-
/** Structured div tree: tag, id, cls, text, html, children[]. */
|
|
86
|
-
div(opts: ProvideOptions, tabId?: string): Promise<ProvideDiv>;
|
|
87
|
-
/** All <meta> name→content pairs. No selector needed. */
|
|
88
|
-
meta(tabId?: string): Promise<ProvideMeta>;
|
|
89
|
-
/** <select> current value + all options. */
|
|
90
|
-
select(opts: ProvideOptions, tabId?: string): Promise<ProvideSelect>;
|
|
91
|
-
/**
|
|
92
|
-
* Parse JSON from element innerText or script[type=application/json].
|
|
93
|
-
* selector is optional — defaults to the first matching JSON script tag.
|
|
94
|
-
*/
|
|
95
|
-
json(opts?: Partial<ProvideOptions>, tabId?: string): Promise<unknown>;
|
|
96
|
-
}
|
|
97
|
-
export declare function createProvideAPI(client: PiggyClient): ProvideClient;
|
|
98
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/provide/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAKxC,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,k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AI7C,4CAA4C;IAC5C,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvE;;;OAGG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAG1E;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAEnE"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export type ProxyType = "http" | "https" | "socks5";
|
|
3
|
-
export type ProxyHealth = "alive" | "dead" | "checking" | "unchecked";
|
|
4
|
-
export type RotationMode = "none" | "timed" | "perrequest";
|
|
5
|
-
export interface ProxyEntry {
|
|
6
|
-
index: number;
|
|
7
|
-
host: string;
|
|
8
|
-
port: number;
|
|
9
|
-
type: ProxyType;
|
|
10
|
-
user: string;
|
|
11
|
-
proxy: string;
|
|
12
|
-
latency: number;
|
|
13
|
-
health: ProxyHealth;
|
|
14
|
-
current: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface ProxyStats {
|
|
17
|
-
total: number;
|
|
18
|
-
alive: number;
|
|
19
|
-
dead: number;
|
|
20
|
-
index: number;
|
|
21
|
-
active: boolean;
|
|
22
|
-
checking: boolean;
|
|
23
|
-
skipDead: boolean;
|
|
24
|
-
autoCheck: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface ProxyListResult {
|
|
27
|
-
proxies: ProxyEntry[];
|
|
28
|
-
total: number;
|
|
29
|
-
shown: number;
|
|
30
|
-
}
|
|
31
|
-
export interface ProxyCurrent {
|
|
32
|
-
active: boolean;
|
|
33
|
-
host?: string;
|
|
34
|
-
port?: number;
|
|
35
|
-
type?: ProxyType;
|
|
36
|
-
user?: string;
|
|
37
|
-
proxy?: string;
|
|
38
|
-
latency?: number;
|
|
39
|
-
health?: ProxyHealth;
|
|
40
|
-
}
|
|
41
|
-
export interface ProxyConfig {
|
|
42
|
-
skipDead: boolean;
|
|
43
|
-
autoCheck: boolean;
|
|
44
|
-
}
|
|
45
|
-
export type ProxySetOptions = {
|
|
46
|
-
proxy: string;
|
|
47
|
-
} | {
|
|
48
|
-
host: string;
|
|
49
|
-
port: number;
|
|
50
|
-
type?: ProxyType;
|
|
51
|
-
user?: string;
|
|
52
|
-
pass?: string;
|
|
53
|
-
};
|
|
54
|
-
export declare class ProxyClient {
|
|
55
|
-
private client;
|
|
56
|
-
constructor(client: PiggyClient);
|
|
57
|
-
/** Load proxies from a local file path. */
|
|
58
|
-
load(path: string): Promise<void>;
|
|
59
|
-
/** Fetch proxies from a URL. Result comes via proxy:loaded / proxy:fetch:failed events. */
|
|
60
|
-
fetch(url: string): Promise<void>;
|
|
61
|
-
/** Load an .ovpn config file. */
|
|
62
|
-
ovpn(path: string): Promise<void>;
|
|
63
|
-
/** Set a single proxy inline. */
|
|
64
|
-
set(opts: ProxySetOptions): Promise<void>;
|
|
65
|
-
/** Health-check all loaded proxies. Results come via events. */
|
|
66
|
-
test(): Promise<void>;
|
|
67
|
-
/** Abort an in-progress health check. */
|
|
68
|
-
testStop(): Promise<void>;
|
|
69
|
-
/** Rotate to the next proxy in the pool. */
|
|
70
|
-
next(): Promise<string>;
|
|
71
|
-
/** Alias for next(). */
|
|
72
|
-
rotate(): Promise<string>;
|
|
73
|
-
/** Disable the proxy — use the real IP. */
|
|
74
|
-
disable(): Promise<void>;
|
|
75
|
-
/** Re-enable the current proxy. */
|
|
76
|
-
enable(): Promise<void>;
|
|
77
|
-
/** Get the current active proxy details. */
|
|
78
|
-
current(): Promise<ProxyCurrent>;
|
|
79
|
-
/** Get pool stats: total, alive, dead, index, active, checking. */
|
|
80
|
-
stats(): Promise<ProxyStats>;
|
|
81
|
-
/** List all proxies with health info. limit defaults to 500. */
|
|
82
|
-
list(limit?: number): Promise<ProxyListResult>;
|
|
83
|
-
/** Set rotation mode and interval (seconds, only used for "timed"). */
|
|
84
|
-
rotation(mode: RotationMode, interval?: number): Promise<void>;
|
|
85
|
-
/** Set skipDead / autoCheck flags. */
|
|
86
|
-
config(opts: Partial<ProxyConfig>): Promise<ProxyConfig>;
|
|
87
|
-
/**
|
|
88
|
-
* Save the current proxy list to a file.
|
|
89
|
-
* filter: "all" | "alive" | "dead" — defaults to "all".
|
|
90
|
-
*/
|
|
91
|
-
save(path: string, filter?: "all" | "alive" | "dead"): Promise<void>;
|
|
92
|
-
}
|
|
93
|
-
export declare function createProxyAPI(client: PiggyClient): ProxyClient;
|
|
94
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/proxy/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,MAAM,MAAM,SAAS,GAAM,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,WAAW,GAAI,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAI,MAAM,CAAC;IAChB,IAAI,EAAK,MAAM,CAAC;IAChB,IAAI,EAAK,MAAM,CAAC;IAChB,IAAI,EAAK,SAAS,CAAC;IACnB,IAAI,EAAK,MAAM,CAAC;IAChB,KAAK,EAAI,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,WAAW,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAM,MAAM,CAAC;IAClB,KAAK,EAAM,MAAM,CAAC;IAClB,IAAI,EAAO,MAAM,CAAC;IAClB,KAAK,EAAM,MAAM,CAAC;IAClB,MAAM,EAAK,OAAO,CAAC;IACnB,QA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,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,gEAAgE;IAChE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,yCAAyC;IACzC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,4CAA4C;IAC5C,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvB,wBAAwB;IACxB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzB,2CAA2C;IAC3C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,mCAAmC;IACnC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,4CAA4C;IAC5C,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAIhC,mEAAmE;IACnE,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;IAI5B,gEAAgE;IAChE,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9C,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,sCAAsC;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxD;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE;AAID,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAE/D"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
import { TabPool } from "../pool";
|
|
3
|
-
export declare let humanMode: boolean;
|
|
4
|
-
export declare function setClient(c: PiggyClient | null): void;
|
|
5
|
-
export declare function setHumanMode(v: boolean): void;
|
|
6
|
-
export declare function createSiteObject(name: string, registeredUrl: string, client: PiggyClient, tabId: string, pool?: TabPool): any;
|
|
7
|
-
export type SiteObject = ReturnType<typeof createSiteObject>;
|
|
8
|
-
export declare function createExposedAPI<T extends Record<string, (data: any) => any>>(site: any, apiName: string, handlers: T): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/register/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAMxC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAUlC,eAAO,IAAI,SAAS,SAAQ,CAAC;AAE7B,wBAAgB,SAAS,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,QAAuB;AACtE,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,QAAoB;AAgB3D,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,OAogBf;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,EAC3E,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
import { CaptureClient } from "../capture";
|
|
3
|
-
import { CaptchaClient } from "../captcha";
|
|
4
|
-
import { DialogClient } from "../dialog";
|
|
5
|
-
import { ExportClient } from "../export";
|
|
6
|
-
import { FindClient } from "../find";
|
|
7
|
-
import { HumanClient } from "../human";
|
|
8
|
-
import { IframeClient } from "../iframe";
|
|
9
|
-
import { InteractionsClient } from "../interactions";
|
|
10
|
-
import { MediaClient } from "../media";
|
|
11
|
-
import { NavigationClient } from "../navigation";
|
|
12
|
-
import { ProvideClient } from "../provide";
|
|
13
|
-
import { ProxyClient } from "../proxy";
|
|
14
|
-
import { SessionClient } from "../session";
|
|
15
|
-
import { TabsClient } from "../tabs";
|
|
16
|
-
import { WaitClient, EvaluateClient, FetchClient } from "../wait";
|
|
17
|
-
export interface PiggyRouter {
|
|
18
|
-
client: PiggyClient;
|
|
19
|
-
tabs: TabsClient;
|
|
20
|
-
navigation: NavigationClient;
|
|
21
|
-
interactions: InteractionsClient;
|
|
22
|
-
media: MediaClient;
|
|
23
|
-
capture: CaptureClient;
|
|
24
|
-
find: FindClient;
|
|
25
|
-
provide: ProvideClient;
|
|
26
|
-
wait: WaitClient;
|
|
27
|
-
evaluate: EvaluateClient;
|
|
28
|
-
fetch: FetchClient;
|
|
29
|
-
proxy: ProxyClient;
|
|
30
|
-
captcha: CaptchaClient;
|
|
31
|
-
dialog: DialogClient;
|
|
32
|
-
human: HumanClient;
|
|
33
|
-
iframe: IframeClient;
|
|
34
|
-
session: SessionClient;
|
|
35
|
-
export: ExportClient;
|
|
36
|
-
}
|
|
37
|
-
export declare function createRouter(client: PiggyClient): PiggyRouter;
|
|
38
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/router/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAC;AAC1D,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,42 +0,0 @@
|
|
|
1
|
-
import { Elysia } from "elysia";
|
|
2
|
-
export type BeforeMiddleware = (ctx: {
|
|
3
|
-
params: Record<string, string>;
|
|
4
|
-
query: Record<string, string>;
|
|
5
|
-
body: any;
|
|
6
|
-
headers: Record<string, string>;
|
|
7
|
-
set: any;
|
|
8
|
-
}) => void | Promise<void>;
|
|
9
|
-
export type RouteHandler = (params: Record<string, string>, query: Record<string, string>, body: any) => Promise<any>;
|
|
10
|
-
export interface RouteParameter {
|
|
11
|
-
name: string;
|
|
12
|
-
in: "query" | "path" | "header" | "cookie";
|
|
13
|
-
description?: string;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
schema?: Record<string, any>;
|
|
16
|
-
}
|
|
17
|
-
export interface RouteDetail {
|
|
18
|
-
tags?: string[];
|
|
19
|
-
summary?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
deprecated?: boolean;
|
|
22
|
-
hide?: boolean;
|
|
23
|
-
parameters?: RouteParameter[];
|
|
24
|
-
}
|
|
25
|
-
export interface RouteConfig {
|
|
26
|
-
path: string;
|
|
27
|
-
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
28
|
-
handler: RouteHandler;
|
|
29
|
-
ttl: number;
|
|
30
|
-
before: BeforeMiddleware[];
|
|
31
|
-
detail?: RouteDetail;
|
|
32
|
-
}
|
|
33
|
-
export declare const routeRegistry: Map<string, RouteConfig>;
|
|
34
|
-
export declare const keepAliveSites: Set<string>;
|
|
35
|
-
export declare function startServer(port: number, hostname?: string, openapiOpts?: {
|
|
36
|
-
title?: string;
|
|
37
|
-
version?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
path?: string;
|
|
40
|
-
}): Promise<Elysia>;
|
|
41
|
-
export declare function stopServer(): void;
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/server/index.ts"],"names":[],"mappings":"AACA,OAAO,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C;IAC1C,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,0BAAiC,CAAC;AAC5D,eAAO,MAAM,cAAc,aAAoB,CAAC;AAmBhD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,SAAY,EACpB,WAAW,CAAC,EAAE;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,OAAO,CAAC,MAAM,CAAC,CA6GjB;AAED,wBAAgB,UAAU,SAGzB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
import type { CookieSetOptions, CookieDeleteOptions } from "../export";
|
|
3
|
-
export interface SessionPaths {
|
|
4
|
-
workDir: string;
|
|
5
|
-
cookies: string;
|
|
6
|
-
profile: string;
|
|
7
|
-
ws: string;
|
|
8
|
-
pings: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class SessionClient {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: PiggyClient);
|
|
13
|
-
reload(tabId?: string): Promise<void>;
|
|
14
|
-
paths(): Promise<SessionPaths>;
|
|
15
|
-
cookiesPath(): Promise<string>;
|
|
16
|
-
profilePath(): Promise<string>;
|
|
17
|
-
wsPath(): Promise<string>;
|
|
18
|
-
pingsPath(): Promise<string>;
|
|
19
|
-
setWsSave(enabled: boolean): Promise<void>;
|
|
20
|
-
setPingsSave(enabled: boolean): Promise<void>;
|
|
21
|
-
export(tabId?: string): Promise<any>;
|
|
22
|
-
import(data: any, tabId?: string): Promise<void>;
|
|
23
|
-
setCookie(opts: CookieSetOptions, tabId?: string): Promise<void>;
|
|
24
|
-
deleteCookie(opts: CookieDeleteOptions, tabId?: string): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export declare function createSessionAPI(client: PiggyClient): SessionClient;
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/session/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAGvC,MAAM,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC;IAI9B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAK5B,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvC,MAAM,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAK7C,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,SAAS,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,YAAY,CAAC,IAAI,EAAE,mBAAmB,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAEnE"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type FieldType = "string" | "number" | "boolean" | "object" | "array";
|
|
2
|
-
export interface FieldSchema {
|
|
3
|
-
type: FieldType;
|
|
4
|
-
required?: boolean;
|
|
5
|
-
default?: any;
|
|
6
|
-
}
|
|
7
|
-
export interface StoreSchema {
|
|
8
|
-
name: string;
|
|
9
|
-
destination: string;
|
|
10
|
-
fields: Record<string, FieldSchema>;
|
|
11
|
-
}
|
|
12
|
-
export interface PiggyStoreConfig {
|
|
13
|
-
stores: StoreSchema[];
|
|
14
|
-
}
|
|
15
|
-
export declare function loadStoreConfig(configPath?: string): PiggyStoreConfig;
|
|
16
|
-
export declare function getSchema(storeName: string): StoreSchema | null;
|
|
17
|
-
export declare function shapeRecord(data: Record<string, any>, schema: StoreSchema): Record<string, any>;
|
|
18
|
-
export declare function storeRecord(storeName: string, data: Record<string, any> | Record<string, any>[]): Promise<{
|
|
19
|
-
stored: number;
|
|
20
|
-
skipped: number;
|
|
21
|
-
}>;
|
|
22
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/store/index.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAMD,wBAAgB,eAAe,CAAC,UAAU,SAAuB,GAAG,gBAAgB,CAiBnF;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAG/D;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAyC/F;AA4FD,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAChD,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAsC9C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export declare class TabsClient {
|
|
3
|
-
private client;
|
|
4
|
-
constructor(client: PiggyClient);
|
|
5
|
-
new(): Promise<string>;
|
|
6
|
-
close(opts: string | {
|
|
7
|
-
tabId: string;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
list(): Promise<string[]>;
|
|
10
|
-
}
|
|
11
|
-
export declare function createTabsAPI(client: PiggyClient): TabsClient;
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/tabs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAItB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAG1B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAE7D"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { PiggyClient } from "../client";
|
|
2
|
-
export type WaitSelectorState = "attached" | "detached" | "visible" | "hidden";
|
|
3
|
-
export declare class WaitClient {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(client: PiggyClient);
|
|
6
|
-
function(js: string, timeout?: number, tabId?: string): Promise<void>;
|
|
7
|
-
selector(selector: string, state?: WaitSelectorState, timeout?: number, tabId?: string): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare class EvaluateClient {
|
|
10
|
-
private client;
|
|
11
|
-
constructor(client: PiggyClient);
|
|
12
|
-
run(js: string, timeout?: number, tabId?: string): Promise<unknown>;
|
|
13
|
-
}
|
|
14
|
-
export declare class FetchClient {
|
|
15
|
-
private client;
|
|
16
|
-
constructor(client: PiggyClient);
|
|
17
|
-
text(selector: string, tabId?: string): Promise<string | null>;
|
|
18
|
-
textAll(selector: string, tabId?: string): Promise<string[]>;
|
|
19
|
-
attr(selector: string, attr: string, tabId?: string): Promise<string | null>;
|
|
20
|
-
attrAll(selector: string, attr: string, tabId?: string): Promise<string[]>;
|
|
21
|
-
links(selector: string, tabId?: string): Promise<string[]>;
|
|
22
|
-
linksAll(tabId?: string): Promise<string[]>;
|
|
23
|
-
images(selector: string, tabId?: string): Promise<string[]>;
|
|
24
|
-
}
|
|
25
|
-
export declare function createWaitAPI(client: PiggyClient): WaitClient;
|
|
26
|
-
export declare function createEvaluateAPI(client: PiggyClient): EvaluateClient;
|
|
27
|
-
export declare function createFetchAPI(client: PiggyClient): FetchClient;
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../piggy/wait/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAK/E,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAGvC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,SAAQ,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvE,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,iBAA8B,EACrC,OAAO,SAAQ,EACf,KAAK,SAAY,GAChB,OAAO,CAAC,IAAI,CAAC;CAGjB;AAMD,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAGvC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE;AAMD,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAGvC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAKjE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK/D,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK/E,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK7E,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK7D,QAAQ,CAAC,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAK9C,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAG/D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAO,UAAU,CAAuC;AACzG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,CAAuC;AAC7G,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAM,WAAW,CAAuC"}
|
package/dist/piggy.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type SiteObject } from "./piggy/register";
|
|
2
|
-
declare const piggy: any;
|
|
3
|
-
type TypedPiggy<Sites extends string> = typeof piggy & {
|
|
4
|
-
[K in Sites]: SiteObject;
|
|
5
|
-
};
|
|
6
|
-
export declare function usePiggy<Sites extends string>(): TypedPiggy<Sites>;
|
|
7
|
-
export type { SiteObject };
|
|
8
|
-
export default piggy;
|
|
9
|
-
export { piggy };
|
|
10
|
-
//# sourceMappingURL=piggy.d.ts.map
|
package/dist/piggy.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"piggy.d.ts","sourceRoot":"","sources":["../piggy.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkD9F,QAAA,MAAM,KAAK,EAAE,GA+QZ,CAAC;AAIF,KAAK,UAAU,CAAC,KAAK,SAAS,MAAM,IAAI,OAAO,KAAK,GAAG;KACpD,CAAC,IAAI,KAAK,GAAG,UAAU;CACzB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,SAAS,MAAM,KAAK,UAAU,CAAC,KAAK,CAAC,CAElE;AAED,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|