Skip to content

Commit 962141e

Browse files
chore: generated code for commit 7ff32bf. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 7ff32bf commit 962141e

File tree

124 files changed

+4497
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+4497
-58
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import type { InitClientOptions } from '@experimental-api-clients-automation/client-common';
2+
import {
3+
DEFAULT_CONNECT_TIMEOUT_BROWSER,
4+
DEFAULT_READ_TIMEOUT_BROWSER,
5+
DEFAULT_WRITE_TIMEOUT_BROWSER,
6+
createMemoryCache,
7+
createFallbackableCache,
8+
createBrowserLocalStorageCache,
9+
} from '@experimental-api-clients-automation/client-common';
10+
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';
11+
12+
import { createLiteClient, apiClientVersion } from '../src/liteClient';
13+
import type { LiteClient } from '../src/liteClient';
14+
15+
export { apiClientVersion, LiteClient } from '../src/liteClient';
16+
export * from '../model';
17+
18+
export function liteClient(
19+
appId: string,
20+
apiKey: string,
21+
options?: InitClientOptions
22+
): LiteClient {
23+
if (!appId || typeof appId !== 'string') {
24+
throw new Error('`appId` is missing.');
25+
}
26+
27+
if (!apiKey || typeof apiKey !== 'string') {
28+
throw new Error('`apiKey` is missing.');
29+
}
30+
31+
return createLiteClient({
32+
appId,
33+
apiKey,
34+
timeouts: {
35+
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
36+
read: DEFAULT_READ_TIMEOUT_BROWSER,
37+
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
38+
},
39+
requester: createXhrRequester(),
40+
algoliaAgents: [{ segment: 'Browser' }],
41+
authMode: 'WithinQueryParameters',
42+
responsesCache: createMemoryCache(),
43+
requestsCache: createMemoryCache({ serializable: false }),
44+
hostsCache: createFallbackableCache({
45+
caches: [
46+
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
47+
createMemoryCache(),
48+
],
49+
}),
50+
...options,
51+
});
52+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type { InitClientOptions } from '@experimental-api-clients-automation/client-common';
2+
import {
3+
DEFAULT_CONNECT_TIMEOUT_NODE,
4+
DEFAULT_READ_TIMEOUT_NODE,
5+
DEFAULT_WRITE_TIMEOUT_NODE,
6+
createMemoryCache,
7+
createNullCache,
8+
} from '@experimental-api-clients-automation/client-common';
9+
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';
10+
11+
import { createLiteClient } from '../src/liteClient';
12+
import type { LiteClient } from '../src/liteClient';
13+
14+
export { apiClientVersion, LiteClient } from '../src/liteClient';
15+
export * from '../model';
16+
17+
export function liteClient(
18+
appId: string,
19+
apiKey: string,
20+
options?: InitClientOptions
21+
): LiteClient {
22+
if (!appId || typeof appId !== 'string') {
23+
throw new Error('`appId` is missing.');
24+
}
25+
26+
if (!apiKey || typeof apiKey !== 'string') {
27+
throw new Error('`apiKey` is missing.');
28+
}
29+
30+
return createLiteClient({
31+
appId,
32+
apiKey,
33+
timeouts: {
34+
connect: DEFAULT_CONNECT_TIMEOUT_NODE,
35+
read: DEFAULT_READ_TIMEOUT_NODE,
36+
write: DEFAULT_WRITE_TIMEOUT_NODE,
37+
},
38+
requester: createHttpRequester(),
39+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
40+
responsesCache: createNullCache(),
41+
requestsCache: createNullCache(),
42+
hostsCache: createMemoryCache(),
43+
...options,
44+
});
45+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line import/no-unresolved
2+
export * from '../dist/lite/lite/builds/node';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line import/no-commonjs,import/extensions
2+
module.exports = require('./../dist/lite/lite.cjs.js');
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export type Acl =
2+
| 'addObject'
3+
| 'analytics'
4+
| 'browse'
5+
| 'deleteIndex'
6+
| 'deleteObject'
7+
| 'editSettings'
8+
| 'listIndexes'
9+
| 'logs'
10+
| 'personalization'
11+
| 'recommendation'
12+
| 'search'
13+
| 'seeUnretrievableAttributes'
14+
| 'settings'
15+
| 'usage';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Type of operation.
3+
*/
4+
export type Action =
5+
| 'addObject'
6+
| 'clear'
7+
| 'delete'
8+
| 'deleteObject'
9+
| 'partialUpdateObject'
10+
| 'partialUpdateObjectNoCreate'
11+
| 'updateObject';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type AddApiKeyResponse = {
2+
/**
3+
* Key string.
4+
*/
5+
key: string;
6+
/**
7+
* Date of creation (ISO-8601 format).
8+
*/
9+
createdAt: string;
10+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type AlternativesAsExact =
2+
| 'ignorePlurals'
3+
| 'multiWordsSynonym'
4+
| 'singleWordSynonym';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Whether the pattern parameter must match the beginning or the end of the query string, or both, or none.
3+
*/
4+
export type Anchoring = 'contains' | 'endsWith' | 'is' | 'startsWith';
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { Acl } from './acl';
2+
3+
/**
4+
* Api Key object.
5+
*/
6+
export type ApiKey = {
7+
/**
8+
* Set of permissions associated with the key.
9+
*/
10+
acl: Acl[];
11+
/**
12+
* A comment used to identify a key more easily in the dashboard. It is not interpreted by the API.
13+
*/
14+
description?: string;
15+
/**
16+
* Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed.
17+
*/
18+
indexes?: string[];
19+
/**
20+
* Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced.
21+
*/
22+
maxHitsPerQuery?: number;
23+
/**
24+
* Maximum number of API calls per hour allowed from a given IP address or a user token.
25+
*/
26+
maxQueriesPerIPPerHour?: number;
27+
/**
28+
* URL-encoded query string. Force some query parameters to be applied for each query made with this API key.
29+
*/
30+
queryParameters?: string;
31+
/**
32+
* Restrict this new API key to specific referers. If empty or blank, defaults to all referers.
33+
*/
34+
referers?: string[];
35+
/**
36+
* Validity limit for this key in seconds. The key will automatically be removed after this period of time.
37+
*/
38+
validity?: number;
39+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { AroundRadiusAll } from './aroundRadiusAll';
2+
3+
/**
4+
* Define the maximum radius for a geo search (in meters).
5+
*/
6+
export type AroundRadius = AroundRadiusAll | number;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type AroundRadiusAll = 'all';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { BuiltInOperation } from './builtInOperation';
2+
3+
export type AttributeOrBuiltInOperation = BuiltInOperation | string;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Automatic facet Filter.
3+
*/
4+
export type AutomaticFacetFilter = {
5+
/**
6+
* Attribute to filter on. This must match a facet placeholder in the Rule\'s pattern.
7+
*/
8+
facet: string;
9+
/**
10+
* Score for the filter. Typically used for optional or disjunctive filters.
11+
*/
12+
score?: number;
13+
/**
14+
* Whether the filter is disjunctive (true) or conjunctive (false).
15+
*/
16+
disjunctive?: boolean;
17+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export type BaseBrowseResponse = {
2+
/**
3+
* Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
4+
*/
5+
cursor: string;
6+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
export type BaseIndexSettings = {
2+
/**
3+
* Creates replicas, exact copies of an index.
4+
*/
5+
replicas?: string[];
6+
/**
7+
* Set the maximum number of hits accessible via pagination.
8+
*/
9+
paginationLimitedTo?: number;
10+
/**
11+
* A list of words for which you want to turn off typo tolerance.
12+
*/
13+
disableTypoToleranceOnWords?: string[];
14+
/**
15+
* Specify on which attributes to apply transliteration.
16+
*/
17+
attributesToTransliterate?: string[];
18+
/**
19+
* List of attributes on which to do a decomposition of camel case words.
20+
*/
21+
camelCaseAttributes?: string[];
22+
/**
23+
* Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding.
24+
*/
25+
decompoundedAttributes?: Record<string, any>;
26+
/**
27+
* Sets the languages at the index level for language-specific processing such as tokenization and normalization.
28+
*/
29+
indexLanguages?: string[];
30+
/**
31+
* List of attributes on which you want to disable prefix matching.
32+
*/
33+
disablePrefixOnAttributes?: string[];
34+
/**
35+
* Enables compression of large integer arrays.
36+
*/
37+
allowCompressionOfIntegerArray?: boolean;
38+
/**
39+
* List of numeric attributes that can be used as numerical filters.
40+
*/
41+
numericAttributesForFiltering?: string[];
42+
/**
43+
* Control which separators are indexed.
44+
*/
45+
separatorsToIndex?: string;
46+
/**
47+
* The complete list of attributes used for searching.
48+
*/
49+
searchableAttributes?: string[];
50+
/**
51+
* Lets you store custom data in your indices.
52+
*/
53+
userData?: Record<string, any>;
54+
};

0 commit comments

Comments
 (0)