@airtop/sdk 0.1.18 → 0.1.26

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.
Files changed (150) hide show
  1. package/api/resources/profiles/client/Client.js +2 -2
  2. package/api/resources/sessions/client/Client.js +14 -14
  3. package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  4. package/api/resources/sessions/types/index.d.ts +1 -1
  5. package/api/resources/sessions/types/index.js +1 -1
  6. package/api/resources/windows/client/Client.js +26 -26
  7. package/api/types/AirtopProxyConfiguration.d.ts +9 -0
  8. package/api/types/ExternalSessionWithConnectionInfo.d.ts +1 -1
  9. package/api/types/PageQueryConfig.d.ts +2 -0
  10. package/api/types/PaginatedExtractionConfig.d.ts +3 -0
  11. package/api/types/Proxy.d.ts +9 -6
  12. package/api/types/ProxyConfigurationKind.d.ts +9 -0
  13. package/api/types/ProxyCredentials.d.ts +11 -0
  14. package/api/types/ScrapeConfig.d.ts +7 -0
  15. package/api/types/SessionConfigV1.d.ts +1 -1
  16. package/api/types/SessionConfigV1Proxy.d.ts +4 -4
  17. package/api/types/VisualAnalysisConfig.d.ts +1 -1
  18. package/api/types/VisualAnalysisConfigResultSelectionStrategy.d.ts +3 -2
  19. package/api/types/VisualAnalysisConfigResultSelectionStrategy.js +1 -0
  20. package/api/types/Window.d.ts +2 -0
  21. package/api/types/index.d.ts +4 -2
  22. package/api/types/index.js +4 -2
  23. package/biome.json +66 -0
  24. package/config/tsconfig-nobase.json +16 -0
  25. package/dist/api/resources/profiles/client/Client.js +2 -2
  26. package/dist/api/resources/sessions/client/Client.js +14 -14
  27. package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  28. package/dist/api/resources/sessions/types/index.d.ts +1 -1
  29. package/dist/api/resources/sessions/types/index.js +1 -1
  30. package/dist/api/resources/windows/client/Client.js +26 -26
  31. package/dist/api/types/AirtopProxyConfiguration.d.ts +9 -0
  32. package/dist/api/types/AirtopProxyConfiguration.js +5 -0
  33. package/dist/api/types/ExternalSessionWithConnectionInfo.d.ts +1 -1
  34. package/dist/api/types/PageQueryConfig.d.ts +2 -0
  35. package/dist/api/types/PaginatedExtractionConfig.d.ts +3 -0
  36. package/dist/api/types/Proxy.d.ts +9 -6
  37. package/dist/api/types/ProxyConfigurationKind.d.ts +9 -0
  38. package/dist/api/types/ProxyConfigurationKind.js +5 -0
  39. package/dist/api/types/ProxyCredentials.d.ts +11 -0
  40. package/dist/api/types/ProxyCredentials.js +5 -0
  41. package/dist/api/types/ScrapeConfig.d.ts +7 -0
  42. package/dist/api/types/ScrapeConfig.js +5 -0
  43. package/dist/api/types/SessionConfigV1.d.ts +1 -1
  44. package/dist/api/types/SessionConfigV1Proxy.d.ts +4 -4
  45. package/dist/api/types/VisualAnalysisConfig.d.ts +1 -1
  46. package/dist/api/types/VisualAnalysisConfigResultSelectionStrategy.d.ts +3 -2
  47. package/dist/api/types/VisualAnalysisConfigResultSelectionStrategy.js +1 -0
  48. package/dist/api/types/Window.d.ts +2 -0
  49. package/dist/api/types/index.d.ts +4 -2
  50. package/dist/api/types/index.js +4 -2
  51. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  52. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  53. package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
  54. package/dist/serialization/resources/sessions/types/index.js +1 -1
  55. package/dist/serialization/types/AirtopProxyConfiguration.d.ts +13 -0
  56. package/dist/serialization/types/{SessionConfigV1ProxyItem.js → AirtopProxyConfiguration.js} +4 -5
  57. package/dist/serialization/types/PageQueryConfig.d.ts +2 -0
  58. package/dist/serialization/types/PageQueryConfig.js +2 -0
  59. package/dist/serialization/types/PaginatedExtractionConfig.d.ts +2 -0
  60. package/dist/serialization/types/PaginatedExtractionConfig.js +2 -0
  61. package/dist/serialization/types/Proxy.d.ts +4 -6
  62. package/dist/serialization/types/Proxy.js +3 -5
  63. package/dist/serialization/types/ProxyConfigurationKind.d.ts +14 -0
  64. package/dist/serialization/types/{CustomProxy.js → ProxyConfigurationKind.js} +5 -2
  65. package/dist/serialization/types/ProxyCredentials.d.ts +14 -0
  66. package/{serialization/types/SessionConfigV1ProxyItem.js → dist/serialization/types/ProxyCredentials.js} +5 -5
  67. package/dist/serialization/types/ScrapeConfig.d.ts +12 -0
  68. package/dist/serialization/types/ScrapeConfig.js +33 -0
  69. package/dist/serialization/types/SessionConfigV1Proxy.d.ts +3 -3
  70. package/dist/serialization/types/SessionConfigV1Proxy.js +4 -4
  71. package/dist/serialization/types/VisualAnalysisConfigResultSelectionStrategy.d.ts +1 -1
  72. package/dist/serialization/types/VisualAnalysisConfigResultSelectionStrategy.js +1 -1
  73. package/dist/serialization/types/Window.d.ts +1 -0
  74. package/dist/serialization/types/Window.js +1 -0
  75. package/dist/serialization/types/index.d.ts +4 -2
  76. package/dist/serialization/types/index.js +4 -2
  77. package/dist/utils/batch-operate/SessionQueue.d.ts +4 -4
  78. package/dist/utils/batch-operate/SessionQueue.js +11 -12
  79. package/dist/utils/batch-operate/WindowQueue.d.ts +3 -3
  80. package/dist/utils/batch-operate/WindowQueue.js +23 -11
  81. package/dist/utils/batch-operate/batch-util.d.ts +2 -2
  82. package/dist/utils/batch-operate/batch-util.js +5 -5
  83. package/dist/utils/batch-operate/helpers.d.ts +1 -1
  84. package/dist/utils/batch-operate/types.d.ts +1 -1
  85. package/dist/utils/index.d.ts +3 -3
  86. package/dist/utils/process-screenshots.d.ts +1 -1
  87. package/dist/utils/process-screenshots.js +4 -4
  88. package/dist/wrapper/AirtopClient.d.ts +1 -1
  89. package/dist/wrapper/AirtopClient.js +3 -3
  90. package/dist/wrapper/AirtopSessions.d.ts +2 -2
  91. package/dist/wrapper/AirtopSessions.js +4 -4
  92. package/dist/wrapper/AirtopWindows.d.ts +9 -9
  93. package/dist/wrapper/AirtopWindows.js +11 -11
  94. package/lefthook.yml +23 -0
  95. package/package.json +9 -3
  96. package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  97. package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  98. package/serialization/resources/sessions/types/index.d.ts +1 -1
  99. package/serialization/resources/sessions/types/index.js +1 -1
  100. package/serialization/types/AirtopProxyConfiguration.d.ts +13 -0
  101. package/serialization/types/AirtopProxyConfiguration.js +34 -0
  102. package/serialization/types/PageQueryConfig.d.ts +2 -0
  103. package/serialization/types/PageQueryConfig.js +2 -0
  104. package/serialization/types/PaginatedExtractionConfig.d.ts +2 -0
  105. package/serialization/types/PaginatedExtractionConfig.js +2 -0
  106. package/serialization/types/Proxy.d.ts +4 -6
  107. package/serialization/types/Proxy.js +3 -5
  108. package/serialization/types/ProxyConfigurationKind.d.ts +14 -0
  109. package/serialization/types/{CustomProxy.js → ProxyConfigurationKind.js} +5 -2
  110. package/serialization/types/ProxyCredentials.d.ts +14 -0
  111. package/serialization/types/ProxyCredentials.js +35 -0
  112. package/serialization/types/ScrapeConfig.d.ts +12 -0
  113. package/serialization/types/ScrapeConfig.js +33 -0
  114. package/serialization/types/SessionConfigV1Proxy.d.ts +3 -3
  115. package/serialization/types/SessionConfigV1Proxy.js +4 -4
  116. package/serialization/types/VisualAnalysisConfigResultSelectionStrategy.d.ts +1 -1
  117. package/serialization/types/VisualAnalysisConfigResultSelectionStrategy.js +1 -1
  118. package/serialization/types/Window.d.ts +1 -0
  119. package/serialization/types/Window.js +1 -0
  120. package/serialization/types/index.d.ts +4 -2
  121. package/serialization/types/index.js +4 -2
  122. package/utils/batch-operate/SessionQueue.d.ts +4 -4
  123. package/utils/batch-operate/SessionQueue.js +11 -12
  124. package/utils/batch-operate/WindowQueue.d.ts +3 -3
  125. package/utils/batch-operate/WindowQueue.js +23 -11
  126. package/utils/batch-operate/batch-util.d.ts +2 -2
  127. package/utils/batch-operate/batch-util.js +5 -5
  128. package/utils/batch-operate/helpers.d.ts +1 -1
  129. package/utils/batch-operate/types.d.ts +1 -1
  130. package/utils/index.d.ts +3 -3
  131. package/utils/process-screenshots.d.ts +1 -1
  132. package/utils/process-screenshots.js +4 -4
  133. package/wrapper/AirtopClient.d.ts +1 -1
  134. package/wrapper/AirtopClient.js +3 -3
  135. package/wrapper/AirtopSessions.d.ts +2 -2
  136. package/wrapper/AirtopSessions.js +4 -4
  137. package/wrapper/AirtopWindows.d.ts +9 -9
  138. package/wrapper/AirtopWindows.js +11 -11
  139. package/api/types/CustomProxy.d.ts +0 -14
  140. package/api/types/SessionConfigV1ProxyItem.d.ts +0 -12
  141. package/dist/api/types/CustomProxy.d.ts +0 -14
  142. package/dist/api/types/SessionConfigV1ProxyItem.d.ts +0 -12
  143. package/dist/serialization/types/CustomProxy.d.ts +0 -11
  144. package/dist/serialization/types/SessionConfigV1ProxyItem.d.ts +0 -14
  145. package/serialization/types/CustomProxy.d.ts +0 -11
  146. package/serialization/types/SessionConfigV1ProxyItem.d.ts +0 -14
  147. /package/api/types/{CustomProxy.js → AirtopProxyConfiguration.js} +0 -0
  148. /package/api/types/{SessionConfigV1ProxyItem.js → ProxyConfigurationKind.js} +0 -0
  149. /package/{dist/api/types/CustomProxy.js → api/types/ProxyCredentials.js} +0 -0
  150. /package/{dist/api/types/SessionConfigV1ProxyItem.js → api/types/ScrapeConfig.js} +0 -0
@@ -44,17 +44,17 @@ class AirtopSessions extends Client_1.Sessions {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  const createSessionResponse = yield _super.create.call(this, request, requestOptions);
46
46
  if (!createSessionResponse.data) {
47
- throw new Error(`Error creating browser session`);
47
+ throw new Error('Error creating browser session');
48
48
  }
49
49
  if ((_a = request === null || request === void 0 ? void 0 : request.configuration) === null || _a === void 0 ? void 0 : _a.skipWaitSessionReady) {
50
50
  return createSessionResponse;
51
51
  }
52
- this.log('session created:\n' + JSON.stringify(createSessionResponse, null, 2));
52
+ this.log(`session created:\n${JSON.stringify(createSessionResponse, null, 2)}`);
53
53
  try {
54
54
  const event = yield this.waitForSessionReady(createSessionResponse.data.id, requestOptions);
55
55
  if (!event) {
56
56
  this.log('No browser created, timed out?');
57
- throw new Error(`Waiting for session ready timed out`);
57
+ throw new Error('Waiting for session ready timed out');
58
58
  }
59
59
  const getInfoResponse = yield this.getInfo(createSessionResponse.data.id, requestOptions);
60
60
  // Merge the createSessionResponse with any new data from getInfoResponse
@@ -73,7 +73,7 @@ class AirtopSessions extends Client_1.Sessions {
73
73
  try {
74
74
  for (var sessionEvents_1 = __asyncValues(sessionEvents), sessionEvents_1_1; sessionEvents_1_1 = yield sessionEvents_1.next(), !sessionEvents_1_1.done;) {
75
75
  const event = sessionEvents_1_1.value;
76
- this.log('status message received:\n' + JSON.stringify(event, null, 2));
76
+ this.log(`status message received:\n${JSON.stringify(event, null, 2)}`);
77
77
  const e = event;
78
78
  if (e.event === 'status' && e.status === 'running') {
79
79
  return event;
@@ -14,9 +14,9 @@ declare namespace seleniumWebdriver {
14
14
  createCDPConnection(domain: string): Promise<any>;
15
15
  }
16
16
  }
17
- import * as Airtop from "../api";
18
- import { Windows as WindowsClass, Windows as WindowsNamespace } from "../api/resources/windows/client/Client";
19
- import * as core from "../core";
17
+ import type * as Airtop from '../api';
18
+ import { Windows as WindowsClass, type Windows as WindowsNamespace } from '../api/resources/windows/client/Client';
19
+ import * as core from '../core';
20
20
  export declare class AirtopWindows extends WindowsClass {
21
21
  readonly _options: WindowsNamespace.Options;
22
22
  private apiKeySupplier;
@@ -33,8 +33,8 @@ export declare class AirtopWindows extends WindowsClass {
33
33
  * prompt: "What is the main idea of this page?"
34
34
  * })
35
35
  */
36
- promptContent(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, "configuration"> & {
37
- configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody["configuration"], "outputSchema"> & {
36
+ promptContent(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, 'configuration'> & {
37
+ configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody['configuration'], 'outputSchema'> & {
38
38
  outputSchema?: string | object;
39
39
  };
40
40
  }, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
@@ -49,8 +49,8 @@ export declare class AirtopWindows extends WindowsClass {
49
49
  * prompt: "What is the main idea of this page?"
50
50
  * })
51
51
  */
52
- pageQuery(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, "configuration"> & {
53
- configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody["configuration"], "outputSchema"> & {
52
+ pageQuery(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, 'configuration'> & {
53
+ configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody['configuration'], 'outputSchema'> & {
54
54
  outputSchema?: string | object;
55
55
  };
56
56
  }, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
@@ -73,8 +73,8 @@ export declare class AirtopWindows extends WindowsClass {
73
73
  * @example
74
74
  * await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
75
75
  */
76
- summarizeContent(sessionId: string, windowId: string, request?: Omit<Airtop.SessionSummaryHandlerRequestBody, "configuration"> & {
77
- configuration?: Omit<Airtop.SessionSummaryHandlerRequestBody["configuration"], "outputSchema"> & {
76
+ summarizeContent(sessionId: string, windowId: string, request?: Omit<Airtop.SessionSummaryHandlerRequestBody, 'configuration'> & {
77
+ configuration?: Omit<Airtop.SessionSummaryHandlerRequestBody['configuration'], 'outputSchema'> & {
78
78
  outputSchema?: string | object;
79
79
  };
80
80
  }, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
@@ -63,7 +63,7 @@ class AirtopWindows extends Client_1.Windows {
63
63
  });
64
64
  var _a, _b;
65
65
  return __awaiter(this, void 0, void 0, function* () {
66
- return _super.promptContent.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
66
+ return _super.promptContent.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === 'object'
67
67
  ? JSON.stringify(request.configuration.outputSchema)
68
68
  : (_b = request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
69
69
  });
@@ -85,7 +85,7 @@ class AirtopWindows extends Client_1.Windows {
85
85
  });
86
86
  var _a, _b;
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
- return _super.pageQuery.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
88
+ return _super.pageQuery.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === 'object'
89
89
  ? JSON.stringify(request.configuration.outputSchema)
90
90
  : (_b = request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
91
91
  });
@@ -113,7 +113,7 @@ class AirtopWindows extends Client_1.Windows {
113
113
  */
114
114
  summarizeContent(sessionId, windowId, request, requestOptions) {
115
115
  var _a, _b, _c;
116
- return super.summarizeContent(sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request === null || request === void 0 ? void 0 : request.configuration), { outputSchema: typeof ((_a = request === null || request === void 0 ? void 0 : request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
116
+ return super.summarizeContent(sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request === null || request === void 0 ? void 0 : request.configuration), { outputSchema: typeof ((_a = request === null || request === void 0 ? void 0 : request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === 'object'
117
117
  ? JSON.stringify((_b = request === null || request === void 0 ? void 0 : request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema)
118
118
  : (_c = request === null || request === void 0 ? void 0 : request.configuration) === null || _c === void 0 ? void 0 : _c.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
119
119
  }
@@ -127,10 +127,10 @@ class AirtopWindows extends Client_1.Windows {
127
127
  return __awaiter(this, void 0, void 0, function* () {
128
128
  // Retrieve target information
129
129
  const cdpSession = yield page.context().newCDPSession(page);
130
- const { targetInfo } = yield cdpSession.send("Target.getTargetInfo");
130
+ const { targetInfo } = yield cdpSession.send('Target.getTargetInfo');
131
131
  const targetId = targetInfo.targetId;
132
132
  if (!targetId) {
133
- throw new Error("TargetId not found");
133
+ throw new Error('TargetId not found');
134
134
  }
135
135
  return yield this.getWindowInfo(session.id, targetId, request, requestOptions);
136
136
  });
@@ -214,17 +214,17 @@ class AirtopWindows extends Client_1.Windows {
214
214
  // Get the current WebDriver session ID
215
215
  const webDriverSessionId = (yield driver.getSession()).getId();
216
216
  if (!webDriverSessionId) {
217
- throw new Error("No WebDriver session available");
217
+ throw new Error('No WebDriver session available');
218
218
  }
219
219
  const chromedriverSessionUrl = `${session.chromedriverUrl}/session/${webDriverSessionId}/chromium/send_command_and_get_result`;
220
220
  const response = yield (0, node_fetch_1.default)(chromedriverSessionUrl, {
221
- method: "POST",
221
+ method: 'POST',
222
222
  headers: {
223
- "Content-Type": "application/json",
223
+ 'Content-Type': 'application/json',
224
224
  Authorization: `Bearer ${apiKey}`,
225
225
  },
226
226
  body: JSON.stringify({
227
- cmd: "Target.getTargetInfo",
227
+ cmd: 'Target.getTargetInfo',
228
228
  params: {},
229
229
  }),
230
230
  });
@@ -235,10 +235,10 @@ class AirtopWindows extends Client_1.Windows {
235
235
  var _a, _b;
236
236
  return __awaiter(this, void 0, void 0, function* () {
237
237
  const apiKey = yield core.Supplier.get(this.apiKeySupplier);
238
- const result = yield this.executeSeleniumCDPCommand(driver, session, apiKey || "");
238
+ const result = yield this.executeSeleniumCDPCommand(driver, session, apiKey || '');
239
239
  const targetId = (_b = (_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.targetInfo) === null || _b === void 0 ? void 0 : _b.targetId;
240
240
  if (!targetId) {
241
- throw new Error("TargetId not found");
241
+ throw new Error('TargetId not found');
242
242
  }
243
243
  return yield this.getWindowInfo(session.id, targetId, request, requestOptions);
244
244
  });
package/lefthook.yml ADDED
@@ -0,0 +1,23 @@
1
+ pre-commit:
2
+ commands:
3
+ "lint and format files":
4
+ glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
5
+ run: yarn run biome:format {staged_files} && yarn run biome:lint {staged_files}
6
+ stage_fixed: true
7
+ tags:
8
+ - lint
9
+ - staged-lint
10
+ exclude:
11
+ - "*.gen.ts"
12
+ - "**/package-lock.json"
13
+ "[repo] verify types":
14
+ run: yarn compile-nobase
15
+ tags:
16
+ - verify-types
17
+ pre-push:
18
+ parallel: true
19
+ commands:
20
+ "[repo] verify types":
21
+ run: yarn compile-nobase
22
+ tags:
23
+ - verify-types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airtop/sdk",
3
- "version": "0.1.18",
3
+ "version": "0.1.26",
4
4
  "private": false,
5
5
  "repository": "https://github.com/airtop-ai/airtop-node-sdk",
6
6
  "main": "./index.js",
@@ -10,7 +10,11 @@
10
10
  "build": "tsc",
11
11
  "prepack": "cp -rv dist/. .",
12
12
  "test": "jest",
13
- "prepublish": "yarn build"
13
+ "prepublish": "yarn build",
14
+ "biome:lint": "biome lint --diagnostic-level=error --no-errors-on-unmatched src",
15
+ "biome:fix": "biome format --write && biome lint --write",
16
+ "biome:format": "biome format --no-errors-on-unmatched --files-ignore-unknown=true",
17
+ "compile-nobase": "tsc --project config/tsconfig-nobase.json"
14
18
  },
15
19
  "dependencies": {
16
20
  "url-join": "4.0.1",
@@ -34,7 +38,9 @@
34
38
  "@types/node": "17.0.33",
35
39
  "prettier": "2.7.1",
36
40
  "typescript": "4.6.4",
37
- "@types/selenium-webdriver": "4.1.26"
41
+ "@types/selenium-webdriver": "4.1.26",
42
+ "@biomejs/biome": "1.9.4",
43
+ "lefthook": "1.10.4"
38
44
  },
39
45
  "browser": {
40
46
  "fs": false,
@@ -4,16 +4,13 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Airtop from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
- import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
8
7
  import { SessionsEventsResponseError } from "./SessionsEventsResponseError";
9
8
  import { SessionsEventsResponseWindowEvent } from "./SessionsEventsResponseWindowEvent";
10
9
  import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
10
+ import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
11
11
  export declare const SessionsEventsResponse: core.serialization.Schema<serializers.SessionsEventsResponse.Raw, Airtop.SessionsEventsResponse>;
12
12
  export declare namespace SessionsEventsResponse {
13
- type Raw = SessionsEventsResponse.Status | SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent | SessionsEventsResponse.SessionEvent;
14
- interface Status extends SessionsEventsResponseStatus.Raw {
15
- event: "status";
16
- }
13
+ type Raw = SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent | SessionsEventsResponse.SessionEvent | SessionsEventsResponse.Status;
17
14
  interface Error extends SessionsEventsResponseError.Raw {
18
15
  event: "error";
19
16
  }
@@ -23,4 +20,7 @@ export declare namespace SessionsEventsResponse {
23
20
  interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
24
21
  event: "sessionEvent";
25
22
  }
23
+ interface Status extends SessionsEventsResponseStatus.Raw {
24
+ event: "status";
25
+ }
26
26
  }
@@ -28,16 +28,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.SessionsEventsResponse = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
- const SessionsEventsResponseStatus_1 = require("./SessionsEventsResponseStatus");
32
31
  const SessionsEventsResponseError_1 = require("./SessionsEventsResponseError");
33
32
  const SessionsEventsResponseWindowEvent_1 = require("./SessionsEventsResponseWindowEvent");
34
33
  const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
34
+ const SessionsEventsResponseStatus_1 = require("./SessionsEventsResponseStatus");
35
35
  exports.SessionsEventsResponse = core.serialization
36
36
  .union("event", {
37
- status: SessionsEventsResponseStatus_1.SessionsEventsResponseStatus,
38
37
  error: SessionsEventsResponseError_1.SessionsEventsResponseError,
39
38
  windowEvent: SessionsEventsResponseWindowEvent_1.SessionsEventsResponseWindowEvent,
40
39
  sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
40
+ status: SessionsEventsResponseStatus_1.SessionsEventsResponseStatus,
41
41
  })
42
42
  .transform({
43
43
  transform: (value) => value,
@@ -1,6 +1,6 @@
1
1
  export * from "./SessionsListRequestStatus";
2
- export * from "./SessionsEventsResponseStatus";
3
2
  export * from "./SessionsEventsResponseError";
4
3
  export * from "./SessionsEventsResponseWindowEvent";
5
4
  export * from "./SessionsEventsResponseSessionEvent";
5
+ export * from "./SessionsEventsResponseStatus";
6
6
  export * from "./SessionsEventsResponse";
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SessionsListRequestStatus"), exports);
18
- __exportStar(require("./SessionsEventsResponseStatus"), exports);
19
18
  __exportStar(require("./SessionsEventsResponseError"), exports);
20
19
  __exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
21
20
  __exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
21
+ __exportStar(require("./SessionsEventsResponseStatus"), exports);
22
22
  __exportStar(require("./SessionsEventsResponse"), exports);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Airtop from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const AirtopProxyConfiguration: core.serialization.ObjectSchema<serializers.AirtopProxyConfiguration.Raw, Airtop.AirtopProxyConfiguration>;
8
+ export declare namespace AirtopProxyConfiguration {
9
+ interface Raw {
10
+ country?: string | null;
11
+ sticky?: boolean | null;
12
+ }
13
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.AirtopProxyConfiguration = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.AirtopProxyConfiguration = core.serialization.object({
32
+ country: core.serialization.string().optional(),
33
+ sticky: core.serialization.boolean().optional(),
34
+ });
@@ -5,10 +5,12 @@ import * as serializers from "../index";
5
5
  import * as Airtop from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  import { PageQueryExperimentalConfig } from "./PageQueryExperimentalConfig";
8
+ import { ScrapeConfig } from "./ScrapeConfig";
8
9
  export declare const PageQueryConfig: core.serialization.ObjectSchema<serializers.PageQueryConfig.Raw, Airtop.PageQueryConfig>;
9
10
  export declare namespace PageQueryConfig {
10
11
  interface Raw {
11
12
  experimental?: PageQueryExperimentalConfig.Raw | null;
12
13
  outputSchema?: string | null;
14
+ scrape?: ScrapeConfig.Raw | null;
13
15
  }
14
16
  }
@@ -29,7 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.PageQueryConfig = void 0;
30
30
  const core = __importStar(require("../../core"));
31
31
  const PageQueryExperimentalConfig_1 = require("./PageQueryExperimentalConfig");
32
+ const ScrapeConfig_1 = require("./ScrapeConfig");
32
33
  exports.PageQueryConfig = core.serialization.object({
33
34
  experimental: PageQueryExperimentalConfig_1.PageQueryExperimentalConfig.optional(),
34
35
  outputSchema: core.serialization.string().optional(),
36
+ scrape: ScrapeConfig_1.ScrapeConfig.optional(),
35
37
  });
@@ -4,11 +4,13 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Airtop from "../../api/index";
6
6
  import * as core from "../../core";
7
+ import { ScrapeConfig } from "./ScrapeConfig";
7
8
  export declare const PaginatedExtractionConfig: core.serialization.ObjectSchema<serializers.PaginatedExtractionConfig.Raw, Airtop.PaginatedExtractionConfig>;
8
9
  export declare namespace PaginatedExtractionConfig {
9
10
  interface Raw {
10
11
  interactionMode?: string | null;
11
12
  outputSchema?: string | null;
12
13
  paginationMode?: string | null;
14
+ scrape?: ScrapeConfig.Raw | null;
13
15
  }
14
16
  }
@@ -28,8 +28,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.PaginatedExtractionConfig = void 0;
30
30
  const core = __importStar(require("../../core"));
31
+ const ScrapeConfig_1 = require("./ScrapeConfig");
31
32
  exports.PaginatedExtractionConfig = core.serialization.object({
32
33
  interactionMode: core.serialization.string().optional(),
33
34
  outputSchema: core.serialization.string().optional(),
34
35
  paginationMode: core.serialization.string().optional(),
36
+ scrape: ScrapeConfig_1.ScrapeConfig.optional(),
35
37
  });
@@ -4,11 +4,9 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Airtop from "../../api/index";
6
6
  import * as core from "../../core";
7
- export declare const Proxy: core.serialization.ObjectSchema<serializers.Proxy.Raw, Airtop.Proxy>;
7
+ import { AirtopProxyConfiguration } from "./AirtopProxyConfiguration";
8
+ import { ProxyCredentials } from "./ProxyCredentials";
9
+ export declare const Proxy: core.serialization.Schema<serializers.Proxy.Raw, Airtop.Proxy>;
8
10
  export declare namespace Proxy {
9
- interface Raw {
10
- password?: string | null;
11
- url: string;
12
- username?: string | null;
13
- }
11
+ type Raw = string | AirtopProxyConfiguration.Raw | ProxyCredentials.Raw;
14
12
  }
@@ -28,8 +28,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Proxy = void 0;
30
30
  const core = __importStar(require("../../core"));
31
- exports.Proxy = core.serialization.object({
32
- password: core.serialization.string().optional(),
33
- url: core.serialization.string(),
34
- username: core.serialization.string().optional(),
35
- });
31
+ const AirtopProxyConfiguration_1 = require("./AirtopProxyConfiguration");
32
+ const ProxyCredentials_1 = require("./ProxyCredentials");
33
+ exports.Proxy = core.serialization.undiscriminatedUnion([core.serialization.string(), AirtopProxyConfiguration_1.AirtopProxyConfiguration, ProxyCredentials_1.ProxyCredentials]);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Airtop from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { Proxy } from "./Proxy";
8
+ export declare const ProxyConfigurationKind: core.serialization.ObjectSchema<serializers.ProxyConfigurationKind.Raw, Airtop.ProxyConfigurationKind>;
9
+ export declare namespace ProxyConfigurationKind {
10
+ interface Raw {
11
+ domainPattern: string;
12
+ relay: Proxy.Raw;
13
+ }
14
+ }
@@ -26,7 +26,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CustomProxy = void 0;
29
+ exports.ProxyConfigurationKind = void 0;
30
30
  const core = __importStar(require("../../core"));
31
31
  const Proxy_1 = require("./Proxy");
32
- exports.CustomProxy = core.serialization.undiscriminatedUnion([core.serialization.string(), Proxy_1.Proxy]);
32
+ exports.ProxyConfigurationKind = core.serialization.object({
33
+ domainPattern: core.serialization.string(),
34
+ relay: Proxy_1.Proxy,
35
+ });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Airtop from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const ProxyCredentials: core.serialization.ObjectSchema<serializers.ProxyCredentials.Raw, Airtop.ProxyCredentials>;
8
+ export declare namespace ProxyCredentials {
9
+ interface Raw {
10
+ password?: string | null;
11
+ url: string;
12
+ username?: string | null;
13
+ }
14
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ProxyCredentials = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.ProxyCredentials = core.serialization.object({
32
+ password: core.serialization.string().optional(),
33
+ url: core.serialization.string(),
34
+ username: core.serialization.string().optional(),
35
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Airtop from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const ScrapeConfig: core.serialization.ObjectSchema<serializers.ScrapeConfig.Raw, Airtop.ScrapeConfig>;
8
+ export declare namespace ScrapeConfig {
9
+ interface Raw {
10
+ optimizeUrls?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ScrapeConfig = void 0;
30
+ const core = __importStar(require("../../core"));
31
+ exports.ScrapeConfig = core.serialization.object({
32
+ optimizeUrls: core.serialization.string().optional(),
33
+ });
@@ -4,9 +4,9 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Airtop from "../../api/index";
6
6
  import * as core from "../../core";
7
- import { CustomProxy } from "./CustomProxy";
8
- import { SessionConfigV1ProxyItem } from "./SessionConfigV1ProxyItem";
7
+ import { Proxy } from "./Proxy";
8
+ import { ProxyConfigurationKind } from "./ProxyConfigurationKind";
9
9
  export declare const SessionConfigV1Proxy: core.serialization.Schema<serializers.SessionConfigV1Proxy.Raw, Airtop.SessionConfigV1Proxy>;
10
10
  export declare namespace SessionConfigV1Proxy {
11
- type Raw = boolean | CustomProxy.Raw | SessionConfigV1ProxyItem.Raw[];
11
+ type Raw = boolean | Proxy.Raw | ProxyConfigurationKind.Raw[];
12
12
  }
@@ -28,10 +28,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.SessionConfigV1Proxy = void 0;
30
30
  const core = __importStar(require("../../core"));
31
- const CustomProxy_1 = require("./CustomProxy");
32
- const SessionConfigV1ProxyItem_1 = require("./SessionConfigV1ProxyItem");
31
+ const Proxy_1 = require("./Proxy");
32
+ const ProxyConfigurationKind_1 = require("./ProxyConfigurationKind");
33
33
  exports.SessionConfigV1Proxy = core.serialization.undiscriminatedUnion([
34
34
  core.serialization.boolean(),
35
- CustomProxy_1.CustomProxy,
36
- core.serialization.list(SessionConfigV1ProxyItem_1.SessionConfigV1ProxyItem),
35
+ Proxy_1.Proxy,
36
+ core.serialization.list(ProxyConfigurationKind_1.ProxyConfigurationKind),
37
37
  ]);
@@ -6,5 +6,5 @@ import * as Airtop from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  export declare const VisualAnalysisConfigResultSelectionStrategy: core.serialization.Schema<serializers.VisualAnalysisConfigResultSelectionStrategy.Raw, Airtop.VisualAnalysisConfigResultSelectionStrategy>;
8
8
  export declare namespace VisualAnalysisConfigResultSelectionStrategy {
9
- type Raw = "first" | "bestMatch";
9
+ type Raw = "first" | "bestMatch" | "auto";
10
10
  }
@@ -28,4 +28,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.VisualAnalysisConfigResultSelectionStrategy = void 0;
30
30
  const core = __importStar(require("../../core"));
31
- exports.VisualAnalysisConfigResultSelectionStrategy = core.serialization.enum_(["first", "bestMatch"]);
31
+ exports.VisualAnalysisConfigResultSelectionStrategy = core.serialization.enum_(["first", "bestMatch", "auto"]);
@@ -8,6 +8,7 @@ export declare const Window: core.serialization.ObjectSchema<serializers.Window.
8
8
  export declare namespace Window {
9
9
  interface Raw {
10
10
  liveViewUrl: string;
11
+ targetId: string;
11
12
  windowId: string;
12
13
  }
13
14
  }
@@ -30,5 +30,6 @@ exports.Window = void 0;
30
30
  const core = __importStar(require("../../core"));
31
31
  exports.Window = core.serialization.object({
32
32
  liveViewUrl: core.serialization.string(),
33
+ targetId: core.serialization.string(),
33
34
  windowId: core.serialization.string(),
34
35
  });
@@ -23,6 +23,7 @@ export * from "./PageQueryConfig";
23
23
  export * from "./PageQueryExperimentalConfig";
24
24
  export * from "./PaginatedExtractionConfig";
25
25
  export * from "./Pagination";
26
+ export * from "./ScrapeConfig";
26
27
  export * from "./ScrapeResponse";
27
28
  export * from "./ScrapeResponseContent";
28
29
  export * from "./ScrapeResponseEnvelope";
@@ -30,9 +31,10 @@ export * from "./ScrapeResponseOutput";
30
31
  export * from "./ScreenshotConfig";
31
32
  export * from "./ScreenshotMetadata";
32
33
  export * from "./ScreenshotRequestConfig";
34
+ export * from "./AirtopProxyConfiguration";
35
+ export * from "./ProxyCredentials";
33
36
  export * from "./Proxy";
34
- export * from "./CustomProxy";
35
- export * from "./SessionConfigV1ProxyItem";
37
+ export * from "./ProxyConfigurationKind";
36
38
  export * from "./SessionConfigV1Proxy";
37
39
  export * from "./SessionConfigV1";
38
40
  export * from "./SessionEventMessage";