@ibm-cloud/cloudant 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cloudant/v1.js CHANGED
@@ -31,7 +31,7 @@ const getAuthenticatorFromEnvCloudantExtension_1 = __importDefault(require("../l
31
31
  */
32
32
  class CloudantV1 extends cloudantBaseService_1.default {
33
33
  static _logger = (0, ibm_cloud_sdk_core_1.getNewLogger)('CloudantV1');
34
- static DEFAULT_SERVICE_URL = 'http://localhost:5984';
34
+ static DEFAULT_SERVICE_URL = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud';
35
35
  static DEFAULT_SERVICE_NAME = 'cloudant';
36
36
  /*************************
37
37
  * Factory method
@@ -3935,9 +3935,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
3935
3935
  /**
3936
3936
  * Retrieve information about all indexes.
3937
3937
  *
3938
- * When you make a GET request to `/db/_index`, you get a list of all indexes used by Cloudant Query in the database,
3939
- * including the primary index. In addition to the information available through this API, indexes are also stored in
3940
- * the `indexes` property of design documents.
3938
+ * When you make a GET request to `/db/_index`, you get a list of all the indexes using `"language":"query"` in the
3939
+ * database and the primary index. In addition to the information available through this API, the indexes are stored
3940
+ * in the `indexes` property of their respective design documents.
3941
3941
  *
3942
3942
  * @param {Object} params - The parameters to send to the service.
3943
3943
  * @param {string} params.db - Path parameter to specify the database name.
@@ -7186,7 +7186,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
7186
7186
  copy.content_type = obj.contentType;
7187
7187
  }
7188
7188
  if (obj.data !== undefined) {
7189
- copy.data = obj.data;
7189
+ copy.data = obj.data !== null ? obj.data.toString('base64') : null;
7190
7190
  }
7191
7191
  if (obj.digest !== undefined) {
7192
7192
  copy.digest = obj.digest;
@@ -7220,7 +7220,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
7220
7220
  copy.contentType = obj.content_type;
7221
7221
  }
7222
7222
  if (obj.data !== undefined) {
7223
- copy.data = obj.data;
7223
+ copy.data = obj.data !== null ? Buffer.from(obj.data, 'base64') : null;
7224
7224
  }
7225
7225
  if (obj.digest !== undefined) {
7226
7226
  copy.digest = obj.digest;
@@ -10510,6 +10510,10 @@ class CloudantV1 extends cloudantBaseService_1.default {
10510
10510
  filter;
10511
10511
  /** Maximum number of HTTP connections per replication. */
10512
10512
  httpConnections;
10513
+ /** The replication document owner. The server sets an appropriate value if the field is unset when writing a
10514
+ * replication document. Only administrators can modify the value to an owner other than themselves.
10515
+ */
10516
+ owner;
10513
10517
  /** Schema for a map of string key value pairs, such as query parameters. */
10514
10518
  queryParams;
10515
10519
  /** Number of times a replication request is retried. The requests are retried with a doubling exponential
@@ -10649,6 +10653,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
10649
10653
  if (obj.httpConnections !== undefined) {
10650
10654
  copy.http_connections = obj.httpConnections;
10651
10655
  }
10656
+ if (obj.owner !== undefined) {
10657
+ copy.owner = obj.owner;
10658
+ }
10652
10659
  if (obj.queryParams !== undefined) {
10653
10660
  copy.query_params = obj.queryParams;
10654
10661
  }
@@ -10713,6 +10720,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
10713
10720
  'docIds',
10714
10721
  'filter',
10715
10722
  'httpConnections',
10723
+ 'owner',
10716
10724
  'queryParams',
10717
10725
  'retriesPerRequest',
10718
10726
  'selector',
@@ -10795,6 +10803,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
10795
10803
  if (obj.http_connections !== undefined) {
10796
10804
  copy.httpConnections = obj.http_connections;
10797
10805
  }
10806
+ if (obj.owner !== undefined) {
10807
+ copy.owner = obj.owner;
10808
+ }
10798
10809
  if (obj.query_params !== undefined) {
10799
10810
  copy.queryParams = obj.query_params;
10800
10811
  }
@@ -10859,6 +10870,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
10859
10870
  'doc_ids',
10860
10871
  'filter',
10861
10872
  'http_connections',
10873
+ 'owner',
10862
10874
  'query_params',
10863
10875
  'retries_per_request',
10864
10876
  'selector',
@@ -12009,6 +12021,16 @@ class CloudantV1 extends cloudantBaseService_1.default {
12009
12021
  if (obj.version !== undefined) {
12010
12022
  copy.version = obj.version;
12011
12023
  }
12024
+ let defaultProperties = [
12025
+ 'name',
12026
+ 'variant',
12027
+ 'version',
12028
+ ];
12029
+ Object.keys(obj).forEach(key => {
12030
+ if (!defaultProperties.includes(key)) {
12031
+ copy[key] = obj[key];
12032
+ }
12033
+ });
12012
12034
  return copy;
12013
12035
  }
12014
12036
  static deserialize(obj) {
@@ -12025,6 +12047,16 @@ class CloudantV1 extends cloudantBaseService_1.default {
12025
12047
  if (obj.version !== undefined) {
12026
12048
  copy.version = obj.version;
12027
12049
  }
12050
+ let defaultProperties = [
12051
+ 'name',
12052
+ 'variant',
12053
+ 'version',
12054
+ ];
12055
+ Object.keys(obj).forEach(key => {
12056
+ if (!defaultProperties.includes(key)) {
12057
+ copy[key] = obj[key];
12058
+ }
12059
+ });
12028
12060
  return copy;
12029
12061
  }
12030
12062
  }