@airtop/plugin-playwright 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 Playwright Plugin
2
+
3
+ This plugin adds Playwright support to the Airtop SDK.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @airtop/sdk @airtop/plugin-playwright playwright
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { registerAirtopPlugin } from "@airtop/sdk";
15
+ import { playwrightPlugin } from "@airtop/plugin-playwright";
16
+
17
+ registerAirtopPlugin(playwrightPlugin);
18
+ ```
19
+
20
+ ## Docs
21
+
22
+ Visit the docs [here](https://docs-v2.airtop.ai/sdk/typescript/@airtop/plugin-playwright/interfaces/PlaywrightPluginMethods/).
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/theo/projects/monarch/sdk-v2/wrapper-sdks/typescript/packages/plugins/playwright/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,+BAAA,EAAiC,MAAA,QAAA,CACzC,IAAA,EACA,OAAA,EACA,cAAA,EACA;AACA,MAAA,MAAM,WAAA,EAAa,MAAM,IAAA,CAAK,OAAA,CAAQ,CAAA,CAAE,aAAA,CAAc,IAAI,CAAA;AAC1D,MAAA,MAAM,EAAE,WAAW,EAAA,EAAI,MAAM,UAAA,CAAW,IAAA,CAAK,sBAAsB,CAAA;AACnE,MAAA,MAAM,SAAA,EAAW,UAAA,CAAW,QAAA;AAC5B,MAAA,GAAA,CAAI,CAAC,QAAA,EAAU;AACb,QAAA,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA;AAAA,MACtC;AAEA,MAAA,OAAO,MAAM,IAAA,CAAK,YAAA,CAAa,QAAQ,CAAA,CAAE,aAAA,CAAc,OAAA,EAAS,cAAc,CAAA;AAAA,IAChF,CAAA;AAAA,EACF;AACF,CAAA;AAKO,SAAS,gBAAA,CAAA,EAA6C;AAC3D,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,CAAC,MAAM;AAAA,EACvB,CAAA;AACF;ADlDA;AACE;AACF,4CAAC","file":"/Users/theo/projects/monarch/sdk-v2/wrapper-sdks/typescript/packages/plugins/playwright/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 \"playwright\";\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 Playwright plugin.\n */\nexport interface PlaywrightPluginMethods {\n /**\n * Get the window information for a Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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 Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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.getWindowInfoForPlaywrightPage = async function (\n page: Page,\n options: WindowGetConfig,\n requestOptions: AirtopRequestOptions,\n ) {\n const cdpSession = await page.context().newCDPSession(page);\n const { targetInfo } = await cdpSession.send(\"Target.getTargetInfo\");\n const targetId = targetInfo.targetId;\n if (!targetId) {\n throw new Error(\"TargetId not found\");\n }\n\n return await this.withWindowId(targetId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Playwright plugin.\n */\nexport function playwrightPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/airtop-sdk/airtop-sdk/typescript/packages/plugins/playwright/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,+BAAA,EAAiC,MAAA,QAAA,CACzC,IAAA,EACA,OAAA,EACA,cAAA,EACA;AACA,MAAA,MAAM,WAAA,EAAa,MAAM,IAAA,CAAK,OAAA,CAAQ,CAAA,CAAE,aAAA,CAAc,IAAI,CAAA;AAC1D,MAAA,MAAM,EAAE,WAAW,EAAA,EAAI,MAAM,UAAA,CAAW,IAAA,CAAK,sBAAsB,CAAA;AACnE,MAAA,MAAM,SAAA,EAAW,UAAA,CAAW,QAAA;AAC5B,MAAA,GAAA,CAAI,CAAC,QAAA,EAAU;AACb,QAAA,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA;AAAA,MACtC;AAEA,MAAA,OAAO,MAAM,IAAA,CAAK,YAAA,CAAa,QAAQ,CAAA,CAAE,aAAA,CAAc,OAAA,EAAS,cAAc,CAAA;AAAA,IAChF,CAAA;AAAA,EACF;AACF,CAAA;AAKO,SAAS,gBAAA,CAAA,EAA6C;AAC3D,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,CAAC,MAAM;AAAA,EACvB,CAAA;AACF;ADtDA;AACE;AACF,4CAAC","file":"/home/runner/work/airtop-sdk/airtop-sdk/typescript/packages/plugins/playwright/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 \"playwright\";\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 Playwright plugin.\n */\nexport interface PlaywrightPluginMethods {\n /**\n * Get the window information for a Playwright Page instance.\n * @param page The Playwright 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.getWindowForPlaywrightPage(page, options, requestOptions);\n */\n getWindowInfoForPlaywrightPage(\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 Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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.getWindowInfoForPlaywrightPage = async function (\n page: Page,\n options: WindowGetConfig,\n requestOptions: AirtopRequestOptions,\n ) {\n const cdpSession = await page.context().newCDPSession(page);\n const { targetInfo } = await cdpSession.send(\"Target.getTargetInfo\");\n const targetId = targetInfo.targetId;\n if (!targetId) {\n throw new Error(\"TargetId not found\");\n }\n\n return await this.withWindowId(targetId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Playwright plugin.\n */\nexport function playwrightPlugin(): AirtopPluginRegistration {\n return {\n pluginsToAdd: [plugin],\n };\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -10,6 +10,10 @@ interface PlaywrightPluginMethods {
10
10
  * @param page The Playwright 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.getWindowForPlaywrightPage(page, options, requestOptions);
13
17
  */
14
18
  getWindowInfoForPlaywrightPage(page: Page, options?: WindowGetConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopWindow<AirtopWindowGetInfoResponse>>;
15
19
  }
package/dist/index.d.ts CHANGED
@@ -10,6 +10,10 @@ interface PlaywrightPluginMethods {
10
10
  * @param page The Playwright 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.getWindowForPlaywrightPage(page, options, requestOptions);
13
17
  */
14
18
  getWindowInfoForPlaywrightPage(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 \"playwright\";\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 Playwright plugin.\n */\nexport interface PlaywrightPluginMethods {\n /**\n * Get the window information for a Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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 Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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.getWindowInfoForPlaywrightPage = async function (\n page: Page,\n options: WindowGetConfig,\n requestOptions: AirtopRequestOptions,\n ) {\n const cdpSession = await page.context().newCDPSession(page);\n const { targetInfo } = await cdpSession.send(\"Target.getTargetInfo\");\n const targetId = targetInfo.targetId;\n if (!targetId) {\n throw new Error(\"TargetId not found\");\n }\n\n return await this.withWindowId(targetId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Playwright plugin.\n */\nexport function playwrightPlugin(): 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,iCAAiC,eACzC,MACA,SACA,gBACA;AACA,YAAM,aAAa,MAAM,KAAK,QAAQ,EAAE,cAAc,IAAI;AAC1D,YAAM,EAAE,WAAW,IAAI,MAAM,WAAW,KAAK,sBAAsB;AACnE,YAAM,WAAW,WAAW;AAC5B,UAAI,CAAC,UAAU;AACb,cAAM,IAAI,MAAM,oBAAoB;AAAA,MACtC;AAEA,aAAO,MAAM,KAAK,aAAa,QAAQ,EAAE,cAAc,SAAS,cAAc;AAAA,IAChF;AAAA,EACF;AACF;AAKO,SAAS,mBAA6C;AAC3D,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 \"playwright\";\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 Playwright plugin.\n */\nexport interface PlaywrightPluginMethods {\n /**\n * Get the window information for a Playwright Page instance.\n * @param page The Playwright 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.getWindowForPlaywrightPage(page, options, requestOptions);\n */\n getWindowInfoForPlaywrightPage(\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 Playwright Page instance.\n * @param page The Playwright 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 getWindowInfoForPlaywrightPage(\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.getWindowInfoForPlaywrightPage = async function (\n page: Page,\n options: WindowGetConfig,\n requestOptions: AirtopRequestOptions,\n ) {\n const cdpSession = await page.context().newCDPSession(page);\n const { targetInfo } = await cdpSession.send(\"Target.getTargetInfo\");\n const targetId = targetInfo.targetId;\n if (!targetId) {\n throw new Error(\"TargetId not found\");\n }\n\n return await this.withWindowId(targetId).getWindowInfo(options, requestOptions);\n };\n },\n};\n\n/**\n * Use with registerAirtopPlugin() from the Airtop SDK to add the Playwright plugin.\n */\nexport function playwrightPlugin(): 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,iCAAiC,eACzC,MACA,SACA,gBACA;AACA,YAAM,aAAa,MAAM,KAAK,QAAQ,EAAE,cAAc,IAAI;AAC1D,YAAM,EAAE,WAAW,IAAI,MAAM,WAAW,KAAK,sBAAsB;AACnE,YAAM,WAAW,WAAW;AAC5B,UAAI,CAAC,UAAU;AACb,cAAM,IAAI,MAAM,oBAAoB;AAAA,MACtC;AAEA,aAAO,MAAM,KAAK,aAAa,QAAQ,EAAE,cAAc,SAAS,cAAc;AAAA,IAChF;AAAA,EACF;AACF;AAKO,SAAS,mBAA6C;AAC3D,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-playwright",
3
3
  "description": "Adds Playwright 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
  "playwright",
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
- "playwright": ">=1.51.1"
36
+ "playwright": ">=1.51.1",
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
+ }