Skip to content

Commit

Permalink
build(spec): update WebDriverBiDi types
Browse files Browse the repository at this point in the history
  • Loading branch information
browser-automation-bot committed Dec 21, 2024
1 parent f742eba commit fe63b51
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
33 changes: 32 additions & 1 deletion src/protocol-parser/generated/webdriver-bidi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ export namespace Session {
z.enum(['accept', 'dismiss', 'ignore']),
);
}
export namespace Session {
export const SubscriptionSchema = z.lazy(() => z.string());
}
export namespace Session {
export const SubscriptionRequestSchema = z.lazy(() =>
z.object({
Expand All @@ -276,6 +279,24 @@ export namespace Session {
}),
);
}
export namespace Session {
export const UnsubscribeByIdRequestSchema = z.lazy(() =>
z.object({
subscriptions: z.array(Session.SubscriptionSchema).min(1),
}),
);
}
export namespace Session {
export const UnsubscribeByAttributesRequestSchema = z.lazy(() =>
z.object({
events: z.array(z.string()).min(1),
contexts: z
.array(BrowsingContext.BrowsingContextSchema)
.min(1)
.optional(),
}),
);
}
export namespace Session {
export const StatusSchema = z.lazy(() =>
z.object({
Expand Down Expand Up @@ -343,11 +364,21 @@ export namespace Session {
}),
);
}
export namespace Session {
export const SubscriptionRequestResultSchema = z.lazy(() =>
z.object({
subscription: Session.SubscriptionSchema,
}),
);
}
export namespace Session {
export const UnsubscribeSchema = z.lazy(() =>
z.object({
method: z.literal('session.unsubscribe'),
params: Session.SubscriptionRequestSchema,
params: z.union([
Session.UnsubscribeByAttributesRequestSchema,
Session.UnsubscribeByIdRequestSchema,
]),
}),
);
}
Expand Down
26 changes: 25 additions & 1 deletion src/protocol/generated/webdriver-bidi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export namespace Session {
Ignore = 'ignore',
}
}
export namespace Session {
export type Subscription = string;
}
export namespace Session {
export type SubscriptionRequest = {
events: [string, ...string[]];
Expand All @@ -204,6 +207,20 @@ export namespace Session {
];
};
}
export namespace Session {
export type UnsubscribeByIdRequest = {
subscriptions: [Session.Subscription, ...Session.Subscription[]];
};
}
export namespace Session {
export type UnsubscribeByAttributesRequest = {
events: [string, ...string[]];
contexts?: [
BrowsingContext.BrowsingContext,
...BrowsingContext.BrowsingContext[],
];
};
}
export namespace Session {
export type Status = {
method: 'session.status';
Expand Down Expand Up @@ -255,10 +272,17 @@ export namespace Session {
params: Session.SubscriptionRequest;
};
}
export namespace Session {
export type SubscriptionRequestResult = {
subscription: Session.Subscription;
};
}
export namespace Session {
export type Unsubscribe = {
method: 'session.unsubscribe';
params: Session.SubscriptionRequest;
params:
| Session.UnsubscribeByAttributesRequest
| Session.UnsubscribeByIdRequest;
};
}
export type BrowserCommand =
Expand Down

0 comments on commit fe63b51

Please sign in to comment.