@algolia/client-common 5.2.4 → 5.2.5
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/common.cjs +714 -0
- package/dist/common.cjs.map +1 -0
- package/dist/common.d.cts +438 -0
- package/dist/common.d.ts +438 -0
- package/dist/common.esm.js +653 -0
- package/dist/common.esm.js.map +1 -0
- package/package.json +20 -6
- package/dist/client-common.cjs +0 -783
- package/dist/client-common.esm.node.js +0 -747
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/src/cache/createBrowserLocalStorageCache.d.ts +0 -3
- package/dist/src/cache/createBrowserLocalStorageCache.d.ts.map +0 -1
- package/dist/src/cache/createFallbackableCache.d.ts +0 -3
- package/dist/src/cache/createFallbackableCache.d.ts.map +0 -1
- package/dist/src/cache/createMemoryCache.d.ts +0 -3
- package/dist/src/cache/createMemoryCache.d.ts.map +0 -1
- package/dist/src/cache/createNullCache.d.ts +0 -3
- package/dist/src/cache/createNullCache.d.ts.map +0 -1
- package/dist/src/cache/index.d.ts +0 -5
- package/dist/src/cache/index.d.ts.map +0 -1
- package/dist/src/constants.d.ts +0 -7
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/createAlgoliaAgent.d.ts +0 -3
- package/dist/src/createAlgoliaAgent.d.ts.map +0 -1
- package/dist/src/createAuth.d.ts +0 -6
- package/dist/src/createAuth.d.ts.map +0 -1
- package/dist/src/createEchoRequester.d.ts +0 -7
- package/dist/src/createEchoRequester.d.ts.map +0 -1
- package/dist/src/createIterablePromise.d.ts +0 -13
- package/dist/src/createIterablePromise.d.ts.map +0 -1
- package/dist/src/getAlgoliaAgent.d.ts +0 -8
- package/dist/src/getAlgoliaAgent.d.ts.map +0 -1
- package/dist/src/transporter/createStatefulHost.d.ts +0 -3
- package/dist/src/transporter/createStatefulHost.d.ts.map +0 -1
- package/dist/src/transporter/createTransporter.d.ts +0 -3
- package/dist/src/transporter/createTransporter.d.ts.map +0 -1
- package/dist/src/transporter/errors.d.ts +0 -38
- package/dist/src/transporter/errors.d.ts.map +0 -1
- package/dist/src/transporter/helpers.d.ts +0 -9
- package/dist/src/transporter/helpers.d.ts.map +0 -1
- package/dist/src/transporter/index.d.ts +0 -7
- package/dist/src/transporter/index.d.ts.map +0 -1
- package/dist/src/transporter/responses.d.ts +0 -5
- package/dist/src/transporter/responses.d.ts.map +0 -1
- package/dist/src/transporter/stackTrace.d.ts +0 -4
- package/dist/src/transporter/stackTrace.d.ts.map +0 -1
- package/dist/src/types/cache.d.ts +0 -61
- package/dist/src/types/cache.d.ts.map +0 -1
- package/dist/src/types/createClient.d.ts +0 -12
- package/dist/src/types/createClient.d.ts.map +0 -1
- package/dist/src/types/createIterablePromise.d.ts +0 -36
- package/dist/src/types/createIterablePromise.d.ts.map +0 -1
- package/dist/src/types/host.d.ts +0 -37
- package/dist/src/types/host.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -7
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/requester.d.ts +0 -66
- package/dist/src/types/requester.d.ts.map +0 -1
- package/dist/src/types/transporter.d.ts +0 -128
- package/dist/src/types/transporter.d.ts.map +0 -1
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBrowserLocalStorageCache.d.ts","sourceRoot":"","sources":["../../../src/cache/createBrowserLocalStorageCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,0BAA0B,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAE7G,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,0BAA0B,GAAG,KAAK,CAuGzF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFallbackableCache.d.ts","sourceRoot":"","sources":["../../../src/cache/createFallbackableCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAI7E,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,KAAK,CAuChF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createMemoryCache.d.ts","sourceRoot":"","sources":["../../../src/cache/createMemoryCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAe,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEvE,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAA2C,GAAG,KAAK,CAwC7F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNullCache.d.ts","sourceRoot":"","sources":["../../../src/cache/createNullCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAEnD,wBAAgB,eAAe,IAAI,KAAK,CA0BvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/dist/src/constants.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AAEnD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,0BAA0B,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAlgoliaAgent.d.ts","sourceRoot":"","sources":["../../src/createAlgoliaAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAehE"}
|
package/dist/src/createAuth.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=createAuth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAuth.d.ts","sourceRoot":"","sources":["../../src/createAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,QAA0B,GACnC;IACD,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,eAAe,CAAC;CACjD,CAeA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=createEchoRequester.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAyCF,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAY,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAqB5F"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=createIterablePromise.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIterablePromise.d.ts","sourceRoot":"","sources":["../../src/createIterablePromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,EAC/C,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,KAAK,EACL,OAAyB,GAC1B,EAAE,qBAAqB,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CA4BvD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=getAlgoliaAgent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,eAAe,GAAG,YAAY,CASjG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createStatefulHost.d.ts","sourceRoot":"","sources":["../../../src/transporter/createStatefulHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAE,YAAY,CAAC,QAAQ,CAAQ,GAAG,YAAY,CAYlG"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { TransporterOptions, Transporter } from '../types';
|
|
2
|
-
export declare function createTransporter({ hosts, hostsCache, baseHeaders, baseQueryParameters, algoliaAgent, timeouts, requester, requestsCache, responsesCache, }: TransporterOptions): Transporter;
|
|
3
|
-
//# sourceMappingURL=createTransporter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAalB,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,CAyRlC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
}
|
|
38
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,IAAI,SAAa;CAIzF;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;gBAET,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE;CAI5F"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/transporter/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI9G,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAYtD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,GAAG,MAAM,CAW/F;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAa5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAQlG;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,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAWjG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transporter/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/transporter/responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,OAAO,CAEzF;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,OAAO,CAEtF;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,OAAO,CAEvE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { StackFrame } from '../types';
|
|
2
|
-
export declare function stackTraceWithoutCredentials(stackTrace: StackFrame[]): StackFrame[];
|
|
3
|
-
export declare function stackFrameWithoutCredentials(stackFrame: StackFrame): StackFrame;
|
|
4
|
-
//# sourceMappingURL=stackTrace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stackTrace.d.ts","sourceRoot":"","sources":["../../../src/transporter/stackTrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAEnF;AAED,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAe/E"}
|
|
@@ -1,61 +0,0 @@
|
|
|
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 time to live for each cached item in seconds.
|
|
38
|
-
*/
|
|
39
|
-
timeToLive?: number;
|
|
40
|
-
/**
|
|
41
|
-
* The native local storage implementation.
|
|
42
|
-
*/
|
|
43
|
-
localStorage?: Storage;
|
|
44
|
-
};
|
|
45
|
-
export type BrowserLocalStorageCacheItem = {
|
|
46
|
-
/**
|
|
47
|
-
* The cache item creation timestamp.
|
|
48
|
-
*/
|
|
49
|
-
timestamp: number;
|
|
50
|
-
/**
|
|
51
|
-
* The cache item value.
|
|
52
|
-
*/
|
|
53
|
-
value: any;
|
|
54
|
-
};
|
|
55
|
-
export type FallbackableCacheOptions = {
|
|
56
|
-
/**
|
|
57
|
-
* List of caches order by priority.
|
|
58
|
-
*/
|
|
59
|
-
caches: Cache[];
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnF;;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,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=createClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,aAAa,GAAG,qBAAqB,GAAG,OAAO,CAAC;AAEpF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,4BAA4B,GAAG,cAAc,CAAC,GACvG,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,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=createIterablePromise.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/src/types/host.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
* The port of the host URL.
|
|
16
|
-
*/
|
|
17
|
-
port?: number;
|
|
18
|
-
};
|
|
19
|
-
export type StatefulHost = Host & {
|
|
20
|
-
/**
|
|
21
|
-
* The status of the host.
|
|
22
|
-
*/
|
|
23
|
-
status: 'down' | 'timed out' | 'up';
|
|
24
|
-
/**
|
|
25
|
-
* The last update of the host status, used to compare with the expiration delay.
|
|
26
|
-
*/
|
|
27
|
-
lastUpdate: number;
|
|
28
|
-
/**
|
|
29
|
-
* Returns whether the host is up or not.
|
|
30
|
-
*/
|
|
31
|
-
isUp: () => boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Returns whether the host is timed out or not.
|
|
34
|
-
*/
|
|
35
|
-
isTimedOut: () => boolean;
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=host.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { Headers, QueryParameters } from './transporter';
|
|
2
|
-
/**
|
|
3
|
-
* The method of the request.
|
|
4
|
-
*/
|
|
5
|
-
export type Method = 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';
|
|
6
|
-
export type Request = {
|
|
7
|
-
method: Method;
|
|
8
|
-
/**
|
|
9
|
-
* The path of the REST API to send the request to.
|
|
10
|
-
*/
|
|
11
|
-
path: string;
|
|
12
|
-
queryParameters: QueryParameters;
|
|
13
|
-
data?: Array<Record<string, any>> | Record<string, any>;
|
|
14
|
-
headers: Headers;
|
|
15
|
-
/**
|
|
16
|
-
* If the given request should persist on the cache. Keep in mind,
|
|
17
|
-
* that some methods may have this option enabled by default.
|
|
18
|
-
*/
|
|
19
|
-
cacheable?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Some POST methods in the Algolia REST API uses the `read` transporter.
|
|
22
|
-
* This information is defined at the spec level.
|
|
23
|
-
*/
|
|
24
|
-
useReadTransporter?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type EndRequest = Pick<Request, 'headers' | 'method'> & {
|
|
27
|
-
/**
|
|
28
|
-
* The full URL of the REST API.
|
|
29
|
-
*/
|
|
30
|
-
url: string;
|
|
31
|
-
/**
|
|
32
|
-
* The connection timeout, in milliseconds.
|
|
33
|
-
*/
|
|
34
|
-
connectTimeout: number;
|
|
35
|
-
/**
|
|
36
|
-
* The response timeout, in milliseconds.
|
|
37
|
-
*/
|
|
38
|
-
responseTimeout: number;
|
|
39
|
-
data?: string;
|
|
40
|
-
};
|
|
41
|
-
export type Response = {
|
|
42
|
-
/**
|
|
43
|
-
* The body of the response.
|
|
44
|
-
*/
|
|
45
|
-
content: string;
|
|
46
|
-
/**
|
|
47
|
-
* Whether the API call is timed out or not.
|
|
48
|
-
*/
|
|
49
|
-
isTimedOut: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* The HTTP status code of the response.
|
|
52
|
-
*/
|
|
53
|
-
status: number;
|
|
54
|
-
};
|
|
55
|
-
export type Requester = {
|
|
56
|
-
/**
|
|
57
|
-
* Sends the given `request` to the server.
|
|
58
|
-
*/
|
|
59
|
-
send: (request: EndRequest) => Promise<Response>;
|
|
60
|
-
};
|
|
61
|
-
export type EchoResponse = Omit<EndRequest, 'data'> & Pick<Request, 'data' | 'path'> & {
|
|
62
|
-
host: string;
|
|
63
|
-
algoliaAgent: string;
|
|
64
|
-
searchParams?: Record<string, string>;
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=requester.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requester.d.ts","sourceRoot":"","sources":["../../../src/types/requester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEjE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,eAAe,CAAC;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC,GAAG;IAC7D;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACjD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { Cache } from './cache';
|
|
2
|
-
import type { Host } from './host';
|
|
3
|
-
import type { Request, Requester, EndRequest, Response } from './requester';
|
|
4
|
-
export type Headers = Record<string, string>;
|
|
5
|
-
export type QueryParameters = Record<string, any>;
|
|
6
|
-
export type RequestOptions = Pick<Request, 'cacheable'> & {
|
|
7
|
-
/**
|
|
8
|
-
* Custom timeout for the request. Note that, in normal situations
|
|
9
|
-
* the given timeout will be applied. But the transporter layer may
|
|
10
|
-
* increase this timeout if there is need for it.
|
|
11
|
-
*/
|
|
12
|
-
timeouts?: Partial<Timeouts>;
|
|
13
|
-
/**
|
|
14
|
-
* Custom headers for the request. This headers are
|
|
15
|
-
* going to be merged the transporter headers.
|
|
16
|
-
*/
|
|
17
|
-
headers?: Headers;
|
|
18
|
-
/**
|
|
19
|
-
* Custom query parameters for the request. This query parameters are
|
|
20
|
-
* going to be merged the transporter query parameters.
|
|
21
|
-
*/
|
|
22
|
-
queryParameters?: QueryParameters;
|
|
23
|
-
/**
|
|
24
|
-
* Custom data for the request. This data is
|
|
25
|
-
* going to be merged the transporter data.
|
|
26
|
-
*/
|
|
27
|
-
data?: Array<Record<string, any>> | Record<string, any>;
|
|
28
|
-
};
|
|
29
|
-
export type StackFrame = {
|
|
30
|
-
request: EndRequest;
|
|
31
|
-
response: Response;
|
|
32
|
-
host: Host;
|
|
33
|
-
triesLeft: number;
|
|
34
|
-
};
|
|
35
|
-
export type AlgoliaAgentOptions = {
|
|
36
|
-
/**
|
|
37
|
-
* The segment. Usually the integration name.
|
|
38
|
-
*/
|
|
39
|
-
segment: string;
|
|
40
|
-
/**
|
|
41
|
-
* The version. Usually the integration version.
|
|
42
|
-
*/
|
|
43
|
-
version?: string;
|
|
44
|
-
};
|
|
45
|
-
export type AlgoliaAgent = {
|
|
46
|
-
/**
|
|
47
|
-
* The raw value of the user agent.
|
|
48
|
-
*/
|
|
49
|
-
value: string;
|
|
50
|
-
/**
|
|
51
|
-
* Mutates the current user agent adding the given user agent options.
|
|
52
|
-
*/
|
|
53
|
-
add: (options: AlgoliaAgentOptions) => AlgoliaAgent;
|
|
54
|
-
};
|
|
55
|
-
export type Timeouts = {
|
|
56
|
-
/**
|
|
57
|
-
* Timeout in milliseconds before the connection is established.
|
|
58
|
-
*/
|
|
59
|
-
connect: number;
|
|
60
|
-
/**
|
|
61
|
-
* Timeout in milliseconds before reading the response on a read request.
|
|
62
|
-
*/
|
|
63
|
-
read: number;
|
|
64
|
-
/**
|
|
65
|
-
* Timeout in milliseconds before reading the response on a write request.
|
|
66
|
-
*/
|
|
67
|
-
write: number;
|
|
68
|
-
};
|
|
69
|
-
export type TransporterOptions = {
|
|
70
|
-
/**
|
|
71
|
-
* The cache of the hosts. Usually used to persist
|
|
72
|
-
* the state of the host when its down.
|
|
73
|
-
*/
|
|
74
|
-
hostsCache: Cache;
|
|
75
|
-
/**
|
|
76
|
-
* The underlying requester used. Should differ
|
|
77
|
-
* depending of the environment where the client
|
|
78
|
-
* will be used.
|
|
79
|
-
*/
|
|
80
|
-
requester: Requester;
|
|
81
|
-
/**
|
|
82
|
-
* The cache of the requests. When requests are
|
|
83
|
-
* `cacheable`, the returned promised persists
|
|
84
|
-
* in this cache to shared in similar requests
|
|
85
|
-
* before being resolved.
|
|
86
|
-
*/
|
|
87
|
-
requestsCache: Cache;
|
|
88
|
-
/**
|
|
89
|
-
* The cache of the responses. When requests are
|
|
90
|
-
* `cacheable`, the returned responses persists
|
|
91
|
-
* in this cache to shared in similar requests.
|
|
92
|
-
*/
|
|
93
|
-
responsesCache: Cache;
|
|
94
|
-
/**
|
|
95
|
-
* The timeouts used by the requester. The transporter
|
|
96
|
-
* layer may increase this timeouts as defined on the
|
|
97
|
-
* retry strategy.
|
|
98
|
-
*/
|
|
99
|
-
timeouts: Timeouts;
|
|
100
|
-
/**
|
|
101
|
-
* The hosts used by the requester.
|
|
102
|
-
*/
|
|
103
|
-
hosts: Host[];
|
|
104
|
-
/**
|
|
105
|
-
* The headers used by the requester. The transporter
|
|
106
|
-
* layer may add some extra headers during the request
|
|
107
|
-
* for the user agent, and others.
|
|
108
|
-
*/
|
|
109
|
-
baseHeaders: Headers;
|
|
110
|
-
/**
|
|
111
|
-
* The query parameters used by the requester. The transporter
|
|
112
|
-
* layer may add some extra headers during the request
|
|
113
|
-
* for the user agent, and others.
|
|
114
|
-
*/
|
|
115
|
-
baseQueryParameters: QueryParameters;
|
|
116
|
-
/**
|
|
117
|
-
* The user agent used. Sent on query parameters.
|
|
118
|
-
*/
|
|
119
|
-
algoliaAgent: AlgoliaAgent;
|
|
120
|
-
};
|
|
121
|
-
export type Transporter = TransporterOptions & {
|
|
122
|
-
/**
|
|
123
|
-
* Performs a request.
|
|
124
|
-
* The `baseRequest` and `baseRequestOptions` will be merged accordingly.
|
|
125
|
-
*/
|
|
126
|
-
request: <TResponse>(baseRequest: Request, baseRequestOptions?: RequestOptions) => Promise<TResponse>;
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=transporter.d.ts.map
|