Files
docs/node_modules/@algolia/monitoring/dist/builds/node.cjs.map

1 line
25 KiB
Plaintext
Raw Normal View History

2025-08-27 14:05:33 +08:00
{"version":3,"sources":["../../builds/node.ts","../../src/monitoringClient.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 MonitoringClient = ReturnType<typeof createMonitoringClient>;\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 { createMonitoringClient } from '../src/monitoringClient';\n\nexport { apiClientVersion } from '../src/monitoringClient';\n\nexport * from '../model';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient {\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 return {\n ...createMonitoringClient({\n appId,\n apiKey,\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 { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\n\nimport type { StatusResponse } from '../model/statusResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.34.1';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, u