-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathBidiParser.ts
234 lines (224 loc) · 7.91 KB
/
BidiParser.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/**
* Copyright 2023 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 {BidiCommandParameterParser} from '../bidiMapper/BidiMapper.js';
import type {
Bluetooth,
Browser,
BrowsingContext,
Cdp,
Input,
Network,
Permissions,
Script,
Session,
Storage,
} from '../protocol/protocol.js';
import * as Parser from '../protocol-parser/protocol-parser.js';
export class BidiParser implements BidiCommandParameterParser {
// Bluetooth domain
// keep-sorted start block=yes
parseHandleRequestDevicePromptParams(
params: unknown,
): Bluetooth.HandleRequestDevicePromptParameters {
return Parser.Bluetooth.parseHandleRequestDevicePromptParams(params);
}
parseSimulateAdapterParameters(
params: unknown,
): Bluetooth.SimulateAdapterParameters {
return Parser.Bluetooth.parseSimulateAdapterParams(params);
}
parseSimulateAdvertisementParameters(
params: unknown,
): Bluetooth.SimulateAdvertisementParameters {
return Parser.Bluetooth.parseSimulateAdvertisementParams(params);
}
parseSimulatePreconnectedPeripheralParameters(
params: unknown,
): Bluetooth.SimulatePreconnectedPeripheralParameters {
return Parser.Bluetooth.parseSimulatePreconnectedPeripheralParams(params);
}
// keep-sorted end
// Browser domain
// keep-sorted start block=yes
parseRemoveUserContextParams(
params: unknown,
): Browser.RemoveUserContextParameters {
return Parser.Browser.parseRemoveUserContextParams(params);
}
// keep-sorted end
// Browsing Context domain
// keep-sorted start block=yes
parseActivateParams(params: unknown): BrowsingContext.ActivateParameters {
return Parser.BrowsingContext.parseActivateParams(params);
}
parseCaptureScreenshotParams(
params: unknown,
): BrowsingContext.CaptureScreenshotParameters {
return Parser.BrowsingContext.parseCaptureScreenshotParams(params);
}
parseCloseParams(params: unknown): BrowsingContext.CloseParameters {
return Parser.BrowsingContext.parseCloseParams(params);
}
parseCreateParams(params: unknown): BrowsingContext.CreateParameters {
return Parser.BrowsingContext.parseCreateParams(params);
}
parseGetTreeParams(params: unknown): BrowsingContext.GetTreeParameters {
return Parser.BrowsingContext.parseGetTreeParams(params);
}
parseHandleUserPromptParams(
params: unknown,
): BrowsingContext.HandleUserPromptParameters {
return Parser.BrowsingContext.parseHandleUserPromptParameters(params);
}
parseLocateNodesParams(
params: unknown,
): BrowsingContext.LocateNodesParameters {
return Parser.BrowsingContext.parseLocateNodesParams(params);
}
parseNavigateParams(params: unknown): BrowsingContext.NavigateParameters {
return Parser.BrowsingContext.parseNavigateParams(params);
}
parsePrintParams(params: unknown): BrowsingContext.PrintParameters {
return Parser.BrowsingContext.parsePrintParams(params);
}
parseReloadParams(params: unknown): BrowsingContext.ReloadParameters {
return Parser.BrowsingContext.parseReloadParams(params);
}
parseSetViewportParams(
params: unknown,
): BrowsingContext.SetViewportParameters {
return Parser.BrowsingContext.parseSetViewportParams(params);
}
parseTraverseHistoryParams(
params: unknown,
): BrowsingContext.TraverseHistoryParameters {
return Parser.BrowsingContext.parseTraverseHistoryParams(params);
}
// keep-sorted end
// CDP domain
// keep-sorted start block=yes
parseGetSessionParams(params: unknown): Cdp.GetSessionParameters {
return Parser.Cdp.parseGetSessionRequest(params);
}
parseResolveRealmParams(params: unknown): Cdp.ResolveRealmParameters {
return Parser.Cdp.parseResolveRealmRequest(params);
}
parseSendCommandParams(params: unknown): Cdp.SendCommandParameters {
return Parser.Cdp.parseSendCommandRequest(params);
}
// keep-sorted end
// Input domain
// keep-sorted start block=yes
parsePerformActionsParams(params: unknown): Input.PerformActionsParameters {
return Parser.Input.parsePerformActionsParams(params);
}
parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters {
return Parser.Input.parseReleaseActionsParams(params);
}
parseSetFilesParams(params: unknown): Input.SetFilesParameters {
return Parser.Input.parseSetFilesParams(params);
}
// keep-sorted end
// Network domain
// keep-sorted start block=yes
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters {
return Parser.Network.parseAddInterceptParameters(params);
}
parseContinueRequestParams(
params: unknown,
): Network.ContinueRequestParameters {
return Parser.Network.parseContinueRequestParameters(params);
}
parseContinueResponseParams(
params: unknown,
): Network.ContinueResponseParameters {
return Parser.Network.parseContinueResponseParameters(params);
}
parseContinueWithAuthParams(
params: unknown,
): Network.ContinueWithAuthParameters {
return Parser.Network.parseContinueWithAuthParameters(params);
}
parseFailRequestParams(params: unknown): Network.FailRequestParameters {
return Parser.Network.parseFailRequestParameters(params);
}
parseProvideResponseParams(
params: unknown,
): Network.ProvideResponseParameters {
return Parser.Network.parseProvideResponseParameters(params);
}
parseRemoveInterceptParams(
params: unknown,
): Network.RemoveInterceptParameters {
return Parser.Network.parseRemoveInterceptParameters(params);
}
parseSetCacheBehavior(params: unknown): Network.SetCacheBehaviorParameters {
return Parser.Network.parseSetCacheBehavior(params);
}
// keep-sorted end
// Permissions domain
// keep-sorted start block=yes
parseSetPermissionsParams(
params: unknown,
): Permissions.SetPermissionParameters {
return Parser.Permissions.parseSetPermissionsParams(params);
}
// keep-sorted end
// Script domain
// keep-sorted start block=yes
parseAddPreloadScriptParams(
params: unknown,
): Script.AddPreloadScriptParameters {
return Parser.Script.parseAddPreloadScriptParams(params);
}
parseCallFunctionParams(params: unknown): Script.CallFunctionParameters {
return Parser.Script.parseCallFunctionParams(params);
}
parseDisownParams(params: unknown): Script.DisownParameters {
return Parser.Script.parseDisownParams(params);
}
parseEvaluateParams(params: unknown): Script.EvaluateParameters {
return Parser.Script.parseEvaluateParams(params);
}
parseGetRealmsParams(params: unknown): Script.GetRealmsParameters {
return Parser.Script.parseGetRealmsParams(params);
}
parseRemovePreloadScriptParams(
params: unknown,
): Script.RemovePreloadScriptParameters {
return Parser.Script.parseRemovePreloadScriptParams(params);
}
// keep-sorted end
// Session domain
// keep-sorted start block=yes
parseSubscribeParams(params: unknown): Session.SubscriptionRequest {
return Parser.Session.parseSubscribeParams(params);
}
// keep-sorted end
// Storage domain
// keep-sorted start block=yes
parseDeleteCookiesParams(params: unknown): Storage.DeleteCookiesParameters {
return Parser.Storage.parseDeleteCookiesParams(params);
}
parseGetCookiesParams(params: unknown): Storage.GetCookiesParameters {
return Parser.Storage.parseGetCookiesParams(params);
}
parseSetCookieParams(params: unknown): Storage.SetCookieParameters {
return Parser.Storage.parseSetCookieParams(params);
}
// keep-sorted end
}