Add Brave CDP automation, replace Oracle browser mode

Connects to user's running Brave via Chrome DevTools Protocol
to automate ChatGPT interaction. Uses puppeteer-core to open a
tab, send the prompt, wait for response, and extract the result.

No cookies, no separate profiles, no copy/paste. Just connects
to the browser where the user is already logged in.

One-time setup: relaunch Brave with --remote-debugging-port=9222

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-07 16:16:41 -05:00
parent d776a266a8
commit e7882b917b
4163 changed files with 782828 additions and 148 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,354 @@
"use strict";
/**
* Copyright 2024 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BluetoothEventSchema = exports.BluetoothCommandSchema = exports.Bluetooth = void 0;
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck Some types may be circular.
const zod_1 = __importDefault(require("zod"));
var Bluetooth;
(function (Bluetooth) {
Bluetooth.BluetoothUuidSchema = zod_1.default.lazy(() => zod_1.default.string());
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.BluetoothManufacturerDataSchema = zod_1.default.lazy(() => zod_1.default.object({
key: zod_1.default.number().int().nonnegative(),
data: zod_1.default.string(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.CharacteristicPropertiesSchema = zod_1.default.lazy(() => zod_1.default.object({
broadcast: zod_1.default.boolean().optional(),
read: zod_1.default.boolean().optional(),
writeWithoutResponse: zod_1.default.boolean().optional(),
write: zod_1.default.boolean().optional(),
notify: zod_1.default.boolean().optional(),
indicate: zod_1.default.boolean().optional(),
authenticatedSignedWrites: zod_1.default.boolean().optional(),
extendedProperties: zod_1.default.boolean().optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.RequestDeviceSchema = zod_1.default.lazy(() => zod_1.default.string());
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.RequestDeviceInfoSchema = zod_1.default.lazy(() => zod_1.default.object({
id: Bluetooth.RequestDeviceSchema,
name: zod_1.default.union([zod_1.default.string(), zod_1.default.null()]),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.RequestDevicePromptSchema = zod_1.default.lazy(() => zod_1.default.string());
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.ScanRecordSchema = zod_1.default.lazy(() => zod_1.default.object({
name: zod_1.default.string().optional(),
uuids: zod_1.default.array(Bluetooth.BluetoothUuidSchema).optional(),
appearance: zod_1.default.number().optional(),
manufacturerData: zod_1.default
.array(Bluetooth.BluetoothManufacturerDataSchema)
.optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
exports.BluetoothCommandSchema = zod_1.default.lazy(() => zod_1.default.union([
Bluetooth.HandleRequestDevicePromptSchema,
Bluetooth.SimulateAdapterSchema,
Bluetooth.DisableSimulationSchema,
Bluetooth.SimulatePreconnectedPeripheralSchema,
Bluetooth.SimulateAdvertisementSchema,
Bluetooth.SimulateGattConnectionResponseSchema,
Bluetooth.SimulateGattDisconnectionSchema,
Bluetooth.SimulateServiceSchema,
Bluetooth.SimulateCharacteristicSchema,
Bluetooth.SimulateCharacteristicResponseSchema,
Bluetooth.SimulateDescriptorSchema,
Bluetooth.SimulateDescriptorResponseSchema,
]));
(function (Bluetooth) {
Bluetooth.HandleRequestDevicePromptSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.handleRequestDevicePrompt'),
params: Bluetooth.HandleRequestDevicePromptParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.HandleRequestDevicePromptParametersSchema = zod_1.default.lazy(() => zod_1.default
.object({
context: zod_1.default.string(),
prompt: Bluetooth.RequestDevicePromptSchema,
})
.and(zod_1.default.union([
Bluetooth.HandleRequestDevicePromptAcceptParametersSchema,
Bluetooth.HandleRequestDevicePromptCancelParametersSchema,
])));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.HandleRequestDevicePromptAcceptParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
accept: zod_1.default.literal(true),
device: Bluetooth.RequestDeviceSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.HandleRequestDevicePromptCancelParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
accept: zod_1.default.literal(false),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateAdapterSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateAdapter'),
params: Bluetooth.SimulateAdapterParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateAdapterParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
leSupported: zod_1.default.boolean().optional(),
state: zod_1.default.enum(['absent', 'powered-off', 'powered-on']),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.DisableSimulationSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.disableSimulation'),
params: Bluetooth.DisableSimulationParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.DisableSimulationParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulatePreconnectedPeripheralSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulatePreconnectedPeripheral'),
params: Bluetooth.SimulatePreconnectedPeripheralParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulatePreconnectedPeripheralParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
name: zod_1.default.string(),
manufacturerData: zod_1.default.array(Bluetooth.BluetoothManufacturerDataSchema),
knownServiceUuids: zod_1.default.array(Bluetooth.BluetoothUuidSchema),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateAdvertisementSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateAdvertisement'),
params: Bluetooth.SimulateAdvertisementParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateAdvertisementParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
scanEntry: Bluetooth.SimulateAdvertisementScanEntryParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateAdvertisementScanEntryParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
deviceAddress: zod_1.default.string(),
rssi: zod_1.default.number(),
scanRecord: Bluetooth.ScanRecordSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateGattConnectionResponseSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateGattConnectionResponse'),
params: Bluetooth.SimulateGattConnectionResponseParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateGattConnectionResponseParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
code: zod_1.default.number().int().nonnegative(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateGattDisconnectionSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateGattDisconnection'),
params: Bluetooth.SimulateGattDisconnectionParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateGattDisconnectionParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateServiceSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateService'),
params: Bluetooth.SimulateServiceParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateServiceParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
uuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum(['add', 'remove']),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateCharacteristicSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateCharacteristic'),
params: Bluetooth.SimulateCharacteristicParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateCharacteristicParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
characteristicProperties: Bluetooth.CharacteristicPropertiesSchema.optional(),
type: zod_1.default.enum(['add', 'remove']),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateCharacteristicResponseSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateCharacteristicResponse'),
params: Bluetooth.SimulateCharacteristicResponseParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateCharacteristicResponseParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum([
'read',
'write',
'subscribe-to-notifications',
'unsubscribe-from-notifications',
]),
code: zod_1.default.number().int().nonnegative(),
data: zod_1.default.array(zod_1.default.number().int().nonnegative()).optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateDescriptorSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateDescriptor'),
params: Bluetooth.SimulateDescriptorParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateDescriptorParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
descriptorUuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum(['add', 'remove']),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateDescriptorResponseSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.simulateDescriptorResponse'),
params: Bluetooth.SimulateDescriptorResponseParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.SimulateDescriptorResponseParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
descriptorUuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum(['read', 'write']),
code: zod_1.default.number().int().nonnegative(),
data: zod_1.default.array(zod_1.default.number().int().nonnegative()).optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
exports.BluetoothEventSchema = zod_1.default.lazy(() => zod_1.default.union([
Bluetooth.RequestDevicePromptUpdatedSchema,
Bluetooth.GattConnectionAttemptedSchema,
]));
(function (Bluetooth) {
Bluetooth.RequestDevicePromptUpdatedSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.requestDevicePromptUpdated'),
params: Bluetooth.RequestDevicePromptUpdatedParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.RequestDevicePromptUpdatedParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
prompt: Bluetooth.RequestDevicePromptSchema,
devices: zod_1.default.array(Bluetooth.RequestDeviceInfoSchema),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.GattConnectionAttemptedSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.gattConnectionAttempted'),
params: Bluetooth.GattConnectionAttemptedParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.GattConnectionAttemptedParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.CharacteristicEventGeneratedSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.characteristicEventGenerated'),
params: Bluetooth.CharacteristicEventGeneratedParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.CharacteristicEventGeneratedParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum([
'read',
'write-with-response',
'write-without-response',
'subscribe-to-notifications',
'unsubscribe-from-notifications',
]),
data: zod_1.default.array(zod_1.default.number().int().nonnegative()).optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.DescriptorEventGeneratedSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('bluetooth.descriptorEventGenerated'),
params: Bluetooth.DescriptorEventGeneratedParametersSchema,
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
(function (Bluetooth) {
Bluetooth.DescriptorEventGeneratedParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
address: zod_1.default.string(),
serviceUuid: Bluetooth.BluetoothUuidSchema,
characteristicUuid: Bluetooth.BluetoothUuidSchema,
descriptorUuid: Bluetooth.BluetoothUuidSchema,
type: zod_1.default.enum(['read', 'write']),
data: zod_1.default.array(zod_1.default.number().int().nonnegative()).optional(),
}));
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
//# sourceMappingURL=webdriver-bidi-bluetooth.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,102 @@
/**
* Copyright 2024 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.
*/
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
import z from 'zod';
export declare namespace Speculation {
const PreloadingStatusSchema: z.ZodLazy<z.ZodEnum<["pending", "ready", "success", "failure"]>>;
}
export declare const SpeculationEventSchema: z.ZodLazy<z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"speculation.prefetchStatusUpdated">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodString;
url: z.ZodString;
status: z.ZodLazy<z.ZodEnum<["pending", "ready", "success", "failure"]>>;
}, "strip", z.ZodTypeAny, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
};
method: "speculation.prefetchStatusUpdated";
}, {
params: {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
};
method: "speculation.prefetchStatusUpdated";
}>>>;
export declare namespace Speculation {
const PrefetchStatusUpdatedSchema: z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"speculation.prefetchStatusUpdated">;
params: z.ZodLazy<z.ZodObject<{
context: z.ZodString;
url: z.ZodString;
status: z.ZodLazy<z.ZodEnum<["pending", "ready", "success", "failure"]>>;
}, "strip", z.ZodTypeAny, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
};
method: "speculation.prefetchStatusUpdated";
}, {
params: {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
};
method: "speculation.prefetchStatusUpdated";
}>>;
}
export declare namespace Speculation {
const PrefetchStatusUpdatedParametersSchema: z.ZodLazy<z.ZodObject<{
context: z.ZodString;
url: z.ZodString;
status: z.ZodLazy<z.ZodEnum<["pending", "ready", "success", "failure"]>>;
}, "strip", z.ZodTypeAny, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}, {
url: string;
status: "success" | "pending" | "ready" | "failure";
context: string;
}>>;
}

View File

@@ -0,0 +1,49 @@
"use strict";
/**
* Copyright 2024 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpeculationEventSchema = exports.Speculation = void 0;
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck Some types may be circular.
const zod_1 = __importDefault(require("zod"));
var Speculation;
(function (Speculation) {
Speculation.PreloadingStatusSchema = zod_1.default.lazy(() => zod_1.default.enum(['pending', 'ready', 'success', 'failure']));
})(Speculation || (exports.Speculation = Speculation = {}));
exports.SpeculationEventSchema = zod_1.default.lazy(() => Speculation.PrefetchStatusUpdatedSchema);
(function (Speculation) {
Speculation.PrefetchStatusUpdatedSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('speculation.prefetchStatusUpdated'),
params: Speculation.PrefetchStatusUpdatedParametersSchema,
}));
})(Speculation || (exports.Speculation = Speculation = {}));
(function (Speculation) {
Speculation.PrefetchStatusUpdatedParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
context: zod_1.default.string(),
url: zod_1.default.string(),
status: Speculation.PreloadingStatusSchema,
}));
})(Speculation || (exports.Speculation = Speculation = {}));
//# sourceMappingURL=webdriver-bidi-nav-speculation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"webdriver-bidi-nav-speculation.js","sourceRoot":"","sources":["../../../../src/protocol-parser/generated/webdriver-bidi-nav-speculation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;AAEH;;;;GAIG;AAEH,6DAA6D;AAC7D,0CAA0C;AAE1C,8CAAoB;AAEpB,IAAiB,WAAW,CAI3B;AAJD,WAAiB,WAAW;IACb,kCAAsB,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAChD,aAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CACnD,CAAC;AACJ,CAAC,EAJgB,WAAW,2BAAX,WAAW,QAI3B;AACY,QAAA,sBAAsB,GAAG,aAAC,CAAC,IAAI,CAC1C,GAAG,EAAE,CAAC,WAAW,CAAC,2BAA2B,CAC9C,CAAC;AACF,WAAiB,WAAW;IACb,uCAA2B,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACrD,aAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,aAAC,CAAC,OAAO,CAAC,mCAAmC,CAAC;QACtD,MAAM,EAAE,WAAW,CAAC,qCAAqC;KAC1D,CAAC,CACH,CAAC;AACJ,CAAC,EAPgB,WAAW,2BAAX,WAAW,QAO3B;AACD,WAAiB,WAAW;IACb,iDAAqC,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC/D,aAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;QACnB,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE;QACf,MAAM,EAAE,WAAW,CAAC,sBAAsB;KAC3C,CAAC,CACH,CAAC;AACJ,CAAC,EARgB,WAAW,2BAAX,WAAW,QAQ3B"}

View File

@@ -0,0 +1,175 @@
/**
* Copyright 2024 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.
*/
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
import z from 'zod';
export declare const PermissionsCommandSchema: z.ZodLazy<z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"permissions.setPermission">;
params: z.ZodLazy<z.ZodObject<{
descriptor: z.ZodLazy<z.ZodObject<{
name: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
}, {
name: string;
}>>;
state: z.ZodLazy<z.ZodEnum<["granted", "denied", "prompt"]>>;
origin: z.ZodString;
embeddedOrigin: z.ZodOptional<z.ZodString>;
userContext: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
};
method: "permissions.setPermission";
}, {
params: {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
};
method: "permissions.setPermission";
}>>>;
export declare namespace Permissions {
const PermissionDescriptorSchema: z.ZodLazy<z.ZodObject<{
name: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
}, {
name: string;
}>>;
}
export declare namespace Permissions {
const PermissionStateSchema: z.ZodLazy<z.ZodEnum<["granted", "denied", "prompt"]>>;
}
export declare namespace Permissions {
const SetPermissionSchema: z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"permissions.setPermission">;
params: z.ZodLazy<z.ZodObject<{
descriptor: z.ZodLazy<z.ZodObject<{
name: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
}, {
name: string;
}>>;
state: z.ZodLazy<z.ZodEnum<["granted", "denied", "prompt"]>>;
origin: z.ZodString;
embeddedOrigin: z.ZodOptional<z.ZodString>;
userContext: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
params: {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
};
method: "permissions.setPermission";
}, {
params: {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
};
method: "permissions.setPermission";
}>>;
}
export declare namespace Permissions {
const SetPermissionParametersSchema: z.ZodLazy<z.ZodObject<{
descriptor: z.ZodLazy<z.ZodObject<{
name: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
}, {
name: string;
}>>;
state: z.ZodLazy<z.ZodEnum<["granted", "denied", "prompt"]>>;
origin: z.ZodString;
embeddedOrigin: z.ZodOptional<z.ZodString>;
userContext: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}, {
origin: string;
state: "granted" | "denied" | "prompt";
descriptor: {
name: string;
};
userContext?: string | undefined;
embeddedOrigin?: string | undefined;
}>>;
}

View File

@@ -0,0 +1,56 @@
"use strict";
/**
* Copyright 2024 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Permissions = exports.PermissionsCommandSchema = void 0;
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck Some types may be circular.
const zod_1 = __importDefault(require("zod"));
exports.PermissionsCommandSchema = zod_1.default.lazy(() => Permissions.SetPermissionSchema);
var Permissions;
(function (Permissions) {
Permissions.PermissionDescriptorSchema = zod_1.default.lazy(() => zod_1.default.object({
name: zod_1.default.string(),
}));
})(Permissions || (exports.Permissions = Permissions = {}));
(function (Permissions) {
Permissions.PermissionStateSchema = zod_1.default.lazy(() => zod_1.default.enum(['granted', 'denied', 'prompt']));
})(Permissions || (exports.Permissions = Permissions = {}));
(function (Permissions) {
Permissions.SetPermissionSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('permissions.setPermission'),
params: Permissions.SetPermissionParametersSchema,
}));
})(Permissions || (exports.Permissions = Permissions = {}));
(function (Permissions) {
Permissions.SetPermissionParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
descriptor: Permissions.PermissionDescriptorSchema,
state: Permissions.PermissionStateSchema,
origin: zod_1.default.string(),
embeddedOrigin: zod_1.default.string().optional(),
userContext: zod_1.default.string().optional(),
}));
})(Permissions || (exports.Permissions = Permissions = {}));
//# sourceMappingURL=webdriver-bidi-permissions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"webdriver-bidi-permissions.js","sourceRoot":"","sources":["../../../../src/protocol-parser/generated/webdriver-bidi-permissions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;AAEH;;;;GAIG;AAEH,6DAA6D;AAC7D,0CAA0C;AAE1C,8CAAoB;AAEP,QAAA,wBAAwB,GAAG,aAAC,CAAC,IAAI,CAC5C,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,CACtC,CAAC;AACF,IAAiB,WAAW,CAM3B;AAND,WAAiB,WAAW;IACb,sCAA0B,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACpD,aAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;KACjB,CAAC,CACH,CAAC;AACJ,CAAC,EANgB,WAAW,2BAAX,WAAW,QAM3B;AACD,WAAiB,WAAW;IACb,iCAAqB,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC/C,aAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CACxC,CAAC;AACJ,CAAC,EAJgB,WAAW,2BAAX,WAAW,QAI3B;AACD,WAAiB,WAAW;IACb,+BAAmB,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC7C,aAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,aAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;QAC9C,MAAM,EAAE,WAAW,CAAC,6BAA6B;KAClD,CAAC,CACH,CAAC;AACJ,CAAC,EAPgB,WAAW,2BAAX,WAAW,QAO3B;AACD,WAAiB,WAAW;IACb,yCAA6B,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACvD,aAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,WAAW,CAAC,0BAA0B;QAClD,KAAK,EAAE,WAAW,CAAC,qBAAqB;QACxC,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE;QAClB,cAAc,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CACH,CAAC;AACJ,CAAC,EAVgB,WAAW,2BAAX,WAAW,QAU3B"}

View File

@@ -0,0 +1,427 @@
/**
* Copyright 2024 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.
*/
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
import z from 'zod';
export declare const UserAgentClientHintsCommandSchema: z.ZodLazy<z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setClientHintsOverride">;
params: z.ZodObject<{
clientHints: z.ZodUnion<[z.ZodLazy<z.ZodObject<{
brands: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
fullVersionList: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
platform: z.ZodOptional<z.ZodString>;
platformVersion: z.ZodOptional<z.ZodString>;
architecture: z.ZodOptional<z.ZodString>;
model: z.ZodOptional<z.ZodString>;
mobile: z.ZodOptional<z.ZodBoolean>;
bitness: z.ZodOptional<z.ZodString>;
wow64: z.ZodOptional<z.ZodBoolean>;
formFactors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}>>, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>;
}, "strip", z.ZodTypeAny, {
params: {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setClientHintsOverride";
}, {
params: {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setClientHintsOverride";
}>>>;
export declare namespace Emulation {
const SetClientHintsOverrideCommandSchema: z.ZodLazy<z.ZodObject<{
method: z.ZodLiteral<"emulation.setClientHintsOverride">;
params: z.ZodObject<{
clientHints: z.ZodUnion<[z.ZodLazy<z.ZodObject<{
brands: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
fullVersionList: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
platform: z.ZodOptional<z.ZodString>;
platformVersion: z.ZodOptional<z.ZodString>;
architecture: z.ZodOptional<z.ZodString>;
model: z.ZodOptional<z.ZodString>;
mobile: z.ZodOptional<z.ZodBoolean>;
bitness: z.ZodOptional<z.ZodString>;
wow64: z.ZodOptional<z.ZodBoolean>;
formFactors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}>>, z.ZodNull]>;
contexts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
userContexts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}, {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
}>;
}, "strip", z.ZodTypeAny, {
params: {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setClientHintsOverride";
}, {
params: {
clientHints: {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
} | null;
userContexts?: string[] | undefined;
contexts?: string[] | undefined;
};
method: "emulation.setClientHintsOverride";
}>>;
}
export declare namespace Emulation {
const ClientHintsMetadataSchema: z.ZodLazy<z.ZodObject<{
brands: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
fullVersionList: z.ZodOptional<z.ZodArray<z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>, "many">>;
platform: z.ZodOptional<z.ZodString>;
platformVersion: z.ZodOptional<z.ZodString>;
architecture: z.ZodOptional<z.ZodString>;
model: z.ZodOptional<z.ZodString>;
mobile: z.ZodOptional<z.ZodBoolean>;
bitness: z.ZodOptional<z.ZodString>;
wow64: z.ZodOptional<z.ZodBoolean>;
formFactors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}, {
mobile?: boolean | undefined;
brands?: {
brand: string;
version: string;
}[] | undefined;
fullVersionList?: {
brand: string;
version: string;
}[] | undefined;
platform?: string | undefined;
platformVersion?: string | undefined;
architecture?: string | undefined;
model?: string | undefined;
bitness?: string | undefined;
wow64?: boolean | undefined;
formFactors?: string[] | undefined;
}>>;
}
export declare namespace Emulation {
const BrandVersionSchema: z.ZodLazy<z.ZodObject<{
brand: z.ZodString;
version: z.ZodString;
}, "strip", z.ZodTypeAny, {
brand: string;
version: string;
}, {
brand: string;
version: string;
}>>;
}
export declare namespace Emulation {
const SetClientHintsOverrideResultSchema: z.ZodLazy<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
}

View File

@@ -0,0 +1,66 @@
"use strict";
/**
* Copyright 2024 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Emulation = exports.UserAgentClientHintsCommandSchema = void 0;
/**
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.7.
* Run `node tools/generate-bidi-types.mjs` to regenerate.
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck Some types may be circular.
const zod_1 = __importDefault(require("zod"));
exports.UserAgentClientHintsCommandSchema = zod_1.default.lazy(() => Emulation.SetClientHintsOverrideCommandSchema);
var Emulation;
(function (Emulation) {
Emulation.SetClientHintsOverrideCommandSchema = zod_1.default.lazy(() => zod_1.default.object({
method: zod_1.default.literal('emulation.setClientHintsOverride'),
params: zod_1.default.object({
clientHints: zod_1.default.union([Emulation.ClientHintsMetadataSchema, zod_1.default.null()]),
contexts: zod_1.default.array(zod_1.default.string()).min(1).optional(),
userContexts: zod_1.default.array(zod_1.default.string()).min(1).optional(),
}),
}));
})(Emulation || (exports.Emulation = Emulation = {}));
(function (Emulation) {
Emulation.ClientHintsMetadataSchema = zod_1.default.lazy(() => zod_1.default.object({
brands: zod_1.default.array(Emulation.BrandVersionSchema).optional(),
fullVersionList: zod_1.default.array(Emulation.BrandVersionSchema).optional(),
platform: zod_1.default.string().optional(),
platformVersion: zod_1.default.string().optional(),
architecture: zod_1.default.string().optional(),
model: zod_1.default.string().optional(),
mobile: zod_1.default.boolean().optional(),
bitness: zod_1.default.string().optional(),
wow64: zod_1.default.boolean().optional(),
formFactors: zod_1.default.array(zod_1.default.string()).optional(),
}));
})(Emulation || (exports.Emulation = Emulation = {}));
(function (Emulation) {
Emulation.BrandVersionSchema = zod_1.default.lazy(() => zod_1.default.object({
brand: zod_1.default.string(),
version: zod_1.default.string(),
}));
})(Emulation || (exports.Emulation = Emulation = {}));
(function (Emulation) {
Emulation.SetClientHintsOverrideResultSchema = zod_1.default.lazy(() => zod_1.default.object({}));
})(Emulation || (exports.Emulation = Emulation = {}));
//# sourceMappingURL=webdriver-bidi-ua-client-hints.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"webdriver-bidi-ua-client-hints.js","sourceRoot":"","sources":["../../../../src/protocol-parser/generated/webdriver-bidi-ua-client-hints.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;AAEH;;;;GAIG;AAEH,6DAA6D;AAC7D,0CAA0C;AAE1C,8CAAoB;AAEP,QAAA,iCAAiC,GAAG,aAAC,CAAC,IAAI,CACrD,GAAG,EAAE,CAAC,SAAS,CAAC,mCAAmC,CACpD,CAAC;AACF,IAAiB,SAAS,CAWzB;AAXD,WAAiB,SAAS;IACX,6CAAmC,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC7D,aAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,aAAC,CAAC,OAAO,CAAC,kCAAkC,CAAC;QACrD,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;YACf,WAAW,EAAE,aAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,yBAAyB,EAAE,aAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACrE,QAAQ,EAAE,aAAC,CAAC,KAAK,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;YAC/C,YAAY,EAAE,aAAC,CAAC,KAAK,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SACpD,CAAC;KACH,CAAC,CACH,CAAC;AACJ,CAAC,EAXgB,SAAS,yBAAT,SAAS,QAWzB;AACD,WAAiB,SAAS;IACX,mCAAyB,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACnD,aAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,aAAC,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;QACxD,eAAe,EAAE,aAAC,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;QACjE,QAAQ,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,eAAe,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,MAAM,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC9B,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,KAAK,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC7B,WAAW,EAAE,aAAC,CAAC,KAAK,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC5C,CAAC,CACH,CAAC;AACJ,CAAC,EAfgB,SAAS,yBAAT,SAAS,QAezB;AACD,WAAiB,SAAS;IACX,4BAAkB,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC5C,aAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH,CAAC;AACJ,CAAC,EAPgB,SAAS,yBAAT,SAAS,QAOzB;AACD,WAAiB,SAAS;IACX,4CAAkC,GAAG,aAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC,EAFgB,SAAS,yBAAT,SAAS,QAEzB"}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,175 @@
/**
* Copyright 2022 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.
*/
/**
* @fileoverview Provides parsing and validator for WebDriver BiDi protocol.
* Parser types should match the `../protocol` types.
*/
import { z, type ZodType } from 'zod';
import type * as Protocol from '../protocol/protocol.js';
export declare function parseObject<T extends ZodType>(obj: unknown, schema: T): z.infer<T>;
/** @see https://w3c.github.io/webdriver-bidi/#module-browser */
export declare namespace Browser {
function parseCreateUserContextParameters(params: unknown): Protocol.Browser.CreateUserContextParameters;
function parseRemoveUserContextParameters(params: unknown): Protocol.Browser.RemoveUserContextParameters;
function parseSetClientWindowStateParameters(params: unknown): Protocol.Browser.SetClientWindowStateParameters;
function parseSetDownloadBehaviorParameters(params: unknown): Protocol.Browser.SetDownloadBehaviorParameters;
}
/** @see https://w3c.github.io/webdriver-bidi/#module-network */
export declare namespace Network {
function parseAddDataCollectorParameters(params: unknown): Protocol.Network.AddDataCollectorParameters;
function parseAddInterceptParameters(params: unknown): Protocol.Network.AddInterceptParameters;
function parseContinueRequestParameters(params: unknown): {
request: string;
url?: string | undefined;
cookies?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
}[] | undefined;
method?: string | undefined;
body?: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
} | undefined;
headers?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
}[] | undefined;
};
function parseContinueResponseParameters(params: unknown): Protocol.Network.ContinueResponseParameters;
function parseContinueWithAuthParameters(params: unknown): {
request: string;
} & ({
credentials: {
type: "password";
password: string;
username: string;
};
action: "provideCredentials";
} | {
action: "default" | "cancel";
});
function parseDisownDataParameters(params: unknown): Protocol.Network.DisownDataParameters;
function parseFailRequestParameters(params: unknown): {
request: string;
};
function parseGetDataParameters(params: unknown): Protocol.Network.GetDataParameters;
function parseProvideResponseParameters(params: unknown): Protocol.Network.ProvideResponseParameters;
function parseRemoveDataCollectorParameters(params: unknown): Protocol.Network.RemoveDataCollectorParameters;
function parseRemoveInterceptParameters(params: unknown): {
intercept: string;
};
function parseSetCacheBehaviorParameters(params: unknown): Protocol.Network.SetCacheBehaviorParameters;
function parseSetExtraHeadersParameters(params: unknown): Protocol.Network.SetExtraHeadersParameters;
}
/** @see https://w3c.github.io/webdriver-bidi/#module-script */
export declare namespace Script {
function parseAddPreloadScriptParams(params: unknown): Protocol.Script.AddPreloadScriptParameters;
function parseCallFunctionParams(params: unknown): Protocol.Script.CallFunctionParameters;
function parseDisownParams(params: unknown): Protocol.Script.DisownParameters;
function parseEvaluateParams(params: unknown): Protocol.Script.EvaluateParameters;
function parseGetRealmsParams(params: unknown): Protocol.Script.GetRealmsParameters;
function parseRemovePreloadScriptParams(params: unknown): {
script: string;
};
}
/** @see https://w3c.github.io/webdriver-bidi/#module-browsingContext */
export declare namespace BrowsingContext {
function parseActivateParams(params: unknown): {
context: string;
};
function parseCaptureScreenshotParams(params: unknown): Protocol.BrowsingContext.CaptureScreenshotParameters;
function parseCloseParams(params: unknown): Protocol.BrowsingContext.CloseParameters;
function parseCreateParams(params: unknown): Protocol.BrowsingContext.CreateParameters;
function parseGetTreeParams(params: unknown): Protocol.BrowsingContext.GetTreeParameters;
function parseHandleUserPromptParameters(params: unknown): Protocol.BrowsingContext.HandleUserPromptParameters;
function parseLocateNodesParams(params: unknown): Protocol.BrowsingContext.LocateNodesParameters;
function parseNavigateParams(params: unknown): Protocol.BrowsingContext.NavigateParameters;
function parsePrintParams(params: unknown): Protocol.BrowsingContext.PrintParameters;
function parseReloadParams(params: unknown): Protocol.BrowsingContext.ReloadParameters;
function parseSetViewportParams(params: unknown): Protocol.BrowsingContext.SetViewportParameters;
function parseTraverseHistoryParams(params: unknown): Protocol.BrowsingContext.TraverseHistoryParameters;
}
/** @see https://w3c.github.io/webdriver-bidi/#module-session */
export declare namespace Session {
function parseSubscribeParams(params: unknown): Protocol.Session.SubscribeParameters;
function parseUnsubscribeParams(params: unknown): Protocol.Session.UnsubscribeParameters;
}
export declare namespace Emulation {
function parseSetClientHintsOverrideParams(params: unknown): Protocol.UAClientHints.Emulation.SetClientHintsOverrideParameters;
function parseSetForcedColorsModeThemeOverrideParams(params: unknown): Protocol.Emulation.SetForcedColorsModeThemeOverrideParameters;
function parseSetGeolocationOverrideParams(params: unknown): Protocol.Emulation.SetGeolocationOverrideParameters;
function parseSetLocaleOverrideParams(params: unknown): Protocol.Emulation.SetLocaleOverrideParameters;
function parseSetNetworkConditionsParams(params: unknown): Protocol.Emulation.SetNetworkConditionsParameters;
function parseSetScreenOrientationOverrideParams(params: unknown): Protocol.Emulation.SetScreenOrientationOverrideParameters;
function parseSetScreenSettingsOverrideParams(params: unknown): Protocol.Emulation.SetScreenSettingsOverrideParameters;
function parseSetScriptingEnabledParams(params: unknown): Protocol.Emulation.SetScriptingEnabledParameters;
function parseSetTimezoneOverrideParams(params: unknown): Protocol.Emulation.SetTimezoneOverrideParameters;
function parseSetTouchOverrideParams(params: unknown): Protocol.Emulation.SetTouchOverrideParameters;
function parseSetUserAgentOverrideParams(params: unknown): Protocol.Emulation.SetUserAgentOverrideParameters;
}
export declare namespace Input {
function parsePerformActionsParams(params: unknown): Protocol.Input.PerformActionsParameters;
function parseReleaseActionsParams(params: unknown): Protocol.Input.ReleaseActionsParameters;
function parseSetFilesParams(params: unknown): Protocol.Input.SetFilesParameters;
}
export declare namespace Storage {
function parseDeleteCookiesParams(params: unknown): Protocol.Storage.DeleteCookiesParameters;
function parseGetCookiesParams(params: unknown): Protocol.Storage.GetCookiesParameters;
function parseSetCookieParams(params: unknown): Protocol.Storage.SetCookieParameters;
}
export declare namespace Cdp {
function parseGetSessionRequest(params: unknown): Protocol.Cdp.GetSessionParameters;
function parseResolveRealmRequest(params: unknown): Protocol.Cdp.ResolveRealmParameters;
function parseSendCommandRequest(params: unknown): Protocol.Cdp.SendCommandParameters;
}
export declare namespace Permissions {
function parseSetPermissionsParams(params: unknown): Protocol.Permissions.SetPermissionParameters;
}
export declare namespace Bluetooth {
function parseDisableSimulationParameters(params: unknown): Protocol.Bluetooth.DisableSimulationParameters;
function parseHandleRequestDevicePromptParams(params: unknown): Protocol.Bluetooth.HandleRequestDevicePromptParameters;
function parseSimulateAdapterParams(params: unknown): Protocol.Bluetooth.SimulateAdapterParameters;
function parseSimulateAdvertisementParams(params: unknown): Protocol.Bluetooth.SimulateAdvertisementParameters;
function parseSimulateCharacteristicParams(params: unknown): Protocol.Bluetooth.SimulateCharacteristicParameters;
function parseSimulateCharacteristicResponseParams(params: unknown): Protocol.Bluetooth.SimulateCharacteristicResponseParameters;
function parseSimulateDescriptorParams(params: unknown): Protocol.Bluetooth.SimulateDescriptorParameters;
function parseSimulateDescriptorResponseParams(params: unknown): Protocol.Bluetooth.SimulateDescriptorResponseParameters;
function parseSimulateGattConnectionResponseParams(params: unknown): Protocol.Bluetooth.SimulateGattConnectionResponseParameters;
function parseSimulateGattDisconnectionParams(params: unknown): Protocol.Bluetooth.SimulateGattDisconnectionParameters;
function parseSimulatePreconnectedPeripheralParams(params: unknown): Protocol.Bluetooth.SimulatePreconnectedPeripheralParameters;
function parseSimulateServiceParams(params: unknown): Protocol.Bluetooth.SimulateServiceParameters;
}
/** @see https://w3c.github.io/webdriver-bidi/#module-webExtension */
export declare namespace WebModule {
function parseInstallParams(params: unknown): Protocol.WebExtension.InstallParameters;
function parseUninstallParams(params: unknown): Protocol.WebExtension.UninstallParameters;
}

View File

@@ -0,0 +1,493 @@
"use strict";
/**
* Copyright 2022 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.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebModule = exports.Bluetooth = exports.Permissions = exports.Cdp = exports.Storage = exports.Input = exports.Emulation = exports.Session = exports.BrowsingContext = exports.Script = exports.Network = exports.Browser = void 0;
exports.parseObject = parseObject;
/**
* @fileoverview Provides parsing and validator for WebDriver BiDi protocol.
* Parser types should match the `../protocol` types.
*/
const zod_1 = require("zod");
const protocol_js_1 = require("../protocol/protocol.js");
const WebDriverBidiBluetooth = __importStar(require("./generated/webdriver-bidi-bluetooth.js"));
const WebDriverBidiPermissions = __importStar(require("./generated/webdriver-bidi-permissions.js"));
const WebDriverBidiUAClientHints = __importStar(require("./generated/webdriver-bidi-ua-client-hints.js"));
const WebDriverBidi = __importStar(require("./generated/webdriver-bidi.js"));
function parseObject(obj, schema) {
const parseResult = schema.safeParse(obj);
if (parseResult.success) {
return parseResult.data;
}
const errorMessage = parseResult.error.errors
.map((e) => `${e.message} in ` +
`${e.path.map((p) => JSON.stringify(p)).join('/')}.`)
.join(' ');
throw new protocol_js_1.InvalidArgumentException(errorMessage);
}
/** @see https://w3c.github.io/webdriver-bidi/#module-browser */
var Browser;
(function (Browser) {
// keep-sorted start block=yes
function parseCreateUserContextParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Browser.CreateUserContextParametersSchema);
}
Browser.parseCreateUserContextParameters = parseCreateUserContextParameters;
function parseRemoveUserContextParameters(params) {
return parseObject(params, WebDriverBidi.Browser.RemoveUserContextParametersSchema);
}
Browser.parseRemoveUserContextParameters = parseRemoveUserContextParameters;
function parseSetClientWindowStateParameters(params) {
return parseObject(params, WebDriverBidi.Browser.SetClientWindowStateParametersSchema);
}
Browser.parseSetClientWindowStateParameters = parseSetClientWindowStateParameters;
function parseSetDownloadBehaviorParameters(params) {
return parseObject(params, WebDriverBidi.Browser.SetDownloadBehaviorParametersSchema);
}
Browser.parseSetDownloadBehaviorParameters = parseSetDownloadBehaviorParameters;
// keep-sorted end
})(Browser || (exports.Browser = Browser = {}));
/** @see https://w3c.github.io/webdriver-bidi/#module-network */
var Network;
(function (Network) {
// keep-sorted start block=yes
function parseAddDataCollectorParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Network.AddDataCollectorParametersSchema);
}
Network.parseAddDataCollectorParameters = parseAddDataCollectorParameters;
function parseAddInterceptParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Network.AddInterceptParametersSchema);
}
Network.parseAddInterceptParameters = parseAddInterceptParameters;
function parseContinueRequestParameters(params) {
return parseObject(params, WebDriverBidi.Network.ContinueRequestParametersSchema);
}
Network.parseContinueRequestParameters = parseContinueRequestParameters;
function parseContinueResponseParameters(params) {
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Network.ContinueResponseParametersSchema);
}
Network.parseContinueResponseParameters = parseContinueResponseParameters;
function parseContinueWithAuthParameters(params) {
return parseObject(params, WebDriverBidi.Network.ContinueWithAuthParametersSchema);
}
Network.parseContinueWithAuthParameters = parseContinueWithAuthParameters;
function parseDisownDataParameters(params) {
return parseObject(params, WebDriverBidi.Network.DisownDataParametersSchema);
}
Network.parseDisownDataParameters = parseDisownDataParameters;
function parseFailRequestParameters(params) {
return parseObject(params, WebDriverBidi.Network.FailRequestParametersSchema);
}
Network.parseFailRequestParameters = parseFailRequestParameters;
function parseGetDataParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Network.GetDataParametersSchema);
}
Network.parseGetDataParameters = parseGetDataParameters;
function parseProvideResponseParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Network.ProvideResponseParametersSchema);
}
Network.parseProvideResponseParameters = parseProvideResponseParameters;
function parseRemoveDataCollectorParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
return parseObject(params, WebDriverBidi.Network.RemoveDataCollectorParametersSchema);
}
Network.parseRemoveDataCollectorParameters = parseRemoveDataCollectorParameters;
function parseRemoveInterceptParameters(params) {
return parseObject(params, WebDriverBidi.Network.RemoveInterceptParametersSchema);
}
Network.parseRemoveInterceptParameters = parseRemoveInterceptParameters;
function parseSetCacheBehaviorParameters(params) {
return parseObject(params, WebDriverBidi.Network.SetCacheBehaviorParametersSchema);
}
Network.parseSetCacheBehaviorParameters = parseSetCacheBehaviorParameters;
function parseSetExtraHeadersParameters(params) {
return parseObject(params, WebDriverBidi.Network.SetExtraHeadersParametersSchema);
}
Network.parseSetExtraHeadersParameters = parseSetExtraHeadersParameters;
// keep-sorted end
})(Network || (exports.Network = Network = {}));
/** @see https://w3c.github.io/webdriver-bidi/#module-script */
var Script;
(function (Script) {
// keep-sorted start block=yes
function parseAddPreloadScriptParams(params) {
return parseObject(params, WebDriverBidi.Script.AddPreloadScriptParametersSchema);
}
Script.parseAddPreloadScriptParams = parseAddPreloadScriptParams;
function parseCallFunctionParams(params) {
return parseObject(params, WebDriverBidi.Script.CallFunctionParametersSchema);
}
Script.parseCallFunctionParams = parseCallFunctionParams;
function parseDisownParams(params) {
return parseObject(params, WebDriverBidi.Script.DisownParametersSchema);
}
Script.parseDisownParams = parseDisownParams;
function parseEvaluateParams(params) {
return parseObject(params, WebDriverBidi.Script.EvaluateParametersSchema);
}
Script.parseEvaluateParams = parseEvaluateParams;
function parseGetRealmsParams(params) {
return parseObject(params, WebDriverBidi.Script.GetRealmsParametersSchema);
}
Script.parseGetRealmsParams = parseGetRealmsParams;
function parseRemovePreloadScriptParams(params) {
return parseObject(params, WebDriverBidi.Script.RemovePreloadScriptParametersSchema);
}
Script.parseRemovePreloadScriptParams = parseRemovePreloadScriptParams;
// keep-sorted end
})(Script || (exports.Script = Script = {}));
/** @see https://w3c.github.io/webdriver-bidi/#module-browsingContext */
var BrowsingContext;
(function (BrowsingContext) {
// keep-sorted start block=yes
function parseActivateParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.ActivateParametersSchema);
}
BrowsingContext.parseActivateParams = parseActivateParams;
function parseCaptureScreenshotParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.CaptureScreenshotParametersSchema);
}
BrowsingContext.parseCaptureScreenshotParams = parseCaptureScreenshotParams;
function parseCloseParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.CloseParametersSchema);
}
BrowsingContext.parseCloseParams = parseCloseParams;
function parseCreateParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.CreateParametersSchema);
}
BrowsingContext.parseCreateParams = parseCreateParams;
function parseGetTreeParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.GetTreeParametersSchema);
}
BrowsingContext.parseGetTreeParams = parseGetTreeParams;
function parseHandleUserPromptParameters(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.HandleUserPromptParametersSchema);
}
BrowsingContext.parseHandleUserPromptParameters = parseHandleUserPromptParameters;
function parseLocateNodesParams(params) {
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.BrowsingContext.LocateNodesParametersSchema);
}
BrowsingContext.parseLocateNodesParams = parseLocateNodesParams;
function parseNavigateParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.NavigateParametersSchema);
}
BrowsingContext.parseNavigateParams = parseNavigateParams;
function parsePrintParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.PrintParametersSchema);
}
BrowsingContext.parsePrintParams = parsePrintParams;
function parseReloadParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.ReloadParametersSchema);
}
BrowsingContext.parseReloadParams = parseReloadParams;
function parseSetViewportParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.SetViewportParametersSchema);
}
BrowsingContext.parseSetViewportParams = parseSetViewportParams;
function parseTraverseHistoryParams(params) {
return parseObject(params, WebDriverBidi.BrowsingContext.TraverseHistoryParametersSchema);
}
BrowsingContext.parseTraverseHistoryParams = parseTraverseHistoryParams;
// keep-sorted end
})(BrowsingContext || (exports.BrowsingContext = BrowsingContext = {}));
/** @see https://w3c.github.io/webdriver-bidi/#module-session */
var Session;
(function (Session) {
// keep-sorted start block=yes
function parseSubscribeParams(params) {
return parseObject(params, WebDriverBidi.Session.SubscribeParametersSchema);
}
Session.parseSubscribeParams = parseSubscribeParams;
function parseUnsubscribeParams(params) {
if (params && typeof params === 'object' && 'subscriptions' in params) {
return parseObject(params, WebDriverBidi.Session.UnsubscribeByIdRequestSchema);
}
return parseObject(params, WebDriverBidi.Session.UnsubscribeParametersSchema);
}
Session.parseUnsubscribeParams = parseUnsubscribeParams;
// keep-sorted end
})(Session || (exports.Session = Session = {}));
var Emulation;
(function (Emulation) {
// keep-sorted start block=yes
function parseSetClientHintsOverrideParams(params) {
const SetClientHintsOverrideParametersSchema = zod_1.z.object({
clientHints: zod_1.z.union([
WebDriverBidiUAClientHints.Emulation.ClientHintsMetadataSchema,
zod_1.z.null(),
]),
contexts: zod_1.z.array(zod_1.z.string()).min(1).optional(),
userContexts: zod_1.z.array(zod_1.z.string()).min(1).optional(),
});
return parseObject(params, SetClientHintsOverrideParametersSchema);
}
Emulation.parseSetClientHintsOverrideParams = parseSetClientHintsOverrideParams;
function parseSetForcedColorsModeThemeOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetForcedColorsModeThemeOverrideParametersSchema);
}
Emulation.parseSetForcedColorsModeThemeOverrideParams = parseSetForcedColorsModeThemeOverrideParams;
function parseSetGeolocationOverrideParams(params) {
if ('coordinates' in params && 'error' in params) {
// Zod picks the first matching parameter omitting the other. In this case, the
// `parseObject` will remove `error` from the params. However, specification
// requires to throw an exception.
throw new protocol_js_1.InvalidArgumentException('Coordinates and error cannot be set at the same time');
}
return parseObject(params, WebDriverBidi.Emulation.SetGeolocationOverrideParametersSchema);
}
Emulation.parseSetGeolocationOverrideParams = parseSetGeolocationOverrideParams;
function parseSetLocaleOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetLocaleOverrideParametersSchema);
}
Emulation.parseSetLocaleOverrideParams = parseSetLocaleOverrideParams;
function parseSetNetworkConditionsParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetNetworkConditionsParametersSchema);
}
Emulation.parseSetNetworkConditionsParams = parseSetNetworkConditionsParams;
function parseSetScreenOrientationOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetScreenOrientationOverrideParametersSchema);
}
Emulation.parseSetScreenOrientationOverrideParams = parseSetScreenOrientationOverrideParams;
function parseSetScreenSettingsOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetScreenSettingsOverrideParametersSchema);
}
Emulation.parseSetScreenSettingsOverrideParams = parseSetScreenSettingsOverrideParams;
function parseSetScriptingEnabledParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetScriptingEnabledParametersSchema);
}
Emulation.parseSetScriptingEnabledParams = parseSetScriptingEnabledParams;
function parseSetTimezoneOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetTimezoneOverrideParametersSchema);
}
Emulation.parseSetTimezoneOverrideParams = parseSetTimezoneOverrideParams;
function parseSetTouchOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetTouchOverrideParametersSchema);
}
Emulation.parseSetTouchOverrideParams = parseSetTouchOverrideParams;
function parseSetUserAgentOverrideParams(params) {
return parseObject(params, WebDriverBidi.Emulation.SetUserAgentOverrideParametersSchema);
}
Emulation.parseSetUserAgentOverrideParams = parseSetUserAgentOverrideParams;
// keep-sorted end
})(Emulation || (exports.Emulation = Emulation = {}));
var Input;
(function (Input) {
// keep-sorted start block=yes
function parsePerformActionsParams(params) {
return parseObject(params, WebDriverBidi.Input.PerformActionsParametersSchema);
}
Input.parsePerformActionsParams = parsePerformActionsParams;
function parseReleaseActionsParams(params) {
return parseObject(params, WebDriverBidi.Input.ReleaseActionsParametersSchema);
}
Input.parseReleaseActionsParams = parseReleaseActionsParams;
function parseSetFilesParams(params) {
return parseObject(params, WebDriverBidi.Input.SetFilesParametersSchema);
}
Input.parseSetFilesParams = parseSetFilesParams;
// keep-sorted end
})(Input || (exports.Input = Input = {}));
var Storage;
(function (Storage) {
// keep-sorted start block=yes
function parseDeleteCookiesParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.DeleteCookiesParametersSchema);
}
Storage.parseDeleteCookiesParams = parseDeleteCookiesParams;
function parseGetCookiesParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.GetCookiesParametersSchema);
}
Storage.parseGetCookiesParams = parseGetCookiesParams;
function parseSetCookieParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.SetCookieParametersSchema);
}
Storage.parseSetCookieParams = parseSetCookieParams;
// keep-sorted end
})(Storage || (exports.Storage = Storage = {}));
var Cdp;
(function (Cdp) {
// keep-sorted start block=yes
const GetSessionRequestSchema = zod_1.z.object({
context: WebDriverBidi.BrowsingContext.BrowsingContextSchema,
});
const ResolveRealmRequestSchema = zod_1.z.object({
realm: WebDriverBidi.Script.RealmSchema,
});
const SendCommandRequestSchema = zod_1.z.object({
// Allowing any cdpMethod, and casting to proper type later on.
method: zod_1.z.string(),
// `passthrough` allows object to have any fields.
// https://github.com/colinhacks/zod#passthrough
params: zod_1.z.object({}).passthrough().optional(),
session: zod_1.z.string().optional(),
});
function parseGetSessionRequest(params) {
return parseObject(params, GetSessionRequestSchema);
}
Cdp.parseGetSessionRequest = parseGetSessionRequest;
function parseResolveRealmRequest(params) {
return parseObject(params, ResolveRealmRequestSchema);
}
Cdp.parseResolveRealmRequest = parseResolveRealmRequest;
function parseSendCommandRequest(params) {
return parseObject(params, SendCommandRequestSchema);
}
Cdp.parseSendCommandRequest = parseSendCommandRequest;
// keep-sorted end
})(Cdp || (exports.Cdp = Cdp = {}));
var Permissions;
(function (Permissions) {
// keep-sorted start block=yes
function parseSetPermissionsParams(params) {
return {
// TODO: remove once "goog:" attributes are not needed.
...params,
...parseObject(params, WebDriverBidiPermissions.Permissions.SetPermissionParametersSchema),
};
}
Permissions.parseSetPermissionsParams = parseSetPermissionsParams;
// keep-sorted end
})(Permissions || (exports.Permissions = Permissions = {}));
var Bluetooth;
(function (Bluetooth) {
// keep-sorted start block=yes
function parseDisableSimulationParameters(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.DisableSimulationParametersSchema);
}
Bluetooth.parseDisableSimulationParameters = parseDisableSimulationParameters;
function parseHandleRequestDevicePromptParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.HandleRequestDevicePromptParametersSchema);
}
Bluetooth.parseHandleRequestDevicePromptParams = parseHandleRequestDevicePromptParams;
function parseSimulateAdapterParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.SimulateAdapterParametersSchema);
}
Bluetooth.parseSimulateAdapterParams = parseSimulateAdapterParams;
function parseSimulateAdvertisementParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.SimulateAdvertisementParametersSchema);
}
Bluetooth.parseSimulateAdvertisementParams = parseSimulateAdvertisementParams;
function parseSimulateCharacteristicParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.SimulateCharacteristicParametersSchema);
}
Bluetooth.parseSimulateCharacteristicParams = parseSimulateCharacteristicParams;
function parseSimulateCharacteristicResponseParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.SimulateCharacteristicResponseParametersSchema);
}
Bluetooth.parseSimulateCharacteristicResponseParams = parseSimulateCharacteristicResponseParams;
function parseSimulateDescriptorParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.SimulateDescriptorParametersSchema);
}
Bluetooth.parseSimulateDescriptorParams = parseSimulateDescriptorParams;
function parseSimulateDescriptorResponseParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.SimulateDescriptorResponseParametersSchema);
}
Bluetooth.parseSimulateDescriptorResponseParams = parseSimulateDescriptorResponseParams;
function parseSimulateGattConnectionResponseParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.SimulateGattConnectionResponseParametersSchema);
}
Bluetooth.parseSimulateGattConnectionResponseParams = parseSimulateGattConnectionResponseParams;
function parseSimulateGattDisconnectionParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.SimulateGattDisconnectionParametersSchema);
}
Bluetooth.parseSimulateGattDisconnectionParams = parseSimulateGattDisconnectionParams;
function parseSimulatePreconnectedPeripheralParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth
.SimulatePreconnectedPeripheralParametersSchema);
}
Bluetooth.parseSimulatePreconnectedPeripheralParams = parseSimulatePreconnectedPeripheralParams;
function parseSimulateServiceParams(params) {
return parseObject(params, WebDriverBidiBluetooth.Bluetooth.SimulateServiceParametersSchema);
}
Bluetooth.parseSimulateServiceParams = parseSimulateServiceParams;
// keep-sorted end
})(Bluetooth || (exports.Bluetooth = Bluetooth = {}));
/** @see https://w3c.github.io/webdriver-bidi/#module-webExtension */
var WebModule;
(function (WebModule) {
// keep-sorted start block=yes
function parseInstallParams(params) {
return parseObject(params, WebDriverBidi.WebExtension.InstallParametersSchema);
}
WebModule.parseInstallParams = parseInstallParams;
function parseUninstallParams(params) {
return parseObject(params, WebDriverBidi.WebExtension.UninstallParametersSchema);
}
WebModule.parseUninstallParams = parseUninstallParams;
// keep-sorted end
})(WebModule || (exports.WebModule = WebModule = {}));
//# sourceMappingURL=protocol-parser.js.map

File diff suppressed because one or more lines are too long