webdriver-bidi-protocol 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  version: 2
2
- # bump 3
2
+ # bump 4
3
3
  updates:
4
4
  - package-ecosystem: npm
5
5
  directory: /
@@ -32,6 +32,9 @@ updates:
32
32
  directory: /
33
33
  schedule:
34
34
  interval: daily
35
- open-pull-requests-limit: 5
36
35
  labels:
37
36
  - commit-updates
37
+ groups:
38
+ all:
39
+ patterns:
40
+ - '*'
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.0"
2
+ ".": "0.3.2"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.3.1...webdriver-bidi-protocol-v0.3.2) (2025-09-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * re-generate types based on specifciation updates ([#257](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/257)) ([d5a2c22](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d5a2c22c5623f914ad309fc78f58bf90e610e816))
9
+
10
+ ## [0.3.1](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.3.0...webdriver-bidi-protocol-v0.3.1) (2025-09-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * generation of mapping ([#251](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/251)) ([6c52528](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/6c52528e916d47188659904c67fca20c752f714f))
16
+ * re-generate types based on specifciation updates ([#249](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/249)) ([d625fd2](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d625fd2e173294e9a80bd3e90572b85c168c3137))
17
+ * re-generate types based on specifciation updates ([#252](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/issues/252)) ([d045d7b](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/commit/d045d7bef06acd6a7df6508ec90f3a178b95070a))
18
+
3
19
  ## [0.3.0](https://github.com/GoogleChromeLabs/webdriver-bidi-protocol/compare/webdriver-bidi-protocol-v0.2.11...webdriver-bidi-protocol-v0.3.0) (2025-09-15)
4
20
 
5
21
 
package/out/gen/main.d.ts CHANGED
@@ -198,10 +198,6 @@ export declare namespace Session {
198
198
  export declare namespace Session {
199
199
  type UnsubscribeByAttributesRequest = {
200
200
  events: [string, ...string[]];
201
- contexts?: [
202
- BrowsingContext.BrowsingContext,
203
- ...BrowsingContext.BrowsingContext[],
204
- ];
205
201
  };
206
202
  }
207
203
  export declare namespace Session {
@@ -277,7 +273,8 @@ export type BrowserCommand =
277
273
  | Browser.GetClientWindows
278
274
  | Browser.GetUserContexts
279
275
  | Browser.RemoveUserContext
280
- | Browser.SetClientWindowState;
276
+ | Browser.SetClientWindowState
277
+ | Browser.SetDownloadBehavior;
281
278
  export type BrowserResult =
282
279
  | Browser.CreateUserContextResult
283
280
  | Browser.GetUserContextsResult;
@@ -383,6 +380,34 @@ export declare namespace Browser {
383
380
  y?: JsInt;
384
381
  };
385
382
  }
383
+ export declare namespace Browser {
384
+ type SetDownloadBehavior = {
385
+ method: 'browser.setDownloadBehavior';
386
+ params: Browser.SetDownloadBehaviorParameters;
387
+ };
388
+ }
389
+ export declare namespace Browser {
390
+ type SetDownloadBehaviorParameters = {
391
+ downloadBehavior: Browser.DownloadBehavior | null;
392
+ userContexts?: [Browser.UserContext, ...Browser.UserContext[]];
393
+ };
394
+ }
395
+ export declare namespace Browser {
396
+ type DownloadBehavior =
397
+ | Browser.DownloadBehaviorAllowed
398
+ | Browser.DownloadBehaviorDenied;
399
+ }
400
+ export declare namespace Browser {
401
+ type DownloadBehaviorAllowed = {
402
+ type: 'allowed';
403
+ destinationFolder: string;
404
+ };
405
+ }
406
+ export declare namespace Browser {
407
+ type DownloadBehaviorDenied = {
408
+ type: 'denied';
409
+ };
410
+ }
386
411
  export type BrowsingContextCommand =
387
412
  | BrowsingContext.Activate
388
413
  | BrowsingContext.CaptureScreenshot
@@ -1641,7 +1666,8 @@ export type ScriptCommand =
1641
1666
  export type ScriptResult =
1642
1667
  | Script.AddPreloadScriptResult
1643
1668
  | Script.EvaluateResult
1644
- | Script.GetRealmsResult;
1669
+ | Script.GetRealmsResult
1670
+ | Script.CallFunctionResult;
1645
1671
  export type ScriptEvent =
1646
1672
  | Script.Message
1647
1673
  | Script.RealmCreated
@@ -2209,6 +2235,9 @@ export declare namespace Script {
2209
2235
  userActivation?: boolean;
2210
2236
  };
2211
2237
  }
2238
+ export declare namespace Script {
2239
+ type CallFunctionResult = Script.EvaluateResult;
2240
+ }
2212
2241
  export declare namespace Script {
2213
2242
  type Evaluate = {
2214
2243
  method: 'script.evaluate';
@@ -4,255 +4,259 @@ import type * as BidiBluetooth from './web-bluetooth.ts';
4
4
  export interface CommandMapping {
5
5
  'bluetooth.disableSimulation': {
6
6
  params: BidiBluetooth.Bluetooth.DisableSimulationParameters;
7
- returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters;
7
+ returnType: Bidi.EmptyResult;
8
8
  };
9
9
  'bluetooth.handleRequestDevicePrompt': {
10
10
  params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
11
- returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
11
+ returnType: Bidi.EmptyResult;
12
12
  };
13
13
  'bluetooth.simulateAdapter': {
14
14
  params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
15
- returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
15
+ returnType: Bidi.EmptyResult;
16
16
  };
17
17
  'bluetooth.simulateAdvertisement': {
18
18
  params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
19
- returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
19
+ returnType: Bidi.EmptyResult;
20
20
  };
21
21
  'bluetooth.simulateCharacteristic': {
22
22
  params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters;
23
- returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters;
23
+ returnType: Bidi.EmptyResult;
24
24
  };
25
25
  'bluetooth.simulateCharacteristicResponse': {
26
26
  params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters;
27
- returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters;
27
+ returnType: Bidi.EmptyResult;
28
28
  };
29
29
  'bluetooth.simulateDescriptor': {
30
30
  params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters;
31
- returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters;
31
+ returnType: Bidi.EmptyResult;
32
32
  };
33
33
  'bluetooth.simulateDescriptorResponse': {
34
34
  params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters;
35
- returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters;
35
+ returnType: Bidi.EmptyResult;
36
36
  };
37
37
  'bluetooth.simulateGattConnectionResponse': {
38
38
  params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters;
39
- returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters;
39
+ returnType: Bidi.EmptyResult;
40
40
  };
41
41
  'bluetooth.simulateGattDisconnection': {
42
42
  params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters;
43
- returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters;
43
+ returnType: Bidi.EmptyResult;
44
44
  };
45
45
  'bluetooth.simulatePreconnectedPeripheral': {
46
46
  params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters;
47
- returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters;
47
+ returnType: Bidi.EmptyResult;
48
48
  };
49
49
  'bluetooth.simulateService': {
50
50
  params: BidiBluetooth.Bluetooth.SimulateServiceParameters;
51
- returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters;
51
+ returnType: Bidi.EmptyResult;
52
52
  };
53
53
  'browser.close': {
54
54
  params: Bidi.Extensible;
55
- returnType: Bidi.Extensible;
55
+ returnType: Bidi.EmptyResult;
56
56
  };
57
57
  'browser.createUserContext': {
58
58
  params: Bidi.Browser.CreateUserContextParameters;
59
- returnType: Bidi.Browser.CreateUserContextParameters;
59
+ returnType: Bidi.Browser.CreateUserContextResult;
60
60
  };
61
61
  'browser.getClientWindows': {
62
62
  params: Bidi.Extensible;
63
- returnType: Bidi.Extensible;
63
+ returnType: Bidi.Browser.GetClientWindowsResult;
64
64
  };
65
65
  'browser.getUserContexts': {
66
66
  params: Bidi.Extensible;
67
- returnType: Bidi.Extensible;
67
+ returnType: Bidi.Browser.GetUserContextsResult;
68
68
  };
69
69
  'browser.removeUserContext': {
70
70
  params: Bidi.Browser.RemoveUserContextParameters;
71
- returnType: Bidi.Browser.RemoveUserContextParameters;
71
+ returnType: Bidi.EmptyResult;
72
72
  };
73
73
  'browser.setClientWindowState': {
74
74
  params: Bidi.Browser.SetClientWindowStateParameters;
75
- returnType: Bidi.Browser.SetClientWindowStateParameters;
75
+ returnType: Bidi.EmptyResult;
76
+ };
77
+ 'browser.setDownloadBehavior': {
78
+ params: Bidi.Browser.SetDownloadBehaviorParameters;
79
+ returnType: Bidi.EmptyResult;
76
80
  };
77
81
  'browsingContext.activate': {
78
82
  params: Bidi.BrowsingContext.ActivateParameters;
79
- returnType: Bidi.BrowsingContext.ActivateParameters;
83
+ returnType: Bidi.EmptyResult;
80
84
  };
81
85
  'browsingContext.captureScreenshot': {
82
86
  params: Bidi.BrowsingContext.CaptureScreenshotParameters;
83
- returnType: Bidi.BrowsingContext.CaptureScreenshotParameters;
87
+ returnType: Bidi.BrowsingContext.CaptureScreenshotResult;
84
88
  };
85
89
  'browsingContext.close': {
86
90
  params: Bidi.BrowsingContext.CloseParameters;
87
- returnType: Bidi.BrowsingContext.CloseParameters;
91
+ returnType: Bidi.EmptyResult;
88
92
  };
89
93
  'browsingContext.create': {
90
94
  params: Bidi.BrowsingContext.CreateParameters;
91
- returnType: Bidi.BrowsingContext.CreateParameters;
95
+ returnType: Bidi.BrowsingContext.CreateResult;
92
96
  };
93
97
  'browsingContext.getTree': {
94
98
  params: Bidi.BrowsingContext.GetTreeParameters;
95
- returnType: Bidi.BrowsingContext.GetTreeParameters;
99
+ returnType: Bidi.BrowsingContext.GetTreeResult;
96
100
  };
97
101
  'browsingContext.handleUserPrompt': {
98
102
  params: Bidi.BrowsingContext.HandleUserPromptParameters;
99
- returnType: Bidi.BrowsingContext.HandleUserPromptParameters;
103
+ returnType: Bidi.EmptyResult;
100
104
  };
101
105
  'browsingContext.locateNodes': {
102
106
  params: Bidi.BrowsingContext.LocateNodesParameters;
103
- returnType: Bidi.BrowsingContext.LocateNodesParameters;
107
+ returnType: Bidi.BrowsingContext.LocateNodesResult;
104
108
  };
105
109
  'browsingContext.navigate': {
106
110
  params: Bidi.BrowsingContext.NavigateParameters;
107
- returnType: Bidi.BrowsingContext.NavigateParameters;
111
+ returnType: Bidi.BrowsingContext.NavigateResult;
108
112
  };
109
113
  'browsingContext.print': {
110
114
  params: Bidi.BrowsingContext.PrintParameters;
111
- returnType: Bidi.BrowsingContext.PrintParameters;
115
+ returnType: Bidi.BrowsingContext.PrintResult;
112
116
  };
113
117
  'browsingContext.reload': {
114
118
  params: Bidi.BrowsingContext.ReloadParameters;
115
- returnType: Bidi.BrowsingContext.ReloadParameters;
119
+ returnType: Bidi.EmptyResult;
116
120
  };
117
121
  'browsingContext.setViewport': {
118
122
  params: Bidi.BrowsingContext.SetViewportParameters;
119
- returnType: Bidi.BrowsingContext.SetViewportParameters;
123
+ returnType: Bidi.EmptyResult;
120
124
  };
121
125
  'browsingContext.traverseHistory': {
122
126
  params: Bidi.BrowsingContext.TraverseHistoryParameters;
123
- returnType: Bidi.BrowsingContext.TraverseHistoryParameters;
127
+ returnType: Bidi.BrowsingContext.TraverseHistoryResult;
124
128
  };
125
129
  'emulation.setForcedColorsModeThemeOverride': {
126
130
  params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters;
127
- returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters;
131
+ returnType: Bidi.EmptyResult;
128
132
  };
129
133
  'emulation.setGeolocationOverride': {
130
134
  params: Bidi.Emulation.SetGeolocationOverrideParameters;
131
- returnType: Bidi.Emulation.SetGeolocationOverrideParameters;
135
+ returnType: Bidi.EmptyResult;
132
136
  };
133
137
  'emulation.setLocaleOverride': {
134
138
  params: Bidi.Emulation.SetLocaleOverrideParameters;
135
- returnType: Bidi.Emulation.SetLocaleOverrideParameters;
139
+ returnType: Bidi.EmptyResult;
136
140
  };
137
141
  'emulation.setScreenOrientationOverride': {
138
142
  params: Bidi.Emulation.SetScreenOrientationOverrideParameters;
139
- returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters;
143
+ returnType: Bidi.EmptyResult;
140
144
  };
141
145
  'emulation.setScriptingEnabled': {
142
146
  params: Bidi.Emulation.SetScriptingEnabledParameters;
143
- returnType: Bidi.Emulation.SetScriptingEnabledParameters;
147
+ returnType: Bidi.EmptyResult;
144
148
  };
145
149
  'emulation.setTimezoneOverride': {
146
150
  params: Bidi.Emulation.SetTimezoneOverrideParameters;
147
- returnType: Bidi.Emulation.SetTimezoneOverrideParameters;
151
+ returnType: Bidi.EmptyResult;
148
152
  };
149
153
  'emulation.setUserAgentOverride': {
150
154
  params: Bidi.Emulation.SetUserAgentOverrideParameters;
151
- returnType: Bidi.Emulation.SetUserAgentOverrideParameters;
155
+ returnType: Bidi.EmptyResult;
152
156
  };
153
157
  'input.performActions': {
154
158
  params: Bidi.Input.PerformActionsParameters;
155
- returnType: Bidi.Input.PerformActionsParameters;
159
+ returnType: Bidi.EmptyResult;
156
160
  };
157
161
  'input.releaseActions': {
158
162
  params: Bidi.Input.ReleaseActionsParameters;
159
- returnType: Bidi.Input.ReleaseActionsParameters;
163
+ returnType: Bidi.EmptyResult;
160
164
  };
161
165
  'input.setFiles': {
162
166
  params: Bidi.Input.SetFilesParameters;
163
- returnType: Bidi.Input.SetFilesParameters;
167
+ returnType: Bidi.EmptyResult;
164
168
  };
165
169
  'network.addDataCollector': {
166
170
  params: Bidi.Network.AddDataCollectorParameters;
167
- returnType: Bidi.Network.AddDataCollectorParameters;
171
+ returnType: Bidi.Network.AddDataCollectorResult;
168
172
  };
169
173
  'network.addIntercept': {
170
174
  params: Bidi.Network.AddInterceptParameters;
171
- returnType: Bidi.Network.AddInterceptParameters;
175
+ returnType: Bidi.Network.AddInterceptResult;
172
176
  };
173
177
  'network.continueRequest': {
174
178
  params: Bidi.Network.ContinueRequestParameters;
175
- returnType: Bidi.Network.ContinueRequestParameters;
179
+ returnType: Bidi.EmptyResult;
176
180
  };
177
181
  'network.continueResponse': {
178
182
  params: Bidi.Network.ContinueResponseParameters;
179
- returnType: Bidi.Network.ContinueResponseParameters;
183
+ returnType: Bidi.EmptyResult;
180
184
  };
181
185
  'network.continueWithAuth': {
182
186
  params: Bidi.Network.ContinueWithAuthParameters;
183
- returnType: Bidi.Network.ContinueWithAuthParameters;
187
+ returnType: Bidi.EmptyResult;
184
188
  };
185
189
  'network.disownData': {
186
190
  params: Bidi.Network.DisownDataParameters;
187
- returnType: Bidi.Network.DisownDataParameters;
191
+ returnType: Bidi.EmptyResult;
188
192
  };
189
193
  'network.failRequest': {
190
194
  params: Bidi.Network.FailRequestParameters;
191
- returnType: Bidi.Network.FailRequestParameters;
195
+ returnType: Bidi.EmptyResult;
192
196
  };
193
197
  'network.getData': {
194
198
  params: Bidi.Network.GetDataParameters;
195
- returnType: Bidi.Network.GetDataParameters;
199
+ returnType: Bidi.Network.GetDataResult;
196
200
  };
197
201
  'network.provideResponse': {
198
202
  params: Bidi.Network.ProvideResponseParameters;
199
- returnType: Bidi.Network.ProvideResponseParameters;
203
+ returnType: Bidi.EmptyResult;
200
204
  };
201
205
  'network.removeDataCollector': {
202
206
  params: Bidi.Network.RemoveDataCollectorParameters;
203
- returnType: Bidi.Network.RemoveDataCollectorParameters;
207
+ returnType: Bidi.EmptyResult;
204
208
  };
205
209
  'network.removeIntercept': {
206
210
  params: Bidi.Network.RemoveInterceptParameters;
207
- returnType: Bidi.Network.RemoveInterceptParameters;
211
+ returnType: Bidi.EmptyResult;
208
212
  };
209
213
  'network.setCacheBehavior': {
210
214
  params: Bidi.Network.SetCacheBehaviorParameters;
211
- returnType: Bidi.Network.SetCacheBehaviorParameters;
215
+ returnType: Bidi.EmptyResult;
212
216
  };
213
217
  'network.setExtraHeaders': {
214
218
  params: Bidi.Network.SetExtraHeadersParameters;
215
- returnType: Bidi.Network.SetExtraHeadersParameters;
219
+ returnType: Bidi.EmptyResult;
216
220
  };
217
221
  'permissions.setPermission': {
218
222
  params: BidiPermissions.Permissions.SetPermissionParameters;
219
- returnType: BidiPermissions.Permissions.SetPermissionParameters;
223
+ returnType: Bidi.EmptyResult;
220
224
  };
221
225
  'script.addPreloadScript': {
222
226
  params: Bidi.Script.AddPreloadScriptParameters;
223
- returnType: Bidi.Script.AddPreloadScriptParameters;
227
+ returnType: Bidi.Script.AddPreloadScriptResult;
224
228
  };
225
229
  'script.callFunction': {
226
230
  params: Bidi.Script.CallFunctionParameters;
227
- returnType: Bidi.Script.CallFunctionParameters;
231
+ returnType: Bidi.Script.CallFunctionResult;
228
232
  };
229
233
  'script.disown': {
230
234
  params: Bidi.Script.DisownParameters;
231
- returnType: Bidi.Script.DisownParameters;
235
+ returnType: Bidi.EmptyResult;
232
236
  };
233
237
  'script.evaluate': {
234
238
  params: Bidi.Script.EvaluateParameters;
235
- returnType: Bidi.Script.EvaluateParameters;
239
+ returnType: Bidi.Script.EvaluateResult;
236
240
  };
237
241
  'script.getRealms': {
238
242
  params: Bidi.Script.GetRealmsParameters;
239
- returnType: Bidi.Script.GetRealmsParameters;
243
+ returnType: Bidi.Script.GetRealmsResult;
240
244
  };
241
245
  'script.removePreloadScript': {
242
246
  params: Bidi.Script.RemovePreloadScriptParameters;
243
- returnType: Bidi.Script.RemovePreloadScriptParameters;
247
+ returnType: Bidi.EmptyResult;
244
248
  };
245
249
  'session.end': {
246
250
  params: Bidi.Extensible;
247
- returnType: Bidi.Extensible;
251
+ returnType: Bidi.EmptyResult;
248
252
  };
249
253
  'session.new': {
250
254
  params: Bidi.Session.NewParameters;
251
- returnType: Bidi.Session.NewParameters;
255
+ returnType: Bidi.Session.NewResult;
252
256
  };
253
257
  'session.status': {
254
258
  params: Bidi.Extensible;
255
- returnType: Bidi.Extensible;
259
+ returnType: Bidi.Session.StatusResult;
256
260
  };
257
261
  'session.subscribe': {
258
262
  params: Bidi.Session.SubscriptionRequest;
@@ -260,26 +264,26 @@ export interface CommandMapping {
260
264
  };
261
265
  'session.unsubscribe': {
262
266
  params: Bidi.Session.UnsubscribeParameters;
263
- returnType: Bidi.Session.UnsubscribeParameters;
267
+ returnType: Bidi.EmptyResult;
264
268
  };
265
269
  'storage.deleteCookies': {
266
270
  params: Bidi.Storage.DeleteCookiesParameters;
267
- returnType: Bidi.Storage.DeleteCookiesParameters;
271
+ returnType: Bidi.Storage.DeleteCookiesResult;
268
272
  };
269
273
  'storage.getCookies': {
270
274
  params: Bidi.Storage.GetCookiesParameters;
271
- returnType: Bidi.Storage.GetCookiesParameters;
275
+ returnType: Bidi.Storage.GetCookiesResult;
272
276
  };
273
277
  'storage.setCookie': {
274
278
  params: Bidi.Storage.SetCookieParameters;
275
- returnType: Bidi.Storage.SetCookieParameters;
279
+ returnType: Bidi.Storage.SetCookieResult;
276
280
  };
277
281
  'webExtension.install': {
278
282
  params: Bidi.WebExtension.InstallParameters;
279
- returnType: Bidi.WebExtension.InstallParameters;
283
+ returnType: Bidi.WebExtension.InstallResult;
280
284
  };
281
285
  'webExtension.uninstall': {
282
286
  params: Bidi.WebExtension.UninstallParameters;
283
- returnType: Bidi.WebExtension.UninstallParameters;
287
+ returnType: Bidi.EmptyResult;
284
288
  };
285
289
  }
@@ -51,8 +51,7 @@ export type BluetoothCommand =
51
51
  | Bluetooth.SimulateCharacteristic
52
52
  | Bluetooth.SimulateCharacteristicResponse
53
53
  | Bluetooth.SimulateDescriptor
54
- | Bluetooth.SimulateDescriptorResponse
55
- | Record<string, never>;
54
+ | Bluetooth.SimulateDescriptorResponse;
56
55
  export declare namespace Bluetooth {
57
56
  type HandleRequestDevicePrompt = {
58
57
  method: 'bluetooth.handleRequestDevicePrompt';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdriver-bidi-protocol",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
package/src/gen/main.ts CHANGED
@@ -200,10 +200,6 @@ export namespace Session {
200
200
  export namespace Session {
201
201
  export type UnsubscribeByAttributesRequest = {
202
202
  events: [string, ...string[]];
203
- contexts?: [
204
- BrowsingContext.BrowsingContext,
205
- ...BrowsingContext.BrowsingContext[],
206
- ];
207
203
  };
208
204
  }
209
205
  export namespace Session {
@@ -279,7 +275,8 @@ export type BrowserCommand =
279
275
  | Browser.GetClientWindows
280
276
  | Browser.GetUserContexts
281
277
  | Browser.RemoveUserContext
282
- | Browser.SetClientWindowState;
278
+ | Browser.SetClientWindowState
279
+ | Browser.SetDownloadBehavior;
283
280
  export type BrowserResult =
284
281
  | Browser.CreateUserContextResult
285
282
  | Browser.GetUserContextsResult;
@@ -385,6 +382,34 @@ export namespace Browser {
385
382
  y?: JsInt;
386
383
  };
387
384
  }
385
+ export namespace Browser {
386
+ export type SetDownloadBehavior = {
387
+ method: 'browser.setDownloadBehavior';
388
+ params: Browser.SetDownloadBehaviorParameters;
389
+ };
390
+ }
391
+ export namespace Browser {
392
+ export type SetDownloadBehaviorParameters = {
393
+ downloadBehavior: Browser.DownloadBehavior | null;
394
+ userContexts?: [Browser.UserContext, ...Browser.UserContext[]];
395
+ };
396
+ }
397
+ export namespace Browser {
398
+ export type DownloadBehavior =
399
+ | Browser.DownloadBehaviorAllowed
400
+ | Browser.DownloadBehaviorDenied;
401
+ }
402
+ export namespace Browser {
403
+ export type DownloadBehaviorAllowed = {
404
+ type: 'allowed';
405
+ destinationFolder: string;
406
+ };
407
+ }
408
+ export namespace Browser {
409
+ export type DownloadBehaviorDenied = {
410
+ type: 'denied';
411
+ };
412
+ }
388
413
  export type BrowsingContextCommand =
389
414
  | BrowsingContext.Activate
390
415
  | BrowsingContext.CaptureScreenshot
@@ -1643,7 +1668,8 @@ export type ScriptCommand =
1643
1668
  export type ScriptResult =
1644
1669
  | Script.AddPreloadScriptResult
1645
1670
  | Script.EvaluateResult
1646
- | Script.GetRealmsResult;
1671
+ | Script.GetRealmsResult
1672
+ | Script.CallFunctionResult;
1647
1673
  export type ScriptEvent =
1648
1674
  | Script.Message
1649
1675
  | Script.RealmCreated
@@ -2213,6 +2239,9 @@ export namespace Script {
2213
2239
  userActivation?: boolean;
2214
2240
  };
2215
2241
  }
2242
+ export namespace Script {
2243
+ export type CallFunctionResult = Script.EvaluateResult;
2244
+ }
2216
2245
  export namespace Script {
2217
2246
  export type Evaluate = {
2218
2247
  method: 'script.evaluate';
@@ -5,255 +5,259 @@ import type * as BidiBluetooth from './web-bluetooth.ts';
5
5
  export interface CommandMapping {
6
6
  'bluetooth.disableSimulation': {
7
7
  params: BidiBluetooth.Bluetooth.DisableSimulationParameters;
8
- returnType: BidiBluetooth.Bluetooth.DisableSimulationParameters;
8
+ returnType: Bidi.EmptyResult;
9
9
  };
10
10
  'bluetooth.handleRequestDevicePrompt': {
11
11
  params: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
12
- returnType: BidiBluetooth.Bluetooth.HandleRequestDevicePromptParameters;
12
+ returnType: Bidi.EmptyResult;
13
13
  };
14
14
  'bluetooth.simulateAdapter': {
15
15
  params: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
16
- returnType: BidiBluetooth.Bluetooth.SimulateAdapterParameters;
16
+ returnType: Bidi.EmptyResult;
17
17
  };
18
18
  'bluetooth.simulateAdvertisement': {
19
19
  params: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
20
- returnType: BidiBluetooth.Bluetooth.SimulateAdvertisementParameters;
20
+ returnType: Bidi.EmptyResult;
21
21
  };
22
22
  'bluetooth.simulateCharacteristic': {
23
23
  params: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters;
24
- returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicParameters;
24
+ returnType: Bidi.EmptyResult;
25
25
  };
26
26
  'bluetooth.simulateCharacteristicResponse': {
27
27
  params: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters;
28
- returnType: BidiBluetooth.Bluetooth.SimulateCharacteristicResponseParameters;
28
+ returnType: Bidi.EmptyResult;
29
29
  };
30
30
  'bluetooth.simulateDescriptor': {
31
31
  params: BidiBluetooth.Bluetooth.SimulateDescriptorParameters;
32
- returnType: BidiBluetooth.Bluetooth.SimulateDescriptorParameters;
32
+ returnType: Bidi.EmptyResult;
33
33
  };
34
34
  'bluetooth.simulateDescriptorResponse': {
35
35
  params: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters;
36
- returnType: BidiBluetooth.Bluetooth.SimulateDescriptorResponseParameters;
36
+ returnType: Bidi.EmptyResult;
37
37
  };
38
38
  'bluetooth.simulateGattConnectionResponse': {
39
39
  params: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters;
40
- returnType: BidiBluetooth.Bluetooth.SimulateGattConnectionResponseParameters;
40
+ returnType: Bidi.EmptyResult;
41
41
  };
42
42
  'bluetooth.simulateGattDisconnection': {
43
43
  params: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters;
44
- returnType: BidiBluetooth.Bluetooth.SimulateGattDisconnectionParameters;
44
+ returnType: Bidi.EmptyResult;
45
45
  };
46
46
  'bluetooth.simulatePreconnectedPeripheral': {
47
47
  params: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters;
48
- returnType: BidiBluetooth.Bluetooth.SimulatePreconnectedPeripheralParameters;
48
+ returnType: Bidi.EmptyResult;
49
49
  };
50
50
  'bluetooth.simulateService': {
51
51
  params: BidiBluetooth.Bluetooth.SimulateServiceParameters;
52
- returnType: BidiBluetooth.Bluetooth.SimulateServiceParameters;
52
+ returnType: Bidi.EmptyResult;
53
53
  };
54
54
  'browser.close': {
55
55
  params: Bidi.Extensible;
56
- returnType: Bidi.Extensible;
56
+ returnType: Bidi.EmptyResult;
57
57
  };
58
58
  'browser.createUserContext': {
59
59
  params: Bidi.Browser.CreateUserContextParameters;
60
- returnType: Bidi.Browser.CreateUserContextParameters;
60
+ returnType: Bidi.Browser.CreateUserContextResult;
61
61
  };
62
62
  'browser.getClientWindows': {
63
63
  params: Bidi.Extensible;
64
- returnType: Bidi.Extensible;
64
+ returnType: Bidi.Browser.GetClientWindowsResult;
65
65
  };
66
66
  'browser.getUserContexts': {
67
67
  params: Bidi.Extensible;
68
- returnType: Bidi.Extensible;
68
+ returnType: Bidi.Browser.GetUserContextsResult;
69
69
  };
70
70
  'browser.removeUserContext': {
71
71
  params: Bidi.Browser.RemoveUserContextParameters;
72
- returnType: Bidi.Browser.RemoveUserContextParameters;
72
+ returnType: Bidi.EmptyResult;
73
73
  };
74
74
  'browser.setClientWindowState': {
75
75
  params: Bidi.Browser.SetClientWindowStateParameters;
76
- returnType: Bidi.Browser.SetClientWindowStateParameters;
76
+ returnType: Bidi.EmptyResult;
77
+ };
78
+ 'browser.setDownloadBehavior': {
79
+ params: Bidi.Browser.SetDownloadBehaviorParameters;
80
+ returnType: Bidi.EmptyResult;
77
81
  };
78
82
  'browsingContext.activate': {
79
83
  params: Bidi.BrowsingContext.ActivateParameters;
80
- returnType: Bidi.BrowsingContext.ActivateParameters;
84
+ returnType: Bidi.EmptyResult;
81
85
  };
82
86
  'browsingContext.captureScreenshot': {
83
87
  params: Bidi.BrowsingContext.CaptureScreenshotParameters;
84
- returnType: Bidi.BrowsingContext.CaptureScreenshotParameters;
88
+ returnType: Bidi.BrowsingContext.CaptureScreenshotResult;
85
89
  };
86
90
  'browsingContext.close': {
87
91
  params: Bidi.BrowsingContext.CloseParameters;
88
- returnType: Bidi.BrowsingContext.CloseParameters;
92
+ returnType: Bidi.EmptyResult;
89
93
  };
90
94
  'browsingContext.create': {
91
95
  params: Bidi.BrowsingContext.CreateParameters;
92
- returnType: Bidi.BrowsingContext.CreateParameters;
96
+ returnType: Bidi.BrowsingContext.CreateResult;
93
97
  };
94
98
  'browsingContext.getTree': {
95
99
  params: Bidi.BrowsingContext.GetTreeParameters;
96
- returnType: Bidi.BrowsingContext.GetTreeParameters;
100
+ returnType: Bidi.BrowsingContext.GetTreeResult;
97
101
  };
98
102
  'browsingContext.handleUserPrompt': {
99
103
  params: Bidi.BrowsingContext.HandleUserPromptParameters;
100
- returnType: Bidi.BrowsingContext.HandleUserPromptParameters;
104
+ returnType: Bidi.EmptyResult;
101
105
  };
102
106
  'browsingContext.locateNodes': {
103
107
  params: Bidi.BrowsingContext.LocateNodesParameters;
104
- returnType: Bidi.BrowsingContext.LocateNodesParameters;
108
+ returnType: Bidi.BrowsingContext.LocateNodesResult;
105
109
  };
106
110
  'browsingContext.navigate': {
107
111
  params: Bidi.BrowsingContext.NavigateParameters;
108
- returnType: Bidi.BrowsingContext.NavigateParameters;
112
+ returnType: Bidi.BrowsingContext.NavigateResult;
109
113
  };
110
114
  'browsingContext.print': {
111
115
  params: Bidi.BrowsingContext.PrintParameters;
112
- returnType: Bidi.BrowsingContext.PrintParameters;
116
+ returnType: Bidi.BrowsingContext.PrintResult;
113
117
  };
114
118
  'browsingContext.reload': {
115
119
  params: Bidi.BrowsingContext.ReloadParameters;
116
- returnType: Bidi.BrowsingContext.ReloadParameters;
120
+ returnType: Bidi.EmptyResult;
117
121
  };
118
122
  'browsingContext.setViewport': {
119
123
  params: Bidi.BrowsingContext.SetViewportParameters;
120
- returnType: Bidi.BrowsingContext.SetViewportParameters;
124
+ returnType: Bidi.EmptyResult;
121
125
  };
122
126
  'browsingContext.traverseHistory': {
123
127
  params: Bidi.BrowsingContext.TraverseHistoryParameters;
124
- returnType: Bidi.BrowsingContext.TraverseHistoryParameters;
128
+ returnType: Bidi.BrowsingContext.TraverseHistoryResult;
125
129
  };
126
130
  'emulation.setForcedColorsModeThemeOverride': {
127
131
  params: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters;
128
- returnType: Bidi.Emulation.SetForcedColorsModeThemeOverrideParameters;
132
+ returnType: Bidi.EmptyResult;
129
133
  };
130
134
  'emulation.setGeolocationOverride': {
131
135
  params: Bidi.Emulation.SetGeolocationOverrideParameters;
132
- returnType: Bidi.Emulation.SetGeolocationOverrideParameters;
136
+ returnType: Bidi.EmptyResult;
133
137
  };
134
138
  'emulation.setLocaleOverride': {
135
139
  params: Bidi.Emulation.SetLocaleOverrideParameters;
136
- returnType: Bidi.Emulation.SetLocaleOverrideParameters;
140
+ returnType: Bidi.EmptyResult;
137
141
  };
138
142
  'emulation.setScreenOrientationOverride': {
139
143
  params: Bidi.Emulation.SetScreenOrientationOverrideParameters;
140
- returnType: Bidi.Emulation.SetScreenOrientationOverrideParameters;
144
+ returnType: Bidi.EmptyResult;
141
145
  };
142
146
  'emulation.setScriptingEnabled': {
143
147
  params: Bidi.Emulation.SetScriptingEnabledParameters;
144
- returnType: Bidi.Emulation.SetScriptingEnabledParameters;
148
+ returnType: Bidi.EmptyResult;
145
149
  };
146
150
  'emulation.setTimezoneOverride': {
147
151
  params: Bidi.Emulation.SetTimezoneOverrideParameters;
148
- returnType: Bidi.Emulation.SetTimezoneOverrideParameters;
152
+ returnType: Bidi.EmptyResult;
149
153
  };
150
154
  'emulation.setUserAgentOverride': {
151
155
  params: Bidi.Emulation.SetUserAgentOverrideParameters;
152
- returnType: Bidi.Emulation.SetUserAgentOverrideParameters;
156
+ returnType: Bidi.EmptyResult;
153
157
  };
154
158
  'input.performActions': {
155
159
  params: Bidi.Input.PerformActionsParameters;
156
- returnType: Bidi.Input.PerformActionsParameters;
160
+ returnType: Bidi.EmptyResult;
157
161
  };
158
162
  'input.releaseActions': {
159
163
  params: Bidi.Input.ReleaseActionsParameters;
160
- returnType: Bidi.Input.ReleaseActionsParameters;
164
+ returnType: Bidi.EmptyResult;
161
165
  };
162
166
  'input.setFiles': {
163
167
  params: Bidi.Input.SetFilesParameters;
164
- returnType: Bidi.Input.SetFilesParameters;
168
+ returnType: Bidi.EmptyResult;
165
169
  };
166
170
  'network.addDataCollector': {
167
171
  params: Bidi.Network.AddDataCollectorParameters;
168
- returnType: Bidi.Network.AddDataCollectorParameters;
172
+ returnType: Bidi.Network.AddDataCollectorResult;
169
173
  };
170
174
  'network.addIntercept': {
171
175
  params: Bidi.Network.AddInterceptParameters;
172
- returnType: Bidi.Network.AddInterceptParameters;
176
+ returnType: Bidi.Network.AddInterceptResult;
173
177
  };
174
178
  'network.continueRequest': {
175
179
  params: Bidi.Network.ContinueRequestParameters;
176
- returnType: Bidi.Network.ContinueRequestParameters;
180
+ returnType: Bidi.EmptyResult;
177
181
  };
178
182
  'network.continueResponse': {
179
183
  params: Bidi.Network.ContinueResponseParameters;
180
- returnType: Bidi.Network.ContinueResponseParameters;
184
+ returnType: Bidi.EmptyResult;
181
185
  };
182
186
  'network.continueWithAuth': {
183
187
  params: Bidi.Network.ContinueWithAuthParameters;
184
- returnType: Bidi.Network.ContinueWithAuthParameters;
188
+ returnType: Bidi.EmptyResult;
185
189
  };
186
190
  'network.disownData': {
187
191
  params: Bidi.Network.DisownDataParameters;
188
- returnType: Bidi.Network.DisownDataParameters;
192
+ returnType: Bidi.EmptyResult;
189
193
  };
190
194
  'network.failRequest': {
191
195
  params: Bidi.Network.FailRequestParameters;
192
- returnType: Bidi.Network.FailRequestParameters;
196
+ returnType: Bidi.EmptyResult;
193
197
  };
194
198
  'network.getData': {
195
199
  params: Bidi.Network.GetDataParameters;
196
- returnType: Bidi.Network.GetDataParameters;
200
+ returnType: Bidi.Network.GetDataResult;
197
201
  };
198
202
  'network.provideResponse': {
199
203
  params: Bidi.Network.ProvideResponseParameters;
200
- returnType: Bidi.Network.ProvideResponseParameters;
204
+ returnType: Bidi.EmptyResult;
201
205
  };
202
206
  'network.removeDataCollector': {
203
207
  params: Bidi.Network.RemoveDataCollectorParameters;
204
- returnType: Bidi.Network.RemoveDataCollectorParameters;
208
+ returnType: Bidi.EmptyResult;
205
209
  };
206
210
  'network.removeIntercept': {
207
211
  params: Bidi.Network.RemoveInterceptParameters;
208
- returnType: Bidi.Network.RemoveInterceptParameters;
212
+ returnType: Bidi.EmptyResult;
209
213
  };
210
214
  'network.setCacheBehavior': {
211
215
  params: Bidi.Network.SetCacheBehaviorParameters;
212
- returnType: Bidi.Network.SetCacheBehaviorParameters;
216
+ returnType: Bidi.EmptyResult;
213
217
  };
214
218
  'network.setExtraHeaders': {
215
219
  params: Bidi.Network.SetExtraHeadersParameters;
216
- returnType: Bidi.Network.SetExtraHeadersParameters;
220
+ returnType: Bidi.EmptyResult;
217
221
  };
218
222
  'permissions.setPermission': {
219
223
  params: BidiPermissions.Permissions.SetPermissionParameters;
220
- returnType: BidiPermissions.Permissions.SetPermissionParameters;
224
+ returnType: Bidi.EmptyResult;
221
225
  };
222
226
  'script.addPreloadScript': {
223
227
  params: Bidi.Script.AddPreloadScriptParameters;
224
- returnType: Bidi.Script.AddPreloadScriptParameters;
228
+ returnType: Bidi.Script.AddPreloadScriptResult;
225
229
  };
226
230
  'script.callFunction': {
227
231
  params: Bidi.Script.CallFunctionParameters;
228
- returnType: Bidi.Script.CallFunctionParameters;
232
+ returnType: Bidi.Script.CallFunctionResult;
229
233
  };
230
234
  'script.disown': {
231
235
  params: Bidi.Script.DisownParameters;
232
- returnType: Bidi.Script.DisownParameters;
236
+ returnType: Bidi.EmptyResult;
233
237
  };
234
238
  'script.evaluate': {
235
239
  params: Bidi.Script.EvaluateParameters;
236
- returnType: Bidi.Script.EvaluateParameters;
240
+ returnType: Bidi.Script.EvaluateResult;
237
241
  };
238
242
  'script.getRealms': {
239
243
  params: Bidi.Script.GetRealmsParameters;
240
- returnType: Bidi.Script.GetRealmsParameters;
244
+ returnType: Bidi.Script.GetRealmsResult;
241
245
  };
242
246
  'script.removePreloadScript': {
243
247
  params: Bidi.Script.RemovePreloadScriptParameters;
244
- returnType: Bidi.Script.RemovePreloadScriptParameters;
248
+ returnType: Bidi.EmptyResult;
245
249
  };
246
250
  'session.end': {
247
251
  params: Bidi.Extensible;
248
- returnType: Bidi.Extensible;
252
+ returnType: Bidi.EmptyResult;
249
253
  };
250
254
  'session.new': {
251
255
  params: Bidi.Session.NewParameters;
252
- returnType: Bidi.Session.NewParameters;
256
+ returnType: Bidi.Session.NewResult;
253
257
  };
254
258
  'session.status': {
255
259
  params: Bidi.Extensible;
256
- returnType: Bidi.Extensible;
260
+ returnType: Bidi.Session.StatusResult;
257
261
  };
258
262
  'session.subscribe': {
259
263
  params: Bidi.Session.SubscriptionRequest;
@@ -261,26 +265,26 @@ export interface CommandMapping {
261
265
  };
262
266
  'session.unsubscribe': {
263
267
  params: Bidi.Session.UnsubscribeParameters;
264
- returnType: Bidi.Session.UnsubscribeParameters;
268
+ returnType: Bidi.EmptyResult;
265
269
  };
266
270
  'storage.deleteCookies': {
267
271
  params: Bidi.Storage.DeleteCookiesParameters;
268
- returnType: Bidi.Storage.DeleteCookiesParameters;
272
+ returnType: Bidi.Storage.DeleteCookiesResult;
269
273
  };
270
274
  'storage.getCookies': {
271
275
  params: Bidi.Storage.GetCookiesParameters;
272
- returnType: Bidi.Storage.GetCookiesParameters;
276
+ returnType: Bidi.Storage.GetCookiesResult;
273
277
  };
274
278
  'storage.setCookie': {
275
279
  params: Bidi.Storage.SetCookieParameters;
276
- returnType: Bidi.Storage.SetCookieParameters;
280
+ returnType: Bidi.Storage.SetCookieResult;
277
281
  };
278
282
  'webExtension.install': {
279
283
  params: Bidi.WebExtension.InstallParameters;
280
- returnType: Bidi.WebExtension.InstallParameters;
284
+ returnType: Bidi.WebExtension.InstallResult;
281
285
  };
282
286
  'webExtension.uninstall': {
283
287
  params: Bidi.WebExtension.UninstallParameters;
284
- returnType: Bidi.WebExtension.UninstallParameters;
288
+ returnType: Bidi.EmptyResult;
285
289
  };
286
290
  }
@@ -51,8 +51,7 @@ export type BluetoothCommand =
51
51
  | Bluetooth.SimulateCharacteristic
52
52
  | Bluetooth.SimulateCharacteristicResponse
53
53
  | Bluetooth.SimulateDescriptor
54
- | Bluetooth.SimulateDescriptorResponse
55
- | Record<string, never>;
54
+ | Bluetooth.SimulateDescriptorResponse;
56
55
  export namespace Bluetooth {
57
56
  export type HandleRequestDevicePrompt = {
58
57
  method: 'bluetooth.handleRequestDevicePrompt';
@@ -7,6 +7,7 @@
7
7
  import {Project, Type, TypeFormatFlags} from 'ts-morph';
8
8
  import * as path from 'path';
9
9
  import {
10
+ getResultNameFromMethod,
10
11
  getTypeInNamespaceOrThrow,
11
12
  type MappingInterface,
12
13
  type SpecType,
@@ -14,11 +15,13 @@ import {
14
15
 
15
16
  const rootDir = path.resolve(import.meta.dirname, '..');
16
17
 
18
+ const MAIN_SPEC_PREFIX = 'Bidi';
19
+
17
20
  const specs: SpecType[] = [
18
21
  {
19
22
  inputFile: './main.ts',
20
23
  commandType: 'CommandData',
21
- modulePrefix: 'Bidi',
24
+ modulePrefix: MAIN_SPEC_PREFIX,
22
25
  },
23
26
  {
24
27
  inputFile: './permissions.ts',
@@ -76,7 +79,17 @@ for (const spec of specs) {
76
79
  TypeFormatFlags.None,
77
80
  );
78
81
 
79
- let expectedResultTypeName = paramsTypeString.replace('Params', 'Result');
82
+ let prefix = spec.modulePrefix;
83
+ let expectedResultTypeName = paramsTypeString.replace(
84
+ 'Parameters',
85
+ 'Result',
86
+ );
87
+
88
+ // We need to infer from methods
89
+ // TODO: See if this is needed as a fallback always
90
+ if (paramsTypeString.includes('Extensible')) {
91
+ expectedResultTypeName = getResultNameFromMethod(methodString);
92
+ }
80
93
 
81
94
  try {
82
95
  // Usually we get something like `BrowsingContext.GetTreeResult`
@@ -86,6 +99,8 @@ for (const spec of specs) {
86
99
  // Maybe it was not inside an Namespace try on the module scope
87
100
  apiIndexFile.getTypeAliasOrThrow(expectedResultTypeName);
88
101
  } catch {
102
+ // The EmptyResult is only available on the main spec
103
+ prefix = MAIN_SPEC_PREFIX;
89
104
  // Default to EmptyResult
90
105
  expectedResultTypeName = `EmptyResult`;
91
106
  }
@@ -94,7 +109,7 @@ for (const spec of specs) {
94
109
  commandMappingEntries.push({
95
110
  method: methodString,
96
111
  params: `${spec.modulePrefix}.${paramsTypeString}`,
97
- resultType: `${spec.modulePrefix}.${expectedResultTypeName}`,
112
+ resultType: `${prefix}.${expectedResultTypeName}`,
98
113
  });
99
114
  }
100
115
  }
package/tools/utils.ts CHANGED
@@ -52,3 +52,11 @@ export function getTypeInNamespaceOrThrow(
52
52
 
53
53
  throw new Error('Not found');
54
54
  }
55
+
56
+ export function getResultNameFromMethod(method: string) {
57
+ const type = method
58
+ .split('.')
59
+ .map(s => s.charAt(0).toUpperCase() + s.slice(1))
60
+ .join('.');
61
+ return `${type}Result`;
62
+ }