mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-09 12:37:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.274.1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
import { HTTPClient } from "../lib/http";
|
||||
import { HTTPClient, RequestInput } from "../lib/http";
|
||||
|
||||
export type HookContext = {
|
||||
operationID: string;
|
||||
@@ -16,6 +16,8 @@ export type SDKInitOptions = {
|
||||
baseURL: URL | null;
|
||||
client: HTTPClient;
|
||||
};
|
||||
|
||||
export type BeforeCreateRequestContext = HookContext & {};
|
||||
export type BeforeRequestContext = HookContext & {};
|
||||
export type AfterSuccessContext = HookContext & {};
|
||||
export type AfterErrorContext = HookContext & {};
|
||||
@@ -28,30 +30,41 @@ export interface SDKInitHook {
|
||||
sdkInit: (opts: SDKInitOptions) => SDKInitOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* BeforeRequestHook is called before the SDK sends a request. The hook can
|
||||
* modify the request before it is sent or throw an error to stop the request
|
||||
* from being sent.
|
||||
*/
|
||||
export interface BeforeCreateRequestHook {
|
||||
/**
|
||||
* A hook that is called before the SDK creates a `Request` object. The hook
|
||||
* can modify how a request is constructed since certain modifications, like
|
||||
* changing the request URL, cannot be done on a request object directly.
|
||||
*/
|
||||
beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput;
|
||||
}
|
||||
|
||||
export interface BeforeRequestHook {
|
||||
/**
|
||||
* A hook that is called before the SDK sends a request. The hook can
|
||||
* introduce instrumentation code such as logging, tracing and metrics or
|
||||
* replace the request before it is sent or throw an error to stop the
|
||||
* request from being sent.
|
||||
*/
|
||||
beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable<Request>;
|
||||
}
|
||||
|
||||
/**
|
||||
* AfterSuccessHook is called after the SDK receives a response. The hook can
|
||||
* modify the response before it is handled or throw an error to stop the
|
||||
* response from being handled.
|
||||
*/
|
||||
export interface AfterSuccessHook {
|
||||
/**
|
||||
* A hook that is called after the SDK receives a response. The hook can
|
||||
* introduce instrumentation code such as logging, tracing and metrics or
|
||||
* modify the response before it is handled or throw an error to stop the
|
||||
* response from being handled.
|
||||
*/
|
||||
afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable<Response>;
|
||||
}
|
||||
|
||||
/**
|
||||
* AfterErrorHook is called after the SDK encounters an error, or a
|
||||
* non-successful response. The hook can modify the response if available
|
||||
* otherwise modify the error.
|
||||
*/
|
||||
export interface AfterErrorHook {
|
||||
/**
|
||||
* A hook that is called after the SDK encounters an error, or a
|
||||
* non-successful response. The hook can introduce instrumentation code such
|
||||
* as logging, tracing and metrics or modify the response or error values.
|
||||
*/
|
||||
afterError: (
|
||||
hookCtx: AfterErrorContext,
|
||||
response: Response | null,
|
||||
@@ -65,6 +78,8 @@ export interface AfterErrorHook {
|
||||
export interface Hooks {
|
||||
/** Registers a hook to be used by the SDK for initialization event. */
|
||||
registerSDKInitHook(hook: SDKInitHook): void;
|
||||
/** Registers a hook to be used by the SDK for to modify `Request` construction. */
|
||||
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
||||
/** Registers a hook to be used by the SDK for the before request event. */
|
||||
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
||||
/** Registers a hook to be used by the SDK for the after success event. */
|
||||
|
||||
Reference in New Issue
Block a user