Fix merge conflicts with master

This commit is contained in:
Steve Faulkner 2019-07-16 14:38:48 -05:00
Родитель 1d3a355bc2 5cb1628114
Коммит c6640b59db
6 изменённых файлов: 21 добавлений и 16 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -272,4 +272,4 @@ test/**/*.js
test/**/*.js.map
test/**/*.d.ts
tsconfig.tsbuildinfo
.env
.env

1
.vscode/launch.json поставляемый
Просмотреть файл

@ -36,6 +36,7 @@
"request": "launch",
"name": "Debug file",
"program": "${file}",
"cwd": "${fileDirname}",
"env": {
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}

1
PoliCheckExclusions.txt Normal file
Просмотреть файл

@ -0,0 +1 @@
package-lock.json

Просмотреть файл

@ -3,7 +3,7 @@
This project provides JavaScript & Node.js SDK library for [SQL API](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sql-query) of [Azure Cosmos
Database Service](https://azure.microsoft.com/en-us/services/cosmos-db/). This project also includes samples, tools, and utilities.
[![latest npm badge](https://img.shields.io/npm/v/%40azure%2Fcosmos/latest.svg)](https://www.npmjs.com/package/@azure/cosmos) [![Build Status](https://travis-ci.org/Azure/azure-cosmos-js.svg?branch=master)](https://travis-ci.org/Azure/azure-cosmos-js) [![Build Status](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_apis/build/status/azure-cosmos-js-Emulator)](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build/latest?definitionId=1)
[![latest npm badge](https://img.shields.io/npm/v/%40azure%2Fcosmos/latest.svg)](https://www.npmjs.com/package/@azure/cosmos) [![Build Status](https://travis-ci.org/Azure/azure-cosmos-js.svg?branch=master)](https://travis-ci.org/Azure/azure-cosmos-js) [![Build Status](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_apis/build/status/azure-cosmos-js-Emulator?branchName=master)](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build/latest?definitionId=1&branchName=master)
```js
// JavaScript
@ -37,6 +37,13 @@ helloCosmos().catch(err => {
});
```
## Install via NPM
You can install the npm package using the following command:
```bash
npm install @azure/cosmos
```
## Useful links
- [Welcome to Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/cosmos-db/community)

8
package-lock.json сгенерированный
Просмотреть файл

@ -468,12 +468,6 @@
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
"dev": true
},
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==",
"dev": true
},
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@ -1480,6 +1474,7 @@
"resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
"integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
"dev": true,
"optional": true,
"requires": {
"array-unique": "^0.3.2",
"define-property": "^1.0.0",
@ -1496,6 +1491,7 @@
"resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
"integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
"dev": true,
"optional": true,
"requires": {
"is-descriptor": "^1.0.0"
}

Просмотреть файл

@ -1,9 +1,9 @@
import assert from "assert";
import { Constants, CosmosClient } from "../../dist-esm";
import { Constants, CosmosClient } from "../..";
import { endpoint, masterKey } from "../common/_testConfig";
import { getTestContainer, removeAllDatabases } from "../common/TestHelpers";
import { getEntropy, getTestContainer, removeAllDatabases } from "../common/TestHelpers";
const client = new CosmosClient({ endpoint, key: masterKey });
const client = new CosmosClient({ endpoint, auth: { masterKey } });
const validateOfferResponseBody = function(offer: any) {
assert(offer.id, "Id cannot be null");
@ -41,7 +41,7 @@ describe("NodeJS CRUD Tests", function() {
);
assert.equal(collectionSize, 10 * mbInBytes, "Collection size is unexpected");
const { resources: offers } = await client.offers.readAll().fetchAll();
const { result: offers } = await client.offers.readAll().toArray();
assert.equal(offers.length, 1);
const expectedOffer = offers[0];
assert.equal(
@ -52,7 +52,7 @@ describe("NodeJS CRUD Tests", function() {
validateOfferResponseBody(expectedOffer);
// Read the offer
const { resource: readOffer } = await client.offer(expectedOffer.id).read();
const { body: readOffer } = await client.offer(expectedOffer.id).read();
validateOfferResponseBody(readOffer);
// Check if the read offer is what we expected.
assert.equal(expectedOffer.id, readOffer.id);
@ -70,7 +70,7 @@ describe("NodeJS CRUD Tests", function() {
}
]
};
const { resources: offers2 } = await client.offers.query(querySpec).fetchAll();
const { result: offers2 } = await client.offers.query(querySpec).toArray();
assert.equal(offers2.length, 1);
const oneOffer = offers2[0];
validateOfferResponseBody(oneOffer);
@ -88,7 +88,7 @@ describe("NodeJS CRUD Tests", function() {
it("nativeApi Should do offer replace operations successfully name based", async function() {
const container = await getTestContainer("Validate Offer CRUD");
const { resources: offers } = await client.offers.readAll().fetchAll();
const { result: offers } = await client.offers.readAll().toArray();
assert.equal(offers.length, 1);
const expectedOffer = offers[0];
validateOfferResponseBody(expectedOffer);
@ -96,7 +96,7 @@ describe("NodeJS CRUD Tests", function() {
const offerToReplace = Object.assign({}, expectedOffer);
const oldThroughput = offerToReplace.content.offerThroughput;
offerToReplace.content.offerThroughput = oldThroughput + 100;
const { resource: replacedOffer } = await client.offer(offerToReplace.id).replace(offerToReplace);
const { body: replacedOffer } = await client.offer(offerToReplace.id).replace(offerToReplace);
validateOfferResponseBody(replacedOffer);
// Check if the replaced offer is what we expect.
assert.equal(replacedOffer.id, offerToReplace.id);