@intuned/browser-dev 2.2.3-test-build.0
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/.babelrc +21 -0
- package/.eslintignore +10 -0
- package/.eslintrc.js +39 -0
- package/LICENSE +43 -0
- package/dist/ai/export.d.js +5 -0
- package/dist/ai/export.d.ts +641 -0
- package/dist/ai/extractStructuredData.js +320 -0
- package/dist/ai/extractStructuredDataUsingAi.js +139 -0
- package/dist/ai/extractionHelpers/screenshotHelpers.js +56 -0
- package/dist/ai/extractionHelpers/validateSchema.js +148 -0
- package/dist/ai/index.d.ts +641 -0
- package/dist/ai/index.js +19 -0
- package/dist/ai/isPageLoaded.js +77 -0
- package/dist/ai/prompt.js +39 -0
- package/dist/ai/tests/testCheckAllTypesAreStrings.spec.js +137 -0
- package/dist/ai/tests/testExtractFromContent.spec.js +372 -0
- package/dist/ai/tests/testExtractStructuredData.spec.js +646 -0
- package/dist/ai/tests/testIsPageLoaded.spec.js +277 -0
- package/dist/ai/tools/index.js +48 -0
- package/dist/ai/types/errors.js +67 -0
- package/dist/ai/types/models.js +45 -0
- package/dist/ai/types/types.js +48 -0
- package/dist/ai/validators.js +167 -0
- package/dist/common/Logger/index.js +60 -0
- package/dist/common/Logger/types.js +5 -0
- package/dist/common/SdkError.js +50 -0
- package/dist/common/aiModelsValidations.js +32 -0
- package/dist/common/browser_scripts.js +2596 -0
- package/dist/common/ensureBrowserScripts.js +18 -0
- package/dist/common/extendedTest.js +148 -0
- package/dist/common/extractionHelpers.js +19 -0
- package/dist/common/formatZodError.js +18 -0
- package/dist/common/fuzzySearch/fuzzySearch.test.js +250 -0
- package/dist/common/fuzzySearch/levenshtein-search.js +298 -0
- package/dist/common/fuzzySearch/utils.js +23 -0
- package/dist/common/getModelProvider.js +18 -0
- package/dist/common/getSimplifiedHtml.js +122 -0
- package/dist/common/hashObject.js +32 -0
- package/dist/common/html2markdown/convertElementToMarkdown.js +469 -0
- package/dist/common/html2markdown/index.js +19 -0
- package/dist/common/jwtTokenManager.js +18 -0
- package/dist/common/loadRuntime.js +16 -0
- package/dist/common/locatorHelpers.js +41 -0
- package/dist/common/matching/collectStrings.js +32 -0
- package/dist/common/matching/levenshtein.js +40 -0
- package/dist/common/matching/matching.js +317 -0
- package/dist/common/matching/types.js +1 -0
- package/dist/common/noEmpty.js +9 -0
- package/dist/common/saveSnapshotWithExamples.js +60 -0
- package/dist/common/tests/testEnsureBrowserScript.spec.js +31 -0
- package/dist/common/xpathMapping.js +107 -0
- package/dist/helpers/clickUntilExhausted.js +85 -0
- package/dist/helpers/downloadFile.js +125 -0
- package/dist/helpers/export.d.js +5 -0
- package/dist/helpers/export.d.ts +1220 -0
- package/dist/helpers/extractMarkdown.js +35 -0
- package/dist/helpers/filterEmptyValues.js +54 -0
- package/dist/helpers/gotoUrl.js +98 -0
- package/dist/helpers/index.d.ts +1220 -0
- package/dist/helpers/index.js +128 -0
- package/dist/helpers/processDate.js +25 -0
- package/dist/helpers/resolveUrl.js +64 -0
- package/dist/helpers/sanitizeHtml.js +74 -0
- package/dist/helpers/saveFileToS3.js +50 -0
- package/dist/helpers/scrollToLoadContent.js +57 -0
- package/dist/helpers/tests/extendedTest.js +130 -0
- package/dist/helpers/tests/testClickUntilExhausted.spec.js +387 -0
- package/dist/helpers/tests/testDownloadFile.spec.js +204 -0
- package/dist/helpers/tests/testExtractMarkdown.spec.js +290 -0
- package/dist/helpers/tests/testFilterEmptyValues.spec.js +151 -0
- package/dist/helpers/tests/testGoToUrl.spec.js +37 -0
- package/dist/helpers/tests/testProcessDate.spec.js +13 -0
- package/dist/helpers/tests/testResolveUrl.spec.js +341 -0
- package/dist/helpers/tests/testSanitizeHtml.spec.js +330 -0
- package/dist/helpers/tests/testScrollToLoadContent.spec.js +163 -0
- package/dist/helpers/tests/testValidateDataUsingSchema.spec.js +342 -0
- package/dist/helpers/tests/testWithDomSettledWait.spec.js +164 -0
- package/dist/helpers/tests/testWithNetworkIdleWait.spec.js +114 -0
- package/dist/helpers/types/Attachment.js +115 -0
- package/dist/helpers/types/CustomTypeRegistry.js +48 -0
- package/dist/helpers/types/RunEnvironment.js +18 -0
- package/dist/helpers/types/ValidationError.js +17 -0
- package/dist/helpers/types/index.js +51 -0
- package/dist/helpers/uploadFileToS3.js +154 -0
- package/dist/helpers/utils/getS3Client.js +22 -0
- package/dist/helpers/utils/index.js +73 -0
- package/dist/helpers/utils/isDownload.js +10 -0
- package/dist/helpers/utils/isGenerateCodeMode.js +9 -0
- package/dist/helpers/utils/isLocator.js +9 -0
- package/dist/helpers/utils/jwtTokenManager.js +18 -0
- package/dist/helpers/validateDataUsingSchema.js +103 -0
- package/dist/helpers/waitForDomSettled.js +90 -0
- package/dist/helpers/withNetworkSettledWait.js +91 -0
- package/dist/index.d.js +16 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +16 -0
- package/dist/intunedServices/ApiGateway/aiApiGateway.js +99 -0
- package/dist/intunedServices/ApiGateway/factory.js +13 -0
- package/dist/intunedServices/ApiGateway/providers/Anthropic.js +26 -0
- package/dist/intunedServices/ApiGateway/providers/Gemini.js +29 -0
- package/dist/intunedServices/ApiGateway/providers/OpenAI.js +29 -0
- package/dist/intunedServices/ApiGateway/tests/testApiGateway.spec.js +224 -0
- package/dist/intunedServices/ApiGateway/types.js +11 -0
- package/dist/intunedServices/cache/cache.js +61 -0
- package/dist/intunedServices/cache/index.js +12 -0
- package/dist/intunedServices/cache/tests/testCache.spec.js +117 -0
- package/dist/optimized-extractors/common/buildExamplesPrompt.js +12 -0
- package/dist/optimized-extractors/common/buildImagesFromPage.js +55 -0
- package/dist/optimized-extractors/common/extractStructuredDataUsingClaude.js +135 -0
- package/dist/optimized-extractors/common/extractStructuredDataUsingGoogle.js +37 -0
- package/dist/optimized-extractors/common/extractStructuredDataUsingOpenAi.js +132 -0
- package/dist/optimized-extractors/common/extractStrucutredDataUsingAiInstance.js +122 -0
- package/dist/optimized-extractors/common/findTableHeaders.js +162 -0
- package/dist/optimized-extractors/common/index.js +55 -0
- package/dist/optimized-extractors/common/isTableHeaderOrFooter.js +84 -0
- package/dist/optimized-extractors/common/matching/matching.js +212 -0
- package/dist/optimized-extractors/common/matching/matching.test.js +655 -0
- package/dist/optimized-extractors/common/matching/types.js +18 -0
- package/dist/optimized-extractors/common/matching/utils.js +184 -0
- package/dist/optimized-extractors/common/utils.js +58 -0
- package/dist/optimized-extractors/export.d.js +5 -0
- package/dist/optimized-extractors/export.d.ts +397 -0
- package/dist/optimized-extractors/extractArray.js +120 -0
- package/dist/optimized-extractors/extractObject.js +104 -0
- package/dist/optimized-extractors/index.d.ts +397 -0
- package/dist/optimized-extractors/index.js +31 -0
- package/dist/optimized-extractors/listExtractionHelpers/__tests__/dynamicListExtractor.spec.js +312 -0
- package/dist/optimized-extractors/listExtractionHelpers/__tests__/findSetOfXpathsToCreateAnArrayExtractor.test.js +22 -0
- package/dist/optimized-extractors/listExtractionHelpers/__tests__/getContainerElement.test.js +21 -0
- package/dist/optimized-extractors/listExtractionHelpers/__tests__/partOfSameArrayXpath.test.js +42 -0
- package/dist/optimized-extractors/listExtractionHelpers/__tests__/verifyThatAllXpathsArePartOfSameArray.test.js +9 -0
- package/dist/optimized-extractors/listExtractionHelpers/dynamicListExtractor.js +152 -0
- package/dist/optimized-extractors/listExtractionHelpers/errors.js +46 -0
- package/dist/optimized-extractors/listExtractionHelpers/getListMatches.js +14 -0
- package/dist/optimized-extractors/listExtractionHelpers/runAiExtraction.js +240 -0
- package/dist/optimized-extractors/listExtractionHelpers/typesAndSchema.js +5 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/extractPropertiesUsingGPTFromArray.js +277 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/extractStructuredListUsingAi.js +44 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/getListContainerXpath.js +94 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/getRelativeContainerXpathSelector.js +20 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/getSimplifiedHtmlPerListItem.js +21 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/tablesUtils.js +48 -0
- package/dist/optimized-extractors/listExtractionHelpers/utils/validateOptions.js +52 -0
- package/dist/optimized-extractors/models/anthropicModel.js +23 -0
- package/dist/optimized-extractors/models/openaiModel.js +23 -0
- package/dist/optimized-extractors/objectExtractionHelpers/AIExtractors.js +73 -0
- package/dist/optimized-extractors/objectExtractionHelpers/__tests__/checksumUtils.test.js +103 -0
- package/dist/optimized-extractors/objectExtractionHelpers/__tests__/testObjectExtractorFromLocator.spec.js +107 -0
- package/dist/optimized-extractors/objectExtractionHelpers/__tests__/testObjectExtractorFromPage.spec.js +107 -0
- package/dist/optimized-extractors/objectExtractionHelpers/calculateObjectExampleHash.js +28 -0
- package/dist/optimized-extractors/objectExtractionHelpers/captureSnapshot.js +26 -0
- package/dist/optimized-extractors/objectExtractionHelpers/checksumUtils.js +32 -0
- package/dist/optimized-extractors/objectExtractionHelpers/constants.js +7 -0
- package/dist/optimized-extractors/objectExtractionHelpers/dynamicObjectExtractor.js +106 -0
- package/dist/optimized-extractors/objectExtractionHelpers/errors.js +42 -0
- package/dist/optimized-extractors/objectExtractionHelpers/findDomMatches.js +54 -0
- package/dist/optimized-extractors/objectExtractionHelpers/getSimplifiedHtml.js +122 -0
- package/dist/optimized-extractors/objectExtractionHelpers/typesAndSchemas.js +5 -0
- package/dist/optimized-extractors/objectExtractionHelpers/validateDynamicObjectExtractorOptions.js +52 -0
- package/dist/optimized-extractors/types/aiModelsValidation.js +45 -0
- package/dist/optimized-extractors/types/errors.js +42 -0
- package/dist/optimized-extractors/types/jsonSchema.d.js +5 -0
- package/dist/optimized-extractors/types/jsonSchema.d.ts +50 -0
- package/dist/optimized-extractors/types/types.js +5 -0
- package/dist/optimized-extractors/validators.js +152 -0
- package/dist/vite-env.d.js +1 -0
- package/dist/vite-env.d.ts +9 -0
- package/docs.md +14 -0
- package/generated-docs/ai/functions/extractStructuredData.mdx +255 -0
- package/generated-docs/ai/functions/isPageLoaded.mdx +88 -0
- package/generated-docs/ai/interfaces/ArraySchema.mdx +36 -0
- package/generated-docs/ai/interfaces/BasicSchema.mdx +14 -0
- package/generated-docs/ai/interfaces/BooleanSchema.mdx +28 -0
- package/generated-docs/ai/interfaces/ImageBufferContentItem.mdx +16 -0
- package/generated-docs/ai/interfaces/ImageUrlContentItem.mdx +16 -0
- package/generated-docs/ai/interfaces/NumberSchema.mdx +35 -0
- package/generated-docs/ai/interfaces/ObjectSchema.mdx +39 -0
- package/generated-docs/ai/interfaces/StringSchema.mdx +35 -0
- package/generated-docs/ai/interfaces/TextContentItem.mdx +14 -0
- package/generated-docs/ai/type-aliases/ContentItem.mdx +12 -0
- package/generated-docs/ai/type-aliases/JsonSchema.mdx +47 -0
- package/generated-docs/ai/type-aliases/SUPPORTED_MODELS.mdx +85 -0
- package/generated-docs/helpers/functions/downloadFile.mdx +99 -0
- package/generated-docs/helpers/functions/extractMarkdown.mdx +56 -0
- package/generated-docs/helpers/functions/filterEmptyValues.mdx +51 -0
- package/generated-docs/helpers/functions/goToUrl.mdx +124 -0
- package/generated-docs/helpers/functions/processDate.mdx +55 -0
- package/generated-docs/helpers/functions/resolveUrl.mdx +165 -0
- package/generated-docs/helpers/functions/sanitizeHtml.mdx +113 -0
- package/generated-docs/helpers/functions/saveFileToS3.mdx +127 -0
- package/generated-docs/helpers/functions/scrollToLoadContent.mdx +89 -0
- package/generated-docs/helpers/functions/uploadFileToS3.mdx +121 -0
- package/generated-docs/helpers/functions/validateDataUsingSchema.mdx +90 -0
- package/generated-docs/helpers/functions/waitForDomSettled.mdx +91 -0
- package/generated-docs/helpers/functions/withNetworkSettledWait.mdx +76 -0
- package/generated-docs/helpers/interfaces/Attachment.mdx +56 -0
- package/generated-docs/helpers/interfaces/S3Configs.mdx +52 -0
- package/generated-docs/helpers/interfaces/SanitizeHtmlOptions.mdx +22 -0
- package/generated-docs/helpers/type-aliases/AttachmentType.mdx +10 -0
- package/generated-docs/helpers/type-aliases/FileType.mdx +61 -0
- package/generated-docs/helpers/type-aliases/Trigger.mdx +62 -0
- package/how-to-run-tests.md +10 -0
- package/intuned-runtime-setup.md +13 -0
- package/package.json +119 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: resolveUrl
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Tabs>
|
|
7
|
+
|
|
8
|
+
<Tab title="From Base URL String">
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export declare function resolveUrl(input: {
|
|
12
|
+
url: string;
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Converts any URL source to an absolute, properly encoded URL by combining a relative URL with a base URL string.
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
<CodeGroup>
|
|
22
|
+
|
|
23
|
+
```typescript String source
|
|
24
|
+
import { resolveUrl } from '@intuned/browser';
|
|
25
|
+
export default async function handler(params, page, context){
|
|
26
|
+
await page.goto("https://example.com");
|
|
27
|
+
|
|
28
|
+
// Using explicit base URL
|
|
29
|
+
const absoluteUrl = await resolveUrl({
|
|
30
|
+
url: "/api/users",
|
|
31
|
+
baseUrl: "https://example.com"
|
|
32
|
+
});
|
|
33
|
+
// Returns: "https://example.com/api/users"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
</CodeGroup>
|
|
38
|
+
|
|
39
|
+
## Arguments
|
|
40
|
+
|
|
41
|
+
<ParamField path="input" type="Object" required
|
|
42
|
+
>
|
|
43
|
+
Configuration object with different properties based on the overload
|
|
44
|
+
|
|
45
|
+
<Expandable title="input">
|
|
46
|
+
<ParamField path="input.url" type="string">
|
|
47
|
+
The relative or absolute URL to resolve
|
|
48
|
+
</ParamField>
|
|
49
|
+
|
|
50
|
+
<ParamField path="input.baseUrl" type="string">
|
|
51
|
+
Base URL string to resolve relative URLs against
|
|
52
|
+
</ParamField>
|
|
53
|
+
|
|
54
|
+
</Expandable>
|
|
55
|
+
|
|
56
|
+
</ParamField>
|
|
57
|
+
|
|
58
|
+
## Returns: `Promise<string>`
|
|
59
|
+
|
|
60
|
+
Promise that resolves to the absolute, properly encoded URL string
|
|
61
|
+
|
|
62
|
+
</Tab>
|
|
63
|
+
|
|
64
|
+
<Tab title="From The Current Page's URL">
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
export declare function resolveUrl(input: {
|
|
68
|
+
url: string;
|
|
69
|
+
page: Page;
|
|
70
|
+
}): Promise<string>;
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Converts any URL source to an absolute, properly encoded URL by using the current page's URL as the base URL.
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
<CodeGroup>
|
|
78
|
+
|
|
79
|
+
```typescript Page source
|
|
80
|
+
import { resolveUrl } from '@intuned/browser';
|
|
81
|
+
export default async function handler(params, page, context){
|
|
82
|
+
await page.goto("https://example.com");
|
|
83
|
+
// Using current page as base URL
|
|
84
|
+
const absoluteUrl = await resolveUrl({
|
|
85
|
+
url: "/api/users",
|
|
86
|
+
page: page
|
|
87
|
+
});
|
|
88
|
+
// Returns: "https://example.com/api/users"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
</CodeGroup>
|
|
93
|
+
|
|
94
|
+
## Arguments
|
|
95
|
+
|
|
96
|
+
<ParamField path="input" type="Object" required
|
|
97
|
+
>
|
|
98
|
+
Configuration object with different properties based on the overload
|
|
99
|
+
|
|
100
|
+
<Expandable title="input">
|
|
101
|
+
<ParamField path="input.url" type="string">
|
|
102
|
+
The relative or absolute URL to resolve
|
|
103
|
+
</ParamField>
|
|
104
|
+
|
|
105
|
+
<ParamField path="input.page" type="Page">
|
|
106
|
+
Playwright Page object to extract base URL from. The current page URL will be used as the base URL
|
|
107
|
+
</ParamField>
|
|
108
|
+
|
|
109
|
+
</Expandable>
|
|
110
|
+
|
|
111
|
+
</ParamField>
|
|
112
|
+
|
|
113
|
+
## Returns: `Promise<string>`
|
|
114
|
+
|
|
115
|
+
Promise that resolves to the absolute, properly encoded URL string
|
|
116
|
+
|
|
117
|
+
</Tab>
|
|
118
|
+
|
|
119
|
+
<Tab title="From Anchor Element">
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
export declare function resolveUrl(input: { url: Locator }): Promise<string>;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Converts any URL source to an absolute, properly encoded URL by extracting the href attribute from a Playwright Locator pointing to an anchor element.
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
<CodeGroup>
|
|
130
|
+
|
|
131
|
+
```typescript Locator source
|
|
132
|
+
import { resolveUrl } from '@intuned/browser';
|
|
133
|
+
export default async function handler(params, page, context){
|
|
134
|
+
await page.goto("https://sandbox.intuned.dev/");
|
|
135
|
+
const absoluteUrl = await resolveUrl({
|
|
136
|
+
url: page.locator("xpath=//a[normalize-space()='Steps Form']"),
|
|
137
|
+
});
|
|
138
|
+
// Returns: "https://sandbox.intuned.dev/steps-form"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
</CodeGroup>
|
|
143
|
+
|
|
144
|
+
## Arguments
|
|
145
|
+
|
|
146
|
+
<ParamField path="input" type="Object" required
|
|
147
|
+
>
|
|
148
|
+
Configuration object with different properties based on the overload
|
|
149
|
+
|
|
150
|
+
<Expandable title="input">
|
|
151
|
+
<ParamField path="input.url" type="Locator">
|
|
152
|
+
Playwright Locator pointing to an anchor element. The href attribute will be extracted and resolved
|
|
153
|
+
</ParamField>
|
|
154
|
+
|
|
155
|
+
</Expandable>
|
|
156
|
+
|
|
157
|
+
</ParamField>
|
|
158
|
+
|
|
159
|
+
## Returns: `Promise<string>`
|
|
160
|
+
|
|
161
|
+
Promise that resolves to the absolute, properly encoded URL string
|
|
162
|
+
|
|
163
|
+
</Tab>
|
|
164
|
+
|
|
165
|
+
</Tabs>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: sanitizeHtml
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Sanitizes and cleans HTML content by removing unwanted elements, attributes, and whitespace.
|
|
11
|
+
Provides fine-grained control over each cleaning operation through configurable options.
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
<CodeGroup>
|
|
16
|
+
|
|
17
|
+
```typescript Basic Sanitization
|
|
18
|
+
import { sanitizeHtml } from "@intuned/browser";
|
|
19
|
+
export default async function handler(params, page, context){
|
|
20
|
+
const dirtyHtml = `
|
|
21
|
+
<div>
|
|
22
|
+
<script>alert('xss')</script>
|
|
23
|
+
<p style="color: red;">Hello World</p>
|
|
24
|
+
<span></span>
|
|
25
|
+
</div>
|
|
26
|
+
`;
|
|
27
|
+
const sanitizedHtml = sanitizeHtml({ html: dirtyHtml });
|
|
28
|
+
// Returns: '<div><p>Hello World</p></div>'
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```typescript Sanitization Options
|
|
33
|
+
import { sanitizeHtml } from "@intuned/browser";
|
|
34
|
+
export default async function handler(params, page, context){
|
|
35
|
+
const html = `
|
|
36
|
+
<div data-long-attr="${'x'.repeat(600)}">
|
|
37
|
+
<style>.test { color: red; }</style>
|
|
38
|
+
<script>alert('test')</script>
|
|
39
|
+
<p style="color: blue;">Content</p>
|
|
40
|
+
<!-- Comment -->
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
// Keep styles but remove scripts and comments
|
|
44
|
+
const result = sanitizeHtml({ html,
|
|
45
|
+
removeScripts: true,
|
|
46
|
+
removeStyles: false,
|
|
47
|
+
removeComments: true,
|
|
48
|
+
maxAttributeLength: 100,
|
|
49
|
+
preserveAttributes: ["class", "src", "style"]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
</CodeGroup>
|
|
55
|
+
|
|
56
|
+
## Arguments
|
|
57
|
+
|
|
58
|
+
<ParamField path="options" type="SanitizeHtmlOptions" required
|
|
59
|
+
>
|
|
60
|
+
Configuration options for sanitization
|
|
61
|
+
|
|
62
|
+
<Expandable title="options">
|
|
63
|
+
<ParamField path="options.html" type="string">
|
|
64
|
+
The HTML content to sanitize
|
|
65
|
+
</ParamField>
|
|
66
|
+
|
|
67
|
+
<ParamField path="options.removeScripts" type="boolean">
|
|
68
|
+
Remove all `<script>` elements. Defaults to true.
|
|
69
|
+
</ParamField>
|
|
70
|
+
|
|
71
|
+
<ParamField path="options.removeStyles" type="boolean">
|
|
72
|
+
Remove all `<style>` elements. Defaults to true.
|
|
73
|
+
</ParamField>
|
|
74
|
+
|
|
75
|
+
<ParamField path="options.removeSvgs" type="boolean">
|
|
76
|
+
Remove all `<svg>` elements. Defaults to true.
|
|
77
|
+
</ParamField>
|
|
78
|
+
|
|
79
|
+
<ParamField path="options.removeComments" type="boolean">
|
|
80
|
+
Remove HTML comments. Defaults to true.
|
|
81
|
+
</ParamField>
|
|
82
|
+
|
|
83
|
+
<ParamField path="options.removeLongAttributes" type="boolean">
|
|
84
|
+
Remove attributes longer than maxAttributeLength. Defaults to true.
|
|
85
|
+
</ParamField>
|
|
86
|
+
|
|
87
|
+
<ParamField path="options.maxAttributeLength" type="number">
|
|
88
|
+
Maximum length for attributes before removal. Defaults to 500.
|
|
89
|
+
</ParamField>
|
|
90
|
+
|
|
91
|
+
<ParamField path="options.preserveAttributes" type="Array<string>">
|
|
92
|
+
List of attribute names to always preserve. Defaults to ["class", "src"].
|
|
93
|
+
</ParamField>
|
|
94
|
+
|
|
95
|
+
<ParamField path="options.removeEmptyTags" type="boolean">
|
|
96
|
+
Remove empty tags (except preserved ones). Defaults to true.
|
|
97
|
+
</ParamField>
|
|
98
|
+
|
|
99
|
+
<ParamField path="options.preserveEmptyTags" type="Array<string>">
|
|
100
|
+
List of tag names to preserve even when empty. Defaults to ["img"].
|
|
101
|
+
</ParamField>
|
|
102
|
+
|
|
103
|
+
<ParamField path="options.minifyWhitespace" type="boolean">
|
|
104
|
+
Remove extra whitespace between tags and empty lines. Defaults to true.
|
|
105
|
+
</ParamField>
|
|
106
|
+
|
|
107
|
+
</Expandable>
|
|
108
|
+
|
|
109
|
+
</ParamField>
|
|
110
|
+
|
|
111
|
+
## Returns: `string`
|
|
112
|
+
|
|
113
|
+
The sanitized HTML string
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: saveFileToS3
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export declare function saveFileToS3(input: {
|
|
8
|
+
page: Page;
|
|
9
|
+
trigger: Trigger;
|
|
10
|
+
timeoutInMs?: number;
|
|
11
|
+
configs?: S3Configs;
|
|
12
|
+
fileNameOverride?: string;
|
|
13
|
+
contentType?: string;
|
|
14
|
+
}): Promise<Attachment>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<Note>
|
|
18
|
+
**S3 Configuration hierarchy:** (same as `uploadFileToS3`):
|
|
19
|
+
1. Explicit `configs` values from the input
|
|
20
|
+
2. Standard AWS environment variables (`AWS_BUCKET`, `AWS_REGION`, etc.)
|
|
21
|
+
3. Intuned's default S3 configuration as fallback
|
|
22
|
+
|
|
23
|
+
**Trigger Behavior** (same as `downloadFile`):
|
|
24
|
+
- **URL**: Creates temporary page, navigates to URL, captures download, closes page
|
|
25
|
+
- **Locator**: Uses current page to click element and capture download
|
|
26
|
+
- **Callback**: Executes custom function and captures any resulting downloads
|
|
27
|
+
</Note>
|
|
28
|
+
|
|
29
|
+
Downloads a file from a web page and automatically uploads it to AWS S3 storage in a single operation.
|
|
30
|
+
|
|
31
|
+
This convenience function combines the functionality of `downloadFile` and `uploadFileToS3`,
|
|
32
|
+
providing a streamlined workflow for capturing files from web pages and storing them in S3.
|
|
33
|
+
It supports the same flexible trigger methods as `downloadFile` with additional S3 upload configuration.
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
<CodeGroup>
|
|
38
|
+
|
|
39
|
+
```typescript URL trigger
|
|
40
|
+
import { saveFileToS3 } from "@intuned/browser";
|
|
41
|
+
export default async function handler(params, page, context){
|
|
42
|
+
// Download from URL and upload to S3 with custom configuration
|
|
43
|
+
const uploadedFile = await saveFileToS3({
|
|
44
|
+
page,
|
|
45
|
+
trigger: "https://sandbox.intuned.dev/pdfs/report.pdf",
|
|
46
|
+
configs: {
|
|
47
|
+
bucket: 'document-storage',
|
|
48
|
+
region: 'us-east-1',
|
|
49
|
+
accessKeyId: 'accessKeyId',
|
|
50
|
+
secretAccessKey: 'SecretAccessKeyId'
|
|
51
|
+
},
|
|
52
|
+
fileNameOverride: 'reports/monthly-report.pdf',
|
|
53
|
+
contentType: 'application/pdf'
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
console.log(`File uploaded to: ${uploadedFile.getS3Key()}`);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```typescript Locator trigger
|
|
61
|
+
import { saveFileToS3 } from "@intuned/browser";
|
|
62
|
+
export default async function handler(params, page, context){
|
|
63
|
+
// Click download link and save to S3
|
|
64
|
+
await page.goto("https://sandbox.intuned.dev/pdfs")
|
|
65
|
+
const uploadedFile = await saveFileToS3({
|
|
66
|
+
page,
|
|
67
|
+
trigger: page.locator("xpath=//tbody/tr[1]//*[name()='svg']"),
|
|
68
|
+
timeoutInMs: 10000,
|
|
69
|
+
configs: {
|
|
70
|
+
bucket: 'invoice-archive',
|
|
71
|
+
region: 'us-west-2',
|
|
72
|
+
accessKeyId: 'accessKeyId',
|
|
73
|
+
secretAccessKey: 'SecretAccessKeyId'
|
|
74
|
+
},
|
|
75
|
+
fileNameOverride: 'invoices/invoice.pdf',
|
|
76
|
+
contentType: 'application/pdf'
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Generate temporary access URL
|
|
80
|
+
const downloadUrl = await uploadedFile.getSignedUrl(7200); // 2 hours
|
|
81
|
+
console.log(`Temporary access: ${downloadUrl}`);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
</CodeGroup>
|
|
86
|
+
|
|
87
|
+
## Arguments
|
|
88
|
+
|
|
89
|
+
<ParamField path="input" type="Object" required
|
|
90
|
+
>
|
|
91
|
+
Configuration object for the download and upload operation
|
|
92
|
+
|
|
93
|
+
<Expandable title="input">
|
|
94
|
+
<ParamField path="input.page" type="Page">
|
|
95
|
+
The Playwright Page object to use for downloading
|
|
96
|
+
</ParamField>
|
|
97
|
+
|
|
98
|
+
<ParamField path="input.trigger" type="Trigger">
|
|
99
|
+
The [Trigger](../type-aliases/Trigger) method to initiate the download:
|
|
100
|
+
- **URL string**: Navigate directly to a download URL
|
|
101
|
+
- **Locator**: Click on an element to trigger download
|
|
102
|
+
- **Callback function**: Execute custom logic to initiate download
|
|
103
|
+
</ParamField>
|
|
104
|
+
|
|
105
|
+
<ParamField path="input.timeoutInMs" type="number">
|
|
106
|
+
Maximum time in milliseconds to wait for download completion. Defaults to 5000.
|
|
107
|
+
</ParamField>
|
|
108
|
+
|
|
109
|
+
<ParamField path="input.configs" type="S3Configs">
|
|
110
|
+
Optional [S3Configs](../interfaces/S3Configs) to customize the S3 upload
|
|
111
|
+
</ParamField>
|
|
112
|
+
|
|
113
|
+
<ParamField path="input.fileNameOverride" type="string">
|
|
114
|
+
Optional filename override for the uploaded file
|
|
115
|
+
</ParamField>
|
|
116
|
+
|
|
117
|
+
<ParamField path="input.contentType" type="string">
|
|
118
|
+
Optional content type for the uploaded file
|
|
119
|
+
</ParamField>
|
|
120
|
+
|
|
121
|
+
</Expandable>
|
|
122
|
+
|
|
123
|
+
</ParamField>
|
|
124
|
+
|
|
125
|
+
## Returns: `Promise<Attachment>`
|
|
126
|
+
|
|
127
|
+
Promise that resolves to an [Attachment](../interfaces/Attachment) object with file metadata and S3 utilities
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: scrollToLoadContent
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export declare function scrollToLoadContent(input: {
|
|
8
|
+
source: Page | Locator;
|
|
9
|
+
onScrollProgress?: CallableFunction;
|
|
10
|
+
scrollableContainer?: Locator | null;
|
|
11
|
+
maxScrolls?: number;
|
|
12
|
+
delayInMs?: number;
|
|
13
|
+
minHeightChange?: number;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Automatically scrolls through infinite scroll content by repeatedly scrolling to the bottom
|
|
18
|
+
until no new content loads or maximum scroll limit is reached.
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
<CodeGroup>
|
|
23
|
+
|
|
24
|
+
```typescript Basic Infinite Scroll
|
|
25
|
+
import { scrollToLoadContent } from "@intuned/browser";
|
|
26
|
+
export default async function handler(params, page, context){
|
|
27
|
+
// Scroll through entire page content
|
|
28
|
+
await page.goto("https://docs.intunedhq.com/docs-old/getting-started/introduction")
|
|
29
|
+
await scrollToLoadContent({
|
|
30
|
+
source: page,
|
|
31
|
+
});
|
|
32
|
+
// Now all content is loaded and visible
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```typescript Scroll Specific Container
|
|
37
|
+
import { scrollToLoadContent } from "@intuned/browser";
|
|
38
|
+
export default async function handler(params, page, context){
|
|
39
|
+
// Scroll through a specific scrollable div
|
|
40
|
+
await page.goto("https://docs.intunedhq.com/docs-old/getting-started/introduction")
|
|
41
|
+
const container = page.locator("xpath=//div[@id='sidebar-content']");
|
|
42
|
+
await scrollToLoadContent({
|
|
43
|
+
source: page,
|
|
44
|
+
scrollableContainer: container,
|
|
45
|
+
maxScrolls: 20
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
</CodeGroup>
|
|
51
|
+
|
|
52
|
+
## Arguments
|
|
53
|
+
|
|
54
|
+
<ParamField path="input" type="Object" required
|
|
55
|
+
>
|
|
56
|
+
The input object containing the data to scroll to load content
|
|
57
|
+
|
|
58
|
+
<Expandable title="input">
|
|
59
|
+
<ParamField path="input.source" type="Page | Locator">
|
|
60
|
+
The Playwright Page or Locator to scroll
|
|
61
|
+
</ParamField>
|
|
62
|
+
|
|
63
|
+
<ParamField path="input.onScrollProgress" type="Function">
|
|
64
|
+
Optional callback function to call during each scroll iteration
|
|
65
|
+
</ParamField>
|
|
66
|
+
|
|
67
|
+
<ParamField path="input.scrollableContainer" type="Locator">
|
|
68
|
+
Specific scrollable element to scroll within. If not provided, scrolls the entire page
|
|
69
|
+
</ParamField>
|
|
70
|
+
|
|
71
|
+
<ParamField path="input.maxScrolls" type="number">
|
|
72
|
+
Maximum number of scroll attempts before stopping. Defaults to 50
|
|
73
|
+
</ParamField>
|
|
74
|
+
|
|
75
|
+
<ParamField path="input.delayInMs" type="number">
|
|
76
|
+
Delay in milliseconds between scroll attempts. Defaults to 100
|
|
77
|
+
</ParamField>
|
|
78
|
+
|
|
79
|
+
<ParamField path="input.minHeightChange" type="number">
|
|
80
|
+
Minimum height change in pixels required to continue scrolling. Defaults to 100
|
|
81
|
+
</ParamField>
|
|
82
|
+
|
|
83
|
+
</Expandable>
|
|
84
|
+
|
|
85
|
+
</ParamField>
|
|
86
|
+
|
|
87
|
+
## Returns: `Promise<void>`
|
|
88
|
+
|
|
89
|
+
Promise that resolves when scrolling is complete
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: uploadFileToS3
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export declare function uploadFileToS3(input: {
|
|
8
|
+
file: FileType;
|
|
9
|
+
configs?: S3Configs;
|
|
10
|
+
fileNameOverride?: string;
|
|
11
|
+
contentType?: string;
|
|
12
|
+
}): Promise<Attachment>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
<Note>
|
|
16
|
+
**S3 Configuration Priority:**
|
|
17
|
+
1. **Explicit configs**: Values provided in `input.configs.s3Configs`
|
|
18
|
+
2. **Environment variables**: Standard AWS environment variables:
|
|
19
|
+
- `AWS_BUCKET`
|
|
20
|
+
- `AWS_REGION`
|
|
21
|
+
- `AWS_ACCESS_KEY_ID`
|
|
22
|
+
- `AWS_SECRET_ACCESS_KEY`
|
|
23
|
+
- `AWS_ENDPOINT_URL`
|
|
24
|
+
3. **Default fallback**: Intuned's default S3 configuration
|
|
25
|
+
</Note>
|
|
26
|
+
|
|
27
|
+
Uploads files to AWS S3 storage with flexible configuration options.
|
|
28
|
+
|
|
29
|
+
This function accepts various file types including Playwright Download objects, binary data,
|
|
30
|
+
and file streams, making it versatile for different upload scenarios. It automatically
|
|
31
|
+
handles file metadata and provides comprehensive S3 configuration options.
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
<CodeGroup>
|
|
36
|
+
|
|
37
|
+
```typescript Upload Downloaded File
|
|
38
|
+
import { downloadFile, uploadFileToS3 } from "@intuned/browser";
|
|
39
|
+
export default async function handler(params, page, context){
|
|
40
|
+
// Download and upload a file with custom S3 configuration
|
|
41
|
+
await page.goto("https://sandbox.intuned.dev/pdfs")
|
|
42
|
+
const download = await downloadFile({
|
|
43
|
+
page,
|
|
44
|
+
trigger: page.locator("xpath=//tbody/tr[1]//*[name()='svg']")
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const uploadedFile = await uploadFileToS3({
|
|
48
|
+
file: download,
|
|
49
|
+
configs: {
|
|
50
|
+
bucket: 'my-documents',
|
|
51
|
+
region: 'us-west-2',
|
|
52
|
+
accessKeyId: 'accessKeyId',
|
|
53
|
+
secretAccessKey: 'SecretAccessKeyId'
|
|
54
|
+
},
|
|
55
|
+
fileNameOverride: 'reports/monthly-report.pdf'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
console.log(`File uploaded: ${uploadedFile.suggestedFileName}`);
|
|
60
|
+
console.log(`S3 URL: ${uploadedFile.getS3Key()}`);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```typescript Upload Binary Data
|
|
65
|
+
import { uploadFileToS3 } from "@intuned/browser";
|
|
66
|
+
export default async function handler(params, page, context){
|
|
67
|
+
// Upload binary data with minimal configuration
|
|
68
|
+
const fileBuffer = Buffer.from('Hello World', 'utf8');
|
|
69
|
+
const uploadedFile = await uploadFileToS3({
|
|
70
|
+
file: fileBuffer,
|
|
71
|
+
configs: {
|
|
72
|
+
bucket: 'my-documents',
|
|
73
|
+
region: 'us-west-2',
|
|
74
|
+
accessKeyId: 'accessKeyId',
|
|
75
|
+
secretAccessKey: 'SecretAccessKeyId'
|
|
76
|
+
},
|
|
77
|
+
fileNameOverride: 'data/text-file.txt',
|
|
78
|
+
contentType: 'text/plain'
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Generate a temporary download URL
|
|
83
|
+
const downloadUrl = await uploadedFile.getSignedUrl(3600); // 1 hour
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</CodeGroup>
|
|
88
|
+
|
|
89
|
+
## Arguments
|
|
90
|
+
|
|
91
|
+
<ParamField path="input" type="Object" required
|
|
92
|
+
>
|
|
93
|
+
Configuration object for the upload operation
|
|
94
|
+
|
|
95
|
+
<Expandable title="input">
|
|
96
|
+
<ParamField path="input.file" type="FileType">
|
|
97
|
+
The file to upload. Accepts [FileType](../type-aliases/FileType) types including:
|
|
98
|
+
- Playwright Download objects (from `downloadFile`)
|
|
99
|
+
- Uint8Array or Buffer (binary data)
|
|
100
|
+
- ReadStream (file streams)
|
|
101
|
+
</ParamField>
|
|
102
|
+
|
|
103
|
+
<ParamField path="input.configs" type="S3Configs">
|
|
104
|
+
Optional [S3Configs](../interfaces/S3Configs) for customizing the S3 upload. If not provided, uses environment variables or default configuration
|
|
105
|
+
</ParamField>
|
|
106
|
+
|
|
107
|
+
<ParamField path="input.fileNameOverride" type="string">
|
|
108
|
+
Optional custom filename for the uploaded file. If not provided, uses the original filename
|
|
109
|
+
</ParamField>
|
|
110
|
+
|
|
111
|
+
<ParamField path="input.contentType" type="string">
|
|
112
|
+
Optional MIME type for the uploaded file (e.g., "application/pdf", "image/png")
|
|
113
|
+
</ParamField>
|
|
114
|
+
|
|
115
|
+
</Expandable>
|
|
116
|
+
|
|
117
|
+
</ParamField>
|
|
118
|
+
|
|
119
|
+
## Returns: `Promise<Attachment>`
|
|
120
|
+
|
|
121
|
+
Promise that resolves to an [Attachment](../interfaces/Attachment) object with file metadata and utility methods
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: validateDataUsingSchema
|
|
3
|
+
description: ""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export declare function validateDataUsingSchema(input: {
|
|
8
|
+
data: Record<string, any>[] | Record<string, any>;
|
|
9
|
+
schema: Record<string, any>;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Validates data against a JSON schema using the AJV validator.
|
|
14
|
+
This function can validate any given data against a given schema. It supports validating custom data types such as the [Attachment](../interfaces/Attachment) type.
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
<CodeGroup>
|
|
19
|
+
|
|
20
|
+
```typescript Basic User Data Validation
|
|
21
|
+
import { validateDataUsingSchema } from "@intuned/browser";
|
|
22
|
+
export default async function handler(params, page, context){
|
|
23
|
+
const userData = {
|
|
24
|
+
name: "John Doe",
|
|
25
|
+
email: "john@example.com",
|
|
26
|
+
age: 30
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const userSchema = {
|
|
30
|
+
type: "object",
|
|
31
|
+
required: ["name", "email", "age"],
|
|
32
|
+
properties: {
|
|
33
|
+
name: { type: "string", minLength: 1 },
|
|
34
|
+
email: { type: "string", format: "email" },
|
|
35
|
+
age: { type: "number", minimum: 0 }
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
await validateDataUsingSchema({ data: userData, schema: userSchema });
|
|
40
|
+
// Validation passes, no error thrown
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```typescript Invalid Data Validation
|
|
45
|
+
import { validateDataUsingSchema } from "@intuned/browser";
|
|
46
|
+
export default async function handler(params, page, context){
|
|
47
|
+
const userData = {
|
|
48
|
+
name: "John Doe",
|
|
49
|
+
email: "john@example.com",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const userSchema = {
|
|
53
|
+
type: "object",
|
|
54
|
+
required: ["name", "email", "age"],
|
|
55
|
+
properties: {
|
|
56
|
+
name: { type: "string", minLength: 1 },
|
|
57
|
+
email: { type: "string", format: "email" },
|
|
58
|
+
age: { type: "number", minimum: 0 }
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
await validateDataUsingSchema({ data: userData, schema: userSchema });
|
|
63
|
+
// Validation fails, throws ValidationError
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
</CodeGroup>
|
|
68
|
+
|
|
69
|
+
## Arguments
|
|
70
|
+
|
|
71
|
+
<ParamField path="input" type="Object" required
|
|
72
|
+
>
|
|
73
|
+
The input object containing data and schema
|
|
74
|
+
|
|
75
|
+
<Expandable title="input">
|
|
76
|
+
<ParamField path="input.data" type="Record<string, any> | Array<Record<string, any>>">
|
|
77
|
+
The data to validate. Can be a single data object or an array of data objects
|
|
78
|
+
</ParamField>
|
|
79
|
+
|
|
80
|
+
<ParamField path="input.schema" type="Record<string, any>">
|
|
81
|
+
JSON schema object defining validation rules
|
|
82
|
+
</ParamField>
|
|
83
|
+
|
|
84
|
+
</Expandable>
|
|
85
|
+
|
|
86
|
+
</ParamField>
|
|
87
|
+
|
|
88
|
+
## Returns: `Promise<void>`
|
|
89
|
+
|
|
90
|
+
Promise that resolves if validation passes, throws ValidationError if it fails
|