@airtop/plugin-puppeteer 1.0.0-alpha2.0 → 1.0.0-alpha2.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/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Airtop Puppeteer Plugin
2
+
3
+ This plugin adds Puppeteer support to the Airtop SDK.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @airtop/sdk @airtop/plugin-puppeteer puppeteer
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { registerAirtopPlugin } from "@airtop/sdk";
15
+ import { puppeteerPlugin } from "@airtop/plugin-puppeteer";
16
+
17
+ registerAirtopPlugin(puppeteerPlugin);
18
+ ```
19
+
20
+ ## Docs
21
+
22
+ Visit the docs [here](https://docs-v2.airtop.ai/sdk/typescript/@airtop/plugin-puppeteer/interfaces/PuppeteerPluginMethods/).
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/theo/projects/monarch/sdk-v2/wrapper-sdks/typescript/packages/plugins/puppeteer/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA6C;AA4C7C,IAAM,OAAA,EAAoC;AAAA,EACxC,gBAAA,EAAkB,iCAAA,CAA6B,mBAAA;AAAA,EAC/C,OAAA,EAAS,CAAC,SAAA,EAAA,GAAoD;AAC5D,IAAA,SAAA,CAAU,0BAAA,EAA4B,MAAA,QAAA,CACpC,IAAA,EACA,OAAA,EACA,cAAA,EACA;AACA,MAAA,MAAM,QAAA,EAAW,IAAA,CAAK,SAAA,CAAU,CAAA,CAAU,GAAA;AAE1C,MAAA,GAAA,CAAI,CAAC,OAAA,EAAS;AACZ,QAAA,MAAM,IAAI,KAAA,CAAM,4CAA4C,CAAA;AAAA,MAC9D;AAEA,MAAA,OAAO,IAAA,CAAK,YAAA,CAAa,OAAO,CAAA,CAAE,aAAA,CAAc,OAAA,EAAS,cAAc,CAAA;AAAA,IACzE,CAAA;AAAA,EACF;AACF,CAAA;AAKO,SAAS,eAAA,CAAA,EAA4C;AAC1D,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,CAAC,MAAM;AAAA,EACvB,CAAA;AACF;ADnDA;AACE;AACF,0CAAC","file":"/Users/theo/projects/monarch/sdk-v2/wrapper-sdks/typescript/packages/plugins/puppeteer/dist/index.cjs","sourcesContent":[null,"import { AirtopPluginAugmentationType } from \"@airtop/sdk\";\nimport type { AirtopSessionClient, AirtopSessionClientPlugin } from \"@airtop/sdk\";\nimport type { AirtopRequestOptions } from \"@airtop/sdk\";\nimport type { AirtopWindow } from \"@airtop/sdk\";\nimport type { WindowGetConfig } from \"@airtop/sdk\";\nimport type { AirtopPluginRegistration } from \"@airtop/sdk\";\nimport type { AirtopWindowGetInfoResponse } from \"@airtop/sdk\";\nimport type { Page } from \"puppeteer\";\n\n// This is exported so the docs can expose it as we can't generate docs against the\n// module declaration\n/**\n * The methods provided by the Puppeteer plugin.\n */\nexport interface PuppeteerPluginMethods {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n}\n\ndeclare module \"@airtop/sdk\" {\n interface AirtopSessionClient {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n }\n}\n\nconst plugin: AirtopSessionClientPlugin = {\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient,\n augment: (prototype: typeof AirtopSessionClient.prototype) => {\n prototype.getWindowForPuppeteerPage = async function (\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ) {\n const frameId = (page.mainFrame() as any)._id;\n\n if (!frameId) {\n throw new Error(\"Could not get frame ID from Puppeteer page\");\n }\n\n return this.withWindowId(frameId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Puppeteer plugin.\n */\nexport function puppeteerPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/airtop-sdk/airtop-sdk/typescript/packages/plugins/puppeteer/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA6C;AAgD7C,IAAM,OAAA,EAAoC;AAAA,EACxC,gBAAA,EAAkB,iCAAA,CAA6B,mBAAA;AAAA,EAC/C,OAAA,EAAS,CAAC,SAAA,EAAA,GAAoD;AAC5D,IAAA,SAAA,CAAU,0BAAA,EAA4B,MAAA,QAAA,CACpC,IAAA,EACA,OAAA,EACA,cAAA,EACA;AACA,MAAA,MAAM,QAAA,EAAW,IAAA,CAAK,SAAA,CAAU,CAAA,CAAU,GAAA;AAE1C,MAAA,GAAA,CAAI,CAAC,OAAA,EAAS;AACZ,QAAA,MAAM,IAAI,KAAA,CAAM,4CAA4C,CAAA;AAAA,MAC9D;AAEA,MAAA,OAAO,IAAA,CAAK,YAAA,CAAa,OAAO,CAAA,CAAE,aAAA,CAAc,OAAA,EAAS,cAAc,CAAA;AAAA,IACzE,CAAA;AAAA,EACF;AACF,CAAA;AAKO,SAAS,eAAA,CAAA,EAA4C;AAC1D,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,CAAC,MAAM;AAAA,EACvB,CAAA;AACF;ADvDA;AACE;AACF,0CAAC","file":"/home/runner/work/airtop-sdk/airtop-sdk/typescript/packages/plugins/puppeteer/dist/index.cjs","sourcesContent":[null,"import { AirtopPluginAugmentationType } from \"@airtop/sdk\";\nimport type { AirtopSessionClient, AirtopSessionClientPlugin } from \"@airtop/sdk\";\nimport type { AirtopRequestOptions } from \"@airtop/sdk\";\nimport type { AirtopWindow } from \"@airtop/sdk\";\nimport type { WindowGetConfig } from \"@airtop/sdk\";\nimport type { AirtopPluginRegistration } from \"@airtop/sdk\";\nimport type { AirtopWindowGetInfoResponse } from \"@airtop/sdk\";\nimport type { Page } from \"puppeteer\";\n\n// This is exported so the docs can expose it as we can't generate docs against the\n// module declaration\n/**\n * The methods provided by the Puppeteer plugin.\n */\nexport interface PuppeteerPluginMethods {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n *\n * @example\n * // AirtopSessionClient instance\n * sessionClient.getWindowForPuppeteerPage(page, options, requestOptions);\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n}\n\ndeclare module \"@airtop/sdk\" {\n interface AirtopSessionClient {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n }\n}\n\nconst plugin: AirtopSessionClientPlugin = {\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient,\n augment: (prototype: typeof AirtopSessionClient.prototype) => {\n prototype.getWindowForPuppeteerPage = async function (\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ) {\n const frameId = (page.mainFrame() as any)._id;\n\n if (!frameId) {\n throw new Error(\"Could not get frame ID from Puppeteer page\");\n }\n\n return this.withWindowId(frameId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Puppeteer plugin.\n */\nexport function puppeteerPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -10,6 +10,10 @@ interface PuppeteerPluginMethods {
10
10
  * @param page The Puppeteer Page instance to get window information for.
11
11
  * @param options Configuration options for the window info request.
12
12
  * @param requestOptions Additional options to customize the request behavior.
13
+ *
14
+ * @example
15
+ * // AirtopSessionClient instance
16
+ * sessionClient.getWindowForPuppeteerPage(page, options, requestOptions);
13
17
  */
14
18
  getWindowForPuppeteerPage(page: Page, options?: WindowGetConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;
15
19
  }
package/dist/index.d.ts CHANGED
@@ -10,6 +10,10 @@ interface PuppeteerPluginMethods {
10
10
  * @param page The Puppeteer Page instance to get window information for.
11
11
  * @param options Configuration options for the window info request.
12
12
  * @param requestOptions Additional options to customize the request behavior.
13
+ *
14
+ * @example
15
+ * // AirtopSessionClient instance
16
+ * sessionClient.getWindowForPuppeteerPage(page, options, requestOptions);
13
17
  */
14
18
  getWindowForPuppeteerPage(page: Page, options?: WindowGetConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;
15
19
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { AirtopPluginAugmentationType } from \"@airtop/sdk\";\nimport type { AirtopSessionClient, AirtopSessionClientPlugin } from \"@airtop/sdk\";\nimport type { AirtopRequestOptions } from \"@airtop/sdk\";\nimport type { AirtopWindow } from \"@airtop/sdk\";\nimport type { WindowGetConfig } from \"@airtop/sdk\";\nimport type { AirtopPluginRegistration } from \"@airtop/sdk\";\nimport type { AirtopWindowGetInfoResponse } from \"@airtop/sdk\";\nimport type { Page } from \"puppeteer\";\n\n// This is exported so the docs can expose it as we can't generate docs against the\n// module declaration\n/**\n * The methods provided by the Puppeteer plugin.\n */\nexport interface PuppeteerPluginMethods {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n}\n\ndeclare module \"@airtop/sdk\" {\n interface AirtopSessionClient {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n }\n}\n\nconst plugin: AirtopSessionClientPlugin = {\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient,\n augment: (prototype: typeof AirtopSessionClient.prototype) => {\n prototype.getWindowForPuppeteerPage = async function (\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ) {\n const frameId = (page.mainFrame() as any)._id;\n\n if (!frameId) {\n throw new Error(\"Could not get frame ID from Puppeteer page\");\n }\n\n return this.withWindowId(frameId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Puppeteer plugin.\n */\nexport function puppeteerPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"],"mappings":";AAAA,SAAS,oCAAoC;AA4C7C,IAAM,SAAoC;AAAA,EACxC,kBAAkB,6BAA6B;AAAA,EAC/C,SAAS,CAAC,cAAoD;AAC5D,cAAU,4BAA4B,eACpC,MACA,SACA,gBACA;AACA,YAAM,UAAW,KAAK,UAAU,EAAU;AAE1C,UAAI,CAAC,SAAS;AACZ,cAAM,IAAI,MAAM,4CAA4C;AAAA,MAC9D;AAEA,aAAO,KAAK,aAAa,OAAO,EAAE,cAAc,SAAS,cAAc;AAAA,IACzE;AAAA,EACF;AACF;AAKO,SAAS,kBAA4C;AAC1D,SAAO;AAAA,IACL,cAAc,CAAC,MAAM;AAAA,EACvB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { AirtopPluginAugmentationType } from \"@airtop/sdk\";\nimport type { AirtopSessionClient, AirtopSessionClientPlugin } from \"@airtop/sdk\";\nimport type { AirtopRequestOptions } from \"@airtop/sdk\";\nimport type { AirtopWindow } from \"@airtop/sdk\";\nimport type { WindowGetConfig } from \"@airtop/sdk\";\nimport type { AirtopPluginRegistration } from \"@airtop/sdk\";\nimport type { AirtopWindowGetInfoResponse } from \"@airtop/sdk\";\nimport type { Page } from \"puppeteer\";\n\n// This is exported so the docs can expose it as we can't generate docs against the\n// module declaration\n/**\n * The methods provided by the Puppeteer plugin.\n */\nexport interface PuppeteerPluginMethods {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n *\n * @example\n * // AirtopSessionClient instance\n * sessionClient.getWindowForPuppeteerPage(page, options, requestOptions);\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n}\n\ndeclare module \"@airtop/sdk\" {\n interface AirtopSessionClient {\n /**\n * Get the window information for a Puppeteer Page instance.\n * @param page The Puppeteer Page instance to get window information for.\n * @param options Configuration options for the window info request.\n * @param requestOptions Additional options to customize the request behavior.\n */\n getWindowForPuppeteerPage(\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;\n }\n}\n\nconst plugin: AirtopSessionClientPlugin = {\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient,\n augment: (prototype: typeof AirtopSessionClient.prototype) => {\n prototype.getWindowForPuppeteerPage = async function (\n page: Page,\n options?: WindowGetConfig,\n requestOptions?: AirtopRequestOptions,\n ) {\n const frameId = (page.mainFrame() as any)._id;\n\n if (!frameId) {\n throw new Error(\"Could not get frame ID from Puppeteer page\");\n }\n\n return this.withWindowId(frameId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Puppeteer plugin.\n */\nexport function puppeteerPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"],"mappings":";AAAA,SAAS,oCAAoC;AAgD7C,IAAM,SAAoC;AAAA,EACxC,kBAAkB,6BAA6B;AAAA,EAC/C,SAAS,CAAC,cAAoD;AAC5D,cAAU,4BAA4B,eACpC,MACA,SACA,gBACA;AACA,YAAM,UAAW,KAAK,UAAU,EAAU;AAE1C,UAAI,CAAC,SAAS;AACZ,cAAM,IAAI,MAAM,4CAA4C;AAAA,MAC9D;AAEA,aAAO,KAAK,aAAa,OAAO,EAAE,cAAc,SAAS,cAAc;AAAA,IACzE;AAAA,EACF;AACF;AAKO,SAAS,kBAA4C;AAC1D,SAAO;AAAA,IACL,cAAc,CAAC,MAAM;AAAA,EACvB;AACF;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airtop/plugin-puppeteer",
3
3
  "description": "Adds puppeteer support to the Airtop SDK",
4
- "version": "1.0.0-alpha2.0",
4
+ "version": "1.0.0-alpha2.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -24,25 +24,17 @@
24
24
  "puppeteer",
25
25
  "plugin"
26
26
  ],
27
- "scripts": {
28
- "build": "tsup src/index.ts",
29
- "test": "vitest --run",
30
- "build:dev": "node_modules/.bin/hash-runner",
31
- "clean": "rm -rf .turbo node_modules dist",
32
- "lint": "biome check --write --unsafe src && biome format src --write && biome lint src --fix",
33
- "verify-types": "tsc --noEmit"
34
- },
35
27
  "devDependencies": {
36
28
  "@biomejs/biome": "1.9.4",
37
- "@internal/tsconfig": "workspace:*",
38
29
  "hash-runner": "2.0.1",
39
30
  "tsup": "8.4.0",
40
31
  "typescript": "5.8.2",
41
- "vitest": "3.1.1"
32
+ "vitest": "3.1.1",
33
+ "@internal/tsconfig": "3.0.0-alpha2.1"
42
34
  },
43
35
  "peerDependencies": {
44
- "@airtop/sdk": "workspace:*",
45
- "puppeteer": ">=22.14.0"
36
+ "puppeteer": ">=22.14.0",
37
+ "@airtop/sdk": "1.0.0-alpha2.1"
46
38
  },
47
39
  "bugs": "https://github.com/airtop-ai/airtop-sdk/issues",
48
40
  "engines": {
@@ -52,5 +44,12 @@
52
44
  "dist"
53
45
  ],
54
46
  "homepage": "https://airtop.ai",
55
- "packageManager": "pnpm@10.5.0"
56
- }
47
+ "scripts": {
48
+ "build": "tsup src/index.ts",
49
+ "test": "vitest --run",
50
+ "build:dev": "node_modules/.bin/hash-runner",
51
+ "clean": "rm -rf .turbo node_modules dist",
52
+ "lint": "biome check --write --unsafe src && biome format src --write && biome lint src --fix",
53
+ "verify-types": "tsc --noEmit"
54
+ }
55
+ }