UNPKG

2.21 kBTypeScriptView Raw
1import { TokenCredential } from "@azure/core-auth";
2import { TokenProvider } from "./auth";
3import { PermissionDefinition } from "./client";
4import { ConnectionPolicy, ConsistencyLevel } from "./documents";
5import { CosmosHeaders } from "./queryExecutionContext/CosmosHeaders";
6export interface Agent {
7 maxFreeSockets: number;
8 maxSockets: number;
9 sockets: any;
10 requests: any;
11 destroy(): void;
12}
13export interface CosmosClientOptions {
14 /** The service endpoint to use to create the client. */
15 endpoint: string;
16 /** The account master or readonly key */
17 key?: string;
18 /** An object that contains resources tokens.
19 * Keys for the object are resource Ids and values are the resource tokens.
20 */
21 resourceTokens?: {
22 [resourcePath: string]: string;
23 };
24 /** A user supplied function for resolving header authorization tokens.
25 * Allows users to generating their own auth tokens, potentially using a separate service
26 */
27 tokenProvider?: TokenProvider;
28 /** AAD token from `@azure/identity`
29 * Obtain a credential object by creating an `@azure/identity` credential object
30 * We will then use your credential object and a scope URL (your cosmos db endpoint)
31 * to authenticate requests to Cosmos
32 */
33 aadCredentials?: TokenCredential;
34 /** An array of {@link Permission} objects. */
35 permissionFeed?: PermissionDefinition[];
36 /** An instance of {@link ConnectionPolicy} class.
37 * This parameter is optional and the default connectionPolicy will be used if omitted.
38 */
39 connectionPolicy?: ConnectionPolicy;
40 /** An optional parameter that represents the consistency level.
41 * It can take any value from {@link ConsistencyLevel}.
42 */
43 consistencyLevel?: keyof typeof ConsistencyLevel;
44 defaultHeaders?: CosmosHeaders;
45 /** An optional custom http(s) Agent to be used in NodeJS enironments
46 * Use an agent such as https://github.com/TooTallNate/node-proxy-agent if you need to connect to Cosmos via a proxy
47 */
48 agent?: Agent;
49 /** A custom string to append to the default SDK user agent. */
50 userAgentSuffix?: string;
51}
52//# sourceMappingURL=CosmosClientOptions.d.ts.map
\No newline at end of file