@opengeni/codemode 0.2.2 → 0.4.1

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,7 +1,11 @@
1
1
  import type {
2
2
  AttachedBrowserDevice,
3
+ AuthRun,
4
+ AuthRunListResponse,
5
+ AuthRunMutationResponse,
3
6
  BrowserAction,
4
7
  BrowserActionReceipt,
8
+ BrowserClipboard,
5
9
  BrowserDiagnosticBatch,
6
10
  BrowserDiagnosticKind,
7
11
  BrowserIdentity,
@@ -9,6 +13,8 @@ import type {
9
13
  BrowserIdentityMutationResponse,
10
14
  BrowserLocator,
11
15
  BrowserObservation,
16
+ BrowserPermission,
17
+ BrowserPermissionSetting,
12
18
  BrowserRevisionListResponse,
13
19
  BrowserSession,
14
20
  BrowserSessionMutationResponse,
@@ -16,14 +22,27 @@ import type {
16
22
  BrowserTargetListResponse,
17
23
  ComputerAction,
18
24
  ComputerActionReceipt,
25
+ ComputerClipboard,
19
26
  ComputerLocator,
20
27
  ComputerObservation,
21
28
  ComputerSession,
22
29
  ComputerSessionMutationResponse,
23
30
  ComputerTarget,
24
31
  ComputerTargetListResponse,
32
+ ExternalAuthRunRequest,
33
+ ExternalAuthRunResponse,
25
34
  InteractionPlacement,
35
+ ProtectedAuthFillRequest,
36
+ ProtectedAuthFillResponse,
26
37
  PublishBrowserRevisionResponse,
38
+ ReportAuthRunRequest,
39
+ RequestHumanInteractionToolInput,
40
+ RequestHumanInteractionToolOutput,
41
+ SiteAuthConnection,
42
+ SiteAuthConnectionListResponse,
43
+ StartAuthRunRequest,
44
+ UpdateBrowserIdentityRequest,
45
+ VerifyAuthRunRequest,
27
46
  } from "@opengeni/contracts";
28
47
  import type { CodemodeCallOptions, CodemodeClient } from "./index";
29
48
  import { environmentCodemodeClient, type CodemodeClientProvider } from "./environment";
@@ -38,13 +57,17 @@ const PATH = {
38
57
  browserTabs: ["interaction", "browser", "tabs"],
39
58
  browserObserve: ["interaction", "browser", "observe"],
40
59
  browserAct: ["interaction", "browser", "act"],
60
+ browserClipboard: ["interaction", "browser", "clipboard"],
41
61
  browserDebug: ["interaction", "browser", "debug"],
62
+ browserAuth: ["interaction", "browser", "auth"],
63
+ requestHuman: ["interaction", "requestHuman"],
42
64
  browserIdentity: ["interaction", "browser", "identity"],
43
65
  browserPublish: ["interaction", "browser", "publish"],
44
66
  browserLifecycle: ["interaction", "browser", "lifecycle"],
45
67
  computerOpen: ["interaction", "computer", "open"],
46
68
  computerTargets: ["interaction", "computer", "targets"],
47
69
  computerObserve: ["interaction", "computer", "observe"],
70
+ computerClipboard: ["interaction", "computer", "clipboard"],
48
71
  computerAct: ["interaction", "computer", "act"],
49
72
  computerLifecycle: ["interaction", "computer", "lifecycle"],
50
73
  } as const;
@@ -96,12 +119,14 @@ export class OpenGeniCodemode {
96
119
  readonly browsers: CodemodeBrowserCollection;
97
120
  readonly computers: CodemodeComputerCollection;
98
121
  readonly artifacts: CodemodeArtifactCollection;
122
+ readonly auth: CodemodeAuth;
99
123
 
100
124
  constructor(client: CodemodeClient | CodemodeClientProvider = () => environmentCodemodeClient()) {
101
125
  const provider = codemodeClientProvider(client);
102
126
  this.browsers = new CodemodeBrowserCollection(provider);
103
127
  this.computers = new CodemodeComputerCollection(provider);
104
128
  this.artifacts = new CodemodeArtifactCollection(provider);
129
+ this.auth = new CodemodeAuth(provider);
105
130
  }
106
131
 
107
132
  async discover(
@@ -114,6 +139,13 @@ export class OpenGeniCodemode {
114
139
  ): Promise<InteractionDiscovery> {
115
140
  return await callStructured(this.browsers.client, PATH.discover, options, callOptions);
116
141
  }
142
+
143
+ async requestHuman(
144
+ request: RequestHumanInteractionToolInput,
145
+ callOptions: CodemodeCallOptions = {},
146
+ ): Promise<RequestHumanInteractionToolOutput> {
147
+ return await callStructured(this.browsers.client, PATH.requestHuman, request, callOptions);
148
+ }
117
149
  }
118
150
 
119
151
  export class CodemodeBrowserCollection {
@@ -195,16 +227,37 @@ export class CodemodeBrowserIdentityCollection {
195
227
  }>(this.client, PATH.browserIdentity, { operation: "revisions", identityId }, callOptions);
196
228
  return response.result;
197
229
  }
230
+
231
+ async update(
232
+ identityId: string,
233
+ update: Omit<UpdateBrowserIdentityRequest, "operationId">,
234
+ callOptions: CodemodeCallOptions = {},
235
+ ): Promise<BrowserIdentityMutationResponse> {
236
+ const response = await callStructured<{
237
+ operation: "update";
238
+ result: BrowserIdentityMutationResponse;
239
+ }>(
240
+ this.client,
241
+ PATH.browserIdentity,
242
+ { operation: "update", identityId, ...update },
243
+ callOptions,
244
+ );
245
+ return response.result;
246
+ }
198
247
  }
199
248
 
200
249
  export class CodemodeBrowser {
201
250
  readonly tabs: CodemodeBrowserTabCollection;
251
+ readonly auth: CodemodeBrowserAuth;
252
+ readonly clipboard: CodemodeBrowserClipboard;
202
253
 
203
254
  constructor(
204
255
  private readonly client: CodemodeClientProvider,
205
256
  readonly id: string,
206
257
  ) {
207
258
  this.tabs = new CodemodeBrowserTabCollection(client, id);
259
+ this.auth = new CodemodeBrowserAuth(client, id);
260
+ this.clipboard = new CodemodeBrowserClipboard(client, id, this.tabs);
208
261
  }
209
262
 
210
263
  async refresh(callOptions: CodemodeCallOptions = {}): Promise<BrowserSession> {
@@ -297,6 +350,103 @@ export class CodemodeBrowser {
297
350
  }
298
351
  }
299
352
 
353
+ export class CodemodeBrowserClipboard {
354
+ constructor(
355
+ private readonly client: CodemodeClientProvider,
356
+ private readonly browserSessionId: string,
357
+ private readonly tabs: CodemodeBrowserTabCollection,
358
+ ) {}
359
+
360
+ async read(callOptions: CodemodeCallOptions = {}): Promise<BrowserClipboard> {
361
+ return await callStructured(
362
+ this.client,
363
+ PATH.browserClipboard,
364
+ { browserSessionId: this.browserSessionId },
365
+ callOptions,
366
+ );
367
+ }
368
+
369
+ async write(
370
+ text: string,
371
+ options: BrowserActionFences & { targetId?: string | undefined } = {},
372
+ callOptions: CodemodeCallOptions = {},
373
+ ): Promise<BrowserActionReceipt> {
374
+ return await this.act({ type: "clipboard", operation: "write", text }, options, callOptions);
375
+ }
376
+
377
+ async clear(
378
+ options: BrowserActionFences & { targetId?: string | undefined } = {},
379
+ callOptions: CodemodeCallOptions = {},
380
+ ): Promise<BrowserActionReceipt> {
381
+ return await this.act({ type: "clipboard", operation: "clear" }, options, callOptions);
382
+ }
383
+
384
+ async copy(
385
+ options: BrowserActionFences & {
386
+ targetId?: string | undefined;
387
+ locator?: BrowserLocator | undefined;
388
+ content?: "selection" | "value" | "text" | undefined;
389
+ } = {},
390
+ callOptions: CodemodeCallOptions = {},
391
+ ): Promise<BrowserActionReceipt> {
392
+ const {
393
+ targetId,
394
+ expectedTargetGeneration,
395
+ expectedDocumentGeneration,
396
+ expectedFrameId,
397
+ ...copy
398
+ } = options;
399
+ return await this.act(
400
+ { type: "clipboard", operation: "copy", ...copy },
401
+ {
402
+ targetId,
403
+ expectedTargetGeneration,
404
+ expectedDocumentGeneration,
405
+ expectedFrameId,
406
+ },
407
+ callOptions,
408
+ );
409
+ }
410
+
411
+ async paste(
412
+ options: BrowserActionFences & {
413
+ targetId?: string | undefined;
414
+ locator?: BrowserLocator | undefined;
415
+ text?: string | undefined;
416
+ } = {},
417
+ callOptions: CodemodeCallOptions = {},
418
+ ): Promise<BrowserActionReceipt> {
419
+ const {
420
+ targetId,
421
+ expectedTargetGeneration,
422
+ expectedDocumentGeneration,
423
+ expectedFrameId,
424
+ ...paste
425
+ } = options;
426
+ return await this.act(
427
+ { type: "clipboard", operation: "paste", ...paste },
428
+ {
429
+ targetId,
430
+ expectedTargetGeneration,
431
+ expectedDocumentGeneration,
432
+ expectedFrameId,
433
+ },
434
+ callOptions,
435
+ );
436
+ }
437
+
438
+ private async act(
439
+ action: BrowserAction,
440
+ options: BrowserActionFences & { targetId?: string | undefined },
441
+ callOptions: CodemodeCallOptions,
442
+ ): Promise<BrowserActionReceipt> {
443
+ const { targetId, ...fences } = options;
444
+ return await this.tabs
445
+ .use(await this.tabs.resolveId(targetId, callOptions))
446
+ .act(action, fences, callOptions);
447
+ }
448
+ }
449
+
300
450
  export class CodemodeBrowserTabCollection {
301
451
  constructor(
302
452
  private readonly client: CodemodeClientProvider,
@@ -417,6 +567,47 @@ export class CodemodeBrowserTab {
417
567
  return await this.act({ type: "navigate", url }, {}, callOptions);
418
568
  }
419
569
 
570
+ async setPermission(
571
+ permission: BrowserPermission,
572
+ setting: BrowserPermissionSetting,
573
+ fences: BrowserActionFences = {},
574
+ callOptions: CodemodeCallOptions = {},
575
+ ): Promise<BrowserActionReceipt> {
576
+ return await this.act({ type: "permission", permission, setting }, fences, callOptions);
577
+ }
578
+
579
+ async requestHuman(
580
+ reason: string,
581
+ options: {
582
+ kind?: "manual_login" | "mfa" | "external_action" | "confirmation" | "other";
583
+ authRunId?: string | undefined;
584
+ expiresInSeconds?: number | undefined;
585
+ } = {},
586
+ callOptions: CodemodeCallOptions = {},
587
+ ): Promise<RequestHumanInteractionToolOutput> {
588
+ const observation = await this.observe(callOptions);
589
+ return await callStructured(
590
+ this.client,
591
+ PATH.requestHuman,
592
+ {
593
+ operation: "request",
594
+ resourceKind: "browser_session",
595
+ resourceId: this.browserSessionId,
596
+ targetId: this.id,
597
+ expectedControllerGeneration: observation.target.controllerGeneration,
598
+ expectedTargetGeneration: observation.target.targetGeneration,
599
+ expectedDocumentGeneration: observation.target.documentGeneration,
600
+ kind: options.kind ?? "other",
601
+ reason,
602
+ ...(options.authRunId ? { authRunId: options.authRunId } : {}),
603
+ ...(options.expiresInSeconds === undefined
604
+ ? {}
605
+ : { expiresInSeconds: options.expiresInSeconds }),
606
+ },
607
+ callOptions,
608
+ );
609
+ }
610
+
420
611
  getByRole(role: string, options: { name?: string; exact?: boolean } = {}) {
421
612
  return new CodemodeBrowserLocator(this, { kind: "role", role, ...options });
422
613
  }
@@ -492,6 +683,207 @@ export class CodemodeBrowserLocator {
492
683
  }
493
684
  }
494
685
 
686
+ export class CodemodeAuth {
687
+ constructor(private readonly client: CodemodeClientProvider) {}
688
+
689
+ async listConnections(
690
+ options: { includeArchived?: boolean | undefined } = {},
691
+ callOptions: CodemodeCallOptions = {},
692
+ ): Promise<SiteAuthConnectionListResponse> {
693
+ const response = await callStructured<{
694
+ operation: "list_connections";
695
+ result: SiteAuthConnectionListResponse;
696
+ }>(this.client, PATH.browserAuth, { operation: "list_connections", ...options }, callOptions);
697
+ return response.result;
698
+ }
699
+
700
+ async getConnection(
701
+ siteAuthConnectionId: string,
702
+ callOptions: CodemodeCallOptions = {},
703
+ ): Promise<SiteAuthConnection> {
704
+ const response = await callStructured<{
705
+ operation: "get_connection";
706
+ result: SiteAuthConnection;
707
+ }>(
708
+ this.client,
709
+ PATH.browserAuth,
710
+ { operation: "get_connection", siteAuthConnectionId },
711
+ callOptions,
712
+ );
713
+ return response.result;
714
+ }
715
+
716
+ async listRuns(
717
+ options: {
718
+ browserSessionId?: string | undefined;
719
+ siteAuthConnectionId?: string | undefined;
720
+ includeSettled?: boolean | undefined;
721
+ } = {},
722
+ callOptions: CodemodeCallOptions = {},
723
+ ): Promise<AuthRunListResponse> {
724
+ const response = await callStructured<{ operation: "list_runs"; result: AuthRunListResponse }>(
725
+ this.client,
726
+ PATH.browserAuth,
727
+ { operation: "list_runs", ...options },
728
+ callOptions,
729
+ );
730
+ return response.result;
731
+ }
732
+
733
+ async getRun(authRunId: string, callOptions: CodemodeCallOptions = {}): Promise<AuthRun> {
734
+ const response = await callStructured<{ operation: "get_run"; result: AuthRun }>(
735
+ this.client,
736
+ PATH.browserAuth,
737
+ { operation: "get_run", authRunId },
738
+ callOptions,
739
+ );
740
+ return response.result;
741
+ }
742
+
743
+ use(browserSessionId: string, authRunId: string): CodemodeAuthRun {
744
+ return new CodemodeAuthRun(this.client, browserSessionId, authRunId);
745
+ }
746
+ }
747
+
748
+ export class CodemodeBrowserAuth {
749
+ constructor(
750
+ private readonly client: CodemodeClientProvider,
751
+ private readonly browserSessionId: string,
752
+ ) {}
753
+
754
+ async listRuns(
755
+ options: {
756
+ siteAuthConnectionId?: string | undefined;
757
+ includeSettled?: boolean | undefined;
758
+ } = {},
759
+ callOptions: CodemodeCallOptions = {},
760
+ ): Promise<AuthRunListResponse> {
761
+ const response = await callStructured<{ operation: "list_runs"; result: AuthRunListResponse }>(
762
+ this.client,
763
+ PATH.browserAuth,
764
+ { operation: "list_runs", browserSessionId: this.browserSessionId, ...options },
765
+ callOptions,
766
+ );
767
+ return response.result;
768
+ }
769
+
770
+ async start(
771
+ request: Omit<StartAuthRunRequest, "operationId">,
772
+ callOptions: CodemodeCallOptions = {},
773
+ ): Promise<CodemodeAuthRun> {
774
+ const response = await callStructured<{ operation: "start"; result: AuthRunMutationResponse }>(
775
+ this.client,
776
+ PATH.browserAuth,
777
+ { operation: "start", browserSessionId: this.browserSessionId, ...request },
778
+ callOptions,
779
+ );
780
+ return this.use(response.result.run.id);
781
+ }
782
+
783
+ use(authRunId: string): CodemodeAuthRun {
784
+ return new CodemodeAuthRun(this.client, this.browserSessionId, authRunId);
785
+ }
786
+ }
787
+
788
+ export class CodemodeAuthRun {
789
+ constructor(
790
+ private readonly client: CodemodeClientProvider,
791
+ readonly browserSessionId: string,
792
+ readonly id: string,
793
+ ) {}
794
+
795
+ async get(callOptions: CodemodeCallOptions = {}): Promise<AuthRun> {
796
+ const response = await callStructured<{ operation: "get_run"; result: AuthRun }>(
797
+ this.client,
798
+ PATH.browserAuth,
799
+ { operation: "get_run", authRunId: this.id },
800
+ callOptions,
801
+ );
802
+ if (response.result.browserSessionId !== this.browserSessionId) {
803
+ throw new Error("Auth run belongs to another BrowserSession");
804
+ }
805
+ return response.result;
806
+ }
807
+
808
+ async report(
809
+ request: Omit<ReportAuthRunRequest, "operationId">,
810
+ callOptions: CodemodeCallOptions = {},
811
+ ): Promise<AuthRunMutationResponse> {
812
+ const response = await callStructured<{ operation: "report"; result: AuthRunMutationResponse }>(
813
+ this.client,
814
+ PATH.browserAuth,
815
+ {
816
+ operation: "report",
817
+ browserSessionId: this.browserSessionId,
818
+ authRunId: this.id,
819
+ ...request,
820
+ },
821
+ callOptions,
822
+ );
823
+ return response.result;
824
+ }
825
+
826
+ async protectedFill(
827
+ request: Omit<ProtectedAuthFillRequest, "operationId">,
828
+ callOptions: CodemodeCallOptions = {},
829
+ ): Promise<ProtectedAuthFillResponse> {
830
+ const response = await callStructured<{
831
+ operation: "protected_fill";
832
+ result: ProtectedAuthFillResponse;
833
+ }>(
834
+ this.client,
835
+ PATH.browserAuth,
836
+ {
837
+ operation: "protected_fill",
838
+ browserSessionId: this.browserSessionId,
839
+ authRunId: this.id,
840
+ ...request,
841
+ },
842
+ callOptions,
843
+ );
844
+ return response.result;
845
+ }
846
+
847
+ async advanceExternal(
848
+ request: Omit<ExternalAuthRunRequest, "operationId">,
849
+ callOptions: CodemodeCallOptions = {},
850
+ ): Promise<ExternalAuthRunResponse> {
851
+ const response = await callStructured<{
852
+ operation: "advance_external";
853
+ result: ExternalAuthRunResponse;
854
+ }>(
855
+ this.client,
856
+ PATH.browserAuth,
857
+ {
858
+ operation: "advance_external",
859
+ browserSessionId: this.browserSessionId,
860
+ authRunId: this.id,
861
+ ...request,
862
+ },
863
+ callOptions,
864
+ );
865
+ return response.result;
866
+ }
867
+
868
+ async verify(
869
+ request: Omit<VerifyAuthRunRequest, "operationId">,
870
+ callOptions: CodemodeCallOptions = {},
871
+ ): Promise<AuthRunMutationResponse> {
872
+ const response = await callStructured<{ operation: "verify"; result: AuthRunMutationResponse }>(
873
+ this.client,
874
+ PATH.browserAuth,
875
+ {
876
+ operation: "verify",
877
+ browserSessionId: this.browserSessionId,
878
+ authRunId: this.id,
879
+ ...request,
880
+ },
881
+ callOptions,
882
+ );
883
+ return response.result;
884
+ }
885
+ }
886
+
495
887
  export class CodemodeComputerCollection {
496
888
  constructor(private readonly client: CodemodeClientProvider) {}
497
889
 
@@ -525,6 +917,7 @@ export class CodemodeComputerCollection {
525
917
  export class CodemodeComputer {
526
918
  readonly targets: CodemodeComputerTargetCollection;
527
919
  readonly apps: CodemodeComputerTargetCollection;
920
+ readonly clipboard: CodemodeComputerClipboard;
528
921
 
529
922
  constructor(
530
923
  private readonly client: CodemodeClientProvider,
@@ -532,6 +925,7 @@ export class CodemodeComputer {
532
925
  ) {
533
926
  this.targets = new CodemodeComputerTargetCollection(client, id);
534
927
  this.apps = this.targets;
928
+ this.clipboard = new CodemodeComputerClipboard(client, id, this.targets);
535
929
  }
536
930
 
537
931
  async refresh(callOptions: CodemodeCallOptions = {}): Promise<ComputerSession> {
@@ -579,6 +973,61 @@ export class CodemodeComputer {
579
973
  }
580
974
  }
581
975
 
976
+ export class CodemodeComputerClipboard {
977
+ constructor(
978
+ private readonly client: CodemodeClientProvider,
979
+ readonly computerSessionId: string,
980
+ private readonly targets: CodemodeComputerTargetCollection,
981
+ ) {}
982
+
983
+ async read(callOptions: CodemodeCallOptions = {}): Promise<ComputerClipboard> {
984
+ return await callStructured(
985
+ this.client,
986
+ PATH.computerClipboard,
987
+ { computerSessionId: this.computerSessionId },
988
+ callOptions,
989
+ );
990
+ }
991
+
992
+ async write(
993
+ text: string,
994
+ options: { targetId?: string | undefined } = {},
995
+ callOptions: CodemodeCallOptions = {},
996
+ ): Promise<ComputerActionReceipt> {
997
+ return await this.mutate({ type: "clipboard", operation: "write", text }, options, callOptions);
998
+ }
999
+
1000
+ async clear(
1001
+ options: { targetId?: string | undefined } = {},
1002
+ callOptions: CodemodeCallOptions = {},
1003
+ ): Promise<ComputerActionReceipt> {
1004
+ return await this.mutate({ type: "clipboard", operation: "clear" }, options, callOptions);
1005
+ }
1006
+
1007
+ async copy(
1008
+ options: { targetId?: string | undefined } = {},
1009
+ callOptions: CodemodeCallOptions = {},
1010
+ ): Promise<ComputerActionReceipt> {
1011
+ return await this.mutate({ type: "clipboard", operation: "copy" }, options, callOptions);
1012
+ }
1013
+
1014
+ async paste(
1015
+ options: { targetId?: string | undefined } = {},
1016
+ callOptions: CodemodeCallOptions = {},
1017
+ ): Promise<ComputerActionReceipt> {
1018
+ return await this.mutate({ type: "clipboard", operation: "paste" }, options, callOptions);
1019
+ }
1020
+
1021
+ private async mutate(
1022
+ action: Extract<ComputerAction, { type: "clipboard" }>,
1023
+ options: { targetId?: string | undefined },
1024
+ callOptions: CodemodeCallOptions,
1025
+ ): Promise<ComputerActionReceipt> {
1026
+ const targetId = await this.targets.resolveSeatId(options.targetId, callOptions);
1027
+ return await this.targets.use(targetId).act(action, {}, callOptions);
1028
+ }
1029
+ }
1030
+
582
1031
  export class CodemodeComputerTargetCollection {
583
1032
  constructor(
584
1033
  private readonly client: CodemodeClientProvider,
@@ -617,6 +1066,17 @@ export class CodemodeComputerTargetCollection {
617
1066
  throw new Error("Computer has no app, window, or screen targets");
618
1067
  throw new Error("Computer target is ambiguous; select an exact app or window");
619
1068
  }
1069
+
1070
+ async resolveSeatId(
1071
+ targetId: string | undefined,
1072
+ callOptions: CodemodeCallOptions,
1073
+ ): Promise<string> {
1074
+ if (targetId) return await this.resolveId(targetId, callOptions);
1075
+ const listed = await this.list(callOptions);
1076
+ const screens = listed.targets.filter((target) => target.kind === "screen");
1077
+ if (screens.length === 1) return screens[0]!.id;
1078
+ return await this.resolveId(undefined, callOptions);
1079
+ }
620
1080
  }
621
1081
 
622
1082
  export class CodemodeComputerTarget {
@@ -648,6 +1108,36 @@ export class CodemodeComputerTarget {
648
1108
  );
649
1109
  }
650
1110
 
1111
+ async requestHuman(
1112
+ reason: string,
1113
+ options: {
1114
+ kind?: "manual_login" | "mfa" | "external_action" | "confirmation" | "other";
1115
+ expiresInSeconds?: number | undefined;
1116
+ } = {},
1117
+ callOptions: CodemodeCallOptions = {},
1118
+ ): Promise<RequestHumanInteractionToolOutput> {
1119
+ const observation = await this.observe(callOptions);
1120
+ return await callStructured(
1121
+ this.client,
1122
+ PATH.requestHuman,
1123
+ {
1124
+ operation: "request",
1125
+ resourceKind: "computer_session",
1126
+ resourceId: this.computerSessionId,
1127
+ targetId: this.id,
1128
+ expectedControllerGeneration: observation.target.controllerGeneration,
1129
+ expectedTargetGeneration: observation.target.targetGeneration,
1130
+ expectedDocumentGeneration: null,
1131
+ kind: options.kind ?? "other",
1132
+ reason,
1133
+ ...(options.expiresInSeconds === undefined
1134
+ ? {}
1135
+ : { expiresInSeconds: options.expiresInSeconds }),
1136
+ },
1137
+ callOptions,
1138
+ );
1139
+ }
1140
+
651
1141
  getByRole(role: string, options: { name?: string; exact?: boolean } = {}) {
652
1142
  return new CodemodeComputerLocator(this, { kind: "role", role, ...options });
653
1143
  }