@stackone/transport 2.6.0 → 2.7.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.
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as redis from "redis";
2
2
  import { AxiosInstance, AxiosInterceptorOptions, AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from "axios";
3
- import { z } from "@stackone/utils";
4
3
  import http, { AgentOptions } from "node:http";
5
4
  import https from "node:https";
5
+ import { z } from "@stackone/utils";
6
6
 
7
7
  //#region src/authorization/types.d.ts
8
8
  type NoAuthorizationParams = {
@@ -308,18 +308,6 @@ declare class ConcurrencyManager extends ScriptManager<ConcurrencyMethods, Concu
308
308
  close(): void;
309
309
  }
310
310
  //#endregion
311
- //#region src/customErrors/schemas.d.ts
312
- declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
313
- receivedStatus: z.ZodNumber;
314
- targetStatus: z.ZodNumber;
315
- message: z.ZodOptional<z.ZodString>;
316
- condition: z.ZodOptional<z.ZodString>;
317
- }, z.core.$strict>;
318
- //#endregion
319
- //#region src/customErrors/types.d.ts
320
- type CustomErrorConfig = z.infer<typeof CUSTOM_ERROR_CONFIG_SCHEMA>;
321
- declare const HttpErrorMessages: Record<number, string>;
322
- //#endregion
323
311
  //#region src/rateLimitManager/types.d.ts
324
312
  type RateLimitSubPoolConfig = {
325
313
  subPoolKey: string;
@@ -528,6 +516,21 @@ type TransportFactory = ({
528
516
  httpsAgentConfig?: https.AgentOptions;
529
517
  }) => Promise<AxiosInstance>;
530
518
  //#endregion
519
+ //#region src/customErrors/schemas.d.ts
520
+ declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
521
+ receivedStatus: z.ZodNumber;
522
+ targetStatus: z.ZodNumber;
523
+ message: z.ZodOptional<z.ZodString>;
524
+ condition: z.ZodOptional<z.ZodString>;
525
+ }, z.core.$strict>;
526
+ //#endregion
527
+ //#region src/customErrors/types.d.ts
528
+ type CustomErrorConfig = z.infer<typeof CUSTOM_ERROR_CONFIG_SCHEMA>;
529
+ declare const HttpErrorMessages: Record<number, string>;
530
+ //#endregion
531
+ //#region src/customErrors/index.d.ts
532
+ declare const translateCustomError: (response: HttpResponse, configs?: CustomErrorConfig[]) => HttpResponse;
533
+ //#endregion
531
534
  //#region src/errors/httpResponseError.d.ts
532
535
  declare class HttpResponseError extends Error {
533
536
  readonly response: HttpResponse;
@@ -939,4 +942,4 @@ type LockEntry = {
939
942
  unlock: Unlock;
940
943
  };
941
944
  //#endregion
942
- export { CUSTOM_ERROR_CONFIG_SCHEMA, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type ICacheClient, type IHttpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Lock, type LockEntry, LockManager, MemoryStore, type MemoryStoreConfig, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, RequestClientFactory, type RequestConfig, type RequestContext, type RequestParameter, RequestParameterLocations, ScriptManager, SubscriptionManager, type TransportInitializationOptions, type Unlock, buildHttpClientInstance, createAuthorizationHeaders, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, serializeHttpResponseError, shutdownTransportSystem };
945
+ export { CUSTOM_ERROR_CONFIG_SCHEMA, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type ICacheClient, type IHttpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Lock, type LockEntry, LockManager, MemoryStore, type MemoryStoreConfig, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, RequestClientFactory, type RequestConfig, type RequestContext, type RequestParameter, RequestParameterLocations, ScriptManager, SubscriptionManager, type TransportInitializationOptions, type Unlock, buildHttpClientInstance, createAuthorizationHeaders, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, serializeHttpResponseError, shutdownTransportSystem, translateCustomError };
package/dist/index.d.mts CHANGED
@@ -308,18 +308,6 @@ declare class ConcurrencyManager extends ScriptManager<ConcurrencyMethods, Concu
308
308
  close(): void;
309
309
  }
310
310
  //#endregion
311
- //#region src/customErrors/schemas.d.ts
312
- declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
313
- receivedStatus: z.ZodNumber;
314
- targetStatus: z.ZodNumber;
315
- message: z.ZodOptional<z.ZodString>;
316
- condition: z.ZodOptional<z.ZodString>;
317
- }, z.core.$strict>;
318
- //#endregion
319
- //#region src/customErrors/types.d.ts
320
- type CustomErrorConfig = z.infer<typeof CUSTOM_ERROR_CONFIG_SCHEMA>;
321
- declare const HttpErrorMessages: Record<number, string>;
322
- //#endregion
323
311
  //#region src/rateLimitManager/types.d.ts
324
312
  type RateLimitSubPoolConfig = {
325
313
  subPoolKey: string;
@@ -528,6 +516,21 @@ type TransportFactory = ({
528
516
  httpsAgentConfig?: https.AgentOptions;
529
517
  }) => Promise<AxiosInstance>;
530
518
  //#endregion
519
+ //#region src/customErrors/schemas.d.ts
520
+ declare const CUSTOM_ERROR_CONFIG_SCHEMA: z.ZodObject<{
521
+ receivedStatus: z.ZodNumber;
522
+ targetStatus: z.ZodNumber;
523
+ message: z.ZodOptional<z.ZodString>;
524
+ condition: z.ZodOptional<z.ZodString>;
525
+ }, z.core.$strict>;
526
+ //#endregion
527
+ //#region src/customErrors/types.d.ts
528
+ type CustomErrorConfig = z.infer<typeof CUSTOM_ERROR_CONFIG_SCHEMA>;
529
+ declare const HttpErrorMessages: Record<number, string>;
530
+ //#endregion
531
+ //#region src/customErrors/index.d.ts
532
+ declare const translateCustomError: (response: HttpResponse, configs?: CustomErrorConfig[]) => HttpResponse;
533
+ //#endregion
531
534
  //#region src/errors/httpResponseError.d.ts
532
535
  declare class HttpResponseError extends Error {
533
536
  readonly response: HttpResponse;
@@ -939,4 +942,4 @@ type LockEntry = {
939
942
  unlock: Unlock;
940
943
  };
941
944
  //#endregion
942
- export { CUSTOM_ERROR_CONFIG_SCHEMA, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type ICacheClient, type IHttpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Lock, type LockEntry, LockManager, MemoryStore, type MemoryStoreConfig, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, RequestClientFactory, type RequestConfig, type RequestContext, type RequestParameter, RequestParameterLocations, ScriptManager, SubscriptionManager, type TransportInitializationOptions, type Unlock, buildHttpClientInstance, createAuthorizationHeaders, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, serializeHttpResponseError, shutdownTransportSystem };
945
+ export { CUSTOM_ERROR_CONFIG_SCHEMA, type ConcurrencyConfig, ConcurrencyManager, type CustomErrorConfig, type ErrorMappingFn, EventClient, HttpClient, HttpClientManager, HttpErrorMessages, type HttpHeaders, type HttpMethod, HttpMethods, type HttpParameters, type HttpQueryParamValue, type HttpQueryParams, type HttpResponse, HttpResponseError, HttpTransportFactory, type ICacheClient, type IHttpClient, type IRequestClient, type InitializedTransportManagers, InstanceManager, type Lock, type LockEntry, LockManager, MemoryStore, type MemoryStoreConfig, type PruneCount, type PubSubListener, type QueryArrayFormat, QueryArrayFormats, QueueManager, type RateLimitConfig, RateLimitManager, RedisClient, type RedisClientConfig, type RedisClientType, RequestClientFactory, type RequestConfig, type RequestContext, type RequestParameter, RequestParameterLocations, ScriptManager, SubscriptionManager, type TransportInitializationOptions, type Unlock, buildHttpClientInstance, createAuthorizationHeaders, getTransportInstance, getTransportManagers, initializeTransportSystem, isFailedStatusCode, isInfoStatusCode, isSuccessStatusCode, isTransportSystemReady, parseRequestParameters, serializeHttpResponseError, shutdownTransportSystem, translateCustomError };