@intuned/browser-dev 2.2.3-unify-sdks.22 → 2.2.3-unify-sdks.23
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/dist/ai/export.d.js +3 -1
- package/dist/ai/export.d.ts +8 -8
- package/dist/ai/index.d.ts +8 -8
- package/dist/ai/tests/testCheckAllTypesAreStrings.spec.js +2 -4
- package/dist/ai/validators.js +8 -6
- package/dist/helpers/export.d.ts +27 -20
- package/dist/helpers/index.d.ts +27 -20
- package/dist/playwright/export.d.ts +1 -10
- package/dist/playwright/index.d.ts +1 -10
- package/package.json +2 -1
package/dist/ai/export.d.js
CHANGED
package/dist/ai/export.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Locator, Page } from "playwright-core";
|
|
2
|
-
import { ObjectSchema } from "./jsonSchema";
|
|
3
2
|
import { JSONSchema7TypeName } from "json-schema";
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -417,13 +416,6 @@ type SUPPORTED_MODELS = SUPPORTED_CLAUDE_MODELS | SUPPORTED_OPENAI_MODELS;
|
|
|
417
416
|
* };
|
|
418
417
|
* ```
|
|
419
418
|
*/
|
|
420
|
-
export type JSONSchema =
|
|
421
|
-
| StringSchema
|
|
422
|
-
| NumberSchema
|
|
423
|
-
| BooleanSchema
|
|
424
|
-
| ArraySchema
|
|
425
|
-
| ObjectSchema
|
|
426
|
-
| BaseSchema;
|
|
427
419
|
|
|
428
420
|
/**
|
|
429
421
|
* @interface HTMLStrategy
|
|
@@ -672,3 +664,11 @@ export declare function isPageLoaded(
|
|
|
672
664
|
* LoadingStatus is a union of true, false, and "Dont know".
|
|
673
665
|
*/
|
|
674
666
|
export type LoadingStatus = true | false | "Dont know";
|
|
667
|
+
|
|
668
|
+
export type JSONSchema =
|
|
669
|
+
| StringSchema
|
|
670
|
+
| NumberSchema
|
|
671
|
+
| BooleanSchema
|
|
672
|
+
| ArraySchema
|
|
673
|
+
| ObjectSchema
|
|
674
|
+
| BaseSchema;
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Locator, Page } from "playwright-core";
|
|
2
|
-
import { ObjectSchema } from "./jsonSchema";
|
|
3
2
|
import { JSONSchema7TypeName } from "json-schema";
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -417,13 +416,6 @@ type SUPPORTED_MODELS = SUPPORTED_CLAUDE_MODELS | SUPPORTED_OPENAI_MODELS;
|
|
|
417
416
|
* };
|
|
418
417
|
* ```
|
|
419
418
|
*/
|
|
420
|
-
export type JSONSchema =
|
|
421
|
-
| StringSchema
|
|
422
|
-
| NumberSchema
|
|
423
|
-
| BooleanSchema
|
|
424
|
-
| ArraySchema
|
|
425
|
-
| ObjectSchema
|
|
426
|
-
| BaseSchema;
|
|
427
419
|
|
|
428
420
|
/**
|
|
429
421
|
* @interface HTMLStrategy
|
|
@@ -672,3 +664,11 @@ export declare function isPageLoaded(
|
|
|
672
664
|
* LoadingStatus is a union of true, false, and "Dont know".
|
|
673
665
|
*/
|
|
674
666
|
export type LoadingStatus = true | false | "Dont know";
|
|
667
|
+
|
|
668
|
+
export type JSONSchema =
|
|
669
|
+
| StringSchema
|
|
670
|
+
| NumberSchema
|
|
671
|
+
| BooleanSchema
|
|
672
|
+
| ArraySchema
|
|
673
|
+
| ObjectSchema
|
|
674
|
+
| BaseSchema;
|
|
@@ -36,11 +36,9 @@ var _validators = require("../validators");
|
|
|
36
36
|
(0, _extendedTest.test)("should return false for array of mixed types", async () => {
|
|
37
37
|
const schema = {
|
|
38
38
|
type: "array",
|
|
39
|
-
items:
|
|
40
|
-
type: "string"
|
|
41
|
-
}, {
|
|
39
|
+
items: {
|
|
42
40
|
type: "number"
|
|
43
|
-
}
|
|
41
|
+
}
|
|
44
42
|
};
|
|
45
43
|
(0, _extendedTest.expect)((0, _validators.checkAllTypesAreStrings)(schema)).toBe(false);
|
|
46
44
|
});
|
package/dist/ai/validators.js
CHANGED
|
@@ -118,19 +118,21 @@ function checkAllTypesAreStrings(schema) {
|
|
|
118
118
|
return true;
|
|
119
119
|
}
|
|
120
120
|
if (schema.type === "array") {
|
|
121
|
-
|
|
121
|
+
const arraySchema = schema;
|
|
122
|
+
if (!arraySchema.items) {
|
|
122
123
|
return true;
|
|
123
124
|
}
|
|
124
|
-
if (Array.isArray(
|
|
125
|
-
return
|
|
125
|
+
if (Array.isArray(arraySchema.items)) {
|
|
126
|
+
return arraySchema.items.every(item => checkAllTypesAreStrings(item));
|
|
126
127
|
}
|
|
127
|
-
return checkAllTypesAreStrings(
|
|
128
|
+
return checkAllTypesAreStrings(arraySchema.items);
|
|
128
129
|
}
|
|
129
130
|
if (schema.type === "object") {
|
|
130
|
-
|
|
131
|
+
const objectSchema = schema;
|
|
132
|
+
if (!objectSchema.properties) {
|
|
131
133
|
return true;
|
|
132
134
|
}
|
|
133
|
-
return Object.values(
|
|
135
|
+
return Object.values(objectSchema.properties).every(prop => checkAllTypesAreStrings(prop));
|
|
134
136
|
}
|
|
135
137
|
return false;
|
|
136
138
|
}
|
package/dist/helpers/export.d.ts
CHANGED
|
@@ -230,7 +230,6 @@ export declare function goToUrl(input: {
|
|
|
230
230
|
page: Page;
|
|
231
231
|
url: string;
|
|
232
232
|
timeoutInMs?: number;
|
|
233
|
-
waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
|
|
234
233
|
retries?: number;
|
|
235
234
|
throwOnTimeout?: boolean;
|
|
236
235
|
waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
|
|
@@ -526,11 +525,17 @@ export declare function validateDataUsingSchema(input: {
|
|
|
526
525
|
* Versatile function that waits for network requests to settle after executing an action.
|
|
527
526
|
* Can be used as a simple decorator, parameterized decorator, or direct async call.
|
|
528
527
|
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
528
|
+
* This function has three overloads:
|
|
529
|
+
* 1. Simple decorator: `waitForNetworkIdle(func)` - Wraps a function that takes Page as first argument
|
|
530
|
+
* 2. Parameterized decorator: `waitForNetworkIdle({timeoutInMs, maxInflightRequests})(func)` - Returns a decorator with custom options
|
|
531
|
+
* 3. Direct async call: `waitForNetworkIdle({page, func, timeoutInMs, maxInflightRequests})` - Executes function directly
|
|
532
|
+
*
|
|
533
|
+
* @param {Function} func - Function to wrap (for simple decorator usage)
|
|
534
|
+
* @param {Object} options - Configuration options (for parameterized decorator or direct call)
|
|
535
|
+
* @param {number} [options.timeoutInMs=30000] - Maximum time to wait in milliseconds before timing out
|
|
536
|
+
* @param {number} [options.maxInflightRequests=0] - Maximum number of pending requests to consider as "settled"
|
|
537
|
+
* @param {Page} [options.page] - Playwright page object (required for direct async call)
|
|
538
|
+
* @param {Function} [options.func] - Function to execute that returns a Promise (required for direct async call)
|
|
534
539
|
* @returns {Function | Promise} Returns wrapped function for decorator usage, or Promise for direct async call
|
|
535
540
|
*
|
|
536
541
|
* @example
|
|
@@ -598,17 +603,19 @@ export declare function validateDataUsingSchema(input: {
|
|
|
598
603
|
* // Function automatically waits for all network requests to complete
|
|
599
604
|
* ```
|
|
600
605
|
*/
|
|
601
|
-
export declare function waitForNetworkIdle(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
606
|
+
export declare function waitForNetworkIdle<T extends (...args: any[]) => any>(
|
|
607
|
+
func: T
|
|
608
|
+
): T;
|
|
609
|
+
export declare function waitForNetworkIdle(options: {
|
|
610
|
+
timeoutInMs?: number;
|
|
611
|
+
maxInflightRequests?: number;
|
|
612
|
+
}): <T extends (...args: any[]) => any>(func: T) => T;
|
|
613
|
+
export declare function waitForNetworkIdle<T>(options: {
|
|
614
|
+
page: Page;
|
|
615
|
+
func: () => Promise<T>;
|
|
616
|
+
timeoutInMs?: number;
|
|
617
|
+
maxInflightRequests?: number;
|
|
618
|
+
}): Promise<T>;
|
|
612
619
|
|
|
613
620
|
/**
|
|
614
621
|
* Wait for the DOM to stop changing before proceeding. Useful for dynamic content
|
|
@@ -717,7 +724,7 @@ export declare function waitForNetworkIdle(
|
|
|
717
724
|
* ```
|
|
718
725
|
*/
|
|
719
726
|
|
|
720
|
-
export
|
|
727
|
+
export function waitForDomSettled(options: {
|
|
721
728
|
page: Page;
|
|
722
729
|
settleDuration?: number;
|
|
723
730
|
timeoutInMs?: number;
|
|
@@ -1147,8 +1154,8 @@ export type S3UploadableFile = Download | Uint8Array | Buffer | ReadStream;
|
|
|
1147
1154
|
export declare function downloadFromPageToS3(
|
|
1148
1155
|
page: Page,
|
|
1149
1156
|
trigger: Trigger,
|
|
1150
|
-
|
|
1151
|
-
|
|
1157
|
+
uploadOptions: S3UploadOptions,
|
|
1158
|
+
timeoutInMs?: number
|
|
1152
1159
|
): Promise<Attachment>;
|
|
1153
1160
|
/**
|
|
1154
1161
|
* Downloads a file from a web page and uploads it to S3 storage.
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -230,7 +230,6 @@ export declare function goToUrl(input: {
|
|
|
230
230
|
page: Page;
|
|
231
231
|
url: string;
|
|
232
232
|
timeoutInMs?: number;
|
|
233
|
-
waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
|
|
234
233
|
retries?: number;
|
|
235
234
|
throwOnTimeout?: boolean;
|
|
236
235
|
waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
|
|
@@ -526,11 +525,17 @@ export declare function validateDataUsingSchema(input: {
|
|
|
526
525
|
* Versatile function that waits for network requests to settle after executing an action.
|
|
527
526
|
* Can be used as a simple decorator, parameterized decorator, or direct async call.
|
|
528
527
|
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
528
|
+
* This function has three overloads:
|
|
529
|
+
* 1. Simple decorator: `waitForNetworkIdle(func)` - Wraps a function that takes Page as first argument
|
|
530
|
+
* 2. Parameterized decorator: `waitForNetworkIdle({timeoutInMs, maxInflightRequests})(func)` - Returns a decorator with custom options
|
|
531
|
+
* 3. Direct async call: `waitForNetworkIdle({page, func, timeoutInMs, maxInflightRequests})` - Executes function directly
|
|
532
|
+
*
|
|
533
|
+
* @param {Function} func - Function to wrap (for simple decorator usage)
|
|
534
|
+
* @param {Object} options - Configuration options (for parameterized decorator or direct call)
|
|
535
|
+
* @param {number} [options.timeoutInMs=30000] - Maximum time to wait in milliseconds before timing out
|
|
536
|
+
* @param {number} [options.maxInflightRequests=0] - Maximum number of pending requests to consider as "settled"
|
|
537
|
+
* @param {Page} [options.page] - Playwright page object (required for direct async call)
|
|
538
|
+
* @param {Function} [options.func] - Function to execute that returns a Promise (required for direct async call)
|
|
534
539
|
* @returns {Function | Promise} Returns wrapped function for decorator usage, or Promise for direct async call
|
|
535
540
|
*
|
|
536
541
|
* @example
|
|
@@ -598,17 +603,19 @@ export declare function validateDataUsingSchema(input: {
|
|
|
598
603
|
* // Function automatically waits for all network requests to complete
|
|
599
604
|
* ```
|
|
600
605
|
*/
|
|
601
|
-
export declare function waitForNetworkIdle(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
606
|
+
export declare function waitForNetworkIdle<T extends (...args: any[]) => any>(
|
|
607
|
+
func: T
|
|
608
|
+
): T;
|
|
609
|
+
export declare function waitForNetworkIdle(options: {
|
|
610
|
+
timeoutInMs?: number;
|
|
611
|
+
maxInflightRequests?: number;
|
|
612
|
+
}): <T extends (...args: any[]) => any>(func: T) => T;
|
|
613
|
+
export declare function waitForNetworkIdle<T>(options: {
|
|
614
|
+
page: Page;
|
|
615
|
+
func: () => Promise<T>;
|
|
616
|
+
timeoutInMs?: number;
|
|
617
|
+
maxInflightRequests?: number;
|
|
618
|
+
}): Promise<T>;
|
|
612
619
|
|
|
613
620
|
/**
|
|
614
621
|
* Wait for the DOM to stop changing before proceeding. Useful for dynamic content
|
|
@@ -717,7 +724,7 @@ export declare function waitForNetworkIdle(
|
|
|
717
724
|
* ```
|
|
718
725
|
*/
|
|
719
726
|
|
|
720
|
-
export
|
|
727
|
+
export function waitForDomSettled(options: {
|
|
721
728
|
page: Page;
|
|
722
729
|
settleDuration?: number;
|
|
723
730
|
timeoutInMs?: number;
|
|
@@ -1147,8 +1154,8 @@ export type S3UploadableFile = Download | Uint8Array | Buffer | ReadStream;
|
|
|
1147
1154
|
export declare function downloadFromPageToS3(
|
|
1148
1155
|
page: Page,
|
|
1149
1156
|
trigger: Trigger,
|
|
1150
|
-
|
|
1151
|
-
|
|
1157
|
+
uploadOptions: S3UploadOptions,
|
|
1158
|
+
timeoutInMs?: number
|
|
1152
1159
|
): Promise<Attachment>;
|
|
1153
1160
|
/**
|
|
1154
1161
|
* Downloads a file from a web page and uploads it to S3 storage.
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
extractMarkdownFromPage,
|
|
4
|
-
extractStructuredDataFromPage,
|
|
5
|
-
} from "../ai-extractors";
|
|
6
|
-
import {
|
|
7
|
-
extractArrayFromPage,
|
|
8
|
-
extractObjectFromPage,
|
|
9
|
-
} from "../optimized-extractors";
|
|
10
|
-
|
|
1
|
+
import type { Page } from "playwright-core";
|
|
11
2
|
/**
|
|
12
3
|
* --
|
|
13
4
|
* @interface
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
extractMarkdownFromPage,
|
|
4
|
-
extractStructuredDataFromPage,
|
|
5
|
-
} from "../ai-extractors";
|
|
6
|
-
import {
|
|
7
|
-
extractArrayFromPage,
|
|
8
|
-
extractObjectFromPage,
|
|
9
|
-
} from "../optimized-extractors";
|
|
10
|
-
|
|
1
|
+
import type { Page } from "playwright-core";
|
|
11
2
|
/**
|
|
12
3
|
* --
|
|
13
4
|
* @interface
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/browser-dev",
|
|
3
|
-
"version": "2.2.3-unify-sdks.
|
|
3
|
+
"version": "2.2.3-unify-sdks.23",
|
|
4
4
|
"description": "runner package for intuned functions",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"typesVersions": {
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"@types/async-retry": "1.4.8",
|
|
106
106
|
"@types/fs-extra": "11.0.1",
|
|
107
107
|
"@types/jest": "^30.0.0",
|
|
108
|
+
"@types/json-schema": "^7.0.15",
|
|
108
109
|
"@types/lodash": "4.14.200",
|
|
109
110
|
"@types/node": "^24.1.0",
|
|
110
111
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|