mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 19:01:28 +00:00
Compare commits
148 Commits
e2e-test-d
...
languy-res
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a17d71d76e | ||
|
|
732d7ce8fa | ||
|
|
faf2e3b559 | ||
|
|
254c551999 | ||
|
|
f86883de6c | ||
|
|
7e992c2b17 | ||
|
|
21b92ed4f8 | ||
|
|
e5755dff39 | ||
|
|
e48a6a10cb | ||
|
|
62550f8d6a | ||
|
|
184910ee6c | ||
|
|
9253ab1876 | ||
|
|
920c95b614 | ||
|
|
1d98c83be5 | ||
|
|
b85a20cbea | ||
|
|
d0f6923d24 | ||
|
|
ecdc41ada9 | ||
|
|
c1b74266eb | ||
|
|
ef6ecf0a5f | ||
|
|
b241771e69 | ||
|
|
9d63a346e4 | ||
|
|
2e7c7440d3 | ||
|
|
641dae30a1 | ||
|
|
f192310697 | ||
|
|
588c1d3ec3 | ||
|
|
7eb2817acc | ||
|
|
9c28b7f9c5 | ||
|
|
4807169b0c | ||
|
|
d85b6285ac | ||
|
|
9617b80b56 | ||
|
|
1af44fb207 | ||
|
|
9d30dd5d0a | ||
|
|
4eb0dedddb | ||
|
|
c844986c34 | ||
|
|
4e702716bd | ||
|
|
1d2995ef32 | ||
|
|
ee919a68a5 | ||
|
|
2ec9df52aa | ||
|
|
0ed9fe029d | ||
|
|
45af1d7cf9 | ||
|
|
4480a7250d | ||
|
|
69975cd0e8 | ||
|
|
c1141406ff | ||
|
|
acb284eac7 | ||
|
|
498c39c877 | ||
|
|
87e016f03c | ||
|
|
3a1841ad3c | ||
|
|
d314a20b81 | ||
|
|
7188e8d8c2 | ||
|
|
3cd2ec93f2 | ||
|
|
b8e9903287 | ||
|
|
4127d0f522 | ||
|
|
56b5a9861b | ||
|
|
10664162c7 | ||
|
|
cf01ffa957 | ||
|
|
3cc1945140 | ||
|
|
864d9393f2 | ||
|
|
8629bcbe2d | ||
|
|
6c90ef2e62 | ||
|
|
2d2d8b6efe | ||
|
|
7cbf7202b0 | ||
|
|
e8e5eb55cb | ||
|
|
f0c82a430b | ||
|
|
3777b6922e | ||
|
|
aec951694a | ||
|
|
07474b8271 | ||
|
|
e092e5140f | ||
|
|
1f4074f3e8 | ||
|
|
1ec0d9a0be | ||
|
|
eddc334cb5 | ||
|
|
22d8a7a1be | ||
|
|
4210e0752b | ||
|
|
b217d4be1b | ||
|
|
81fd442fad | ||
|
|
87f7dd2230 | ||
|
|
9926fd97a2 | ||
|
|
2a7546e0de | ||
|
|
4b442dd869 | ||
|
|
f0b4737313 | ||
|
|
8dc5ed590a | ||
|
|
afaa844d28 | ||
|
|
3e5a876ef2 | ||
|
|
51abf1560a | ||
|
|
1c0fed88c0 | ||
|
|
93cfd52e36 | ||
|
|
3fd014ddad | ||
|
|
3b6fda4fa5 | ||
|
|
db7c45c9b8 | ||
|
|
4f6b75fe79 | ||
|
|
5038a01079 | ||
|
|
e0063c76d9 | ||
|
|
9278654479 | ||
|
|
59113d7bbf | ||
|
|
88d8200c14 | ||
|
|
6aaddd9c60 | ||
|
|
f8ede0cc1e | ||
|
|
bddb288a89 | ||
|
|
a14d20a88e | ||
|
|
f1db1ed978 | ||
|
|
86a483c3a4 | ||
|
|
263262a040 | ||
|
|
bd4d8da065 | ||
|
|
59ec18cd9b | ||
|
|
49bf8c60db | ||
|
|
b0b973b21a | ||
|
|
3529e80f0d | ||
|
|
a298fd8389 | ||
|
|
1ecc467f60 | ||
|
|
b3cafe3468 | ||
|
|
4be53284b5 | ||
|
|
c1937ca464 | ||
|
|
2b2de7c645 | ||
|
|
8c40df0fa1 | ||
|
|
fcbc9474ea | ||
|
|
81f861af39 | ||
|
|
9afa29cdb6 | ||
|
|
9a1e8b2d87 | ||
|
|
babda4d9cb | ||
|
|
9d20a13dd4 | ||
|
|
3effbe6991 | ||
|
|
af53697ff4 | ||
|
|
b1ad80480e | ||
|
|
9247a6c4a2 | ||
|
|
767d46480e | ||
|
|
2d98c5d269 | ||
|
|
6627172a52 | ||
|
|
19fa5e17a5 | ||
|
|
a4a367a212 | ||
|
|
983c9201bb | ||
|
|
76d7f00a90 | ||
|
|
6490597736 | ||
|
|
229119e697 | ||
|
|
ceefd7c615 | ||
|
|
6e619175c6 | ||
|
|
08e8bf4bcf | ||
|
|
89dc0f394b | ||
|
|
30e0001b7f | ||
|
|
4a8f408112 | ||
|
|
e801364800 | ||
|
|
a55f2d0de9 | ||
|
|
d40b1aa9b5 | ||
|
|
cc63cdc1fd | ||
|
|
c3058ee5a9 | ||
|
|
b000631a0c | ||
|
|
e8f4c8f93c | ||
|
|
16bde97e47 | ||
|
|
6da43ee27b | ||
|
|
ebae484b8f |
@@ -4,6 +4,8 @@ PORTAL_RUNNER_SUBSCRIPTION=
|
|||||||
PORTAL_RUNNER_RESOURCE_GROUP=
|
PORTAL_RUNNER_RESOURCE_GROUP=
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT=
|
PORTAL_RUNNER_DATABASE_ACCOUNT=
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY=
|
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY=
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT=
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY=
|
||||||
PORTAL_RUNNER_CONNECTION_STRING=
|
PORTAL_RUNNER_CONNECTION_STRING=
|
||||||
NOTEBOOKS_TEST_RUNNER_TENANT_ID=
|
NOTEBOOKS_TEST_RUNNER_TENANT_ID=
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_ID=
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID=
|
||||||
|
|||||||
@@ -11,15 +11,9 @@ src/Common/CosmosClient.test.ts
|
|||||||
src/Common/CosmosClient.ts
|
src/Common/CosmosClient.ts
|
||||||
src/Common/DataAccessUtilityBase.test.ts
|
src/Common/DataAccessUtilityBase.test.ts
|
||||||
src/Common/DataAccessUtilityBase.ts
|
src/Common/DataAccessUtilityBase.ts
|
||||||
src/Common/DeleteFeedback.ts
|
|
||||||
src/Common/DocumentClientUtilityBase.ts
|
|
||||||
src/Common/EditableUtility.ts
|
src/Common/EditableUtility.ts
|
||||||
src/Common/HashMap.test.ts
|
src/Common/HashMap.test.ts
|
||||||
src/Common/HashMap.ts
|
src/Common/HashMap.ts
|
||||||
src/Common/HeadersUtility.test.ts
|
|
||||||
src/Common/HeadersUtility.ts
|
|
||||||
src/Common/IteratorUtilities.test.ts
|
|
||||||
src/Common/IteratorUtilities.ts
|
|
||||||
src/Common/Logger.test.ts
|
src/Common/Logger.test.ts
|
||||||
src/Common/MessageHandler.test.ts
|
src/Common/MessageHandler.test.ts
|
||||||
src/Common/MessageHandler.ts
|
src/Common/MessageHandler.ts
|
||||||
@@ -30,7 +24,6 @@ src/Common/ObjectCache.test.ts
|
|||||||
src/Common/ObjectCache.ts
|
src/Common/ObjectCache.ts
|
||||||
src/Common/QueriesClient.ts
|
src/Common/QueriesClient.ts
|
||||||
src/Common/Splitter.ts
|
src/Common/Splitter.ts
|
||||||
src/Common/ThemeUtility.ts
|
|
||||||
src/Common/UrlUtility.ts
|
src/Common/UrlUtility.ts
|
||||||
src/Config.ts
|
src/Config.ts
|
||||||
src/Contracts/ActionContracts.ts
|
src/Contracts/ActionContracts.ts
|
||||||
@@ -42,7 +35,6 @@ src/Contracts/ViewModels.ts
|
|||||||
src/Controls/Heatmap/Heatmap.test.ts
|
src/Controls/Heatmap/Heatmap.test.ts
|
||||||
src/Controls/Heatmap/Heatmap.ts
|
src/Controls/Heatmap/Heatmap.ts
|
||||||
src/Controls/Heatmap/HeatmapDatatypes.ts
|
src/Controls/Heatmap/HeatmapDatatypes.ts
|
||||||
src/Definitions/adal.d.ts
|
|
||||||
src/Definitions/datatables.d.ts
|
src/Definitions/datatables.d.ts
|
||||||
src/Definitions/gif.d.ts
|
src/Definitions/gif.d.ts
|
||||||
src/Definitions/globals.d.ts
|
src/Definitions/globals.d.ts
|
||||||
@@ -59,8 +51,6 @@ src/Explorer/ComponentRegisterer.test.ts
|
|||||||
src/Explorer/ComponentRegisterer.ts
|
src/Explorer/ComponentRegisterer.ts
|
||||||
src/Explorer/ContextMenuButtonFactory.ts
|
src/Explorer/ContextMenuButtonFactory.ts
|
||||||
src/Explorer/Controls/CollapsiblePanel/CollapsiblePanelComponent.ts
|
src/Explorer/Controls/CollapsiblePanel/CollapsiblePanelComponent.ts
|
||||||
src/Explorer/Controls/CommandButton/CommandButton.test.ts
|
|
||||||
src/Explorer/Controls/CommandButton/CommandButton.ts
|
|
||||||
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
|
||||||
src/Explorer/Controls/DynamicList/DynamicList.test.ts
|
src/Explorer/Controls/DynamicList/DynamicList.test.ts
|
||||||
src/Explorer/Controls/DynamicList/DynamicListComponent.ts
|
src/Explorer/Controls/DynamicList/DynamicListComponent.ts
|
||||||
@@ -88,7 +78,7 @@ src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
|
|||||||
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.ts
|
src/Explorer/DataSamples/DataSamplesUtil.ts
|
||||||
src/Explorer/Explorer.ts
|
src/Explorer/Explorer.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts
|
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.test.ts
|
||||||
@@ -96,8 +86,6 @@ src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.ts
|
|||||||
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.ts
|
src/Explorer/Graph/GraphExplorerComponent/GraphData.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphUtil.test.ts
|
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphUtil.ts
|
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.test.ts
|
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.test.ts
|
||||||
@@ -111,7 +99,6 @@ src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts
|
|||||||
src/Explorer/Menus/ContextMenu.ts
|
src/Explorer/Menus/ContextMenu.ts
|
||||||
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
||||||
src/Explorer/Notebook/FileSystemUtil.ts
|
src/Explorer/Notebook/FileSystemUtil.ts
|
||||||
src/Explorer/Notebook/NTeractUtil.ts
|
|
||||||
src/Explorer/Notebook/NotebookClientV2.ts
|
src/Explorer/Notebook/NotebookClientV2.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
||||||
@@ -163,7 +150,7 @@ src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts
|
|||||||
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
||||||
src/Explorer/Panes/UploadFilePane.ts
|
src/Explorer/Panes/UploadFilePane.ts
|
||||||
src/Explorer/Panes/UploadItemsPane.ts
|
src/Explorer/Panes/UploadItemsPane.ts
|
||||||
src/Explorer/SplashScreen/SplashScreenComponentAdapter.test.ts
|
src/Explorer/SplashScreen/SplashScreen.test.ts
|
||||||
src/Explorer/Tables/Constants.ts
|
src/Explorer/Tables/Constants.ts
|
||||||
src/Explorer/Tables/DataTable/CacheBase.ts
|
src/Explorer/Tables/DataTable/CacheBase.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableBindingManager.ts
|
src/Explorer/Tables/DataTable/DataTableBindingManager.ts
|
||||||
@@ -171,7 +158,6 @@ src/Explorer/Tables/DataTable/DataTableBuilder.ts
|
|||||||
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableOperations.ts
|
src/Explorer/Tables/DataTable/DataTableOperations.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableUtilities.ts
|
|
||||||
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
||||||
src/Explorer/Tables/DataTable/TableCommands.ts
|
src/Explorer/Tables/DataTable/TableCommands.ts
|
||||||
src/Explorer/Tables/DataTable/TableEntityCache.ts
|
src/Explorer/Tables/DataTable/TableEntityCache.ts
|
||||||
@@ -180,8 +166,6 @@ src/Explorer/Tables/Entities.ts
|
|||||||
src/Explorer/Tables/QueryBuilder/ClauseGroup.ts
|
src/Explorer/Tables/QueryBuilder/ClauseGroup.ts
|
||||||
src/Explorer/Tables/QueryBuilder/ClauseGroupViewModel.ts
|
src/Explorer/Tables/QueryBuilder/ClauseGroupViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
||||||
src/Explorer/Tables/QueryBuilder/DateTimeUtilities.test.ts
|
|
||||||
src/Explorer/Tables/QueryBuilder/DateTimeUtilities.ts
|
|
||||||
src/Explorer/Tables/QueryBuilder/QueryBuilderViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryBuilderViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/QueryClauseViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryClauseViewModel.ts
|
||||||
src/Explorer/Tables/QueryBuilder/QueryViewModel.ts
|
src/Explorer/Tables/QueryBuilder/QueryViewModel.ts
|
||||||
@@ -201,7 +185,6 @@ src/Explorer/Tabs/QueryTab.test.ts
|
|||||||
src/Explorer/Tabs/QueryTab.ts
|
src/Explorer/Tabs/QueryTab.ts
|
||||||
src/Explorer/Tabs/QueryTablesTab.ts
|
src/Explorer/Tabs/QueryTablesTab.ts
|
||||||
src/Explorer/Tabs/ScriptTabBase.ts
|
src/Explorer/Tabs/ScriptTabBase.ts
|
||||||
src/Explorer/Tabs/SparkMasterTab.ts
|
|
||||||
src/Explorer/Tabs/StoredProcedureTab.ts
|
src/Explorer/Tabs/StoredProcedureTab.ts
|
||||||
src/Explorer/Tabs/TabComponents.ts
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
src/Explorer/Tabs/TabsBase.ts
|
src/Explorer/Tabs/TabsBase.ts
|
||||||
@@ -242,9 +225,6 @@ src/Platform/Hosted/Authorization.ts
|
|||||||
src/Platform/Hosted/DataAccessUtility.ts
|
src/Platform/Hosted/DataAccessUtility.ts
|
||||||
src/Platform/Hosted/ExplorerFactory.ts
|
src/Platform/Hosted/ExplorerFactory.ts
|
||||||
src/Platform/Hosted/Helpers/ConnectionStringParser.test.ts
|
src/Platform/Hosted/Helpers/ConnectionStringParser.test.ts
|
||||||
src/Platform/Hosted/Helpers/ConnectionStringParser.ts
|
|
||||||
src/Platform/Hosted/HostedUtils.test.ts
|
|
||||||
src/Platform/Hosted/HostedUtils.ts
|
|
||||||
src/Platform/Hosted/Main.ts
|
src/Platform/Hosted/Main.ts
|
||||||
src/Platform/Hosted/Maint.test.ts
|
src/Platform/Hosted/Maint.test.ts
|
||||||
src/Platform/Hosted/NotificationsClient.ts
|
src/Platform/Hosted/NotificationsClient.ts
|
||||||
@@ -268,8 +248,6 @@ src/Shared/ExplorerSettings.ts
|
|||||||
src/Shared/PriceEstimateCalculator.ts
|
src/Shared/PriceEstimateCalculator.ts
|
||||||
src/Shared/StorageUtility.test.ts
|
src/Shared/StorageUtility.test.ts
|
||||||
src/Shared/StorageUtility.ts
|
src/Shared/StorageUtility.ts
|
||||||
src/Shared/StringUtility.test.ts
|
|
||||||
src/Shared/StringUtility.ts
|
|
||||||
src/Shared/appInsights.ts
|
src/Shared/appInsights.ts
|
||||||
src/SparkClusterManager/ArcadiaResourceManager.ts
|
src/SparkClusterManager/ArcadiaResourceManager.ts
|
||||||
src/SparkClusterManager/SparkClusterManager.ts
|
src/SparkClusterManager/SparkClusterManager.ts
|
||||||
@@ -278,25 +256,14 @@ src/Terminal/NotebookAppContracts.d.ts
|
|||||||
src/Terminal/index.ts
|
src/Terminal/index.ts
|
||||||
src/TokenProviders/PortalTokenProvider.ts
|
src/TokenProviders/PortalTokenProvider.ts
|
||||||
src/TokenProviders/TokenProviderFactory.ts
|
src/TokenProviders/TokenProviderFactory.ts
|
||||||
src/Utils/AuthorizationUtils.test.ts
|
|
||||||
src/Utils/AuthorizationUtils.ts
|
|
||||||
src/Utils/AutoPilotUtils.test.ts
|
|
||||||
src/Utils/AutoPilotUtils.ts
|
|
||||||
src/Utils/DatabaseAccountUtils.test.ts
|
src/Utils/DatabaseAccountUtils.test.ts
|
||||||
src/Utils/DatabaseAccountUtils.ts
|
src/Utils/DatabaseAccountUtils.ts
|
||||||
src/Utils/JunoUtils.ts
|
|
||||||
src/Utils/MessageValidation.ts
|
|
||||||
src/Utils/NotebookConfigurationUtils.ts
|
|
||||||
src/Utils/PricingUtils.test.ts
|
src/Utils/PricingUtils.test.ts
|
||||||
src/Utils/QueryUtils.test.ts
|
src/Utils/QueryUtils.test.ts
|
||||||
src/Utils/QueryUtils.ts
|
src/Utils/QueryUtils.ts
|
||||||
src/Utils/StringUtils.test.ts
|
|
||||||
src/Utils/StringUtils.ts
|
|
||||||
src/applyExplorerBindings.ts
|
src/applyExplorerBindings.ts
|
||||||
src/global.d.ts
|
src/global.d.ts
|
||||||
src/quickstart.ts
|
|
||||||
src/setupTests.ts
|
src/setupTests.ts
|
||||||
src/workers/upload/definitions.ts
|
|
||||||
src/workers/upload/index.ts
|
src/workers/upload/index.ts
|
||||||
src/Explorer/Controls/AccessibleElement/AccessibleElement.tsx
|
src/Explorer/Controls/AccessibleElement/AccessibleElement.tsx
|
||||||
src/Explorer/Controls/Accordion/AccordionComponent.tsx
|
src/Explorer/Controls/Accordion/AccordionComponent.tsx
|
||||||
@@ -343,15 +310,7 @@ src/Explorer/Graph/GraphExplorerComponent/QueryContainerComponent.tsx
|
|||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNeighborsComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNeighborsComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
||||||
src/Explorer/Menus/CommandBar/CommandBarComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx
|
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
||||||
src/Explorer/Menus/CommandBar/MemoryTrackerComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/ControlBarComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/ControlBarComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponent.test.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponent.tsx
|
|
||||||
src/Explorer/Menus/NavBar/MeControlComponentAdapter.tsx
|
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
|
||||||
@@ -381,8 +340,7 @@ src/Explorer/Notebook/temp/inputs/editor.tsx
|
|||||||
src/Explorer/Notebook/temp/markdown-cell.tsx
|
src/Explorer/Notebook/temp/markdown-cell.tsx
|
||||||
src/Explorer/Notebook/temp/source.tsx
|
src/Explorer/Notebook/temp/source.tsx
|
||||||
src/Explorer/Notebook/temp/syntax-highlighter/index.tsx
|
src/Explorer/Notebook/temp/syntax-highlighter/index.tsx
|
||||||
src/Explorer/SplashScreen/SplashScreenComponent.tsx
|
src/Explorer/SplashScreen/SplashScreen.tsx
|
||||||
src/Explorer/SplashScreen/SplashScreenComponentApdapter.tsx
|
|
||||||
src/Explorer/Tabs/GalleryTab.tsx
|
src/Explorer/Tabs/GalleryTab.tsx
|
||||||
src/Explorer/Tabs/NotebookViewerTab.tsx
|
src/Explorer/Tabs/NotebookViewerTab.tsx
|
||||||
src/Explorer/Tabs/TerminalTab.tsx
|
src/Explorer/Tabs/TerminalTab.tsx
|
||||||
|
|||||||
31
.eslintrc.js
31
.eslintrc.js
@@ -1,41 +1,39 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es6: true
|
es6: true,
|
||||||
},
|
},
|
||||||
plugins: ["@typescript-eslint", "no-null", "prefer-arrow"],
|
plugins: ["@typescript-eslint", "no-null", "prefer-arrow"],
|
||||||
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
||||||
globals: {
|
globals: {
|
||||||
Atomics: "readonly",
|
Atomics: "readonly",
|
||||||
SharedArrayBuffer: "readonly"
|
SharedArrayBuffer: "readonly",
|
||||||
},
|
},
|
||||||
parser: "@typescript-eslint/parser",
|
parser: "@typescript-eslint/parser",
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaFeatures: {
|
ecmaFeatures: {
|
||||||
jsx: true
|
jsx: true,
|
||||||
},
|
},
|
||||||
ecmaVersion: 2018,
|
ecmaVersion: 2018,
|
||||||
sourceType: "module"
|
sourceType: "module",
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["**/*.tsx"],
|
files: ["**/*.tsx"],
|
||||||
env: {
|
extends: ["plugin:react/recommended"], // TODO: Add react-hooks
|
||||||
jest: true
|
plugins: ["react"],
|
||||||
},
|
|
||||||
extends: ["plugin:react/recommended"],
|
|
||||||
plugins: ["react"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
files: ["**/*.{test,spec}.{ts,tsx}"],
|
files: ["**/*.{test,spec}.{ts,tsx}"],
|
||||||
env: {
|
env: {
|
||||||
jest: true
|
jest: true,
|
||||||
},
|
},
|
||||||
extends: ["plugin:jest/recommended"],
|
extends: ["plugin:jest/recommended"],
|
||||||
plugins: ["jest"]
|
plugins: ["jest"],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
"no-console": ["error", { allow: ["error", "warn", "dir"] }],
|
||||||
curly: "error",
|
curly: "error",
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "error",
|
||||||
"@typescript-eslint/no-extraneous-class": "error",
|
"@typescript-eslint/no-extraneous-class": "error",
|
||||||
@@ -43,12 +41,13 @@ module.exports = {
|
|||||||
"@typescript-eslint/no-explicit-any": "error",
|
"@typescript-eslint/no-explicit-any": "error",
|
||||||
"prefer-arrow/prefer-arrow-functions": ["error", { allowStandaloneDeclarations: true }],
|
"prefer-arrow/prefer-arrow-functions": ["error", { allowStandaloneDeclarations: true }],
|
||||||
eqeqeq: "error",
|
eqeqeq: "error",
|
||||||
|
"react/display-name": "off",
|
||||||
"no-restricted-syntax": [
|
"no-restricted-syntax": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
selector: "CallExpression[callee.object.name='JSON'][callee.property.name='stringify'] Identifier[name=/$err/]",
|
selector: "CallExpression[callee.object.name='JSON'][callee.property.name='stringify'] Identifier[name=/$err/]",
|
||||||
message: "Do not use JSON.stringify(error). It will print '{}'"
|
message: "Do not use JSON.stringify(error). It will print '{}'",
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
113
.github/workflows/ci.yml
vendored
113
.github/workflows/ci.yml
vendored
@@ -9,15 +9,29 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
|
codemetrics:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "Log Code Metrics"
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 14.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- run: npm ci
|
||||||
|
- run: node utils/codeMetrics.js
|
||||||
|
env:
|
||||||
|
CODE_METRICS_APP_ID: ${{ secrets.CODE_METRICS_APP_ID }}
|
||||||
compile:
|
compile:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: "Compile TypeScript"
|
name: "Compile TypeScript"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run compile
|
- run: npm run compile
|
||||||
- run: npm run compile:strict
|
- run: npm run compile:strict
|
||||||
@@ -26,10 +40,10 @@ jobs:
|
|||||||
name: "Check Format"
|
name: "Check Format"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run format:check
|
- run: npm run format:check
|
||||||
lint:
|
lint:
|
||||||
@@ -37,10 +51,10 @@ jobs:
|
|||||||
name: "Lint"
|
name: "Lint"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
unittest:
|
unittest:
|
||||||
@@ -48,10 +62,10 @@ jobs:
|
|||||||
name: "Unit Tests"
|
name: "Unit Tests"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run test
|
- run: npm run test
|
||||||
build:
|
build:
|
||||||
@@ -60,10 +74,10 @@ jobs:
|
|||||||
name: "Build"
|
name: "Build"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build:contracts
|
- run: npm run build:contracts
|
||||||
- name: Restore Build Cache
|
- name: Restore Build Cache
|
||||||
@@ -80,27 +94,28 @@ jobs:
|
|||||||
path: dist/
|
path: dist/
|
||||||
endtoendemulator:
|
endtoendemulator:
|
||||||
name: "End To End Emulator Tests"
|
name: "End To End Emulator Tests"
|
||||||
needs: [lint, format, compile, unittest]
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
- uses: southpolesteve/cosmos-emulator-github-action@v1
|
||||||
- name: End to End Tests
|
- name: End to End Tests
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm start &
|
npm start &
|
||||||
npm run wait-for-server
|
npm run wait-for-server
|
||||||
npx jest -c ./jest.config.e2e.js --detectOpenHandles sql
|
npx jest -c ./jest.config.e2e.js --detectOpenHandles test/sql/container.spec.ts
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/explorer.html?platform=Emulator"
|
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/explorer.html?platform=Emulator"
|
||||||
PLATFORM: "Emulator"
|
PLATFORM: "Emulator"
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: screenshots
|
name: screenshots
|
||||||
path: failed-*
|
path: failed-*
|
||||||
@@ -110,10 +125,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js 12.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 14.x
|
||||||
- name: Accessibility Check
|
- name: Accessibility Check
|
||||||
run: |
|
run: |
|
||||||
# Ubuntu gets mad when webpack runs too many files watchers
|
# Ubuntu gets mad when webpack runs too many files watchers
|
||||||
@@ -128,28 +143,17 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
endtoendhosted:
|
endtoendhosted:
|
||||||
name: "End to End Hosted Tests"
|
name: "End to End Tests"
|
||||||
needs: [lint, format, compile, unittest]
|
needs: [cleanupaccounts]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js 12.x
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 12.x
|
|
||||||
- name: End to End Hosted Tests
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npm start &
|
|
||||||
npm run wait-for-server
|
|
||||||
npm run test:e2e
|
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
PORTAL_RUNNER_SUBSCRIPTION: ${{ secrets.PORTAL_RUNNER_SUBSCRIPTION }}
|
PORTAL_RUNNER_SUBSCRIPTION: ${{ secrets.PORTAL_RUNNER_SUBSCRIPTION }}
|
||||||
PORTAL_RUNNER_RESOURCE_GROUP: ${{ secrets.PORTAL_RUNNER_RESOURCE_GROUP }}
|
PORTAL_RUNNER_RESOURCE_GROUP: ${{ secrets.PORTAL_RUNNER_RESOURCE_GROUP }}
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT }}
|
PORTAL_RUNNER_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT }}
|
||||||
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT_KEY }}
|
PORTAL_RUNNER_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_DATABASE_ACCOUNT_KEY }}
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT: ${{ secrets.PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT }}
|
||||||
|
PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY: ${{ secrets.PORTAL_RUNNER_MONGO_DATABASE_ACCOUNT_KEY }}
|
||||||
NOTEBOOKS_TEST_RUNNER_TENANT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_TENANT_ID }}
|
NOTEBOOKS_TEST_RUNNER_TENANT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_TENANT_ID }}
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
||||||
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
||||||
@@ -158,14 +162,53 @@ jobs:
|
|||||||
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
|
CASSANDRA_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_CASSANDRA }}
|
||||||
TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
|
TABLES_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_TABLE }}
|
||||||
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/hostedExplorer.html"
|
DATA_EXPLORER_ENDPOINT: "https://localhost:1234/hostedExplorer.html"
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
test-file:
|
||||||
|
- ./test/cassandra/container.spec.ts
|
||||||
|
- ./test/mongo/mongoIndexPolicy.spec.ts
|
||||||
|
- ./test/notebooks/uploadAndOpenNotebook.spec.ts
|
||||||
|
- ./test/selfServe/selfServeExample.spec.ts
|
||||||
|
- ./test/sql/container.spec.ts
|
||||||
|
- ./test/sql/resourceToken.spec.ts
|
||||||
|
- ./test/tables/container.spec.ts
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 14.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm start &
|
||||||
|
- run: node utils/cleanupDBs.js
|
||||||
|
- run: npm run wait-for-server
|
||||||
|
- name: ${{ matrix['test-file'] }}
|
||||||
|
run: npx jest -c ./jest.config.e2e.js --detectOpenHandles ${{ matrix['test-file'] }}
|
||||||
|
shell: bash
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: screenshots
|
name: screenshots
|
||||||
path: failed-*
|
path: failed-*
|
||||||
|
cleanupaccounts:
|
||||||
|
name: "Cleanup Test Database Accounts"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_ID: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_ID }}
|
||||||
|
NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET: ${{ secrets.NOTEBOOKS_TEST_RUNNER_CLIENT_SECRET }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 14.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- run: npm ci
|
||||||
|
- run: node utils/cleanupDBs.js
|
||||||
nuget:
|
nuget:
|
||||||
name: Publish Nuget
|
name: Publish Nuget
|
||||||
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
||||||
@@ -181,7 +224,7 @@ jobs:
|
|||||||
- run: cp ./configs/prod.json config.json
|
- run: cp ./configs/prod.json config.json
|
||||||
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
||||||
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
||||||
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
- run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
name: packages
|
name: packages
|
||||||
with:
|
with:
|
||||||
@@ -189,7 +232,7 @@ jobs:
|
|||||||
nugetmpac:
|
nugetmpac:
|
||||||
name: Publish Nuget MPAC
|
name: Publish Nuget MPAC
|
||||||
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
if: github.ref == 'refs/heads/master' || contains(github.ref, 'hotfix/') || contains(github.ref, 'release/')
|
||||||
needs: [lint, format, compile, build, unittest, endtoendemulator, endtoendhosted]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
|
||||||
@@ -206,7 +249,7 @@ jobs:
|
|||||||
- run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec
|
- run: sed -i 's/Azure.Cosmos.DB.Data.Explorer/Azure.Cosmos.DB.Data.Explorer.MPAC/g' DataExplorer.nuspec
|
||||||
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
- run: nuget sources add -Name "ADO" -Source "$NUGET_SOURCE" -UserName "GitHub" -Password "$AZURE_DEVOPS_PAT"
|
||||||
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
- run: nuget pack -Version "2.0.0-github-${GITHUB_SHA}"
|
||||||
- run: nuget push -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
- run: nuget push -SkipDuplicate -Source "$NUGET_SOURCE" -ApiKey Az *.nupkg
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
name: packages
|
name: packages
|
||||||
with:
|
with:
|
||||||
|
|||||||
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -17,5 +17,10 @@
|
|||||||
"test/out/**": true,
|
"test/out/**": true,
|
||||||
"workers/libs/**": true
|
"workers/libs/**": true
|
||||||
},
|
},
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true,
|
||||||
|
"source.organizeImports": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
194
CODING_GUIDELINES.md
Normal file
194
CODING_GUIDELINES.md
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
# Coding Guidelines and Recommendations
|
||||||
|
|
||||||
|
Cosmos Explorer has been under constant development for over 5 years. As a result, there are many different patterns and practices in the codebase. This document serves as a guide to how we write code and helps avoid propagating practices which are no longer preferred. Each requirement in this document is labeled and color-coded to show the relative importance. In order from highest to lowest importance:
|
||||||
|
|
||||||
|
✅ DO this. If you feel you need an exception, engage with the project owners _prior_ to implementation.
|
||||||
|
|
||||||
|
⛔️ DO NOT do this. If you feel you need an exception, engage with the project owners _prior_ to implementation.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD strongly consider this but it is not a requirement. If not following this advice, please comment code with why and proactively begin a discussion as part of the PR process.
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT strongly consider not doing this. If not following this advice, please comment code with why and proactively begin a discussion as part of the PR process.
|
||||||
|
|
||||||
|
💭 YOU MAY consider this advice if appropriate to your situation. Other team members may comment on this as part of PR review, but there is no need to be proactive.
|
||||||
|
|
||||||
|
## Development Environment
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Use VSCode and install the following extensions. This setup will catch most linting/formatting/type errors as you develop:
|
||||||
|
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||||
|
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Use the [GitHub CLI](https://cli.github.com/). It has helpful workflows for submitting PRs as well as for checking out other team member's PRs.
|
||||||
|
- Use Windows, Linux (including WSL), or OSX. We have team members developing on all three environments.
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Maintain cross-platform compatibility when modifying any engineering or build systems
|
||||||
|
|
||||||
|
## Code Formatting
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [Prettier](https://prettier.io/) to format your code
|
||||||
|
- This will occur automatically if using the recommended editor setup
|
||||||
|
- `npm run format` will also format code
|
||||||
|
|
||||||
|
## Linting
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [ESLint](https://eslint.org/) to check for code errors.
|
||||||
|
- This will occur automatically if using the recommended editor setup
|
||||||
|
- `npm run lint` will also check for linting errors
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Consider adding new lint rules.
|
||||||
|
- If you find yourself performing "nits" as part of PR review, consider adding a lint rule that will automatically catch the error in the future
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Disable lint rules
|
||||||
|
- Lint rules exist as guidance and to catch common mistakes
|
||||||
|
- You will find places we disable specific lint rules however it should be exceptional.
|
||||||
|
- If a rule does need to be disabled, prefer disabling a specific line instead of the entire file.
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Add [TSLint](https://palantir.github.io/tslint/) rules
|
||||||
|
- TSLint has been deprecated and is on track to be removed
|
||||||
|
- Always prefer ESLint rules
|
||||||
|
|
||||||
|
## UI Components
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write new components using [React](https://reactjs.org/). We are actively migrating Cosmos Explorer off of [Knockout](https://knockoutjs.com/).
|
||||||
|
- Use [Fluent](https://developer.microsoft.com/en-us/fluentui#/) components.
|
||||||
|
- Fluent components are designed to be highly accessible and composable
|
||||||
|
- Using Fluent allows us to build upon the work of the Fluent team and leads to a lower total cost of ownership for UI code
|
||||||
|
|
||||||
|
### React
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Use pure functional components when no state is required
|
||||||
|
|
||||||
|
💭 YOU MAY
|
||||||
|
|
||||||
|
- Use functional (hooks) or class components
|
||||||
|
- The project contains examples of both
|
||||||
|
- Neither is strongly preferred at this time
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use inheritance for sharing component behavior.
|
||||||
|
- React documentation covers this topic in detail https://reactjs.org/docs/composition-vs-inheritance.html
|
||||||
|
- Suffix your file or component name with "Component"
|
||||||
|
- Even though the code has examples of it, we are ending the practice.
|
||||||
|
|
||||||
|
## Libraries
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Add new libraries to package.json.
|
||||||
|
- Adding libraries may bring in code that explodes the bundled size or attempts to run NodeJS code in the browser
|
||||||
|
- Consult with project owners for help with library selection if one is needed
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use underscore.js
|
||||||
|
- Much of this library is now native to JS and will be automatically transpiled
|
||||||
|
- Use jQuery
|
||||||
|
- Much of this library is not native to the DOM.
|
||||||
|
- We are planning to remove it
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Decrease test coverage
|
||||||
|
- Unit/Functional test coverage is checked as part of the CI process
|
||||||
|
|
||||||
|
### Unit Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Write unit tests for non-UI and utility code.
|
||||||
|
- Write your tests using [Jest](https://jestjs.io/)
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Abstract non-UI and utility code so it can run either the NodeJS or Browser environment
|
||||||
|
|
||||||
|
### Functional(Component) Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Write tests for UI components
|
||||||
|
- Write your tests using [Jest](https://jestjs.io/)
|
||||||
|
- Use either Enzyme or React Testing Library to perform component tests.
|
||||||
|
|
||||||
|
### Mocking
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use Jest's built-in mocking helpers
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write code that does not require mocking
|
||||||
|
- Build components that do not require mocking extremely large or difficult to mock objects (like Explorer.ts). Pass _only_ what you need.
|
||||||
|
|
||||||
|
⛔️ DO NOT
|
||||||
|
|
||||||
|
- Use sinon.js for mocking
|
||||||
|
- Sinon has been deprecated and planned for removal
|
||||||
|
|
||||||
|
### End to End Tests
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Use [Puppeteer](https://developers.google.com/web/tools/puppeteer) and [Jest](https://jestjs.io/)
|
||||||
|
- Write or modify an existing E2E test that covers the primary use case of any major feature.
|
||||||
|
- Use caution. Do not try to cover every case. End to End tests can be slow and brittle.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write tests that use accessible attributes to perform actions. Role, Title, Label, etc
|
||||||
|
- More information https://testing-library.com/docs/queries/about#priority
|
||||||
|
|
||||||
|
⚠️ YOU SHOULD NOT
|
||||||
|
|
||||||
|
- Add test specfic `data-*` attributes to dom elements
|
||||||
|
- This is a common current practice, but one we would like to avoid in the future
|
||||||
|
- End to end tests need to use semantic HTML and accesible attributes to be truely end to end
|
||||||
|
- No user or screen reader actually navigates an app using `data-*` attributes
|
||||||
|
- Add arbitrary time delays to wait for page to render or element to be ready.
|
||||||
|
- All the time delays add up and slow down testing.
|
||||||
|
- Prefer using the framework's "wait for..." functionality.
|
||||||
|
|
||||||
|
### Migrating Knockout to React
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Consult other team members before beginning migration work. There is a significant amount of flux in patterns we are using and it is important we do not propagate incorrect patterns.
|
||||||
|
- Start by converting HTML to JSX: https://magic.reactjs.net/htmltojsx.htm. Add functionality as a second step.
|
||||||
|
|
||||||
|
☑️ YOU SHOULD
|
||||||
|
|
||||||
|
- Write React components that require no dependency on Knockout or observables to trigger rendering.
|
||||||
|
|
||||||
|
## Browser Support
|
||||||
|
|
||||||
|
✅ DO
|
||||||
|
|
||||||
|
- Support all [browsers supported by the Azure Portal](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-supported-browsers-devices)
|
||||||
|
- Support IE11
|
||||||
|
- In practice, this should not need to be considered as part of a normal development workflow
|
||||||
|
- Polyfills and transpilation are already provided by our engineering systems.
|
||||||
|
- This requirement will be removed on March 30th, 2021 when Azure drops IE11 support.
|
||||||
@@ -13,6 +13,7 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
|
|||||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||||
|
|
||||||
## Microsoft Open Source Code of Conduct
|
## Microsoft Open Source Code of Conduct
|
||||||
|
|
||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
@@ -20,33 +21,3 @@ Resources:
|
|||||||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
||||||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||||
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
||||||
|
|
||||||
## Browser support
|
|
||||||
Please make sure to support all modern browsers as well as Internet Explorer 11.
|
|
||||||
For IE support, polyfill is preferred over new usage of lodash or underscore. We already polyfill almost everything by importing babel-polyfill at the top of entry points.
|
|
||||||
|
|
||||||
|
|
||||||
## Coding guidelines, conventions and recommendations
|
|
||||||
### Typescript
|
|
||||||
* Follow this [typescript style guide](https://github.com/excelmicro/typescript) which is based on [airbnb's style guide](https://github.com/airbnb/javascript).
|
|
||||||
* Conventions speficic to this project:
|
|
||||||
- Use double-quotes for string
|
|
||||||
- Don't use `null`, use `undefined`
|
|
||||||
- Pascal case for private static readonly fields
|
|
||||||
- Camel case for classnames in markup
|
|
||||||
* Don't use class unless necessary
|
|
||||||
* Code related to notebooks should be dynamically imported so that it is loaded from a separate bundle only if the account is notebook-enabled. There are already top-level notebook components which are dynamically imported and their dependencies can be statically imported from these files.
|
|
||||||
* Prefer using [Fluent UI controls](https://developer.microsoft.com/en-us/fluentui#/controls/web) over creating your own, in order to maintain consistency and support a11y.
|
|
||||||
|
|
||||||
### React
|
|
||||||
* Prefer using React class components over function components and hooks unless you have a simple component and require no nested functions:
|
|
||||||
* Nested functions may be harder to test independently
|
|
||||||
* Switching from function component to class component later mayb be painful
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
Any PR should not decrease testing coverage.
|
|
||||||
|
|
||||||
## Recommended Tools and VS Code extensions
|
|
||||||
* [Bookmarks](https://github.com/alefragnani/vscode-bookmarks)
|
|
||||||
* [Bracket pair colorizer](https://github.com/CoenraadS/Bracket-Pair-Colorizer-2)
|
|
||||||
* [GitHub Pull Requests and Issues](https://github.com/Microsoft/vscode-pull-request-github)
|
|
||||||
@@ -69,6 +69,10 @@ Jest and Puppeteer are used for end to end browser based tests and are contained
|
|||||||
|
|
||||||
We generally adhere to the release strategy [documented by the Azure SDK Guidelines](https://azure.github.io/azure-sdk/policies_repobranching.html#release-branches). Most releases should happen from the master branch. If master contains commits that cannot be released, you may create a release from a `release/` or `hotfix/` branch. See linked documentation for more details.
|
We generally adhere to the release strategy [documented by the Azure SDK Guidelines](https://azure.github.io/azure-sdk/policies_repobranching.html#release-branches). Most releases should happen from the master branch. If master contains commits that cannot be released, you may create a release from a `release/` or `hotfix/` branch. See linked documentation for more details.
|
||||||
|
|
||||||
|
### Architechture
|
||||||
|
|
||||||
|
[](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFJcbiAgaG9zdGVkKGh0dHBzOi8vY29zbW9zLmF6dXJlLmNvbSlcbiAgcG9ydGFsKFBvcnRhbClcbiAgZW11bGF0b3IoRW11bGF0b3IpXG4gIGFhZFtBQURdXG4gIHJlc291cmNlVG9rZW5bUmVzb3VyY2UgVG9rZW5dXG4gIGNvbm5lY3Rpb25TdHJpbmdbQ29ubmVjdGlvbiBTdHJpbmddXG4gIHBvcnRhbFRva2VuW0VuY3J5cHRlZCBQb3J0YWwgVG9rZW5dXG4gIG1hc3RlcktleVtNYXN0ZXIgS2V5XVxuICBhcm1bQVJNIFJlc291cmNlIFByb3ZpZGVyXVxuICBkYXRhcGxhbmVbRGF0YSBQbGFuZV1cbiAgcHJveHlbUG9ydGFsIEFQSSBQcm94eV1cbiAgc3FsW1NRTF1cbiAgbW9uZ29bTW9uZ29dXG4gIHRhYmxlc1tUYWJsZXNdXG4gIGNhc3NhbmRyYVtDYXNzYW5kcmFdXG4gIGdyYWZbR3JhcGhdXG5cblxuICBlbXVsYXRvciAtLT4gbWFzdGVyS2V5IC0tLS0-IGRhdGFwbGFuZVxuICBwb3J0YWwgLS0-IGFhZFxuICBob3N0ZWQgLS0-IHBvcnRhbFRva2VuICYgcmVzb3VyY2VUb2tlbiAmIGNvbm5lY3Rpb25TdHJpbmcgJiBhYWRcbiAgYWFkIC0tLT4gYXJtXG4gIGFhZCAtLS0-IGRhdGFwbGFuZVxuICBhYWQgLS0tPiBwcm94eVxuICByZXNvdXJjZVRva2VuIC0tLT4gc3FsIC0tPiBkYXRhcGxhbmVcbiAgcG9ydGFsVG9rZW4gLS0tPiBwcm94eVxuICBwcm94eSAtLT4gZGF0YXBsYW5lXG4gIGNvbm5lY3Rpb25TdHJpbmcgLS0-IHNxbCAmIG1vbmdvICYgY2Fzc2FuZHJhICYgZ3JhZiAmIHRhYmxlc1xuICBzcWwgLS0-IGRhdGFwbGFuZVxuICB0YWJsZXMgLS0-IGRhdGFwbGFuZVxuICBtb25nbyAtLT4gcHJveHlcbiAgY2Fzc2FuZHJhIC0tPiBwcm94eVxuICBncmFmIC0tPiBwcm94eVxuXG5cdFx0IiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifSwidXBkYXRlRWRpdG9yIjpmYWxzZX0)
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Please read the [contribution guidelines](./CONTRIBUTING.md).
|
Please read the [contribution guidelines](./CONTRIBUTING.md).
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-react", "@babel/preset-typescript"]
|
presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-react", "@babel/preset-typescript"],
|
||||||
|
plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]],
|
||||||
};
|
};
|
||||||
|
|||||||
7
canvas/README.md
Normal file
7
canvas/README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Why?
|
||||||
|
|
||||||
|
This adds a mock module for `canvas`. Nteract has a ignored require and undeclared dependency on this module. `cavnas` is a server side node module and is not used in browser side code for nteract.
|
||||||
|
|
||||||
|
Installing it locally (`npm install canvas`) will resolve the problem, but it is a native module so it is flaky depending on the system, node version, processor arch, etc. This module provides a simpler, more robust solution.
|
||||||
|
|
||||||
|
Remove this workaround if [this bug](https://github.com/nteract/any-vega/issues/2) ever gets resolved
|
||||||
1
canvas/index.js
Normal file
1
canvas/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = {}
|
||||||
11
canvas/package.json
Normal file
11
canvas/package.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "canvas",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
1963
externals/adal.js
vendored
1963
externals/adal.js
vendored
File diff suppressed because it is too large
Load Diff
3
images/notebook/publish_content.svg
Normal file
3
images/notebook/publish_content.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M7.31449 2.01439L4.00103 5.31963L3.26105 4.57965L7.8407 0L12.4203 4.57965L11.6804 5.31963L8.36691 2.01439V12.8428H7.31449V2.01439ZM13.629 12.8428H14.6814V16H1V12.8428H2.05242V14.9476H13.629V12.8428Z" fill="#0078D4"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 329 B |
@@ -6,6 +6,6 @@ module.exports = {
|
|||||||
slowMo: 55,
|
slowMo: 55,
|
||||||
defaultViewport: null,
|
defaultViewport: null,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
args: ["--disable-web-security"]
|
args: ["--disable-web-security"],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
preset: "jest-puppeteer",
|
preset: "jest-puppeteer",
|
||||||
testMatch: ["<rootDir>/test/**/*.spec.[jt]s?(x)"],
|
testMatch: ["<rootDir>/test/**/*.spec.[jt]s?(x)"],
|
||||||
setupFiles: ["dotenv/config"]
|
setupFiles: ["dotenv/config"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ module.exports = {
|
|||||||
// An object that configures minimum threshold enforcement for coverage results
|
// An object that configures minimum threshold enforcement for coverage results
|
||||||
coverageThreshold: {
|
coverageThreshold: {
|
||||||
global: {
|
global: {
|
||||||
branches: 20,
|
branches: 22,
|
||||||
functions: 24,
|
functions: 28,
|
||||||
lines: 30,
|
lines: 33,
|
||||||
statements: 29.0
|
statements: 31,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Make calling deprecated APIs throw helpful error messages
|
// Make calling deprecated APIs throw helpful error messages
|
||||||
@@ -76,7 +76,7 @@ module.exports = {
|
|||||||
"office-ui-fabric-react/lib/(.*)$": "office-ui-fabric-react/lib-commonjs/$1", // https://github.com/OfficeDev/office-ui-fabric-react/wiki/Fabric-6-Release-Notes
|
"office-ui-fabric-react/lib/(.*)$": "office-ui-fabric-react/lib-commonjs/$1", // https://github.com/OfficeDev/office-ui-fabric-react/wiki/Fabric-6-Release-Notes
|
||||||
"^dnd-core$": "dnd-core/dist/cjs",
|
"^dnd-core$": "dnd-core/dist/cjs",
|
||||||
"^react-dnd$": "react-dnd/dist/cjs",
|
"^react-dnd$": "react-dnd/dist/cjs",
|
||||||
"^react-dnd-html5-backend$": "react-dnd-html5-backend/dist/cjs"
|
"^react-dnd-html5-backend$": "react-dnd-html5-backend/dist/cjs",
|
||||||
},
|
},
|
||||||
|
|
||||||
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||||
@@ -164,11 +164,11 @@ module.exports = {
|
|||||||
// A map from regular expressions to paths to transformers
|
// A map from regular expressions to paths to transformers
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.html?$": "html-loader-jest",
|
"^.+\\.html?$": "html-loader-jest",
|
||||||
"^.+\\.[t|j]sx?$": "babel-jest"
|
"^.+\\.[t|j]sx?$": "babel-jest",
|
||||||
},
|
},
|
||||||
|
|
||||||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
||||||
transformIgnorePatterns: ["/node_modules/", "/externals/"]
|
transformIgnorePatterns: ["/node_modules/", "/externals/"],
|
||||||
|
|
||||||
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
||||||
// unmockedModulePathPatterns: undefined,
|
// unmockedModulePathPatterns: undefined,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: wf_segoe-ui_normal;
|
font-family: wf_segoe-ui_normal;
|
||||||
src: url('../../fonts/segoe-ui/west-european/normal/latest.woff');
|
src: url("../../fonts/segoe-ui/west-european/normal/latest.woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DataExplorerFont: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
@DataExplorerFont: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
||||||
@@ -20,26 +20,26 @@
|
|||||||
COLORS
|
COLORS
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
@AccentMediumHigh: #0058AD;
|
@AccentMediumHigh: #0058ad;
|
||||||
@AccentMedium: #004E87;
|
@AccentMedium: #004e87;
|
||||||
@AccentHigh: #1EBAED;
|
@AccentHigh: #1ebaed;
|
||||||
@AccentExtraHigh: #55B3FF;
|
@AccentExtraHigh: #55b3ff;
|
||||||
@AccentLow: #EDF6FF;
|
@AccentLow: #edf6ff;
|
||||||
@AccentMediumLow: #DDEEFE;
|
@AccentMediumLow: #ddeefe;
|
||||||
@AccentLight: #EEF7FF;
|
@AccentLight: #eef7ff;
|
||||||
@AccentExtra: #DDF0FF;
|
@AccentExtra: #ddf0ff;
|
||||||
|
|
||||||
@SelectionHigh: #B91F26;
|
@SelectionHigh: #b91f26;
|
||||||
@BaseLight: #FFFFFF;
|
@BaseLight: #ffffff;
|
||||||
@BaseDark: #000000;
|
@BaseDark: #000000;
|
||||||
@NotificationLow: #FFF4CE;
|
@NotificationLow: #fff4ce;
|
||||||
@NotificationHigh: #F9E9B0;
|
@NotificationHigh: #f9e9b0;
|
||||||
@Purple1: #8A2DA5;
|
@Purple1: #8a2da5;
|
||||||
@Dirty: #9b4f96;
|
@Dirty: #9b4f96;
|
||||||
|
|
||||||
@BaseLow: #F2F2F2;
|
@BaseLow: #f2f2f2;
|
||||||
@BaseMediumLow: #E6E6E6;
|
@BaseMediumLow: #e6e6e6;
|
||||||
@BaseMedium: #CCCCCC;
|
@BaseMedium: #cccccc;
|
||||||
@BaseMediumHigh: #767676;
|
@BaseMediumHigh: #767676;
|
||||||
@BaseHigh: #393939;
|
@BaseHigh: #393939;
|
||||||
|
|
||||||
@@ -53,10 +53,17 @@
|
|||||||
|
|
||||||
@ErrorColor: @SelectionHigh;
|
@ErrorColor: @SelectionHigh;
|
||||||
|
|
||||||
@SelectionColor: #3074B0;
|
@SelectionColor: #3074b0;
|
||||||
|
|
||||||
@FocusColor: #605e5c;
|
@FocusColor: #605e5c;
|
||||||
|
|
||||||
|
@GalleryBackgroundColor: #fdfdfd;
|
||||||
|
|
||||||
|
//Icons
|
||||||
|
@InfoIconColor: #0072c6;
|
||||||
|
@WarningIconColor: #db7500;
|
||||||
|
@ErrorIconColor: #b91f26;
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
METRICS
|
METRICS
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@@ -165,8 +172,8 @@
|
|||||||
.selectedRadio:hover,
|
.selectedRadio:hover,
|
||||||
.selectedRadio:active,
|
.selectedRadio:active,
|
||||||
.selectedRadio.dirty,
|
.selectedRadio.dirty,
|
||||||
.tab [type=radio]:checked ~ label,
|
.tab [type="radio"]:checked ~ label,
|
||||||
.tab [type=radio]:checked ~ label:hover {
|
.tab [type="radio"]:checked ~ label:hover {
|
||||||
-ms-high-contrast-adjust: none;
|
-ms-high-contrast-adjust: none;
|
||||||
-webkit-text-fill-color: HighlightText;
|
-webkit-text-fill-color: HighlightText;
|
||||||
color: HighlightText;
|
color: HighlightText;
|
||||||
@@ -175,9 +182,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.queryMetricsSummaryTuple {
|
.queryMetricsSummaryTuple {
|
||||||
|
th,
|
||||||
th, td {
|
td {
|
||||||
|
|
||||||
&:nth-child(2) {
|
&:nth-child(2) {
|
||||||
width: @IETableDataWidth;
|
width: @IETableDataWidth;
|
||||||
}
|
}
|
||||||
@@ -272,3 +278,27 @@
|
|||||||
.tooltipVisible() {
|
.tooltipVisible() {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputTooltip() {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltipText(@textColor: @BaseLight, @backgroundColor: @BaseHigh) {
|
||||||
|
background-color: @backgroundColor;
|
||||||
|
color: @textColor;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
padding: @MediumSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltipTextAfter(@color: @BaseDark) {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
right: 100%;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent @color transparent transparent;
|
||||||
|
left: 10px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-color: @InfoPointerColor transparent;
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
:focus {
|
:focus {
|
||||||
.focus()
|
.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ body {
|
|||||||
right: 14px;
|
right: 14px;
|
||||||
border-width: 0 9px 9px;
|
border-width: 0 9px 9px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: #FFF rgba(0, 0, 0, 0);
|
border-color: #fff rgba(0, 0, 0, 0);
|
||||||
display: block;
|
display: block;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,6 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|
||||||
.urlContainer {
|
.urlContainer {
|
||||||
margin-left: @DefaultSpace;
|
margin-left: @DefaultSpace;
|
||||||
|
|
||||||
@@ -179,7 +178,8 @@ body {
|
|||||||
.active();
|
.active();
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus .urlTokenCopyTooltiptext, &:focus .urlTokenCopyTooltiptext {
|
&:focus .urlTokenCopyTooltiptext,
|
||||||
|
&:focus .urlTokenCopyTooltiptext {
|
||||||
.tooltipVisible();
|
.tooltipVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ body {
|
|||||||
|
|
||||||
.shareLink {
|
.shareLink {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
background-color: #FFFFFF;
|
background-color: #ffffff;
|
||||||
border: 1px solid @BaseMedium;
|
border: 1px solid @BaseMedium;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -722,7 +722,8 @@ stored-procedure-tab {
|
|||||||
@ToggleHeight: 30px;
|
@ToggleHeight: 30px;
|
||||||
@ToggleWidth: 180px;
|
@ToggleWidth: 180px;
|
||||||
|
|
||||||
.results-container, .errors-container {
|
.results-container,
|
||||||
|
.errors-container {
|
||||||
padding: @MediumSpace 0px 0px @MediumSpace;
|
padding: @MediumSpace 0px 0px @MediumSpace;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.flex-display();
|
.flex-display();
|
||||||
@@ -934,19 +935,19 @@ menuQuickStart {
|
|||||||
.content {
|
.content {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transition: all .4s ease-in-out;
|
transition: all 0.4s ease-in-out;
|
||||||
-ms-transition: all .4s ease-in-out;
|
-ms-transition: all 0.4s ease-in-out;
|
||||||
-webkit-transition: all .4s ease-in-out;
|
-webkit-transition: all 0.4s ease-in-out;
|
||||||
-moz-transition: all .4s ease-in-out;
|
-moz-transition: all 0.4s ease-in-out;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mini {
|
.mini {
|
||||||
width: 0%;
|
width: 0%;
|
||||||
float: left;
|
float: left;
|
||||||
transition: all .4s ease-in-out;
|
transition: all 0.4s ease-in-out;
|
||||||
-webkit-transition: all .4s ease-in-out;
|
-webkit-transition: all 0.4s ease-in-out;
|
||||||
-moz-transition: all .4s ease-in-out;
|
-moz-transition: all 0.4s ease-in-out;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
@@ -1097,7 +1098,7 @@ menuQuickStart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#tbodycontent > tr > td {
|
#tbodycontent > tr > td {
|
||||||
border-bottom: 1px solid #CCCCCC;
|
border-bottom: 1px solid #cccccc;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
@@ -1205,7 +1206,7 @@ menuQuickStart {
|
|||||||
|
|
||||||
.gridRowSelected:hover {
|
.gridRowSelected:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
.hover()
|
.hover();
|
||||||
}
|
}
|
||||||
|
|
||||||
.gridRowHighlighted {
|
.gridRowHighlighted {
|
||||||
@@ -1240,7 +1241,7 @@ menuQuickStart {
|
|||||||
border-top: 1px solid #eee;
|
border-top: 1px solid #eee;
|
||||||
margin-left: -17px;
|
margin-left: -17px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: 1px solid #53575B;
|
color: 1px solid #53575b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.partitioning-btn {
|
.partitioning-btn {
|
||||||
@@ -1308,7 +1309,7 @@ menuQuickStart {
|
|||||||
|
|
||||||
.collid-white {
|
.collid-white {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: solid 1px #DDD;
|
border: solid 1px #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plusimg-but {
|
.plusimg-but {
|
||||||
@@ -1522,6 +1523,21 @@ p {
|
|||||||
.tooltipVisible();
|
.tooltipVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputTooltip {
|
||||||
|
.inputTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltip .inputTooltipText {
|
||||||
|
top: -68px;
|
||||||
|
.inputTooltipText();
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTooltip .inputTooltipText::after {
|
||||||
|
border-width: @MediumSpace @MediumSpace 0 @MediumSpace;
|
||||||
|
top: 55px;
|
||||||
|
.inputTooltipTextAfter();
|
||||||
|
}
|
||||||
|
|
||||||
.infoTooltip a {
|
.infoTooltip a {
|
||||||
color: @AccentHigh;
|
color: @AccentHigh;
|
||||||
}
|
}
|
||||||
@@ -1631,7 +1647,6 @@ p {
|
|||||||
margin-left: -32px;
|
margin-left: -32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Variant of paddingspan3 without the margins */
|
/* Variant of paddingspan3 without the margins */
|
||||||
|
|
||||||
.contextual-pane .paddingspan3b {
|
.contextual-pane .paddingspan3b {
|
||||||
@@ -1644,7 +1659,7 @@ p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.contextual-pane hr {
|
.contextual-pane hr {
|
||||||
border: 1px solid #53575B;
|
border: 1px solid #53575b;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1694,6 +1709,7 @@ input::-webkit-calendar-picker-indicator {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
max-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contextual-pane .paneErrorDetailsContainer {
|
.contextual-pane .paneErrorDetailsContainer {
|
||||||
@@ -1818,11 +1834,11 @@ label {
|
|||||||
|
|
||||||
.datalist-arrow:focus:after,
|
.datalist-arrow:focus:after,
|
||||||
.datalist-arrow:active:after {
|
.datalist-arrow:active:after {
|
||||||
background: #1EBBEE;
|
background: #1ebbee;
|
||||||
}
|
}
|
||||||
|
|
||||||
input::-webkit-calendar-picker-indicator::after {
|
input::-webkit-calendar-picker-indicator::after {
|
||||||
content: '\276F';
|
content: "\276F";
|
||||||
right: 0;
|
right: 0;
|
||||||
top: -8%;
|
top: -8%;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -1836,7 +1852,7 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.datalist-arrow:after:hover {
|
.datalist-arrow:after:hover {
|
||||||
content: '\276F';
|
content: "\276F";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 1px;
|
right: 1px;
|
||||||
top: 6%;
|
top: 6%;
|
||||||
@@ -1848,7 +1864,7 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background-color: #1EBBEE;
|
background-color: #1ebbee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Introline3 {
|
.Introline3 {
|
||||||
@@ -1912,7 +1928,7 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
|
|
||||||
.nav-tabs-margin {
|
.nav-tabs-margin {
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
background-color: #F2F2F2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navTabHeight {
|
.navTabHeight {
|
||||||
@@ -1978,7 +1994,7 @@ input::-webkit-calendar-picker-indicator::after {
|
|||||||
.atags {
|
.atags {
|
||||||
color: @AccentMediumHigh;
|
color: @AccentMediumHigh;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
cursor: pointer
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.qsmenuicons {
|
.qsmenuicons {
|
||||||
@@ -2083,7 +2099,7 @@ a:link {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2218,7 +2234,7 @@ a:link {
|
|||||||
.documentsGridHeaderContainer {
|
.documentsGridHeaderContainer {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid #CCCCCC;
|
border-bottom: 1px solid #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.documentsGridHeaderContainer > table {
|
.documentsGridHeaderContainer > table {
|
||||||
@@ -2234,7 +2250,7 @@ a:link {
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
border-bottom: 1px solid #CCCCCC !important;
|
border-bottom: 1px solid #cccccc !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2383,7 +2399,7 @@ a:link {
|
|||||||
color: #393939;
|
color: #393939;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio] {
|
.tab [type="radio"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2395,40 +2411,40 @@ a:link {
|
|||||||
padding: @MediumSpace 0px;
|
padding: @MediumSpace 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:checked~label {
|
.tab [type="radio"]:checked ~ label {
|
||||||
border: 1px solid #0072c6;
|
border: 1px solid #0072c6;
|
||||||
background-color: @AccentMediumHigh;
|
background-color: @AccentMediumHigh;
|
||||||
color: white;
|
color: white;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:checked~label:hover {
|
.tab [type="radio"]:checked ~ label:hover {
|
||||||
border: 1px solid @AccentMediumHigh;
|
border: 1px solid @AccentMediumHigh;
|
||||||
background-color: @AccentMediumHigh;
|
background-color: @AccentMediumHigh;
|
||||||
color: white;
|
color: white;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:checked~label:active {
|
.tab [type="radio"]:checked ~ label:active {
|
||||||
border: 1px solid #0072c6;
|
border: 1px solid #0072c6;
|
||||||
background-color: #0072c6;
|
background-color: #0072c6;
|
||||||
color: white;
|
color: white;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:checked~label~.tabcontent {
|
.tab [type="radio"]:checked ~ label ~ .tabcontent {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: initial;
|
display: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:not(:checked)~label:hover {
|
.tab [type="radio"]:not(:checked) ~ label:hover {
|
||||||
border: 1px solid #969696;
|
border: 1px solid #969696;
|
||||||
background-color: #969696;
|
background-color: #969696;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab [type=radio]:not(:checked)~label~.tabcontent {
|
.tab [type="radio"]:not(:checked) ~ label ~ .tabcontent {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2732,7 +2748,7 @@ a:link {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-grow: 1
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabIconSection {
|
.tabIconSection {
|
||||||
@@ -2822,17 +2838,17 @@ a:link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tabCommandDisabled {
|
.tabCommandDisabled {
|
||||||
color: #CCCCCC;
|
color: #cccccc;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
background-color: #FFFFFF;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabCommandDisabled:active {
|
.tabCommandDisabled:active {
|
||||||
border: 1px solid #FFFFFF;
|
border: 1px solid #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabCommandDisabled:hover {
|
.tabCommandDisabled:hover {
|
||||||
background-color: #FFFFFF;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#explorerNotificationConsole {
|
#explorerNotificationConsole {
|
||||||
@@ -2940,13 +2956,13 @@ settings-pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.linkDarkBackground {
|
.linkDarkBackground {
|
||||||
color: @AccentExtraHigh
|
color: @AccentExtraHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.linkDarkBackground:hover,
|
.linkDarkBackground:hover,
|
||||||
.linkDarkBackground:active,
|
.linkDarkBackground:active,
|
||||||
.linkDarkBackground:focus {
|
.linkDarkBackground:focus {
|
||||||
color: @AccentHigh
|
color: @AccentHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.library-add-button {
|
.library-add-button {
|
||||||
@@ -2983,7 +2999,7 @@ settings-pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.enableAnalyticalStorageRadioLabel {
|
.enableAnalyticalStorageRadioLabel {
|
||||||
padding: 0px
|
padding: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2993,18 +3009,18 @@ settings-pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button.enabled {
|
.button.enabled {
|
||||||
background: #FFF;
|
background: #fff;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
color: #323130;
|
color: #323130;
|
||||||
padding: 3px 20px;
|
padding: 3px 20px;
|
||||||
border: 1px solid #8A8886;
|
border: 1px solid #8a8886;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.disabled {
|
.button.disabled {
|
||||||
background: #F3F2F1;
|
background: #f3f2f1;
|
||||||
border: 0px solid #8A8886;
|
border: 0px solid #8a8886;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
color: #A19F9D;
|
color: #a19f9d;
|
||||||
padding: 3px 20px;
|
padding: 3px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3017,13 +3033,55 @@ settings-pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.warningErrorContent a {
|
.warningErrorContent a {
|
||||||
color: @AccentMediumHigh
|
color: @AccentMediumHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.infoBoxContent a {
|
.infoBoxContent a {
|
||||||
color: @AccentMediumHigh
|
color: @AccentMediumHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsibleSection :hover {
|
.collapsibleSection :hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.messageBarInfoIcon {
|
||||||
|
color: @InfoIconColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.messageBarWarningIcon {
|
||||||
|
color: @WarningIconColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInfoBanner {
|
||||||
|
background-color: @BaseLow;
|
||||||
|
display: inline-flex;
|
||||||
|
padding: @DefaultSpace;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.freeTierInfoIcon img {
|
||||||
|
height: 28px;
|
||||||
|
width: 28px;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInfoMessage {
|
||||||
|
margin: auto 0;
|
||||||
|
padding-left: @MediumSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierInlineWarning {
|
||||||
|
display: inline-flex;
|
||||||
|
padding: 8px 8px 8px 0;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.freeTierWarningIcon img {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.freeTierWarningMessage {
|
||||||
|
margin: auto 0;
|
||||||
|
padding-left: @SmallSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
@NavMediumSpace: 10px;
|
@NavMediumSpace: 10px;
|
||||||
@NavLargeSpace: 15px;
|
@NavLargeSpace: 15px;
|
||||||
|
|
||||||
|
.skip-link {
|
||||||
|
position: fixed;
|
||||||
|
top: -200px;
|
||||||
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|||||||
@@ -1,20 +1,13 @@
|
|||||||
@import "./Common/Constants";
|
@import "./Common/Constants";
|
||||||
|
|
||||||
.main {
|
|
||||||
width: 100%;
|
|
||||||
float: left;
|
|
||||||
transition: all .0s ease-in-out;
|
|
||||||
-ms-transition: all 0s ease-in-out;
|
|
||||||
-webkit-transition: all 0s ease-in-out;
|
|
||||||
-moz-transition: all .0s ease-in-out;
|
|
||||||
height: 100%;
|
|
||||||
background-color: white;
|
|
||||||
border-left: 0px solid white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.resourceTree {
|
.resourceTree {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
.main {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
border-right: 1px solid @BaseMedium;
|
||||||
}
|
}
|
||||||
|
|
||||||
.resourceTreeScroll {
|
.resourceTreeScroll {
|
||||||
|
|||||||
31507
package-lock.json
generated
31507
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@@ -6,12 +6,15 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/arm-cosmosdb": "9.1.0",
|
"@azure/arm-cosmosdb": "9.1.0",
|
||||||
"@azure/cosmos": "3.9.0",
|
"@azure/cosmos": "3.9.0",
|
||||||
"@azure/identity": "1.1.0",
|
|
||||||
"@azure/cosmos-language-service": "0.0.5",
|
"@azure/cosmos-language-service": "0.0.5",
|
||||||
"@jupyterlab/services": "6.0.0-rc.2",
|
"@azure/identity": "1.2.1",
|
||||||
"@jupyterlab/terminal": "3.0.0-rc.2",
|
"@azure/ms-rest-nodeauth": "3.0.7",
|
||||||
|
"@babel/plugin-proposal-class-properties": "7.12.1",
|
||||||
|
"@babel/plugin-proposal-decorators": "7.12.12",
|
||||||
|
"@jupyterlab/services": "6.0.2",
|
||||||
|
"@jupyterlab/terminal": "3.0.3",
|
||||||
"@microsoft/applicationinsights-web": "2.5.9",
|
"@microsoft/applicationinsights-web": "2.5.9",
|
||||||
"@nteract/commutable": "7.3.2",
|
"@nteract/commutable": "7.4.2",
|
||||||
"@nteract/connected-components": "6.8.2",
|
"@nteract/connected-components": "6.8.2",
|
||||||
"@nteract/core": "15.1.0",
|
"@nteract/core": "15.1.0",
|
||||||
"@nteract/data-explorer": "8.0.3",
|
"@nteract/data-explorer": "8.0.3",
|
||||||
@@ -36,6 +39,7 @@
|
|||||||
"@nteract/transform-vega": "7.0.6",
|
"@nteract/transform-vega": "7.0.6",
|
||||||
"@octokit/rest": "17.9.2",
|
"@octokit/rest": "17.9.2",
|
||||||
"@phosphor/widgets": "1.9.3",
|
"@phosphor/widgets": "1.9.3",
|
||||||
|
"@testing-library/jest-dom": "5.11.9",
|
||||||
"@types/mkdirp": "1.0.1",
|
"@types/mkdirp": "1.0.1",
|
||||||
"@types/node-fetch": "2.5.7",
|
"@types/node-fetch": "2.5.7",
|
||||||
"@uifabric/react-cards": "0.109.110",
|
"@uifabric/react-cards": "0.109.110",
|
||||||
@@ -44,8 +48,9 @@
|
|||||||
"applicationinsights": "1.8.0",
|
"applicationinsights": "1.8.0",
|
||||||
"babel-polyfill": "6.26.0",
|
"babel-polyfill": "6.26.0",
|
||||||
"bootstrap": "3.4.1",
|
"bootstrap": "3.4.1",
|
||||||
"canvas": "2.6.1",
|
"canvas": "file:./canvas",
|
||||||
"clean-webpack-plugin": "0.1.19",
|
"clean-webpack-plugin": "0.1.19",
|
||||||
|
"clipboard-copy": "4.0.1",
|
||||||
"copy-webpack-plugin": "6.0.2",
|
"copy-webpack-plugin": "6.0.2",
|
||||||
"crossroads": "0.12.2",
|
"crossroads": "0.12.2",
|
||||||
"css-element-queries": "1.1.1",
|
"css-element-queries": "1.1.1",
|
||||||
@@ -61,6 +66,9 @@
|
|||||||
"eslint-plugin-react": "7.20.0",
|
"eslint-plugin-react": "7.20.0",
|
||||||
"hasher": "1.2.0",
|
"hasher": "1.2.0",
|
||||||
"html2canvas": "1.0.0-rc.5",
|
"html2canvas": "1.0.0-rc.5",
|
||||||
|
"i18next": "19.8.4",
|
||||||
|
"i18next-browser-languagedetector": "6.0.1",
|
||||||
|
"i18next-http-backend": "1.0.23",
|
||||||
"immutable": "4.0.0-rc.12",
|
"immutable": "4.0.0-rc.12",
|
||||||
"is-ci": "2.0.0",
|
"is-ci": "2.0.0",
|
||||||
"jquery": "3.5.1",
|
"jquery": "3.5.1",
|
||||||
@@ -69,6 +77,8 @@
|
|||||||
"knockout": "3.5.1",
|
"knockout": "3.5.1",
|
||||||
"mkdirp": "1.0.4",
|
"mkdirp": "1.0.4",
|
||||||
"monaco-editor": "0.18.1",
|
"monaco-editor": "0.18.1",
|
||||||
|
"ms": "2.1.3",
|
||||||
|
"msal": "1.4.4",
|
||||||
"object.entries": "1.1.0",
|
"object.entries": "1.1.0",
|
||||||
"office-ui-fabric-react": "7.134.1",
|
"office-ui-fabric-react": "7.134.1",
|
||||||
"p-retry": "4.2.0",
|
"p-retry": "4.2.0",
|
||||||
@@ -80,14 +90,17 @@
|
|||||||
"react-animate-height": "2.0.8",
|
"react-animate-height": "2.0.8",
|
||||||
"react-dnd": "9.4.0",
|
"react-dnd": "9.4.0",
|
||||||
"react-dnd-html5-backend": "9.4.0",
|
"react-dnd-html5-backend": "9.4.0",
|
||||||
"react-dom": "16.9.0",
|
"react-dom": "16.13.1",
|
||||||
"react-hotkeys": "2.0.0",
|
"react-hotkeys": "2.0.0",
|
||||||
|
"react-i18next": "11.8.5",
|
||||||
"react-notification-system": "0.2.17",
|
"react-notification-system": "0.2.17",
|
||||||
"react-redux": "7.1.3",
|
"react-redux": "7.1.3",
|
||||||
"redux": "4.0.4",
|
"redux": "4.0.4",
|
||||||
|
"reflect-metadata": "0.1.13",
|
||||||
"rx-jupyter": "5.5.12",
|
"rx-jupyter": "5.5.12",
|
||||||
"rxjs": "6.6.3",
|
"rxjs": "6.6.3",
|
||||||
"styled-components": "4.3.2",
|
"styled-components": "4.3.2",
|
||||||
|
"swr": "0.4.0",
|
||||||
"text-encoding": "0.7.0",
|
"text-encoding": "0.7.0",
|
||||||
"underscore": "1.9.1",
|
"underscore": "1.9.1",
|
||||||
"url-polyfill": "1.1.7",
|
"url-polyfill": "1.1.7",
|
||||||
@@ -101,6 +114,7 @@
|
|||||||
"@babel/preset-env": "7.9.0",
|
"@babel/preset-env": "7.9.0",
|
||||||
"@babel/preset-react": "7.9.4",
|
"@babel/preset-react": "7.9.4",
|
||||||
"@babel/preset-typescript": "7.9.0",
|
"@babel/preset-typescript": "7.9.0",
|
||||||
|
"@testing-library/react": "11.2.3",
|
||||||
"@types/applicationinsights-js": "1.0.7",
|
"@types/applicationinsights-js": "1.0.7",
|
||||||
"@types/codemirror": "0.0.56",
|
"@types/codemirror": "0.0.56",
|
||||||
"@types/crossroads": "0.0.30",
|
"@types/crossroads": "0.0.30",
|
||||||
@@ -109,7 +123,7 @@
|
|||||||
"@types/enzyme-adapter-react-16": "1.0.6",
|
"@types/enzyme-adapter-react-16": "1.0.6",
|
||||||
"@types/expect-puppeteer": "4.4.3",
|
"@types/expect-puppeteer": "4.4.3",
|
||||||
"@types/hasher": "0.0.31",
|
"@types/hasher": "0.0.31",
|
||||||
"@types/jest": "23.3.10",
|
"@types/jest": "26.0.20",
|
||||||
"@types/jest-environment-puppeteer": "4.3.2",
|
"@types/jest-environment-puppeteer": "4.3.2",
|
||||||
"@types/memoize-one": "4.1.1",
|
"@types/memoize-one": "4.1.1",
|
||||||
"@types/node": "12.11.1",
|
"@types/node": "12.11.1",
|
||||||
@@ -117,8 +131,8 @@
|
|||||||
"@types/prop-types": "15.5.8",
|
"@types/prop-types": "15.5.8",
|
||||||
"@types/puppeteer": "3.0.1",
|
"@types/puppeteer": "3.0.1",
|
||||||
"@types/q": "1.5.1",
|
"@types/q": "1.5.1",
|
||||||
"@types/react": "16.9.56",
|
"@types/react": "17.0.0",
|
||||||
"@types/react-dom": "16.0.7",
|
"@types/react-dom": "17.0.0",
|
||||||
"@types/react-notification-system": "0.2.39",
|
"@types/react-notification-system": "0.2.39",
|
||||||
"@types/react-redux": "7.1.7",
|
"@types/react-redux": "7.1.7",
|
||||||
"@types/sinon": "2.3.3",
|
"@types/sinon": "2.3.3",
|
||||||
@@ -128,7 +142,6 @@
|
|||||||
"@types/webfontloader": "1.6.29",
|
"@types/webfontloader": "1.6.29",
|
||||||
"@typescript-eslint/eslint-plugin": "4.0.1",
|
"@typescript-eslint/eslint-plugin": "4.0.1",
|
||||||
"@typescript-eslint/parser": "4.0.1",
|
"@typescript-eslint/parser": "4.0.1",
|
||||||
"adal-angular": "1.0.15",
|
|
||||||
"axe-puppeteer": "1.1.0",
|
"axe-puppeteer": "1.1.0",
|
||||||
"babel-jest": "24.9.0",
|
"babel-jest": "24.9.0",
|
||||||
"babel-loader": "8.1.0",
|
"babel-loader": "8.1.0",
|
||||||
@@ -143,7 +156,9 @@
|
|||||||
"eslint-cli": "1.1.1",
|
"eslint-cli": "1.1.1",
|
||||||
"eslint-plugin-no-null": "1.0.2",
|
"eslint-plugin-no-null": "1.0.2",
|
||||||
"eslint-plugin-prefer-arrow": "1.2.2",
|
"eslint-plugin-prefer-arrow": "1.2.2",
|
||||||
|
"eslint-plugin-react-hooks": "4.2.0",
|
||||||
"expose-loader": "0.7.5",
|
"expose-loader": "0.7.5",
|
||||||
|
"fast-glob": "3.2.5",
|
||||||
"file-loader": "2.0.0",
|
"file-loader": "2.0.0",
|
||||||
"fs-extra": "7.0.0",
|
"fs-extra": "7.0.0",
|
||||||
"html-loader": "0.5.5",
|
"html-loader": "0.5.5",
|
||||||
@@ -160,7 +175,7 @@
|
|||||||
"mini-css-extract-plugin": "0.4.3",
|
"mini-css-extract-plugin": "0.4.3",
|
||||||
"monaco-editor-webpack-plugin": "1.7.0",
|
"monaco-editor-webpack-plugin": "1.7.0",
|
||||||
"node-fetch": "2.6.1",
|
"node-fetch": "2.6.1",
|
||||||
"prettier": "1.19.1",
|
"prettier": "2.2.1",
|
||||||
"puppeteer": "4.0.0",
|
"puppeteer": "4.0.0",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "0.5.1",
|
||||||
"rimraf": "3.0.0",
|
"rimraf": "3.0.0",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"offerThroughput": 400,
|
"offerThroughput": 400,
|
||||||
"databaseLevelThroughput": false,
|
"databaseLevelThroughput": false,
|
||||||
"collectionId": "Persons",
|
"collectionId": "Persons",
|
||||||
|
"createNewDatabase": true,
|
||||||
"partitionKey": { "kind": "Hash", "paths": ["/name"] },
|
"partitionKey": { "kind": "Hash", "paths": ["/name"] },
|
||||||
"data": [
|
"data": [
|
||||||
"g.addV('person').property(id, '1').property('name', 'Eva').property('age', 44)",
|
"g.addV('person').property(id, '1').property('name', 'Eva').property('age', 44)",
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ export enum AuthType {
|
|||||||
AAD = "aad",
|
AAD = "aad",
|
||||||
EncryptedToken = "encryptedtoken",
|
EncryptedToken = "encryptedtoken",
|
||||||
MasterKey = "masterkey",
|
MasterKey = "masterkey",
|
||||||
ResourceToken = "resourcetoken"
|
ResourceToken = "resourcetoken",
|
||||||
|
ConnectionString = "connectionstring",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import * as ReactBindingHandler from "./ReactBindingHandler";
|
import * as ReactBindingHandler from "./ReactBindingHandler";
|
||||||
|
import "../Explorer/Tables/DataTable/DataTableBindingManager";
|
||||||
|
|
||||||
export class BindingHandlersRegisterer {
|
export class BindingHandlersRegisterer {
|
||||||
public static registerBindingHandlers() {
|
public static registerBindingHandlers() {
|
||||||
@@ -13,7 +14,7 @@ export class BindingHandlersRegisterer {
|
|||||||
) {
|
) {
|
||||||
const value = ko.unwrap(wrappedValueAccessor());
|
const value = ko.unwrap(wrappedValueAccessor());
|
||||||
bindingContext?.$data.isTemplateReady(value);
|
bindingContext?.$data.isTemplateReady(value);
|
||||||
}
|
},
|
||||||
} as ko.BindingHandler;
|
} as ko.BindingHandler;
|
||||||
|
|
||||||
ReactBindingHandler.Registerer.register();
|
ReactBindingHandler.Registerer.register();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class Registerer {
|
|||||||
|
|
||||||
// Initial rendering at mount point
|
// Initial rendering at mount point
|
||||||
ReactDOM.render(adapter.renderComponent(), element);
|
ReactDOM.render(adapter.renderComponent(), element);
|
||||||
}
|
},
|
||||||
} as ko.BindingHandler;
|
} as ko.BindingHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class ArrayHashMap<T> {
|
|||||||
public forEach(key: string, iteratorFct: (value: T) => void) {
|
public forEach(key: string, iteratorFct: (value: T) => void) {
|
||||||
const values = this.store.get(key);
|
const values = this.store.get(key);
|
||||||
if (values) {
|
if (values) {
|
||||||
values.forEach(value => iteratorFct(value));
|
values.forEach((value) => iteratorFct(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
import { HashMap } from "./HashMap";
|
|
||||||
|
|
||||||
export class AuthorizationEndpoints {
|
|
||||||
public static arm: string = "https://management.core.windows.net/";
|
|
||||||
public static common: string = "https://login.windows.net/";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CodeOfConductEndpoints {
|
export class CodeOfConductEndpoints {
|
||||||
public static privacyStatement: string = "https://aka.ms/ms-privacy-policy";
|
public static privacyStatement: string = "https://aka.ms/ms-privacy-policy";
|
||||||
public static codeOfConduct: string = "https://aka.ms/cosmos-code-of-conduct";
|
public static codeOfConduct: string = "https://aka.ms/cosmos-code-of-conduct";
|
||||||
@@ -14,7 +7,7 @@ export class CodeOfConductEndpoints {
|
|||||||
export class EndpointsRegex {
|
export class EndpointsRegex {
|
||||||
public static readonly cassandra = [
|
public static readonly cassandra = [
|
||||||
"AccountEndpoint=(.*).cassandra.cosmosdb.azure.com",
|
"AccountEndpoint=(.*).cassandra.cosmosdb.azure.com",
|
||||||
"HostName=(.*).cassandra.cosmos.azure.com"
|
"HostName=(.*).cassandra.cosmos.azure.com",
|
||||||
];
|
];
|
||||||
public static readonly mongo = "mongodb://.*:(.*)@(.*).documents.azure.com";
|
public static readonly mongo = "mongodb://.*:(.*)@(.*).documents.azure.com";
|
||||||
public static readonly mongoCompute = "mongodb://.*:(.*)@(.*).mongo.cosmos.azure.com";
|
public static readonly mongoCompute = "mongodb://.*:(.*)@(.*).mongo.cosmos.azure.com";
|
||||||
@@ -112,8 +105,6 @@ export class Features {
|
|||||||
public static readonly hostedDataExplorer = "hosteddataexplorerenabled";
|
public static readonly hostedDataExplorer = "hosteddataexplorerenabled";
|
||||||
public static readonly enableTtl = "enablettl";
|
public static readonly enableTtl = "enablettl";
|
||||||
public static readonly enableNotebooks = "enablenotebooks";
|
public static readonly enableNotebooks = "enablenotebooks";
|
||||||
public static readonly enableGalleryPublish = "enablegallerypublish";
|
|
||||||
public static readonly enableLinkInjection = "enablelinkinjection";
|
|
||||||
public static readonly enableSpark = "enablespark";
|
public static readonly enableSpark = "enablespark";
|
||||||
public static readonly livyEndpoint = "livyendpoint";
|
public static readonly livyEndpoint = "livyendpoint";
|
||||||
public static readonly notebookServerUrl = "notebookserverurl";
|
public static readonly notebookServerUrl = "notebookserverurl";
|
||||||
@@ -126,12 +117,17 @@ export class Features {
|
|||||||
public static readonly enableSchema = "enableschema";
|
public static readonly enableSchema = "enableschema";
|
||||||
public static readonly enableSDKoperations = "enablesdkoperations";
|
public static readonly enableSDKoperations = "enablesdkoperations";
|
||||||
public static readonly showMinRUSurvey = "showminrusurvey";
|
public static readonly showMinRUSurvey = "showminrusurvey";
|
||||||
|
public static readonly enableDatabaseSettingsTabV1 = "enabledbsettingsv1";
|
||||||
|
public static readonly selfServeType = "selfservetype";
|
||||||
|
public static readonly enableKOPanel = "enablekopanel";
|
||||||
}
|
}
|
||||||
|
|
||||||
// flight names returned from the portal are always lowercase
|
// flight names returned from the portal are always lowercase
|
||||||
export class Flights {
|
export class Flights {
|
||||||
public static readonly SettingsV2 = "settingsv2";
|
public static readonly SettingsV2 = "settingsv2";
|
||||||
public static readonly MongoIndexEditor = "mongoindexeditor";
|
public static readonly MongoIndexEditor = "mongoindexeditor";
|
||||||
|
public static readonly MongoIndexing = "mongoindexing";
|
||||||
|
public static readonly AutoscaleTest = "autoscaletest";
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AfecFeatures {
|
export class AfecFeatures {
|
||||||
@@ -140,19 +136,6 @@ export class AfecFeatures {
|
|||||||
public static readonly StorageAnalytics = "storageanalytics-public-preview";
|
public static readonly StorageAnalytics = "storageanalytics-public-preview";
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Spark {
|
|
||||||
public static readonly MaxWorkerCount = 10;
|
|
||||||
public static readonly SKUs: HashMap<string> = new HashMap({
|
|
||||||
"Cosmos.Spark.D1s": "D1s / 1 core / 4GB RAM",
|
|
||||||
"Cosmos.Spark.D2s": "D2s / 2 cores / 8GB RAM",
|
|
||||||
"Cosmos.Spark.D4s": "D4s / 4 cores / 16GB RAM",
|
|
||||||
"Cosmos.Spark.D8s": "D8s / 8 cores / 32GB RAM",
|
|
||||||
"Cosmos.Spark.D16s": "D16s / 16 cores / 64GB RAM",
|
|
||||||
"Cosmos.Spark.D32s": "D32s / 32 cores / 128GB RAM",
|
|
||||||
"Cosmos.Spark.D64s": "D64s / 64 cores / 256GB RAM"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TagNames {
|
export class TagNames {
|
||||||
public static defaultExperience: string = "defaultExperience";
|
public static defaultExperience: string = "defaultExperience";
|
||||||
}
|
}
|
||||||
@@ -164,7 +147,7 @@ export class MongoDBAccounts {
|
|||||||
|
|
||||||
export enum MongoBackendEndpointType {
|
export enum MongoBackendEndpointType {
|
||||||
local,
|
local,
|
||||||
remote
|
remote,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 435619 Add default endpoints per cloud and use regional only when available
|
// TODO: 435619 Add default endpoints per cloud and use regional only when available
|
||||||
@@ -291,7 +274,7 @@ export class HttpStatusCodes {
|
|||||||
HttpStatusCodes.InternalServerError, // TODO: Handle all 500s on Portal backend and remove from retries list
|
HttpStatusCodes.InternalServerError, // TODO: Handle all 500s on Portal backend and remove from retries list
|
||||||
HttpStatusCodes.BadGateway,
|
HttpStatusCodes.BadGateway,
|
||||||
HttpStatusCodes.ServiceUnavailable,
|
HttpStatusCodes.ServiceUnavailable,
|
||||||
HttpStatusCodes.GatewayTimeout
|
HttpStatusCodes.GatewayTimeout,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,10 +330,7 @@ export class HashRoutePrefixes {
|
|||||||
public static docsWithIds(databaseId: string, collectionId: string, docId: string) {
|
public static docsWithIds(databaseId: string, collectionId: string, docId: string) {
|
||||||
const transformedDatabasePrefix: string = this.docs.replace("{db_id}", databaseId);
|
const transformedDatabasePrefix: string = this.docs.replace("{db_id}", databaseId);
|
||||||
|
|
||||||
return transformedDatabasePrefix
|
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("{doc_id}", docId).replace("/", ""); // strip the first slash since hasher adds it
|
||||||
.replace("{coll_id}", collectionId)
|
|
||||||
.replace("{doc_id}", docId)
|
|
||||||
.replace("/", ""); // strip the first slash since hasher adds it
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +376,7 @@ export class OfferVersions {
|
|||||||
export enum ConflictOperationType {
|
export enum ConflictOperationType {
|
||||||
Replace = "replace",
|
Replace = "replace",
|
||||||
Create = "create",
|
Create = "create",
|
||||||
Delete = "delete"
|
Delete = "delete",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EmulatorMasterKey =
|
export const EmulatorMasterKey =
|
||||||
@@ -412,6 +392,9 @@ export class Notebook {
|
|||||||
public static readonly kernelRestartInitialDelayMs = 1000;
|
public static readonly kernelRestartInitialDelayMs = 1000;
|
||||||
public static readonly kernelRestartMaxDelayMs = 20000;
|
public static readonly kernelRestartMaxDelayMs = 20000;
|
||||||
public static readonly autoSaveIntervalMs = 120000;
|
public static readonly autoSaveIntervalMs = 120000;
|
||||||
|
|
||||||
|
public static readonly MyNotebooksTitle = "My Notebooks";
|
||||||
|
public static readonly GitHubReposTitle = "GitHub repos";
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SparkLibrary {
|
export class SparkLibrary {
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ describe("tokenProvider", () => {
|
|||||||
resourceId: "",
|
resourceId: "",
|
||||||
resourceType: "dbs" as ResourceType,
|
resourceType: "dbs" as ResourceType,
|
||||||
headers: {},
|
headers: {},
|
||||||
getAuthorizationTokenUsingMasterKey: () => ""
|
getAuthorizationTokenUsingMasterKey: () => "",
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(() => {
|
window.fetch = jest.fn().mockImplementation(() => {
|
||||||
return {
|
return {
|
||||||
json: () => "{}",
|
json: () => "{}",
|
||||||
headers: new Map()
|
headers: new Map(),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -36,7 +36,7 @@ describe("tokenProvider", () => {
|
|||||||
|
|
||||||
it("does not call the auth service if a master key is set", async () => {
|
it("does not call the auth service if a master key is set", async () => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
masterKey: "foo"
|
masterKey: "foo",
|
||||||
});
|
});
|
||||||
await tokenProvider(options);
|
await tokenProvider(options);
|
||||||
expect((window.fetch as any).mock.calls.length).toBe(0);
|
expect((window.fetch as any).mock.calls.length).toBe(0);
|
||||||
@@ -50,7 +50,7 @@ describe("getTokenFromAuthService", () => {
|
|||||||
window.fetch = jest.fn().mockImplementation(() => {
|
window.fetch = jest.fn().mockImplementation(() => {
|
||||||
return {
|
return {
|
||||||
json: () => "{}",
|
json: () => "{}",
|
||||||
headers: new Map()
|
headers: new Map(),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -61,7 +61,7 @@ describe("getTokenFromAuthService", () => {
|
|||||||
|
|
||||||
it("builds the correct URL in production", () => {
|
it("builds the correct URL in production", () => {
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
getTokenFromAuthService("GET", "dbs", "foo");
|
getTokenFromAuthService("GET", "dbs", "foo");
|
||||||
expect(window.fetch).toHaveBeenCalledWith(
|
expect(window.fetch).toHaveBeenCalledWith(
|
||||||
@@ -72,7 +72,7 @@ describe("getTokenFromAuthService", () => {
|
|||||||
|
|
||||||
it("builds the correct URL in dev", () => {
|
it("builds the correct URL in dev", () => {
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://localhost:1234"
|
BACKEND_ENDPOINT: "https://localhost:1234",
|
||||||
});
|
});
|
||||||
getTokenFromAuthService("GET", "dbs", "foo");
|
getTokenFromAuthService("GET", "dbs", "foo");
|
||||||
expect(window.fetch).toHaveBeenCalledWith(
|
expect(window.fetch).toHaveBeenCalledWith(
|
||||||
@@ -96,15 +96,15 @@ describe("endpoint", () => {
|
|||||||
documentEndpoint: "bar",
|
documentEndpoint: "bar",
|
||||||
gremlinEndpoint: "foo",
|
gremlinEndpoint: "foo",
|
||||||
tableEndpoint: "foo",
|
tableEndpoint: "foo",
|
||||||
cassandraEndpoint: "foo"
|
cassandraEndpoint: "foo",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
expect(endpoint()).toEqual("bar");
|
expect(endpoint()).toEqual("bar");
|
||||||
});
|
});
|
||||||
it("uses _endpoint if set", () => {
|
it("uses _endpoint if set", () => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
endpoint: "baz"
|
endpoint: "baz",
|
||||||
});
|
});
|
||||||
expect(endpoint()).toEqual("baz");
|
expect(endpoint()).toEqual("baz");
|
||||||
});
|
});
|
||||||
@@ -121,7 +121,7 @@ describe("requestPlugin", () => {
|
|||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
platform: Platform.Hosted,
|
platform: Platform.Hosted,
|
||||||
BACKEND_ENDPOINT: "https://localhost:1234",
|
BACKEND_ENDPOINT: "https://localhost:1234",
|
||||||
PROXY_PATH: "/proxy"
|
PROXY_PATH: "/proxy",
|
||||||
});
|
});
|
||||||
const headers = {};
|
const headers = {};
|
||||||
const endpoint = "https://docs.azure.com";
|
const endpoint = "https://docs.azure.com";
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as Cosmos from "@azure/cosmos";
|
import * as Cosmos from "@azure/cosmos";
|
||||||
import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos";
|
import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos";
|
||||||
import { configContext, Platform } from "../ConfigContext";
|
import { configContext, Platform } from "../ConfigContext";
|
||||||
import { getErrorMessage } from "./ErrorHandlingUtils";
|
import { userContext } from "../UserContext";
|
||||||
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
||||||
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
|
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
|
||||||
import { userContext } from "../UserContext";
|
import { getErrorMessage } from "./ErrorHandlingUtils";
|
||||||
|
|
||||||
const _global = typeof self === "undefined" ? window : self;
|
const _global = typeof self === "undefined" ? window : self;
|
||||||
|
|
||||||
@@ -58,13 +58,13 @@ export async function getTokenFromAuthService(verb: string, resourceType: string
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
"x-ms-encrypted-auth-token": userContext.accessToken
|
"x-ms-encrypted-auth-token": userContext.accessToken,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
verb,
|
verb,
|
||||||
resourceType,
|
resourceType,
|
||||||
resourceId
|
resourceId,
|
||||||
})
|
}),
|
||||||
});
|
});
|
||||||
//TODO I am not sure why we have to parse the JSON again here. fetch should do it for us when we call .json()
|
//TODO I am not sure why we have to parse the JSON again here. fetch should do it for us when we call .json()
|
||||||
const result = JSON.parse(await response.json());
|
const result = JSON.parse(await response.json());
|
||||||
@@ -77,13 +77,13 @@ export async function getTokenFromAuthService(verb: string, resourceType: string
|
|||||||
|
|
||||||
export function client(): Cosmos.CosmosClient {
|
export function client(): Cosmos.CosmosClient {
|
||||||
const options: Cosmos.CosmosClientOptions = {
|
const options: Cosmos.CosmosClientOptions = {
|
||||||
endpoint: endpoint() || " ", // CosmosClient gets upset if we pass a falsy value here
|
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
||||||
key: userContext.masterKey,
|
key: userContext.masterKey,
|
||||||
tokenProvider,
|
tokenProvider,
|
||||||
connectionPolicy: {
|
connectionPolicy: {
|
||||||
enableEndpointDiscovery: false
|
enableEndpointDiscovery: false,
|
||||||
},
|
},
|
||||||
userAgentSuffix: "Azure Portal"
|
userAgentSuffix: "Azure Portal",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (configContext.PROXY_PATH !== undefined) {
|
if (configContext.PROXY_PATH !== undefined) {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default class EditableUtility {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
observable.subscribe(edit => {
|
observable.subscribe((edit) => {
|
||||||
var edits = observable.edits && observable.edits();
|
var edits = observable.edits && observable.edits();
|
||||||
if (!edits) {
|
if (!edits) {
|
||||||
return;
|
return;
|
||||||
@@ -83,9 +83,9 @@ export default class EditableUtility {
|
|||||||
});
|
});
|
||||||
|
|
||||||
observable.editableIsValid = ko.observable<boolean>(true);
|
observable.editableIsValid = ko.observable<boolean>(true);
|
||||||
observable.subscribe(value => {
|
observable.subscribe((value) => {
|
||||||
const validations: ((value: T) => boolean)[] = (observable.validations && observable.validations()) || [];
|
const validations: ((value: T) => boolean)[] = (observable.validations && observable.validations()) || [];
|
||||||
const isValid = validations.every(validate => validate(value));
|
const isValid = validations.every((validate) => validate(value));
|
||||||
observable.editableIsValid(isValid);
|
observable.editableIsValid(isValid);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { ARMError } from "../Utils/arm/request";
|
|
||||||
import { HttpStatusCodes } from "./Constants";
|
|
||||||
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||||
import { SubscriptionType } from "../Contracts/SubscriptionType";
|
import { SubscriptionType } from "../Contracts/SubscriptionType";
|
||||||
|
import { userContext } from "../UserContext";
|
||||||
|
import { ARMError } from "../Utils/arm/request";
|
||||||
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
|
||||||
|
import { HttpStatusCodes } from "./Constants";
|
||||||
import { logError } from "./Logger";
|
import { logError } from "./Logger";
|
||||||
import { sendMessage } from "./MessageHandler";
|
import { sendMessage } from "./MessageHandler";
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ export const handleError = (error: string | ARMError | Error, area: string, cons
|
|||||||
sendNotificationForError(errorMessage, errorCode);
|
sendNotificationForError(errorMessage, errorCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getErrorMessage = (error: string | Error): string => {
|
export const getErrorMessage = (error: string | Error = ""): string => {
|
||||||
const errorMessage = typeof error === "string" ? error : error.message;
|
const errorMessage = typeof error === "string" ? error : error.message;
|
||||||
return replaceKnownError(errorMessage);
|
return replaceKnownError(errorMessage);
|
||||||
};
|
};
|
||||||
@@ -37,18 +38,18 @@ const sendNotificationForError = (errorMessage: string, errorCode: number | stri
|
|||||||
}
|
}
|
||||||
sendMessage({
|
sendMessage({
|
||||||
type: MessageTypes.ForbiddenError,
|
type: MessageTypes.ForbiddenError,
|
||||||
reason: errorMessage
|
reason: errorMessage,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const replaceKnownError = (errorMessage: string): string => {
|
const replaceKnownError = (errorMessage: string): string => {
|
||||||
if (
|
if (
|
||||||
window.dataExplorer?.subscriptionType() === SubscriptionType.Internal &&
|
userContext.subscriptionType === SubscriptionType.Internal &&
|
||||||
errorMessage.indexOf("SharedOffer is Disabled for your account") >= 0
|
errorMessage?.indexOf("SharedOffer is Disabled for your account") >= 0
|
||||||
) {
|
) {
|
||||||
return "Database throughput is not supported for internal subscriptions.";
|
return "Database throughput is not supported for internal subscriptions.";
|
||||||
} else if (errorMessage.indexOf("Partition key paths must contain only valid") >= 0) {
|
} else if (errorMessage?.indexOf("Partition key paths must contain only valid") >= 0) {
|
||||||
return "Partition key paths must contain only valid characters and not contain a trailing slash or wildcard character.";
|
return "Partition key paths must contain only valid characters and not contain a trailing slash or wildcard character.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,5 @@
|
|||||||
import * as Constants from "./Constants";
|
|
||||||
|
|
||||||
import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility";
|
import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility";
|
||||||
|
|
||||||
// x-ms-resource-quota: databases = 100; collections = 5000; users = 500000; permissions = 2000000;
|
|
||||||
export function getQuota(responseHeaders: any): any {
|
|
||||||
return responseHeaders && responseHeaders[Constants.HttpHeaders.resourceQuota]
|
|
||||||
? parseStringIntoObject(responseHeaders[Constants.HttpHeaders.resourceQuota])
|
|
||||||
: null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function shouldEnableCrossPartitionKey(): boolean {
|
export function shouldEnableCrossPartitionKey(): boolean {
|
||||||
return LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true";
|
return LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStringIntoObject(resourceString: string) {
|
|
||||||
var entityObject: any = {};
|
|
||||||
|
|
||||||
if (resourceString) {
|
|
||||||
var entitiesArray: string[] = resourceString.split(";");
|
|
||||||
for (var i: any = 0; i < entitiesArray.length; i++) {
|
|
||||||
var entity: string[] = entitiesArray[i].split("=");
|
|
||||||
entityObject[entity[0]] = entity[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return entityObject;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ describe("nextPage", () => {
|
|||||||
queryMetrics: {},
|
queryMetrics: {},
|
||||||
requestCharge: 1,
|
requestCharge: 1,
|
||||||
headers: {},
|
headers: {},
|
||||||
activityId: "foo"
|
activityId: "foo",
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(await nextPage(fakeIterator, 10)).toMatchSnapshot();
|
expect(await nextPage(fakeIterator, 10)).toMatchSnapshot();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { QueryResults } from "../Contracts/ViewModels";
|
import { QueryResults } from "../Contracts/ViewModels";
|
||||||
|
|
||||||
interface QueryResponse {
|
interface QueryResponse {
|
||||||
|
// [Todo] remove any
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
resources: any[];
|
resources: any[];
|
||||||
hasMoreResults: boolean;
|
hasMoreResults: boolean;
|
||||||
activityId: string;
|
activityId: string;
|
||||||
@@ -14,8 +16,9 @@ export interface MinimalQueryIterator {
|
|||||||
// Pick<QueryIterator<any>, "fetchNext">;
|
// Pick<QueryIterator<any>, "fetchNext">;
|
||||||
|
|
||||||
export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex: number): Promise<QueryResults> {
|
export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex: number): Promise<QueryResults> {
|
||||||
return documentsIterator.fetchNext().then(response => {
|
return documentsIterator.fetchNext().then((response) => {
|
||||||
const documents = response.resources;
|
const documents = response.resources;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const headers = (response as any).headers || {}; // TODO this is a private key. Remove any
|
const headers = (response as any).headers || {}; // TODO this is a private key. Remove any
|
||||||
const itemCount = (documents && documents.length) || 0;
|
const itemCount = (documents && documents.length) || 0;
|
||||||
return {
|
return {
|
||||||
@@ -26,7 +29,7 @@ export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex
|
|||||||
lastItemIndex: Number(firstItemIndex) + Number(itemCount),
|
lastItemIndex: Number(firstItemIndex) + Number(itemCount),
|
||||||
headers,
|
headers,
|
||||||
activityId: response.activityId,
|
activityId: response.activityId,
|
||||||
requestCharge: response.requestCharge
|
requestCharge: response.requestCharge,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export function logError(errorMessage: string, area: string, code?: number | str
|
|||||||
function _logEntry(entry: Diagnostics.LogEntry): void {
|
function _logEntry(entry: Diagnostics.LogEntry): void {
|
||||||
sendMessage({
|
sendMessage({
|
||||||
type: MessageTypes.LogInfo,
|
type: MessageTypes.LogInfo,
|
||||||
data: JSON.stringify(entry)
|
data: JSON.stringify(entry),
|
||||||
});
|
});
|
||||||
|
|
||||||
const severityLevel = ((level: Diagnostics.LogEntryLevel): SeverityLevel => {
|
const severityLevel = ((level: Diagnostics.LogEntryLevel): SeverityLevel => {
|
||||||
@@ -60,6 +60,6 @@ function _generateLogEntry(
|
|||||||
level,
|
level,
|
||||||
message,
|
message,
|
||||||
area,
|
area,
|
||||||
code
|
code,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe("Message Handler", () => {
|
|||||||
let mockPromise = {
|
let mockPromise = {
|
||||||
id: "123",
|
id: "123",
|
||||||
startTime: new Date(),
|
startTime: new Date(),
|
||||||
deferred: Q.defer<any>()
|
deferred: Q.defer<any>(),
|
||||||
};
|
};
|
||||||
let mockMessage = { message: { id: "123", data: "{}" } };
|
let mockMessage = { message: { id: "123", data: "{}" } };
|
||||||
MessageHandler.RequestMap[mockPromise.id] = mockPromise;
|
MessageHandler.RequestMap[mockPromise.id] = mockPromise;
|
||||||
@@ -18,7 +18,7 @@ describe("Message Handler", () => {
|
|||||||
let message = {
|
let message = {
|
||||||
id: "123",
|
id: "123",
|
||||||
startTime: new Date(),
|
startTime: new Date(),
|
||||||
deferred: Q.defer<any>()
|
deferred: Q.defer<any>(),
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageHandler.handleCachedDataMessage(message);
|
MessageHandler.handleCachedDataMessage(message);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export function sendCachedDataMessage<TResponseDataModel>(
|
|||||||
let cachedDataPromise: CachedDataPromise<TResponseDataModel> = {
|
let cachedDataPromise: CachedDataPromise<TResponseDataModel> = {
|
||||||
deferred: Q.defer<TResponseDataModel>(),
|
deferred: Q.defer<TResponseDataModel>(),
|
||||||
startTime: new Date(),
|
startTime: new Date(),
|
||||||
id: _.uniqueId()
|
id: _.uniqueId(),
|
||||||
};
|
};
|
||||||
RequestMap[cachedDataPromise.id] = cachedDataPromise;
|
RequestMap[cachedDataPromise.id] = cachedDataPromise;
|
||||||
sendMessage({ type: messageType, params: params, id: cachedDataPromise.id });
|
sendMessage({ type: messageType, params: params, id: cachedDataPromise.id });
|
||||||
@@ -54,7 +54,7 @@ export function sendMessage(data: any): void {
|
|||||||
portalChildWindow.parent.postMessage(
|
portalChildWindow.parent.postMessage(
|
||||||
{
|
{
|
||||||
signature: "pcIframe",
|
signature: "pcIframe",
|
||||||
data: data
|
data: data,
|
||||||
},
|
},
|
||||||
portalChildWindow.document.referrer
|
portalChildWindow.document.referrer
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const fetchMock = () => {
|
|||||||
ok: true,
|
ok: true,
|
||||||
text: () => "{}",
|
text: () => "{}",
|
||||||
json: () => "{}",
|
json: () => "{}",
|
||||||
headers: new Map()
|
headers: new Map(),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -27,8 +27,8 @@ const collection = {
|
|||||||
partitionKey: {
|
partitionKey: {
|
||||||
paths: ["/pk"],
|
paths: ["/pk"],
|
||||||
kind: "Hash",
|
kind: "Hash",
|
||||||
version: 1
|
version: 1,
|
||||||
}
|
},
|
||||||
} as Collection;
|
} as Collection;
|
||||||
|
|
||||||
const documentId = ({
|
const documentId = ({
|
||||||
@@ -38,8 +38,8 @@ const documentId = ({
|
|||||||
partitionKey: {
|
partitionKey: {
|
||||||
paths: ["/pk"],
|
paths: ["/pk"],
|
||||||
kind: "Hash",
|
kind: "Hash",
|
||||||
version: 1
|
version: 1,
|
||||||
}
|
},
|
||||||
} as unknown) as DocumentId;
|
} as unknown) as DocumentId;
|
||||||
|
|
||||||
const databaseAccount = {
|
const databaseAccount = {
|
||||||
@@ -52,8 +52,8 @@ const databaseAccount = {
|
|||||||
documentEndpoint: "bar",
|
documentEndpoint: "bar",
|
||||||
gremlinEndpoint: "foo",
|
gremlinEndpoint: "foo",
|
||||||
tableEndpoint: "foo",
|
tableEndpoint: "foo",
|
||||||
cassandraEndpoint: "foo"
|
cassandraEndpoint: "foo",
|
||||||
}
|
},
|
||||||
} as DatabaseAccount;
|
} as DatabaseAccount;
|
||||||
|
|
||||||
describe("MongoProxyClient", () => {
|
describe("MongoProxyClient", () => {
|
||||||
@@ -61,10 +61,10 @@ describe("MongoProxyClient", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(fetchMock);
|
window.fetch = jest.fn().mockImplementation(fetchMock);
|
||||||
});
|
});
|
||||||
@@ -93,10 +93,10 @@ describe("MongoProxyClient", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(fetchMock);
|
window.fetch = jest.fn().mockImplementation(fetchMock);
|
||||||
});
|
});
|
||||||
@@ -125,10 +125,10 @@ describe("MongoProxyClient", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(fetchMock);
|
window.fetch = jest.fn().mockImplementation(fetchMock);
|
||||||
});
|
});
|
||||||
@@ -157,10 +157,10 @@ describe("MongoProxyClient", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(fetchMock);
|
window.fetch = jest.fn().mockImplementation(fetchMock);
|
||||||
});
|
});
|
||||||
@@ -189,10 +189,10 @@ describe("MongoProxyClient", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
window.fetch = jest.fn().mockImplementation(fetchMock);
|
window.fetch = jest.fn().mockImplementation(fetchMock);
|
||||||
});
|
});
|
||||||
@@ -220,12 +220,11 @@ describe("MongoProxyClient", () => {
|
|||||||
describe("getEndpoint", () => {
|
describe("getEndpoint", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetConfigContext();
|
resetConfigContext();
|
||||||
delete window.authType;
|
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount
|
databaseAccount,
|
||||||
});
|
});
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -241,7 +240,9 @@ describe("MongoProxyClient", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("returns a guest endpoint", () => {
|
it("returns a guest endpoint", () => {
|
||||||
window.authType = AuthType.EncryptedToken;
|
updateUserContext({
|
||||||
|
authType: AuthType.EncryptedToken,
|
||||||
|
});
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/guest/mongo/explorer");
|
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/guest/mongo/explorer");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ import { sendMessage } from "./MessageHandler";
|
|||||||
const defaultHeaders = {
|
const defaultHeaders = {
|
||||||
[HttpHeaders.apiType]: ApiType.MongoDB.toString(),
|
[HttpHeaders.apiType]: ApiType.MongoDB.toString(),
|
||||||
[CosmosSDKConstants.HttpHeaders.MaxEntityCount]: "100",
|
[CosmosSDKConstants.HttpHeaders.MaxEntityCount]: "100",
|
||||||
[CosmosSDKConstants.HttpHeaders.Version]: "2017-11-15"
|
[CosmosSDKConstants.HttpHeaders.Version]: "2017-11-15",
|
||||||
};
|
};
|
||||||
|
|
||||||
function authHeaders() {
|
function authHeaders() {
|
||||||
if (window.authType === AuthType.EncryptedToken) {
|
if (userContext.authType === AuthType.EncryptedToken) {
|
||||||
return { [HttpHeaders.guestAccessToken]: userContext.accessToken };
|
return { [HttpHeaders.guestAccessToken]: userContext.accessToken };
|
||||||
} else {
|
} else {
|
||||||
return { [HttpHeaders.authorization]: userContext.authorizationToken };
|
return { [HttpHeaders.authorization]: userContext.authorizationToken };
|
||||||
@@ -31,7 +31,7 @@ export function queryIterator(databaseId: string, collection: Collection, query:
|
|||||||
let continuationToken: string;
|
let continuationToken: string;
|
||||||
return {
|
return {
|
||||||
fetchNext: () => {
|
fetchNext: () => {
|
||||||
return queryDocuments(databaseId, collection, false, query).then(response => {
|
return queryDocuments(databaseId, collection, false, query).then((response) => {
|
||||||
continuationToken = response.continuationToken;
|
continuationToken = response.continuationToken;
|
||||||
const headers: { [key: string]: string | number } = {};
|
const headers: { [key: string]: string | number } = {};
|
||||||
response.headers.forEach((value, key) => {
|
response.headers.forEach((value, key) => {
|
||||||
@@ -42,10 +42,10 @@ export function queryIterator(databaseId: string, collection: Collection, query:
|
|||||||
headers,
|
headers,
|
||||||
requestCharge: Number(headers[CosmosSDKConstants.HttpHeaders.RequestCharge]),
|
requestCharge: Number(headers[CosmosSDKConstants.HttpHeaders.RequestCharge]),
|
||||||
activityId: String(headers[CosmosSDKConstants.HttpHeaders.ActivityId]),
|
activityId: String(headers[CosmosSDKConstants.HttpHeaders.ActivityId]),
|
||||||
hasMoreResults: !!continuationToken
|
hasMoreResults: !!continuationToken,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,9 @@ export function queryDocuments(
|
|||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
pk:
|
pk:
|
||||||
collection && collection.partitionKey && !collection.partitionKey.systemKey ? collection.partitionKeyProperty : ""
|
collection && collection.partitionKey && !collection.partitionKey.systemKey
|
||||||
|
? collection.partitionKeyProperty
|
||||||
|
: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const endpoint = getEndpoint() || "";
|
const endpoint = getEndpoint() || "";
|
||||||
@@ -87,7 +89,7 @@ export function queryDocuments(
|
|||||||
[CosmosSDKConstants.HttpHeaders.EnableScanInQuery]: "true",
|
[CosmosSDKConstants.HttpHeaders.EnableScanInQuery]: "true",
|
||||||
[CosmosSDKConstants.HttpHeaders.EnableCrossPartitionQuery]: "true",
|
[CosmosSDKConstants.HttpHeaders.EnableCrossPartitionQuery]: "true",
|
||||||
[CosmosSDKConstants.HttpHeaders.ParallelizeCrossPartitionQuery]: "true",
|
[CosmosSDKConstants.HttpHeaders.ParallelizeCrossPartitionQuery]: "true",
|
||||||
[HttpHeaders.contentType]: "application/query+json"
|
[HttpHeaders.contentType]: "application/query+json",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (continuationToken) {
|
if (continuationToken) {
|
||||||
@@ -100,14 +102,14 @@ export function queryDocuments(
|
|||||||
.fetch(`${endpoint}${path}?${queryString.stringify(params)}`, {
|
.fetch(`${endpoint}${path}?${queryString.stringify(params)}`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({ query }),
|
body: JSON.stringify({ query }),
|
||||||
headers
|
headers,
|
||||||
})
|
})
|
||||||
.then(async response => {
|
.then(async (response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return {
|
return {
|
||||||
continuationToken: response.headers.get(CosmosSDKConstants.HttpHeaders.Continuation),
|
continuationToken: response.headers.get(CosmosSDKConstants.HttpHeaders.Continuation),
|
||||||
documents: (await response.json()).Documents as DataModels.DocumentId[],
|
documents: (await response.json()).Documents as DataModels.DocumentId[],
|
||||||
headers: response.headers
|
headers: response.headers,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
errorHandling(response, "querying documents", params);
|
errorHandling(response, "querying documents", params);
|
||||||
@@ -135,7 +137,9 @@ export function readDocument(
|
|||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
pk:
|
pk:
|
||||||
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey ? documentId.partitionKeyProperty : ""
|
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey
|
||||||
|
? documentId.partitionKeyProperty
|
||||||
|
: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
@@ -147,10 +151,10 @@ export function readDocument(
|
|||||||
...authHeaders(),
|
...authHeaders(),
|
||||||
[CosmosSDKConstants.HttpHeaders.PartitionKey]: encodeURIComponent(
|
[CosmosSDKConstants.HttpHeaders.PartitionKey]: encodeURIComponent(
|
||||||
JSON.stringify(documentId.partitionKeyHeader())
|
JSON.stringify(documentId.partitionKeyHeader())
|
||||||
)
|
),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}
|
}
|
||||||
@@ -175,7 +179,7 @@ export function createDocument(
|
|||||||
sid: userContext.subscriptionId,
|
sid: userContext.subscriptionId,
|
||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
pk: collection && collection.partitionKey && !collection.partitionKey.systemKey ? partitionKeyProperty : ""
|
pk: collection && collection.partitionKey && !collection.partitionKey.systemKey ? partitionKeyProperty : "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
@@ -186,10 +190,10 @@ export function createDocument(
|
|||||||
body: JSON.stringify(documentContent),
|
body: JSON.stringify(documentContent),
|
||||||
headers: {
|
headers: {
|
||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...authHeaders()
|
...authHeaders(),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}
|
}
|
||||||
@@ -218,7 +222,9 @@ export function updateDocument(
|
|||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
pk:
|
pk:
|
||||||
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey ? documentId.partitionKeyProperty : ""
|
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey
|
||||||
|
? documentId.partitionKeyProperty
|
||||||
|
: "",
|
||||||
};
|
};
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
|
|
||||||
@@ -230,10 +236,10 @@ export function updateDocument(
|
|||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...authHeaders(),
|
...authHeaders(),
|
||||||
[HttpHeaders.contentType]: "application/json",
|
[HttpHeaders.contentType]: "application/json",
|
||||||
[CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader())
|
[CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader()),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}
|
}
|
||||||
@@ -257,7 +263,9 @@ export function deleteDocument(databaseId: string, collection: Collection, docum
|
|||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
pk:
|
pk:
|
||||||
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey ? documentId.partitionKeyProperty : ""
|
documentId && documentId.partitionKey && !documentId.partitionKey.systemKey
|
||||||
|
? documentId.partitionKeyProperty
|
||||||
|
: "",
|
||||||
};
|
};
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
|
|
||||||
@@ -268,10 +276,10 @@ export function deleteDocument(databaseId: string, collection: Collection, docum
|
|||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...authHeaders(),
|
...authHeaders(),
|
||||||
[HttpHeaders.contentType]: "application/json",
|
[HttpHeaders.contentType]: "application/json",
|
||||||
[CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader())
|
[CosmosSDKConstants.HttpHeaders.PartitionKey]: JSON.stringify(documentId.partitionKeyHeader()),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -299,7 +307,7 @@ export function createMongoCollectionWithProxy(
|
|||||||
rg: userContext.resourceGroup,
|
rg: userContext.resourceGroup,
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
isAutoPilot: !!params.autoPilotMaxThroughput,
|
isAutoPilot: !!params.autoPilotMaxThroughput,
|
||||||
autoPilotThroughput: params.autoPilotMaxThroughput?.toString()
|
autoPilotThroughput: params.autoPilotMaxThroughput?.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const endpoint = getEndpoint();
|
const endpoint = getEndpoint();
|
||||||
@@ -314,11 +322,11 @@ export function createMongoCollectionWithProxy(
|
|||||||
headers: {
|
headers: {
|
||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...authHeaders(),
|
...authHeaders(),
|
||||||
[HttpHeaders.contentType]: "application/json"
|
[HttpHeaders.contentType]: "application/json",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}
|
}
|
||||||
@@ -329,7 +337,7 @@ export function createMongoCollectionWithProxy(
|
|||||||
export function getEndpoint(): string {
|
export function getEndpoint(): string {
|
||||||
let url = (configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT) + "/api/mongo/explorer";
|
let url = (configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT) + "/api/mongo/explorer";
|
||||||
|
|
||||||
if (window.authType === AuthType.EncryptedToken) {
|
if (userContext.authType === AuthType.EncryptedToken) {
|
||||||
url = url.replace("api/mongo", "api/guest/mongo");
|
url = url.replace("api/mongo", "api/guest/mongo");
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ describe("parseSDKOfferResponse", () => {
|
|||||||
offerThroughput: 500,
|
offerThroughput: 500,
|
||||||
collectionThroughputInfo: {
|
collectionThroughputInfo: {
|
||||||
minimumRUForCollection: 400,
|
minimumRUForCollection: 400,
|
||||||
numPhysicalPartitions: 1
|
numPhysicalPartitions: 1,
|
||||||
}
|
|
||||||
},
|
},
|
||||||
id: "test"
|
},
|
||||||
|
id: "test",
|
||||||
} as SDKOfferDefinition;
|
} as SDKOfferDefinition;
|
||||||
|
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
resource: mockOfferDefinition
|
resource: mockOfferDefinition,
|
||||||
} as OfferResponse;
|
} as OfferResponse;
|
||||||
|
|
||||||
const expectedResult: Offer = {
|
const expectedResult: Offer = {
|
||||||
@@ -25,7 +25,7 @@ describe("parseSDKOfferResponse", () => {
|
|||||||
minimumThroughput: 400,
|
minimumThroughput: 400,
|
||||||
id: "test",
|
id: "test",
|
||||||
offerDefinition: mockOfferDefinition,
|
offerDefinition: mockOfferDefinition,
|
||||||
offerReplacePending: false
|
offerReplacePending: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(OfferUtility.parseSDKOfferResponse(mockResponse)).toEqual(expectedResult);
|
expect(OfferUtility.parseSDKOfferResponse(mockResponse)).toEqual(expectedResult);
|
||||||
@@ -37,17 +37,17 @@ describe("parseSDKOfferResponse", () => {
|
|||||||
offerThroughput: 400,
|
offerThroughput: 400,
|
||||||
collectionThroughputInfo: {
|
collectionThroughputInfo: {
|
||||||
minimumRUForCollection: 400,
|
minimumRUForCollection: 400,
|
||||||
numPhysicalPartitions: 1
|
numPhysicalPartitions: 1,
|
||||||
},
|
},
|
||||||
offerAutopilotSettings: {
|
offerAutopilotSettings: {
|
||||||
maxThroughput: 5000
|
maxThroughput: 5000,
|
||||||
}
|
|
||||||
},
|
},
|
||||||
id: "test"
|
},
|
||||||
|
id: "test",
|
||||||
} as SDKOfferDefinition;
|
} as SDKOfferDefinition;
|
||||||
|
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
resource: mockOfferDefinition
|
resource: mockOfferDefinition,
|
||||||
} as OfferResponse;
|
} as OfferResponse;
|
||||||
|
|
||||||
const expectedResult: Offer = {
|
const expectedResult: Offer = {
|
||||||
@@ -56,7 +56,7 @@ describe("parseSDKOfferResponse", () => {
|
|||||||
minimumThroughput: 400,
|
minimumThroughput: 400,
|
||||||
id: "test",
|
id: "test",
|
||||||
offerDefinition: mockOfferDefinition,
|
offerDefinition: mockOfferDefinition,
|
||||||
offerReplacePending: false
|
offerReplacePending: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(OfferUtility.parseSDKOfferResponse(mockResponse)).toEqual(expectedResult);
|
expect(OfferUtility.parseSDKOfferResponse(mockResponse)).toEqual(expectedResult);
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ import { Offer, SDKOfferDefinition } from "../Contracts/DataModels";
|
|||||||
import { OfferResponse } from "@azure/cosmos";
|
import { OfferResponse } from "@azure/cosmos";
|
||||||
import { HttpHeaders } from "./Constants";
|
import { HttpHeaders } from "./Constants";
|
||||||
|
|
||||||
export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
|
export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer | undefined => {
|
||||||
const offerDefinition: SDKOfferDefinition = offerResponse?.resource;
|
const offerDefinition: SDKOfferDefinition | undefined = offerResponse?.resource;
|
||||||
|
if (!offerDefinition) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const offerContent = offerDefinition.content;
|
const offerContent = offerDefinition.content;
|
||||||
if (!offerContent) {
|
if (!offerContent) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -12,14 +15,14 @@ export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
|
|||||||
const minimumThroughput = offerContent.collectionThroughputInfo?.minimumRUForCollection;
|
const minimumThroughput = offerContent.collectionThroughputInfo?.minimumRUForCollection;
|
||||||
const autopilotSettings = offerContent.offerAutopilotSettings;
|
const autopilotSettings = offerContent.offerAutopilotSettings;
|
||||||
|
|
||||||
if (autopilotSettings) {
|
if (autopilotSettings && autopilotSettings.maxThroughput && minimumThroughput) {
|
||||||
return {
|
return {
|
||||||
id: offerDefinition.id,
|
id: offerDefinition.id,
|
||||||
autoscaleMaxThroughput: autopilotSettings.maxThroughput,
|
autoscaleMaxThroughput: autopilotSettings.maxThroughput,
|
||||||
manualThroughput: undefined,
|
manualThroughput: undefined,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerDefinition,
|
offerDefinition,
|
||||||
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true"
|
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +32,6 @@ export const parseSDKOfferResponse = (offerResponse: OfferResponse): Offer => {
|
|||||||
manualThroughput: offerContent.offerThroughput,
|
manualThroughput: offerContent.offerThroughput,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerDefinition,
|
offerDefinition,
|
||||||
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true"
|
offerReplacePending: offerResponse.headers?.[HttpHeaders.offerReplacePending] === "true",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const fetchPortalNotifications = async (): Promise<DataModels.Notificatio
|
|||||||
const headers = { [authorizationHeader.header]: authorizationHeader.token };
|
const headers = { [authorizationHeader.header]: authorizationHeader.token };
|
||||||
|
|
||||||
const response = await window.fetch(url, {
|
const response = await window.fetch(url, {
|
||||||
headers
|
headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class QueriesClient {
|
|||||||
private static readonly PartitionKey: DataModels.PartitionKey = {
|
private static readonly PartitionKey: DataModels.PartitionKey = {
|
||||||
paths: [`/${SavedQueries.PartitionKeyProperty}`],
|
paths: [`/${SavedQueries.PartitionKeyProperty}`],
|
||||||
kind: BackendDefaults.partitionKeyKind,
|
kind: BackendDefaults.partitionKeyKind,
|
||||||
version: BackendDefaults.partitionKeyVersion
|
version: BackendDefaults.partitionKeyVersion,
|
||||||
};
|
};
|
||||||
private static readonly FetchQuery: string = "SELECT * FROM c";
|
private static readonly FetchQuery: string = "SELECT * FROM c";
|
||||||
private static readonly FetchMongoQuery: string = "{}";
|
private static readonly FetchMongoQuery: string = "{}";
|
||||||
@@ -40,7 +40,7 @@ export class QueriesClient {
|
|||||||
databaseId: SavedQueries.DatabaseName,
|
databaseId: SavedQueries.DatabaseName,
|
||||||
partitionKey: QueriesClient.PartitionKey,
|
partitionKey: QueriesClient.PartitionKey,
|
||||||
offerThroughput: SavedQueries.OfferThroughput,
|
offerThroughput: SavedQueries.OfferThroughput,
|
||||||
databaseLevelThroughput: false
|
databaseLevelThroughput: false,
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
(collection: DataModels.Collection) => {
|
(collection: DataModels.Collection) => {
|
||||||
@@ -120,7 +120,7 @@ export class QueriesClient {
|
|||||||
resourceId: resourceId,
|
resourceId: resourceId,
|
||||||
queryName: queryName,
|
queryName: queryName,
|
||||||
query: query,
|
query: query,
|
||||||
id: id
|
id: id,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
this.validateQuery(parsedQuery);
|
this.validateQuery(parsedQuery);
|
||||||
@@ -161,7 +161,7 @@ export class QueriesClient {
|
|||||||
const documentId = new DocumentId(
|
const documentId = new DocumentId(
|
||||||
{
|
{
|
||||||
partitionKey: QueriesClient.PartitionKey,
|
partitionKey: QueriesClient.PartitionKey,
|
||||||
partitionKeyProperty: "id"
|
partitionKeyProperty: "id",
|
||||||
} as DocumentsTab,
|
} as DocumentsTab,
|
||||||
query,
|
query,
|
||||||
query.queryName
|
query.queryName
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { SplitterMetrics } from "./Constants";
|
|||||||
|
|
||||||
export enum SplitterDirection {
|
export enum SplitterDirection {
|
||||||
Horizontal = "horizontal",
|
Horizontal = "horizontal",
|
||||||
Vertical = "vertical"
|
Vertical = "vertical",
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SplitterBounds {
|
export interface SplitterBounds {
|
||||||
@@ -23,10 +23,10 @@ export class Splitter {
|
|||||||
public splitterId: string;
|
public splitterId: string;
|
||||||
public leftSideId: string;
|
public leftSideId: string;
|
||||||
|
|
||||||
public splitter: HTMLElement;
|
public splitter!: HTMLElement;
|
||||||
public leftSide: HTMLElement;
|
public leftSide!: HTMLElement;
|
||||||
public lastX: number;
|
public lastX!: number;
|
||||||
public lastWidth: number;
|
public lastWidth!: number;
|
||||||
|
|
||||||
private isCollapsed: ko.Observable<boolean>;
|
private isCollapsed: ko.Observable<boolean>;
|
||||||
private bounds: SplitterBounds;
|
private bounds: SplitterBounds;
|
||||||
@@ -42,15 +42,16 @@ export class Splitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public initialize() {
|
public initialize() {
|
||||||
this.splitter = document.getElementById(this.splitterId);
|
if (document.getElementById(this.splitterId) !== null && document.getElementById(this.leftSideId) != null) {
|
||||||
this.leftSide = document.getElementById(this.leftSideId);
|
this.splitter = <HTMLElement>document.getElementById(this.splitterId);
|
||||||
|
this.leftSide = <HTMLElement>document.getElementById(this.leftSideId);
|
||||||
|
}
|
||||||
const isVerticalSplitter: boolean = this.direction === SplitterDirection.Vertical;
|
const isVerticalSplitter: boolean = this.direction === SplitterDirection.Vertical;
|
||||||
const splitterOptions: JQueryUI.ResizableOptions = {
|
const splitterOptions: JQueryUI.ResizableOptions = {
|
||||||
animate: true,
|
animate: true,
|
||||||
animateDuration: "fast",
|
animateDuration: "fast",
|
||||||
start: this.onResizeStart,
|
start: this.onResizeStart,
|
||||||
stop: this.onResizeStop
|
stop: this.onResizeStop,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isVerticalSplitter) {
|
if (isVerticalSplitter) {
|
||||||
@@ -90,9 +91,7 @@ export class Splitter {
|
|||||||
this.lastWidth = $(this.leftSide).width();
|
this.lastWidth = $(this.leftSide).width();
|
||||||
$(this.splitter).css("left", SplitterMetrics.CollapsedPositionLeft);
|
$(this.splitter).css("left", SplitterMetrics.CollapsedPositionLeft);
|
||||||
$(this.leftSide).css("width", "");
|
$(this.leftSide).css("width", "");
|
||||||
$(this.leftSide)
|
$(this.leftSide).resizable("option", "disabled", true).removeClass("ui-resizable-disabled"); // remove class so splitter is visible
|
||||||
.resizable("option", "disabled", true)
|
|
||||||
.removeClass("ui-resizable-disabled"); // remove class so splitter is visible
|
|
||||||
$(this.splitter).removeClass("ui-resizable-e");
|
$(this.splitter).removeClass("ui-resizable-e");
|
||||||
this.isCollapsed(true);
|
this.isCollapsed(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
export default class ThemeUtility {
|
export function getMonacoTheme(theme: string): string {
|
||||||
public static getMonacoTheme(theme: string): string {
|
|
||||||
switch (theme) {
|
switch (theme) {
|
||||||
case "default":
|
case "default":
|
||||||
case "hc-white":
|
case "hc-white":
|
||||||
@@ -16,4 +15,3 @@ export default class ThemeUtility {
|
|||||||
return "vs";
|
return "vs";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ export default class UrlUtility {
|
|||||||
type: type,
|
type: type,
|
||||||
objectBody: {
|
objectBody: {
|
||||||
id: id,
|
id: id,
|
||||||
self: resourcePath
|
self: resourcePath,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -14,38 +14,42 @@ describe("createCollection", () => {
|
|||||||
collectionId: "testContainer",
|
collectionId: "testContainer",
|
||||||
databaseId: "testDatabase",
|
databaseId: "testDatabase",
|
||||||
databaseLevelThroughput: true,
|
databaseLevelThroughput: true,
|
||||||
offerThroughput: 400
|
offerThroughput: 400,
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await createCollection(createCollectionParams);
|
await createCollection(createCollectionParams);
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
databases: {
|
databases: {
|
||||||
createIfNotExists: () => {
|
createIfNotExists: () => {
|
||||||
return {
|
return {
|
||||||
database: {
|
database: {
|
||||||
containers: {
|
containers: {
|
||||||
create: () => ({})
|
create: () => ({}),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await createCollection(createCollectionParams);
|
await createCollection(createCollectionParams);
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
@@ -59,7 +63,7 @@ describe("createCollection", () => {
|
|||||||
collectionId: "testContainer",
|
collectionId: "testContainer",
|
||||||
databaseId: "testDatabase",
|
databaseId: "testDatabase",
|
||||||
databaseLevelThroughput: false,
|
databaseLevelThroughput: false,
|
||||||
offerThroughput: 400
|
offerThroughput: 400,
|
||||||
};
|
};
|
||||||
expect(constructRpOptions(manualThroughputParams)).toEqual({ throughput: 400 });
|
expect(constructRpOptions(manualThroughputParams)).toEqual({ throughput: 400 });
|
||||||
|
|
||||||
@@ -69,12 +73,12 @@ describe("createCollection", () => {
|
|||||||
databaseId: "testDatabase",
|
databaseId: "testDatabase",
|
||||||
databaseLevelThroughput: false,
|
databaseLevelThroughput: false,
|
||||||
offerThroughput: 400,
|
offerThroughput: 400,
|
||||||
autoPilotMaxThroughput: 4000
|
autoPilotMaxThroughput: 4000,
|
||||||
};
|
};
|
||||||
expect(constructRpOptions(autoPilotThroughputParams)).toEqual({
|
expect(constructRpOptions(autoPilotThroughputParams)).toEqual({
|
||||||
autoscaleSettings: {
|
autoscaleSettings: {
|
||||||
maxThroughput: 4000
|
maxThroughput: 4000,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import { createMongoCollectionWithProxy } from "../MongoProxyClient";
|
|||||||
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraTable,
|
createUpdateCassandraTable,
|
||||||
getCassandraTable
|
getCassandraTable,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBCollection,
|
createUpdateMongoDBCollection,
|
||||||
getMongoDBCollection
|
getMongoDBCollection,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
||||||
import {
|
import {
|
||||||
createUpdateGremlinGraph,
|
createUpdateGremlinGraph,
|
||||||
getGremlinGraph
|
getGremlinGraph,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
||||||
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
||||||
import { logConsoleProgress, logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress, logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -35,13 +35,13 @@ export const createCollection = async (params: DataModels.CreateCollectionParams
|
|||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
let collection: DataModels.Collection;
|
let collection: DataModels.Collection;
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
if (params.createNewDatabase) {
|
if (params.createNewDatabase) {
|
||||||
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
const createDatabaseParams: DataModels.CreateDatabaseParams = {
|
||||||
autoPilotMaxThroughput: params.autoPilotMaxThroughput,
|
autoPilotMaxThroughput: params.autoPilotMaxThroughput,
|
||||||
databaseId: params.databaseId,
|
databaseId: params.databaseId,
|
||||||
databaseLevelThroughput: params.databaseLevelThroughput,
|
databaseLevelThroughput: params.databaseLevelThroughput,
|
||||||
offerThroughput: params.offerThroughput
|
offerThroughput: params.offerThroughput,
|
||||||
};
|
};
|
||||||
await createDatabase(createDatabaseParams);
|
await createDatabase(createDatabaseParams);
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ const createSqlContainer = async (params: DataModels.CreateCollectionParams): Pr
|
|||||||
|
|
||||||
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
||||||
const resource: ARMTypes.SqlContainerResource = {
|
const resource: ARMTypes.SqlContainerResource = {
|
||||||
id: params.collectionId
|
id: params.collectionId,
|
||||||
};
|
};
|
||||||
if (params.analyticalStorageTtl) {
|
if (params.analyticalStorageTtl) {
|
||||||
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
||||||
@@ -118,8 +118,8 @@ const createSqlContainer = async (params: DataModels.CreateCollectionParams): Pr
|
|||||||
const rpPayload: ARMTypes.SqlDatabaseCreateUpdateParameters = {
|
const rpPayload: ARMTypes.SqlDatabaseCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource,
|
resource,
|
||||||
options
|
options,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = await createUpdateSqlContainer(
|
const createResponse = await createUpdateSqlContainer(
|
||||||
@@ -154,7 +154,7 @@ const createMongoCollection = async (params: DataModels.CreateCollectionParams):
|
|||||||
|
|
||||||
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
||||||
const resource: ARMTypes.MongoDBCollectionResource = {
|
const resource: ARMTypes.MongoDBCollectionResource = {
|
||||||
id: params.collectionId
|
id: params.collectionId,
|
||||||
};
|
};
|
||||||
if (params.analyticalStorageTtl) {
|
if (params.analyticalStorageTtl) {
|
||||||
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
||||||
@@ -170,8 +170,8 @@ const createMongoCollection = async (params: DataModels.CreateCollectionParams):
|
|||||||
const rpPayload: ARMTypes.MongoDBCollectionCreateUpdateParameters = {
|
const rpPayload: ARMTypes.MongoDBCollectionCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource,
|
resource,
|
||||||
options
|
options,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = await createUpdateMongoDBCollection(
|
const createResponse = await createUpdateMongoDBCollection(
|
||||||
@@ -185,7 +185,7 @@ const createMongoCollection = async (params: DataModels.CreateCollectionParams):
|
|||||||
|
|
||||||
if (params.createMongoWildcardIndex) {
|
if (params.createMongoWildcardIndex) {
|
||||||
TelemetryProcessor.trace(Action.CreateMongoCollectionWithWildcardIndex, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.CreateMongoCollectionWithWildcardIndex, ActionModifiers.Mark, {
|
||||||
message: "Mongo Collection created with wildcard index on all fields."
|
message: "Mongo Collection created with wildcard index on all fields.",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ const createCassandraTable = async (params: DataModels.CreateCollectionParams):
|
|||||||
|
|
||||||
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
||||||
const resource: ARMTypes.CassandraTableResource = {
|
const resource: ARMTypes.CassandraTableResource = {
|
||||||
id: params.collectionId
|
id: params.collectionId,
|
||||||
};
|
};
|
||||||
if (params.analyticalStorageTtl) {
|
if (params.analyticalStorageTtl) {
|
||||||
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
||||||
@@ -221,8 +221,8 @@ const createCassandraTable = async (params: DataModels.CreateCollectionParams):
|
|||||||
const rpPayload: ARMTypes.CassandraTableCreateUpdateParameters = {
|
const rpPayload: ARMTypes.CassandraTableCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource,
|
resource,
|
||||||
options
|
options,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = await createUpdateCassandraTable(
|
const createResponse = await createUpdateCassandraTable(
|
||||||
@@ -256,7 +256,7 @@ const createGraph = async (params: DataModels.CreateCollectionParams): Promise<D
|
|||||||
|
|
||||||
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
||||||
const resource: ARMTypes.GremlinGraphResource = {
|
const resource: ARMTypes.GremlinGraphResource = {
|
||||||
id: params.collectionId
|
id: params.collectionId,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (params.indexingPolicy) {
|
if (params.indexingPolicy) {
|
||||||
@@ -272,8 +272,8 @@ const createGraph = async (params: DataModels.CreateCollectionParams): Promise<D
|
|||||||
const rpPayload: ARMTypes.GremlinGraphCreateUpdateParameters = {
|
const rpPayload: ARMTypes.GremlinGraphCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource,
|
resource,
|
||||||
options
|
options,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = await createUpdateGremlinGraph(
|
const createResponse = await createUpdateGremlinGraph(
|
||||||
@@ -306,14 +306,14 @@ const createTable = async (params: DataModels.CreateCollectionParams): Promise<D
|
|||||||
|
|
||||||
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
const options: ARMTypes.CreateUpdateOptions = constructRpOptions(params);
|
||||||
const resource: ARMTypes.TableResource = {
|
const resource: ARMTypes.TableResource = {
|
||||||
id: params.collectionId
|
id: params.collectionId,
|
||||||
};
|
};
|
||||||
|
|
||||||
const rpPayload: ARMTypes.TableCreateUpdateParameters = {
|
const rpPayload: ARMTypes.TableCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource,
|
resource,
|
||||||
options
|
options,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = await createUpdateTable(
|
const createResponse = await createUpdateTable(
|
||||||
@@ -334,13 +334,13 @@ export const constructRpOptions = (params: DataModels.CreateDatabaseParams): ARM
|
|||||||
if (params.autoPilotMaxThroughput) {
|
if (params.autoPilotMaxThroughput) {
|
||||||
return {
|
return {
|
||||||
autoscaleSettings: {
|
autoscaleSettings: {
|
||||||
maxThroughput: params.autoPilotMaxThroughput
|
maxThroughput: params.autoPilotMaxThroughput,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
throughput: params.offerThroughput
|
throughput: params.offerThroughput,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ const createCollectionWithSDK = async (params: DataModels.CreateCollectionParams
|
|||||||
partitionKey: params.partitionKey || undefined,
|
partitionKey: params.partitionKey || undefined,
|
||||||
indexingPolicy: params.indexingPolicy || undefined,
|
indexingPolicy: params.indexingPolicy || undefined,
|
||||||
uniqueKeyPolicy: params.uniqueKeyPolicy || undefined,
|
uniqueKeyPolicy: params.uniqueKeyPolicy || undefined,
|
||||||
analyticalStorageTtl: params.analyticalStorageTtl
|
analyticalStorageTtl: params.analyticalStorageTtl,
|
||||||
} as ContainerRequest; // TODO: remove cast when https://github.com/Azure/azure-cosmos-js/issues/423 is fixed
|
} as ContainerRequest; // TODO: remove cast when https://github.com/Azure/azure-cosmos-js/issues/423 is fixed
|
||||||
const collectionOptions: RequestOptions = {};
|
const collectionOptions: RequestOptions = {};
|
||||||
const createDatabaseBody: DatabaseRequest = { id: params.databaseId };
|
const createDatabaseBody: DatabaseRequest = { id: params.databaseId };
|
||||||
|
|||||||
@@ -8,21 +8,21 @@ import {
|
|||||||
GremlinDatabaseCreateUpdateParameters,
|
GremlinDatabaseCreateUpdateParameters,
|
||||||
MongoDBDatabaseCreateUpdateParameters,
|
MongoDBDatabaseCreateUpdateParameters,
|
||||||
SqlDatabaseCreateUpdateParameters,
|
SqlDatabaseCreateUpdateParameters,
|
||||||
CreateUpdateOptions
|
CreateUpdateOptions,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { createUpdateSqlDatabase, getSqlDatabase } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlDatabase, getSqlDatabase } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraKeyspace,
|
createUpdateCassandraKeyspace,
|
||||||
getCassandraKeyspace
|
getCassandraKeyspace,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBDatabase,
|
createUpdateMongoDBDatabase,
|
||||||
getMongoDBDatabase
|
getMongoDBDatabase,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
||||||
import {
|
import {
|
||||||
createUpdateGremlinDatabase,
|
createUpdateGremlinDatabase,
|
||||||
getGremlinDatabase
|
getGremlinDatabase,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { logConsoleProgress, logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress, logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -34,7 +34,7 @@ export async function createDatabase(params: DataModels.CreateDatabaseParams): P
|
|||||||
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
throw new Error("Creating database resources is not allowed for tables accounts");
|
throw new Error("Creating database resources is not allowed for tables accounts");
|
||||||
}
|
}
|
||||||
const database: DataModels.Database = await (window.authType === AuthType.AAD && !userContext.useSDKOperations
|
const database: DataModels.Database = await (userContext.authType === AuthType.AAD && !userContext.useSDKOperations
|
||||||
? createDatabaseWithARM(params)
|
? createDatabaseWithARM(params)
|
||||||
: createDatabaseWithSDK(params));
|
: createDatabaseWithSDK(params));
|
||||||
|
|
||||||
@@ -85,10 +85,10 @@ async function createSqlDatabase(params: DataModels.CreateDatabaseParams): Promi
|
|||||||
const rpPayload: SqlDatabaseCreateUpdateParameters = {
|
const rpPayload: SqlDatabaseCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: {
|
resource: {
|
||||||
id: params.databaseId
|
id: params.databaseId,
|
||||||
|
},
|
||||||
|
options,
|
||||||
},
|
},
|
||||||
options
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const createResponse = await createUpdateSqlDatabase(
|
const createResponse = await createUpdateSqlDatabase(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
@@ -121,10 +121,10 @@ async function createMongoDatabase(params: DataModels.CreateDatabaseParams): Pro
|
|||||||
const rpPayload: MongoDBDatabaseCreateUpdateParameters = {
|
const rpPayload: MongoDBDatabaseCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: {
|
resource: {
|
||||||
id: params.databaseId
|
id: params.databaseId,
|
||||||
|
},
|
||||||
|
options,
|
||||||
},
|
},
|
||||||
options
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const createResponse = await createUpdateMongoDBDatabase(
|
const createResponse = await createUpdateMongoDBDatabase(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
@@ -157,10 +157,10 @@ async function createCassandraKeyspace(params: DataModels.CreateDatabaseParams):
|
|||||||
const rpPayload: CassandraKeyspaceCreateUpdateParameters = {
|
const rpPayload: CassandraKeyspaceCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: {
|
resource: {
|
||||||
id: params.databaseId
|
id: params.databaseId,
|
||||||
|
},
|
||||||
|
options,
|
||||||
},
|
},
|
||||||
options
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const createResponse = await createUpdateCassandraKeyspace(
|
const createResponse = await createUpdateCassandraKeyspace(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
@@ -193,10 +193,10 @@ async function createGremlineDatabase(params: DataModels.CreateDatabaseParams):
|
|||||||
const rpPayload: GremlinDatabaseCreateUpdateParameters = {
|
const rpPayload: GremlinDatabaseCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: {
|
resource: {
|
||||||
id: params.databaseId
|
id: params.databaseId,
|
||||||
|
},
|
||||||
|
options,
|
||||||
},
|
},
|
||||||
options
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const createResponse = await createUpdateGremlinDatabase(
|
const createResponse = await createUpdateGremlinDatabase(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
@@ -231,12 +231,12 @@ function constructRpOptions(params: DataModels.CreateDatabaseParams): CreateUpda
|
|||||||
if (params.autoPilotMaxThroughput) {
|
if (params.autoPilotMaxThroughput) {
|
||||||
return {
|
return {
|
||||||
autoscaleSettings: {
|
autoscaleSettings: {
|
||||||
maxThroughput: params.autoPilotMaxThroughput
|
maxThroughput: params.autoPilotMaxThroughput,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
throughput: params.offerThroughput
|
throughput: params.offerThroughput,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType
|
|||||||
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
||||||
import {
|
import {
|
||||||
SqlStoredProcedureCreateUpdateParameters,
|
SqlStoredProcedureCreateUpdateParameters,
|
||||||
SqlStoredProcedureResource
|
SqlStoredProcedureResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlStoredProcedure,
|
createUpdateSqlStoredProcedure,
|
||||||
getSqlStoredProcedure
|
getSqlStoredProcedure,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -22,7 +22,7 @@ export async function createStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`);
|
const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -49,8 +49,8 @@ export async function createStoredProcedure(
|
|||||||
const createSprocParams: SqlStoredProcedureCreateUpdateParameters = {
|
const createSprocParams: SqlStoredProcedureCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: storedProcedure as SqlStoredProcedureResource,
|
resource: storedProcedure as SqlStoredProcedureResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlStoredProcedure(
|
const rpResponse = await createUpdateSqlStoredProcedure(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType
|
|||||||
import { Resource, TriggerDefinition } from "@azure/cosmos";
|
import { Resource, TriggerDefinition } from "@azure/cosmos";
|
||||||
import {
|
import {
|
||||||
SqlTriggerCreateUpdateParameters,
|
SqlTriggerCreateUpdateParameters,
|
||||||
SqlTriggerResource
|
SqlTriggerResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
@@ -19,7 +19,7 @@ export async function createTrigger(
|
|||||||
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -44,8 +44,8 @@ export async function createTrigger(
|
|||||||
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: trigger as SqlTriggerResource,
|
resource: trigger as SqlTriggerResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlTrigger(
|
const rpResponse = await createUpdateSqlTrigger(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
@@ -59,10 +59,7 @@ export async function createTrigger(
|
|||||||
return rpResponse && (rpResponse.properties?.resource as TriggerDefinition & Resource);
|
return rpResponse && (rpResponse.properties?.resource as TriggerDefinition & Resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client()
|
const response = await client().database(databaseId).container(collectionId).scripts.triggers.create(trigger);
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.scripts.triggers.create(trigger);
|
|
||||||
return response.resource;
|
return response.resource;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "CreateTrigger", `Error while creating trigger ${trigger.id}`);
|
handleError(error, "CreateTrigger", `Error while creating trigger ${trigger.id}`);
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType
|
|||||||
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
||||||
import {
|
import {
|
||||||
SqlUserDefinedFunctionCreateUpdateParameters,
|
SqlUserDefinedFunctionCreateUpdateParameters,
|
||||||
SqlUserDefinedFunctionResource
|
SqlUserDefinedFunctionResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlUserDefinedFunction,
|
createUpdateSqlUserDefinedFunction,
|
||||||
getSqlUserDefinedFunction
|
getSqlUserDefinedFunction,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -22,7 +22,7 @@ export async function createUserDefinedFunction(
|
|||||||
const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`);
|
const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -49,8 +49,8 @@ export async function createUserDefinedFunction(
|
|||||||
const createUDFParams: SqlUserDefinedFunctionCreateUpdateParameters = {
|
const createUDFParams: SqlUserDefinedFunctionCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: userDefinedFunction as SqlUserDefinedFunctionResource,
|
resource: userDefinedFunction as SqlUserDefinedFunctionResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlUserDefinedFunction(
|
const rpResponse = await createUpdateSqlUserDefinedFunction(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
|
|||||||
@@ -13,30 +13,34 @@ describe("deleteCollection", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await deleteCollection("database", "collection");
|
await deleteCollection("database", "collection");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
container: () => {
|
container: () => {
|
||||||
return {
|
return {
|
||||||
delete: (): unknown => undefined
|
delete: (): unknown => undefined,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await deleteCollection("database", "collection");
|
await deleteCollection("database", "collection");
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
|
|||||||
@@ -13,13 +13,10 @@ import { client } from "../CosmosClient";
|
|||||||
export async function deleteCollection(databaseId: string, collectionId: string): Promise<void> {
|
export async function deleteCollection(databaseId: string, collectionId: string): Promise<void> {
|
||||||
const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
await deleteCollectionWithARM(databaseId, collectionId);
|
await deleteCollectionWithARM(databaseId, collectionId);
|
||||||
} else {
|
} else {
|
||||||
await client()
|
await client().database(databaseId).container(collectionId).delete();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.delete();
|
|
||||||
}
|
}
|
||||||
logConsoleInfo(`Successfully deleted container ${collectionId}`);
|
logConsoleInfo(`Successfully deleted container ${collectionId}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const deleteConflict = async (collection: CollectionBase, conflictId: Con
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {
|
const options = {
|
||||||
partitionKey: getPartitionKeyHeaderForConflict(conflictId)
|
partitionKey: getPartitionKeyHeaderForConflict(conflictId),
|
||||||
};
|
};
|
||||||
|
|
||||||
await client()
|
await client()
|
||||||
|
|||||||
@@ -13,26 +13,30 @@ describe("deleteDatabase", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await deleteDatabase("database");
|
await deleteDatabase("database");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
delete: (): unknown => undefined
|
delete: (): unknown => undefined,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await deleteDatabase("database");
|
await deleteDatabase("database");
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
|
|||||||
@@ -16,12 +16,10 @@ export async function deleteDatabase(databaseId: string): Promise<void> {
|
|||||||
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
throw new Error("Deleting database resources is not allowed for tables accounts");
|
throw new Error("Deleting database resources is not allowed for tables accounts");
|
||||||
}
|
}
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
await deleteDatabaseWithARM(databaseId);
|
await deleteDatabaseWithARM(databaseId);
|
||||||
} else {
|
} else {
|
||||||
await client()
|
await client().database(databaseId).delete();
|
||||||
.database(databaseId)
|
|
||||||
.delete();
|
|
||||||
}
|
}
|
||||||
logConsoleInfo(`Successfully deleted database ${databaseId}`);
|
logConsoleInfo(`Successfully deleted database ${databaseId}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function deleteStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`);
|
const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -27,11 +27,7 @@ export async function deleteStoredProcedure(
|
|||||||
storedProcedureId
|
storedProcedureId
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await client()
|
await client().database(databaseId).container(collectionId).scripts.storedProcedure(storedProcedureId).delete();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.scripts.storedProcedure(storedProcedureId)
|
|
||||||
.delete();
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "DeleteStoredProcedure", `Error while deleting stored procedure ${storedProcedureId}`);
|
handleError(error, "DeleteStoredProcedure", `Error while deleting stored procedure ${storedProcedureId}`);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export async function deleteTrigger(databaseId: string, collectionId: string, tr
|
|||||||
const clearMessage = logConsoleProgress(`Deleting trigger ${triggerId}`);
|
const clearMessage = logConsoleProgress(`Deleting trigger ${triggerId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -23,11 +23,7 @@ export async function deleteTrigger(databaseId: string, collectionId: string, tr
|
|||||||
triggerId
|
triggerId
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await client()
|
await client().database(databaseId).container(collectionId).scripts.trigger(triggerId).delete();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.scripts.trigger(triggerId)
|
|
||||||
.delete();
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "DeleteTrigger", `Error while deleting trigger ${triggerId}`);
|
handleError(error, "DeleteTrigger", `Error while deleting trigger ${triggerId}`);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export async function deleteUserDefinedFunction(databaseId: string, collectionId
|
|||||||
const clearMessage = logConsoleProgress(`Deleting user defined function ${id}`);
|
const clearMessage = logConsoleProgress(`Deleting user defined function ${id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -23,11 +23,7 @@ export async function deleteUserDefinedFunction(databaseId: string, collectionId
|
|||||||
id
|
id
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await client()
|
await client().database(databaseId).container(collectionId).scripts.userDefinedFunction(id).delete();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.scripts.userDefinedFunction(id)
|
|
||||||
.delete();
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "DeleteUserDefinedFunction", `Error while deleting user defined function ${id}`);
|
handleError(error, "DeleteUserDefinedFunction", `Error while deleting user defined function ${id}`);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const executeStoredProcedure = async (
|
|||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
result: response.resource,
|
result: response.resource,
|
||||||
scriptLogs: response.headers[HttpHeaders.scriptLogResults] as string
|
scriptLogs: response.headers[HttpHeaders.scriptLogResults] as string,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(
|
handleError(
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ interface MetricsResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getCollectionUsageSizeInKB = async (databaseName: string, containerName: string): Promise<number> => {
|
export const getCollectionUsageSizeInKB = async (databaseName: string, containerName: string): Promise<number> => {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +60,8 @@ export const getCollectionUsageSizeInKB = async (databaseName: string, container
|
|||||||
apiVersion: "2018-01-01",
|
apiVersion: "2018-01-01",
|
||||||
queryParams: {
|
queryParams: {
|
||||||
filter,
|
filter,
|
||||||
metricNames
|
metricNames,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (metricsResponse?.value?.length !== 2) {
|
if (metricsResponse?.value?.length !== 2) {
|
||||||
@@ -76,7 +76,7 @@ export const getCollectionUsageSizeInKB = async (databaseName: string, container
|
|||||||
return dataUsageSizeInKb + indexUsageSizeInKb;
|
return dataUsageSizeInKb + indexUsageSizeInKb;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "getCollectionUsageSize");
|
handleError(error, "getCollectionUsageSize");
|
||||||
throw error;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,16 @@ import { handleError } from "../ErrorHandlingUtils";
|
|||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import * as Constants from "../Constants";
|
import * as Constants from "../Constants";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
|
import { userContext } from "../../UserContext";
|
||||||
|
|
||||||
export async function getIndexTransformationProgress(databaseId: string, collectionId: string): Promise<number> {
|
export async function getIndexTransformationProgress(databaseId: string, collectionId: string): Promise<number> {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let indexTransformationPercentage: number;
|
let indexTransformationPercentage: number;
|
||||||
const clearMessage = logConsoleProgress(`Reading container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Reading container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
const response = await client()
|
const response = await client().database(databaseId).container(collectionId).read({ populateQuotaInfo: true });
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.read({ populateQuotaInfo: true });
|
|
||||||
|
|
||||||
indexTransformationPercentage = parseInt(
|
indexTransformationPercentage = parseInt(
|
||||||
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string
|
response.headers[Constants.HttpHeaders.collectionIndexTransformationProgress] as string
|
||||||
|
|||||||
@@ -7,8 +7,5 @@ export const queryConflicts = (
|
|||||||
query: string,
|
query: string,
|
||||||
options: FeedOptions
|
options: FeedOptions
|
||||||
): QueryIterator<ConflictDefinition & Resource> => {
|
): QueryIterator<ConflictDefinition & Resource> => {
|
||||||
return client()
|
return client().database(databaseId).container(containerId).conflicts.query(query, options);
|
||||||
.database(databaseId)
|
|
||||||
.container(containerId)
|
|
||||||
.conflicts.query(query, options);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,10 +10,7 @@ export const queryDocuments = (
|
|||||||
options: FeedOptions
|
options: FeedOptions
|
||||||
): QueryIterator<ItemDefinition & Resource> => {
|
): QueryIterator<ItemDefinition & Resource> => {
|
||||||
options = getCommonQueryOptions(options);
|
options = getCommonQueryOptions(options);
|
||||||
return client()
|
return client().database(databaseId).container(containerId).items.query(query, options);
|
||||||
.database(databaseId)
|
|
||||||
.container(containerId)
|
|
||||||
.items.query(query, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCommonQueryOptions = (options: FeedOptions): FeedOptions => {
|
export const getCommonQueryOptions = (options: FeedOptions): FeedOptions => {
|
||||||
|
|||||||
@@ -9,25 +9,25 @@ import { updateUserContext } from "../../UserContext";
|
|||||||
describe("readCollection", () => {
|
describe("readCollection", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
|
authType: AuthType.ResourceToken,
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if logged in with resource token", async () => {
|
it("should call SDK if logged in with resource token", async () => {
|
||||||
window.authType = AuthType.ResourceToken;
|
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
container: () => {
|
container: () => {
|
||||||
return {
|
return {
|
||||||
read: (): unknown => ({})
|
read: (): unknown => ({}),
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await readCollection("database", "collection");
|
await readCollection("database", "collection");
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ export async function readCollection(databaseId: string, collectionId: string):
|
|||||||
let collection: DataModels.Collection;
|
let collection: DataModels.Collection;
|
||||||
const clearMessage = logConsoleProgress(`Querying container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
const response = await client()
|
const response = await client().database(databaseId).container(collectionId).read();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.read();
|
|
||||||
collection = response.resource as DataModels.Collection;
|
collection = response.resource as DataModels.Collection;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "ReadCollection", `Error while querying container ${collectionId}`);
|
handleError(error, "ReadCollection", `Error while querying container ${collectionId}`);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const readCollectionOffer = async (params: ReadCollectionOfferParams): Pr
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
@@ -106,7 +106,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
|
|||||||
autoscaleMaxThroughput: autoscaleSettings.maxThroughput,
|
autoscaleMaxThroughput: autoscaleSettings.maxThroughput,
|
||||||
manualThroughput: undefined,
|
manualThroughput: undefined,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerReplacePending: resource.offerReplacePending === "true"
|
offerReplacePending: resource.offerReplacePending === "true",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri
|
|||||||
autoscaleMaxThroughput: undefined,
|
autoscaleMaxThroughput: undefined,
|
||||||
manualThroughput: resource.throughput,
|
manualThroughput: resource.throughput,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerReplacePending: resource.offerReplacePending === "true"
|
offerReplacePending: resource.offerReplacePending === "true",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,32 +12,36 @@ describe("readCollections", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await readCollections("database");
|
await readCollections("database");
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
database: () => {
|
database: () => {
|
||||||
return {
|
return {
|
||||||
containers: {
|
containers: {
|
||||||
readAll: () => {
|
readAll: () => {
|
||||||
return {
|
return {
|
||||||
fetchAll: (): unknown => []
|
fetchAll: (): unknown => [],
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await readCollections("database");
|
await readCollections("database");
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export async function readCollections(databaseId: string): Promise<DataModels.Co
|
|||||||
const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`);
|
const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
@@ -23,10 +23,7 @@ export async function readCollections(databaseId: string): Promise<DataModels.Co
|
|||||||
return await readCollectionsWithARM(databaseId);
|
return await readCollectionsWithARM(databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const sdkResponse = await client()
|
const sdkResponse = await client().database(databaseId).containers.readAll().fetchAll();
|
||||||
.database(databaseId)
|
|
||||||
.containers.readAll()
|
|
||||||
.fetchAll();
|
|
||||||
return sdkResponse.resources as DataModels.Collection[];
|
return sdkResponse.resources as DataModels.Collection[];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "ReadCollections", `Error while querying containers for database ${databaseId}`);
|
handleError(error, "ReadCollections", `Error while querying containers for database ${databaseId}`);
|
||||||
@@ -63,5 +60,5 @@ async function readCollectionsWithARM(databaseId: string): Promise<DataModels.Co
|
|||||||
throw new Error(`Unsupported default experience type: ${defaultExperience}`);
|
throw new Error(`Unsupported default experience type: ${defaultExperience}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rpResponse?.value?.map(collection => collection.properties?.resource as DataModels.Collection);
|
return rpResponse?.value?.map((collection) => collection.properties?.resource as DataModels.Collection);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const readDatabaseOffer = async (params: ReadDatabaseOfferParams): Promis
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
@@ -78,7 +78,7 @@ const readDatabaseOfferWithARM = async (databaseId: string): Promise<Offer> => {
|
|||||||
autoscaleMaxThroughput: autoscaleSettings.maxThroughput,
|
autoscaleMaxThroughput: autoscaleSettings.maxThroughput,
|
||||||
manualThroughput: undefined,
|
manualThroughput: undefined,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerReplacePending: resource.offerReplacePending === "true"
|
offerReplacePending: resource.offerReplacePending === "true",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ const readDatabaseOfferWithARM = async (databaseId: string): Promise<Offer> => {
|
|||||||
autoscaleMaxThroughput: undefined,
|
autoscaleMaxThroughput: undefined,
|
||||||
manualThroughput: resource.throughput,
|
manualThroughput: resource.throughput,
|
||||||
minimumThroughput,
|
minimumThroughput,
|
||||||
offerReplacePending: resource.offerReplacePending === "true"
|
offerReplacePending: resource.offerReplacePending === "true",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,28 +12,32 @@ describe("readDatabases", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
name: "test"
|
name: "test",
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
defaultExperience: DefaultAccountExperienceType.DocumentDB
|
defaultExperience: DefaultAccountExperienceType.DocumentDB,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call ARM if logged in with AAD", async () => {
|
it("should call ARM if logged in with AAD", async () => {
|
||||||
window.authType = AuthType.AAD;
|
updateUserContext({
|
||||||
|
authType: AuthType.AAD,
|
||||||
|
});
|
||||||
await readDatabases();
|
await readDatabases();
|
||||||
expect(armRequest).toHaveBeenCalled();
|
expect(armRequest).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call SDK if not logged in with non-AAD method", async () => {
|
it("should call SDK if not logged in with non-AAD method", async () => {
|
||||||
window.authType = AuthType.MasterKey;
|
updateUserContext({
|
||||||
|
authType: AuthType.MasterKey,
|
||||||
|
});
|
||||||
(client as jest.Mock).mockReturnValue({
|
(client as jest.Mock).mockReturnValue({
|
||||||
databases: {
|
databases: {
|
||||||
readAll: () => {
|
readAll: () => {
|
||||||
return {
|
return {
|
||||||
fetchAll: (): unknown => []
|
fetchAll: (): unknown => [],
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await readDatabases();
|
await readDatabases();
|
||||||
expect(client).toHaveBeenCalled();
|
expect(client).toHaveBeenCalled();
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ export async function readDatabases(): Promise<DataModels.Database[]> {
|
|||||||
const clearMessage = logConsoleProgress(`Querying databases`);
|
const clearMessage = logConsoleProgress(`Querying databases`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
) {
|
) {
|
||||||
databases = await readDatabasesWithARM();
|
databases = await readDatabasesWithARM();
|
||||||
} else {
|
} else {
|
||||||
const sdkResponse = await client()
|
const sdkResponse = await client().databases.readAll().fetchAll();
|
||||||
.databases.readAll()
|
|
||||||
.fetchAll();
|
|
||||||
databases = sdkResponse.resources as DataModels.Database[];
|
databases = sdkResponse.resources as DataModels.Database[];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -58,5 +56,5 @@ async function readDatabasesWithARM(): Promise<DataModels.Database[]> {
|
|||||||
throw new Error(`Unsupported default experience type: ${defaultExperience}`);
|
throw new Error(`Unsupported default experience type: ${defaultExperience}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rpResponse?.value?.map(database => database.properties?.resource as DataModels.Database);
|
return rpResponse?.value?.map((database) => database.properties?.resource as DataModels.Database);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export async function readMongoDBCollectionThroughRP(
|
|||||||
databaseId: string,
|
databaseId: string,
|
||||||
collectionId: string
|
collectionId: string
|
||||||
): Promise<MongoDBCollectionResource> {
|
): Promise<MongoDBCollectionResource> {
|
||||||
if (window.authType !== AuthType.AAD) {
|
if (userContext.authType !== AuthType.AAD) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let collection: MongoDBCollectionResource;
|
let collection: MongoDBCollectionResource;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { readOffers } from "./readOffers";
|
|||||||
export const readOfferWithSDK = async (offerId: string, resourceId: string): Promise<Offer> => {
|
export const readOfferWithSDK = async (offerId: string, resourceId: string): Promise<Offer> => {
|
||||||
if (!offerId) {
|
if (!offerId) {
|
||||||
const offers = await readOffers();
|
const offers = await readOffers();
|
||||||
const offer = offers.find(offer => offer.resource === resourceId);
|
const offer = offers.find((offer) => offer.resource === resourceId);
|
||||||
|
|
||||||
if (!offer) {
|
if (!offer) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -18,12 +18,10 @@ export const readOfferWithSDK = async (offerId: string, resourceId: string): Pro
|
|||||||
|
|
||||||
const options: RequestOptions = {
|
const options: RequestOptions = {
|
||||||
initialHeaders: {
|
initialHeaders: {
|
||||||
[HttpHeaders.populateCollectionThroughputInfo]: true
|
[HttpHeaders.populateCollectionThroughputInfo]: true,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const response = await client()
|
const response = await client().offer(offerId).read(options);
|
||||||
.offer(offerId)
|
|
||||||
.read(options);
|
|
||||||
|
|
||||||
return parseSDKOfferResponse(response);
|
return parseSDKOfferResponse(response);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ export const readOffers = async (): Promise<SDKOfferDefinition[]> => {
|
|||||||
const clearMessage = logConsoleProgress(`Querying offers`);
|
const clearMessage = logConsoleProgress(`Querying offers`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await client()
|
const response = await client().offers.readAll().fetchAll();
|
||||||
.offers.readAll()
|
|
||||||
.fetchAll();
|
|
||||||
return response?.resources;
|
return response?.resources;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// This should be removed when we can correctly identify if an account is serverless when connected using connection string too.
|
// This should be removed when we can correctly identify if an account is serverless when connected using connection string too.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readStoredProcedures(
|
|||||||
const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -25,7 +25,7 @@ export async function readStoredProcedures(
|
|||||||
databaseId,
|
databaseId,
|
||||||
collectionId
|
collectionId
|
||||||
);
|
);
|
||||||
return rpResponse?.value?.map(sproc => sproc.properties?.resource as StoredProcedureDefinition & Resource);
|
return rpResponse?.value?.map((sproc) => sproc.properties?.resource as StoredProcedureDefinition & Resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client()
|
const response = await client()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readTriggers(
|
|||||||
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -25,14 +25,10 @@ export async function readTriggers(
|
|||||||
databaseId,
|
databaseId,
|
||||||
collectionId
|
collectionId
|
||||||
);
|
);
|
||||||
return rpResponse?.value?.map(trigger => trigger.properties?.resource as TriggerDefinition & Resource);
|
return rpResponse?.value?.map((trigger) => trigger.properties?.resource as TriggerDefinition & Resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client()
|
const response = await client().database(databaseId).container(collectionId).scripts.triggers.readAll().fetchAll();
|
||||||
.database(databaseId)
|
|
||||||
.container(collectionId)
|
|
||||||
.scripts.triggers.readAll()
|
|
||||||
.fetchAll();
|
|
||||||
return response?.resources;
|
return response?.resources;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "ReadTriggers", `Failed to query triggers for container ${collectionId}`);
|
handleError(error, "ReadTriggers", `Failed to query triggers for container ${collectionId}`);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function readUserDefinedFunctions(
|
|||||||
const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -25,7 +25,7 @@ export async function readUserDefinedFunctions(
|
|||||||
databaseId,
|
databaseId,
|
||||||
collectionId
|
collectionId
|
||||||
);
|
);
|
||||||
return rpResponse?.value?.map(udf => udf.properties?.resource as UserDefinedFunctionDefinition & Resource);
|
return rpResponse?.value?.map((udf) => udf.properties?.resource as UserDefinedFunctionDefinition & Resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client()
|
const response = await client()
|
||||||
|
|||||||
@@ -8,22 +8,22 @@ import {
|
|||||||
MongoDBCollectionCreateUpdateParameters,
|
MongoDBCollectionCreateUpdateParameters,
|
||||||
MongoDBCollectionResource,
|
MongoDBCollectionResource,
|
||||||
SqlContainerCreateUpdateParameters,
|
SqlContainerCreateUpdateParameters,
|
||||||
SqlContainerResource
|
SqlContainerResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { RequestOptions } from "@azure/cosmos/dist-esm";
|
import { RequestOptions } from "@azure/cosmos/dist-esm";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraTable,
|
createUpdateCassandraTable,
|
||||||
getCassandraTable
|
getCassandraTable,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBCollection,
|
createUpdateMongoDBCollection,
|
||||||
getMongoDBCollection
|
getMongoDBCollection,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
||||||
import {
|
import {
|
||||||
createUpdateGremlinGraph,
|
createUpdateGremlinGraph,
|
||||||
getGremlinGraph
|
getGremlinGraph,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
||||||
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
@@ -41,7 +41,7 @@ export async function updateCollection(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB &&
|
||||||
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
userContext.defaultExperience !== DefaultAccountExperienceType.Table
|
||||||
@@ -130,8 +130,8 @@ export async function updateMongoDBCollectionThroughRP(
|
|||||||
const updateParams: MongoDBCollectionCreateUpdateParameters = {
|
const updateParams: MongoDBCollectionCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: newCollection,
|
resource: newCollection,
|
||||||
options: updateOptions
|
options: updateOptions,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateResponse = await createUpdateMongoDBCollection(
|
const updateResponse = await createUpdateMongoDBCollection(
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
migrateSqlDatabaseToManualThroughput,
|
migrateSqlDatabaseToManualThroughput,
|
||||||
migrateSqlContainerToAutoscale,
|
migrateSqlContainerToAutoscale,
|
||||||
migrateSqlContainerToManualThroughput,
|
migrateSqlContainerToManualThroughput,
|
||||||
updateSqlContainerThroughput
|
updateSqlContainerThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import {
|
import {
|
||||||
updateCassandraKeyspaceThroughput,
|
updateCassandraKeyspaceThroughput,
|
||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
migrateCassandraKeyspaceToManualThroughput,
|
migrateCassandraKeyspaceToManualThroughput,
|
||||||
migrateCassandraTableToAutoscale,
|
migrateCassandraTableToAutoscale,
|
||||||
migrateCassandraTableToManualThroughput,
|
migrateCassandraTableToManualThroughput,
|
||||||
updateCassandraTableThroughput
|
updateCassandraTableThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
||||||
import {
|
import {
|
||||||
updateMongoDBDatabaseThroughput,
|
updateMongoDBDatabaseThroughput,
|
||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
migrateMongoDBDatabaseToManualThroughput,
|
migrateMongoDBDatabaseToManualThroughput,
|
||||||
migrateMongoDBCollectionToAutoscale,
|
migrateMongoDBCollectionToAutoscale,
|
||||||
migrateMongoDBCollectionToManualThroughput,
|
migrateMongoDBCollectionToManualThroughput,
|
||||||
updateMongoDBCollectionThroughput
|
updateMongoDBCollectionThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
||||||
import {
|
import {
|
||||||
updateGremlinDatabaseThroughput,
|
updateGremlinDatabaseThroughput,
|
||||||
@@ -41,13 +41,13 @@ import {
|
|||||||
migrateGremlinDatabaseToManualThroughput,
|
migrateGremlinDatabaseToManualThroughput,
|
||||||
migrateGremlinGraphToAutoscale,
|
migrateGremlinGraphToAutoscale,
|
||||||
migrateGremlinGraphToManualThroughput,
|
migrateGremlinGraphToManualThroughput,
|
||||||
updateGremlinGraphThroughput
|
updateGremlinGraphThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
migrateTableToAutoscale,
|
migrateTableToAutoscale,
|
||||||
migrateTableToManualThroughput,
|
migrateTableToManualThroughput,
|
||||||
updateTableThroughput
|
updateTableThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
||||||
|
|
||||||
export const updateOffer = async (params: UpdateOfferParams): Promise<Offer> => {
|
export const updateOffer = async (params: UpdateOfferParams): Promise<Offer> => {
|
||||||
@@ -58,7 +58,7 @@ export const updateOffer = async (params: UpdateOfferParams): Promise<Offer> =>
|
|||||||
const clearMessage = logConsoleProgress(`Updating offer for ${offerResourceText}`);
|
const clearMessage = logConsoleProgress(`Updating offer for ${offerResourceText}`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (window.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) {
|
||||||
if (params.collectionId) {
|
if (params.collectionId) {
|
||||||
updatedOffer = await updateCollectionOfferWithARM(params);
|
updatedOffer = await updateCollectionOfferWithARM(params);
|
||||||
} else if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
} else if (userContext.defaultExperience === DefaultAccountExperienceType.Table) {
|
||||||
@@ -110,7 +110,7 @@ const updateCollectionOfferWithARM = async (params: UpdateOfferParams): Promise<
|
|||||||
return await readCollectionOffer({
|
return await readCollectionOffer({
|
||||||
collectionId: params.collectionId,
|
collectionId: params.collectionId,
|
||||||
databaseId: params.databaseId,
|
databaseId: params.databaseId,
|
||||||
offerId: params.currentOffer.id
|
offerId: params.currentOffer.id,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ const updateDatabaseOfferWithARM = async (params: UpdateOfferParams): Promise<Of
|
|||||||
|
|
||||||
return await readDatabaseOffer({
|
return await readDatabaseOffer({
|
||||||
databaseId: params.databaseId,
|
databaseId: params.databaseId,
|
||||||
offerId: params.currentOffer.id
|
offerId: params.currentOffer.id,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -358,13 +358,13 @@ const updateGremlinDatabaseOffer = async (params: UpdateOfferParams): Promise<vo
|
|||||||
const createUpdateOfferBody = (params: UpdateOfferParams): ThroughputSettingsUpdateParameters => {
|
const createUpdateOfferBody = (params: UpdateOfferParams): ThroughputSettingsUpdateParameters => {
|
||||||
const body: ThroughputSettingsUpdateParameters = {
|
const body: ThroughputSettingsUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: {}
|
resource: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (params.autopilotThroughput) {
|
if (params.autopilotThroughput) {
|
||||||
body.properties.resource.autoscaleSettings = {
|
body.properties.resource.autoscaleSettings = {
|
||||||
maxThroughput: params.autopilotThroughput
|
maxThroughput: params.autopilotThroughput,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
body.properties.resource.throughput = params.manualThroughput;
|
body.properties.resource.throughput = params.manualThroughput;
|
||||||
@@ -378,7 +378,7 @@ const updateOfferWithSDK = async (params: UpdateOfferParams): Promise<Offer> =>
|
|||||||
const newOffer: SDKOfferDefinition = {
|
const newOffer: SDKOfferDefinition = {
|
||||||
content: {
|
content: {
|
||||||
offerThroughput: undefined,
|
offerThroughput: undefined,
|
||||||
offerIsRUPerMinuteThroughputEnabled: false
|
offerIsRUPerMinuteThroughputEnabled: false,
|
||||||
},
|
},
|
||||||
_etag: undefined,
|
_etag: undefined,
|
||||||
_ts: undefined,
|
_ts: undefined,
|
||||||
@@ -388,12 +388,12 @@ const updateOfferWithSDK = async (params: UpdateOfferParams): Promise<Offer> =>
|
|||||||
offerResourceId: sdkOfferDefinition.offerResourceId,
|
offerResourceId: sdkOfferDefinition.offerResourceId,
|
||||||
offerVersion: sdkOfferDefinition.offerVersion,
|
offerVersion: sdkOfferDefinition.offerVersion,
|
||||||
offerType: sdkOfferDefinition.offerType,
|
offerType: sdkOfferDefinition.offerType,
|
||||||
resource: sdkOfferDefinition.resource
|
resource: sdkOfferDefinition.resource,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (params.autopilotThroughput) {
|
if (params.autopilotThroughput) {
|
||||||
newOffer.content.offerAutopilotSettings = {
|
newOffer.content.offerAutopilotSettings = {
|
||||||
maxThroughput: params.autopilotThroughput
|
maxThroughput: params.autopilotThroughput,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
newOffer.content.offerThroughput = params.manualThroughput;
|
newOffer.content.offerThroughput = params.manualThroughput;
|
||||||
@@ -402,12 +402,12 @@ const updateOfferWithSDK = async (params: UpdateOfferParams): Promise<Offer> =>
|
|||||||
const options: RequestOptions = {};
|
const options: RequestOptions = {};
|
||||||
if (params.migrateToAutoPilot) {
|
if (params.migrateToAutoPilot) {
|
||||||
options.initialHeaders = {
|
options.initialHeaders = {
|
||||||
[HttpHeaders.migrateOfferToAutopilot]: "true"
|
[HttpHeaders.migrateOfferToAutopilot]: "true",
|
||||||
};
|
};
|
||||||
delete newOffer.content.offerAutopilotSettings;
|
delete newOffer.content.offerAutopilotSettings;
|
||||||
} else if (params.migrateToManual) {
|
} else if (params.migrateToManual) {
|
||||||
options.initialHeaders = {
|
options.initialHeaders = {
|
||||||
[HttpHeaders.migrateOfferToManualThroughput]: "true"
|
[HttpHeaders.migrateOfferToManualThroughput]: "true",
|
||||||
};
|
};
|
||||||
newOffer.content.offerAutopilotSettings = { maxThroughput: 0 };
|
newOffer.content.offerAutopilotSettings = { maxThroughput: 0 };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType
|
|||||||
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
||||||
import {
|
import {
|
||||||
SqlStoredProcedureCreateUpdateParameters,
|
SqlStoredProcedureCreateUpdateParameters,
|
||||||
SqlStoredProcedureResource
|
SqlStoredProcedureResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlStoredProcedure,
|
createUpdateSqlStoredProcedure,
|
||||||
getSqlStoredProcedure
|
getSqlStoredProcedure,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -22,7 +22,7 @@ export async function updateStoredProcedure(
|
|||||||
const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`);
|
const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -39,8 +39,8 @@ export async function updateStoredProcedure(
|
|||||||
const createSprocParams: SqlStoredProcedureCreateUpdateParameters = {
|
const createSprocParams: SqlStoredProcedureCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: storedProcedure as SqlStoredProcedureResource,
|
resource: storedProcedure as SqlStoredProcedureResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlStoredProcedure(
|
const rpResponse = await createUpdateSqlStoredProcedure(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { AuthType } from "../../AuthType";
|
|||||||
import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType";
|
import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType";
|
||||||
import {
|
import {
|
||||||
SqlTriggerCreateUpdateParameters,
|
SqlTriggerCreateUpdateParameters,
|
||||||
SqlTriggerResource
|
SqlTriggerResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { TriggerDefinition } from "@azure/cosmos";
|
import { TriggerDefinition } from "@azure/cosmos";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
@@ -19,7 +19,7 @@ export async function updateTrigger(
|
|||||||
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -36,8 +36,8 @@ export async function updateTrigger(
|
|||||||
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: trigger as SqlTriggerResource,
|
resource: trigger as SqlTriggerResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlTrigger(
|
const rpResponse = await createUpdateSqlTrigger(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType
|
|||||||
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
||||||
import {
|
import {
|
||||||
SqlUserDefinedFunctionCreateUpdateParameters,
|
SqlUserDefinedFunctionCreateUpdateParameters,
|
||||||
SqlUserDefinedFunctionResource
|
SqlUserDefinedFunctionResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlUserDefinedFunction,
|
createUpdateSqlUserDefinedFunction,
|
||||||
getSqlUserDefinedFunction
|
getSqlUserDefinedFunction,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
@@ -22,7 +22,7 @@ export async function updateUserDefinedFunction(
|
|||||||
const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`);
|
const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`);
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
window.authType === AuthType.AAD &&
|
userContext.authType === AuthType.AAD &&
|
||||||
!userContext.useSDKOperations &&
|
!userContext.useSDKOperations &&
|
||||||
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
userContext.defaultExperience === DefaultAccountExperienceType.DocumentDB
|
||||||
) {
|
) {
|
||||||
@@ -39,8 +39,8 @@ export async function updateUserDefinedFunction(
|
|||||||
const createUDFParams: SqlUserDefinedFunctionCreateUpdateParameters = {
|
const createUDFParams: SqlUserDefinedFunctionCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: userDefinedFunction as SqlUserDefinedFunctionResource,
|
resource: userDefinedFunction as SqlUserDefinedFunctionResource,
|
||||||
options: {}
|
options: {},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
const rpResponse = await createUpdateSqlUserDefinedFunction(
|
const rpResponse = await createUpdateSqlUserDefinedFunction(
|
||||||
userContext.subscriptionId,
|
userContext.subscriptionId,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
export enum Platform {
|
export enum Platform {
|
||||||
Portal = "Portal",
|
Portal = "Portal",
|
||||||
Hosted = "Hosted",
|
Hosted = "Hosted",
|
||||||
Emulator = "Emulator"
|
Emulator = "Emulator",
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ConfigContext {
|
export interface ConfigContext {
|
||||||
platform: Platform;
|
platform: Platform;
|
||||||
allowedParentFrameOrigins: string[];
|
allowedParentFrameOrigins: string[];
|
||||||
gitSha?: string;
|
gitSha?: string;
|
||||||
@@ -37,7 +37,7 @@ let configContext: Readonly<ConfigContext> = {
|
|||||||
`^https:\\/\\/[\\.\\w]*portal\\.microsoftazure.de$`,
|
`^https:\\/\\/[\\.\\w]*portal\\.microsoftazure.de$`,
|
||||||
`^https:\\/\\/[\\.\\w]*ext\\.azure\\.(com|cn|us)$`,
|
`^https:\\/\\/[\\.\\w]*ext\\.azure\\.(com|cn|us)$`,
|
||||||
`^https:\\/\\/[\\.\\w]*\\.ext\\.microsoftazure\\.de$`,
|
`^https:\\/\\/[\\.\\w]*\\.ext\\.microsoftazure\\.de$`,
|
||||||
`^https://cosmos-db-dataexplorer-germanycentral.azurewebsites.de$`
|
`^https://cosmos-db-dataexplorer-germanycentral.azurewebsites.de$`,
|
||||||
],
|
],
|
||||||
// Webpack injects this at build time
|
// Webpack injects this at build time
|
||||||
gitSha: process.env.GIT_SHA,
|
gitSha: process.env.GIT_SHA,
|
||||||
@@ -52,7 +52,7 @@ let configContext: Readonly<ConfigContext> = {
|
|||||||
ARCADIA_LIVY_ENDPOINT_DNS_ZONE: "dev.azuresynapse.net",
|
ARCADIA_LIVY_ENDPOINT_DNS_ZONE: "dev.azuresynapse.net",
|
||||||
GITHUB_CLIENT_ID: "6cb2f63cf6f7b5cbdeca", // Registered OAuth app: https://github.com/settings/applications/1189306
|
GITHUB_CLIENT_ID: "6cb2f63cf6f7b5cbdeca", // Registered OAuth app: https://github.com/settings/applications/1189306
|
||||||
JUNO_ENDPOINT: "https://tools.cosmos.azure.com",
|
JUNO_ENDPOINT: "https://tools.cosmos.azure.com",
|
||||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com"
|
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function resetConfigContext(): void {
|
export function resetConfigContext(): void {
|
||||||
@@ -73,20 +73,24 @@ if (process.env.NODE_ENV === "development") {
|
|||||||
BACKEND_ENDPOINT: "https://localhost:" + port,
|
BACKEND_ENDPOINT: "https://localhost:" + port,
|
||||||
MONGO_BACKEND_ENDPOINT: "https://localhost:" + port,
|
MONGO_BACKEND_ENDPOINT: "https://localhost:" + port,
|
||||||
PROXY_PATH: "/proxy",
|
PROXY_PATH: "/proxy",
|
||||||
EMULATOR_ENDPOINT: "https://localhost:8081"
|
EMULATOR_ENDPOINT: "https://localhost:8081",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function initializeConfiguration(): Promise<ConfigContext> {
|
export async function initializeConfiguration(): Promise<ConfigContext> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch("./config.json");
|
const response = await fetch("./config.json", {
|
||||||
|
headers: {
|
||||||
|
"If-None-Match": "", // disable client side cache
|
||||||
|
},
|
||||||
|
});
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
try {
|
try {
|
||||||
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
||||||
Object.assign(configContext, externalConfig);
|
Object.assign(configContext, externalConfig);
|
||||||
if (allowedParentFrameOrigins && allowedParentFrameOrigins.length > 0) {
|
if (allowedParentFrameOrigins && allowedParentFrameOrigins.length > 0) {
|
||||||
updateConfigContext({
|
updateConfigContext({
|
||||||
allowedParentFrameOrigins: [...configContext.allowedParentFrameOrigins, ...allowedParentFrameOrigins]
|
allowedParentFrameOrigins: [...configContext.allowedParentFrameOrigins, ...allowedParentFrameOrigins],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -104,7 +108,7 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
|
|||||||
const platform = params.get("platform");
|
const platform = params.get("platform");
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
default:
|
default:
|
||||||
console.log("Invalid platform query parameter given, ignoring");
|
console.error(`Invalid platform query parameter: ${platform}`);
|
||||||
break;
|
break;
|
||||||
case Platform.Portal:
|
case Platform.Portal:
|
||||||
case Platform.Hosted:
|
case Platform.Hosted:
|
||||||
@@ -113,7 +117,7 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("No configuration file found using defaults");
|
console.error("No configuration file found using defaults");
|
||||||
}
|
}
|
||||||
return configContext;
|
return configContext;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export enum TabKind {
|
|||||||
TableEntities,
|
TableEntities,
|
||||||
Graph,
|
Graph,
|
||||||
SQLQuery,
|
SQLQuery,
|
||||||
ScaleSettings
|
ScaleSettings,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +20,7 @@ export enum PaneKind {
|
|||||||
DeleteDatabase,
|
DeleteDatabase,
|
||||||
GlobalSettings,
|
GlobalSettings,
|
||||||
AdHocAccess,
|
AdHocAccess,
|
||||||
SwitchDirectory
|
SwitchDirectory,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,5 +79,5 @@ export enum ActionType {
|
|||||||
OpenCollectionTab,
|
OpenCollectionTab,
|
||||||
OpenPane,
|
OpenPane,
|
||||||
TransmitCachedData,
|
TransmitCachedData,
|
||||||
OpenSampleNotebook
|
OpenSampleNotebook,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ export interface DatabaseAccount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DatabaseAccountExtendedProperties {
|
export interface DatabaseAccountExtendedProperties {
|
||||||
documentEndpoint: string;
|
documentEndpoint?: string;
|
||||||
tableEndpoint: string;
|
tableEndpoint?: string;
|
||||||
gremlinEndpoint: string;
|
gremlinEndpoint?: string;
|
||||||
cassandraEndpoint: string;
|
cassandraEndpoint?: string;
|
||||||
configurationOverrides?: ConfigurationOverrides;
|
configurationOverrides?: ConfigurationOverrides;
|
||||||
capabilities?: Capability[];
|
capabilities?: Capability[];
|
||||||
enableMultipleWriteLocations?: boolean;
|
enableMultipleWriteLocations?: boolean;
|
||||||
@@ -56,7 +56,7 @@ export enum ApiKind {
|
|||||||
Table,
|
Table,
|
||||||
Cassandra,
|
Cassandra,
|
||||||
Graph,
|
Graph,
|
||||||
MongoDBCompute
|
MongoDBCompute,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GenerateTokenResponse {
|
export interface GenerateTokenResponse {
|
||||||
@@ -210,9 +210,9 @@ export interface QueryMetrics {
|
|||||||
|
|
||||||
export interface Offer {
|
export interface Offer {
|
||||||
id: string;
|
id: string;
|
||||||
autoscaleMaxThroughput: number;
|
autoscaleMaxThroughput: number | undefined;
|
||||||
manualThroughput: number;
|
manualThroughput: number | undefined;
|
||||||
minimumThroughput: number;
|
minimumThroughput: number | undefined;
|
||||||
offerDefinition?: SDKOfferDefinition;
|
offerDefinition?: SDKOfferDefinition;
|
||||||
offerReplacePending: boolean;
|
offerReplacePending: boolean;
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ export interface Notification {
|
|||||||
|
|
||||||
export enum ConflictResolutionMode {
|
export enum ConflictResolutionMode {
|
||||||
Custom = "Custom",
|
Custom = "Custom",
|
||||||
LastWriterWins = "LastWriterWins"
|
LastWriterWins = "LastWriterWins",
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -472,7 +472,7 @@ export interface SparkClusterEndpoint {
|
|||||||
export enum SparkClusterEndpointKind {
|
export enum SparkClusterEndpointKind {
|
||||||
SparkUI = "SparkUI",
|
SparkUI = "SparkUI",
|
||||||
HistoryServerUI = "HistoryServerUI",
|
HistoryServerUI = "HistoryServerUI",
|
||||||
Livy = "Livy"
|
Livy = "Livy",
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RpParameters {
|
export interface RpParameters {
|
||||||
@@ -587,11 +587,3 @@ export interface MemoryUsageInfo {
|
|||||||
freeKB: number;
|
freeKB: number;
|
||||||
totalKB: number;
|
totalKB: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface resourceTokenConnectionStringProperties {
|
|
||||||
accountEndpoint: string;
|
|
||||||
collectionId: string;
|
|
||||||
databaseId: string;
|
|
||||||
partitionKey?: string;
|
|
||||||
resourceToken: string;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export enum LogEntryLevel {
|
|||||||
/**
|
/**
|
||||||
* Error level.
|
* Error level.
|
||||||
*/
|
*/
|
||||||
Error = 2
|
Error = 2,
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Schema of a log entry.
|
* Schema of a log entry.
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export enum MessageTypes {
|
|||||||
CreateWorkspace,
|
CreateWorkspace,
|
||||||
CreateSparkPool,
|
CreateSparkPool,
|
||||||
RefreshDatabaseAccount,
|
RefreshDatabaseAccount,
|
||||||
InitTestExplorer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Versions, ActionContracts, Diagnostics };
|
export { Versions, ActionContracts, Diagnostics };
|
||||||
|
|||||||
9
src/Contracts/SelfServeContracts.ts
Normal file
9
src/Contracts/SelfServeContracts.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Messaging types used with SelfServe Component <-> Portal communication
|
||||||
|
* and Hosted <-> SelfServe Component communication
|
||||||
|
*/
|
||||||
|
|
||||||
|
export enum SelfServeMessageTypes {
|
||||||
|
TelemetryInfo = "TelemetryInfo",
|
||||||
|
Notification = "Notification",
|
||||||
|
}
|
||||||
@@ -3,5 +3,5 @@ export enum SubscriptionType {
|
|||||||
EA,
|
EA,
|
||||||
Free,
|
Free,
|
||||||
Internal,
|
Internal,
|
||||||
PAYG
|
PAYG,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ import {
|
|||||||
Resource,
|
Resource,
|
||||||
StoredProcedureDefinition,
|
StoredProcedureDefinition,
|
||||||
TriggerDefinition,
|
TriggerDefinition,
|
||||||
UserDefinedFunctionDefinition
|
UserDefinedFunctionDefinition,
|
||||||
} from "@azure/cosmos";
|
} from "@azure/cosmos";
|
||||||
import Q from "q";
|
|
||||||
import { CommandButtonComponentProps } from "../Explorer/Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "../Explorer/Controls/CommandButton/CommandButtonComponent";
|
||||||
import Explorer from "../Explorer/Explorer";
|
import Explorer from "../Explorer/Explorer";
|
||||||
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||||
@@ -15,6 +14,7 @@ import DocumentId from "../Explorer/Tree/DocumentId";
|
|||||||
import StoredProcedure from "../Explorer/Tree/StoredProcedure";
|
import StoredProcedure from "../Explorer/Tree/StoredProcedure";
|
||||||
import Trigger from "../Explorer/Tree/Trigger";
|
import Trigger from "../Explorer/Tree/Trigger";
|
||||||
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
||||||
|
import { SelfServeType } from "../SelfServe/SelfServeUtils";
|
||||||
import { UploadDetails } from "../workers/upload/definitions";
|
import { UploadDetails } from "../workers/upload/definitions";
|
||||||
import * as DataModels from "./DataModels";
|
import * as DataModels from "./DataModels";
|
||||||
import { SubscriptionType } from "./SubscriptionType";
|
import { SubscriptionType } from "./SubscriptionType";
|
||||||
@@ -91,6 +91,7 @@ export interface Database extends TreeNode {
|
|||||||
onDeleteDatabaseContextMenuClick(source: Database, event: MouseEvent | KeyboardEvent): void;
|
onDeleteDatabaseContextMenuClick(source: Database, event: MouseEvent | KeyboardEvent): void;
|
||||||
onSettingsClick: () => void;
|
onSettingsClick: () => void;
|
||||||
loadOffer(): Promise<void>;
|
loadOffer(): Promise<void>;
|
||||||
|
getPendingThroughputSplitNotification(): Promise<DataModels.Notification>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CollectionBase extends TreeNode {
|
export interface CollectionBase extends TreeNode {
|
||||||
@@ -107,8 +108,8 @@ export interface CollectionBase extends TreeNode {
|
|||||||
isCollectionExpanded: ko.Observable<boolean>;
|
isCollectionExpanded: ko.Observable<boolean>;
|
||||||
|
|
||||||
onDocumentDBDocumentsClick(): void;
|
onDocumentDBDocumentsClick(): void;
|
||||||
onNewQueryClick(source: any, event: MouseEvent, queryText?: string): void;
|
onNewQueryClick(source: any, event?: MouseEvent, queryText?: string): void;
|
||||||
expandCollection(): Q.Promise<any>;
|
expandCollection(): void;
|
||||||
collapseCollection(): void;
|
collapseCollection(): void;
|
||||||
getDatabase(): Database;
|
getDatabase(): Database;
|
||||||
}
|
}
|
||||||
@@ -137,14 +138,13 @@ export interface Collection extends CollectionBase {
|
|||||||
openTab(): void;
|
openTab(): void;
|
||||||
|
|
||||||
onSettingsClick: () => Promise<void>;
|
onSettingsClick: () => Promise<void>;
|
||||||
onDeleteCollectionContextMenuClick(source: Collection, event: MouseEvent): void;
|
|
||||||
|
|
||||||
onNewGraphClick(): void;
|
onNewGraphClick(): void;
|
||||||
onNewMongoQueryClick(source: any, event: MouseEvent, queryText?: string): void;
|
onNewMongoQueryClick(source: any, event?: MouseEvent, queryText?: string): void;
|
||||||
onNewMongoShellClick(): void;
|
onNewMongoShellClick(): void;
|
||||||
onNewStoredProcedureClick(source: Collection, event: MouseEvent): void;
|
onNewStoredProcedureClick(source: Collection, event?: MouseEvent): void;
|
||||||
onNewUserDefinedFunctionClick(source: Collection, event: MouseEvent): void;
|
onNewUserDefinedFunctionClick(source: Collection, event?: MouseEvent): void;
|
||||||
onNewTriggerClick(source: Collection, event: MouseEvent): void;
|
onNewTriggerClick(source: Collection, event?: MouseEvent): void;
|
||||||
storedProcedures: ko.Computed<StoredProcedure[]>;
|
storedProcedures: ko.Computed<StoredProcedure[]>;
|
||||||
userDefinedFunctions: ko.Computed<UserDefinedFunction[]>;
|
userDefinedFunctions: ko.Computed<UserDefinedFunction[]>;
|
||||||
triggers: ko.Computed<Trigger[]>;
|
triggers: ko.Computed<Trigger[]>;
|
||||||
@@ -175,9 +175,10 @@ export interface Collection extends CollectionBase {
|
|||||||
|
|
||||||
onDragOver(source: Collection, event: { originalEvent: DragEvent }): void;
|
onDragOver(source: Collection, event: { originalEvent: DragEvent }): void;
|
||||||
onDrop(source: Collection, event: { originalEvent: DragEvent }): void;
|
onDrop(source: Collection, event: { originalEvent: DragEvent }): void;
|
||||||
uploadFiles(fileList: FileList): Q.Promise<UploadDetails>;
|
uploadFiles(fileList: FileList): Promise<UploadDetails>;
|
||||||
|
|
||||||
getLabel(): string;
|
getLabel(): string;
|
||||||
|
getPendingThroughputSplitNotification(): Promise<DataModels.Notification>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,7 +196,7 @@ export interface PaneOptions {
|
|||||||
export enum NeighborType {
|
export enum NeighborType {
|
||||||
SOURCES_ONLY,
|
SOURCES_ONLY,
|
||||||
TARGETS_ONLY,
|
TARGETS_ONLY,
|
||||||
BOTH
|
BOTH,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,10 +293,6 @@ export interface DocumentsTabOptions extends TabOptions {
|
|||||||
resourceTokenPartitionKey?: string;
|
resourceTokenPartitionKey?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingsTabV2Options extends TabOptions {
|
|
||||||
getPendingNotification: Q.Promise<DataModels.Notification>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConflictsTabOptions extends TabOptions {
|
export interface ConflictsTabOptions extends TabOptions {
|
||||||
partitionKey: DataModels.PartitionKey;
|
partitionKey: DataModels.PartitionKey;
|
||||||
conflictIds: ko.ObservableArray<ConflictId>;
|
conflictIds: ko.ObservableArray<ConflictId>;
|
||||||
@@ -325,14 +322,14 @@ export enum DocumentExplorerState {
|
|||||||
newDocumentInvalid,
|
newDocumentInvalid,
|
||||||
exisitingDocumentNoEdits,
|
exisitingDocumentNoEdits,
|
||||||
exisitingDocumentDirtyValid,
|
exisitingDocumentDirtyValid,
|
||||||
exisitingDocumentDirtyInvalid
|
exisitingDocumentDirtyInvalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum IndexingPolicyEditorState {
|
export enum IndexingPolicyEditorState {
|
||||||
noCollectionSelected,
|
noCollectionSelected,
|
||||||
noEdits,
|
noEdits,
|
||||||
dirtyValid,
|
dirtyValid,
|
||||||
dirtyInvalid
|
dirtyInvalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ScriptEditorState {
|
export enum ScriptEditorState {
|
||||||
@@ -340,7 +337,7 @@ export enum ScriptEditorState {
|
|||||||
newValid,
|
newValid,
|
||||||
exisitingNoEdits,
|
exisitingNoEdits,
|
||||||
exisitingDirtyValid,
|
exisitingDirtyValid,
|
||||||
exisitingDirtyInvalid
|
exisitingDirtyInvalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CollectionTabKind {
|
export enum CollectionTabKind {
|
||||||
@@ -358,35 +355,36 @@ export enum CollectionTabKind {
|
|||||||
Notebook = 13 /* Deprecated */,
|
Notebook = 13 /* Deprecated */,
|
||||||
Terminal = 14,
|
Terminal = 14,
|
||||||
NotebookV2 = 15,
|
NotebookV2 = 15,
|
||||||
SparkMasterTab = 16,
|
SparkMasterTab = 16 /* Deprecated */,
|
||||||
Gallery = 17,
|
Gallery = 17,
|
||||||
NotebookViewer = 18,
|
NotebookViewer = 18,
|
||||||
Schema = 19,
|
Schema = 19,
|
||||||
SettingsV2 = 19
|
CollectionSettingsV2 = 20,
|
||||||
|
DatabaseSettingsV2 = 21,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum TerminalKind {
|
export enum TerminalKind {
|
||||||
Default = 0,
|
Default = 0,
|
||||||
Mongo = 1,
|
Mongo = 1,
|
||||||
Cassandra = 2
|
Cassandra = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DataExplorerInputsFrame {
|
export interface DataExplorerInputsFrame {
|
||||||
databaseAccount: any;
|
databaseAccount: any;
|
||||||
subscriptionId: string;
|
subscriptionId?: string;
|
||||||
resourceGroup: string;
|
resourceGroup?: string;
|
||||||
masterKey: string;
|
masterKey?: string;
|
||||||
hasWriteAccess: boolean;
|
hasWriteAccess?: boolean;
|
||||||
authorizationToken: string;
|
authorizationToken?: string;
|
||||||
features: any;
|
features: { [key: string]: string };
|
||||||
csmEndpoint: string;
|
csmEndpoint?: string;
|
||||||
dnsSuffix: string;
|
dnsSuffix?: string;
|
||||||
serverId: string;
|
serverId?: string;
|
||||||
extensionEndpoint: string;
|
extensionEndpoint?: string;
|
||||||
subscriptionType: SubscriptionType;
|
subscriptionType?: SubscriptionType;
|
||||||
quotaId: string;
|
quotaId?: string;
|
||||||
addCollectionDefaultFlight: string;
|
addCollectionDefaultFlight?: string;
|
||||||
isTryCosmosDBSubscription: boolean;
|
isTryCosmosDBSubscription?: boolean;
|
||||||
loadDatabaseAccountTimestamp?: number;
|
loadDatabaseAccountTimestamp?: number;
|
||||||
sharedThroughputMinimum?: number;
|
sharedThroughputMinimum?: number;
|
||||||
sharedThroughputMaximum?: number;
|
sharedThroughputMaximum?: number;
|
||||||
@@ -397,6 +395,16 @@ export interface DataExplorerInputsFrame {
|
|||||||
flights?: readonly string[];
|
flights?: readonly string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SelfServeFrameInputs {
|
||||||
|
selfServeType: SelfServeType;
|
||||||
|
databaseAccount: any;
|
||||||
|
subscriptionId: string;
|
||||||
|
resourceGroup: string;
|
||||||
|
authorizationToken: string;
|
||||||
|
csmEndpoint: string;
|
||||||
|
flights?: readonly string[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface CollectionCreationDefaults {
|
export interface CollectionCreationDefaults {
|
||||||
storage: string;
|
storage: string;
|
||||||
throughput: ThroughputDefaults;
|
throughput: ThroughputDefaults;
|
||||||
|
|||||||
@@ -6,19 +6,19 @@ describe("The Heatmap Control", () => {
|
|||||||
const dataPoints = {
|
const dataPoints = {
|
||||||
"1": {
|
"1": {
|
||||||
"2019-06-19T00:59:10Z": {
|
"2019-06-19T00:59:10Z": {
|
||||||
"Normalized Throughput": 0.35
|
"Normalized Throughput": 0.35,
|
||||||
},
|
},
|
||||||
"2019-06-19T00:48:10Z": {
|
"2019-06-19T00:48:10Z": {
|
||||||
"Normalized Throughput": 0.25
|
"Normalized Throughput": 0.25,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const chartCaptions = {
|
const chartCaptions = {
|
||||||
chartTitle: "chart title",
|
chartTitle: "chart title",
|
||||||
yAxisTitle: "YAxisTitle",
|
yAxisTitle: "YAxisTitle",
|
||||||
tooltipText: "Tooltip text",
|
tooltipText: "Tooltip text",
|
||||||
timeWindow: 123456789
|
timeWindow: 123456789,
|
||||||
};
|
};
|
||||||
|
|
||||||
let heatmap: Heatmap;
|
let heatmap: Heatmap;
|
||||||
@@ -75,12 +75,12 @@ describe("The Heatmap Control", () => {
|
|||||||
if (dayjs().utcOffset()) {
|
if (dayjs().utcOffset()) {
|
||||||
expect(heatmap.generateMatrixFromMap(dataPoints).xAxisPoints).not.toEqual([
|
expect(heatmap.generateMatrixFromMap(dataPoints).xAxisPoints).not.toEqual([
|
||||||
"2019-06-19T00:48:10Z",
|
"2019-06-19T00:48:10Z",
|
||||||
"2019-06-19T00:59:10Z"
|
"2019-06-19T00:59:10Z",
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
expect(heatmap.generateMatrixFromMap(dataPoints).xAxisPoints).toEqual([
|
expect(heatmap.generateMatrixFromMap(dataPoints).xAxisPoints).toEqual([
|
||||||
"2019-06-19T00:48:10Z",
|
"2019-06-19T00:48:10Z",
|
||||||
"2019-06-19T00:59:10Z"
|
"2019-06-19T00:59:10Z",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -106,9 +106,9 @@ describe("iframe rendering when there is no data", () => {
|
|||||||
data: {
|
data: {
|
||||||
chartData: {},
|
chartData: {},
|
||||||
chartSettings: {},
|
chartSettings: {},
|
||||||
theme: 4
|
theme: 4,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const divElement: string = `<div id="${Heatmap.elementId}"></div>`;
|
const divElement: string = `<div id="${Heatmap.elementId}"></div>`;
|
||||||
@@ -126,9 +126,9 @@ describe("iframe rendering when there is no data", () => {
|
|||||||
data: {
|
data: {
|
||||||
chartData: {},
|
chartData: {},
|
||||||
chartSettings: {},
|
chartSettings: {},
|
||||||
theme: 2
|
theme: 2,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const divElement: string = `<div id="${Heatmap.elementId}"></div>`;
|
const divElement: string = `<div id="${Heatmap.elementId}"></div>`;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
HeatmapData,
|
HeatmapData,
|
||||||
LayoutSettings,
|
LayoutSettings,
|
||||||
PartitionTimeStampToData,
|
PartitionTimeStampToData,
|
||||||
PortalTheme
|
PortalTheme,
|
||||||
} from "./HeatmapDatatypes";
|
} from "./HeatmapDatatypes";
|
||||||
import { isInvalidParentFrameOrigin } from "../../Utils/MessageValidation";
|
import { isInvalidParentFrameOrigin } from "../../Utils/MessageValidation";
|
||||||
import { sendCachedDataMessage, sendMessage } from "../../Common/MessageHandler";
|
import { sendCachedDataMessage, sendMessage } from "../../Common/MessageHandler";
|
||||||
@@ -43,7 +43,7 @@ export class Heatmap {
|
|||||||
return {
|
return {
|
||||||
family: StyleConstants.DataExplorerFont,
|
family: StyleConstants.DataExplorerFont,
|
||||||
size,
|
size,
|
||||||
color
|
color,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ export class Heatmap {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
// go thru all rows and create 2d matrix for heatmap...
|
// go thru all rows and create 2d matrix for heatmap...
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
@@ -115,7 +115,7 @@ export class Heatmap {
|
|||||||
[0.7, "#E46612"],
|
[0.7, "#E46612"],
|
||||||
[0.8, "#E64914"],
|
[0.8, "#E64914"],
|
||||||
[0.9, "#B80016"],
|
[0.9, "#B80016"],
|
||||||
[1.0, "#B80016"]
|
[1.0, "#B80016"],
|
||||||
],
|
],
|
||||||
name: "",
|
name: "",
|
||||||
hovertemplate: this._heatmapCaptions.tooltipText,
|
hovertemplate: this._heatmapCaptions.tooltipText,
|
||||||
@@ -123,11 +123,11 @@ export class Heatmap {
|
|||||||
thickness: 15,
|
thickness: 15,
|
||||||
outlinewidth: 0,
|
outlinewidth: 0,
|
||||||
tickcolor: StyleConstants.BaseDark,
|
tickcolor: StyleConstants.BaseDark,
|
||||||
tickfont: this._getFontStyles(10, this._defaultFontColor)
|
tickfont: this._getFontStyles(10, this._defaultFontColor),
|
||||||
},
|
},
|
||||||
y: this._chartData.yAxisPoints,
|
y: this._chartData.yAxisPoints,
|
||||||
x: this._chartData.xAxisPoints
|
x: this._chartData.xAxisPoints,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ export class Heatmap {
|
|||||||
r: 10,
|
r: 10,
|
||||||
b: 35,
|
b: 35,
|
||||||
t: 30,
|
t: 30,
|
||||||
pad: 0
|
pad: 0,
|
||||||
},
|
},
|
||||||
paper_bgcolor: "transparent",
|
paper_bgcolor: "transparent",
|
||||||
plot_bgcolor: "transparent",
|
plot_bgcolor: "transparent",
|
||||||
@@ -154,7 +154,7 @@ export class Heatmap {
|
|||||||
autotick: true,
|
autotick: true,
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
ticks: "",
|
ticks: "",
|
||||||
showticklabels: false
|
showticklabels: false,
|
||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
fixedrange: true,
|
fixedrange: true,
|
||||||
@@ -167,13 +167,13 @@ export class Heatmap {
|
|||||||
autotick: true,
|
autotick: true,
|
||||||
tickformat: this._heatmapCaptions.timeWindow > 7 ? "%I:%M %p" : "%b %e",
|
tickformat: this._heatmapCaptions.timeWindow > 7 ? "%I:%M %p" : "%b %e",
|
||||||
showticklabels: true,
|
showticklabels: true,
|
||||||
tickfont: this._getFontStyles(10)
|
tickfont: this._getFontStyles(10),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
text: this._heatmapCaptions.chartTitle,
|
text: this._heatmapCaptions.chartTitle,
|
||||||
x: 0.01,
|
x: 0.01,
|
||||||
font: this._getFontStyles(13, this._defaultFontColor)
|
font: this._getFontStyles(13, this._defaultFontColor),
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ export class Heatmap {
|
|||||||
return {
|
return {
|
||||||
/* heatmap can be fully responsive however the min-height needed in that case is greater than the iframe portal height, hence explicit width + height have been set in _getLayoutSettings
|
/* heatmap can be fully responsive however the min-height needed in that case is greater than the iframe portal height, hence explicit width + height have been set in _getLayoutSettings
|
||||||
responsive: true,*/
|
responsive: true,*/
|
||||||
displayModeBar: false
|
displayModeBar: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export enum PortalTheme {
|
|||||||
blue = 1,
|
blue = 1,
|
||||||
azure,
|
azure,
|
||||||
light,
|
light,
|
||||||
dark
|
dark,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HeatmapData {
|
export interface HeatmapData {
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export enum DefaultAccountExperienceType {
|
|||||||
MongoDB = "MongoDB",
|
MongoDB = "MongoDB",
|
||||||
Table = "Table",
|
Table = "Table",
|
||||||
Cassandra = "Cassandra",
|
Cassandra = "Cassandra",
|
||||||
ApiForMongoDB = "Azure Cosmos DB for MongoDB API"
|
ApiForMongoDB = "Azure Cosmos DB for MongoDB API",
|
||||||
}
|
}
|
||||||
|
|||||||
383
src/Definitions/adal.d.ts
vendored
383
src/Definitions/adal.d.ts
vendored
@@ -1,383 +0,0 @@
|
|||||||
// Type definitions for adal-angular 1.0.1.1
|
|
||||||
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js#readme
|
|
||||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
|
||||||
// Anthony Ciccarello <https://github.com/aciccarello>
|
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
||||||
|
|
||||||
//This is a customized version of adal on top of version 1.0.1 which does not support multi tenant
|
|
||||||
// Customized version add tenantId to stored tokens so when tenant change, adal will refetch instead of read from sessionStorage
|
|
||||||
|
|
||||||
// In module contexts the class constructor function is the exported object
|
|
||||||
// export = AuthenticationContext;
|
|
||||||
|
|
||||||
// This class is defined globally in not in a module context
|
|
||||||
declare class AuthenticationContext {
|
|
||||||
instance: string;
|
|
||||||
config: AuthenticationContext.Options;
|
|
||||||
callback: AuthenticationContext.TokenCallback;
|
|
||||||
popUp: boolean;
|
|
||||||
isAngular: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enum for request type
|
|
||||||
*/
|
|
||||||
REQUEST_TYPE: AuthenticationContext.RequestType;
|
|
||||||
RESPONSE_TYPE: AuthenticationContext.ResponseType;
|
|
||||||
CONSTANTS: AuthenticationContext.Constants;
|
|
||||||
|
|
||||||
constructor(options: AuthenticationContext.Options);
|
|
||||||
/**
|
|
||||||
* Initiates the login process by redirecting the user to Azure AD authorization endpoint.
|
|
||||||
*/
|
|
||||||
login(): void;
|
|
||||||
/**
|
|
||||||
* Returns whether a login is in progress.
|
|
||||||
*/
|
|
||||||
loginInProgress(): boolean;
|
|
||||||
/**
|
|
||||||
* Gets token for the specified resource from the cache.
|
|
||||||
* @param resource A URI that identifies the resource for which the token is requested.
|
|
||||||
* @param tenantId tenant Id.
|
|
||||||
*/
|
|
||||||
getCachedToken(resource: string, tenantId: string): string;
|
|
||||||
/**
|
|
||||||
* If user object exists, returns it. Else creates a new user object by decoding `id_token` from the cache.
|
|
||||||
*/
|
|
||||||
getCachedUser(): AuthenticationContext.UserInfo;
|
|
||||||
/**
|
|
||||||
* Adds the passed callback to the array of callbacks for the specified resource.
|
|
||||||
* @param resource A URI that identifies the resource for which the token is requested.
|
|
||||||
* @param expectedState A unique identifier (guid).
|
|
||||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
|
||||||
*/
|
|
||||||
registerCallback(
|
|
||||||
expectedState: string,
|
|
||||||
resource: string,
|
|
||||||
callback: AuthenticationContext.TokenCallback,
|
|
||||||
tenantId: string
|
|
||||||
): void;
|
|
||||||
/**
|
|
||||||
* Acquires token from the cache if it is not expired. Otherwise sends request to AAD to obtain a new token.
|
|
||||||
* @param resource Resource URI identifying the target resource.
|
|
||||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
|
||||||
*/
|
|
||||||
acquireToken(resource: string, tenantId: string, callback: AuthenticationContext.TokenCallback): void;
|
|
||||||
/**
|
|
||||||
* Acquires token (interactive flow using a popup window) by sending request to AAD to obtain a new token.
|
|
||||||
* @param resource Resource URI identifying the target resource.
|
|
||||||
* @param extraQueryParameters Query parameters to add to the authentication request.
|
|
||||||
* @param claims Claims to add to the authentication request.
|
|
||||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
|
||||||
*/
|
|
||||||
acquireTokenPopup(
|
|
||||||
resource: string,
|
|
||||||
tenantId: string,
|
|
||||||
extraQueryParameters: string | null | undefined,
|
|
||||||
claims: string | null | undefined,
|
|
||||||
callback: AuthenticationContext.TokenCallback
|
|
||||||
): void;
|
|
||||||
/**
|
|
||||||
* Acquires token (interactive flow using a redirect) by sending request to AAD to obtain a new token. In this case the callback passed in the authentication request constructor will be called.
|
|
||||||
* @param resource Resource URI identifying the target resource.
|
|
||||||
* @param extraQueryParameters Query parameters to add to the authentication request.
|
|
||||||
* @param claims Claims to add to the authentication request.
|
|
||||||
*/
|
|
||||||
acquireTokenRedirect(
|
|
||||||
resource: string,
|
|
||||||
tenantId: string,
|
|
||||||
extraQueryParameters?: string | null,
|
|
||||||
claims?: string | null
|
|
||||||
): void;
|
|
||||||
/**
|
|
||||||
* Redirects the browser to Azure AD authorization endpoint.
|
|
||||||
* @param urlNavigate URL of the authorization endpoint.
|
|
||||||
*/
|
|
||||||
promptUser(urlNavigate: string): void;
|
|
||||||
/**
|
|
||||||
* Clears cache items.
|
|
||||||
*/
|
|
||||||
clearCache(): void;
|
|
||||||
/**
|
|
||||||
* Clears cache items for a given resource.
|
|
||||||
* @param resource Resource URI identifying the target resource.
|
|
||||||
*/
|
|
||||||
clearCacheForResource(resource: string): void;
|
|
||||||
/**
|
|
||||||
* Redirects user to logout endpoint. After logout, it will redirect to `postLogoutRedirectUri` if added as a property on the config object.
|
|
||||||
*/
|
|
||||||
logOut(): void;
|
|
||||||
/**
|
|
||||||
* Calls the passed in callback with the user object or error message related to the user.
|
|
||||||
* @param callback The callback provided by the caller. It will be called with user or error.
|
|
||||||
*/
|
|
||||||
getUser(callback: AuthenticationContext.UserCallback): void;
|
|
||||||
/**
|
|
||||||
* Checks if the URL fragment contains access token, id token or error description.
|
|
||||||
* @param hash Hash passed from redirect page.
|
|
||||||
*/
|
|
||||||
isCallback(hash: string): boolean;
|
|
||||||
/**
|
|
||||||
* Gets login error.
|
|
||||||
*/
|
|
||||||
getLoginError(): string;
|
|
||||||
/**
|
|
||||||
* Creates a request info object from the URL fragment and returns it.
|
|
||||||
*/
|
|
||||||
getRequestInfo(hash: string): AuthenticationContext.RequestInfo;
|
|
||||||
/**
|
|
||||||
* Saves token or error received in the response from AAD in the cache. In case of `id_token`, it also creates the user object.
|
|
||||||
*/
|
|
||||||
saveTokenFromHash(requestInfo: AuthenticationContext.RequestInfo): void;
|
|
||||||
/**
|
|
||||||
* Gets resource for given endpoint if mapping is provided with config.
|
|
||||||
* @param endpoint Resource URI identifying the target resource.
|
|
||||||
*/
|
|
||||||
getResourceForEndpoint(resource: string): string;
|
|
||||||
/**
|
|
||||||
* This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the callbacks with the result.
|
|
||||||
* @param hash Hash fragment of URL. Defaults to `window.location.hash`.
|
|
||||||
*/
|
|
||||||
handleWindowCallback(hash?: string): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks the logging Level, constructs the log message and logs it. Users need to implement/override this method to turn on logging.
|
|
||||||
* @param level Level can be set 0, 1, 2 and 3 which turns on 'error', 'warning', 'info' or 'verbose' level logging respectively.
|
|
||||||
* @param message Message to log.
|
|
||||||
* @param error Error to log.
|
|
||||||
*/
|
|
||||||
log(level: AuthenticationContext.LoggingLevel, message: string, error: any): void;
|
|
||||||
/**
|
|
||||||
* Logs messages when logging level is set to 0.
|
|
||||||
* @param message Message to log.
|
|
||||||
* @param error Error to log.
|
|
||||||
*/
|
|
||||||
error(message: string, error: any): void;
|
|
||||||
/**
|
|
||||||
* Logs messages when logging level is set to 1.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
warn(message: string): void;
|
|
||||||
/**
|
|
||||||
* Logs messages when logging level is set to 2.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
info(message: string): void;
|
|
||||||
/**
|
|
||||||
* Logs messages when logging level is set to 3.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
verbose(message: string): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs Pii messages when Logging Level is set to 0 and window.piiLoggingEnabled is set to true.
|
|
||||||
* @param message Message to log.
|
|
||||||
* @param error Error to log.
|
|
||||||
*/
|
|
||||||
errorPii(message: string, error: any): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs Pii messages when Logging Level is set to 1 and window.piiLoggingEnabled is set to true.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
warnPii(message: string): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs messages when Logging Level is set to 2 and window.piiLoggingEnabled is set to true.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
infoPii(message: string): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs messages when Logging Level is set to 3 and window.piiLoggingEnabled is set to true.
|
|
||||||
* @param message Message to log.
|
|
||||||
*/
|
|
||||||
verbosePii(message: string): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare namespace AuthenticationContext {
|
|
||||||
function inject(config: Options): AuthenticationContext;
|
|
||||||
|
|
||||||
type LoggingLevel = 0 | 1 | 2 | 3;
|
|
||||||
|
|
||||||
type RequestType = "LOGIN" | "RENEW_TOKEN" | "UNKNOWN";
|
|
||||||
|
|
||||||
type ResponseType = "id_token token" | "token";
|
|
||||||
|
|
||||||
interface RequestInfo {
|
|
||||||
/**
|
|
||||||
* Object comprising of fields such as id_token/error, session_state, state, e.t.c.
|
|
||||||
*/
|
|
||||||
parameters: any;
|
|
||||||
/**
|
|
||||||
* Request type.
|
|
||||||
*/
|
|
||||||
requestType: RequestType;
|
|
||||||
/**
|
|
||||||
* Whether state is valid.
|
|
||||||
*/
|
|
||||||
stateMatch: boolean;
|
|
||||||
/**
|
|
||||||
* Unique guid used to match the response with the request.
|
|
||||||
*/
|
|
||||||
stateResponse: string;
|
|
||||||
/**
|
|
||||||
* Whether `requestType` contains `id_token`, `access_token` or error.
|
|
||||||
*/
|
|
||||||
valid: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UserInfo {
|
|
||||||
/**
|
|
||||||
* Username assigned from UPN or email.
|
|
||||||
*/
|
|
||||||
userName: string;
|
|
||||||
/**
|
|
||||||
* Properties parsed from `id_token`.
|
|
||||||
*/
|
|
||||||
profile: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
type TokenCallback = (errorDesc: string | null, token: string | null, error: any) => void;
|
|
||||||
|
|
||||||
type UserCallback = (errorDesc: string | null, user: UserInfo | null) => void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration options for Authentication Context
|
|
||||||
*/
|
|
||||||
interface Options {
|
|
||||||
/**
|
|
||||||
* Client ID assigned to your app by Azure Active Directory.
|
|
||||||
*/
|
|
||||||
clientId: string;
|
|
||||||
/**
|
|
||||||
* Endpoint at which you expect to receive tokens.Defaults to `window.location.href`.
|
|
||||||
*/
|
|
||||||
redirectUri?: string;
|
|
||||||
/**
|
|
||||||
* Azure Active Directory instance. Defaults to `https://login.microsoftonline.com/`.
|
|
||||||
*/
|
|
||||||
instance?: string;
|
|
||||||
/**
|
|
||||||
* Your target tenant. Defaults to `common`.
|
|
||||||
*/
|
|
||||||
tenant?: string;
|
|
||||||
/**
|
|
||||||
* Query parameters to add to the authentication request.
|
|
||||||
*/
|
|
||||||
extraQueryParameter?: string;
|
|
||||||
/**
|
|
||||||
* Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits).
|
|
||||||
*/
|
|
||||||
correlationId?: string;
|
|
||||||
/**
|
|
||||||
* User defined function of handling the navigation to Azure AD authorization endpoint in case of login.
|
|
||||||
*/
|
|
||||||
displayCall?: (url: string) => void;
|
|
||||||
/**
|
|
||||||
* Set this to true to enable login in a popup winodow instead of a full redirect. Defaults to `false`.
|
|
||||||
*/
|
|
||||||
popUp?: boolean;
|
|
||||||
/**
|
|
||||||
* Set this to the resource to request on login. Defaults to `clientId`.
|
|
||||||
*/
|
|
||||||
loginResource?: string;
|
|
||||||
/**
|
|
||||||
* Set this to redirect the user to a custom login page.
|
|
||||||
*/
|
|
||||||
localLoginUrl?: string;
|
|
||||||
/**
|
|
||||||
* Redirects to start page after login. Defaults to `true`.
|
|
||||||
*/
|
|
||||||
navigateToLoginRequestUrl?: boolean;
|
|
||||||
/**
|
|
||||||
* Set this to redirect the user to a custom logout page.
|
|
||||||
*/
|
|
||||||
logOutUri?: string;
|
|
||||||
/**
|
|
||||||
* Redirects the user to postLogoutRedirectUri after logout. Defaults to `redirectUri`.
|
|
||||||
*/
|
|
||||||
postLogoutRedirectUri?: string;
|
|
||||||
/**
|
|
||||||
* Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to `sessionStorage`.
|
|
||||||
*/
|
|
||||||
cacheLocation?: "localStorage" | "sessionStorage";
|
|
||||||
/**
|
|
||||||
* Array of keywords or URIs. Adal will attach a token to outgoing requests that have these keywords or URIs.
|
|
||||||
*/
|
|
||||||
endpoints?: { [resource: string]: string };
|
|
||||||
/**
|
|
||||||
* Array of keywords or URIs. Adal will not attach a token to outgoing requests that have these keywords or URIs.
|
|
||||||
*/
|
|
||||||
anonymousEndpoints?: string[];
|
|
||||||
/**
|
|
||||||
* If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds.
|
|
||||||
*/
|
|
||||||
expireOffsetSeconds?: number;
|
|
||||||
/**
|
|
||||||
* The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out. Defaults to 6 seconds.
|
|
||||||
*/
|
|
||||||
loadFrameTimeout?: number;
|
|
||||||
/**
|
|
||||||
* Callback to be invoked when a token is acquired.
|
|
||||||
*/
|
|
||||||
callback?: TokenCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface LoggingConfig {
|
|
||||||
level: LoggingLevel;
|
|
||||||
log: (message: string) => void;
|
|
||||||
piiLoggingEnabled: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enum for storage constants
|
|
||||||
*/
|
|
||||||
interface Constants {
|
|
||||||
ACCESS_TOKEN: "access_token";
|
|
||||||
EXPIRES_IN: "expires_in";
|
|
||||||
ID_TOKEN: "id_token";
|
|
||||||
ERROR_DESCRIPTION: "error_description";
|
|
||||||
SESSION_STATE: "session_state";
|
|
||||||
STORAGE: {
|
|
||||||
TOKEN_KEYS: "adal.token.keys";
|
|
||||||
ACCESS_TOKEN_KEY: "adal.access.token.key";
|
|
||||||
EXPIRATION_KEY: "adal.expiration.key";
|
|
||||||
STATE_LOGIN: "adal.state.login";
|
|
||||||
STATE_RENEW: "adal.state.renew";
|
|
||||||
NONCE_IDTOKEN: "adal.nonce.idtoken";
|
|
||||||
SESSION_STATE: "adal.session.state";
|
|
||||||
USERNAME: "adal.username";
|
|
||||||
IDTOKEN: "adal.idtoken";
|
|
||||||
ERROR: "adal.error";
|
|
||||||
ERROR_DESCRIPTION: "adal.error.description";
|
|
||||||
LOGIN_REQUEST: "adal.login.request";
|
|
||||||
LOGIN_ERROR: "adal.login.error";
|
|
||||||
RENEW_STATUS: "adal.token.renew.status";
|
|
||||||
};
|
|
||||||
RESOURCE_DELIMETER: "|";
|
|
||||||
LOADFRAME_TIMEOUT: "6000";
|
|
||||||
TOKEN_RENEW_STATUS_CANCELED: "Canceled";
|
|
||||||
TOKEN_RENEW_STATUS_COMPLETED: "Completed";
|
|
||||||
TOKEN_RENEW_STATUS_IN_PROGRESS: "In Progress";
|
|
||||||
LOGGING_LEVEL: {
|
|
||||||
ERROR: 0;
|
|
||||||
WARN: 1;
|
|
||||||
INFO: 2;
|
|
||||||
VERBOSE: 3;
|
|
||||||
};
|
|
||||||
LEVEL_STRING_MAP: {
|
|
||||||
0: "ERROR:";
|
|
||||||
1: "WARNING:";
|
|
||||||
2: "INFO:";
|
|
||||||
3: "VERBOSE:";
|
|
||||||
};
|
|
||||||
POPUP_WIDTH: 483;
|
|
||||||
POPUP_HEIGHT: 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// declare global {
|
|
||||||
// interface Window {
|
|
||||||
// Logging: AuthenticationContext.LoggingConfig;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user