You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2020/02/13 14:02:10 UTC

[couchdb-nano] branch master updated: change bulk() return type (#199)

This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git


The following commit(s) were added to refs/heads/master by this push:
     new 6741f6e  change bulk() return type (#199)
6741f6e is described below

commit 6741f6eceebb9d9de67daa5e9d6072d72fbdc1b7
Author: Agnaro <42...@users.noreply.github.com>
AuthorDate: Thu Feb 13 09:02:02 2020 -0500

    change bulk() return type (#199)
---
 lib/nano.d.ts | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/nano.d.ts b/lib/nano.d.ts
index d91917c..36b7fc3 100644
--- a/lib/nano.d.ts
+++ b/lib/nano.d.ts
@@ -161,7 +161,7 @@ declare namespace nano {
     ): Promise<DocumentCopyResponse>;
     // http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid
     destroy(docname: string, rev: string, callback?: Callback<DocumentDestroyResponse>): Promise<DocumentDestroyResponse>;
-    bulk(docs: BulkModifyDocsWrapper, callback?: Callback<DocumentInsertResponse[]>): Promise<DocumentInsertResponse[]>;
+    bulk(docs: BulkModifyDocsWrapper, callback?: Callback<DocumentBulkResponse[]>): Promise<DocumentBulkResponse[]>;
     bulk(docs: BulkModifyDocsWrapper, params: any, callback?: Callback<DocumentInsertResponse[]>): Promise<DocumentInsertResponse[]>;
     // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#get--db-_all_docs
     list(callback?: Callback<DocumentListResponse<D>>): Promise<DocumentListResponse<D>>;
@@ -802,6 +802,21 @@ declare namespace nano {
     doc?: D & Document;
   }
 
+  // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_bulk_docs
+  interface DocumentBulkResponse {
+    // Document ID. Available in all cases
+    id: string;
+
+    // New document revision token. Available if document has saved without errors.
+    rev?: string;
+
+    // Error type. Available if response code is 4xx
+    error?: string;
+
+    // Error reason. Available if response code is 4xx
+    reason?: string;
+  }
+
   // http://docs.couchdb.org/en/latest/api/database/common.html#post--db
   // http://docs.couchdb.org/en/latest/api/document/common.html#put--db-docid
   interface DocumentInsertParams {