@algolia/client-common 5.0.0-alpha.8 → 5.0.0-alpha.81

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.
Files changed (44) hide show
  1. package/dist/{client-common.cjs.js → client-common.cjs} +140 -199
  2. package/dist/client-common.esm.node.js +140 -198
  3. package/dist/index.d.ts +9 -9
  4. package/dist/src/cache/createBrowserLocalStorageCache.d.ts +2 -2
  5. package/dist/src/cache/createFallbackableCache.d.ts +2 -2
  6. package/dist/src/cache/createMemoryCache.d.ts +2 -2
  7. package/dist/src/cache/createNullCache.d.ts +2 -2
  8. package/dist/src/cache/index.d.ts +4 -4
  9. package/dist/src/constants.d.ts +6 -6
  10. package/dist/src/createAlgoliaAgent.d.ts +2 -2
  11. package/dist/src/createAuth.d.ts +5 -5
  12. package/dist/src/createEchoRequester.d.ts +6 -6
  13. package/dist/src/createEchoRequester.d.ts.map +1 -1
  14. package/dist/src/createIterablePromise.d.ts +12 -12
  15. package/dist/src/getAlgoliaAgent.d.ts +7 -7
  16. package/dist/src/getAlgoliaAgent.d.ts.map +1 -1
  17. package/dist/src/transporter/createStatefulHost.d.ts +2 -2
  18. package/dist/src/transporter/createTransporter.d.ts +2 -2
  19. package/dist/src/transporter/createTransporter.d.ts.map +1 -1
  20. package/dist/src/transporter/errors.d.ts +37 -20
  21. package/dist/src/transporter/errors.d.ts.map +1 -1
  22. package/dist/src/transporter/helpers.d.ts +8 -8
  23. package/dist/src/transporter/helpers.d.ts.map +1 -1
  24. package/dist/src/transporter/index.d.ts +6 -6
  25. package/dist/src/transporter/responses.d.ts +4 -4
  26. package/dist/src/transporter/stackTrace.d.ts +3 -3
  27. package/dist/src/types/cache.d.ts +46 -46
  28. package/dist/src/types/cache.d.ts.map +1 -1
  29. package/dist/src/types/createClient.d.ts +11 -11
  30. package/dist/src/types/createClient.d.ts.map +1 -1
  31. package/dist/src/types/createIterablePromise.d.ts +35 -35
  32. package/dist/src/types/createIterablePromise.d.ts.map +1 -1
  33. package/dist/src/types/host.d.ts +32 -32
  34. package/dist/src/types/host.d.ts.map +1 -1
  35. package/dist/src/types/index.d.ts +6 -6
  36. package/dist/src/types/requester.d.ts +65 -65
  37. package/dist/src/types/requester.d.ts.map +1 -1
  38. package/dist/src/types/transporter.d.ts +127 -127
  39. package/dist/src/types/transporter.d.ts.map +1 -1
  40. package/package.json +9 -8
  41. package/src/createEchoRequester.ts +2 -2
  42. package/src/transporter/createTransporter.ts +4 -1
  43. package/src/transporter/errors.ts +38 -2
  44. package/src/transporter/helpers.ts +14 -6
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from './src/createAuth';
2
- export * from './src/createEchoRequester';
3
- export * from './src/createIterablePromise';
4
- export * from './src/cache';
5
- export * from './src/transporter';
6
- export * from './src/createAlgoliaAgent';
7
- export * from './src/getAlgoliaAgent';
8
- export * from './src/types';
9
- export * from './src/constants';
1
+ export * from './src/createAuth';
2
+ export * from './src/createEchoRequester';
3
+ export * from './src/createIterablePromise';
4
+ export * from './src/cache';
5
+ export * from './src/transporter';
6
+ export * from './src/createAlgoliaAgent';
7
+ export * from './src/getAlgoliaAgent';
8
+ export * from './src/types';
9
+ export * from './src/constants';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { BrowserLocalStorageOptions, Cache } from '../types';
2
- export declare function createBrowserLocalStorageCache(options: BrowserLocalStorageOptions): Cache;
1
+ import type { BrowserLocalStorageOptions, Cache } from '../types';
2
+ export declare function createBrowserLocalStorageCache(options: BrowserLocalStorageOptions): Cache;
3
3
  //# sourceMappingURL=createBrowserLocalStorageCache.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { FallbackableCacheOptions, Cache } from '../types';
2
- export declare function createFallbackableCache(options: FallbackableCacheOptions): Cache;
1
+ import type { FallbackableCacheOptions, Cache } from '../types';
2
+ export declare function createFallbackableCache(options: FallbackableCacheOptions): Cache;
3
3
  //# sourceMappingURL=createFallbackableCache.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { Cache, MemoryCacheOptions } from '../types';
2
- export declare function createMemoryCache(options?: MemoryCacheOptions): Cache;
1
+ import type { Cache, MemoryCacheOptions } from '../types';
2
+ export declare function createMemoryCache(options?: MemoryCacheOptions): Cache;
3
3
  //# sourceMappingURL=createMemoryCache.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { Cache } from '../types';
2
- export declare function createNullCache(): Cache;
1
+ import type { Cache } from '../types';
2
+ export declare function createNullCache(): Cache;
3
3
  //# sourceMappingURL=createNullCache.d.ts.map
@@ -1,5 +1,5 @@
1
- export * from './createBrowserLocalStorageCache';
2
- export * from './createFallbackableCache';
3
- export * from './createMemoryCache';
4
- export * from './createNullCache';
1
+ export * from './createBrowserLocalStorageCache';
2
+ export * from './createFallbackableCache';
3
+ export * from './createMemoryCache';
4
+ export * from './createNullCache';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- export declare const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
2
- export declare const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
3
- export declare const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
4
- export declare const DEFAULT_CONNECT_TIMEOUT_NODE = 2000;
5
- export declare const DEFAULT_READ_TIMEOUT_NODE = 5000;
6
- export declare const DEFAULT_WRITE_TIMEOUT_NODE = 30000;
1
+ export declare const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
2
+ export declare const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
3
+ export declare const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
4
+ export declare const DEFAULT_CONNECT_TIMEOUT_NODE = 2000;
5
+ export declare const DEFAULT_READ_TIMEOUT_NODE = 5000;
6
+ export declare const DEFAULT_WRITE_TIMEOUT_NODE = 30000;
7
7
  //# sourceMappingURL=constants.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { AlgoliaAgent } from './types';
2
- export declare function createAlgoliaAgent(version: string): AlgoliaAgent;
1
+ import type { AlgoliaAgent } from './types';
2
+ export declare function createAlgoliaAgent(version: string): AlgoliaAgent;
3
3
  //# sourceMappingURL=createAlgoliaAgent.d.ts.map
@@ -1,6 +1,6 @@
1
- import type { AuthMode, Headers, QueryParameters } from './types';
2
- export declare function createAuth(appId: string, apiKey: string, authMode?: AuthMode): {
3
- readonly headers: () => Headers;
4
- readonly queryParameters: () => QueryParameters;
5
- };
1
+ import type { AuthMode, Headers, QueryParameters } from './types';
2
+ export declare function createAuth(appId: string, apiKey: string, authMode?: AuthMode): {
3
+ readonly headers: () => Headers;
4
+ readonly queryParameters: () => QueryParameters;
5
+ };
6
6
  //# sourceMappingURL=createAuth.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { Requester } from './types';
2
- export declare type EchoRequesterParams = {
3
- getURL: (url: string) => URL;
4
- status?: number;
5
- };
6
- export declare function createEchoRequester({ getURL, status, }: EchoRequesterParams): Requester;
1
+ import type { Requester } from './types';
2
+ export type EchoRequesterParams = {
3
+ getURL: (url: string) => URL;
4
+ status?: number;
5
+ };
6
+ export declare function createEchoRequester({ getURL, status, }: EchoRequesterParams): Requester;
7
7
  //# sourceMappingURL=createEchoRequester.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createEchoRequester.d.ts","sourceRoot":"","sources":["../../src/createEchoRequester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,SAAS,EAAY,MAAM,SAAS,CAAC;AAE7E,oBAAY,mBAAmB,GAAG;IAChC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA2BF,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAY,GACb,EAAE,mBAAmB,GAAG,SAAS,CAuBjC"}
1
+ {"version":3,"file":"createEchoRequester.d.ts","sourceRoot":"","sources":["../../src/createEchoRequester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,SAAS,EAAY,MAAM,SAAS,CAAC;AAE7E,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA2BF,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAY,GACb,EAAE,mBAAmB,GAAG,SAAS,CAuBjC"}
@@ -1,13 +1,13 @@
1
- import type { CreateIterablePromise } from './types/createIterablePromise';
2
- /**
3
- * Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.
4
- *
5
- * @param createIterator - The createIterator options.
6
- * @param createIterator.func - The function to run, which returns a promise.
7
- * @param createIterator.validate - The validator function. It receives the resolved return of `func`.
8
- * @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.
9
- * @param createIterator.error - The `validate` condition to throw an error, and its message.
10
- * @param createIterator.timeout - The function to decide how long to wait between iterations.
11
- */
12
- export declare function createIterablePromise<TResponse>({ func, validate, aggregator, error, timeout, }: CreateIterablePromise<TResponse>): Promise<TResponse>;
1
+ import type { CreateIterablePromise } from './types/createIterablePromise';
2
+ /**
3
+ * Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.
4
+ *
5
+ * @param createIterator - The createIterator options.
6
+ * @param createIterator.func - The function to run, which returns a promise.
7
+ * @param createIterator.validate - The validator function. It receives the resolved return of `func`.
8
+ * @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.
9
+ * @param createIterator.error - The `validate` condition to throw an error, and its message.
10
+ * @param createIterator.timeout - The function to decide how long to wait between iterations.
11
+ */
12
+ export declare function createIterablePromise<TResponse>({ func, validate, aggregator, error, timeout, }: CreateIterablePromise<TResponse>): Promise<TResponse>;
13
13
  //# sourceMappingURL=createIterablePromise.d.ts.map
@@ -1,8 +1,8 @@
1
- import type { AlgoliaAgentOptions, AlgoliaAgent } from './types';
2
- export declare type GetAlgoliaAgent = {
3
- algoliaAgents: AlgoliaAgentOptions[];
4
- client: string;
5
- version: string;
6
- };
7
- export declare function getAlgoliaAgent({ algoliaAgents, client, version, }: GetAlgoliaAgent): AlgoliaAgent;
1
+ import type { AlgoliaAgentOptions, AlgoliaAgent } from './types';
2
+ export type GetAlgoliaAgent = {
3
+ algoliaAgents: AlgoliaAgentOptions[];
4
+ client: string;
5
+ version: string;
6
+ };
7
+ export declare function getAlgoliaAgent({ algoliaAgents, client, version, }: GetAlgoliaAgent): AlgoliaAgent;
8
8
  //# sourceMappingURL=getAlgoliaAgent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAlgoliaAgent.d.ts","sourceRoot":"","sources":["../../src/getAlgoliaAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjE,oBAAY,eAAe,GAAG;IAC5B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,MAAM,EACN,OAAO,GACR,EAAE,eAAe,GAAG,YAAY,CAWhC"}
1
+ {"version":3,"file":"getAlgoliaAgent.d.ts","sourceRoot":"","sources":["../../src/getAlgoliaAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,MAAM,EACN,OAAO,GACR,EAAE,eAAe,GAAG,YAAY,CAWhC"}
@@ -1,3 +1,3 @@
1
- import type { Host, StatefulHost } from '../types';
2
- export declare function createStatefulHost(host: Host, status?: StatefulHost['status']): StatefulHost;
1
+ import type { Host, StatefulHost } from '../types';
2
+ export declare function createStatefulHost(host: Host, status?: StatefulHost['status']): StatefulHost;
3
3
  //# sourceMappingURL=createStatefulHost.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { TransporterOptions, Transporter } from '../types';
2
- export declare function createTransporter({ hosts, hostsCache, baseHeaders, baseQueryParameters, algoliaAgent, timeouts, requester, requestsCache, responsesCache, }: TransporterOptions): Transporter;
1
+ import type { TransporterOptions, Transporter } from '../types';
2
+ export declare function createTransporter({ hosts, hostsCache, baseHeaders, baseQueryParameters, algoliaAgent, timeouts, requester, requestsCache, responsesCache, }: TransporterOptions): Transporter;
3
3
  //# sourceMappingURL=createTransporter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTransporter.d.ts","sourceRoot":"","sources":["../../../src/transporter/createTransporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOV,kBAAkB,EAClB,WAAW,EAEZ,MAAM,UAAU,CAAC;AAsBlB,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,GACf,EAAE,kBAAkB,GAAG,WAAW,CAgTlC"}
1
+ {"version":3,"file":"createTransporter.d.ts","sourceRoot":"","sources":["../../../src/transporter/createTransporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOV,kBAAkB,EAClB,WAAW,EAEZ,MAAM,UAAU,CAAC;AAsBlB,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,GACf,EAAE,kBAAkB,GAAG,WAAW,CAmTlC"}
@@ -1,21 +1,38 @@
1
- import type { Response, StackFrame } from '../types';
2
- export declare class AlgoliaError extends Error {
3
- name: string;
4
- constructor(message: string, name: string);
5
- }
6
- export declare class ErrorWithStackTrace extends AlgoliaError {
7
- stackTrace: StackFrame[];
8
- constructor(message: string, stackTrace: StackFrame[], name: string);
9
- }
10
- export declare class RetryError extends ErrorWithStackTrace {
11
- constructor(stackTrace: StackFrame[]);
12
- }
13
- export declare class ApiError extends ErrorWithStackTrace {
14
- status: number;
15
- constructor(message: string, status: number, stackTrace: StackFrame[]);
16
- }
17
- export declare class DeserializationError extends AlgoliaError {
18
- response: Response;
19
- constructor(message: string, response: Response);
20
- }
1
+ import type { Response, StackFrame } from '../types';
2
+ export declare class AlgoliaError extends Error {
3
+ name: string;
4
+ constructor(message: string, name: string);
5
+ }
6
+ export declare class ErrorWithStackTrace extends AlgoliaError {
7
+ stackTrace: StackFrame[];
8
+ constructor(message: string, stackTrace: StackFrame[], name: string);
9
+ }
10
+ export declare class RetryError extends ErrorWithStackTrace {
11
+ constructor(stackTrace: StackFrame[]);
12
+ }
13
+ export declare class ApiError extends ErrorWithStackTrace {
14
+ status: number;
15
+ constructor(message: string, status: number, stackTrace: StackFrame[], name?: string);
16
+ }
17
+ export declare class DeserializationError extends AlgoliaError {
18
+ response: Response;
19
+ constructor(message: string, response: Response);
20
+ }
21
+ export type DetailedErrorWithMessage = {
22
+ message: string;
23
+ label: string;
24
+ };
25
+ export type DetailedErrorWithTypeID = {
26
+ id: string;
27
+ type: string;
28
+ name?: string;
29
+ };
30
+ export type DetailedError = {
31
+ code: string;
32
+ details?: DetailedErrorWithMessage[] | DetailedErrorWithTypeID[];
33
+ };
34
+ export declare class DetailedApiError extends ApiError {
35
+ error: DetailedError;
36
+ constructor(message: string, status: number, error: DetailedError, stackTrace: StackFrame[]);
37
+ }
21
38
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/transporter/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAkB;gBAElB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAO1C;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,UAAU,EAAE,UAAU,EAAE,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM;CAKpE;AAED,qBAAa,UAAW,SAAQ,mBAAmB;gBACrC,UAAU,EAAE,UAAU,EAAE;CAOrC;AAED,qBAAa,QAAS,SAAQ,mBAAmB;IAC/C,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE;CAItE;AAED,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,QAAQ,EAAE,QAAQ,CAAC;gBAEP,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;CAIhD"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/transporter/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAkB;gBAElB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAO1C;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,UAAU,EAAE,UAAU,EAAE,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM;CAKpE;AAED,qBAAa,UAAW,SAAQ,mBAAmB;gBACrC,UAAU,EAAE,UAAU,EAAE;CAOrC;AAED,qBAAa,QAAS,SAAQ,mBAAmB;IAC/C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EAAE,EACxB,IAAI,SAAa;CAKpB;AAED,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,QAAQ,EAAE,QAAQ,CAAC;gBAEP,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;CAIhD;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,wBAAwB,EAAE,GAAG,uBAAuB,EAAE,CAAC;CAClE,CAAC;AAGF,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,KAAK,EAAE,aAAa,CAAC;gBAGnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,EAAE;CAK3B"}
@@ -1,9 +1,9 @@
1
- import type { Headers, Host, QueryParameters, Request, RequestOptions, Response, StackFrame } from '../types';
2
- export declare function shuffle<TData>(array: TData[]): TData[];
3
- export declare function serializeUrl(host: Host, path: string, queryParameters: QueryParameters): string;
4
- export declare function serializeQueryParameters(parameters: QueryParameters): string;
5
- export declare function serializeData(request: Request, requestOptions: RequestOptions): string | undefined;
6
- export declare function serializeHeaders(baseHeaders: Headers, requestHeaders: Headers, requestOptionsHeaders?: Headers): Headers;
7
- export declare function deserializeSuccess<TObject>(response: Response): TObject;
8
- export declare function deserializeFailure({ content, status }: Response, stackFrame: StackFrame[]): Error;
1
+ import type { Headers, Host, QueryParameters, Request, RequestOptions, Response, StackFrame } from '../types';
2
+ export declare function shuffle<TData>(array: TData[]): TData[];
3
+ export declare function serializeUrl(host: Host, path: string, queryParameters: QueryParameters): string;
4
+ export declare function serializeQueryParameters(parameters: QueryParameters): string;
5
+ export declare function serializeData(request: Request, requestOptions: RequestOptions): string | undefined;
6
+ export declare function serializeHeaders(baseHeaders: Headers, requestHeaders: Headers, requestOptionsHeaders?: Headers): Headers;
7
+ export declare function deserializeSuccess<TObject>(response: Response): TObject;
8
+ export declare function deserializeFailure({ content, status }: Response, stackFrame: StackFrame[]): Error;
9
9
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/transporter/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,IAAI,EACJ,eAAe,EACf,OAAO,EACP,cAAc,EACd,QAAQ,EACR,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAYtD;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,eAAe,GAC/B,MAAM,CAWR;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAe5E;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,GAC7B,MAAM,GAAG,SAAS,CAapB;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,OAAO,EACpB,cAAc,EAAE,OAAO,EACvB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAeT;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAMvE;AAED,wBAAgB,kBAAkB,CAChC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAC7B,UAAU,EAAE,UAAU,EAAE,GACvB,KAAK,CAQP"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/transporter/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,IAAI,EACJ,eAAe,EACf,OAAO,EACP,cAAc,EACd,QAAQ,EACR,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAYtD;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,eAAe,GAC/B,MAAM,CAWR;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAe5E;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,GAC7B,MAAM,GAAG,SAAS,CAapB;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,OAAO,EACpB,cAAc,EAAE,OAAO,EACvB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAeT;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAMvE;AAED,wBAAgB,kBAAkB,CAChC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAC7B,UAAU,EAAE,UAAU,EAAE,GACvB,KAAK,CAgBP"}
@@ -1,7 +1,7 @@
1
- export * from './createTransporter';
2
- export * from './createStatefulHost';
3
- export * from './errors';
4
- export * from './helpers';
5
- export * from './responses';
6
- export * from './stackTrace';
1
+ export * from './createTransporter';
2
+ export * from './createStatefulHost';
3
+ export * from './errors';
4
+ export * from './helpers';
5
+ export * from './responses';
6
+ export * from './stackTrace';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { Response } from '../types';
2
- export declare function isNetworkError({ isTimedOut, status, }: Omit<Response, 'content'>): boolean;
3
- export declare function isRetryable({ isTimedOut, status, }: Omit<Response, 'content'>): boolean;
4
- export declare function isSuccess({ status }: Pick<Response, 'status'>): boolean;
1
+ import type { Response } from '../types';
2
+ export declare function isNetworkError({ isTimedOut, status, }: Omit<Response, 'content'>): boolean;
3
+ export declare function isRetryable({ isTimedOut, status, }: Omit<Response, 'content'>): boolean;
4
+ export declare function isSuccess({ status }: Pick<Response, 'status'>): boolean;
5
5
  //# sourceMappingURL=responses.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { StackFrame } from '../types';
2
- export declare function stackTraceWithoutCredentials(stackTrace: StackFrame[]): StackFrame[];
3
- export declare function stackFrameWithoutCredentials(stackFrame: StackFrame): StackFrame;
1
+ import type { StackFrame } from '../types';
2
+ export declare function stackTraceWithoutCredentials(stackTrace: StackFrame[]): StackFrame[];
3
+ export declare function stackFrameWithoutCredentials(stackFrame: StackFrame): StackFrame;
4
4
  //# sourceMappingURL=stackTrace.d.ts.map
@@ -1,47 +1,47 @@
1
- export declare type Cache = {
2
- /**
3
- * Gets the value of the given `key`.
4
- */
5
- get: <TValue>(key: Record<string, any> | string, defaultValue: () => Promise<TValue>, events?: CacheEvents<TValue>) => Promise<TValue>;
6
- /**
7
- * Sets the given value with the given `key`.
8
- */
9
- set: <TValue>(key: Record<string, any> | string, value: TValue) => Promise<TValue>;
10
- /**
11
- * Deletes the given `key`.
12
- */
13
- delete: (key: Record<string, any> | string) => Promise<void>;
14
- /**
15
- * Clears the cache.
16
- */
17
- clear: () => Promise<void>;
18
- };
19
- export declare type CacheEvents<TValue> = {
20
- /**
21
- * The callback when the given `key` is missing from the cache.
22
- */
23
- miss: (value: TValue) => Promise<any>;
24
- };
25
- export declare type MemoryCacheOptions = {
26
- /**
27
- * If keys and values should be serialized using `JSON.stringify`.
28
- */
29
- serializable?: boolean;
30
- };
31
- export declare type BrowserLocalStorageOptions = {
32
- /**
33
- * The cache key.
34
- */
35
- key: string;
36
- /**
37
- * The native local storage implementation.
38
- */
39
- localStorage?: Storage;
40
- };
41
- export declare type FallbackableCacheOptions = {
42
- /**
43
- * List of caches order by priority.
44
- */
45
- caches: Cache[];
46
- };
1
+ export type Cache = {
2
+ /**
3
+ * Gets the value of the given `key`.
4
+ */
5
+ get: <TValue>(key: Record<string, any> | string, defaultValue: () => Promise<TValue>, events?: CacheEvents<TValue>) => Promise<TValue>;
6
+ /**
7
+ * Sets the given value with the given `key`.
8
+ */
9
+ set: <TValue>(key: Record<string, any> | string, value: TValue) => Promise<TValue>;
10
+ /**
11
+ * Deletes the given `key`.
12
+ */
13
+ delete: (key: Record<string, any> | string) => Promise<void>;
14
+ /**
15
+ * Clears the cache.
16
+ */
17
+ clear: () => Promise<void>;
18
+ };
19
+ export type CacheEvents<TValue> = {
20
+ /**
21
+ * The callback when the given `key` is missing from the cache.
22
+ */
23
+ miss: (value: TValue) => Promise<any>;
24
+ };
25
+ export type MemoryCacheOptions = {
26
+ /**
27
+ * If keys and values should be serialized using `JSON.stringify`.
28
+ */
29
+ serializable?: boolean;
30
+ };
31
+ export type BrowserLocalStorageOptions = {
32
+ /**
33
+ * The cache key.
34
+ */
35
+ key: string;
36
+ /**
37
+ * The native local storage implementation.
38
+ */
39
+ localStorage?: Storage;
40
+ };
41
+ export type FallbackableCacheOptions = {
42
+ /**
43
+ * List of caches order by priority.
44
+ */
45
+ caches: Cache[];
46
+ };
47
47
  //# sourceMappingURL=cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/types/cache.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IAClB;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EACV,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EACjC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACnC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,KACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EACV,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EACjC,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF,oBAAY,WAAW,CAAC,MAAM,IAAI;IAChC;;OAEG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/types/cache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EACV,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EACjC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACnC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,KACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EACV,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EACjC,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,MAAM,IAAI;IAChC;;OAEG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC"}
@@ -1,12 +1,12 @@
1
- import type { AlgoliaAgentOptions, TransporterOptions } from './transporter';
2
- export declare type AuthMode = 'WithinHeaders' | 'WithinQueryParameters';
3
- declare type OverriddenTransporterOptions = 'baseHeaders' | 'baseQueryParameters' | 'hosts';
4
- export declare type CreateClientOptions = Omit<TransporterOptions, OverriddenTransporterOptions | 'algoliaAgent'> & Partial<Pick<TransporterOptions, OverriddenTransporterOptions>> & {
5
- appId: string;
6
- apiKey: string;
7
- authMode?: AuthMode;
8
- algoliaAgents: AlgoliaAgentOptions[];
9
- };
10
- export declare type ClientOptions = Partial<Omit<CreateClientOptions, 'apiKey' | 'appId'>>;
11
- export {};
1
+ import type { AlgoliaAgentOptions, TransporterOptions } from './transporter';
2
+ export type AuthMode = 'WithinHeaders' | 'WithinQueryParameters';
3
+ type OverriddenTransporterOptions = 'baseHeaders' | 'baseQueryParameters' | 'hosts';
4
+ export type CreateClientOptions = Omit<TransporterOptions, OverriddenTransporterOptions | 'algoliaAgent'> & Partial<Pick<TransporterOptions, OverriddenTransporterOptions>> & {
5
+ appId: string;
6
+ apiKey: string;
7
+ authMode?: AuthMode;
8
+ algoliaAgents: AlgoliaAgentOptions[];
9
+ };
10
+ export type ClientOptions = Partial<Omit<CreateClientOptions, 'apiKey' | 'appId'>>;
11
+ export {};
12
12
  //# sourceMappingURL=createClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../../src/types/createClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E,oBAAY,QAAQ,GAAG,eAAe,GAAG,uBAAuB,CAAC;AAEjE,aAAK,4BAA4B,GAC7B,aAAa,GACb,qBAAqB,GACrB,OAAO,CAAC;AAEZ,oBAAY,mBAAmB,GAAG,IAAI,CACpC,kBAAkB,EAClB,4BAA4B,GAAG,cAAc,CAC9C,GACC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC,GAAG;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC,CAAC;AAEJ,oBAAY,aAAa,GAAG,OAAO,CACjC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,CAC9C,CAAC"}
1
+ {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../../src/types/createClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,uBAAuB,CAAC;AAEjE,KAAK,4BAA4B,GAC7B,aAAa,GACb,qBAAqB,GACrB,OAAO,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,kBAAkB,EAClB,4BAA4B,GAAG,cAAc,CAC9C,GACC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC,GAAG;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,OAAO,CACjC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,CAC9C,CAAC"}
@@ -1,36 +1,36 @@
1
- export declare type IterableOptions<TResponse> = Partial<{
2
- /**
3
- * The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
4
- */
5
- aggregator: (response: TResponse) => void;
6
- /**
7
- * The `validate` condition to throw an error and its message.
8
- */
9
- error: {
10
- /**
11
- * The function to validate the error condition.
12
- */
13
- validate: (response: TResponse) => boolean;
14
- /**
15
- * The error message to throw.
16
- */
17
- message: (response: TResponse) => string;
18
- };
19
- /**
20
- * The function to decide how long to wait between iterations.
21
- */
22
- timeout: () => number;
23
- }>;
24
- export declare type CreateIterablePromise<TResponse> = IterableOptions<TResponse> & {
25
- /**
26
- * The function to run, which returns a promise.
27
- *
28
- * The `previousResponse` parameter (`undefined` on the first call) allows you to build your request with incremental logic, to iterate on `page` or `cursor` for example.
29
- */
30
- func: (previousResponse?: TResponse) => Promise<TResponse>;
31
- /**
32
- * The validator function. It receive the resolved return of the API call.
33
- */
34
- validate: (response: TResponse) => boolean;
35
- };
1
+ export type IterableOptions<TResponse> = Partial<{
2
+ /**
3
+ * The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
4
+ */
5
+ aggregator: (response: TResponse) => void;
6
+ /**
7
+ * The `validate` condition to throw an error and its message.
8
+ */
9
+ error: {
10
+ /**
11
+ * The function to validate the error condition.
12
+ */
13
+ validate: (response: TResponse) => boolean;
14
+ /**
15
+ * The error message to throw.
16
+ */
17
+ message: (response: TResponse) => string;
18
+ };
19
+ /**
20
+ * The function to decide how long to wait between iterations.
21
+ */
22
+ timeout: () => number;
23
+ }>;
24
+ export type CreateIterablePromise<TResponse> = IterableOptions<TResponse> & {
25
+ /**
26
+ * The function to run, which returns a promise.
27
+ *
28
+ * The `previousResponse` parameter (`undefined` on the first call) allows you to build your request with incremental logic, to iterate on `page` or `cursor` for example.
29
+ */
30
+ func: (previousResponse?: TResponse) => Promise<TResponse>;
31
+ /**
32
+ * The validator function. It receive the resolved return of the API call.
33
+ */
34
+ validate: (response: TResponse) => boolean;
35
+ };
36
36
  //# sourceMappingURL=createIterablePromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createIterablePromise.d.ts","sourceRoot":"","sources":["../../../src/types/createIterablePromise.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,CAAC,SAAS,IAAI,OAAO,CAAC;IAC/C;;OAEG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE;QACL;;WAEG;QACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC;QAE3C;;WAEG;QACH,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,MAAM,CAAC;KAC1C,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH,oBAAY,qBAAqB,CAAC,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG;IAC1E;;;;OAIG;IACH,IAAI,EAAE,CAAC,gBAAgB,CAAC,EAAE,SAAS,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAE3D;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC;CAC5C,CAAC"}
1
+ {"version":3,"file":"createIterablePromise.d.ts","sourceRoot":"","sources":["../../../src/types/createIterablePromise.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CAAC,SAAS,IAAI,OAAO,CAAC;IAC/C;;OAEG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE;QACL;;WAEG;QACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC;QAE3C;;WAEG;QACH,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,MAAM,CAAC;KAC1C,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,CAAC,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG;IAC1E;;;;OAIG;IACH,IAAI,EAAE,CAAC,gBAAgB,CAAC,EAAE,SAAS,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAE3D;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC;CAC5C,CAAC"}
@@ -1,33 +1,33 @@
1
- export declare type Host = {
2
- /**
3
- * The host URL.
4
- */
5
- url: string;
6
- /**
7
- * The accepted transporter.
8
- */
9
- accept: 'read' | 'readWrite' | 'write';
10
- /**
11
- * The protocol of the host URL.
12
- */
13
- protocol: 'http' | 'https';
14
- };
15
- export declare type StatefulHost = Host & {
16
- /**
17
- * The status of the host.
18
- */
19
- status: 'down' | 'timed out' | 'up';
20
- /**
21
- * The last update of the host status, used to compare with the expiration delay.
22
- */
23
- lastUpdate: number;
24
- /**
25
- * Returns whether the host is up or not.
26
- */
27
- isUp: () => boolean;
28
- /**
29
- * Returns whether the host is timed out or not.
30
- */
31
- isTimedOut: () => boolean;
32
- };
1
+ export type Host = {
2
+ /**
3
+ * The host URL.
4
+ */
5
+ url: string;
6
+ /**
7
+ * The accepted transporter.
8
+ */
9
+ accept: 'read' | 'readWrite' | 'write';
10
+ /**
11
+ * The protocol of the host URL.
12
+ */
13
+ protocol: 'http' | 'https';
14
+ };
15
+ export type StatefulHost = Host & {
16
+ /**
17
+ * The status of the host.
18
+ */
19
+ status: 'down' | 'timed out' | 'up';
20
+ /**
21
+ * The last update of the host status, used to compare with the expiration delay.
22
+ */
23
+ lastUpdate: number;
24
+ /**
25
+ * Returns whether the host is up or not.
26
+ */
27
+ isUp: () => boolean;
28
+ /**
29
+ * Returns whether the host is timed out or not.
30
+ */
31
+ isTimedOut: () => boolean;
32
+ };
33
33
  //# sourceMappingURL=host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/types/host.ts"],"names":[],"mappings":"AAAA,oBAAY,IAAI,GAAG;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;IAEvC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEF,oBAAY,YAAY,GAAG,IAAI,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;CAC3B,CAAC"}
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/types/host.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;IAEvC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC;CAC3B,CAAC"}
@@ -1,7 +1,7 @@
1
- export * from './cache';
2
- export * from './createClient';
3
- export * from './createIterablePromise';
4
- export * from './host';
5
- export * from './requester';
6
- export * from './transporter';
1
+ export * from './cache';
2
+ export * from './createClient';
3
+ export * from './createIterablePromise';
4
+ export * from './host';
5
+ export * from './requester';
6
+ export * from './transporter';
7
7
  //# sourceMappingURL=index.d.ts.map