From 37122acc3372b21a358adaacade26d4101950362 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Wed, 11 May 2022 18:12:12 -0700 Subject: [PATCH 01/22] Fix issue with reading and saving mongo documents with shard key (#1269) --- src/Explorer/Tree/Collection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Explorer/Tree/Collection.ts b/src/Explorer/Tree/Collection.ts index 9ef429df4..c5995b8df 100644 --- a/src/Explorer/Tree/Collection.ts +++ b/src/Explorer/Tree/Collection.ts @@ -133,7 +133,7 @@ export default class Collection implements ViewModels.Collection { if (partitionKeyProperty.indexOf("$v") > -1) { // From $v.shard.$v.key.$v > shard.key partitionKeyProperty = partitionKeyProperty.replace(/.\$v/g, "").replace(/\$v./g, ""); - this.partitionKeyPropertyHeaders[i] = partitionKeyProperty; + this.partitionKeyPropertyHeaders[i] = "/" + partitionKeyProperty; } } From 60525f654bf5f60fc00018258762ebc8e19a856d Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Mon, 16 May 2022 17:45:50 -0700 Subject: [PATCH 02/22] Add teaching bubbles after creating sample DB (#1270) * Add teaching bubbles after creating sample DB * Add teaching bubble while creating sample container * Remove test code * Update tests and always show teaching bubbles in add collection panel when launched from quick start * Fix snapshot --- .../Controls/TreeComponent/TreeComponent.tsx | 1 + .../__snapshots__/TreeComponent.test.tsx.snap | 2 + src/Explorer/Explorer.tsx | 3 +- .../CommandBarComponentButtonFactory.tsx | 3 + src/Explorer/Panes/AddCollectionPanel.tsx | 40 ++++- src/Explorer/Panes/PanelLoadingScreen.tsx | 2 +- src/Explorer/SplashScreen/SplashScreen.tsx | 2 +- src/Explorer/Tabs/DocumentsTab.ts | 1 + src/Explorer/Tabs/Tabs.tsx | 10 ++ src/Explorer/Tree/ResourceTree.tsx | 15 +- src/Explorer/Tutorials/QuickstartTutorial.tsx | 164 ++++++++++++++++++ src/Main.tsx | 2 + src/hooks/useTeachingBubble.ts | 19 ++ 13 files changed, 253 insertions(+), 11 deletions(-) create mode 100644 src/Explorer/Tutorials/QuickstartTutorial.tsx create mode 100644 src/hooks/useTeachingBubble.ts diff --git a/src/Explorer/Controls/TreeComponent/TreeComponent.tsx b/src/Explorer/Controls/TreeComponent/TreeComponent.tsx index c54d8fcf4..83b00b362 100644 --- a/src/Explorer/Controls/TreeComponent/TreeComponent.tsx +++ b/src/Explorer/Controls/TreeComponent/TreeComponent.tsx @@ -173,6 +173,7 @@ export class TreeNodeComponent extends React.Component) => this.onNodeClick(event, node)} onKeyPress={(event: React.KeyboardEvent) => this.onNodeKeyPress(event, node)} role="treeitem" + id={node.id} >
{ if (userContext.apiType === "Cassandra") { diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index c4fa1b79c..3a1a9c9db 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -309,6 +309,7 @@ function createNewSQLQueryButton(selectedNodeState: SelectedNodeState): CommandB if (userContext.apiType === "SQL" || userContext.apiType === "Gremlin") { const label = "New SQL Query"; return { + id: "newQueryBtn", iconSrc: AddSqlQueryIcon, iconAlt: label, onCommandClick: () => { @@ -323,6 +324,7 @@ function createNewSQLQueryButton(selectedNodeState: SelectedNodeState): CommandB } else if (userContext.apiType === "Mongo") { const label = "New Query"; return { + id: "newQueryBtn", iconSrc: AddSqlQueryIcon, iconAlt: label, onCommandClick: () => { @@ -409,6 +411,7 @@ function applyNotebooksTemporarilyDownStyle(buttonProps: CommandButtonComponentP function createNewNotebookButton(container: Explorer): CommandButtonComponentProps { const label = "New Notebook"; return { + id: "newNotebookBtn", iconSrc: NewNotebookIcon, iconAlt: label, onCommandClick: () => container.onNewNotebookClicked(), diff --git a/src/Explorer/Panes/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel.tsx index 9f279df51..6f7d51c4b 100644 --- a/src/Explorer/Panes/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel.tsx @@ -8,6 +8,7 @@ import { IconButton, IDropdownOption, Link, + ProgressIndicator, Separator, Stack, TeachingBubble, @@ -21,6 +22,7 @@ import { configContext, Platform } from "ConfigContext"; import * as DataModels from "Contracts/DataModels"; import { SubscriptionType } from "Contracts/SubscriptionType"; import { useSidePanel } from "hooks/useSidePanel"; +import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; import { CollectionCreation } from "Shared/Constants"; import { Action } from "Shared/Telemetry/TelemetryConstants"; @@ -42,7 +44,6 @@ export interface AddCollectionPanelProps { explorer: Explorer; databaseId?: string; isQuickstart?: boolean; - showTeachingBubble?: boolean; } const SharedDatabaseDefault: DataModels.IndexingPolicy = { @@ -134,7 +135,7 @@ export class AddCollectionPanel extends React.Component { - this.setState({ teachingBubbleStep: 0 }); + this.setState({ teachingBubbleStep: 5 }); this.submit(); }, }} @@ -764,7 +765,30 @@ export class AddCollectionPanel extends React.Component - {this.state.isExecuting && } + {this.state.isExecuting && ( +
+ + {this.state.teachingBubbleStep === 5 && ( + this.setState({ teachingBubbleStep: 0 })} + footerContent={ + + } + > + A sample container is now being created and we are adding sample data for you. It should take about 1 + minute. +
+
+ Once the sample container is created, review your sample dataset and follow next steps +
+ )} +
+ )} ); } @@ -1176,10 +1200,16 @@ export class AddCollectionPanel extends React.Component ( -
+
); diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 0431d2af8..153c2dd1f 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -149,7 +149,7 @@ export class SplashScreen extends React.Component { this.setState({ showCoachmark: false }); - this.container.onNewCollectionClicked({ isQuickstart: true, showTeachingBubble: true }); + this.container.onNewCollectionClicked({ isQuickstart: true }); }, }} secondaryButtonProps={{ text: "Cancel", onClick: () => this.setState({ showCoachmark: false }) }} diff --git a/src/Explorer/Tabs/DocumentsTab.ts b/src/Explorer/Tabs/DocumentsTab.ts index 17538b624..fd51273d7 100644 --- a/src/Explorer/Tabs/DocumentsTab.ts +++ b/src/Explorer/Tabs/DocumentsTab.ts @@ -909,6 +909,7 @@ export default class DocumentsTab extends TabsBase { public static _createUploadButton(container: Explorer): CommandButtonComponentProps { const label = "Upload Item"; return { + id: "uploadItemBtn", iconSrc: UploadIcon, iconAlt: label, onCommandClick: () => { diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index 7948e871a..ba2493540 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -1,3 +1,5 @@ +import { CollectionTabKind } from "Contracts/ViewModels"; +import { useTeachingBubble } from "hooks/useTeachingBubble"; import ko from "knockout"; import React, { MutableRefObject, useEffect, useRef, useState } from "react"; import loadingIcon from "../../../images/circular_loader_black_16x16.gif"; @@ -113,6 +115,14 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { }; useEffect((): (() => void) | void => { + if ( + tab.tabKind === CollectionTabKind.Documents && + tab.collection?.databaseId === "SampleDB" && + tab.collection?.id() === "SampleContainer" + ) { + useTeachingBubble.getState().setIsDocumentsTabOpened(true); + } + const { current: element } = ref; if (element) { ko.applyBindings(tab, element); diff --git a/src/Explorer/Tree/ResourceTree.tsx b/src/Explorer/Tree/ResourceTree.tsx index 77f694598..4a4ab526c 100644 --- a/src/Explorer/Tree/ResourceTree.tsx +++ b/src/Explorer/Tree/ResourceTree.tsx @@ -1,4 +1,5 @@ import { Callout, DirectionalHint, ICalloutProps, ILinkProps, Link, Stack, Text } from "@fluentui/react"; +import { useTeachingBubble } from "hooks/useTeachingBubble"; import * as React from "react"; import shallow from "zustand/shallow"; import CosmosDBIcon from "../../../images/Azure-Cosmos-DB.svg"; @@ -436,7 +437,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc const databaseNode: TreeNode = { label: database.id(), iconSrc: CosmosDBIcon, - isExpanded: false, + isExpanded: database.isDatabaseExpanded(), className: "databaseHeader", children: [], isSelected: () => useSelectedNode.getState().isDataNodeSelected(database.id()), @@ -461,6 +462,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc if (database.isDatabaseShared()) { databaseNode.children.push({ + id: database.id() === "SampleDB" ? "sampleScaleSettings" : "", label: "Scale", isSelected: () => useSelectedNode @@ -497,6 +499,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc const children: TreeNode[] = []; children.push({ label: collection.getLabel(), + id: collection.databaseId === "SampleDB" && collection.id() === "SampleContainer" ? "sampleItems" : "", onClick: () => { collection.openTab(); // push to most recent @@ -530,6 +533,10 @@ export const ResourceTree: React.FC = ({ container }: Resourc if (userContext.apiType !== "Cassandra" || !isServerlessAccount()) { children.push({ + id: + collection.databaseId === "SampleDB" && collection.id() === "SampleContainer" && !database.isDatabaseShared() + ? "sampleScaleSettings" + : "", label: database.isDatabaseShared() || isServerlessAccount() ? "Settings" : "Scale & Settings", onClick: collection.onSettingsClick.bind(collection), isSelected: () => @@ -572,7 +579,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc return { label: collection.id(), iconSrc: CollectionIcon, - isExpanded: false, + isExpanded: collection.isCollectionExpanded(), children: children, className: "collectionHeader", contextMenu: ResourceTreeContextMenuButtonFactory.createCollectionContextMenuButton(container, collection), @@ -586,6 +593,10 @@ export const ResourceTree: React.FC = ({ container }: Resourc ); }, onExpanded: () => { + // TODO: For testing purpose only, remove after + if (collection.databaseId === "SampleDB" && collection.id() === "SampleContainer") { + useTeachingBubble.getState().setIsSampleDBExpanded(true); + } if (showScriptNodes) { collection.loadStoredProcedures(); collection.loadUserDefinedFunctions(); diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx new file mode 100644 index 000000000..9da43060c --- /dev/null +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -0,0 +1,164 @@ +import { TeachingBubble } from "@fluentui/react"; +import { useDatabases } from "Explorer/useDatabases"; +import { useTeachingBubble } from "hooks/useTeachingBubble"; +import React from "react"; +import { userContext } from "UserContext"; + +export const QuickstartTutorial: React.FC = (): JSX.Element => { + const { step, isSampleDBExpanded, isDocumentsTabOpened, setStep } = useTeachingBubble(); + + if (!userContext.features.enableNewQuickstart) { + return <>; + } + + switch (step) { + case 1: + return isSampleDBExpanded ? ( + { + const sampleContainer = useDatabases.getState().findCollection("SampleDB", "SampleContainer"); + sampleContainer.openTab(); + setStep(2); + }, + }} + onDismiss={() => setStep(0)} + footerContent="Step 1 of 7" + > + Start viewing and working with your data by opening Items under Data + + ) : ( + <> + ); + case 2: + return isDocumentsTabOpened ? ( + setStep(3), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(1), + }} + onDismiss={() => setStep(0)} + footerContent="Step 2 of 7" + > + View item here using the items window. Additionally you can also filter items to be reviewed with the filter + function + + ) : ( + <> + ); + case 3: + return ( + setStep(4), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(2), + }} + onDismiss={() => setStep(0)} + footerContent="Step 3 of 7" + > + Add new item by copy / pasting jsons; or uploading a json + + ); + case 4: + return ( + setStep(5), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(3), + }} + onDismiss={() => setStep(0)} + footerContent="Step 4 of 7" + > + Query your data using either the filter function or new query. + + ); + case 5: + return ( + setStep(6), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(4), + }} + onDismiss={() => setStep(0)} + footerContent="Step 5 of 7" + > + Change throughput provisioned to your container according to your needs + + ); + case 6: + return ( + setStep(7), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(5), + }} + onDismiss={() => setStep(0)} + footerContent="Step 6 of 7" + > + Visualize your data, store queries in an interactive document + + ); + case 7: + return ( + setStep(7), + }} + secondaryButtonProps={{ + text: "Previous", + onClick: () => setStep(6), + }} + onDismiss={() => setStep(0)} + footerContent="Step 7 of 7" + > + You have finished the tour in data explorer. For next steps, you may want to launch connect and start + connecting with your current app + + ); + default: + return <>; + } +}; diff --git a/src/Main.tsx b/src/Main.tsx index c38012b64..869f4f7ea 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -1,6 +1,7 @@ // CSS Dependencies import { initializeIcons } from "@fluentui/react"; import "bootstrap/dist/css/bootstrap.css"; +import { QuickstartTutorial } from "Explorer/Tutorials/QuickstartTutorial"; import React, { useState } from "react"; import ReactDOM from "react-dom"; import "../externals/jquery-ui.min.css"; @@ -115,6 +116,7 @@ const App: React.FunctionComponent = () => {
+
); }; diff --git a/src/hooks/useTeachingBubble.ts b/src/hooks/useTeachingBubble.ts new file mode 100644 index 000000000..003d105e2 --- /dev/null +++ b/src/hooks/useTeachingBubble.ts @@ -0,0 +1,19 @@ +import create, { UseStore } from "zustand"; + +interface TeachingBubbleState { + step: number; + isSampleDBExpanded: boolean; + isDocumentsTabOpened: boolean; + setStep: (step: number) => void; + setIsSampleDBExpanded: (isReady: boolean) => void; + setIsDocumentsTabOpened: (isOpened: boolean) => void; +} + +export const useTeachingBubble: UseStore = create((set) => ({ + step: 1, + isSampleDBExpanded: false, + isDocumentsTabOpened: false, + setStep: (step: number) => set({ step }), + setIsSampleDBExpanded: (isSampleDBExpanded: boolean) => set({ isSampleDBExpanded }), + setIsDocumentsTabOpened: (isDocumentsTabOpened: boolean) => set({ isDocumentsTabOpened }), +})); From c2f3471afeae6df30e73f16037297bee2821449a Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Mon, 16 May 2022 18:23:54 -0700 Subject: [PATCH 03/22] Add carousel for quick start (#1271) * Add carousel for quick start * Put carousel behind feature flag * Install type definition for react-youtube * Install type definition for react-youtube * Remove @types/youtube-player * Move feature flag outside of quickstarttutorial component --- images/Placeholder.svg | 8 ++ package-lock.json | 114 ++++++++++++++++-- package.json | 2 + src/Explorer/Tutorials/QuickstartCarousel.tsx | 77 ++++++++++++ src/Explorer/Tutorials/QuickstartTutorial.tsx | 5 - src/Main.tsx | 5 +- 6 files changed, 197 insertions(+), 14 deletions(-) create mode 100644 images/Placeholder.svg create mode 100644 src/Explorer/Tutorials/QuickstartCarousel.tsx diff --git a/images/Placeholder.svg b/images/Placeholder.svg new file mode 100644 index 000000000..31d547883 --- /dev/null +++ b/images/Placeholder.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/package-lock.json b/package-lock.json index df903c500..ce3c13ec8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,6 +95,7 @@ "react-notification-system": "0.2.17", "react-redux": "7.1.3", "react-splitter-layout": "4.0.0", + "react-youtube": "9.0.1", "redux": "4.0.4", "reflect-metadata": "0.1.13", "rx-jupyter": "5.5.12", @@ -134,6 +135,7 @@ "@types/sinon": "2.3.3", "@types/styled-components": "5.1.1", "@types/underscore": "1.7.36", + "@types/youtube-player": "5.5.6", "@typescript-eslint/eslint-plugin": "4.22.0", "@typescript-eslint/parser": "4.22.0", "@webpack-cli/serve": "1.5.2", @@ -6825,6 +6827,12 @@ "@types/node": "*" } }, + "node_modules/@types/youtube-player": { + "version": "5.5.6", + "resolved": "https://registry.npmjs.org/@types/youtube-player/-/youtube-player-5.5.6.tgz", + "integrity": "sha512-RcWWUEuAZZX24dG55Xk558/HHCZxYf798/xPnV6wTwDlUF8HZNAmqyXyi+4QgN2l9juP9GRjCwILxXLSPKQBBw==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz", @@ -25033,13 +25041,13 @@ } }, "node_modules/prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", - "react-is": "^16.8.1" + "react-is": "^16.13.1" } }, "node_modules/prop-types-exact": { @@ -25958,6 +25966,22 @@ "react-dom": ">=15.0.0" } }, + "node_modules/react-youtube": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-9.0.1.tgz", + "integrity": "sha512-w2yt3o1H0fjlMjoqn8zEmtCqgiV+bYS1JfMSUfh70zky2rwWVORQzpt2DWoDio1+nZ1X9kSTzakdif6gaJdFuQ==", + "dependencies": { + "fast-deep-equal": "3.1.3", + "prop-types": "15.8.1", + "youtube-player": "5.5.2" + }, + "engines": { + "node": ">= 14.x" + }, + "peerDependencies": { + "react": ">=0.14.1" + } + }, "node_modules/reactcss": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/reactcss/-/reactcss-1.2.3.tgz", @@ -27391,6 +27415,11 @@ "node": ">= 10" } }, + "node_modules/sister": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sister/-/sister-3.0.2.tgz", + "integrity": "sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==" + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -31155,6 +31184,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/youtube-player": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.2.tgz", + "integrity": "sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==", + "dependencies": { + "debug": "^2.6.6", + "load-script": "^1.0.0", + "sister": "^3.0.0" + } + }, + "node_modules/youtube-player/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/youtube-player/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "node_modules/zalgo-promise": { "version": "1.0.46", "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.46.tgz", @@ -37098,6 +37150,12 @@ "@types/node": "*" } }, + "@types/youtube-player": { + "version": "5.5.6", + "resolved": "https://registry.npmjs.org/@types/youtube-player/-/youtube-player-5.5.6.tgz", + "integrity": "sha512-RcWWUEuAZZX24dG55Xk558/HHCZxYf798/xPnV6wTwDlUF8HZNAmqyXyi+4QgN2l9juP9GRjCwILxXLSPKQBBw==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz", @@ -51360,13 +51418,13 @@ } }, "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", - "react-is": "^16.8.1" + "react-is": "^16.13.1" } }, "prop-types-exact": { @@ -52072,6 +52130,16 @@ "react-lifecycles-compat": "^3.0.4" } }, + "react-youtube": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-9.0.1.tgz", + "integrity": "sha512-w2yt3o1H0fjlMjoqn8zEmtCqgiV+bYS1JfMSUfh70zky2rwWVORQzpt2DWoDio1+nZ1X9kSTzakdif6gaJdFuQ==", + "requires": { + "fast-deep-equal": "3.1.3", + "prop-types": "15.8.1", + "youtube-player": "5.5.2" + } + }, "reactcss": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/reactcss/-/reactcss-1.2.3.tgz", @@ -53221,6 +53289,11 @@ "totalist": "^1.0.0" } }, + "sister": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sister/-/sister-3.0.2.tgz", + "integrity": "sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==" + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -56130,6 +56203,31 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" }, + "youtube-player": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.2.tgz", + "integrity": "sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==", + "requires": { + "debug": "^2.6.6", + "load-script": "^1.0.0", + "sister": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "zalgo-promise": { "version": "1.0.46", "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.46.tgz", diff --git a/package.json b/package.json index 762d9c9ce..3e76f6f69 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "react-notification-system": "0.2.17", "react-redux": "7.1.3", "react-splitter-layout": "4.0.0", + "react-youtube": "9.0.1", "redux": "4.0.4", "reflect-metadata": "0.1.13", "rx-jupyter": "5.5.12", @@ -130,6 +131,7 @@ "@types/sinon": "2.3.3", "@types/styled-components": "5.1.1", "@types/underscore": "1.7.36", + "@types/youtube-player": "5.5.6", "@typescript-eslint/eslint-plugin": "4.22.0", "@typescript-eslint/parser": "4.22.0", "@webpack-cli/serve": "1.5.2", diff --git a/src/Explorer/Tutorials/QuickstartCarousel.tsx b/src/Explorer/Tutorials/QuickstartCarousel.tsx new file mode 100644 index 000000000..b5a58ead7 --- /dev/null +++ b/src/Explorer/Tutorials/QuickstartCarousel.tsx @@ -0,0 +1,77 @@ +import { DefaultButton, IconButton, Image, Modal, PrimaryButton, Stack, Text } from "@fluentui/react"; +import React, { useState } from "react"; +import Youtube from "react-youtube"; +import Placeholder from "../../../images/Placeholder.svg"; + +interface QuickstartCarouselProps { + isOpen: boolean; +} + +export const QuickstartCarousel: React.FC = ({ + isOpen, +}: QuickstartCarouselProps): JSX.Element => { + const [page, setPage] = useState(1); + return ( + + + + {getHeaderText(page)} + setPage(4)} /> + + {getContent(page)} + + {getDescriptionText(page)} + + + {page !== 1 && ( + setPage(page - 1)} /> + )} + setPage(page + 1)} + /> + + + + ); +}; + +const getHeaderText = (page: number): string => { + switch (page) { + case 1: + return "Welcome! What is Cosmos DB?"; + case 2: + return "Get Started with Sample Data"; + case 3: + return "Connect to your database"; + default: + return ""; + } +}; + +const getContent = (page: number): JSX.Element => { + switch (page) { + case 1: + return ; + case 2: + return ; + case 3: + return ; + default: + return <>; + } +}; + +const getDescriptionText = (page: number): string => { + switch (page) { + case 1: + return "Azure Cosmos DB is a fully managed NoSQL database service for modern app development. "; + case 2: + return "Launch the quickstart for a tutotrial to learn how to create a database, add sample data, connect to a sample app and more."; + case 3: + return "Already have an existing app? Connect your database to an app, or tooling of your choice from Data Explorer."; + default: + return ""; + } +}; diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx index 9da43060c..4b7c0fc71 100644 --- a/src/Explorer/Tutorials/QuickstartTutorial.tsx +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -2,15 +2,10 @@ import { TeachingBubble } from "@fluentui/react"; import { useDatabases } from "Explorer/useDatabases"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; -import { userContext } from "UserContext"; export const QuickstartTutorial: React.FC = (): JSX.Element => { const { step, isSampleDBExpanded, isDocumentsTabOpened, setStep } = useTeachingBubble(); - if (!userContext.features.enableNewQuickstart) { - return <>; - } - switch (step) { case 1: return isSampleDBExpanded ? ( diff --git a/src/Main.tsx b/src/Main.tsx index 869f4f7ea..0888f3ec2 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -1,9 +1,11 @@ // CSS Dependencies import { initializeIcons } from "@fluentui/react"; import "bootstrap/dist/css/bootstrap.css"; +import { QuickstartCarousel } from "Explorer/Tutorials/QuickstartCarousel"; import { QuickstartTutorial } from "Explorer/Tutorials/QuickstartTutorial"; import React, { useState } from "react"; import ReactDOM from "react-dom"; +import { userContext } from "UserContext"; import "../externals/jquery-ui.min.css"; import "../externals/jquery-ui.min.js"; import "../externals/jquery-ui.structure.min.css"; @@ -116,7 +118,8 @@ const App: React.FunctionComponent = () => { - + {userContext.features.enableNewQuickstart && } + {userContext.features.enableNewQuickstart && } ); }; From dc83bf6fa02e0f498bb98e1520e9767993763e98 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 20 May 2022 16:37:50 -0700 Subject: [PATCH 04/22] Update recent items UI and add to new home page (#1275) * Update recent items UI and add to new home page * Update text and links for different APIs * Update home page text and carousel images --- images/CarouselImage1.svg | 54 +++ images/CarouselImage2.svg | 66 +++ images/Cost.svg | 16 - images/Green_check.svg | 4 - images/Notebooks.svg | 27 +- images/Placeholder.svg | 8 - src/Explorer/SplashScreen/SplashScreen.less | 9 - src/Explorer/SplashScreen/SplashScreen.tsx | 376 ++++++++++++------ src/Explorer/Tutorials/QuickstartCarousel.tsx | 7 +- 9 files changed, 400 insertions(+), 167 deletions(-) create mode 100644 images/CarouselImage1.svg create mode 100644 images/CarouselImage2.svg delete mode 100644 images/Cost.svg delete mode 100644 images/Green_check.svg delete mode 100644 images/Placeholder.svg diff --git a/images/CarouselImage1.svg b/images/CarouselImage1.svg new file mode 100644 index 000000000..7901e733f --- /dev/null +++ b/images/CarouselImage1.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/CarouselImage2.svg b/images/CarouselImage2.svg new file mode 100644 index 000000000..83441d9e1 --- /dev/null +++ b/images/CarouselImage2.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/Cost.svg b/images/Cost.svg deleted file mode 100644 index f46733a8e..000000000 --- a/images/Cost.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/images/Green_check.svg b/images/Green_check.svg deleted file mode 100644 index 3bee1e456..000000000 --- a/images/Green_check.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/images/Notebooks.svg b/images/Notebooks.svg index b313b90ea..96de71b63 100644 --- a/images/Notebooks.svg +++ b/images/Notebooks.svg @@ -1,28 +1,23 @@ - - - - - - - - - - - + + + + + + + + + - + - + - - - diff --git a/images/Placeholder.svg b/images/Placeholder.svg deleted file mode 100644 index 31d547883..000000000 --- a/images/Placeholder.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/Explorer/SplashScreen/SplashScreen.less b/src/Explorer/SplashScreen/SplashScreen.less index 856a07d70..63f06b4c6 100644 --- a/src/Explorer/SplashScreen/SplashScreen.less +++ b/src/Explorer/SplashScreen/SplashScreen.less @@ -57,7 +57,6 @@ .legend { font-family: @SemiboldFont; - margin-bottom: @DefaultSpace; font-size: 18px; } @@ -114,14 +113,6 @@ margin-top: 4px; } - .twoLineContent { - margin-top: -5px; - - :nth-child(2) { - font-size: 9px; - } - } - .description { font-size: 10px; color: @BaseMediumHigh; diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 153c2dd1f..5818e95c6 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -9,14 +9,12 @@ import NewStoredProcedureIcon from "../../../images/AddStoredProcedure.svg"; import OpenQueryIcon from "../../../images/BrowseQuery.svg"; import ConnectIcon from "../../../images/Connect_color.svg"; import ContainersIcon from "../../../images/Containers.svg"; -import CostIcon from "../../../images/Cost.svg"; -import GreenCheckIcon from "../../../images/Green_check.svg"; import NewContainerIcon from "../../../images/Hero-new-container.svg"; import NewNotebookIcon from "../../../images/Hero-new-notebook.svg"; import SampleIcon from "../../../images/Hero-sample.svg"; import LinkIcon from "../../../images/Link_blue.svg"; import NotebookIcon from "../../../images/notebook/Notebook-resource.svg"; -import NotebooksIcon from "../../../images/Notebooks.svg"; +import NotebookColorIcon from "../../../images/Notebooks.svg"; import QuickStartIcon from "../../../images/Quickstart_Lightning.svg"; import ScaleAndSettingsIcon from "../../../images/Scale_15x15.svg"; import CollectionIcon from "../../../images/tree-collection.svg"; @@ -42,6 +40,7 @@ export interface SplashScreenItem { id?: string; info?: string; description: string; + showLinkIcon?: boolean; onClick: () => void; } @@ -124,7 +123,11 @@ export class SplashScreen extends React.Component
-
{item.title}
+ +
{item.title}
+ {item.showLinkIcon && } +
+
-
- {userContext.features.enableNewQuickstart ? "Why Cosmos DB" : "Common Tasks"} -
- {userContext.features.enableNewQuickstart ? this.getNotebookItems() : this.getCommonTasksItems()} +
{userContext.features.enableNewQuickstart ? "Recents" : "Common Tasks"}
+ {userContext.features.enableNewQuickstart ? this.getRecentItems() : this.getCommonTasksItems()}
@@ -198,16 +199,31 @@ export class SplashScreen extends React.Component this.container.onNewCollectionClicked({ isQuickstart: true }), - }; + if (userContext.apiType === "SQL" || userContext.apiType === "Mongo") { + const launchQuickstartBtn = { + id: "quickstartDescription", + iconSrc: QuickStartIcon, + title: "Launch quick start", + description: "Launch a quick start tutorial to get started with sample data", + showLinkIcon: userContext.apiType === "Mongo", + onClick: () => + userContext.apiType === "Mongo" + ? window.open("http://aka.ms/mongodbquickstart", "_blank") + : this.container.onNewCollectionClicked({ isQuickstart: true }), + }; + heroes.push(launchQuickstartBtn); + } else if (useNotebook.getState().isPhoenixNotebooks) { + const newNotebookBtn = { + iconSrc: NotebookColorIcon, + title: "New notebook", + description: "Visualize your data stored in Azure Cosmos DB", + onClick: () => this.container.onNewNotebookClicked(), + }; + heroes.push(newNotebookBtn); + } const newContainerBtn = { iconSrc: ContainersIcon, @@ -215,6 +231,7 @@ export class SplashScreen extends React.Component this.container.onNewCollectionClicked(), }; + heroes.push(newContainerBtn); const connectBtn = { iconSrc: ConnectIcon, @@ -223,11 +240,9 @@ export class SplashScreen extends React.Component 2, }; - - return [launchQuickstartBtn, newContainerBtn, connectBtn]; + heroes.push(connectBtn); } else { - const heroes: SplashScreenItem[] = []; - + const dataSampleUtil = this.createDataSampleUtil(); if (dataSampleUtil.isSampleContainerCreationSupported()) { heroes.push({ iconSrc: SampleIcon, @@ -252,9 +267,9 @@ export class SplashScreen extends React.Component this.container.onNewNotebookClicked(), }); } - - return heroes; } + + return heroes; } private createCommonTaskItems(): SplashScreenItem[] { @@ -349,9 +364,9 @@ export class SplashScreen extends React.Component { const collection = useDatabases.getState().findCollection(databaseId, collectionId); collection?.openTab(); @@ -362,7 +377,7 @@ export class SplashScreen extends React.Component { @@ -418,25 +433,6 @@ export class SplashScreen extends React.Component - - - Notebook - Easy to develop - - - - Notebook - Enterprise ready - - - - Notebook - Cost effective - - - ); - } - private getCommonTasksItems(): JSX.Element { const commonTaskItems = this.createCommonTaskItems(); return ( @@ -461,41 +457,117 @@ export class SplashScreen extends React.Component - - - - Advanced Modeling Patterns - - + {items.map((item, i) => ( + + + + {item.title} + + + + {item.description} - - Learn advanced strategies for managing relationships between data entities to optimize your database. - - - - - - Partitioning Best Practices - - - - - Learn to apply data model and partitioning strategies to support an efficient and scalable NoSQL database. - - - - - - Plan Your Resource Requirements - - - - - Familiarize yourself with the various configuration options for a new Azure Cosmos DB SQL API account. - - + ))} ); } @@ -508,13 +580,15 @@ export class SplashScreen extends React.Component {recentItems.map((item, index) => (
  • - - - - {item.title} - -
    {item.description}
    -
    + + + + + {item.title} + + + {item.description} +
  • ))} @@ -524,37 +598,117 @@ export class SplashScreen extends React.Component - - - - Get Started using th SQL API with the SDK - - + {items.map((item, i) => ( + + + + {item.title} + + + + {item.description} - Learn about the Azure Cosmos DB SDK, then download and use in a .NET application. - - - - - Master Complex Queries - - - - Learn how to author complex queries using cross-products and correlated subqueries. - - - - - Migrate Your Data - - - - - Migrate data into and out of Azure Cosmos DB SQL API using Azure services and open-source solutions. - - + ))} ); } diff --git a/src/Explorer/Tutorials/QuickstartCarousel.tsx b/src/Explorer/Tutorials/QuickstartCarousel.tsx index b5a58ead7..6077d221f 100644 --- a/src/Explorer/Tutorials/QuickstartCarousel.tsx +++ b/src/Explorer/Tutorials/QuickstartCarousel.tsx @@ -1,7 +1,8 @@ import { DefaultButton, IconButton, Image, Modal, PrimaryButton, Stack, Text } from "@fluentui/react"; import React, { useState } from "react"; import Youtube from "react-youtube"; -import Placeholder from "../../../images/Placeholder.svg"; +import Image1 from "../../../images/CarouselImage1.svg"; +import Image2 from "../../../images/CarouselImage2.svg"; interface QuickstartCarouselProps { isOpen: boolean; @@ -55,9 +56,9 @@ const getContent = (page: number): JSX.Element => { case 1: return ; case 2: - return ; + return ; case 3: - return ; + return ; default: return <>; } From 2ab60a7a40e17ff0f961c4486c5dde73b3bb8800 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 20 May 2022 16:38:38 -0700 Subject: [PATCH 05/22] Add connect tab for new quick start (#1273) * Add connect tab * Error handling * Add button to open quick start blade * Handle scenario where user don't have write access --- src/Contracts/ExplorerContracts.ts | 1 + src/Explorer/SplashScreen/SplashScreen.tsx | 4 +- src/Explorer/Tabs/ConnectTab.tsx | 232 ++++++++++++++++++ src/Explorer/Tabs/Tabs.tsx | 37 ++- src/Explorer/Tutorials/QuickstartTutorial.tsx | 3 +- src/Main.tsx | 3 +- src/hooks/useTabs.ts | 28 ++- 7 files changed, 289 insertions(+), 19 deletions(-) create mode 100644 src/Explorer/Tabs/ConnectTab.tsx diff --git a/src/Contracts/ExplorerContracts.ts b/src/Contracts/ExplorerContracts.ts index 09a271194..7fd127bec 100644 --- a/src/Contracts/ExplorerContracts.ts +++ b/src/Contracts/ExplorerContracts.ts @@ -34,6 +34,7 @@ export enum MessageTypes { CreateSparkPool, RefreshDatabaseAccount, CloseTab, + OpenQuickstartBlade, } export { Versions, ActionContracts, Diagnostics }; diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 5818e95c6..212ef06fc 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -2,6 +2,7 @@ * Accordion top class */ import { Coachmark, DirectionalHint, Image, Link, Stack, TeachingBubbleContent, Text } from "@fluentui/react"; +import { useTabs } from "hooks/useTabs"; import * as React from "react"; import AddDatabaseIcon from "../../../images/AddDatabase.svg"; import NewQueryIcon from "../../../images/AddSqlQuery_16x16.svg"; @@ -237,8 +238,7 @@ export class SplashScreen extends React.Component 2, + onClick: () => useTabs.getState().openAndActivateConnectTab(), }; heroes.push(connectBtn); } else { diff --git a/src/Explorer/Tabs/ConnectTab.tsx b/src/Explorer/Tabs/ConnectTab.tsx new file mode 100644 index 000000000..d1edef963 --- /dev/null +++ b/src/Explorer/Tabs/ConnectTab.tsx @@ -0,0 +1,232 @@ +import { + IconButton, + ITextFieldStyles, + Link, + Pivot, + PivotItem, + PrimaryButton, + Stack, + Text, + TextField, +} from "@fluentui/react"; +import { handleError } from "Common/ErrorHandlingUtils"; +import { sendMessage } from "Common/MessageHandler"; +import { MessageTypes } from "Contracts/ExplorerContracts"; +import React, { useEffect, useState } from "react"; +import { userContext } from "UserContext"; +import { listKeys, listReadOnlyKeys } from "Utils/arm/generatedClients/cosmos/databaseAccounts"; +import { + DatabaseAccountListKeysResult, + DatabaseAccountListReadOnlyKeysResult, +} from "Utils/arm/generatedClients/cosmos/types"; + +export const ConnectTab: React.FC = (): JSX.Element => { + const [primaryMasterKey, setPrimaryMasterKey] = useState(""); + const [secondaryMasterKey, setSecondaryMasterKey] = useState(""); + const [primaryReadonlyMasterKey, setPrimaryReadonlyMasterKey] = useState(""); + const [secondaryReadonlyMasterKey, setSecondaryReadonlyMasterKey] = useState(""); + const uri: string = userContext.databaseAccount.properties?.documentEndpoint; + const primaryConnectionStr = `AccountEndpoint=${uri};AccountKey=${primaryMasterKey}`; + const secondaryConnectionStr = `AccountEndpoint=${uri};AccountKey=${secondaryMasterKey}`; + const primaryReadonlyConnectionStr = `AccountEndpoint=${uri};AccountKey=${primaryReadonlyMasterKey}`; + const secondaryReadonlyConnectionStr = `AccountEndpoint=${uri};AccountKey=${secondaryReadonlyMasterKey}`; + + useEffect(() => { + fetchKeys(); + }, []); + + const fetchKeys = async (): Promise => { + try { + if (userContext.hasWriteAccess) { + const listKeysResult: DatabaseAccountListKeysResult = await listKeys( + userContext.subscriptionId, + userContext.resourceGroup, + userContext.databaseAccount.name + ); + setPrimaryMasterKey(listKeysResult.primaryMasterKey); + setSecondaryMasterKey(listKeysResult.secondaryMasterKey); + setPrimaryReadonlyMasterKey(listKeysResult.primaryReadonlyMasterKey); + setSecondaryReadonlyMasterKey(listKeysResult.secondaryReadonlyMasterKey); + } else { + const listReadonlyKeysResult: DatabaseAccountListReadOnlyKeysResult = await listReadOnlyKeys( + userContext.subscriptionId, + userContext.resourceGroup, + userContext.databaseAccount.name + ); + setPrimaryReadonlyMasterKey(listReadonlyKeysResult.primaryReadonlyMasterKey); + setSecondaryReadonlyMasterKey(listReadonlyKeysResult.secondaryReadonlyMasterKey); + } + } catch (error) { + handleError(error, "listKeys", "listKeys request has failed: "); + throw error; + } + }; + + const onCopyBtnClicked = (selector: string): void => { + const textfield: HTMLInputElement = document.querySelector(selector); + textfield.select(); + document.execCommand("copy"); + }; + + const textfieldStyles: Partial = { + root: { width: "100%" }, + field: { backgroundColor: "rgb(230, 230, 230)" }, + fieldGroup: { borderColor: "rgb(138, 136, 134)" }, + }; + + return ( +
    + + + Ensure you have the right networking / access configuration before you establish the connection with your app + or 3rd party tool. + + + Configure networking in Azure portal + + + + + {userContext.hasWriteAccess && ( + + + + + onCopyBtnClicked("#uriTextfield")} /> + + + + + onCopyBtnClicked("#primaryKeyTextfield")} /> + + + + + onCopyBtnClicked("#secondaryKeyTextfield")} + /> + + + + + onCopyBtnClicked("#primaryConStrTextfield")} + /> + + + + onCopyBtnClicked("#secondaryConStrTextfield")} + /> + + + + )} + + + + + onCopyBtnClicked("#uriReadOnlyTextfield")} /> + + + + onCopyBtnClicked("#primaryReadonlyKeyTextfield")} + /> + + + + onCopyBtnClicked("#secondaryReadonlyKeyTextfield")} + /> + + + + onCopyBtnClicked("#primaryReadonlyConStrTextfield")} + /> + + + + onCopyBtnClicked("#secondaryReadonlyConStrTextfield")} + /> + + + + + + + Download sample app + + Don’t have an app ready? No worries, download one of our sample app with a platform of your choice. Connection + string is already included in the app. + + + sendMessage({ + type: MessageTypes.OpenQuickstartBlade, + }) + } + text="Download sample app" + /> + +
    + ); +}; diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index ba2493540..161c3e200 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -1,4 +1,5 @@ import { CollectionTabKind } from "Contracts/ViewModels"; +import { ConnectTab } from "Explorer/Tabs/ConnectTab"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import ko from "knockout"; import React, { MutableRefObject, useEffect, useRef, useState } from "react"; @@ -12,17 +13,21 @@ type Tab = TabsBase | (TabsBase & { render: () => JSX.Element }); export const Tabs = (): JSX.Element => { const { openedTabs, activeTab } = useTabs(); + const isConnectTabOpen = useTabs((state) => state.isConnectTabOpen); + const isConnectTabActive = useTabs((state) => state.isConnectTabActive); return (
    + {isConnectTabActive && } {openedTabs.map((tab) => ( ))} @@ -35,6 +40,7 @@ export const Tabs = (): JSX.Element => { function TabNav({ tab, active }: { tab: Tab; active: boolean }) { const [hovering, setHovering] = useState(false); const focusTab = useRef() as MutableRefObject; + const tabId = tab ? tab.tabId : "connect"; useEffect(() => { if (active && focusTab.current) { @@ -45,27 +51,27 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) {
  • setHovering(true)} onMouseLeave={() => setHovering(false)} - onClick={() => tab.onTabClick()} - onKeyPress={({ nativeEvent: e }) => tab.onKeyPressActivate(undefined, e)} + onClick={() => (tab ? tab.onTabClick() : useTabs.getState().activateConnectTab())} + onKeyPress={({ nativeEvent: e }) => (tab ? tab.onKeyPressActivate(undefined, e) : onKeyPressConnectTab(e))} className={active ? "active tabList" : "tabList"} - title={useObservable(tab.tabPath)} + title={useObservable(tab?.tabPath || ko.observable(""))} aria-selected={active} aria-expanded={active} - aria-controls={tab.tabId} + aria-controls={tabId} tabIndex={0} role="tab" ref={focusTab} > - +
    - {useObservable(tab.isExecutionError) && } - {useObservable(tab.isExecuting) && ( + {useObservable(tab?.isExecutionError || ko.observable(false)) && } + {useObservable(tab?.isExecuting || ko.observable(false)) && ( Loading )} - {useObservable(tab.tabTitle)} + {useObservable(tab?.tabTitle || ko.observable("Connect"))} @@ -83,7 +89,7 @@ const CloseButton = ({ tab, active, hovering }: { tab: Tab; active: boolean; hov role="button" aria-label="Close Tab" className="cancelButton" - onClick={() => tab.onCloseTabButtonClick()} + onClick={() => (tab ? tab.onCloseTabButtonClick() : useTabs.getState().closeConnectTab())} tabIndex={active ? 0 : undefined} onKeyPress={({ nativeEvent: e }) => tab.onKeyPressClose(undefined, e)} > @@ -133,9 +139,18 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { } }, [ref, tab]); - if ("render" in tab) { - return
    {tab.render()}
    ; + if (tab) { + if ("render" in tab) { + return
    {tab.render()}
    ; + } } return
    ; } + +const onKeyPressConnectTab = (e: KeyboardEvent): void => { + if (e.key === "Enter" || e.key === "Space") { + useTabs.getState().activateConnectTab(); + e.stopPropagation(); + } +}; diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx index 4b7c0fc71..393c963e5 100644 --- a/src/Explorer/Tutorials/QuickstartTutorial.tsx +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -1,5 +1,6 @@ import { TeachingBubble } from "@fluentui/react"; import { useDatabases } from "Explorer/useDatabases"; +import { useTabs } from "hooks/useTabs"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; @@ -140,7 +141,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { hasCloseButton primaryButtonProps={{ text: "Launch connect", - //onClick: () => setStep(7), + onClick: () => useTabs.getState().openAndActivateConnectTab(), }} secondaryButtonProps={{ text: "Previous", diff --git a/src/Main.tsx b/src/Main.tsx index 0888f3ec2..096ce7dc0 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -60,6 +60,7 @@ initializeIcons(); const App: React.FunctionComponent = () => { const [isLeftPaneExpanded, setIsLeftPaneExpanded] = useState(true); const openedTabs = useTabs((state) => state.openedTabs); + const isConnectTabOpen = useTabs((state) => state.isConnectTabOpen); const config = useConfig(); const explorer = useKnockoutExplorer(config?.platform); @@ -103,7 +104,7 @@ const App: React.FunctionComponent = () => {
    {/* Collections Tree - End */} - {openedTabs.length === 0 && } + {openedTabs.length === 0 && !isConnectTabOpen && }
  • {/* Collections Tree and Tabs - End */} diff --git a/src/hooks/useTabs.ts b/src/hooks/useTabs.ts index c8c059ab0..93149aba1 100644 --- a/src/hooks/useTabs.ts +++ b/src/hooks/useTabs.ts @@ -7,6 +7,8 @@ import TabsBase from "../Explorer/Tabs/TabsBase"; interface TabsState { openedTabs: TabsBase[]; activeTab: TabsBase; + isConnectTabOpen: boolean; + isConnectTabActive: boolean; activateTab: (tab: TabsBase) => void; activateNewTab: (tab: TabsBase) => void; updateTab: (tab: TabsBase) => void; @@ -15,19 +17,24 @@ interface TabsState { closeTabsByComparator: (comparator: (tab: TabsBase) => boolean) => void; closeTab: (tab: TabsBase) => void; closeAllNotebookTabs: (hardClose: boolean) => void; + activateConnectTab: () => void; + openAndActivateConnectTab: () => void; + closeConnectTab: () => void; } export const useTabs: UseStore = create((set, get) => ({ openedTabs: [], activeTab: undefined, + isConnectTabOpen: false, + isConnectTabActive: false, activateTab: (tab: TabsBase): void => { if (get().openedTabs.some((openedTab) => openedTab.tabId === tab.tabId)) { - set({ activeTab: tab }); + set({ activeTab: tab, isConnectTabActive: false }); tab.onActivate(); } }, activateNewTab: (tab: TabsBase): void => { - set((state) => ({ openedTabs: [...state.openedTabs, tab], activeTab: tab })); + set((state) => ({ openedTabs: [...state.openedTabs, tab], activeTab: tab, isConnectTabActive: false })); tab.onActivate(); }, updateTab: (tab: TabsBase) => { @@ -66,7 +73,7 @@ export const useTabs: UseStore = create((set, get) => ({ return true; }); if (updatedTabs.length === 0) { - set({ activeTab: undefined }); + set({ activeTab: undefined, isConnectTabActive: get().isConnectTabOpen }); } if (tab.tabId === activeTab.tabId && tabIndex !== -1) { @@ -104,8 +111,21 @@ export const useTabs: UseStore = create((set, get) => ({ }); if (get().openedTabs.length === 0) { - set({ activeTab: undefined }); + set({ activeTab: undefined, isConnectTabActive: get().isConnectTabOpen }); } } }, + activateConnectTab: () => { + if (get().isConnectTabOpen) { + set({ isConnectTabActive: true, activeTab: undefined }); + } + }, + openAndActivateConnectTab: () => set({ isConnectTabActive: true, isConnectTabOpen: true, activeTab: undefined }), + closeConnectTab: () => { + const { isConnectTabActive, openedTabs } = get(); + if (isConnectTabActive && openedTabs?.length > 0) { + set({ activeTab: openedTabs[0] }); + } + set({ isConnectTabActive: false, isConnectTabOpen: false }); + }, })); From dfd5a7c6984064a94937e952ee37b5e729093fee Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 20 May 2022 16:39:21 -0700 Subject: [PATCH 06/22] Use undefined as the partition key value when deleting and updating documents (#1274) --- src/Common/dataAccess/deleteDocument.ts | 6 +++--- src/Common/dataAccess/updateDocument.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Common/dataAccess/deleteDocument.ts b/src/Common/dataAccess/deleteDocument.ts index 0ab2e6999..51713e791 100644 --- a/src/Common/dataAccess/deleteDocument.ts +++ b/src/Common/dataAccess/deleteDocument.ts @@ -1,9 +1,9 @@ import { CollectionBase } from "../../Contracts/ViewModels"; +import DocumentId from "../../Explorer/Tree/DocumentId"; +import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils"; import { client } from "../CosmosClient"; import { getEntityName } from "../DocumentUtility"; import { handleError } from "../ErrorHandlingUtils"; -import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils"; -import DocumentId from "../../Explorer/Tree/DocumentId"; export const deleteDocument = async (collection: CollectionBase, documentId: DocumentId): Promise => { const entityName: string = getEntityName(); @@ -13,7 +13,7 @@ export const deleteDocument = async (collection: CollectionBase, documentId: Doc await client() .database(collection.databaseId) .container(collection.id()) - .item(documentId.id(), documentId.partitionKeyValue) + .item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue) .delete(); logConsoleInfo(`Successfully deleted ${entityName} ${documentId.id()}`); } catch (error) { diff --git a/src/Common/dataAccess/updateDocument.ts b/src/Common/dataAccess/updateDocument.ts index 7cda6566d..8aa100bbc 100644 --- a/src/Common/dataAccess/updateDocument.ts +++ b/src/Common/dataAccess/updateDocument.ts @@ -25,7 +25,7 @@ export const updateDocument = async ( const response = await client() .database(collection.databaseId) .container(collection.id()) - .item(documentId.id(), documentId.partitionKeyValue) + .item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue) .replace(newDocument, options); logConsoleInfo(`Successfully updated ${entityName} ${documentId.id()}`); From d13b7a50ad89423117ffd9993a7ad6b532d60e8e Mon Sep 17 00:00:00 2001 From: Srinath Narayanan Date: Mon, 23 May 2022 16:28:45 +0530 Subject: [PATCH 07/22] phoenix errors added (#1272) --- src/Contracts/DataModels.ts | 9 +++++---- src/Explorer/Explorer.tsx | 4 +--- src/Phoenix/PhoenixClient.ts | 24 +++++++++++++----------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index ca76351cf..a367656e4 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -450,21 +450,21 @@ export interface IResponse { data: T; } -export interface IValidationError { +export interface IPhoenixError { message: string; type: string; } -export interface IMaxAllocationTimeExceeded extends IValidationError { +export interface IMaxAllocationTimeExceeded extends IPhoenixError { earliestAllocationTimestamp: string; maxAllocationTimePerDayPerUserInMinutes: string; } -export interface IMaxDbAccountsPerUserExceeded extends IValidationError { +export interface IMaxDbAccountsPerUserExceeded extends IPhoenixError { maxSimultaneousConnectionsPerUser: string; } -export interface IMaxUsersPerDbAccountExceeded extends IValidationError { +export interface IMaxUsersPerDbAccountExceeded extends IPhoenixError { maxSimultaneousUsersPerDbAccount: string; } @@ -557,4 +557,5 @@ export enum PhoenixErrorType { AllocationValidationResult = "AllocationValidationResult", RegionNotServicable = "RegionNotServicable", SubscriptionNotAllowed = "SubscriptionNotAllowed", + UnknownError = "UnknownError", } diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index a74abb0d9..a90b0dc41 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -369,9 +369,6 @@ export default class Explorer { }); useNotebook.getState().setIsAllocating(true); connectionInfo = await this.phoenixClient.allocateContainer(provisionData); - if (connectionInfo.status !== HttpStatusCodes.OK) { - throw new Error(`Received status code: ${connectionInfo?.status}`); - } if (!connectionInfo?.data?.notebookServerUrl) { throw new Error(`NotebookServerUrl is invalid!`); } @@ -382,6 +379,7 @@ export default class Explorer { } catch (error) { TelemetryProcessor.traceFailure(Action.PhoenixConnection, { dataExplorerArea: Areas.Notebook, + status: error.status, error: getErrorMessage(error), errorStack: getErrorStack(error), }); diff --git a/src/Phoenix/PhoenixClient.ts b/src/Phoenix/PhoenixClient.ts index 7629ffac5..3b95a5786 100644 --- a/src/Phoenix/PhoenixClient.ts +++ b/src/Phoenix/PhoenixClient.ts @@ -21,9 +21,9 @@ import { IMaxDbAccountsPerUserExceeded, IMaxUsersPerDbAccountExceeded, IPhoenixConnectionInfoResult, + IPhoenixError, IProvisionData, IResponse, - IValidationError, PhoenixErrorType, } from "../Contracts/DataModels"; import { useNotebook } from "../Explorer/Notebook/useNotebook"; @@ -59,17 +59,19 @@ export class PhoenixClient { body: JSON.stringify(provisionData), }); const responseJson = await response?.json(); - if (response.status === HttpStatusCodes.Forbidden) { - throw new Error(this.ConvertToForbiddenErrorString(responseJson)); + if (response.ok) { + return { + status: response.status, + data: responseJson, + }; } - return { - status: response.status, - data: responseJson, - }; + const phoenixError = responseJson as IPhoenixError; + if (response.status === HttpStatusCodes.Forbidden) { + throw new Error(this.ConvertToForbiddenErrorString(phoenixError)); + } + throw new Error(phoenixError.message); } catch (error) { - if (response.status === HttpStatusCodes.Forbidden) { - error.status = HttpStatusCodes.Forbidden; - } + error.status = response?.status; throw error; } } @@ -220,7 +222,7 @@ export class PhoenixClient { }; } - public ConvertToForbiddenErrorString(jsonData: IValidationError): string { + public ConvertToForbiddenErrorString(jsonData: IPhoenixError): string { const errInfo = jsonData; switch (errInfo?.type) { case PhoenixErrorType.MaxAllocationTimeExceeded: { From 46ca952955d838d7fd7566f635f938479368f6a2 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Mon, 23 May 2022 20:52:21 -0700 Subject: [PATCH 08/22] Add condition for showing quick start carousel (#1278) * Add condition for showing quick start carousel * Show coach mark when carousel is closed * Add condition for showing quick start carousel and other UI changes * Fix compile error * Fix issue with coach mark * Fix test * Add new sample data, fix link url, fix e2e tests * Fix e2e tests --- sampleData/sqlSampleData.json | 43 +++-- src/Contracts/ViewModels.ts | 2 + src/Explorer/Panes/AddCollectionPanel.tsx | 68 ++++++-- .../SplashScreen/SplashScreen.test.ts | 25 --- src/Explorer/SplashScreen/SplashScreen.tsx | 154 +++++++----------- src/Explorer/Tabs/ConnectTab.tsx | 22 +-- src/Explorer/Tabs/Tabs.tsx | 6 +- src/Explorer/Tree/Collection.ts | 2 + src/Explorer/Tree/Database.tsx | 2 + src/Explorer/Tree/ResourceTree.tsx | 14 +- src/Explorer/Tutorials/QuickstartCarousel.tsx | 24 ++- src/Explorer/Tutorials/QuickstartTutorial.tsx | 23 ++- src/Main.tsx | 7 +- src/Platform/Hosted/extractFeatures.ts | 2 - src/Shared/StorageUtility.ts | 1 + src/UserContext.ts | 5 + src/hooks/useCarousel.ts | 15 ++ src/hooks/useTeachingBubble.ts | 5 + test/cassandra/container.spec.ts | 4 + test/graph/container.spec.ts | 4 + test/mongo/container.spec.ts | 5 + test/mongo/container32.spec.ts | 5 + test/sql/container.spec.ts | 6 + test/tables/container.spec.ts | 4 + 24 files changed, 241 insertions(+), 207 deletions(-) create mode 100644 src/hooks/useCarousel.ts diff --git a/sampleData/sqlSampleData.json b/sampleData/sqlSampleData.json index 46b607a50..1cde20e57 100644 --- a/sampleData/sqlSampleData.json +++ b/sampleData/sqlSampleData.json @@ -1,26 +1,25 @@ { - "databaseId": "SampleDB", - "offerThroughput": 400, - "databaseLevelThroughput": false, - "collectionId": "Persons", - "createNewDatabase": true, - "partitionKey": { "kind": "Hash", "paths": ["/firstname"], "version": 1 }, "data": [ - { - "firstname": "Eva", - "age": 44 - }, - { - "firstname": "Véronique", - "age": 50 - }, - { - "firstname": "亜妃子", - "age": 5 - }, - { - "firstname": "John", - "age": 23 - } + { "address": "2007, NE 37TH PL" }, + { "address": "11635, SE MAY CREEK PARK DR" }, + { "address": "8923, 133RD AVE SE" }, + { "address": "1124, N 33RD ST" }, + { "address": "4288, 131ST PL SE" }, + { "address": "10900, SE 66TH ST" }, + { "address": "6260, 139TH AVE NE" }, + { "address": "13427, NE SPRING BLVD" }, + { "address": "13812, NE SPRING BLVD" }, + { "address": "5029, 159TH PL SE" }, + { "address": "8604, 117TH AVE SE" }, + { "address": "1561, 139TH LN NE" }, + { "address": "1575, 139TH CT NE" }, + { "address": "13901, NE 15TH CT" }, + { "address": "16365, NE 12TH PL" }, + { "address": "12226, NE 37TH ST" }, + { "address": "4021, 129TH CT SE" }, + { "address": "1455, 159TH PL NE" }, + { "address": "15825, NE 14TH RD" }, + { "address": "1418, 157TH CT NE" }, + { "address": "889, 131ST PL NE" } ] } diff --git a/src/Contracts/ViewModels.ts b/src/Contracts/ViewModels.ts index ef775e2ce..9e89807e2 100644 --- a/src/Contracts/ViewModels.ts +++ b/src/Contracts/ViewModels.ts @@ -86,6 +86,7 @@ export interface Database extends TreeNode { offer: ko.Observable; isDatabaseExpanded: ko.Observable; isDatabaseShared: ko.Computed; + isSampleDB?: boolean; selectedSubnodeKind: ko.Observable; @@ -112,6 +113,7 @@ export interface CollectionBase extends TreeNode { selectedSubnodeKind: ko.Observable; children: ko.ObservableArray; isCollectionExpanded: ko.Observable; + isSampleCollection?: boolean; onDocumentDBDocumentsClick(): void; onNewQueryClick(source: any, event?: MouseEvent, queryText?: string): void; diff --git a/src/Explorer/Panes/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel.tsx index 6f7d51c4b..6fae58d24 100644 --- a/src/Explorer/Panes/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel.tsx @@ -113,7 +113,7 @@ export class AddCollectionPanel extends React.Component this.setState({ teachingBubbleStep: 0 })} footerContent="Step 1 of 4" > - Database is the parent of a container, create a new database / use an existing one + + + Database is the parent of a container. You can create a new database or use an existing one. In this + tutorial we are creating a new database named SampleDB. + + + Learn more about resources. + + )} @@ -187,8 +199,15 @@ export class AddCollectionPanel extends React.Component this.setState({ teachingBubbleStep: 0 })} footerContent="Step 2 of 4" > - Cosmos DB recommends sharing throughput across database. Autoscale will give you a flexible amount of - throughput based on the max RU/s set + + + Cosmos DB recommends sharing throughput across database. Autoscale will give you a flexible amount of + throughput based on the max RU/s set (Request Units). + + + Learn more about RU/s. + + )} @@ -773,18 +792,23 @@ export class AddCollectionPanel extends React.Component this.setState({ teachingBubbleStep: 0 })} - footerContent={ - - } + styles={{ footer: { width: "100%" } }} > A sample container is now being created and we are adding sample data for you. It should take about 1 minute.

    Once the sample container is created, review your sample dataset and follow next steps +
    +
    + )}
    @@ -1102,6 +1126,23 @@ export class AddCollectionPanel extends React.Component database.id().startsWith("SampleDB")); + const existingSampleDBNames = existingSampleDBs?.map((database) => database.id()); + if (!existingSampleDBNames || existingSampleDBNames.length === 0) { + return "SampleDB"; + } + + let i = 1; + while (existingSampleDBNames.indexOf(`SampleDB${i}`) !== -1) { + i++; + } + + return `SampleDB${i}`; + } + private async submit(event?: React.FormEvent): Promise { event?.preventDefault(); @@ -1198,11 +1239,14 @@ export class AddCollectionPanel extends React.Component { }; describe("SplashScreen", () => { - it("allows sample collection creation for supported api's", () => { - const explorer = createExplorer(); - const dataSampleUtil = new DataSamplesUtil(explorer); - const createStub = jest - .spyOn(dataSampleUtil, "createGeneratorAsync") - .mockImplementation(() => Promise.reject(undefined)); - - // Sample is supported - jest.spyOn(dataSampleUtil, "isSampleContainerCreationSupported").mockImplementation(() => true); - - const splashScreen = new SplashScreen({ explorer }); - jest.spyOn(splashScreen, "createDataSampleUtil").mockImplementation(() => dataSampleUtil); - const mainButtons = splashScreen.createMainItems(); - - // Press all buttons and make sure create gets called - mainButtons.forEach((button) => { - try { - button.onClick(); - } catch (e) { - // noop - } - }); - expect(createStub).toHaveBeenCalled(); - }); - it("does not allow sample collection creation for non-supported api's", () => { const explorerStub = createExplorer(); const dataSampleUtil = new DataSamplesUtil(explorerStub); diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 212ef06fc..846b4bb56 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -2,6 +2,7 @@ * Accordion top class */ import { Coachmark, DirectionalHint, Image, Link, Stack, TeachingBubbleContent, Text } from "@fluentui/react"; +import { useCarousel } from "hooks/useCarousel"; import { useTabs } from "hooks/useTabs"; import * as React from "react"; import AddDatabaseIcon from "../../../images/AddDatabase.svg"; @@ -10,9 +11,6 @@ import NewStoredProcedureIcon from "../../../images/AddStoredProcedure.svg"; import OpenQueryIcon from "../../../images/BrowseQuery.svg"; import ConnectIcon from "../../../images/Connect_color.svg"; import ContainersIcon from "../../../images/Containers.svg"; -import NewContainerIcon from "../../../images/Hero-new-container.svg"; -import NewNotebookIcon from "../../../images/Hero-new-notebook.svg"; -import SampleIcon from "../../../images/Hero-sample.svg"; import LinkIcon from "../../../images/Link_blue.svg"; import NotebookIcon from "../../../images/notebook/Notebook-resource.svg"; import NotebookColorIcon from "../../../images/Notebooks.svg"; @@ -49,11 +47,7 @@ export interface SplashScreenProps { explorer: Explorer; } -export interface SplashScreenState { - showCoachmark: boolean; -} - -export class SplashScreen extends React.Component { +export class SplashScreen extends React.Component { private static readonly seeMoreItemTitle: string = "See more Cosmos DB documentation"; private static readonly seeMoreItemUrl: string = "https://aka.ms/cosmosdbdocument"; private static readonly dataModelingUrl = "https://docs.microsoft.com/azure/cosmos-db/modeling-data"; @@ -67,10 +61,6 @@ export class SplashScreen extends React.Component state.isNotebookEnabled ), }, - { dispose: useSelectedNode.subscribe(() => this.setState({})) } + { dispose: useSelectedNode.subscribe(() => this.setState({})) }, + { + dispose: useCarousel.subscribe( + () => this.setState({}), + (state) => state.showCoachMark + ), + } ); } @@ -129,17 +125,14 @@ export class SplashScreen extends React.Component} -
    +
    {item.description}
    ))}
    - {this.state.showCoachmark && ( + {useCarousel.getState().showCoachMark && ( { - this.setState({ showCoachmark: false }); + useCarousel.getState().setShowCoachMark(false); this.container.onNewCollectionClicked({ isQuickstart: true }); }, }} - secondaryButtonProps={{ text: "Cancel", onClick: () => this.setState({ showCoachmark: false }) }} - onDismiss={() => this.setState({ showCoachmark: false })} + secondaryButtonProps={{ + text: "Cancel", + onClick: () => useCarousel.getState().setShowCoachMark(false), + }} + onDismiss={() => useCarousel.getState().setShowCoachMark(false)} > You will be guided to create a sample container with sample data, then we will give you a tour of - data explorer You can also cancel launching this tour and explore yourself + data explorer. You can also cancel launching this tour and explore yourself )}
    -
    {userContext.features.enableNewQuickstart ? "Recents" : "Common Tasks"}
    - {userContext.features.enableNewQuickstart ? this.getRecentItems() : this.getCommonTasksItems()} +
    Recents
    + {this.getRecentItems()}
    -
    - {userContext.features.enableNewQuickstart ? "Top 3 things you need to know" : "Recents"} -
    - {userContext.features.enableNewQuickstart ? this.top3Items() : this.getRecentItems()} +
    Top 3 things you need to know
    + {this.top3Items()}
    -
    - {userContext.features.enableNewQuickstart ? "Learning Resources" : "Tips"} -
    - {userContext.features.enableNewQuickstart ? this.getLearningResourceItems() : this.getTipItems()} +
    Learning Resources
    + {this.getLearningResourceItems()}
    @@ -202,73 +194,45 @@ export class SplashScreen extends React.Component - userContext.apiType === "Mongo" - ? window.open("http://aka.ms/mongodbquickstart", "_blank") - : this.container.onNewCollectionClicked({ isQuickstart: true }), - }; - heroes.push(launchQuickstartBtn); - } else if (useNotebook.getState().isPhoenixNotebooks) { - const newNotebookBtn = { - iconSrc: NotebookColorIcon, - title: "New notebook", - description: "Visualize your data stored in Azure Cosmos DB", - onClick: () => this.container.onNewNotebookClicked(), - }; - heroes.push(newNotebookBtn); - } - - const newContainerBtn = { - iconSrc: ContainersIcon, - title: `New ${getCollectionName()}`, - description: "Create a new container for storage and throughput", - onClick: () => this.container.onNewCollectionClicked(), + if (userContext.apiType === "SQL" || userContext.apiType === "Mongo") { + const launchQuickstartBtn = { + id: "quickstartDescription", + iconSrc: QuickStartIcon, + title: "Launch quick start", + description: "Launch a quick start tutorial to get started with sample data", + showLinkIcon: userContext.apiType === "Mongo", + onClick: () => + userContext.apiType === "Mongo" + ? window.open("http://aka.ms/mongodbquickstart", "_blank") + : this.container.onNewCollectionClicked({ isQuickstart: true }), }; - heroes.push(newContainerBtn); - - const connectBtn = { - iconSrc: ConnectIcon, - title: "Connect", - description: "Prefer using your own choice of tooling? Find the connection string you need to connect", - onClick: () => useTabs.getState().openAndActivateConnectTab(), + heroes.push(launchQuickstartBtn); + } else if (useNotebook.getState().isPhoenixNotebooks) { + const newNotebookBtn = { + iconSrc: NotebookColorIcon, + title: "New notebook", + description: "Visualize your data stored in Azure Cosmos DB", + onClick: () => this.container.onNewNotebookClicked(), }; - heroes.push(connectBtn); - } else { - const dataSampleUtil = this.createDataSampleUtil(); - if (dataSampleUtil.isSampleContainerCreationSupported()) { - heroes.push({ - iconSrc: SampleIcon, - title: "Start with Sample", - description: "Get started with a sample provided by Cosmos DB", - onClick: () => dataSampleUtil.createSampleContainerAsync(), - }); - } - - heroes.push({ - iconSrc: NewContainerIcon, - title: `New ${getCollectionName()}`, - description: "Create a new container for storage and throughput", - onClick: () => this.container.onNewCollectionClicked(), - }); - - if (useNotebook.getState().isPhoenixNotebooks) { - heroes.push({ - iconSrc: NewNotebookIcon, - title: "New Notebook", - description: "Create a notebook to start querying, visualizing, and modeling your data", - onClick: () => this.container.onNewNotebookClicked(), - }); - } + heroes.push(newNotebookBtn); } + const newContainerBtn = { + iconSrc: ContainersIcon, + title: `New ${getCollectionName()}`, + description: "Create a new container for storage and throughput", + onClick: () => this.container.onNewCollectionClicked(), + }; + heroes.push(newContainerBtn); + + const connectBtn = { + iconSrc: ConnectIcon, + title: "Connect", + description: "Prefer using your own choice of tooling? Find the connection string you need to connect", + onClick: () => useTabs.getState().openAndActivateConnectTab(), + }; + heroes.push(connectBtn); + return heroes; } diff --git a/src/Explorer/Tabs/ConnectTab.tsx b/src/Explorer/Tabs/ConnectTab.tsx index d1edef963..63304151b 100644 --- a/src/Explorer/Tabs/ConnectTab.tsx +++ b/src/Explorer/Tabs/ConnectTab.tsx @@ -1,14 +1,4 @@ -import { - IconButton, - ITextFieldStyles, - Link, - Pivot, - PivotItem, - PrimaryButton, - Stack, - Text, - TextField, -} from "@fluentui/react"; +import { IconButton, ITextFieldStyles, Pivot, PivotItem, PrimaryButton, Stack, Text, TextField } from "@fluentui/react"; import { handleError } from "Common/ErrorHandlingUtils"; import { sendMessage } from "Common/MessageHandler"; import { MessageTypes } from "Contracts/ExplorerContracts"; @@ -76,16 +66,6 @@ export const ConnectTab: React.FC = (): JSX.Element => { return (
    - - - Ensure you have the right networking / access configuration before you establish the connection with your app - or 3rd party tool. - - - Configure networking in Azure portal - - - {userContext.hasWriteAccess && ( diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index 161c3e200..9d980a44b 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -121,11 +121,7 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { }; useEffect((): (() => void) | void => { - if ( - tab.tabKind === CollectionTabKind.Documents && - tab.collection?.databaseId === "SampleDB" && - tab.collection?.id() === "SampleContainer" - ) { + if (tab.tabKind === CollectionTabKind.Documents && tab.collection?.isSampleCollection) { useTeachingBubble.getState().setIsDocumentsTabOpened(true); } diff --git a/src/Explorer/Tree/Collection.ts b/src/Explorer/Tree/Collection.ts index c5995b8df..f2fff2a99 100644 --- a/src/Explorer/Tree/Collection.ts +++ b/src/Explorer/Tree/Collection.ts @@ -97,6 +97,7 @@ export default class Collection implements ViewModels.Collection { public storedProceduresFocused: ko.Observable; public userDefinedFunctionsFocused: ko.Observable; public triggersFocused: ko.Observable; + public isSampleCollection: boolean; private isOfferRead: boolean; constructor(container: Explorer, databaseId: string, data: DataModels.Collection) { @@ -216,6 +217,7 @@ export default class Collection implements ViewModels.Collection { this.isStoredProceduresExpanded = ko.observable(false); this.isUserDefinedFunctionsExpanded = ko.observable(false); this.isTriggersExpanded = ko.observable(false); + this.isSampleCollection = false; this.isOfferRead = false; } diff --git a/src/Explorer/Tree/Database.tsx b/src/Explorer/Tree/Database.tsx index 156b5f275..a31b79b97 100644 --- a/src/Explorer/Tree/Database.tsx +++ b/src/Explorer/Tree/Database.tsx @@ -37,6 +37,7 @@ export default class Database implements ViewModels.Database { public isDatabaseShared: ko.Computed; public selectedSubnodeKind: ko.Observable; public junoClient: JunoClient; + public isSampleDB: boolean; private isOfferRead: boolean; constructor(container: Explorer, data: DataModels.Database) { @@ -54,6 +55,7 @@ export default class Database implements ViewModels.Database { return this.offer && !!this.offer(); }); this.junoClient = new JunoClient(); + this.isSampleDB = false; this.isOfferRead = false; } diff --git a/src/Explorer/Tree/ResourceTree.tsx b/src/Explorer/Tree/ResourceTree.tsx index 4a4ab526c..87432ce8b 100644 --- a/src/Explorer/Tree/ResourceTree.tsx +++ b/src/Explorer/Tree/ResourceTree.tsx @@ -1,5 +1,4 @@ import { Callout, DirectionalHint, ICalloutProps, ILinkProps, Link, Stack, Text } from "@fluentui/react"; -import { useTeachingBubble } from "hooks/useTeachingBubble"; import * as React from "react"; import shallow from "zustand/shallow"; import CosmosDBIcon from "../../../images/Azure-Cosmos-DB.svg"; @@ -462,7 +461,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc if (database.isDatabaseShared()) { databaseNode.children.push({ - id: database.id() === "SampleDB" ? "sampleScaleSettings" : "", + id: database.isSampleDB ? "sampleScaleSettings" : "", label: "Scale", isSelected: () => useSelectedNode @@ -499,7 +498,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc const children: TreeNode[] = []; children.push({ label: collection.getLabel(), - id: collection.databaseId === "SampleDB" && collection.id() === "SampleContainer" ? "sampleItems" : "", + id: collection.isSampleCollection ? "sampleItems" : "", onClick: () => { collection.openTab(); // push to most recent @@ -533,10 +532,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc if (userContext.apiType !== "Cassandra" || !isServerlessAccount()) { children.push({ - id: - collection.databaseId === "SampleDB" && collection.id() === "SampleContainer" && !database.isDatabaseShared() - ? "sampleScaleSettings" - : "", + id: collection.isSampleCollection && !database.isDatabaseShared() ? "sampleScaleSettings" : "", label: database.isDatabaseShared() || isServerlessAccount() ? "Settings" : "Scale & Settings", onClick: collection.onSettingsClick.bind(collection), isSelected: () => @@ -593,10 +589,6 @@ export const ResourceTree: React.FC = ({ container }: Resourc ); }, onExpanded: () => { - // TODO: For testing purpose only, remove after - if (collection.databaseId === "SampleDB" && collection.id() === "SampleContainer") { - useTeachingBubble.getState().setIsSampleDBExpanded(true); - } if (showScriptNodes) { collection.loadStoredProcedures(); collection.loadUserDefinedFunctions(); diff --git a/src/Explorer/Tutorials/QuickstartCarousel.tsx b/src/Explorer/Tutorials/QuickstartCarousel.tsx index 6077d221f..976f192ba 100644 --- a/src/Explorer/Tutorials/QuickstartCarousel.tsx +++ b/src/Explorer/Tutorials/QuickstartCarousel.tsx @@ -1,6 +1,8 @@ import { DefaultButton, IconButton, Image, Modal, PrimaryButton, Stack, Text } from "@fluentui/react"; +import { useCarousel } from "hooks/useCarousel"; import React, { useState } from "react"; import Youtube from "react-youtube"; +import { userContext } from "UserContext"; import Image1 from "../../../images/CarouselImage1.svg"; import Image2 from "../../../images/CarouselImage2.svg"; @@ -13,7 +15,11 @@ export const QuickstartCarousel: React.FC = ({ }: QuickstartCarouselProps): JSX.Element => { const [page, setPage] = useState(1); return ( - + userContext.apiType === "SQL" && useCarousel.getState().setShowCoachMark(true)} + > {getHeaderText(page)} @@ -28,9 +34,23 @@ export const QuickstartCarousel: React.FC = ({ setPage(page - 1)} /> )} setPage(page + 1)} + onClick={() => { + if ( + userContext.apiType === "Cassandra" || + userContext.apiType === "Tables" || + userContext.apiType === "Gremlin" + ) { + setPage(page + 2); + } else { + if (page === 3 && userContext.apiType === "SQL") { + useCarousel.getState().setShowCoachMark(true); + } + setPage(page + 1); + } + }} /> diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx index 393c963e5..ad456e9a7 100644 --- a/src/Explorer/Tutorials/QuickstartTutorial.tsx +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -1,11 +1,10 @@ -import { TeachingBubble } from "@fluentui/react"; -import { useDatabases } from "Explorer/useDatabases"; +import { Link, Stack, TeachingBubble, Text } from "@fluentui/react"; import { useTabs } from "hooks/useTabs"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; export const QuickstartTutorial: React.FC = (): JSX.Element => { - const { step, isSampleDBExpanded, isDocumentsTabOpened, setStep } = useTeachingBubble(); + const { step, isSampleDBExpanded, isDocumentsTabOpened, sampleCollection, setStep } = useTeachingBubble(); switch (step) { case 1: @@ -17,8 +16,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { primaryButtonProps={{ text: "Open Items", onClick: () => { - const sampleContainer = useDatabases.getState().findCollection("SampleDB", "SampleContainer"); - sampleContainer.openTab(); + sampleCollection.openTab(); setStep(2); }, }} @@ -70,7 +68,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { onDismiss={() => setStep(0)} footerContent="Step 3 of 7" > - Add new item by copy / pasting jsons; or uploading a json + Add new item by copy / pasting JSON; or uploading a JSON ); case 4: @@ -120,7 +118,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { target={"#newNotebookBtn"} hasCloseButton primaryButtonProps={{ - text: "Finish", + text: "Next", onClick: () => setStep(7), }} secondaryButtonProps={{ @@ -150,8 +148,15 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { onDismiss={() => setStep(0)} footerContent="Step 7 of 7" > - You have finished the tour in data explorer. For next steps, you may want to launch connect and start - connecting with your current app + + + You have finished the tour in data explorer. For next steps, you may want to launch connect and start + connecting with your current app. + + + Share your feedback + + ); default: diff --git a/src/Main.tsx b/src/Main.tsx index 096ce7dc0..b68254204 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -3,9 +3,9 @@ import { initializeIcons } from "@fluentui/react"; import "bootstrap/dist/css/bootstrap.css"; import { QuickstartCarousel } from "Explorer/Tutorials/QuickstartCarousel"; import { QuickstartTutorial } from "Explorer/Tutorials/QuickstartTutorial"; +import { useCarousel } from "hooks/useCarousel"; import React, { useState } from "react"; import ReactDOM from "react-dom"; -import { userContext } from "UserContext"; import "../externals/jquery-ui.min.css"; import "../externals/jquery-ui.min.js"; import "../externals/jquery-ui.structure.min.css"; @@ -61,6 +61,7 @@ const App: React.FunctionComponent = () => { const [isLeftPaneExpanded, setIsLeftPaneExpanded] = useState(true); const openedTabs = useTabs((state) => state.openedTabs); const isConnectTabOpen = useTabs((state) => state.isConnectTabOpen); + const isCarouselOpen = useCarousel((state) => state.shouldOpen); const config = useConfig(); const explorer = useKnockoutExplorer(config?.platform); @@ -119,8 +120,8 @@ const App: React.FunctionComponent = () => {
    - {userContext.features.enableNewQuickstart && } - {userContext.features.enableNewQuickstart && } + {} + {}
    ); }; diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 8d6a763cc..368f09eb2 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -29,7 +29,6 @@ export type Features = { readonly mongoProxyEndpoint?: string; readonly mongoProxyAPIs?: string; readonly enableThroughputCap: boolean; - readonly enableNewQuickstart: boolean; // can be set via both flight and feature flag autoscaleDefault: boolean; @@ -91,7 +90,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear partitionKeyDefault2: "true" === get("pkpartitionkeytest"), notebooksDownBanner: "true" === get("notebooksDownBanner"), enableThroughputCap: "true" === get("enablethroughputcap"), - enableNewQuickstart: "true" === get("enablenewquickstart"), }; } diff --git a/src/Shared/StorageUtility.ts b/src/Shared/StorageUtility.ts index 9c16467d2..0d8477016 100644 --- a/src/Shared/StorageUtility.ts +++ b/src/Shared/StorageUtility.ts @@ -14,4 +14,5 @@ export enum StorageKey { MostRecentActivity, SetPartitionKeyUndefined, GalleryCalloutDismissed, + VisitedAccounts, } diff --git a/src/UserContext.ts b/src/UserContext.ts index 96bfc2ecf..27f02cc8a 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -1,3 +1,4 @@ +import { useCarousel } from "hooks/useCarousel"; import { AuthType } from "./AuthType"; import { DatabaseAccount } from "./Contracts/DataModels"; import { SubscriptionType } from "./Contracts/SubscriptionType"; @@ -73,6 +74,10 @@ const userContext: UserContext = { function updateUserContext(newContext: Partial): void { if (newContext.databaseAccount) { newContext.apiType = apiType(newContext.databaseAccount); + if (!localStorage.getItem(newContext.databaseAccount.id)) { + useCarousel.getState().setShouldOpen(true); + localStorage.setItem(newContext.databaseAccount.id, "true"); + } } Object.assign(userContext, newContext); } diff --git a/src/hooks/useCarousel.ts b/src/hooks/useCarousel.ts new file mode 100644 index 000000000..533dab397 --- /dev/null +++ b/src/hooks/useCarousel.ts @@ -0,0 +1,15 @@ +import create, { UseStore } from "zustand"; + +interface CarouselState { + shouldOpen: boolean; + showCoachMark: boolean; + setShouldOpen: (shouldOpen: boolean) => void; + setShowCoachMark: (showCoachMark: boolean) => void; +} + +export const useCarousel: UseStore = create((set) => ({ + shouldOpen: false, + showCoachMark: false, + setShouldOpen: (shouldOpen: boolean) => set({ shouldOpen }), + setShowCoachMark: (showCoachMark: boolean) => set({ showCoachMark }), +})); diff --git a/src/hooks/useTeachingBubble.ts b/src/hooks/useTeachingBubble.ts index 003d105e2..e615fc9fe 100644 --- a/src/hooks/useTeachingBubble.ts +++ b/src/hooks/useTeachingBubble.ts @@ -1,19 +1,24 @@ +import { Collection } from "Contracts/ViewModels"; import create, { UseStore } from "zustand"; interface TeachingBubbleState { step: number; isSampleDBExpanded: boolean; isDocumentsTabOpened: boolean; + sampleCollection: Collection; setStep: (step: number) => void; setIsSampleDBExpanded: (isReady: boolean) => void; setIsDocumentsTabOpened: (isOpened: boolean) => void; + setSampleCollection: (sampleCollection: Collection) => void; } export const useTeachingBubble: UseStore = create((set) => ({ step: 1, isSampleDBExpanded: false, isDocumentsTabOpened: false, + sampleCollection: undefined, setStep: (step: number) => set({ step }), setIsSampleDBExpanded: (isSampleDBExpanded: boolean) => set({ isSampleDBExpanded }), setIsDocumentsTabOpened: (isDocumentsTabOpened: boolean) => set({ isDocumentsTabOpened }), + setSampleCollection: (sampleCollection: Collection) => set({ sampleCollection }), })); diff --git a/test/cassandra/container.spec.ts b/test/cassandra/container.spec.ts index af68a47dc..6b4bda8e6 100644 --- a/test/cassandra/container.spec.ts +++ b/test/cassandra/container.spec.ts @@ -13,6 +13,10 @@ test("Cassandra keyspace and table CRUD", async () => { await page.waitForSelector("iframe"); const explorer = await waitForExplorer(); + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await explorer.click('[data-test="New Table"]'); await explorer.click('[aria-label="Keyspace id"]'); await explorer.fill('[aria-label="Keyspace id"]', keyspaceId); diff --git a/test/graph/container.spec.ts b/test/graph/container.spec.ts index 0b2bf5090..97b07ee9e 100644 --- a/test/graph/container.spec.ts +++ b/test/graph/container.spec.ts @@ -12,6 +12,10 @@ test("Graph CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-gremlin-runner"); const explorer = await waitForExplorer(); + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + // Create new database and graph await explorer.click('[data-test="New Graph"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/mongo/container.spec.ts b/test/mongo/container.spec.ts index ca977ea93..91f1c254a 100644 --- a/test/mongo/container.spec.ts +++ b/test/mongo/container.spec.ts @@ -12,6 +12,11 @@ test("Mongo CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-mongo-runner"); const explorer = await waitForExplorer(); + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + // Create new database and collection await explorer.click('[data-test="New Collection"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/mongo/container32.spec.ts b/test/mongo/container32.spec.ts index 5b3845a14..8b7a830e4 100644 --- a/test/mongo/container32.spec.ts +++ b/test/mongo/container32.spec.ts @@ -12,6 +12,11 @@ test("Mongo CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-mongo32-runner"); const explorer = await waitForExplorer(); + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + // Create new database and collection await explorer.click('[data-test="New Collection"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/sql/container.spec.ts b/test/sql/container.spec.ts index 82fda76aa..5e53696bd 100644 --- a/test/sql/container.spec.ts +++ b/test/sql/container.spec.ts @@ -11,6 +11,12 @@ test("SQL CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-sql-runner-west-us"); const explorer = await waitForExplorer(); + + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await explorer.click('[data-test="New Container"]'); await explorer.fill('[aria-label="New database id"]', databaseId); await explorer.fill('[aria-label="Container id"]', containerId); diff --git a/test/tables/container.spec.ts b/test/tables/container.spec.ts index 5dbfc9cfa..6243d0cb0 100644 --- a/test/tables/container.spec.ts +++ b/test/tables/container.spec.ts @@ -12,6 +12,10 @@ test("Tables CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-tables-runner"); const explorer = await waitForExplorer(); + // Click through quick start carousel + await explorer.click("#carouselNextBtn"); + await explorer.click("#carouselNextBtn"); + await page.waitForSelector('text="Querying databases"', { state: "detached" }); await explorer.click('[data-test="New Table"]'); await explorer.fill('[aria-label="Table id"]', tableId); From 7e1343e84ffdd575958b93514b4ead8f0f93d82c Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:25:56 -0700 Subject: [PATCH 09/22] Add check of account creation time to show carousel (#1284) Co-authored-by: artrejo --- src/Contracts/DataModels.ts | 5 ++++ src/Explorer/Tutorials/QuickstartCarousel.tsx | 1 - src/UserContext.ts | 24 ++++++++++++++++++- src/hooks/useKnockoutExplorer.ts | 1 + test/cassandra/container.spec.ts | 4 ---- test/graph/container.spec.ts | 4 ---- test/mongo/container.spec.ts | 5 ---- test/mongo/container32.spec.ts | 5 ---- test/sql/container.spec.ts | 5 ---- test/tables/container.spec.ts | 4 ---- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index a367656e4..eab6a91a3 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -7,6 +7,11 @@ export interface DatabaseAccount { type: string; kind: string; properties: DatabaseAccountExtendedProperties; + systemData?: DatabaseAccountSystemData; +} + +export interface DatabaseAccountSystemData { + createdAt: string; } export interface DatabaseAccountExtendedProperties { diff --git a/src/Explorer/Tutorials/QuickstartCarousel.tsx b/src/Explorer/Tutorials/QuickstartCarousel.tsx index 976f192ba..1d05961eb 100644 --- a/src/Explorer/Tutorials/QuickstartCarousel.tsx +++ b/src/Explorer/Tutorials/QuickstartCarousel.tsx @@ -34,7 +34,6 @@ export const QuickstartCarousel: React.FC = ({ setPage(page - 1)} /> )} { diff --git a/src/UserContext.ts b/src/UserContext.ts index 27f02cc8a..7e3390eb4 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -56,6 +56,8 @@ interface UserContext { export type ApiType = "SQL" | "Mongo" | "Gremlin" | "Tables" | "Cassandra"; export type PortalEnv = "localhost" | "blackforest" | "fairfax" | "mooncake" | "prod" | "dev"; +const ONE_WEEK_IN_MS = 604800000; + const features = extractFeatures(); const { enableSDKoperations: useSDKOperations } = features; @@ -71,10 +73,30 @@ const userContext: UserContext = { collectionCreationDefaults: CollectionCreationDefaults, }; +function isAccountNewerThanThresholdInMs(createdAt: string, threshold: number) { + let createdAtMs: number = Date.parse(createdAt); + if (isNaN(createdAtMs)) { + createdAtMs = 0; + } + + const nowMs: number = Date.now(); + const millisecsSinceAccountCreation = nowMs - createdAtMs; + return threshold > millisecsSinceAccountCreation; +} + function updateUserContext(newContext: Partial): void { if (newContext.databaseAccount) { newContext.apiType = apiType(newContext.databaseAccount); - if (!localStorage.getItem(newContext.databaseAccount.id)) { + + const isNewAccount = isAccountNewerThanThresholdInMs( + newContext.databaseAccount?.systemData?.createdAt || "", + ONE_WEEK_IN_MS + ); + + if ( + !localStorage.getItem(newContext.databaseAccount.id) && + (userContext.isTryCosmosDBSubscription || isNewAccount) + ) { useCarousel.getState().setShouldOpen(true); localStorage.setItem(newContext.databaseAccount.id, "true"); } diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 7a0330ff3..09b1654ca 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -352,6 +352,7 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) { hasWriteAccess: inputs.hasWriteAccess ?? true, addCollectionFlight: inputs.addCollectionDefaultFlight || CollectionCreation.DefaultAddCollectionDefaultFlight, collectionCreationDefaults: inputs.defaultCollectionThroughput, + isTryCosmosDBSubscription: inputs.isTryCosmosDBSubscription, }); if (inputs.features) { Object.assign(userContext.features, extractFeatures(new URLSearchParams(inputs.features))); diff --git a/test/cassandra/container.spec.ts b/test/cassandra/container.spec.ts index 6b4bda8e6..af68a47dc 100644 --- a/test/cassandra/container.spec.ts +++ b/test/cassandra/container.spec.ts @@ -13,10 +13,6 @@ test("Cassandra keyspace and table CRUD", async () => { await page.waitForSelector("iframe"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await explorer.click('[data-test="New Table"]'); await explorer.click('[aria-label="Keyspace id"]'); await explorer.fill('[aria-label="Keyspace id"]', keyspaceId); diff --git a/test/graph/container.spec.ts b/test/graph/container.spec.ts index 97b07ee9e..0b2bf5090 100644 --- a/test/graph/container.spec.ts +++ b/test/graph/container.spec.ts @@ -12,10 +12,6 @@ test("Graph CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-gremlin-runner"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - // Create new database and graph await explorer.click('[data-test="New Graph"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/mongo/container.spec.ts b/test/mongo/container.spec.ts index 91f1c254a..ca977ea93 100644 --- a/test/mongo/container.spec.ts +++ b/test/mongo/container.spec.ts @@ -12,11 +12,6 @@ test("Mongo CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-mongo-runner"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - // Create new database and collection await explorer.click('[data-test="New Collection"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/mongo/container32.spec.ts b/test/mongo/container32.spec.ts index 8b7a830e4..5b3845a14 100644 --- a/test/mongo/container32.spec.ts +++ b/test/mongo/container32.spec.ts @@ -12,11 +12,6 @@ test("Mongo CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-mongo32-runner"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - // Create new database and collection await explorer.click('[data-test="New Collection"]'); await explorer.fill('[aria-label="New database id"]', databaseId); diff --git a/test/sql/container.spec.ts b/test/sql/container.spec.ts index 5e53696bd..066344740 100644 --- a/test/sql/container.spec.ts +++ b/test/sql/container.spec.ts @@ -12,11 +12,6 @@ test("SQL CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-sql-runner-west-us"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await explorer.click('[data-test="New Container"]'); await explorer.fill('[aria-label="New database id"]', databaseId); await explorer.fill('[aria-label="Container id"]', containerId); diff --git a/test/tables/container.spec.ts b/test/tables/container.spec.ts index 6243d0cb0..5dbfc9cfa 100644 --- a/test/tables/container.spec.ts +++ b/test/tables/container.spec.ts @@ -12,10 +12,6 @@ test("Tables CRUD", async () => { await page.goto("https://localhost:1234/testExplorer.html?accountName=portal-tables-runner"); const explorer = await waitForExplorer(); - // Click through quick start carousel - await explorer.click("#carouselNextBtn"); - await explorer.click("#carouselNextBtn"); - await page.waitForSelector('text="Querying databases"', { state: "detached" }); await explorer.click('[data-test="New Table"]'); await explorer.fill('[aria-label="Table id"]', tableId); From 7ab57c9ec45dad66c8e7ca4d6ccd878c3dda6343 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:26:10 -0700 Subject: [PATCH 10/22] Add telemetry for new quick start (#1285) --- src/Explorer/Panes/AddCollectionPanel.tsx | 2 + src/Explorer/SplashScreen/SplashScreen.tsx | 81 ++++++------------- src/Explorer/Tutorials/QuickstartCarousel.tsx | 8 +- src/Explorer/Tutorials/QuickstartTutorial.tsx | 21 +++-- src/Shared/Telemetry/TelemetryConstants.ts | 9 +++ src/UserContext.ts | 3 + 6 files changed, 59 insertions(+), 65 deletions(-) diff --git a/src/Explorer/Panes/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel.tsx index 6fae58d24..d2dfa80ba 100644 --- a/src/Explorer/Panes/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel.tsx @@ -1193,6 +1193,7 @@ export class AddCollectionPanel extends React.Component { title: "Launch quick start", description: "Launch a quick start tutorial to get started with sample data", showLinkIcon: userContext.apiType === "Mongo", - onClick: () => + onClick: () => { userContext.apiType === "Mongo" ? window.open("http://aka.ms/mongodbquickstart", "_blank") - : this.container.onNewCollectionClicked({ isQuickstart: true }), + : this.container.onNewCollectionClicked({ isQuickstart: true }); + traceOpen(Action.LaunchQuickstart, { apiType: userContext.apiType }); + }, }; heroes.push(launchQuickstartBtn); } else if (useNotebook.getState().isPhoenixNotebooks) { @@ -221,7 +225,10 @@ export class SplashScreen extends React.Component { iconSrc: ContainersIcon, title: `New ${getCollectionName()}`, description: "Create a new container for storage and throughput", - onClick: () => this.container.onNewCollectionClicked(), + onClick: () => { + this.container.onNewCollectionClicked(); + traceOpen(Action.NewContainerHomepage, { apiType: userContext.apiType }); + }, }; heroes.push(newContainerBtn); @@ -397,29 +404,6 @@ export class SplashScreen extends React.Component { } } - private getCommonTasksItems(): JSX.Element { - const commonTaskItems = this.createCommonTaskItems(); - return ( -
      - {commonTaskItems.map((item) => ( -
    • this.onSplashScreenItemKeyPress(event, item.onClick)} - tabIndex={0} - role="button" - > - - - {item.title} - -
    • - ))} -
    - ); - } - private top3Items(): JSX.Element { let items: { link: string; title: string; description: string }[]; switch (userContext.apiType) { @@ -524,7 +508,12 @@ export class SplashScreen extends React.Component { {items.map((item, i) => ( - + traceOpen(Action.Top3ItemsClicked, { item: i + 1, apiType: userContext.apiType })} + href={item.link} + target="_blank" + style={{ marginRight: 5 }} + > {item.title} @@ -665,7 +654,14 @@ export class SplashScreen extends React.Component { {items.map((item, i) => ( - + + traceOpen(Action.LearningResourcesClicked, { item: i + 1, apiType: userContext.apiType }) + } + href={item.link} + target="_blank" + style={{ marginRight: 5 }} + > {item.title} @@ -676,33 +672,4 @@ export class SplashScreen extends React.Component { ); } - - private getTipItems(): JSX.Element { - const tipsItems = this.createTipsItems(); - - return ( -
    - ); - } } diff --git a/src/Explorer/Tutorials/QuickstartCarousel.tsx b/src/Explorer/Tutorials/QuickstartCarousel.tsx index 1d05961eb..a2516fc5b 100644 --- a/src/Explorer/Tutorials/QuickstartCarousel.tsx +++ b/src/Explorer/Tutorials/QuickstartCarousel.tsx @@ -2,6 +2,8 @@ import { DefaultButton, IconButton, Image, Modal, PrimaryButton, Stack, Text } f import { useCarousel } from "hooks/useCarousel"; import React, { useState } from "react"; import Youtube from "react-youtube"; +import { Action } from "Shared/Telemetry/TelemetryConstants"; +import { traceSuccess } from "Shared/Telemetry/TelemetryProcessor"; import { userContext } from "UserContext"; import Image1 from "../../../images/CarouselImage1.svg"; import Image2 from "../../../images/CarouselImage2.svg"; @@ -49,6 +51,10 @@ export const QuickstartCarousel: React.FC = ({ } setPage(page + 1); } + + if (page === 3) { + traceSuccess(Action.CompleteCarousel); + } }} /> @@ -73,7 +79,7 @@ const getHeaderText = (page: number): string => { const getContent = (page: number): JSX.Element => { switch (page) { case 1: - return ; + return traceSuccess(Action.PlayCarouselVideo)} />; case 2: return ; case 3: diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx index ad456e9a7..5fcb44026 100644 --- a/src/Explorer/Tutorials/QuickstartTutorial.tsx +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -2,10 +2,17 @@ import { Link, Stack, TeachingBubble, Text } from "@fluentui/react"; import { useTabs } from "hooks/useTabs"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; +import { Action } from "Shared/Telemetry/TelemetryConstants"; +import { traceCancel } from "Shared/Telemetry/TelemetryProcessor"; export const QuickstartTutorial: React.FC = (): JSX.Element => { const { step, isSampleDBExpanded, isDocumentsTabOpened, sampleCollection, setStep } = useTeachingBubble(); + const onDimissTeachingBubble = (): void => { + setStep(0); + traceCancel(Action.CancelUITour, { step }); + }; + switch (step) { case 1: return isSampleDBExpanded ? ( @@ -20,7 +27,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { setStep(2); }, }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 1 of 7" > Start viewing and working with your data by opening Items under Data @@ -42,7 +49,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(1), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 2 of 7" > View item here using the items window. Additionally you can also filter items to be reviewed with the filter @@ -65,7 +72,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(2), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 3 of 7" > Add new item by copy / pasting JSON; or uploading a JSON @@ -85,7 +92,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(3), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 4 of 7" > Query your data using either the filter function or new query. @@ -105,7 +112,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(4), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 5 of 7" > Change throughput provisioned to your container according to your needs @@ -125,7 +132,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(5), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 6 of 7" > Visualize your data, store queries in an interactive document @@ -145,7 +152,7 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { text: "Previous", onClick: () => setStep(6), }} - onDismiss={() => setStep(0)} + onDismiss={() => onDimissTeachingBubble()} footerContent="Step 7 of 7" > diff --git a/src/Shared/Telemetry/TelemetryConstants.ts b/src/Shared/Telemetry/TelemetryConstants.ts index 2f43adb03..dd040ebb4 100644 --- a/src/Shared/Telemetry/TelemetryConstants.ts +++ b/src/Shared/Telemetry/TelemetryConstants.ts @@ -121,6 +121,15 @@ export enum Action { ExpandAddCollectionPaneAdvancedSection, SchemaAnalyzerClickAnalyze, SelfServeComponent, + LaunchQuickstart, + NewContainerHomepage, + Top3ItemsClicked, + LearningResourcesClicked, + PlayCarouselVideo, + OpenCarousel, + CompleteCarousel, + LaunchUITour, + CancelUITour, } export const ActionModifiers = { diff --git a/src/UserContext.ts b/src/UserContext.ts index 7e3390eb4..74f14d6a9 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -1,4 +1,6 @@ import { useCarousel } from "hooks/useCarousel"; +import { Action } from "Shared/Telemetry/TelemetryConstants"; +import { traceOpen } from "Shared/Telemetry/TelemetryProcessor"; import { AuthType } from "./AuthType"; import { DatabaseAccount } from "./Contracts/DataModels"; import { SubscriptionType } from "./Contracts/SubscriptionType"; @@ -99,6 +101,7 @@ function updateUserContext(newContext: Partial): void { ) { useCarousel.getState().setShouldOpen(true); localStorage.setItem(newContext.databaseAccount.id, "true"); + traceOpen(Action.OpenCarousel); } } Object.assign(userContext, newContext); From e34f68b162e8095518fc9c022796d60525a91b6b Mon Sep 17 00:00:00 2001 From: chandrasekhar gunturi <42460664+chandugunturi@users.noreply.github.com> Date: Fri, 3 Jun 2022 12:51:54 +0530 Subject: [PATCH 11/22] adding Materializedviews under selfserve (#1247) * adding Materializedviews under selfserve * ran npm format & fixed few links * modified required key & changed URLs * modifying links to aka.ms * modifying few descriptions * Delete VSWorkspaceState.json * Delete .suo * modifying URLs & adding missing keys Co-authored-by: Chandra sekhar Gunturi --- .../en/MaterializedViewsBuilder.json | 48 ++ .../MaterializedViewsBuilder.rp.ts | 228 ++++++++++ .../MaterializedViewsBuilder.tsx | 416 ++++++++++++++++++ .../MaterializedViewsBuilderTypes.ts | 57 +++ src/SelfServe/SelfServe.tsx | 8 + src/SelfServe/SelfServeUtils.tsx | 1 + 6 files changed, 758 insertions(+) create mode 100644 src/Localization/en/MaterializedViewsBuilder.json create mode 100644 src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.rp.ts create mode 100644 src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.tsx create mode 100644 src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilderTypes.ts diff --git a/src/Localization/en/MaterializedViewsBuilder.json b/src/Localization/en/MaterializedViewsBuilder.json new file mode 100644 index 000000000..7c3aaa032 --- /dev/null +++ b/src/Localization/en/MaterializedViewsBuilder.json @@ -0,0 +1,48 @@ +{ + "MaterializedViewsBuilderDescription": "Provision a Materializedviews builder cluster for your Azure Cosmos DB account. Materializedviews builder is compute in your account that performs read operations on source collection for any updates and applies them on materialized views as per the materializedview definition.", + "MaterializedViewsBuilder": "Materializedviews Builder", + "Provisioned": "Provisioned", + "Deprovisioned": "Deprovisioned", + "LearnAboutMaterializedViews": "Learn more about materializedviews.", + "DeprovisioningDetailsText": "Learn more about materializedviews.", + "MaterializedviewsBuilderPricing": "Learn more about materializedviews pricing.", + "SKUs": "SKUs", + "SKUsPlaceHolder": "Select SKUs", + "NumberOfInstances": "Number of instances", + "CosmosD2s": "Cosmos.D2s (General Purpose Cosmos Compute with 2 vCPUs, 8 GB Memory)", + "CosmosD4s": "Cosmos.D4s (General Purpose Cosmos Compute with 4 vCPUs, 16 GB Memory)", + "CosmosD8s": "Cosmos.D8s (General Purpose Cosmos Compute with 8 vCPUs, 32 GB Memory)", + "CosmosD16s": "Cosmos.D16s (General Purpose Cosmos Compute with 16 vCPUs, 64 GB Memory)", + "CosmosD32s": "Cosmos.D32s (General Purpose Cosmos Compute with 32 vCPUs, 128 GB Memory)", + "CreateMessage": "MaterializedViewsBuilder resource is being created.", + "CreateInitializeTitle": "Provisioning resource", + "CreateInitializeMessage": "Materializedviews Builder resource will be provisioned.", + "CreateSuccessTitle": "Resource provisioned", + "CreateSuccesseMessage": "Materializedviews Builder resource provisioned.", + "CreateFailureTitle": "Failed to provision resource", + "CreateFailureMessage": "Materializedviews Builder resource provisioning failed.", + "UpdateMessage": "MaterializedViewsBuilder resource is being updated.", + "UpdateInitializeTitle": "Updating resource", + "UpdateInitializeMessage": "Materializedviews Builder resource will be updated.", + "UpdateSuccessTitle": "Resource updated", + "UpdateSuccesseMessage": "Materializedviews Builder resource updated.", + "UpdateFailureTitle": "Failed to update resource", + "UpdateFailureMessage": "Materializedviews Builder resource updation failed.", + "DeleteMessage": "MaterializedViewsBuilder resource is being deleted.", + "DeleteInitializeTitle": "Deleting resource", + "DeleteInitializeMessage": "Materializedviews Builder resource will be deleted.", + "DeleteSuccessTitle": "Resource deleted", + "DeleteSuccesseMessage": "Materializedviews Builder resource deleted.", + "DeleteFailureTitle": "Failed to delete resource", + "DeleteFailureMessage": "Materializedviews Builder resource deletion failed.", + "ApproximateCost": "Approximate Cost Per Hour", + "CostText": "Hourly cost of the Materializedviews Builder resource depends on the SKU selection, number of instances per region, and number of regions.", + "MetricsString": "Metrics", + "MetricsText": "Monitor the CPU and memory usage for the Materializedviews Builder instances in ", + "MetricsBlade": "the metrics blade.", + "MonitorUsage": "Monitor Usage", + "ResizingDecisionText": "To understand if the Materializedviews Builder is the right size, ", + "ResizingDecisionLink": "learn more about Materializedviews Builder sizing.", + "WarningBannerOnUpdate": "Adding or modifying Materializedviews Builder instances may affect your bill.", + "WarningBannerOnDelete": "After deprovisioning the Materializedviews Builder, your materializedviews will not be updated with new source changes anymore. Materializedviews builder is compute in your account that performs read operations on source collection for any updates and applies them on materialized views as per the materializedview definition." +} \ No newline at end of file diff --git a/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.rp.ts b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.rp.ts new file mode 100644 index 000000000..d5fae8d0d --- /dev/null +++ b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.rp.ts @@ -0,0 +1,228 @@ +import { configContext } from "../../ConfigContext"; +import { userContext } from "../../UserContext"; +import { armRequestWithoutPolling } from "../../Utils/arm/request"; +import { selfServeTraceFailure, selfServeTraceStart, selfServeTraceSuccess } from "../SelfServeTelemetryProcessor"; +import { RefreshResult } from "../SelfServeTypes"; +import MaterializedViewsBuilder from "./MaterializedViewsBuilder"; +import { + FetchPricesResponse, + PriceMapAndCurrencyCode, + RegionsResponse, + MaterializedViewsBuilderServiceResource, + UpdateMaterializedViewsBuilderRequestParameters, +} from "./MaterializedViewsBuilderTypes"; + +const apiVersion = "2021-07-01-preview"; + +export enum ResourceStatus { + Running = "Running", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", +} + +export interface MaterializedViewsBuilderResponse { + sku: string; + instances: number; + status: string; + endpoint: string; +} + +export const getPath = (subscriptionId: string, resourceGroup: string, name: string): string => { + return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}/services/materializedviewsBuilder`; +}; + +export const updateMaterializedViewsBuilderResource = async (sku: string, instances: number): Promise => { + const path = getPath(userContext.subscriptionId, userContext.resourceGroup, userContext.databaseAccount.name); + const body: UpdateMaterializedViewsBuilderRequestParameters = { + properties: { + instanceSize: sku, + instanceCount: instances, + serviceType: "materializedviewsBuilder", + }, + }; + const telemetryData = { ...body, httpMethod: "PUT", selfServeClassName: MaterializedViewsBuilder.name }; + const updateTimeStamp = selfServeTraceStart(telemetryData); + let armRequestResult; + try { + armRequestResult = await armRequestWithoutPolling({ + host: configContext.ARM_ENDPOINT, + path, + method: "PUT", + apiVersion, + body, + }); + selfServeTraceSuccess(telemetryData, updateTimeStamp); + } catch (e) { + const failureTelemetry = { ...body, e, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, updateTimeStamp); + throw e; + } + return armRequestResult?.operationStatusUrl; +}; + +export const deleteMaterializedViewsBuilderResource = async (): Promise => { + const path = getPath(userContext.subscriptionId, userContext.resourceGroup, userContext.databaseAccount.name); + const telemetryData = { httpMethod: "DELETE", selfServeClassName: MaterializedViewsBuilder.name }; + const deleteTimeStamp = selfServeTraceStart(telemetryData); + let armRequestResult; + try { + armRequestResult = await armRequestWithoutPolling({ + host: configContext.ARM_ENDPOINT, + path, + method: "DELETE", + apiVersion, + }); + selfServeTraceSuccess(telemetryData, deleteTimeStamp); + } catch (e) { + const failureTelemetry = { e, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, deleteTimeStamp); + throw e; + } + return armRequestResult?.operationStatusUrl; +}; + +export const getMaterializedViewsBuilderResource = async (): Promise => { + const path = getPath(userContext.subscriptionId, userContext.resourceGroup, userContext.databaseAccount.name); + const telemetryData = { httpMethod: "GET", selfServeClassName: MaterializedViewsBuilder.name }; + const getResourceTimeStamp = selfServeTraceStart(telemetryData); + let armRequestResult; + try { + armRequestResult = await armRequestWithoutPolling({ + host: configContext.ARM_ENDPOINT, + path, + method: "GET", + apiVersion, + }); + selfServeTraceSuccess(telemetryData, getResourceTimeStamp); + } catch (e) { + const failureTelemetry = { e, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, getResourceTimeStamp); + throw e; + } + return armRequestResult?.result; +}; + +export const getCurrentProvisioningState = async (): Promise => { + try { + const response = await getMaterializedViewsBuilderResource(); + return { + sku: response.properties.instanceSize, + instances: response.properties.instanceCount, + status: response.properties.status, + endpoint: response.properties.MaterializedViewsBuilderEndPoint, + }; + } catch (e) { + return { sku: undefined, instances: undefined, status: undefined, endpoint: undefined }; + } +}; + +export const refreshMaterializedViewsBuilderProvisioning = async (): Promise => { + try { + const response = await getMaterializedViewsBuilderResource(); + if (response.properties.status === ResourceStatus.Running.toString()) { + return { isUpdateInProgress: false, updateInProgressMessageTKey: undefined }; + } else if (response.properties.status === ResourceStatus.Creating.toString()) { + return { isUpdateInProgress: true, updateInProgressMessageTKey: "CreateMessage" }; + } else if (response.properties.status === ResourceStatus.Deleting.toString()) { + return { isUpdateInProgress: true, updateInProgressMessageTKey: "DeleteMessage" }; + } else { + return { isUpdateInProgress: true, updateInProgressMessageTKey: "UpdateMessage" }; + } + } catch { + //TODO differentiate between different failures + return { isUpdateInProgress: false, updateInProgressMessageTKey: undefined }; + } +}; + +const getGeneralPath = (subscriptionId: string, resourceGroup: string, name: string): string => { + return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`; +}; + +export const getRegions = async (): Promise> => { + const telemetryData = { + feature: "Calculate approximate cost", + function: "getRegions", + description: "", + selfServeClassName: MaterializedViewsBuilder.name, + }; + const getRegionsTimestamp = selfServeTraceStart(telemetryData); + + try { + const regions = new Array(); + + const response = await armRequestWithoutPolling({ + host: configContext.ARM_ENDPOINT, + path: getGeneralPath(userContext.subscriptionId, userContext.resourceGroup, userContext.databaseAccount.name), + method: "GET", + apiVersion: "2021-07-01-preview", + }); + + if (response.result.location !== undefined) { + regions.push(response.result.location.split(" ").join("").toLowerCase()); + } else { + for (const location of response.result.locations) { + regions.push(location.locationName.split(" ").join("").toLowerCase()); + } + } + + selfServeTraceSuccess(telemetryData, getRegionsTimestamp); + return regions; + } catch (err) { + const failureTelemetry = { err, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, getRegionsTimestamp); + return new Array(); + } +}; + +const getFetchPricesPathForRegion = (subscriptionId: string): string => { + return `/subscriptions/${subscriptionId}/providers/Microsoft.CostManagement/fetchPrices`; +}; + +export const getPriceMapAndCurrencyCode = async (regions: Array): Promise => { + const telemetryData = { + feature: "Calculate approximate cost", + function: "getPriceMapAndCurrencyCode", + description: "fetch prices API call", + selfServeClassName: MaterializedViewsBuilder.name, + }; + const getPriceMapAndCurrencyCodeTimestamp = selfServeTraceStart(telemetryData); + + try { + const priceMap = new Map>(); + let currencyCode; + for (const region of regions) { + const regionPriceMap = new Map(); + + const response = await armRequestWithoutPolling({ + host: configContext.ARM_ENDPOINT, + path: getFetchPricesPathForRegion(userContext.subscriptionId), + method: "POST", + apiVersion: "2020-01-01-preview", + queryParams: { + filter: + "armRegionName eq '" + + region + + "' and serviceFamily eq 'Databases' and productName eq 'Azure Cosmos DB MaterializedViews Builder - General Purpose'", + }, + }); + + for (const item of response.result.Items) { + if (currencyCode === undefined) { + currencyCode = item.currencyCode; + } else if (item.currencyCode !== currencyCode) { + throw Error("Currency Code Mismatch: Currency code not same for all regions / skus."); + } + regionPriceMap.set(item.skuName, item.retailPrice); + } + priceMap.set(region, regionPriceMap); + } + + selfServeTraceSuccess(telemetryData, getPriceMapAndCurrencyCodeTimestamp); + return { priceMap: priceMap, currencyCode: currencyCode }; + } catch (err) { + const failureTelemetry = { err, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, getPriceMapAndCurrencyCodeTimestamp); + return { priceMap: undefined, currencyCode: undefined }; + } +}; diff --git a/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.tsx b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.tsx new file mode 100644 index 000000000..40b0458e2 --- /dev/null +++ b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilder.tsx @@ -0,0 +1,416 @@ +import { IsDisplayable, OnChange, PropertyInfo, RefreshOptions, Values } from "../Decorators"; +import { + selfServeTrace, + selfServeTraceFailure, + selfServeTraceStart, + selfServeTraceSuccess, +} from "../SelfServeTelemetryProcessor"; +import { + ChoiceItem, + Description, + DescriptionType, + Info, + InputType, + NumberUiType, + OnSaveResult, + RefreshResult, + SelfServeBaseClass, + SmartUiInput, +} from "../SelfServeTypes"; +import { BladeType, generateBladeLink } from "../SelfServeUtils"; +import { + deleteMaterializedViewsBuilderResource, + getCurrentProvisioningState, + getPriceMapAndCurrencyCode, + getRegions, + refreshMaterializedViewsBuilderProvisioning, + updateMaterializedViewsBuilderResource, +} from "./MaterializedViewsBuilder.rp"; + +const costPerHourDefaultValue: Description = { + textTKey: "CostText", + type: DescriptionType.Text, + link: { + href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing", + textTKey: "MaterializedviewsBuilderPricing", + }, +}; + +const metricsStringValue: Description = { + textTKey: "MetricsText", + type: DescriptionType.Text, + link: { + href: generateBladeLink(BladeType.Metrics), + textTKey: "MetricsBlade", + }, +}; + +const CosmosD2s = "Cosmos.D2s"; +const CosmosD4s = "Cosmos.D4s"; +const CosmosD8s = "Cosmos.D8s"; +const CosmosD16s = "Cosmos.D16s"; + +const onSKUChange = (newValue: InputType, currentValues: Map): Map => { + currentValues.set("sku", { value: newValue }); + currentValues.set("costPerHour", { + value: calculateCost(newValue as string, currentValues.get("instances").value as number), + }); + + return currentValues; +}; + +const onNumberOfInstancesChange = ( + newValue: InputType, + currentValues: Map, + baselineValues: Map +): Map => { + currentValues.set("instances", { value: newValue }); + const MaterializedViewsBuilderOriginallyEnabled = baselineValues.get("enableMaterializedViewsBuilder") + ?.value as boolean; + const baselineInstances = baselineValues.get("instances")?.value as number; + if (!MaterializedViewsBuilderOriginallyEnabled || baselineInstances !== newValue) { + currentValues.set("warningBanner", { + value: { + textTKey: "WarningBannerOnUpdate", + link: { + href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing", + textTKey: "MaterializedviewsBuilderPricing", + }, + } as Description, + hidden: false, + }); + } else { + currentValues.set("warningBanner", undefined); + } + + currentValues.set("costPerHour", { + value: calculateCost(currentValues.get("sku").value as string, newValue as number), + }); + + return currentValues; +}; + +const onEnableMaterializedViewsBuilderChange = ( + newValue: InputType, + currentValues: Map, + baselineValues: ReadonlyMap +): Map => { + currentValues.set("enableMaterializedViewsBuilder", { value: newValue }); + const MaterializedViewsBuilderOriginallyEnabled = baselineValues.get("enableMaterializedViewsBuilder") + ?.value as boolean; + if (MaterializedViewsBuilderOriginallyEnabled === newValue) { + currentValues.set("sku", baselineValues.get("sku")); + currentValues.set("instances", baselineValues.get("instances")); + currentValues.set("costPerHour", baselineValues.get("costPerHour")); + currentValues.set("warningBanner", baselineValues.get("warningBanner")); + currentValues.set("metricsString", baselineValues.get("metricsString")); + return currentValues; + } + + currentValues.set("warningBanner", undefined); + if (newValue === true) { + currentValues.set("warningBanner", { + value: { + textTKey: "WarningBannerOnUpdate", + link: { + href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing", + textTKey: "MaterializedviewsBuilderPricing", + }, + } as Description, + hidden: false, + }); + + currentValues.set("costPerHour", { + value: calculateCost(baselineValues.get("sku").value as string, baselineValues.get("instances").value as number), + hidden: false, + }); + } else { + currentValues.set("warningBanner", { + value: { + textTKey: "WarningBannerOnDelete", + link: { + href: "https://aka.ms/cosmos-db-materializedviews", + textTKey: "DeprovisioningDetailsText", + }, + } as Description, + hidden: false, + }); + + currentValues.set("costPerHour", { value: costPerHourDefaultValue, hidden: true }); + } + const sku = currentValues.get("sku"); + const instances = currentValues.get("instances"); + const hideAttributes = newValue === undefined || !(newValue as boolean); + currentValues.set("sku", { + value: sku.value, + hidden: hideAttributes, + disabled: MaterializedViewsBuilderOriginallyEnabled, + }); + currentValues.set("instances", { + value: instances.value, + hidden: hideAttributes, + disabled: MaterializedViewsBuilderOriginallyEnabled, + }); + + currentValues.set("metricsString", { + value: metricsStringValue, + hidden: !newValue || !MaterializedViewsBuilderOriginallyEnabled, + }); + + return currentValues; +}; + +const skuDropDownItems: ChoiceItem[] = [ + { labelTKey: "CosmosD2s", key: CosmosD2s }, + { labelTKey: "CosmosD4s", key: CosmosD4s }, + { labelTKey: "CosmosD8s", key: CosmosD8s }, + { labelTKey: "CosmosD16s", key: CosmosD16s }, +]; + +const getSkus = async (): Promise => { + return skuDropDownItems; +}; + +const getInstancesMin = async (): Promise => { + return 1; +}; + +const getInstancesMax = async (): Promise => { + return 5; +}; + +const NumberOfInstancesDropdownInfo: Info = { + messageTKey: "ResizingDecisionText", + link: { + href: "https://aka.ms/cosmos-db-materializedviewsbuilder-size", + textTKey: "ResizingDecisionLink", + }, +}; + +const ApproximateCostDropDownInfo: Info = { + messageTKey: "CostText", + link: { + href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing", + textTKey: "MaterializedviewsBuilderPricing", + }, +}; + +let priceMap: Map>; +let currencyCode: string; +let regions: Array; + +const calculateCost = (skuName: string, instanceCount: number): Description => { + const telemetryData = { + feature: "Calculate approximate cost", + function: "calculateCost", + description: "performs final calculation", + selfServeClassName: MaterializedViewsBuilder.name, + }; + const calculateCostTimestamp = selfServeTraceStart(telemetryData); + + try { + let costPerHour = 0; + for (const region of regions) { + const incrementalCost = priceMap.get(region).get(skuName.replace("Cosmos.", "")); + if (incrementalCost === undefined) { + throw new Error("Value not found in map."); + } + costPerHour += incrementalCost; + } + + if (costPerHour === 0) { + throw new Error("Cost per hour = 0"); + } + + costPerHour *= instanceCount; + costPerHour = Math.round(costPerHour * 100) / 100; + + selfServeTraceSuccess(telemetryData, calculateCostTimestamp); + return { + textTKey: `${costPerHour} ${currencyCode}`, + type: DescriptionType.Text, + }; + } catch (err) { + const failureTelemetry = { err, regions, priceMap, selfServeClassName: MaterializedViewsBuilder.name }; + selfServeTraceFailure(failureTelemetry, calculateCostTimestamp); + + return costPerHourDefaultValue; + } +}; + +@IsDisplayable() +@RefreshOptions({ retryIntervalInMs: 20000 }) +export default class MaterializedViewsBuilder extends SelfServeBaseClass { + public onRefresh = async (): Promise => { + return await refreshMaterializedViewsBuilderProvisioning(); + }; + + public onSave = async ( + currentValues: Map, + baselineValues: Map + ): Promise => { + selfServeTrace({ selfServeClassName: MaterializedViewsBuilder.name }); + + const MaterializedViewsBuilderCurrentlyEnabled = currentValues.get("enableMaterializedViewsBuilder") + ?.value as boolean; + const MaterializedViewsBuilderOriginallyEnabled = baselineValues.get("enableMaterializedViewsBuilder") + ?.value as boolean; + + currentValues.set("warningBanner", undefined); + + if (MaterializedViewsBuilderOriginallyEnabled) { + if (!MaterializedViewsBuilderCurrentlyEnabled) { + const operationStatusUrl = await deleteMaterializedViewsBuilderResource(); + return { + operationStatusUrl: operationStatusUrl, + portalNotification: { + initialize: { + titleTKey: "DeleteInitializeTitle", + messageTKey: "DeleteInitializeMessage", + }, + success: { + titleTKey: "DeleteSuccessTitle", + messageTKey: "DeleteSuccesseMessage", + }, + failure: { + titleTKey: "DeleteFailureTitle", + messageTKey: "DeleteFailureMessage", + }, + }, + }; + } else { + const sku = currentValues.get("sku")?.value as string; + const instances = currentValues.get("instances").value as number; + const operationStatusUrl = await updateMaterializedViewsBuilderResource(sku, instances); + return { + operationStatusUrl: operationStatusUrl, + portalNotification: { + initialize: { + titleTKey: "UpdateInitializeTitle", + messageTKey: "UpdateInitializeMessage", + }, + success: { + titleTKey: "UpdateSuccessTitle", + messageTKey: "UpdateSuccesseMessage", + }, + failure: { + titleTKey: "UpdateFailureTitle", + messageTKey: "UpdateFailureMessage", + }, + }, + }; + } + } else { + const sku = currentValues.get("sku")?.value as string; + const instances = currentValues.get("instances").value as number; + const operationStatusUrl = await updateMaterializedViewsBuilderResource(sku, instances); + return { + operationStatusUrl: operationStatusUrl, + portalNotification: { + initialize: { + titleTKey: "CreateInitializeTitle", + messageTKey: "CreateInitializeMessage", + }, + success: { + titleTKey: "CreateSuccessTitle", + messageTKey: "CreateSuccesseMessage", + }, + failure: { + titleTKey: "CreateFailureTitle", + messageTKey: "CreateFailureMessage", + }, + }, + }; + } + }; + + public initialize = async (): Promise> => { + // Based on the RP call enableMaterializedViewsBuilder will be true if it has not yet been enabled and false if it has. + const defaults = new Map(); + defaults.set("enableMaterializedViewsBuilder", { value: false }); + defaults.set("sku", { value: CosmosD2s, hidden: true }); + defaults.set("instances", { value: await getInstancesMin(), hidden: true }); + defaults.set("costPerHour", undefined); + defaults.set("metricsString", { + value: undefined, + hidden: true, + }); + + regions = await getRegions(); + const priceMapAndCurrencyCode = await getPriceMapAndCurrencyCode(regions); + priceMap = priceMapAndCurrencyCode.priceMap; + currencyCode = priceMapAndCurrencyCode.currencyCode; + + const response = await getCurrentProvisioningState(); + if (response.status && response.status !== "Deleting") { + defaults.set("enableMaterializedViewsBuilder", { value: true }); + defaults.set("sku", { value: response.sku, disabled: true }); + defaults.set("instances", { value: response.instances, disabled: false }); + defaults.set("costPerHour", { value: calculateCost(response.sku, response.instances) }); + + defaults.set("metricsString", { + value: metricsStringValue, + hidden: false, + }); + } + defaults.set("warningBanner", undefined); + return defaults; + }; + + @Values({ + isDynamicDescription: true, + }) + warningBanner: string; + + @Values({ + description: { + textTKey: "MaterializedViewsBuilderDescription", + type: DescriptionType.Text, + link: { + href: "https://aka.ms/cosmos-db-materializedviews", + textTKey: "LearnAboutMaterializedViews", + }, + }, + }) + description: string; + + @OnChange(onEnableMaterializedViewsBuilderChange) + @Values({ + labelTKey: "MaterializedViewsBuilder", + trueLabelTKey: "Provisioned", + falseLabelTKey: "Deprovisioned", + }) + enableMaterializedViewsBuilder: boolean; + + @OnChange(onSKUChange) + @Values({ + labelTKey: "SKUs", + choices: getSkus, + placeholderTKey: "SKUsPlaceHolder", + }) + sku: ChoiceItem; + + @OnChange(onNumberOfInstancesChange) + @PropertyInfo(NumberOfInstancesDropdownInfo) + @Values({ + labelTKey: "NumberOfInstances", + min: getInstancesMin, + max: getInstancesMax, + step: 1, + uiType: NumberUiType.Spinner, + }) + instances: number; + + @PropertyInfo(ApproximateCostDropDownInfo) + @Values({ + labelTKey: "ApproximateCost", + isDynamicDescription: true, + }) + costPerHour: string; + + @Values({ + labelTKey: "MonitorUsage", + description: metricsStringValue, + }) + metricsString: string; +} diff --git a/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilderTypes.ts b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilderTypes.ts new file mode 100644 index 000000000..ac521fdfa --- /dev/null +++ b/src/SelfServe/MaterializedViewsBuilder/MaterializedViewsBuilderTypes.ts @@ -0,0 +1,57 @@ +export type MaterializedViewsBuilderServiceResource = { + id: string; + name: string; + type: string; + properties: MaterializedViewsBuilderServiceProps; + locations: MaterializedViewsBuilderServiceLocations; +}; +export type MaterializedViewsBuilderServiceProps = { + serviceType: string; + creationTime: string; + status: string; + instanceSize: string; + instanceCount: number; + MaterializedViewsBuilderEndPoint: string; +}; + +export type MaterializedViewsBuilderServiceLocations = { + location: string; + status: string; + MaterializedViewsBuilderEndpoint: string; +}; + +export type UpdateMaterializedViewsBuilderRequestParameters = { + properties: UpdateMaterializedViewsBuilderRequestProperties; +}; + +export type UpdateMaterializedViewsBuilderRequestProperties = { + instanceSize: string; + instanceCount: number; + serviceType: string; +}; + +export type FetchPricesResponse = { + Items: Array; + NextPageLink: string | undefined; + Count: number; +}; + +export type PriceMapAndCurrencyCode = { + priceMap: Map>; + currencyCode: string; +}; + +export type PriceItem = { + retailPrice: number; + skuName: string; + currencyCode: string; +}; + +export type RegionsResponse = { + locations: Array; + location: string; +}; + +export type RegionItem = { + locationName: string; +}; diff --git a/src/SelfServe/SelfServe.tsx b/src/SelfServe/SelfServe.tsx index 99e6e51c9..f663a3ef9 100644 --- a/src/SelfServe/SelfServe.tsx +++ b/src/SelfServe/SelfServe.tsx @@ -58,6 +58,14 @@ const getDescriptor = async (selfServeType: SelfServeType): Promise Date: Fri, 3 Jun 2022 13:19:29 -0700 Subject: [PATCH 12/22] Upgrade JS SDK version to 3.16.1 (#1287) --- package-lock.json | 238 +++++++++++++++------ package.json | 2 +- src/Common/CosmosClient.test.ts | 2 +- src/Common/CosmosClient.ts | 10 +- src/Common/dataAccess/createCollection.ts | 5 +- src/Common/dataAccess/createDatabase.ts | 3 +- src/Common/dataAccess/readOfferWithSDK.ts | 4 +- src/Common/dataAccess/updateCollection.ts | 3 +- src/Common/dataAccess/updateOffer.ts | 3 +- src/Explorer/SplashScreen/SplashScreen.tsx | 2 - 10 files changed, 188 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce3c13ec8..3bc885f96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@azure/arm-cosmosdb": "9.1.0", - "@azure/cosmos": "3.10.5", + "@azure/cosmos": "3.16.1", "@azure/cosmos-language-service": "0.0.5", "@azure/identity": "1.2.1", "@azure/ms-rest-nodeauth": "3.0.7", @@ -224,21 +224,21 @@ } }, "node_modules/@azure/core-auth": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.1.4.tgz", - "integrity": "sha512-+j1embyH1jqf04AIfJPdLafd5SC1y6z1Jz4i+USR1XkTp6KM8P5u4/AjmWMVoEQdM/M29PJcRDZcCEWjK9S1bw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", + "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "tslib": "^2.0.0" + "tslib": "^2.2.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=12.0.0" } }, "node_modules/@azure/core-auth/node_modules/tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/@azure/core-http": { "version": "1.2.2", @@ -304,6 +304,63 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/@azure/core-rest-pipeline": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.8.1.tgz", + "integrity": "sha512-R/XpxZcDgGbnneEifnsAcjLoR2NCmlDxKDmzd8oi5jx5YEnPE6gsxHQWAk2+uY55Ka717x/fdctyoCYKnumrqw==", + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.0.0", + "@azure/logger": "^1.0.0", + "form-data": "^4.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/@azure/core-rest-pipeline/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@azure/core-tracing": { "version": "1.0.0-preview.9", "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.9.tgz", @@ -322,25 +379,41 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, - "node_modules/@azure/cosmos": { - "version": "3.10.5", - "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.10.5.tgz", - "integrity": "sha512-if1uApYNjNXzB+reNFvzEBHvinxdQOzU8fni9e9Fs9jcPv9m76t2pzmYJNrxxCiFLP0vbNr/QCfQzIPQVw6v/A==", + "node_modules/@azure/core-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.0.0.tgz", + "integrity": "sha512-yWshY9cdPthlebnb3Zuz/j0Lv4kjU6u7PR5sW7A9FF7EX+0irMRJAtyTq5TPiDHJfjH8gTSlnIYFj9m7Ed76IQ==", "dependencies": { - "@azure/core-auth": "^1.2.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-util/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/@azure/cosmos": { + "version": "3.16.1", + "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.1.tgz", + "integrity": "sha512-9J76EMiF+ypZwO/Z7OS4PjrU/3hdRLe18dQh/Hj+jwXG2gKJ1NwgkYqcwu1HiCiX73A8+NCeA3PRDbegEnuuNQ==", + "dependencies": { + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.2.0", "debug": "^4.1.1", - "fast-json-stable-stringify": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", "jsbi": "^3.1.3", - "node-abort-controller": "^1.2.0", - "node-fetch": "^2.6.0", + "node-abort-controller": "^3.0.0", "priorityqueuejs": "^1.0.0", "semaphore": "^1.0.5", - "tslib": "^2.0.0", + "tslib": "^2.2.0", "universal-user-agent": "^6.0.0", "uuid": "^8.3.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=12.0.0" } }, "node_modules/@azure/cosmos-language-service": { @@ -368,18 +441,6 @@ "node": ">=0.10.0" } }, - "node_modules/@azure/cosmos/node_modules/@azure/core-auth": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.0.tgz", - "integrity": "sha512-kSDSZBL6c0CYdhb+7KuutnKGf2geeT+bCJAgccB0DD7wmNJSsQPcF7TcuoZX83B7VK4tLz/u+8sOO/CnCsYp8A==", - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/@azure/cosmos/node_modules/tslib": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", @@ -23099,9 +23160,9 @@ } }, "node_modules/node-abort-controller": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-1.2.1.tgz", - "integrity": "sha512-79PYeJuj6S9+yOHirR0JBLFOgjB6sQCir10uN6xRx25iD+ZD4ULqgRn3MwWBRaQGB0vEgReJzWwJo42T1R6YbQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.0.1.tgz", + "integrity": "sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw==" }, "node_modules/node-fetch": { "version": "2.6.1", @@ -31248,18 +31309,18 @@ } }, "@azure/core-auth": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.1.4.tgz", - "integrity": "sha512-+j1embyH1jqf04AIfJPdLafd5SC1y6z1Jz4i+USR1XkTp6KM8P5u4/AjmWMVoEQdM/M29PJcRDZcCEWjK9S1bw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", + "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", "requires": { "@azure/abort-controller": "^1.0.0", - "tslib": "^2.0.0" + "tslib": "^2.2.0" }, "dependencies": { "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" } } }, @@ -31317,6 +31378,53 @@ } } }, + "@azure/core-rest-pipeline": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.8.1.tgz", + "integrity": "sha512-R/XpxZcDgGbnneEifnsAcjLoR2NCmlDxKDmzd8oi5jx5YEnPE6gsxHQWAk2+uY55Ka717x/fdctyoCYKnumrqw==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.0.0", + "@azure/logger": "^1.0.0", + "form-data": "^4.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "requires": { + "tslib": "^2.2.0" + } + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, "@azure/core-tracing": { "version": "1.0.0-preview.9", "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.9.tgz", @@ -31334,33 +31442,39 @@ } } }, - "@azure/cosmos": { - "version": "3.10.5", - "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.10.5.tgz", - "integrity": "sha512-if1uApYNjNXzB+reNFvzEBHvinxdQOzU8fni9e9Fs9jcPv9m76t2pzmYJNrxxCiFLP0vbNr/QCfQzIPQVw6v/A==", + "@azure/core-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.0.0.tgz", + "integrity": "sha512-yWshY9cdPthlebnb3Zuz/j0Lv4kjU6u7PR5sW7A9FF7EX+0irMRJAtyTq5TPiDHJfjH8gTSlnIYFj9m7Ed76IQ==", "requires": { - "@azure/core-auth": "^1.2.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + } + } + }, + "@azure/cosmos": { + "version": "3.16.1", + "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.1.tgz", + "integrity": "sha512-9J76EMiF+ypZwO/Z7OS4PjrU/3hdRLe18dQh/Hj+jwXG2gKJ1NwgkYqcwu1HiCiX73A8+NCeA3PRDbegEnuuNQ==", + "requires": { + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.2.0", "debug": "^4.1.1", - "fast-json-stable-stringify": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", "jsbi": "^3.1.3", - "node-abort-controller": "^1.2.0", - "node-fetch": "^2.6.0", + "node-abort-controller": "^3.0.0", "priorityqueuejs": "^1.0.0", "semaphore": "^1.0.5", - "tslib": "^2.0.0", + "tslib": "^2.2.0", "universal-user-agent": "^6.0.0", "uuid": "^8.3.0" }, "dependencies": { - "@azure/core-auth": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.0.tgz", - "integrity": "sha512-kSDSZBL6c0CYdhb+7KuutnKGf2geeT+bCJAgccB0DD7wmNJSsQPcF7TcuoZX83B7VK4tLz/u+8sOO/CnCsYp8A==", - "requires": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.0.0" - } - }, "tslib": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", @@ -49900,9 +50014,9 @@ } }, "node-abort-controller": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-1.2.1.tgz", - "integrity": "sha512-79PYeJuj6S9+yOHirR0JBLFOgjB6sQCir10uN6xRx25iD+ZD4ULqgRn3MwWBRaQGB0vEgReJzWwJo42T1R6YbQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.0.1.tgz", + "integrity": "sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw==" }, "node-fetch": { "version": "2.6.1", diff --git a/package.json b/package.json index 3e76f6f69..f70ef6d4d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "@azure/arm-cosmosdb": "9.1.0", - "@azure/cosmos": "3.10.5", + "@azure/cosmos": "3.16.1", "@azure/cosmos-language-service": "0.0.5", "@azure/identity": "1.2.1", "@azure/ms-rest-nodeauth": "3.0.7", diff --git a/src/Common/CosmosClient.test.ts b/src/Common/CosmosClient.test.ts index 96505f208..ddac0de7d 100644 --- a/src/Common/CosmosClient.test.ts +++ b/src/Common/CosmosClient.test.ts @@ -1,4 +1,4 @@ -import { ResourceType } from "@azure/cosmos/dist-esm/common/constants"; +import { ResourceType } from "@azure/cosmos"; import { Platform, resetConfigContext, updateConfigContext } from "../ConfigContext"; import { updateUserContext } from "../UserContext"; import { endpoint, getTokenFromAuthService, requestPlugin, tokenProvider } from "./CosmosClient"; diff --git a/src/Common/CosmosClient.ts b/src/Common/CosmosClient.ts index 75359e363..f973df855 100644 --- a/src/Common/CosmosClient.ts +++ b/src/Common/CosmosClient.ts @@ -1,6 +1,4 @@ import * as Cosmos from "@azure/cosmos"; -import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos"; -import { CosmosHeaders } from "@azure/cosmos/dist-esm"; import { configContext, Platform } from "../ConfigContext"; import { userContext } from "../UserContext"; import { logConsoleError } from "../Utils/NotificationConsoleUtils"; @@ -9,7 +7,7 @@ import { getErrorMessage } from "./ErrorHandlingUtils"; const _global = typeof self === "undefined" ? window : self; -export const tokenProvider = async (requestInfo: RequestInfo) => { +export const tokenProvider = async (requestInfo: Cosmos.RequestInfo) => { const { verb, resourceId, resourceType, headers } = requestInfo; if (userContext.features.enableAadDataPlane && userContext.aadToken) { @@ -20,13 +18,13 @@ export const tokenProvider = async (requestInfo: RequestInfo) => { if (configContext.platform === Platform.Emulator) { // TODO This SDK method mutates the headers object. Find a better one or fix the SDK. - await setAuthorizationTokenHeaderUsingMasterKey(verb, resourceId, resourceType, headers, EmulatorMasterKey); + await Cosmos.setAuthorizationTokenHeaderUsingMasterKey(verb, resourceId, resourceType, headers, EmulatorMasterKey); return decodeURIComponent(headers.authorization); } if (userContext.masterKey) { // TODO This SDK method mutates the headers object. Find a better one or fix the SDK. - await setAuthorizationTokenHeaderUsingMasterKey(verb, resourceId, resourceType, headers, EmulatorMasterKey); + await Cosmos.setAuthorizationTokenHeaderUsingMasterKey(verb, resourceId, resourceType, headers, EmulatorMasterKey); return decodeURIComponent(headers.authorization); } @@ -89,7 +87,7 @@ let _client: Cosmos.CosmosClient; export function client(): Cosmos.CosmosClient { if (_client) return _client; - let _defaultHeaders: CosmosHeaders = {}; + let _defaultHeaders: Cosmos.CosmosHeaders = {}; _defaultHeaders["x-ms-cosmos-sdk-supportedcapabilities"] = SDKSupportedCapabilities.None | SDKSupportedCapabilities.PartitionMerge; diff --git a/src/Common/dataAccess/createCollection.ts b/src/Common/dataAccess/createCollection.ts index 791b29fcc..7c657e667 100644 --- a/src/Common/dataAccess/createCollection.ts +++ b/src/Common/dataAccess/createCollection.ts @@ -1,7 +1,4 @@ -import { ContainerResponse, DatabaseResponse } from "@azure/cosmos"; -import { RequestOptions } from "@azure/cosmos/dist-esm"; -import { ContainerRequest } from "@azure/cosmos/dist-esm/client/Container/ContainerRequest"; -import { DatabaseRequest } from "@azure/cosmos/dist-esm/client/Database/DatabaseRequest"; +import { ContainerRequest, ContainerResponse, DatabaseRequest, DatabaseResponse, RequestOptions } from "@azure/cosmos"; import { AuthType } from "../../AuthType"; import * as DataModels from "../../Contracts/DataModels"; import { useDatabases } from "../../Explorer/useDatabases"; diff --git a/src/Common/dataAccess/createDatabase.ts b/src/Common/dataAccess/createDatabase.ts index 2467b7975..9208119ad 100644 --- a/src/Common/dataAccess/createDatabase.ts +++ b/src/Common/dataAccess/createDatabase.ts @@ -1,5 +1,4 @@ -import { DatabaseResponse } from "@azure/cosmos"; -import { DatabaseRequest } from "@azure/cosmos/dist-esm/client/Database/DatabaseRequest"; +import { DatabaseRequest, DatabaseResponse } from "@azure/cosmos"; import { AuthType } from "../../AuthType"; import * as DataModels from "../../Contracts/DataModels"; import { useDatabases } from "../../Explorer/useDatabases"; diff --git a/src/Common/dataAccess/readOfferWithSDK.ts b/src/Common/dataAccess/readOfferWithSDK.ts index 761d9b282..7332a4e4f 100644 --- a/src/Common/dataAccess/readOfferWithSDK.ts +++ b/src/Common/dataAccess/readOfferWithSDK.ts @@ -1,6 +1,6 @@ -import { HttpHeaders } from "../Constants"; +import { RequestOptions } from "@azure/cosmos"; import { Offer } from "../../Contracts/DataModels"; -import { RequestOptions } from "@azure/cosmos/dist-esm"; +import { HttpHeaders } from "../Constants"; import { client } from "../CosmosClient"; import { parseSDKOfferResponse } from "../OfferUtility"; import { readOffers } from "./readOffers"; diff --git a/src/Common/dataAccess/updateCollection.ts b/src/Common/dataAccess/updateCollection.ts index cb553b77f..8b4c075e2 100644 --- a/src/Common/dataAccess/updateCollection.ts +++ b/src/Common/dataAccess/updateCollection.ts @@ -1,5 +1,4 @@ -import { ContainerDefinition } from "@azure/cosmos"; -import { RequestOptions } from "@azure/cosmos/dist-esm"; +import { ContainerDefinition, RequestOptions } from "@azure/cosmos"; import { AuthType } from "../../AuthType"; import { Collection } from "../../Contracts/DataModels"; import { userContext } from "../../UserContext"; diff --git a/src/Common/dataAccess/updateOffer.ts b/src/Common/dataAccess/updateOffer.ts index 380de430d..88a3355d5 100644 --- a/src/Common/dataAccess/updateOffer.ts +++ b/src/Common/dataAccess/updateOffer.ts @@ -1,5 +1,4 @@ -import { OfferDefinition } from "@azure/cosmos"; -import { RequestOptions } from "@azure/cosmos/dist-esm"; +import { OfferDefinition, RequestOptions } from "@azure/cosmos"; import { AuthType } from "../../AuthType"; import { Offer, SDKOfferDefinition, UpdateOfferParams } from "../../Contracts/DataModels"; import { userContext } from "../../UserContext"; diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 06ba26adc..31f472754 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -50,8 +50,6 @@ export interface SplashScreenProps { } export class SplashScreen extends React.Component { - private static readonly seeMoreItemTitle: string = "See more Cosmos DB documentation"; - private static readonly seeMoreItemUrl: string = "https://aka.ms/cosmosdbdocument"; private static readonly dataModelingUrl = "https://docs.microsoft.com/azure/cosmos-db/modeling-data"; private static readonly throughputEstimatorUrl = "https://cosmos.azure.com/capacitycalculator"; private static readonly failoverUrl = "https://docs.microsoft.com/azure/cosmos-db/high-availability"; From c534b2d74b5cb425876a45f65ed88ceab3636df1 Mon Sep 17 00:00:00 2001 From: siddjoshi-ms <86025894+siddjoshi-ms@users.noreply.github.com> Date: Wed, 8 Jun 2022 10:16:43 -0700 Subject: [PATCH 13/22] Sqlx az portal cost estimate (#1264) * added isZoneRedundant to rp call * Pass region item everywhere * cost breakdown string added --- src/SelfServe/SqlX/SqlX.rp.ts | 25 ++++++++--------------- src/SelfServe/SqlX/SqlX.tsx | 35 ++++++++++++++++++++++++++------- src/SelfServe/SqlX/SqlxTypes.ts | 6 +++++- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/SelfServe/SqlX/SqlX.rp.ts b/src/SelfServe/SqlX/SqlX.rp.ts index d224990bb..9cb430971 100644 --- a/src/SelfServe/SqlX/SqlX.rp.ts +++ b/src/SelfServe/SqlX/SqlX.rp.ts @@ -7,6 +7,7 @@ import SqlX from "./SqlX"; import { FetchPricesResponse, PriceMapAndCurrencyCode, + RegionItem, RegionsResponse, SqlxServiceResource, UpdateDedicatedGatewayRequestParameters, @@ -139,7 +140,7 @@ const getGeneralPath = (subscriptionId: string, resourceGroup: string, name: str return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`; }; -export const getRegions = async (): Promise> => { +export const getRegions = async (): Promise> => { const telemetryData = { feature: "Calculate approximate cost", function: "getRegions", @@ -149,8 +150,6 @@ export const getRegions = async (): Promise> => { const getRegionsTimestamp = selfServeTraceStart(telemetryData); try { - const regions = new Array(); - const response = await armRequestWithoutPolling({ host: configContext.ARM_ENDPOINT, path: getGeneralPath(userContext.subscriptionId, userContext.resourceGroup, userContext.databaseAccount.name), @@ -158,20 +157,12 @@ export const getRegions = async (): Promise> => { apiVersion: "2021-04-01-preview", }); - if (response.result.location !== undefined) { - regions.push(response.result.location.split(" ").join("").toLowerCase()); - } else { - for (const location of response.result.locations) { - regions.push(location.locationName.split(" ").join("").toLowerCase()); - } - } - selfServeTraceSuccess(telemetryData, getRegionsTimestamp); - return regions; + return response.result.properties.locations; } catch (err) { const failureTelemetry = { err, selfServeClassName: SqlX.name }; selfServeTraceFailure(failureTelemetry, getRegionsTimestamp); - return new Array(); + return new Array(); } }; @@ -179,7 +170,7 @@ const getFetchPricesPathForRegion = (subscriptionId: string): string => { return `/subscriptions/${subscriptionId}/providers/Microsoft.CostManagement/fetchPrices`; }; -export const getPriceMapAndCurrencyCode = async (regions: Array): Promise => { +export const getPriceMapAndCurrencyCode = async (regions: Array): Promise => { const telemetryData = { feature: "Calculate approximate cost", function: "getPriceMapAndCurrencyCode", @@ -191,7 +182,7 @@ export const getPriceMapAndCurrencyCode = async (regions: Array): Promis try { const priceMap = new Map>(); let currencyCode; - for (const region of regions) { + for (const regionItem of regions) { const regionPriceMap = new Map(); const response = await armRequestWithoutPolling({ @@ -202,7 +193,7 @@ export const getPriceMapAndCurrencyCode = async (regions: Array): Promis queryParams: { filter: "armRegionName eq '" + - region + + regionItem.locationName.split(" ").join("").toLowerCase() + "' and serviceFamily eq 'Databases' and productName eq 'Azure Cosmos DB Dedicated Gateway - General Purpose'", }, }); @@ -215,7 +206,7 @@ export const getPriceMapAndCurrencyCode = async (regions: Array): Promis } regionPriceMap.set(item.skuName, item.retailPrice); } - priceMap.set(region, regionPriceMap); + priceMap.set(regionItem.locationName, regionPriceMap); } selfServeTraceSuccess(telemetryData, getPriceMapAndCurrencyCodeTimestamp); diff --git a/src/SelfServe/SqlX/SqlX.tsx b/src/SelfServe/SqlX/SqlX.tsx index 76623cd97..a760d8d97 100644 --- a/src/SelfServe/SqlX/SqlX.tsx +++ b/src/SelfServe/SqlX/SqlX.tsx @@ -1,3 +1,4 @@ +import { RegionItem } from "SelfServe/SqlX/SqlxTypes"; import { IsDisplayable, OnChange, PropertyInfo, RefreshOptions, Values } from "../Decorators"; import { selfServeTrace, @@ -208,7 +209,7 @@ const ApproximateCostDropDownInfo: Info = { let priceMap: Map>; let currencyCode: string; -let regions: Array; +let regions: Array; const calculateCost = (skuName: string, instanceCount: number): Description => { const telemetryData = { @@ -221,27 +222,47 @@ const calculateCost = (skuName: string, instanceCount: number): Description => { try { let costPerHour = 0; - for (const region of regions) { - const incrementalCost = priceMap.get(region).get(skuName.replace("Cosmos.", "")); + let costBreakdown = ""; + for (const regionItem of regions) { + const incrementalCost = priceMap.get(regionItem.locationName).get(skuName.replace("Cosmos.", "")); if (incrementalCost === undefined) { - throw new Error("Value not found in map."); + throw new Error(`${regionItem.locationName} not found in price map.`); + } else if (incrementalCost === 0) { + throw new Error(`${regionItem.locationName} cost per hour = 0`); } - costPerHour += incrementalCost; + + let regionalInstanceCount = instanceCount; + if (regionItem.isZoneRedundant) { + regionalInstanceCount = Math.ceil(instanceCount * 1.5); + } + + const regionalCostPerHour = incrementalCost * regionalInstanceCount; + costBreakdown += ` + ${regionItem.locationName} ${regionItem.isZoneRedundant ? "(AZ)" : ""} + ${regionalCostPerHour} ${currencyCode} (${regionalInstanceCount} instances * ${incrementalCost} ${currencyCode})\ + `; + + if (regionalCostPerHour === 0) { + throw new Error(`${regionItem.locationName} Cost per hour = 0`); + } + + costPerHour += regionalCostPerHour; } if (costPerHour === 0) { throw new Error("Cost per hour = 0"); } - costPerHour *= instanceCount; costPerHour = Math.round(costPerHour * 100) / 100; selfServeTraceSuccess(telemetryData, calculateCostTimestamp); return { - textTKey: `${costPerHour} ${currencyCode}`, + textTKey: `${costPerHour} ${currencyCode} + ${costBreakdown}`, type: DescriptionType.Text, }; } catch (err) { + alert(err); const failureTelemetry = { err, regions, priceMap, selfServeClassName: SqlX.name }; selfServeTraceFailure(failureTelemetry, calculateCostTimestamp); diff --git a/src/SelfServe/SqlX/SqlxTypes.ts b/src/SelfServe/SqlX/SqlxTypes.ts index 7ca2fe264..3360df734 100644 --- a/src/SelfServe/SqlX/SqlxTypes.ts +++ b/src/SelfServe/SqlX/SqlxTypes.ts @@ -48,10 +48,14 @@ export type PriceItem = { }; export type RegionsResponse = { + properties: RegionsProperties; +}; + +export type RegionsProperties = { locations: Array; - location: string; }; export type RegionItem = { locationName: string; + isZoneRedundant: boolean; }; From c731eb9cf91a296a843f815dc93eba958015fc99 Mon Sep 17 00:00:00 2001 From: Tanuj Mittal Date: Wed, 8 Jun 2022 14:00:49 -0700 Subject: [PATCH 14/22] Fix Official Samples not loading when Gallery tab is opened (#1282) --- src/GalleryViewer/GalleryViewer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GalleryViewer/GalleryViewer.tsx b/src/GalleryViewer/GalleryViewer.tsx index e630ee7b2..2026415af 100644 --- a/src/GalleryViewer/GalleryViewer.tsx +++ b/src/GalleryViewer/GalleryViewer.tsx @@ -2,6 +2,7 @@ import { initializeIcons, Link, Text } from "@fluentui/react"; import "bootstrap/dist/css/bootstrap.css"; import * as React from "react"; import * as ReactDOM from "react-dom"; +import { userContext } from "UserContext"; import { initializeConfiguration } from "../ConfigContext"; import { GalleryHeaderComponent } from "../Explorer/Controls/Header/GalleryHeaderComponent"; import { @@ -25,7 +26,9 @@ const onInit = async () => { const props: GalleryAndNotebookViewerComponentProps = { junoClient: new JunoClient(), - selectedTab: galleryViewerProps.selectedTab || GalleryTab.PublicGallery, + selectedTab: + galleryViewerProps.selectedTab || + (userContext.features.publicGallery ? GalleryTab.PublicGallery : GalleryTab.OfficialSamples), sortBy: galleryViewerProps.sortBy || SortBy.MostRecent, searchText: galleryViewerProps.searchText, }; From 7abd65ac4ba00642f6c6d1e3aa32627bdace0707 Mon Sep 17 00:00:00 2001 From: Karthik chakravarthy <88904658+kcheekuri@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:08:06 -0400 Subject: [PATCH 15/22] Enable phoenix based of allowed subscription and flights (#1291) * Enable phoenix based of allowed subscription and flights --- src/Contracts/DataModels.ts | 7 + .../SettingsComponent.test.tsx.snap | 3210 ----------------- src/Explorer/Notebook/useNotebook.ts | 28 +- .../GitHubReposPanel.test.tsx.snap | 1605 --------- .../StringInputPane.test.tsx.snap | 1605 --------- src/Phoenix/PhoenixClient.ts | 17 +- 6 files changed, 39 insertions(+), 6433 deletions(-) diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index eab6a91a3..1c46b349b 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -450,6 +450,12 @@ export interface IContainerData { forwardingId: string; } +export interface IDbAccountAllow { + status: number; + message?: string; + type?: string; +} + export interface IResponse { status: number; data: T; @@ -563,4 +569,5 @@ export enum PhoenixErrorType { RegionNotServicable = "RegionNotServicable", SubscriptionNotAllowed = "SubscriptionNotAllowed", UnknownError = "UnknownError", + PhoenixFlightFallback = "PhoenixFlightFallback", } diff --git a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap index ea8341d10..fd3b28ed5 100644 --- a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap +++ b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap @@ -32,1611 +32,6 @@ exports[`SettingsComponent renders 1`] = ` "_resetNotebookWorkspace": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function], "isTabsContentExpanded": [Function], - "notebookManager": NotebookManager { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "gitHubContentProvider": GitHubContentProvider { - "params": Object { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "promptForCommitMsg": [Function], - }, - }, - "gitHubOAuthService": GitHubOAuthService { - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "token": [Function], - }, - "inMemoryContentProvider": InMemoryContentProvider { - "params": Object { - "memory://schema-analyzer-component-notebook.ipynb": Object { - "content": Object { - "content": Object { - "cells": Array [ - Object { - "cell_type": "code", - "execution_count": 0, - "metadata": Object {}, - "outputs": Array [], - "source": "", - }, - ], - "metadata": Object { - "kernelspec": Object { - "displayName": "Mongo", - "language": "mongocli", - "name": "mongo", - }, - "language_info": Object { - "file_extension": "ipynb", - "mimetype": "application/json", - "name": "mongo", - "version": "1.0", - }, - }, - "nbformat": 4, - "nbformat_minor": 4, - }, - "created": "", - "format": "json", - "last_modified": "", - "mimetype": "application/x-ipynb+json", - "name": "schema-analyzer-component-notebook.ipynb", - "path": "memory://schema-analyzer-component-notebook.ipynb", - "type": "notebook", - "writable": true, - }, - "readonly": true, - }, - }, - }, - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "onGitHubClientError": [Function], - "params": Object { - "container": [Circular], - "refreshCommandBarButtons": [Function], - "refreshNotebookList": [Function], - "resourceTree": ResourceTreeAdapter { - "container": [Circular], - "copyNotebook": [Function], - "parameters": [Function], - }, - }, - "promptForCommitMsg": [Function], - }, "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], "phoenixClient": PhoenixClient { @@ -1713,1611 +108,6 @@ exports[`SettingsComponent renders 1`] = ` "_resetNotebookWorkspace": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function], "isTabsContentExpanded": [Function], - "notebookManager": NotebookManager { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "gitHubContentProvider": GitHubContentProvider { - "params": Object { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "promptForCommitMsg": [Function], - }, - }, - "gitHubOAuthService": GitHubOAuthService { - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "token": [Function], - }, - "inMemoryContentProvider": InMemoryContentProvider { - "params": Object { - "memory://schema-analyzer-component-notebook.ipynb": Object { - "content": Object { - "content": Object { - "cells": Array [ - Object { - "cell_type": "code", - "execution_count": 0, - "metadata": Object {}, - "outputs": Array [], - "source": "", - }, - ], - "metadata": Object { - "kernelspec": Object { - "displayName": "Mongo", - "language": "mongocli", - "name": "mongo", - }, - "language_info": Object { - "file_extension": "ipynb", - "mimetype": "application/json", - "name": "mongo", - "version": "1.0", - }, - }, - "nbformat": 4, - "nbformat_minor": 4, - }, - "created": "", - "format": "json", - "last_modified": "", - "mimetype": "application/x-ipynb+json", - "name": "schema-analyzer-component-notebook.ipynb", - "path": "memory://schema-analyzer-component-notebook.ipynb", - "type": "notebook", - "writable": true, - }, - "readonly": true, - }, - }, - }, - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "onGitHubClientError": [Function], - "params": Object { - "container": [Circular], - "refreshCommandBarButtons": [Function], - "refreshNotebookList": [Function], - "resourceTree": ResourceTreeAdapter { - "container": [Circular], - "copyNotebook": [Function], - "parameters": [Function], - }, - }, - "promptForCommitMsg": [Function], - }, "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], "phoenixClient": PhoenixClient { diff --git a/src/Explorer/Notebook/useNotebook.ts b/src/Explorer/Notebook/useNotebook.ts index 1515f281f..b0bcba10b 100644 --- a/src/Explorer/Notebook/useNotebook.ts +++ b/src/Explorer/Notebook/useNotebook.ts @@ -4,12 +4,12 @@ import { PhoenixClient } from "Phoenix/PhoenixClient"; import create, { UseStore } from "zustand"; import { AuthType } from "../../AuthType"; import * as Constants from "../../Common/Constants"; -import { ConnectionStatusType } from "../../Common/Constants"; +import { ConnectionStatusType, HttpStatusCodes } from "../../Common/Constants"; import { getErrorMessage } from "../../Common/ErrorHandlingUtils"; import * as Logger from "../../Common/Logger"; import { configContext } from "../../ConfigContext"; import * as DataModels from "../../Contracts/DataModels"; -import { ContainerConnectionInfo, ContainerInfo } from "../../Contracts/DataModels"; +import { ContainerConnectionInfo, ContainerInfo, PhoenixErrorType } from "../../Contracts/DataModels"; import { useTabs } from "../../hooks/useTabs"; import { IPinnedRepo } from "../../Juno/JunoClient"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; @@ -303,15 +303,23 @@ export const useNotebook: UseStore = create((set, get) => ({ setContainerStatus: (containerStatus: ContainerInfo) => set({ containerStatus }), getPhoenixStatus: async () => { if (get().isPhoenixNotebooks === undefined || get().isPhoenixFeatures === undefined) { - let isPhoenix = false; - if (userContext.features.phoenixNotebooks || userContext.features.phoenixFeatures) { - const phoenixClient = new PhoenixClient(); - isPhoenix = isPublicInternetAccessAllowed() && (await phoenixClient.isDbAcountWhitelisted()); + let isPhoenixNotebooks = false; + let isPhoenixFeatures = false; + + const isPublicInternetAllowed = isPublicInternetAccessAllowed(); + const phoenixClient = new PhoenixClient(); + const dbAccountAllowedInfo = await phoenixClient.getDbAccountAllowedStatus(); + + if (dbAccountAllowedInfo.status === HttpStatusCodes.OK) { + if (dbAccountAllowedInfo?.type === PhoenixErrorType.PhoenixFlightFallback) { + isPhoenixNotebooks = isPublicInternetAllowed && userContext.features.phoenixNotebooks; + isPhoenixFeatures = isPublicInternetAllowed && userContext.features.phoenixFeatures; + } else { + isPhoenixNotebooks = isPhoenixFeatures = isPublicInternetAllowed; + } + } else { + isPhoenixNotebooks = isPhoenixFeatures = false; } - - const isPhoenixNotebooks = userContext.features.phoenixNotebooks && isPhoenix; - const isPhoenixFeatures = userContext.features.phoenixFeatures && isPhoenix; - set({ isPhoenixNotebooks: isPhoenixNotebooks }); set({ isPhoenixFeatures: isPhoenixFeatures }); } diff --git a/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap index fe350f1fa..a66023041 100644 --- a/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap +++ b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap @@ -21,1611 +21,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = ` "_resetNotebookWorkspace": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function], "isTabsContentExpanded": [Function], - "notebookManager": NotebookManager { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "gitHubContentProvider": GitHubContentProvider { - "params": Object { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "promptForCommitMsg": [Function], - }, - }, - "gitHubOAuthService": GitHubOAuthService { - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "token": [Function], - }, - "inMemoryContentProvider": InMemoryContentProvider { - "params": Object { - "memory://schema-analyzer-component-notebook.ipynb": Object { - "content": Object { - "content": Object { - "cells": Array [ - Object { - "cell_type": "code", - "execution_count": 0, - "metadata": Object {}, - "outputs": Array [], - "source": "", - }, - ], - "metadata": Object { - "kernelspec": Object { - "displayName": "Mongo", - "language": "mongocli", - "name": "mongo", - }, - "language_info": Object { - "file_extension": "ipynb", - "mimetype": "application/json", - "name": "mongo", - "version": "1.0", - }, - }, - "nbformat": 4, - "nbformat_minor": 4, - }, - "created": "", - "format": "json", - "last_modified": "", - "mimetype": "application/x-ipynb+json", - "name": "schema-analyzer-component-notebook.ipynb", - "path": "memory://schema-analyzer-component-notebook.ipynb", - "type": "notebook", - "writable": true, - }, - "readonly": true, - }, - }, - }, - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "onGitHubClientError": [Function], - "params": Object { - "container": [Circular], - "refreshCommandBarButtons": [Function], - "refreshNotebookList": [Function], - "resourceTree": ResourceTreeAdapter { - "container": [Circular], - "copyNotebook": [Function], - "parameters": [Function], - }, - }, - "promptForCommitMsg": [Function], - }, "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], "phoenixClient": PhoenixClient { diff --git a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap index a0a695c5d..e77d8c74d 100644 --- a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap +++ b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap @@ -11,1611 +11,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = ` "_resetNotebookWorkspace": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function], "isTabsContentExpanded": [Function], - "notebookManager": NotebookManager { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "gitHubContentProvider": GitHubContentProvider { - "params": Object { - "gitHubClient": GitHubClient { - "errorCallback": [Function], - "ocktokit": OctokitWithDefaults { - "actions": Object { - "addSelectedRepoToOrgSecret": [Function], - "cancelWorkflowRun": [Function], - "createOrUpdateOrgSecret": [Function], - "createOrUpdateRepoSecret": [Function], - "createOrUpdateSecretForRepo": [Function], - "createRegistrationToken": [Function], - "createRegistrationTokenForOrg": [Function], - "createRegistrationTokenForRepo": [Function], - "createRemoveToken": [Function], - "createRemoveTokenForOrg": [Function], - "createRemoveTokenForRepo": [Function], - "deleteArtifact": [Function], - "deleteOrgSecret": [Function], - "deleteRepoSecret": [Function], - "deleteSecretFromRepo": [Function], - "deleteSelfHostedRunnerFromOrg": [Function], - "deleteSelfHostedRunnerFromRepo": [Function], - "deleteWorkflowRunLogs": [Function], - "downloadArtifact": [Function], - "downloadJobLogsForWorkflowRun": [Function], - "downloadWorkflowJobLogs": [Function], - "downloadWorkflowRunLogs": [Function], - "getArtifact": [Function], - "getJobForWorkflowRun": [Function], - "getOrgPublicKey": [Function], - "getOrgSecret": [Function], - "getPublicKey": [Function], - "getRepoPublicKey": [Function], - "getRepoSecret": [Function], - "getSecret": [Function], - "getSelfHostedRunner": [Function], - "getSelfHostedRunnerForOrg": [Function], - "getSelfHostedRunnerForRepo": [Function], - "getWorkflow": [Function], - "getWorkflowJob": [Function], - "getWorkflowRun": [Function], - "getWorkflowRunUsage": [Function], - "getWorkflowUsage": [Function], - "listArtifactsForRepo": [Function], - "listDownloadsForSelfHostedRunnerApplication": [Function], - "listJobsForWorkflowRun": [Function], - "listOrgSecrets": [Function], - "listRepoSecrets": [Function], - "listRepoWorkflowRuns": [Function], - "listRepoWorkflows": [Function], - "listRunnerApplicationsForOrg": [Function], - "listRunnerApplicationsForRepo": [Function], - "listSecretsForRepo": [Function], - "listSelectedReposForOrgSecret": [Function], - "listSelfHostedRunnersForOrg": [Function], - "listSelfHostedRunnersForRepo": [Function], - "listWorkflowJobLogs": [Function], - "listWorkflowRunArtifacts": [Function], - "listWorkflowRunLogs": [Function], - "listWorkflowRuns": [Function], - "listWorkflowRunsForRepo": [Function], - "reRunWorkflow": [Function], - "removeSelectedRepoFromOrgSecret": [Function], - "removeSelfHostedRunner": [Function], - "setSelectedReposForOrgSecret": [Function], - }, - "activity": Object { - "checkRepoIsStarredByAuthenticatedUser": [Function], - "checkStarringRepo": [Function], - "deleteRepoSubscription": [Function], - "deleteThreadSubscription": [Function], - "getFeeds": [Function], - "getRepoSubscription": [Function], - "getThread": [Function], - "getThreadSubscription": [Function], - "getThreadSubscriptionForAuthenticatedUser": [Function], - "listEventsForAuthenticatedUser": [Function], - "listEventsForOrg": [Function], - "listEventsForUser": [Function], - "listFeeds": [Function], - "listNotifications": [Function], - "listNotificationsForAuthenticatedUser": [Function], - "listNotificationsForRepo": [Function], - "listOrgEventsForAuthenticatedUser": [Function], - "listPublicEvents": [Function], - "listPublicEventsForOrg": [Function], - "listPublicEventsForRepoNetwork": [Function], - "listPublicEventsForUser": [Function], - "listPublicOrgEvents": [Function], - "listReceivedEventsForUser": [Function], - "listReceivedPublicEventsForUser": [Function], - "listRepoEvents": [Function], - "listRepoNotificationsForAuthenticatedUser": [Function], - "listReposStarredByAuthenticatedUser": [Function], - "listReposStarredByUser": [Function], - "listReposWatchedByUser": [Function], - "listStargazersForRepo": [Function], - "listWatchedReposForAuthenticatedUser": [Function], - "listWatchersForRepo": [Function], - "markAsRead": [Function], - "markNotificationsAsRead": [Function], - "markNotificationsAsReadForRepo": [Function], - "markRepoNotificationsAsRead": [Function], - "markThreadAsRead": [Function], - "setRepoSubscription": [Function], - "setThreadSubscription": [Function], - "starRepo": [Function], - "starRepoForAuthenticatedUser": [Function], - "unstarRepo": [Function], - "unstarRepoForAuthenticatedUser": [Function], - }, - "apps": Object { - "addRepoToInstallation": [Function], - "checkAccountIsAssociatedWithAny": [Function], - "checkAccountIsAssociatedWithAnyStubbed": [Function], - "checkToken": [Function], - "createContentAttachment": [Function], - "createFromManifest": [Function], - "createInstallationAccessToken": [Function], - "createInstallationToken": [Function], - "deleteAuthorization": [Function], - "deleteInstallation": [Function], - "deleteToken": [Function], - "getAuthenticated": [Function], - "getBySlug": [Function], - "getInstallation": [Function], - "getOrgInstallation": [Function], - "getRepoInstallation": [Function], - "getSubscriptionPlanForAccount": [Function], - "getSubscriptionPlanForAccountStubbed": [Function], - "getUserInstallation": [Function], - "listAccountsForPlan": [Function], - "listAccountsForPlanStubbed": [Function], - "listAccountsUserOrOrgOnPlan": [Function], - "listAccountsUserOrOrgOnPlanStubbed": [Function], - "listInstallationReposForAuthenticatedUser": [Function], - "listInstallations": [Function], - "listInstallationsForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUser": [Function], - "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function], - "listPlans": [Function], - "listPlansStubbed": [Function], - "listRepos": [Function], - "listReposAccessibleToInstallation": [Function], - "listSubscriptionsForAuthenticatedUser": [Function], - "listSubscriptionsForAuthenticatedUserStubbed": [Function], - "removeRepoFromInstallation": [Function], - "resetToken": [Function], - "revokeInstallationAccessToken": [Function], - "revokeInstallationToken": [Function], - "suspendInstallation": [Function], - "unsuspendInstallation": [Function], - }, - "auth": [Function], - "checks": Object { - "create": [Function], - "createSuite": [Function], - "get": [Function], - "getSuite": [Function], - "listAnnotations": [Function], - "listForRef": [Function], - "listForSuite": [Function], - "listSuitesForRef": [Function], - "rerequestSuite": [Function], - "setSuitesPreferences": [Function], - "update": [Function], - }, - "codeScanning": Object { - "getAlert": [Function], - "listAlertsForRepo": [Function], - }, - "codesOfConduct": Object { - "getAllCodesOfConduct": [Function], - "getConductCode": [Function], - "getForRepo": [Function], - "listConductCodes": [Function], - }, - "emojis": Object { - "get": [Function], - }, - "gists": Object { - "checkIsStarred": [Function], - "create": [Function], - "createComment": [Function], - "delete": [Function], - "deleteComment": [Function], - "fork": [Function], - "get": [Function], - "getComment": [Function], - "getRevision": [Function], - "list": [Function], - "listComments": [Function], - "listCommits": [Function], - "listForUser": [Function], - "listForks": [Function], - "listPublic": [Function], - "listPublicForUser": [Function], - "listStarred": [Function], - "star": [Function], - "unstar": [Function], - "update": [Function], - "updateComment": [Function], - }, - "git": Object { - "createBlob": [Function], - "createCommit": [Function], - "createRef": [Function], - "createTag": [Function], - "createTree": [Function], - "deleteRef": [Function], - "getBlob": [Function], - "getCommit": [Function], - "getRef": [Function], - "getTag": [Function], - "getTree": [Function], - "listMatchingRefs": [Function], - "updateRef": [Function], - }, - "gitignore": Object { - "getAllTemplates": [Function], - "getTemplate": [Function], - "listTemplates": [Function], - }, - "graphql": [Function], - "hook": [Function], - "interactions": Object { - "addOrUpdateRestrictionsForOrg": [Function], - "addOrUpdateRestrictionsForRepo": [Function], - "getRestrictionsForOrg": [Function], - "getRestrictionsForRepo": [Function], - "removeRestrictionsForOrg": [Function], - "removeRestrictionsForRepo": [Function], - "setRestrictionsForOrg": [Function], - "setRestrictionsForRepo": [Function], - }, - "issues": Object { - "addAssignees": [Function], - "addLabels": [Function], - "checkAssignee": [Function], - "checkUserCanBeAssigned": [Function], - "create": [Function], - "createComment": [Function], - "createLabel": [Function], - "createMilestone": [Function], - "deleteComment": [Function], - "deleteLabel": [Function], - "deleteMilestone": [Function], - "get": [Function], - "getComment": [Function], - "getEvent": [Function], - "getLabel": [Function], - "getMilestone": [Function], - "list": [Function], - "listAssignees": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listEvents": [Function], - "listEventsForRepo": [Function], - "listEventsForTimeline": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listLabelsForMilestone": [Function], - "listLabelsForRepo": [Function], - "listLabelsOnIssue": [Function], - "listMilestones": [Function], - "listMilestonesForRepo": [Function], - "lock": [Function], - "removeAllLabels": [Function], - "removeAssignees": [Function], - "removeLabel": [Function], - "removeLabels": [Function], - "replaceAllLabels": [Function], - "replaceLabels": [Function], - "setLabels": [Function], - "unlock": [Function], - "update": [Function], - "updateComment": [Function], - "updateLabel": [Function], - "updateMilestone": [Function], - }, - "licenses": Object { - "get": [Function], - "getAllCommonlyUsed": [Function], - "getForRepo": [Function], - "listCommonlyUsed": [Function], - }, - "log": Object { - "debug": [Function], - "error": [Function], - "info": [Function], - "warn": [Function], - }, - "markdown": Object { - "render": [Function], - "renderRaw": [Function], - }, - "meta": Object { - "get": [Function], - }, - "migrations": Object { - "cancelImport": [Function], - "deleteArchiveForAuthenticatedUser": [Function], - "deleteArchiveForOrg": [Function], - "downloadArchiveForOrg": [Function], - "getArchiveForAuthenticatedUser": [Function], - "getCommitAuthors": [Function], - "getImportProgress": [Function], - "getImportStatus": [Function], - "getLargeFiles": [Function], - "getStatusForAuthenticatedUser": [Function], - "getStatusForOrg": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listReposForOrg": [Function], - "listReposForUser": [Function], - "mapCommitAuthor": [Function], - "setLfsPreference": [Function], - "startForAuthenticatedUser": [Function], - "startForOrg": [Function], - "startImport": [Function], - "unlockRepoForAuthenticatedUser": [Function], - "unlockRepoForOrg": [Function], - "updateImport": [Function], - }, - "orgs": Object { - "addOrUpdateMembership": [Function], - "blockUser": [Function], - "checkBlockedUser": [Function], - "checkMembership": [Function], - "checkMembershipForUser": [Function], - "checkPublicMembership": [Function], - "checkPublicMembershipForUser": [Function], - "concealMembership": [Function], - "convertMemberToOutsideCollaborator": [Function], - "createHook": [Function], - "createInvitation": [Function], - "createWebhook": [Function], - "deleteHook": [Function], - "deleteWebhook": [Function], - "get": [Function], - "getHook": [Function], - "getMembership": [Function], - "getMembershipForAuthenticatedUser": [Function], - "getMembershipForUser": [Function], - "getWebhook": [Function], - "list": [Function], - "listAppInstallations": [Function], - "listBlockedUsers": [Function], - "listForAuthenticatedUser": [Function], - "listForUser": [Function], - "listHooks": [Function], - "listInstallations": [Function], - "listInvitationTeams": [Function], - "listMembers": [Function], - "listMemberships": [Function], - "listMembershipsForAuthenticatedUser": [Function], - "listOutsideCollaborators": [Function], - "listPendingInvitations": [Function], - "listPublicMembers": [Function], - "listWebhooks": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "publicizeMembership": [Function], - "removeMember": [Function], - "removeMembership": [Function], - "removeMembershipForUser": [Function], - "removeOutsideCollaborator": [Function], - "removePublicMembershipForAuthenticatedUser": [Function], - "setMembershipForUser": [Function], - "setPublicMembershipForAuthenticatedUser": [Function], - "unblockUser": [Function], - "update": [Function], - "updateHook": [Function], - "updateMembership": [Function], - "updateMembershipForAuthenticatedUser": [Function], - "updateWebhook": [Function], - }, - "paginate": [Function], - "projects": Object { - "addCollaborator": [Function], - "createCard": [Function], - "createColumn": [Function], - "createForAuthenticatedUser": [Function], - "createForOrg": [Function], - "createForRepo": [Function], - "delete": [Function], - "deleteCard": [Function], - "deleteColumn": [Function], - "get": [Function], - "getCard": [Function], - "getColumn": [Function], - "getPermissionForUser": [Function], - "listCards": [Function], - "listCollaborators": [Function], - "listColumns": [Function], - "listForOrg": [Function], - "listForRepo": [Function], - "listForUser": [Function], - "moveCard": [Function], - "moveColumn": [Function], - "removeCollaborator": [Function], - "reviewUserPermissionLevel": [Function], - "update": [Function], - "updateCard": [Function], - "updateColumn": [Function], - }, - "pulls": Object { - "checkIfMerged": [Function], - "create": [Function], - "createComment": [Function], - "createReplyForReviewComment": [Function], - "createReview": [Function], - "createReviewComment": [Function], - "createReviewCommentReply": [Function], - "createReviewRequest": [Function], - "deleteComment": [Function], - "deletePendingReview": [Function], - "deleteReviewComment": [Function], - "deleteReviewRequest": [Function], - "dismissReview": [Function], - "get": [Function], - "getComment": [Function], - "getCommentsForReview": [Function], - "getReview": [Function], - "getReviewComment": [Function], - "list": [Function], - "listComments": [Function], - "listCommentsForRepo": [Function], - "listCommentsForReview": [Function], - "listCommits": [Function], - "listFiles": [Function], - "listRequestedReviewers": [Function], - "listReviewComments": [Function], - "listReviewCommentsForRepo": [Function], - "listReviewRequests": [Function], - "listReviews": [Function], - "merge": [Function], - "removeRequestedReviewers": [Function], - "requestReviewers": [Function], - "submitReview": [Function], - "update": [Function], - "updateBranch": [Function], - "updateComment": [Function], - "updateReview": [Function], - "updateReviewComment": [Function], - }, - "rateLimit": Object { - "get": [Function], - }, - "reactions": Object { - "createForCommitComment": [Function], - "createForIssue": [Function], - "createForIssueComment": [Function], - "createForPullRequestReviewComment": [Function], - "createForTeamDiscussionCommentInOrg": [Function], - "createForTeamDiscussionInOrg": [Function], - "delete": [Function], - "deleteForCommitComment": [Function], - "deleteForIssue": [Function], - "deleteForIssueComment": [Function], - "deleteForPullRequestComment": [Function], - "deleteForTeamDiscussion": [Function], - "deleteForTeamDiscussionComment": [Function], - "deleteLegacy": [Function], - "listForCommitComment": [Function], - "listForIssue": [Function], - "listForIssueComment": [Function], - "listForPullRequestReviewComment": [Function], - "listForTeamDiscussionCommentInOrg": [Function], - "listForTeamDiscussionInOrg": [Function], - }, - "repos": Object { - "acceptInvitation": [Function], - "addAppAccessRestrictions": [Function], - "addCollaborator": [Function], - "addDeployKey": [Function], - "addProtectedBranchAdminEnforcement": [Function], - "addProtectedBranchAppRestrictions": [Function], - "addProtectedBranchRequiredSignatures": [Function], - "addProtectedBranchRequiredStatusChecksContexts": [Function], - "addProtectedBranchTeamRestrictions": [Function], - "addProtectedBranchUserRestrictions": [Function], - "addStatusCheckContexts": [Function], - "addTeamAccessRestrictions": [Function], - "addUserAccessRestrictions": [Function], - "checkCollaborator": [Function], - "checkVulnerabilityAlerts": [Function], - "compareCommits": [Function], - "createCommitComment": [Function], - "createCommitSignatureProtection": [Function], - "createCommitStatus": [Function], - "createDeployKey": [Function], - "createDeployment": [Function], - "createDeploymentStatus": [Function], - "createDispatchEvent": [Function], - "createForAuthenticatedUser": [Function], - "createFork": [Function], - "createHook": [Function], - "createInOrg": [Function], - "createOrUpdateFile": [Function], - "createOrUpdateFileContents": [Function], - "createPagesSite": [Function], - "createRelease": [Function], - "createStatus": [Function], - "createUsingTemplate": [Function], - "createWebhook": [Function], - "declineInvitation": [Function], - "delete": [Function], - "deleteAccessRestrictions": [Function], - "deleteAdminBranchProtection": [Function], - "deleteBranchProtection": [Function], - "deleteCommitComment": [Function], - "deleteCommitSignatureProtection": [Function], - "deleteDeployKey": [Function], - "deleteDeployment": [Function], - "deleteDownload": [Function], - "deleteFile": [Function], - "deleteHook": [Function], - "deleteInvitation": [Function], - "deletePagesSite": [Function], - "deletePullRequestReviewProtection": [Function], - "deleteRelease": [Function], - "deleteReleaseAsset": [Function], - "deleteWebhook": [Function], - "disableAutomatedSecurityFixes": [Function], - "disablePagesSite": [Function], - "disableVulnerabilityAlerts": [Function], - "downloadArchive": [Function], - "enableAutomatedSecurityFixes": [Function], - "enablePagesSite": [Function], - "enableVulnerabilityAlerts": [Function], - "get": [Function], - "getAccessRestrictions": [Function], - "getAdminBranchProtection": [Function], - "getAllStatusCheckContexts": [Function], - "getAllTopics": [Function], - "getAppsWithAccessToProtectedBranch": [Function], - "getArchiveLink": [Function], - "getBranch": [Function], - "getBranchProtection": [Function], - "getClones": [Function], - "getCodeFrequencyStats": [Function], - "getCollaboratorPermissionLevel": [Function], - "getCombinedStatusForRef": [Function], - "getCommit": [Function], - "getCommitActivityStats": [Function], - "getCommitComment": [Function], - "getCommitSignatureProtection": [Function], - "getCommunityProfileMetrics": [Function], - "getContent": [Function], - "getContents": [Function], - "getContributorsStats": [Function], - "getDeployKey": [Function], - "getDeployment": [Function], - "getDeploymentStatus": [Function], - "getDownload": [Function], - "getHook": [Function], - "getLatestPagesBuild": [Function], - "getLatestRelease": [Function], - "getPages": [Function], - "getPagesBuild": [Function], - "getParticipationStats": [Function], - "getProtectedBranchAdminEnforcement": [Function], - "getProtectedBranchPullRequestReviewEnforcement": [Function], - "getProtectedBranchRequiredSignatures": [Function], - "getProtectedBranchRequiredStatusChecks": [Function], - "getProtectedBranchRestrictions": [Function], - "getPullRequestReviewProtection": [Function], - "getPunchCardStats": [Function], - "getReadme": [Function], - "getRelease": [Function], - "getReleaseAsset": [Function], - "getReleaseByTag": [Function], - "getStatusChecksProtection": [Function], - "getTeamsWithAccessToProtectedBranch": [Function], - "getTopPaths": [Function], - "getTopReferrers": [Function], - "getUsersWithAccessToProtectedBranch": [Function], - "getViews": [Function], - "getWebhook": [Function], - "list": [Function], - "listAssetsForRelease": [Function], - "listBranches": [Function], - "listBranchesForHeadCommit": [Function], - "listCollaborators": [Function], - "listCommentsForCommit": [Function], - "listCommitComments": [Function], - "listCommitCommentsForRepo": [Function], - "listCommitStatusesForRef": [Function], - "listCommits": [Function], - "listContributors": [Function], - "listDeployKeys": [Function], - "listDeploymentStatuses": [Function], - "listDeployments": [Function], - "listDownloads": [Function], - "listForAuthenticatedUser": [Function], - "listForOrg": [Function], - "listForUser": [Function], - "listForks": [Function], - "listHooks": [Function], - "listInvitations": [Function], - "listInvitationsForAuthenticatedUser": [Function], - "listLanguages": [Function], - "listPagesBuilds": [Function], - "listProtectedBranchRequiredStatusChecksContexts": [Function], - "listPublic": [Function], - "listPullRequestsAssociatedWithCommit": [Function], - "listReleaseAssets": [Function], - "listReleases": [Function], - "listStatusesForRef": [Function], - "listTags": [Function], - "listTeams": [Function], - "listTopics": [Function], - "listWebhooks": [Function], - "merge": [Function], - "pingHook": [Function], - "pingWebhook": [Function], - "removeAppAccessRestrictions": [Function], - "removeBranchProtection": [Function], - "removeCollaborator": [Function], - "removeDeployKey": [Function], - "removeProtectedBranchAdminEnforcement": [Function], - "removeProtectedBranchAppRestrictions": [Function], - "removeProtectedBranchPullRequestReviewEnforcement": [Function], - "removeProtectedBranchRequiredSignatures": [Function], - "removeProtectedBranchRequiredStatusChecks": [Function], - "removeProtectedBranchRequiredStatusChecksContexts": [Function], - "removeProtectedBranchRestrictions": [Function], - "removeProtectedBranchTeamRestrictions": [Function], - "removeProtectedBranchUserRestrictions": [Function], - "removeStatusCheckContexts": [Function], - "removeStatusCheckProtection": [Function], - "removeTeamAccessRestrictions": [Function], - "removeUserAccessRestrictions": [Function], - "replaceAllTopics": [Function], - "replaceProtectedBranchAppRestrictions": [Function], - "replaceProtectedBranchRequiredStatusChecksContexts": [Function], - "replaceProtectedBranchTeamRestrictions": [Function], - "replaceProtectedBranchUserRestrictions": [Function], - "replaceTopics": [Function], - "requestPageBuild": [Function], - "requestPagesBuild": [Function], - "retrieveCommunityProfileMetrics": [Function], - "setAdminBranchProtection": [Function], - "setAppAccessRestrictions": [Function], - "setStatusCheckContexts": [Function], - "setTeamAccessRestrictions": [Function], - "setUserAccessRestrictions": [Function], - "testPushHook": [Function], - "testPushWebhook": [Function], - "transfer": [Function], - "update": [Function], - "updateBranchProtection": [Function], - "updateCommitComment": [Function], - "updateHook": [Function], - "updateInformationAboutPagesSite": [Function], - "updateInvitation": [Function], - "updateProtectedBranchPullRequestReviewEnforcement": [Function], - "updateProtectedBranchRequiredStatusChecks": [Function], - "updatePullRequestReviewProtection": [Function], - "updateRelease": [Function], - "updateReleaseAsset": [Function], - "updateStatusCheckPotection": [Function], - "updateWebhook": [Function], - "uploadReleaseAsset": [Function], - }, - "request": [Function], - "search": Object { - "code": [Function], - "commits": [Function], - "issuesAndPullRequests": [Function], - "labels": [Function], - "repos": [Function], - "topics": [Function], - "users": [Function], - }, - "teams": Object { - "addOrUpdateMembershipForUserInOrg": [Function], - "addOrUpdateMembershipInOrg": [Function], - "addOrUpdateProjectInOrg": [Function], - "addOrUpdateProjectPermissionsInOrg": [Function], - "addOrUpdateRepoInOrg": [Function], - "addOrUpdateRepoPermissionsInOrg": [Function], - "checkManagesRepoInOrg": [Function], - "checkPermissionsForProjectInOrg": [Function], - "checkPermissionsForRepoInOrg": [Function], - "create": [Function], - "createDiscussionCommentInOrg": [Function], - "createDiscussionInOrg": [Function], - "deleteDiscussionCommentInOrg": [Function], - "deleteDiscussionInOrg": [Function], - "deleteInOrg": [Function], - "getByName": [Function], - "getDiscussionCommentInOrg": [Function], - "getDiscussionInOrg": [Function], - "getMembershipForUserInOrg": [Function], - "getMembershipInOrg": [Function], - "list": [Function], - "listChildInOrg": [Function], - "listDiscussionCommentsInOrg": [Function], - "listDiscussionsInOrg": [Function], - "listForAuthenticatedUser": [Function], - "listMembersInOrg": [Function], - "listPendingInvitationsInOrg": [Function], - "listProjectsInOrg": [Function], - "listReposInOrg": [Function], - "removeMembershipForUserInOrg": [Function], - "removeMembershipInOrg": [Function], - "removeProjectInOrg": [Function], - "removeRepoInOrg": [Function], - "reviewProjectInOrg": [Function], - "updateDiscussionCommentInOrg": [Function], - "updateDiscussionInOrg": [Function], - "updateInOrg": [Function], - }, - "users": Object { - "addEmailForAuthenticated": [Function], - "addEmails": [Function], - "block": [Function], - "checkBlocked": [Function], - "checkFollowing": [Function], - "checkFollowingForUser": [Function], - "checkPersonIsFollowedByAuthenticated": [Function], - "createGpgKey": [Function], - "createGpgKeyForAuthenticated": [Function], - "createPublicKey": [Function], - "createPublicSshKeyForAuthenticated": [Function], - "deleteEmailForAuthenticated": [Function], - "deleteEmails": [Function], - "deleteGpgKey": [Function], - "deleteGpgKeyForAuthenticated": [Function], - "deletePublicKey": [Function], - "deletePublicSshKeyForAuthenticated": [Function], - "follow": [Function], - "getAuthenticated": [Function], - "getByUsername": [Function], - "getContextForUser": [Function], - "getGpgKey": [Function], - "getGpgKeyForAuthenticated": [Function], - "getPublicKey": [Function], - "getPublicSshKeyForAuthenticated": [Function], - "list": [Function], - "listBlocked": [Function], - "listBlockedByAuthenticated": [Function], - "listEmails": [Function], - "listEmailsForAuthenticated": [Function], - "listFollowedByAuthenticated": [Function], - "listFollowersForAuthenticatedUser": [Function], - "listFollowersForUser": [Function], - "listFollowingForAuthenticatedUser": [Function], - "listFollowingForUser": [Function], - "listGpgKeys": [Function], - "listGpgKeysForAuthenticated": [Function], - "listGpgKeysForUser": [Function], - "listPublicEmails": [Function], - "listPublicEmailsForAuthenticated": [Function], - "listPublicKeys": [Function], - "listPublicKeysForUser": [Function], - "listPublicSshKeysForAuthenticated": [Function], - "setPrimaryEmailVisibilityForAuthenticated": [Function], - "togglePrimaryEmailVisibility": [Function], - "unblock": [Function], - "unfollow": [Function], - "updateAuthenticated": [Function], - }, - }, - }, - "promptForCommitMsg": [Function], - }, - }, - "gitHubOAuthService": GitHubOAuthService { - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "token": [Function], - }, - "inMemoryContentProvider": InMemoryContentProvider { - "params": Object { - "memory://schema-analyzer-component-notebook.ipynb": Object { - "content": Object { - "content": Object { - "cells": Array [ - Object { - "cell_type": "code", - "execution_count": 0, - "metadata": Object {}, - "outputs": Array [], - "source": "", - }, - ], - "metadata": Object { - "kernelspec": Object { - "displayName": "Mongo", - "language": "mongocli", - "name": "mongo", - }, - "language_info": Object { - "file_extension": "ipynb", - "mimetype": "application/json", - "name": "mongo", - "version": "1.0", - }, - }, - "nbformat": 4, - "nbformat_minor": 4, - }, - "created": "", - "format": "json", - "last_modified": "", - "mimetype": "application/x-ipynb+json", - "name": "schema-analyzer-component-notebook.ipynb", - "path": "memory://schema-analyzer-component-notebook.ipynb", - "type": "notebook", - "writable": true, - }, - "readonly": true, - }, - }, - }, - "junoClient": JunoClient { - "cachedPinnedRepos": [Function], - }, - "onGitHubClientError": [Function], - "params": Object { - "container": [Circular], - "refreshCommandBarButtons": [Function], - "refreshNotebookList": [Function], - "resourceTree": ResourceTreeAdapter { - "container": [Circular], - "copyNotebook": [Function], - "parameters": [Function], - }, - }, - "promptForCommitMsg": [Function], - }, "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], "phoenixClient": PhoenixClient { diff --git a/src/Phoenix/PhoenixClient.ts b/src/Phoenix/PhoenixClient.ts index 3b95a5786..9728a8a15 100644 --- a/src/Phoenix/PhoenixClient.ts +++ b/src/Phoenix/PhoenixClient.ts @@ -17,6 +17,7 @@ import { ContainerConnectionInfo, ContainerInfo, IContainerData, + IDbAccountAllow, IMaxAllocationTimeExceeded, IMaxDbAccountsPerUserExceeded, IMaxUsersPerDbAccountExceeded, @@ -161,15 +162,17 @@ export class PhoenixClient { } } - public async isDbAcountWhitelisted(): Promise { + public async getDbAccountAllowedStatus(): Promise { const startKey = TelemetryProcessor.traceStart(Action.PhoenixDBAccountAllowed, { dataExplorerArea: Areas.Notebook, }); + let responseJson; try { const response = await window.fetch(`${this.getPhoenixControlPlanePathPrefix()}`, { method: "GET", headers: PhoenixClient.getHeaders(), }); + responseJson = await response?.json(); if (response.status !== HttpStatusCodes.OK) { throw new Error(`Received status code: ${response?.status}`); } @@ -180,7 +183,11 @@ export class PhoenixClient { }, startKey ); - return response.status === HttpStatusCodes.OK; + return { + status: response.status, + message: responseJson?.message, + type: responseJson?.type, + }; } catch (error) { TelemetryProcessor.traceFailure( Action.PhoenixDBAccountAllowed, @@ -192,7 +199,11 @@ export class PhoenixClient { startKey ); Logger.logError(getErrorMessage(error), "PhoenixClient/IsDbAcountWhitelisted"); - return false; + return { + status: HttpStatusCodes.Forbidden, + message: responseJson?.message, + type: responseJson?.type, + }; } } From 1643ce4dbb1eac922343469de65d3904f9fbafbf Mon Sep 17 00:00:00 2001 From: Tanuj Mittal Date: Mon, 20 Jun 2022 16:37:49 -0700 Subject: [PATCH 16/22] Log errors by Schema Analyzer (#1293) --- src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzer.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzer.tsx b/src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzer.tsx index cf9810f38..b0bfdb674 100644 --- a/src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzer.tsx +++ b/src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzer.tsx @@ -5,6 +5,7 @@ import Immutable from "immutable"; import * as React from "react"; import { connect } from "react-redux"; import { Dispatch } from "redux"; +import * as Logger from "../../../Common/Logger"; import { Action } from "../../../Shared/Telemetry/TelemetryConstants"; import { traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetry/TelemetryProcessor"; import loadTransform from "../NotebookComponent/loadTransform"; @@ -100,6 +101,7 @@ export class SchemaAnalyzer extends React.Component Date: Tue, 21 Jun 2022 08:48:18 -0400 Subject: [PATCH 17/22] Update allocate call (#1290) --- src/Common/Constants.ts | 4 ++++ src/Contracts/DataModels.ts | 1 + src/Explorer/Explorer.tsx | 3 ++- src/Explorer/Notebook/NotebookContainerClient.ts | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 537685a2c..2e877f872 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -354,6 +354,10 @@ export enum ContainerStatusType { Disconnected = "Disconnected", } +export enum PoolIdType { + DefaultPoolId = "default", +} + export const EmulatorMasterKey = //[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Well known public masterKey for emulator")] "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="; diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index 1c46b349b..5e783f471 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -444,6 +444,7 @@ export interface ContainerInfo { export interface IProvisionData { cosmosEndpoint: string; + poolId: string; } export interface IContainerData { diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index a90b0dc41..a9a5f645b 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -9,7 +9,7 @@ import shallow from "zustand/shallow"; import { AuthType } from "../AuthType"; import { BindingHandlersRegisterer } from "../Bindings/BindingHandlersRegisterer"; import * as Constants from "../Common/Constants"; -import { Areas, ConnectionStatusType, HttpStatusCodes, Notebook } from "../Common/Constants"; +import { Areas, ConnectionStatusType, HttpStatusCodes, Notebook, PoolIdType } from "../Common/Constants"; import { readCollection } from "../Common/dataAccess/readCollection"; import { readDatabases } from "../Common/dataAccess/readDatabases"; import { getErrorMessage, getErrorStack, handleError } from "../Common/ErrorHandlingUtils"; @@ -357,6 +357,7 @@ export default class Explorer { ) { const provisionData: IProvisionData = { cosmosEndpoint: userContext.databaseAccount.properties.documentEndpoint, + poolId: PoolIdType.DefaultPoolId, }; const connectionStatus: ContainerConnectionInfo = { status: ConnectionStatusType.Connecting, diff --git a/src/Explorer/Notebook/NotebookContainerClient.ts b/src/Explorer/Notebook/NotebookContainerClient.ts index 15e283915..53ddc44ff 100644 --- a/src/Explorer/Notebook/NotebookContainerClient.ts +++ b/src/Explorer/Notebook/NotebookContainerClient.ts @@ -5,7 +5,7 @@ import { useDialog } from "Explorer/Controls/Dialog"; import promiseRetry, { AbortError } from "p-retry"; import { PhoenixClient } from "Phoenix/PhoenixClient"; import * as Constants from "../../Common/Constants"; -import { ConnectionStatusType, HttpHeaders, HttpStatusCodes, Notebook } from "../../Common/Constants"; +import { ConnectionStatusType, HttpHeaders, HttpStatusCodes, Notebook, PoolIdType } from "../../Common/Constants"; import { getErrorMessage } from "../../Common/ErrorHandlingUtils"; import * as Logger from "../../Common/Logger"; import * as DataModels from "../../Contracts/DataModels"; @@ -154,6 +154,7 @@ export class NotebookContainerClient { if (useNotebook.getState().isPhoenixNotebooks) { const provisionData: IProvisionData = { cosmosEndpoint: userContext.databaseAccount.properties.documentEndpoint, + poolId: PoolIdType.DefaultPoolId, }; return await this.phoenixClient.resetContainer(provisionData); } From b9dffdd9904cebe69104fafd3dc1483798e4180e Mon Sep 17 00:00:00 2001 From: Mathieu Tremblay Date: Tue, 21 Jun 2022 11:19:45 -0700 Subject: [PATCH 18/22] =?UTF-8?q?Rename=20properties=20from=20notebookServ?= =?UTF-8?q?ice=20to=20phoenixService=20in=20phoenix=20c=E2=80=A6=20(#1263)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rename properties from notebookService to phoenixService in phoenix client Co-authored-by: kcheekuri --- src/Contracts/DataModels.ts | 6 +++--- src/Explorer/Explorer.tsx | 12 ++++++------ src/Explorer/Notebook/useNotebook.ts | 4 ++-- src/Phoenix/PhoenixClient.ts | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index 5e783f471..8bec7e6f9 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -438,7 +438,7 @@ export interface NotebookWorkspaceConnectionInfo { export interface ContainerInfo { durationLeftInMinutes: number; - notebookServerInfo: NotebookWorkspaceConnectionInfo; + phoenixServerInfo: NotebookWorkspaceConnectionInfo; status: ContainerStatusType; } @@ -481,8 +481,8 @@ export interface IMaxUsersPerDbAccountExceeded extends IPhoenixError { } export interface IPhoenixConnectionInfoResult { - readonly notebookAuthToken?: string; - readonly notebookServerUrl?: string; + readonly authToken?: string; + readonly phoenixServiceUrl?: string; readonly forwardingId?: string; } diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index a9a5f645b..6bf9a581c 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -370,8 +370,8 @@ export default class Explorer { }); useNotebook.getState().setIsAllocating(true); connectionInfo = await this.phoenixClient.allocateContainer(provisionData); - if (!connectionInfo?.data?.notebookServerUrl) { - throw new Error(`NotebookServerUrl is invalid!`); + if (!connectionInfo?.data?.phoenixServiceUrl) { + throw new Error(`PhoenixServiceUrl is invalid!`); } await this.setNotebookInfo(connectionInfo, connectionStatus); TelemetryProcessor.traceSuccess(Action.PhoenixConnection, { @@ -422,8 +422,8 @@ export default class Explorer { notebookServerEndpoint: (validateEndpoint(userContext.features.notebookServerUrl, allowedNotebookServerUrls) && userContext.features.notebookServerUrl) || - connectionInfo.data.notebookServerUrl, - authToken: userContext.features.notebookServerToken || connectionInfo.data.notebookAuthToken, + connectionInfo.data.phoenixServiceUrl, + authToken: userContext.features.notebookServerToken || connectionInfo.data.authToken, forwardingId: connectionInfo.data.forwardingId, }); this.notebookManager?.notebookClient @@ -498,8 +498,8 @@ export default class Explorer { if (connectionInfo?.status !== HttpStatusCodes.OK) { throw new Error(`Reset Workspace: Received status code- ${connectionInfo?.status}`); } - if (!connectionInfo?.data?.notebookServerUrl) { - throw new Error(`Reset Workspace: NotebookServerUrl is invalid!`); + if (!connectionInfo?.data?.phoenixServiceUrl) { + throw new Error(`Reset Workspace: PhoenixServiceUrl is invalid!`); } if (useNotebook.getState().isPhoenixNotebooks) { await this.setNotebookInfo(connectionInfo, connectionStatus); diff --git a/src/Explorer/Notebook/useNotebook.ts b/src/Explorer/Notebook/useNotebook.ts index b0bcba10b..d283b7a7b 100644 --- a/src/Explorer/Notebook/useNotebook.ts +++ b/src/Explorer/Notebook/useNotebook.ts @@ -96,7 +96,7 @@ export const useNotebook: UseStore = create((set, get) => ({ containerStatus: { status: undefined, durationLeftInMinutes: undefined, - notebookServerInfo: undefined, + phoenixServerInfo: undefined, }, isPhoenixNotebooks: undefined, isPhoenixFeatures: undefined, @@ -296,7 +296,7 @@ export const useNotebook: UseStore = create((set, get) => ({ useNotebook.getState().setContainerStatus({ status: undefined, durationLeftInMinutes: undefined, - notebookServerInfo: undefined, + phoenixServerInfo: undefined, }); }, setIsRefreshed: (isRefreshed: boolean) => set({ isRefreshed }), diff --git a/src/Phoenix/PhoenixClient.ts b/src/Phoenix/PhoenixClient.ts index 9728a8a15..9ff373366 100644 --- a/src/Phoenix/PhoenixClient.ts +++ b/src/Phoenix/PhoenixClient.ts @@ -104,7 +104,7 @@ export class PhoenixClient { const containerStatus = await response.json(); return { durationLeftInMinutes: containerStatus?.durationLeftInMinutes, - notebookServerInfo: containerStatus?.notebookServerInfo, + phoenixServerInfo: containerStatus?.phoenixServerInfo, status: ContainerStatusType.Active, }; } else if (response.status === HttpStatusCodes.NotFound) { @@ -148,7 +148,7 @@ export class PhoenixClient { useNotebook.getState().setIsRefreshed(!useNotebook.getState().isRefreshed); return { durationLeftInMinutes: undefined, - notebookServerInfo: undefined, + phoenixServerInfo: undefined, status: ContainerStatusType.Disconnected, }; } From f83634c50d19e039075b71c6dfc4038c40174cf4 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Tue, 28 Jun 2022 17:52:46 -0700 Subject: [PATCH 19/22] Upgrade js sdk version (#1297) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3bc885f96..bab68778d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@azure/arm-cosmosdb": "9.1.0", - "@azure/cosmos": "3.16.1", + "@azure/cosmos": "3.16.2", "@azure/cosmos-language-service": "0.0.5", "@azure/identity": "1.2.1", "@azure/ms-rest-nodeauth": "3.0.7", @@ -396,9 +396,9 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/@azure/cosmos": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.1.tgz", - "integrity": "sha512-9J76EMiF+ypZwO/Z7OS4PjrU/3hdRLe18dQh/Hj+jwXG2gKJ1NwgkYqcwu1HiCiX73A8+NCeA3PRDbegEnuuNQ==", + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.2.tgz", + "integrity": "sha512-sceY5LWj0BHGj8PSyaVCfDRQLVZyoCfIY78kyIROJVEw0k+p9XFs8fhpykN8JklkCftL0WlaVY+X25SQwnhZsw==", "dependencies": { "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.2.0", @@ -31458,9 +31458,9 @@ } }, "@azure/cosmos": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.1.tgz", - "integrity": "sha512-9J76EMiF+ypZwO/Z7OS4PjrU/3hdRLe18dQh/Hj+jwXG2gKJ1NwgkYqcwu1HiCiX73A8+NCeA3PRDbegEnuuNQ==", + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.2.tgz", + "integrity": "sha512-sceY5LWj0BHGj8PSyaVCfDRQLVZyoCfIY78kyIROJVEw0k+p9XFs8fhpykN8JklkCftL0WlaVY+X25SQwnhZsw==", "requires": { "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.2.0", diff --git a/package.json b/package.json index f70ef6d4d..4141629e1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "@azure/arm-cosmosdb": "9.1.0", - "@azure/cosmos": "3.16.1", + "@azure/cosmos": "3.16.2", "@azure/cosmos-language-service": "0.0.5", "@azure/identity": "1.2.1", "@azure/ms-rest-nodeauth": "3.0.7", From 0996489897203659f0f06dae394186ae00e59623 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:54:35 -0700 Subject: [PATCH 20/22] Improve quickstart teaching bubble telemetries and make the home page a tab (#1299) --- src/Explorer/SplashScreen/SplashScreen.tsx | 129 +----------------- src/Explorer/Tabs/Tabs.tsx | 80 ++++++++--- src/Explorer/Tutorials/QuickstartTutorial.tsx | 9 +- src/Main.tsx | 8 +- src/Shared/Telemetry/TelemetryConstants.ts | 1 + src/hooks/useTabs.ts | 52 ++++--- 6 files changed, 104 insertions(+), 175 deletions(-) diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 31f472754..26ce9d3dc 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -3,35 +3,25 @@ */ import { Coachmark, DirectionalHint, Image, Link, Stack, TeachingBubbleContent, Text } from "@fluentui/react"; import { useCarousel } from "hooks/useCarousel"; -import { useTabs } from "hooks/useTabs"; +import { ReactTabKind, useTabs } from "hooks/useTabs"; import * as React from "react"; import { Action } from "Shared/Telemetry/TelemetryConstants"; import { traceOpen } from "Shared/Telemetry/TelemetryProcessor"; -import AddDatabaseIcon from "../../../images/AddDatabase.svg"; -import NewQueryIcon from "../../../images/AddSqlQuery_16x16.svg"; -import NewStoredProcedureIcon from "../../../images/AddStoredProcedure.svg"; -import OpenQueryIcon from "../../../images/BrowseQuery.svg"; import ConnectIcon from "../../../images/Connect_color.svg"; import ContainersIcon from "../../../images/Containers.svg"; import LinkIcon from "../../../images/Link_blue.svg"; import NotebookIcon from "../../../images/notebook/Notebook-resource.svg"; import NotebookColorIcon from "../../../images/Notebooks.svg"; import QuickStartIcon from "../../../images/Quickstart_Lightning.svg"; -import ScaleAndSettingsIcon from "../../../images/Scale_15x15.svg"; import CollectionIcon from "../../../images/tree-collection.svg"; -import { AuthType } from "../../AuthType"; import * as Constants from "../../Common/Constants"; -import * as ViewModels from "../../Contracts/ViewModels"; -import { useSidePanel } from "../../hooks/useSidePanel"; import { userContext } from "../../UserContext"; -import { getCollectionName, getDatabaseName } from "../../Utils/APITypeUtils"; +import { getCollectionName } from "../../Utils/APITypeUtils"; import { FeaturePanelLauncher } from "../Controls/FeaturePanel/FeaturePanelLauncher"; import { DataSamplesUtil } from "../DataSamples/DataSamplesUtil"; import Explorer from "../Explorer"; import * as MostRecentActivity from "../MostRecentActivity/MostRecentActivity"; import { useNotebook } from "../Notebook/useNotebook"; -import { AddDatabasePanel } from "../Panes/AddDatabasePanel/AddDatabasePanel"; -import { BrowseQueriesPane } from "../Panes/BrowseQueriesPane/BrowseQueriesPane"; import { useDatabases } from "../useDatabases"; import { useSelectedNode } from "../useSelectedNode"; @@ -234,103 +224,13 @@ export class SplashScreen extends React.Component { iconSrc: ConnectIcon, title: "Connect", description: "Prefer using your own choice of tooling? Find the connection string you need to connect", - onClick: () => useTabs.getState().openAndActivateConnectTab(), + onClick: () => useTabs.getState().openAndActivateReactTab(ReactTabKind.Connect), }; heroes.push(connectBtn); return heroes; } - private createCommonTaskItems(): SplashScreenItem[] { - const items: SplashScreenItem[] = []; - - if (userContext.authType === AuthType.ResourceToken) { - return items; - } - - if (!useSelectedNode.getState().isDatabaseNodeOrNoneSelected()) { - if (userContext.apiType === "SQL" || userContext.apiType === "Gremlin") { - items.push({ - iconSrc: NewQueryIcon, - onClick: () => { - const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection(); - selectedCollection && selectedCollection.onNewQueryClick(selectedCollection, undefined); - }, - title: "New SQL Query", - description: undefined, - }); - } else if (userContext.apiType === "Mongo") { - items.push({ - iconSrc: NewQueryIcon, - onClick: () => { - const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection(); - selectedCollection && selectedCollection.onNewMongoQueryClick(selectedCollection, undefined); - }, - title: "New Query", - description: undefined, - }); - } - - if (userContext.apiType === "SQL") { - items.push({ - iconSrc: OpenQueryIcon, - title: "Open Query", - description: undefined, - onClick: () => - useSidePanel - .getState() - .openSidePanel("Open Saved Queries", ), - }); - } - - if (userContext.apiType !== "Cassandra") { - items.push({ - iconSrc: NewStoredProcedureIcon, - title: "New Stored Procedure", - description: undefined, - onClick: () => { - const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection(); - selectedCollection && selectedCollection.onNewStoredProcedureClick(selectedCollection, undefined); - }, - }); - } - - /* Scale & Settings */ - const isShared = useDatabases.getState().findSelectedDatabase()?.isDatabaseShared(); - - const label = isShared ? "Settings" : "Scale & Settings"; - items.push({ - iconSrc: ScaleAndSettingsIcon, - title: label, - description: undefined, - onClick: () => { - const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection(); - selectedCollection && selectedCollection.onSettingsClick(); - }, - }); - } else { - items.push({ - iconSrc: AddDatabaseIcon, - title: "New " + getDatabaseName(), - description: undefined, - onClick: async () => { - const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit; - if (throughputCap && throughputCap !== -1) { - await useDatabases.getState().loadAllOffers(); - } - useSidePanel - .getState() - .openSidePanel( - "New " + getDatabaseName(), - - ); - }, - }); - } - - return items; - } - private decorateOpenCollectionActivity({ databaseId, collectionId }: MostRecentActivity.OpenCollectionItem) { return { iconSrc: CollectionIcon, @@ -372,29 +272,6 @@ export class SplashScreen extends React.Component { }); } - private createTipsItems(): SplashScreenItem[] { - return [ - { - iconSrc: undefined, - title: "Data Modeling", - description: "Learn more about modeling", - onClick: () => window.open(SplashScreen.dataModelingUrl), - }, - { - iconSrc: undefined, - title: "Cost & Throughput Calculation", - description: "Learn more about cost calculation", - onClick: () => window.open(SplashScreen.throughputEstimatorUrl), - }, - { - iconSrc: undefined, - title: "Configure automatic failover", - description: "Learn more about Cosmos DB high-availability", - onClick: () => window.open(SplashScreen.failoverUrl), - }, - ]; - } - private onSplashScreenItemKeyPress(event: React.KeyboardEvent, callback: () => void) { if (event.charCode === Constants.KeyCodes.Space || event.charCode === Constants.KeyCodes.Enter) { callback(); diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index 9d980a44b..1439b2fd2 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -1,4 +1,6 @@ import { CollectionTabKind } from "Contracts/ViewModels"; +import Explorer from "Explorer/Explorer"; +import { SplashScreen } from "Explorer/SplashScreen/SplashScreen"; import { ConnectTab } from "Explorer/Tabs/ConnectTab"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import ko from "knockout"; @@ -6,28 +8,33 @@ import React, { MutableRefObject, useEffect, useRef, useState } from "react"; import loadingIcon from "../../../images/circular_loader_black_16x16.gif"; import errorIcon from "../../../images/close-black.svg"; import { useObservable } from "../../hooks/useObservable"; -import { useTabs } from "../../hooks/useTabs"; +import { ReactTabKind, useTabs } from "../../hooks/useTabs"; import TabsBase from "./TabsBase"; type Tab = TabsBase | (TabsBase & { render: () => JSX.Element }); -export const Tabs = (): JSX.Element => { - const { openedTabs, activeTab } = useTabs(); - const isConnectTabOpen = useTabs((state) => state.isConnectTabOpen); - const isConnectTabActive = useTabs((state) => state.isConnectTabActive); +interface TabsProps { + explorer: Explorer; +} + +export const Tabs = ({ explorer }: TabsProps): JSX.Element => { + const { openedTabs, openedReactTabs, activeTab, activeReactTab } = useTabs(); + return (
    - {isConnectTabActive && } + {activeReactTab !== undefined && getReactTabContent(activeReactTab, explorer)} {openedTabs.map((tab) => ( ))} @@ -37,7 +44,7 @@ export const Tabs = (): JSX.Element => { ); }; -function TabNav({ tab, active }: { tab: Tab; active: boolean }) { +function TabNav({ tab, active, tabKind }: { tab?: Tab; active: boolean; tabKind?: ReactTabKind }) { const [hovering, setHovering] = useState(false); const focusTab = useRef() as MutableRefObject; const tabId = tab ? tab.tabId : "connect"; @@ -51,8 +58,20 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) {
  • setHovering(true)} onMouseLeave={() => setHovering(false)} - onClick={() => (tab ? tab.onTabClick() : useTabs.getState().activateConnectTab())} - onKeyPress={({ nativeEvent: e }) => (tab ? tab.onKeyPressActivate(undefined, e) : onKeyPressConnectTab(e))} + onClick={() => { + if (tab) { + tab.onTabClick(); + } else if (tabKind !== undefined) { + useTabs.getState().activateReactTab(tabKind); + } + }} + onKeyPress={({ nativeEvent: e }) => { + if (tab) { + tab.onKeyPressActivate(undefined, e); + } else if (tabKind !== undefined) { + onKeyPressReactTab(e, tabKind); + } + }} className={active ? "active tabList" : "tabList"} title={useObservable(tab?.tabPath || ko.observable(""))} aria-selected={active} @@ -65,16 +84,18 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) {
    - + {useObservable(tab?.isExecutionError || ko.observable(false)) && } {useObservable(tab?.isExecuting || ko.observable(false)) && ( Loading )} - {useObservable(tab?.tabTitle || ko.observable("Connect"))} - - - + {useObservable(tab?.tabTitle || ko.observable(ReactTabKind[tabKind]))} + {tabKind !== ReactTabKind.Home && ( + + + + )}
    @@ -82,14 +103,24 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) { ); } -const CloseButton = ({ tab, active, hovering }: { tab: Tab; active: boolean; hovering: boolean }) => ( +const CloseButton = ({ + tab, + active, + hovering, + tabKind, +}: { + tab: Tab; + active: boolean; + hovering: boolean; + tabKind?: ReactTabKind; +}) => ( (tab ? tab.onCloseTabButtonClick() : useTabs.getState().closeConnectTab())} + onClick={() => (tab ? tab.onCloseTabButtonClick() : useTabs.getState().closeReactTab(tabKind))} tabIndex={active ? 0 : undefined} onKeyPress={({ nativeEvent: e }) => tab.onKeyPressClose(undefined, e)} > @@ -144,9 +175,20 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { return
    ; } -const onKeyPressConnectTab = (e: KeyboardEvent): void => { +const onKeyPressReactTab = (e: KeyboardEvent, tabKind: ReactTabKind): void => { if (e.key === "Enter" || e.key === "Space") { - useTabs.getState().activateConnectTab(); + useTabs.getState().activateReactTab(tabKind); e.stopPropagation(); } }; + +const getReactTabContent = (activeReactTab: ReactTabKind, explorer: Explorer): JSX.Element => { + switch (activeReactTab) { + case ReactTabKind.Connect: + return ; + case ReactTabKind.Home: + return ; + default: + throw Error(`Unsupported tab kind ${ReactTabKind[activeReactTab]}`); + } +}; diff --git a/src/Explorer/Tutorials/QuickstartTutorial.tsx b/src/Explorer/Tutorials/QuickstartTutorial.tsx index 5fcb44026..516a3a518 100644 --- a/src/Explorer/Tutorials/QuickstartTutorial.tsx +++ b/src/Explorer/Tutorials/QuickstartTutorial.tsx @@ -1,9 +1,9 @@ import { Link, Stack, TeachingBubble, Text } from "@fluentui/react"; -import { useTabs } from "hooks/useTabs"; +import { ReactTabKind, useTabs } from "hooks/useTabs"; import { useTeachingBubble } from "hooks/useTeachingBubble"; import React from "react"; import { Action } from "Shared/Telemetry/TelemetryConstants"; -import { traceCancel } from "Shared/Telemetry/TelemetryProcessor"; +import { traceCancel, traceSuccess } from "Shared/Telemetry/TelemetryProcessor"; export const QuickstartTutorial: React.FC = (): JSX.Element => { const { step, isSampleDBExpanded, isDocumentsTabOpened, sampleCollection, setStep } = useTeachingBubble(); @@ -146,7 +146,10 @@ export const QuickstartTutorial: React.FC = (): JSX.Element => { hasCloseButton primaryButtonProps={{ text: "Launch connect", - onClick: () => useTabs.getState().openAndActivateConnectTab(), + onClick: () => { + traceSuccess(Action.CompleteUITour); + useTabs.getState().openAndActivateReactTab(ReactTabKind.Connect); + }, }} secondaryButtonProps={{ text: "Previous", diff --git a/src/Main.tsx b/src/Main.tsx index b68254204..20a7340ee 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -46,12 +46,10 @@ import "./Explorer/Menus/NotificationConsole/NotificationConsole.less"; import { NotificationConsole } from "./Explorer/Menus/NotificationConsole/NotificationConsoleComponent"; import "./Explorer/Panes/PanelComponent.less"; import { SidePanel } from "./Explorer/Panes/PanelContainerComponent"; -import { SplashScreen } from "./Explorer/SplashScreen/SplashScreen"; import "./Explorer/SplashScreen/SplashScreen.less"; import { Tabs } from "./Explorer/Tabs/Tabs"; import { useConfig } from "./hooks/useConfig"; import { useKnockoutExplorer } from "./hooks/useKnockoutExplorer"; -import { useTabs } from "./hooks/useTabs"; import "./Libs/jquery"; import "./Shared/appInsights"; @@ -59,8 +57,6 @@ initializeIcons(); const App: React.FunctionComponent = () => { const [isLeftPaneExpanded, setIsLeftPaneExpanded] = useState(true); - const openedTabs = useTabs((state) => state.openedTabs); - const isConnectTabOpen = useTabs((state) => state.isConnectTabOpen); const isCarouselOpen = useCarousel((state) => state.shouldOpen); const config = useConfig(); @@ -104,9 +100,7 @@ const App: React.FunctionComponent = () => { {/* Collections Tree Collapsed - End */}
  • - {/* Collections Tree - End */} - {openedTabs.length === 0 && !isConnectTabOpen && } - +
    {/* Collections Tree and Tabs - End */}
    void; activateNewTab: (tab: TabsBase) => void; + activateReactTab: (tabkind: ReactTabKind) => void; updateTab: (tab: TabsBase) => void; getTabs: (tabKind: ViewModels.CollectionTabKind, comparator?: (tab: TabsBase) => boolean) => TabsBase[]; refreshActiveTab: (comparator: (tab: TabsBase) => boolean) => void; closeTabsByComparator: (comparator: (tab: TabsBase) => boolean) => void; closeTab: (tab: TabsBase) => void; closeAllNotebookTabs: (hardClose: boolean) => void; - activateConnectTab: () => void; - openAndActivateConnectTab: () => void; - closeConnectTab: () => void; + openAndActivateReactTab: (tabKind: ReactTabKind) => void; + closeReactTab: (tabKind: ReactTabKind) => void; +} + +export enum ReactTabKind { + Connect, + Home, } export const useTabs: UseStore = create((set, get) => ({ openedTabs: [], + openedReactTabs: [ReactTabKind.Home], activeTab: undefined, - isConnectTabOpen: false, - isConnectTabActive: false, + activeReactTab: ReactTabKind.Home, activateTab: (tab: TabsBase): void => { if (get().openedTabs.some((openedTab) => openedTab.tabId === tab.tabId)) { - set({ activeTab: tab, isConnectTabActive: false }); + set({ activeTab: tab, activeReactTab: undefined }); tab.onActivate(); } }, activateNewTab: (tab: TabsBase): void => { - set((state) => ({ openedTabs: [...state.openedTabs, tab], activeTab: tab, isConnectTabActive: false })); + set((state) => ({ openedTabs: [...state.openedTabs, tab], activeTab: tab, activeReactTab: undefined })); tab.onActivate(); }, + activateReactTab: (tabKind: ReactTabKind): void => set({ activeTab: undefined, activeReactTab: tabKind }), updateTab: (tab: TabsBase) => { if (get().activeTab?.tabId === tab.tabId) { set({ activeTab: tab }); @@ -73,7 +79,7 @@ export const useTabs: UseStore = create((set, get) => ({ return true; }); if (updatedTabs.length === 0) { - set({ activeTab: undefined, isConnectTabActive: get().isConnectTabOpen }); + set({ activeTab: undefined, activeReactTab: ReactTabKind.Home }); } if (tab.tabId === activeTab.tabId && tabIndex !== -1) { @@ -111,21 +117,27 @@ export const useTabs: UseStore = create((set, get) => ({ }); if (get().openedTabs.length === 0) { - set({ activeTab: undefined, isConnectTabActive: get().isConnectTabOpen }); + set({ activeTab: undefined, activeReactTab: ReactTabKind.Home }); } } }, - activateConnectTab: () => { - if (get().isConnectTabOpen) { - set({ isConnectTabActive: true, activeTab: undefined }); + openAndActivateReactTab: (tabKind: ReactTabKind) => { + if (get().openedReactTabs.indexOf(tabKind) === -1) { + set((state) => ({ + openedReactTabs: [...state.openedReactTabs, tabKind], + })); } + + set({ activeTab: undefined, activeReactTab: tabKind }); }, - openAndActivateConnectTab: () => set({ isConnectTabActive: true, isConnectTabOpen: true, activeTab: undefined }), - closeConnectTab: () => { - const { isConnectTabActive, openedTabs } = get(); - if (isConnectTabActive && openedTabs?.length > 0) { - set({ activeTab: openedTabs[0] }); + closeReactTab: (tabKind: ReactTabKind) => { + const { activeReactTab, openedTabs, openedReactTabs } = get(); + if (activeReactTab === tabKind) { + openedTabs?.length > 0 + ? set({ activeTab: openedTabs[0], activeReactTab: undefined }) + : set({ activeTab: undefined, activeReactTab: openedReactTabs[0] }); } - set({ isConnectTabActive: false, isConnectTabOpen: false }); + + set({ openedReactTabs: openedReactTabs.filter((tab: ReactTabKind) => tabKind !== tab) }); }, })); From d66e85f4316e9adb2c92fced60a87b1d7efae0a8 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:54:49 -0700 Subject: [PATCH 21/22] Allow users to delete TablesDB database when enableSDKOperations feature flag is set (#1300) --- src/Common/dataAccess/createCollection.ts | 2 +- src/Common/dataAccess/createDatabase.ts | 3 ++- src/Common/dataAccess/createStoredProcedure.ts | 6 +++++- src/Common/dataAccess/createTrigger.ts | 6 +++++- src/Common/dataAccess/createUserDefinedFunction.ts | 6 +++++- src/Common/dataAccess/deleteCollection.ts | 2 +- src/Common/dataAccess/deleteDatabase.ts | 5 +---- src/Common/dataAccess/deleteStoredProcedure.ts | 6 +++++- src/Common/dataAccess/deleteTrigger.ts | 6 +++++- src/Common/dataAccess/deleteUserDefinedFunction.ts | 6 +++++- src/Common/dataAccess/readCollectionOffer.ts | 6 +++++- src/Common/dataAccess/readCollections.ts | 6 +++++- src/Common/dataAccess/readDatabaseOffer.ts | 6 +++++- src/Common/dataAccess/readDatabases.ts | 6 +++++- src/Common/dataAccess/readStoredProcedures.ts | 6 +++++- src/Common/dataAccess/readTriggers.ts | 6 +++++- src/Common/dataAccess/readUserDefinedFunctions.ts | 4 ++-- src/Common/dataAccess/updateCollection.ts | 6 +++++- src/Common/dataAccess/updateOffer.ts | 2 +- src/Common/dataAccess/updateStoredProcedure.ts | 4 ++-- src/Common/dataAccess/updateTrigger.ts | 4 ++-- src/Common/dataAccess/updateUserDefinedFunction.ts | 4 ++-- src/Explorer/ContextMenuButtonFactory.tsx | 2 +- src/UserContext.ts | 3 --- 24 files changed, 80 insertions(+), 33 deletions(-) diff --git a/src/Common/dataAccess/createCollection.ts b/src/Common/dataAccess/createCollection.ts index 7c657e667..64911ff28 100644 --- a/src/Common/dataAccess/createCollection.ts +++ b/src/Common/dataAccess/createCollection.ts @@ -24,7 +24,7 @@ export const createCollection = async (params: DataModels.CreateCollectionParams ); try { let collection: DataModels.Collection; - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) { + if (userContext.authType === AuthType.AAD && !userContext.features.enableSDKoperations) { if (params.createNewDatabase) { const createDatabaseParams: DataModels.CreateDatabaseParams = { autoPilotMaxThroughput: params.autoPilotMaxThroughput, diff --git a/src/Common/dataAccess/createDatabase.ts b/src/Common/dataAccess/createDatabase.ts index 9208119ad..d54c94133 100644 --- a/src/Common/dataAccess/createDatabase.ts +++ b/src/Common/dataAccess/createDatabase.ts @@ -25,7 +25,8 @@ export async function createDatabase(params: DataModels.CreateDatabaseParams): P if (userContext.apiType === "Tables") { throw new Error("Creating database resources is not allowed for tables accounts"); } - const database: DataModels.Database = await (userContext.authType === AuthType.AAD && !userContext.useSDKOperations + const database: DataModels.Database = await (userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations ? createDatabaseWithARM(params) : createDatabaseWithSDK(params)); diff --git a/src/Common/dataAccess/createStoredProcedure.ts b/src/Common/dataAccess/createStoredProcedure.ts index 579835277..96ae4b7b0 100644 --- a/src/Common/dataAccess/createStoredProcedure.ts +++ b/src/Common/dataAccess/createStoredProcedure.ts @@ -20,7 +20,11 @@ export async function createStoredProcedure( ): Promise { const clearMessage = logConsoleProgress(`Creating stored procedure ${storedProcedure.id}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { try { const getResponse = await getSqlStoredProcedure( userContext.subscriptionId, diff --git a/src/Common/dataAccess/createTrigger.ts b/src/Common/dataAccess/createTrigger.ts index ad825820f..d5cdd5661 100644 --- a/src/Common/dataAccess/createTrigger.ts +++ b/src/Common/dataAccess/createTrigger.ts @@ -14,7 +14,11 @@ export async function createTrigger( ): Promise { const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { try { const getResponse = await getSqlTrigger( userContext.subscriptionId, diff --git a/src/Common/dataAccess/createUserDefinedFunction.ts b/src/Common/dataAccess/createUserDefinedFunction.ts index 3b7dd4a12..175b0af9f 100644 --- a/src/Common/dataAccess/createUserDefinedFunction.ts +++ b/src/Common/dataAccess/createUserDefinedFunction.ts @@ -20,7 +20,11 @@ export async function createUserDefinedFunction( ): Promise { const clearMessage = logConsoleProgress(`Creating user defined function ${userDefinedFunction.id}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { try { const getResponse = await getSqlUserDefinedFunction( userContext.subscriptionId, diff --git a/src/Common/dataAccess/deleteCollection.ts b/src/Common/dataAccess/deleteCollection.ts index 63e58b8c8..f83126dd1 100644 --- a/src/Common/dataAccess/deleteCollection.ts +++ b/src/Common/dataAccess/deleteCollection.ts @@ -12,7 +12,7 @@ import { handleError } from "../ErrorHandlingUtils"; export async function deleteCollection(databaseId: string, collectionId: string): Promise { const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) { + if (userContext.authType === AuthType.AAD && !userContext.features.enableSDKoperations) { await deleteCollectionWithARM(databaseId, collectionId); } else { await client().database(databaseId).container(collectionId).delete(); diff --git a/src/Common/dataAccess/deleteDatabase.ts b/src/Common/dataAccess/deleteDatabase.ts index c6c744e35..fc16fe205 100644 --- a/src/Common/dataAccess/deleteDatabase.ts +++ b/src/Common/dataAccess/deleteDatabase.ts @@ -12,10 +12,7 @@ export async function deleteDatabase(databaseId: string): Promise { const clearMessage = logConsoleProgress(`Deleting database ${databaseId}`); try { - if (userContext.apiType === "Tables") { - throw new Error("Deleting database resources is not allowed for tables accounts"); - } - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) { + if (userContext.authType === AuthType.AAD && !userContext.features.enableSDKoperations) { await deleteDatabaseWithARM(databaseId); } else { await client().database(databaseId).delete(); diff --git a/src/Common/dataAccess/deleteStoredProcedure.ts b/src/Common/dataAccess/deleteStoredProcedure.ts index daaf8315a..6bc5f2fbd 100644 --- a/src/Common/dataAccess/deleteStoredProcedure.ts +++ b/src/Common/dataAccess/deleteStoredProcedure.ts @@ -12,7 +12,11 @@ export async function deleteStoredProcedure( ): Promise { const clearMessage = logConsoleProgress(`Deleting stored procedure ${storedProcedureId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { await deleteSqlStoredProcedure( userContext.subscriptionId, userContext.resourceGroup, diff --git a/src/Common/dataAccess/deleteTrigger.ts b/src/Common/dataAccess/deleteTrigger.ts index b4a7aa7ad..a3b31369e 100644 --- a/src/Common/dataAccess/deleteTrigger.ts +++ b/src/Common/dataAccess/deleteTrigger.ts @@ -8,7 +8,11 @@ import { handleError } from "../ErrorHandlingUtils"; export async function deleteTrigger(databaseId: string, collectionId: string, triggerId: string): Promise { const clearMessage = logConsoleProgress(`Deleting trigger ${triggerId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { await deleteSqlTrigger( userContext.subscriptionId, userContext.resourceGroup, diff --git a/src/Common/dataAccess/deleteUserDefinedFunction.ts b/src/Common/dataAccess/deleteUserDefinedFunction.ts index c9683c1ab..d91d9d55b 100644 --- a/src/Common/dataAccess/deleteUserDefinedFunction.ts +++ b/src/Common/dataAccess/deleteUserDefinedFunction.ts @@ -8,7 +8,11 @@ import { handleError } from "../ErrorHandlingUtils"; export async function deleteUserDefinedFunction(databaseId: string, collectionId: string, id: string): Promise { const clearMessage = logConsoleProgress(`Deleting user defined function ${id}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { await deleteSqlUserDefinedFunction( userContext.subscriptionId, userContext.resourceGroup, diff --git a/src/Common/dataAccess/readCollectionOffer.ts b/src/Common/dataAccess/readCollectionOffer.ts index c307242d8..8bd5d589e 100644 --- a/src/Common/dataAccess/readCollectionOffer.ts +++ b/src/Common/dataAccess/readCollectionOffer.ts @@ -14,7 +14,11 @@ export const readCollectionOffer = async (params: ReadCollectionOfferParams): Pr const clearMessage = logConsoleProgress(`Querying offer for collection ${params.collectionId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType !== "Tables") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType !== "Tables" + ) { return await readCollectionOfferWithARM(params.databaseId, params.collectionId); } diff --git a/src/Common/dataAccess/readCollections.ts b/src/Common/dataAccess/readCollections.ts index 92be4f57e..a5c8dd928 100644 --- a/src/Common/dataAccess/readCollections.ts +++ b/src/Common/dataAccess/readCollections.ts @@ -13,7 +13,11 @@ import { handleError } from "../ErrorHandlingUtils"; export async function readCollections(databaseId: string): Promise { const clearMessage = logConsoleProgress(`Querying containers for database ${databaseId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType !== "Tables") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType !== "Tables" + ) { return await readCollectionsWithARM(databaseId); } diff --git a/src/Common/dataAccess/readDatabaseOffer.ts b/src/Common/dataAccess/readDatabaseOffer.ts index d27d68078..bb7366ac9 100644 --- a/src/Common/dataAccess/readDatabaseOffer.ts +++ b/src/Common/dataAccess/readDatabaseOffer.ts @@ -13,7 +13,11 @@ export const readDatabaseOffer = async (params: ReadDatabaseOfferParams): Promis const clearMessage = logConsoleProgress(`Querying offer for database ${params.databaseId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType !== "Tables") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType !== "Tables" + ) { return await readDatabaseOfferWithARM(params.databaseId); } diff --git a/src/Common/dataAccess/readDatabases.ts b/src/Common/dataAccess/readDatabases.ts index e5136676e..cd1ae1843 100644 --- a/src/Common/dataAccess/readDatabases.ts +++ b/src/Common/dataAccess/readDatabases.ts @@ -13,7 +13,11 @@ export async function readDatabases(): Promise { let databases: DataModels.Database[]; const clearMessage = logConsoleProgress(`Querying databases`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType !== "Tables") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType !== "Tables" + ) { databases = await readDatabasesWithARM(); } else { const sdkResponse = await client().databases.readAll().fetchAll(); diff --git a/src/Common/dataAccess/readStoredProcedures.ts b/src/Common/dataAccess/readStoredProcedures.ts index 65edb54c2..2e8652933 100644 --- a/src/Common/dataAccess/readStoredProcedures.ts +++ b/src/Common/dataAccess/readStoredProcedures.ts @@ -12,7 +12,11 @@ export async function readStoredProcedures( ): Promise<(StoredProcedureDefinition & Resource)[]> { const clearMessage = logConsoleProgress(`Querying stored procedures for container ${collectionId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { const rpResponse = await listSqlStoredProcedures( userContext.subscriptionId, userContext.resourceGroup, diff --git a/src/Common/dataAccess/readTriggers.ts b/src/Common/dataAccess/readTriggers.ts index 764f3ace1..dd51db372 100644 --- a/src/Common/dataAccess/readTriggers.ts +++ b/src/Common/dataAccess/readTriggers.ts @@ -13,7 +13,11 @@ export async function readTriggers( ): Promise { const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType === "SQL" + ) { const rpResponse = await listSqlTriggers( userContext.subscriptionId, userContext.resourceGroup, diff --git a/src/Common/dataAccess/readUserDefinedFunctions.ts b/src/Common/dataAccess/readUserDefinedFunctions.ts index a55ad0ca6..a103291f9 100644 --- a/src/Common/dataAccess/readUserDefinedFunctions.ts +++ b/src/Common/dataAccess/readUserDefinedFunctions.ts @@ -11,9 +11,9 @@ export async function readUserDefinedFunctions( collectionId: string ): Promise<(UserDefinedFunctionDefinition & Resource)[]> { const clearMessage = logConsoleProgress(`Querying user defined functions for container ${collectionId}`); - const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; + const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; try { - if (authType === AuthType.AAD && !useSDKOperations && apiType === "SQL") { + if (authType === AuthType.AAD && !userContext.features.enableSDKoperations && apiType === "SQL") { const rpResponse = await listSqlUserDefinedFunctions( subscriptionId, resourceGroup, diff --git a/src/Common/dataAccess/updateCollection.ts b/src/Common/dataAccess/updateCollection.ts index 8b4c075e2..5a0006697 100644 --- a/src/Common/dataAccess/updateCollection.ts +++ b/src/Common/dataAccess/updateCollection.ts @@ -33,7 +33,11 @@ export async function updateCollection( const clearMessage = logConsoleProgress(`Updating container ${collectionId}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType !== "Tables") { + if ( + userContext.authType === AuthType.AAD && + !userContext.features.enableSDKoperations && + userContext.apiType !== "Tables" + ) { collection = await updateCollectionWithARM(databaseId, collectionId, newCollection); } else { const sdkResponse = await client() diff --git a/src/Common/dataAccess/updateOffer.ts b/src/Common/dataAccess/updateOffer.ts index 88a3355d5..7f3a26da1 100644 --- a/src/Common/dataAccess/updateOffer.ts +++ b/src/Common/dataAccess/updateOffer.ts @@ -56,7 +56,7 @@ export const updateOffer = async (params: UpdateOfferParams): Promise => const clearMessage = logConsoleProgress(`Updating offer for ${offerResourceText}`); try { - if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations) { + if (userContext.authType === AuthType.AAD && !userContext.features.enableSDKoperations) { if (params.collectionId) { updatedOffer = await updateCollectionOfferWithARM(params); } else if (userContext.apiType === "Tables") { diff --git a/src/Common/dataAccess/updateStoredProcedure.ts b/src/Common/dataAccess/updateStoredProcedure.ts index b3cf875a0..6e6d841e6 100644 --- a/src/Common/dataAccess/updateStoredProcedure.ts +++ b/src/Common/dataAccess/updateStoredProcedure.ts @@ -20,9 +20,9 @@ export async function updateStoredProcedure( ): Promise { const clearMessage = logConsoleProgress(`Updating stored procedure ${storedProcedure.id}`); try { - const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; + const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; - if (authType === AuthType.AAD && !useSDKOperations && apiType === "SQL") { + if (authType === AuthType.AAD && !userContext.features.enableSDKoperations && apiType === "SQL") { const getResponse = await getSqlStoredProcedure( subscriptionId, resourceGroup, diff --git a/src/Common/dataAccess/updateTrigger.ts b/src/Common/dataAccess/updateTrigger.ts index 6d5afb4be..56e27a905 100644 --- a/src/Common/dataAccess/updateTrigger.ts +++ b/src/Common/dataAccess/updateTrigger.ts @@ -13,9 +13,9 @@ export async function updateTrigger( trigger: SqlTriggerResource ): Promise { const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`); - const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; + const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; try { - if (authType === AuthType.AAD && !useSDKOperations && apiType === "SQL") { + if (authType === AuthType.AAD && !userContext.features.enableSDKoperations && apiType === "SQL") { const getResponse = await getSqlTrigger( subscriptionId, resourceGroup, diff --git a/src/Common/dataAccess/updateUserDefinedFunction.ts b/src/Common/dataAccess/updateUserDefinedFunction.ts index f3b28bf51..21780774b 100644 --- a/src/Common/dataAccess/updateUserDefinedFunction.ts +++ b/src/Common/dataAccess/updateUserDefinedFunction.ts @@ -19,9 +19,9 @@ export async function updateUserDefinedFunction( userDefinedFunction: UserDefinedFunctionDefinition ): Promise { const clearMessage = logConsoleProgress(`Updating user defined function ${userDefinedFunction.id}`); - const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; + const { authType, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext; try { - if (authType === AuthType.AAD && !useSDKOperations && apiType === "SQL") { + if (authType === AuthType.AAD && !userContext.features.enableSDKoperations && apiType === "SQL") { const getResponse = await getSqlUserDefinedFunction( subscriptionId, resourceGroup, diff --git a/src/Explorer/ContextMenuButtonFactory.tsx b/src/Explorer/ContextMenuButtonFactory.tsx index 8f85ddbdb..426287068 100644 --- a/src/Explorer/ContextMenuButtonFactory.tsx +++ b/src/Explorer/ContextMenuButtonFactory.tsx @@ -44,7 +44,7 @@ export const createDatabaseContextMenu = (container: Explorer, databaseId: strin }, ]; - if (userContext.apiType !== "Tables") { + if (userContext.apiType !== "Tables" || userContext.features.enableSDKoperations) { items.push({ iconSrc: DeleteDatabaseIcon, onClick: () => diff --git a/src/UserContext.ts b/src/UserContext.ts index 74f14d6a9..873a1dad0 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -36,7 +36,6 @@ interface UserContext { readonly accessToken?: string; readonly authorizationToken?: string; readonly resourceToken?: string; - readonly useSDKOperations: boolean; readonly subscriptionType?: SubscriptionType; readonly quotaId?: string; // API Type is not yet provided by ARM. You need to manually inspect all the capabilities+kind so we abstract that logic in userContext @@ -61,7 +60,6 @@ export type PortalEnv = "localhost" | "blackforest" | "fairfax" | "mooncake" | " const ONE_WEEK_IN_MS = 604800000; const features = extractFeatures(); -const { enableSDKoperations: useSDKOperations } = features; const userContext: UserContext = { apiType: "SQL", @@ -69,7 +67,6 @@ const userContext: UserContext = { isTryCosmosDBSubscription: false, portalEnv: "prod", features, - useSDKOperations, addCollectionFlight: CollectionCreation.DefaultAddCollectionDefaultFlight, subscriptionType: CollectionCreation.DefaultSubscriptionType, collectionCreationDefaults: CollectionCreationDefaults, From c5ef0e608e5dc28a868ca3f43d14bc75ccc1fc73 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:39:40 -0700 Subject: [PATCH 22/22] Fix aggregated query metrics show incorrect number (#1302) --- .../Tabs/QueryTab/QueryTabComponent.tsx | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx index a3146b99d..101cb1dec 100644 --- a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx +++ b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx @@ -600,56 +600,43 @@ export default class QueryTabComponent extends React.Component { if (queryMetrics) { aggregatedMetrics.documentLoadTime = - queryMetrics.documentLoadTime && this._normalize(queryMetrics.documentLoadTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.documentLoadTime); + this._normalize(aggregatedMetrics.documentLoadTime); aggregatedMetrics.documentWriteTime = - queryMetrics.documentWriteTime && this._normalize(queryMetrics.documentWriteTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.documentWriteTime); + this._normalize(aggregatedMetrics.documentWriteTime); aggregatedMetrics.indexHitDocumentCount = - queryMetrics.indexHitDocumentCount && this._normalize(queryMetrics.indexHitDocumentCount) + - this._normalize(aggregatedMetrics.indexHitDocumentCount); + this._normalize(aggregatedMetrics.indexHitDocumentCount); aggregatedMetrics.outputDocumentCount = - queryMetrics.outputDocumentCount && this._normalize(queryMetrics.outputDocumentCount) + this._normalize(aggregatedMetrics.outputDocumentCount); aggregatedMetrics.outputDocumentSize = - queryMetrics.outputDocumentSize && this._normalize(queryMetrics.outputDocumentSize) + this._normalize(aggregatedMetrics.outputDocumentSize); aggregatedMetrics.indexLookupTime = - queryMetrics.indexLookupTime && this._normalize(queryMetrics.indexLookupTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.indexLookupTime); + this._normalize(aggregatedMetrics.indexLookupTime); aggregatedMetrics.retrievedDocumentCount = - queryMetrics.retrievedDocumentCount && this._normalize(queryMetrics.retrievedDocumentCount) + - this._normalize(aggregatedMetrics.retrievedDocumentCount); + this._normalize(aggregatedMetrics.retrievedDocumentCount); aggregatedMetrics.retrievedDocumentSize = - queryMetrics.retrievedDocumentSize && this._normalize(queryMetrics.retrievedDocumentSize) + - this._normalize(aggregatedMetrics.retrievedDocumentSize); + this._normalize(aggregatedMetrics.retrievedDocumentSize); aggregatedMetrics.vmExecutionTime = - queryMetrics.vmExecutionTime && this._normalize(queryMetrics.vmExecutionTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.vmExecutionTime); + this._normalize(aggregatedMetrics.vmExecutionTime); aggregatedMetrics.totalQueryExecutionTime = - queryMetrics.totalQueryExecutionTime && this._normalize(queryMetrics.totalQueryExecutionTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.totalQueryExecutionTime); + this._normalize(aggregatedMetrics.totalQueryExecutionTime); aggregatedMetrics.runtimeExecutionTimes.queryEngineExecutionTime = - aggregatedMetrics.runtimeExecutionTimes && this._normalize(queryMetrics.runtimeExecutionTimes.queryEngineExecutionTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.runtimeExecutionTimes.queryEngineExecutionTime); + this._normalize(aggregatedMetrics.runtimeExecutionTimes.queryEngineExecutionTime); aggregatedMetrics.runtimeExecutionTimes.systemFunctionExecutionTime = - aggregatedMetrics.runtimeExecutionTimes && this._normalize(queryMetrics.runtimeExecutionTimes.systemFunctionExecutionTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.runtimeExecutionTimes.systemFunctionExecutionTime); + this._normalize(aggregatedMetrics.runtimeExecutionTimes.systemFunctionExecutionTime); aggregatedMetrics.runtimeExecutionTimes.userDefinedFunctionExecutionTime = - aggregatedMetrics.runtimeExecutionTimes && this._normalize(queryMetrics.runtimeExecutionTimes.userDefinedFunctionExecutionTime.totalMilliseconds()) + - this._normalize(aggregatedMetrics.runtimeExecutionTimes.userDefinedFunctionExecutionTime); + this._normalize(aggregatedMetrics.runtimeExecutionTimes.userDefinedFunctionExecutionTime); } });