diff --git a/package-lock.json b/package-lock.json index eadf7c9..9104102 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2259,7 +2259,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -2634,7 +2633,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -2647,7 +2645,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -4875,7 +4872,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -6671,7 +6667,6 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -8544,7 +8539,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -8713,7 +8707,6 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" diff --git a/package.json b/package.json index 3f0a828..0332d13 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "dependencies": { "big-integer": "^1.6.32", "binary-search-bounds": "2.0.3", + "create-hmac": "^1.1.7", "int64-buffer": "^0.1.9", "priorityqueuejs": "1.0.0", "semaphore": "1.0.5", diff --git a/src/auth.ts b/src/auth.ts index 5294572..628dbf4 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,4 +1,4 @@ -import * as crypto from "crypto"; +import createHmac from "create-hmac"; import { PermissionDefinition } from "./client"; import { Helper } from "./common"; import { IHeaders } from "./queryExecutionContext"; @@ -95,8 +95,7 @@ export class AuthHandler { "\n"; const body = new Buffer(text, "utf8"); - const signature = crypto - .createHmac("sha256", key) + const signature = createHmac("sha256", key) .update(body) .digest("base64"); const MasterToken = "master"; diff --git a/src/common/resourceId.ts b/src/common/resourceId.ts index 57ad32f..3782dbe 100644 --- a/src/common/resourceId.ts +++ b/src/common/resourceId.ts @@ -1,5 +1,5 @@ // tslint:disable:no-bitwise -import * as BigInt from "big-integer"; +import BigInt from "big-integer"; import { Int64BE } from "int64-buffer"; /** @hidden */ diff --git a/src/queryExecutionContext/documentProducer.ts b/src/queryExecutionContext/documentProducer.ts index 1bbad01..25d723e 100644 --- a/src/queryExecutionContext/documentProducer.ts +++ b/src/queryExecutionContext/documentProducer.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { FetchFunctionCallback, SqlQuerySpec } from "."; import { ClientContext } from "../ClientContext"; import { Constants, Helper, StatusCodes, SubStatusCodes } from "../common"; diff --git a/src/queryExecutionContext/headerUtils.ts b/src/queryExecutionContext/headerUtils.ts index 52d1e32..88cc543 100644 --- a/src/queryExecutionContext/headerUtils.ts +++ b/src/queryExecutionContext/headerUtils.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as util from "util"; import { Constants } from "../common"; import { QueryMetrics } from "../queryMetrics"; diff --git a/src/queryExecutionContext/orderByDocumentProducerComparator.ts b/src/queryExecutionContext/orderByDocumentProducerComparator.ts index ee96edc..4a48078 100644 --- a/src/queryExecutionContext/orderByDocumentProducerComparator.ts +++ b/src/queryExecutionContext/orderByDocumentProducerComparator.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as util from "util"; import { DocumentProducer } from "./documentProducer"; diff --git a/src/queryExecutionContext/parallelQueryExecutionContextBase.ts b/src/queryExecutionContext/parallelQueryExecutionContextBase.ts index 0141f24..06cb4bb 100644 --- a/src/queryExecutionContext/parallelQueryExecutionContextBase.ts +++ b/src/queryExecutionContext/parallelQueryExecutionContextBase.ts @@ -1,7 +1,7 @@ -import * as assert from "assert"; +import assert from "assert"; import * as bs from "binary-search-bounds"; -import * as PriorityQueue from "priorityqueuejs"; -import * as semaphore from "semaphore"; +import PriorityQueue from "priorityqueuejs"; +import semaphore from "semaphore"; import * as util from "util"; import { DocumentProducer, diff --git a/src/queryExecutionContext/partitionedQueryExecutionContextInfoParser.ts b/src/queryExecutionContext/partitionedQueryExecutionContextInfoParser.ts index e7782b1..ab8cc0b 100644 --- a/src/queryExecutionContext/partitionedQueryExecutionContextInfoParser.ts +++ b/src/queryExecutionContext/partitionedQueryExecutionContextInfoParser.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as util from "util"; /** @hidden */ diff --git a/src/queryExecutionContext/proxyQueryExecutionContext.ts b/src/queryExecutionContext/proxyQueryExecutionContext.ts index c394349..8499ae4 100644 --- a/src/queryExecutionContext/proxyQueryExecutionContext.ts +++ b/src/queryExecutionContext/proxyQueryExecutionContext.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { DefaultQueryExecutionContext, FetchFunctionCallback, diff --git a/src/routing/inMemoryCollectionRoutingMap.ts b/src/routing/inMemoryCollectionRoutingMap.ts index 8efd706..a8bc9fb 100644 --- a/src/routing/inMemoryCollectionRoutingMap.ts +++ b/src/routing/inMemoryCollectionRoutingMap.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as bs from "binary-search-bounds"; // TODO: missing types import { Constants } from "../common"; import { Range } from "../range"; diff --git a/src/routing/partitionKeyRangeCache.ts b/src/routing/partitionKeyRangeCache.ts index f3fff9b..ddd9906 100644 --- a/src/routing/partitionKeyRangeCache.ts +++ b/src/routing/partitionKeyRangeCache.ts @@ -1,4 +1,4 @@ -import * as semaphore from "semaphore"; +import semaphore from "semaphore"; import { CollectionRoutingMapFactory, InMemoryCollectionRoutingMap, QueryRange } from "."; import { ClientContext } from "../ClientContext"; import { Helper } from "../common"; diff --git a/src/routing/smartRoutingMapProvider.ts b/src/routing/smartRoutingMapProvider.ts index 3190e2b..2b83905 100644 --- a/src/routing/smartRoutingMapProvider.ts +++ b/src/routing/smartRoutingMapProvider.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { PartitionKeyRangeCache, QueryRange } from "."; import { ClientContext } from "../ClientContext"; import { Constants } from "../common"; diff --git a/src/sessionContainer.ts b/src/sessionContainer.ts index 3b62ab7..e513d74 100644 --- a/src/sessionContainer.ts +++ b/src/sessionContainer.ts @@ -1,4 +1,4 @@ -import * as BigInt from "big-integer"; +import BigInt from "big-integer"; import { Constants, EMPTY, Helper, ResourceId } from "./common"; import { IHeaders } from "./queryExecutionContext"; diff --git a/src/test/common/TestHelpers.ts b/src/test/common/TestHelpers.ts index 17069af..8ea6d8c 100644 --- a/src/test/common/TestHelpers.ts +++ b/src/test/common/TestHelpers.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container, CosmosClient, Database, DatabaseDefinition, Item, RequestOptions, Response } from "../.."; import { ContainerDefinition, diff --git a/src/test/functional/authorization.spec.ts b/src/test/functional/authorization.spec.ts index 664f6bd..a94b9c1 100644 --- a/src/test/functional/authorization.spec.ts +++ b/src/test/functional/authorization.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CosmosClient, DocumentBase } from "../.."; import { PermissionDefinition } from "../../client"; import { endpoint } from "../common/_testConfig"; diff --git a/src/test/functional/client.spec.ts b/src/test/functional/client.spec.ts index 440e1bf..136e335 100644 --- a/src/test/functional/client.spec.ts +++ b/src/test/functional/client.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CosmosClient, DocumentBase } from "../.."; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/container.spec.ts b/src/test/functional/container.spec.ts index fa0e377..99f4025 100644 --- a/src/test/functional/container.spec.ts +++ b/src/test/functional/container.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants, DocumentBase } from "../.."; import { ContainerDefinition, Database } from "../../client"; import { DataType, Index, IndexedPath, IndexingMode, IndexingPolicy, IndexKind } from "../../documents"; diff --git a/src/test/functional/database.spec.ts b/src/test/functional/database.spec.ts index 447768a..b1ed9bc 100644 --- a/src/test/functional/database.spec.ts +++ b/src/test/functional/database.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CosmosClient, DatabaseDefinition } from "../.."; import { endpoint, masterKey } from "../common/_testConfig"; import { addEntropy, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/databaseaccount.spec.ts b/src/test/functional/databaseaccount.spec.ts index bd2b96b..7942f8a 100644 --- a/src/test/functional/databaseaccount.spec.ts +++ b/src/test/functional/databaseaccount.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CosmosClient } from "../.."; import { endpoint, masterKey } from "../common/_testConfig"; import { removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/item.spec.ts b/src/test/functional/item.spec.ts index bc32009..39686fd 100644 --- a/src/test/functional/item.spec.ts +++ b/src/test/functional/item.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container, DocumentBase } from "../.."; import { bulkDeleteItems, diff --git a/src/test/functional/offer.spec.ts.ignore b/src/test/functional/offer.spec.ts.ignore index 20dfd18..6a69be7 100644 --- a/src/test/functional/offer.spec.ts.ignore +++ b/src/test/functional/offer.spec.ts.ignore @@ -2,7 +2,7 @@ -import * as assert from "assert"; +import assert from "assert"; import { Base, Constants, CosmosClient } from "../../"; import testConfig from "./../common/_testConfig"; import { TestHelpers } from "./../common/TestHelpers"; diff --git a/src/test/functional/permission.spec.ts b/src/test/functional/permission.spec.ts index 197540a..1e62399 100644 --- a/src/test/functional/permission.spec.ts +++ b/src/test/functional/permission.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { DocumentBase } from "../.."; import { PermissionDefinition } from "../../client"; import { diff --git a/src/test/functional/query.spec.ts b/src/test/functional/query.spec.ts index 091d372..ec92f1c 100644 --- a/src/test/functional/query.spec.ts +++ b/src/test/functional/query.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants, CosmosClient, DocumentBase } from "../.."; import { Container } from "../../client"; import { endpoint, masterKey } from "../common/_testConfig"; diff --git a/src/test/functional/spatial.spec.ts b/src/test/functional/spatial.spec.ts index 6ba8d5a..fdc6c60 100644 --- a/src/test/functional/spatial.spec.ts +++ b/src/test/functional/spatial.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Database, DocumentBase } from "../.."; import { createOrUpsertItem, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/sproc.spec.ts b/src/test/functional/sproc.spec.ts index 498b307..36c00aa 100644 --- a/src/test/functional/sproc.spec.ts +++ b/src/test/functional/sproc.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants, CosmosClient, DocumentBase } from "../.."; import { Container, StoredProcedureDefinition } from "../../client"; import { bulkInsertItems, getTestContainer, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/trigger.spec.ts b/src/test/functional/trigger.spec.ts index e248456..e3102f0 100644 --- a/src/test/functional/trigger.spec.ts +++ b/src/test/functional/trigger.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { DocumentBase } from "../.."; import { Container, TriggerDefinition } from "../../client"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/ttl.spec.ts b/src/test/functional/ttl.spec.ts index cd9f2c4..be6ffee 100644 --- a/src/test/functional/ttl.spec.ts +++ b/src/test/functional/ttl.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container, ContainerDefinition, Database } from "../../client"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/udf.spec.ts b/src/test/functional/udf.spec.ts index 9a6d218..ddea389 100644 --- a/src/test/functional/udf.spec.ts +++ b/src/test/functional/udf.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container } from "../.."; import { UserDefinedFunctionDefinition } from "../../client"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/functional/user.spec.ts b/src/test/functional/user.spec.ts index adace41..58d8a91 100644 --- a/src/test/functional/user.spec.ts +++ b/src/test/functional/user.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { UserDefinition } from "../../client"; import { createOrUpsertUser, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/integration/aggregateQuery.spec.ts b/src/test/integration/aggregateQuery.spec.ts index 1681ac8..0a31377 100644 --- a/src/test/integration/aggregateQuery.spec.ts +++ b/src/test/integration/aggregateQuery.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as util from "util"; import { QueryIterator } from "../.."; import { Container, ContainerDefinition, Database } from "../../client"; diff --git a/src/test/integration/authorization.spec.ts b/src/test/integration/authorization.spec.ts index 8d3da7e..145cf91 100644 --- a/src/test/integration/authorization.spec.ts +++ b/src/test/integration/authorization.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container, CosmosClient, DocumentBase } from "../.."; import { Database } from "../../client"; import { endpoint } from "../common/_testConfig"; diff --git a/src/test/integration/container.spec.ts b/src/test/integration/container.spec.ts index 77b2185..d182745 100644 --- a/src/test/integration/container.spec.ts +++ b/src/test/integration/container.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Container } from "../../client"; describe("Container", function() { diff --git a/src/test/integration/crossPartition.spec.ts b/src/test/integration/crossPartition.spec.ts index be0d6b9..a1c4537 100644 --- a/src/test/integration/crossPartition.spec.ts +++ b/src/test/integration/crossPartition.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as util from "util"; import { Constants } from "../.."; import { Container, ContainerDefinition } from "../../client"; diff --git a/src/test/integration/encoding.spec.ts b/src/test/integration/encoding.spec.ts index 547425a..25cb0ea 100644 --- a/src/test/integration/encoding.spec.ts +++ b/src/test/integration/encoding.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { IndexingMode } from "../../documents"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/integration/incrementalFeed.spec.ts b/src/test/integration/incrementalFeed.spec.ts index 45aa397..d105b60 100644 --- a/src/test/integration/incrementalFeed.spec.ts +++ b/src/test/integration/incrementalFeed.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { FeedOptions } from "../.."; import { Container } from "../../client"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/integration/query.spec.ts b/src/test/integration/query.spec.ts index 1141ae9..84f697c 100644 --- a/src/test/integration/query.spec.ts +++ b/src/test/integration/query.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants, FeedOptions } from "../.."; import { PartitionKind } from "../../documents"; import { getTestContainer, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/integration/queryMetrics.spec.ts b/src/test/integration/queryMetrics.spec.ts index aa03463..4415400 100644 --- a/src/test/integration/queryMetrics.spec.ts +++ b/src/test/integration/queryMetrics.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants } from "../../common"; import { ClientSideMetrics, diff --git a/src/test/integration/retry.spec.ts b/src/test/integration/retry.spec.ts index 178cae1..6e2fd24 100644 --- a/src/test/integration/retry.spec.ts +++ b/src/test/integration/retry.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { AzureDocuments, Constants, CosmosClient, RetryOptions } from "../.."; import * as request from "../../request"; diff --git a/src/test/integration/ruPerMin.spec.ts b/src/test/integration/ruPerMin.spec.ts index 552426d..54cb5fb 100644 --- a/src/test/integration/ruPerMin.spec.ts +++ b/src/test/integration/ruPerMin.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Constants, CosmosClient, Database } from "../.."; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/src/test/integration/session.spec.ts b/src/test/integration/session.spec.ts index fb47c10..a333157 100644 --- a/src/test/integration/session.spec.ts +++ b/src/test/integration/session.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as sinon from "sinon"; import { Constants, CosmosClient, IHeaders } from "../.."; import { ClientContext } from "../../ClientContext"; diff --git a/src/test/integration/split.spec.ts b/src/test/integration/split.spec.ts index 980cf16..35e34a6 100644 --- a/src/test/integration/split.spec.ts +++ b/src/test/integration/split.spec.ts @@ -1,4 +1,4 @@ -// import * as assert from "assert"; +// import assert from "assert"; // import { execFileSync, spawnSync } from "child_process"; // import * as Stream from "stream"; // import * as _ from "underscore"; diff --git a/src/test/integration/sslVerification.spec.ts b/src/test/integration/sslVerification.spec.ts index c9ee98f..916dda0 100644 --- a/src/test/integration/sslVerification.spec.ts +++ b/src/test/integration/sslVerification.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CosmosClient, DocumentBase } from "../.."; import { getTestDatabase } from "../common/TestHelpers"; diff --git a/src/test/unit/helper.spec.ts b/src/test/unit/helper.spec.ts index 48bc681..d30e881 100644 --- a/src/test/unit/helper.spec.ts +++ b/src/test/unit/helper.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { IHeaders } from "../.."; import { Constants, Helper } from "../../common"; diff --git a/src/test/unit/inMemoryCollectionRoutingMap.spec.ts b/src/test/unit/inMemoryCollectionRoutingMap.spec.ts index fcf2128..e2ab4f2 100644 --- a/src/test/unit/inMemoryCollectionRoutingMap.spec.ts +++ b/src/test/unit/inMemoryCollectionRoutingMap.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { CollectionRoutingMapFactory, InMemoryCollectionRoutingMap, QueryRange } from "../../routing"; describe("InMemoryCollectionRoutingMap Tests", function() { diff --git a/src/test/unit/plaftorm.spec.ts b/src/test/unit/plaftorm.spec.ts index 94bb5f3..f041aae 100644 --- a/src/test/unit/plaftorm.spec.ts +++ b/src/test/unit/plaftorm.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import * as os from "os"; import * as util from "util"; import { Constants } from "../.."; diff --git a/src/test/unit/range.spec.ts b/src/test/unit/range.spec.ts index 3c66b1a..29938ed 100644 --- a/src/test/unit/range.spec.ts +++ b/src/test/unit/range.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Range } from "../../range"; describe("Range Tests", function() { diff --git a/src/test/unit/rangePartitionResolver.spec.ts b/src/test/unit/rangePartitionResolver.spec.ts index 30eb090..751ca1f 100644 --- a/src/test/unit/rangePartitionResolver.spec.ts +++ b/src/test/unit/rangePartitionResolver.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { Range, RangePartitionResolver } from "../../range"; import { CompareFunction } from "../../range"; diff --git a/src/test/unit/sessionContainer.spec.ts b/src/test/unit/sessionContainer.spec.ts index 5e2bd42..5dd30f8 100644 --- a/src/test/unit/sessionContainer.spec.ts +++ b/src/test/unit/sessionContainer.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { ResourceId } from "../../common"; import { SessionContainer } from "../../sessionContainer"; diff --git a/src/test/unit/smartRoutingMapProvider.spec.ts b/src/test/unit/smartRoutingMapProvider.spec.ts index f526d66..6cd0b2a 100644 --- a/src/test/unit/smartRoutingMapProvider.spec.ts +++ b/src/test/unit/smartRoutingMapProvider.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert from "assert"; import { ClientContext } from "../../ClientContext"; import { PartitionKeyRangeCache, QueryRange, SmartRoutingMapProvider } from "../../routing"; import { MockedClientContext } from "../common/MockClientContext"; diff --git a/src/typings/create-hmac.d.ts b/src/typings/create-hmac.d.ts new file mode 100644 index 0000000..b60841a --- /dev/null +++ b/src/typings/create-hmac.d.ts @@ -0,0 +1,7 @@ +/// + +declare module "create-hmac" { + import { createHmac } from "crypto"; + + export = createHmac; +} diff --git a/tsconfig.json b/tsconfig.json index cacee28..3764290 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,8 @@ "module": "commonjs", "moduleResolution": "node", "noImplicitAny": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "outDir": "./lib", "preserveConstEnums": true, "removeComments": false,