From a5e2e470fd8592e828ae406c36fb3bca3b1f7e11 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Wed, 3 Sep 2025 17:43:29 +0200 Subject: [PATCH 1/4] Add autofill trigger command --- src/bidiMapper/BidiNoOpParser.ts | 7 + src/bidiMapper/BidiParser.ts | 5 + src/bidiMapper/CommandProcessor.ts | 12 + .../modules/autofill/AutofillProcessor.ts | 59 + src/bidiTab/BidiParser.ts | 7 + .../generated/webdriver-bidi.ts | 2642 +++++------------ src/protocol/ErrorResponse.spec.ts | 1 + src/protocol/generated/webdriver-bidi.ts | 2367 ++++++--------- 8 files changed, 1629 insertions(+), 3471 deletions(-) create mode 100644 src/bidiMapper/modules/autofill/AutofillProcessor.ts diff --git a/src/bidiMapper/BidiNoOpParser.ts b/src/bidiMapper/BidiNoOpParser.ts index 96dfe5d1aa..6f75383d58 100644 --- a/src/bidiMapper/BidiNoOpParser.ts +++ b/src/bidiMapper/BidiNoOpParser.ts @@ -33,6 +33,13 @@ import type { import type {BidiCommandParameterParser} from './BidiParser.js'; export class BidiNoOpParser implements BidiCommandParameterParser { + // Autofill module + // keep-sorted start block=yes + parseAutofillTriggerParams(params: unknown): Autofill.TriggerParameters { + return params as Autofill.TriggerParameters; + } + // keep-sorted end + // Bluetooth module // keep-sorted start block=yes parseDisableSimulationParameters( diff --git a/src/bidiMapper/BidiParser.ts b/src/bidiMapper/BidiParser.ts index 83c85e933c..41807f7c26 100644 --- a/src/bidiMapper/BidiParser.ts +++ b/src/bidiMapper/BidiParser.ts @@ -31,6 +31,11 @@ import type { } from '../protocol/protocol.js'; export interface BidiCommandParameterParser { + // Autofill module + // keep-sorted start block=yes + parseAutofillTriggerParams(params: unknown): Autofill.TriggerParameters; + // keep-sorted end + // Bluetooth module // keep-sorted start block=yes parseDisableSimulationParameters( diff --git a/src/bidiMapper/CommandProcessor.ts b/src/bidiMapper/CommandProcessor.ts index bbda9760f1..a15879066b 100644 --- a/src/bidiMapper/CommandProcessor.ts +++ b/src/bidiMapper/CommandProcessor.ts @@ -32,6 +32,7 @@ import type {Result} from '../utils/result.js'; import {BidiNoOpParser} from './BidiNoOpParser.js'; import type {BidiCommandParameterParser} from './BidiParser.js'; import type {MapperOptions} from './MapperOptions.js'; +import {AutofillProcessor} from './modules/autofill/AutofillProcessor.js'; import type {BluetoothProcessor} from './modules/bluetooth/BluetoothProcessor.js'; import {BrowserProcessor} from './modules/browser/BrowserProcessor.js'; import type {ContextConfigStorage} from './modules/browser/ContextConfigStorage.js'; @@ -66,6 +67,7 @@ interface CommandProcessorEventsMap extends Record { export class CommandProcessor extends EventEmitter { // keep-sorted start + #autofillProcessor: AutofillProcessor; #bluetoothProcessor: BluetoothProcessor; #browserCdpClient: CdpClient; #browserProcessor: BrowserProcessor; @@ -105,6 +107,7 @@ export class CommandProcessor extends EventEmitter { this.#logger = logger; this.#bluetoothProcessor = bluetoothProcessor; + this.#autofillProcessor = new AutofillProcessor(browserCdpClient); // keep-sorted start block=yes this.#browserProcessor = new BrowserProcessor( @@ -165,8 +168,17 @@ export class CommandProcessor extends EventEmitter { command: ChromiumBidi.Command, ): Promise { switch (command.method) { + // Autofill module + // keep-sorted start block=yes + case 'autofill.trigger': + return await this.#autofillProcessor.trigger( + this.#parser.parseAutofillTriggerParams(command.params), + ); + // keep-sorted end + // Bluetooth module // keep-sorted start block=yes + case 'bluetooth.disableSimulation': return await this.#bluetoothProcessor.disableSimulation( this.#parser.parseDisableSimulationParameters(command.params), diff --git a/src/bidiMapper/modules/autofill/AutofillProcessor.ts b/src/bidiMapper/modules/autofill/AutofillProcessor.ts new file mode 100644 index 0000000000..a1b9a4461a --- /dev/null +++ b/src/bidiMapper/modules/autofill/AutofillProcessor.ts @@ -0,0 +1,59 @@ +/** + * Copyright 2025 Google LLC. + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type {CdpClient} from '../../../cdp/CdpClient.js'; +import { + type Autofill, + type EmptyResult, + UnsupportedOperationException, +} from '../../../protocol/protocol.js'; + +/** + * Responsible for handling the `autofill` module. + */ +export class AutofillProcessor { + readonly #browserCdpClient: CdpClient; + + constructor(browserCdpClient: CdpClient) { + this.#browserCdpClient = browserCdpClient; + } + + /** + * Triggers autofill for a specific element with the provided field data. + * + * @param params Parameters for the autofill.trigger command + * @returns An empty result + */ + async trigger(params: Autofill.TriggerParameters): Promise { + try { + await this.#browserCdpClient.sendCommand('Autofill.trigger', { + fieldId: Number(params.element.sharedId), + frameId: undefined, + card: params.card, + address: params.address + }); + return {}; + } catch (err) { + if ((err as Error).message.includes('command was not found')) { + throw new UnsupportedOperationException( + 'Autofill.trigger() is not supported by this browser', + ); + } + throw err; + } + } +} \ No newline at end of file diff --git a/src/bidiTab/BidiParser.ts b/src/bidiTab/BidiParser.ts index e55993efeb..d1f9119f74 100644 --- a/src/bidiTab/BidiParser.ts +++ b/src/bidiTab/BidiParser.ts @@ -32,6 +32,13 @@ import type { import * as Parser from '../protocol-parser/protocol-parser.js'; export class BidiParser implements BidiCommandParameterParser { + // Autofill module + // keep-sorted start block=yes + parseAutofillTriggerParams(params: unknown): Autofill.TriggerParameters { + return Parser.Autofill.parseTriggerParameters(params); + } + // keep-sorted end + // Bluetooth module // keep-sorted start block=yes parseDisableSimulationParameters( diff --git a/src/protocol-parser/generated/webdriver-bidi.ts b/src/protocol-parser/generated/webdriver-bidi.ts index e1baaf10d1..ce248afde7 100644 --- a/src/protocol-parser/generated/webdriver-bidi.ts +++ b/src/protocol-parser/generated/webdriver-bidi.ts @@ -1,3 +1,4 @@ + /** * Copyright 2024 Google LLC. * Copyright (c) Microsoft Corporation. @@ -195,363 +196,200 @@ export namespace Session { ); } export namespace Session { - export const AutodetectProxyConfigurationSchema = z.lazy(() => - z - .object({ - proxyType: z.literal('autodetect'), - }) - .and(ExtensibleSchema), - ); +export const +AutodetectProxyConfigurationSchema = z.lazy(() => z.object({ +"proxyType":z.literal("autodetect")}).and( +ExtensibleSchema) +); } export namespace Session { - export const DirectProxyConfigurationSchema = z.lazy(() => - z - .object({ - proxyType: z.literal('direct'), - }) - .and(ExtensibleSchema), - ); +export const +DirectProxyConfigurationSchema = z.lazy(() => z.object({ +"proxyType":z.literal("direct")}).and( +ExtensibleSchema) +); } export namespace Session { - export const ManualProxyConfigurationSchema = z.lazy(() => - z - .object({ - proxyType: z.literal('manual'), - httpProxy: z.string().optional(), - sslProxy: z.string().optional(), - }) - .and(Session.SocksProxyConfigurationSchema.or(z.object({}))) - .and( - z.object({ - noProxy: z.array(z.string()).optional(), - }), - ) - .and(ExtensibleSchema), - ); +export const +ManualProxyConfigurationSchema = z.lazy(() => z.object({ +"proxyType":z.literal("manual"),"httpProxy":z.string().optional(),"sslProxy":z.string().optional()}).and( +Session.SocksProxyConfigurationSchema.or(z.object({}))) +.and( +z.object({ +"noProxy":z.array(z.string()).optional()})) +.and( +ExtensibleSchema) +); } export namespace Session { - export const SocksProxyConfigurationSchema = z.lazy(() => - z.object({ - socksProxy: z.string(), - socksVersion: z.number().int().nonnegative().gte(0).lte(255), - }), - ); +export const +SocksProxyConfigurationSchema = z.lazy(() => z.object({ +"socksProxy":z.string(),"socksVersion":z.number().int().nonnegative().gte(0).lte(255)})); } export namespace Session { - export const PacProxyConfigurationSchema = z.lazy(() => - z - .object({ - proxyType: z.literal('pac'), - proxyAutoconfigUrl: z.string(), - }) - .and(ExtensibleSchema), - ); +export const +PacProxyConfigurationSchema = z.lazy(() => z.object({ +"proxyType":z.literal("pac"),"proxyAutoconfigUrl":z.string()}).and( +ExtensibleSchema) +); } export namespace Session { - export const SystemProxyConfigurationSchema = z.lazy(() => - z - .object({ - proxyType: z.literal('system'), - }) - .and(ExtensibleSchema), - ); +export const +SystemProxyConfigurationSchema = z.lazy(() => z.object({ +"proxyType":z.literal("system")}).and( +ExtensibleSchema) +); } export namespace Session { - export const UserPromptHandlerSchema = z.lazy(() => - z.object({ - alert: Session.UserPromptHandlerTypeSchema.optional(), - beforeUnload: Session.UserPromptHandlerTypeSchema.optional(), - confirm: Session.UserPromptHandlerTypeSchema.optional(), - default: Session.UserPromptHandlerTypeSchema.optional(), - file: Session.UserPromptHandlerTypeSchema.optional(), - prompt: Session.UserPromptHandlerTypeSchema.optional(), - }), - ); +export const UserPromptHandlerSchema = z.lazy(() => z.object({ +"alert":Session.UserPromptHandlerTypeSchema.optional(),"beforeUnload":Session.UserPromptHandlerTypeSchema.optional(),"confirm":Session.UserPromptHandlerTypeSchema.optional(),"default":Session.UserPromptHandlerTypeSchema.optional(),"file":Session.UserPromptHandlerTypeSchema.optional(),"prompt":Session.UserPromptHandlerTypeSchema.optional()})); } export namespace Session { - export const UserPromptHandlerTypeSchema = z.lazy(() => - z.enum(['accept', 'dismiss', 'ignore']), - ); +export const UserPromptHandlerTypeSchema = z.lazy(() => z.enum(["accept","dismiss","ignore",])); } export namespace Session { - export const SubscriptionSchema = z.lazy(() => z.string()); +export const SubscriptionSchema = z.lazy(() => z.string()); } export namespace Session { - export const SubscriptionRequestSchema = z.lazy(() => - z.object({ - events: z.array(z.string()).min(1), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SubscriptionRequestSchema = z.lazy(() => z.object({ +"events":z.array(z.string()).min(1),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Session { - export const UnsubscribeByIdRequestSchema = z.lazy(() => - z.object({ - subscriptions: z.array(Session.SubscriptionSchema).min(1), - }), - ); +export const UnsubscribeByIdRequestSchema = z.lazy(() => z.object({ +"subscriptions":z.array(Session.SubscriptionSchema).min(1)})); } export namespace Session { - export const UnsubscribeByAttributesRequestSchema = z.lazy(() => - z.object({ - events: z.array(z.string()).min(1), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - }), - ); +export const UnsubscribeByAttributesRequestSchema = z.lazy(() => z.object({ +"events":z.array(z.string()).min(1),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional()})); } export namespace Session { - export const StatusSchema = z.lazy(() => - z.object({ - method: z.literal('session.status'), - params: EmptyParamsSchema, - }), - ); +export const +StatusSchema = z.lazy(() => z.object({ +"method":z.literal("session.status"),"params":EmptyParamsSchema})); } export namespace Session { - export const StatusResultSchema = z.lazy(() => - z.object({ - ready: z.boolean(), - message: z.string(), - }), - ); +export const StatusResultSchema = z.lazy(() => z.object({ +"ready":z.boolean(),"message":z.string()})); } export namespace Session { - export const NewSchema = z.lazy(() => - z.object({ - method: z.literal('session.new'), - params: Session.NewParametersSchema, - }), - ); +export const +NewSchema = z.lazy(() => z.object({ +"method":z.literal("session.new"),"params":Session.NewParametersSchema})); } export namespace Session { - export const NewParametersSchema = z.lazy(() => - z.object({ - capabilities: Session.CapabilitiesRequestSchema, - }), - ); +export const NewParametersSchema = z.lazy(() => z.object({ +"capabilities":Session.CapabilitiesRequestSchema})); } export namespace Session { - export const NewResultSchema = z.lazy(() => - z.object({ - sessionId: z.string(), - capabilities: z - .object({ - acceptInsecureCerts: z.boolean(), - browserName: z.string(), - browserVersion: z.string(), - platformName: z.string(), - setWindowRect: z.boolean(), - userAgent: z.string(), - proxy: Session.ProxyConfigurationSchema.optional(), - unhandledPromptBehavior: Session.UserPromptHandlerSchema.optional(), - webSocketUrl: z.string().optional(), - }) - .and(ExtensibleSchema), - }), - ); +export const NewResultSchema = z.lazy(() => z.object({ +"sessionId":z.string(),"capabilities":z.object({ +"acceptInsecureCerts":z.boolean(),"browserName":z.string(),"browserVersion":z.string(),"platformName":z.string(),"setWindowRect":z.boolean(),"userAgent":z.string(),"proxy":Session.ProxyConfigurationSchema.optional(),"unhandledPromptBehavior":Session.UserPromptHandlerSchema.optional(),"webSocketUrl":z.string().optional()}).and( +ExtensibleSchema) +})); } export namespace Session { - export const EndSchema = z.lazy(() => - z.object({ - method: z.literal('session.end'), - params: EmptyParamsSchema, - }), - ); +export const +EndSchema = z.lazy(() => z.object({ +"method":z.literal("session.end"),"params":EmptyParamsSchema})); } export namespace Session { - export const SubscribeSchema = z.lazy(() => - z.object({ - method: z.literal('session.subscribe'), - params: Session.SubscriptionRequestSchema, - }), - ); +export const +SubscribeSchema = z.lazy(() => z.object({ +"method":z.literal("session.subscribe"),"params":Session.SubscriptionRequestSchema})); } export namespace Session { - export const SubscribeResultSchema = z.lazy(() => - z.object({ - subscription: Session.SubscriptionSchema, - }), - ); +export const SubscribeResultSchema = z.lazy(() => z.object({ +"subscription":Session.SubscriptionSchema})); } export namespace Session { - export const UnsubscribeSchema = z.lazy(() => - z.object({ - method: z.literal('session.unsubscribe'), - params: Session.UnsubscribeParametersSchema, - }), - ); +export const +UnsubscribeSchema = z.lazy(() => z.object({ +"method":z.literal("session.unsubscribe"),"params":Session.UnsubscribeParametersSchema})); } export namespace Session { - export const UnsubscribeParametersSchema = z.lazy(() => - z.union([ - Session.UnsubscribeByAttributesRequestSchema, - Session.UnsubscribeByIdRequestSchema, - ]), - ); +export const UnsubscribeParametersSchema = z.lazy(() => z.union([Session.UnsubscribeByAttributesRequestSchema,Session.UnsubscribeByIdRequestSchema])); } -export const BrowserCommandSchema = z.lazy(() => - z.union([ - Browser.CloseSchema, - Browser.CreateUserContextSchema, - Browser.GetClientWindowsSchema, - Browser.GetUserContextsSchema, - Browser.RemoveUserContextSchema, - Browser.SetClientWindowStateSchema, - ]), -); -export const BrowserResultSchema = z.lazy(() => - z.union([ - Browser.CreateUserContextResultSchema, - Browser.GetUserContextsResultSchema, - ]), -); +export const +BrowserCommandSchema = z.lazy(() => z.union([Browser.CloseSchema,Browser.CreateUserContextSchema,Browser.GetClientWindowsSchema,Browser.GetUserContextsSchema,Browser.RemoveUserContextSchema,Browser.SetClientWindowStateSchema])); +export const BrowserResultSchema = z.lazy(() => z.union([Browser.CreateUserContextResultSchema,Browser.GetUserContextsResultSchema])); export namespace Browser { - export const ClientWindowSchema = z.lazy(() => z.string()); +export const ClientWindowSchema = z.lazy(() => z.string()); } export namespace Browser { - export const ClientWindowInfoSchema = z.lazy(() => - z.object({ - active: z.boolean(), - clientWindow: Browser.ClientWindowSchema, - height: JsUintSchema, - state: z.enum(['fullscreen', 'maximized', 'minimized', 'normal']), - width: JsUintSchema, - x: JsIntSchema, - y: JsIntSchema, - }), - ); +export const ClientWindowInfoSchema = z.lazy(() => z.object({ +"active":z.boolean(),"clientWindow":Browser.ClientWindowSchema,"height":JsUintSchema,"state":z.enum(["fullscreen","maximized","minimized","normal",]),"width":JsUintSchema,"x":JsIntSchema,"y":JsIntSchema})); } export namespace Browser { - export const UserContextSchema = z.lazy(() => z.string()); +export const UserContextSchema = z.lazy(() => z.string()); } export namespace Browser { - export const UserContextInfoSchema = z.lazy(() => - z.object({ - userContext: Browser.UserContextSchema, - }), - ); +export const UserContextInfoSchema = z.lazy(() => z.object({ +"userContext":Browser.UserContextSchema})); } export namespace Browser { - export const CloseSchema = z.lazy(() => - z.object({ - method: z.literal('browser.close'), - params: EmptyParamsSchema, - }), - ); +export const +CloseSchema = z.lazy(() => z.object({ +"method":z.literal("browser.close"),"params":EmptyParamsSchema})); } export namespace Browser { - export const CreateUserContextSchema = z.lazy(() => - z.object({ - method: z.literal('browser.createUserContext'), - params: Browser.CreateUserContextParametersSchema, - }), - ); +export const +CreateUserContextSchema = z.lazy(() => z.object({ +"method":z.literal("browser.createUserContext"),"params":Browser.CreateUserContextParametersSchema})); } export namespace Browser { - export const CreateUserContextParametersSchema = z.lazy(() => - z.object({ - acceptInsecureCerts: z.boolean().optional(), - proxy: Session.ProxyConfigurationSchema.optional(), - unhandledPromptBehavior: Session.UserPromptHandlerSchema.optional(), - }), - ); +export const CreateUserContextParametersSchema = z.lazy(() => z.object({ +"acceptInsecureCerts":z.boolean().optional(),"proxy":Session.ProxyConfigurationSchema.optional(),"unhandledPromptBehavior":Session.UserPromptHandlerSchema.optional()})); } export namespace Browser { - export const CreateUserContextResultSchema = z.lazy( - () => Browser.UserContextInfoSchema, - ); +export const CreateUserContextResultSchema = z.lazy(() => Browser.UserContextInfoSchema); } export namespace Browser { - export const GetClientWindowsSchema = z.lazy(() => - z.object({ - method: z.literal('browser.getClientWindows'), - params: EmptyParamsSchema, - }), - ); +export const +GetClientWindowsSchema = z.lazy(() => z.object({ +"method":z.literal("browser.getClientWindows"),"params":EmptyParamsSchema})); } export namespace Browser { - export const GetClientWindowsResultSchema = z.lazy(() => - z.object({ - clientWindows: z.array(Browser.ClientWindowInfoSchema), - }), - ); +export const GetClientWindowsResultSchema = z.lazy(() => z.object({ +"clientWindows":z.array(Browser.ClientWindowInfoSchema)})); } export namespace Browser { - export const GetUserContextsSchema = z.lazy(() => - z.object({ - method: z.literal('browser.getUserContexts'), - params: EmptyParamsSchema, - }), - ); +export const +GetUserContextsSchema = z.lazy(() => z.object({ +"method":z.literal("browser.getUserContexts"),"params":EmptyParamsSchema})); } export namespace Browser { - export const GetUserContextsResultSchema = z.lazy(() => - z.object({ - userContexts: z.array(Browser.UserContextInfoSchema).min(1), - }), - ); +export const GetUserContextsResultSchema = z.lazy(() => z.object({ +"userContexts":z.array(Browser.UserContextInfoSchema).min(1)})); } export namespace Browser { - export const RemoveUserContextSchema = z.lazy(() => - z.object({ - method: z.literal('browser.removeUserContext'), - params: Browser.RemoveUserContextParametersSchema, - }), - ); +export const +RemoveUserContextSchema = z.lazy(() => z.object({ +"method":z.literal("browser.removeUserContext"),"params":Browser.RemoveUserContextParametersSchema})); } export namespace Browser { - export const RemoveUserContextParametersSchema = z.lazy(() => - z.object({ - userContext: Browser.UserContextSchema, - }), - ); +export const RemoveUserContextParametersSchema = z.lazy(() => z.object({ +"userContext":Browser.UserContextSchema})); } export namespace Browser { - export const SetClientWindowStateSchema = z.lazy(() => - z.object({ - method: z.literal('browser.setClientWindowState'), - params: Browser.SetClientWindowStateParametersSchema, - }), - ); +export const +SetClientWindowStateSchema = z.lazy(() => z.object({ +"method":z.literal("browser.setClientWindowState"),"params":Browser.SetClientWindowStateParametersSchema})); } export namespace Browser { - export const SetClientWindowStateParametersSchema = z.lazy(() => - z - .object({ - clientWindow: Browser.ClientWindowSchema, - }) - .and( - z.union([ - Browser.ClientWindowNamedStateSchema, - Browser.ClientWindowRectStateSchema, - ]), - ), - ); +export const SetClientWindowStateParametersSchema = z.lazy(() => z.object({ +"clientWindow":Browser.ClientWindowSchema}).and( +z.union([Browser.ClientWindowNamedStateSchema,Browser.ClientWindowRectStateSchema])) +); } export namespace Browser { - export const ClientWindowNamedStateSchema = z.lazy(() => - z.object({ - state: z.enum(['fullscreen', 'maximized', 'minimized']), - }), - ); +export const +ClientWindowNamedStateSchema = z.lazy(() => z.object({ +"state":z.enum(["fullscreen","maximized","minimized",])})); } export namespace Browser { - export const ClientWindowRectStateSchema = z.lazy(() => - z.object({ - state: z.literal('normal'), - width: JsUintSchema.optional(), - height: JsUintSchema.optional(), - x: JsIntSchema.optional(), - y: JsIntSchema.optional(), - }), - ); +export const +ClientWindowRectStateSchema = z.lazy(() => z.object({ +"state":z.literal("normal"),"width":JsUintSchema.optional(),"height":JsUintSchema.optional(),"x":JsIntSchema.optional(),"y":JsIntSchema.optional()})); } export const BrowsingContextCommandSchema = z.lazy(() => z.union([ @@ -599,132 +437,65 @@ export const BrowsingContextEventSchema = z.lazy(() => ]), ); export namespace BrowsingContext { - export const BrowsingContextSchema = z.lazy(() => z.string()); +export const BrowsingContextSchema = z.lazy(() => z.string()); } export namespace BrowsingContext { - export const InfoListSchema = z.lazy(() => - z.array(BrowsingContext.InfoSchema), - ); +export const InfoListSchema = z.lazy(() => z.array(BrowsingContext.InfoSchema)); } export namespace BrowsingContext { - export const InfoSchema = z.lazy(() => - z.object({ - children: z.union([BrowsingContext.InfoListSchema, z.null()]), - clientWindow: Browser.ClientWindowSchema, - context: BrowsingContext.BrowsingContextSchema, - originalOpener: z.union([ - BrowsingContext.BrowsingContextSchema, - z.null(), - ]), - url: z.string(), - userContext: Browser.UserContextSchema, - parent: z - .union([BrowsingContext.BrowsingContextSchema, z.null()]) - .optional(), - }), - ); +export const InfoSchema = z.lazy(() => z.object({ +"children":z.union([BrowsingContext.InfoListSchema,z.null()]),"clientWindow":Browser.ClientWindowSchema,"context":BrowsingContext.BrowsingContextSchema,"originalOpener":z.union([BrowsingContext.BrowsingContextSchema,z.null()]),"url":z.string(),"userContext":Browser.UserContextSchema,"parent":z.union([BrowsingContext.BrowsingContextSchema,z.null()]).optional()})); } export namespace BrowsingContext { - export const LocatorSchema = z.lazy(() => - z.union([ - BrowsingContext.AccessibilityLocatorSchema, - BrowsingContext.CssLocatorSchema, - BrowsingContext.ContextLocatorSchema, - BrowsingContext.InnerTextLocatorSchema, - BrowsingContext.XPathLocatorSchema, - ]), - ); +export const LocatorSchema = z.lazy(() => z.union([BrowsingContext.AccessibilityLocatorSchema,BrowsingContext.CssLocatorSchema,BrowsingContext.ContextLocatorSchema,BrowsingContext.InnerTextLocatorSchema,BrowsingContext.XPathLocatorSchema])); } export namespace BrowsingContext { - export const AccessibilityLocatorSchema = z.lazy(() => - z.object({ - type: z.literal('accessibility'), - value: z.object({ - name: z.string().optional(), - role: z.string().optional(), - }), - }), - ); +export const AccessibilityLocatorSchema = z.lazy(() => z.object({ +"type":z.literal("accessibility"),"value":z.object({ +"name":z.string().optional(),"role":z.string().optional()})})); } export namespace BrowsingContext { - export const CssLocatorSchema = z.lazy(() => - z.object({ - type: z.literal('css'), - value: z.string(), - }), - ); +export const CssLocatorSchema = z.lazy(() => z.object({ +"type":z.literal("css"),"value":z.string()})); } export namespace BrowsingContext { - export const ContextLocatorSchema = z.lazy(() => - z.object({ - type: z.literal('context'), - value: z.object({ - context: BrowsingContext.BrowsingContextSchema, - }), - }), - ); +export const ContextLocatorSchema = z.lazy(() => z.object({ +"type":z.literal("context"),"value":z.object({ +"context":BrowsingContext.BrowsingContextSchema})})); } export namespace BrowsingContext { - export const InnerTextLocatorSchema = z.lazy(() => - z.object({ - type: z.literal('innerText'), - value: z.string(), - ignoreCase: z.boolean().optional(), - matchType: z.enum(['full', 'partial']).optional(), - maxDepth: JsUintSchema.optional(), - }), - ); +export const InnerTextLocatorSchema = z.lazy(() => z.object({ +"type":z.literal("innerText"),"value":z.string(),"ignoreCase":z.boolean().optional(),"matchType":z.enum(["full","partial",]).optional(),"maxDepth":JsUintSchema.optional()})); } export namespace BrowsingContext { - export const XPathLocatorSchema = z.lazy(() => - z.object({ - type: z.literal('xpath'), - value: z.string(), - }), - ); +export const XPathLocatorSchema = z.lazy(() => z.object({ +"type":z.literal("xpath"),"value":z.string()})); } export namespace BrowsingContext { - export const NavigationSchema = z.lazy(() => z.string()); +export const NavigationSchema = z.lazy(() => z.string()); } export namespace BrowsingContext { - export const BaseNavigationInfoSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), - timestamp: JsUintSchema, - url: z.string(), - }), - ); +export const +BaseNavigationInfoSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"timestamp":JsUintSchema,"url":z.string()})); } export namespace BrowsingContext { - export const NavigationInfoSchema = z.lazy( - () => BrowsingContext.BaseNavigationInfoSchema, - ); +export const NavigationInfoSchema = z.lazy(() => BrowsingContext.BaseNavigationInfoSchema); } export namespace BrowsingContext { - export const ReadinessStateSchema = z.lazy(() => - z.enum(['none', 'interactive', 'complete']), - ); +export const ReadinessStateSchema = z.lazy(() => z.enum(["none","interactive","complete",])); } export namespace BrowsingContext { - export const UserPromptTypeSchema = z.lazy(() => - z.enum(['alert', 'beforeunload', 'confirm', 'prompt']), - ); +export const UserPromptTypeSchema = z.lazy(() => z.enum(["alert","beforeunload","confirm","prompt",])); } export namespace BrowsingContext { - export const ActivateSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.activate'), - params: BrowsingContext.ActivateParametersSchema, - }), - ); +export const +ActivateSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.activate"),"params":BrowsingContext.ActivateParametersSchema})); } export namespace BrowsingContext { - export const ActivateParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - }), - ); +export const ActivateParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema})); } export namespace BrowsingContext { export const CaptureScreenshotSchema = z.lazy(() => @@ -745,130 +516,70 @@ export namespace BrowsingContext { ); } export namespace BrowsingContext { - export const ImageFormatSchema = z.lazy(() => - z.object({ - type: z.string(), - quality: z.number().gte(0).lte(1).optional(), - }), - ); +export const ImageFormatSchema = z.lazy(() => z.object({ +"type":z.string(),"quality":z.number().gte(0).lte(1).optional()})); } export namespace BrowsingContext { - export const ClipRectangleSchema = z.lazy(() => - z.union([ - BrowsingContext.BoxClipRectangleSchema, - BrowsingContext.ElementClipRectangleSchema, - ]), - ); +export const ClipRectangleSchema = z.lazy(() => z.union([BrowsingContext.BoxClipRectangleSchema,BrowsingContext.ElementClipRectangleSchema])); } export namespace BrowsingContext { - export const ElementClipRectangleSchema = z.lazy(() => - z.object({ - type: z.literal('element'), - element: Script.SharedReferenceSchema, - }), - ); +export const ElementClipRectangleSchema = z.lazy(() => z.object({ +"type":z.literal("element"),"element":Script.SharedReferenceSchema})); } export namespace BrowsingContext { - export const BoxClipRectangleSchema = z.lazy(() => - z.object({ - type: z.literal('box'), - x: z.number(), - y: z.number(), - width: z.number(), - height: z.number(), - }), - ); +export const BoxClipRectangleSchema = z.lazy(() => z.object({ +"type":z.literal("box"),"x":z.number(),"y":z.number(),"width":z.number(),"height":z.number()})); } export namespace BrowsingContext { - export const CaptureScreenshotResultSchema = z.lazy(() => - z.object({ - data: z.string(), - }), - ); +export const CaptureScreenshotResultSchema = z.lazy(() => z.object({ +"data":z.string()})); } export namespace BrowsingContext { - export const CloseSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.close'), - params: BrowsingContext.CloseParametersSchema, - }), - ); +export const +CloseSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.close"),"params":BrowsingContext.CloseParametersSchema})); } export namespace BrowsingContext { - export const CloseParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - promptUnload: z.boolean().default(false).optional(), - }), - ); +export const CloseParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"promptUnload":z.boolean().default(false).optional()})); } export namespace BrowsingContext { - export const CreateSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.create'), - params: BrowsingContext.CreateParametersSchema, - }), - ); +export const +CreateSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.create"),"params":BrowsingContext.CreateParametersSchema})); } export namespace BrowsingContext { - export const CreateTypeSchema = z.lazy(() => z.enum(['tab', 'window'])); +export const CreateTypeSchema = z.lazy(() => z.enum(["tab","window",])); } export namespace BrowsingContext { - export const CreateParametersSchema = z.lazy(() => - z.object({ - type: BrowsingContext.CreateTypeSchema, - referenceContext: BrowsingContext.BrowsingContextSchema.optional(), - background: z.boolean().default(false).optional(), - userContext: Browser.UserContextSchema.optional(), - }), - ); +export const CreateParametersSchema = z.lazy(() => z.object({ +"type":BrowsingContext.CreateTypeSchema,"referenceContext":BrowsingContext.BrowsingContextSchema.optional(),"background":z.boolean().default(false).optional(),"userContext":Browser.UserContextSchema.optional()})); } export namespace BrowsingContext { - export const CreateResultSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - }), - ); +export const CreateResultSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema})); } export namespace BrowsingContext { - export const GetTreeSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.getTree'), - params: BrowsingContext.GetTreeParametersSchema, - }), - ); +export const +GetTreeSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.getTree"),"params":BrowsingContext.GetTreeParametersSchema})); } export namespace BrowsingContext { - export const GetTreeParametersSchema = z.lazy(() => - z.object({ - maxDepth: JsUintSchema.optional(), - root: BrowsingContext.BrowsingContextSchema.optional(), - }), - ); +export const GetTreeParametersSchema = z.lazy(() => z.object({ +"maxDepth":JsUintSchema.optional(),"root":BrowsingContext.BrowsingContextSchema.optional()})); } export namespace BrowsingContext { - export const GetTreeResultSchema = z.lazy(() => - z.object({ - contexts: BrowsingContext.InfoListSchema, - }), - ); +export const GetTreeResultSchema = z.lazy(() => z.object({ +"contexts":BrowsingContext.InfoListSchema})); } export namespace BrowsingContext { - export const HandleUserPromptSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.handleUserPrompt'), - params: BrowsingContext.HandleUserPromptParametersSchema, - }), - ); +export const +HandleUserPromptSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.handleUserPrompt"),"params":BrowsingContext.HandleUserPromptParametersSchema})); } export namespace BrowsingContext { - export const HandleUserPromptParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - accept: z.boolean().optional(), - userText: z.string().optional(), - }), - ); +export const HandleUserPromptParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"accept":z.boolean().optional(),"userText":z.string().optional()})); } export namespace BrowsingContext { export const LocateNodesSchema = z.lazy(() => @@ -890,521 +601,263 @@ export namespace BrowsingContext { ); } export namespace BrowsingContext { - export const LocateNodesResultSchema = z.lazy(() => - z.object({ - nodes: z.array(Script.NodeRemoteValueSchema), - }), - ); +export const LocateNodesResultSchema = z.lazy(() => z.object({ +"nodes":z.array(Script.NodeRemoteValueSchema)})); } export namespace BrowsingContext { - export const NavigateSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.navigate'), - params: BrowsingContext.NavigateParametersSchema, - }), - ); +export const +NavigateSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.navigate"),"params":BrowsingContext.NavigateParametersSchema})); } export namespace BrowsingContext { - export const NavigateParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - url: z.string(), - wait: BrowsingContext.ReadinessStateSchema.optional(), - }), - ); +export const NavigateParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"url":z.string(),"wait":BrowsingContext.ReadinessStateSchema.optional()})); } export namespace BrowsingContext { - export const NavigateResultSchema = z.lazy(() => - z.object({ - navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), - url: z.string(), - }), - ); +export const NavigateResultSchema = z.lazy(() => z.object({ +"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"url":z.string()})); } export namespace BrowsingContext { - export const PrintSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.print'), - params: BrowsingContext.PrintParametersSchema, - }), - ); +export const +PrintSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.print"),"params":BrowsingContext.PrintParametersSchema})); } export namespace BrowsingContext { - export const PrintParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - background: z.boolean().default(false).optional(), - margin: BrowsingContext.PrintMarginParametersSchema.optional(), - orientation: z - .enum(['portrait', 'landscape']) - .default('portrait') - .optional(), - page: BrowsingContext.PrintPageParametersSchema.optional(), - pageRanges: z.array(z.union([JsUintSchema, z.string()])).optional(), - scale: z.number().gte(0.1).lte(2).default(1).optional(), - shrinkToFit: z.boolean().default(true).optional(), - }), - ); +export const PrintParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"background":z.boolean().default(false).optional(),"margin":BrowsingContext.PrintMarginParametersSchema.optional(),"orientation":z.enum(["portrait","landscape",]).default("portrait").optional(),"page":BrowsingContext.PrintPageParametersSchema.optional(),"pageRanges":z.array(z.union([JsUintSchema,z.string()])).optional(),"scale":z.number().gte(0.1).lte(2).default(1).optional(),"shrinkToFit":z.boolean().default(true).optional()})); } export namespace BrowsingContext { - export const PrintMarginParametersSchema = z.lazy(() => - z.object({ - bottom: z.number().gte(0).default(1).optional(), - left: z.number().gte(0).default(1).optional(), - right: z.number().gte(0).default(1).optional(), - top: z.number().gte(0).default(1).optional(), - }), - ); +export const PrintMarginParametersSchema = z.lazy(() => z.object({ +"bottom":z.number().gte(0).default(1).optional(),"left":z.number().gte(0).default(1).optional(),"right":z.number().gte(0).default(1).optional(),"top":z.number().gte(0).default(1).optional()})); } export namespace BrowsingContext { - export const PrintPageParametersSchema = z.lazy(() => - z.object({ - height: z.number().gte(0.0352).default(27.94).optional(), - width: z.number().gte(0.0352).default(21.59).optional(), - }), - ); +export const PrintPageParametersSchema = z.lazy(() => z.object({ +"height":z.number().gte(0.0352).default(27.94).optional(),"width":z.number().gte(0.0352).default(21.59).optional()})); } export namespace BrowsingContext { - export const PrintResultSchema = z.lazy(() => - z.object({ - data: z.string(), - }), - ); +export const PrintResultSchema = z.lazy(() => z.object({ +"data":z.string()})); } export namespace BrowsingContext { - export const ReloadSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.reload'), - params: BrowsingContext.ReloadParametersSchema, - }), - ); +export const +ReloadSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.reload"),"params":BrowsingContext.ReloadParametersSchema})); } export namespace BrowsingContext { - export const ReloadParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - ignoreCache: z.boolean().optional(), - wait: BrowsingContext.ReadinessStateSchema.optional(), - }), - ); +export const ReloadParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"ignoreCache":z.boolean().optional(),"wait":BrowsingContext.ReadinessStateSchema.optional()})); } export namespace BrowsingContext { - export const SetViewportSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.setViewport'), - params: BrowsingContext.SetViewportParametersSchema, - }), - ); +export const +SetViewportSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.setViewport"),"params":BrowsingContext.SetViewportParametersSchema})); } export namespace BrowsingContext { - export const SetViewportParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema.optional(), - viewport: z.union([BrowsingContext.ViewportSchema, z.null()]).optional(), - devicePixelRatio: z.union([z.number().gt(0), z.null()]).optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetViewportParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema.optional(),"viewport":z.union([BrowsingContext.ViewportSchema,z.null()]).optional(),"devicePixelRatio":z.union([z.number().gt(0),z.null()]).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace BrowsingContext { - export const ViewportSchema = z.lazy(() => - z.object({ - width: JsUintSchema, - height: JsUintSchema, - }), - ); +export const ViewportSchema = z.lazy(() => z.object({ +"width":JsUintSchema,"height":JsUintSchema})); } export namespace BrowsingContext { - export const TraverseHistorySchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.traverseHistory'), - params: BrowsingContext.TraverseHistoryParametersSchema, - }), - ); +export const +TraverseHistorySchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.traverseHistory"),"params":BrowsingContext.TraverseHistoryParametersSchema})); } export namespace BrowsingContext { - export const TraverseHistoryParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - delta: JsIntSchema, - }), - ); +export const TraverseHistoryParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"delta":JsIntSchema})); } export namespace BrowsingContext { - export const TraverseHistoryResultSchema = z.lazy(() => z.object({})); +export const TraverseHistoryResultSchema = z.lazy(() => z.object({ +})); } export namespace BrowsingContext { - export const ContextCreatedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.contextCreated'), - params: BrowsingContext.InfoSchema, - }), - ); +export const +ContextCreatedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.contextCreated"),"params":BrowsingContext.InfoSchema})); } export namespace BrowsingContext { - export const ContextDestroyedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.contextDestroyed'), - params: BrowsingContext.InfoSchema, - }), - ); +export const +ContextDestroyedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.contextDestroyed"),"params":BrowsingContext.InfoSchema})); } export namespace BrowsingContext { - export const NavigationStartedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.navigationStarted'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +NavigationStartedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.navigationStarted"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const FragmentNavigatedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.fragmentNavigated'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +FragmentNavigatedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.fragmentNavigated"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const HistoryUpdatedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.historyUpdated'), - params: BrowsingContext.HistoryUpdatedParametersSchema, - }), - ); +export const +HistoryUpdatedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.historyUpdated"),"params":BrowsingContext.HistoryUpdatedParametersSchema})); } export namespace BrowsingContext { - export const HistoryUpdatedParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - timestamp: JsUintSchema, - url: z.string(), - }), - ); +export const HistoryUpdatedParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"timestamp":JsUintSchema,"url":z.string()})); } export namespace BrowsingContext { - export const DomContentLoadedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.domContentLoaded'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +DomContentLoadedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.domContentLoaded"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const LoadSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.load'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +LoadSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.load"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const DownloadWillBeginSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.downloadWillBegin'), - params: BrowsingContext.DownloadWillBeginParamsSchema, - }), - ); +export const +DownloadWillBeginSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.downloadWillBegin"),"params":BrowsingContext.DownloadWillBeginParamsSchema})); } export namespace BrowsingContext { - export const DownloadWillBeginParamsSchema = z.lazy(() => - z - .object({ - suggestedFilename: z.string(), - }) - .and(BrowsingContext.BaseNavigationInfoSchema), - ); +export const DownloadWillBeginParamsSchema = z.lazy(() => z.object({ +"suggestedFilename":z.string()}).and( +BrowsingContext.BaseNavigationInfoSchema) +); } export namespace BrowsingContext { - export const DownloadEndSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.downloadEnd'), - params: BrowsingContext.DownloadEndParamsSchema, - }), - ); +export const +DownloadEndSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.downloadEnd"),"params":BrowsingContext.DownloadEndParamsSchema})); } export namespace BrowsingContext { - export const DownloadEndParamsSchema = z.lazy(() => - z.union([ - BrowsingContext.DownloadCanceledParamsSchema, - BrowsingContext.DownloadCompleteParamsSchema, - ]), - ); +export const DownloadEndParamsSchema = z.lazy(() => z.union([BrowsingContext.DownloadCanceledParamsSchema,BrowsingContext.DownloadCompleteParamsSchema])); } export namespace BrowsingContext { - export const DownloadCanceledParamsSchema = z.lazy(() => - z - .object({ - status: z.literal('canceled'), - }) - .and(BrowsingContext.BaseNavigationInfoSchema), - ); +export const +DownloadCanceledParamsSchema = z.lazy(() => z.object({ +"status":z.literal("canceled")}).and( +BrowsingContext.BaseNavigationInfoSchema) +); } export namespace BrowsingContext { - export const DownloadCompleteParamsSchema = z.lazy(() => - z - .object({ - status: z.literal('complete'), - filepath: z.union([z.string(), z.null()]), - }) - .and(BrowsingContext.BaseNavigationInfoSchema), - ); +export const +DownloadCompleteParamsSchema = z.lazy(() => z.object({ +"status":z.literal("complete"),"filepath":z.union([z.string(),z.null()])}).and( +BrowsingContext.BaseNavigationInfoSchema) +); } export namespace BrowsingContext { - export const NavigationAbortedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.navigationAborted'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +NavigationAbortedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.navigationAborted"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const NavigationCommittedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.navigationCommitted'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +NavigationCommittedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.navigationCommitted"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const NavigationFailedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.navigationFailed'), - params: BrowsingContext.NavigationInfoSchema, - }), - ); +export const +NavigationFailedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.navigationFailed"),"params":BrowsingContext.NavigationInfoSchema})); } export namespace BrowsingContext { - export const UserPromptClosedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.userPromptClosed'), - params: BrowsingContext.UserPromptClosedParametersSchema, - }), - ); +export const +UserPromptClosedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.userPromptClosed"),"params":BrowsingContext.UserPromptClosedParametersSchema})); } export namespace BrowsingContext { - export const UserPromptClosedParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - accepted: z.boolean(), - type: BrowsingContext.UserPromptTypeSchema, - userText: z.string().optional(), - }), - ); +export const UserPromptClosedParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"accepted":z.boolean(),"type":BrowsingContext.UserPromptTypeSchema,"userText":z.string().optional()})); } export namespace BrowsingContext { - export const UserPromptOpenedSchema = z.lazy(() => - z.object({ - method: z.literal('browsingContext.userPromptOpened'), - params: BrowsingContext.UserPromptOpenedParametersSchema, - }), - ); +export const +UserPromptOpenedSchema = z.lazy(() => z.object({ +"method":z.literal("browsingContext.userPromptOpened"),"params":BrowsingContext.UserPromptOpenedParametersSchema})); } export namespace BrowsingContext { - export const UserPromptOpenedParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - handler: Session.UserPromptHandlerTypeSchema, - message: z.string(), - type: BrowsingContext.UserPromptTypeSchema, - defaultValue: z.string().optional(), - }), - ); +export const UserPromptOpenedParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"handler":Session.UserPromptHandlerTypeSchema,"message":z.string(),"type":BrowsingContext.UserPromptTypeSchema,"defaultValue":z.string().optional()})); } -export const EmulationCommandSchema = z.lazy(() => - z.union([ - Emulation.SetForcedColorsModeThemeOverrideSchema, - Emulation.SetGeolocationOverrideSchema, - Emulation.SetLocaleOverrideSchema, - Emulation.SetScreenOrientationOverrideSchema, - Emulation.SetScriptingEnabledSchema, - Emulation.SetTimezoneOverrideSchema, - ]), -); +export const +EmulationCommandSchema = z.lazy(() => z.union([Emulation.SetForcedColorsModeThemeOverrideSchema,Emulation.SetGeolocationOverrideSchema,Emulation.SetLocaleOverrideSchema,Emulation.SetScreenOrientationOverrideSchema,Emulation.SetScriptingEnabledSchema,Emulation.SetTimezoneOverrideSchema])); export namespace Emulation { - export const SetForcedColorsModeThemeOverrideSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setForcedColorsModeThemeOverride'), - params: Emulation.SetForcedColorsModeThemeOverrideParametersSchema, - }), - ); +export const +SetForcedColorsModeThemeOverrideSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setForcedColorsModeThemeOverride"),"params":Emulation.SetForcedColorsModeThemeOverrideParametersSchema})); } export namespace Emulation { - export const SetForcedColorsModeThemeOverrideParametersSchema = z.lazy(() => - z.object({ - theme: z.union([Emulation.ForcedColorsModeThemeSchema, z.null()]), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetForcedColorsModeThemeOverrideParametersSchema = z.lazy(() => z.object({ +"theme":z.union([Emulation.ForcedColorsModeThemeSchema,z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Emulation { - export const ForcedColorsModeThemeSchema = z.lazy(() => - z.enum(['light', 'dark']), - ); +export const ForcedColorsModeThemeSchema = z.lazy(() => z.enum(["light","dark",])); } export namespace Emulation { - export const SetGeolocationOverrideSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setGeolocationOverride'), - params: Emulation.SetGeolocationOverrideParametersSchema, - }), - ); +export const +SetGeolocationOverrideSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setGeolocationOverride"),"params":Emulation.SetGeolocationOverrideParametersSchema})); } export namespace Emulation { - export const SetGeolocationOverrideParametersSchema = z.lazy(() => - z - .union([ - z.object({ - coordinates: z.union([ - Emulation.GeolocationCoordinatesSchema, - z.null(), - ]), - }), - z.object({ - error: Emulation.GeolocationPositionErrorSchema, - }), - ]) - .and( - z.object({ - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ), - ); +export const SetGeolocationOverrideParametersSchema = z.lazy(() => z.union([z.object({ +"coordinates":z.union([Emulation.GeolocationCoordinatesSchema,z.null()])}),z.object({ +"error":Emulation.GeolocationPositionErrorSchema})]).and( +z.object({ +"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})) +); } export namespace Emulation { - export const GeolocationCoordinatesSchema = z.lazy(() => - z.object({ - latitude: z.number().gte(-90).lte(90), - longitude: z.number().gte(-180).lte(180), - accuracy: z.number().gte(0).default(1).optional(), - altitude: z.union([z.number(), z.null().default(null)]).optional(), - altitudeAccuracy: z - .union([z.number().gte(0), z.null().default(null)]) - .optional(), - heading: z - .union([z.number().gt(0).lt(360), z.null().default(null)]) - .optional(), - speed: z.union([z.number().gte(0), z.null().default(null)]).optional(), - }), - ); +export const GeolocationCoordinatesSchema = z.lazy(() => z.object({ +"latitude":z.number().gte(-90).lte(90),"longitude":z.number().gte(-180).lte(180),"accuracy":z.number().gte(0).default(1).optional(),"altitude":z.union([z.number(),z.null().default(null)]).optional(),"altitudeAccuracy":z.union([z.number().gte(0),z.null().default(null)]).optional(),"heading":z.union([z.number().gt(0).lt(360),z.null().default(null)]).optional(),"speed":z.union([z.number().gte(0),z.null().default(null)]).optional()})); } export namespace Emulation { - export const GeolocationPositionErrorSchema = z.lazy(() => - z.object({ - type: z.literal('positionUnavailable'), - }), - ); +export const GeolocationPositionErrorSchema = z.lazy(() => z.object({ +"type":z.literal("positionUnavailable")})); } export namespace Emulation { - export const SetLocaleOverrideSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setLocaleOverride'), - params: Emulation.SetLocaleOverrideParametersSchema, - }), - ); +export const +SetLocaleOverrideSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setLocaleOverride"),"params":Emulation.SetLocaleOverrideParametersSchema})); } export namespace Emulation { - export const SetLocaleOverrideParametersSchema = z.lazy(() => - z.object({ - locale: z.union([z.string(), z.null()]), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetLocaleOverrideParametersSchema = z.lazy(() => z.object({ +"locale":z.union([z.string(),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Emulation { - export const SetScreenOrientationOverrideSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setScreenOrientationOverride'), - params: Emulation.SetScreenOrientationOverrideParametersSchema, - }), - ); +export const +SetScreenOrientationOverrideSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setScreenOrientationOverride"),"params":Emulation.SetScreenOrientationOverrideParametersSchema})); } export namespace Emulation { - export const ScreenOrientationNaturalSchema = z.lazy(() => - z.enum(['portrait', 'landscape']), - ); +export const ScreenOrientationNaturalSchema = z.lazy(() => z.enum(["portrait","landscape",])); } export namespace Emulation { - export const ScreenOrientationTypeSchema = z.lazy(() => - z.enum([ - 'portrait-primary', - 'portrait-secondary', - 'landscape-primary', - 'landscape-secondary', - ]), - ); +export const ScreenOrientationTypeSchema = z.lazy(() => z.enum(["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary",])); } export namespace Emulation { - export const ScreenOrientationSchema = z.lazy(() => - z.object({ - natural: Emulation.ScreenOrientationNaturalSchema, - type: Emulation.ScreenOrientationTypeSchema, - }), - ); +export const ScreenOrientationSchema = z.lazy(() => z.object({ +"natural":Emulation.ScreenOrientationNaturalSchema,"type":Emulation.ScreenOrientationTypeSchema})); } export namespace Emulation { - export const SetScreenOrientationOverrideParametersSchema = z.lazy(() => - z.object({ - screenOrientation: z.union([Emulation.ScreenOrientationSchema, z.null()]), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetScreenOrientationOverrideParametersSchema = z.lazy(() => z.object({ +"screenOrientation":z.union([Emulation.ScreenOrientationSchema,z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Emulation { - export const SetScriptingEnabledSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setScriptingEnabled'), - params: Emulation.SetScriptingEnabledParametersSchema, - }), - ); +export const +SetScriptingEnabledSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setScriptingEnabled"),"params":Emulation.SetScriptingEnabledParametersSchema})); } export namespace Emulation { - export const SetScriptingEnabledParametersSchema = z.lazy(() => - z.object({ - enabled: z.union([z.literal(false), z.null()]), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetScriptingEnabledParametersSchema = z.lazy(() => z.object({ +"enabled":z.union([z.literal(false),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Emulation { - export const SetTimezoneOverrideSchema = z.lazy(() => - z.object({ - method: z.literal('emulation.setTimezoneOverride'), - params: Emulation.SetTimezoneOverrideParametersSchema, - }), - ); +export const +SetTimezoneOverrideSchema = z.lazy(() => z.object({ +"method":z.literal("emulation.setTimezoneOverride"),"params":Emulation.SetTimezoneOverrideParametersSchema})); } export namespace Emulation { - export const SetTimezoneOverrideParametersSchema = z.lazy(() => - z.object({ - timezone: z.union([z.string(), z.null()]), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const SetTimezoneOverrideParametersSchema = z.lazy(() => z.object({ +"timezone":z.union([z.string(),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export const NetworkCommandSchema = z.lazy(() => z.union([ @@ -1434,250 +887,110 @@ export const NetworkEventSchema = z.lazy(() => Network.ResponseCompletedSchema, Network.ResponseStartedSchema, ]), -); -export namespace Network { - export const AuthChallengeSchema = z.lazy(() => - z.object({ - scheme: z.string(), - realm: z.string(), - }), - ); +); +export namespace Network { +export const AuthChallengeSchema = z.lazy(() => z.object({ +"scheme":z.string(),"realm":z.string()})); } export namespace Network { - export const AuthCredentialsSchema = z.lazy(() => - z.object({ - type: z.literal('password'), - username: z.string(), - password: z.string(), - }), - ); +export const AuthCredentialsSchema = z.lazy(() => z.object({ +"type":z.literal("password"),"username":z.string(),"password":z.string()})); } export namespace Network { - export const BaseParametersSchema = z.lazy(() => - z.object({ - context: z.union([BrowsingContext.BrowsingContextSchema, z.null()]), - isBlocked: z.boolean(), - navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), - redirectCount: JsUintSchema, - request: Network.RequestDataSchema, - timestamp: JsUintSchema, - intercepts: z.array(Network.InterceptSchema).min(1).optional(), - }), - ); +export const +BaseParametersSchema = z.lazy(() => z.object({ +"context":z.union([BrowsingContext.BrowsingContextSchema,z.null()]),"isBlocked":z.boolean(),"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"redirectCount":JsUintSchema,"request":Network.RequestDataSchema,"timestamp":JsUintSchema,"intercepts":z.array(Network.InterceptSchema).min(1).optional()})); } export namespace Network { - export const BytesValueSchema = z.lazy(() => - z.union([Network.StringValueSchema, Network.Base64ValueSchema]), - ); +export const BytesValueSchema = z.lazy(() => z.union([Network.StringValueSchema,Network.Base64ValueSchema])); } export namespace Network { - export const StringValueSchema = z.lazy(() => - z.object({ - type: z.literal('string'), - value: z.string(), - }), - ); +export const StringValueSchema = z.lazy(() => z.object({ +"type":z.literal("string"),"value":z.string()})); } export namespace Network { - export const Base64ValueSchema = z.lazy(() => - z.object({ - type: z.literal('base64'), - value: z.string(), - }), - ); +export const Base64ValueSchema = z.lazy(() => z.object({ +"type":z.literal("base64"),"value":z.string()})); } export namespace Network { - export const CollectorSchema = z.lazy(() => z.string()); +export const CollectorSchema = z.lazy(() => z.string()); } export namespace Network { - export const CollectorTypeSchema = z.literal('blob'); +export const CollectorTypeSchema = z.literal("blob"); } export namespace Network { - export const SameSiteSchema = z.lazy(() => - z.enum(['strict', 'lax', 'none', 'default']), - ); +export const SameSiteSchema = z.lazy(() => z.enum(["strict","lax","none","default",])); } export namespace Network { - export const CookieSchema = z.lazy(() => - z - .object({ - name: z.string(), - value: Network.BytesValueSchema, - domain: z.string(), - path: z.string(), - size: JsUintSchema, - httpOnly: z.boolean(), - secure: z.boolean(), - sameSite: Network.SameSiteSchema, - expiry: JsUintSchema.optional(), - }) - .and(ExtensibleSchema), - ); +export const CookieSchema = z.lazy(() => z.object({ +"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string(),"path":z.string(),"size":JsUintSchema,"httpOnly":z.boolean(),"secure":z.boolean(),"sameSite":Network.SameSiteSchema,"expiry":JsUintSchema.optional()}).and( +ExtensibleSchema) +); } export namespace Network { - export const CookieHeaderSchema = z.lazy(() => - z.object({ - name: z.string(), - value: Network.BytesValueSchema, - }), - ); +export const CookieHeaderSchema = z.lazy(() => z.object({ +"name":z.string(),"value":Network.BytesValueSchema})); } export namespace Network { - export const DataTypeSchema = z.literal('response'); +export const DataTypeSchema = z.literal("response"); } export namespace Network { - export const FetchTimingInfoSchema = z.lazy(() => - z.object({ - timeOrigin: z.number(), - requestTime: z.number(), - redirectStart: z.number(), - redirectEnd: z.number(), - fetchStart: z.number(), - dnsStart: z.number(), - dnsEnd: z.number(), - connectStart: z.number(), - connectEnd: z.number(), - tlsStart: z.number(), - requestStart: z.number(), - responseStart: z.number(), - responseEnd: z.number(), - }), - ); +export const FetchTimingInfoSchema = z.lazy(() => z.object({ +"timeOrigin":z.number(),"requestTime":z.number(),"redirectStart":z.number(),"redirectEnd":z.number(),"fetchStart":z.number(),"dnsStart":z.number(),"dnsEnd":z.number(),"connectStart":z.number(),"connectEnd":z.number(),"tlsStart":z.number(),"requestStart":z.number(),"responseStart":z.number(),"responseEnd":z.number()})); } export namespace Network { - export const HeaderSchema = z.lazy(() => - z.object({ - name: z.string(), - value: Network.BytesValueSchema, - }), - ); +export const HeaderSchema = z.lazy(() => z.object({ +"name":z.string(),"value":Network.BytesValueSchema})); } export namespace Network { - export const InitiatorSchema = z.lazy(() => - z.object({ - columnNumber: JsUintSchema.optional(), - lineNumber: JsUintSchema.optional(), - request: Network.RequestSchema.optional(), - stackTrace: Script.StackTraceSchema.optional(), - type: z.enum(['parser', 'script', 'preflight', 'other']).optional(), - }), - ); +export const InitiatorSchema = z.lazy(() => z.object({ +"columnNumber":JsUintSchema.optional(),"lineNumber":JsUintSchema.optional(),"request":Network.RequestSchema.optional(),"stackTrace":Script.StackTraceSchema.optional(),"type":z.enum(["parser","script","preflight","other",]).optional()})); } export namespace Network { - export const InterceptSchema = z.lazy(() => z.string()); +export const InterceptSchema = z.lazy(() => z.string()); } export namespace Network { - export const RequestSchema = z.lazy(() => z.string()); +export const RequestSchema = z.lazy(() => z.string()); } export namespace Network { - export const RequestDataSchema = z.lazy(() => - z.object({ - request: Network.RequestSchema, - url: z.string(), - method: z.string(), - headers: z.array(Network.HeaderSchema), - cookies: z.array(Network.CookieSchema), - headersSize: JsUintSchema, - bodySize: z.union([JsUintSchema, z.null()]), - destination: z.string(), - initiatorType: z.union([z.string(), z.null()]), - timings: Network.FetchTimingInfoSchema, - }), - ); +export const RequestDataSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema,"url":z.string(),"method":z.string(),"headers":z.array(Network.HeaderSchema),"cookies":z.array(Network.CookieSchema),"headersSize":JsUintSchema,"bodySize":z.union([JsUintSchema,z.null()]),"destination":z.string(),"initiatorType":z.union([z.string(),z.null()]),"timings":Network.FetchTimingInfoSchema})); } export namespace Network { - export const ResponseContentSchema = z.lazy(() => - z.object({ - size: JsUintSchema, - }), - ); +export const ResponseContentSchema = z.lazy(() => z.object({ +"size":JsUintSchema})); } export namespace Network { - export const ResponseDataSchema = z.lazy(() => - z.object({ - url: z.string(), - protocol: z.string(), - status: JsUintSchema, - statusText: z.string(), - fromCache: z.boolean(), - headers: z.array(Network.HeaderSchema), - mimeType: z.string(), - bytesReceived: JsUintSchema, - headersSize: z.union([JsUintSchema, z.null()]), - bodySize: z.union([JsUintSchema, z.null()]), - content: Network.ResponseContentSchema, - authChallenges: z.array(Network.AuthChallengeSchema).optional(), - }), - ); +export const ResponseDataSchema = z.lazy(() => z.object({ +"url":z.string(),"protocol":z.string(),"status":JsUintSchema,"statusText":z.string(),"fromCache":z.boolean(),"headers":z.array(Network.HeaderSchema),"mimeType":z.string(),"bytesReceived":JsUintSchema,"headersSize":z.union([JsUintSchema,z.null()]),"bodySize":z.union([JsUintSchema,z.null()]),"content":Network.ResponseContentSchema,"authChallenges":z.array(Network.AuthChallengeSchema).optional()})); } export namespace Network { - export const SetCookieHeaderSchema = z.lazy(() => - z.object({ - name: z.string(), - value: Network.BytesValueSchema, - domain: z.string().optional(), - httpOnly: z.boolean().optional(), - expiry: z.string().optional(), - maxAge: JsIntSchema.optional(), - path: z.string().optional(), - sameSite: Network.SameSiteSchema.optional(), - secure: z.boolean().optional(), - }), - ); +export const SetCookieHeaderSchema = z.lazy(() => z.object({ +"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string().optional(),"httpOnly":z.boolean().optional(),"expiry":z.string().optional(),"maxAge":JsIntSchema.optional(),"path":z.string().optional(),"sameSite":Network.SameSiteSchema.optional(),"secure":z.boolean().optional()})); } export namespace Network { - export const UrlPatternSchema = z.lazy(() => - z.union([Network.UrlPatternPatternSchema, Network.UrlPatternStringSchema]), - ); +export const UrlPatternSchema = z.lazy(() => z.union([Network.UrlPatternPatternSchema,Network.UrlPatternStringSchema])); } export namespace Network { - export const UrlPatternPatternSchema = z.lazy(() => - z.object({ - type: z.literal('pattern'), - protocol: z.string().optional(), - hostname: z.string().optional(), - port: z.string().optional(), - pathname: z.string().optional(), - search: z.string().optional(), - }), - ); +export const UrlPatternPatternSchema = z.lazy(() => z.object({ +"type":z.literal("pattern"),"protocol":z.string().optional(),"hostname":z.string().optional(),"port":z.string().optional(),"pathname":z.string().optional(),"search":z.string().optional()})); } export namespace Network { - export const UrlPatternStringSchema = z.lazy(() => - z.object({ - type: z.literal('string'), - pattern: z.string(), - }), - ); +export const UrlPatternStringSchema = z.lazy(() => z.object({ +"type":z.literal("string"),"pattern":z.string()})); } export namespace Network { - export const AddDataCollectorSchema = z.lazy(() => - z.object({ - method: z.literal('network.addDataCollector'), - params: Network.AddDataCollectorParametersSchema, - }), - ); +export const +AddDataCollectorSchema = z.lazy(() => z.object({ +"method":z.literal("network.addDataCollector"),"params":Network.AddDataCollectorParametersSchema})); } export namespace Network { - export const AddDataCollectorParametersSchema = z.lazy(() => - z.object({ - dataTypes: z.array(Network.DataTypeSchema).min(1), - maxEncodedDataSize: JsUintSchema, - collectorType: Network.CollectorTypeSchema.default('blob').optional(), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - }), - ); +export const AddDataCollectorParametersSchema = z.lazy(() => z.object({ +"dataTypes":z.array(Network.DataTypeSchema).min(1),"maxEncodedDataSize":JsUintSchema,"collectorType":Network.CollectorTypeSchema.default("blob").optional(),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); } export namespace Network { - export const AddDataCollectorResultSchema = z.lazy(() => - z.object({ - collector: Network.CollectorSchema, - }), - ); +export const AddDataCollectorResultSchema = z.lazy(() => z.object({ +"collector":Network.CollectorSchema})); } export namespace Network { export const AddInterceptSchema = z.lazy(() => @@ -1700,200 +1013,108 @@ export namespace Network { ); } export namespace Network { - export const InterceptPhaseSchema = z.lazy(() => - z.enum(['beforeRequestSent', 'responseStarted', 'authRequired']), - ); +export const InterceptPhaseSchema = z.lazy(() => z.enum(["beforeRequestSent","responseStarted","authRequired",])); } export namespace Network { - export const AddInterceptResultSchema = z.lazy(() => - z.object({ - intercept: Network.InterceptSchema, - }), - ); +export const AddInterceptResultSchema = z.lazy(() => z.object({ +"intercept":Network.InterceptSchema})); } export namespace Network { - export const ContinueRequestSchema = z.lazy(() => - z.object({ - method: z.literal('network.continueRequest'), - params: Network.ContinueRequestParametersSchema, - }), - ); +export const +ContinueRequestSchema = z.lazy(() => z.object({ +"method":z.literal("network.continueRequest"),"params":Network.ContinueRequestParametersSchema})); } export namespace Network { - export const ContinueRequestParametersSchema = z.lazy(() => - z.object({ - request: Network.RequestSchema, - body: Network.BytesValueSchema.optional(), - cookies: z.array(Network.CookieHeaderSchema).optional(), - headers: z.array(Network.HeaderSchema).optional(), - method: z.string().optional(), - url: z.string().optional(), - }), - ); +export const ContinueRequestParametersSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema,"body":Network.BytesValueSchema.optional(),"cookies":z.array(Network.CookieHeaderSchema).optional(),"headers":z.array(Network.HeaderSchema).optional(),"method":z.string().optional(),"url":z.string().optional()})); } export namespace Network { - export const ContinueResponseSchema = z.lazy(() => - z.object({ - method: z.literal('network.continueResponse'), - params: Network.ContinueResponseParametersSchema, - }), - ); +export const +ContinueResponseSchema = z.lazy(() => z.object({ +"method":z.literal("network.continueResponse"),"params":Network.ContinueResponseParametersSchema})); } export namespace Network { - export const ContinueResponseParametersSchema = z.lazy(() => - z.object({ - request: Network.RequestSchema, - cookies: z.array(Network.SetCookieHeaderSchema).optional(), - credentials: Network.AuthCredentialsSchema.optional(), - headers: z.array(Network.HeaderSchema).optional(), - reasonPhrase: z.string().optional(), - statusCode: JsUintSchema.optional(), - }), - ); +export const ContinueResponseParametersSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema,"cookies":z.array(Network.SetCookieHeaderSchema).optional(),"credentials":Network.AuthCredentialsSchema.optional(),"headers":z.array(Network.HeaderSchema).optional(),"reasonPhrase":z.string().optional(),"statusCode":JsUintSchema.optional()})); } export namespace Network { - export const ContinueWithAuthSchema = z.lazy(() => - z.object({ - method: z.literal('network.continueWithAuth'), - params: Network.ContinueWithAuthParametersSchema, - }), - ); +export const +ContinueWithAuthSchema = z.lazy(() => z.object({ +"method":z.literal("network.continueWithAuth"),"params":Network.ContinueWithAuthParametersSchema})); } export namespace Network { - export const ContinueWithAuthParametersSchema = z.lazy(() => - z - .object({ - request: Network.RequestSchema, - }) - .and( - z.union([ - Network.ContinueWithAuthCredentialsSchema, - Network.ContinueWithAuthNoCredentialsSchema, - ]), - ), - ); +export const ContinueWithAuthParametersSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema}).and( +z.union([Network.ContinueWithAuthCredentialsSchema,Network.ContinueWithAuthNoCredentialsSchema])) +); } export namespace Network { - export const ContinueWithAuthCredentialsSchema = z.lazy(() => - z.object({ - action: z.literal('provideCredentials'), - credentials: Network.AuthCredentialsSchema, - }), - ); +export const +ContinueWithAuthCredentialsSchema = z.lazy(() => z.object({ +"action":z.literal("provideCredentials"),"credentials":Network.AuthCredentialsSchema})); } export namespace Network { - export const ContinueWithAuthNoCredentialsSchema = z.lazy(() => - z.object({ - action: z.enum(['default', 'cancel']), - }), - ); +export const +ContinueWithAuthNoCredentialsSchema = z.lazy(() => z.object({ +"action":z.enum(["default","cancel",])})); } export namespace Network { - export const DisownDataSchema = z.lazy(() => - z.object({ - method: z.literal('network.disownData'), - params: Network.DisownDataParametersSchema, - }), - ); +export const +DisownDataSchema = z.lazy(() => z.object({ +"method":z.literal("network.disownData"),"params":Network.DisownDataParametersSchema})); } export namespace Network { - export const DisownDataParametersSchema = z.lazy(() => - z.object({ - dataType: Network.DataTypeSchema, - collector: Network.CollectorSchema, - request: Network.RequestSchema, - }), - ); +export const DisownDataParametersSchema = z.lazy(() => z.object({ +"dataType":Network.DataTypeSchema,"collector":Network.CollectorSchema,"request":Network.RequestSchema})); } export namespace Network { - export const FailRequestSchema = z.lazy(() => - z.object({ - method: z.literal('network.failRequest'), - params: Network.FailRequestParametersSchema, - }), - ); +export const +FailRequestSchema = z.lazy(() => z.object({ +"method":z.literal("network.failRequest"),"params":Network.FailRequestParametersSchema})); } export namespace Network { - export const FailRequestParametersSchema = z.lazy(() => - z.object({ - request: Network.RequestSchema, - }), - ); +export const FailRequestParametersSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema})); } export namespace Network { - export const GetDataSchema = z.lazy(() => - z.object({ - method: z.literal('network.getData'), - params: Network.GetDataParametersSchema, - }), - ); +export const +GetDataSchema = z.lazy(() => z.object({ +"method":z.literal("network.getData"),"params":Network.GetDataParametersSchema})); } export namespace Network { - export const GetDataParametersSchema = z.lazy(() => - z.object({ - dataType: Network.DataTypeSchema, - collector: Network.CollectorSchema.optional(), - disown: z.boolean().default(false).optional(), - request: Network.RequestSchema, - }), - ); +export const GetDataParametersSchema = z.lazy(() => z.object({ +"dataType":Network.DataTypeSchema,"collector":Network.CollectorSchema.optional(),"disown":z.boolean().default(false).optional(),"request":Network.RequestSchema})); } export namespace Network { - export const GetDataResultSchema = z.lazy(() => - z.object({ - bytes: Network.BytesValueSchema, - }), - ); +export const GetDataResultSchema = z.lazy(() => z.object({ +"bytes":Network.BytesValueSchema})); } export namespace Network { - export const ProvideResponseSchema = z.lazy(() => - z.object({ - method: z.literal('network.provideResponse'), - params: Network.ProvideResponseParametersSchema, - }), - ); +export const +ProvideResponseSchema = z.lazy(() => z.object({ +"method":z.literal("network.provideResponse"),"params":Network.ProvideResponseParametersSchema})); } export namespace Network { - export const ProvideResponseParametersSchema = z.lazy(() => - z.object({ - request: Network.RequestSchema, - body: Network.BytesValueSchema.optional(), - cookies: z.array(Network.SetCookieHeaderSchema).optional(), - headers: z.array(Network.HeaderSchema).optional(), - reasonPhrase: z.string().optional(), - statusCode: JsUintSchema.optional(), - }), - ); +export const ProvideResponseParametersSchema = z.lazy(() => z.object({ +"request":Network.RequestSchema,"body":Network.BytesValueSchema.optional(),"cookies":z.array(Network.SetCookieHeaderSchema).optional(),"headers":z.array(Network.HeaderSchema).optional(),"reasonPhrase":z.string().optional(),"statusCode":JsUintSchema.optional()})); } export namespace Network { - export const RemoveDataCollectorSchema = z.lazy(() => - z.object({ - method: z.literal('network.removeDataCollector'), - params: Network.RemoveDataCollectorParametersSchema, - }), - ); +export const +RemoveDataCollectorSchema = z.lazy(() => z.object({ +"method":z.literal("network.removeDataCollector"),"params":Network.RemoveDataCollectorParametersSchema})); } export namespace Network { - export const RemoveDataCollectorParametersSchema = z.lazy(() => - z.object({ - collector: Network.CollectorSchema, - }), - ); +export const RemoveDataCollectorParametersSchema = z.lazy(() => z.object({ +"collector":Network.CollectorSchema})); } export namespace Network { - export const RemoveInterceptSchema = z.lazy(() => - z.object({ - method: z.literal('network.removeIntercept'), - params: Network.RemoveInterceptParametersSchema, - }), - ); +export const +RemoveInterceptSchema = z.lazy(() => z.object({ +"method":z.literal("network.removeIntercept"),"params":Network.RemoveInterceptParametersSchema})); } export namespace Network { - export const RemoveInterceptParametersSchema = z.lazy(() => - z.object({ - intercept: Network.InterceptSchema, - }), - ); +export const RemoveInterceptParametersSchema = z.lazy(() => z.object({ +"intercept":Network.InterceptSchema})); } export namespace Network { export const SetCacheBehaviorSchema = z.lazy(() => @@ -2011,13 +1232,10 @@ export namespace Network { ); } export namespace Network { - export const ResponseStartedParametersSchema = z.lazy(() => - Network.BaseParametersSchema.and( - z.object({ - response: Network.ResponseDataSchema, - }), - ), - ); +export const ResponseStartedParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( +z.object({ +"response":Network.ResponseDataSchema})) +); } export const ScriptCommandSchema = z.lazy(() => z.union([ @@ -2044,15 +1262,11 @@ export const ScriptEventSchema = z.lazy(() => ]), ); export namespace Script { - export const ChannelSchema = z.lazy(() => z.string()); +export const ChannelSchema = z.lazy(() => z.string()); } export namespace Script { - export const ChannelValueSchema = z.lazy(() => - z.object({ - type: z.literal('channel'), - value: Script.ChannelPropertiesSchema, - }), - ); +export const ChannelValueSchema = z.lazy(() => z.object({ +"type":z.literal("channel"),"value":Script.ChannelPropertiesSchema})); } export namespace Script { export const ChannelPropertiesSchema = z.lazy(() => @@ -2101,25 +1315,13 @@ export namespace Script { ); } export namespace Script { - export const HandleSchema = z.lazy(() => z.string()); +export const HandleSchema = z.lazy(() => z.string()); } export namespace Script { - export const InternalIdSchema = z.lazy(() => z.string()); +export const InternalIdSchema = z.lazy(() => z.string()); } export namespace Script { - export const LocalValueSchema = z.lazy(() => - z.union([ - Script.RemoteReferenceSchema, - Script.PrimitiveProtocolValueSchema, - Script.ChannelValueSchema, - Script.ArrayLocalValueSchema, - Script.DateLocalValueSchema, - Script.MapLocalValueSchema, - Script.ObjectLocalValueSchema, - Script.RegExpLocalValueSchema, - Script.SetLocalValueSchema, - ]), - ); +export const LocalValueSchema = z.lazy(() => z.union([Script.RemoteReferenceSchema,Script.PrimitiveProtocolValueSchema,Script.ChannelValueSchema,Script.ArrayLocalValueSchema,Script.DateLocalValueSchema,Script.MapLocalValueSchema,Script.ObjectLocalValueSchema,Script.RegExpLocalValueSchema,Script.SetLocalValueSchema])); } export namespace Script { export const ListLocalValueSchema = z.lazy(() => @@ -2193,184 +1395,100 @@ export namespace Script { ); } export namespace Script { - export const PreloadScriptSchema = z.lazy(() => z.string()); +export const PreloadScriptSchema = z.lazy(() => z.string()); } export namespace Script { - export const RealmSchema = z.lazy(() => z.string()); +export const RealmSchema = z.lazy(() => z.string()); } export namespace Script { - export const PrimitiveProtocolValueSchema = z.lazy(() => - z.union([ - Script.UndefinedValueSchema, - Script.NullValueSchema, - Script.StringValueSchema, - Script.NumberValueSchema, - Script.BooleanValueSchema, - Script.BigIntValueSchema, - ]), - ); +export const PrimitiveProtocolValueSchema = z.lazy(() => z.union([Script.UndefinedValueSchema,Script.NullValueSchema,Script.StringValueSchema,Script.NumberValueSchema,Script.BooleanValueSchema,Script.BigIntValueSchema])); } export namespace Script { - export const UndefinedValueSchema = z.lazy(() => - z.object({ - type: z.literal('undefined'), - }), - ); +export const UndefinedValueSchema = z.lazy(() => z.object({ +"type":z.literal("undefined")})); } export namespace Script { - export const NullValueSchema = z.lazy(() => - z.object({ - type: z.literal('null'), - }), - ); +export const NullValueSchema = z.lazy(() => z.object({ +"type":z.literal("null")})); } export namespace Script { - export const StringValueSchema = z.lazy(() => - z.object({ - type: z.literal('string'), - value: z.string(), - }), - ); +export const StringValueSchema = z.lazy(() => z.object({ +"type":z.literal("string"),"value":z.string()})); } export namespace Script { - export const SpecialNumberSchema = z.lazy(() => - z.enum(['NaN', '-0', 'Infinity', '-Infinity']), - ); +export const SpecialNumberSchema = z.lazy(() => z.enum(["NaN","-0","Infinity","-Infinity",])); } export namespace Script { - export const NumberValueSchema = z.lazy(() => - z.object({ - type: z.literal('number'), - value: z.union([z.number(), Script.SpecialNumberSchema]), - }), - ); +export const NumberValueSchema = z.lazy(() => z.object({ +"type":z.literal("number"),"value":z.union([z.number(),Script.SpecialNumberSchema])})); } export namespace Script { - export const BooleanValueSchema = z.lazy(() => - z.object({ - type: z.literal('boolean'), - value: z.boolean(), - }), - ); +export const BooleanValueSchema = z.lazy(() => z.object({ +"type":z.literal("boolean"),"value":z.boolean()})); } export namespace Script { - export const BigIntValueSchema = z.lazy(() => - z.object({ - type: z.literal('bigint'), - value: z.string(), - }), - ); +export const BigIntValueSchema = z.lazy(() => z.object({ +"type":z.literal("bigint"),"value":z.string()})); } export namespace Script { - export const RealmInfoSchema = z.lazy(() => - z.union([ - Script.WindowRealmInfoSchema, - Script.DedicatedWorkerRealmInfoSchema, - Script.SharedWorkerRealmInfoSchema, - Script.ServiceWorkerRealmInfoSchema, - Script.WorkerRealmInfoSchema, - Script.PaintWorkletRealmInfoSchema, - Script.AudioWorkletRealmInfoSchema, - Script.WorkletRealmInfoSchema, - ]), - ); +export const RealmInfoSchema = z.lazy(() => z.union([Script.WindowRealmInfoSchema,Script.DedicatedWorkerRealmInfoSchema,Script.SharedWorkerRealmInfoSchema,Script.ServiceWorkerRealmInfoSchema,Script.WorkerRealmInfoSchema,Script.PaintWorkletRealmInfoSchema,Script.AudioWorkletRealmInfoSchema,Script.WorkletRealmInfoSchema])); } export namespace Script { - export const BaseRealmInfoSchema = z.lazy(() => - z.object({ - realm: Script.RealmSchema, - origin: z.string(), - }), - ); +export const +BaseRealmInfoSchema = z.lazy(() => z.object({ +"realm":Script.RealmSchema,"origin":z.string()})); } export namespace Script { - export const WindowRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('window'), - context: BrowsingContext.BrowsingContextSchema, - sandbox: z.string().optional(), - }), - ), - ); +export const WindowRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("window"),"context":BrowsingContext.BrowsingContextSchema,"sandbox":z.string().optional()})) +); } export namespace Script { - export const DedicatedWorkerRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('dedicated-worker'), - owners: z.tuple([Script.RealmSchema]), - }), - ), - ); +export const DedicatedWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("dedicated-worker"),"owners":z.tuple([ +Script.RealmSchema])})) +); } export namespace Script { - export const SharedWorkerRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('shared-worker'), - }), - ), - ); +export const SharedWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("shared-worker")})) +); } export namespace Script { - export const ServiceWorkerRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('service-worker'), - }), - ), - ); +export const ServiceWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("service-worker")})) +); } export namespace Script { - export const WorkerRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('worker'), - }), - ), - ); +export const WorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("worker")})) +); } export namespace Script { - export const PaintWorkletRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('paint-worklet'), - }), - ), - ); +export const PaintWorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("paint-worklet")})) +); } export namespace Script { - export const AudioWorkletRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('audio-worklet'), - }), - ), - ); +export const AudioWorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("audio-worklet")})) +); } export namespace Script { - export const WorkletRealmInfoSchema = z.lazy(() => - Script.BaseRealmInfoSchema.and( - z.object({ - type: z.literal('worklet'), - }), - ), - ); +export const WorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( +z.object({ +"type":z.literal("worklet")})) +); } export namespace Script { - export const RealmTypeSchema = z.lazy(() => - z.enum([ - 'window', - 'dedicated-worker', - 'shared-worker', - 'service-worker', - 'worker', - 'paint-worklet', - 'audio-worklet', - 'worklet', - ]), - ); +export const RealmTypeSchema = z.lazy(() => z.enum(["window","dedicated-worker","shared-worker","service-worker","worker","paint-worklet","audio-worklet","worklet",])); } export namespace Script { export const RemoteReferenceSchema = z.lazy(() => @@ -2398,31 +1516,7 @@ export namespace Script { ); } export namespace Script { - export const RemoteValueSchema = z.lazy(() => - z.union([ - Script.PrimitiveProtocolValueSchema, - Script.SymbolRemoteValueSchema, - Script.ArrayRemoteValueSchema, - Script.ObjectRemoteValueSchema, - Script.FunctionRemoteValueSchema, - Script.RegExpRemoteValueSchema, - Script.DateRemoteValueSchema, - Script.MapRemoteValueSchema, - Script.SetRemoteValueSchema, - Script.WeakMapRemoteValueSchema, - Script.WeakSetRemoteValueSchema, - Script.GeneratorRemoteValueSchema, - Script.ErrorRemoteValueSchema, - Script.ProxyRemoteValueSchema, - Script.PromiseRemoteValueSchema, - Script.TypedArrayRemoteValueSchema, - Script.ArrayBufferRemoteValueSchema, - Script.NodeListRemoteValueSchema, - Script.HtmlCollectionRemoteValueSchema, - Script.NodeRemoteValueSchema, - Script.WindowProxyRemoteValueSchema, - ]), - ); +export const RemoteValueSchema = z.lazy(() => z.union([Script.PrimitiveProtocolValueSchema,Script.SymbolRemoteValueSchema,Script.ArrayRemoteValueSchema,Script.ObjectRemoteValueSchema,Script.FunctionRemoteValueSchema,Script.RegExpRemoteValueSchema,Script.DateRemoteValueSchema,Script.MapRemoteValueSchema,Script.SetRemoteValueSchema,Script.WeakMapRemoteValueSchema,Script.WeakSetRemoteValueSchema,Script.GeneratorRemoteValueSchema,Script.ErrorRemoteValueSchema,Script.ProxyRemoteValueSchema,Script.PromiseRemoteValueSchema,Script.TypedArrayRemoteValueSchema,Script.ArrayBufferRemoteValueSchema,Script.NodeListRemoteValueSchema,Script.HtmlCollectionRemoteValueSchema,Script.NodeRemoteValueSchema,Script.WindowProxyRemoteValueSchema])); } export namespace Script { export const ListRemoteValueSchema = z.lazy(() => @@ -2440,328 +1534,152 @@ export namespace Script { ); } export namespace Script { - export const SymbolRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('symbol'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const SymbolRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("symbol"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const ArrayRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('array'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.ListRemoteValueSchema.optional(), - }), - ); +export const ArrayRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("array"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); } export namespace Script { - export const ObjectRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('object'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.MappingRemoteValueSchema.optional(), - }), - ); +export const ObjectRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("object"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.MappingRemoteValueSchema.optional()})); } export namespace Script { - export const FunctionRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('function'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const FunctionRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("function"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const RegExpRemoteValueSchema = z.lazy(() => - Script.RegExpLocalValueSchema.and( - z.object({ - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ), - ); +export const RegExpRemoteValueSchema = z.lazy(() => Script.RegExpLocalValueSchema.and( +z.object({ +"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})) +); } export namespace Script { - export const DateRemoteValueSchema = z.lazy(() => - Script.DateLocalValueSchema.and( - z.object({ - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ), - ); +export const DateRemoteValueSchema = z.lazy(() => Script.DateLocalValueSchema.and( +z.object({ +"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})) +); } export namespace Script { - export const MapRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('map'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.MappingRemoteValueSchema.optional(), - }), - ); +export const MapRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("map"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.MappingRemoteValueSchema.optional()})); } export namespace Script { - export const SetRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('set'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.ListRemoteValueSchema.optional(), - }), - ); +export const SetRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("set"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); } export namespace Script { - export const WeakMapRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('weakmap'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const WeakMapRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("weakmap"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const WeakSetRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('weakset'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const WeakSetRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("weakset"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const GeneratorRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('generator'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const GeneratorRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("generator"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const ErrorRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('error'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const ErrorRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("error"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const ProxyRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('proxy'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const ProxyRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("proxy"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const PromiseRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('promise'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const PromiseRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("promise"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const TypedArrayRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('typedarray'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const TypedArrayRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("typedarray"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const ArrayBufferRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('arraybuffer'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const ArrayBufferRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("arraybuffer"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const NodeListRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('nodelist'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.ListRemoteValueSchema.optional(), - }), - ); +export const NodeListRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("nodelist"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); } export namespace Script { - export const HtmlCollectionRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('htmlcollection'), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.ListRemoteValueSchema.optional(), - }), - ); +export const HtmlCollectionRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("htmlcollection"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); } export namespace Script { - export const NodeRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('node'), - sharedId: Script.SharedIdSchema.optional(), - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - value: Script.NodePropertiesSchema.optional(), - }), - ); +export const NodeRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("node"),"sharedId":Script.SharedIdSchema.optional(),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.NodePropertiesSchema.optional()})); } export namespace Script { - export const NodePropertiesSchema = z.lazy(() => - z.object({ - nodeType: JsUintSchema, - childNodeCount: JsUintSchema, - attributes: z.record(z.string(), z.string()).optional(), - children: z.array(Script.NodeRemoteValueSchema).optional(), - localName: z.string().optional(), - mode: z.enum(['open', 'closed']).optional(), - namespaceURI: z.string().optional(), - nodeValue: z.string().optional(), - shadowRoot: z.union([Script.NodeRemoteValueSchema, z.null()]).optional(), - }), - ); +export const NodePropertiesSchema = z.lazy(() => z.object({ +"nodeType":JsUintSchema,"childNodeCount":JsUintSchema,"attributes":z.record( +z.string(),z.string()).optional(),"children":z.array(Script.NodeRemoteValueSchema).optional(),"localName":z.string().optional(),"mode":z.enum(["open","closed",]).optional(),"namespaceURI":z.string().optional(),"nodeValue":z.string().optional(),"shadowRoot":z.union([Script.NodeRemoteValueSchema,z.null()]).optional()})); } export namespace Script { - export const WindowProxyRemoteValueSchema = z.lazy(() => - z.object({ - type: z.literal('window'), - value: Script.WindowProxyPropertiesSchema, - handle: Script.HandleSchema.optional(), - internalId: Script.InternalIdSchema.optional(), - }), - ); +export const WindowProxyRemoteValueSchema = z.lazy(() => z.object({ +"type":z.literal("window"),"value":Script.WindowProxyPropertiesSchema,"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); } export namespace Script { - export const WindowProxyPropertiesSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - }), - ); +export const WindowProxyPropertiesSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema})); } export namespace Script { - export const ResultOwnershipSchema = z.lazy(() => z.enum(['root', 'none'])); +export const ResultOwnershipSchema = z.lazy(() => z.enum(["root","none",])); } export namespace Script { - export const SerializationOptionsSchema = z.lazy(() => - z.object({ - maxDomDepth: z.union([JsUintSchema, z.null()]).default(0).optional(), - maxObjectDepth: z - .union([JsUintSchema, z.null()]) - .default(null) - .optional(), - includeShadowTree: z - .enum(['none', 'open', 'all']) - .default('none') - .optional(), - }), - ); +export const SerializationOptionsSchema = z.lazy(() => z.object({ +"maxDomDepth":z.union([JsUintSchema,z.null()]).default(0).optional(),"maxObjectDepth":z.union([JsUintSchema,z.null()]).default(null).optional(),"includeShadowTree":z.enum(["none","open","all",]).default("none").optional()})); } export namespace Script { - export const SharedIdSchema = z.lazy(() => z.string()); +export const SharedIdSchema = z.lazy(() => z.string()); } export namespace Script { - export const StackFrameSchema = z.lazy(() => - z.object({ - columnNumber: JsUintSchema, - functionName: z.string(), - lineNumber: JsUintSchema, - url: z.string(), - }), - ); +export const StackFrameSchema = z.lazy(() => z.object({ +"columnNumber":JsUintSchema,"functionName":z.string(),"lineNumber":JsUintSchema,"url":z.string()})); } export namespace Script { - export const StackTraceSchema = z.lazy(() => - z.object({ - callFrames: z.array(Script.StackFrameSchema), - }), - ); +export const StackTraceSchema = z.lazy(() => z.object({ +"callFrames":z.array(Script.StackFrameSchema)})); } export namespace Script { - export const SourceSchema = z.lazy(() => - z.object({ - realm: Script.RealmSchema, - context: BrowsingContext.BrowsingContextSchema.optional(), - }), - ); +export const SourceSchema = z.lazy(() => z.object({ +"realm":Script.RealmSchema,"context":BrowsingContext.BrowsingContextSchema.optional()})); } export namespace Script { - export const RealmTargetSchema = z.lazy(() => - z.object({ - realm: Script.RealmSchema, - }), - ); +export const RealmTargetSchema = z.lazy(() => z.object({ +"realm":Script.RealmSchema})); } export namespace Script { - export const ContextTargetSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - sandbox: z.string().optional(), - }), - ); +export const ContextTargetSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"sandbox":z.string().optional()})); } export namespace Script { - export const TargetSchema = z.lazy(() => - z.union([Script.ContextTargetSchema, Script.RealmTargetSchema]), - ); +export const TargetSchema = z.lazy(() => z.union([Script.ContextTargetSchema,Script.RealmTargetSchema])); } export namespace Script { - export const AddPreloadScriptSchema = z.lazy(() => - z.object({ - method: z.literal('script.addPreloadScript'), - params: Script.AddPreloadScriptParametersSchema, - }), - ); +export const +AddPreloadScriptSchema = z.lazy(() => z.object({ +"method":z.literal("script.addPreloadScript"),"params":Script.AddPreloadScriptParametersSchema})); } export namespace Script { - export const AddPreloadScriptParametersSchema = z.lazy(() => - z.object({ - functionDeclaration: z.string(), - arguments: z.array(Script.ChannelValueSchema).optional(), - contexts: z - .array(BrowsingContext.BrowsingContextSchema) - .min(1) - .optional(), - userContexts: z.array(Browser.UserContextSchema).min(1).optional(), - sandbox: z.string().optional(), - }), - ); +export const AddPreloadScriptParametersSchema = z.lazy(() => z.object({ +"functionDeclaration":z.string(),"arguments":z.array(Script.ChannelValueSchema).optional(),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional(),"sandbox":z.string().optional()})); } export namespace Script { - export const AddPreloadScriptResultSchema = z.lazy(() => - z.object({ - script: Script.PreloadScriptSchema, - }), - ); +export const AddPreloadScriptResultSchema = z.lazy(() => z.object({ +"script":Script.PreloadScriptSchema})); } export namespace Script { - export const DisownSchema = z.lazy(() => - z.object({ - method: z.literal('script.disown'), - params: Script.DisownParametersSchema, - }), - ); +export const +DisownSchema = z.lazy(() => z.object({ +"method":z.literal("script.disown"),"params":Script.DisownParametersSchema})); } export namespace Script { - export const DisownParametersSchema = z.lazy(() => - z.object({ - handles: z.array(Script.HandleSchema), - target: Script.TargetSchema, - }), - ); +export const DisownParametersSchema = z.lazy(() => z.object({ +"handles":z.array(Script.HandleSchema),"target":Script.TargetSchema})); } export namespace Script { export const CallFunctionSchema = z.lazy(() => @@ -2786,62 +1704,35 @@ export namespace Script { ); } export namespace Script { - export const EvaluateSchema = z.lazy(() => - z.object({ - method: z.literal('script.evaluate'), - params: Script.EvaluateParametersSchema, - }), - ); +export const +EvaluateSchema = z.lazy(() => z.object({ +"method":z.literal("script.evaluate"),"params":Script.EvaluateParametersSchema})); } export namespace Script { - export const EvaluateParametersSchema = z.lazy(() => - z.object({ - expression: z.string(), - target: Script.TargetSchema, - awaitPromise: z.boolean(), - resultOwnership: Script.ResultOwnershipSchema.optional(), - serializationOptions: Script.SerializationOptionsSchema.optional(), - userActivation: z.boolean().default(false).optional(), - }), - ); +export const EvaluateParametersSchema = z.lazy(() => z.object({ +"expression":z.string(),"target":Script.TargetSchema,"awaitPromise":z.boolean(),"resultOwnership":Script.ResultOwnershipSchema.optional(),"serializationOptions":Script.SerializationOptionsSchema.optional(),"userActivation":z.boolean().default(false).optional()})); } export namespace Script { - export const GetRealmsSchema = z.lazy(() => - z.object({ - method: z.literal('script.getRealms'), - params: Script.GetRealmsParametersSchema, - }), - ); +export const +GetRealmsSchema = z.lazy(() => z.object({ +"method":z.literal("script.getRealms"),"params":Script.GetRealmsParametersSchema})); } export namespace Script { - export const GetRealmsParametersSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema.optional(), - type: Script.RealmTypeSchema.optional(), - }), - ); +export const GetRealmsParametersSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema.optional(),"type":Script.RealmTypeSchema.optional()})); } export namespace Script { - export const GetRealmsResultSchema = z.lazy(() => - z.object({ - realms: z.array(Script.RealmInfoSchema), - }), - ); +export const GetRealmsResultSchema = z.lazy(() => z.object({ +"realms":z.array(Script.RealmInfoSchema)})); } export namespace Script { - export const RemovePreloadScriptSchema = z.lazy(() => - z.object({ - method: z.literal('script.removePreloadScript'), - params: Script.RemovePreloadScriptParametersSchema, - }), - ); +export const +RemovePreloadScriptSchema = z.lazy(() => z.object({ +"method":z.literal("script.removePreloadScript"),"params":Script.RemovePreloadScriptParametersSchema})); } export namespace Script { - export const RemovePreloadScriptParametersSchema = z.lazy(() => - z.object({ - script: Script.PreloadScriptSchema, - }), - ); +export const RemovePreloadScriptParametersSchema = z.lazy(() => z.object({ +"script":Script.PreloadScriptSchema})); } export namespace Script { export const MessageSchema = z.lazy(() => @@ -2869,228 +1760,117 @@ export namespace Script { ); } export namespace Script { - export const RealmDestroyedSchema = z.lazy(() => - z.object({ - method: z.literal('script.realmDestroyed'), - params: Script.RealmDestroyedParametersSchema, - }), - ); +export const +RealmDestroyedSchema = z.lazy(() => z.object({ +"method":z.literal("script.realmDestroyed"),"params":Script.RealmDestroyedParametersSchema})); } export namespace Script { - export const RealmDestroyedParametersSchema = z.lazy(() => - z.object({ - realm: Script.RealmSchema, - }), - ); +export const RealmDestroyedParametersSchema = z.lazy(() => z.object({ +"realm":Script.RealmSchema})); } -export const StorageCommandSchema = z.lazy(() => - z.union([ - Storage.DeleteCookiesSchema, - Storage.GetCookiesSchema, - Storage.SetCookieSchema, - ]), -); -export const StorageResultSchema = z.lazy(() => - z.union([ - Storage.DeleteCookiesResultSchema, - Storage.GetCookiesResultSchema, - Storage.SetCookieResultSchema, - ]), -); +export const +StorageCommandSchema = z.lazy(() => z.union([Storage.DeleteCookiesSchema,Storage.GetCookiesSchema,Storage.SetCookieSchema])); +export const StorageResultSchema = z.lazy(() => z.union([Storage.DeleteCookiesResultSchema,Storage.GetCookiesResultSchema,Storage.SetCookieResultSchema])); export namespace Storage { - export const PartitionKeySchema = z.lazy(() => - z - .object({ - userContext: z.string().optional(), - sourceOrigin: z.string().optional(), - }) - .and(ExtensibleSchema), - ); +export const PartitionKeySchema = z.lazy(() => z.object({ +"userContext":z.string().optional(),"sourceOrigin":z.string().optional()}).and( +ExtensibleSchema) +); } export namespace Storage { - export const GetCookiesSchema = z.lazy(() => - z.object({ - method: z.literal('storage.getCookies'), - params: Storage.GetCookiesParametersSchema, - }), - ); +export const +GetCookiesSchema = z.lazy(() => z.object({ +"method":z.literal("storage.getCookies"),"params":Storage.GetCookiesParametersSchema})); } export namespace Storage { - export const CookieFilterSchema = z.lazy(() => - z - .object({ - name: z.string().optional(), - value: Network.BytesValueSchema.optional(), - domain: z.string().optional(), - path: z.string().optional(), - size: JsUintSchema.optional(), - httpOnly: z.boolean().optional(), - secure: z.boolean().optional(), - sameSite: Network.SameSiteSchema.optional(), - expiry: JsUintSchema.optional(), - }) - .and(ExtensibleSchema), - ); +export const CookieFilterSchema = z.lazy(() => z.object({ +"name":z.string().optional(),"value":Network.BytesValueSchema.optional(),"domain":z.string().optional(),"path":z.string().optional(),"size":JsUintSchema.optional(),"httpOnly":z.boolean().optional(),"secure":z.boolean().optional(),"sameSite":Network.SameSiteSchema.optional(),"expiry":JsUintSchema.optional()}).and( +ExtensibleSchema) +); } export namespace Storage { - export const BrowsingContextPartitionDescriptorSchema = z.lazy(() => - z.object({ - type: z.literal('context'), - context: BrowsingContext.BrowsingContextSchema, - }), - ); +export const BrowsingContextPartitionDescriptorSchema = z.lazy(() => z.object({ +"type":z.literal("context"),"context":BrowsingContext.BrowsingContextSchema})); } export namespace Storage { - export const StorageKeyPartitionDescriptorSchema = z.lazy(() => - z - .object({ - type: z.literal('storageKey'), - userContext: z.string().optional(), - sourceOrigin: z.string().optional(), - }) - .and(ExtensibleSchema), - ); +export const StorageKeyPartitionDescriptorSchema = z.lazy(() => z.object({ +"type":z.literal("storageKey"),"userContext":z.string().optional(),"sourceOrigin":z.string().optional()}).and( +ExtensibleSchema) +); } export namespace Storage { - export const PartitionDescriptorSchema = z.lazy(() => - z.union([ - Storage.BrowsingContextPartitionDescriptorSchema, - Storage.StorageKeyPartitionDescriptorSchema, - ]), - ); +export const PartitionDescriptorSchema = z.lazy(() => z.union([Storage.BrowsingContextPartitionDescriptorSchema,Storage.StorageKeyPartitionDescriptorSchema])); } export namespace Storage { - export const GetCookiesParametersSchema = z.lazy(() => - z.object({ - filter: Storage.CookieFilterSchema.optional(), - partition: Storage.PartitionDescriptorSchema.optional(), - }), - ); +export const GetCookiesParametersSchema = z.lazy(() => z.object({ +"filter":Storage.CookieFilterSchema.optional(),"partition":Storage.PartitionDescriptorSchema.optional()})); } export namespace Storage { - export const GetCookiesResultSchema = z.lazy(() => - z.object({ - cookies: z.array(Network.CookieSchema), - partitionKey: Storage.PartitionKeySchema, - }), - ); +export const GetCookiesResultSchema = z.lazy(() => z.object({ +"cookies":z.array(Network.CookieSchema),"partitionKey":Storage.PartitionKeySchema})); } export namespace Storage { - export const SetCookieSchema = z.lazy(() => - z.object({ - method: z.literal('storage.setCookie'), - params: Storage.SetCookieParametersSchema, - }), - ); +export const +SetCookieSchema = z.lazy(() => z.object({ +"method":z.literal("storage.setCookie"),"params":Storage.SetCookieParametersSchema})); } export namespace Storage { - export const PartialCookieSchema = z.lazy(() => - z - .object({ - name: z.string(), - value: Network.BytesValueSchema, - domain: z.string(), - path: z.string().optional(), - httpOnly: z.boolean().optional(), - secure: z.boolean().optional(), - sameSite: Network.SameSiteSchema.optional(), - expiry: JsUintSchema.optional(), - }) - .and(ExtensibleSchema), - ); +export const PartialCookieSchema = z.lazy(() => z.object({ +"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string(),"path":z.string().optional(),"httpOnly":z.boolean().optional(),"secure":z.boolean().optional(),"sameSite":Network.SameSiteSchema.optional(),"expiry":JsUintSchema.optional()}).and( +ExtensibleSchema) +); } export namespace Storage { - export const SetCookieParametersSchema = z.lazy(() => - z.object({ - cookie: Storage.PartialCookieSchema, - partition: Storage.PartitionDescriptorSchema.optional(), - }), - ); +export const SetCookieParametersSchema = z.lazy(() => z.object({ +"cookie":Storage.PartialCookieSchema,"partition":Storage.PartitionDescriptorSchema.optional()})); } export namespace Storage { - export const SetCookieResultSchema = z.lazy(() => - z.object({ - partitionKey: Storage.PartitionKeySchema, - }), - ); +export const SetCookieResultSchema = z.lazy(() => z.object({ +"partitionKey":Storage.PartitionKeySchema})); } export namespace Storage { - export const DeleteCookiesSchema = z.lazy(() => - z.object({ - method: z.literal('storage.deleteCookies'), - params: Storage.DeleteCookiesParametersSchema, - }), - ); +export const +DeleteCookiesSchema = z.lazy(() => z.object({ +"method":z.literal("storage.deleteCookies"),"params":Storage.DeleteCookiesParametersSchema})); } export namespace Storage { - export const DeleteCookiesParametersSchema = z.lazy(() => - z.object({ - filter: Storage.CookieFilterSchema.optional(), - partition: Storage.PartitionDescriptorSchema.optional(), - }), - ); +export const DeleteCookiesParametersSchema = z.lazy(() => z.object({ +"filter":Storage.CookieFilterSchema.optional(),"partition":Storage.PartitionDescriptorSchema.optional()})); } export namespace Storage { - export const DeleteCookiesResultSchema = z.lazy(() => - z.object({ - partitionKey: Storage.PartitionKeySchema, - }), - ); +export const DeleteCookiesResultSchema = z.lazy(() => z.object({ +"partitionKey":Storage.PartitionKeySchema})); } -export const LogEventSchema = z.lazy(() => Log.EntryAddedSchema); +export const +LogEventSchema = z.lazy(() => Log.EntryAddedSchema); export namespace Log { - export const LevelSchema = z.lazy(() => - z.enum(['debug', 'info', 'warn', 'error']), - ); +export const LevelSchema = z.lazy(() => z.enum(["debug","info","warn","error",])); } export namespace Log { - export const EntrySchema = z.lazy(() => - z.union([ - Log.GenericLogEntrySchema, - Log.ConsoleLogEntrySchema, - Log.JavascriptLogEntrySchema, - ]), - ); +export const EntrySchema = z.lazy(() => z.union([Log.GenericLogEntrySchema,Log.ConsoleLogEntrySchema,Log.JavascriptLogEntrySchema])); } export namespace Log { - export const BaseLogEntrySchema = z.lazy(() => - z.object({ - level: Log.LevelSchema, - source: Script.SourceSchema, - text: z.union([z.string(), z.null()]), - timestamp: JsUintSchema, - stackTrace: Script.StackTraceSchema.optional(), - }), - ); +export const +BaseLogEntrySchema = z.lazy(() => z.object({ +"level":Log.LevelSchema,"source":Script.SourceSchema,"text":z.union([z.string(),z.null()]),"timestamp":JsUintSchema,"stackTrace":Script.StackTraceSchema.optional()})); } export namespace Log { - export const GenericLogEntrySchema = z.lazy(() => - Log.BaseLogEntrySchema.and( - z.object({ - type: z.string(), - }), - ), - ); +export const GenericLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( +z.object({ +"type":z.string()})) +); } export namespace Log { - export const ConsoleLogEntrySchema = z.lazy(() => - Log.BaseLogEntrySchema.and( - z.object({ - type: z.literal('console'), - method: z.string(), - args: z.array(Script.RemoteValueSchema), - }), - ), - ); +export const ConsoleLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( +z.object({ +"type":z.literal("console"),"method":z.string(),"args":z.array(Script.RemoteValueSchema)})) +); } export namespace Log { - export const JavascriptLogEntrySchema = z.lazy(() => - Log.BaseLogEntrySchema.and( - z.object({ - type: z.literal('javascript'), - }), - ), - ); +export const JavascriptLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( +z.object({ +"type":z.literal("javascript")})) +); } export namespace Log { export const EntryAddedSchema = z.lazy(() => @@ -3173,19 +1953,11 @@ export namespace Input { ); } export namespace Input { - export const PointerSourceActionsSchema = z.lazy(() => - z.object({ - type: z.literal('pointer'), - id: z.string(), - parameters: Input.PointerParametersSchema.optional(), - actions: z.array(Input.PointerSourceActionSchema), - }), - ); +export const PointerSourceActionsSchema = z.lazy(() => z.object({ +"type":z.literal("pointer"),"id":z.string(),"parameters":Input.PointerParametersSchema.optional(),"actions":z.array(Input.PointerSourceActionSchema)})); } export namespace Input { - export const PointerTypeSchema = z.lazy(() => - z.enum(['mouse', 'pen', 'touch']), - ); +export const PointerTypeSchema = z.lazy(() => z.enum(["mouse","pen","touch",])); } export namespace Input { export const PointerParametersSchema = z.lazy(() => @@ -3358,30 +2130,19 @@ export namespace Input { ); } export namespace Input { - export const FileDialogOpenedSchema = z.lazy(() => - z.object({ - method: z.literal('input.fileDialogOpened'), - params: Input.FileDialogInfoSchema, - }), - ); +export const +FileDialogOpenedSchema = z.lazy(() => z.object({ +"method":z.literal("input.fileDialogOpened"),"params":Input.FileDialogInfoSchema})); } export namespace Input { - export const FileDialogInfoSchema = z.lazy(() => - z.object({ - context: BrowsingContext.BrowsingContextSchema, - element: Script.SharedReferenceSchema.optional(), - multiple: z.boolean(), - }), - ); +export const FileDialogInfoSchema = z.lazy(() => z.object({ +"context":BrowsingContext.BrowsingContextSchema,"element":Script.SharedReferenceSchema.optional(),"multiple":z.boolean()})); } -export const WebExtensionCommandSchema = z.lazy(() => - z.union([WebExtension.InstallSchema, WebExtension.UninstallSchema]), -); -export const WebExtensionResultSchema = z.lazy( - () => WebExtension.InstallResultSchema, -); +export const +WebExtensionCommandSchema = z.lazy(() => z.union([WebExtension.InstallSchema,WebExtension.UninstallSchema])); +export const WebExtensionResultSchema = z.lazy(() => WebExtension.InstallResultSchema); export namespace WebExtension { - export const ExtensionSchema = z.lazy(() => z.string()); +export const ExtensionSchema = z.lazy(() => z.string()); } export namespace WebExtension { export const InstallSchema = z.lazy(() => @@ -3399,57 +2160,30 @@ export namespace WebExtension { ); } export namespace WebExtension { - export const ExtensionDataSchema = z.lazy(() => - z.union([ - WebExtension.ExtensionArchivePathSchema, - WebExtension.ExtensionBase64EncodedSchema, - WebExtension.ExtensionPathSchema, - ]), - ); +export const ExtensionDataSchema = z.lazy(() => z.union([WebExtension.ExtensionArchivePathSchema,WebExtension.ExtensionBase64EncodedSchema,WebExtension.ExtensionPathSchema])); } export namespace WebExtension { - export const ExtensionPathSchema = z.lazy(() => - z.object({ - type: z.literal('path'), - path: z.string(), - }), - ); +export const ExtensionPathSchema = z.lazy(() => z.object({ +"type":z.literal("path"),"path":z.string()})); } export namespace WebExtension { - export const ExtensionArchivePathSchema = z.lazy(() => - z.object({ - type: z.literal('archivePath'), - path: z.string(), - }), - ); +export const ExtensionArchivePathSchema = z.lazy(() => z.object({ +"type":z.literal("archivePath"),"path":z.string()})); } export namespace WebExtension { - export const ExtensionBase64EncodedSchema = z.lazy(() => - z.object({ - type: z.literal('base64'), - value: z.string(), - }), - ); +export const ExtensionBase64EncodedSchema = z.lazy(() => z.object({ +"type":z.literal("base64"),"value":z.string()})); } export namespace WebExtension { - export const InstallResultSchema = z.lazy(() => - z.object({ - extension: WebExtension.ExtensionSchema, - }), - ); +export const InstallResultSchema = z.lazy(() => z.object({ +"extension":WebExtension.ExtensionSchema})); } export namespace WebExtension { - export const UninstallSchema = z.lazy(() => - z.object({ - method: z.literal('webExtension.uninstall'), - params: WebExtension.UninstallParametersSchema, - }), - ); +export const +UninstallSchema = z.lazy(() => z.object({ +"method":z.literal("webExtension.uninstall"),"params":WebExtension.UninstallParametersSchema})); } export namespace WebExtension { - export const UninstallParametersSchema = z.lazy(() => - z.object({ - extension: WebExtension.ExtensionSchema, - }), - ); +export const UninstallParametersSchema = z.lazy(() => z.object({ +"extension":WebExtension.ExtensionSchema})); } diff --git a/src/protocol/ErrorResponse.spec.ts b/src/protocol/ErrorResponse.spec.ts index b8f1816ed1..739060ba4f 100644 --- a/src/protocol/ErrorResponse.spec.ts +++ b/src/protocol/ErrorResponse.spec.ts @@ -25,6 +25,7 @@ describe('Exception', () => { } = { // keep-sorted start [ErrorCode.InvalidArgument]: undefined, + [ErrorCode.InvalidElementState]: undefined, [ErrorCode.InvalidSelector]: undefined, [ErrorCode.InvalidSessionId]: undefined, [ErrorCode.InvalidWebExtension]: undefined, diff --git a/src/protocol/generated/webdriver-bidi.ts b/src/protocol/generated/webdriver-bidi.ts index f5c551f985..989c12669b 100644 --- a/src/protocol/generated/webdriver-bidi.ts +++ b/src/protocol/generated/webdriver-bidi.ts @@ -1,3 +1,4 @@ + /** * Copyright 2024 Google LLC. * Copyright (c) Microsoft Corporation. @@ -75,42 +76,42 @@ export type Extensible = { /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = number; +export type JsInt = (number); /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = number; -export const enum ErrorCode { - InvalidArgument = 'invalid argument', - InvalidSelector = 'invalid selector', - InvalidSessionId = 'invalid session id', - InvalidWebExtension = 'invalid web extension', - MoveTargetOutOfBounds = 'move target out of bounds', - NoSuchAlert = 'no such alert', - NoSuchNetworkCollector = 'no such network collector', - NoSuchElement = 'no such element', - NoSuchFrame = 'no such frame', - NoSuchHandle = 'no such handle', - NoSuchHistoryEntry = 'no such history entry', - NoSuchIntercept = 'no such intercept', - NoSuchNetworkData = 'no such network data', - NoSuchNode = 'no such node', - NoSuchRequest = 'no such request', - NoSuchScript = 'no such script', - NoSuchStoragePartition = 'no such storage partition', - NoSuchUserContext = 'no such user context', - NoSuchWebExtension = 'no such web extension', - SessionNotCreated = 'session not created', - UnableToCaptureScreen = 'unable to capture screen', - UnableToCloseBrowser = 'unable to close browser', - UnableToSetCookie = 'unable to set cookie', - UnableToSetFileInput = 'unable to set file input', - UnavailableNetworkData = 'unavailable network data', - UnderspecifiedStoragePartition = 'underspecified storage partition', - UnknownCommand = 'unknown command', - UnknownError = 'unknown error', - UnsupportedOperation = 'unsupported operation', +export type JsUint = (number); +export const enum ErrorCode {InvalidArgument = "invalid argument", +InvalidSelector = "invalid selector", +InvalidElementState = "invalid element state", +InvalidSessionId = "invalid session id", +InvalidWebExtension = "invalid web extension", +MoveTargetOutOfBounds = "move target out of bounds", +NoSuchAlert = "no such alert", +NoSuchNetworkCollector = "no such network collector", +NoSuchElement = "no such element", +NoSuchFrame = "no such frame", +NoSuchHandle = "no such handle", +NoSuchHistoryEntry = "no such history entry", +NoSuchIntercept = "no such intercept", +NoSuchNetworkData = "no such network data", +NoSuchNode = "no such node", +NoSuchRequest = "no such request", +NoSuchScript = "no such script", +NoSuchStoragePartition = "no such storage partition", +NoSuchUserContext = "no such user context", +NoSuchWebExtension = "no such web extension", +SessionNotCreated = "session not created", +UnableToCaptureScreen = "unable to capture screen", +UnableToCloseBrowser = "unable to close browser", +UnableToSetCookie = "unable to set cookie", +UnableToSetFileInput = "unable to set file input", +UnavailableNetworkData = "unavailable network data", +UnderspecifiedStoragePartition = "underspecified storage partition", +UnknownCommand = "unknown command", +UnknownError = "unknown error", +UnsupportedOperation = "unsupported operation", } export type SessionCommand = | Session.End @@ -123,20 +124,13 @@ export type SessionResult = | Session.StatusResult | Session.SubscribeResult; export namespace Session { - export type CapabilitiesRequest = { - alwaysMatch?: Session.CapabilityRequest; - firstMatch?: [...Session.CapabilityRequest[]]; - }; +export type CapabilitiesRequest = (({ +"alwaysMatch"?:(Session.CapabilityRequest),"firstMatch"?:([ +...((Session.CapabilityRequest)[])])})); } export namespace Session { - export type CapabilityRequest = { - acceptInsecureCerts?: boolean; - browserName?: string; - browserVersion?: string; - platformName?: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - } & Extensible; +export type CapabilityRequest = (({ +"acceptInsecureCerts"?:(boolean),"browserName"?:(string),"browserVersion"?:(string),"platformName"?:(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)}&Extensible)); } export namespace Session { export type ProxyConfiguration = @@ -175,238 +169,156 @@ export namespace Session { }; } export namespace Session { - export type PacProxyConfiguration = { - proxyType: 'pac'; - proxyAutoconfigUrl: string; - } & Extensible; +export type PacProxyConfiguration = ({ +"proxyType":("pac"),"proxyAutoconfigUrl":(string)}&Extensible); } export namespace Session { - export type SystemProxyConfiguration = { - proxyType: 'system'; - } & Extensible; +export type SystemProxyConfiguration = ({ +"proxyType":("system")}&Extensible); } export namespace Session { - export type UserPromptHandler = { - alert?: Session.UserPromptHandlerType; - beforeUnload?: Session.UserPromptHandlerType; - confirm?: Session.UserPromptHandlerType; - default?: Session.UserPromptHandlerType; - file?: Session.UserPromptHandlerType; - prompt?: Session.UserPromptHandlerType; - }; +export type UserPromptHandler = (({ +"alert"?:(Session.UserPromptHandlerType),"beforeUnload"?:(Session.UserPromptHandlerType),"confirm"?:(Session.UserPromptHandlerType),"default"?:(Session.UserPromptHandlerType),"file"?:(Session.UserPromptHandlerType),"prompt"?:(Session.UserPromptHandlerType)})); } export namespace Session { - export const enum UserPromptHandlerType { - Accept = 'accept', - Dismiss = 'dismiss', - Ignore = 'ignore', - } +export const enum UserPromptHandlerType {Accept = "accept", +Dismiss = "dismiss", +Ignore = "ignore", +} } export namespace Session { - export type Subscription = string; +export type Subscription = (string); } export namespace Session { - export type SubscriptionRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SubscriptionRequest = (({ +"events":([ +(string),...(string)[]]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Session { - export type UnsubscribeByIdRequest = { - subscriptions: [Session.Subscription, ...Session.Subscription[]]; - }; +export type UnsubscribeByIdRequest = (({ +"subscriptions":([ +(Session.Subscription),...(Session.Subscription)[]])})); } export namespace Session { - export type UnsubscribeByAttributesRequest = { - events: [string, ...string[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; +export type UnsubscribeByAttributesRequest = (({ +"events":([ +(string),...(string)[]]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); } export namespace Session { - export type Status = { - method: 'session.status'; - params: EmptyParams; - }; +export type Status = ({ +"method":("session.status"),"params":(EmptyParams)}); } export namespace Session { - export type StatusResult = { - ready: boolean; - message: string; - }; +export type StatusResult = (({ +"ready":(boolean),"message":(string)})); } export namespace Session { - export type New = { - method: 'session.new'; - params: Session.NewParameters; - }; +export type New = ({ +"method":("session.new"),"params":(Session.NewParameters)}); } export namespace Session { - export type NewParameters = { - capabilities: Session.CapabilitiesRequest; - }; +export type NewParameters = (({ +"capabilities":(Session.CapabilitiesRequest)})); } export namespace Session { - export type NewResult = { - sessionId: string; - capabilities: { - acceptInsecureCerts: boolean; - browserName: string; - browserVersion: string; - platformName: string; - setWindowRect: boolean; - userAgent: string; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - webSocketUrl?: string; - } & Extensible; - }; +export type NewResult = (({ +"sessionId":(string),"capabilities":(({ +"acceptInsecureCerts":(boolean),"browserName":(string),"browserVersion":(string),"platformName":(string),"setWindowRect":(boolean),"userAgent":(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler),"webSocketUrl"?:(string)}&Extensible))})); } export namespace Session { - export type End = { - method: 'session.end'; - params: EmptyParams; - }; +export type End = ({ +"method":("session.end"),"params":(EmptyParams)}); } export namespace Session { - export type Subscribe = { - method: 'session.subscribe'; - params: Session.SubscriptionRequest; - }; +export type Subscribe = ({ +"method":("session.subscribe"),"params":(Session.SubscriptionRequest)}); } export namespace Session { - export type SubscribeResult = { - subscription: Session.Subscription; - }; +export type SubscribeResult = (({ +"subscription":(Session.Subscription)})); } export namespace Session { - export type Unsubscribe = { - method: 'session.unsubscribe'; - params: Session.UnsubscribeParameters; - }; +export type Unsubscribe = ({ +"method":("session.unsubscribe"),"params":(Session.UnsubscribeParameters)}); } export namespace Session { - export type UnsubscribeParameters = - | Session.UnsubscribeByAttributesRequest - | Session.UnsubscribeByIdRequest; -} -export type BrowserCommand = - | Browser.Close - | Browser.CreateUserContext - | Browser.GetClientWindows - | Browser.GetUserContexts - | Browser.RemoveUserContext - | Browser.SetClientWindowState; -export type BrowserResult = - | Browser.CreateUserContextResult - | Browser.GetUserContextsResult; +export type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest| Session.UnsubscribeByIdRequest); +} +export type BrowserCommand = (Browser.Close| Browser.CreateUserContext| Browser.GetClientWindows| Browser.GetUserContexts| Browser.RemoveUserContext| Browser.SetClientWindowState); +export type BrowserResult = ((Browser.CreateUserContextResult| Browser.GetUserContextsResult)); export namespace Browser { - export type ClientWindow = string; +export type ClientWindow = (string); } export namespace Browser { - export type ClientWindowInfo = { - active: boolean; - clientWindow: Browser.ClientWindow; - height: JsUint; - state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; - width: JsUint; - x: JsInt; - y: JsInt; - }; +export type ClientWindowInfo = (({ +"active":(boolean),"clientWindow":(Browser.ClientWindow),"height":(JsUint),"state":("fullscreen"| "maximized"| "minimized"| "normal"),"width":(JsUint),"x":(JsInt),"y":(JsInt)})); } export namespace Browser { - export type UserContext = string; +export type UserContext = (string); } export namespace Browser { - export type UserContextInfo = { - userContext: Browser.UserContext; - }; +export type UserContextInfo = (({ +"userContext":(Browser.UserContext)})); } export namespace Browser { - export type Close = { - method: 'browser.close'; - params: EmptyParams; - }; +export type Close = ({ +"method":("browser.close"),"params":(EmptyParams)}); } export namespace Browser { - export type CreateUserContext = { - method: 'browser.createUserContext'; - params: Browser.CreateUserContextParameters; - }; +export type CreateUserContext = ({ +"method":("browser.createUserContext"),"params":(Browser.CreateUserContextParameters)}); } export namespace Browser { - export type CreateUserContextParameters = { - acceptInsecureCerts?: boolean; - proxy?: Session.ProxyConfiguration; - unhandledPromptBehavior?: Session.UserPromptHandler; - }; +export type CreateUserContextParameters = (({ +"acceptInsecureCerts"?:(boolean),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)})); } export namespace Browser { - export type CreateUserContextResult = Browser.UserContextInfo; +export type CreateUserContextResult = (Browser.UserContextInfo); } export namespace Browser { - export type GetClientWindows = { - method: 'browser.getClientWindows'; - params: EmptyParams; - }; +export type GetClientWindows = ({ +"method":("browser.getClientWindows"),"params":(EmptyParams)}); } export namespace Browser { - export type GetClientWindowsResult = { - clientWindows: [...Browser.ClientWindowInfo[]]; - }; +export type GetClientWindowsResult = (({ +"clientWindows":([ +...((Browser.ClientWindowInfo)[])])})); } export namespace Browser { - export type GetUserContexts = { - method: 'browser.getUserContexts'; - params: EmptyParams; - }; +export type GetUserContexts = ({ +"method":("browser.getUserContexts"),"params":(EmptyParams)}); } export namespace Browser { - export type GetUserContextsResult = { - userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; - }; +export type GetUserContextsResult = (({ +"userContexts":([ +(Browser.UserContextInfo),...(Browser.UserContextInfo)[]])})); } export namespace Browser { - export type RemoveUserContext = { - method: 'browser.removeUserContext'; - params: Browser.RemoveUserContextParameters; - }; +export type RemoveUserContext = ({ +"method":("browser.removeUserContext"),"params":(Browser.RemoveUserContextParameters)}); } export namespace Browser { - export type RemoveUserContextParameters = { - userContext: Browser.UserContext; - }; +export type RemoveUserContextParameters = (({ +"userContext":(Browser.UserContext)})); } export namespace Browser { - export type SetClientWindowState = { - method: 'browser.setClientWindowState'; - params: Browser.SetClientWindowStateParameters; - }; +export type SetClientWindowState = ({ +"method":("browser.setClientWindowState"),"params":(Browser.SetClientWindowStateParameters)}); } export namespace Browser { - export type SetClientWindowStateParameters = { - clientWindow: Browser.ClientWindow; - } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); +export type SetClientWindowStateParameters = (({ +"clientWindow":(Browser.ClientWindow)}&(Browser.ClientWindowNamedState| Browser.ClientWindowRectState))); } export namespace Browser { - export type ClientWindowNamedState = { - state: 'fullscreen' | 'maximized' | 'minimized'; - }; +export type ClientWindowNamedState = ({ +"state":("fullscreen"| "maximized"| "minimized")}); } export namespace Browser { - export type ClientWindowRectState = { - state: 'normal'; - width?: JsUint; - height?: JsUint; - x?: JsInt; - y?: JsInt; - }; +export type ClientWindowRectState = ({ +"state":("normal"),"width"?:(JsUint),"height"?:(JsUint),"x"?:(JsInt),"y"?:(JsInt)}); } export type BrowsingContextCommand = | BrowsingContext.Activate @@ -445,102 +357,67 @@ export type BrowsingContextEvent = | BrowsingContext.UserPromptClosed | BrowsingContext.UserPromptOpened; export namespace BrowsingContext { - export type BrowsingContext = string; +export type BrowsingContext = (string); } export namespace BrowsingContext { - export type InfoList = [...BrowsingContext.Info[]]; +export type InfoList = ([ +...((BrowsingContext.Info)[])]); } export namespace BrowsingContext { - export type Info = { - children: BrowsingContext.InfoList | null; - clientWindow: Browser.ClientWindow; - context: BrowsingContext.BrowsingContext; - originalOpener: BrowsingContext.BrowsingContext | null; - url: string; - userContext: Browser.UserContext; - parent?: BrowsingContext.BrowsingContext | null; - }; +export type Info = (({ +"children":(BrowsingContext.InfoList| null),"clientWindow":(Browser.ClientWindow),"context":(BrowsingContext.BrowsingContext),"originalOpener":(BrowsingContext.BrowsingContext| null),"url":(string),"userContext":(Browser.UserContext),"parent"?:(BrowsingContext.BrowsingContext| null)})); } export namespace BrowsingContext { - export type Locator = - | BrowsingContext.AccessibilityLocator - | BrowsingContext.CssLocator - | BrowsingContext.ContextLocator - | BrowsingContext.InnerTextLocator - | BrowsingContext.XPathLocator; +export type Locator = ((BrowsingContext.AccessibilityLocator| BrowsingContext.CssLocator| BrowsingContext.ContextLocator| BrowsingContext.InnerTextLocator| BrowsingContext.XPathLocator)); } export namespace BrowsingContext { - export type AccessibilityLocator = { - type: 'accessibility'; - value: { - name?: string; - role?: string; - }; - }; +export type AccessibilityLocator = (({ +"type":("accessibility"),"value":(({ +"name"?:(string),"role"?:(string)}))})); } export namespace BrowsingContext { - export type CssLocator = { - type: 'css'; - value: string; - }; +export type CssLocator = (({ +"type":("css"),"value":(string)})); } export namespace BrowsingContext { - export type ContextLocator = { - type: 'context'; - value: { - context: BrowsingContext.BrowsingContext; - }; - }; +export type ContextLocator = (({ +"type":("context"),"value":(({ +"context":(BrowsingContext.BrowsingContext)}))})); } export namespace BrowsingContext { - export type InnerTextLocator = { - type: 'innerText'; - value: string; - ignoreCase?: boolean; - matchType?: 'full' | 'partial'; - maxDepth?: JsUint; - }; +export type InnerTextLocator = (({ +"type":("innerText"),"value":(string),"ignoreCase"?:(boolean),"matchType"?:("full"| "partial"),"maxDepth"?:(JsUint)})); } export namespace BrowsingContext { - export type XPathLocator = { - type: 'xpath'; - value: string; - }; +export type XPathLocator = (({ +"type":("xpath"),"value":(string)})); } export namespace BrowsingContext { - export type Navigation = string; +export type Navigation = (string); } export namespace BrowsingContext { - export type BaseNavigationInfo = { - context: BrowsingContext.BrowsingContext; - navigation: BrowsingContext.Navigation | null; - timestamp: JsUint; - url: string; - }; +export type BaseNavigationInfo = ({ +"context":(BrowsingContext.BrowsingContext),"navigation":(BrowsingContext.Navigation| null),"timestamp":(JsUint),"url":(string)}); } export namespace BrowsingContext { - export type NavigationInfo = BrowsingContext.BaseNavigationInfo; +export type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); } export namespace BrowsingContext { - export const enum ReadinessState { - None = 'none', - Interactive = 'interactive', - Complete = 'complete', - } +export const enum ReadinessState {None = "none", +Interactive = "interactive", +Complete = "complete", +} } export namespace BrowsingContext { - export const enum UserPromptType { - Alert = 'alert', - Beforeunload = 'beforeunload', - Confirm = 'confirm', - Prompt = 'prompt', - } +export const enum UserPromptType {Alert = "alert", +Beforeunload = "beforeunload", +Confirm = "confirm", +Prompt = "prompt", +} } export namespace BrowsingContext { - export type Activate = { - method: 'browsingContext.activate'; - params: BrowsingContext.ActivateParameters; - }; +export type Activate = ({ +"method":("browsingContext.activate"),"params":(BrowsingContext.ActivateParameters)}); } export namespace BrowsingContext { export type ActivateParameters = { @@ -554,115 +431,84 @@ export namespace BrowsingContext { }; } export namespace BrowsingContext { - export type CaptureScreenshotParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `"viewport"` - */ - origin?: 'viewport' | 'document'; - format?: BrowsingContext.ImageFormat; - clip?: BrowsingContext.ClipRectangle; - }; +export type CaptureScreenshotParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `"viewport"` + */ +"origin"?:(("viewport"| "document")),"format"?:(BrowsingContext.ImageFormat),"clip"?:(BrowsingContext.ClipRectangle)})); } export namespace BrowsingContext { - export type ImageFormat = { - type: string; - /** - * Must be between `0` and `1`, inclusive. - */ - quality?: number; - }; +export type ImageFormat = (({ +"type":(string), +/** + * Must be between `0` and `1`, inclusive. + */ +"quality"?:(number)})); } export namespace BrowsingContext { - export type ClipRectangle = - | BrowsingContext.BoxClipRectangle - | BrowsingContext.ElementClipRectangle; +export type ClipRectangle = ((BrowsingContext.BoxClipRectangle| BrowsingContext.ElementClipRectangle)); } export namespace BrowsingContext { - export type ElementClipRectangle = { - type: 'element'; - element: Script.SharedReference; - }; +export type ElementClipRectangle = (({ +"type":("element"),"element":(Script.SharedReference)})); } export namespace BrowsingContext { - export type BoxClipRectangle = { - type: 'box'; - x: number; - y: number; - width: number; - height: number; - }; +export type BoxClipRectangle = (({ +"type":("box"),"x":(number),"y":(number),"width":(number),"height":(number)})); } export namespace BrowsingContext { - export type CaptureScreenshotResult = { - data: string; - }; +export type CaptureScreenshotResult = (({ +"data":(string)})); } export namespace BrowsingContext { - export type Close = { - method: 'browsingContext.close'; - params: BrowsingContext.CloseParameters; - }; +export type Close = ({ +"method":("browsingContext.close"),"params":(BrowsingContext.CloseParameters)}); } export namespace BrowsingContext { - export type CloseParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - promptUnload?: boolean; - }; +export type CloseParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"promptUnload"?:(boolean)})); } export namespace BrowsingContext { - export type Create = { - method: 'browsingContext.create'; - params: BrowsingContext.CreateParameters; - }; +export type Create = ({ +"method":("browsingContext.create"),"params":(BrowsingContext.CreateParameters)}); } export namespace BrowsingContext { - export const enum CreateType { - Tab = 'tab', - Window = 'window', - } +export const enum CreateType {Tab = "tab", +Window = "window", +} } export namespace BrowsingContext { - export type CreateParameters = { - type: BrowsingContext.CreateType; - referenceContext?: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - userContext?: Browser.UserContext; - }; +export type CreateParameters = (({ +"type":(BrowsingContext.CreateType),"referenceContext"?:(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"background"?:(boolean),"userContext"?:(Browser.UserContext)})); } export namespace BrowsingContext { - export type CreateResult = { - context: BrowsingContext.BrowsingContext; - }; +export type CreateResult = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace BrowsingContext { - export type GetTree = { - method: 'browsingContext.getTree'; - params: BrowsingContext.GetTreeParameters; - }; +export type GetTree = ({ +"method":("browsingContext.getTree"),"params":(BrowsingContext.GetTreeParameters)}); } export namespace BrowsingContext { - export type GetTreeParameters = { - maxDepth?: JsUint; - root?: BrowsingContext.BrowsingContext; - }; +export type GetTreeParameters = (({ +"maxDepth"?:(JsUint),"root"?:(BrowsingContext.BrowsingContext)})); } export namespace BrowsingContext { - export type GetTreeResult = { - contexts: BrowsingContext.InfoList; - }; +export type GetTreeResult = (({ +"contexts":(BrowsingContext.InfoList)})); } export namespace BrowsingContext { - export type HandleUserPrompt = { - method: 'browsingContext.handleUserPrompt'; - params: BrowsingContext.HandleUserPromptParameters; - }; +export type HandleUserPrompt = ({ +"method":("browsingContext.handleUserPrompt"),"params":(BrowsingContext.HandleUserPromptParameters)}); } export namespace BrowsingContext { export type HandleUserPromptParameters = { @@ -678,480 +524,349 @@ export namespace BrowsingContext { }; } export namespace BrowsingContext { - export type LocateNodesParameters = { - context: BrowsingContext.BrowsingContext; - locator: BrowsingContext.Locator; - /** - * Must be greater than or equal to `1`. - */ - maxNodeCount?: JsUint; - serializationOptions?: Script.SerializationOptions; - startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; - }; +export type LocateNodesParameters = (({ +"context":(BrowsingContext.BrowsingContext),"locator":(BrowsingContext.Locator), +/** + * Must be greater than or equal to `1`. + */ +"maxNodeCount"?:((JsUint)),"serializationOptions"?:(Script.SerializationOptions),"startNodes"?:([ +(Script.SharedReference),...(Script.SharedReference)[]])})); } export namespace BrowsingContext { - export type LocateNodesResult = { - nodes: [...Script.NodeRemoteValue[]]; - }; +export type LocateNodesResult = (({ +"nodes":([ +...((Script.NodeRemoteValue)[])])})); } export namespace BrowsingContext { - export type Navigate = { - method: 'browsingContext.navigate'; - params: BrowsingContext.NavigateParameters; - }; +export type Navigate = ({ +"method":("browsingContext.navigate"),"params":(BrowsingContext.NavigateParameters)}); } export namespace BrowsingContext { - export type NavigateParameters = { - context: BrowsingContext.BrowsingContext; - url: string; - wait?: BrowsingContext.ReadinessState; - }; +export type NavigateParameters = (({ +"context":(BrowsingContext.BrowsingContext),"url":(string),"wait"?:(BrowsingContext.ReadinessState)})); } export namespace BrowsingContext { - export type NavigateResult = { - navigation: BrowsingContext.Navigation | null; - url: string; - }; +export type NavigateResult = (({ +"navigation":(BrowsingContext.Navigation| null),"url":(string)})); } export namespace BrowsingContext { - export type Print = { - method: 'browsingContext.print'; - params: BrowsingContext.PrintParameters; - }; +export type Print = ({ +"method":("browsingContext.print"),"params":(BrowsingContext.PrintParameters)}); } export namespace BrowsingContext { - export type PrintParameters = { - context: BrowsingContext.BrowsingContext; - /** - * @defaultValue `false` - */ - background?: boolean; - margin?: BrowsingContext.PrintMarginParameters; - /** - * @defaultValue `"portrait"` - */ - orientation?: 'portrait' | 'landscape'; - page?: BrowsingContext.PrintPageParameters; - pageRanges?: [...(JsUint | string)[]]; - /** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ - scale?: number; - /** - * @defaultValue `true` - */ - shrinkToFit?: boolean; - }; +export type PrintParameters = (({ +"context":(BrowsingContext.BrowsingContext), +/** + * @defaultValue `false` + */ +"background"?:(boolean),"margin"?:(BrowsingContext.PrintMarginParameters), +/** + * @defaultValue `"portrait"` + */ +"orientation"?:(("portrait"| "landscape")),"page"?:(BrowsingContext.PrintPageParameters),"pageRanges"?:([ +...((JsUint| string)[])]), +/** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ +"scale"?:((number)), +/** + * @defaultValue `true` + */ +"shrinkToFit"?:(boolean)})); } export namespace BrowsingContext { - export type PrintMarginParameters = { - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - bottom?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - left?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - right?: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - top?: number; - }; +export type PrintMarginParameters = (({ + +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"bottom"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"left"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"right"?:((number)), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"top"?:((number))})); } export namespace BrowsingContext { - export type PrintPageParameters = { - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ - height?: number; - /** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ - width?: number; - }; +export type PrintPageParameters = (({ + +/** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ +"height"?:((number)), +/** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ +"width"?:((number))})); } export namespace BrowsingContext { - export type PrintResult = { - data: string; - }; +export type PrintResult = (({ +"data":(string)})); } export namespace BrowsingContext { - export type Reload = { - method: 'browsingContext.reload'; - params: BrowsingContext.ReloadParameters; - }; +export type Reload = ({ +"method":("browsingContext.reload"),"params":(BrowsingContext.ReloadParameters)}); } export namespace BrowsingContext { - export type ReloadParameters = { - context: BrowsingContext.BrowsingContext; - ignoreCache?: boolean; - wait?: BrowsingContext.ReadinessState; - }; +export type ReloadParameters = (({ +"context":(BrowsingContext.BrowsingContext),"ignoreCache"?:(boolean),"wait"?:(BrowsingContext.ReadinessState)})); } export namespace BrowsingContext { - export type SetViewport = { - method: 'browsingContext.setViewport'; - params: BrowsingContext.SetViewportParameters; - }; +export type SetViewport = ({ +"method":("browsingContext.setViewport"),"params":(BrowsingContext.SetViewportParameters)}); } export namespace BrowsingContext { - export type SetViewportParameters = { - context?: BrowsingContext.BrowsingContext; - viewport?: BrowsingContext.Viewport | null; - /** - * Must be greater than `0`. - */ - devicePixelRatio?: number | null; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetViewportParameters = (({ +"context"?:(BrowsingContext.BrowsingContext),"viewport"?:(BrowsingContext.Viewport| null), +/** + * Must be greater than `0`. + */ +"devicePixelRatio"?:((number)| null),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace BrowsingContext { - export type Viewport = { - width: JsUint; - height: JsUint; - }; +export type Viewport = (({ +"width":(JsUint),"height":(JsUint)})); } export namespace BrowsingContext { - export type TraverseHistory = { - method: 'browsingContext.traverseHistory'; - params: BrowsingContext.TraverseHistoryParameters; - }; +export type TraverseHistory = ({ +"method":("browsingContext.traverseHistory"),"params":(BrowsingContext.TraverseHistoryParameters)}); } export namespace BrowsingContext { - export type TraverseHistoryParameters = { - context: BrowsingContext.BrowsingContext; - delta: JsInt; - }; +export type TraverseHistoryParameters = (({ +"context":(BrowsingContext.BrowsingContext),"delta":(JsInt)})); } export namespace BrowsingContext { - export type TraverseHistoryResult = Record; +export type TraverseHistoryResult = ((Record +)); } export namespace BrowsingContext { - export type ContextCreated = { - method: 'browsingContext.contextCreated'; - params: BrowsingContext.Info; - }; +export type ContextCreated = ({ +"method":("browsingContext.contextCreated"),"params":(BrowsingContext.Info)}); } export namespace BrowsingContext { - export type ContextDestroyed = { - method: 'browsingContext.contextDestroyed'; - params: BrowsingContext.Info; - }; +export type ContextDestroyed = ({ +"method":("browsingContext.contextDestroyed"),"params":(BrowsingContext.Info)}); } export namespace BrowsingContext { - export type NavigationStarted = { - method: 'browsingContext.navigationStarted'; - params: BrowsingContext.NavigationInfo; - }; +export type NavigationStarted = ({ +"method":("browsingContext.navigationStarted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type FragmentNavigated = { - method: 'browsingContext.fragmentNavigated'; - params: BrowsingContext.NavigationInfo; - }; +export type FragmentNavigated = ({ +"method":("browsingContext.fragmentNavigated"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type HistoryUpdated = { - method: 'browsingContext.historyUpdated'; - params: BrowsingContext.HistoryUpdatedParameters; - }; +export type HistoryUpdated = ({ +"method":("browsingContext.historyUpdated"),"params":(BrowsingContext.HistoryUpdatedParameters)}); } export namespace BrowsingContext { - export type HistoryUpdatedParameters = { - context: BrowsingContext.BrowsingContext; - timestamp: JsUint; - url: string; - }; +export type HistoryUpdatedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"timestamp":(JsUint),"url":(string)})); } export namespace BrowsingContext { - export type DomContentLoaded = { - method: 'browsingContext.domContentLoaded'; - params: BrowsingContext.NavigationInfo; - }; +export type DomContentLoaded = ({ +"method":("browsingContext.domContentLoaded"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type Load = { - method: 'browsingContext.load'; - params: BrowsingContext.NavigationInfo; - }; +export type Load = ({ +"method":("browsingContext.load"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type DownloadWillBegin = { - method: 'browsingContext.downloadWillBegin'; - params: BrowsingContext.DownloadWillBeginParams; - }; +export type DownloadWillBegin = ({ +"method":("browsingContext.downloadWillBegin"),"params":(BrowsingContext.DownloadWillBeginParams)}); } export namespace BrowsingContext { - export type DownloadWillBeginParams = { - suggestedFilename: string; - } & BrowsingContext.BaseNavigationInfo; +export type DownloadWillBeginParams = (({ +"suggestedFilename":(string)}&BrowsingContext.BaseNavigationInfo)); } export namespace BrowsingContext { - export type DownloadEnd = { - method: 'browsingContext.downloadEnd'; - params: BrowsingContext.DownloadEndParams; - }; +export type DownloadEnd = ({ +"method":("browsingContext.downloadEnd"),"params":(BrowsingContext.DownloadEndParams)}); } export namespace BrowsingContext { - export type DownloadEndParams = - | BrowsingContext.DownloadCanceledParams - | BrowsingContext.DownloadCompleteParams; +export type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams| BrowsingContext.DownloadCompleteParams))); } export namespace BrowsingContext { - export type DownloadCanceledParams = { - status: 'canceled'; - } & BrowsingContext.BaseNavigationInfo; +export type DownloadCanceledParams = ({ +"status":("canceled")}&BrowsingContext.BaseNavigationInfo); } export namespace BrowsingContext { - export type DownloadCompleteParams = { - status: 'complete'; - filepath: string | null; - } & BrowsingContext.BaseNavigationInfo; +export type DownloadCompleteParams = ({ +"status":("complete"),"filepath":(string| null)}&BrowsingContext.BaseNavigationInfo); } export namespace BrowsingContext { - export type NavigationAborted = { - method: 'browsingContext.navigationAborted'; - params: BrowsingContext.NavigationInfo; - }; +export type NavigationAborted = ({ +"method":("browsingContext.navigationAborted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type NavigationCommitted = { - method: 'browsingContext.navigationCommitted'; - params: BrowsingContext.NavigationInfo; - }; +export type NavigationCommitted = ({ +"method":("browsingContext.navigationCommitted"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type NavigationFailed = { - method: 'browsingContext.navigationFailed'; - params: BrowsingContext.NavigationInfo; - }; +export type NavigationFailed = ({ +"method":("browsingContext.navigationFailed"),"params":(BrowsingContext.NavigationInfo)}); } export namespace BrowsingContext { - export type UserPromptClosed = { - method: 'browsingContext.userPromptClosed'; - params: BrowsingContext.UserPromptClosedParameters; - }; +export type UserPromptClosed = ({ +"method":("browsingContext.userPromptClosed"),"params":(BrowsingContext.UserPromptClosedParameters)}); } export namespace BrowsingContext { - export type UserPromptClosedParameters = { - context: BrowsingContext.BrowsingContext; - accepted: boolean; - type: BrowsingContext.UserPromptType; - userText?: string; - }; +export type UserPromptClosedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"accepted":(boolean),"type":(BrowsingContext.UserPromptType),"userText"?:(string)})); } export namespace BrowsingContext { - export type UserPromptOpened = { - method: 'browsingContext.userPromptOpened'; - params: BrowsingContext.UserPromptOpenedParameters; - }; +export type UserPromptOpened = ({ +"method":("browsingContext.userPromptOpened"),"params":(BrowsingContext.UserPromptOpenedParameters)}); } export namespace BrowsingContext { - export type UserPromptOpenedParameters = { - context: BrowsingContext.BrowsingContext; - handler: Session.UserPromptHandlerType; - message: string; - type: BrowsingContext.UserPromptType; - defaultValue?: string; - }; +export type UserPromptOpenedParameters = (({ +"context":(BrowsingContext.BrowsingContext),"handler":(Session.UserPromptHandlerType),"message":(string),"type":(BrowsingContext.UserPromptType),"defaultValue"?:(string)})); } -export type EmulationCommand = - | Emulation.SetForcedColorsModeThemeOverride - | Emulation.SetGeolocationOverride - | Emulation.SetLocaleOverride - | Emulation.SetScreenOrientationOverride - | Emulation.SetScriptingEnabled - | Emulation.SetTimezoneOverride; +export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride| Emulation.SetGeolocationOverride| Emulation.SetLocaleOverride| Emulation.SetScreenOrientationOverride| Emulation.SetScriptingEnabled| Emulation.SetTimezoneOverride); export namespace Emulation { - export type SetForcedColorsModeThemeOverride = { - method: 'emulation.setForcedColorsModeThemeOverride'; - params: Emulation.SetForcedColorsModeThemeOverrideParameters; - }; +export type SetForcedColorsModeThemeOverride = ({ +"method":("emulation.setForcedColorsModeThemeOverride"),"params":(Emulation.SetForcedColorsModeThemeOverrideParameters)}); } export namespace Emulation { - export type SetForcedColorsModeThemeOverrideParameters = { - theme: Emulation.ForcedColorsModeTheme | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetForcedColorsModeThemeOverrideParameters = (({ +"theme":(Emulation.ForcedColorsModeTheme| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export const enum ForcedColorsModeTheme { - Light = 'light', - Dark = 'dark', - } +export const enum ForcedColorsModeTheme {Light = "light", +Dark = "dark", +} } export namespace Emulation { - export type SetGeolocationOverride = { - method: 'emulation.setGeolocationOverride'; - params: Emulation.SetGeolocationOverrideParameters; - }; +export type SetGeolocationOverride = ({ +"method":("emulation.setGeolocationOverride"),"params":(Emulation.SetGeolocationOverrideParameters)}); } export namespace Emulation { - export type SetGeolocationOverrideParameters = ( - | { - coordinates: Emulation.GeolocationCoordinates | null; - } - | { - error: Emulation.GeolocationPositionError; - } - ) & { - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetGeolocationOverrideParameters = (((({ +"coordinates":(Emulation.GeolocationCoordinates| null)})| ({ +"error":(Emulation.GeolocationPositionError)}))&{ +"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type GeolocationCoordinates = { - /** - * Must be between `-90` and `90`, inclusive. - */ - latitude: number; - /** - * Must be between `-180` and `180`, inclusive. - */ - longitude: number; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ - accuracy?: number; - /** - * @defaultValue `null` - */ - altitude?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - altitudeAccuracy?: number | null; - /** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ - heading?: number | null; - /** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ - speed?: number | null; - }; +export type GeolocationCoordinates = (({ + +/** + * Must be between `-90` and `90`, inclusive. + */ +"latitude":(number), +/** + * Must be between `-180` and `180`, inclusive. + */ +"longitude":(number), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ +"accuracy"?:((number)), +/** + * @defaultValue `null` + */ +"altitude"?:(number| null), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ +"altitudeAccuracy"?:((number)| null), +/** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ +"heading"?:((number)| null), +/** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ +"speed"?:((number)| null)})); } export namespace Emulation { - export type GeolocationPositionError = { - type: 'positionUnavailable'; - }; +export type GeolocationPositionError = (({ +"type":("positionUnavailable")})); } export namespace Emulation { - export type SetLocaleOverride = { - method: 'emulation.setLocaleOverride'; - params: Emulation.SetLocaleOverrideParameters; - }; +export type SetLocaleOverride = ({ +"method":("emulation.setLocaleOverride"),"params":(Emulation.SetLocaleOverrideParameters)}); } export namespace Emulation { - export type SetLocaleOverrideParameters = { - locale: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetLocaleOverrideParameters = (({ +"locale":(string| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetScreenOrientationOverride = { - method: 'emulation.setScreenOrientationOverride'; - params: Emulation.SetScreenOrientationOverrideParameters; - }; +export type SetScreenOrientationOverride = ({ +"method":("emulation.setScreenOrientationOverride"),"params":(Emulation.SetScreenOrientationOverrideParameters)}); } export namespace Emulation { - export const enum ScreenOrientationNatural { - Portrait = 'portrait', - Landscape = 'landscape', - } +export const enum ScreenOrientationNatural {Portrait = "portrait", +Landscape = "landscape", +} } export namespace Emulation { - export type ScreenOrientationType = - | 'portrait-primary' - | 'portrait-secondary' - | 'landscape-primary' - | 'landscape-secondary'; +export type ScreenOrientationType = ("portrait-primary"| "portrait-secondary"| "landscape-primary"| "landscape-secondary"); } export namespace Emulation { - export type ScreenOrientation = { - natural: Emulation.ScreenOrientationNatural; - type: Emulation.ScreenOrientationType; - }; +export type ScreenOrientation = (({ +"natural":(Emulation.ScreenOrientationNatural),"type":(Emulation.ScreenOrientationType)})); } export namespace Emulation { - export type SetScreenOrientationOverrideParameters = { - screenOrientation: Emulation.ScreenOrientation | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetScreenOrientationOverrideParameters = (({ +"screenOrientation":(Emulation.ScreenOrientation| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetScriptingEnabled = { - method: 'emulation.setScriptingEnabled'; - params: Emulation.SetScriptingEnabledParameters; - }; +export type SetScriptingEnabled = ({ +"method":("emulation.setScriptingEnabled"),"params":(Emulation.SetScriptingEnabledParameters)}); } export namespace Emulation { - export type SetScriptingEnabledParameters = { - enabled: false | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetScriptingEnabledParameters = (({ +"enabled":(false| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Emulation { - export type SetTimezoneOverride = { - method: 'emulation.setTimezoneOverride'; - params: Emulation.SetTimezoneOverrideParameters; - }; +export type SetTimezoneOverride = ({ +"method":("emulation.setTimezoneOverride"),"params":(Emulation.SetTimezoneOverrideParameters)}); } export namespace Emulation { - export type SetTimezoneOverrideParameters = { - timezone: string | null; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetTimezoneOverrideParameters = (({ +"timezone":(string| null),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export type NetworkCommand = | Network.AddDataCollector @@ -1175,214 +890,122 @@ export type NetworkEvent = | Network.ResponseCompleted | Network.ResponseStarted; export namespace Network { - export type AuthChallenge = { - scheme: string; - realm: string; - }; +export type AuthChallenge = (({ +"scheme":(string),"realm":(string)})); } export namespace Network { - export type AuthCredentials = { - type: 'password'; - username: string; - password: string; - }; +export type AuthCredentials = (({ +"type":("password"),"username":(string),"password":(string)})); } export namespace Network { - export type BaseParameters = { - context: BrowsingContext.BrowsingContext | null; - isBlocked: boolean; - navigation: BrowsingContext.Navigation | null; - redirectCount: JsUint; - request: Network.RequestData; - timestamp: JsUint; - intercepts?: [Network.Intercept, ...Network.Intercept[]]; - }; +export type BaseParameters = ({ +"context":(BrowsingContext.BrowsingContext| null),"isBlocked":(boolean),"navigation":(BrowsingContext.Navigation| null),"redirectCount":(JsUint),"request":(Network.RequestData),"timestamp":(JsUint),"intercepts"?:([ +(Network.Intercept),...(Network.Intercept)[]])}); } export namespace Network { - export type BytesValue = Network.StringValue | Network.Base64Value; +export type BytesValue = (Network.StringValue| Network.Base64Value); } export namespace Network { - export type StringValue = { - type: 'string'; - value: string; - }; +export type StringValue = (({ +"type":("string"),"value":(string)})); } export namespace Network { - export type Base64Value = { - type: 'base64'; - value: string; - }; +export type Base64Value = (({ +"type":("base64"),"value":(string)})); } export namespace Network { - export type Collector = string; +export type Collector = (string); } export namespace Network { - export const enum CollectorType { - Blob = 'blob', - } +export const enum CollectorType {Blob = "blob", +} } export namespace Network { - export const enum SameSite { - Strict = 'strict', - Lax = 'lax', - None = 'none', - Default = 'default', - } +export const enum SameSite {Strict = "strict", +Lax = "lax", +None = "none", +Default = "default", +} } export namespace Network { - export type Cookie = { - name: string; - value: Network.BytesValue; - domain: string; - path: string; - size: JsUint; - httpOnly: boolean; - secure: boolean; - sameSite: Network.SameSite; - expiry?: JsUint; - } & Extensible; +export type Cookie = (({ +"name":(string),"value":(Network.BytesValue),"domain":(string),"path":(string),"size":(JsUint),"httpOnly":(boolean),"secure":(boolean),"sameSite":(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); } export namespace Network { - export type CookieHeader = { - name: string; - value: Network.BytesValue; - }; +export type CookieHeader = (({ +"name":(string),"value":(Network.BytesValue)})); +} +export namespace Network { +export const enum DataType {Response = "response", +} } export namespace Network { - export const enum DataType { - Response = 'response', - } -} -export namespace Network { - export type FetchTimingInfo = { - timeOrigin: number; - requestTime: number; - redirectStart: number; - redirectEnd: number; - fetchStart: number; - dnsStart: number; - dnsEnd: number; - connectStart: number; - connectEnd: number; - tlsStart: number; - requestStart: number; - responseStart: number; - responseEnd: number; - }; +export type FetchTimingInfo = (({ +"timeOrigin":(number),"requestTime":(number),"redirectStart":(number),"redirectEnd":(number),"fetchStart":(number),"dnsStart":(number),"dnsEnd":(number),"connectStart":(number),"connectEnd":(number),"tlsStart":(number),"requestStart":(number),"responseStart":(number),"responseEnd":(number)})); } export namespace Network { - export type Header = { - name: string; - value: Network.BytesValue; - }; +export type Header = (({ +"name":(string),"value":(Network.BytesValue)})); } export namespace Network { - export type Initiator = { - columnNumber?: JsUint; - lineNumber?: JsUint; - request?: Network.Request; - stackTrace?: Script.StackTrace; - type?: 'parser' | 'script' | 'preflight' | 'other'; - }; +export type Initiator = (({ +"columnNumber"?:(JsUint),"lineNumber"?:(JsUint),"request"?:(Network.Request),"stackTrace"?:(Script.StackTrace),"type"?:("parser"| "script"| "preflight"| "other")})); } export namespace Network { - export type Intercept = string; +export type Intercept = (string); } export namespace Network { - export type Request = string; +export type Request = (string); } export namespace Network { - export type RequestData = { - request: Network.Request; - url: string; - method: string; - headers: [...Network.Header[]]; - cookies: [...Network.Cookie[]]; - headersSize: JsUint; - bodySize: JsUint | null; - destination: string; - initiatorType: string | null; - timings: Network.FetchTimingInfo; - }; +export type RequestData = (({ +"request":(Network.Request),"url":(string),"method":(string),"headers":([ +...((Network.Header)[])]),"cookies":([ +...((Network.Cookie)[])]),"headersSize":(JsUint),"bodySize":(JsUint| null),"destination":(string),"initiatorType":(string| null),"timings":(Network.FetchTimingInfo)})); } export namespace Network { - export type ResponseContent = { - size: JsUint; - }; +export type ResponseContent = (({ +"size":(JsUint)})); } export namespace Network { - export type ResponseData = { - url: string; - protocol: string; - status: JsUint; - statusText: string; - fromCache: boolean; - headers: [...Network.Header[]]; - mimeType: string; - bytesReceived: JsUint; - headersSize: JsUint | null; - bodySize: JsUint | null; - content: Network.ResponseContent; - authChallenges?: [...Network.AuthChallenge[]]; - }; +export type ResponseData = (({ +"url":(string),"protocol":(string),"status":(JsUint),"statusText":(string),"fromCache":(boolean),"headers":([ +...((Network.Header)[])]),"mimeType":(string),"bytesReceived":(JsUint),"headersSize":(JsUint| null),"bodySize":(JsUint| null),"content":(Network.ResponseContent),"authChallenges"?:([ +...((Network.AuthChallenge)[])])})); } export namespace Network { - export type SetCookieHeader = { - name: string; - value: Network.BytesValue; - domain?: string; - httpOnly?: boolean; - expiry?: string; - maxAge?: JsInt; - path?: string; - sameSite?: Network.SameSite; - secure?: boolean; - }; +export type SetCookieHeader = (({ +"name":(string),"value":(Network.BytesValue),"domain"?:(string),"httpOnly"?:(boolean),"expiry"?:(string),"maxAge"?:(JsInt),"path"?:(string),"sameSite"?:(Network.SameSite),"secure"?:(boolean)})); } export namespace Network { - export type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; +export type UrlPattern = ((Network.UrlPatternPattern| Network.UrlPatternString)); } export namespace Network { - export type UrlPatternPattern = { - type: 'pattern'; - protocol?: string; - hostname?: string; - port?: string; - pathname?: string; - search?: string; - }; +export type UrlPatternPattern = (({ +"type":("pattern"),"protocol"?:(string),"hostname"?:(string),"port"?:(string),"pathname"?:(string),"search"?:(string)})); } export namespace Network { - export type UrlPatternString = { - type: 'string'; - pattern: string; - }; +export type UrlPatternString = (({ +"type":("string"),"pattern":(string)})); } export namespace Network { - export type AddDataCollector = { - method: 'network.addDataCollector'; - params: Network.AddDataCollectorParameters; - }; +export type AddDataCollector = ({ +"method":("network.addDataCollector"),"params":(Network.AddDataCollectorParameters)}); } export namespace Network { - export type AddDataCollectorParameters = { - dataTypes: [Network.DataType, ...Network.DataType[]]; - maxEncodedDataSize: JsUint; - /** - * @defaultValue `"blob"` - */ - collectorType?: Network.CollectorType; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type AddDataCollectorParameters = (({ +"dataTypes":([ +(Network.DataType),...(Network.DataType)[]]),"maxEncodedDataSize":(JsUint), +/** + * @defaultValue `"blob"` + */ +"collectorType"?:(Network.CollectorType),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Network { - export type AddDataCollectorResult = { - collector: Network.Collector; - }; +export type AddDataCollectorResult = (({ +"collector":(Network.Collector)})); } export namespace Network { export type AddIntercept = { @@ -1401,188 +1024,128 @@ export namespace Network { }; } export namespace Network { - export const enum InterceptPhase { - BeforeRequestSent = 'beforeRequestSent', - ResponseStarted = 'responseStarted', - AuthRequired = 'authRequired', - } +export const enum InterceptPhase {BeforeRequestSent = "beforeRequestSent", +ResponseStarted = "responseStarted", +AuthRequired = "authRequired", +} } export namespace Network { - export type AddInterceptResult = { - intercept: Network.Intercept; - }; +export type AddInterceptResult = (({ +"intercept":(Network.Intercept)})); } export namespace Network { - export type ContinueRequest = { - method: 'network.continueRequest'; - params: Network.ContinueRequestParameters; - }; +export type ContinueRequest = ({ +"method":("network.continueRequest"),"params":(Network.ContinueRequestParameters)}); } export namespace Network { - export type ContinueRequestParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.CookieHeader[]]; - headers?: [...Network.Header[]]; - method?: string; - url?: string; - }; +export type ContinueRequestParameters = (({ +"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ +...((Network.CookieHeader)[])]),"headers"?:([ +...((Network.Header)[])]),"method"?:(string),"url"?:(string)})); } export namespace Network { - export type ContinueResponse = { - method: 'network.continueResponse'; - params: Network.ContinueResponseParameters; - }; +export type ContinueResponse = ({ +"method":("network.continueResponse"),"params":(Network.ContinueResponseParameters)}); } export namespace Network { - export type ContinueResponseParameters = { - request: Network.Request; - cookies?: [...Network.SetCookieHeader[]]; - credentials?: Network.AuthCredentials; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; +export type ContinueResponseParameters = (({ +"request":(Network.Request),"cookies"?:([ +...((Network.SetCookieHeader)[])]),"credentials"?:(Network.AuthCredentials),"headers"?:([ +...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); } export namespace Network { - export type ContinueWithAuth = { - method: 'network.continueWithAuth'; - params: Network.ContinueWithAuthParameters; - }; +export type ContinueWithAuth = ({ +"method":("network.continueWithAuth"),"params":(Network.ContinueWithAuthParameters)}); } export namespace Network { - export type ContinueWithAuthParameters = { - request: Network.Request; - } & ( - | Network.ContinueWithAuthCredentials - | Network.ContinueWithAuthNoCredentials - ); +export type ContinueWithAuthParameters = (({ +"request":(Network.Request)}&(Network.ContinueWithAuthCredentials| Network.ContinueWithAuthNoCredentials))); } export namespace Network { - export type ContinueWithAuthCredentials = { - action: 'provideCredentials'; - credentials: Network.AuthCredentials; - }; +export type ContinueWithAuthCredentials = ({ +"action":("provideCredentials"),"credentials":(Network.AuthCredentials)}); } export namespace Network { - export type ContinueWithAuthNoCredentials = { - action: 'default' | 'cancel'; - }; +export type ContinueWithAuthNoCredentials = ({ +"action":("default"| "cancel")}); } export namespace Network { - export type DisownData = { - method: 'network.disownData'; - params: Network.DisownDataParameters; - }; +export type DisownData = ({ +"method":("network.disownData"),"params":(Network.DisownDataParameters)}); } export namespace Network { - export type DisownDataParameters = { - dataType: Network.DataType; - collector: Network.Collector; - request: Network.Request; - }; +export type DisownDataParameters = (({ +"dataType":(Network.DataType),"collector":(Network.Collector),"request":(Network.Request)})); } export namespace Network { - export type FailRequest = { - method: 'network.failRequest'; - params: Network.FailRequestParameters; - }; +export type FailRequest = ({ +"method":("network.failRequest"),"params":(Network.FailRequestParameters)}); } export namespace Network { - export type FailRequestParameters = { - request: Network.Request; - }; +export type FailRequestParameters = (({ +"request":(Network.Request)})); } export namespace Network { - export type GetData = { - method: 'network.getData'; - params: Network.GetDataParameters; - }; +export type GetData = ({ +"method":("network.getData"),"params":(Network.GetDataParameters)}); } export namespace Network { - export type GetDataParameters = { - dataType: Network.DataType; - collector?: Network.Collector; - /** - * @defaultValue `false` - */ - disown?: boolean; - request: Network.Request; - }; +export type GetDataParameters = (({ +"dataType":(Network.DataType),"collector"?:(Network.Collector), +/** + * @defaultValue `false` + */ +"disown"?:(boolean),"request":(Network.Request)})); } export namespace Network { - export type GetDataResult = { - bytes: Network.BytesValue; - }; +export type GetDataResult = (({ +"bytes":(Network.BytesValue)})); } export namespace Network { - export type ProvideResponse = { - method: 'network.provideResponse'; - params: Network.ProvideResponseParameters; - }; +export type ProvideResponse = ({ +"method":("network.provideResponse"),"params":(Network.ProvideResponseParameters)}); } export namespace Network { - export type ProvideResponseParameters = { - request: Network.Request; - body?: Network.BytesValue; - cookies?: [...Network.SetCookieHeader[]]; - headers?: [...Network.Header[]]; - reasonPhrase?: string; - statusCode?: JsUint; - }; +export type ProvideResponseParameters = (({ +"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ +...((Network.SetCookieHeader)[])]),"headers"?:([ +...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); } export namespace Network { - export type RemoveDataCollector = { - method: 'network.removeDataCollector'; - params: Network.RemoveDataCollectorParameters; - }; +export type RemoveDataCollector = ({ +"method":("network.removeDataCollector"),"params":(Network.RemoveDataCollectorParameters)}); } export namespace Network { - export type RemoveDataCollectorParameters = { - collector: Network.Collector; - }; +export type RemoveDataCollectorParameters = (({ +"collector":(Network.Collector)})); } export namespace Network { - export type RemoveIntercept = { - method: 'network.removeIntercept'; - params: Network.RemoveInterceptParameters; - }; +export type RemoveIntercept = ({ +"method":("network.removeIntercept"),"params":(Network.RemoveInterceptParameters)}); } export namespace Network { - export type RemoveInterceptParameters = { - intercept: Network.Intercept; - }; +export type RemoveInterceptParameters = (({ +"intercept":(Network.Intercept)})); } export namespace Network { - export type SetCacheBehavior = { - method: 'network.setCacheBehavior'; - params: Network.SetCacheBehaviorParameters; - }; +export type SetCacheBehavior = ({ +"method":("network.setCacheBehavior"),"params":(Network.SetCacheBehaviorParameters)}); } export namespace Network { - export type SetCacheBehaviorParameters = { - cacheBehavior: 'default' | 'bypass'; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - }; +export type SetCacheBehaviorParameters = (({ +"cacheBehavior":("default"| "bypass"),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); } export namespace Network { - export type SetExtraHeaders = { - method: 'network.setExtraHeaders'; - params: Network.SetExtraHeadersParameters; - }; +export type SetExtraHeaders = ({ +"method":("network.setExtraHeaders"),"params":(Network.SetExtraHeadersParameters)}); } export namespace Network { - export type SetExtraHeadersParameters = { - headers: [...Network.Header[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - }; +export type SetExtraHeadersParameters = (({ +"headers":([ +...((Network.Header)[])]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]])})); } export namespace Network { export type AuthRequired = { @@ -1591,9 +1154,8 @@ export namespace Network { }; } export namespace Network { - export type AuthRequiredParameters = Network.BaseParameters & { - response: Network.ResponseData; - }; +export type AuthRequiredParameters = ((Network.BaseParameters&{ +"response":(Network.ResponseData)})); } export namespace Network { export type BeforeRequestSent = { @@ -1655,25 +1217,18 @@ export type ScriptEvent = | Script.RealmCreated | Script.RealmDestroyed; export namespace Script { - export type Channel = string; +export type Channel = (string); } export namespace Script { - export type ChannelValue = { - type: 'channel'; - value: Script.ChannelProperties; - }; +export type ChannelValue = (({ +"type":("channel"),"value":(Script.ChannelProperties)})); } export namespace Script { - export type ChannelProperties = { - channel: Script.Channel; - serializationOptions?: Script.SerializationOptions; - ownership?: Script.ResultOwnership; - }; +export type ChannelProperties = (({ +"channel":(Script.Channel),"serializationOptions"?:(Script.SerializationOptions),"ownership"?:(Script.ResultOwnership)})); } export namespace Script { - export type EvaluateResult = - | Script.EvaluateResultSuccess - | Script.EvaluateResultException; +export type EvaluateResult = ((Script.EvaluateResultSuccess| Script.EvaluateResultException)); } export namespace Script { export type EvaluateResultSuccess = { @@ -1705,16 +1260,7 @@ export namespace Script { export type InternalId = string; } export namespace Script { - export type LocalValue = - | Script.RemoteReference - | Script.PrimitiveProtocolValue - | Script.ChannelValue - | Script.ArrayLocalValue - | Script.DateLocalValue - | Script.MapLocalValue - | Script.ObjectLocalValue - | Script.RegExpLocalValue - | Script.SetLocalValue; +export type LocalValue = ((Script.RemoteReference| Script.PrimitiveProtocolValue| Script.ChannelValue| Script.ArrayLocalValue| (Script.DateLocalValue)| Script.MapLocalValue| Script.ObjectLocalValue| (Script.RegExpLocalValue)| Script.SetLocalValue)); } export namespace Script { export type ListLocalValue = [...Script.LocalValue[]]; @@ -1907,28 +1453,7 @@ export namespace Script { } & Extensible; } export namespace Script { - export type RemoteValue = - | Script.PrimitiveProtocolValue - | Script.SymbolRemoteValue - | Script.ArrayRemoteValue - | Script.ObjectRemoteValue - | Script.FunctionRemoteValue - | Script.RegExpRemoteValue - | Script.DateRemoteValue - | Script.MapRemoteValue - | Script.SetRemoteValue - | Script.WeakMapRemoteValue - | Script.WeakSetRemoteValue - | Script.GeneratorRemoteValue - | Script.ErrorRemoteValue - | Script.ProxyRemoteValue - | Script.PromiseRemoteValue - | Script.TypedArrayRemoteValue - | Script.ArrayBufferRemoteValue - | Script.NodeListRemoteValue - | Script.HtmlCollectionRemoteValue - | Script.NodeRemoteValue - | Script.WindowProxyRemoteValue; +export type RemoteValue = ((Script.PrimitiveProtocolValue| Script.SymbolRemoteValue| Script.ArrayRemoteValue| Script.ObjectRemoteValue| Script.FunctionRemoteValue| Script.RegExpRemoteValue| Script.DateRemoteValue| Script.MapRemoteValue| Script.SetRemoteValue| Script.WeakMapRemoteValue| Script.WeakSetRemoteValue| Script.GeneratorRemoteValue| Script.ErrorRemoteValue| Script.ProxyRemoteValue| Script.PromiseRemoteValue| Script.TypedArrayRemoteValue| Script.ArrayBufferRemoteValue| Script.NodeListRemoteValue| Script.HtmlCollectionRemoteValue| Script.NodeRemoteValue| Script.WindowProxyRemoteValue)); } export namespace Script { export type ListRemoteValue = [...Script.RemoteValue[]]; @@ -1939,258 +1464,161 @@ export namespace Script { ]; } export namespace Script { - export type SymbolRemoteValue = { - type: 'symbol'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type SymbolRemoteValue = (({ +"type":("symbol"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ArrayRemoteValue = { - type: 'array'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type ArrayRemoteValue = (({ +"type":("array"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type ObjectRemoteValue = { - type: 'object'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; +export type ObjectRemoteValue = (({ +"type":("object"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); } export namespace Script { - export type FunctionRemoteValue = { - type: 'function'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type FunctionRemoteValue = (({ +"type":("function"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type RegExpRemoteValue = Script.RegExpLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type RegExpRemoteValue = ((Script.RegExpLocalValue&{ +"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type DateRemoteValue = Script.DateLocalValue & { - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type DateRemoteValue = ((Script.DateLocalValue&{ +"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type MapRemoteValue = { - type: 'map'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.MappingRemoteValue; - }; +export type MapRemoteValue = (({ +"type":("map"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); } export namespace Script { - export type SetRemoteValue = { - type: 'set'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type SetRemoteValue = (({ +"type":("set"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type WeakMapRemoteValue = { - type: 'weakmap'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WeakMapRemoteValue = (({ +"type":("weakmap"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type WeakSetRemoteValue = { - type: 'weakset'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WeakSetRemoteValue = (({ +"type":("weakset"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type GeneratorRemoteValue = { - type: 'generator'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type GeneratorRemoteValue = (({ +"type":("generator"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ErrorRemoteValue = { - type: 'error'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ErrorRemoteValue = (({ +"type":("error"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ProxyRemoteValue = { - type: 'proxy'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ProxyRemoteValue = (({ +"type":("proxy"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type PromiseRemoteValue = { - type: 'promise'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type PromiseRemoteValue = (({ +"type":("promise"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type TypedArrayRemoteValue = { - type: 'typedarray'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type TypedArrayRemoteValue = (({ +"type":("typedarray"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type ArrayBufferRemoteValue = { - type: 'arraybuffer'; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type ArrayBufferRemoteValue = (({ +"type":("arraybuffer"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type NodeListRemoteValue = { - type: 'nodelist'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type NodeListRemoteValue = (({ +"type":("nodelist"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type HtmlCollectionRemoteValue = { - type: 'htmlcollection'; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.ListRemoteValue; - }; +export type HtmlCollectionRemoteValue = (({ +"type":("htmlcollection"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); } export namespace Script { - export type NodeRemoteValue = { - type: 'node'; - sharedId?: Script.SharedId; - handle?: Script.Handle; - internalId?: Script.InternalId; - value?: Script.NodeProperties; - }; +export type NodeRemoteValue = (({ +"type":("node"),"sharedId"?:(Script.SharedId),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.NodeProperties)})); } export namespace Script { - export type NodeProperties = { - nodeType: JsUint; - childNodeCount: JsUint; - attributes?: { - [key: string]: string; - }; - children?: [...Script.NodeRemoteValue[]]; - localName?: string; - mode?: 'open' | 'closed'; - namespaceURI?: string; - nodeValue?: string; - shadowRoot?: Script.NodeRemoteValue | null; - }; +export type NodeProperties = (({ +"nodeType":(JsUint),"childNodeCount":(JsUint),"attributes"?:(({ +[key: string]:(string)})),"children"?:([ +...((Script.NodeRemoteValue)[])]),"localName"?:(string),"mode"?:("open"| "closed"),"namespaceURI"?:(string),"nodeValue"?:(string),"shadowRoot"?:(Script.NodeRemoteValue| null)})); } export namespace Script { - export type WindowProxyRemoteValue = { - type: 'window'; - value: Script.WindowProxyProperties; - handle?: Script.Handle; - internalId?: Script.InternalId; - }; +export type WindowProxyRemoteValue = (({ +"type":("window"),"value":(Script.WindowProxyProperties),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); } export namespace Script { - export type WindowProxyProperties = { - context: BrowsingContext.BrowsingContext; - }; +export type WindowProxyProperties = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace Script { - export const enum ResultOwnership { - Root = 'root', - None = 'none', - } +export const enum ResultOwnership {Root = "root", +None = "none", +} } export namespace Script { - export type SerializationOptions = { - /** - * @defaultValue `0` - */ - maxDomDepth?: JsUint | null; - /** - * @defaultValue `null` - */ - maxObjectDepth?: JsUint | null; - /** - * @defaultValue `"none"` - */ - includeShadowTree?: 'none' | 'open' | 'all'; - }; +export type SerializationOptions = (({ + +/** + * @defaultValue `0` + */ +"maxDomDepth"?:((JsUint| null)), +/** + * @defaultValue `null` + */ +"maxObjectDepth"?:((JsUint| null)), +/** + * @defaultValue `"none"` + */ +"includeShadowTree"?:(("none"| "open"| "all"))})); } export namespace Script { - export type SharedId = string; +export type SharedId = (string); } export namespace Script { - export type StackFrame = { - columnNumber: JsUint; - functionName: string; - lineNumber: JsUint; - url: string; - }; +export type StackFrame = (({ +"columnNumber":(JsUint),"functionName":(string),"lineNumber":(JsUint),"url":(string)})); } export namespace Script { - export type StackTrace = { - callFrames: [...Script.StackFrame[]]; - }; +export type StackTrace = (({ +"callFrames":([ +...((Script.StackFrame)[])])})); } export namespace Script { - export type Source = { - realm: Script.Realm; - context?: BrowsingContext.BrowsingContext; - }; +export type Source = (({ +"realm":(Script.Realm),"context"?:(BrowsingContext.BrowsingContext)})); } export namespace Script { - export type RealmTarget = { - realm: Script.Realm; - }; +export type RealmTarget = (({ +"realm":(Script.Realm)})); } export namespace Script { - export type ContextTarget = { - context: BrowsingContext.BrowsingContext; - sandbox?: string; - }; +export type ContextTarget = (({ +"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); } export namespace Script { - export type Target = Script.ContextTarget | Script.RealmTarget; +export type Target = ((Script.ContextTarget| Script.RealmTarget)); } export namespace Script { - export type AddPreloadScript = { - method: 'script.addPreloadScript'; - params: Script.AddPreloadScriptParameters; - }; +export type AddPreloadScript = ({ +"method":("script.addPreloadScript"),"params":(Script.AddPreloadScriptParameters)}); } export namespace Script { - export type AddPreloadScriptParameters = { - functionDeclaration: string; - arguments?: [...Script.ChannelValue[]]; - contexts?: [ - BrowsingContext.BrowsingContext, - ...BrowsingContext.BrowsingContext[], - ]; - userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; - sandbox?: string; - }; +export type AddPreloadScriptParameters = (({ +"functionDeclaration":(string),"arguments"?:([ +...((Script.ChannelValue)[])]),"contexts"?:([ +(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ +(Browser.UserContext),...(Browser.UserContext)[]]),"sandbox"?:(string)})); } export namespace Script { - export type AddPreloadScriptResult = { - script: Script.PreloadScript; - }; +export type AddPreloadScriptResult = (({ +"script":(Script.PreloadScript)})); } export namespace Script { - export type Disown = { - method: 'script.disown'; - params: Script.DisownParameters; - }; +export type Disown = ({ +"method":("script.disown"),"params":(Script.DisownParameters)}); } export namespace Script { export type DisownParameters = { @@ -2205,66 +1633,46 @@ export namespace Script { }; } export namespace Script { - export type CallFunctionParameters = { - functionDeclaration: string; - awaitPromise: boolean; - target: Script.Target; - arguments?: [...Script.LocalValue[]]; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - this?: Script.LocalValue; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; +export type CallFunctionParameters = (({ +"functionDeclaration":(string),"awaitPromise":(boolean),"target":(Script.Target),"arguments"?:([ +...((Script.LocalValue)[])]),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions),"this"?:(Script.LocalValue), +/** + * @defaultValue `false` + */ +"userActivation"?:(boolean)})); } export namespace Script { - export type Evaluate = { - method: 'script.evaluate'; - params: Script.EvaluateParameters; - }; +export type Evaluate = ({ +"method":("script.evaluate"),"params":(Script.EvaluateParameters)}); } export namespace Script { - export type EvaluateParameters = { - expression: string; - target: Script.Target; - awaitPromise: boolean; - resultOwnership?: Script.ResultOwnership; - serializationOptions?: Script.SerializationOptions; - /** - * @defaultValue `false` - */ - userActivation?: boolean; - }; +export type EvaluateParameters = (({ +"expression":(string),"target":(Script.Target),"awaitPromise":(boolean),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions), +/** + * @defaultValue `false` + */ +"userActivation"?:(boolean)})); } export namespace Script { - export type GetRealms = { - method: 'script.getRealms'; - params: Script.GetRealmsParameters; - }; +export type GetRealms = ({ +"method":("script.getRealms"),"params":(Script.GetRealmsParameters)}); } export namespace Script { - export type GetRealmsParameters = { - context?: BrowsingContext.BrowsingContext; - type?: Script.RealmType; - }; +export type GetRealmsParameters = (({ +"context"?:(BrowsingContext.BrowsingContext),"type"?:(Script.RealmType)})); } export namespace Script { - export type GetRealmsResult = { - realms: [...Script.RealmInfo[]]; - }; +export type GetRealmsResult = (({ +"realms":([ +...((Script.RealmInfo)[])])})); } export namespace Script { - export type RemovePreloadScript = { - method: 'script.removePreloadScript'; - params: Script.RemovePreloadScriptParameters; - }; +export type RemovePreloadScript = ({ +"method":("script.removePreloadScript"),"params":(Script.RemovePreloadScriptParameters)}); } export namespace Script { - export type RemovePreloadScriptParameters = { - script: Script.PreloadScript; - }; +export type RemovePreloadScriptParameters = (({ +"script":(Script.PreloadScript)})); } export namespace Script { export type Message = { @@ -2286,182 +1694,112 @@ export namespace Script { }; } export namespace Script { - export type RealmDestroyed = { - method: 'script.realmDestroyed'; - params: Script.RealmDestroyedParameters; - }; +export type RealmDestroyed = ({ +"method":("script.realmDestroyed"),"params":(Script.RealmDestroyedParameters)}); } export namespace Script { - export type RealmDestroyedParameters = { - realm: Script.Realm; - }; +export type RealmDestroyedParameters = (({ +"realm":(Script.Realm)})); } -export type StorageCommand = - | Storage.DeleteCookies - | Storage.GetCookies - | Storage.SetCookie; -export type StorageResult = - | Storage.DeleteCookiesResult - | Storage.GetCookiesResult - | Storage.SetCookieResult; +export type StorageCommand = (Storage.DeleteCookies| Storage.GetCookies| Storage.SetCookie); +export type StorageResult = ((Storage.DeleteCookiesResult| Storage.GetCookiesResult| Storage.SetCookieResult)); export namespace Storage { - export type PartitionKey = { - userContext?: string; - sourceOrigin?: string; - } & Extensible; +export type PartitionKey = (({ +"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); } export namespace Storage { - export type GetCookies = { - method: 'storage.getCookies'; - params: Storage.GetCookiesParameters; - }; +export type GetCookies = ({ +"method":("storage.getCookies"),"params":(Storage.GetCookiesParameters)}); } export namespace Storage { - export type CookieFilter = { - name?: string; - value?: Network.BytesValue; - domain?: string; - path?: string; - size?: JsUint; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; +export type CookieFilter = (({ +"name"?:(string),"value"?:(Network.BytesValue),"domain"?:(string),"path"?:(string),"size"?:(JsUint),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); } export namespace Storage { - export type BrowsingContextPartitionDescriptor = { - type: 'context'; - context: BrowsingContext.BrowsingContext; - }; +export type BrowsingContextPartitionDescriptor = (({ +"type":("context"),"context":(BrowsingContext.BrowsingContext)})); } export namespace Storage { - export type StorageKeyPartitionDescriptor = { - type: 'storageKey'; - userContext?: string; - sourceOrigin?: string; - } & Extensible; +export type StorageKeyPartitionDescriptor = (({ +"type":("storageKey"),"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); } export namespace Storage { - export type PartitionDescriptor = - | Storage.BrowsingContextPartitionDescriptor - | Storage.StorageKeyPartitionDescriptor; +export type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor| Storage.StorageKeyPartitionDescriptor)); } export namespace Storage { - export type GetCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; +export type GetCookiesParameters = (({ +"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type GetCookiesResult = { - cookies: [...Network.Cookie[]]; - partitionKey: Storage.PartitionKey; - }; +export type GetCookiesResult = (({ +"cookies":([ +...((Network.Cookie)[])]),"partitionKey":(Storage.PartitionKey)})); } export namespace Storage { - export type SetCookie = { - method: 'storage.setCookie'; - params: Storage.SetCookieParameters; - }; +export type SetCookie = ({ +"method":("storage.setCookie"),"params":(Storage.SetCookieParameters)}); } export namespace Storage { - export type PartialCookie = { - name: string; - value: Network.BytesValue; - domain: string; - path?: string; - httpOnly?: boolean; - secure?: boolean; - sameSite?: Network.SameSite; - expiry?: JsUint; - } & Extensible; +export type PartialCookie = (({ +"name":(string),"value":(Network.BytesValue),"domain":(string),"path"?:(string),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); } export namespace Storage { - export type SetCookieParameters = { - cookie: Storage.PartialCookie; - partition?: Storage.PartitionDescriptor; - }; +export type SetCookieParameters = (({ +"cookie":(Storage.PartialCookie),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type SetCookieResult = { - partitionKey: Storage.PartitionKey; - }; +export type SetCookieResult = (({ +"partitionKey":(Storage.PartitionKey)})); } export namespace Storage { - export type DeleteCookies = { - method: 'storage.deleteCookies'; - params: Storage.DeleteCookiesParameters; - }; +export type DeleteCookies = ({ +"method":("storage.deleteCookies"),"params":(Storage.DeleteCookiesParameters)}); } export namespace Storage { - export type DeleteCookiesParameters = { - filter?: Storage.CookieFilter; - partition?: Storage.PartitionDescriptor; - }; +export type DeleteCookiesParameters = (({ +"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); } export namespace Storage { - export type DeleteCookiesResult = { - partitionKey: Storage.PartitionKey; - }; +export type DeleteCookiesResult = (({ +"partitionKey":(Storage.PartitionKey)})); } -export type LogEvent = Log.EntryAdded; +export type LogEvent = (Log.EntryAdded); export namespace Log { - export const enum Level { - Debug = 'debug', - Info = 'info', - Warn = 'warn', - Error = 'error', - } +export const enum Level {Debug = "debug", +Info = "info", +Warn = "warn", +Error = "error", +} } export namespace Log { - export type Entry = - | Log.GenericLogEntry - | Log.ConsoleLogEntry - | Log.JavascriptLogEntry; +export type Entry = ((Log.GenericLogEntry| Log.ConsoleLogEntry| Log.JavascriptLogEntry)); } export namespace Log { - export type BaseLogEntry = { - level: Log.Level; - source: Script.Source; - text: string | null; - timestamp: JsUint; - stackTrace?: Script.StackTrace; - }; +export type BaseLogEntry = ({ +"level":(Log.Level),"source":(Script.Source),"text":(string| null),"timestamp":(JsUint),"stackTrace"?:(Script.StackTrace)}); } export namespace Log { - export type GenericLogEntry = Log.BaseLogEntry & { - type: string; - }; +export type GenericLogEntry = ((Log.BaseLogEntry&{ +"type":(string)})); } export namespace Log { - export type ConsoleLogEntry = Log.BaseLogEntry & { - type: 'console'; - method: string; - args: [...Script.RemoteValue[]]; - }; +export type ConsoleLogEntry = ((Log.BaseLogEntry&{ +"type":("console"),"method":(string),"args":([ +...((Script.RemoteValue)[])])})); } export namespace Log { - export type JavascriptLogEntry = Log.BaseLogEntry & { - type: 'javascript'; - }; +export type JavascriptLogEntry = ((Log.BaseLogEntry&{ +"type":("javascript")})); } export namespace Log { - export type EntryAdded = { - method: 'log.entryAdded'; - params: Log.Entry; - }; +export type EntryAdded = ({ +"method":("log.entryAdded"),"params":(Log.Entry)}); } -export type InputCommand = - | Input.PerformActions - | Input.ReleaseActions - | Input.SetFiles; -export type InputEvent = Input.FileDialogOpened; +export type InputCommand = (Input.PerformActions| Input.ReleaseActions| Input.SetFiles); +export type InputEvent = (Input.FileDialogOpened); export namespace Input { - export type ElementOrigin = { - type: 'element'; - element: Script.SharedReference; - }; +export type ElementOrigin = (({ +"type":("element"),"element":(Script.SharedReference)})); } export namespace Input { export type PerformActions = { @@ -2514,26 +1852,21 @@ export namespace Input { }; } export namespace Input { - export const enum PointerType { - Mouse = 'mouse', - Pen = 'pen', - Touch = 'touch', - } +export const enum PointerType {Mouse = "mouse", +Pen = "pen", +Touch = "touch", +} } export namespace Input { - export type PointerParameters = { - /** - * @defaultValue `"mouse"` - */ - pointerType?: Input.PointerType; - }; +export type PointerParameters = (({ + +/** + * @defaultValue `"mouse"` + */ +"pointerType"?:(Input.PointerType)})); } export namespace Input { - export type PointerSourceAction = - | Input.PauseAction - | Input.PointerDownAction - | Input.PointerUpAction - | Input.PointerMoveAction; +export type PointerSourceAction = ((Input.PauseAction| Input.PointerDownAction| Input.PointerUpAction| Input.PointerMoveAction)); } export namespace Input { export type WheelSourceActions = { @@ -2599,87 +1932,100 @@ export namespace Input { }; } export namespace Input { - export type PointerCommonProperties = { - /** - * @defaultValue `1` - */ - width?: JsUint; - /** - * @defaultValue `1` - */ - height?: JsUint; - /** - * @defaultValue `0` - */ - pressure?: number; - /** - * @defaultValue `0` - */ - tangentialPressure?: number; - /** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ - twist?: number; - /** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ - altitudeAngle?: number; - /** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ - azimuthAngle?: number; - }; +export type PointerCommonProperties = ({ + +/** + * @defaultValue `1` + */ +"width"?:(JsUint), +/** + * @defaultValue `1` + */ +"height"?:(JsUint), +/** + * @defaultValue `0` + */ +"pressure"?:(number), +/** + * @defaultValue `0` + */ +"tangentialPressure"?:(number), +/** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ +"twist"?:((number)), +/** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ +"altitudeAngle"?:((number)), +/** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ +"azimuthAngle"?:((number))}); } export namespace Input { - export type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; +export type Origin = ("viewport"| "pointer"| Input.ElementOrigin); } export namespace Input { - export type ReleaseActions = { - method: 'input.releaseActions'; - params: Input.ReleaseActionsParameters; - }; +export type ReleaseActions = ({ +"method":("input.releaseActions"),"params":(Input.ReleaseActionsParameters)}); } export namespace Input { - export type ReleaseActionsParameters = { - context: BrowsingContext.BrowsingContext; - }; +export type ReleaseActionsParameters = (({ +"context":(BrowsingContext.BrowsingContext)})); } export namespace Input { - export type SetFiles = { - method: 'input.setFiles'; - params: Input.SetFilesParameters; - }; +export type SetFiles = ({ +"method":("input.setFiles"),"params":(Input.SetFilesParameters)}); } export namespace Input { - export type SetFilesParameters = { - context: BrowsingContext.BrowsingContext; - element: Script.SharedReference; - files: [...string[]]; - }; +export type SetFilesParameters = (({ +"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"files":([ +...((string)[])])})); +} +export type AutofillCommand = (Autofill.Trigger); +export namespace Autofill { +export type Trigger = ({ +"method":("autofill.trigger"),"params":(Autofill.TriggerParameters)}); +} +export namespace Autofill { +export type TriggerParameters = (({ +"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"field":(Autofill.Field),"card":(Autofill.Card),"address":(Autofill.Address)})); +} +export namespace Autofill { +export type Field = (({ +"name":(Autofill.FieldName),"value":(string)})); +} +export namespace Autofill { +export type Card = (({ +"number":(string),"name":(string),"expiryMonth":(string),"expiryYear":(string),"cvc":(string)})); +} +export namespace Autofill { +export type Address = (({ +"fields":([ +...((Autofill.Field)[])])})); +} +export namespace Autofill { +export type FieldName = (string); } export namespace Input { - export type FileDialogOpened = { - method: 'input.fileDialogOpened'; - params: Input.FileDialogInfo; - }; +export type FileDialogOpened = ({ +"method":("input.fileDialogOpened"),"params":(Input.FileDialogInfo)}); } export namespace Input { - export type FileDialogInfo = { - context: BrowsingContext.BrowsingContext; - element?: Script.SharedReference; - multiple: boolean; - }; +export type FileDialogInfo = (({ +"context":(BrowsingContext.BrowsingContext),"element"?:(Script.SharedReference),"multiple":(boolean)})); } -export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; -export type WebExtensionResult = WebExtension.InstallResult; +export type WebExtensionCommand = (WebExtension.Install| WebExtension.Uninstall); +export type WebExtensionResult = ((WebExtension.InstallResult)); export namespace WebExtension { - export type Extension = string; +export type Extension = (string); } export namespace WebExtension { export type Install = { @@ -2693,42 +2039,29 @@ export namespace WebExtension { }; } export namespace WebExtension { - export type ExtensionData = - | WebExtension.ExtensionArchivePath - | WebExtension.ExtensionBase64Encoded - | WebExtension.ExtensionPath; +export type ExtensionData = ((WebExtension.ExtensionArchivePath| WebExtension.ExtensionBase64Encoded| WebExtension.ExtensionPath)); } export namespace WebExtension { - export type ExtensionPath = { - type: 'path'; - path: string; - }; +export type ExtensionPath = (({ +"type":("path"),"path":(string)})); } export namespace WebExtension { - export type ExtensionArchivePath = { - type: 'archivePath'; - path: string; - }; +export type ExtensionArchivePath = (({ +"type":("archivePath"),"path":(string)})); } export namespace WebExtension { - export type ExtensionBase64Encoded = { - type: 'base64'; - value: string; - }; +export type ExtensionBase64Encoded = (({ +"type":("base64"),"value":(string)})); } export namespace WebExtension { - export type InstallResult = { - extension: WebExtension.Extension; - }; +export type InstallResult = (({ +"extension":(WebExtension.Extension)})); } export namespace WebExtension { - export type Uninstall = { - method: 'webExtension.uninstall'; - params: WebExtension.UninstallParameters; - }; +export type Uninstall = ({ +"method":("webExtension.uninstall"),"params":(WebExtension.UninstallParameters)}); } export namespace WebExtension { - export type UninstallParameters = { - extension: WebExtension.Extension; - }; +export type UninstallParameters = (({ +"extension":(WebExtension.Extension)})); } From e6e80cb1d2522478cfa9e5535bb0707296dbf281 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 4 Sep 2025 07:01:06 +0200 Subject: [PATCH 2/4] Fix up generated content --- .../modules/autofill/AutofillProcessor.ts | 4 +- .../generated/webdriver-bidi.ts | 3108 ++++++++++++----- src/protocol/generated/webdriver-bidi.ts | 2651 ++++++++------ 3 files changed, 3893 insertions(+), 1870 deletions(-) diff --git a/src/bidiMapper/modules/autofill/AutofillProcessor.ts b/src/bidiMapper/modules/autofill/AutofillProcessor.ts index a1b9a4461a..d5f277e69d 100644 --- a/src/bidiMapper/modules/autofill/AutofillProcessor.ts +++ b/src/bidiMapper/modules/autofill/AutofillProcessor.ts @@ -44,7 +44,7 @@ export class AutofillProcessor { fieldId: Number(params.element.sharedId), frameId: undefined, card: params.card, - address: params.address + address: params.address, }); return {}; } catch (err) { @@ -56,4 +56,4 @@ export class AutofillProcessor { throw err; } } -} \ No newline at end of file +} diff --git a/src/protocol-parser/generated/webdriver-bidi.ts b/src/protocol-parser/generated/webdriver-bidi.ts index ce248afde7..11bd177eb8 100644 --- a/src/protocol-parser/generated/webdriver-bidi.ts +++ b/src/protocol-parser/generated/webdriver-bidi.ts @@ -1,4 +1,3 @@ - /** * Copyright 2024 Google LLC. * Copyright (c) Microsoft Corporation. @@ -17,7 +16,7 @@ */ /** - * THIS FILE IS AUTOGENERATED by cddlconv 0.1.7. + * THIS FILE IS AUTOGENERATED by cddlconv 0.1.6. * Run `node tools/generate-bidi-types.mjs` to regenerate. * @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs */ @@ -27,6 +26,14 @@ import z from 'zod'; +export const EventSchema = z.lazy(() => + z + .object({ + type: z.literal('event'), + }) + .and(EventDataSchema) + .and(ExtensibleSchema), +); export const CommandSchema = z.lazy(() => z .object({ @@ -35,6 +42,24 @@ export const CommandSchema = z.lazy(() => .and(CommandDataSchema) .and(ExtensibleSchema), ); +export const CommandResponseSchema = z.lazy(() => + z + .object({ + type: z.literal('success'), + id: JsUintSchema, + result: ResultDataSchema, + }) + .and(ExtensibleSchema), +); +export const EventDataSchema = z.lazy(() => + z.union([ + BrowsingContextEventSchema, + InputEventSchema, + LogEventSchema, + NetworkEventSchema, + ScriptEventSchema, + ]), +); export const CommandDataSchema = z.lazy(() => z.union([ BrowserCommandSchema, @@ -46,32 +71,9 @@ export const CommandDataSchema = z.lazy(() => SessionCommandSchema, StorageCommandSchema, WebExtensionCommandSchema, + AutofillCommandSchema, ]), ); -export const EmptyParamsSchema = z.lazy(() => ExtensibleSchema); -export const MessageSchema = z.lazy(() => - z.union([CommandResponseSchema, ErrorResponseSchema, EventSchema]), -); -export const CommandResponseSchema = z.lazy(() => - z - .object({ - type: z.literal('success'), - id: JsUintSchema, - result: ResultDataSchema, - }) - .and(ExtensibleSchema), -); -export const ErrorResponseSchema = z.lazy(() => - z - .object({ - type: z.literal('error'), - id: z.union([JsUintSchema, z.null()]), - error: ErrorCodeSchema, - message: z.string(), - stacktrace: z.string().optional(), - }) - .and(ExtensibleSchema), -); export const ResultDataSchema = z.lazy(() => z.union([ BrowsingContextResultSchema, @@ -83,24 +85,22 @@ export const ResultDataSchema = z.lazy(() => WebExtensionResultSchema, ]), ); -export const EmptyResultSchema = z.lazy(() => ExtensibleSchema); -export const EventSchema = z.lazy(() => +export const EmptyParamsSchema = z.lazy(() => ExtensibleSchema); +export const MessageSchema = z.lazy(() => + z.union([CommandResponseSchema, ErrorResponseSchema, EventSchema]), +); +export const ErrorResponseSchema = z.lazy(() => z .object({ - type: z.literal('event'), + type: z.literal('error'), + id: z.union([JsUintSchema, z.null()]), + error: ErrorCodeSchema, + message: z.string(), + stacktrace: z.string().optional(), }) - .and(EventDataSchema) .and(ExtensibleSchema), ); -export const EventDataSchema = z.lazy(() => - z.union([ - BrowsingContextEventSchema, - InputEventSchema, - LogEventSchema, - NetworkEventSchema, - ScriptEventSchema, - ]), -); +export const EmptyResultSchema = z.lazy(() => ExtensibleSchema); export const ExtensibleSchema = z.lazy(() => z.record(z.string(), z.any())); export const JsIntSchema = z .number() @@ -117,6 +117,7 @@ export const ErrorCodeSchema = z.lazy(() => z.enum([ 'invalid argument', 'invalid selector', + 'invalid element state', 'invalid session id', 'invalid web extension', 'move target out of bounds', @@ -155,6 +156,17 @@ export const SessionCommandSchema = z.lazy(() => Session.UnsubscribeSchema, ]), ); +export namespace Session { + export const ProxyConfigurationSchema = z.lazy(() => + z.union([ + Session.AutodetectProxyConfigurationSchema, + Session.DirectProxyConfigurationSchema, + Session.ManualProxyConfigurationSchema, + Session.PacProxyConfigurationSchema, + Session.SystemProxyConfigurationSchema, + ]), + ); +} export const SessionResultSchema = z.lazy(() => z.union([ Session.NewResultSchema, @@ -185,211 +197,363 @@ export namespace Session { ); } export namespace Session { - export const ProxyConfigurationSchema = z.lazy(() => - z.union([ - Session.AutodetectProxyConfigurationSchema, - Session.DirectProxyConfigurationSchema, - Session.ManualProxyConfigurationSchema, - Session.PacProxyConfigurationSchema, - Session.SystemProxyConfigurationSchema, - ]), + export const AutodetectProxyConfigurationSchema = z.lazy(() => + z + .object({ + proxyType: z.literal('autodetect'), + }) + .and(ExtensibleSchema), ); } export namespace Session { -export const -AutodetectProxyConfigurationSchema = z.lazy(() => z.object({ -"proxyType":z.literal("autodetect")}).and( -ExtensibleSchema) -); -} -export namespace Session { -export const -DirectProxyConfigurationSchema = z.lazy(() => z.object({ -"proxyType":z.literal("direct")}).and( -ExtensibleSchema) -); + export const DirectProxyConfigurationSchema = z.lazy(() => + z + .object({ + proxyType: z.literal('direct'), + }) + .and(ExtensibleSchema), + ); } export namespace Session { -export const -ManualProxyConfigurationSchema = z.lazy(() => z.object({ -"proxyType":z.literal("manual"),"httpProxy":z.string().optional(),"sslProxy":z.string().optional()}).and( -Session.SocksProxyConfigurationSchema.or(z.object({}))) -.and( -z.object({ -"noProxy":z.array(z.string()).optional()})) -.and( -ExtensibleSchema) -); + export const ManualProxyConfigurationSchema = z.lazy(() => + z + .object({ + proxyType: z.literal('manual'), + httpProxy: z.string().optional(), + sslProxy: z.string().optional(), + }) + .and(Session.SocksProxyConfigurationSchema.or(z.object({}))) + .and( + z.object({ + noProxy: z.array(z.string()).optional(), + }), + ) + .and(ExtensibleSchema), + ); } export namespace Session { -export const -SocksProxyConfigurationSchema = z.lazy(() => z.object({ -"socksProxy":z.string(),"socksVersion":z.number().int().nonnegative().gte(0).lte(255)})); + export const SocksProxyConfigurationSchema = z.lazy(() => + z.object({ + socksProxy: z.string(), + socksVersion: z.number().int().nonnegative().gte(0).lte(255), + }), + ); } export namespace Session { -export const -PacProxyConfigurationSchema = z.lazy(() => z.object({ -"proxyType":z.literal("pac"),"proxyAutoconfigUrl":z.string()}).and( -ExtensibleSchema) -); + export const PacProxyConfigurationSchema = z.lazy(() => + z + .object({ + proxyType: z.literal('pac'), + proxyAutoconfigUrl: z.string(), + }) + .and(ExtensibleSchema), + ); } export namespace Session { -export const -SystemProxyConfigurationSchema = z.lazy(() => z.object({ -"proxyType":z.literal("system")}).and( -ExtensibleSchema) -); + export const SystemProxyConfigurationSchema = z.lazy(() => + z + .object({ + proxyType: z.literal('system'), + }) + .and(ExtensibleSchema), + ); } export namespace Session { -export const UserPromptHandlerSchema = z.lazy(() => z.object({ -"alert":Session.UserPromptHandlerTypeSchema.optional(),"beforeUnload":Session.UserPromptHandlerTypeSchema.optional(),"confirm":Session.UserPromptHandlerTypeSchema.optional(),"default":Session.UserPromptHandlerTypeSchema.optional(),"file":Session.UserPromptHandlerTypeSchema.optional(),"prompt":Session.UserPromptHandlerTypeSchema.optional()})); + export const UserPromptHandlerSchema = z.lazy(() => + z.object({ + alert: Session.UserPromptHandlerTypeSchema.optional(), + beforeUnload: Session.UserPromptHandlerTypeSchema.optional(), + confirm: Session.UserPromptHandlerTypeSchema.optional(), + default: Session.UserPromptHandlerTypeSchema.optional(), + file: Session.UserPromptHandlerTypeSchema.optional(), + prompt: Session.UserPromptHandlerTypeSchema.optional(), + }), + ); } export namespace Session { -export const UserPromptHandlerTypeSchema = z.lazy(() => z.enum(["accept","dismiss","ignore",])); + export const UserPromptHandlerTypeSchema = z.lazy(() => + z.enum(['accept', 'dismiss', 'ignore']), + ); } export namespace Session { -export const SubscriptionSchema = z.lazy(() => z.string()); + export const SubscriptionSchema = z.lazy(() => z.string()); } export namespace Session { -export const SubscriptionRequestSchema = z.lazy(() => z.object({ -"events":z.array(z.string()).min(1),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SubscriptionRequestSchema = z.lazy(() => + z.object({ + events: z.array(z.string()).min(1), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Session { -export const UnsubscribeByIdRequestSchema = z.lazy(() => z.object({ -"subscriptions":z.array(Session.SubscriptionSchema).min(1)})); + export const UnsubscribeByIdRequestSchema = z.lazy(() => + z.object({ + subscriptions: z.array(Session.SubscriptionSchema).min(1), + }), + ); } export namespace Session { -export const UnsubscribeByAttributesRequestSchema = z.lazy(() => z.object({ -"events":z.array(z.string()).min(1),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional()})); + export const UnsubscribeByAttributesRequestSchema = z.lazy(() => + z.object({ + events: z.array(z.string()).min(1), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + }), + ); } export namespace Session { -export const -StatusSchema = z.lazy(() => z.object({ -"method":z.literal("session.status"),"params":EmptyParamsSchema})); + export const StatusSchema = z.lazy(() => + z.object({ + method: z.literal('session.status'), + params: EmptyParamsSchema, + }), + ); } export namespace Session { -export const StatusResultSchema = z.lazy(() => z.object({ -"ready":z.boolean(),"message":z.string()})); + export const StatusResultSchema = z.lazy(() => + z.object({ + ready: z.boolean(), + message: z.string(), + }), + ); } export namespace Session { -export const -NewSchema = z.lazy(() => z.object({ -"method":z.literal("session.new"),"params":Session.NewParametersSchema})); + export const NewSchema = z.lazy(() => + z.object({ + method: z.literal('session.new'), + params: Session.NewParametersSchema, + }), + ); } export namespace Session { -export const NewParametersSchema = z.lazy(() => z.object({ -"capabilities":Session.CapabilitiesRequestSchema})); + export const NewParametersSchema = z.lazy(() => + z.object({ + capabilities: Session.CapabilitiesRequestSchema, + }), + ); } export namespace Session { -export const NewResultSchema = z.lazy(() => z.object({ -"sessionId":z.string(),"capabilities":z.object({ -"acceptInsecureCerts":z.boolean(),"browserName":z.string(),"browserVersion":z.string(),"platformName":z.string(),"setWindowRect":z.boolean(),"userAgent":z.string(),"proxy":Session.ProxyConfigurationSchema.optional(),"unhandledPromptBehavior":Session.UserPromptHandlerSchema.optional(),"webSocketUrl":z.string().optional()}).and( -ExtensibleSchema) -})); + export const NewResultSchema = z.lazy(() => + z.object({ + sessionId: z.string(), + capabilities: z + .object({ + acceptInsecureCerts: z.boolean(), + browserName: z.string(), + browserVersion: z.string(), + platformName: z.string(), + setWindowRect: z.boolean(), + userAgent: z.string(), + proxy: Session.ProxyConfigurationSchema.optional(), + unhandledPromptBehavior: Session.UserPromptHandlerSchema.optional(), + webSocketUrl: z.string().optional(), + }) + .and(ExtensibleSchema), + }), + ); } export namespace Session { -export const -EndSchema = z.lazy(() => z.object({ -"method":z.literal("session.end"),"params":EmptyParamsSchema})); + export const EndSchema = z.lazy(() => + z.object({ + method: z.literal('session.end'), + params: EmptyParamsSchema, + }), + ); } export namespace Session { -export const -SubscribeSchema = z.lazy(() => z.object({ -"method":z.literal("session.subscribe"),"params":Session.SubscriptionRequestSchema})); + export const SubscribeSchema = z.lazy(() => + z.object({ + method: z.literal('session.subscribe'), + params: Session.SubscriptionRequestSchema, + }), + ); } export namespace Session { -export const SubscribeResultSchema = z.lazy(() => z.object({ -"subscription":Session.SubscriptionSchema})); + export const SubscribeResultSchema = z.lazy(() => + z.object({ + subscription: Session.SubscriptionSchema, + }), + ); } export namespace Session { -export const -UnsubscribeSchema = z.lazy(() => z.object({ -"method":z.literal("session.unsubscribe"),"params":Session.UnsubscribeParametersSchema})); + export const UnsubscribeSchema = z.lazy(() => + z.object({ + method: z.literal('session.unsubscribe'), + params: Session.UnsubscribeParametersSchema, + }), + ); } export namespace Session { -export const UnsubscribeParametersSchema = z.lazy(() => z.union([Session.UnsubscribeByAttributesRequestSchema,Session.UnsubscribeByIdRequestSchema])); + export const UnsubscribeParametersSchema = z.lazy(() => + z.union([ + Session.UnsubscribeByAttributesRequestSchema, + Session.UnsubscribeByIdRequestSchema, + ]), + ); } -export const -BrowserCommandSchema = z.lazy(() => z.union([Browser.CloseSchema,Browser.CreateUserContextSchema,Browser.GetClientWindowsSchema,Browser.GetUserContextsSchema,Browser.RemoveUserContextSchema,Browser.SetClientWindowStateSchema])); -export const BrowserResultSchema = z.lazy(() => z.union([Browser.CreateUserContextResultSchema,Browser.GetUserContextsResultSchema])); +export const BrowserCommandSchema = z.lazy(() => + z.union([ + Browser.CloseSchema, + Browser.CreateUserContextSchema, + Browser.GetClientWindowsSchema, + Browser.GetUserContextsSchema, + Browser.RemoveUserContextSchema, + Browser.SetClientWindowStateSchema, + ]), +); +export const BrowserResultSchema = z.lazy(() => + z.union([ + Browser.CreateUserContextResultSchema, + Browser.GetUserContextsResultSchema, + ]), +); export namespace Browser { -export const ClientWindowSchema = z.lazy(() => z.string()); + export const ClientWindowSchema = z.lazy(() => z.string()); } export namespace Browser { -export const ClientWindowInfoSchema = z.lazy(() => z.object({ -"active":z.boolean(),"clientWindow":Browser.ClientWindowSchema,"height":JsUintSchema,"state":z.enum(["fullscreen","maximized","minimized","normal",]),"width":JsUintSchema,"x":JsIntSchema,"y":JsIntSchema})); + export const ClientWindowInfoSchema = z.lazy(() => + z.object({ + active: z.boolean(), + clientWindow: Browser.ClientWindowSchema, + height: JsUintSchema, + state: z.enum(['fullscreen', 'maximized', 'minimized', 'normal']), + width: JsUintSchema, + x: JsIntSchema, + y: JsIntSchema, + }), + ); } export namespace Browser { -export const UserContextSchema = z.lazy(() => z.string()); + export const UserContextSchema = z.lazy(() => z.string()); } export namespace Browser { -export const UserContextInfoSchema = z.lazy(() => z.object({ -"userContext":Browser.UserContextSchema})); + export const UserContextInfoSchema = z.lazy(() => + z.object({ + userContext: Browser.UserContextSchema, + }), + ); } export namespace Browser { -export const -CloseSchema = z.lazy(() => z.object({ -"method":z.literal("browser.close"),"params":EmptyParamsSchema})); + export const CloseSchema = z.lazy(() => + z.object({ + method: z.literal('browser.close'), + params: EmptyParamsSchema, + }), + ); } export namespace Browser { -export const -CreateUserContextSchema = z.lazy(() => z.object({ -"method":z.literal("browser.createUserContext"),"params":Browser.CreateUserContextParametersSchema})); + export const CreateUserContextSchema = z.lazy(() => + z.object({ + method: z.literal('browser.createUserContext'), + params: Browser.CreateUserContextParametersSchema, + }), + ); } export namespace Browser { -export const CreateUserContextParametersSchema = z.lazy(() => z.object({ -"acceptInsecureCerts":z.boolean().optional(),"proxy":Session.ProxyConfigurationSchema.optional(),"unhandledPromptBehavior":Session.UserPromptHandlerSchema.optional()})); + export const CreateUserContextParametersSchema = z.lazy(() => + z.object({ + acceptInsecureCerts: z.boolean().optional(), + proxy: Session.ProxyConfigurationSchema.optional(), + unhandledPromptBehavior: Session.UserPromptHandlerSchema.optional(), + }), + ); } export namespace Browser { -export const CreateUserContextResultSchema = z.lazy(() => Browser.UserContextInfoSchema); + export const CreateUserContextResultSchema = z.lazy( + () => Browser.UserContextInfoSchema, + ); } export namespace Browser { -export const -GetClientWindowsSchema = z.lazy(() => z.object({ -"method":z.literal("browser.getClientWindows"),"params":EmptyParamsSchema})); + export const GetClientWindowsSchema = z.lazy(() => + z.object({ + method: z.literal('browser.getClientWindows'), + params: EmptyParamsSchema, + }), + ); } export namespace Browser { -export const GetClientWindowsResultSchema = z.lazy(() => z.object({ -"clientWindows":z.array(Browser.ClientWindowInfoSchema)})); + export const GetClientWindowsResultSchema = z.lazy(() => + z.object({ + clientWindows: z.array(Browser.ClientWindowInfoSchema), + }), + ); } export namespace Browser { -export const -GetUserContextsSchema = z.lazy(() => z.object({ -"method":z.literal("browser.getUserContexts"),"params":EmptyParamsSchema})); + export const GetUserContextsSchema = z.lazy(() => + z.object({ + method: z.literal('browser.getUserContexts'), + params: EmptyParamsSchema, + }), + ); } export namespace Browser { -export const GetUserContextsResultSchema = z.lazy(() => z.object({ -"userContexts":z.array(Browser.UserContextInfoSchema).min(1)})); + export const GetUserContextsResultSchema = z.lazy(() => + z.object({ + userContexts: z.array(Browser.UserContextInfoSchema).min(1), + }), + ); } export namespace Browser { -export const -RemoveUserContextSchema = z.lazy(() => z.object({ -"method":z.literal("browser.removeUserContext"),"params":Browser.RemoveUserContextParametersSchema})); + export const RemoveUserContextSchema = z.lazy(() => + z.object({ + method: z.literal('browser.removeUserContext'), + params: Browser.RemoveUserContextParametersSchema, + }), + ); } export namespace Browser { -export const RemoveUserContextParametersSchema = z.lazy(() => z.object({ -"userContext":Browser.UserContextSchema})); + export const RemoveUserContextParametersSchema = z.lazy(() => + z.object({ + userContext: Browser.UserContextSchema, + }), + ); } export namespace Browser { -export const -SetClientWindowStateSchema = z.lazy(() => z.object({ -"method":z.literal("browser.setClientWindowState"),"params":Browser.SetClientWindowStateParametersSchema})); + export const SetClientWindowStateSchema = z.lazy(() => + z.object({ + method: z.literal('browser.setClientWindowState'), + params: Browser.SetClientWindowStateParametersSchema, + }), + ); } export namespace Browser { -export const SetClientWindowStateParametersSchema = z.lazy(() => z.object({ -"clientWindow":Browser.ClientWindowSchema}).and( -z.union([Browser.ClientWindowNamedStateSchema,Browser.ClientWindowRectStateSchema])) -); + export const SetClientWindowStateParametersSchema = z.lazy(() => + z + .object({ + clientWindow: Browser.ClientWindowSchema, + }) + .and( + z.union([ + Browser.ClientWindowNamedStateSchema, + Browser.ClientWindowRectStateSchema, + ]), + ), + ); } export namespace Browser { -export const -ClientWindowNamedStateSchema = z.lazy(() => z.object({ -"state":z.enum(["fullscreen","maximized","minimized",])})); + export const ClientWindowNamedStateSchema = z.lazy(() => + z.object({ + state: z.enum(['fullscreen', 'maximized', 'minimized']), + }), + ); } export namespace Browser { -export const -ClientWindowRectStateSchema = z.lazy(() => z.object({ -"state":z.literal("normal"),"width":JsUintSchema.optional(),"height":JsUintSchema.optional(),"x":JsIntSchema.optional(),"y":JsIntSchema.optional()})); + export const ClientWindowRectStateSchema = z.lazy(() => + z.object({ + state: z.literal('normal'), + width: JsUintSchema.optional(), + height: JsUintSchema.optional(), + x: JsIntSchema.optional(), + y: JsIntSchema.optional(), + }), + ); } export const BrowsingContextCommandSchema = z.lazy(() => z.union([ @@ -407,17 +571,6 @@ export const BrowsingContextCommandSchema = z.lazy(() => BrowsingContext.TraverseHistorySchema, ]), ); -export const BrowsingContextResultSchema = z.lazy(() => - z.union([ - BrowsingContext.CaptureScreenshotResultSchema, - BrowsingContext.CreateResultSchema, - BrowsingContext.GetTreeResultSchema, - BrowsingContext.LocateNodesResultSchema, - BrowsingContext.NavigateResultSchema, - BrowsingContext.PrintResultSchema, - BrowsingContext.TraverseHistoryResultSchema, - ]), -); export const BrowsingContextEventSchema = z.lazy(() => z.union([ BrowsingContext.ContextCreatedSchema, @@ -436,72 +589,142 @@ export const BrowsingContextEventSchema = z.lazy(() => BrowsingContext.UserPromptOpenedSchema, ]), ); +export const BrowsingContextResultSchema = z.lazy(() => + z.union([ + BrowsingContext.CaptureScreenshotResultSchema, + BrowsingContext.CreateResultSchema, + BrowsingContext.GetTreeResultSchema, + BrowsingContext.LocateNodesResultSchema, + BrowsingContext.NavigateResultSchema, + BrowsingContext.PrintResultSchema, + BrowsingContext.TraverseHistoryResultSchema, + ]), +); export namespace BrowsingContext { -export const BrowsingContextSchema = z.lazy(() => z.string()); -} -export namespace BrowsingContext { -export const InfoListSchema = z.lazy(() => z.array(BrowsingContext.InfoSchema)); -} -export namespace BrowsingContext { -export const InfoSchema = z.lazy(() => z.object({ -"children":z.union([BrowsingContext.InfoListSchema,z.null()]),"clientWindow":Browser.ClientWindowSchema,"context":BrowsingContext.BrowsingContextSchema,"originalOpener":z.union([BrowsingContext.BrowsingContextSchema,z.null()]),"url":z.string(),"userContext":Browser.UserContextSchema,"parent":z.union([BrowsingContext.BrowsingContextSchema,z.null()]).optional()})); -} -export namespace BrowsingContext { -export const LocatorSchema = z.lazy(() => z.union([BrowsingContext.AccessibilityLocatorSchema,BrowsingContext.CssLocatorSchema,BrowsingContext.ContextLocatorSchema,BrowsingContext.InnerTextLocatorSchema,BrowsingContext.XPathLocatorSchema])); -} -export namespace BrowsingContext { -export const AccessibilityLocatorSchema = z.lazy(() => z.object({ -"type":z.literal("accessibility"),"value":z.object({ -"name":z.string().optional(),"role":z.string().optional()})})); + export const BrowsingContextSchema = z.lazy(() => z.string()); } export namespace BrowsingContext { -export const CssLocatorSchema = z.lazy(() => z.object({ -"type":z.literal("css"),"value":z.string()})); + export const InfoListSchema = z.lazy(() => + z.array(BrowsingContext.InfoSchema), + ); } export namespace BrowsingContext { -export const ContextLocatorSchema = z.lazy(() => z.object({ -"type":z.literal("context"),"value":z.object({ -"context":BrowsingContext.BrowsingContextSchema})})); + export const InfoSchema = z.lazy(() => + z.object({ + children: z.union([BrowsingContext.InfoListSchema, z.null()]), + clientWindow: Browser.ClientWindowSchema, + context: BrowsingContext.BrowsingContextSchema, + originalOpener: z.union([ + BrowsingContext.BrowsingContextSchema, + z.null(), + ]), + url: z.string(), + userContext: Browser.UserContextSchema, + parent: z + .union([BrowsingContext.BrowsingContextSchema, z.null()]) + .optional(), + }), + ); } export namespace BrowsingContext { -export const InnerTextLocatorSchema = z.lazy(() => z.object({ -"type":z.literal("innerText"),"value":z.string(),"ignoreCase":z.boolean().optional(),"matchType":z.enum(["full","partial",]).optional(),"maxDepth":JsUintSchema.optional()})); + export const LocatorSchema = z.lazy(() => + z.union([ + BrowsingContext.AccessibilityLocatorSchema, + BrowsingContext.CssLocatorSchema, + BrowsingContext.ContextLocatorSchema, + BrowsingContext.InnerTextLocatorSchema, + BrowsingContext.XPathLocatorSchema, + ]), + ); } export namespace BrowsingContext { -export const XPathLocatorSchema = z.lazy(() => z.object({ -"type":z.literal("xpath"),"value":z.string()})); + export const AccessibilityLocatorSchema = z.lazy(() => + z.object({ + type: z.literal('accessibility'), + value: z.object({ + name: z.string().optional(), + role: z.string().optional(), + }), + }), + ); } export namespace BrowsingContext { -export const NavigationSchema = z.lazy(() => z.string()); + export const CssLocatorSchema = z.lazy(() => + z.object({ + type: z.literal('css'), + value: z.string(), + }), + ); } export namespace BrowsingContext { -export const -BaseNavigationInfoSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"timestamp":JsUintSchema,"url":z.string()})); + export const ContextLocatorSchema = z.lazy(() => + z.object({ + type: z.literal('context'), + value: z.object({ + context: BrowsingContext.BrowsingContextSchema, + }), + }), + ); } export namespace BrowsingContext { -export const NavigationInfoSchema = z.lazy(() => BrowsingContext.BaseNavigationInfoSchema); + export const InnerTextLocatorSchema = z.lazy(() => + z.object({ + type: z.literal('innerText'), + value: z.string(), + ignoreCase: z.boolean().optional(), + matchType: z.enum(['full', 'partial']).optional(), + maxDepth: JsUintSchema.optional(), + }), + ); } export namespace BrowsingContext { -export const ReadinessStateSchema = z.lazy(() => z.enum(["none","interactive","complete",])); + export const XPathLocatorSchema = z.lazy(() => + z.object({ + type: z.literal('xpath'), + value: z.string(), + }), + ); } export namespace BrowsingContext { -export const UserPromptTypeSchema = z.lazy(() => z.enum(["alert","beforeunload","confirm","prompt",])); + export const NavigationSchema = z.lazy(() => z.string()); } export namespace BrowsingContext { -export const -ActivateSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.activate"),"params":BrowsingContext.ActivateParametersSchema})); + export const BaseNavigationInfoSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), + timestamp: JsUintSchema, + url: z.string(), + }), + ); } export namespace BrowsingContext { -export const ActivateParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema})); + export const NavigationInfoSchema = z.lazy( + () => BrowsingContext.BaseNavigationInfoSchema, + ); } export namespace BrowsingContext { - export const CaptureScreenshotSchema = z.lazy(() => + export const ReadinessStateSchema = z.lazy(() => + z.enum(['none', 'interactive', 'complete']), + ); +} +export namespace BrowsingContext { + export const UserPromptTypeSchema = z.lazy(() => + z.enum(['alert', 'beforeunload', 'confirm', 'prompt']), + ); +} +export namespace BrowsingContext { + export const ActivateSchema = z.lazy(() => z.object({ - method: z.literal('browsingContext.captureScreenshot'), - params: BrowsingContext.CaptureScreenshotParametersSchema, + method: z.literal('browsingContext.activate'), + params: BrowsingContext.ActivateParametersSchema, + }), + ); +} +export namespace BrowsingContext { + export const ActivateParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, }), ); } @@ -516,76 +739,136 @@ export namespace BrowsingContext { ); } export namespace BrowsingContext { -export const ImageFormatSchema = z.lazy(() => z.object({ -"type":z.string(),"quality":z.number().gte(0).lte(1).optional()})); + export const CaptureScreenshotSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.captureScreenshot'), + params: BrowsingContext.CaptureScreenshotParametersSchema, + }), + ); } export namespace BrowsingContext { -export const ClipRectangleSchema = z.lazy(() => z.union([BrowsingContext.BoxClipRectangleSchema,BrowsingContext.ElementClipRectangleSchema])); + export const ImageFormatSchema = z.lazy(() => + z.object({ + type: z.string(), + quality: z.number().gte(0).lte(1).optional(), + }), + ); } export namespace BrowsingContext { -export const ElementClipRectangleSchema = z.lazy(() => z.object({ -"type":z.literal("element"),"element":Script.SharedReferenceSchema})); + export const ClipRectangleSchema = z.lazy(() => + z.union([ + BrowsingContext.BoxClipRectangleSchema, + BrowsingContext.ElementClipRectangleSchema, + ]), + ); } export namespace BrowsingContext { -export const BoxClipRectangleSchema = z.lazy(() => z.object({ -"type":z.literal("box"),"x":z.number(),"y":z.number(),"width":z.number(),"height":z.number()})); + export const ElementClipRectangleSchema = z.lazy(() => + z.object({ + type: z.literal('element'), + element: Script.SharedReferenceSchema, + }), + ); } export namespace BrowsingContext { -export const CaptureScreenshotResultSchema = z.lazy(() => z.object({ -"data":z.string()})); + export const BoxClipRectangleSchema = z.lazy(() => + z.object({ + type: z.literal('box'), + x: z.number(), + y: z.number(), + width: z.number(), + height: z.number(), + }), + ); } export namespace BrowsingContext { -export const -CloseSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.close"),"params":BrowsingContext.CloseParametersSchema})); + export const CaptureScreenshotResultSchema = z.lazy(() => + z.object({ + data: z.string(), + }), + ); } export namespace BrowsingContext { -export const CloseParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"promptUnload":z.boolean().default(false).optional()})); + export const CloseSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.close'), + params: BrowsingContext.CloseParametersSchema, + }), + ); } export namespace BrowsingContext { -export const -CreateSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.create"),"params":BrowsingContext.CreateParametersSchema})); + export const CloseParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + promptUnload: z.boolean().default(false).optional(), + }), + ); } export namespace BrowsingContext { -export const CreateTypeSchema = z.lazy(() => z.enum(["tab","window",])); + export const CreateSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.create'), + params: BrowsingContext.CreateParametersSchema, + }), + ); } export namespace BrowsingContext { -export const CreateParametersSchema = z.lazy(() => z.object({ -"type":BrowsingContext.CreateTypeSchema,"referenceContext":BrowsingContext.BrowsingContextSchema.optional(),"background":z.boolean().default(false).optional(),"userContext":Browser.UserContextSchema.optional()})); + export const CreateTypeSchema = z.lazy(() => z.enum(['tab', 'window'])); } export namespace BrowsingContext { -export const CreateResultSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema})); + export const CreateParametersSchema = z.lazy(() => + z.object({ + type: BrowsingContext.CreateTypeSchema, + referenceContext: BrowsingContext.BrowsingContextSchema.optional(), + background: z.boolean().default(false).optional(), + userContext: Browser.UserContextSchema.optional(), + }), + ); } export namespace BrowsingContext { -export const -GetTreeSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.getTree"),"params":BrowsingContext.GetTreeParametersSchema})); + export const CreateResultSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + }), + ); } export namespace BrowsingContext { -export const GetTreeParametersSchema = z.lazy(() => z.object({ -"maxDepth":JsUintSchema.optional(),"root":BrowsingContext.BrowsingContextSchema.optional()})); + export const GetTreeSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.getTree'), + params: BrowsingContext.GetTreeParametersSchema, + }), + ); } export namespace BrowsingContext { -export const GetTreeResultSchema = z.lazy(() => z.object({ -"contexts":BrowsingContext.InfoListSchema})); + export const GetTreeParametersSchema = z.lazy(() => + z.object({ + maxDepth: JsUintSchema.optional(), + root: BrowsingContext.BrowsingContextSchema.optional(), + }), + ); } export namespace BrowsingContext { -export const -HandleUserPromptSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.handleUserPrompt"),"params":BrowsingContext.HandleUserPromptParametersSchema})); + export const GetTreeResultSchema = z.lazy(() => + z.object({ + contexts: BrowsingContext.InfoListSchema, + }), + ); } export namespace BrowsingContext { -export const HandleUserPromptParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"accept":z.boolean().optional(),"userText":z.string().optional()})); + export const HandleUserPromptSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.handleUserPrompt'), + params: BrowsingContext.HandleUserPromptParametersSchema, + }), + ); } export namespace BrowsingContext { - export const LocateNodesSchema = z.lazy(() => + export const HandleUserPromptParametersSchema = z.lazy(() => z.object({ - method: z.literal('browsingContext.locateNodes'), - params: BrowsingContext.LocateNodesParametersSchema, + context: BrowsingContext.BrowsingContextSchema, + accept: z.boolean().optional(), + userText: z.string().optional(), }), ); } @@ -601,263 +884,529 @@ export namespace BrowsingContext { ); } export namespace BrowsingContext { -export const LocateNodesResultSchema = z.lazy(() => z.object({ -"nodes":z.array(Script.NodeRemoteValueSchema)})); + export const LocateNodesSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.locateNodes'), + params: BrowsingContext.LocateNodesParametersSchema, + }), + ); } export namespace BrowsingContext { -export const -NavigateSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.navigate"),"params":BrowsingContext.NavigateParametersSchema})); + export const LocateNodesResultSchema = z.lazy(() => + z.object({ + nodes: z.array(Script.NodeRemoteValueSchema), + }), + ); } export namespace BrowsingContext { -export const NavigateParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"url":z.string(),"wait":BrowsingContext.ReadinessStateSchema.optional()})); + export const NavigateSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.navigate'), + params: BrowsingContext.NavigateParametersSchema, + }), + ); } export namespace BrowsingContext { -export const NavigateResultSchema = z.lazy(() => z.object({ -"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"url":z.string()})); + export const NavigateParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + url: z.string(), + wait: BrowsingContext.ReadinessStateSchema.optional(), + }), + ); } export namespace BrowsingContext { -export const -PrintSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.print"),"params":BrowsingContext.PrintParametersSchema})); + export const NavigateResultSchema = z.lazy(() => + z.object({ + navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), + url: z.string(), + }), + ); } export namespace BrowsingContext { -export const PrintParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"background":z.boolean().default(false).optional(),"margin":BrowsingContext.PrintMarginParametersSchema.optional(),"orientation":z.enum(["portrait","landscape",]).default("portrait").optional(),"page":BrowsingContext.PrintPageParametersSchema.optional(),"pageRanges":z.array(z.union([JsUintSchema,z.string()])).optional(),"scale":z.number().gte(0.1).lte(2).default(1).optional(),"shrinkToFit":z.boolean().default(true).optional()})); + export const PrintSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.print'), + params: BrowsingContext.PrintParametersSchema, + }), + ); } export namespace BrowsingContext { -export const PrintMarginParametersSchema = z.lazy(() => z.object({ -"bottom":z.number().gte(0).default(1).optional(),"left":z.number().gte(0).default(1).optional(),"right":z.number().gte(0).default(1).optional(),"top":z.number().gte(0).default(1).optional()})); + export const PrintParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + background: z.boolean().default(false).optional(), + margin: BrowsingContext.PrintMarginParametersSchema.optional(), + orientation: z + .enum(['portrait', 'landscape']) + .default('portrait') + .optional(), + page: BrowsingContext.PrintPageParametersSchema.optional(), + pageRanges: z.array(z.union([JsUintSchema, z.string()])).optional(), + scale: z.number().gte(0.1).lte(2).default(1).optional(), + shrinkToFit: z.boolean().default(true).optional(), + }), + ); } export namespace BrowsingContext { -export const PrintPageParametersSchema = z.lazy(() => z.object({ -"height":z.number().gte(0.0352).default(27.94).optional(),"width":z.number().gte(0.0352).default(21.59).optional()})); + export const PrintMarginParametersSchema = z.lazy(() => + z.object({ + bottom: z.number().gte(0).default(1).optional(), + left: z.number().gte(0).default(1).optional(), + right: z.number().gte(0).default(1).optional(), + top: z.number().gte(0).default(1).optional(), + }), + ); } export namespace BrowsingContext { -export const PrintResultSchema = z.lazy(() => z.object({ -"data":z.string()})); + export const PrintPageParametersSchema = z.lazy(() => + z.object({ + height: z.number().gte(0.0352).default(27.94).optional(), + width: z.number().gte(0.0352).default(21.59).optional(), + }), + ); } export namespace BrowsingContext { -export const -ReloadSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.reload"),"params":BrowsingContext.ReloadParametersSchema})); + export const PrintResultSchema = z.lazy(() => + z.object({ + data: z.string(), + }), + ); } export namespace BrowsingContext { -export const ReloadParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"ignoreCache":z.boolean().optional(),"wait":BrowsingContext.ReadinessStateSchema.optional()})); + export const ReloadSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.reload'), + params: BrowsingContext.ReloadParametersSchema, + }), + ); } export namespace BrowsingContext { -export const -SetViewportSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.setViewport"),"params":BrowsingContext.SetViewportParametersSchema})); + export const ReloadParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + ignoreCache: z.boolean().optional(), + wait: BrowsingContext.ReadinessStateSchema.optional(), + }), + ); +} +export namespace BrowsingContext { + export const SetViewportSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.setViewport'), + params: BrowsingContext.SetViewportParametersSchema, + }), + ); } export namespace BrowsingContext { -export const SetViewportParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema.optional(),"viewport":z.union([BrowsingContext.ViewportSchema,z.null()]).optional(),"devicePixelRatio":z.union([z.number().gt(0),z.null()]).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetViewportParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema.optional(), + viewport: z.union([BrowsingContext.ViewportSchema, z.null()]).optional(), + devicePixelRatio: z.union([z.number().gt(0), z.null()]).optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace BrowsingContext { -export const ViewportSchema = z.lazy(() => z.object({ -"width":JsUintSchema,"height":JsUintSchema})); + export const ViewportSchema = z.lazy(() => + z.object({ + width: JsUintSchema, + height: JsUintSchema, + }), + ); } export namespace BrowsingContext { -export const -TraverseHistorySchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.traverseHistory"),"params":BrowsingContext.TraverseHistoryParametersSchema})); + export const TraverseHistorySchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.traverseHistory'), + params: BrowsingContext.TraverseHistoryParametersSchema, + }), + ); } export namespace BrowsingContext { -export const TraverseHistoryParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"delta":JsIntSchema})); + export const TraverseHistoryParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + delta: JsIntSchema, + }), + ); } export namespace BrowsingContext { -export const TraverseHistoryResultSchema = z.lazy(() => z.object({ -})); + export const TraverseHistoryResultSchema = z.lazy(() => z.object({})); } export namespace BrowsingContext { -export const -ContextCreatedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.contextCreated"),"params":BrowsingContext.InfoSchema})); + export const ContextCreatedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.contextCreated'), + params: BrowsingContext.InfoSchema, + }), + ); } export namespace BrowsingContext { -export const -ContextDestroyedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.contextDestroyed"),"params":BrowsingContext.InfoSchema})); + export const ContextDestroyedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.contextDestroyed'), + params: BrowsingContext.InfoSchema, + }), + ); } export namespace BrowsingContext { -export const -NavigationStartedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.navigationStarted"),"params":BrowsingContext.NavigationInfoSchema})); + export const NavigationStartedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.navigationStarted'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -FragmentNavigatedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.fragmentNavigated"),"params":BrowsingContext.NavigationInfoSchema})); + export const FragmentNavigatedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.fragmentNavigated'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -HistoryUpdatedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.historyUpdated"),"params":BrowsingContext.HistoryUpdatedParametersSchema})); + export const HistoryUpdatedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.historyUpdated'), + params: BrowsingContext.HistoryUpdatedParametersSchema, + }), + ); } export namespace BrowsingContext { -export const HistoryUpdatedParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"timestamp":JsUintSchema,"url":z.string()})); + export const HistoryUpdatedParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + timestamp: JsUintSchema, + url: z.string(), + }), + ); } export namespace BrowsingContext { -export const -DomContentLoadedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.domContentLoaded"),"params":BrowsingContext.NavigationInfoSchema})); + export const DomContentLoadedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.domContentLoaded'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -LoadSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.load"),"params":BrowsingContext.NavigationInfoSchema})); + export const LoadSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.load'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -DownloadWillBeginSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.downloadWillBegin"),"params":BrowsingContext.DownloadWillBeginParamsSchema})); + export const DownloadWillBeginSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.downloadWillBegin'), + params: BrowsingContext.DownloadWillBeginParamsSchema, + }), + ); } export namespace BrowsingContext { -export const DownloadWillBeginParamsSchema = z.lazy(() => z.object({ -"suggestedFilename":z.string()}).and( -BrowsingContext.BaseNavigationInfoSchema) -); + export const DownloadWillBeginParamsSchema = z.lazy(() => + z + .object({ + suggestedFilename: z.string(), + }) + .and(BrowsingContext.BaseNavigationInfoSchema), + ); } export namespace BrowsingContext { -export const -DownloadEndSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.downloadEnd"),"params":BrowsingContext.DownloadEndParamsSchema})); + export const DownloadEndSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.downloadEnd'), + params: BrowsingContext.DownloadEndParamsSchema, + }), + ); } export namespace BrowsingContext { -export const DownloadEndParamsSchema = z.lazy(() => z.union([BrowsingContext.DownloadCanceledParamsSchema,BrowsingContext.DownloadCompleteParamsSchema])); + export const DownloadEndParamsSchema = z.lazy(() => + z.union([ + BrowsingContext.DownloadCanceledParamsSchema, + BrowsingContext.DownloadCompleteParamsSchema, + ]), + ); } export namespace BrowsingContext { -export const -DownloadCanceledParamsSchema = z.lazy(() => z.object({ -"status":z.literal("canceled")}).and( -BrowsingContext.BaseNavigationInfoSchema) -); + export const DownloadCanceledParamsSchema = z.lazy(() => + z + .object({ + status: z.literal('canceled'), + }) + .and(BrowsingContext.BaseNavigationInfoSchema), + ); } export namespace BrowsingContext { -export const -DownloadCompleteParamsSchema = z.lazy(() => z.object({ -"status":z.literal("complete"),"filepath":z.union([z.string(),z.null()])}).and( -BrowsingContext.BaseNavigationInfoSchema) -); + export const DownloadCompleteParamsSchema = z.lazy(() => + z + .object({ + status: z.literal('complete'), + filepath: z.union([z.string(), z.null()]), + }) + .and(BrowsingContext.BaseNavigationInfoSchema), + ); } export namespace BrowsingContext { -export const -NavigationAbortedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.navigationAborted"),"params":BrowsingContext.NavigationInfoSchema})); + export const NavigationAbortedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.navigationAborted'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -NavigationCommittedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.navigationCommitted"),"params":BrowsingContext.NavigationInfoSchema})); + export const NavigationCommittedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.navigationCommitted'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -NavigationFailedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.navigationFailed"),"params":BrowsingContext.NavigationInfoSchema})); + export const NavigationFailedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.navigationFailed'), + params: BrowsingContext.NavigationInfoSchema, + }), + ); } export namespace BrowsingContext { -export const -UserPromptClosedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.userPromptClosed"),"params":BrowsingContext.UserPromptClosedParametersSchema})); + export const UserPromptClosedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.userPromptClosed'), + params: BrowsingContext.UserPromptClosedParametersSchema, + }), + ); } export namespace BrowsingContext { -export const UserPromptClosedParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"accepted":z.boolean(),"type":BrowsingContext.UserPromptTypeSchema,"userText":z.string().optional()})); + export const UserPromptClosedParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + accepted: z.boolean(), + type: BrowsingContext.UserPromptTypeSchema, + userText: z.string().optional(), + }), + ); } export namespace BrowsingContext { -export const -UserPromptOpenedSchema = z.lazy(() => z.object({ -"method":z.literal("browsingContext.userPromptOpened"),"params":BrowsingContext.UserPromptOpenedParametersSchema})); + export const UserPromptOpenedSchema = z.lazy(() => + z.object({ + method: z.literal('browsingContext.userPromptOpened'), + params: BrowsingContext.UserPromptOpenedParametersSchema, + }), + ); } export namespace BrowsingContext { -export const UserPromptOpenedParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"handler":Session.UserPromptHandlerTypeSchema,"message":z.string(),"type":BrowsingContext.UserPromptTypeSchema,"defaultValue":z.string().optional()})); + export const UserPromptOpenedParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + handler: Session.UserPromptHandlerTypeSchema, + message: z.string(), + type: BrowsingContext.UserPromptTypeSchema, + defaultValue: z.string().optional(), + }), + ); } -export const -EmulationCommandSchema = z.lazy(() => z.union([Emulation.SetForcedColorsModeThemeOverrideSchema,Emulation.SetGeolocationOverrideSchema,Emulation.SetLocaleOverrideSchema,Emulation.SetScreenOrientationOverrideSchema,Emulation.SetScriptingEnabledSchema,Emulation.SetTimezoneOverrideSchema])); +export const EmulationCommandSchema = z.lazy(() => + z.union([ + Emulation.SetForcedColorsModeThemeOverrideSchema, + Emulation.SetGeolocationOverrideSchema, + Emulation.SetLocaleOverrideSchema, + Emulation.SetScreenOrientationOverrideSchema, + Emulation.SetScriptingEnabledSchema, + Emulation.SetTimezoneOverrideSchema, + ]), +); export namespace Emulation { -export const -SetForcedColorsModeThemeOverrideSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setForcedColorsModeThemeOverride"),"params":Emulation.SetForcedColorsModeThemeOverrideParametersSchema})); + export const SetForcedColorsModeThemeOverrideSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setForcedColorsModeThemeOverride'), + params: Emulation.SetForcedColorsModeThemeOverrideParametersSchema, + }), + ); } export namespace Emulation { -export const SetForcedColorsModeThemeOverrideParametersSchema = z.lazy(() => z.object({ -"theme":z.union([Emulation.ForcedColorsModeThemeSchema,z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetForcedColorsModeThemeOverrideParametersSchema = z.lazy(() => + z.object({ + theme: z.union([Emulation.ForcedColorsModeThemeSchema, z.null()]), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Emulation { -export const ForcedColorsModeThemeSchema = z.lazy(() => z.enum(["light","dark",])); + export const ForcedColorsModeThemeSchema = z.lazy(() => + z.enum(['light', 'dark']), + ); } export namespace Emulation { -export const -SetGeolocationOverrideSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setGeolocationOverride"),"params":Emulation.SetGeolocationOverrideParametersSchema})); + export const SetGeolocationOverrideSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setGeolocationOverride'), + params: Emulation.SetGeolocationOverrideParametersSchema, + }), + ); } export namespace Emulation { -export const SetGeolocationOverrideParametersSchema = z.lazy(() => z.union([z.object({ -"coordinates":z.union([Emulation.GeolocationCoordinatesSchema,z.null()])}),z.object({ -"error":Emulation.GeolocationPositionErrorSchema})]).and( -z.object({ -"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})) -); + export const SetGeolocationOverrideParametersSchema = z.lazy(() => + z + .union([ + z.object({ + coordinates: z.union([ + Emulation.GeolocationCoordinatesSchema, + z.null(), + ]), + }), + z.object({ + error: Emulation.GeolocationPositionErrorSchema, + }), + ]) + .and( + z.object({ + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ), + ); } export namespace Emulation { -export const GeolocationCoordinatesSchema = z.lazy(() => z.object({ -"latitude":z.number().gte(-90).lte(90),"longitude":z.number().gte(-180).lte(180),"accuracy":z.number().gte(0).default(1).optional(),"altitude":z.union([z.number(),z.null().default(null)]).optional(),"altitudeAccuracy":z.union([z.number().gte(0),z.null().default(null)]).optional(),"heading":z.union([z.number().gt(0).lt(360),z.null().default(null)]).optional(),"speed":z.union([z.number().gte(0),z.null().default(null)]).optional()})); + export const GeolocationCoordinatesSchema = z.lazy(() => + z.object({ + latitude: z.number().gte(-90).lte(90), + longitude: z.number().gte(-180).lte(180), + accuracy: z.number().gte(0).default(1).optional(), + altitude: z.union([z.number(), z.null().default(null)]).optional(), + altitudeAccuracy: z + .union([z.number().gte(0), z.null().default(null)]) + .optional(), + heading: z + .union([z.number().gt(0).lt(360), z.null().default(null)]) + .optional(), + speed: z.union([z.number().gte(0), z.null().default(null)]).optional(), + }), + ); } export namespace Emulation { -export const GeolocationPositionErrorSchema = z.lazy(() => z.object({ -"type":z.literal("positionUnavailable")})); + export const GeolocationPositionErrorSchema = z.lazy(() => + z.object({ + type: z.literal('positionUnavailable'), + }), + ); } export namespace Emulation { -export const -SetLocaleOverrideSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setLocaleOverride"),"params":Emulation.SetLocaleOverrideParametersSchema})); + export const SetLocaleOverrideSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setLocaleOverride'), + params: Emulation.SetLocaleOverrideParametersSchema, + }), + ); } export namespace Emulation { -export const SetLocaleOverrideParametersSchema = z.lazy(() => z.object({ -"locale":z.union([z.string(),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetLocaleOverrideParametersSchema = z.lazy(() => + z.object({ + locale: z.union([z.string(), z.null()]), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Emulation { -export const -SetScreenOrientationOverrideSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setScreenOrientationOverride"),"params":Emulation.SetScreenOrientationOverrideParametersSchema})); + export const SetScreenOrientationOverrideSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setScreenOrientationOverride'), + params: Emulation.SetScreenOrientationOverrideParametersSchema, + }), + ); } export namespace Emulation { -export const ScreenOrientationNaturalSchema = z.lazy(() => z.enum(["portrait","landscape",])); + export const ScreenOrientationNaturalSchema = z.lazy(() => + z.enum(['portrait', 'landscape']), + ); } export namespace Emulation { -export const ScreenOrientationTypeSchema = z.lazy(() => z.enum(["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary",])); + export const ScreenOrientationTypeSchema = z.lazy(() => + z.enum([ + 'portrait-primary', + 'portrait-secondary', + 'landscape-primary', + 'landscape-secondary', + ]), + ); } export namespace Emulation { -export const ScreenOrientationSchema = z.lazy(() => z.object({ -"natural":Emulation.ScreenOrientationNaturalSchema,"type":Emulation.ScreenOrientationTypeSchema})); + export const ScreenOrientationSchema = z.lazy(() => + z.object({ + natural: Emulation.ScreenOrientationNaturalSchema, + type: Emulation.ScreenOrientationTypeSchema, + }), + ); } export namespace Emulation { -export const SetScreenOrientationOverrideParametersSchema = z.lazy(() => z.object({ -"screenOrientation":z.union([Emulation.ScreenOrientationSchema,z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetScreenOrientationOverrideParametersSchema = z.lazy(() => + z.object({ + screenOrientation: z.union([Emulation.ScreenOrientationSchema, z.null()]), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Emulation { -export const -SetScriptingEnabledSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setScriptingEnabled"),"params":Emulation.SetScriptingEnabledParametersSchema})); + export const SetScriptingEnabledSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setScriptingEnabled'), + params: Emulation.SetScriptingEnabledParametersSchema, + }), + ); } export namespace Emulation { -export const SetScriptingEnabledParametersSchema = z.lazy(() => z.object({ -"enabled":z.union([z.literal(false),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetScriptingEnabledParametersSchema = z.lazy(() => + z.object({ + enabled: z.union([z.literal(false), z.null()]), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Emulation { -export const -SetTimezoneOverrideSchema = z.lazy(() => z.object({ -"method":z.literal("emulation.setTimezoneOverride"),"params":Emulation.SetTimezoneOverrideParametersSchema})); + export const SetTimezoneOverrideSchema = z.lazy(() => + z.object({ + method: z.literal('emulation.setTimezoneOverride'), + params: Emulation.SetTimezoneOverrideParametersSchema, + }), + ); } export namespace Emulation { -export const SetTimezoneOverrideParametersSchema = z.lazy(() => z.object({ -"timezone":z.union([z.string(),z.null()]),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const SetTimezoneOverrideParametersSchema = z.lazy(() => + z.object({ + timezone: z.union([z.string(), z.null()]), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export const NetworkCommandSchema = z.lazy(() => z.union([ @@ -876,9 +1425,6 @@ export const NetworkCommandSchema = z.lazy(() => Network.SetExtraHeadersSchema, ]), ); -export const NetworkResultSchema = z.lazy( - () => Network.AddInterceptResultSchema, -); export const NetworkEventSchema = z.lazy(() => z.union([ Network.AuthRequiredSchema, @@ -888,115 +1434,250 @@ export const NetworkEventSchema = z.lazy(() => Network.ResponseStartedSchema, ]), ); +export const NetworkResultSchema = z.lazy( + () => Network.AddInterceptResultSchema, +); export namespace Network { -export const AuthChallengeSchema = z.lazy(() => z.object({ -"scheme":z.string(),"realm":z.string()})); -} -export namespace Network { -export const AuthCredentialsSchema = z.lazy(() => z.object({ -"type":z.literal("password"),"username":z.string(),"password":z.string()})); + export const AuthChallengeSchema = z.lazy(() => + z.object({ + scheme: z.string(), + realm: z.string(), + }), + ); } export namespace Network { -export const -BaseParametersSchema = z.lazy(() => z.object({ -"context":z.union([BrowsingContext.BrowsingContextSchema,z.null()]),"isBlocked":z.boolean(),"navigation":z.union([BrowsingContext.NavigationSchema,z.null()]),"redirectCount":JsUintSchema,"request":Network.RequestDataSchema,"timestamp":JsUintSchema,"intercepts":z.array(Network.InterceptSchema).min(1).optional()})); + export const AuthCredentialsSchema = z.lazy(() => + z.object({ + type: z.literal('password'), + username: z.string(), + password: z.string(), + }), + ); } export namespace Network { -export const BytesValueSchema = z.lazy(() => z.union([Network.StringValueSchema,Network.Base64ValueSchema])); + export const BaseParametersSchema = z.lazy(() => + z.object({ + context: z.union([BrowsingContext.BrowsingContextSchema, z.null()]), + isBlocked: z.boolean(), + navigation: z.union([BrowsingContext.NavigationSchema, z.null()]), + redirectCount: JsUintSchema, + request: Network.RequestDataSchema, + timestamp: JsUintSchema, + intercepts: z.array(Network.InterceptSchema).min(1).optional(), + }), + ); } export namespace Network { -export const StringValueSchema = z.lazy(() => z.object({ -"type":z.literal("string"),"value":z.string()})); + export const BytesValueSchema = z.lazy(() => + z.union([Network.StringValueSchema, Network.Base64ValueSchema]), + ); } export namespace Network { -export const Base64ValueSchema = z.lazy(() => z.object({ -"type":z.literal("base64"),"value":z.string()})); + export const StringValueSchema = z.lazy(() => + z.object({ + type: z.literal('string'), + value: z.string(), + }), + ); } export namespace Network { -export const CollectorSchema = z.lazy(() => z.string()); + export const Base64ValueSchema = z.lazy(() => + z.object({ + type: z.literal('base64'), + value: z.string(), + }), + ); } export namespace Network { -export const CollectorTypeSchema = z.literal("blob"); + export const CollectorSchema = z.lazy(() => z.string()); } export namespace Network { -export const SameSiteSchema = z.lazy(() => z.enum(["strict","lax","none","default",])); + export const CollectorTypeSchema = z.literal('blob'); } export namespace Network { -export const CookieSchema = z.lazy(() => z.object({ -"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string(),"path":z.string(),"size":JsUintSchema,"httpOnly":z.boolean(),"secure":z.boolean(),"sameSite":Network.SameSiteSchema,"expiry":JsUintSchema.optional()}).and( -ExtensibleSchema) -); + export const SameSiteSchema = z.lazy(() => + z.enum(['strict', 'lax', 'none', 'default']), + ); } export namespace Network { -export const CookieHeaderSchema = z.lazy(() => z.object({ -"name":z.string(),"value":Network.BytesValueSchema})); + export const CookieSchema = z.lazy(() => + z + .object({ + name: z.string(), + value: Network.BytesValueSchema, + domain: z.string(), + path: z.string(), + size: JsUintSchema, + httpOnly: z.boolean(), + secure: z.boolean(), + sameSite: Network.SameSiteSchema, + expiry: JsUintSchema.optional(), + }) + .and(ExtensibleSchema), + ); } export namespace Network { -export const DataTypeSchema = z.literal("response"); + export const CookieHeaderSchema = z.lazy(() => + z.object({ + name: z.string(), + value: Network.BytesValueSchema, + }), + ); } export namespace Network { -export const FetchTimingInfoSchema = z.lazy(() => z.object({ -"timeOrigin":z.number(),"requestTime":z.number(),"redirectStart":z.number(),"redirectEnd":z.number(),"fetchStart":z.number(),"dnsStart":z.number(),"dnsEnd":z.number(),"connectStart":z.number(),"connectEnd":z.number(),"tlsStart":z.number(),"requestStart":z.number(),"responseStart":z.number(),"responseEnd":z.number()})); + export const DataTypeSchema = z.literal('response'); } export namespace Network { -export const HeaderSchema = z.lazy(() => z.object({ -"name":z.string(),"value":Network.BytesValueSchema})); + export const FetchTimingInfoSchema = z.lazy(() => + z.object({ + timeOrigin: z.number(), + requestTime: z.number(), + redirectStart: z.number(), + redirectEnd: z.number(), + fetchStart: z.number(), + dnsStart: z.number(), + dnsEnd: z.number(), + connectStart: z.number(), + connectEnd: z.number(), + tlsStart: z.number(), + requestStart: z.number(), + responseStart: z.number(), + responseEnd: z.number(), + }), + ); } export namespace Network { -export const InitiatorSchema = z.lazy(() => z.object({ -"columnNumber":JsUintSchema.optional(),"lineNumber":JsUintSchema.optional(),"request":Network.RequestSchema.optional(),"stackTrace":Script.StackTraceSchema.optional(),"type":z.enum(["parser","script","preflight","other",]).optional()})); + export const HeaderSchema = z.lazy(() => + z.object({ + name: z.string(), + value: Network.BytesValueSchema, + }), + ); } export namespace Network { -export const InterceptSchema = z.lazy(() => z.string()); + export const InitiatorSchema = z.lazy(() => + z.object({ + columnNumber: JsUintSchema.optional(), + lineNumber: JsUintSchema.optional(), + request: Network.RequestSchema.optional(), + stackTrace: Script.StackTraceSchema.optional(), + type: z.enum(['parser', 'script', 'preflight', 'other']).optional(), + }), + ); } export namespace Network { -export const RequestSchema = z.lazy(() => z.string()); + export const InterceptSchema = z.lazy(() => z.string()); } export namespace Network { -export const RequestDataSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema,"url":z.string(),"method":z.string(),"headers":z.array(Network.HeaderSchema),"cookies":z.array(Network.CookieSchema),"headersSize":JsUintSchema,"bodySize":z.union([JsUintSchema,z.null()]),"destination":z.string(),"initiatorType":z.union([z.string(),z.null()]),"timings":Network.FetchTimingInfoSchema})); + export const RequestSchema = z.lazy(() => z.string()); } export namespace Network { -export const ResponseContentSchema = z.lazy(() => z.object({ -"size":JsUintSchema})); + export const RequestDataSchema = z.lazy(() => + z.object({ + request: Network.RequestSchema, + url: z.string(), + method: z.string(), + headers: z.array(Network.HeaderSchema), + cookies: z.array(Network.CookieSchema), + headersSize: JsUintSchema, + bodySize: z.union([JsUintSchema, z.null()]), + destination: z.string(), + initiatorType: z.union([z.string(), z.null()]), + timings: Network.FetchTimingInfoSchema, + }), + ); } export namespace Network { -export const ResponseDataSchema = z.lazy(() => z.object({ -"url":z.string(),"protocol":z.string(),"status":JsUintSchema,"statusText":z.string(),"fromCache":z.boolean(),"headers":z.array(Network.HeaderSchema),"mimeType":z.string(),"bytesReceived":JsUintSchema,"headersSize":z.union([JsUintSchema,z.null()]),"bodySize":z.union([JsUintSchema,z.null()]),"content":Network.ResponseContentSchema,"authChallenges":z.array(Network.AuthChallengeSchema).optional()})); + export const ResponseContentSchema = z.lazy(() => + z.object({ + size: JsUintSchema, + }), + ); } export namespace Network { -export const SetCookieHeaderSchema = z.lazy(() => z.object({ -"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string().optional(),"httpOnly":z.boolean().optional(),"expiry":z.string().optional(),"maxAge":JsIntSchema.optional(),"path":z.string().optional(),"sameSite":Network.SameSiteSchema.optional(),"secure":z.boolean().optional()})); + export const ResponseDataSchema = z.lazy(() => + z.object({ + url: z.string(), + protocol: z.string(), + status: JsUintSchema, + statusText: z.string(), + fromCache: z.boolean(), + headers: z.array(Network.HeaderSchema), + mimeType: z.string(), + bytesReceived: JsUintSchema, + headersSize: z.union([JsUintSchema, z.null()]), + bodySize: z.union([JsUintSchema, z.null()]), + content: Network.ResponseContentSchema, + authChallenges: z.array(Network.AuthChallengeSchema).optional(), + }), + ); } export namespace Network { -export const UrlPatternSchema = z.lazy(() => z.union([Network.UrlPatternPatternSchema,Network.UrlPatternStringSchema])); + export const SetCookieHeaderSchema = z.lazy(() => + z.object({ + name: z.string(), + value: Network.BytesValueSchema, + domain: z.string().optional(), + httpOnly: z.boolean().optional(), + expiry: z.string().optional(), + maxAge: JsIntSchema.optional(), + path: z.string().optional(), + sameSite: Network.SameSiteSchema.optional(), + secure: z.boolean().optional(), + }), + ); } export namespace Network { -export const UrlPatternPatternSchema = z.lazy(() => z.object({ -"type":z.literal("pattern"),"protocol":z.string().optional(),"hostname":z.string().optional(),"port":z.string().optional(),"pathname":z.string().optional(),"search":z.string().optional()})); + export const UrlPatternSchema = z.lazy(() => + z.union([Network.UrlPatternPatternSchema, Network.UrlPatternStringSchema]), + ); } export namespace Network { -export const UrlPatternStringSchema = z.lazy(() => z.object({ -"type":z.literal("string"),"pattern":z.string()})); + export const UrlPatternPatternSchema = z.lazy(() => + z.object({ + type: z.literal('pattern'), + protocol: z.string().optional(), + hostname: z.string().optional(), + port: z.string().optional(), + pathname: z.string().optional(), + search: z.string().optional(), + }), + ); } export namespace Network { -export const -AddDataCollectorSchema = z.lazy(() => z.object({ -"method":z.literal("network.addDataCollector"),"params":Network.AddDataCollectorParametersSchema})); + export const UrlPatternStringSchema = z.lazy(() => + z.object({ + type: z.literal('string'), + pattern: z.string(), + }), + ); } export namespace Network { -export const AddDataCollectorParametersSchema = z.lazy(() => z.object({ -"dataTypes":z.array(Network.DataTypeSchema).min(1),"maxEncodedDataSize":JsUintSchema,"collectorType":Network.CollectorTypeSchema.default("blob").optional(),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional()})); + export const AddDataCollectorSchema = z.lazy(() => + z.object({ + method: z.literal('network.addDataCollector'), + params: Network.AddDataCollectorParametersSchema, + }), + ); } export namespace Network { -export const AddDataCollectorResultSchema = z.lazy(() => z.object({ -"collector":Network.CollectorSchema})); + export const AddDataCollectorParametersSchema = z.lazy(() => + z.object({ + dataTypes: z.array(Network.DataTypeSchema).min(1), + maxEncodedDataSize: JsUintSchema, + collectorType: Network.CollectorTypeSchema.default('blob').optional(), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + }), + ); } export namespace Network { - export const AddInterceptSchema = z.lazy(() => + export const AddDataCollectorResultSchema = z.lazy(() => z.object({ - method: z.literal('network.addIntercept'), - params: Network.AddInterceptParametersSchema, + collector: Network.CollectorSchema, }), ); } @@ -1013,108 +1694,208 @@ export namespace Network { ); } export namespace Network { -export const InterceptPhaseSchema = z.lazy(() => z.enum(["beforeRequestSent","responseStarted","authRequired",])); + export const AddInterceptSchema = z.lazy(() => + z.object({ + method: z.literal('network.addIntercept'), + params: Network.AddInterceptParametersSchema, + }), + ); } export namespace Network { -export const AddInterceptResultSchema = z.lazy(() => z.object({ -"intercept":Network.InterceptSchema})); + export const InterceptPhaseSchema = z.lazy(() => + z.enum(['beforeRequestSent', 'responseStarted', 'authRequired']), + ); } export namespace Network { -export const -ContinueRequestSchema = z.lazy(() => z.object({ -"method":z.literal("network.continueRequest"),"params":Network.ContinueRequestParametersSchema})); + export const AddInterceptResultSchema = z.lazy(() => + z.object({ + intercept: Network.InterceptSchema, + }), + ); } export namespace Network { -export const ContinueRequestParametersSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema,"body":Network.BytesValueSchema.optional(),"cookies":z.array(Network.CookieHeaderSchema).optional(),"headers":z.array(Network.HeaderSchema).optional(),"method":z.string().optional(),"url":z.string().optional()})); + export const ContinueRequestSchema = z.lazy(() => + z.object({ + method: z.literal('network.continueRequest'), + params: Network.ContinueRequestParametersSchema, + }), + ); } export namespace Network { -export const -ContinueResponseSchema = z.lazy(() => z.object({ -"method":z.literal("network.continueResponse"),"params":Network.ContinueResponseParametersSchema})); + export const ContinueRequestParametersSchema = z.lazy(() => + z.object({ + request: Network.RequestSchema, + body: Network.BytesValueSchema.optional(), + cookies: z.array(Network.CookieHeaderSchema).optional(), + headers: z.array(Network.HeaderSchema).optional(), + method: z.string().optional(), + url: z.string().optional(), + }), + ); } export namespace Network { -export const ContinueResponseParametersSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema,"cookies":z.array(Network.SetCookieHeaderSchema).optional(),"credentials":Network.AuthCredentialsSchema.optional(),"headers":z.array(Network.HeaderSchema).optional(),"reasonPhrase":z.string().optional(),"statusCode":JsUintSchema.optional()})); + export const ContinueResponseSchema = z.lazy(() => + z.object({ + method: z.literal('network.continueResponse'), + params: Network.ContinueResponseParametersSchema, + }), + ); } export namespace Network { -export const -ContinueWithAuthSchema = z.lazy(() => z.object({ -"method":z.literal("network.continueWithAuth"),"params":Network.ContinueWithAuthParametersSchema})); + export const ContinueResponseParametersSchema = z.lazy(() => + z.object({ + request: Network.RequestSchema, + cookies: z.array(Network.SetCookieHeaderSchema).optional(), + credentials: Network.AuthCredentialsSchema.optional(), + headers: z.array(Network.HeaderSchema).optional(), + reasonPhrase: z.string().optional(), + statusCode: JsUintSchema.optional(), + }), + ); } export namespace Network { -export const ContinueWithAuthParametersSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema}).and( -z.union([Network.ContinueWithAuthCredentialsSchema,Network.ContinueWithAuthNoCredentialsSchema])) -); + export const ContinueWithAuthSchema = z.lazy(() => + z.object({ + method: z.literal('network.continueWithAuth'), + params: Network.ContinueWithAuthParametersSchema, + }), + ); } export namespace Network { -export const -ContinueWithAuthCredentialsSchema = z.lazy(() => z.object({ -"action":z.literal("provideCredentials"),"credentials":Network.AuthCredentialsSchema})); + export const ContinueWithAuthParametersSchema = z.lazy(() => + z + .object({ + request: Network.RequestSchema, + }) + .and( + z.union([ + Network.ContinueWithAuthCredentialsSchema, + Network.ContinueWithAuthNoCredentialsSchema, + ]), + ), + ); +} +export namespace Network { + export const ContinueWithAuthCredentialsSchema = z.lazy(() => + z.object({ + action: z.literal('provideCredentials'), + credentials: Network.AuthCredentialsSchema, + }), + ); } export namespace Network { -export const -ContinueWithAuthNoCredentialsSchema = z.lazy(() => z.object({ -"action":z.enum(["default","cancel",])})); + export const ContinueWithAuthNoCredentialsSchema = z.lazy(() => + z.object({ + action: z.enum(['default', 'cancel']), + }), + ); } export namespace Network { -export const -DisownDataSchema = z.lazy(() => z.object({ -"method":z.literal("network.disownData"),"params":Network.DisownDataParametersSchema})); + export const DisownDataSchema = z.lazy(() => + z.object({ + method: z.literal('network.disownData'), + params: Network.DisownDataParametersSchema, + }), + ); } export namespace Network { -export const DisownDataParametersSchema = z.lazy(() => z.object({ -"dataType":Network.DataTypeSchema,"collector":Network.CollectorSchema,"request":Network.RequestSchema})); + export const DisownDataParametersSchema = z.lazy(() => + z.object({ + dataType: Network.DataTypeSchema, + collector: Network.CollectorSchema, + request: Network.RequestSchema, + }), + ); } export namespace Network { -export const -FailRequestSchema = z.lazy(() => z.object({ -"method":z.literal("network.failRequest"),"params":Network.FailRequestParametersSchema})); + export const FailRequestSchema = z.lazy(() => + z.object({ + method: z.literal('network.failRequest'), + params: Network.FailRequestParametersSchema, + }), + ); } export namespace Network { -export const FailRequestParametersSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema})); + export const FailRequestParametersSchema = z.lazy(() => + z.object({ + request: Network.RequestSchema, + }), + ); } export namespace Network { -export const -GetDataSchema = z.lazy(() => z.object({ -"method":z.literal("network.getData"),"params":Network.GetDataParametersSchema})); + export const GetDataSchema = z.lazy(() => + z.object({ + method: z.literal('network.getData'), + params: Network.GetDataParametersSchema, + }), + ); } export namespace Network { -export const GetDataParametersSchema = z.lazy(() => z.object({ -"dataType":Network.DataTypeSchema,"collector":Network.CollectorSchema.optional(),"disown":z.boolean().default(false).optional(),"request":Network.RequestSchema})); + export const GetDataParametersSchema = z.lazy(() => + z.object({ + dataType: Network.DataTypeSchema, + collector: Network.CollectorSchema.optional(), + disown: z.boolean().default(false).optional(), + request: Network.RequestSchema, + }), + ); } export namespace Network { -export const GetDataResultSchema = z.lazy(() => z.object({ -"bytes":Network.BytesValueSchema})); + export const GetDataResultSchema = z.lazy(() => + z.object({ + bytes: Network.BytesValueSchema, + }), + ); } export namespace Network { -export const -ProvideResponseSchema = z.lazy(() => z.object({ -"method":z.literal("network.provideResponse"),"params":Network.ProvideResponseParametersSchema})); + export const ProvideResponseSchema = z.lazy(() => + z.object({ + method: z.literal('network.provideResponse'), + params: Network.ProvideResponseParametersSchema, + }), + ); } export namespace Network { -export const ProvideResponseParametersSchema = z.lazy(() => z.object({ -"request":Network.RequestSchema,"body":Network.BytesValueSchema.optional(),"cookies":z.array(Network.SetCookieHeaderSchema).optional(),"headers":z.array(Network.HeaderSchema).optional(),"reasonPhrase":z.string().optional(),"statusCode":JsUintSchema.optional()})); + export const ProvideResponseParametersSchema = z.lazy(() => + z.object({ + request: Network.RequestSchema, + body: Network.BytesValueSchema.optional(), + cookies: z.array(Network.SetCookieHeaderSchema).optional(), + headers: z.array(Network.HeaderSchema).optional(), + reasonPhrase: z.string().optional(), + statusCode: JsUintSchema.optional(), + }), + ); } export namespace Network { -export const -RemoveDataCollectorSchema = z.lazy(() => z.object({ -"method":z.literal("network.removeDataCollector"),"params":Network.RemoveDataCollectorParametersSchema})); + export const RemoveDataCollectorSchema = z.lazy(() => + z.object({ + method: z.literal('network.removeDataCollector'), + params: Network.RemoveDataCollectorParametersSchema, + }), + ); } export namespace Network { -export const RemoveDataCollectorParametersSchema = z.lazy(() => z.object({ -"collector":Network.CollectorSchema})); + export const RemoveDataCollectorParametersSchema = z.lazy(() => + z.object({ + collector: Network.CollectorSchema, + }), + ); } export namespace Network { -export const -RemoveInterceptSchema = z.lazy(() => z.object({ -"method":z.literal("network.removeIntercept"),"params":Network.RemoveInterceptParametersSchema})); + export const RemoveInterceptSchema = z.lazy(() => + z.object({ + method: z.literal('network.removeIntercept'), + params: Network.RemoveInterceptParametersSchema, + }), + ); } export namespace Network { -export const RemoveInterceptParametersSchema = z.lazy(() => z.object({ -"intercept":Network.InterceptSchema})); + export const RemoveInterceptParametersSchema = z.lazy(() => + z.object({ + intercept: Network.InterceptSchema, + }), + ); } export namespace Network { export const SetCacheBehaviorSchema = z.lazy(() => @@ -1155,14 +1936,13 @@ export namespace Network { }), ); } -export namespace Network { - export const AuthRequiredSchema = z.lazy(() => - z.object({ - method: z.literal('network.authRequired'), - params: Network.AuthRequiredParametersSchema, - }), - ); -} +export const ScriptEventSchema = z.lazy(() => + z.union([ + Script.MessageSchema, + Script.RealmCreatedSchema, + Script.RealmDestroyedSchema, + ]), +); export namespace Network { export const AuthRequiredParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( @@ -1172,14 +1952,6 @@ export namespace Network { ), ); } -export namespace Network { - export const BeforeRequestSentSchema = z.lazy(() => - z.object({ - method: z.literal('network.beforeRequestSent'), - params: Network.BeforeRequestSentParametersSchema, - }), - ); -} export namespace Network { export const BeforeRequestSentParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( @@ -1189,14 +1961,6 @@ export namespace Network { ), ); } -export namespace Network { - export const FetchErrorSchema = z.lazy(() => - z.object({ - method: z.literal('network.fetchError'), - params: Network.FetchErrorParametersSchema, - }), - ); -} export namespace Network { export const FetchErrorParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( @@ -1206,14 +1970,6 @@ export namespace Network { ), ); } -export namespace Network { - export const ResponseCompletedSchema = z.lazy(() => - z.object({ - method: z.literal('network.responseCompleted'), - params: Network.ResponseCompletedParametersSchema, - }), - ); -} export namespace Network { export const ResponseCompletedParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( @@ -1224,19 +1980,14 @@ export namespace Network { ); } export namespace Network { - export const ResponseStartedSchema = z.lazy(() => - z.object({ - method: z.literal('network.responseStarted'), - params: Network.ResponseStartedParametersSchema, - }), + export const ResponseStartedParametersSchema = z.lazy(() => + Network.BaseParametersSchema.and( + z.object({ + response: Network.ResponseDataSchema, + }), + ), ); } -export namespace Network { -export const ResponseStartedParametersSchema = z.lazy(() => Network.BaseParametersSchema.and( -z.object({ -"response":Network.ResponseDataSchema})) -); -} export const ScriptCommandSchema = z.lazy(() => z.union([ Script.AddPreloadScriptSchema, @@ -1254,51 +2005,54 @@ export const ScriptResultSchema = z.lazy(() => Script.GetRealmsResultSchema, ]), ); -export const ScriptEventSchema = z.lazy(() => - z.union([ - Script.MessageSchema, - Script.RealmCreatedSchema, - Script.RealmDestroyedSchema, - ]), -); -export namespace Script { -export const ChannelSchema = z.lazy(() => z.string()); +export namespace Network { + export const AuthRequiredSchema = z.lazy(() => + z.object({ + method: z.literal('network.authRequired'), + params: Network.AuthRequiredParametersSchema, + }), + ); } -export namespace Script { -export const ChannelValueSchema = z.lazy(() => z.object({ -"type":z.literal("channel"),"value":Script.ChannelPropertiesSchema})); +export namespace Network { + export const BeforeRequestSentSchema = z.lazy(() => + z.object({ + method: z.literal('network.beforeRequestSent'), + params: Network.BeforeRequestSentParametersSchema, + }), + ); } -export namespace Script { - export const ChannelPropertiesSchema = z.lazy(() => +export namespace Network { + export const FetchErrorSchema = z.lazy(() => z.object({ - channel: Script.ChannelSchema, - serializationOptions: Script.SerializationOptionsSchema.optional(), - ownership: Script.ResultOwnershipSchema.optional(), + method: z.literal('network.fetchError'), + params: Network.FetchErrorParametersSchema, }), ); } -export namespace Script { - export const EvaluateResultSchema = z.lazy(() => - z.union([ - Script.EvaluateResultSuccessSchema, - Script.EvaluateResultExceptionSchema, - ]), +export namespace Network { + export const ResponseCompletedSchema = z.lazy(() => + z.object({ + method: z.literal('network.responseCompleted'), + params: Network.ResponseCompletedParametersSchema, + }), ); } -export namespace Script { - export const EvaluateResultSuccessSchema = z.lazy(() => +export namespace Network { + export const ResponseStartedSchema = z.lazy(() => z.object({ - type: z.literal('success'), - result: Script.RemoteValueSchema, - realm: Script.RealmSchema, + method: z.literal('network.responseStarted'), + params: Network.ResponseStartedParametersSchema, }), ); } export namespace Script { - export const EvaluateResultExceptionSchema = z.lazy(() => + export const ChannelSchema = z.lazy(() => z.string()); +} +export namespace Script { + export const EvaluateResultSuccessSchema = z.lazy(() => z.object({ - type: z.literal('exception'), - exceptionDetails: Script.ExceptionDetailsSchema, + type: z.literal('success'), + result: Script.RemoteValueSchema, realm: Script.RealmSchema, }), ); @@ -1315,19 +2069,65 @@ export namespace Script { ); } export namespace Script { -export const HandleSchema = z.lazy(() => z.string()); -} -export namespace Script { -export const InternalIdSchema = z.lazy(() => z.string()); + export const ChannelValueSchema = z.lazy(() => + z.object({ + type: z.literal('channel'), + value: Script.ChannelPropertiesSchema, + }), + ); +} +export namespace Script { + export const ChannelPropertiesSchema = z.lazy(() => + z.object({ + channel: Script.ChannelSchema, + serializationOptions: Script.SerializationOptionsSchema.optional(), + ownership: Script.ResultOwnershipSchema.optional(), + }), + ); +} +export namespace Script { + export const EvaluateResultSchema = z.lazy(() => + z.union([ + Script.EvaluateResultSuccessSchema, + Script.EvaluateResultExceptionSchema, + ]), + ); +} +export namespace Script { + export const EvaluateResultExceptionSchema = z.lazy(() => + z.object({ + type: z.literal('exception'), + exceptionDetails: Script.ExceptionDetailsSchema, + realm: Script.RealmSchema, + }), + ); +} +export namespace Script { + export const HandleSchema = z.lazy(() => z.string()); } export namespace Script { -export const LocalValueSchema = z.lazy(() => z.union([Script.RemoteReferenceSchema,Script.PrimitiveProtocolValueSchema,Script.ChannelValueSchema,Script.ArrayLocalValueSchema,Script.DateLocalValueSchema,Script.MapLocalValueSchema,Script.ObjectLocalValueSchema,Script.RegExpLocalValueSchema,Script.SetLocalValueSchema])); + export const InternalIdSchema = z.lazy(() => z.string()); } export namespace Script { export const ListLocalValueSchema = z.lazy(() => z.array(Script.LocalValueSchema), ); } +export namespace Script { + export const LocalValueSchema = z.lazy(() => + z.union([ + Script.RemoteReferenceSchema, + Script.PrimitiveProtocolValueSchema, + Script.ChannelValueSchema, + Script.ArrayLocalValueSchema, + Script.DateLocalValueSchema, + Script.MapLocalValueSchema, + Script.ObjectLocalValueSchema, + Script.RegExpLocalValueSchema, + Script.SetLocalValueSchema, + ]), + ); +} export namespace Script { export const ArrayLocalValueSchema = z.lazy(() => z.object({ @@ -1395,100 +2195,226 @@ export namespace Script { ); } export namespace Script { -export const PreloadScriptSchema = z.lazy(() => z.string()); + export const PreloadScriptSchema = z.lazy(() => z.string()); } export namespace Script { -export const RealmSchema = z.lazy(() => z.string()); + export const RealmSchema = z.lazy(() => z.string()); } export namespace Script { -export const PrimitiveProtocolValueSchema = z.lazy(() => z.union([Script.UndefinedValueSchema,Script.NullValueSchema,Script.StringValueSchema,Script.NumberValueSchema,Script.BooleanValueSchema,Script.BigIntValueSchema])); + export const PrimitiveProtocolValueSchema = z.lazy(() => + z.union([ + Script.UndefinedValueSchema, + Script.NullValueSchema, + Script.StringValueSchema, + Script.NumberValueSchema, + Script.BooleanValueSchema, + Script.BigIntValueSchema, + ]), + ); } export namespace Script { -export const UndefinedValueSchema = z.lazy(() => z.object({ -"type":z.literal("undefined")})); + export const UndefinedValueSchema = z.lazy(() => + z.object({ + type: z.literal('undefined'), + }), + ); } export namespace Script { -export const NullValueSchema = z.lazy(() => z.object({ -"type":z.literal("null")})); + export const NullValueSchema = z.lazy(() => + z.object({ + type: z.literal('null'), + }), + ); } export namespace Script { -export const StringValueSchema = z.lazy(() => z.object({ -"type":z.literal("string"),"value":z.string()})); + export const StringValueSchema = z.lazy(() => + z.object({ + type: z.literal('string'), + value: z.string(), + }), + ); } export namespace Script { -export const SpecialNumberSchema = z.lazy(() => z.enum(["NaN","-0","Infinity","-Infinity",])); + export const SpecialNumberSchema = z.lazy(() => + z.enum(['NaN', '-0', 'Infinity', '-Infinity']), + ); } export namespace Script { -export const NumberValueSchema = z.lazy(() => z.object({ -"type":z.literal("number"),"value":z.union([z.number(),Script.SpecialNumberSchema])})); + export const NumberValueSchema = z.lazy(() => + z.object({ + type: z.literal('number'), + value: z.union([z.number(), Script.SpecialNumberSchema]), + }), + ); } export namespace Script { -export const BooleanValueSchema = z.lazy(() => z.object({ -"type":z.literal("boolean"),"value":z.boolean()})); + export const BooleanValueSchema = z.lazy(() => + z.object({ + type: z.literal('boolean'), + value: z.boolean(), + }), + ); } export namespace Script { -export const BigIntValueSchema = z.lazy(() => z.object({ -"type":z.literal("bigint"),"value":z.string()})); + export const BigIntValueSchema = z.lazy(() => + z.object({ + type: z.literal('bigint'), + value: z.string(), + }), + ); } export namespace Script { -export const RealmInfoSchema = z.lazy(() => z.union([Script.WindowRealmInfoSchema,Script.DedicatedWorkerRealmInfoSchema,Script.SharedWorkerRealmInfoSchema,Script.ServiceWorkerRealmInfoSchema,Script.WorkerRealmInfoSchema,Script.PaintWorkletRealmInfoSchema,Script.AudioWorkletRealmInfoSchema,Script.WorkletRealmInfoSchema])); + export const RealmInfoSchema = z.lazy(() => + z.union([ + Script.WindowRealmInfoSchema, + Script.DedicatedWorkerRealmInfoSchema, + Script.SharedWorkerRealmInfoSchema, + Script.ServiceWorkerRealmInfoSchema, + Script.WorkerRealmInfoSchema, + Script.PaintWorkletRealmInfoSchema, + Script.AudioWorkletRealmInfoSchema, + Script.WorkletRealmInfoSchema, + ]), + ); } export namespace Script { -export const -BaseRealmInfoSchema = z.lazy(() => z.object({ -"realm":Script.RealmSchema,"origin":z.string()})); + export const BaseRealmInfoSchema = z.lazy(() => + z.object({ + realm: Script.RealmSchema, + origin: z.string(), + }), + ); } export namespace Script { -export const WindowRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("window"),"context":BrowsingContext.BrowsingContextSchema,"sandbox":z.string().optional()})) -); + export const WindowRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('window'), + context: BrowsingContext.BrowsingContextSchema, + sandbox: z.string().optional(), + }), + ), + ); } export namespace Script { -export const DedicatedWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("dedicated-worker"),"owners":z.tuple([ -Script.RealmSchema])})) -); + export const DedicatedWorkerRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('dedicated-worker'), + owners: z.tuple([Script.RealmSchema]), + }), + ), + ); } export namespace Script { -export const SharedWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("shared-worker")})) -); + export const SharedWorkerRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('shared-worker'), + }), + ), + ); } export namespace Script { -export const ServiceWorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("service-worker")})) -); + export const ServiceWorkerRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('service-worker'), + }), + ), + ); } export namespace Script { -export const WorkerRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("worker")})) -); + export const WorkerRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('worker'), + }), + ), + ); } export namespace Script { -export const PaintWorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("paint-worklet")})) -); + export const PaintWorkletRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('paint-worklet'), + }), + ), + ); } export namespace Script { -export const AudioWorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("audio-worklet")})) -); + export const AudioWorkletRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('audio-worklet'), + }), + ), + ); } export namespace Script { -export const WorkletRealmInfoSchema = z.lazy(() => Script.BaseRealmInfoSchema.and( -z.object({ -"type":z.literal("worklet")})) -); + export const WorkletRealmInfoSchema = z.lazy(() => + Script.BaseRealmInfoSchema.and( + z.object({ + type: z.literal('worklet'), + }), + ), + ); +} +export namespace Script { + export const RealmTypeSchema = z.lazy(() => + z.enum([ + 'window', + 'dedicated-worker', + 'shared-worker', + 'service-worker', + 'worker', + 'paint-worklet', + 'audio-worklet', + 'worklet', + ]), + ); +} +export namespace Script { + export const ListRemoteValueSchema = z.lazy(() => + z.array(Script.RemoteValueSchema), + ); +} +export namespace Script { + export const MappingRemoteValueSchema = z.lazy(() => + z.array( + z.tuple([ + z.union([Script.RemoteValueSchema, z.string()]), + Script.RemoteValueSchema, + ]), + ), + ); } export namespace Script { -export const RealmTypeSchema = z.lazy(() => z.enum(["window","dedicated-worker","shared-worker","service-worker","worker","paint-worklet","audio-worklet","worklet",])); + export const RemoteValueSchema = z.lazy(() => + z.union([ + Script.PrimitiveProtocolValueSchema, + Script.SymbolRemoteValueSchema, + Script.ArrayRemoteValueSchema, + Script.ObjectRemoteValueSchema, + Script.FunctionRemoteValueSchema, + Script.RegExpRemoteValueSchema, + Script.DateRemoteValueSchema, + Script.MapRemoteValueSchema, + Script.SetRemoteValueSchema, + Script.WeakMapRemoteValueSchema, + Script.WeakSetRemoteValueSchema, + Script.GeneratorRemoteValueSchema, + Script.ErrorRemoteValueSchema, + Script.ProxyRemoteValueSchema, + Script.PromiseRemoteValueSchema, + Script.TypedArrayRemoteValueSchema, + Script.ArrayBufferRemoteValueSchema, + Script.NodeListRemoteValueSchema, + Script.HtmlCollectionRemoteValueSchema, + Script.NodeRemoteValueSchema, + Script.WindowProxyRemoteValueSchema, + ]), + ); } export namespace Script { export const RemoteReferenceSchema = z.lazy(() => @@ -1516,176 +2442,326 @@ export namespace Script { ); } export namespace Script { -export const RemoteValueSchema = z.lazy(() => z.union([Script.PrimitiveProtocolValueSchema,Script.SymbolRemoteValueSchema,Script.ArrayRemoteValueSchema,Script.ObjectRemoteValueSchema,Script.FunctionRemoteValueSchema,Script.RegExpRemoteValueSchema,Script.DateRemoteValueSchema,Script.MapRemoteValueSchema,Script.SetRemoteValueSchema,Script.WeakMapRemoteValueSchema,Script.WeakSetRemoteValueSchema,Script.GeneratorRemoteValueSchema,Script.ErrorRemoteValueSchema,Script.ProxyRemoteValueSchema,Script.PromiseRemoteValueSchema,Script.TypedArrayRemoteValueSchema,Script.ArrayBufferRemoteValueSchema,Script.NodeListRemoteValueSchema,Script.HtmlCollectionRemoteValueSchema,Script.NodeRemoteValueSchema,Script.WindowProxyRemoteValueSchema])); -} -export namespace Script { - export const ListRemoteValueSchema = z.lazy(() => - z.array(Script.RemoteValueSchema), + export const SymbolRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('symbol'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), ); } export namespace Script { - export const MappingRemoteValueSchema = z.lazy(() => - z.array( - z.tuple([ - z.union([Script.RemoteValueSchema, z.string()]), - Script.RemoteValueSchema, - ]), - ), + export const ArrayRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('array'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.ListRemoteValueSchema.optional(), + }), ); } export namespace Script { -export const SymbolRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("symbol"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); -} -export namespace Script { -export const ArrayRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("array"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); -} -export namespace Script { -export const ObjectRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("object"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.MappingRemoteValueSchema.optional()})); -} -export namespace Script { -export const FunctionRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("function"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const ObjectRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('object'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.MappingRemoteValueSchema.optional(), + }), + ); } export namespace Script { -export const RegExpRemoteValueSchema = z.lazy(() => Script.RegExpLocalValueSchema.and( -z.object({ -"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})) -); + export const FunctionRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('function'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const DateRemoteValueSchema = z.lazy(() => Script.DateLocalValueSchema.and( -z.object({ -"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})) -); + export const RegExpRemoteValueSchema = z.lazy(() => + Script.RegExpLocalValueSchema.and( + z.object({ + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ), + ); } export namespace Script { -export const MapRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("map"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.MappingRemoteValueSchema.optional()})); + export const DateRemoteValueSchema = z.lazy(() => + Script.DateLocalValueSchema.and( + z.object({ + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ), + ); } export namespace Script { -export const SetRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("set"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); + export const MapRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('map'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.MappingRemoteValueSchema.optional(), + }), + ); } export namespace Script { -export const WeakMapRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("weakmap"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const SetRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('set'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.ListRemoteValueSchema.optional(), + }), + ); } export namespace Script { -export const WeakSetRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("weakset"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const WeakMapRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('weakmap'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const GeneratorRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("generator"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const WeakSetRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('weakset'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const ErrorRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("error"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const GeneratorRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('generator'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const ProxyRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("proxy"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const ErrorRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('error'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const PromiseRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("promise"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const ProxyRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('proxy'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const TypedArrayRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("typedarray"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const PromiseRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('promise'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const ArrayBufferRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("arraybuffer"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const TypedArrayRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('typedarray'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const NodeListRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("nodelist"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); + export const ArrayBufferRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('arraybuffer'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const HtmlCollectionRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("htmlcollection"),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.ListRemoteValueSchema.optional()})); + export const NodeListRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('nodelist'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.ListRemoteValueSchema.optional(), + }), + ); } export namespace Script { -export const NodeRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("node"),"sharedId":Script.SharedIdSchema.optional(),"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional(),"value":Script.NodePropertiesSchema.optional()})); + export const HtmlCollectionRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('htmlcollection'), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.ListRemoteValueSchema.optional(), + }), + ); } export namespace Script { -export const NodePropertiesSchema = z.lazy(() => z.object({ -"nodeType":JsUintSchema,"childNodeCount":JsUintSchema,"attributes":z.record( -z.string(),z.string()).optional(),"children":z.array(Script.NodeRemoteValueSchema).optional(),"localName":z.string().optional(),"mode":z.enum(["open","closed",]).optional(),"namespaceURI":z.string().optional(),"nodeValue":z.string().optional(),"shadowRoot":z.union([Script.NodeRemoteValueSchema,z.null()]).optional()})); + export const NodeRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('node'), + sharedId: Script.SharedIdSchema.optional(), + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + value: Script.NodePropertiesSchema.optional(), + }), + ); } export namespace Script { -export const WindowProxyRemoteValueSchema = z.lazy(() => z.object({ -"type":z.literal("window"),"value":Script.WindowProxyPropertiesSchema,"handle":Script.HandleSchema.optional(),"internalId":Script.InternalIdSchema.optional()})); + export const NodePropertiesSchema = z.lazy(() => + z.object({ + nodeType: JsUintSchema, + childNodeCount: JsUintSchema, + attributes: z.record(z.string(), z.string()).optional(), + children: z.array(Script.NodeRemoteValueSchema).optional(), + localName: z.string().optional(), + mode: z.enum(['open', 'closed']).optional(), + namespaceURI: z.string().optional(), + nodeValue: z.string().optional(), + shadowRoot: z.union([Script.NodeRemoteValueSchema, z.null()]).optional(), + }), + ); } export namespace Script { -export const WindowProxyPropertiesSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema})); + export const WindowProxyRemoteValueSchema = z.lazy(() => + z.object({ + type: z.literal('window'), + value: Script.WindowProxyPropertiesSchema, + handle: Script.HandleSchema.optional(), + internalId: Script.InternalIdSchema.optional(), + }), + ); } export namespace Script { -export const ResultOwnershipSchema = z.lazy(() => z.enum(["root","none",])); + export const WindowProxyPropertiesSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + }), + ); } export namespace Script { -export const SerializationOptionsSchema = z.lazy(() => z.object({ -"maxDomDepth":z.union([JsUintSchema,z.null()]).default(0).optional(),"maxObjectDepth":z.union([JsUintSchema,z.null()]).default(null).optional(),"includeShadowTree":z.enum(["none","open","all",]).default("none").optional()})); + export const ResultOwnershipSchema = z.lazy(() => z.enum(['root', 'none'])); } export namespace Script { -export const SharedIdSchema = z.lazy(() => z.string()); + export const SerializationOptionsSchema = z.lazy(() => + z.object({ + maxDomDepth: z.union([JsUintSchema, z.null()]).default(0).optional(), + maxObjectDepth: z + .union([JsUintSchema, z.null()]) + .default(null) + .optional(), + includeShadowTree: z + .enum(['none', 'open', 'all']) + .default('none') + .optional(), + }), + ); } export namespace Script { -export const StackFrameSchema = z.lazy(() => z.object({ -"columnNumber":JsUintSchema,"functionName":z.string(),"lineNumber":JsUintSchema,"url":z.string()})); + export const SharedIdSchema = z.lazy(() => z.string()); } export namespace Script { -export const StackTraceSchema = z.lazy(() => z.object({ -"callFrames":z.array(Script.StackFrameSchema)})); + export const StackFrameSchema = z.lazy(() => + z.object({ + columnNumber: JsUintSchema, + functionName: z.string(), + lineNumber: JsUintSchema, + url: z.string(), + }), + ); } export namespace Script { -export const SourceSchema = z.lazy(() => z.object({ -"realm":Script.RealmSchema,"context":BrowsingContext.BrowsingContextSchema.optional()})); + export const StackTraceSchema = z.lazy(() => + z.object({ + callFrames: z.array(Script.StackFrameSchema), + }), + ); } export namespace Script { -export const RealmTargetSchema = z.lazy(() => z.object({ -"realm":Script.RealmSchema})); + export const SourceSchema = z.lazy(() => + z.object({ + realm: Script.RealmSchema, + context: BrowsingContext.BrowsingContextSchema.optional(), + }), + ); } export namespace Script { -export const ContextTargetSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"sandbox":z.string().optional()})); + export const RealmTargetSchema = z.lazy(() => + z.object({ + realm: Script.RealmSchema, + }), + ); } export namespace Script { -export const TargetSchema = z.lazy(() => z.union([Script.ContextTargetSchema,Script.RealmTargetSchema])); + export const ContextTargetSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + sandbox: z.string().optional(), + }), + ); } export namespace Script { -export const -AddPreloadScriptSchema = z.lazy(() => z.object({ -"method":z.literal("script.addPreloadScript"),"params":Script.AddPreloadScriptParametersSchema})); + export const TargetSchema = z.lazy(() => + z.union([Script.ContextTargetSchema, Script.RealmTargetSchema]), + ); } export namespace Script { -export const AddPreloadScriptParametersSchema = z.lazy(() => z.object({ -"functionDeclaration":z.string(),"arguments":z.array(Script.ChannelValueSchema).optional(),"contexts":z.array(BrowsingContext.BrowsingContextSchema).min(1).optional(),"userContexts":z.array(Browser.UserContextSchema).min(1).optional(),"sandbox":z.string().optional()})); + export const AddPreloadScriptSchema = z.lazy(() => + z.object({ + method: z.literal('script.addPreloadScript'), + params: Script.AddPreloadScriptParametersSchema, + }), + ); } export namespace Script { -export const AddPreloadScriptResultSchema = z.lazy(() => z.object({ -"script":Script.PreloadScriptSchema})); + export const AddPreloadScriptParametersSchema = z.lazy(() => + z.object({ + functionDeclaration: z.string(), + arguments: z.array(Script.ChannelValueSchema).optional(), + contexts: z + .array(BrowsingContext.BrowsingContextSchema) + .min(1) + .optional(), + userContexts: z.array(Browser.UserContextSchema).min(1).optional(), + sandbox: z.string().optional(), + }), + ); } export namespace Script { -export const -DisownSchema = z.lazy(() => z.object({ -"method":z.literal("script.disown"),"params":Script.DisownParametersSchema})); + export const AddPreloadScriptResultSchema = z.lazy(() => + z.object({ + script: Script.PreloadScriptSchema, + }), + ); } export namespace Script { -export const DisownParametersSchema = z.lazy(() => z.object({ -"handles":z.array(Script.HandleSchema),"target":Script.TargetSchema})); + export const DisownSchema = z.lazy(() => + z.object({ + method: z.literal('script.disown'), + params: Script.DisownParametersSchema, + }), + ); } export namespace Script { - export const CallFunctionSchema = z.lazy(() => + export const DisownParametersSchema = z.lazy(() => z.object({ - method: z.literal('script.callFunction'), - params: Script.CallFunctionParametersSchema, + handles: z.array(Script.HandleSchema), + target: Script.TargetSchema, }), ); } @@ -1704,41 +2780,68 @@ export namespace Script { ); } export namespace Script { -export const -EvaluateSchema = z.lazy(() => z.object({ -"method":z.literal("script.evaluate"),"params":Script.EvaluateParametersSchema})); + export const CallFunctionSchema = z.lazy(() => + z.object({ + method: z.literal('script.callFunction'), + params: Script.CallFunctionParametersSchema, + }), + ); } export namespace Script { -export const EvaluateParametersSchema = z.lazy(() => z.object({ -"expression":z.string(),"target":Script.TargetSchema,"awaitPromise":z.boolean(),"resultOwnership":Script.ResultOwnershipSchema.optional(),"serializationOptions":Script.SerializationOptionsSchema.optional(),"userActivation":z.boolean().default(false).optional()})); + export const EvaluateSchema = z.lazy(() => + z.object({ + method: z.literal('script.evaluate'), + params: Script.EvaluateParametersSchema, + }), + ); } export namespace Script { -export const -GetRealmsSchema = z.lazy(() => z.object({ -"method":z.literal("script.getRealms"),"params":Script.GetRealmsParametersSchema})); + export const EvaluateParametersSchema = z.lazy(() => + z.object({ + expression: z.string(), + target: Script.TargetSchema, + awaitPromise: z.boolean(), + resultOwnership: Script.ResultOwnershipSchema.optional(), + serializationOptions: Script.SerializationOptionsSchema.optional(), + userActivation: z.boolean().default(false).optional(), + }), + ); } export namespace Script { -export const GetRealmsParametersSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema.optional(),"type":Script.RealmTypeSchema.optional()})); + export const GetRealmsSchema = z.lazy(() => + z.object({ + method: z.literal('script.getRealms'), + params: Script.GetRealmsParametersSchema, + }), + ); } export namespace Script { -export const GetRealmsResultSchema = z.lazy(() => z.object({ -"realms":z.array(Script.RealmInfoSchema)})); + export const GetRealmsParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema.optional(), + type: Script.RealmTypeSchema.optional(), + }), + ); } export namespace Script { -export const -RemovePreloadScriptSchema = z.lazy(() => z.object({ -"method":z.literal("script.removePreloadScript"),"params":Script.RemovePreloadScriptParametersSchema})); + export const GetRealmsResultSchema = z.lazy(() => + z.object({ + realms: z.array(Script.RealmInfoSchema), + }), + ); } export namespace Script { -export const RemovePreloadScriptParametersSchema = z.lazy(() => z.object({ -"script":Script.PreloadScriptSchema})); + export const RemovePreloadScriptSchema = z.lazy(() => + z.object({ + method: z.literal('script.removePreloadScript'), + params: Script.RemovePreloadScriptParametersSchema, + }), + ); } export namespace Script { - export const MessageSchema = z.lazy(() => + export const RemovePreloadScriptParametersSchema = z.lazy(() => z.object({ - method: z.literal('script.message'), - params: Script.MessageParametersSchema, + script: Script.PreloadScriptSchema, }), ); } @@ -1760,117 +2863,236 @@ export namespace Script { ); } export namespace Script { -export const -RealmDestroyedSchema = z.lazy(() => z.object({ -"method":z.literal("script.realmDestroyed"),"params":Script.RealmDestroyedParametersSchema})); + export const MessageSchema = z.lazy(() => + z.object({ + method: z.literal('script.message'), + params: Script.MessageParametersSchema, + }), + ); } export namespace Script { -export const RealmDestroyedParametersSchema = z.lazy(() => z.object({ -"realm":Script.RealmSchema})); + export const RealmDestroyedSchema = z.lazy(() => + z.object({ + method: z.literal('script.realmDestroyed'), + params: Script.RealmDestroyedParametersSchema, + }), + ); } -export const -StorageCommandSchema = z.lazy(() => z.union([Storage.DeleteCookiesSchema,Storage.GetCookiesSchema,Storage.SetCookieSchema])); -export const StorageResultSchema = z.lazy(() => z.union([Storage.DeleteCookiesResultSchema,Storage.GetCookiesResultSchema,Storage.SetCookieResultSchema])); -export namespace Storage { -export const PartitionKeySchema = z.lazy(() => z.object({ -"userContext":z.string().optional(),"sourceOrigin":z.string().optional()}).and( -ExtensibleSchema) +export namespace Script { + export const RealmDestroyedParametersSchema = z.lazy(() => + z.object({ + realm: Script.RealmSchema, + }), + ); +} +export const StorageCommandSchema = z.lazy(() => + z.union([ + Storage.DeleteCookiesSchema, + Storage.GetCookiesSchema, + Storage.SetCookieSchema, + ]), +); +export const StorageResultSchema = z.lazy(() => + z.union([ + Storage.DeleteCookiesResultSchema, + Storage.GetCookiesResultSchema, + Storage.SetCookieResultSchema, + ]), ); +export namespace Storage { + export const PartitionKeySchema = z.lazy(() => + z + .object({ + userContext: z.string().optional(), + sourceOrigin: z.string().optional(), + }) + .and(ExtensibleSchema), + ); } export namespace Storage { -export const -GetCookiesSchema = z.lazy(() => z.object({ -"method":z.literal("storage.getCookies"),"params":Storage.GetCookiesParametersSchema})); + export const GetCookiesSchema = z.lazy(() => + z.object({ + method: z.literal('storage.getCookies'), + params: Storage.GetCookiesParametersSchema, + }), + ); } export namespace Storage { -export const CookieFilterSchema = z.lazy(() => z.object({ -"name":z.string().optional(),"value":Network.BytesValueSchema.optional(),"domain":z.string().optional(),"path":z.string().optional(),"size":JsUintSchema.optional(),"httpOnly":z.boolean().optional(),"secure":z.boolean().optional(),"sameSite":Network.SameSiteSchema.optional(),"expiry":JsUintSchema.optional()}).and( -ExtensibleSchema) -); + export const CookieFilterSchema = z.lazy(() => + z + .object({ + name: z.string().optional(), + value: Network.BytesValueSchema.optional(), + domain: z.string().optional(), + path: z.string().optional(), + size: JsUintSchema.optional(), + httpOnly: z.boolean().optional(), + secure: z.boolean().optional(), + sameSite: Network.SameSiteSchema.optional(), + expiry: JsUintSchema.optional(), + }) + .and(ExtensibleSchema), + ); } export namespace Storage { -export const BrowsingContextPartitionDescriptorSchema = z.lazy(() => z.object({ -"type":z.literal("context"),"context":BrowsingContext.BrowsingContextSchema})); + export const BrowsingContextPartitionDescriptorSchema = z.lazy(() => + z.object({ + type: z.literal('context'), + context: BrowsingContext.BrowsingContextSchema, + }), + ); } export namespace Storage { -export const StorageKeyPartitionDescriptorSchema = z.lazy(() => z.object({ -"type":z.literal("storageKey"),"userContext":z.string().optional(),"sourceOrigin":z.string().optional()}).and( -ExtensibleSchema) -); + export const StorageKeyPartitionDescriptorSchema = z.lazy(() => + z + .object({ + type: z.literal('storageKey'), + userContext: z.string().optional(), + sourceOrigin: z.string().optional(), + }) + .and(ExtensibleSchema), + ); } export namespace Storage { -export const PartitionDescriptorSchema = z.lazy(() => z.union([Storage.BrowsingContextPartitionDescriptorSchema,Storage.StorageKeyPartitionDescriptorSchema])); + export const PartitionDescriptorSchema = z.lazy(() => + z.union([ + Storage.BrowsingContextPartitionDescriptorSchema, + Storage.StorageKeyPartitionDescriptorSchema, + ]), + ); } export namespace Storage { -export const GetCookiesParametersSchema = z.lazy(() => z.object({ -"filter":Storage.CookieFilterSchema.optional(),"partition":Storage.PartitionDescriptorSchema.optional()})); + export const GetCookiesParametersSchema = z.lazy(() => + z.object({ + filter: Storage.CookieFilterSchema.optional(), + partition: Storage.PartitionDescriptorSchema.optional(), + }), + ); } export namespace Storage { -export const GetCookiesResultSchema = z.lazy(() => z.object({ -"cookies":z.array(Network.CookieSchema),"partitionKey":Storage.PartitionKeySchema})); + export const GetCookiesResultSchema = z.lazy(() => + z.object({ + cookies: z.array(Network.CookieSchema), + partitionKey: Storage.PartitionKeySchema, + }), + ); } export namespace Storage { -export const -SetCookieSchema = z.lazy(() => z.object({ -"method":z.literal("storage.setCookie"),"params":Storage.SetCookieParametersSchema})); + export const SetCookieSchema = z.lazy(() => + z.object({ + method: z.literal('storage.setCookie'), + params: Storage.SetCookieParametersSchema, + }), + ); } export namespace Storage { -export const PartialCookieSchema = z.lazy(() => z.object({ -"name":z.string(),"value":Network.BytesValueSchema,"domain":z.string(),"path":z.string().optional(),"httpOnly":z.boolean().optional(),"secure":z.boolean().optional(),"sameSite":Network.SameSiteSchema.optional(),"expiry":JsUintSchema.optional()}).and( -ExtensibleSchema) -); + export const PartialCookieSchema = z.lazy(() => + z + .object({ + name: z.string(), + value: Network.BytesValueSchema, + domain: z.string(), + path: z.string().optional(), + httpOnly: z.boolean().optional(), + secure: z.boolean().optional(), + sameSite: Network.SameSiteSchema.optional(), + expiry: JsUintSchema.optional(), + }) + .and(ExtensibleSchema), + ); } export namespace Storage { -export const SetCookieParametersSchema = z.lazy(() => z.object({ -"cookie":Storage.PartialCookieSchema,"partition":Storage.PartitionDescriptorSchema.optional()})); + export const SetCookieParametersSchema = z.lazy(() => + z.object({ + cookie: Storage.PartialCookieSchema, + partition: Storage.PartitionDescriptorSchema.optional(), + }), + ); } export namespace Storage { -export const SetCookieResultSchema = z.lazy(() => z.object({ -"partitionKey":Storage.PartitionKeySchema})); + export const SetCookieResultSchema = z.lazy(() => + z.object({ + partitionKey: Storage.PartitionKeySchema, + }), + ); } export namespace Storage { -export const -DeleteCookiesSchema = z.lazy(() => z.object({ -"method":z.literal("storage.deleteCookies"),"params":Storage.DeleteCookiesParametersSchema})); + export const DeleteCookiesSchema = z.lazy(() => + z.object({ + method: z.literal('storage.deleteCookies'), + params: Storage.DeleteCookiesParametersSchema, + }), + ); } export namespace Storage { -export const DeleteCookiesParametersSchema = z.lazy(() => z.object({ -"filter":Storage.CookieFilterSchema.optional(),"partition":Storage.PartitionDescriptorSchema.optional()})); + export const DeleteCookiesParametersSchema = z.lazy(() => + z.object({ + filter: Storage.CookieFilterSchema.optional(), + partition: Storage.PartitionDescriptorSchema.optional(), + }), + ); } export namespace Storage { -export const DeleteCookiesResultSchema = z.lazy(() => z.object({ -"partitionKey":Storage.PartitionKeySchema})); + export const DeleteCookiesResultSchema = z.lazy(() => + z.object({ + partitionKey: Storage.PartitionKeySchema, + }), + ); } -export const -LogEventSchema = z.lazy(() => Log.EntryAddedSchema); +export const LogEventSchema = z.lazy(() => Log.EntryAddedSchema); export namespace Log { -export const LevelSchema = z.lazy(() => z.enum(["debug","info","warn","error",])); + export const LevelSchema = z.lazy(() => + z.enum(['debug', 'info', 'warn', 'error']), + ); } export namespace Log { -export const EntrySchema = z.lazy(() => z.union([Log.GenericLogEntrySchema,Log.ConsoleLogEntrySchema,Log.JavascriptLogEntrySchema])); + export const EntrySchema = z.lazy(() => + z.union([ + Log.GenericLogEntrySchema, + Log.ConsoleLogEntrySchema, + Log.JavascriptLogEntrySchema, + ]), + ); } export namespace Log { -export const -BaseLogEntrySchema = z.lazy(() => z.object({ -"level":Log.LevelSchema,"source":Script.SourceSchema,"text":z.union([z.string(),z.null()]),"timestamp":JsUintSchema,"stackTrace":Script.StackTraceSchema.optional()})); + export const BaseLogEntrySchema = z.lazy(() => + z.object({ + level: Log.LevelSchema, + source: Script.SourceSchema, + text: z.union([z.string(), z.null()]), + timestamp: JsUintSchema, + stackTrace: Script.StackTraceSchema.optional(), + }), + ); } export namespace Log { -export const GenericLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( -z.object({ -"type":z.string()})) -); + export const GenericLogEntrySchema = z.lazy(() => + Log.BaseLogEntrySchema.and( + z.object({ + type: z.string(), + }), + ), + ); } export namespace Log { -export const ConsoleLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( -z.object({ -"type":z.literal("console"),"method":z.string(),"args":z.array(Script.RemoteValueSchema)})) -); + export const ConsoleLogEntrySchema = z.lazy(() => + Log.BaseLogEntrySchema.and( + z.object({ + type: z.literal('console'), + method: z.string(), + args: z.array(Script.RemoteValueSchema), + }), + ), + ); } export namespace Log { -export const JavascriptLogEntrySchema = z.lazy(() => Log.BaseLogEntrySchema.and( -z.object({ -"type":z.literal("javascript")})) -); + export const JavascriptLogEntrySchema = z.lazy(() => + Log.BaseLogEntrySchema.and( + z.object({ + type: z.literal('javascript'), + }), + ), + ); } export namespace Log { export const EntryAddedSchema = z.lazy(() => @@ -1896,14 +3118,6 @@ export namespace Input { }), ); } -export namespace Input { - export const PerformActionsSchema = z.lazy(() => - z.object({ - method: z.literal('input.performActions'), - params: Input.PerformActionsParametersSchema, - }), - ); -} export namespace Input { export const PerformActionsParametersSchema = z.lazy(() => z.object({ @@ -1912,16 +3126,6 @@ export namespace Input { }), ); } -export namespace Input { - export const SourceActionsSchema = z.lazy(() => - z.union([ - Input.NoneSourceActionsSchema, - Input.KeySourceActionsSchema, - Input.PointerSourceActionsSchema, - Input.WheelSourceActionsSchema, - ]), - ); -} export namespace Input { export const NoneSourceActionsSchema = z.lazy(() => z.object({ @@ -1931,9 +3135,6 @@ export namespace Input { }), ); } -export namespace Input { - export const NoneSourceActionSchema = z.lazy(() => Input.PauseActionSchema); -} export namespace Input { export const KeySourceActionsSchema = z.lazy(() => z.object({ @@ -1943,6 +3144,37 @@ export namespace Input { }), ); } +export namespace Input { + export const PointerSourceActionsSchema = z.lazy(() => + z.object({ + type: z.literal('pointer'), + id: z.string(), + parameters: Input.PointerParametersSchema.optional(), + actions: z.array(Input.PointerSourceActionSchema), + }), + ); +} +export namespace Input { + export const PerformActionsSchema = z.lazy(() => + z.object({ + method: z.literal('input.performActions'), + params: Input.PerformActionsParametersSchema, + }), + ); +} +export namespace Input { + export const SourceActionsSchema = z.lazy(() => + z.union([ + Input.NoneSourceActionsSchema, + Input.KeySourceActionsSchema, + Input.PointerSourceActionsSchema, + Input.WheelSourceActionsSchema, + ]), + ); +} +export namespace Input { + export const NoneSourceActionSchema = z.lazy(() => Input.PauseActionSchema); +} export namespace Input { export const KeySourceActionSchema = z.lazy(() => z.union([ @@ -1953,11 +3185,9 @@ export namespace Input { ); } export namespace Input { -export const PointerSourceActionsSchema = z.lazy(() => z.object({ -"type":z.literal("pointer"),"id":z.string(),"parameters":Input.PointerParametersSchema.optional(),"actions":z.array(Input.PointerSourceActionSchema)})); -} -export namespace Input { -export const PointerTypeSchema = z.lazy(() => z.enum(["mouse","pen","touch",])); + export const PointerTypeSchema = z.lazy(() => + z.enum(['mouse', 'pen', 'touch']), + ); } export namespace Input { export const PointerParametersSchema = z.lazy(() => @@ -1966,6 +3196,15 @@ export namespace Input { }), ); } +export namespace Input { + export const WheelSourceActionsSchema = z.lazy(() => + z.object({ + type: z.literal('wheel'), + id: z.string(), + actions: z.array(Input.WheelSourceActionSchema), + }), + ); +} export namespace Input { export const PointerSourceActionSchema = z.lazy(() => z.union([ @@ -1976,15 +3215,6 @@ export namespace Input { ]), ); } -export namespace Input { - export const WheelSourceActionsSchema = z.lazy(() => - z.object({ - type: z.literal('wheel'), - id: z.string(), - actions: z.array(Input.WheelSourceActionSchema), - }), - ); -} export namespace Input { export const WheelSourceActionSchema = z.lazy(() => z.union([Input.PauseActionSchema, Input.WheelScrollActionSchema]), @@ -2129,61 +3359,147 @@ export namespace Input { }), ); } +export const AutofillCommandSchema = z.lazy(() => Autofill.TriggerSchema); +export namespace Autofill { + export const TriggerSchema = z.lazy(() => + z.object({ + method: z.literal('autofill.trigger'), + params: Autofill.TriggerParametersSchema, + }), + ); +} +export namespace Autofill { + export const TriggerParametersSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + element: Script.SharedReferenceSchema, + card: Autofill.CardSchema.optional(), + address: Autofill.AddressSchema.optional(), + }), + ); +} +export namespace Autofill { + export const FieldSchema = z.lazy(() => + z.object({ + name: Autofill.FieldNameSchema, + value: z.string(), + }), + ); +} +export namespace Autofill { + export const CardSchema = z.lazy(() => + z.object({ + number: z.string(), + name: z.string(), + expiryMonth: z.string(), + expiryYear: z.string(), + cvc: z.string(), + }), + ); +} +export namespace Autofill { + export const AddressSchema = z.lazy(() => + z.object({ + fields: z.array(Autofill.FieldSchema), + }), + ); +} +export namespace Autofill { + export const FieldNameSchema = z.lazy(() => z.string()); +} export namespace Input { -export const -FileDialogOpenedSchema = z.lazy(() => z.object({ -"method":z.literal("input.fileDialogOpened"),"params":Input.FileDialogInfoSchema})); + export const FileDialogOpenedSchema = z.lazy(() => + z.object({ + method: z.literal('input.fileDialogOpened'), + params: Input.FileDialogInfoSchema, + }), + ); } export namespace Input { -export const FileDialogInfoSchema = z.lazy(() => z.object({ -"context":BrowsingContext.BrowsingContextSchema,"element":Script.SharedReferenceSchema.optional(),"multiple":z.boolean()})); + export const FileDialogInfoSchema = z.lazy(() => + z.object({ + context: BrowsingContext.BrowsingContextSchema, + element: Script.SharedReferenceSchema.optional(), + multiple: z.boolean(), + }), + ); } -export const -WebExtensionCommandSchema = z.lazy(() => z.union([WebExtension.InstallSchema,WebExtension.UninstallSchema])); -export const WebExtensionResultSchema = z.lazy(() => WebExtension.InstallResultSchema); +export const WebExtensionCommandSchema = z.lazy(() => + z.union([WebExtension.InstallSchema, WebExtension.UninstallSchema]), +); +export const WebExtensionResultSchema = z.lazy( + () => WebExtension.InstallResultSchema, +); export namespace WebExtension { -export const ExtensionSchema = z.lazy(() => z.string()); + export const ExtensionSchema = z.lazy(() => z.string()); } export namespace WebExtension { - export const InstallSchema = z.lazy(() => + export const InstallParametersSchema = z.lazy(() => z.object({ - method: z.literal('webExtension.install'), - params: WebExtension.InstallParametersSchema, + extensionData: WebExtension.ExtensionDataSchema, }), ); } export namespace WebExtension { - export const InstallParametersSchema = z.lazy(() => + export const InstallSchema = z.lazy(() => z.object({ - extensionData: WebExtension.ExtensionDataSchema, + method: z.literal('webExtension.install'), + params: WebExtension.InstallParametersSchema, }), ); } export namespace WebExtension { -export const ExtensionDataSchema = z.lazy(() => z.union([WebExtension.ExtensionArchivePathSchema,WebExtension.ExtensionBase64EncodedSchema,WebExtension.ExtensionPathSchema])); + export const ExtensionDataSchema = z.lazy(() => + z.union([ + WebExtension.ExtensionArchivePathSchema, + WebExtension.ExtensionBase64EncodedSchema, + WebExtension.ExtensionPathSchema, + ]), + ); } export namespace WebExtension { -export const ExtensionPathSchema = z.lazy(() => z.object({ -"type":z.literal("path"),"path":z.string()})); + export const ExtensionPathSchema = z.lazy(() => + z.object({ + type: z.literal('path'), + path: z.string(), + }), + ); } export namespace WebExtension { -export const ExtensionArchivePathSchema = z.lazy(() => z.object({ -"type":z.literal("archivePath"),"path":z.string()})); + export const ExtensionArchivePathSchema = z.lazy(() => + z.object({ + type: z.literal('archivePath'), + path: z.string(), + }), + ); } export namespace WebExtension { -export const ExtensionBase64EncodedSchema = z.lazy(() => z.object({ -"type":z.literal("base64"),"value":z.string()})); + export const ExtensionBase64EncodedSchema = z.lazy(() => + z.object({ + type: z.literal('base64'), + value: z.string(), + }), + ); } export namespace WebExtension { -export const InstallResultSchema = z.lazy(() => z.object({ -"extension":WebExtension.ExtensionSchema})); + export const InstallResultSchema = z.lazy(() => + z.object({ + extension: WebExtension.ExtensionSchema, + }), + ); } export namespace WebExtension { -export const -UninstallSchema = z.lazy(() => z.object({ -"method":z.literal("webExtension.uninstall"),"params":WebExtension.UninstallParametersSchema})); + export const UninstallSchema = z.lazy(() => + z.object({ + method: z.literal('webExtension.uninstall'), + params: WebExtension.UninstallParametersSchema, + }), + ); } export namespace WebExtension { -export const UninstallParametersSchema = z.lazy(() => z.object({ -"extension":WebExtension.ExtensionSchema})); + export const UninstallParametersSchema = z.lazy(() => + z.object({ + extension: WebExtension.ExtensionSchema, + }), + ); } diff --git a/src/protocol/generated/webdriver-bidi.ts b/src/protocol/generated/webdriver-bidi.ts index 989c12669b..ca140b647a 100644 --- a/src/protocol/generated/webdriver-bidi.ts +++ b/src/protocol/generated/webdriver-bidi.ts @@ -1,4 +1,3 @@ - /** * Copyright 2024 Google LLC. * Copyright (c) Microsoft Corporation. @@ -17,15 +16,30 @@ */ /** - * THIS FILE IS AUTOGENERATED by cddlconv 0.1.7. + * THIS FILE IS AUTOGENERATED by cddlconv 0.1.6. * Run `node tools/generate-bidi-types.mjs` to regenerate. * @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs */ +export type Event = { + type: 'event'; +} & EventData & + Extensible; export type Command = { id: JsUint; } & CommandData & Extensible; +export type CommandResponse = { + type: 'success'; + id: JsUint; + result: ResultData; +} & Extensible; +export type EventData = + | BrowsingContextEvent + | InputEvent + | LogEvent + | NetworkEvent + | ScriptEvent; export type CommandData = | BrowserCommand | BrowsingContextCommand @@ -35,14 +49,18 @@ export type CommandData = | ScriptCommand | SessionCommand | StorageCommand - | WebExtensionCommand; + | WebExtensionCommand + | AutofillCommand; +export type ResultData = + | BrowsingContextResult + | EmptyResult + | NetworkResult + | ScriptResult + | SessionResult + | StorageResult + | WebExtensionResult; export type EmptyParams = Extensible; export type Message = CommandResponse | ErrorResponse | Event; -export type CommandResponse = { - type: 'success'; - id: JsUint; - result: ResultData; -} & Extensible; export type ErrorResponse = { type: 'error'; id: JsUint | null; @@ -50,25 +68,7 @@ export type ErrorResponse = { message: string; stacktrace?: string; } & Extensible; -export type ResultData = - | BrowsingContextResult - | EmptyResult - | NetworkResult - | ScriptResult - | SessionResult - | StorageResult - | WebExtensionResult; export type EmptyResult = Extensible; -export type Event = { - type: 'event'; -} & EventData & - Extensible; -export type EventData = - | BrowsingContextEvent - | InputEvent - | LogEvent - | NetworkEvent - | ScriptEvent; export type Extensible = { [key: string]: any; }; @@ -76,42 +76,43 @@ export type Extensible = { /** * Must be between `-9007199254740991` and `9007199254740991`, inclusive. */ -export type JsInt = (number); +export type JsInt = number; /** * Must be between `0` and `9007199254740991`, inclusive. */ -export type JsUint = (number); -export const enum ErrorCode {InvalidArgument = "invalid argument", -InvalidSelector = "invalid selector", -InvalidElementState = "invalid element state", -InvalidSessionId = "invalid session id", -InvalidWebExtension = "invalid web extension", -MoveTargetOutOfBounds = "move target out of bounds", -NoSuchAlert = "no such alert", -NoSuchNetworkCollector = "no such network collector", -NoSuchElement = "no such element", -NoSuchFrame = "no such frame", -NoSuchHandle = "no such handle", -NoSuchHistoryEntry = "no such history entry", -NoSuchIntercept = "no such intercept", -NoSuchNetworkData = "no such network data", -NoSuchNode = "no such node", -NoSuchRequest = "no such request", -NoSuchScript = "no such script", -NoSuchStoragePartition = "no such storage partition", -NoSuchUserContext = "no such user context", -NoSuchWebExtension = "no such web extension", -SessionNotCreated = "session not created", -UnableToCaptureScreen = "unable to capture screen", -UnableToCloseBrowser = "unable to close browser", -UnableToSetCookie = "unable to set cookie", -UnableToSetFileInput = "unable to set file input", -UnavailableNetworkData = "unavailable network data", -UnderspecifiedStoragePartition = "underspecified storage partition", -UnknownCommand = "unknown command", -UnknownError = "unknown error", -UnsupportedOperation = "unsupported operation", +export type JsUint = number; +export const enum ErrorCode { + InvalidArgument = 'invalid argument', + InvalidSelector = 'invalid selector', + InvalidElementState = 'invalid element state', + InvalidSessionId = 'invalid session id', + InvalidWebExtension = 'invalid web extension', + MoveTargetOutOfBounds = 'move target out of bounds', + NoSuchAlert = 'no such alert', + NoSuchNetworkCollector = 'no such network collector', + NoSuchElement = 'no such element', + NoSuchFrame = 'no such frame', + NoSuchHandle = 'no such handle', + NoSuchHistoryEntry = 'no such history entry', + NoSuchIntercept = 'no such intercept', + NoSuchNetworkData = 'no such network data', + NoSuchNode = 'no such node', + NoSuchRequest = 'no such request', + NoSuchScript = 'no such script', + NoSuchStoragePartition = 'no such storage partition', + NoSuchUserContext = 'no such user context', + NoSuchWebExtension = 'no such web extension', + SessionNotCreated = 'session not created', + UnableToCaptureScreen = 'unable to capture screen', + UnableToCloseBrowser = 'unable to close browser', + UnableToSetCookie = 'unable to set cookie', + UnableToSetFileInput = 'unable to set file input', + UnavailableNetworkData = 'unavailable network data', + UnderspecifiedStoragePartition = 'underspecified storage partition', + UnknownCommand = 'unknown command', + UnknownError = 'unknown error', + UnsupportedOperation = 'unsupported operation', } export type SessionCommand = | Session.End @@ -119,19 +120,6 @@ export type SessionCommand = | Session.Status | Session.Subscribe | Session.Unsubscribe; -export type SessionResult = - | Session.NewResult - | Session.StatusResult - | Session.SubscribeResult; -export namespace Session { -export type CapabilitiesRequest = (({ -"alwaysMatch"?:(Session.CapabilityRequest),"firstMatch"?:([ -...((Session.CapabilityRequest)[])])})); -} -export namespace Session { -export type CapabilityRequest = (({ -"acceptInsecureCerts"?:(boolean),"browserName"?:(string),"browserVersion"?:(string),"platformName"?:(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)}&Extensible)); -} export namespace Session { export type ProxyConfiguration = | Session.AutodetectProxyConfiguration @@ -140,6 +128,26 @@ export namespace Session { | Session.PacProxyConfiguration | Session.SystemProxyConfiguration; } +export type SessionResult = + | Session.NewResult + | Session.StatusResult + | Session.SubscribeResult; +export namespace Session { + export type CapabilitiesRequest = { + alwaysMatch?: Session.CapabilityRequest; + firstMatch?: [...Session.CapabilityRequest[]]; + }; +} +export namespace Session { + export type CapabilityRequest = { + acceptInsecureCerts?: boolean; + browserName?: string; + browserVersion?: string; + platformName?: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + } & Extensible; +} export namespace Session { export type AutodetectProxyConfiguration = { proxyType: 'autodetect'; @@ -169,156 +177,238 @@ export namespace Session { }; } export namespace Session { -export type PacProxyConfiguration = ({ -"proxyType":("pac"),"proxyAutoconfigUrl":(string)}&Extensible); + export type PacProxyConfiguration = { + proxyType: 'pac'; + proxyAutoconfigUrl: string; + } & Extensible; } export namespace Session { -export type SystemProxyConfiguration = ({ -"proxyType":("system")}&Extensible); + export type SystemProxyConfiguration = { + proxyType: 'system'; + } & Extensible; } export namespace Session { -export type UserPromptHandler = (({ -"alert"?:(Session.UserPromptHandlerType),"beforeUnload"?:(Session.UserPromptHandlerType),"confirm"?:(Session.UserPromptHandlerType),"default"?:(Session.UserPromptHandlerType),"file"?:(Session.UserPromptHandlerType),"prompt"?:(Session.UserPromptHandlerType)})); + export type UserPromptHandler = { + alert?: Session.UserPromptHandlerType; + beforeUnload?: Session.UserPromptHandlerType; + confirm?: Session.UserPromptHandlerType; + default?: Session.UserPromptHandlerType; + file?: Session.UserPromptHandlerType; + prompt?: Session.UserPromptHandlerType; + }; } export namespace Session { -export const enum UserPromptHandlerType {Accept = "accept", -Dismiss = "dismiss", -Ignore = "ignore", -} + export const enum UserPromptHandlerType { + Accept = 'accept', + Dismiss = 'dismiss', + Ignore = 'ignore', + } } export namespace Session { -export type Subscription = (string); + export type Subscription = string; } export namespace Session { -export type SubscriptionRequest = (({ -"events":([ -(string),...(string)[]]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SubscriptionRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Session { -export type UnsubscribeByIdRequest = (({ -"subscriptions":([ -(Session.Subscription),...(Session.Subscription)[]])})); + export type UnsubscribeByIdRequest = { + subscriptions: [Session.Subscription, ...Session.Subscription[]]; + }; } export namespace Session { -export type UnsubscribeByAttributesRequest = (({ -"events":([ -(string),...(string)[]]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); + export type UnsubscribeByAttributesRequest = { + events: [string, ...string[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export namespace Session { -export type Status = ({ -"method":("session.status"),"params":(EmptyParams)}); + export type Status = { + method: 'session.status'; + params: EmptyParams; + }; } export namespace Session { -export type StatusResult = (({ -"ready":(boolean),"message":(string)})); + export type StatusResult = { + ready: boolean; + message: string; + }; } export namespace Session { -export type New = ({ -"method":("session.new"),"params":(Session.NewParameters)}); + export type New = { + method: 'session.new'; + params: Session.NewParameters; + }; } export namespace Session { -export type NewParameters = (({ -"capabilities":(Session.CapabilitiesRequest)})); + export type NewParameters = { + capabilities: Session.CapabilitiesRequest; + }; } export namespace Session { -export type NewResult = (({ -"sessionId":(string),"capabilities":(({ -"acceptInsecureCerts":(boolean),"browserName":(string),"browserVersion":(string),"platformName":(string),"setWindowRect":(boolean),"userAgent":(string),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler),"webSocketUrl"?:(string)}&Extensible))})); + export type NewResult = { + sessionId: string; + capabilities: { + acceptInsecureCerts: boolean; + browserName: string; + browserVersion: string; + platformName: string; + setWindowRect: boolean; + userAgent: string; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + webSocketUrl?: string; + } & Extensible; + }; } export namespace Session { -export type End = ({ -"method":("session.end"),"params":(EmptyParams)}); + export type End = { + method: 'session.end'; + params: EmptyParams; + }; } export namespace Session { -export type Subscribe = ({ -"method":("session.subscribe"),"params":(Session.SubscriptionRequest)}); + export type Subscribe = { + method: 'session.subscribe'; + params: Session.SubscriptionRequest; + }; } export namespace Session { -export type SubscribeResult = (({ -"subscription":(Session.Subscription)})); + export type SubscribeResult = { + subscription: Session.Subscription; + }; } export namespace Session { -export type Unsubscribe = ({ -"method":("session.unsubscribe"),"params":(Session.UnsubscribeParameters)}); + export type Unsubscribe = { + method: 'session.unsubscribe'; + params: Session.UnsubscribeParameters; + }; } export namespace Session { -export type UnsubscribeParameters = (Session.UnsubscribeByAttributesRequest| Session.UnsubscribeByIdRequest); -} -export type BrowserCommand = (Browser.Close| Browser.CreateUserContext| Browser.GetClientWindows| Browser.GetUserContexts| Browser.RemoveUserContext| Browser.SetClientWindowState); -export type BrowserResult = ((Browser.CreateUserContextResult| Browser.GetUserContextsResult)); + export type UnsubscribeParameters = + | Session.UnsubscribeByAttributesRequest + | Session.UnsubscribeByIdRequest; +} +export type BrowserCommand = + | Browser.Close + | Browser.CreateUserContext + | Browser.GetClientWindows + | Browser.GetUserContexts + | Browser.RemoveUserContext + | Browser.SetClientWindowState; +export type BrowserResult = + | Browser.CreateUserContextResult + | Browser.GetUserContextsResult; export namespace Browser { -export type ClientWindow = (string); + export type ClientWindow = string; } export namespace Browser { -export type ClientWindowInfo = (({ -"active":(boolean),"clientWindow":(Browser.ClientWindow),"height":(JsUint),"state":("fullscreen"| "maximized"| "minimized"| "normal"),"width":(JsUint),"x":(JsInt),"y":(JsInt)})); + export type ClientWindowInfo = { + active: boolean; + clientWindow: Browser.ClientWindow; + height: JsUint; + state: 'fullscreen' | 'maximized' | 'minimized' | 'normal'; + width: JsUint; + x: JsInt; + y: JsInt; + }; } export namespace Browser { -export type UserContext = (string); + export type UserContext = string; } export namespace Browser { -export type UserContextInfo = (({ -"userContext":(Browser.UserContext)})); + export type UserContextInfo = { + userContext: Browser.UserContext; + }; } export namespace Browser { -export type Close = ({ -"method":("browser.close"),"params":(EmptyParams)}); + export type Close = { + method: 'browser.close'; + params: EmptyParams; + }; } export namespace Browser { -export type CreateUserContext = ({ -"method":("browser.createUserContext"),"params":(Browser.CreateUserContextParameters)}); + export type CreateUserContext = { + method: 'browser.createUserContext'; + params: Browser.CreateUserContextParameters; + }; } export namespace Browser { -export type CreateUserContextParameters = (({ -"acceptInsecureCerts"?:(boolean),"proxy"?:(Session.ProxyConfiguration),"unhandledPromptBehavior"?:(Session.UserPromptHandler)})); + export type CreateUserContextParameters = { + acceptInsecureCerts?: boolean; + proxy?: Session.ProxyConfiguration; + unhandledPromptBehavior?: Session.UserPromptHandler; + }; } export namespace Browser { -export type CreateUserContextResult = (Browser.UserContextInfo); + export type CreateUserContextResult = Browser.UserContextInfo; } export namespace Browser { -export type GetClientWindows = ({ -"method":("browser.getClientWindows"),"params":(EmptyParams)}); + export type GetClientWindows = { + method: 'browser.getClientWindows'; + params: EmptyParams; + }; } export namespace Browser { -export type GetClientWindowsResult = (({ -"clientWindows":([ -...((Browser.ClientWindowInfo)[])])})); + export type GetClientWindowsResult = { + clientWindows: [...Browser.ClientWindowInfo[]]; + }; } export namespace Browser { -export type GetUserContexts = ({ -"method":("browser.getUserContexts"),"params":(EmptyParams)}); + export type GetUserContexts = { + method: 'browser.getUserContexts'; + params: EmptyParams; + }; } export namespace Browser { -export type GetUserContextsResult = (({ -"userContexts":([ -(Browser.UserContextInfo),...(Browser.UserContextInfo)[]])})); + export type GetUserContextsResult = { + userContexts: [Browser.UserContextInfo, ...Browser.UserContextInfo[]]; + }; } export namespace Browser { -export type RemoveUserContext = ({ -"method":("browser.removeUserContext"),"params":(Browser.RemoveUserContextParameters)}); + export type RemoveUserContext = { + method: 'browser.removeUserContext'; + params: Browser.RemoveUserContextParameters; + }; } export namespace Browser { -export type RemoveUserContextParameters = (({ -"userContext":(Browser.UserContext)})); + export type RemoveUserContextParameters = { + userContext: Browser.UserContext; + }; } export namespace Browser { -export type SetClientWindowState = ({ -"method":("browser.setClientWindowState"),"params":(Browser.SetClientWindowStateParameters)}); + export type SetClientWindowState = { + method: 'browser.setClientWindowState'; + params: Browser.SetClientWindowStateParameters; + }; } export namespace Browser { -export type SetClientWindowStateParameters = (({ -"clientWindow":(Browser.ClientWindow)}&(Browser.ClientWindowNamedState| Browser.ClientWindowRectState))); + export type SetClientWindowStateParameters = { + clientWindow: Browser.ClientWindow; + } & (Browser.ClientWindowNamedState | Browser.ClientWindowRectState); } export namespace Browser { -export type ClientWindowNamedState = ({ -"state":("fullscreen"| "maximized"| "minimized")}); + export type ClientWindowNamedState = { + state: 'fullscreen' | 'maximized' | 'minimized'; + }; } export namespace Browser { -export type ClientWindowRectState = ({ -"state":("normal"),"width"?:(JsUint),"height"?:(JsUint),"x"?:(JsInt),"y"?:(JsInt)}); + export type ClientWindowRectState = { + state: 'normal'; + width?: JsUint; + height?: JsUint; + x?: JsInt; + y?: JsInt; + }; } export type BrowsingContextCommand = | BrowsingContext.Activate @@ -333,14 +423,6 @@ export type BrowsingContextCommand = | BrowsingContext.Reload | BrowsingContext.SetViewport | BrowsingContext.TraverseHistory; -export type BrowsingContextResult = - | BrowsingContext.CaptureScreenshotResult - | BrowsingContext.CreateResult - | BrowsingContext.GetTreeResult - | BrowsingContext.LocateNodesResult - | BrowsingContext.NavigateResult - | BrowsingContext.PrintResult - | BrowsingContext.TraverseHistoryResult; export type BrowsingContextEvent = | BrowsingContext.ContextCreated | BrowsingContext.ContextDestroyed @@ -356,74 +438,128 @@ export type BrowsingContextEvent = | BrowsingContext.NavigationStarted | BrowsingContext.UserPromptClosed | BrowsingContext.UserPromptOpened; +export type BrowsingContextResult = + | BrowsingContext.CaptureScreenshotResult + | BrowsingContext.CreateResult + | BrowsingContext.GetTreeResult + | BrowsingContext.LocateNodesResult + | BrowsingContext.NavigateResult + | BrowsingContext.PrintResult + | BrowsingContext.TraverseHistoryResult; export namespace BrowsingContext { -export type BrowsingContext = (string); + export type BrowsingContext = string; } export namespace BrowsingContext { -export type InfoList = ([ -...((BrowsingContext.Info)[])]); + export type InfoList = [...BrowsingContext.Info[]]; } export namespace BrowsingContext { -export type Info = (({ -"children":(BrowsingContext.InfoList| null),"clientWindow":(Browser.ClientWindow),"context":(BrowsingContext.BrowsingContext),"originalOpener":(BrowsingContext.BrowsingContext| null),"url":(string),"userContext":(Browser.UserContext),"parent"?:(BrowsingContext.BrowsingContext| null)})); + export type Info = { + children: BrowsingContext.InfoList | null; + clientWindow: Browser.ClientWindow; + context: BrowsingContext.BrowsingContext; + originalOpener: BrowsingContext.BrowsingContext | null; + url: string; + userContext: Browser.UserContext; + parent?: BrowsingContext.BrowsingContext | null; + }; } export namespace BrowsingContext { -export type Locator = ((BrowsingContext.AccessibilityLocator| BrowsingContext.CssLocator| BrowsingContext.ContextLocator| BrowsingContext.InnerTextLocator| BrowsingContext.XPathLocator)); + export type Locator = + | BrowsingContext.AccessibilityLocator + | BrowsingContext.CssLocator + | BrowsingContext.ContextLocator + | BrowsingContext.InnerTextLocator + | BrowsingContext.XPathLocator; } export namespace BrowsingContext { -export type AccessibilityLocator = (({ -"type":("accessibility"),"value":(({ -"name"?:(string),"role"?:(string)}))})); + export type AccessibilityLocator = { + type: 'accessibility'; + value: { + name?: string; + role?: string; + }; + }; } export namespace BrowsingContext { -export type CssLocator = (({ -"type":("css"),"value":(string)})); + export type CssLocator = { + type: 'css'; + value: string; + }; } export namespace BrowsingContext { -export type ContextLocator = (({ -"type":("context"),"value":(({ -"context":(BrowsingContext.BrowsingContext)}))})); + export type ContextLocator = { + type: 'context'; + value: { + context: BrowsingContext.BrowsingContext; + }; + }; } export namespace BrowsingContext { -export type InnerTextLocator = (({ -"type":("innerText"),"value":(string),"ignoreCase"?:(boolean),"matchType"?:("full"| "partial"),"maxDepth"?:(JsUint)})); + export type InnerTextLocator = { + type: 'innerText'; + value: string; + ignoreCase?: boolean; + matchType?: 'full' | 'partial'; + maxDepth?: JsUint; + }; } export namespace BrowsingContext { -export type XPathLocator = (({ -"type":("xpath"),"value":(string)})); + export type XPathLocator = { + type: 'xpath'; + value: string; + }; } export namespace BrowsingContext { -export type Navigation = (string); + export type Navigation = string; } export namespace BrowsingContext { -export type BaseNavigationInfo = ({ -"context":(BrowsingContext.BrowsingContext),"navigation":(BrowsingContext.Navigation| null),"timestamp":(JsUint),"url":(string)}); + export type BaseNavigationInfo = { + context: BrowsingContext.BrowsingContext; + navigation: BrowsingContext.Navigation | null; + timestamp: JsUint; + url: string; + }; } export namespace BrowsingContext { -export type NavigationInfo = ((BrowsingContext.BaseNavigationInfo)); + export type NavigationInfo = BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export const enum ReadinessState {None = "none", -Interactive = "interactive", -Complete = "complete", -} + export const enum ReadinessState { + None = 'none', + Interactive = 'interactive', + Complete = 'complete', + } } export namespace BrowsingContext { -export const enum UserPromptType {Alert = "alert", -Beforeunload = "beforeunload", -Confirm = "confirm", -Prompt = "prompt", -} + export const enum UserPromptType { + Alert = 'alert', + Beforeunload = 'beforeunload', + Confirm = 'confirm', + Prompt = 'prompt', + } } export namespace BrowsingContext { -export type Activate = ({ -"method":("browsingContext.activate"),"params":(BrowsingContext.ActivateParameters)}); + export type Activate = { + method: 'browsingContext.activate'; + params: BrowsingContext.ActivateParameters; + }; } export namespace BrowsingContext { export type ActivateParameters = { context: BrowsingContext.BrowsingContext; }; } +export namespace BrowsingContext { + export type CaptureScreenshotParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `"viewport"` + */ + origin?: 'viewport' | 'document'; + format?: BrowsingContext.ImageFormat; + clip?: BrowsingContext.ClipRectangle; + }; +} export namespace BrowsingContext { export type CaptureScreenshot = { method: 'browsingContext.captureScreenshot'; @@ -431,84 +567,104 @@ export namespace BrowsingContext { }; } export namespace BrowsingContext { -export type CaptureScreenshotParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `"viewport"` - */ -"origin"?:(("viewport"| "document")),"format"?:(BrowsingContext.ImageFormat),"clip"?:(BrowsingContext.ClipRectangle)})); -} -export namespace BrowsingContext { -export type ImageFormat = (({ -"type":(string), -/** - * Must be between `0` and `1`, inclusive. - */ -"quality"?:(number)})); + export type ImageFormat = { + type: string; + /** + * Must be between `0` and `1`, inclusive. + */ + quality?: number; + }; } export namespace BrowsingContext { -export type ClipRectangle = ((BrowsingContext.BoxClipRectangle| BrowsingContext.ElementClipRectangle)); + export type ClipRectangle = + | BrowsingContext.BoxClipRectangle + | BrowsingContext.ElementClipRectangle; } export namespace BrowsingContext { -export type ElementClipRectangle = (({ -"type":("element"),"element":(Script.SharedReference)})); + export type ElementClipRectangle = { + type: 'element'; + element: Script.SharedReference; + }; } export namespace BrowsingContext { -export type BoxClipRectangle = (({ -"type":("box"),"x":(number),"y":(number),"width":(number),"height":(number)})); + export type BoxClipRectangle = { + type: 'box'; + x: number; + y: number; + width: number; + height: number; + }; } export namespace BrowsingContext { -export type CaptureScreenshotResult = (({ -"data":(string)})); + export type CaptureScreenshotResult = { + data: string; + }; } export namespace BrowsingContext { -export type Close = ({ -"method":("browsingContext.close"),"params":(BrowsingContext.CloseParameters)}); + export type Close = { + method: 'browsingContext.close'; + params: BrowsingContext.CloseParameters; + }; } export namespace BrowsingContext { -export type CloseParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"promptUnload"?:(boolean)})); + export type CloseParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + promptUnload?: boolean; + }; } export namespace BrowsingContext { -export type Create = ({ -"method":("browsingContext.create"),"params":(BrowsingContext.CreateParameters)}); + export type Create = { + method: 'browsingContext.create'; + params: BrowsingContext.CreateParameters; + }; } export namespace BrowsingContext { -export const enum CreateType {Tab = "tab", -Window = "window", -} + export const enum CreateType { + Tab = 'tab', + Window = 'window', + } } export namespace BrowsingContext { -export type CreateParameters = (({ -"type":(BrowsingContext.CreateType),"referenceContext"?:(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"background"?:(boolean),"userContext"?:(Browser.UserContext)})); + export type CreateParameters = { + type: BrowsingContext.CreateType; + referenceContext?: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + userContext?: Browser.UserContext; + }; } export namespace BrowsingContext { -export type CreateResult = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type CreateResult = { + context: BrowsingContext.BrowsingContext; + }; } export namespace BrowsingContext { -export type GetTree = ({ -"method":("browsingContext.getTree"),"params":(BrowsingContext.GetTreeParameters)}); + export type GetTree = { + method: 'browsingContext.getTree'; + params: BrowsingContext.GetTreeParameters; + }; } export namespace BrowsingContext { -export type GetTreeParameters = (({ -"maxDepth"?:(JsUint),"root"?:(BrowsingContext.BrowsingContext)})); + export type GetTreeParameters = { + maxDepth?: JsUint; + root?: BrowsingContext.BrowsingContext; + }; } export namespace BrowsingContext { -export type GetTreeResult = (({ -"contexts":(BrowsingContext.InfoList)})); + export type GetTreeResult = { + contexts: BrowsingContext.InfoList; + }; } export namespace BrowsingContext { -export type HandleUserPrompt = ({ -"method":("browsingContext.handleUserPrompt"),"params":(BrowsingContext.HandleUserPromptParameters)}); + export type HandleUserPrompt = { + method: 'browsingContext.handleUserPrompt'; + params: BrowsingContext.HandleUserPromptParameters; + }; } export namespace BrowsingContext { export type HandleUserPromptParameters = { @@ -517,6 +673,18 @@ export namespace BrowsingContext { userText?: string; }; } +export namespace BrowsingContext { + export type LocateNodesParameters = { + context: BrowsingContext.BrowsingContext; + locator: BrowsingContext.Locator; + /** + * Must be greater than or equal to `1`. + */ + maxNodeCount?: JsUint; + serializationOptions?: Script.SerializationOptions; + startNodes?: [Script.SharedReference, ...Script.SharedReference[]]; + }; +} export namespace BrowsingContext { export type LocateNodes = { method: 'browsingContext.locateNodes'; @@ -524,349 +692,468 @@ export namespace BrowsingContext { }; } export namespace BrowsingContext { -export type LocateNodesParameters = (({ -"context":(BrowsingContext.BrowsingContext),"locator":(BrowsingContext.Locator), -/** - * Must be greater than or equal to `1`. - */ -"maxNodeCount"?:((JsUint)),"serializationOptions"?:(Script.SerializationOptions),"startNodes"?:([ -(Script.SharedReference),...(Script.SharedReference)[]])})); -} -export namespace BrowsingContext { -export type LocateNodesResult = (({ -"nodes":([ -...((Script.NodeRemoteValue)[])])})); + export type LocateNodesResult = { + nodes: [...Script.NodeRemoteValue[]]; + }; } export namespace BrowsingContext { -export type Navigate = ({ -"method":("browsingContext.navigate"),"params":(BrowsingContext.NavigateParameters)}); + export type Navigate = { + method: 'browsingContext.navigate'; + params: BrowsingContext.NavigateParameters; + }; } export namespace BrowsingContext { -export type NavigateParameters = (({ -"context":(BrowsingContext.BrowsingContext),"url":(string),"wait"?:(BrowsingContext.ReadinessState)})); + export type NavigateParameters = { + context: BrowsingContext.BrowsingContext; + url: string; + wait?: BrowsingContext.ReadinessState; + }; } export namespace BrowsingContext { -export type NavigateResult = (({ -"navigation":(BrowsingContext.Navigation| null),"url":(string)})); + export type NavigateResult = { + navigation: BrowsingContext.Navigation | null; + url: string; + }; } export namespace BrowsingContext { -export type Print = ({ -"method":("browsingContext.print"),"params":(BrowsingContext.PrintParameters)}); + export type Print = { + method: 'browsingContext.print'; + params: BrowsingContext.PrintParameters; + }; } export namespace BrowsingContext { -export type PrintParameters = (({ -"context":(BrowsingContext.BrowsingContext), -/** - * @defaultValue `false` - */ -"background"?:(boolean),"margin"?:(BrowsingContext.PrintMarginParameters), -/** - * @defaultValue `"portrait"` - */ -"orientation"?:(("portrait"| "landscape")),"page"?:(BrowsingContext.PrintPageParameters),"pageRanges"?:([ -...((JsUint| string)[])]), -/** - * Must be between `0.1` and `2`, inclusive. - * - * @defaultValue `1` - */ -"scale"?:((number)), -/** - * @defaultValue `true` - */ -"shrinkToFit"?:(boolean)})); + export type PrintParameters = { + context: BrowsingContext.BrowsingContext; + /** + * @defaultValue `false` + */ + background?: boolean; + margin?: BrowsingContext.PrintMarginParameters; + /** + * @defaultValue `"portrait"` + */ + orientation?: 'portrait' | 'landscape'; + page?: BrowsingContext.PrintPageParameters; + pageRanges?: [...(JsUint | string)[]]; + /** + * Must be between `0.1` and `2`, inclusive. + * + * @defaultValue `1` + */ + scale?: number; + /** + * @defaultValue `true` + */ + shrinkToFit?: boolean; + }; } export namespace BrowsingContext { -export type PrintMarginParameters = (({ - -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"bottom"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"left"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"right"?:((number)), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"top"?:((number))})); + export type PrintMarginParameters = { + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + bottom?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + left?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + right?: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + top?: number; + }; } export namespace BrowsingContext { -export type PrintPageParameters = (({ - -/** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `27.94` - */ -"height"?:((number)), -/** - * Must be greater than or equal to `0.0352`. - * - * @defaultValue `21.59` - */ -"width"?:((number))})); + export type PrintPageParameters = { + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `27.94` + */ + height?: number; + /** + * Must be greater than or equal to `0.0352`. + * + * @defaultValue `21.59` + */ + width?: number; + }; } export namespace BrowsingContext { -export type PrintResult = (({ -"data":(string)})); + export type PrintResult = { + data: string; + }; } export namespace BrowsingContext { -export type Reload = ({ -"method":("browsingContext.reload"),"params":(BrowsingContext.ReloadParameters)}); + export type Reload = { + method: 'browsingContext.reload'; + params: BrowsingContext.ReloadParameters; + }; } export namespace BrowsingContext { -export type ReloadParameters = (({ -"context":(BrowsingContext.BrowsingContext),"ignoreCache"?:(boolean),"wait"?:(BrowsingContext.ReadinessState)})); + export type ReloadParameters = { + context: BrowsingContext.BrowsingContext; + ignoreCache?: boolean; + wait?: BrowsingContext.ReadinessState; + }; } export namespace BrowsingContext { -export type SetViewport = ({ -"method":("browsingContext.setViewport"),"params":(BrowsingContext.SetViewportParameters)}); + export type SetViewport = { + method: 'browsingContext.setViewport'; + params: BrowsingContext.SetViewportParameters; + }; } export namespace BrowsingContext { -export type SetViewportParameters = (({ -"context"?:(BrowsingContext.BrowsingContext),"viewport"?:(BrowsingContext.Viewport| null), -/** - * Must be greater than `0`. - */ -"devicePixelRatio"?:((number)| null),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetViewportParameters = { + context?: BrowsingContext.BrowsingContext; + viewport?: BrowsingContext.Viewport | null; + /** + * Must be greater than `0`. + */ + devicePixelRatio?: number | null; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace BrowsingContext { -export type Viewport = (({ -"width":(JsUint),"height":(JsUint)})); + export type Viewport = { + width: JsUint; + height: JsUint; + }; } export namespace BrowsingContext { -export type TraverseHistory = ({ -"method":("browsingContext.traverseHistory"),"params":(BrowsingContext.TraverseHistoryParameters)}); + export type TraverseHistory = { + method: 'browsingContext.traverseHistory'; + params: BrowsingContext.TraverseHistoryParameters; + }; } export namespace BrowsingContext { -export type TraverseHistoryParameters = (({ -"context":(BrowsingContext.BrowsingContext),"delta":(JsInt)})); + export type TraverseHistoryParameters = { + context: BrowsingContext.BrowsingContext; + delta: JsInt; + }; } export namespace BrowsingContext { -export type TraverseHistoryResult = ((Record -)); + export type TraverseHistoryResult = Record; } export namespace BrowsingContext { -export type ContextCreated = ({ -"method":("browsingContext.contextCreated"),"params":(BrowsingContext.Info)}); + export type ContextCreated = { + method: 'browsingContext.contextCreated'; + params: BrowsingContext.Info; + }; } export namespace BrowsingContext { -export type ContextDestroyed = ({ -"method":("browsingContext.contextDestroyed"),"params":(BrowsingContext.Info)}); + export type ContextDestroyed = { + method: 'browsingContext.contextDestroyed'; + params: BrowsingContext.Info; + }; } export namespace BrowsingContext { -export type NavigationStarted = ({ -"method":("browsingContext.navigationStarted"),"params":(BrowsingContext.NavigationInfo)}); + export type NavigationStarted = { + method: 'browsingContext.navigationStarted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type FragmentNavigated = ({ -"method":("browsingContext.fragmentNavigated"),"params":(BrowsingContext.NavigationInfo)}); + export type FragmentNavigated = { + method: 'browsingContext.fragmentNavigated'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type HistoryUpdated = ({ -"method":("browsingContext.historyUpdated"),"params":(BrowsingContext.HistoryUpdatedParameters)}); + export type HistoryUpdated = { + method: 'browsingContext.historyUpdated'; + params: BrowsingContext.HistoryUpdatedParameters; + }; } export namespace BrowsingContext { -export type HistoryUpdatedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"timestamp":(JsUint),"url":(string)})); + export type HistoryUpdatedParameters = { + context: BrowsingContext.BrowsingContext; + timestamp: JsUint; + url: string; + }; } export namespace BrowsingContext { -export type DomContentLoaded = ({ -"method":("browsingContext.domContentLoaded"),"params":(BrowsingContext.NavigationInfo)}); + export type DomContentLoaded = { + method: 'browsingContext.domContentLoaded'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type Load = ({ -"method":("browsingContext.load"),"params":(BrowsingContext.NavigationInfo)}); + export type Load = { + method: 'browsingContext.load'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type DownloadWillBegin = ({ -"method":("browsingContext.downloadWillBegin"),"params":(BrowsingContext.DownloadWillBeginParams)}); + export type DownloadWillBegin = { + method: 'browsingContext.downloadWillBegin'; + params: BrowsingContext.DownloadWillBeginParams; + }; } export namespace BrowsingContext { -export type DownloadWillBeginParams = (({ -"suggestedFilename":(string)}&BrowsingContext.BaseNavigationInfo)); + export type DownloadWillBeginParams = { + suggestedFilename: string; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type DownloadEnd = ({ -"method":("browsingContext.downloadEnd"),"params":(BrowsingContext.DownloadEndParams)}); + export type DownloadEnd = { + method: 'browsingContext.downloadEnd'; + params: BrowsingContext.DownloadEndParams; + }; } export namespace BrowsingContext { -export type DownloadEndParams = (((BrowsingContext.DownloadCanceledParams| BrowsingContext.DownloadCompleteParams))); + export type DownloadEndParams = + | BrowsingContext.DownloadCanceledParams + | BrowsingContext.DownloadCompleteParams; } export namespace BrowsingContext { -export type DownloadCanceledParams = ({ -"status":("canceled")}&BrowsingContext.BaseNavigationInfo); + export type DownloadCanceledParams = { + status: 'canceled'; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type DownloadCompleteParams = ({ -"status":("complete"),"filepath":(string| null)}&BrowsingContext.BaseNavigationInfo); + export type DownloadCompleteParams = { + status: 'complete'; + filepath: string | null; + } & BrowsingContext.BaseNavigationInfo; } export namespace BrowsingContext { -export type NavigationAborted = ({ -"method":("browsingContext.navigationAborted"),"params":(BrowsingContext.NavigationInfo)}); + export type NavigationAborted = { + method: 'browsingContext.navigationAborted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type NavigationCommitted = ({ -"method":("browsingContext.navigationCommitted"),"params":(BrowsingContext.NavigationInfo)}); + export type NavigationCommitted = { + method: 'browsingContext.navigationCommitted'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type NavigationFailed = ({ -"method":("browsingContext.navigationFailed"),"params":(BrowsingContext.NavigationInfo)}); + export type NavigationFailed = { + method: 'browsingContext.navigationFailed'; + params: BrowsingContext.NavigationInfo; + }; } export namespace BrowsingContext { -export type UserPromptClosed = ({ -"method":("browsingContext.userPromptClosed"),"params":(BrowsingContext.UserPromptClosedParameters)}); + export type UserPromptClosed = { + method: 'browsingContext.userPromptClosed'; + params: BrowsingContext.UserPromptClosedParameters; + }; } export namespace BrowsingContext { -export type UserPromptClosedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"accepted":(boolean),"type":(BrowsingContext.UserPromptType),"userText"?:(string)})); + export type UserPromptClosedParameters = { + context: BrowsingContext.BrowsingContext; + accepted: boolean; + type: BrowsingContext.UserPromptType; + userText?: string; + }; } export namespace BrowsingContext { -export type UserPromptOpened = ({ -"method":("browsingContext.userPromptOpened"),"params":(BrowsingContext.UserPromptOpenedParameters)}); + export type UserPromptOpened = { + method: 'browsingContext.userPromptOpened'; + params: BrowsingContext.UserPromptOpenedParameters; + }; } export namespace BrowsingContext { -export type UserPromptOpenedParameters = (({ -"context":(BrowsingContext.BrowsingContext),"handler":(Session.UserPromptHandlerType),"message":(string),"type":(BrowsingContext.UserPromptType),"defaultValue"?:(string)})); + export type UserPromptOpenedParameters = { + context: BrowsingContext.BrowsingContext; + handler: Session.UserPromptHandlerType; + message: string; + type: BrowsingContext.UserPromptType; + defaultValue?: string; + }; } -export type EmulationCommand = (Emulation.SetForcedColorsModeThemeOverride| Emulation.SetGeolocationOverride| Emulation.SetLocaleOverride| Emulation.SetScreenOrientationOverride| Emulation.SetScriptingEnabled| Emulation.SetTimezoneOverride); +export type EmulationCommand = + | Emulation.SetForcedColorsModeThemeOverride + | Emulation.SetGeolocationOverride + | Emulation.SetLocaleOverride + | Emulation.SetScreenOrientationOverride + | Emulation.SetScriptingEnabled + | Emulation.SetTimezoneOverride; export namespace Emulation { -export type SetForcedColorsModeThemeOverride = ({ -"method":("emulation.setForcedColorsModeThemeOverride"),"params":(Emulation.SetForcedColorsModeThemeOverrideParameters)}); + export type SetForcedColorsModeThemeOverride = { + method: 'emulation.setForcedColorsModeThemeOverride'; + params: Emulation.SetForcedColorsModeThemeOverrideParameters; + }; } export namespace Emulation { -export type SetForcedColorsModeThemeOverrideParameters = (({ -"theme":(Emulation.ForcedColorsModeTheme| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetForcedColorsModeThemeOverrideParameters = { + theme: Emulation.ForcedColorsModeTheme | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export const enum ForcedColorsModeTheme {Light = "light", -Dark = "dark", -} + export const enum ForcedColorsModeTheme { + Light = 'light', + Dark = 'dark', + } } export namespace Emulation { -export type SetGeolocationOverride = ({ -"method":("emulation.setGeolocationOverride"),"params":(Emulation.SetGeolocationOverrideParameters)}); + export type SetGeolocationOverride = { + method: 'emulation.setGeolocationOverride'; + params: Emulation.SetGeolocationOverrideParameters; + }; } export namespace Emulation { -export type SetGeolocationOverrideParameters = (((({ -"coordinates":(Emulation.GeolocationCoordinates| null)})| ({ -"error":(Emulation.GeolocationPositionError)}))&{ -"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetGeolocationOverrideParameters = ( + | { + coordinates: Emulation.GeolocationCoordinates | null; + } + | { + error: Emulation.GeolocationPositionError; + } + ) & { + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type GeolocationCoordinates = (({ - -/** - * Must be between `-90` and `90`, inclusive. - */ -"latitude":(number), -/** - * Must be between `-180` and `180`, inclusive. - */ -"longitude":(number), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `1` - */ -"accuracy"?:((number)), -/** - * @defaultValue `null` - */ -"altitude"?:(number| null), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ -"altitudeAccuracy"?:((number)| null), -/** - * Must be between `0` and `360`. - * - * @defaultValue `null` - */ -"heading"?:((number)| null), -/** - * Must be greater than or equal to `0`. - * - * @defaultValue `null` - */ -"speed"?:((number)| null)})); + export type GeolocationCoordinates = { + /** + * Must be between `-90` and `90`, inclusive. + */ + latitude: number; + /** + * Must be between `-180` and `180`, inclusive. + */ + longitude: number; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `1` + */ + accuracy?: number; + /** + * @defaultValue `null` + */ + altitude?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + altitudeAccuracy?: number | null; + /** + * Must be between `0` and `360`. + * + * @defaultValue `null` + */ + heading?: number | null; + /** + * Must be greater than or equal to `0`. + * + * @defaultValue `null` + */ + speed?: number | null; + }; } export namespace Emulation { -export type GeolocationPositionError = (({ -"type":("positionUnavailable")})); + export type GeolocationPositionError = { + type: 'positionUnavailable'; + }; } export namespace Emulation { -export type SetLocaleOverride = ({ -"method":("emulation.setLocaleOverride"),"params":(Emulation.SetLocaleOverrideParameters)}); + export type SetLocaleOverride = { + method: 'emulation.setLocaleOverride'; + params: Emulation.SetLocaleOverrideParameters; + }; } export namespace Emulation { -export type SetLocaleOverrideParameters = (({ -"locale":(string| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetLocaleOverrideParameters = { + locale: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetScreenOrientationOverride = ({ -"method":("emulation.setScreenOrientationOverride"),"params":(Emulation.SetScreenOrientationOverrideParameters)}); + export type SetScreenOrientationOverride = { + method: 'emulation.setScreenOrientationOverride'; + params: Emulation.SetScreenOrientationOverrideParameters; + }; } export namespace Emulation { -export const enum ScreenOrientationNatural {Portrait = "portrait", -Landscape = "landscape", -} + export const enum ScreenOrientationNatural { + Portrait = 'portrait', + Landscape = 'landscape', + } } export namespace Emulation { -export type ScreenOrientationType = ("portrait-primary"| "portrait-secondary"| "landscape-primary"| "landscape-secondary"); + export type ScreenOrientationType = + | 'portrait-primary' + | 'portrait-secondary' + | 'landscape-primary' + | 'landscape-secondary'; } export namespace Emulation { -export type ScreenOrientation = (({ -"natural":(Emulation.ScreenOrientationNatural),"type":(Emulation.ScreenOrientationType)})); + export type ScreenOrientation = { + natural: Emulation.ScreenOrientationNatural; + type: Emulation.ScreenOrientationType; + }; } export namespace Emulation { -export type SetScreenOrientationOverrideParameters = (({ -"screenOrientation":(Emulation.ScreenOrientation| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetScreenOrientationOverrideParameters = { + screenOrientation: Emulation.ScreenOrientation | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetScriptingEnabled = ({ -"method":("emulation.setScriptingEnabled"),"params":(Emulation.SetScriptingEnabledParameters)}); + export type SetScriptingEnabled = { + method: 'emulation.setScriptingEnabled'; + params: Emulation.SetScriptingEnabledParameters; + }; } export namespace Emulation { -export type SetScriptingEnabledParameters = (({ -"enabled":(false| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetScriptingEnabledParameters = { + enabled: false | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Emulation { -export type SetTimezoneOverride = ({ -"method":("emulation.setTimezoneOverride"),"params":(Emulation.SetTimezoneOverrideParameters)}); + export type SetTimezoneOverride = { + method: 'emulation.setTimezoneOverride'; + params: Emulation.SetTimezoneOverrideParameters; + }; } export namespace Emulation { -export type SetTimezoneOverrideParameters = (({ -"timezone":(string| null),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetTimezoneOverrideParameters = { + timezone: string | null; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export type NetworkCommand = | Network.AddDataCollector @@ -882,135 +1169,221 @@ export type NetworkCommand = | Network.RemoveIntercept | Network.SetCacheBehavior | Network.SetExtraHeaders; -export type NetworkResult = Network.AddInterceptResult; export type NetworkEvent = | Network.AuthRequired | Network.BeforeRequestSent | Network.FetchError | Network.ResponseCompleted | Network.ResponseStarted; +export type NetworkResult = Network.AddInterceptResult; export namespace Network { -export type AuthChallenge = (({ -"scheme":(string),"realm":(string)})); -} -export namespace Network { -export type AuthCredentials = (({ -"type":("password"),"username":(string),"password":(string)})); -} -export namespace Network { -export type BaseParameters = ({ -"context":(BrowsingContext.BrowsingContext| null),"isBlocked":(boolean),"navigation":(BrowsingContext.Navigation| null),"redirectCount":(JsUint),"request":(Network.RequestData),"timestamp":(JsUint),"intercepts"?:([ -(Network.Intercept),...(Network.Intercept)[]])}); + export type AuthChallenge = { + scheme: string; + realm: string; + }; } export namespace Network { -export type BytesValue = (Network.StringValue| Network.Base64Value); + export type AuthCredentials = { + type: 'password'; + username: string; + password: string; + }; } export namespace Network { -export type StringValue = (({ -"type":("string"),"value":(string)})); + export type BaseParameters = { + context: BrowsingContext.BrowsingContext | null; + isBlocked: boolean; + navigation: BrowsingContext.Navigation | null; + redirectCount: JsUint; + request: Network.RequestData; + timestamp: JsUint; + intercepts?: [Network.Intercept, ...Network.Intercept[]]; + }; } export namespace Network { -export type Base64Value = (({ -"type":("base64"),"value":(string)})); + export type BytesValue = Network.StringValue | Network.Base64Value; } export namespace Network { -export type Collector = (string); + export type StringValue = { + type: 'string'; + value: string; + }; } export namespace Network { -export const enum CollectorType {Blob = "blob", -} + export type Base64Value = { + type: 'base64'; + value: string; + }; } export namespace Network { -export const enum SameSite {Strict = "strict", -Lax = "lax", -None = "none", -Default = "default", -} + export type Collector = string; } export namespace Network { -export type Cookie = (({ -"name":(string),"value":(Network.BytesValue),"domain":(string),"path":(string),"size":(JsUint),"httpOnly":(boolean),"secure":(boolean),"sameSite":(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); + export const enum CollectorType { + Blob = 'blob', + } } export namespace Network { -export type CookieHeader = (({ -"name":(string),"value":(Network.BytesValue)})); + export const enum SameSite { + Strict = 'strict', + Lax = 'lax', + None = 'none', + Default = 'default', + } } export namespace Network { -export const enum DataType {Response = "response", -} + export type Cookie = { + name: string; + value: Network.BytesValue; + domain: string; + path: string; + size: JsUint; + httpOnly: boolean; + secure: boolean; + sameSite: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export namespace Network { -export type FetchTimingInfo = (({ -"timeOrigin":(number),"requestTime":(number),"redirectStart":(number),"redirectEnd":(number),"fetchStart":(number),"dnsStart":(number),"dnsEnd":(number),"connectStart":(number),"connectEnd":(number),"tlsStart":(number),"requestStart":(number),"responseStart":(number),"responseEnd":(number)})); + export type CookieHeader = { + name: string; + value: Network.BytesValue; + }; } export namespace Network { -export type Header = (({ -"name":(string),"value":(Network.BytesValue)})); + export const enum DataType { + Response = 'response', + } +} +export namespace Network { + export type FetchTimingInfo = { + timeOrigin: number; + requestTime: number; + redirectStart: number; + redirectEnd: number; + fetchStart: number; + dnsStart: number; + dnsEnd: number; + connectStart: number; + connectEnd: number; + tlsStart: number; + requestStart: number; + responseStart: number; + responseEnd: number; + }; } export namespace Network { -export type Initiator = (({ -"columnNumber"?:(JsUint),"lineNumber"?:(JsUint),"request"?:(Network.Request),"stackTrace"?:(Script.StackTrace),"type"?:("parser"| "script"| "preflight"| "other")})); + export type Header = { + name: string; + value: Network.BytesValue; + }; } export namespace Network { -export type Intercept = (string); + export type Initiator = { + columnNumber?: JsUint; + lineNumber?: JsUint; + request?: Network.Request; + stackTrace?: Script.StackTrace; + type?: 'parser' | 'script' | 'preflight' | 'other'; + }; } export namespace Network { -export type Request = (string); + export type Intercept = string; } export namespace Network { -export type RequestData = (({ -"request":(Network.Request),"url":(string),"method":(string),"headers":([ -...((Network.Header)[])]),"cookies":([ -...((Network.Cookie)[])]),"headersSize":(JsUint),"bodySize":(JsUint| null),"destination":(string),"initiatorType":(string| null),"timings":(Network.FetchTimingInfo)})); + export type Request = string; } export namespace Network { -export type ResponseContent = (({ -"size":(JsUint)})); + export type RequestData = { + request: Network.Request; + url: string; + method: string; + headers: [...Network.Header[]]; + cookies: [...Network.Cookie[]]; + headersSize: JsUint; + bodySize: JsUint | null; + destination: string; + initiatorType: string | null; + timings: Network.FetchTimingInfo; + }; } export namespace Network { -export type ResponseData = (({ -"url":(string),"protocol":(string),"status":(JsUint),"statusText":(string),"fromCache":(boolean),"headers":([ -...((Network.Header)[])]),"mimeType":(string),"bytesReceived":(JsUint),"headersSize":(JsUint| null),"bodySize":(JsUint| null),"content":(Network.ResponseContent),"authChallenges"?:([ -...((Network.AuthChallenge)[])])})); + export type ResponseContent = { + size: JsUint; + }; } export namespace Network { -export type SetCookieHeader = (({ -"name":(string),"value":(Network.BytesValue),"domain"?:(string),"httpOnly"?:(boolean),"expiry"?:(string),"maxAge"?:(JsInt),"path"?:(string),"sameSite"?:(Network.SameSite),"secure"?:(boolean)})); + export type ResponseData = { + url: string; + protocol: string; + status: JsUint; + statusText: string; + fromCache: boolean; + headers: [...Network.Header[]]; + mimeType: string; + bytesReceived: JsUint; + headersSize: JsUint | null; + bodySize: JsUint | null; + content: Network.ResponseContent; + authChallenges?: [...Network.AuthChallenge[]]; + }; } export namespace Network { -export type UrlPattern = ((Network.UrlPatternPattern| Network.UrlPatternString)); + export type SetCookieHeader = { + name: string; + value: Network.BytesValue; + domain?: string; + httpOnly?: boolean; + expiry?: string; + maxAge?: JsInt; + path?: string; + sameSite?: Network.SameSite; + secure?: boolean; + }; } export namespace Network { -export type UrlPatternPattern = (({ -"type":("pattern"),"protocol"?:(string),"hostname"?:(string),"port"?:(string),"pathname"?:(string),"search"?:(string)})); + export type UrlPattern = Network.UrlPatternPattern | Network.UrlPatternString; } export namespace Network { -export type UrlPatternString = (({ -"type":("string"),"pattern":(string)})); + export type UrlPatternPattern = { + type: 'pattern'; + protocol?: string; + hostname?: string; + port?: string; + pathname?: string; + search?: string; + }; } export namespace Network { -export type AddDataCollector = ({ -"method":("network.addDataCollector"),"params":(Network.AddDataCollectorParameters)}); + export type UrlPatternString = { + type: 'string'; + pattern: string; + }; } export namespace Network { -export type AddDataCollectorParameters = (({ -"dataTypes":([ -(Network.DataType),...(Network.DataType)[]]),"maxEncodedDataSize":(JsUint), -/** - * @defaultValue `"blob"` - */ -"collectorType"?:(Network.CollectorType),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type AddDataCollector = { + method: 'network.addDataCollector'; + params: Network.AddDataCollectorParameters; + }; } export namespace Network { -export type AddDataCollectorResult = (({ -"collector":(Network.Collector)})); + export type AddDataCollectorParameters = { + dataTypes: [Network.DataType, ...Network.DataType[]]; + maxEncodedDataSize: JsUint; + /** + * @defaultValue `"blob"` + */ + collectorType?: Network.CollectorType; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } export namespace Network { - export type AddIntercept = { - method: 'network.addIntercept'; - params: Network.AddInterceptParameters; + export type AddDataCollectorResult = { + collector: Network.Collector; }; } export namespace Network { @@ -1024,143 +1397,202 @@ export namespace Network { }; } export namespace Network { -export const enum InterceptPhase {BeforeRequestSent = "beforeRequestSent", -ResponseStarted = "responseStarted", -AuthRequired = "authRequired", -} -} -export namespace Network { -export type AddInterceptResult = (({ -"intercept":(Network.Intercept)})); + export type AddIntercept = { + method: 'network.addIntercept'; + params: Network.AddInterceptParameters; + }; } export namespace Network { -export type ContinueRequest = ({ -"method":("network.continueRequest"),"params":(Network.ContinueRequestParameters)}); + export const enum InterceptPhase { + BeforeRequestSent = 'beforeRequestSent', + ResponseStarted = 'responseStarted', + AuthRequired = 'authRequired', + } } export namespace Network { -export type ContinueRequestParameters = (({ -"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ -...((Network.CookieHeader)[])]),"headers"?:([ -...((Network.Header)[])]),"method"?:(string),"url"?:(string)})); + export type AddInterceptResult = { + intercept: Network.Intercept; + }; } export namespace Network { -export type ContinueResponse = ({ -"method":("network.continueResponse"),"params":(Network.ContinueResponseParameters)}); + export type ContinueRequest = { + method: 'network.continueRequest'; + params: Network.ContinueRequestParameters; + }; } export namespace Network { -export type ContinueResponseParameters = (({ -"request":(Network.Request),"cookies"?:([ -...((Network.SetCookieHeader)[])]),"credentials"?:(Network.AuthCredentials),"headers"?:([ -...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); + export type ContinueRequestParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.CookieHeader[]]; + headers?: [...Network.Header[]]; + method?: string; + url?: string; + }; } export namespace Network { -export type ContinueWithAuth = ({ -"method":("network.continueWithAuth"),"params":(Network.ContinueWithAuthParameters)}); + export type ContinueResponse = { + method: 'network.continueResponse'; + params: Network.ContinueResponseParameters; + }; } export namespace Network { -export type ContinueWithAuthParameters = (({ -"request":(Network.Request)}&(Network.ContinueWithAuthCredentials| Network.ContinueWithAuthNoCredentials))); + export type ContinueResponseParameters = { + request: Network.Request; + cookies?: [...Network.SetCookieHeader[]]; + credentials?: Network.AuthCredentials; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export namespace Network { -export type ContinueWithAuthCredentials = ({ -"action":("provideCredentials"),"credentials":(Network.AuthCredentials)}); + export type ContinueWithAuth = { + method: 'network.continueWithAuth'; + params: Network.ContinueWithAuthParameters; + }; } export namespace Network { -export type ContinueWithAuthNoCredentials = ({ -"action":("default"| "cancel")}); + export type ContinueWithAuthParameters = { + request: Network.Request; + } & ( + | Network.ContinueWithAuthCredentials + | Network.ContinueWithAuthNoCredentials + ); } export namespace Network { -export type DisownData = ({ -"method":("network.disownData"),"params":(Network.DisownDataParameters)}); + export type ContinueWithAuthCredentials = { + action: 'provideCredentials'; + credentials: Network.AuthCredentials; + }; } export namespace Network { -export type DisownDataParameters = (({ -"dataType":(Network.DataType),"collector":(Network.Collector),"request":(Network.Request)})); + export type ContinueWithAuthNoCredentials = { + action: 'default' | 'cancel'; + }; } export namespace Network { -export type FailRequest = ({ -"method":("network.failRequest"),"params":(Network.FailRequestParameters)}); + export type DisownData = { + method: 'network.disownData'; + params: Network.DisownDataParameters; + }; } export namespace Network { -export type FailRequestParameters = (({ -"request":(Network.Request)})); + export type DisownDataParameters = { + dataType: Network.DataType; + collector: Network.Collector; + request: Network.Request; + }; } export namespace Network { -export type GetData = ({ -"method":("network.getData"),"params":(Network.GetDataParameters)}); + export type FailRequest = { + method: 'network.failRequest'; + params: Network.FailRequestParameters; + }; } export namespace Network { -export type GetDataParameters = (({ -"dataType":(Network.DataType),"collector"?:(Network.Collector), -/** - * @defaultValue `false` - */ -"disown"?:(boolean),"request":(Network.Request)})); + export type FailRequestParameters = { + request: Network.Request; + }; } export namespace Network { -export type GetDataResult = (({ -"bytes":(Network.BytesValue)})); + export type GetData = { + method: 'network.getData'; + params: Network.GetDataParameters; + }; } export namespace Network { -export type ProvideResponse = ({ -"method":("network.provideResponse"),"params":(Network.ProvideResponseParameters)}); + export type GetDataParameters = { + dataType: Network.DataType; + collector?: Network.Collector; + /** + * @defaultValue `false` + */ + disown?: boolean; + request: Network.Request; + }; } export namespace Network { -export type ProvideResponseParameters = (({ -"request":(Network.Request),"body"?:(Network.BytesValue),"cookies"?:([ -...((Network.SetCookieHeader)[])]),"headers"?:([ -...((Network.Header)[])]),"reasonPhrase"?:(string),"statusCode"?:(JsUint)})); + export type GetDataResult = { + bytes: Network.BytesValue; + }; } export namespace Network { -export type RemoveDataCollector = ({ -"method":("network.removeDataCollector"),"params":(Network.RemoveDataCollectorParameters)}); + export type ProvideResponse = { + method: 'network.provideResponse'; + params: Network.ProvideResponseParameters; + }; } export namespace Network { -export type RemoveDataCollectorParameters = (({ -"collector":(Network.Collector)})); + export type ProvideResponseParameters = { + request: Network.Request; + body?: Network.BytesValue; + cookies?: [...Network.SetCookieHeader[]]; + headers?: [...Network.Header[]]; + reasonPhrase?: string; + statusCode?: JsUint; + }; } export namespace Network { -export type RemoveIntercept = ({ -"method":("network.removeIntercept"),"params":(Network.RemoveInterceptParameters)}); + export type RemoveDataCollector = { + method: 'network.removeDataCollector'; + params: Network.RemoveDataCollectorParameters; + }; } export namespace Network { -export type RemoveInterceptParameters = (({ -"intercept":(Network.Intercept)})); + export type RemoveDataCollectorParameters = { + collector: Network.Collector; + }; } export namespace Network { -export type SetCacheBehavior = ({ -"method":("network.setCacheBehavior"),"params":(Network.SetCacheBehaviorParameters)}); + export type RemoveIntercept = { + method: 'network.removeIntercept'; + params: Network.RemoveInterceptParameters; + }; } export namespace Network { -export type SetCacheBehaviorParameters = (({ -"cacheBehavior":("default"| "bypass"),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]])})); + export type RemoveInterceptParameters = { + intercept: Network.Intercept; + }; } export namespace Network { -export type SetExtraHeaders = ({ -"method":("network.setExtraHeaders"),"params":(Network.SetExtraHeadersParameters)}); + export type SetCacheBehavior = { + method: 'network.setCacheBehavior'; + params: Network.SetCacheBehaviorParameters; + }; } export namespace Network { -export type SetExtraHeadersParameters = (({ -"headers":([ -...((Network.Header)[])]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]])})); + export type SetCacheBehaviorParameters = { + cacheBehavior: 'default' | 'bypass'; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + }; } export namespace Network { - export type AuthRequired = { - method: 'network.authRequired'; - params: Network.AuthRequiredParameters; + export type SetExtraHeaders = { + method: 'network.setExtraHeaders'; + params: Network.SetExtraHeadersParameters; }; } export namespace Network { -export type AuthRequiredParameters = ((Network.BaseParameters&{ -"response":(Network.ResponseData)})); + export type SetExtraHeadersParameters = { + headers: [...Network.Header[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + }; } +export type ScriptEvent = + | Script.Message + | Script.RealmCreated + | Script.RealmDestroyed; export namespace Network { - export type BeforeRequestSent = { - method: 'network.beforeRequestSent'; - params: Network.BeforeRequestSentParameters; + export type AuthRequiredParameters = Network.BaseParameters & { + response: Network.ResponseData; }; } export namespace Network { @@ -1168,34 +1600,16 @@ export namespace Network { initiator?: Network.Initiator; }; } -export namespace Network { - export type FetchError = { - method: 'network.fetchError'; - params: Network.FetchErrorParameters; - }; -} export namespace Network { export type FetchErrorParameters = Network.BaseParameters & { errorText: string; }; } -export namespace Network { - export type ResponseCompleted = { - method: 'network.responseCompleted'; - params: Network.ResponseCompletedParameters; - }; -} export namespace Network { export type ResponseCompletedParameters = Network.BaseParameters & { response: Network.ResponseData; }; } -export namespace Network { - export type ResponseStarted = { - method: 'network.responseStarted'; - params: Network.ResponseStartedParameters; - }; -} export namespace Network { export type ResponseStartedParameters = Network.BaseParameters & { response: Network.ResponseData; @@ -1212,23 +1626,38 @@ export type ScriptResult = | Script.AddPreloadScriptResult | Script.EvaluateResult | Script.GetRealmsResult; -export type ScriptEvent = - | Script.Message - | Script.RealmCreated - | Script.RealmDestroyed; -export namespace Script { -export type Channel = (string); +export namespace Network { + export type AuthRequired = { + method: 'network.authRequired'; + params: Network.AuthRequiredParameters; + }; } -export namespace Script { -export type ChannelValue = (({ -"type":("channel"),"value":(Script.ChannelProperties)})); +export namespace Network { + export type BeforeRequestSent = { + method: 'network.beforeRequestSent'; + params: Network.BeforeRequestSentParameters; + }; } -export namespace Script { -export type ChannelProperties = (({ -"channel":(Script.Channel),"serializationOptions"?:(Script.SerializationOptions),"ownership"?:(Script.ResultOwnership)})); +export namespace Network { + export type FetchError = { + method: 'network.fetchError'; + params: Network.FetchErrorParameters; + }; +} +export namespace Network { + export type ResponseCompleted = { + method: 'network.responseCompleted'; + params: Network.ResponseCompletedParameters; + }; +} +export namespace Network { + export type ResponseStarted = { + method: 'network.responseStarted'; + params: Network.ResponseStartedParameters; + }; } export namespace Script { -export type EvaluateResult = ((Script.EvaluateResultSuccess| Script.EvaluateResultException)); + export type Channel = string; } export namespace Script { export type EvaluateResultSuccess = { @@ -1237,13 +1666,6 @@ export namespace Script { realm: Script.Realm; }; } -export namespace Script { - export type EvaluateResultException = { - type: 'exception'; - exceptionDetails: Script.ExceptionDetails; - realm: Script.Realm; - }; -} export namespace Script { export type ExceptionDetails = { columnNumber: JsUint; @@ -1253,6 +1675,31 @@ export namespace Script { text: string; }; } +export namespace Script { + export type ChannelValue = { + type: 'channel'; + value: Script.ChannelProperties; + }; +} +export namespace Script { + export type ChannelProperties = { + channel: Script.Channel; + serializationOptions?: Script.SerializationOptions; + ownership?: Script.ResultOwnership; + }; +} +export namespace Script { + export type EvaluateResult = + | Script.EvaluateResultSuccess + | Script.EvaluateResultException; +} +export namespace Script { + export type EvaluateResultException = { + type: 'exception'; + exceptionDetails: Script.ExceptionDetails; + realm: Script.Realm; + }; +} export namespace Script { export type Handle = string; } @@ -1260,10 +1707,19 @@ export namespace Script { export type InternalId = string; } export namespace Script { -export type LocalValue = ((Script.RemoteReference| Script.PrimitiveProtocolValue| Script.ChannelValue| Script.ArrayLocalValue| (Script.DateLocalValue)| Script.MapLocalValue| Script.ObjectLocalValue| (Script.RegExpLocalValue)| Script.SetLocalValue)); + export type ListLocalValue = [...Script.LocalValue[]]; } export namespace Script { - export type ListLocalValue = [...Script.LocalValue[]]; + export type LocalValue = + | Script.RemoteReference + | Script.PrimitiveProtocolValue + | Script.ChannelValue + | Script.ArrayLocalValue + | Script.DateLocalValue + | Script.MapLocalValue + | Script.ObjectLocalValue + | Script.RegExpLocalValue + | Script.SetLocalValue; } export namespace Script { export type ArrayLocalValue = { @@ -1435,6 +1891,38 @@ export namespace Script { | 'audio-worklet' | 'worklet'; } +export namespace Script { + export type ListRemoteValue = [...Script.RemoteValue[]]; +} +export namespace Script { + export type MappingRemoteValue = [ + ...[Script.RemoteValue | string, Script.RemoteValue][], + ]; +} +export namespace Script { + export type RemoteValue = + | Script.PrimitiveProtocolValue + | Script.SymbolRemoteValue + | Script.ArrayRemoteValue + | Script.ObjectRemoteValue + | Script.FunctionRemoteValue + | Script.RegExpRemoteValue + | Script.DateRemoteValue + | Script.MapRemoteValue + | Script.SetRemoteValue + | Script.WeakMapRemoteValue + | Script.WeakSetRemoteValue + | Script.GeneratorRemoteValue + | Script.ErrorRemoteValue + | Script.ProxyRemoteValue + | Script.PromiseRemoteValue + | Script.TypedArrayRemoteValue + | Script.ArrayBufferRemoteValue + | Script.NodeListRemoteValue + | Script.HtmlCollectionRemoteValue + | Script.NodeRemoteValue + | Script.WindowProxyRemoteValue; +} export namespace Script { export type RemoteReference = | Script.SharedReference @@ -1453,172 +1941,258 @@ export namespace Script { } & Extensible; } export namespace Script { -export type RemoteValue = ((Script.PrimitiveProtocolValue| Script.SymbolRemoteValue| Script.ArrayRemoteValue| Script.ObjectRemoteValue| Script.FunctionRemoteValue| Script.RegExpRemoteValue| Script.DateRemoteValue| Script.MapRemoteValue| Script.SetRemoteValue| Script.WeakMapRemoteValue| Script.WeakSetRemoteValue| Script.GeneratorRemoteValue| Script.ErrorRemoteValue| Script.ProxyRemoteValue| Script.PromiseRemoteValue| Script.TypedArrayRemoteValue| Script.ArrayBufferRemoteValue| Script.NodeListRemoteValue| Script.HtmlCollectionRemoteValue| Script.NodeRemoteValue| Script.WindowProxyRemoteValue)); -} -export namespace Script { - export type ListRemoteValue = [...Script.RemoteValue[]]; -} -export namespace Script { - export type MappingRemoteValue = [ - ...[Script.RemoteValue | string, Script.RemoteValue][], - ]; -} -export namespace Script { -export type SymbolRemoteValue = (({ -"type":("symbol"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type SymbolRemoteValue = { + type: 'symbol'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ArrayRemoteValue = (({ -"type":("array"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type ArrayRemoteValue = { + type: 'array'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type ObjectRemoteValue = (({ -"type":("object"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); + export type ObjectRemoteValue = { + type: 'object'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export namespace Script { -export type FunctionRemoteValue = (({ -"type":("function"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type FunctionRemoteValue = { + type: 'function'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type RegExpRemoteValue = ((Script.RegExpLocalValue&{ -"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type RegExpRemoteValue = Script.RegExpLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type DateRemoteValue = ((Script.DateLocalValue&{ -"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type DateRemoteValue = Script.DateLocalValue & { + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type MapRemoteValue = (({ -"type":("map"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.MappingRemoteValue)})); + export type MapRemoteValue = { + type: 'map'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.MappingRemoteValue; + }; } export namespace Script { -export type SetRemoteValue = (({ -"type":("set"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type SetRemoteValue = { + type: 'set'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type WeakMapRemoteValue = (({ -"type":("weakmap"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WeakMapRemoteValue = { + type: 'weakmap'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type WeakSetRemoteValue = (({ -"type":("weakset"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WeakSetRemoteValue = { + type: 'weakset'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type GeneratorRemoteValue = (({ -"type":("generator"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type GeneratorRemoteValue = { + type: 'generator'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ErrorRemoteValue = (({ -"type":("error"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ErrorRemoteValue = { + type: 'error'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ProxyRemoteValue = (({ -"type":("proxy"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ProxyRemoteValue = { + type: 'proxy'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type PromiseRemoteValue = (({ -"type":("promise"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type PromiseRemoteValue = { + type: 'promise'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type TypedArrayRemoteValue = (({ -"type":("typedarray"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type TypedArrayRemoteValue = { + type: 'typedarray'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type ArrayBufferRemoteValue = (({ -"type":("arraybuffer"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type ArrayBufferRemoteValue = { + type: 'arraybuffer'; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type NodeListRemoteValue = (({ -"type":("nodelist"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type NodeListRemoteValue = { + type: 'nodelist'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type HtmlCollectionRemoteValue = (({ -"type":("htmlcollection"),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.ListRemoteValue)})); + export type HtmlCollectionRemoteValue = { + type: 'htmlcollection'; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.ListRemoteValue; + }; } export namespace Script { -export type NodeRemoteValue = (({ -"type":("node"),"sharedId"?:(Script.SharedId),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId),"value"?:(Script.NodeProperties)})); + export type NodeRemoteValue = { + type: 'node'; + sharedId?: Script.SharedId; + handle?: Script.Handle; + internalId?: Script.InternalId; + value?: Script.NodeProperties; + }; } export namespace Script { -export type NodeProperties = (({ -"nodeType":(JsUint),"childNodeCount":(JsUint),"attributes"?:(({ -[key: string]:(string)})),"children"?:([ -...((Script.NodeRemoteValue)[])]),"localName"?:(string),"mode"?:("open"| "closed"),"namespaceURI"?:(string),"nodeValue"?:(string),"shadowRoot"?:(Script.NodeRemoteValue| null)})); + export type NodeProperties = { + nodeType: JsUint; + childNodeCount: JsUint; + attributes?: { + [key: string]: string; + }; + children?: [...Script.NodeRemoteValue[]]; + localName?: string; + mode?: 'open' | 'closed'; + namespaceURI?: string; + nodeValue?: string; + shadowRoot?: Script.NodeRemoteValue | null; + }; } export namespace Script { -export type WindowProxyRemoteValue = (({ -"type":("window"),"value":(Script.WindowProxyProperties),"handle"?:(Script.Handle),"internalId"?:(Script.InternalId)})); + export type WindowProxyRemoteValue = { + type: 'window'; + value: Script.WindowProxyProperties; + handle?: Script.Handle; + internalId?: Script.InternalId; + }; } export namespace Script { -export type WindowProxyProperties = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type WindowProxyProperties = { + context: BrowsingContext.BrowsingContext; + }; } export namespace Script { -export const enum ResultOwnership {Root = "root", -None = "none", -} + export const enum ResultOwnership { + Root = 'root', + None = 'none', + } } export namespace Script { -export type SerializationOptions = (({ - -/** - * @defaultValue `0` - */ -"maxDomDepth"?:((JsUint| null)), -/** - * @defaultValue `null` - */ -"maxObjectDepth"?:((JsUint| null)), -/** - * @defaultValue `"none"` - */ -"includeShadowTree"?:(("none"| "open"| "all"))})); + export type SerializationOptions = { + /** + * @defaultValue `0` + */ + maxDomDepth?: JsUint | null; + /** + * @defaultValue `null` + */ + maxObjectDepth?: JsUint | null; + /** + * @defaultValue `"none"` + */ + includeShadowTree?: 'none' | 'open' | 'all'; + }; } export namespace Script { -export type SharedId = (string); + export type SharedId = string; } export namespace Script { -export type StackFrame = (({ -"columnNumber":(JsUint),"functionName":(string),"lineNumber":(JsUint),"url":(string)})); + export type StackFrame = { + columnNumber: JsUint; + functionName: string; + lineNumber: JsUint; + url: string; + }; } export namespace Script { -export type StackTrace = (({ -"callFrames":([ -...((Script.StackFrame)[])])})); + export type StackTrace = { + callFrames: [...Script.StackFrame[]]; + }; } export namespace Script { -export type Source = (({ -"realm":(Script.Realm),"context"?:(BrowsingContext.BrowsingContext)})); + export type Source = { + realm: Script.Realm; + context?: BrowsingContext.BrowsingContext; + }; } export namespace Script { -export type RealmTarget = (({ -"realm":(Script.Realm)})); + export type RealmTarget = { + realm: Script.Realm; + }; } export namespace Script { -export type ContextTarget = (({ -"context":(BrowsingContext.BrowsingContext),"sandbox"?:(string)})); + export type ContextTarget = { + context: BrowsingContext.BrowsingContext; + sandbox?: string; + }; } export namespace Script { -export type Target = ((Script.ContextTarget| Script.RealmTarget)); + export type Target = Script.ContextTarget | Script.RealmTarget; } export namespace Script { -export type AddPreloadScript = ({ -"method":("script.addPreloadScript"),"params":(Script.AddPreloadScriptParameters)}); + export type AddPreloadScript = { + method: 'script.addPreloadScript'; + params: Script.AddPreloadScriptParameters; + }; } export namespace Script { -export type AddPreloadScriptParameters = (({ -"functionDeclaration":(string),"arguments"?:([ -...((Script.ChannelValue)[])]),"contexts"?:([ -(BrowsingContext.BrowsingContext),...(BrowsingContext.BrowsingContext)[]]),"userContexts"?:([ -(Browser.UserContext),...(Browser.UserContext)[]]),"sandbox"?:(string)})); + export type AddPreloadScriptParameters = { + functionDeclaration: string; + arguments?: [...Script.ChannelValue[]]; + contexts?: [ + BrowsingContext.BrowsingContext, + ...BrowsingContext.BrowsingContext[], + ]; + userContexts?: [Browser.UserContext, ...Browser.UserContext[]]; + sandbox?: string; + }; } export namespace Script { -export type AddPreloadScriptResult = (({ -"script":(Script.PreloadScript)})); + export type AddPreloadScriptResult = { + script: Script.PreloadScript; + }; } export namespace Script { -export type Disown = ({ -"method":("script.disown"),"params":(Script.DisownParameters)}); + export type Disown = { + method: 'script.disown'; + params: Script.DisownParameters; + }; } export namespace Script { export type DisownParameters = { @@ -1626,6 +2200,21 @@ export namespace Script { target: Script.Target; }; } +export namespace Script { + export type CallFunctionParameters = { + functionDeclaration: string; + awaitPromise: boolean; + target: Script.Target; + arguments?: [...Script.LocalValue[]]; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + this?: Script.LocalValue; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; +} export namespace Script { export type CallFunction = { method: 'script.callFunction'; @@ -1633,51 +2222,50 @@ export namespace Script { }; } export namespace Script { -export type CallFunctionParameters = (({ -"functionDeclaration":(string),"awaitPromise":(boolean),"target":(Script.Target),"arguments"?:([ -...((Script.LocalValue)[])]),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions),"this"?:(Script.LocalValue), -/** - * @defaultValue `false` - */ -"userActivation"?:(boolean)})); -} -export namespace Script { -export type Evaluate = ({ -"method":("script.evaluate"),"params":(Script.EvaluateParameters)}); -} -export namespace Script { -export type EvaluateParameters = (({ -"expression":(string),"target":(Script.Target),"awaitPromise":(boolean),"resultOwnership"?:(Script.ResultOwnership),"serializationOptions"?:(Script.SerializationOptions), -/** - * @defaultValue `false` - */ -"userActivation"?:(boolean)})); + export type Evaluate = { + method: 'script.evaluate'; + params: Script.EvaluateParameters; + }; } export namespace Script { -export type GetRealms = ({ -"method":("script.getRealms"),"params":(Script.GetRealmsParameters)}); + export type EvaluateParameters = { + expression: string; + target: Script.Target; + awaitPromise: boolean; + resultOwnership?: Script.ResultOwnership; + serializationOptions?: Script.SerializationOptions; + /** + * @defaultValue `false` + */ + userActivation?: boolean; + }; } export namespace Script { -export type GetRealmsParameters = (({ -"context"?:(BrowsingContext.BrowsingContext),"type"?:(Script.RealmType)})); + export type GetRealms = { + method: 'script.getRealms'; + params: Script.GetRealmsParameters; + }; } export namespace Script { -export type GetRealmsResult = (({ -"realms":([ -...((Script.RealmInfo)[])])})); + export type GetRealmsParameters = { + context?: BrowsingContext.BrowsingContext; + type?: Script.RealmType; + }; } export namespace Script { -export type RemovePreloadScript = ({ -"method":("script.removePreloadScript"),"params":(Script.RemovePreloadScriptParameters)}); + export type GetRealmsResult = { + realms: [...Script.RealmInfo[]]; + }; } export namespace Script { -export type RemovePreloadScriptParameters = (({ -"script":(Script.PreloadScript)})); + export type RemovePreloadScript = { + method: 'script.removePreloadScript'; + params: Script.RemovePreloadScriptParameters; + }; } export namespace Script { - export type Message = { - method: 'script.message'; - params: Script.MessageParameters; + export type RemovePreloadScriptParameters = { + script: Script.PreloadScript; }; } export namespace Script { @@ -1694,117 +2282,187 @@ export namespace Script { }; } export namespace Script { -export type RealmDestroyed = ({ -"method":("script.realmDestroyed"),"params":(Script.RealmDestroyedParameters)}); + export type Message = { + method: 'script.message'; + params: Script.MessageParameters; + }; +} +export namespace Script { + export type RealmDestroyed = { + method: 'script.realmDestroyed'; + params: Script.RealmDestroyedParameters; + }; } export namespace Script { -export type RealmDestroyedParameters = (({ -"realm":(Script.Realm)})); + export type RealmDestroyedParameters = { + realm: Script.Realm; + }; } -export type StorageCommand = (Storage.DeleteCookies| Storage.GetCookies| Storage.SetCookie); -export type StorageResult = ((Storage.DeleteCookiesResult| Storage.GetCookiesResult| Storage.SetCookieResult)); +export type StorageCommand = + | Storage.DeleteCookies + | Storage.GetCookies + | Storage.SetCookie; +export type StorageResult = + | Storage.DeleteCookiesResult + | Storage.GetCookiesResult + | Storage.SetCookieResult; export namespace Storage { -export type PartitionKey = (({ -"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); + export type PartitionKey = { + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export namespace Storage { -export type GetCookies = ({ -"method":("storage.getCookies"),"params":(Storage.GetCookiesParameters)}); + export type GetCookies = { + method: 'storage.getCookies'; + params: Storage.GetCookiesParameters; + }; } export namespace Storage { -export type CookieFilter = (({ -"name"?:(string),"value"?:(Network.BytesValue),"domain"?:(string),"path"?:(string),"size"?:(JsUint),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); + export type CookieFilter = { + name?: string; + value?: Network.BytesValue; + domain?: string; + path?: string; + size?: JsUint; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export namespace Storage { -export type BrowsingContextPartitionDescriptor = (({ -"type":("context"),"context":(BrowsingContext.BrowsingContext)})); + export type BrowsingContextPartitionDescriptor = { + type: 'context'; + context: BrowsingContext.BrowsingContext; + }; } export namespace Storage { -export type StorageKeyPartitionDescriptor = (({ -"type":("storageKey"),"userContext"?:(string),"sourceOrigin"?:(string)}&Extensible)); + export type StorageKeyPartitionDescriptor = { + type: 'storageKey'; + userContext?: string; + sourceOrigin?: string; + } & Extensible; } export namespace Storage { -export type PartitionDescriptor = ((Storage.BrowsingContextPartitionDescriptor| Storage.StorageKeyPartitionDescriptor)); + export type PartitionDescriptor = + | Storage.BrowsingContextPartitionDescriptor + | Storage.StorageKeyPartitionDescriptor; } export namespace Storage { -export type GetCookiesParameters = (({ -"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); + export type GetCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type GetCookiesResult = (({ -"cookies":([ -...((Network.Cookie)[])]),"partitionKey":(Storage.PartitionKey)})); + export type GetCookiesResult = { + cookies: [...Network.Cookie[]]; + partitionKey: Storage.PartitionKey; + }; } export namespace Storage { -export type SetCookie = ({ -"method":("storage.setCookie"),"params":(Storage.SetCookieParameters)}); + export type SetCookie = { + method: 'storage.setCookie'; + params: Storage.SetCookieParameters; + }; } export namespace Storage { -export type PartialCookie = (({ -"name":(string),"value":(Network.BytesValue),"domain":(string),"path"?:(string),"httpOnly"?:(boolean),"secure"?:(boolean),"sameSite"?:(Network.SameSite),"expiry"?:(JsUint)}&Extensible)); + export type PartialCookie = { + name: string; + value: Network.BytesValue; + domain: string; + path?: string; + httpOnly?: boolean; + secure?: boolean; + sameSite?: Network.SameSite; + expiry?: JsUint; + } & Extensible; } export namespace Storage { -export type SetCookieParameters = (({ -"cookie":(Storage.PartialCookie),"partition"?:(Storage.PartitionDescriptor)})); + export type SetCookieParameters = { + cookie: Storage.PartialCookie; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type SetCookieResult = (({ -"partitionKey":(Storage.PartitionKey)})); + export type SetCookieResult = { + partitionKey: Storage.PartitionKey; + }; } export namespace Storage { -export type DeleteCookies = ({ -"method":("storage.deleteCookies"),"params":(Storage.DeleteCookiesParameters)}); + export type DeleteCookies = { + method: 'storage.deleteCookies'; + params: Storage.DeleteCookiesParameters; + }; } export namespace Storage { -export type DeleteCookiesParameters = (({ -"filter"?:(Storage.CookieFilter),"partition"?:(Storage.PartitionDescriptor)})); + export type DeleteCookiesParameters = { + filter?: Storage.CookieFilter; + partition?: Storage.PartitionDescriptor; + }; } export namespace Storage { -export type DeleteCookiesResult = (({ -"partitionKey":(Storage.PartitionKey)})); + export type DeleteCookiesResult = { + partitionKey: Storage.PartitionKey; + }; } -export type LogEvent = (Log.EntryAdded); +export type LogEvent = Log.EntryAdded; export namespace Log { -export const enum Level {Debug = "debug", -Info = "info", -Warn = "warn", -Error = "error", -} + export const enum Level { + Debug = 'debug', + Info = 'info', + Warn = 'warn', + Error = 'error', + } } export namespace Log { -export type Entry = ((Log.GenericLogEntry| Log.ConsoleLogEntry| Log.JavascriptLogEntry)); + export type Entry = + | Log.GenericLogEntry + | Log.ConsoleLogEntry + | Log.JavascriptLogEntry; } export namespace Log { -export type BaseLogEntry = ({ -"level":(Log.Level),"source":(Script.Source),"text":(string| null),"timestamp":(JsUint),"stackTrace"?:(Script.StackTrace)}); + export type BaseLogEntry = { + level: Log.Level; + source: Script.Source; + text: string | null; + timestamp: JsUint; + stackTrace?: Script.StackTrace; + }; } export namespace Log { -export type GenericLogEntry = ((Log.BaseLogEntry&{ -"type":(string)})); + export type GenericLogEntry = Log.BaseLogEntry & { + type: string; + }; } export namespace Log { -export type ConsoleLogEntry = ((Log.BaseLogEntry&{ -"type":("console"),"method":(string),"args":([ -...((Script.RemoteValue)[])])})); + export type ConsoleLogEntry = Log.BaseLogEntry & { + type: 'console'; + method: string; + args: [...Script.RemoteValue[]]; + }; } export namespace Log { -export type JavascriptLogEntry = ((Log.BaseLogEntry&{ -"type":("javascript")})); + export type JavascriptLogEntry = Log.BaseLogEntry & { + type: 'javascript'; + }; } export namespace Log { -export type EntryAdded = ({ -"method":("log.entryAdded"),"params":(Log.Entry)}); -} -export type InputCommand = (Input.PerformActions| Input.ReleaseActions| Input.SetFiles); -export type InputEvent = (Input.FileDialogOpened); -export namespace Input { -export type ElementOrigin = (({ -"type":("element"),"element":(Script.SharedReference)})); + export type EntryAdded = { + method: 'log.entryAdded'; + params: Log.Entry; + }; } +export type InputCommand = + | Input.PerformActions + | Input.ReleaseActions + | Input.SetFiles; +export type InputEvent = Input.FileDialogOpened; export namespace Input { - export type PerformActions = { - method: 'input.performActions'; - params: Input.PerformActionsParameters; + export type ElementOrigin = { + type: 'element'; + element: Script.SharedReference; }; } export namespace Input { @@ -1813,13 +2471,6 @@ export namespace Input { actions: [...Input.SourceActions[]]; }; } -export namespace Input { - export type SourceActions = - | Input.NoneSourceActions - | Input.KeySourceActions - | Input.PointerSourceActions - | Input.WheelSourceActions; -} export namespace Input { export type NoneSourceActions = { type: 'none'; @@ -1827,9 +2478,6 @@ export namespace Input { actions: [...Input.NoneSourceAction[]]; }; } -export namespace Input { - export type NoneSourceAction = Input.PauseAction; -} export namespace Input { export type KeySourceActions = { type: 'key'; @@ -1837,12 +2485,6 @@ export namespace Input { actions: [...Input.KeySourceAction[]]; }; } -export namespace Input { - export type KeySourceAction = - | Input.PauseAction - | Input.KeyDownAction - | Input.KeyUpAction; -} export namespace Input { export type PointerSourceActions = { type: 'pointer'; @@ -1852,21 +2494,41 @@ export namespace Input { }; } export namespace Input { -export const enum PointerType {Mouse = "mouse", -Pen = "pen", -Touch = "touch", + export type PerformActions = { + method: 'input.performActions'; + params: Input.PerformActionsParameters; + }; } +export namespace Input { + export type SourceActions = + | Input.NoneSourceActions + | Input.KeySourceActions + | Input.PointerSourceActions + | Input.WheelSourceActions; } export namespace Input { -export type PointerParameters = (({ - -/** - * @defaultValue `"mouse"` - */ -"pointerType"?:(Input.PointerType)})); + export type NoneSourceAction = Input.PauseAction; } export namespace Input { -export type PointerSourceAction = ((Input.PauseAction| Input.PointerDownAction| Input.PointerUpAction| Input.PointerMoveAction)); + export type KeySourceAction = + | Input.PauseAction + | Input.KeyDownAction + | Input.KeyUpAction; +} +export namespace Input { + export const enum PointerType { + Mouse = 'mouse', + Pen = 'pen', + Touch = 'touch', + } +} +export namespace Input { + export type PointerParameters = { + /** + * @defaultValue `"mouse"` + */ + pointerType?: Input.PointerType; + }; } export namespace Input { export type WheelSourceActions = { @@ -1875,6 +2537,13 @@ export namespace Input { actions: [...Input.WheelSourceAction[]]; }; } +export namespace Input { + export type PointerSourceAction = + | Input.PauseAction + | Input.PointerDownAction + | Input.PointerUpAction + | Input.PointerMoveAction; +} export namespace Input { export type WheelSourceAction = Input.PauseAction | Input.WheelScrollAction; } @@ -1932,136 +2601,174 @@ export namespace Input { }; } export namespace Input { -export type PointerCommonProperties = ({ - -/** - * @defaultValue `1` - */ -"width"?:(JsUint), -/** - * @defaultValue `1` - */ -"height"?:(JsUint), -/** - * @defaultValue `0` - */ -"pressure"?:(number), -/** - * @defaultValue `0` - */ -"tangentialPressure"?:(number), -/** - * Must be between `0` and `359`, inclusive. - * - * @defaultValue `0` - */ -"twist"?:((number)), -/** - * Must be between `0` and `1.5707963267948966`, inclusive. - * - * @defaultValue `0` - */ -"altitudeAngle"?:((number)), -/** - * Must be between `0` and `6.283185307179586`, inclusive. - * - * @defaultValue `0` - */ -"azimuthAngle"?:((number))}); + export type PointerCommonProperties = { + /** + * @defaultValue `1` + */ + width?: JsUint; + /** + * @defaultValue `1` + */ + height?: JsUint; + /** + * @defaultValue `0` + */ + pressure?: number; + /** + * @defaultValue `0` + */ + tangentialPressure?: number; + /** + * Must be between `0` and `359`, inclusive. + * + * @defaultValue `0` + */ + twist?: number; + /** + * Must be between `0` and `1.5707963267948966`, inclusive. + * + * @defaultValue `0` + */ + altitudeAngle?: number; + /** + * Must be between `0` and `6.283185307179586`, inclusive. + * + * @defaultValue `0` + */ + azimuthAngle?: number; + }; } export namespace Input { -export type Origin = ("viewport"| "pointer"| Input.ElementOrigin); + export type Origin = 'viewport' | 'pointer' | Input.ElementOrigin; } export namespace Input { -export type ReleaseActions = ({ -"method":("input.releaseActions"),"params":(Input.ReleaseActionsParameters)}); + export type ReleaseActions = { + method: 'input.releaseActions'; + params: Input.ReleaseActionsParameters; + }; } export namespace Input { -export type ReleaseActionsParameters = (({ -"context":(BrowsingContext.BrowsingContext)})); + export type ReleaseActionsParameters = { + context: BrowsingContext.BrowsingContext; + }; } export namespace Input { -export type SetFiles = ({ -"method":("input.setFiles"),"params":(Input.SetFilesParameters)}); + export type SetFiles = { + method: 'input.setFiles'; + params: Input.SetFilesParameters; + }; } export namespace Input { -export type SetFilesParameters = (({ -"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"files":([ -...((string)[])])})); + export type SetFilesParameters = { + context: BrowsingContext.BrowsingContext; + element: Script.SharedReference; + files: [...string[]]; + }; } -export type AutofillCommand = (Autofill.Trigger); +export type AutofillCommand = Autofill.Trigger; export namespace Autofill { -export type Trigger = ({ -"method":("autofill.trigger"),"params":(Autofill.TriggerParameters)}); + export type Trigger = { + method: 'autofill.trigger'; + params: Autofill.TriggerParameters; + }; } export namespace Autofill { -export type TriggerParameters = (({ -"context":(BrowsingContext.BrowsingContext),"element":(Script.SharedReference),"field":(Autofill.Field),"card":(Autofill.Card),"address":(Autofill.Address)})); + export type TriggerParameters = { + context: BrowsingContext.BrowsingContext; + element: Script.SharedReference; + card?: Autofill.Card; + address?: Autofill.Address; + }; } export namespace Autofill { -export type Field = (({ -"name":(Autofill.FieldName),"value":(string)})); + export type Field = { + name: Autofill.FieldName; + value: string; + }; } export namespace Autofill { -export type Card = (({ -"number":(string),"name":(string),"expiryMonth":(string),"expiryYear":(string),"cvc":(string)})); + export type Card = { + number: string; + name: string; + expiryMonth: string; + expiryYear: string; + cvc: string; + }; } export namespace Autofill { -export type Address = (({ -"fields":([ -...((Autofill.Field)[])])})); + export type Address = { + fields: [...Autofill.Field[]]; + }; } export namespace Autofill { -export type FieldName = (string); + export type FieldName = string; } export namespace Input { -export type FileDialogOpened = ({ -"method":("input.fileDialogOpened"),"params":(Input.FileDialogInfo)}); + export type FileDialogOpened = { + method: 'input.fileDialogOpened'; + params: Input.FileDialogInfo; + }; } export namespace Input { -export type FileDialogInfo = (({ -"context":(BrowsingContext.BrowsingContext),"element"?:(Script.SharedReference),"multiple":(boolean)})); + export type FileDialogInfo = { + context: BrowsingContext.BrowsingContext; + element?: Script.SharedReference; + multiple: boolean; + }; } -export type WebExtensionCommand = (WebExtension.Install| WebExtension.Uninstall); -export type WebExtensionResult = ((WebExtension.InstallResult)); +export type WebExtensionCommand = WebExtension.Install | WebExtension.Uninstall; +export type WebExtensionResult = WebExtension.InstallResult; export namespace WebExtension { -export type Extension = (string); + export type Extension = string; } export namespace WebExtension { - export type Install = { - method: 'webExtension.install'; - params: WebExtension.InstallParameters; + export type InstallParameters = { + extensionData: WebExtension.ExtensionData; }; } export namespace WebExtension { - export type InstallParameters = { - extensionData: WebExtension.ExtensionData; + export type Install = { + method: 'webExtension.install'; + params: WebExtension.InstallParameters; }; } export namespace WebExtension { -export type ExtensionData = ((WebExtension.ExtensionArchivePath| WebExtension.ExtensionBase64Encoded| WebExtension.ExtensionPath)); + export type ExtensionData = + | WebExtension.ExtensionArchivePath + | WebExtension.ExtensionBase64Encoded + | WebExtension.ExtensionPath; } export namespace WebExtension { -export type ExtensionPath = (({ -"type":("path"),"path":(string)})); + export type ExtensionPath = { + type: 'path'; + path: string; + }; } export namespace WebExtension { -export type ExtensionArchivePath = (({ -"type":("archivePath"),"path":(string)})); + export type ExtensionArchivePath = { + type: 'archivePath'; + path: string; + }; } export namespace WebExtension { -export type ExtensionBase64Encoded = (({ -"type":("base64"),"value":(string)})); + export type ExtensionBase64Encoded = { + type: 'base64'; + value: string; + }; } export namespace WebExtension { -export type InstallResult = (({ -"extension":(WebExtension.Extension)})); + export type InstallResult = { + extension: WebExtension.Extension; + }; } export namespace WebExtension { -export type Uninstall = ({ -"method":("webExtension.uninstall"),"params":(WebExtension.UninstallParameters)}); + export type Uninstall = { + method: 'webExtension.uninstall'; + params: WebExtension.UninstallParameters; + }; } export namespace WebExtension { -export type UninstallParameters = (({ -"extension":(WebExtension.Extension)})); + export type UninstallParameters = { + extension: WebExtension.Extension; + }; } From 11cb61c7f21265720854898ff3d1a8adec0c5355 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 4 Sep 2025 07:22:20 +0200 Subject: [PATCH 3/4] Build passes --- src/bidiMapper/BidiNoOpParser.ts | 1 + src/bidiMapper/BidiParser.ts | 1 + .../modules/autofill/AutofillProcessor.ts | 4 +++- src/bidiTab/BidiParser.ts | 1 + src/protocol-parser/protocol-parser.ts | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/bidiMapper/BidiNoOpParser.ts b/src/bidiMapper/BidiNoOpParser.ts index 6f75383d58..1fc7d01493 100644 --- a/src/bidiMapper/BidiNoOpParser.ts +++ b/src/bidiMapper/BidiNoOpParser.ts @@ -16,6 +16,7 @@ */ import type { + Autofill, Browser, BrowsingContext, Cdp, diff --git a/src/bidiMapper/BidiParser.ts b/src/bidiMapper/BidiParser.ts index 41807f7c26..93231d1efd 100644 --- a/src/bidiMapper/BidiParser.ts +++ b/src/bidiMapper/BidiParser.ts @@ -16,6 +16,7 @@ */ import type { + Autofill, Bluetooth, Browser, BrowsingContext, diff --git a/src/bidiMapper/modules/autofill/AutofillProcessor.ts b/src/bidiMapper/modules/autofill/AutofillProcessor.ts index d5f277e69d..b07a015328 100644 --- a/src/bidiMapper/modules/autofill/AutofillProcessor.ts +++ b/src/bidiMapper/modules/autofill/AutofillProcessor.ts @@ -40,7 +40,9 @@ export class AutofillProcessor { */ async trigger(params: Autofill.TriggerParameters): Promise { try { - await this.#browserCdpClient.sendCommand('Autofill.trigger', { + // Cast to `any` as a temporary workaround for prototyping, since the TypeScript types + // for CDP in "Chromium BiDi" aren't automatically updated with local changes. + await (this.#browserCdpClient as any).sendCommand('Autofill.trigger', { fieldId: Number(params.element.sharedId), frameId: undefined, card: params.card, diff --git a/src/bidiTab/BidiParser.ts b/src/bidiTab/BidiParser.ts index d1f9119f74..e00055f944 100644 --- a/src/bidiTab/BidiParser.ts +++ b/src/bidiTab/BidiParser.ts @@ -16,6 +16,7 @@ */ import type {BidiCommandParameterParser} from '../bidiMapper/BidiMapper.js'; import type { + Autofill, Bluetooth, Browser, BrowsingContext, diff --git a/src/protocol-parser/protocol-parser.ts b/src/protocol-parser/protocol-parser.ts index 1e306b05c5..833063c1db 100644 --- a/src/protocol-parser/protocol-parser.ts +++ b/src/protocol-parser/protocol-parser.ts @@ -636,3 +636,17 @@ export namespace WebModule { } // keep-sorted end } + +export namespace Autofill { + // keep-sorted start block=yes + + export function parseTriggerParameters( + params: unknown, + ): Protocol.Autofill.TriggerParameters { + return parseObject( + params, + WebDriverBidi.Autofill.TriggerParametersSchema, + ) as Protocol.Autofill.TriggerParameters; + } + // keep-sorted end +} From 1f4a9e9389597f99e0bde231b0506b11a03cc740 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Tue, 9 Sep 2025 06:21:21 +0200 Subject: [PATCH 4/4] style --- Pipfile.lock | 1079 +++++++++-------- src/bidiMapper/CommandProcessor.ts | 2 +- .../modules/autofill/AutofillProcessor.ts | 59 +- tests/autofill/__init__.py | 14 + tests/autofill/test_autofill_trigger.py | 384 ++++++ 5 files changed, 1010 insertions(+), 528 deletions(-) create mode 100644 tests/autofill/__init__.py create mode 100644 tests/autofill/test_autofill_trigger.py diff --git a/Pipfile.lock b/Pipfile.lock index 42b9018172..eca0315c83 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,522 +1,563 @@ { - "_meta": { - "hash": { - "sha256": "55acc4758cdb5f5112921b960586e78aa312e91c0c7aa44478e52763ab2b26ee" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.11" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "anys": { - "hashes": [ - "sha256:56c04f76afe5379a5058aec067befa1fb93070d63cabbd342e04b3d5aff739f8", - "sha256:ae4124d98ab0449a457d1563e86c9f9baa059707bf7bd65248d594b1fdc2a5c2" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.3.0" - }, - "icdiff": { - "hashes": [ - "sha256:f05d1b3623223dd1c70f7848da7d699de3d9a2550b902a8234d9026292fb5762", - "sha256:f79a318891adbf59a45e3a7694f5e1f18c5407065264637072ac8363b759866f" - ], - "version": "==2.0.7" - }, - "iniconfig": { - "hashes": [ - "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", - "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760" - ], - "markers": "python_version >= '3.8'", - "version": "==2.1.0" - }, - "markupsafe": { - "hashes": [ - "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4", - "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", - "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0", - "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", - "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", - "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13", - "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", - "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca", - "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", - "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832", - "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0", - "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b", - "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579", - "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", - "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", - "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff", - "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", - "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", - "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", - "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb", - "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e", - "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", - "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a", - "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d", - "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a", - "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b", - "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8", - "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", - "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", - "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144", - "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f", - "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", - "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d", - "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93", - "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", - "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158", - "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84", - "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", - "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", - "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171", - "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", - "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", - "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", - "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d", - "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", - "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", - "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", - "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", - "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29", - "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", - "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798", - "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c", - "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", - "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", - "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", - "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a", - "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178", - "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", - "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", - "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", - "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50" - ], - "markers": "python_version >= '3.9'", - "version": "==3.0.2" - }, - "mypy": { - "hashes": [ - "sha256:091f53ff88cb093dcc33c29eee522c087a438df65eb92acd371161c1f4380ff0", - "sha256:1a69db3018b87b3e6e9dd28970f983ea6c933800c9edf8c503c3135b3274d5ad", - "sha256:24f3de8b9e7021cd794ad9dfbf2e9fe3f069ff5e28cb57af6f873ffec1cb0425", - "sha256:31eba8a7a71f0071f55227a8057468b8d2eb5bf578c8502c7f01abaec8141b2f", - "sha256:3c8835a07b8442da900db47ccfda76c92c69c3a575872a5b764332c4bacb5a0a", - "sha256:3df87094028e52766b0a59a3e46481bb98b27986ed6ded6a6cc35ecc75bb9182", - "sha256:49499cf1e464f533fc45be54d20a6351a312f96ae7892d8e9f1708140e27ce41", - "sha256:4c192445899c69f07874dabda7e931b0cc811ea055bf82c1ababf358b9b2a72c", - "sha256:4f3d27537abde1be6d5f2c96c29a454da333a2a271ae7d5bc7110e6d4b7beb3f", - "sha256:7469545380dddce5719e3656b80bdfbb217cfe8dbb1438532d6abc754b828fed", - "sha256:7807a2a61e636af9ca247ba8494031fb060a0a744b9fee7de3a54bed8a753323", - "sha256:856bad61ebc7d21dbc019b719e98303dc6256cec6dcc9ebb0b214b81d6901bd8", - "sha256:89513ddfda06b5c8ebd64f026d20a61ef264e89125dc82633f3c34eeb50e7d60", - "sha256:8e0db37ac4ebb2fee7702767dfc1b773c7365731c22787cb99f507285014fcaf", - "sha256:971104bcb180e4fed0d7bd85504c9036346ab44b7416c75dd93b5c8c6bb7e28f", - "sha256:9e1589ca150a51d9d00bb839bfeca2f7a04f32cd62fad87a847bc0818e15d7dc", - "sha256:9f8464ed410ada641c29f5de3e6716cbdd4f460b31cf755b2af52f2d5ea79ead", - "sha256:ab98b8f6fdf669711f3abe83a745f67f50e3cbaea3998b90e8608d2b459fd566", - "sha256:b19006055dde8a5425baa5f3b57a19fa79df621606540493e5e893500148c72f", - "sha256:c69051274762cccd13498b568ed2430f8d22baa4b179911ad0c1577d336ed849", - "sha256:d2dad072e01764823d4b2f06bc7365bb1d4b6c2f38c4d42fade3c8d45b0b4b67", - "sha256:dccd850a2e3863891871c9e16c54c742dba5470f5120ffed8152956e9e0a5e13", - "sha256:e28d7b221898c401494f3b77db3bac78a03ad0a0fff29a950317d87885c655d2", - "sha256:e4b7a99275a61aa22256bab5839c35fe8a6887781862471df82afb4b445daae6", - "sha256:eb7ff4007865833c470a601498ba30462b7374342580e2346bf7884557e40531", - "sha256:f8598307150b5722854f035d2e70a1ad9cc3c72d392c34fffd8c66d888c90f17", - "sha256:fea451a3125bf0bfe716e5d7ad4b92033c471e4b5b3e154c67525539d14dc15a" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==1.6.0" - }, - "mypy-extensions": { - "hashes": [ - "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", - "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782" - ], - "markers": "python_version >= '3.5'", - "version": "==1.0.0" - }, - "packaging": { - "hashes": [ - "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", - "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f" - ], - "markers": "python_version >= '3.8'", - "version": "==24.2" - }, - "pillow": { - "hashes": [ - "sha256:048ad577748b9fa4a99a0548c64f2cb8d672d5bf2e643a739ac8faff1164238c", - "sha256:048eeade4c33fdf7e08da40ef402e748df113fd0b4584e32c4af74fe78baaeb2", - "sha256:0ba26351b137ca4e0db0342d5d00d2e355eb29372c05afd544ebf47c0956ffeb", - "sha256:0ea2a783a2bdf2a561808fe4a7a12e9aa3799b701ba305de596bc48b8bdfce9d", - "sha256:1530e8f3a4b965eb6a7785cf17a426c779333eb62c9a7d1bbcf3ffd5bf77a4aa", - "sha256:16563993329b79513f59142a6b02055e10514c1a8e86dca8b48a893e33cf91e3", - "sha256:19aeb96d43902f0a783946a0a87dbdad5c84c936025b8419da0a0cd7724356b1", - "sha256:1a1d1915db1a4fdb2754b9de292642a39a7fb28f1736699527bb649484fb966a", - "sha256:1b87bd9d81d179bd8ab871603bd80d8645729939f90b71e62914e816a76fc6bd", - "sha256:1dfc94946bc60ea375cc39cff0b8da6c7e5f8fcdc1d946beb8da5c216156ddd8", - "sha256:2034f6759a722da3a3dbd91a81148cf884e91d1b747992ca288ab88c1de15999", - "sha256:261ddb7ca91fcf71757979534fb4c128448b5b4c55cb6152d280312062f69599", - "sha256:2ed854e716a89b1afcedea551cd85f2eb2a807613752ab997b9974aaa0d56936", - "sha256:3102045a10945173d38336f6e71a8dc71bcaeed55c3123ad4af82c52807b9375", - "sha256:339894035d0ede518b16073bdc2feef4c991ee991a29774b33e515f1d308e08d", - "sha256:412444afb8c4c7a6cc11a47dade32982439925537e483be7c0ae0cf96c4f6a0b", - "sha256:4203efca580f0dd6f882ca211f923168548f7ba334c189e9eab1178ab840bf60", - "sha256:45ebc7b45406febf07fef35d856f0293a92e7417ae7933207e90bf9090b70572", - "sha256:4b5ec25d8b17217d635f8935dbc1b9aa5907962fae29dff220f2659487891cd3", - "sha256:4c8e73e99da7db1b4cad7f8d682cf6abad7844da39834c288fbfa394a47bbced", - "sha256:4e6f7d1c414191c1199f8996d3f2282b9ebea0945693fb67392c75a3a320941f", - "sha256:4eaa22f0d22b1a7e93ff0a596d57fdede2e550aecffb5a1ef1106aaece48e96b", - "sha256:50b8eae8f7334ec826d6eeffaeeb00e36b5e24aa0b9df322c247539714c6df19", - "sha256:50fd3f6b26e3441ae07b7c979309638b72abc1a25da31a81a7fbd9495713ef4f", - "sha256:51243f1ed5161b9945011a7360e997729776f6e5d7005ba0c6879267d4c5139d", - "sha256:5d512aafa1d32efa014fa041d38868fda85028e3f930a96f85d49c7d8ddc0383", - "sha256:5f77cf66e96ae734717d341c145c5949c63180842a545c47a0ce7ae52ca83795", - "sha256:6b02471b72526ab8a18c39cb7967b72d194ec53c1fd0a70b050565a0f366d355", - "sha256:6fb1b30043271ec92dc65f6d9f0b7a830c210b8a96423074b15c7bc999975f57", - "sha256:7161ec49ef0800947dc5570f86568a7bb36fa97dd09e9827dc02b718c5643f09", - "sha256:72d622d262e463dfb7595202d229f5f3ab4b852289a1cd09650362db23b9eb0b", - "sha256:74d28c17412d9caa1066f7a31df8403ec23d5268ba46cd0ad2c50fb82ae40462", - "sha256:78618cdbccaa74d3f88d0ad6cb8ac3007f1a6fa5c6f19af64b55ca170bfa1edf", - "sha256:793b4e24db2e8742ca6423d3fde8396db336698c55cd34b660663ee9e45ed37f", - "sha256:798232c92e7665fe82ac085f9d8e8ca98826f8e27859d9a96b41d519ecd2e49a", - "sha256:81d09caa7b27ef4e61cb7d8fbf1714f5aec1c6b6c5270ee53504981e6e9121ad", - "sha256:8ab74c06ffdab957d7670c2a5a6e1a70181cd10b727cd788c4dd9005b6a8acd9", - "sha256:8eb0908e954d093b02a543dc963984d6e99ad2b5e36503d8a0aaf040505f747d", - "sha256:90b9e29824800e90c84e4022dd5cc16eb2d9605ee13f05d47641eb183cd73d45", - "sha256:9797a6c8fe16f25749b371c02e2ade0efb51155e767a971c61734b1bf6293994", - "sha256:9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d", - "sha256:9d3bea1c75f8c53ee4d505c3e67d8c158ad4df0d83170605b50b64025917f338", - "sha256:9e2ec1e921fd07c7cda7962bad283acc2f2a9ccc1b971ee4b216b75fad6f0463", - "sha256:9e91179a242bbc99be65e139e30690e081fe6cb91a8e77faf4c409653de39451", - "sha256:a0eaa93d054751ee9964afa21c06247779b90440ca41d184aeb5d410f20ff591", - "sha256:a2c405445c79c3f5a124573a051062300936b0281fee57637e706453e452746c", - "sha256:aa7e402ce11f0885305bfb6afb3434b3cd8f53b563ac065452d9d5654c7b86fd", - "sha256:aff76a55a8aa8364d25400a210a65ff59d0168e0b4285ba6bf2bd83cf675ba32", - "sha256:b09b86b27a064c9624d0a6c54da01c1beaf5b6cadfa609cf63789b1d08a797b9", - "sha256:b14f16f94cbc61215115b9b1236f9c18403c15dd3c52cf629072afa9d54c1cbf", - "sha256:b50811d664d392f02f7761621303eba9d1b056fb1868c8cdf4231279645c25f5", - "sha256:b7bc2176354defba3edc2b9a777744462da2f8e921fbaf61e52acb95bafa9828", - "sha256:c78e1b00a87ce43bb37642c0812315b411e856a905d58d597750eb79802aaaa3", - "sha256:c83341b89884e2b2e55886e8fbbf37c3fa5efd6c8907124aeb72f285ae5696e5", - "sha256:ca2870d5d10d8726a27396d3ca4cf7976cec0f3cb706debe88e3a5bd4610f7d2", - "sha256:ccce24b7ad89adb5a1e34a6ba96ac2530046763912806ad4c247356a8f33a67b", - "sha256:cd5e14fbf22a87321b24c88669aad3a51ec052eb145315b3da3b7e3cc105b9a2", - "sha256:ce49c67f4ea0609933d01c0731b34b8695a7a748d6c8d186f95e7d085d2fe475", - "sha256:d33891be6df59d93df4d846640f0e46f1a807339f09e79a8040bc887bdcd7ed3", - "sha256:d3b2348a78bc939b4fed6552abfd2e7988e0f81443ef3911a4b8498ca084f6eb", - "sha256:d886f5d353333b4771d21267c7ecc75b710f1a73d72d03ca06df49b09015a9ef", - "sha256:d93480005693d247f8346bc8ee28c72a2191bdf1f6b5db469c096c0c867ac015", - "sha256:dc1a390a82755a8c26c9964d457d4c9cbec5405896cba94cf51f36ea0d855002", - "sha256:dd78700f5788ae180b5ee8902c6aea5a5726bac7c364b202b4b3e3ba2d293170", - "sha256:e46f38133e5a060d46bd630faa4d9fa0202377495df1f068a8299fd78c84de84", - "sha256:e4b878386c4bf293578b48fc570b84ecfe477d3b77ba39a6e87150af77f40c57", - "sha256:f0d0591a0aeaefdaf9a5e545e7485f89910c977087e7de2b6c388aec32011e9f", - "sha256:fdcbb4068117dfd9ce0138d068ac512843c52295ed996ae6dd1faf537b6dbc27", - "sha256:ff61bfd9253c3915e6d41c651d5f962da23eda633cf02262990094a18a55371a" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==10.3.0" - }, - "pluggy": { - "hashes": [ - "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", - "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669" - ], - "markers": "python_version >= '3.8'", - "version": "==1.5.0" - }, - "pprintpp": { - "hashes": [ - "sha256:b6b4dcdd0c0c0d75e4d7b2f21a9e933e5b2ce62b26e1a54537f9651ae5a5c01d", - "sha256:ea826108e2c7f49dc6d66c752973c3fc9749142a798d6b254e1e301cfdbc6403" - ], - "version": "==0.4.0" - }, - "pytest": { - "hashes": [ - "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002", - "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==7.4.2" - }, - "pytest-asyncio": { - "hashes": [ - "sha256:40a7eae6dded22c7b604986855ea48400ab15b069ae38116e8c01238e9eeb64d", - "sha256:8666c1c8ac02631d7c51ba282e0c69a8a452b211ffedf2599099845da5c5c37b" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.21.1" - }, - "pytest-httpserver": { - "hashes": [ - "sha256:24cd3d9f6a0b927c7bfc400d0b3fda7442721b8267ce29942bf307b190f0bb09", - "sha256:e052f69bc8a9073db02484681e8e47004dd1fb3763b0ae833bd899e5895c559a" - ], - "index": "pypi", - "markers": "python_version >= '3.8' and python_version < '4.0'", - "version": "==1.0.8" - }, - "pytest-icdiff": { - "hashes": [ - "sha256:4f493ae5ee63c8e90e9f96d4b0b2968b19634dfed8a6e3c9848fcd0d6cadcf7b", - "sha256:8fac8667d7042270c23019580b4b5dfd81e1c3e5a9bc9d5df6ac4a49788d42f2" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.8" - }, - "pytest-repeat": { - "hashes": [ - "sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3", - "sha256:d92ac14dfaa6ffcfe6917e5d16f0c9bc82380c135b03c2a5f412d2637f224485" - ], - "index": "pypi", - "markers": "python_version >= '3.9'", - "version": "==0.9.4" - }, - "pytest-rerunfailures": { - "hashes": [ - "sha256:784f462fa87fe9bdf781d0027d856b47a4bfe6c12af108f6bd887057a917b48e", - "sha256:9a1afd04e21b8177faf08a9bbbf44de7a0fe3fc29f8ddbe83b9684bd5f8f92a9" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==12.0" - }, - "pytest-shard": { - "hashes": [ - "sha256:407a1df385cebe1feb9b4d2e7eeee8b044f8a24f0919421233159a17c59be2b9", - "sha256:b86a967fbfd1c8e50295095ccda031b7e890862ee06531d5142844f4c1d1cd67" - ], - "index": "pypi", - "markers": "python_version >= '3.6'", - "version": "==0.1.2" - }, - "pytest-timeout": { - "hashes": [ - "sha256:3b0b95dabf3cb50bac9ef5ca912fa0cfc286526af17afc806824df20c2f72c90", - "sha256:bde531e096466f49398a59f2dde76fa78429a09a12411466f88a07213e220de2" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==2.2.0" - }, - "syrupy": { - "hashes": [ - "sha256:6e01fccb4cd5ad37ce54e8c265cde068fa9c37b7a0946c603c328e8a38a7330d", - "sha256:ea6a237ef374bacebbdb4049f73bf48e3dda76eabd4621a6d104d43077529de6" - ], - "index": "pypi", - "markers": "python_version < '4' and python_full_version >= '3.8.1'", - "version": "==4.5.0" - }, - "typing-extensions": { - "hashes": [ - "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c", - "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef" - ], - "markers": "python_version >= '3.8'", - "version": "==4.13.2" - }, - "websockets": { - "hashes": [ - "sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd", - "sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f", - "sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998", - "sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82", - "sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788", - "sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa", - "sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f", - "sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4", - "sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7", - "sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f", - "sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd", - "sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69", - "sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb", - "sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b", - "sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016", - "sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac", - "sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4", - "sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb", - "sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99", - "sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e", - "sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54", - "sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf", - "sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007", - "sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3", - "sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6", - "sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86", - "sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1", - "sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61", - "sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11", - "sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8", - "sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f", - "sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931", - "sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526", - "sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016", - "sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae", - "sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd", - "sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b", - "sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311", - "sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af", - "sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152", - "sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288", - "sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de", - "sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97", - "sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d", - "sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d", - "sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca", - "sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0", - "sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9", - "sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b", - "sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e", - "sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128", - "sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d", - "sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c", - "sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5", - "sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6", - "sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b", - "sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b", - "sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280", - "sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c", - "sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c", - "sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f", - "sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20", - "sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8", - "sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb", - "sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602", - "sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf", - "sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0", - "sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74", - "sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0", - "sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==11.0.3" - }, - "werkzeug": { - "hashes": [ - "sha256:54b78bf3716d19a65be4fceccc0d1d7b89e608834989dfae50ea87564639213e", - "sha256:60723ce945c19328679790e3282cc758aa4a6040e4bb330f53d30fa546d44746" - ], - "markers": "python_version >= '3.9'", - "version": "==3.1.3" - } - }, - "develop": { - "execnet": { - "hashes": [ - "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", - "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3" - ], - "markers": "python_version >= '3.8'", - "version": "==2.1.1" - }, - "iniconfig": { - "hashes": [ - "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", - "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760" - ], - "markers": "python_version >= '3.8'", - "version": "==2.1.0" - }, - "packaging": { - "hashes": [ - "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", - "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f" - ], - "markers": "python_version >= '3.8'", - "version": "==24.2" - }, - "pluggy": { - "hashes": [ - "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", - "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669" - ], - "markers": "python_version >= '3.8'", - "version": "==1.5.0" - }, - "pyflakes": { - "hashes": [ - "sha256:5039c8339cbb1944045f4ee5466908906180f13cc99cc9949348d10f82a5c32a", - "sha256:6dfd61d87b97fba5dcfaaf781171ac16be16453be6d816147989e7f6e6a9576b" - ], - "markers": "python_version >= '3.9'", - "version": "==3.3.2" - }, - "pytest": { - "hashes": [ - "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002", - "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==7.4.2" - }, - "pytest-flakefinder": { - "hashes": [ - "sha256:741e0e8eea427052f5b8c89c2b3c3019a50c39a59ce4df6a305a2c2d9ba2bd13", - "sha256:e2412a1920bdb8e7908783b20b3d57e9dad590cc39a93e8596ffdd493b403e0e" - ], - "index": "pypi", - "markers": "python_version >= '3.5'", - "version": "==1.1.0" - }, - "pytest-flakes": { - "hashes": [ - "sha256:953134e97215ae31f6879fbd7368c18d43f709dc2fab5b7777db2bb2bac3a924", - "sha256:d0e8602d882744fc6169247b62a51203c5a3d8f160892ff3b82f5b9c1e4bb675" - ], - "index": "pypi", - "markers": "python_version >= '3.5'", - "version": "==4.0.5" - }, - "pytest-instafail": { - "hashes": [ - "sha256:33a606f7e0c8e646dc3bfee0d5e3a4b7b78ef7c36168cfa1f3d93af7ca706c9e", - "sha256:6855414487e9e4bb76a118ce952c3c27d3866af15487506c4ded92eb72387819" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.5.0" - }, - "pytest-randomly": { - "hashes": [ - "sha256:11bf4d23a26484de7860d82f726c0629837cf4064b79157bd18ec9d41d7feb26", - "sha256:8633d332635a1a0983d3bba19342196807f6afb17c3eef78e02c2f85dade45d6" - ], - "index": "pypi", - "markers": "python_version >= '3.9'", - "version": "==3.16.0" - }, - "pytest-xdist": { - "hashes": [ - "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7", - "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==3.6.1" + "_meta": { + "hash": { + "sha256": "eb87d19f8fffc9adc2be32b619b6737795b1058194822d52bb3a60033d3a028a" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.11" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "anys": { + "hashes": [ + "sha256:56c04f76afe5379a5058aec067befa1fb93070d63cabbd342e04b3d5aff739f8", + "sha256:ae4124d98ab0449a457d1563e86c9f9baa059707bf7bd65248d594b1fdc2a5c2" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.3.0" + }, + "blinker": { + "hashes": [ + "sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf", + "sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc" + ], + "markers": "python_version >= '3.9'", + "version": "==1.9.0" + }, + "click": { + "hashes": [ + "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", + "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b" + ], + "markers": "python_version >= '3.10'", + "version": "==8.2.1" + }, + "flask": { + "hashes": [ + "sha256:07aae2bb5eaf77993ef57e357491839f5fd9f4dc281593a81a9e4d79a24f295c", + "sha256:284c7b8f2f58cb737f0cf1c30fd7eaf0ccfcde196099d24ecede3fc2005aa59e" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==3.1.1" + }, + "icdiff": { + "hashes": [ + "sha256:f05d1b3623223dd1c70f7848da7d699de3d9a2550b902a8234d9026292fb5762", + "sha256:f79a318891adbf59a45e3a7694f5e1f18c5407065264637072ac8363b759866f" + ], + "version": "==2.0.7" + }, + "iniconfig": { + "hashes": [ + "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", + "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760" + ], + "markers": "python_version >= '3.8'", + "version": "==2.1.0" + }, + "itsdangerous": { + "hashes": [ + "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef", + "sha256:e0050c0b7da1eea53ffaf149c0cfbb5c6e2e2b69c4bef22c81fa6eb73e5f6173" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.0" + }, + "jinja2": { + "hashes": [ + "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", + "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67" + ], + "markers": "python_version >= '3.7'", + "version": "==3.1.6" + }, + "markupsafe": { + "hashes": [ + "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4", + "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", + "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0", + "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", + "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", + "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13", + "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", + "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca", + "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", + "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832", + "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0", + "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b", + "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579", + "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", + "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", + "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff", + "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", + "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", + "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", + "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb", + "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e", + "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", + "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a", + "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d", + "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a", + "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b", + "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8", + "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", + "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", + "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144", + "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f", + "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", + "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d", + "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93", + "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", + "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158", + "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84", + "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", + "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", + "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171", + "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", + "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", + "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", + "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d", + "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", + "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", + "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", + "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", + "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29", + "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", + "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798", + "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c", + "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", + "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", + "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", + "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a", + "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178", + "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", + "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", + "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", + "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50" + ], + "markers": "python_version >= '3.9'", + "version": "==3.0.2" + }, + "mypy": { + "hashes": [ + "sha256:091f53ff88cb093dcc33c29eee522c087a438df65eb92acd371161c1f4380ff0", + "sha256:1a69db3018b87b3e6e9dd28970f983ea6c933800c9edf8c503c3135b3274d5ad", + "sha256:24f3de8b9e7021cd794ad9dfbf2e9fe3f069ff5e28cb57af6f873ffec1cb0425", + "sha256:31eba8a7a71f0071f55227a8057468b8d2eb5bf578c8502c7f01abaec8141b2f", + "sha256:3c8835a07b8442da900db47ccfda76c92c69c3a575872a5b764332c4bacb5a0a", + "sha256:3df87094028e52766b0a59a3e46481bb98b27986ed6ded6a6cc35ecc75bb9182", + "sha256:49499cf1e464f533fc45be54d20a6351a312f96ae7892d8e9f1708140e27ce41", + "sha256:4c192445899c69f07874dabda7e931b0cc811ea055bf82c1ababf358b9b2a72c", + "sha256:4f3d27537abde1be6d5f2c96c29a454da333a2a271ae7d5bc7110e6d4b7beb3f", + "sha256:7469545380dddce5719e3656b80bdfbb217cfe8dbb1438532d6abc754b828fed", + "sha256:7807a2a61e636af9ca247ba8494031fb060a0a744b9fee7de3a54bed8a753323", + "sha256:856bad61ebc7d21dbc019b719e98303dc6256cec6dcc9ebb0b214b81d6901bd8", + "sha256:89513ddfda06b5c8ebd64f026d20a61ef264e89125dc82633f3c34eeb50e7d60", + "sha256:8e0db37ac4ebb2fee7702767dfc1b773c7365731c22787cb99f507285014fcaf", + "sha256:971104bcb180e4fed0d7bd85504c9036346ab44b7416c75dd93b5c8c6bb7e28f", + "sha256:9e1589ca150a51d9d00bb839bfeca2f7a04f32cd62fad87a847bc0818e15d7dc", + "sha256:9f8464ed410ada641c29f5de3e6716cbdd4f460b31cf755b2af52f2d5ea79ead", + "sha256:ab98b8f6fdf669711f3abe83a745f67f50e3cbaea3998b90e8608d2b459fd566", + "sha256:b19006055dde8a5425baa5f3b57a19fa79df621606540493e5e893500148c72f", + "sha256:c69051274762cccd13498b568ed2430f8d22baa4b179911ad0c1577d336ed849", + "sha256:d2dad072e01764823d4b2f06bc7365bb1d4b6c2f38c4d42fade3c8d45b0b4b67", + "sha256:dccd850a2e3863891871c9e16c54c742dba5470f5120ffed8152956e9e0a5e13", + "sha256:e28d7b221898c401494f3b77db3bac78a03ad0a0fff29a950317d87885c655d2", + "sha256:e4b7a99275a61aa22256bab5839c35fe8a6887781862471df82afb4b445daae6", + "sha256:eb7ff4007865833c470a601498ba30462b7374342580e2346bf7884557e40531", + "sha256:f8598307150b5722854f035d2e70a1ad9cc3c72d392c34fffd8c66d888c90f17", + "sha256:fea451a3125bf0bfe716e5d7ad4b92033c471e4b5b3e154c67525539d14dc15a" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==1.6.0" + }, + "mypy-extensions": { + "hashes": [ + "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", + "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558" + ], + "markers": "python_version >= '3.8'", + "version": "==1.1.0" + }, + "packaging": { + "hashes": [ + "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", + "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f" + ], + "markers": "python_version >= '3.8'", + "version": "==25.0" + }, + "pillow": { + "hashes": [ + "sha256:048ad577748b9fa4a99a0548c64f2cb8d672d5bf2e643a739ac8faff1164238c", + "sha256:048eeade4c33fdf7e08da40ef402e748df113fd0b4584e32c4af74fe78baaeb2", + "sha256:0ba26351b137ca4e0db0342d5d00d2e355eb29372c05afd544ebf47c0956ffeb", + "sha256:0ea2a783a2bdf2a561808fe4a7a12e9aa3799b701ba305de596bc48b8bdfce9d", + "sha256:1530e8f3a4b965eb6a7785cf17a426c779333eb62c9a7d1bbcf3ffd5bf77a4aa", + "sha256:16563993329b79513f59142a6b02055e10514c1a8e86dca8b48a893e33cf91e3", + "sha256:19aeb96d43902f0a783946a0a87dbdad5c84c936025b8419da0a0cd7724356b1", + "sha256:1a1d1915db1a4fdb2754b9de292642a39a7fb28f1736699527bb649484fb966a", + "sha256:1b87bd9d81d179bd8ab871603bd80d8645729939f90b71e62914e816a76fc6bd", + "sha256:1dfc94946bc60ea375cc39cff0b8da6c7e5f8fcdc1d946beb8da5c216156ddd8", + "sha256:2034f6759a722da3a3dbd91a81148cf884e91d1b747992ca288ab88c1de15999", + "sha256:261ddb7ca91fcf71757979534fb4c128448b5b4c55cb6152d280312062f69599", + "sha256:2ed854e716a89b1afcedea551cd85f2eb2a807613752ab997b9974aaa0d56936", + "sha256:3102045a10945173d38336f6e71a8dc71bcaeed55c3123ad4af82c52807b9375", + "sha256:339894035d0ede518b16073bdc2feef4c991ee991a29774b33e515f1d308e08d", + "sha256:412444afb8c4c7a6cc11a47dade32982439925537e483be7c0ae0cf96c4f6a0b", + "sha256:4203efca580f0dd6f882ca211f923168548f7ba334c189e9eab1178ab840bf60", + "sha256:45ebc7b45406febf07fef35d856f0293a92e7417ae7933207e90bf9090b70572", + "sha256:4b5ec25d8b17217d635f8935dbc1b9aa5907962fae29dff220f2659487891cd3", + "sha256:4c8e73e99da7db1b4cad7f8d682cf6abad7844da39834c288fbfa394a47bbced", + "sha256:4e6f7d1c414191c1199f8996d3f2282b9ebea0945693fb67392c75a3a320941f", + "sha256:4eaa22f0d22b1a7e93ff0a596d57fdede2e550aecffb5a1ef1106aaece48e96b", + "sha256:50b8eae8f7334ec826d6eeffaeeb00e36b5e24aa0b9df322c247539714c6df19", + "sha256:50fd3f6b26e3441ae07b7c979309638b72abc1a25da31a81a7fbd9495713ef4f", + "sha256:51243f1ed5161b9945011a7360e997729776f6e5d7005ba0c6879267d4c5139d", + "sha256:5d512aafa1d32efa014fa041d38868fda85028e3f930a96f85d49c7d8ddc0383", + "sha256:5f77cf66e96ae734717d341c145c5949c63180842a545c47a0ce7ae52ca83795", + "sha256:6b02471b72526ab8a18c39cb7967b72d194ec53c1fd0a70b050565a0f366d355", + "sha256:6fb1b30043271ec92dc65f6d9f0b7a830c210b8a96423074b15c7bc999975f57", + "sha256:7161ec49ef0800947dc5570f86568a7bb36fa97dd09e9827dc02b718c5643f09", + "sha256:72d622d262e463dfb7595202d229f5f3ab4b852289a1cd09650362db23b9eb0b", + "sha256:74d28c17412d9caa1066f7a31df8403ec23d5268ba46cd0ad2c50fb82ae40462", + "sha256:78618cdbccaa74d3f88d0ad6cb8ac3007f1a6fa5c6f19af64b55ca170bfa1edf", + "sha256:793b4e24db2e8742ca6423d3fde8396db336698c55cd34b660663ee9e45ed37f", + "sha256:798232c92e7665fe82ac085f9d8e8ca98826f8e27859d9a96b41d519ecd2e49a", + "sha256:81d09caa7b27ef4e61cb7d8fbf1714f5aec1c6b6c5270ee53504981e6e9121ad", + "sha256:8ab74c06ffdab957d7670c2a5a6e1a70181cd10b727cd788c4dd9005b6a8acd9", + "sha256:8eb0908e954d093b02a543dc963984d6e99ad2b5e36503d8a0aaf040505f747d", + "sha256:90b9e29824800e90c84e4022dd5cc16eb2d9605ee13f05d47641eb183cd73d45", + "sha256:9797a6c8fe16f25749b371c02e2ade0efb51155e767a971c61734b1bf6293994", + "sha256:9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d", + "sha256:9d3bea1c75f8c53ee4d505c3e67d8c158ad4df0d83170605b50b64025917f338", + "sha256:9e2ec1e921fd07c7cda7962bad283acc2f2a9ccc1b971ee4b216b75fad6f0463", + "sha256:9e91179a242bbc99be65e139e30690e081fe6cb91a8e77faf4c409653de39451", + "sha256:a0eaa93d054751ee9964afa21c06247779b90440ca41d184aeb5d410f20ff591", + "sha256:a2c405445c79c3f5a124573a051062300936b0281fee57637e706453e452746c", + "sha256:aa7e402ce11f0885305bfb6afb3434b3cd8f53b563ac065452d9d5654c7b86fd", + "sha256:aff76a55a8aa8364d25400a210a65ff59d0168e0b4285ba6bf2bd83cf675ba32", + "sha256:b09b86b27a064c9624d0a6c54da01c1beaf5b6cadfa609cf63789b1d08a797b9", + "sha256:b14f16f94cbc61215115b9b1236f9c18403c15dd3c52cf629072afa9d54c1cbf", + "sha256:b50811d664d392f02f7761621303eba9d1b056fb1868c8cdf4231279645c25f5", + "sha256:b7bc2176354defba3edc2b9a777744462da2f8e921fbaf61e52acb95bafa9828", + "sha256:c78e1b00a87ce43bb37642c0812315b411e856a905d58d597750eb79802aaaa3", + "sha256:c83341b89884e2b2e55886e8fbbf37c3fa5efd6c8907124aeb72f285ae5696e5", + "sha256:ca2870d5d10d8726a27396d3ca4cf7976cec0f3cb706debe88e3a5bd4610f7d2", + "sha256:ccce24b7ad89adb5a1e34a6ba96ac2530046763912806ad4c247356a8f33a67b", + "sha256:cd5e14fbf22a87321b24c88669aad3a51ec052eb145315b3da3b7e3cc105b9a2", + "sha256:ce49c67f4ea0609933d01c0731b34b8695a7a748d6c8d186f95e7d085d2fe475", + "sha256:d33891be6df59d93df4d846640f0e46f1a807339f09e79a8040bc887bdcd7ed3", + "sha256:d3b2348a78bc939b4fed6552abfd2e7988e0f81443ef3911a4b8498ca084f6eb", + "sha256:d886f5d353333b4771d21267c7ecc75b710f1a73d72d03ca06df49b09015a9ef", + "sha256:d93480005693d247f8346bc8ee28c72a2191bdf1f6b5db469c096c0c867ac015", + "sha256:dc1a390a82755a8c26c9964d457d4c9cbec5405896cba94cf51f36ea0d855002", + "sha256:dd78700f5788ae180b5ee8902c6aea5a5726bac7c364b202b4b3e3ba2d293170", + "sha256:e46f38133e5a060d46bd630faa4d9fa0202377495df1f068a8299fd78c84de84", + "sha256:e4b878386c4bf293578b48fc570b84ecfe477d3b77ba39a6e87150af77f40c57", + "sha256:f0d0591a0aeaefdaf9a5e545e7485f89910c977087e7de2b6c388aec32011e9f", + "sha256:fdcbb4068117dfd9ce0138d068ac512843c52295ed996ae6dd1faf537b6dbc27", + "sha256:ff61bfd9253c3915e6d41c651d5f962da23eda633cf02262990094a18a55371a" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==10.3.0" + }, + "pluggy": { + "hashes": [ + "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", + "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746" + ], + "markers": "python_version >= '3.9'", + "version": "==1.6.0" + }, + "pprintpp": { + "hashes": [ + "sha256:b6b4dcdd0c0c0d75e4d7b2f21a9e933e5b2ce62b26e1a54537f9651ae5a5c01d", + "sha256:ea826108e2c7f49dc6d66c752973c3fc9749142a798d6b254e1e301cfdbc6403" + ], + "version": "==0.4.0" + }, + "pytest": { + "hashes": [ + "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002", + "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==7.4.2" + }, + "pytest-asyncio": { + "hashes": [ + "sha256:40a7eae6dded22c7b604986855ea48400ab15b069ae38116e8c01238e9eeb64d", + "sha256:8666c1c8ac02631d7c51ba282e0c69a8a452b211ffedf2599099845da5c5c37b" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.21.1" + }, + "pytest-httpserver": { + "hashes": [ + "sha256:24cd3d9f6a0b927c7bfc400d0b3fda7442721b8267ce29942bf307b190f0bb09", + "sha256:e052f69bc8a9073db02484681e8e47004dd1fb3763b0ae833bd899e5895c559a" + ], + "index": "pypi", + "markers": "python_version >= '3.8' and python_version < '4.0'", + "version": "==1.0.8" + }, + "pytest-icdiff": { + "hashes": [ + "sha256:4f493ae5ee63c8e90e9f96d4b0b2968b19634dfed8a6e3c9848fcd0d6cadcf7b", + "sha256:8fac8667d7042270c23019580b4b5dfd81e1c3e5a9bc9d5df6ac4a49788d42f2" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.8" + }, + "pytest-repeat": { + "hashes": [ + "sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3", + "sha256:d92ac14dfaa6ffcfe6917e5d16f0c9bc82380c135b03c2a5f412d2637f224485" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==0.9.4" + }, + "pytest-rerunfailures": { + "hashes": [ + "sha256:784f462fa87fe9bdf781d0027d856b47a4bfe6c12af108f6bd887057a917b48e", + "sha256:9a1afd04e21b8177faf08a9bbbf44de7a0fe3fc29f8ddbe83b9684bd5f8f92a9" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==12.0" + }, + "pytest-shard": { + "hashes": [ + "sha256:407a1df385cebe1feb9b4d2e7eeee8b044f8a24f0919421233159a17c59be2b9", + "sha256:b86a967fbfd1c8e50295095ccda031b7e890862ee06531d5142844f4c1d1cd67" + ], + "index": "pypi", + "markers": "python_version >= '3.6'", + "version": "==0.1.2" + }, + "pytest-timeout": { + "hashes": [ + "sha256:3b0b95dabf3cb50bac9ef5ca912fa0cfc286526af17afc806824df20c2f72c90", + "sha256:bde531e096466f49398a59f2dde76fa78429a09a12411466f88a07213e220de2" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==2.2.0" + }, + "syrupy": { + "hashes": [ + "sha256:6e01fccb4cd5ad37ce54e8c265cde068fa9c37b7a0946c603c328e8a38a7330d", + "sha256:ea6a237ef374bacebbdb4049f73bf48e3dda76eabd4621a6d104d43077529de6" + ], + "index": "pypi", + "markers": "python_full_version >= '3.8.1' and python_version < '4'", + "version": "==4.5.0" + }, + "typing-extensions": { + "hashes": [ + "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", + "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548" + ], + "markers": "python_version >= '3.9'", + "version": "==4.15.0" + }, + "websockets": { + "hashes": [ + "sha256:01f5567d9cf6f502d655151645d4e8b72b453413d3819d2b6f1185abc23e82dd", + "sha256:03aae4edc0b1c68498f41a6772d80ac7c1e33c06c6ffa2ac1c27a07653e79d6f", + "sha256:0ac56b661e60edd453585f4bd68eb6a29ae25b5184fd5ba51e97652580458998", + "sha256:0ee68fe502f9031f19d495dae2c268830df2760c0524cbac5d759921ba8c8e82", + "sha256:1553cb82942b2a74dd9b15a018dce645d4e68674de2ca31ff13ebc2d9f283788", + "sha256:1a073fc9ab1c8aff37c99f11f1641e16da517770e31a37265d2755282a5d28aa", + "sha256:1d2256283fa4b7f4c7d7d3e84dc2ece74d341bce57d5b9bf385df109c2a1a82f", + "sha256:1d5023a4b6a5b183dc838808087033ec5df77580485fc533e7dab2567851b0a4", + "sha256:1fdf26fa8a6a592f8f9235285b8affa72748dc12e964a5518c6c5e8f916716f7", + "sha256:2529338a6ff0eb0b50c7be33dc3d0e456381157a31eefc561771ee431134a97f", + "sha256:279e5de4671e79a9ac877427f4ac4ce93751b8823f276b681d04b2156713b9dd", + "sha256:2d903ad4419f5b472de90cd2d40384573b25da71e33519a67797de17ef849b69", + "sha256:332d126167ddddec94597c2365537baf9ff62dfcc9db4266f263d455f2f031cb", + "sha256:34fd59a4ac42dff6d4681d8843217137f6bc85ed29722f2f7222bd619d15e95b", + "sha256:3580dd9c1ad0701169e4d6fc41e878ffe05e6bdcaf3c412f9d559389d0c9e016", + "sha256:3ccc8a0c387629aec40f2fc9fdcb4b9d5431954f934da3eaf16cdc94f67dbfac", + "sha256:41f696ba95cd92dc047e46b41b26dd24518384749ed0d99bea0a941ca87404c4", + "sha256:42cc5452a54a8e46a032521d7365da775823e21bfba2895fb7b77633cce031bb", + "sha256:4841ed00f1026dfbced6fca7d963c4e7043aa832648671b5138008dc5a8f6d99", + "sha256:4b253869ea05a5a073ebfdcb5cb3b0266a57c3764cf6fe114e4cd90f4bfa5f5e", + "sha256:54c6e5b3d3a8936a4ab6870d46bdd6ec500ad62bde9e44462c32d18f1e9a8e54", + "sha256:619d9f06372b3a42bc29d0cd0354c9bb9fb39c2cbc1a9c5025b4538738dbffaf", + "sha256:6505c1b31274723ccaf5f515c1824a4ad2f0d191cec942666b3d0f3aa4cb4007", + "sha256:660e2d9068d2bedc0912af508f30bbeb505bbbf9774d98def45f68278cea20d3", + "sha256:6681ba9e7f8f3b19440921e99efbb40fc89f26cd71bf539e45d8c8a25c976dc6", + "sha256:68b977f21ce443d6d378dbd5ca38621755f2063d6fdb3335bda981d552cfff86", + "sha256:69269f3a0b472e91125b503d3c0b3566bda26da0a3261c49f0027eb6075086d1", + "sha256:6f1a3f10f836fab6ca6efa97bb952300b20ae56b409414ca85bff2ad241d2a61", + "sha256:7622a89d696fc87af8e8d280d9b421db5133ef5b29d3f7a1ce9f1a7bf7fcfa11", + "sha256:777354ee16f02f643a4c7f2b3eff8027a33c9861edc691a2003531f5da4f6bc8", + "sha256:84d27a4832cc1a0ee07cdcf2b0629a8a72db73f4cf6de6f0904f6661227f256f", + "sha256:8531fdcad636d82c517b26a448dcfe62f720e1922b33c81ce695d0edb91eb931", + "sha256:86d2a77fd490ae3ff6fae1c6ceaecad063d3cc2320b44377efdde79880e11526", + "sha256:88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016", + "sha256:8a34e13a62a59c871064dfd8ffb150867e54291e46d4a7cf11d02c94a5275bae", + "sha256:8c82f11964f010053e13daafdc7154ce7385ecc538989a354ccc7067fd7028fd", + "sha256:92b2065d642bf8c0a82d59e59053dd2fdde64d4ed44efe4870fa816c1232647b", + "sha256:97b52894d948d2f6ea480171a27122d77af14ced35f62e5c892ca2fae9344311", + "sha256:9d9acd80072abcc98bd2c86c3c9cd4ac2347b5a5a0cae7ed5c0ee5675f86d9af", + "sha256:9f59a3c656fef341a99e3d63189852be7084c0e54b75734cde571182c087b152", + "sha256:aa5003845cdd21ac0dc6c9bf661c5beddd01116f6eb9eb3c8e272353d45b3288", + "sha256:b16fff62b45eccb9c7abb18e60e7e446998093cdcb50fed33134b9b6878836de", + "sha256:b30c6590146e53149f04e85a6e4fcae068df4289e31e4aee1fdf56a0dead8f97", + "sha256:b58cbf0697721120866820b89f93659abc31c1e876bf20d0b3d03cef14faf84d", + "sha256:b67c6f5e5a401fc56394f191f00f9b3811fe843ee93f4a70df3c389d1adf857d", + "sha256:bceab846bac555aff6427d060f2fcfff71042dba6f5fca7dc4f75cac815e57ca", + "sha256:bee9fcb41db2a23bed96c6b6ead6489702c12334ea20a297aa095ce6d31370d0", + "sha256:c114e8da9b475739dde229fd3bc6b05a6537a88a578358bc8eb29b4030fac9c9", + "sha256:c1f0524f203e3bd35149f12157438f406eff2e4fb30f71221c8a5eceb3617b6b", + "sha256:c792ea4eabc0159535608fc5658a74d1a81020eb35195dd63214dcf07556f67e", + "sha256:c7f3cb904cce8e1be667c7e6fef4516b98d1a6a0635a58a57528d577ac18a128", + "sha256:d67ac60a307f760c6e65dad586f556dde58e683fab03323221a4e530ead6f74d", + "sha256:dcacf2c7a6c3a84e720d1bb2b543c675bf6c40e460300b628bab1b1efc7c034c", + "sha256:de36fe9c02995c7e6ae6efe2e205816f5f00c22fd1fbf343d4d18c3d5ceac2f5", + "sha256:def07915168ac8f7853812cc593c71185a16216e9e4fa886358a17ed0fd9fcf6", + "sha256:df41b9bc27c2c25b486bae7cf42fccdc52ff181c8c387bfd026624a491c2671b", + "sha256:e052b8467dd07d4943936009f46ae5ce7b908ddcac3fda581656b1b19c083d9b", + "sha256:e063b1865974611313a3849d43f2c3f5368093691349cf3c7c8f8f75ad7cb280", + "sha256:e1459677e5d12be8bbc7584c35b992eea142911a6236a3278b9b5ce3326f282c", + "sha256:e1a99a7a71631f0efe727c10edfba09ea6bee4166a6f9c19aafb6c0b5917d09c", + "sha256:e590228200fcfc7e9109509e4d9125eace2042fd52b595dd22bbc34bb282307f", + "sha256:e6316827e3e79b7b8e7d8e3b08f4e331af91a48e794d5d8b099928b6f0b85f20", + "sha256:e7837cb169eca3b3ae94cc5787c4fed99eef74c0ab9506756eea335e0d6f3ed8", + "sha256:e848f46a58b9fcf3d06061d17be388caf70ea5b8cc3466251963c8345e13f7eb", + "sha256:ed058398f55163a79bb9f06a90ef9ccc063b204bb346c4de78efc5d15abfe602", + "sha256:f2e58f2c36cc52d41f2659e4c0cbf7353e28c8c9e63e30d8c6d3494dc9fdedcf", + "sha256:f467ba0050b7de85016b43f5a22b46383ef004c4f672148a8abf32bc999a87f0", + "sha256:f61bdb1df43dc9c131791fbc2355535f9024b9a04398d3bd0684fc16ab07df74", + "sha256:fb06eea71a00a7af0ae6aefbb932fb8a7df3cb390cc217d51a9ad7343de1b8d0", + "sha256:ffd7dcaf744f25f82190856bc26ed81721508fc5cbf2a330751e135ff1283564" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==11.0.3" + }, + "werkzeug": { + "hashes": [ + "sha256:54b78bf3716d19a65be4fceccc0d1d7b89e608834989dfae50ea87564639213e", + "sha256:60723ce945c19328679790e3282cc758aa4a6040e4bb330f53d30fa546d44746" + ], + "markers": "python_version >= '3.9'", + "version": "==3.1.3" + } + }, + "develop": { + "execnet": { + "hashes": [ + "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", + "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3" + ], + "markers": "python_version >= '3.8'", + "version": "==2.1.1" + }, + "iniconfig": { + "hashes": [ + "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", + "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760" + ], + "markers": "python_version >= '3.8'", + "version": "==2.1.0" + }, + "packaging": { + "hashes": [ + "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", + "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f" + ], + "markers": "python_version >= '3.8'", + "version": "==25.0" + }, + "pluggy": { + "hashes": [ + "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", + "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746" + ], + "markers": "python_version >= '3.9'", + "version": "==1.6.0" + }, + "pyflakes": { + "hashes": [ + "sha256:b24f96fafb7d2ab0ec5075b7350b3d2d2218eab42003821c06344973d3ea2f58", + "sha256:f742a7dbd0d9cb9ea41e9a24a918996e8170c799fa528688d40dd582c8265f4f" + ], + "markers": "python_version >= '3.9'", + "version": "==3.4.0" + }, + "pytest": { + "hashes": [ + "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002", + "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==7.4.2" + }, + "pytest-flakefinder": { + "hashes": [ + "sha256:741e0e8eea427052f5b8c89c2b3c3019a50c39a59ce4df6a305a2c2d9ba2bd13", + "sha256:e2412a1920bdb8e7908783b20b3d57e9dad590cc39a93e8596ffdd493b403e0e" + ], + "index": "pypi", + "markers": "python_version >= '3.5'", + "version": "==1.1.0" + }, + "pytest-flakes": { + "hashes": [ + "sha256:953134e97215ae31f6879fbd7368c18d43f709dc2fab5b7777db2bb2bac3a924", + "sha256:d0e8602d882744fc6169247b62a51203c5a3d8f160892ff3b82f5b9c1e4bb675" + ], + "index": "pypi", + "markers": "python_version >= '3.5'", + "version": "==4.0.5" + }, + "pytest-instafail": { + "hashes": [ + "sha256:33a606f7e0c8e646dc3bfee0d5e3a4b7b78ef7c36168cfa1f3d93af7ca706c9e", + "sha256:6855414487e9e4bb76a118ce952c3c27d3866af15487506c4ded92eb72387819" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.5.0" + }, + "pytest-randomly": { + "hashes": [ + "sha256:11bf4d23a26484de7860d82f726c0629837cf4064b79157bd18ec9d41d7feb26", + "sha256:8633d332635a1a0983d3bba19342196807f6afb17c3eef78e02c2f85dade45d6" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==3.16.0" + }, + "pytest-xdist": { + "hashes": [ + "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", + "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==3.8.0" + } } - } } diff --git a/src/bidiMapper/CommandProcessor.ts b/src/bidiMapper/CommandProcessor.ts index a15879066b..9d08d46471 100644 --- a/src/bidiMapper/CommandProcessor.ts +++ b/src/bidiMapper/CommandProcessor.ts @@ -107,7 +107,7 @@ export class CommandProcessor extends EventEmitter { this.#logger = logger; this.#bluetoothProcessor = bluetoothProcessor; - this.#autofillProcessor = new AutofillProcessor(browserCdpClient); + this.#autofillProcessor = new AutofillProcessor(browsingContextStorage); // keep-sorted start block=yes this.#browserProcessor = new BrowserProcessor( diff --git a/src/bidiMapper/modules/autofill/AutofillProcessor.ts b/src/bidiMapper/modules/autofill/AutofillProcessor.ts index b07a015328..077cf2150f 100644 --- a/src/bidiMapper/modules/autofill/AutofillProcessor.ts +++ b/src/bidiMapper/modules/autofill/AutofillProcessor.ts @@ -19,17 +19,20 @@ import type {CdpClient} from '../../../cdp/CdpClient.js'; import { type Autofill, type EmptyResult, + NoSuchNodeException, UnsupportedOperationException, } from '../../../protocol/protocol.js'; +import type {BrowsingContextStorage} from '../context/BrowsingContextStorage.js'; +import {parseSharedId} from '../script/SharedId.js'; /** * Responsible for handling the `autofill` module. */ export class AutofillProcessor { - readonly #browserCdpClient: CdpClient; + readonly #browsingContextStorage: BrowsingContextStorage; - constructor(browserCdpClient: CdpClient) { - this.#browserCdpClient = browserCdpClient; + constructor(browsingContextStorage: BrowsingContextStorage) { + this.#browsingContextStorage = browsingContextStorage; } /** @@ -40,14 +43,54 @@ export class AutofillProcessor { */ async trigger(params: Autofill.TriggerParameters): Promise { try { + // Get the browsing context from the parameters + const context = this.#browsingContextStorage.getContext(params.context); + + // Parse the shared ID to get frame, document, and backend node ID + const parsedSharedId = parseSharedId(params.element.sharedId); + if (parsedSharedId === null) { + throw new NoSuchNodeException( + `SharedId "${params.element.sharedId}" was not found.`, + ); + } + + const {frameId, documentId, backendNodeId} = parsedSharedId; + + // Assert that the frame matches the current context (if frameId is available) + if (frameId !== undefined && frameId !== params.context) { + throw new NoSuchNodeException( + `SharedId "${params.element.sharedId}" belongs to different frame. Current frame is ${params.context}.`, + ); + } + + // Assert that the document matches the current context's navigable ID + if (context.navigableId !== documentId) { + throw new NoSuchNodeException( + `SharedId "${params.element.sharedId}" belongs to different document. Current document is ${context.navigableId}.`, + ); + } + // Cast to `any` as a temporary workaround for prototyping, since the TypeScript types // for CDP in "Chromium BiDi" aren't automatically updated with local changes. - await (this.#browserCdpClient as any).sendCommand('Autofill.trigger', { - fieldId: Number(params.element.sharedId), - frameId: undefined, - card: params.card, - address: params.address, + + // Based on the Autofill.pdl definition, call the correct CDP method + // The PDL shows: command trigger with fieldId as DOM.BackendNodeId + + // First, we need to enable the Autofill domain + try { + await context.cdpTarget.cdpClient.sendCommand('Autofill.enable'); + } catch (enableErr) { + console.log('Failed to enable Autofill domain:', (enableErr as Error).message); + } + + // Call the trigger method with the correct parameters from PDL + await (context.cdpTarget.cdpClient as any).sendCommand('Autofill.trigger', { + fieldId: backendNodeId, // DOM.BackendNodeId from parsed shared ID + frameId: frameId, // Page.FrameId from parsed shared ID + card: params.card, // optional CreditCard + address: params.address, // optional Address }); + return {}; } catch (err) { if ((err as Error).message.includes('command was not found')) { diff --git a/tests/autofill/__init__.py b/tests/autofill/__init__.py new file mode 100644 index 0000000000..7370cf3cd2 --- /dev/null +++ b/tests/autofill/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2025 Google LLC. +# Copyright (c) Microsoft Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/autofill/test_autofill_trigger.py b/tests/autofill/test_autofill_trigger.py new file mode 100644 index 0000000000..d6d4267a59 --- /dev/null +++ b/tests/autofill/test_autofill_trigger.py @@ -0,0 +1,384 @@ +# Copyright 2025 Google LLC. +# Copyright (c) Microsoft Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pytest +from test_helpers import execute_command, goto_url + + +async def verify_field_value(websocket, context_id, field_id, expected_value): + """Helper function to verify that a form field has the expected value.""" + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': f'document.getElementById("{field_id}").value', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + assert resp['result']['value'] == expected_value, f"Field '{field_id}' expected '{expected_value}' but got '{resp['result']['value']}'" + + +@pytest.mark.asyncio +async def test_autofill_trigger_with_card(websocket, context_id, html): + """Test autofill.trigger command with credit card data.""" + # Create a simple form with credit card fields + await goto_url( + websocket, context_id, + html(''' +
+ + + + + +
+ ''') + ) + + # Get a reference to the card number input field + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': 'document.getElementById("cardNumber")', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + + element_shared_id = resp['result']['sharedId'] + + # Execute autofill.trigger with card data + card_data = { + 'number': '4111111111111111', + 'name': 'John Doe', + 'expiryMonth': '12', + 'expiryYear': '2025', + 'cvc': '123' + } + + resp = await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': element_shared_id + }, + 'card': card_data + } + }) + + # The command should return an empty result + assert resp == {} + + # Verify that the form fields were actually filled with the card data + await verify_field_value(websocket, context_id, "cardNumber", "4111111111111111") + await verify_field_value(websocket, context_id, "cardName", "John Doe") + await verify_field_value(websocket, context_id, "expiryMonth", "12") + await verify_field_value(websocket, context_id, "expiryYear", "2025") + await verify_field_value(websocket, context_id, "cvc", "123") + + +@pytest.mark.asyncio +async def test_autofill_trigger_with_address(websocket, context_id, html): + """Test autofill.trigger command with address data.""" + # Create a simple form with address fields + await goto_url( + websocket, context_id, + html(''' +
+ + + + + + +
+ ''') + ) + + # Get a reference to the first name input field + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': 'document.getElementById("firstName")', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + + element_shared_id = resp['result']['sharedId'] + + # Execute autofill.trigger with address data + address_data = { + 'fields': [ + {'name': 'NAME_FIRST', 'value': 'Jane'}, + {'name': 'NAME_LAST', 'value': 'Smith'}, + {'name': 'ADDRESS_HOME_LINE1', 'value': '123 Main St'}, + {'name': 'ADDRESS_HOME_CITY', 'value': 'Anytown'}, + {'name': 'ADDRESS_HOME_STATE', 'value': 'CA'}, + {'name': 'ADDRESS_HOME_ZIP', 'value': '12345'} + ] + } + + resp = await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': element_shared_id + }, + 'address': address_data + } + }) + + # The command should return an empty result + assert resp == {} + + # Verify that the address form fields were actually filled + await verify_field_value(websocket, context_id, "firstName", "Jane") + await verify_field_value(websocket, context_id, "lastName", "Smith") + await verify_field_value(websocket, context_id, "street", "123 Main St") + await verify_field_value(websocket, context_id, "city", "Anytown") + await verify_field_value(websocket, context_id, "state", "CA") + await verify_field_value(websocket, context_id, "zipCode", "12345") + + +@pytest.mark.asyncio +async def test_autofill_trigger_with_both_card_and_address(websocket, context_id, html): + """Test autofill.trigger command with both card and address data.""" + # Create a comprehensive form + await goto_url( + websocket, context_id, + html(''' +
+ + + + + + + + + + + + + + +
+ ''') + ) + + # Get a reference to the card number input field + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': 'document.getElementById("cardNumber")', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + + element_shared_id = resp['result']['sharedId'] + + # Execute autofill.trigger with both card and address data + card_data = { + 'number': '4111111111111111', + 'name': 'John Doe', + 'expiryMonth': '12', + 'expiryYear': '2025', + 'cvc': '123' + } + + address_data = { + 'fields': [ + {'name': 'firstName', 'value': 'John'}, + {'name': 'lastName', 'value': 'Doe'}, + {'name': 'street', 'value': '456 Oak Ave'}, + {'name': 'city', 'value': 'Springfield'}, + {'name': 'state', 'value': 'IL'}, + {'name': 'zipCode', 'value': '62701'} + ] + } + + # The command should fail with an error about unsupported field type + with pytest.raises(Exception) as exc_info: + await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': element_shared_id + }, + 'card': card_data, + 'address': address_data + } + }) + + # Verify that the error is about unsupported field type + error = exc_info.value.args[0] + assert error['error'] == 'unknown error' + assert 'Card and address cannot both be provided' in error['message'] + +@pytest.mark.asyncio +async def test_autofill_trigger_no_card_or_address(websocket, context_id, html): + """Test autofill.trigger command with minimal parameters (no card or address data).""" + # Create a simple input field + await goto_url( + websocket, context_id, + html('') + ) + + # Get a reference to the input field + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': 'document.getElementById("testField")', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + + element_shared_id = resp['result']['sharedId'] + + with pytest.raises(Exception) as exc_info: + await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': element_shared_id + }, + } + }) + + # Verify that the error is about unsupported field type + error = exc_info.value.args[0] + assert error['error'] == 'unknown error' + assert 'Either card or address must be provided' in error['message'] + + +@pytest.mark.asyncio +async def test_autofill_trigger_invalid_element(websocket, context_id, html): + """Test autofill.trigger command with invalid element reference.""" + # Create a simple page + await goto_url(websocket, context_id, html('
Test page
')) + + # Try to execute autofill.trigger with an invalid shared ID + with pytest.raises(Exception) as exc_info: + await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': 'invalid-shared-id' + }, + 'card': { + 'number': '4111111111111111', + 'name': 'Test User', + 'expiryMonth': '12', + 'expiryYear': '2025', + 'cvc': '123' + } + } + }) + error = exc_info.value.args[0] + assert error['error'] == 'no such node' + assert 'SharedId "invalid-shared-id" was not found' in error['message'] + + +@pytest.mark.asyncio +async def test_autofill_trigger_unknown_field_type_error(websocket, context_id, html): + """Test that autofill.trigger command fails with unknown field types.""" + # Create a form with various field types + await goto_url( + websocket, context_id, + html(''' +
+ + + + + +
+ ''') + ) + + # Test with email field + resp = await execute_command( + websocket, { + 'method': 'script.evaluate', + 'params': { + 'expression': 'document.getElementById("email")', + 'target': { + 'context': context_id + }, + 'awaitPromise': False + } + }) + + element_shared_id = resp['result']['sharedId'] + + address_data = { + 'fields': [ + {'name': 'EMAIL_ADDRESS', 'value': 'test@example.com'}, + {'name': 'COMPANY_NAME', 'value': 'Test Company'}, + {'name': 'ADDRESS_HOME_COUNTRY', 'value': 'US'}, + {'name': 'UNKNOWN_TYPE', 'value': 'This is a test note'} + ] + } + + # The command should fail with an error about unsupported field type + with pytest.raises(Exception) as exc_info: + await execute_command( + websocket, { + 'method': 'autofill.trigger', + 'params': { + 'context': context_id, + 'element': { + 'sharedId': element_shared_id + }, + 'address': address_data + } + }) + + # Verify that the error is about unsupported field type + error = exc_info.value.args[0] + assert error['error'] == 'unknown error' + assert 'Unsupported field type' in error['message']