@dereekb/zoom 13.4.0 → 13.4.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.
@@ -63,13 +63,14 @@ export declare function logZoomServerErrorFunction(zoomApiNamePrefix: string): L
63
63
  * @returns
64
64
  */
65
65
  export type HandleZoomErrorFetchFactory = (fetch: ConfiguredFetch, logError?: LogZoomServerErrorFunction) => ConfiguredFetch;
66
- export type ParsedZoomServerError = FetchRequestFactoryError | ZoomServerError | undefined;
66
+ export type ParsedZoomServerError = Maybe<FetchRequestFactoryError | ZoomServerError>;
67
67
  export type ParseZoomFetchResponseErrorFunction = (responseError: FetchResponseError) => Promise<ParsedZoomServerError>;
68
68
  /**
69
69
  * Wraps a ConfiguredFetch to support handling errors returned by fetch.
70
70
  *
71
- * @param fetch
72
- * @returns
71
+ * @param parseZoomError Function to parse fetch response errors into typed Zoom errors
72
+ * @param defaultLogError Default error logging function
73
+ * @returns A factory that wraps ConfiguredFetch with error handling
73
74
  */
74
75
  export declare function handleZoomErrorFetchFactory(parseZoomError: ParseZoomFetchResponseErrorFunction, defaultLogError: LogZoomServerErrorFunction): HandleZoomErrorFetchFactory;
75
76
  /**
@@ -118,6 +119,12 @@ export interface ZoomRateLimitHeaderDetails {
118
119
  */
119
120
  readonly retryAfterAt?: Date;
120
121
  }
122
+ /**
123
+ * Parses rate limit header details from a Zoom API response.
124
+ *
125
+ * @param headers The response headers to parse
126
+ * @returns Parsed rate limit details, or null if required headers are missing
127
+ */
121
128
  export declare function zoomRateLimitHeaderDetails(headers: Headers): Maybe<ZoomRateLimitHeaderDetails>;
122
129
  export declare class ZoomTooManyRequestsError extends ZoomServerFetchResponseError {
123
130
  get headerDetails(): Maybe<ZoomRateLimitHeaderDetails>;
@@ -125,9 +132,9 @@ export declare class ZoomTooManyRequestsError extends ZoomServerFetchResponseErr
125
132
  /**
126
133
  * Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
127
134
  *
128
- * @param errorResponseData
129
- * @param responseError
130
- * @returns
135
+ * @param zoomServerError The error data from the Zoom API
136
+ * @param responseError The original fetch response error
137
+ * @returns A typed ZoomServerFetchResponseError, or undefined
131
138
  */
132
139
  export declare function parseZoomServerErrorData(zoomServerError: ZoomServerErrorData, responseError: FetchResponseError): ZoomServerFetchResponseError | undefined;
133
140
  export interface SilenceZoomErrorConfig {
@@ -140,6 +147,9 @@ export interface SilenceZoomErrorConfig {
140
147
  * Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
141
148
  *
142
149
  * If other options are input, it merges those two options together and adds silenceError to the omitted keys.
150
+ *
151
+ * @param options Optional additional MakeUrlSearchParamsOptions to merge
152
+ * @returns A MakeUrlSearchParamsOptions that omits silenceError
143
153
  */
144
154
  export declare function omitSilenceZoomErrorKeys(options?: MakeUrlSearchParamsOptions): MakeUrlSearchParamsOptions;
145
155
  export type SilenceZoomErrorWithCodesFunction<T> = (silence?: boolean) => (reason: unknown) => T;
@@ -148,5 +158,11 @@ export type SilenceZoomErrorWithCodesFunction<T> = (silence?: boolean) => (reaso
148
158
  *
149
159
  * For example, when deleting a meeting that does not exist, the error code is 3001. This function can be used to silence that error.
150
160
  */
161
+ /**
162
+ * Creates a function that silences Zoom errors with specific error codes.
163
+ *
164
+ * @param codes The error code(s) to silence
165
+ * @returns A function that creates catch handlers for silencing specified errors
166
+ */
151
167
  export declare function silenceZoomErrorWithCodesFunction<T>(codes: ArrayOrValue<ZoomServerErrorCode>): SilenceZoomErrorWithCodesFunction<void>;
152
168
  export declare function silenceZoomErrorWithCodesFunction<T>(codes: ArrayOrValue<ZoomServerErrorCode>, returnFn: (error: ZoomServerFetchResponseError) => T): SilenceZoomErrorWithCodesFunction<T>;
@@ -8,9 +8,13 @@ export interface ZoomRateLimiterRef {
8
8
  * Function to execute when too many requests is reached.
9
9
  *
10
10
  * Typically used for logging of some sort. Thrown errors are ignored.
11
+ *
12
+ * @param headers The parsed rate limit header details from the response
13
+ * @param response The raw HTTP response
14
+ * @param fetchResponseError Optional fetch response error, if available
11
15
  */
12
16
  export type ZoomRateLimitedTooManyRequestsLogFunction = (headers: ZoomRateLimitHeaderDetails, response: Response, fetchResponseError?: FetchResponseError) => PromiseOrValue<void>;
13
- export declare const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION: (headers: ZoomRateLimitHeaderDetails) => void;
17
+ export declare const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION: (headers: ZoomRateLimitHeaderDetails) => void;
14
18
  export interface ZoomRateLimitedFetchHandlerConfig {
15
19
  /**
16
20
  * Custom max rate limit.
@@ -32,4 +36,14 @@ export interface ZoomRateLimitedFetchHandlerConfig {
32
36
  readonly onTooManyRequests?: ZoomRateLimitedTooManyRequestsLogFunction | false;
33
37
  }
34
38
  export type ZoomRateLimitedFetchHandler = RateLimitedFetchHandler<ResetPeriodPromiseRateLimiter>;
39
+ /**
40
+ * Creates a rate-limited fetch handler configured for the Zoom API.
41
+ *
42
+ * @param config Optional configuration for rate limiting behavior
43
+ * @returns A configured rate-limited fetch handler
44
+ */
35
45
  export declare function zoomRateLimitedFetchHandler(config?: Maybe<ZoomRateLimitedFetchHandlerConfig>): ZoomRateLimitedFetchHandler;
46
+ /**
47
+ * @deprecated use DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
48
+ */
49
+ export declare const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION: (headers: ZoomRateLimitHeaderDetails) => void;