Skip to content

Commit aa68d61

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit deac88b9. [skip ci]
algolia/api-clients-automation@deac88b Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent f518a1a commit aa68d61

File tree

80 files changed

+2641
-1
lines changed

Some content is hidden

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

80 files changed

+2641
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

packages/client-common/src/transporter/createTransporter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ export function createTransporter({
110110
: {};
111111

112112
const queryParameters: QueryParameters = {
113-
'x-algolia-agent': algoliaAgent.value,
114113
...baseQueryParameters,
115114
...request.queryParameters,
116115
...dataQueryParameters,
117116
};
118117

118+
if (algoliaAgent.value) {
119+
queryParameters['x-algolia-agent'] = algoliaAgent.value;
120+
}
121+
119122
if (requestOptions && requestOptions.queryParameters) {
120123
for (const key of Object.keys(requestOptions.queryParameters)) {
121124
// We want to keep `undefined` and `null` values,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

packages/ingestion/builds/browser.ts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { ClientOptions } from '@algolia/client-common';
4+
import {
5+
DEFAULT_CONNECT_TIMEOUT_BROWSER,
6+
DEFAULT_READ_TIMEOUT_BROWSER,
7+
DEFAULT_WRITE_TIMEOUT_BROWSER,
8+
createMemoryCache,
9+
createFallbackableCache,
10+
createBrowserLocalStorageCache,
11+
} from '@algolia/client-common';
12+
import { createXhrRequester } from '@algolia/requester-browser-xhr';
13+
14+
import type { IngestionClient, Region } from '../src/ingestionClient';
15+
import {
16+
createIngestionClient,
17+
apiClientVersion,
18+
REGIONS,
19+
} from '../src/ingestionClient';
20+
21+
export {
22+
apiClientVersion,
23+
IngestionClient,
24+
Region,
25+
} from '../src/ingestionClient';
26+
export * from '../model';
27+
28+
export function ingestionClient(
29+
appId: string,
30+
apiKey: string,
31+
region: Region,
32+
options?: ClientOptions
33+
): IngestionClient {
34+
if (!appId || typeof appId !== 'string') {
35+
throw new Error('`appId` is missing.');
36+
}
37+
38+
if (!apiKey || typeof apiKey !== 'string') {
39+
throw new Error('`apiKey` is missing.');
40+
}
41+
42+
if (
43+
!region ||
44+
(region && (typeof region !== 'string' || !REGIONS.includes(region)))
45+
) {
46+
throw new Error(
47+
`\`region\` is required and must be one of the following: ${REGIONS.join(
48+
', '
49+
)}`
50+
);
51+
}
52+
53+
return createIngestionClient({
54+
appId,
55+
apiKey,
56+
region,
57+
timeouts: {
58+
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
59+
read: DEFAULT_READ_TIMEOUT_BROWSER,
60+
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
61+
},
62+
requester: createXhrRequester(),
63+
algoliaAgents: [{ segment: 'Browser' }],
64+
authMode: 'WithinQueryParameters',
65+
responsesCache: createMemoryCache(),
66+
requestsCache: createMemoryCache({ serializable: false }),
67+
hostsCache: createFallbackableCache({
68+
caches: [
69+
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
70+
createMemoryCache(),
71+
],
72+
}),
73+
...options,
74+
});
75+
}

packages/ingestion/builds/node.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { ClientOptions } from '@algolia/client-common';
4+
import {
5+
DEFAULT_CONNECT_TIMEOUT_NODE,
6+
DEFAULT_READ_TIMEOUT_NODE,
7+
DEFAULT_WRITE_TIMEOUT_NODE,
8+
createMemoryCache,
9+
createNullCache,
10+
} from '@algolia/client-common';
11+
import { createHttpRequester } from '@algolia/requester-node-http';
12+
13+
import type { IngestionClient, Region } from '../src/ingestionClient';
14+
import { createIngestionClient, REGIONS } from '../src/ingestionClient';
15+
16+
export {
17+
apiClientVersion,
18+
IngestionClient,
19+
Region,
20+
} from '../src/ingestionClient';
21+
export * from '../model';
22+
23+
export function ingestionClient(
24+
appId: string,
25+
apiKey: string,
26+
region: Region,
27+
options?: ClientOptions
28+
): IngestionClient {
29+
if (!appId || typeof appId !== 'string') {
30+
throw new Error('`appId` is missing.');
31+
}
32+
33+
if (!apiKey || typeof apiKey !== 'string') {
34+
throw new Error('`apiKey` is missing.');
35+
}
36+
37+
if (
38+
!region ||
39+
(region && (typeof region !== 'string' || !REGIONS.includes(region)))
40+
) {
41+
throw new Error(
42+
`\`region\` is required and must be one of the following: ${REGIONS.join(
43+
', '
44+
)}`
45+
);
46+
}
47+
48+
return createIngestionClient({
49+
appId,
50+
apiKey,
51+
region,
52+
timeouts: {
53+
connect: DEFAULT_CONNECT_TIMEOUT_NODE,
54+
read: DEFAULT_READ_TIMEOUT_NODE,
55+
write: DEFAULT_WRITE_TIMEOUT_NODE,
56+
},
57+
requester: createHttpRequester(),
58+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
59+
responsesCache: createNullCache(),
60+
requestsCache: createNullCache(),
61+
hostsCache: createMemoryCache(),
62+
...options,
63+
});
64+
}

packages/ingestion/index.d.ts

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/builds/node';

packages/ingestion/index.js

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/ingestion.cjs.js');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type ActionType = 'delete' | 'replace' | 'save';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthAPIKey = {
4+
key: string;
5+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthAlgolia = {
4+
appID: string;
5+
6+
apiKey: string;
7+
};

0 commit comments

Comments
 (0)