Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createAbtestingApi } from '../src/abtestingApi';
import { createAbtestingApi, apiClientVersion } from '../src/abtestingApi';
import type { AbtestingApi, Region } from '../src/abtestingApi';

export * from '../src/abtestingApi';
Expand Down Expand Up @@ -35,6 +40,14 @@ export function abtestingApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
} from '@experimental-api-clients-automation/client-common';
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';

import { createAbtestingApi } from '../src/abtestingApi';
Expand Down Expand Up @@ -34,6 +38,9 @@ export function abtestingApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
createAuth,
createMemoryCache,
createTransporter,
getUserAgent,
} from '@experimental-api-clients-automation/client-common';
Expand Down Expand Up @@ -40,7 +39,9 @@ export function createAbtestingApi(
const auth = createAuth(options.appId, options.apiKey, options.authMode);
const transporter = createTransporter({
hosts: options?.hosts ?? getDefaultHosts(options.region),
hostsCache: createMemoryCache(),
hostsCache: options.hostsCache,
requestsCache: options.requestsCache,
responsesCache: options.responsesCache,
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
...auth.headers(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createAnalyticsApi } from '../src/analyticsApi';
import { createAnalyticsApi, apiClientVersion } from '../src/analyticsApi';
import type { AnalyticsApi, Region } from '../src/analyticsApi';

export * from '../src/analyticsApi';
Expand Down Expand Up @@ -35,6 +40,14 @@ export function analyticsApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
} from '@experimental-api-clients-automation/client-common';
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';

import { createAnalyticsApi } from '../src/analyticsApi';
Expand Down Expand Up @@ -34,6 +38,9 @@ export function analyticsApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
createAuth,
createMemoryCache,
createTransporter,
getUserAgent,
} from '@experimental-api-clients-automation/client-common';
Expand Down Expand Up @@ -53,7 +52,9 @@ export function createAnalyticsApi(
const auth = createAuth(options.appId, options.apiKey, options.authMode);
const transporter = createTransporter({
hosts: options?.hosts ?? getDefaultHosts(options.region),
hostsCache: createMemoryCache(),
hostsCache: options.hostsCache,
requestsCache: options.requestsCache,
responsesCache: options.responsesCache,
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
...auth.headers(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createInsightsApi } from '../src/insightsApi';
import { createInsightsApi, apiClientVersion } from '../src/insightsApi';
import type { InsightsApi, Region } from '../src/insightsApi';

export * from '../src/insightsApi';
Expand Down Expand Up @@ -35,6 +40,14 @@ export function insightsApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
} from '@experimental-api-clients-automation/client-common';
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';

import { createInsightsApi } from '../src/insightsApi';
Expand Down Expand Up @@ -34,6 +38,9 @@ export function insightsApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
createAuth,
createMemoryCache,
createTransporter,
getUserAgent,
} from '@experimental-api-clients-automation/client-common';
Expand Down Expand Up @@ -38,7 +37,9 @@ export function createInsightsApi(
const auth = createAuth(options.appId, options.apiKey, options.authMode);
const transporter = createTransporter({
hosts: options?.hosts ?? getDefaultHosts(options.region),
hostsCache: createMemoryCache(),
hostsCache: options.hostsCache,
requestsCache: options.requestsCache,
responsesCache: options.responsesCache,
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
...auth.headers(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createPersonalizationApi } from '../src/personalizationApi';
import {
createPersonalizationApi,
apiClientVersion,
} from '../src/personalizationApi';
import type { PersonalizationApi, Region } from '../src/personalizationApi';

export * from '../src/personalizationApi';
Expand Down Expand Up @@ -39,6 +47,14 @@ export function personalizationApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
} from '@experimental-api-clients-automation/client-common';
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';

import { createPersonalizationApi } from '../src/personalizationApi';
Expand Down Expand Up @@ -38,6 +42,9 @@ export function personalizationApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
createAuth,
createMemoryCache,
createTransporter,
getUserAgent,
} from '@experimental-api-clients-automation/client-common';
Expand Down Expand Up @@ -38,7 +37,9 @@ export function createPersonalizationApi(
const auth = createAuth(options.appId, options.apiKey, options.authMode);
const transporter = createTransporter({
hosts: options?.hosts ?? getDefaultHosts(options.region),
hostsCache: createMemoryCache(),
hostsCache: options.hostsCache,
requestsCache: options.requestsCache,
responsesCache: options.responsesCache,
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
...auth.headers(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createPredictApi } from '../src/predictApi';
import { createPredictApi, apiClientVersion } from '../src/predictApi';
import type { PredictApi } from '../src/predictApi';

export * from '../src/predictApi';
Expand Down Expand Up @@ -33,6 +38,14 @@ export function predictApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
} from '@experimental-api-clients-automation/client-common';
import { createHttpRequester } from '@experimental-api-clients-automation/requester-node-http';

import { createPredictApi } from '../src/predictApi';
Expand Down Expand Up @@ -32,6 +36,9 @@ export function predictApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
createAuth,
createMemoryCache,
createTransporter,
getUserAgent,
} from '@experimental-api-clients-automation/client-common';
Expand Down Expand Up @@ -32,7 +31,9 @@ export function createPredictApi(options: CreateClientOptions) {
const auth = createAuth(options.appId, options.apiKey, options.authMode);
const transporter = createTransporter({
hosts: options?.hosts ?? getDefaultHosts(),
hostsCache: createMemoryCache(),
hostsCache: options.hostsCache,
requestsCache: options.requestsCache,
responsesCache: options.responsesCache,
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
...auth.headers(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
createBrowserLocalStorageCache,
} from '@experimental-api-clients-automation/client-common';
import { createXhrRequester } from '@experimental-api-clients-automation/requester-browser-xhr';

import { createQuerySuggestionsApi } from '../src/querySuggestionsApi';
import {
createQuerySuggestionsApi,
apiClientVersion,
} from '../src/querySuggestionsApi';
import type { QuerySuggestionsApi, Region } from '../src/querySuggestionsApi';

export * from '../src/querySuggestionsApi';
Expand Down Expand Up @@ -39,6 +47,14 @@ export function querySuggestionsApi(
requester: options?.requester ?? createXhrRequester(),
userAgents: [{ segment: 'Browser' }],
authMode: 'WithinQueryParameters',
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
}),
...options,
});
}
Loading