@ibm-cloud/cloudant 0.0.11 → 0.0.15
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/LICENSE +25 -0
- package/README.md +332 -282
- package/auth/couchdbSessionAuthenticator.d.ts +2 -2
- package/auth/couchdbSessionAuthenticator.js +4 -2
- package/auth/couchdbSessionAuthenticator.js.map +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.js +2 -1
- package/auth/index.js.map +1 -1
- package/auth/sessionTokenManager.d.ts +2 -2
- package/auth/sessionTokenManager.js +16 -8
- package/auth/sessionTokenManager.js.map +1 -1
- package/cloudant/v1.d.ts +300 -460
- package/cloudant/v1.js +509 -610
- package/cloudant/v1.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/lib/cloudantBaseService.d.ts +10 -2
- package/lib/cloudantBaseService.js +17 -2
- package/lib/cloudantBaseService.js.map +1 -1
- package/lib/common.d.ts +1 -1
- package/lib/common.js +1 -1
- package/lib/common.js.map +1 -1
- package/lib/getAuthenticatorFromEnvCloudantExtension.d.ts +2 -2
- package/lib/getAuthenticatorFromEnvCloudantExtension.js +1 -1
- package/lib/getAuthenticatorFromEnvCloudantExtension.js.map +1 -1
- package/package.json +7 -9
package/README.md
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
The example codes and outputs below are generated using the `embedmd` go
|
|
2
|
+
The example codes and outputs below are generated using the `embedmd` go
|
|
3
|
+
package.
|
|
3
4
|
|
|
4
5
|
https://github.com/campoy/embedmd
|
|
5
6
|
|
|
6
|
-
You should regenerate the example codes after making any changes to
|
|
7
|
+
You should regenerate the example codes after making any changes to
|
|
8
|
+
examples in the test/examples/ folder.
|
|
7
9
|
|
|
8
10
|
embedmd -w README.md
|
|
9
11
|
-->
|
|
10
12
|
|
|
11
13
|
[](https://travis-ci.com/IBM/cloudant-node-sdk)
|
|
12
|
-
|
|
13
|
-
[](https://www.npmjs.com/package/@ibmcloud/cloudant)
|
|
15
|
-
[](https://codecov.io/gh/IBM/cloudant-node-sdk)
|
|
16
|
-
-->
|
|
14
|
+
[](https://github.com/IBM/cloudant-node-sdk/releases/latest)
|
|
15
|
+
[](https://ibm.github.io/cloudant-node-sdk/)
|
|
17
16
|
|
|
18
|
-
# IBM Cloudant Node.js SDK Version 0.0.
|
|
17
|
+
# IBM Cloudant Node.js SDK Version 0.0.15
|
|
19
18
|
|
|
20
|
-
Node.js client library
|
|
19
|
+
IBM Cloudant Node.js SDK is a client library that interacts with the
|
|
21
20
|
[IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=node).
|
|
22
21
|
|
|
23
|
-
Disclaimer:
|
|
22
|
+
Disclaimer: This SDK is being released initially as a **pre-release** version.
|
|
24
23
|
Changes might occur which impact applications that use this SDK.
|
|
25
24
|
|
|
26
25
|
<details>
|
|
@@ -31,8 +30,6 @@ Changes might occur which impact applications that use this SDK.
|
|
|
31
30
|
|
|
32
31
|
https://github.com/jonschlinkert/markdown-toc
|
|
33
32
|
|
|
34
|
-
You should regenerate the TOC after making changes to this file.
|
|
35
|
-
|
|
36
33
|
npx markdown-toc -i README.md
|
|
37
34
|
-->
|
|
38
35
|
|
|
@@ -43,23 +40,24 @@ Changes might occur which impact applications that use this SDK.
|
|
|
43
40
|
- [Prerequisites](#prerequisites)
|
|
44
41
|
- [Installation](#installation)
|
|
45
42
|
- [Authentication](#authentication)
|
|
46
|
-
* [
|
|
43
|
+
* [Authentication with environment variables](#authentication-with-environment-variables)
|
|
47
44
|
+ [IAM authentication](#iam-authentication)
|
|
48
45
|
+ [Session cookie authentication](#session-cookie-authentication)
|
|
49
46
|
+ [Basic authentication](#basic-authentication)
|
|
50
|
-
* [
|
|
51
|
-
* [
|
|
52
|
-
- [Code examples](#code-examples)
|
|
53
|
-
* [1. Retrieve information from an existing database](#1-retrieve-information-from-an-existing-database)
|
|
54
|
-
* [2. Create your own database and add a document](#2-create-your-own-database-and-add-a-document)
|
|
55
|
-
* [3. Update your previously created document](#3-update-your-previously-created-document)
|
|
56
|
-
* [4. Delete your previously created document](#4-delete-your-previously-created-document)
|
|
57
|
-
- [Error handling](#error-handling)
|
|
47
|
+
* [Authentication with external configuration](#authentication-with-external-configuration)
|
|
48
|
+
* [Programmatic authentication](#programmatic-authentication)
|
|
58
49
|
- [Using the SDK](#using-the-sdk)
|
|
50
|
+
* [Code examples](#code-examples)
|
|
51
|
+
+ [1. Retrieve information from an existing database](#1-retrieve-information-from-an-existing-database)
|
|
52
|
+
+ [2. Create your own database and add a document](#2-create-your-own-database-and-add-a-document)
|
|
53
|
+
+ [3. Update your previously created document](#3-update-your-previously-created-document)
|
|
54
|
+
+ [4. Delete your previously created document](#4-delete-your-previously-created-document)
|
|
55
|
+
* [Error handling](#error-handling)
|
|
56
|
+
* [Raw IO](#raw-io)
|
|
57
|
+
* [Further resources](#further-resources)
|
|
59
58
|
- [Questions](#questions)
|
|
60
59
|
- [Issues](#issues)
|
|
61
|
-
- [
|
|
62
|
-
- [Open source @ IBM](#open-source--ibm)
|
|
60
|
+
- [Open source at IBM](#open-source-at-ibm)
|
|
63
61
|
- [Contributing](#contributing)
|
|
64
62
|
- [License](#license)
|
|
65
63
|
|
|
@@ -70,39 +68,41 @@ Changes might occur which impact applications that use this SDK.
|
|
|
70
68
|
## Overview
|
|
71
69
|
|
|
72
70
|
The IBM Cloudant Node.js SDK allows developers to programmatically
|
|
73
|
-
interact with IBM
|
|
71
|
+
interact with [IBM Cloudant](https://cloud.ibm.com/apidocs/cloudant)
|
|
74
72
|
with the help of the `@ibm-cloud/cloudant` package.
|
|
75
73
|
|
|
76
74
|
## Features
|
|
77
75
|
|
|
78
76
|
The purpose of this Node.js SDK is to wrap most of the HTTP request APIs
|
|
79
77
|
provided by Cloudant and supply other functions to ease the usage of Cloudant.
|
|
80
|
-
Moreover, it has limited support for CouchDB as well.
|
|
81
78
|
This SDK should make life easier for programmers to do what’s really important
|
|
82
|
-
|
|
79
|
+
to them: developing software.
|
|
83
80
|
|
|
84
81
|
Reasons why you should consider using Cloudant Node.js SDK in your
|
|
85
82
|
project:
|
|
86
83
|
|
|
87
84
|
- Supported by IBM Cloudant.
|
|
85
|
+
- Server compatibility with:
|
|
86
|
+
- IBM Cloudant "Classic".
|
|
87
|
+
- [Cloudant "Standard on Transaction Engine"](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te) for APIs compatible with Cloudant "Classic". For more information, see the [Feature Parity](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te#feature-parity-between-ibm-cloudant-on-the-transaction-engine-vs-classic-architecture) page.
|
|
88
|
+
- [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations.
|
|
88
89
|
- Includes all the most popular and latest supported endpoints for
|
|
89
90
|
applications.
|
|
90
91
|
- Handles the authentication.
|
|
91
|
-
- Familiar user experience
|
|
92
|
+
- Familiar user experience with IBM Cloud SDKs.
|
|
93
|
+
- Flexibility to use either built-in models or byte-based requests and responses for documents.
|
|
92
94
|
- `Promise` based design with asynchronous HTTP requests.
|
|
93
95
|
- Use either as native JavaScript or take advantage of TypeScript models.
|
|
94
96
|
- Transparently compresses request and response bodies.
|
|
95
97
|
|
|
96
98
|
## Prerequisites
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
It may work on other versions but those are not officially supported.
|
|
105
|
-
|
|
100
|
+
- A
|
|
101
|
+
[Cloudant](https://cloud.ibm.com/docs/Cloudant/getting-started.html#step-1-connect-to-your-cloudant-nosql-db-service-instance-on-ibm-cloud)
|
|
102
|
+
service instance or a
|
|
103
|
+
[CouchDB](https://docs.couchdb.org/en/latest/install/index.html)
|
|
104
|
+
server.
|
|
105
|
+
- Node.js 10, 12 or 14.
|
|
106
106
|
|
|
107
107
|
## Installation
|
|
108
108
|
|
|
@@ -127,7 +127,8 @@ account.
|
|
|
127
127
|
1. [*IAM authentication*](#iam-authentication) is highly recommended when your
|
|
128
128
|
back-end database server is [**Cloudant**][cloud-IAM-mgmt]. This
|
|
129
129
|
authentication type requires a server-generated `apikey` instead of a
|
|
130
|
-
user-given password.
|
|
130
|
+
user-given password. You can create one
|
|
131
|
+
[here](https://cloud.ibm.com/iam/apikeys).
|
|
131
132
|
1. [*Session cookie (`COUCHDB_SESSION`) authentication*](#session-cookie-authentication)
|
|
132
133
|
is recommended for [Apache CouchDB][couch-cookie-auth] or for
|
|
133
134
|
[Cloudant][cloudant-cookie-auth] when IAM is unavailable. It exchanges username
|
|
@@ -137,23 +138,23 @@ account.
|
|
|
137
138
|
for both [Cloudant][cloudant-basic-auth] and [Apache CouchDB][couch-basic-auth]
|
|
138
139
|
back-end database servers. This authentication type requires the good old
|
|
139
140
|
`username` and `password` credentials.
|
|
140
|
-
1. *Noauth* authentication does not
|
|
141
|
-
authentication type
|
|
141
|
+
1. *Noauth* authentication does not require credentials. Note that this
|
|
142
|
+
authentication type only works with queries against a database with read
|
|
142
143
|
access for everyone.
|
|
143
144
|
1. The service `url`.
|
|
144
145
|
|
|
145
146
|
There are several ways to **set** these properties:
|
|
146
147
|
|
|
147
|
-
1. As [environment variables](#
|
|
148
|
-
1. The [programmatic approach](#
|
|
149
|
-
1. With an [external credentials file](#
|
|
148
|
+
1. As [environment variables](#authentication-with-environment-variables)
|
|
149
|
+
1. The [programmatic approach](#programmatic-authentication)
|
|
150
|
+
1. With an [external credentials file](#authentication-with-external-configuration)
|
|
150
151
|
|
|
151
|
-
###
|
|
152
|
+
### Authentication with environment variables
|
|
152
153
|
|
|
153
154
|
#### IAM authentication
|
|
154
155
|
|
|
155
|
-
For Cloudant *IAM authentication
|
|
156
|
-
replacing `<url>` and `<apikey>` with your proper
|
|
156
|
+
For Cloudant *IAM authentication*, set the following environmental variables by
|
|
157
|
+
replacing the `<url>` and `<apikey>` with your proper
|
|
157
158
|
[service credentials][service-credentials]. There is no need to set
|
|
158
159
|
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default.
|
|
159
160
|
|
|
@@ -164,8 +165,8 @@ CLOUDANT_APIKEY=<apikey>
|
|
|
164
165
|
|
|
165
166
|
#### Session cookie authentication
|
|
166
167
|
|
|
167
|
-
For `COUCHDB_SESSION` authentication set the following environmental variables
|
|
168
|
-
by replacing `<url>`, `<username>` and `<password>` with your proper
|
|
168
|
+
For `COUCHDB_SESSION` authentication, set the following environmental variables
|
|
169
|
+
by replacing the `<url>`, `<username>` and `<password>` with your proper
|
|
169
170
|
[service credentials][service-credentials].
|
|
170
171
|
|
|
171
172
|
```bash
|
|
@@ -177,8 +178,8 @@ CLOUDANT_PASSWORD=<password>
|
|
|
177
178
|
|
|
178
179
|
#### Basic authentication
|
|
179
180
|
|
|
180
|
-
For *Basic authentication
|
|
181
|
-
replacing `<url>`, `<username>` and `<password>` with your proper
|
|
181
|
+
For *Basic authentication*, set the following environmental variables by
|
|
182
|
+
replacing the `<url>`, `<username>` and `<password>` with your proper
|
|
182
183
|
[service credentials][service-credentials].
|
|
183
184
|
|
|
184
185
|
```bash
|
|
@@ -188,10 +189,10 @@ CLOUDANT_USERNAME=<username>
|
|
|
188
189
|
CLOUDANT_PASSWORD=<password>
|
|
189
190
|
```
|
|
190
191
|
|
|
191
|
-
**Note**: We recommend
|
|
192
|
+
**Note**: We recommend that you use [IAM](#iam-authentication) for Cloudant and
|
|
192
193
|
[Session](#session-cookie-authentication) for CouchDB authentication.
|
|
193
194
|
|
|
194
|
-
###
|
|
195
|
+
### Authentication with external configuration
|
|
195
196
|
|
|
196
197
|
To use an external configuration file, the
|
|
197
198
|
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node#authentication-with-external-configuration),
|
|
@@ -199,28 +200,43 @@ or the
|
|
|
199
200
|
[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration)
|
|
200
201
|
will guide you.
|
|
201
202
|
|
|
202
|
-
###
|
|
203
|
+
### Programmatic authentication
|
|
203
204
|
|
|
204
205
|
To learn more about how to use programmatic authentication, see the related
|
|
205
206
|
documentation in the
|
|
206
|
-
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=
|
|
207
|
+
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node#programmatic-authentication)
|
|
207
208
|
or in the
|
|
208
|
-
[Node.js SDK Core document
|
|
209
|
+
[Node.js SDK Core document](https://github.com/IBM/node-sdk-core/blob/master/Authentication.md) about authentication.
|
|
209
210
|
|
|
210
|
-
##
|
|
211
|
+
## Using the SDK
|
|
211
212
|
|
|
212
|
-
|
|
213
|
-
[
|
|
213
|
+
For general IBM Cloud SDK usage information, please see
|
|
214
|
+
[IBM Cloud SDK Common](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md).
|
|
214
215
|
|
|
215
|
-
###
|
|
216
|
+
### Code examples
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
The following code examples
|
|
219
|
+
[authenticate with the environment variables](#authenticate-with-environment-variables).
|
|
220
|
+
|
|
221
|
+
#### 1. Retrieve information from an existing database
|
|
222
|
+
|
|
223
|
+
**Note:** This example code assumes that `animaldb` database does not exist in your account.
|
|
224
|
+
|
|
225
|
+
This example code gathers information about an existing database hosted on
|
|
226
|
+
the https://examples.cloudant.com/ service `url`. To connect, you must
|
|
219
227
|
extend your environment variables with the *service url* and *authentication
|
|
220
|
-
type* to use `NOAUTH` authentication while
|
|
228
|
+
type* to use `NOAUTH` authentication while you connect to the `animaldb` database.
|
|
221
229
|
This step is necessary for the SDK to distinguish the `EXAMPLES` custom service
|
|
222
230
|
name from the default service name which is `CLOUDANT`.
|
|
223
231
|
|
|
232
|
+
Cloudant environment variable naming starts with a *service name* prefix that identifies your service.
|
|
233
|
+
By default this is `CLOUDANT`, see the settings in the
|
|
234
|
+
[authentication with environment variables section](#authentication-with-environment-variables).
|
|
235
|
+
|
|
236
|
+
If you would like to rename your Cloudant service from `CLOUDANT`,
|
|
237
|
+
you must use your defined service name as the prefix for all Cloudant related environment variables.
|
|
238
|
+
The code block below provides an example of instantiating a user-defined `EXAMPLES` service name.
|
|
239
|
+
|
|
224
240
|
```bash
|
|
225
241
|
EXAMPLES_URL=https://examples.cloudant.com
|
|
226
242
|
EXAMPLES_AUTH_TYPE=NOAUTH
|
|
@@ -231,52 +247,58 @@ Once the environment variables are set, you can try out the code examples.
|
|
|
231
247
|
<details open>
|
|
232
248
|
<summary>TypeScript:</summary>
|
|
233
249
|
|
|
250
|
+
```ts
|
|
251
|
+
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
252
|
+
```
|
|
234
253
|
[embedmd]:# (test/examples/src/ts/GetInfoFromExistingDatabase.ts /\/\/ 1./ $)
|
|
235
254
|
```ts
|
|
236
255
|
// 1. Create a Cloudant client with "EXAMPLES" service name ===================
|
|
237
|
-
const client =
|
|
238
|
-
CloudantV1.newInstance({serviceName:"EXAMPLES"});
|
|
256
|
+
const client = CloudantV1.newInstance({ serviceName: 'EXAMPLES' });
|
|
239
257
|
|
|
240
258
|
// 2. Get server information ==================================================
|
|
241
259
|
// call service without parameters:
|
|
242
|
-
client.getServerInformation()
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
});
|
|
260
|
+
client.getServerInformation().then((serverInformation) => {
|
|
261
|
+
const version = serverInformation.result.version;
|
|
262
|
+
console.log(`Server version ${version}`);
|
|
263
|
+
});
|
|
247
264
|
|
|
248
265
|
// 3. Get database information for "animaldb" =================================
|
|
249
|
-
const dbName =
|
|
266
|
+
const dbName = 'animaldb';
|
|
250
267
|
|
|
251
268
|
// call service with embedded parameters:
|
|
252
|
-
client.getDatabaseInformation({db: dbName})
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
269
|
+
client.getDatabaseInformation({ db: dbName }).then((dbInfo) => {
|
|
270
|
+
const documentCount = dbInfo.result.doc_count;
|
|
271
|
+
const dbNameResult = dbInfo.result.db_name;
|
|
272
|
+
|
|
273
|
+
// 4. Show document count in database =================================
|
|
274
|
+
console.log(
|
|
275
|
+
`Document count in "${dbNameResult}" database is ` + documentCount + '.'
|
|
276
|
+
);
|
|
277
|
+
});
|
|
261
278
|
|
|
262
279
|
// 5. Get zebra document out of the database by document id ===================
|
|
263
|
-
const getDocParams:
|
|
264
|
-
|
|
280
|
+
const getDocParams: CloudantV1.GetDocumentParams = {
|
|
281
|
+
db: dbName,
|
|
282
|
+
docId: 'zebra',
|
|
283
|
+
};
|
|
265
284
|
|
|
266
285
|
// call service with predefined parameters:
|
|
267
|
-
client.getDocument(getDocParams)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
286
|
+
client.getDocument(getDocParams).then((documentAboutZebra) => {
|
|
287
|
+
// result object is defined as a Document here:
|
|
288
|
+
const result: CloudantV1.Document = documentAboutZebra.result;
|
|
289
|
+
console.log(
|
|
290
|
+
'Document retrieved from database:\n' + JSON.stringify(result, null, 2)
|
|
291
|
+
);
|
|
292
|
+
});
|
|
274
293
|
```
|
|
275
294
|
</details>
|
|
276
295
|
|
|
277
296
|
<details>
|
|
278
297
|
<summary>JavaScript:</summary>
|
|
279
298
|
|
|
299
|
+
```js
|
|
300
|
+
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
301
|
+
```
|
|
280
302
|
[embedmd]:# (test/examples/src/js/GetInfoFromExistingDatabase.js /const getInfoFromExistingDatabase/ /getInfoFromExistingDatabase\(\);\n\}/)
|
|
281
303
|
```js
|
|
282
304
|
const getInfoFromExistingDatabase = async () => {
|
|
@@ -297,7 +319,9 @@ const getInfoFromExistingDatabase = async () => {
|
|
|
297
319
|
const dbNameResult = dbInfo.result.db_name;
|
|
298
320
|
|
|
299
321
|
// 4. Show document count in database =================================
|
|
300
|
-
console.log(
|
|
322
|
+
console.log(
|
|
323
|
+
`Document count in "${dbNameResult}" database is ` + documentCount + '.'
|
|
324
|
+
);
|
|
301
325
|
|
|
302
326
|
// 5. Get zebra document out of the database by document id ===================
|
|
303
327
|
const getDocParams = { db: dbName, docId: 'zebra' };
|
|
@@ -308,7 +332,9 @@ const getInfoFromExistingDatabase = async () => {
|
|
|
308
332
|
// result object is defined as a Document here:
|
|
309
333
|
const result = documentAboutZebra.result;
|
|
310
334
|
|
|
311
|
-
console.log(
|
|
335
|
+
console.log(
|
|
336
|
+
'Document retrieved from database:\n' + JSON.stringify(result, null, 2)
|
|
337
|
+
);
|
|
312
338
|
};
|
|
313
339
|
|
|
314
340
|
if (require.main === module) {
|
|
@@ -318,8 +344,7 @@ if (require.main === module) {
|
|
|
318
344
|
|
|
319
345
|
</details>
|
|
320
346
|
|
|
321
|
-
|
|
322
|
-
The order of the output lines may change due to the asynchronicity.
|
|
347
|
+
When you run the code, you see a result similar to the following output.
|
|
323
348
|
|
|
324
349
|
[embedmd]:# (test/examples/output/GetInfoFromExistingDatabase.txt)
|
|
325
350
|
```txt
|
|
@@ -339,90 +364,89 @@ Document retrieved from database:
|
|
|
339
364
|
}
|
|
340
365
|
```
|
|
341
366
|
|
|
342
|
-
|
|
367
|
+
#### 2. Create your own database and add a document
|
|
343
368
|
|
|
344
|
-
|
|
345
|
-
|
|
369
|
+
**Note:** This example code assumes that `orders` database does not exist in your account.
|
|
370
|
+
|
|
371
|
+
Now comes the exciting part, you create your own `orders` database and add a document about *Bob Smith* with your own [IAM](#iam-authentication) or
|
|
346
372
|
[Basic](#basic-authentication) service credentials.
|
|
347
373
|
|
|
374
|
+
<details>
|
|
375
|
+
<summary>Create code example</summary>
|
|
376
|
+
|
|
348
377
|
<details open>
|
|
349
378
|
<summary>TypeScript:</summary>
|
|
350
379
|
|
|
380
|
+
```ts
|
|
381
|
+
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
382
|
+
```
|
|
351
383
|
[embedmd]:# (test/examples/src/ts/CreateDbAndDoc.ts /interface/ $)
|
|
352
384
|
```ts
|
|
353
385
|
interface OrderDocument extends CloudantV1.Document {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
386
|
+
name?: string;
|
|
387
|
+
joined?: string;
|
|
388
|
+
_id: string;
|
|
389
|
+
_rev?: string;
|
|
358
390
|
}
|
|
359
391
|
|
|
360
392
|
// 1. Create a client with `CLOUDANT` default service name ================
|
|
361
393
|
const client = CloudantV1.newInstance({});
|
|
362
394
|
|
|
363
395
|
// 2. Create a database =======================================================
|
|
364
|
-
const exampleDbName =
|
|
396
|
+
const exampleDbName = 'orders';
|
|
365
397
|
|
|
366
398
|
// Try to create database if it doesn't exist
|
|
367
|
-
const createDb = client
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
399
|
+
const createDb = client
|
|
400
|
+
.putDatabase({ db: exampleDbName })
|
|
401
|
+
.then((putDatabaseResult) => {
|
|
402
|
+
if (putDatabaseResult.result.ok) {
|
|
403
|
+
console.log(`"${exampleDbName}" database created."`);
|
|
404
|
+
}
|
|
405
|
+
})
|
|
406
|
+
.catch((err) => {
|
|
407
|
+
if (err.code === 412) {
|
|
408
|
+
console.log(
|
|
409
|
+
'Cannot create "' + exampleDbName + '" database, it already exists.'
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
});
|
|
379
413
|
|
|
380
414
|
// 3. Create a document =======================================================
|
|
381
415
|
// Create a document object with "example" id
|
|
382
|
-
const exampleDocId =
|
|
416
|
+
const exampleDocId = 'example';
|
|
383
417
|
|
|
384
418
|
// set required _id property on exampleDocument:
|
|
385
|
-
const exampleDocument: OrderDocument = {_id: exampleDocId};
|
|
419
|
+
const exampleDocument: OrderDocument = { _id: exampleDocId };
|
|
386
420
|
|
|
387
421
|
// Add "name" and "joined" fields to the document
|
|
388
|
-
exampleDocument.name =
|
|
389
|
-
exampleDocument.joined =
|
|
422
|
+
exampleDocument.name = 'Bob Smith';
|
|
423
|
+
exampleDocument.joined = '2019-01-24T10:42:99.000Z';
|
|
390
424
|
|
|
391
|
-
|
|
392
|
-
latest one if it previously existed in the database */
|
|
425
|
+
// Save the document in the database
|
|
393
426
|
createDb.then(() => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
client.postDocument({
|
|
408
|
-
db: exampleDbName,
|
|
409
|
-
document: exampleDocument
|
|
410
|
-
}
|
|
411
|
-
).then(createDocumentResponse => {
|
|
412
|
-
// Keep track with the revision number of the document object
|
|
413
|
-
exampleDocument._rev = createDocumentResponse.result.rev;
|
|
414
|
-
console.log("You have created the document:\n" +
|
|
415
|
-
JSON.stringify(exampleDocument, null, 2));
|
|
416
|
-
});
|
|
417
|
-
});
|
|
427
|
+
client
|
|
428
|
+
.postDocument({
|
|
429
|
+
db: exampleDbName,
|
|
430
|
+
document: exampleDocument,
|
|
431
|
+
})
|
|
432
|
+
.then((createDocumentResponse) => {
|
|
433
|
+
// Keep track with the revision number of the document object
|
|
434
|
+
exampleDocument._rev = createDocumentResponse.result.rev;
|
|
435
|
+
console.log(
|
|
436
|
+
'You have created the document:\n' +
|
|
437
|
+
JSON.stringify(exampleDocument, null, 2)
|
|
438
|
+
);
|
|
439
|
+
});
|
|
418
440
|
});
|
|
419
441
|
```
|
|
420
|
-
|
|
421
442
|
</details>
|
|
422
443
|
|
|
423
444
|
<details>
|
|
424
445
|
<summary>JavaScript:</summary>
|
|
425
446
|
|
|
447
|
+
```js
|
|
448
|
+
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
449
|
+
```
|
|
426
450
|
[embedmd]:# (test/examples/src/js/CreateDbAndDoc.js /const createDbAndDoc/ /createDbAndDoc\(\);\n\}/)
|
|
427
451
|
```js
|
|
428
452
|
const createDbAndDoc = async () => {
|
|
@@ -444,7 +468,9 @@ const createDbAndDoc = async () => {
|
|
|
444
468
|
}
|
|
445
469
|
} catch (err) {
|
|
446
470
|
if (err.code === 412) {
|
|
447
|
-
console.log(
|
|
471
|
+
console.log(
|
|
472
|
+
'Cannot create "' + exampleDbName + '" database, it already exists.'
|
|
473
|
+
);
|
|
448
474
|
}
|
|
449
475
|
}
|
|
450
476
|
|
|
@@ -458,44 +484,29 @@ const createDbAndDoc = async () => {
|
|
|
458
484
|
exampleDocument['name'] = 'Bob Smith';
|
|
459
485
|
exampleDocument.joined = '2019-01-24T10:42:99.000Z';
|
|
460
486
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
exampleDocument
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
} catch (err) {
|
|
474
|
-
if (err.code === 404) {
|
|
475
|
-
// Document does not exist in database
|
|
476
|
-
}
|
|
477
|
-
} finally {
|
|
478
|
-
// Save the document in the database
|
|
479
|
-
const createDocumentResponse = await client.postDocument({
|
|
480
|
-
db: exampleDbName,
|
|
481
|
-
document: exampleDocument,
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
// Keep track with the revision number of the document object
|
|
485
|
-
exampleDocument._rev = createDocumentResponse.result.rev;
|
|
486
|
-
console.log('You have created the document:\n' + JSON.stringify(exampleDocument, null, 2));
|
|
487
|
-
}
|
|
487
|
+
// Save the document in the database
|
|
488
|
+
const createDocumentResponse = await client.postDocument({
|
|
489
|
+
db: exampleDbName,
|
|
490
|
+
document: exampleDocument,
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// Keep track with the revision number of the document object
|
|
494
|
+
exampleDocument._rev = createDocumentResponse.result.rev;
|
|
495
|
+
console.log(
|
|
496
|
+
'You have created the document:\n' +
|
|
497
|
+
JSON.stringify(exampleDocument, null, 2)
|
|
498
|
+
);
|
|
488
499
|
};
|
|
489
500
|
|
|
490
501
|
if (require.main === module) {
|
|
491
502
|
createDbAndDoc();
|
|
492
503
|
}
|
|
493
504
|
```
|
|
494
|
-
|
|
495
505
|
</details>
|
|
496
506
|
|
|
497
|
-
|
|
498
|
-
|
|
507
|
+
|
|
508
|
+
</details>
|
|
509
|
+
When you run the code, you see a result similar to the following output.
|
|
499
510
|
|
|
500
511
|
[embedmd]:# (test/examples/output/CreateDbAndDoc.txt)
|
|
501
512
|
```txt
|
|
@@ -509,72 +520,84 @@ You have created the document:
|
|
|
509
520
|
}
|
|
510
521
|
```
|
|
511
522
|
|
|
512
|
-
|
|
523
|
+
#### 3. Update your previously created document
|
|
513
524
|
|
|
514
|
-
**Note**:
|
|
525
|
+
**Note**: This example code assumes that you have created both the `orders`
|
|
515
526
|
database and the `example` document by
|
|
516
|
-
[running
|
|
517
|
-
successfully,
|
|
518
|
-
database or
|
|
527
|
+
[running the previous example code](#2-create-your-own-database-and-add-a-document)
|
|
528
|
+
successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders'
|
|
529
|
+
database or 'example' document was not found."
|
|
530
|
+
|
|
531
|
+
<details>
|
|
532
|
+
<summary>Update code example</summary>
|
|
519
533
|
|
|
520
534
|
<details open>
|
|
521
535
|
<summary>TypeScript:</summary>
|
|
522
536
|
|
|
537
|
+
```ts
|
|
538
|
+
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
539
|
+
```
|
|
523
540
|
[embedmd]:# (test/examples/src/ts/UpdateDoc.ts /interface/ $)
|
|
524
541
|
```ts
|
|
525
542
|
interface OrderDocument extends CloudantV1.Document {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
543
|
+
address?: string;
|
|
544
|
+
joined?: string;
|
|
545
|
+
_id?: string;
|
|
546
|
+
_rev?: string;
|
|
530
547
|
}
|
|
531
548
|
|
|
532
549
|
// 1. Create a client with `CLOUDANT` default service name ================
|
|
533
550
|
const client = CloudantV1.newInstance({});
|
|
534
551
|
// 2. Update the document =====================================================
|
|
535
552
|
// Set the options to get the document out of the database if it exists
|
|
536
|
-
const exampleDbName =
|
|
553
|
+
const exampleDbName = 'orders';
|
|
537
554
|
|
|
538
555
|
// Try to get the document if it previously existed in the database
|
|
539
|
-
const getDocParams: CloudantV1.GetDocumentParams =
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (err.code === 404) {
|
|
564
|
-
console.log(
|
|
565
|
-
"Cannot update document because either \"" +
|
|
566
|
-
exampleDbName + "\" database or the \"example\" " +
|
|
567
|
-
"document was not found."
|
|
568
|
-
);
|
|
569
|
-
}
|
|
556
|
+
const getDocParams: CloudantV1.GetDocumentParams = {
|
|
557
|
+
docId: 'example',
|
|
558
|
+
db: exampleDbName,
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
client
|
|
562
|
+
.getDocument(getDocParams)
|
|
563
|
+
.then((docResult) => {
|
|
564
|
+
// using OrderDocument on getDocument result:
|
|
565
|
+
const document: OrderDocument = docResult.result;
|
|
566
|
+
|
|
567
|
+
// Add Bob Smith's address to the document
|
|
568
|
+
document.address = '19 Front Street, Darlington, DL5 1TY';
|
|
569
|
+
|
|
570
|
+
// Remove the joined property from document object
|
|
571
|
+
delete document.joined;
|
|
572
|
+
|
|
573
|
+
// Update the document in the database
|
|
574
|
+
client.postDocument({ db: exampleDbName, document }).then((res) => {
|
|
575
|
+
// Keeping track with the revision number of the document object:
|
|
576
|
+
document._rev = res.result.rev;
|
|
577
|
+
console.log(
|
|
578
|
+
'You have updated the document:\n' + JSON.stringify(document, null, 2)
|
|
579
|
+
);
|
|
570
580
|
});
|
|
581
|
+
})
|
|
582
|
+
.catch((err) => {
|
|
583
|
+
if (err.code === 404) {
|
|
584
|
+
console.log(
|
|
585
|
+
'Cannot update document because either "' +
|
|
586
|
+
exampleDbName +
|
|
587
|
+
'" database or the "example" ' +
|
|
588
|
+
'document was not found.'
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
571
592
|
```
|
|
572
|
-
|
|
573
593
|
</details>
|
|
574
594
|
|
|
575
595
|
<details>
|
|
576
596
|
<summary>JavaScript:</summary>
|
|
577
597
|
|
|
598
|
+
```js
|
|
599
|
+
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
600
|
+
```
|
|
578
601
|
[embedmd]:# (test/examples/src/js/UpdateDoc.js /const updateDoc/ /updateDoc\(\);\n\}/)
|
|
579
602
|
```js
|
|
580
603
|
const updateDoc = async () => {
|
|
@@ -607,7 +630,9 @@ const updateDoc = async () => {
|
|
|
607
630
|
})
|
|
608
631
|
).result.rev;
|
|
609
632
|
|
|
610
|
-
console.log(
|
|
633
|
+
console.log(
|
|
634
|
+
'You have updated the document:\n' + JSON.stringify(document, null, 2)
|
|
635
|
+
);
|
|
611
636
|
} catch (err) {
|
|
612
637
|
if (err.code === 404) {
|
|
613
638
|
console.log(
|
|
@@ -624,41 +649,48 @@ if (require.main === module) {
|
|
|
624
649
|
updateDoc();
|
|
625
650
|
}
|
|
626
651
|
```
|
|
627
|
-
|
|
628
652
|
</details>
|
|
629
653
|
|
|
630
|
-
|
|
654
|
+
|
|
655
|
+
</details>
|
|
656
|
+
When you run the code, you see a result similar to the following output.
|
|
631
657
|
|
|
632
658
|
[embedmd]:# (test/examples/output/UpdateDoc.txt)
|
|
633
659
|
```txt
|
|
634
660
|
You have updated the document:
|
|
635
661
|
{
|
|
636
662
|
"_id": "example",
|
|
637
|
-
"_rev": "2-
|
|
663
|
+
"_rev": "2-4e2178e85cffb32d38ba4e451f6ca376",
|
|
638
664
|
"name": "Bob Smith",
|
|
639
665
|
"address": "19 Front Street, Darlington, DL5 1TY"
|
|
640
666
|
}
|
|
641
667
|
```
|
|
642
668
|
|
|
643
|
-
|
|
669
|
+
#### 4. Delete your previously created document
|
|
644
670
|
|
|
645
|
-
**Note**:
|
|
671
|
+
**Note**: This example code assumes that you have created both the `orders`
|
|
646
672
|
database and the `example` document by
|
|
647
|
-
[running
|
|
648
|
-
successfully,
|
|
649
|
-
database or
|
|
673
|
+
[running the previous example code](#2-create-your-own-database-and-add-a-document)
|
|
674
|
+
successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders'
|
|
675
|
+
database or 'example' document was not found."
|
|
676
|
+
|
|
677
|
+
<details>
|
|
678
|
+
<summary>Delete code example</summary>
|
|
650
679
|
|
|
651
680
|
<details open>
|
|
652
681
|
<summary>TypeScript:</summary>
|
|
653
682
|
|
|
683
|
+
```ts
|
|
684
|
+
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
685
|
+
```
|
|
654
686
|
[embedmd]:# (test/examples/src/ts/DeleteDoc.ts /interface/ $)
|
|
655
687
|
```ts
|
|
656
688
|
interface OrderDocument extends CloudantV1.Document {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
689
|
+
name?: string;
|
|
690
|
+
address?: string;
|
|
691
|
+
joined?: string;
|
|
692
|
+
_id?: string;
|
|
693
|
+
_rev?: string;
|
|
662
694
|
}
|
|
663
695
|
|
|
664
696
|
// 1. Create a client with `CLOUDANT` default service name ================
|
|
@@ -666,40 +698,49 @@ const client = CloudantV1.newInstance({});
|
|
|
666
698
|
|
|
667
699
|
// 2. Delete the document =============================================
|
|
668
700
|
// Set the options to get the document out of the database if it exists
|
|
669
|
-
const exampleDbName =
|
|
670
|
-
const exampleDocId =
|
|
701
|
+
const exampleDbName = 'orders';
|
|
702
|
+
const exampleDocId = 'example';
|
|
671
703
|
|
|
672
704
|
// Try to get the document if it previously existed in the database
|
|
673
|
-
const getDocParams: CloudantV1.GetDocumentParams =
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
.then(docResult => {
|
|
678
|
-
const document: OrderDocument = docResult.result;
|
|
679
|
-
|
|
680
|
-
client.deleteDocument({
|
|
681
|
-
db: exampleDbName,
|
|
682
|
-
docId: document._id,
|
|
683
|
-
rev: document._rev}).then(() => {
|
|
684
|
-
console.log("You have deleted the document.");
|
|
685
|
-
});
|
|
686
|
-
})
|
|
687
|
-
.catch(err => {
|
|
688
|
-
if (err.code === 404) {
|
|
689
|
-
console.log(
|
|
690
|
-
"Cannot delete document because either \"" +
|
|
691
|
-
exampleDbName + "\" database or the \"example\" " +
|
|
692
|
-
"document was not found."
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
});
|
|
696
|
-
```
|
|
705
|
+
const getDocParams: CloudantV1.GetDocumentParams = {
|
|
706
|
+
docId: exampleDocId,
|
|
707
|
+
db: exampleDbName,
|
|
708
|
+
};
|
|
697
709
|
|
|
710
|
+
client
|
|
711
|
+
.getDocument(getDocParams)
|
|
712
|
+
.then((docResult) => {
|
|
713
|
+
const document: OrderDocument = docResult.result;
|
|
714
|
+
|
|
715
|
+
client
|
|
716
|
+
.deleteDocument({
|
|
717
|
+
db: exampleDbName,
|
|
718
|
+
docId: document._id,
|
|
719
|
+
rev: document._rev,
|
|
720
|
+
})
|
|
721
|
+
.then(() => {
|
|
722
|
+
console.log('You have deleted the document.');
|
|
723
|
+
});
|
|
724
|
+
})
|
|
725
|
+
.catch((err) => {
|
|
726
|
+
if (err.code === 404) {
|
|
727
|
+
console.log(
|
|
728
|
+
'Cannot delete document because either "' +
|
|
729
|
+
exampleDbName +
|
|
730
|
+
'" database or the "example" ' +
|
|
731
|
+
'document was not found.'
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
```
|
|
698
736
|
</details>
|
|
699
737
|
|
|
700
738
|
<details>
|
|
701
739
|
<summary>JavaScript:</summary>
|
|
702
740
|
|
|
741
|
+
```js
|
|
742
|
+
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
743
|
+
```
|
|
703
744
|
[embedmd]:# (test/examples/src/js/DeleteDoc.js /const deleteDoc/ /deleteDoc\(\);\n\}/)
|
|
704
745
|
```js
|
|
705
746
|
const deleteDoc = async () => {
|
|
@@ -742,60 +783,69 @@ if (require.main === module) {
|
|
|
742
783
|
deleteDoc();
|
|
743
784
|
}
|
|
744
785
|
```
|
|
745
|
-
|
|
746
786
|
</details>
|
|
747
787
|
|
|
748
|
-
|
|
788
|
+
|
|
789
|
+
</details>
|
|
790
|
+
When you run the code, you see the following output.
|
|
749
791
|
|
|
750
792
|
[embedmd]:# (test/examples/output/DeleteDoc.txt)
|
|
751
793
|
```txt
|
|
752
794
|
You have deleted the document.
|
|
753
795
|
```
|
|
754
796
|
|
|
755
|
-
|
|
797
|
+
### Error handling
|
|
756
798
|
|
|
757
|
-
For sample code on handling errors,
|
|
799
|
+
For sample code on handling errors, see
|
|
758
800
|
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node#error-handling).
|
|
759
801
|
|
|
760
|
-
|
|
802
|
+
### Raw IO
|
|
761
803
|
|
|
762
|
-
For
|
|
763
|
-
|
|
804
|
+
For endpoints that read or write document content it is possible to bypass
|
|
805
|
+
usage of the built-in models and send or receive a bytes response.
|
|
806
|
+
For examples of using byte streams, see the API reference documentation
|
|
807
|
+
("Example request as a stream" section).
|
|
764
808
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
the IBM Cloud services, please ask a question on
|
|
769
|
-
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).
|
|
770
|
-
|
|
771
|
-
## Issues
|
|
809
|
+
- [Bulk modify multiple documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postbulkdocs)
|
|
810
|
+
- [Query a list of all documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postalldocs)
|
|
811
|
+
- [Query the database document changes feed](https://cloud.ibm.com/apidocs/cloudant?code=node#postchanges)
|
|
772
812
|
|
|
773
|
-
|
|
774
|
-
a [bug report](https://github.com/IBM/cloudant-node-sdk/issues).
|
|
775
|
-
Before that, please search for similar issues. It's possible someone has
|
|
776
|
-
already encountered this issue.
|
|
777
|
-
|
|
778
|
-
## Further resources
|
|
813
|
+
### Further resources
|
|
779
814
|
|
|
780
815
|
- [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node):
|
|
781
|
-
API examples for Cloudant Node.js SDK.
|
|
816
|
+
API reference including usage examples for Cloudant Node.js SDK API.
|
|
817
|
+
- [TypeDoc](https://ibm.github.io/cloudant-node-sdk/):
|
|
818
|
+
Cloudant Node.js SDK API Documentation.
|
|
782
819
|
- [Cloudant docs](https://cloud.ibm.com/docs/services/Cloudant?topic=cloudant-overview#overview):
|
|
783
820
|
The official documentation page for Cloudant.
|
|
784
821
|
- [Cloudant Learning Center](https://developer.ibm.com/clouddataservices/docs/compose/cloudant/):
|
|
785
|
-
The official learning center with several useful videos which help you
|
|
822
|
+
The official learning center with several useful videos which help you use
|
|
786
823
|
Cloudant successfully.
|
|
787
824
|
- [Cloudant blog](https://blog.cloudant.com/):
|
|
788
|
-
Many useful articles how to optimize Cloudant for common problems.
|
|
825
|
+
Many useful articles about how to optimize Cloudant for common problems.
|
|
826
|
+
|
|
827
|
+
## Questions
|
|
828
|
+
|
|
829
|
+
If you are having difficulties using this SDK or have a question about the
|
|
830
|
+
IBM Cloud services, ask a question on
|
|
831
|
+
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud).
|
|
832
|
+
|
|
833
|
+
## Issues
|
|
834
|
+
|
|
835
|
+
If you encounter an issue with the project, you are welcome to submit a
|
|
836
|
+
[bug report](https://github.com/IBM/cloudant-node-sdk/issues).
|
|
837
|
+
Before you submit a bug report, search for
|
|
838
|
+
[similar issues](https://github.com/IBM/cloudant-node-sdk/issues?q=is%3Aissue) and review the
|
|
839
|
+
[KNOWN_ISSUES file](KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.
|
|
789
840
|
|
|
790
|
-
## Open source
|
|
841
|
+
## Open source at IBM
|
|
791
842
|
|
|
792
|
-
Find more open source projects on the [IBM Github
|
|
843
|
+
Find more open source projects on the [IBM Github](http://ibm.github.io/) page.
|
|
793
844
|
|
|
794
845
|
## Contributing
|
|
795
846
|
|
|
796
|
-
|
|
847
|
+
For more information, see [CONTRIBUTING](CONTRIBUTING.md).
|
|
797
848
|
|
|
798
849
|
## License
|
|
799
850
|
|
|
800
|
-
This SDK is released under the Apache 2.0 license.
|
|
801
|
-
The license's full text can be found in [LICENSE](LICENSE).
|
|
851
|
+
This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](LICENSE).
|