UNPKG

2.62 kBSource Map (JSON)View Raw
1{"version":3,"file":"CosmosClientOptions.js","sourceRoot":"","sources":["../../src/CosmosClientOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { TokenProvider } from \"./auth\";\nimport { PermissionDefinition } from \"./client\";\nimport { ConnectionPolicy, ConsistencyLevel } from \"./documents\";\nimport { PluginConfig } from \"./plugins/Plugin\";\nimport { CosmosHeaders } from \"./queryExecutionContext/CosmosHeaders\";\n\n// We expose our own Agent interface to avoid taking a dependency on and leaking node types. This interface should mirror the node Agent interface\nexport interface Agent {\n maxFreeSockets: number;\n maxSockets: number;\n sockets: any;\n requests: any;\n destroy(): void;\n}\n\nexport interface CosmosClientOptions {\n /** The service endpoint to use to create the client. */\n endpoint: string;\n /** The account master or readonly key */\n key?: string;\n /** An object that contains resources tokens.\n * Keys for the object are resource Ids and values are the resource tokens.\n */\n resourceTokens?: { [resourcePath: string]: string };\n /** A user supplied function for resolving header authorization tokens.\n * Allows users to generating their own auth tokens, potentially using a separate service\n */\n tokenProvider?: TokenProvider;\n /** AAD token from `@azure/identity`\n * Obtain a credential object by creating an `@azure/identity` credential object\n * We will then use your credential object and a scope URL (your cosmos db endpoint)\n * to authenticate requests to Cosmos\n */\n aadCredentials?: TokenCredential;\n /** An array of {@link Permission} objects. */\n permissionFeed?: PermissionDefinition[];\n /** An instance of {@link ConnectionPolicy} class.\n * This parameter is optional and the default connectionPolicy will be used if omitted.\n */\n connectionPolicy?: ConnectionPolicy;\n /** An optional parameter that represents the consistency level.\n * It can take any value from {@link ConsistencyLevel}.\n */\n consistencyLevel?: keyof typeof ConsistencyLevel;\n defaultHeaders?: CosmosHeaders;\n /** An optional custom http(s) Agent to be used in NodeJS enironments\n * Use an agent such as https://github.com/TooTallNate/node-proxy-agent if you need to connect to Cosmos via a proxy\n */\n agent?: Agent;\n /** A custom string to append to the default SDK user agent. */\n userAgentSuffix?: string;\n /** @internal */\n plugins?: PluginConfig[];\n}\n"]}
\No newline at end of file