Skip to content

Releases: jcormont/documentdb-typescript

v1.0.7

17 Feb 15:41
Compare
Choose a tag to compare
  • 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

04 Jun 15:50
Compare
Choose a tag to compare
  • Fixed an issue with the asyncIterator polyfill (thanks @shaikatz )

v1.0.5

18 May 01:06
Compare
Choose a tag to compare

Update to DocumentDB Node.js API v1.12.0 with support for RU/min billing and ConsistentPrefix consistency level.

v1.0.4

05 May 08:31
Compare
Choose a tag to compare

Minor fix for type of DocumentStream's .next() to be in line with Typescript lib default, and avoid any.

v1.0.3

05 May 07:50
Compare
Choose a tag to compare

Added support for Typescript 2.3's new for await ( ... of ... ) syntax.

v1.0.2

17 Apr 01:35
Compare
Choose a tag to compare

Minor update to behavior of findDocumentAsync:

  • If an object is passed in with an id property, the other properties are now also still checked on the object read from the database. If one of the properties is different, the promise is still rejected.

Example: given a document { id: "foo", bar: 1, ... } in the database

  • The previous behavior of findDocumentAsync({ id: "foo", bar: 2 }) was to return the document (wrong!);
  • The new behavior is that the document is loaded (through the readDocument API, using the ID), but an error is thrown upon checking the bar property.

Bug fixes

11 Apr 05:39
Compare
Choose a tag to compare
  • Minor issue with typing of .toArray() on query iterators
  • Security issue with property-based searches (i.e. use c["property"] instead of c.property)

v1.0.0

16 Mar 14:42
Compare
Choose a tag to compare
  • Important: This version now requires TypeScript 2.1+.
  • New: Added an existsAsync method to Collection that uses a select count(1) from c where... query to determine more efficiently if any documents exist that match given ID or properties.
  • New: Added path properties to Database and Collection, which can be used with the underlying Node.js API (through Client.documentClient) if needed.
  • New: Most methods now accept an options parameter to forward feed and/or request options to the underlying Node.js API (e.g. for enableCrossPartitionQuery).
  • Improved: Where possible, document IDs are now used to locate document resources instead of mandatory _self links. This allows for a new overload of the deleteDocumentAsync method that just takes an ID, and removes the need for a query in findDocumentAsync if an ID is passed in (either as a property or as a single parameter). Also, storeDocumentAsync with StoreMode.UpdateOnly no longer requires a _self property, an id property will do.
  • Improved: More accurate types for objects passed to and/or returned from Collection methods. E.g. query results generated by queryDocuments no longer automatically include document properties such as id and _self, because queries may not actually return full documents anyway (or a document at all, e.g. for select value... queries). This is a breaking change since the TypeScript compiler may no longer find these properties on result objects, even for select * queries. The findDocumentAsync and queryDocuments methods now accept a type parameter to specify a result type explicitly.
  • Changed: Getting Client.documentClient now throws an exception if the client connection has not been opened yet, or has been closed. Use isOpen() to check if the connection is currently open.
  • Fixed: Operations are now queued properly in DocumentStream, e.g. calling .read() twice in succession (synchronously) actually returns promises for two different results.
  • Fixed: Added strictNullChecks and noImplicitAny to the TypeScript configuration for compatibility with projects that have these options enabled.
  • Fixed: Added TypeScript as a development dependency to package.json.