/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { SqlContainerResource } from '@azure/arm-cosmosdb'; import { Container, ContainerDefinition, ItemDefinition, Resource, SqlQuerySpec } from '@azure/cosmos'; import { TokenCredential } from '@azure/identity'; import { AnnotatedResponse } from '../interceptor'; import { Omit } from '../types/internal'; import { TimeoutsOptions } from '../types/public'; interface SprocClient { createSproc(id: string, body: (...args: any[]) => void): Promise; replaceSproc(id: string, body: (...args: any[]) => void): Promise; } export interface ManagementOptions { storageCredentials: TokenCredential; subscriptionId: string; resourceGroupName: string; accountName: string; databaseName: string; containerName: string; } export default class CosmosDbClient { private _endpoint; private _client; private _session?; private _retryOptions; private _sprocClient; static createFromCredential(subscriptionId: string, resourceGroupName: string, account: string, database: string, collection: string, aadCredentials: TokenCredential, collectionOptions: Omit, retryOptions?: TimeoutsOptions): Promise; static createFromKey(account: string, database: string, collection: string, key: string, collectionOptions: Omit, retryOptions?: TimeoutsOptions): Promise; static getErrorRU(err: any): number | undefined; get containerRef(): string; constructor(endpoint: string, container: Container, retryOptions: TimeoutsOptions, sprocClient: SprocClient); documentRef(partition: string, id: string): string; createItem(document: T): Promise>; getItem(id: string, partition: string): Promise>; queryItemsArray(query: SqlQuerySpec): Promise>; queryItemsPage(query: SqlQuerySpec, options: { continuation?: string; pageSize?: number; }): Promise>; queryItemsIterator(query: SqlQuerySpec): AsyncIterable>; deleteItem(id: string, partition: string): Promise>; replaceItem(document: T, partition: string): Promise>; executeSproc(id: string, partition: string, ...params: string[]): Promise>; createSproc(id: string, body: (...args: any[]) => void): Promise>; replaceSproc(id: string, body: (...args: any[]) => void): Promise>; private _wrap; private _transformResult; private _transformError; private _updateSession; private static _translateError; private static _scrubError; private static _getRu; private static _getContinuation; private static _isCosmosError; private static _shouldRetry; } export interface DocumentBase { id: string; _etag: string; } export declare const formatAccountName: (accountEndpoint: string) => string; export {}; //# sourceMappingURL=cosmos.d.ts.map