Skip to content

Commit

Permalink
Generated code for commit 09259f7.
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
api-clients-bot and shortcuts committed Mar 24, 2022
1 parent 09259f7 commit b36896c
Show file tree
Hide file tree
Showing 27 changed files with 2,064 additions and 1,465 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import type { InitClientOptions } from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createFallbackableCache,
Expand All @@ -18,7 +15,7 @@ export function abtestingApi(
appId: string,
apiKey: string,
region?: Region,
options?: { requester?: Requester; hosts?: Host[] }
options?: InitClientOptions
): AbtestingApi {
if (!appId) {
throw new Error('`appId` is missing.');
Expand All @@ -40,14 +37,19 @@ 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(),
],
}),
responsesCache: options?.responsesCache ?? createMemoryCache(),
requestsCache:
options?.requestsCache ?? createMemoryCache({ serializable: false }),
hostsCache:
options?.hostsCache ??
createFallbackableCache({
caches: [
createBrowserLocalStorageCache({
key: `${apiClientVersion}-${appId}`,
}),
createMemoryCache(),
],
}),
...options,
});
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import type {
Host,
Requester,
} from '@experimental-api-clients-automation/client-common';
import type { InitClientOptions } from '@experimental-api-clients-automation/client-common';
import {
createMemoryCache,
createNullCache,
Expand All @@ -17,7 +14,7 @@ export function abtestingApi(
appId: string,
apiKey: string,
region?: Region,
options?: { requester?: Requester; hosts?: Host[] }
options?: InitClientOptions
): AbtestingApi {
if (!appId) {
throw new Error('`appId` is missing.');
Expand All @@ -38,9 +35,9 @@ export function abtestingApi(
},
requester: options?.requester ?? createHttpRequester(),
userAgents: [{ segment: 'Node.js', version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
responsesCache: options?.responsesCache ?? createNullCache(),
requestsCache: options?.requestsCache ?? createNullCache(),
hostsCache: options?.hostsCache ?? createMemoryCache(),
...options,
});
}
Loading

0 comments on commit b36896c

Please sign in to comment.