1 line
26 KiB
Plaintext
1 line
26 KiB
Plaintext
|
{"version":3,"sources":["../../builds/node.ts","../../src/abtestingClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nexport type AbtestingClient = ReturnType<typeof createAbtestingClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAbtestingClient } from '../src/abtestingClient';\n\nimport type { Region } from '../src/abtestingClient';\nimport { REGIONS } from '../src/abtestingClient';\n\nexport type { Region, RegionOptions } from '../src/abtestingClient';\n\nexport { apiClientVersion } from '../src/abtestingClient';\n\nexport * from '../model';\n\nexport function abtestingClient(\n appId: string,\n apiKey: string,\n region?: Region | undefined,\n options?: ClientOptions | undefined,\n): AbtestingClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {\n throw new Error(`\\`region\\` must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAbtestingClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { ABTest } from '../model/aBTest';\nimport type { ABTestResponse } from '../model/aBTestResponse';\nimport type { AddABTestsRequest } from '../model/addABTestsRequest';\n\nimport type { EstimateABTestRequest } from '../model/estimateABTestRequest';\nimport type { EstimateABTestResponse } from '../model/estimateABTestResponse';\nimport type { ListABTestsResponse } from '../model/listABTestsResponse';\nimport type { ScheduleABTestResponse } from '../model/scheduleABTestResponse';\nimport type { ScheduleABTestsRequest } from '../model/scheduleABTestsRequest';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n ListABTestsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.34.1';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region | undefined };\n\nfunction getDefaultHosts(region?: Region | undefined): Host[] {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAbtestingClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Abtesting',\n
|