diff --git a/sdk/cosmosdb/cosmos/package.json b/sdk/cosmosdb/cosmos/package.json index 45d396b2fcb9..bc307608fe16 100644 --- a/sdk/cosmosdb/cosmos/package.json +++ b/sdk/cosmosdb/cosmos/package.json @@ -48,14 +48,14 @@ "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:samples": "node prep-samples.js && tsc -b samples", "build:src": "echo Using TypeScript && tsc --version && tsc -b --pretty", - "build:test": "tsc -b src test --verbose", + "build:test": "tsc", "build:types": "downlevel-dts dist/types/latest dist/types/3.1", - "build": "npm run clean && tslint --project ./src/tsconfig.json && npm run extract-api && npm run build:types && node writeSDKVersion.js && npm run bundle", + "build": "npm run clean && npm run lint && npm run extract-api && npm run build:types && node writeSDKVersion.js && npm run bundle", "bundle": "rollup -c", "bundle-types": "node bundle-types.js", "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm temp types *.tgz *.html *.log *.tsbuildinfo test/**/*.{js,js.map,d.ts}", - "docs": "typedoc --tsconfig ./src/tsconfig.json --excludePrivate --mode file --out ./dist/docs ./src", + "docs": "typedoc --excludePrivate --mode file --out ./dist/docs ./src", "execute:samples": " cd samples && npm run all-samples", "extract-api": "npm run build:src && api-extractor run --local", "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", @@ -66,10 +66,10 @@ "lint": "eslint package.json tsconfig.json src test samples --ext .ts -f html -o cosmos-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", - "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:browser": "npm run unit-test:browser && npm run integration-test:browser", "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", "test-consumer": "node consumer-test.js 2>&1", - "test": "npm run build:test && npm run unit-test && npm run integration-test", + "test": "npm run unit-test && npm run integration-test", "test:signoff": "mocha -r esm -r dotenv/config -r ./test/common/setup.js \"./test/**/*.spec.js\" --timeout 100000 --grep \"#nosignoff\" --invert", "unit-test:browser": "echo skipped", "unit-test:node": "echo skipped", diff --git a/sdk/cosmosdb/cosmos/src/tsconfig.json b/sdk/cosmosdb/cosmos/src/tsconfig.json deleted file mode 100644 index 9c53832ba041..000000000000 --- a/sdk/cosmosdb/cosmos/src/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "declarationMap": true, - "module": "esnext", - "moduleResolution": "node", - "importHelpers": true, - "noImplicitAny": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "../dist-esm", - "preserveConstEnums": true, - "removeComments": false, - "target": "es6", - "sourceMap": true, - "inlineSources": true, - "newLine": "LF", - "resolveJsonModule": true, - "composite": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "stripInternal": true - }, - "include": ["./**/*"] -} diff --git a/sdk/cosmosdb/cosmos/test/common/TestHelpers.ts b/sdk/cosmosdb/cosmos/test/common/TestHelpers.ts index be08b6788aee..e595a0376162 100644 --- a/sdk/cosmosdb/cosmos/test/common/TestHelpers.ts +++ b/sdk/cosmosdb/cosmos/test/common/TestHelpers.ts @@ -8,18 +8,12 @@ import { DatabaseDefinition, RequestOptions, Response -} from "../../dist-esm"; -import { - ItemDefinition, - ItemResponse, - PermissionResponse, - Resource, - User -} from "../../dist-esm/client"; -import { UserResponse } from "../../dist-esm/client/User/UserResponse"; +} from "../../src"; +import { ItemDefinition, ItemResponse, PermissionResponse, Resource, User } from "../../src/client"; +import { UserResponse } from "../../src/client/User/UserResponse"; import { endpoint, masterKey } from "./_testConfig"; -import { DatabaseRequest } from "../../dist-esm/client/Database/DatabaseRequest"; -import { ContainerRequest } from "../../dist-esm/client/Container/ContainerRequest"; +import { DatabaseRequest } from "../../src/client/Database/DatabaseRequest"; +import { ContainerRequest } from "../../src/client/Container/ContainerRequest"; const defaultClient = new CosmosClient({ endpoint, key: masterKey }); diff --git a/sdk/cosmosdb/cosmos/test/functional/authorization.spec.ts b/sdk/cosmosdb/cosmos/test/functional/authorization.spec.ts index 6ca457f0e2d2..1b9ab6cabe58 100644 --- a/sdk/cosmosdb/cosmos/test/functional/authorization.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/authorization.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient, PermissionMode } from "../../dist-esm"; -import { PermissionDefinition } from "../../dist-esm/client"; +import { CosmosClient, PermissionMode } from "../../src"; +import { PermissionDefinition } from "../../src/client"; import { endpoint, masterKey } from "../common/_testConfig"; import { createOrUpsertPermission, diff --git a/sdk/cosmosdb/cosmos/test/functional/client.spec.ts b/sdk/cosmosdb/cosmos/test/functional/client.spec.ts index ce755fbbba38..9fa32dfdbbd9 100644 --- a/sdk/cosmosdb/cosmos/test/functional/client.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/client.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import assert from "assert"; import { Agent } from "http"; -import { CosmosClient } from "../../dist-esm"; +import { CosmosClient } from "../../src"; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestDatabase, diff --git a/sdk/cosmosdb/cosmos/test/functional/container.spec.ts b/sdk/cosmosdb/cosmos/test/functional/container.spec.ts index e7dd814a3d75..02ca476146fd 100644 --- a/sdk/cosmosdb/cosmos/test/functional/container.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/container.spec.ts @@ -1,18 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Constants } from "../../dist-esm"; -import { ContainerDefinition, Database, Container } from "../../dist-esm/client"; -import { ContainerRequest } from "../../dist-esm/client/Container/ContainerRequest"; +import { Constants } from "../../src"; +import { ContainerDefinition, Database, Container } from "../../src/client"; +import { ContainerRequest } from "../../src/client/Container/ContainerRequest"; import { DataType, IndexedPath, IndexingMode, IndexingPolicy, IndexKind -} from "../../dist-esm/documents"; -import { SpatialType } from "../../dist-esm/documents/IndexingPolicy"; -import { GeospatialType } from "../../dist-esm/documents/GeospatialType"; +} from "../../src/documents"; +import { SpatialType } from "../../src/documents/IndexingPolicy"; +import { GeospatialType } from "../../src/documents/GeospatialType"; import { getTestDatabase, removeAllDatabases, getTestContainer } from "../common/TestHelpers"; describe("Containers", function() { diff --git a/sdk/cosmosdb/cosmos/test/functional/database.spec.ts b/sdk/cosmosdb/cosmos/test/functional/database.spec.ts index 992f180c9b27..0b2316f29db8 100644 --- a/sdk/cosmosdb/cosmos/test/functional/database.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/database.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient, DatabaseDefinition, Database } from "../../dist-esm"; +import { CosmosClient, DatabaseDefinition, Database } from "../../src/index"; import { endpoint, masterKey } from "../common/_testConfig"; import { addEntropy, removeAllDatabases, getTestDatabase } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/functional/databaseaccount.spec.ts b/sdk/cosmosdb/cosmos/test/functional/databaseaccount.spec.ts index e9239680f1d5..ff6e6ab31be4 100644 --- a/sdk/cosmosdb/cosmos/test/functional/databaseaccount.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/databaseaccount.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient } from "../../dist-esm"; +import { CosmosClient } from "../../src"; import { endpoint, masterKey } from "../common/_testConfig"; const client = new CosmosClient({ endpoint, key: masterKey }); diff --git a/sdk/cosmosdb/cosmos/test/functional/globalEndpointManager.spec.ts b/sdk/cosmosdb/cosmos/test/functional/globalEndpointManager.spec.ts index ed6eadbdd3cf..14dac2f2e100 100644 --- a/sdk/cosmosdb/cosmos/test/functional/globalEndpointManager.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/globalEndpointManager.spec.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { DatabaseAccount, ResourceResponse, RequestOptions } from "../../dist-esm"; +import { DatabaseAccount, ResourceResponse, RequestOptions } from "../../src"; import { masterKey } from "../common/_testConfig"; -import { GlobalEndpointManager } from "../../dist-esm/globalEndpointManager"; -import { OperationType, ResourceType } from "../../dist-esm/common"; +import { GlobalEndpointManager } from "../../src/globalEndpointManager"; +import { OperationType, ResourceType } from "../../src/common"; import assert from "assert"; diff --git a/sdk/cosmosdb/cosmos/test/functional/item.spec.ts b/sdk/cosmosdb/cosmos/test/functional/item.spec.ts index 29785eebf3d8..b577d363cde2 100644 --- a/sdk/cosmosdb/cosmos/test/functional/item.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/item.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Container } from "../../dist-esm"; -import { ItemDefinition } from "../../dist-esm/client"; +import { Container } from "../../src"; +import { ItemDefinition } from "../../src/client"; import { bulkDeleteItems, bulkInsertItems, diff --git a/sdk/cosmosdb/cosmos/test/functional/npcontainer.spec.ts b/sdk/cosmosdb/cosmos/test/functional/npcontainer.spec.ts index 201e02de04e3..8c8eca8081f4 100644 --- a/sdk/cosmosdb/cosmos/test/functional/npcontainer.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/npcontainer.spec.ts @@ -1,16 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { - CosmosClient, - Constants, - Container, - PluginConfig, - CosmosClientOptions -} from "../../dist-esm"; +import { CosmosClient, Constants, Container, PluginConfig, CosmosClientOptions } from "../../src"; import { removeAllDatabases, getTestContainer } from "../common/TestHelpers"; import { endpoint, masterKey } from "../common/_testConfig"; -import { ResourceType, HTTPMethod, StatusCodes } from "../../dist-esm/common"; +import { ResourceType, HTTPMethod, StatusCodes } from "../../src/common"; const plugins: PluginConfig[] = [ { diff --git a/sdk/cosmosdb/cosmos/test/functional/offer.spec.ts b/sdk/cosmosdb/cosmos/test/functional/offer.spec.ts index 22f0e6f4d36f..d1c72edfa9a3 100644 --- a/sdk/cosmosdb/cosmos/test/functional/offer.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/offer.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Constants, CosmosClient } from "../../dist-esm"; +import { Constants, CosmosClient } from "../../src"; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/functional/permission.spec.ts b/sdk/cosmosdb/cosmos/test/functional/permission.spec.ts index bfec16e9a09e..89c7e7a5d234 100644 --- a/sdk/cosmosdb/cosmos/test/functional/permission.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/permission.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { PermissionMode } from "../../dist-esm"; -import { PermissionDefinition } from "../../dist-esm/client"; +import { PermissionMode } from "../../src"; +import { PermissionDefinition } from "../../src/client"; import { createOrUpsertPermission, getTestContainer, diff --git a/sdk/cosmosdb/cosmos/test/functional/plugin.spec.ts b/sdk/cosmosdb/cosmos/test/functional/plugin.spec.ts index 3ec860f302cc..eb14fe153b25 100644 --- a/sdk/cosmosdb/cosmos/test/functional/plugin.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/plugin.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { CosmosClient, CosmosClientOptions } from "../../dist-esm"; -import { RequestContext } from "../../dist-esm/request/RequestContext"; -import { Plugin, Next, PluginConfig } from "../../dist-esm/plugins/Plugin"; +import { CosmosClient, CosmosClientOptions } from "../../src"; +import { RequestContext } from "../../src/request/RequestContext"; +import { Plugin, Next, PluginConfig } from "../../src/plugins/Plugin"; import * as assert from "assert"; diff --git a/sdk/cosmosdb/cosmos/test/functional/query.spec.ts b/sdk/cosmosdb/cosmos/test/functional/query.spec.ts index 7de886279fb9..fb2f3525954d 100644 --- a/sdk/cosmosdb/cosmos/test/functional/query.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/query.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient } from "../../dist-esm"; -import { Container } from "../../dist-esm/client"; +import { CosmosClient } from "../../src"; +import { Container } from "../../src/client"; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestContainer, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/functional/spatial.spec.ts b/sdk/cosmosdb/cosmos/test/functional/spatial.spec.ts index b3b578956ff8..42a0a9fb7287 100644 --- a/sdk/cosmosdb/cosmos/test/functional/spatial.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/spatial.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Database, DataType, IndexKind } from "../../dist-esm"; +import { Database, DataType, IndexKind } from "../../src"; import { createOrUpsertItem, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; describe("Spatial Indexes", function() { diff --git a/sdk/cosmosdb/cosmos/test/functional/sproc.spec.ts b/sdk/cosmosdb/cosmos/test/functional/sproc.spec.ts index 5a3467c58fb7..581b10788e93 100644 --- a/sdk/cosmosdb/cosmos/test/functional/sproc.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/sproc.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Constants } from "../../dist-esm"; -import { Container, StoredProcedureDefinition } from "../../dist-esm/client"; +import { Constants } from "../../src"; +import { Container, StoredProcedureDefinition } from "../../src/client"; import { bulkInsertItems, getTestContainer, diff --git a/sdk/cosmosdb/cosmos/test/functional/trigger.spec.ts b/sdk/cosmosdb/cosmos/test/functional/trigger.spec.ts index fdd23fa8babf..c02c023b0ab1 100644 --- a/sdk/cosmosdb/cosmos/test/functional/trigger.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/trigger.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { TriggerOperation, TriggerType } from "../../dist-esm"; -import { TriggerDefinition, Container } from "../../dist-esm/client"; +import { TriggerOperation, TriggerType } from "../../src"; +import { TriggerDefinition, Container } from "../../src/client"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; const notFoundErrorCode = 404; diff --git a/sdk/cosmosdb/cosmos/test/functional/ttl.spec.ts b/sdk/cosmosdb/cosmos/test/functional/ttl.spec.ts index 11fc65a58bbd..ebba4f4496d4 100644 --- a/sdk/cosmosdb/cosmos/test/functional/ttl.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/ttl.spec.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Container, ContainerDefinition, Database } from "../../dist-esm/client"; +import { Container, ContainerDefinition, Database } from "../../src/client"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; -import { StatusCodes } from "../../dist-esm"; +import { StatusCodes } from "../../src"; async function sleep(time: number) { return new Promise((resolve) => { diff --git a/sdk/cosmosdb/cosmos/test/functional/udf.spec.ts b/sdk/cosmosdb/cosmos/test/functional/udf.spec.ts index 6ea87ef813c8..ec8ce9b38081 100644 --- a/sdk/cosmosdb/cosmos/test/functional/udf.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/udf.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { UserDefinedFunctionDefinition, Container } from "../../dist-esm/client"; +import { UserDefinedFunctionDefinition, Container } from "../../src/client"; import { removeAllDatabases, getTestContainer } from "../common/TestHelpers"; describe("User Defined Function", function() { diff --git a/sdk/cosmosdb/cosmos/test/functional/user.spec.ts b/sdk/cosmosdb/cosmos/test/functional/user.spec.ts index 518ad8b08790..f5f7dd0dddd3 100644 --- a/sdk/cosmosdb/cosmos/test/functional/user.spec.ts +++ b/sdk/cosmosdb/cosmos/test/functional/user.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { UserDefinition } from "../../dist-esm/client"; +import { UserDefinition } from "../../src/client"; import { createOrUpsertUser, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; describe("NodeJS CRUD Tests", function() { diff --git a/sdk/cosmosdb/cosmos/test/integration/aggregateQuery.spec.ts b/sdk/cosmosdb/cosmos/test/integration/aggregateQuery.spec.ts index 5b66d1d5e132..fad6b8a9ac83 100644 --- a/sdk/cosmosdb/cosmos/test/integration/aggregateQuery.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/aggregateQuery.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Container, ContainerDefinition } from "../../dist-esm/client"; -import { DataType, IndexKind } from "../../dist-esm/documents"; -import { QueryIterator } from "../../dist-esm/index"; -import { SqlQuerySpec } from "../../dist-esm/queryExecutionContext"; -import { FeedOptions } from "../../dist-esm/request"; +import { Container, ContainerDefinition } from "../../src/client"; +import { DataType, IndexKind } from "../../src/documents"; +import { QueryIterator } from "../../src/index"; +import { SqlQuerySpec } from "../../src/queryExecutionContext"; +import { FeedOptions } from "../../src/request"; import { TestData } from "../common/TestData"; import { bulkInsertItems, getTestContainer, removeAllDatabases } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/integration/aggregates/groupBy.spec.ts b/sdk/cosmosdb/cosmos/test/integration/aggregates/groupBy.spec.ts index d44784e577ac..f5185e9b026c 100644 --- a/sdk/cosmosdb/cosmos/test/integration/aggregates/groupBy.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/aggregates/groupBy.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { Container, ContainerDefinition } from "../../../dist-esm/client"; +import { Container, ContainerDefinition } from "../../../src/client"; import { bulkInsertItems, getTestContainer, removeAllDatabases } from "../../common/TestHelpers"; import snapshot from "snap-shot-it"; import assert from "assert"; diff --git a/sdk/cosmosdb/cosmos/test/integration/authorization.spec.ts b/sdk/cosmosdb/cosmos/test/integration/authorization.spec.ts index 738c232d6140..6caad9331338 100644 --- a/sdk/cosmosdb/cosmos/test/integration/authorization.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/authorization.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Container, CosmosClient, PermissionMode } from "../../dist-esm"; -import { Database } from "../../dist-esm/client"; +import { Container, CosmosClient, PermissionMode } from "../../src"; +import { Database } from "../../src/client"; import { endpoint } from "../common/_testConfig"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/integration/changeFeed.spec.ts b/sdk/cosmosdb/cosmos/test/integration/changeFeed.spec.ts index 0a67a1c1d4b1..aa7440835934 100644 --- a/sdk/cosmosdb/cosmos/test/integration/changeFeed.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/changeFeed.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { RequestOptions } from "../../dist-esm"; -import { Container, ContainerDefinition } from "../../dist-esm/client"; +import { RequestOptions } from "../../src"; +import { Container, ContainerDefinition } from "../../src/client"; import { getTestContainer, removeAllDatabases } from "../common/TestHelpers"; describe("Change Feed Iterator", function() { diff --git a/sdk/cosmosdb/cosmos/test/integration/crossPartition.spec.ts b/sdk/cosmosdb/cosmos/test/integration/crossPartition.spec.ts index ecaba0586503..d27057c8f5b0 100644 --- a/sdk/cosmosdb/cosmos/test/integration/crossPartition.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/crossPartition.spec.ts @@ -2,17 +2,17 @@ // Licensed under the MIT license. import assert from "assert"; import * as util from "util"; -import { Container, ContainerDefinition } from "../../dist-esm/client"; -import { DataType, IndexKind } from "../../dist-esm/documents"; -import { SqlQuerySpec } from "../../dist-esm/queryExecutionContext"; -import { QueryIterator } from "../../dist-esm/queryIterator"; +import { Container, ContainerDefinition } from "../../src/client"; +import { DataType, IndexKind } from "../../src/documents"; +import { SqlQuerySpec } from "../../src/queryExecutionContext"; +import { QueryIterator } from "../../src/queryIterator"; import { bulkInsertItems, getTestContainer, removeAllDatabases, generateDocuments } from "../common/TestHelpers"; -import { FeedResponse, FeedOptions } from "../../dist-esm"; +import { FeedResponse, FeedOptions } from "../../src"; function compare(key: string) { return function(a: any, b: any): number { diff --git a/sdk/cosmosdb/cosmos/test/integration/encoding.spec.ts b/sdk/cosmosdb/cosmos/test/integration/encoding.spec.ts index fb1b0c6899a5..bb539e9ca3e7 100644 --- a/sdk/cosmosdb/cosmos/test/integration/encoding.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/encoding.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { IndexingMode } from "../../dist-esm/documents"; +import { IndexingMode } from "../../src/documents"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; const testDoc = { diff --git a/sdk/cosmosdb/cosmos/test/integration/extractPartitionKey.spec.ts b/sdk/cosmosdb/cosmos/test/integration/extractPartitionKey.spec.ts index e8b9806760c3..a6bccb7a8042 100644 --- a/sdk/cosmosdb/cosmos/test/integration/extractPartitionKey.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/extractPartitionKey.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { extractPartitionKey } from "../../dist-esm/extractPartitionKey"; +import { extractPartitionKey } from "../../src/extractPartitionKey"; describe("extractPartitionKey", function() { describe("With undefined partitionKeyDefinition", function() { diff --git a/sdk/cosmosdb/cosmos/test/integration/failover.spec.ts b/sdk/cosmosdb/cosmos/test/integration/failover.spec.ts index 120ad67e5fee..13f43235a021 100644 --- a/sdk/cosmosdb/cosmos/test/integration/failover.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/failover.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { CosmosClient, PluginOn, CosmosClientOptions, PluginConfig } from "../../dist-esm"; +import { CosmosClient, PluginOn, CosmosClientOptions, PluginConfig } from "../../src"; import { masterKey } from "../common/_testConfig"; import assert from "assert"; diff --git a/sdk/cosmosdb/cosmos/test/integration/multiregion.spec.ts b/sdk/cosmosdb/cosmos/test/integration/multiregion.spec.ts index 33247db8a735..dd7f25e655af 100644 --- a/sdk/cosmosdb/cosmos/test/integration/multiregion.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/multiregion.spec.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient } from "../../dist-esm/CosmosClient"; +import { CosmosClient } from "../../src/CosmosClient"; import { masterKey } from "../common/_testConfig"; -import { PluginOn, PluginConfig, CosmosClientOptions } from "../../dist-esm"; +import { PluginOn, PluginConfig, CosmosClientOptions } from "../../src"; const endpoint = "https://failovertest.documents.azure.com/"; diff --git a/sdk/cosmosdb/cosmos/test/integration/proxy.spec.ts b/sdk/cosmosdb/cosmos/test/integration/proxy.spec.ts index efbbfe2f4f1b..e5c44a54e58e 100644 --- a/sdk/cosmosdb/cosmos/test/integration/proxy.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/proxy.spec.ts @@ -4,7 +4,7 @@ import * as http from "http"; import * as net from "net"; import { URL } from "url"; import ProxyAgent from "proxy-agent"; -import { CosmosClient } from "../../dist-esm/index"; +import { CosmosClient } from "../../src/index"; import { endpoint, masterKey } from "../common/_testConfig"; import { addEntropy } from "../common/TestHelpers"; diff --git a/sdk/cosmosdb/cosmos/test/integration/query.spec.ts b/sdk/cosmosdb/cosmos/test/integration/query.spec.ts index 04ea1d613b80..d0c15acbc2c2 100644 --- a/sdk/cosmosdb/cosmos/test/integration/query.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/query.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { FeedOptions } from "../../dist-esm"; +import { FeedOptions } from "../../src"; import { getTestContainer, getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; const doc = { id: "myId", pk: "pk" }; diff --git a/sdk/cosmosdb/cosmos/test/integration/queryMetrics.spec.ts b/sdk/cosmosdb/cosmos/test/integration/queryMetrics.spec.ts index 1a7a8c397c3d..ef4c3fc76951 100644 --- a/sdk/cosmosdb/cosmos/test/integration/queryMetrics.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/queryMetrics.spec.ts @@ -7,7 +7,7 @@ import { QueryPreparationTimes, RuntimeExecutionTimes, TimeSpan -} from "../../dist-esm/queryMetrics"; +} from "../../src/queryMetrics"; describe("QueryMetrics", function() { // Properties diff --git a/sdk/cosmosdb/cosmos/test/integration/retry.spec.ts b/sdk/cosmosdb/cosmos/test/integration/retry.spec.ts index d39470479041..fa239fecbeba 100644 --- a/sdk/cosmosdb/cosmos/test/integration/retry.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/retry.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. // import assert from "assert"; -// import { ConnectionPolicy, Constants, CosmosClient, RetryOptions } from "../../dist-esm"; -// import * as request from "../../dist-esm/request"; +// import { ConnectionPolicy, Constants, CosmosClient, RetryOptions } from "../../src"; +// import * as request from "../../src/request"; describe("retry policy tests", function() { // this.timeout(300000); diff --git a/sdk/cosmosdb/cosmos/test/integration/session.spec.ts b/sdk/cosmosdb/cosmos/test/integration/session.spec.ts index 339163db006d..ddb2798592a7 100644 --- a/sdk/cosmosdb/cosmos/test/integration/session.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/session.spec.ts @@ -2,16 +2,16 @@ // Licensed under the MIT license. import assert from "assert"; import * as sinon from "sinon"; -import { ClientContext } from "../../dist-esm/ClientContext"; -import { OperationType, ResourceType, trimSlashes } from "../../dist-esm/common"; -import { ConsistencyLevel } from "../../dist-esm/documents"; -import { Constants, CosmosClient } from "../../dist-esm/index"; -import { SessionContainer } from "../../dist-esm/session/sessionContainer"; -import { VectorSessionToken } from "../../dist-esm/session/VectorSessionToken"; +import { ClientContext } from "../../src/ClientContext"; +import { OperationType, ResourceType, trimSlashes } from "../../src/common"; +import { ConsistencyLevel } from "../../src/documents"; +import { Constants, CosmosClient } from "../../src/index"; +import { SessionContainer } from "../../src/session/sessionContainer"; +import { VectorSessionToken } from "../../src/session/VectorSessionToken"; import { endpoint, masterKey } from "../common/_testConfig"; import { getTestDatabase, removeAllDatabases } from "../common/TestHelpers"; -import * as RequestHandler from "../../dist-esm/request/RequestHandler"; -import { RequestContext } from "../../dist-esm/request/RequestContext"; +import * as RequestHandler from "../../src/request/RequestHandler"; +import { RequestContext } from "../../src/request/RequestContext"; // TODO: there is alot of "any" types for tokens here // TODO: there is alot of leaky document client stuff here that will make removing document client hard diff --git a/sdk/cosmosdb/cosmos/test/integration/split.spec.ts b/sdk/cosmosdb/cosmos/test/integration/split.spec.ts index 212bd61210fb..fb7bf1f3e9f7 100644 --- a/sdk/cosmosdb/cosmos/test/integration/split.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/split.spec.ts @@ -1,16 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { Container } from "../../dist-esm/client"; +import { Container } from "../../src/client"; import { bulkInsertItems, getTestContainer, removeAllDatabases } from "../common/TestHelpers"; -import { - Constants, - CosmosClient, - PluginOn, - CosmosClientOptions, - PluginConfig -} from "../../dist-esm"; +import { Constants, CosmosClient, PluginOn, CosmosClientOptions, PluginConfig } from "../../src"; import { masterKey, endpoint } from "../common/_testConfig"; -import { SubStatusCodes } from "../../dist-esm/common"; +import { SubStatusCodes } from "../../src/common"; import assert from "assert"; const splitError = new Error("Fake Partition Split") as any; diff --git a/sdk/cosmosdb/cosmos/test/integration/sslVerification.spec.ts b/sdk/cosmosdb/cosmos/test/integration/sslVerification.spec.ts index f3fb44f5a8e9..c5edeb44ea11 100644 --- a/sdk/cosmosdb/cosmos/test/integration/sslVerification.spec.ts +++ b/sdk/cosmosdb/cosmos/test/integration/sslVerification.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { CosmosClient } from "../../dist-esm"; +import { CosmosClient } from "../../src"; import { getTestDatabase } from "../common/TestHelpers"; import https from "https"; diff --git a/sdk/cosmosdb/cosmos/test/unit/defaultQueryExecutionContext.spec.ts b/sdk/cosmosdb/cosmos/test/unit/defaultQueryExecutionContext.spec.ts index 037d9857293d..915688a51a48 100644 --- a/sdk/cosmosdb/cosmos/test/unit/defaultQueryExecutionContext.spec.ts +++ b/sdk/cosmosdb/cosmos/test/unit/defaultQueryExecutionContext.spec.ts @@ -3,10 +3,10 @@ import { FetchFunctionCallback, DefaultQueryExecutionContext -} from "../../dist-esm/queryExecutionContext"; -import { FeedOptions } from "../../dist-esm"; +} from "../../src/queryExecutionContext"; +import { FeedOptions } from "../../src"; import assert from "assert"; -import { sleep } from "../../dist-esm/common"; +import { sleep } from "../../src/common"; describe("defaultQueryExecutionContext", function() { it("should not buffer items if bufferItems is false", async function() { diff --git a/sdk/cosmosdb/cosmos/test/unit/helper.spec.ts b/sdk/cosmosdb/cosmos/test/unit/helper.spec.ts index 743305179e43..0222f30a0f51 100644 --- a/sdk/cosmosdb/cosmos/test/unit/helper.spec.ts +++ b/sdk/cosmosdb/cosmos/test/unit/helper.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { isResourceValid, parseConnectionString } from "../../dist-esm/common"; +import { isResourceValid, parseConnectionString } from "../../src/common"; describe("Helper methods", function() { describe("isResourceValid Unit Tests", function() { diff --git a/sdk/cosmosdb/cosmos/test/unit/inMemoryCollectionRoutingMap.spec.ts b/sdk/cosmosdb/cosmos/test/unit/inMemoryCollectionRoutingMap.spec.ts index 3b591ec53d39..7c58f73d0c91 100644 --- a/sdk/cosmosdb/cosmos/test/unit/inMemoryCollectionRoutingMap.spec.ts +++ b/sdk/cosmosdb/cosmos/test/unit/inMemoryCollectionRoutingMap.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { QueryRange } from "../../dist-esm/routing"; -import { createCompleteRoutingMap } from "../../dist-esm/routing/CollectionRoutingMapFactory"; +import { QueryRange } from "../../src/routing"; +import { createCompleteRoutingMap } from "../../src/routing/CollectionRoutingMapFactory"; describe("InMemoryCollectionRoutingMap Tests", function() { describe("getOverlappingRanges", function() { diff --git a/sdk/cosmosdb/cosmos/test/unit/sessionContainer.spec.ts b/sdk/cosmosdb/cosmos/test/unit/sessionContainer.spec.ts index b9421f2d5216..a3422925e47e 100644 --- a/sdk/cosmosdb/cosmos/test/unit/sessionContainer.spec.ts +++ b/sdk/cosmosdb/cosmos/test/unit/sessionContainer.spec.ts @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { Constants, OperationType, ResourceType } from "../../dist-esm/common"; -import { CosmosHeaders } from "../../dist-esm/queryExecutionContext/CosmosHeaders"; -import { SessionContainer } from "../../dist-esm/session/sessionContainer"; -import { SessionContext } from "../../dist-esm/session/SessionContext"; +import { Constants, OperationType, ResourceType } from "../../src/common"; +import { CosmosHeaders } from "../../src/queryExecutionContext/CosmosHeaders"; +import { SessionContainer } from "../../src/session/sessionContainer"; +import { SessionContext } from "../../src/session/SessionContext"; describe("SessionContainer", function() { const collectionLink = "dbs/testDatabase/colls/testCollection"; diff --git a/sdk/cosmosdb/cosmos/test/unit/smartRoutingMapProvider.spec.ts b/sdk/cosmosdb/cosmos/test/unit/smartRoutingMapProvider.spec.ts index 28a616a068d1..4a8e0be6ecb3 100644 --- a/sdk/cosmosdb/cosmos/test/unit/smartRoutingMapProvider.spec.ts +++ b/sdk/cosmosdb/cosmos/test/unit/smartRoutingMapProvider.spec.ts @@ -1,12 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import assert from "assert"; -import { ClientContext } from "../../dist-esm/ClientContext"; -import { - PartitionKeyRangeCache, - QueryRange, - SmartRoutingMapProvider -} from "../../dist-esm/routing"; +import { ClientContext } from "../../src/ClientContext"; +import { PartitionKeyRangeCache, QueryRange, SmartRoutingMapProvider } from "../../src/routing"; import { MockedClientContext } from "../common/MockClientContext"; describe("Smart Routing Map Provider OverlappingRanges", function() { diff --git a/sdk/cosmosdb/cosmos/tsconfig.json b/sdk/cosmosdb/cosmos/tsconfig.json index d8c6fc5cde96..ac0425d109e9 100644 --- a/sdk/cosmosdb/cosmos/tsconfig.json +++ b/sdk/cosmosdb/cosmos/tsconfig.json @@ -1,5 +1,26 @@ { - "compilerOptions": {}, - "files": [], - "references": [{ "path": "./src" }, { "path": "./test" }] + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "module": "esnext", + "moduleResolution": "node", + "importHelpers": true, + "noImplicitAny": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist-esm", + "preserveConstEnums": true, + "removeComments": false, + "target": "es6", + "sourceMap": true, + "inlineSources": true, + "newLine": "LF", + "resolveJsonModule": true, + "composite": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "stripInternal": true, + "rootDir": "src" + }, + "include": ["src/**/*"] }