documentdb-typescript
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -86,3 +86,3 @@ "use strict"; | ||
resetAsync() { | ||
this._nextP.then(() => { | ||
return this._nextP.then(() => { | ||
this._qi && this._qi.reset(); | ||
@@ -89,0 +89,0 @@ }); |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -48,3 +48,3 @@ "use strict"; | ||
t = parseFloat(headers["x-ms-retry-after-ms"]); | ||
setTimeout(exec, retryTimer || 100, resolve, reject); | ||
setTimeout(exec, t, resolve, reject); | ||
} | ||
@@ -51,0 +51,0 @@ setTimeoutTimer(); |
@@ -0,0 +0,0 @@ // These declarations are extracted from the Typescript ESNext lib files, |
{ | ||
"name": "documentdb-typescript", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "TypeScript API for Microsoft Azure DocumentDB", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
# Azure Cosmos DB (DocumentDB API) TypeScript interface | ||
# Azure Cosmos DB (DocumentDB SQL API) TypeScript interface | ||
@@ -22,2 +22,7 @@ This Node.js module provides a TypeScript-based wrapper around the Node.js APIs for Microsoft's awesome SQL-queried schema-free NoSQL database in the Azure cloud, ~~DocumentDB~~ Cosmos DB. | ||
**v1.0.7** | ||
* _Update:_ CosmosDB Node.js API v1.14, with Session consistency, DisableSSLVerification and ProxyURL options. | ||
* Fixed several typing issues that occur with newer TypeScript compilers. | ||
**v1.0.6:** | ||
@@ -103,5 +108,2 @@ | ||
// dump the account information | ||
console.log(await client.getAccountInfoAsync()); | ||
// open the connection and print a list of IDs | ||
@@ -112,2 +114,5 @@ await client.openAsync(); | ||
// dump the account information | ||
console.log(await client.getAccountInfoAsync()); | ||
// unnecessary unless you expect new clients | ||
@@ -114,0 +119,0 @@ // to reopen the connection: |
/// <reference path="esnext-async-iterators.d.ts" /> | ||
export * from "./typings"; |
@@ -216,2 +216,4 @@ /** Constructor for the DocumentClient instance */ | ||
}; | ||
DisableSSLVerification?: boolean; | ||
ProxyUrl?: string; | ||
} | ||
@@ -218,0 +220,0 @@ /** DocumentClient indexing policy interface */ |
@@ -0,0 +0,0 @@ import * as _DocumentDB from "./_DocumentDB"; |
@@ -41,3 +41,3 @@ import * as _DocumentDB from "./_DocumentDB"; | ||
/** Create or update the document with given data (must include an `.id` or `._self` property if store mode is `UpdateOnly`, and must also include an `_etag` property if store mode is `UpdateOnlyIfNoChange`); returns the stored data as a plain object, including meta properties such as `._etag` and `._self` */ | ||
storeDocumentAsync<T extends Partial<_DocumentDB.DocumentResource>>(data: T, mode?: StoreMode, maxRetries?: number, options?: AllOptions): Promise<T & _DocumentDB.DocumentResource>; | ||
storeDocumentAsync<T extends Partial<_DocumentDB.DocumentResource>>(data: T & object, mode?: StoreMode, maxRetries?: number, options?: AllOptions): Promise<T & _DocumentDB.DocumentResource>; | ||
/** Find the document with given ID */ | ||
@@ -50,3 +50,3 @@ findDocumentAsync<ResultT extends {}>(id: string, maxRetries?: number, options?: AllOptions): Promise<ResultT & _DocumentDB.DocumentResource>; | ||
/** Find the document with exactly the same values for all properties (i.e. where _all_ own properties of the given object match exactly) */ | ||
findDocumentAsync<ResultT extends {}>(obj: Partial<ResultT>, maxRetries?: number, options?: AllOptions): Promise<ResultT & _DocumentDB.DocumentResource>; | ||
findDocumentAsync<ResultT extends {}>(obj: Partial<ResultT> & object, maxRetries?: number, options?: AllOptions): Promise<ResultT & _DocumentDB.DocumentResource>; | ||
/** Check if a document with given ID exists (without reading the document) */ | ||
@@ -53,0 +53,0 @@ existsAsync(id: string, maxRetries?: number, options?: AllOptions): Promise<boolean>; |
@@ -0,0 +0,0 @@ import * as _DocumentDB from "./_DocumentDB"; |
@@ -7,3 +7,3 @@ /** Represents asynchronously loaded query result sets as a stream; the type parameter represents the query result type, i.e. a full document resource type for `SELECT * FROM` queries, an object with only projected properties for `SELECT x, y, ... FROM` queries, or even a scalar value for `SELECT VALUE ... FROM` queries */ | ||
/** Private constructor */ | ||
private constructor(_collection, _uid, _qiP); | ||
private constructor(); | ||
/** Timeout (ms) used for all operations; set to the Client timeout initially, set this to a large number if reading a large result set using `toArray` */ | ||
@@ -20,9 +20,9 @@ timeout: number; | ||
/** Call a function for each result; returns a promise for an array with all return values, which is resolved only when all results have been processed, or is rejected if the callback throws an error */ | ||
mapAsync(f: (doc: T) => void): Promise<void[]>; | ||
mapAsync<ResultT>(f: (doc: T) => ResultT): Promise<ResultT[]>; | ||
/** Reset the stream to the beginning of the set (synchronously); returns the stream itself */ | ||
reset(): this; | ||
/** Reset the stream to the beginning of the set (asynchronously, i.e. after all queued operations have completed) */ | ||
resetAsync(): void; | ||
resetAsync(): PromiseLike<void>; | ||
/** Load all results into an array */ | ||
toArray(): Promise<T[]>; | ||
} |
export * from "./Client"; | ||
export * from "./Database"; | ||
export * from "./Collection"; |
/** Return a curried version of given function that appends a callback as a last parameter, which rejects or resolves a promise; the promise is returned immediately; also handles DocumentDB errors when possible */ | ||
export declare function curryPromise<T>(f: Function, timeout?: number, maxRetries?: number, retryTimer?: number, retryOn404?: boolean): (...args: any[]) => PromiseLike<T>; | ||
export declare function curryPromise<T>(f: Function, timeout?: number, maxRetries?: number, retryTimer?: number, retryOn404?: boolean): (...args: any[]) => Promise<T>; | ||
/** Return a promise that resolves after a given timeout */ | ||
export declare function sleepAsync(ms: number, value?: any): Promise<{}>; |
Sorry, the diff of this file is not supported yet
1305
353
83438
19