Skip to content

Commit b0f5d78

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit deac88b. [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent deac88b commit b0f5d78

Some content is hidden

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

69 files changed

+3761
-0
lines changed
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+
}
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+
}
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';
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+
};
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 AuthBasic = {
4+
username: string;
5+
6+
password: string;
7+
};
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 AuthGoogleServiceAccount = {
4+
clientEmail: string;
5+
6+
privateKey: string;
7+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { AuthAPIKey } from './authAPIKey';
4+
import type { AuthAlgolia } from './authAlgolia';
5+
import type { AuthBasic } from './authBasic';
6+
import type { AuthGoogleServiceAccount } from './authGoogleServiceAccount';
7+
import type { AuthOAuth } from './authOAuth';
8+
9+
export type AuthInput =
10+
| AuthAlgolia
11+
| AuthAPIKey
12+
| AuthBasic
13+
| AuthGoogleServiceAccount
14+
| AuthOAuth;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthOAuth = {
4+
url: string;
5+
6+
client_id: string;
7+
8+
client_secret: string;
9+
10+
scope: string;
11+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { AuthInput } from './authInput';
4+
import type { AuthenticationType } from './authenticationType';
5+
import type { PlatformType } from './platformType';
6+
7+
export type Authentication = {
8+
authenticationID: string;
9+
10+
type: AuthenticationType;
11+
12+
name: string;
13+
14+
platform?: PlatformType;
15+
16+
input: AuthInput;
17+
18+
/**
19+
* Date of creation (RFC3339 format).
20+
*/
21+
createdAt: string;
22+
23+
/**
24+
* Date of last update (RFC3339 format).
25+
*/
26+
updatedAt?: string;
27+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { AuthInput } from './authInput';
4+
import type { AuthenticationType } from './authenticationType';
5+
import type { PlatformType } from './platformType';
6+
7+
export type AuthenticationCreate = {
8+
type: AuthenticationType;
9+
10+
name: string;
11+
12+
platform?: PlatformType;
13+
14+
input: AuthInput;
15+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthenticationCreateResponse = {
4+
authenticationID: string;
5+
6+
name: string;
7+
8+
/**
9+
* Date of creation (RFC3339 format).
10+
*/
11+
createdAt: string;
12+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthenticationType =
4+
| 'algolia'
5+
| 'apiKey'
6+
| 'basic'
7+
| 'googleServiceAccount'
8+
| 'oauth';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { AuthInput } from './authInput';
4+
import type { AuthenticationType } from './authenticationType';
5+
import type { PlatformType } from './platformType';
6+
7+
export type AuthenticationUpdate = {
8+
type?: AuthenticationType;
9+
10+
name?: string;
11+
12+
platform?: PlatformType;
13+
14+
input?: AuthInput;
15+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type AuthenticationUpdateResponse = {
4+
authenticationID: string;
5+
6+
name: string;
7+
8+
/**
9+
* Date of last update (RFC3339 format).
10+
*/
11+
updatedAt: string;
12+
};

0 commit comments

Comments
 (0)