@looker/api-explorer 0.9.22 → 0.9.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/e2e/e2e.spec.ts +1 -1
- package/lib/ApiExplorer.d.ts +4 -43
- package/lib/ApiExplorer.js +71 -93
- package/lib/ApiExplorer.js.map +1 -1
- package/lib/App.d.ts +1 -0
- package/lib/App.js +29 -0
- package/lib/App.js.map +1 -0
- package/lib/StandaloneApiExplorer.js +36 -53
- package/lib/StandaloneApiExplorer.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +8 -0
- package/lib/components/Banner/Banner.js +70 -0
- package/lib/components/Banner/Banner.js.map +1 -0
- package/lib/components/Banner/index.d.ts +1 -0
- package/lib/components/Banner/index.js +14 -0
- package/lib/components/Banner/index.js.map +1 -0
- package/lib/components/DocMarkdown/DocMarkdown.js +5 -5
- package/lib/components/DocMarkdown/DocMarkdown.js.map +1 -1
- package/lib/components/DocSDKs/DocSDKs.js +3 -3
- package/lib/components/DocSDKs/DocSDKs.js.map +1 -1
- package/lib/components/DocSdkUsage/DocSdkUsage.js +3 -6
- package/lib/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/components/DocSource/DocSource.js +5 -7
- package/lib/components/DocSource/DocSource.js.map +1 -1
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.d.ts +1 -1
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +152 -8
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
- package/lib/components/ExploreType/ExploreType.js +3 -5
- package/lib/components/ExploreType/ExploreType.js.map +1 -1
- package/lib/components/Header/Header.d.ts +2 -5
- package/lib/components/Header/Header.js +1 -5
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/SelectorContainer/ApiSpecSelector.d.ts +2 -5
- package/lib/components/SelectorContainer/ApiSpecSelector.js +5 -5
- package/lib/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
- package/lib/components/SelectorContainer/SdkLanguageSelector.js +1 -1
- package/lib/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
- package/lib/components/SelectorContainer/SelectorContainer.d.ts +2 -5
- package/lib/components/SelectorContainer/SelectorContainer.js +3 -7
- package/lib/components/SelectorContainer/SelectorContainer.js.map +1 -1
- package/lib/components/SideNav/SideNav.d.ts +2 -5
- package/lib/components/SideNav/SideNav.js +1 -1
- package/lib/components/SideNav/SideNav.js.map +1 -1
- package/lib/components/common/Loader.d.ts +1 -1
- package/lib/components/common/Loader.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +8 -0
- package/lib/components/index.js.map +1 -1
- package/lib/esm/ApiExplorer.js +71 -92
- package/lib/esm/ApiExplorer.js.map +1 -1
- package/lib/esm/App.js +19 -0
- package/lib/esm/App.js.map +1 -0
- package/lib/esm/StandaloneApiExplorer.js +36 -53
- package/lib/esm/StandaloneApiExplorer.js.map +1 -1
- package/lib/esm/components/Banner/Banner.js +54 -0
- package/lib/esm/components/Banner/Banner.js.map +1 -0
- package/lib/esm/components/Banner/index.js +2 -0
- package/lib/esm/{test-utils/envAdaptor.js.map → components/Banner/index.js.map} +1 -1
- package/lib/esm/components/DocMarkdown/DocMarkdown.js +3 -3
- package/lib/esm/components/DocMarkdown/DocMarkdown.js.map +1 -1
- package/lib/esm/components/DocSDKs/DocSDKs.js +2 -2
- package/lib/esm/components/DocSDKs/DocSDKs.js.map +1 -1
- package/lib/esm/components/DocSdkUsage/DocSdkUsage.js +5 -7
- package/lib/esm/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/esm/components/DocSource/DocSource.js +4 -5
- package/lib/esm/components/DocSource/DocSource.js.map +1 -1
- package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js +153 -6
- package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.js.map +1 -1
- package/lib/esm/components/ExploreType/ExploreType.js +3 -4
- package/lib/esm/components/ExploreType/ExploreType.js.map +1 -1
- package/lib/esm/components/Header/Header.js +1 -5
- package/lib/esm/components/Header/Header.js.map +1 -1
- package/lib/esm/components/SelectorContainer/ApiSpecSelector.js +4 -5
- package/lib/esm/components/SelectorContainer/ApiSpecSelector.js.map +1 -1
- package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js +2 -2
- package/lib/esm/components/SelectorContainer/SdkLanguageSelector.js.map +1 -1
- package/lib/esm/components/SelectorContainer/SelectorContainer.js +3 -7
- package/lib/esm/components/SelectorContainer/SelectorContainer.js.map +1 -1
- package/lib/esm/components/SideNav/SideNav.js +2 -2
- package/lib/esm/components/SideNav/SideNav.js.map +1 -1
- package/lib/esm/components/common/Loader.js.map +1 -1
- package/lib/esm/components/index.js +1 -0
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/index.js +5 -18
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/routes/AppRouter.js +3 -7
- package/lib/esm/routes/AppRouter.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DiffScene.js +43 -99
- package/lib/esm/scenes/DiffScene/DiffScene.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js +9 -13
- package/lib/esm/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js +2 -2
- package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
- package/lib/esm/scenes/MethodScene/MethodScene.js +12 -15
- package/lib/esm/scenes/MethodScene/MethodScene.js.map +1 -1
- package/lib/esm/state/index.js +2 -0
- package/lib/esm/state/index.js.map +1 -1
- package/lib/esm/state/lodes/index.js +3 -0
- package/lib/{test-utils/envAdaptor.js.map → esm/state/lodes/index.js.map} +1 -1
- package/lib/esm/state/lodes/sagas.js +25 -0
- package/lib/esm/state/lodes/sagas.js.map +1 -0
- package/lib/esm/state/lodes/selectors.js +5 -0
- package/lib/esm/state/lodes/selectors.js.map +1 -0
- package/lib/esm/state/lodes/slice.js +30 -0
- package/lib/esm/state/lodes/slice.js.map +1 -0
- package/lib/esm/state/settings/sagas.js +28 -16
- package/lib/esm/state/settings/sagas.js.map +1 -1
- package/lib/esm/state/settings/selectors.js +5 -5
- package/lib/esm/state/settings/selectors.js.map +1 -1
- package/lib/esm/state/settings/slice.js +8 -8
- package/lib/esm/state/settings/slice.js.map +1 -1
- package/lib/esm/state/specs/index.js +3 -0
- package/lib/esm/state/specs/index.js.map +1 -0
- package/lib/esm/state/specs/sagas.js +58 -0
- package/lib/esm/state/specs/sagas.js.map +1 -0
- package/lib/esm/state/specs/selectors.js +8 -0
- package/lib/esm/state/specs/selectors.js.map +1 -0
- package/lib/esm/state/specs/slice.js +55 -0
- package/lib/esm/state/specs/slice.js.map +1 -0
- package/lib/esm/state/store.js +57 -3
- package/lib/esm/state/store.js.map +1 -1
- package/lib/esm/test-utils/index.js +1 -2
- package/lib/esm/test-utils/index.js.map +1 -1
- package/lib/esm/test-utils/lodes.js +12 -0
- package/lib/esm/test-utils/lodes.js.map +1 -0
- package/lib/esm/test-utils/redux.js +16 -9
- package/lib/esm/test-utils/redux.js.map +1 -1
- package/lib/esm/utils/adaptorUtils.js +101 -0
- package/lib/esm/utils/adaptorUtils.js.map +1 -0
- package/lib/esm/utils/apixAdaptor.js +48 -0
- package/lib/esm/utils/apixAdaptor.js.map +1 -0
- package/lib/esm/utils/index.js +3 -2
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/esm/utils/lodeUtils.js +3 -7
- package/lib/esm/utils/lodeUtils.js.map +1 -1
- package/lib/esm/utils/path.js +27 -2
- package/lib/esm/utils/path.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +59 -17
- package/lib/index.js.map +1 -1
- package/lib/routes/AppRouter.d.ts +1 -5
- package/lib/routes/AppRouter.js +3 -7
- package/lib/routes/AppRouter.js.map +1 -1
- package/lib/scenes/DiffScene/DiffScene.js +45 -100
- package/lib/scenes/DiffScene/DiffScene.js.map +1 -1
- package/lib/scenes/DiffScene/DocDiff/DiffItem.js +9 -13
- package/lib/scenes/DiffScene/DocDiff/DiffItem.js.map +1 -1
- package/lib/scenes/DiffScene/DocDiff/DocDiff.js +2 -2
- package/lib/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
- package/lib/scenes/MethodScene/MethodScene.d.ts +0 -4
- package/lib/scenes/MethodScene/MethodScene.js +11 -13
- package/lib/scenes/MethodScene/MethodScene.js.map +1 -1
- package/lib/state/index.d.ts +2 -0
- package/lib/state/index.js +26 -0
- package/lib/state/index.js.map +1 -1
- package/lib/state/lodes/index.d.ts +2 -0
- package/lib/state/lodes/index.js +32 -0
- package/lib/state/lodes/index.js.map +1 -0
- package/lib/state/lodes/sagas.d.ts +1 -0
- package/lib/state/lodes/sagas.js +34 -0
- package/lib/state/lodes/sagas.js.map +1 -0
- package/lib/state/lodes/selectors.d.ts +3 -0
- package/lib/state/lodes/selectors.js +17 -0
- package/lib/state/lodes/selectors.js.map +1 -0
- package/lib/state/lodes/slice.d.ts +29 -0
- package/lib/state/lodes/slice.js +45 -0
- package/lib/state/lodes/slice.js.map +1 -0
- package/lib/state/settings/sagas.js +28 -15
- package/lib/state/settings/sagas.js.map +1 -1
- package/lib/state/settings/selectors.d.ts +1 -1
- package/lib/state/settings/selectors.js +5 -5
- package/lib/state/settings/selectors.js.map +1 -1
- package/lib/state/settings/slice.d.ts +14 -14
- package/lib/state/settings/slice.js +13 -13
- package/lib/state/settings/slice.js.map +1 -1
- package/lib/state/specs/index.d.ts +2 -0
- package/lib/state/specs/index.js +32 -0
- package/lib/state/specs/index.js.map +1 -0
- package/lib/state/specs/sagas.d.ts +1 -0
- package/lib/state/specs/sagas.js +67 -0
- package/lib/state/specs/sagas.js.map +1 -0
- package/lib/state/specs/selectors.d.ts +4 -0
- package/lib/state/specs/selectors.js +20 -0
- package/lib/state/specs/selectors.js.map +1 -0
- package/lib/state/specs/slice.d.ts +49 -0
- package/lib/state/specs/slice.js +70 -0
- package/lib/state/specs/slice.js.map +1 -0
- package/lib/state/store.d.ts +6 -0
- package/lib/state/store.js +60 -2
- package/lib/state/store.js.map +1 -1
- package/lib/test-data/declarations.d.ts +2 -0
- package/lib/test-data/declarations.js +24 -0
- package/lib/test-data/declarations.js.map +1 -0
- package/lib/test-data/examples.d.ts +2 -0
- package/lib/test-data/index.d.ts +3 -0
- package/lib/test-data/index.js +29 -36
- package/lib/test-data/index.js.map +1 -1
- package/lib/test-data/specs.d.ts +10 -0
- package/lib/test-data/specs.js +6 -6
- package/lib/test-data/specs.js.map +1 -1
- package/lib/test-utils/index.d.ts +1 -2
- package/lib/test-utils/index.js +12 -28
- package/lib/test-utils/index.js.map +1 -1
- package/lib/test-utils/lodes.d.ts +4 -0
- package/lib/test-utils/lodes.js +23 -0
- package/lib/test-utils/lodes.js.map +1 -0
- package/lib/test-utils/redux.d.ts +4 -1
- package/lib/test-utils/redux.js +18 -9
- package/lib/test-utils/redux.js.map +1 -1
- package/lib/utils/adaptorUtils.d.ts +30 -0
- package/lib/utils/adaptorUtils.js +124 -0
- package/lib/utils/adaptorUtils.js.map +1 -0
- package/lib/utils/apixAdaptor.d.ts +15 -0
- package/lib/utils/apixAdaptor.js +67 -0
- package/lib/utils/apixAdaptor.js.map +1 -0
- package/lib/utils/index.d.ts +3 -2
- package/lib/utils/index.js +30 -39
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/lodeUtils.d.ts +2 -2
- package/lib/utils/lodeUtils.js +3 -7
- package/lib/utils/lodeUtils.js.map +1 -1
- package/lib/utils/path.d.ts +3 -0
- package/lib/utils/path.js +32 -2
- package/lib/utils/path.js.map +1 -1
- package/package.json +11 -10
- package/public/Looker.3.1.json +1343 -412
- package/public/Looker.4.0.json +3305 -661
- package/src/ApiExplorer.tsx +114 -144
- package/src/{index.tsx → App.tsx} +0 -0
- package/src/StandaloneApiExplorer.tsx +38 -61
- package/src/components/Banner/Banner.spec.tsx +99 -0
- package/src/components/Banner/Banner.tsx +87 -0
- package/src/{reducers → components/Banner}/index.ts +1 -1
- package/src/components/DocMarkdown/DocMarkdown.tsx +3 -3
- package/src/components/DocSDKs/DocSDKs.tsx +4 -5
- package/src/components/DocSdkUsage/DocSdkUsage.spec.tsx +2 -2
- package/src/components/DocSdkUsage/DocSdkUsage.tsx +5 -5
- package/src/components/DocSource/DocSource.tsx +4 -3
- package/src/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.spec.tsx +1 -1
- package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/SomethingWentWrongGraphic.tsx +170 -6
- package/src/components/ExploreType/ExploreType.spec.tsx +0 -23
- package/src/components/ExploreType/ExploreType.tsx +5 -6
- package/src/components/ExploreType/exploreUtils.spec.tsx +1 -1
- package/src/components/Header/Header.spec.tsx +9 -30
- package/src/components/Header/Header.tsx +3 -10
- package/src/components/SelectorContainer/ApiSpecSelector.spec.tsx +31 -44
- package/src/components/SelectorContainer/ApiSpecSelector.tsx +6 -12
- package/src/components/SelectorContainer/SdkLanguageSelector.spec.tsx +3 -5
- package/src/components/SelectorContainer/SdkLanguageSelector.tsx +2 -2
- package/src/components/SelectorContainer/SelectorContainer.spec.tsx +7 -26
- package/src/components/SelectorContainer/SelectorContainer.tsx +4 -10
- package/src/components/SideNav/SideNav.spec.tsx +12 -45
- package/src/components/SideNav/SideNav.tsx +3 -9
- package/src/components/common/Loader.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/{reducers/spec/index.ts → index.ts} +4 -2
- package/src/routes/AppRouter.tsx +26 -37
- package/src/scenes/DiffScene/DiffScene.tsx +47 -84
- package/src/scenes/DiffScene/DocDiff/DiffItem.spec.tsx +9 -16
- package/src/scenes/DiffScene/DocDiff/DiffItem.tsx +11 -12
- package/src/scenes/DiffScene/DocDiff/DocDiff.tsx +2 -2
- package/src/scenes/MethodScene/MethodScene.tsx +12 -18
- package/src/state/index.ts +2 -0
- package/src/{context → state/lodes}/index.ts +2 -1
- package/src/state/lodes/sagas.spec.ts +92 -0
- package/src/state/lodes/sagas.ts +51 -0
- package/src/state/lodes/selectors.spec.ts +42 -0
- package/src/{reducers/spec/actions.spec.ts → state/lodes/selectors.ts} +9 -11
- package/src/{test-utils/render_with_lode.tsx → state/lodes/slice.ts} +37 -37
- package/src/state/settings/sagas.spec.ts +25 -21
- package/src/state/settings/sagas.ts +16 -16
- package/src/state/settings/selectors.spec.ts +1 -5
- package/src/state/settings/selectors.ts +5 -5
- package/src/state/settings/slice.ts +12 -7
- package/src/{context/lode → state/specs}/index.ts +2 -1
- package/src/state/specs/sagas.spec.ts +135 -0
- package/src/state/specs/sagas.ts +81 -0
- package/src/{test-utils/envAdaptor.ts → state/specs/selectors.ts} +10 -4
- package/src/state/specs/slice.ts +109 -0
- package/src/state/store.ts +65 -2
- package/src/{context/lode/LodeContext.ts → test-data/declarations.ts} +17 -14
- package/src/test-data/index.ts +2 -8
- package/src/test-data/specs.ts +6 -6
- package/src/test-utils/index.ts +1 -5
- package/src/{reducers/spec/reducer.spec.ts → test-utils/lodes.tsx} +16 -19
- package/src/test-utils/redux.tsx +31 -8
- package/src/utils/adaptorUtils.ts +181 -0
- package/src/utils/apixAdaptor.ts +72 -0
- package/src/utils/index.ts +3 -8
- package/src/utils/lodeUtils.ts +4 -6
- package/src/utils/path.ts +25 -2
- package/webpack.dev.config.js +3 -0
- package/webpack.prod.config.js +4 -0
- package/lib/context/index.d.ts +0 -1
- package/lib/context/index.js +0 -20
- package/lib/context/index.js.map +0 -1
- package/lib/context/lode/LodeContext.d.ts +0 -9
- package/lib/context/lode/LodeContext.js +0 -21
- package/lib/context/lode/LodeContext.js.map +0 -1
- package/lib/context/lode/index.d.ts +0 -1
- package/lib/context/lode/index.js +0 -20
- package/lib/context/lode/index.js.map +0 -1
- package/lib/esm/context/index.js +0 -2
- package/lib/esm/context/index.js.map +0 -1
- package/lib/esm/context/lode/LodeContext.js +0 -11
- package/lib/esm/context/lode/LodeContext.js.map +0 -1
- package/lib/esm/context/lode/index.js +0 -2
- package/lib/esm/context/lode/index.js.map +0 -1
- package/lib/esm/reducers/index.js +0 -2
- package/lib/esm/reducers/index.js.map +0 -1
- package/lib/esm/reducers/spec/actions.js +0 -19
- package/lib/esm/reducers/spec/actions.js.map +0 -1
- package/lib/esm/reducers/spec/index.js +0 -4
- package/lib/esm/reducers/spec/index.js.map +0 -1
- package/lib/esm/reducers/spec/reducer.js +0 -62
- package/lib/esm/reducers/spec/reducer.js.map +0 -1
- package/lib/esm/reducers/spec/utils.js +0 -74
- package/lib/esm/reducers/spec/utils.js.map +0 -1
- package/lib/esm/test-utils/envAdaptor.js +0 -5
- package/lib/esm/test-utils/render_with_lode.js +0 -19
- package/lib/esm/test-utils/render_with_lode.js.map +0 -1
- package/lib/esm/utils/envAdaptor.js +0 -84
- package/lib/esm/utils/envAdaptor.js.map +0 -1
- package/lib/reducers/index.d.ts +0 -1
- package/lib/reducers/index.js +0 -19
- package/lib/reducers/index.js.map +0 -1
- package/lib/reducers/spec/actions.d.ts +0 -20
- package/lib/reducers/spec/actions.js +0 -31
- package/lib/reducers/spec/actions.js.map +0 -1
- package/lib/reducers/spec/index.d.ts +0 -3
- package/lib/reducers/spec/index.js +0 -45
- package/lib/reducers/spec/index.js.map +0 -1
- package/lib/reducers/spec/reducer.d.ts +0 -7
- package/lib/reducers/spec/reducer.js +0 -73
- package/lib/reducers/spec/reducer.js.map +0 -1
- package/lib/reducers/spec/utils.d.ts +0 -7
- package/lib/reducers/spec/utils.js +0 -91
- package/lib/reducers/spec/utils.js.map +0 -1
- package/lib/test-utils/envAdaptor.d.ts +0 -2
- package/lib/test-utils/envAdaptor.js +0 -15
- package/lib/test-utils/render_with_lode.d.ts +0 -7
- package/lib/test-utils/render_with_lode.js +0 -36
- package/lib/test-utils/render_with_lode.js.map +0 -1
- package/lib/utils/envAdaptor.d.ts +0 -31
- package/lib/utils/envAdaptor.js +0 -106
- package/lib/utils/envAdaptor.js.map +0 -1
- package/src/components/ErrorBoundary/components/SomethingWentWrong/components/SomethingWentWrongGraphic/somethingWentWrong.svg +0 -45
- package/src/reducers/spec/actions.ts +0 -62
- package/src/reducers/spec/reducer.ts +0 -69
- package/src/reducers/spec/utils.spec.ts +0 -138
- package/src/reducers/spec/utils.ts +0 -123
- package/src/utils/envAdaptor.spec.ts +0 -50
- package/src/utils/envAdaptor.ts +0 -147
package/src/utils/lodeUtils.ts
CHANGED
|
@@ -38,17 +38,17 @@ const fetchLode = async (lodeUrl: string) => {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
interface FullLode {
|
|
41
|
-
examples
|
|
41
|
+
examples?: IExampleMine
|
|
42
42
|
declarations?: IDeclarationMine
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export const getLoded = async (
|
|
46
|
-
examplesLodeUrl
|
|
46
|
+
examplesLodeUrl?: string,
|
|
47
47
|
declarationsLodeUrl?: string
|
|
48
48
|
): Promise<FullLode> => {
|
|
49
49
|
// First try to load from the apix-files server
|
|
50
50
|
let examples = await fetchLode(`${apixFilesHost}/examplesIndex.json`)
|
|
51
|
-
if (!examples) {
|
|
51
|
+
if (!examples && examplesLodeUrl) {
|
|
52
52
|
examples = await fetchLode(examplesLodeUrl)
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -57,9 +57,7 @@ export const getLoded = async (
|
|
|
57
57
|
declarations = await fetchLode(declarationsLodeUrl)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const lode: FullLode = {
|
|
61
|
-
examples: { commitHash: '', nuggets: {}, remoteOrigin: '', summaries: {} },
|
|
62
|
-
}
|
|
60
|
+
const lode: FullLode = { examples: undefined, declarations: undefined }
|
|
63
61
|
if (examples) {
|
|
64
62
|
lode.examples = JSON.parse(examples)
|
|
65
63
|
}
|
package/src/utils/path.ts
CHANGED
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import type { ApiModel, IMethod, IType } from '@looker/sdk-codegen'
|
|
28
|
-
import { firstMethodRef
|
|
28
|
+
import { firstMethodRef } from '@looker/sdk-codegen'
|
|
29
|
+
import type { Location as HLocation } from 'history'
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Builds a path matching the route used by MethodScene
|
|
@@ -66,6 +67,12 @@ const getMethodTag = (api: ApiModel, methodName: string) => {
|
|
|
66
67
|
.map(([methodTag]) => methodTag)[0]
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Is this item a method? Check without requiring `instanceof Method`
|
|
72
|
+
* @param item to check for method or type
|
|
73
|
+
*/
|
|
74
|
+
export const isMethod = (item: IMethod | IType) => 'params' in item
|
|
75
|
+
|
|
69
76
|
/**
|
|
70
77
|
* Return the tag for a give type
|
|
71
78
|
* @param api Parsed api
|
|
@@ -89,7 +96,7 @@ export const buildPath = (
|
|
|
89
96
|
specKey: string
|
|
90
97
|
) => {
|
|
91
98
|
let path
|
|
92
|
-
if (item
|
|
99
|
+
if (isMethod(item)) {
|
|
93
100
|
const tag = getMethodTag(api, item.name)
|
|
94
101
|
path = buildMethodPath(specKey, tag, item.name)
|
|
95
102
|
} else {
|
|
@@ -98,3 +105,19 @@ export const buildPath = (
|
|
|
98
105
|
}
|
|
99
106
|
return path
|
|
100
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Determine API specification keys from URL pattern
|
|
111
|
+
* @param location service to examine
|
|
112
|
+
*/
|
|
113
|
+
export const getSpecKey = (location: HLocation | Location): string | null => {
|
|
114
|
+
const pathname = location.pathname
|
|
115
|
+
let match
|
|
116
|
+
if (pathname.startsWith(`/${diffPath}`)) {
|
|
117
|
+
const pattern = new RegExp(`(?:/${diffPath})/(?<specKey>\\w+.\\w+)`)
|
|
118
|
+
match = pathname.match(pattern)
|
|
119
|
+
} else {
|
|
120
|
+
match = pathname.match(/\/(?<specKey>\w+\.\w+).*/)
|
|
121
|
+
}
|
|
122
|
+
return match?.groups?.specKey || null
|
|
123
|
+
}
|
package/webpack.dev.config.js
CHANGED
|
@@ -30,6 +30,9 @@ const base = require('../../webpack.base.config')(__dirname)
|
|
|
30
30
|
const browser = require('../../webpack.browser.config')()
|
|
31
31
|
|
|
32
32
|
module.exports = merge(base, browser, {
|
|
33
|
+
entry: {
|
|
34
|
+
app: path.join(__dirname, 'src/App.tsx'),
|
|
35
|
+
},
|
|
33
36
|
mode: 'development',
|
|
34
37
|
devServer: {
|
|
35
38
|
contentBase: path.join(__dirname, 'public'),
|
package/webpack.prod.config.js
CHANGED
|
@@ -23,10 +23,14 @@
|
|
|
23
23
|
SOFTWARE.
|
|
24
24
|
|
|
25
25
|
*/
|
|
26
|
+
const path = require('path')
|
|
26
27
|
const { merge } = require('webpack-merge')
|
|
27
28
|
const base = require('../../webpack.base.config')(__dirname)
|
|
28
29
|
const browser = require('../../webpack.browser.config')()
|
|
29
30
|
|
|
30
31
|
module.exports = merge(base, browser, {
|
|
32
|
+
entry: {
|
|
33
|
+
app: path.join(__dirname, 'src/index.ts'),
|
|
34
|
+
},
|
|
31
35
|
mode: 'production',
|
|
32
36
|
})
|
package/lib/context/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { LodeContext, defaultLodeContextValue } from './lode';
|
package/lib/context/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "LodeContext", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _lode.LodeContext;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "defaultLodeContextValue", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _lode.defaultLodeContextValue;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _lode = require("./lode");
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/lib/context/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAyBA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { LodeContext, defaultLodeContextValue } from './lode'\n"],"file":"index.js"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen';
|
|
3
|
-
interface LodeContextProps {
|
|
4
|
-
examples: IExampleMine;
|
|
5
|
-
declarations?: IDeclarationMine;
|
|
6
|
-
}
|
|
7
|
-
export declare const defaultLodeContextValue: LodeContextProps;
|
|
8
|
-
export declare const LodeContext: import("react").Context<LodeContextProps>;
|
|
9
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LodeContext = exports.defaultLodeContextValue = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
|
|
10
|
-
var defaultLodeContextValue = {
|
|
11
|
-
examples: {
|
|
12
|
-
commitHash: '',
|
|
13
|
-
remoteOrigin: '',
|
|
14
|
-
nuggets: {},
|
|
15
|
-
summaries: {}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
exports.defaultLodeContextValue = defaultLodeContextValue;
|
|
19
|
-
var LodeContext = (0, _react.createContext)(defaultLodeContextValue);
|
|
20
|
-
exports.LodeContext = LodeContext;
|
|
21
|
-
//# sourceMappingURL=LodeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/lode/LodeContext.ts"],"names":["defaultLodeContextValue","examples","commitHash","remoteOrigin","nuggets","summaries","LodeContext"],"mappings":";;;;;;;AAyBA;;AAQO,IAAMA,uBAAyC,GAAG;AACvDC,EAAAA,QAAQ,EAAE;AAAEC,IAAAA,UAAU,EAAE,EAAd;AAAkBC,IAAAA,YAAY,EAAE,EAAhC;AAAoCC,IAAAA,OAAO,EAAE,EAA7C;AAAiDC,IAAAA,SAAS,EAAE;AAA5D;AAD6C,CAAlD;;AAIA,IAAMC,WAAW,GAAG,0BACzBN,uBADyB,CAApB","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { createContext } from 'react'\nimport type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen'\n\ninterface LodeContextProps {\n examples: IExampleMine\n declarations?: IDeclarationMine\n}\n\nexport const defaultLodeContextValue: LodeContextProps = {\n examples: { commitHash: '', remoteOrigin: '', nuggets: {}, summaries: {} },\n}\n\nexport const LodeContext = createContext<LodeContextProps>(\n defaultLodeContextValue\n)\n"],"file":"LodeContext.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { defaultLodeContextValue, LodeContext } from './LodeContext';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "defaultLodeContextValue", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _LodeContext.defaultLodeContextValue;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "LodeContext", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _LodeContext.LodeContext;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _LodeContext = require("./LodeContext");
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/lode/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAyBA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { defaultLodeContextValue, LodeContext } from './LodeContext'\n"],"file":"index.js"}
|
package/lib/esm/context/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/index.ts"],"names":["LodeContext","defaultLodeContextValue"],"mappings":"AAyBA,SAASA,WAAT,EAAsBC,uBAAtB,QAAqD,QAArD","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { LodeContext, defaultLodeContextValue } from './lode'\n"],"file":"index.js"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
export var defaultLodeContextValue = {
|
|
3
|
-
examples: {
|
|
4
|
-
commitHash: '',
|
|
5
|
-
remoteOrigin: '',
|
|
6
|
-
nuggets: {},
|
|
7
|
-
summaries: {}
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
export var LodeContext = createContext(defaultLodeContextValue);
|
|
11
|
-
//# sourceMappingURL=LodeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/context/lode/LodeContext.ts"],"names":["createContext","defaultLodeContextValue","examples","commitHash","remoteOrigin","nuggets","summaries","LodeContext"],"mappings":"AAyBA,SAASA,aAAT,QAA8B,OAA9B;AAQA,OAAO,IAAMC,uBAAyC,GAAG;AACvDC,EAAAA,QAAQ,EAAE;AAAEC,IAAAA,UAAU,EAAE,EAAd;AAAkBC,IAAAA,YAAY,EAAE,EAAhC;AAAoCC,IAAAA,OAAO,EAAE,EAA7C;AAAiDC,IAAAA,SAAS,EAAE;AAA5D;AAD6C,CAAlD;AAIP,OAAO,IAAMC,WAAW,GAAGP,aAAa,CACtCC,uBADsC,CAAjC","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { createContext } from 'react'\nimport type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen'\n\ninterface LodeContextProps {\n examples: IExampleMine\n declarations?: IDeclarationMine\n}\n\nexport const defaultLodeContextValue: LodeContextProps = {\n examples: { commitHash: '', remoteOrigin: '', nuggets: {}, summaries: {} },\n}\n\nexport const LodeContext = createContext<LodeContextProps>(\n defaultLodeContextValue\n)\n"],"file":"LodeContext.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/context/lode/index.ts"],"names":["defaultLodeContextValue","LodeContext"],"mappings":"AAyBA,SAASA,uBAAT,EAAkCC,WAAlC,QAAqD,eAArD","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { defaultLodeContextValue, LodeContext } from './LodeContext'\n"],"file":"index.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/reducers/index.ts"],"names":[],"mappings":"AAyBA,cAAc,QAAd","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './spec'\n"],"file":"index.js"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export var Actions;
|
|
2
|
-
|
|
3
|
-
(function (Actions) {
|
|
4
|
-
Actions["SELECT_SPEC"] = "SELECT_SPEC";
|
|
5
|
-
Actions["UPDATE_SPEC_API"] = "UPDATE_SPEC_API";
|
|
6
|
-
})(Actions || (Actions = {}));
|
|
7
|
-
|
|
8
|
-
export var selectSpec = specKey => ({
|
|
9
|
-
type: Actions.SELECT_SPEC,
|
|
10
|
-
payload: specKey
|
|
11
|
-
});
|
|
12
|
-
export var updateSpecApi = (specKey, api) => ({
|
|
13
|
-
type: Actions.UPDATE_SPEC_API,
|
|
14
|
-
payload: {
|
|
15
|
-
specKey,
|
|
16
|
-
api
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/reducers/spec/actions.ts"],"names":["Actions","selectSpec","specKey","type","SELECT_SPEC","payload","updateSpecApi","api","UPDATE_SPEC_API"],"mappings":"AA4BA,WAAYA,OAAZ;;WAAYA,O;AAAAA,EAAAA,O;AAAAA,EAAAA,O;GAAAA,O,KAAAA,O;;AAsBZ,OAAO,IAAMC,UAAU,GAAIC,OAAD,KAAwC;AAChEC,EAAAA,IAAI,EAAEH,OAAO,CAACI,WADkD;AAEhEC,EAAAA,OAAO,EAAEH;AAFuD,CAAxC,CAAnB;AAKP,OAAO,IAAMI,aAAa,GAAG,CAC3BJ,OAD2B,EAE3BK,GAF2B,MAGF;AACzBJ,EAAAA,IAAI,EAAEH,OAAO,CAACQ,eADW;AAEzBH,EAAAA,OAAO,EAAE;AAAEH,IAAAA,OAAF;AAAWK,IAAAA;AAAX;AAFgB,CAHE,CAAtB","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ApiModel } from '@looker/sdk-codegen'\n\nexport enum Actions {\n SELECT_SPEC = 'SELECT_SPEC',\n UPDATE_SPEC_API = 'UPDATE_SPEC_API',\n}\n\nexport interface ApiUpdatePayload {\n specKey: string\n api: ApiModel\n}\n\nexport interface UpdateSpecApiAction {\n type: Actions.UPDATE_SPEC_API\n payload: ApiUpdatePayload\n}\n\nexport interface SelectSpecAction {\n type: Actions.SELECT_SPEC\n payload: string\n}\n\nexport type SpecAction = SelectSpecAction | UpdateSpecApiAction\n\nexport const selectSpec = (specKey: string): SelectSpecAction => ({\n type: Actions.SELECT_SPEC,\n payload: specKey,\n})\n\nexport const updateSpecApi = (\n specKey: string,\n api: ApiModel\n): UpdateSpecApiAction => ({\n type: Actions.UPDATE_SPEC_API,\n payload: { specKey, api },\n})\n"],"file":"actions.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/reducers/spec/index.ts"],"names":[],"mappings":"AAyBA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,WAAd","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './utils'\nexport * from './actions'\nexport * from './reducer'\n"],"file":"index.js"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
|
-
import { ApiModel } from '@looker/sdk-codegen';
|
|
8
|
-
import { Actions } from '.';
|
|
9
|
-
export var specReducer = (state, action) => {
|
|
10
|
-
var {
|
|
11
|
-
type,
|
|
12
|
-
payload
|
|
13
|
-
} = action;
|
|
14
|
-
|
|
15
|
-
switch (type) {
|
|
16
|
-
case Actions.UPDATE_SPEC_API:
|
|
17
|
-
{
|
|
18
|
-
var specList = _objectSpread({}, state.specList);
|
|
19
|
-
|
|
20
|
-
var {
|
|
21
|
-
specKey,
|
|
22
|
-
api
|
|
23
|
-
} = payload;
|
|
24
|
-
var spec = specList[specKey];
|
|
25
|
-
|
|
26
|
-
if (spec) {
|
|
27
|
-
spec = _objectSpread(_objectSpread({}, spec), {}, {
|
|
28
|
-
api
|
|
29
|
-
});
|
|
30
|
-
specList[specKey] = spec;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
specList,
|
|
35
|
-
spec
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
case 'SELECT_SPEC':
|
|
40
|
-
{
|
|
41
|
-
var newState = _objectSpread({}, state);
|
|
42
|
-
|
|
43
|
-
var _spec = newState.specList[payload];
|
|
44
|
-
|
|
45
|
-
if (_spec) {
|
|
46
|
-
if (!_spec.api && _spec.specContent) {
|
|
47
|
-
_spec.api = ApiModel.fromJson(_spec.specContent);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
51
|
-
spec: _spec
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return state;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
default:
|
|
59
|
-
return state;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/reducers/spec/reducer.ts"],"names":["ApiModel","Actions","specReducer","state","action","type","payload","UPDATE_SPEC_API","specList","specKey","api","spec","newState","specContent","fromJson"],"mappings":";;;;;;AA2BA,SAASA,QAAT,QAAyB,qBAAzB;AAGA,SAASC,OAAT,QAAwB,GAAxB;AAOA,OAAO,IAAMC,WAAW,GAAG,CACzBC,KADyB,EAEzBC,MAFyB,KAGX;AACd,MAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAoBF,MAA1B;;AACA,UAAQC,IAAR;AACE,SAAKJ,OAAO,CAACM,eAAb;AAA8B;AAC5B,YAAMC,QAAQ,qBAAQL,KAAK,CAACK,QAAd,CAAd;;AACA,YAAM;AAAEC,UAAAA,OAAF;AAAWC,UAAAA;AAAX,YAAmBJ,OAAzB;AACA,YAAIK,IAAI,GAAGH,QAAQ,CAACC,OAAD,CAAnB;;AACA,YAAIE,IAAJ,EAAU;AACRA,UAAAA,IAAI,mCAAQA,IAAR;AAAcD,YAAAA;AAAd,YAAJ;AACAF,UAAAA,QAAQ,CAACC,OAAD,CAAR,GAAoBE,IAApB;AACD;;AACD,eAAO;AAAEH,UAAAA,QAAF;AAAYG,UAAAA;AAAZ,SAAP;AACD;;AACD,SAAK,aAAL;AAAoB;AAClB,YAAMC,QAAQ,qBAAQT,KAAR,CAAd;;AACA,YAAMQ,KAAI,GAAGC,QAAQ,CAACJ,QAAT,CAAkBF,OAAlB,CAAb;;AAEA,YAAIK,KAAJ,EAAU;AACR,cAAI,CAACA,KAAI,CAACD,GAAN,IAAaC,KAAI,CAACE,WAAtB,EAAmC;AACjCF,YAAAA,KAAI,CAACD,GAAL,GAAWV,QAAQ,CAACc,QAAT,CAAkBH,KAAI,CAACE,WAAvB,CAAX;AACD;;AACD,iDAAYV,KAAZ;AAAmBQ,YAAAA,IAAI,EAAJA;AAAnB;AACD;;AACD,eAAOR,KAAP;AACD;;AACD;AACE,aAAOA,KAAP;AAxBJ;AA0BD,CA/BM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { SpecItem, SpecList } from '@looker/sdk-codegen'\nimport { ApiModel } from '@looker/sdk-codegen'\nimport type { ApiUpdatePayload } from './actions'\nimport type { SpecAction } from '.'\nimport { Actions } from '.'\n\nexport interface SpecState {\n specList: SpecList\n spec: SpecItem\n}\n\nexport const specReducer = (\n state: SpecState,\n action: SpecAction\n): SpecState => {\n const { type, payload } = action\n switch (type) {\n case Actions.UPDATE_SPEC_API: {\n const specList = { ...state.specList }\n const { specKey, api } = payload as ApiUpdatePayload\n let spec = specList[specKey]\n if (spec) {\n spec = { ...spec, api }\n specList[specKey] = spec\n }\n return { specList, spec }\n }\n case 'SELECT_SPEC': {\n const newState = { ...state }\n const spec = newState.specList[payload as string]\n // Does extension API Explorer needs this?\n if (spec) {\n if (!spec.api && spec.specContent) {\n spec.api = ApiModel.fromJson(spec.specContent)\n }\n return { ...state, spec }\n }\n return state\n }\n default:\n return state\n }\n}\n"],"file":"reducer.js"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { OAuthSession } from '@looker/sdk-rtl';
|
|
2
|
-
import { diffPath, oAuthPath } from '../../utils';
|
|
3
|
-
export var getDefaultSpecKey = specs => {
|
|
4
|
-
var items = Object.entries(specs);
|
|
5
|
-
|
|
6
|
-
if (items.length === 0) {
|
|
7
|
-
throw Error('No specs found.');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
var specKey = '';
|
|
11
|
-
items.forEach(_ref => {
|
|
12
|
-
var [key, item] = _ref;
|
|
13
|
-
|
|
14
|
-
if (item.isDefault) {
|
|
15
|
-
specKey = key;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
if (!specKey) {
|
|
20
|
-
items.forEach(_ref2 => {
|
|
21
|
-
var [key, item] = _ref2;
|
|
22
|
-
|
|
23
|
-
if (item.status === 'current') {
|
|
24
|
-
specKey = key;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (!specKey) {
|
|
30
|
-
specKey = Object.keys(specs)[0];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!specKey) {
|
|
34
|
-
throw Error('No specs found.');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return specKey;
|
|
38
|
-
};
|
|
39
|
-
export var getSpecKey = (location, specs) => {
|
|
40
|
-
var pathName = location.pathname;
|
|
41
|
-
|
|
42
|
-
if (pathName === "/".concat(oAuthPath)) {
|
|
43
|
-
var returnUrl = sessionStorage.getItem(OAuthSession.returnUrlKey);
|
|
44
|
-
|
|
45
|
-
if (returnUrl) {
|
|
46
|
-
pathName = returnUrl;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var pathNodes = pathName.split('/');
|
|
51
|
-
var specKey = '';
|
|
52
|
-
|
|
53
|
-
if (pathNodes.length > 1 && pathNodes[1] && pathNodes[1] !== oAuthPath && pathNodes[1] !== diffPath) {
|
|
54
|
-
specKey = pathNodes[1];
|
|
55
|
-
} else if (specs) {
|
|
56
|
-
specKey = getDefaultSpecKey(specs);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return specKey;
|
|
60
|
-
};
|
|
61
|
-
export var initDefaultSpecState = (specList, location) => {
|
|
62
|
-
var specKey = getSpecKey(location, specList);
|
|
63
|
-
var spec = specList[specKey];
|
|
64
|
-
|
|
65
|
-
if (!spec) {
|
|
66
|
-
spec = specList['4.0'];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
specList,
|
|
71
|
-
spec
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/reducers/spec/utils.ts"],"names":["OAuthSession","diffPath","oAuthPath","getDefaultSpecKey","specs","items","Object","entries","length","Error","specKey","forEach","key","item","isDefault","status","keys","getSpecKey","location","pathName","pathname","returnUrl","sessionStorage","getItem","returnUrlKey","pathNodes","split","initDefaultSpecState","specList","spec"],"mappings":"AA4BA,SAASA,YAAT,QAA6B,iBAA7B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,aAApC;AAWA,OAAO,IAAMC,iBAAiB,GAAIC,KAAD,IAA6B;AAC5D,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAP,CAAeH,KAAf,CAAd;;AAEA,MAAIC,KAAK,CAACG,MAAN,KAAiB,CAArB,EAAwB;AACtB,UAAMC,KAAK,CAAC,iBAAD,CAAX;AACD;;AAED,MAAIC,OAAO,GAAG,EAAd;AACAL,EAAAA,KAAK,CAACM,OAAN,CAAc,QAAiB;AAAA,QAAhB,CAACC,GAAD,EAAMC,IAAN,CAAgB;;AAC7B,QAAIA,IAAI,CAACC,SAAT,EAAoB;AAClBJ,MAAAA,OAAO,GAAGE,GAAV;AACD;AACF,GAJD;;AAMA,MAAI,CAACF,OAAL,EAAc;AACZL,IAAAA,KAAK,CAACM,OAAN,CAAc,SAAiB;AAAA,UAAhB,CAACC,GAAD,EAAMC,IAAN,CAAgB;;AAC7B,UAAIA,IAAI,CAACE,MAAL,KAAgB,SAApB,EAA+B;AAC7BL,QAAAA,OAAO,GAAGE,GAAV;AACD;AACF,KAJD;AAKD;;AAED,MAAI,CAACF,OAAL,EAAc;AACZA,IAAAA,OAAO,GAAGJ,MAAM,CAACU,IAAP,CAAYZ,KAAZ,EAAmB,CAAnB,CAAV;AACD;;AAED,MAAI,CAACM,OAAL,EAAc;AACZ,UAAMD,KAAK,CAAC,iBAAD,CAAX;AACD;;AAED,SAAOC,OAAP;AACD,CA/BM;AAsCP,OAAO,IAAMO,UAAU,GAAG,CAACC,QAAD,EAA6Bd,KAA7B,KAAkD;AAC1E,MAAIe,QAAQ,GAAGD,QAAQ,CAACE,QAAxB;;AACA,MAAID,QAAQ,gBAASjB,SAAT,CAAZ,EAAkC;AAChC,QAAMmB,SAAS,GAAGC,cAAc,CAACC,OAAf,CAAuBvB,YAAY,CAACwB,YAApC,CAAlB;;AACA,QAAIH,SAAJ,EAAe;AACbF,MAAAA,QAAQ,GAAGE,SAAX;AACD;AACF;;AACD,MAAMI,SAAS,GAAGN,QAAQ,CAACO,KAAT,CAAe,GAAf,CAAlB;AACA,MAAIhB,OAAO,GAAG,EAAd;;AACA,MACEe,SAAS,CAACjB,MAAV,GAAmB,CAAnB,IACAiB,SAAS,CAAC,CAAD,CADT,IAEAA,SAAS,CAAC,CAAD,CAAT,KAAiBvB,SAFjB,IAGAuB,SAAS,CAAC,CAAD,CAAT,KAAiBxB,QAJnB,EAKE;AACAS,IAAAA,OAAO,GAAGe,SAAS,CAAC,CAAD,CAAnB;AACD,GAPD,MAOO,IAAIrB,KAAJ,EAAW;AAChBM,IAAAA,OAAO,GAAGP,iBAAiB,CAACC,KAAD,CAA3B;AACD;;AACD,SAAOM,OAAP;AACD,CArBM;AA8BP,OAAO,IAAMiB,oBAAoB,GAAG,CAClCC,QADkC,EAElCV,QAFkC,KAGpB;AACd,MAAMR,OAAO,GAAGO,UAAU,CAACC,QAAD,EAAWU,QAAX,CAA1B;AAEA,MAAIC,IAAI,GAAGD,QAAQ,CAAClB,OAAD,CAAnB;;AACA,MAAI,CAACmB,IAAL,EAAW;AACTA,IAAAA,IAAI,GAAGD,QAAQ,CAAC,KAAD,CAAf;AACD;;AACD,SAAO;AACLA,IAAAA,QADK;AAELC,IAAAA;AAFK,GAAP;AAID,CAdM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { SpecList } from '@looker/sdk-codegen'\nimport type { Location as HLocation } from 'history'\nimport { OAuthSession } from '@looker/sdk-rtl'\nimport { diffPath, oAuthPath } from '../../utils'\nimport type { SpecState } from './reducer'\n\nexport type AbstractLocation = HLocation | Location\n\n/**\n * Given a collection of specs, it returns the spec marked as default, the one\n * marked as current or the first one, in that order.\n * @param specs A collection of specs\n * @returns A spec\n */\nexport const getDefaultSpecKey = (specs: SpecList): string => {\n const items = Object.entries(specs)\n\n if (items.length === 0) {\n throw Error('No specs found.')\n }\n\n let specKey = ''\n items.forEach(([key, item]) => {\n if (item.isDefault) {\n specKey = key\n }\n })\n\n if (!specKey) {\n items.forEach(([key, item]) => {\n if (item.status === 'current') {\n specKey = key\n }\n })\n }\n\n if (!specKey) {\n specKey = Object.keys(specs)[0]\n }\n\n if (!specKey) {\n throw Error('No specs found.')\n }\n\n return specKey\n}\n\n/**\n * Determine the API specification key from URL pattern or default spec\n * @param location service to examine\n * @param specs to use to find the default spec key\n */\nexport const getSpecKey = (location: AbstractLocation, specs?: SpecList) => {\n let pathName = location.pathname\n if (pathName === `/${oAuthPath}`) {\n const returnUrl = sessionStorage.getItem(OAuthSession.returnUrlKey)\n if (returnUrl) {\n pathName = returnUrl\n }\n }\n const pathNodes = pathName.split('/')\n let specKey = ''\n if (\n pathNodes.length > 1 &&\n pathNodes[1] &&\n pathNodes[1] !== oAuthPath &&\n pathNodes[1] !== diffPath\n ) {\n specKey = pathNodes[1]\n } else if (specs) {\n specKey = getDefaultSpecKey(specs)\n }\n return specKey\n}\n\n/**\n * Creates a default state object with the spec matching the specKey defined\n * in the url or the default criteria in getDefaultSpecKey\n * @param specList A collection of specs\n * @param location Standalone or extension location\n * @returns An object to be used as default state\n */\nexport const initDefaultSpecState = (\n specList: SpecList,\n location: AbstractLocation\n): SpecState => {\n const specKey = getSpecKey(location, specList)\n // Handle bad spec in the URL. Fall back to 4.0\n let spec = specList[specKey]\n if (!spec) {\n spec = specList['4.0']\n }\n return {\n specList,\n spec,\n }\n}\n"],"file":"utils.js"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderWithTheme } from '@looker/components-test-utils';
|
|
3
|
-
import { LodeContext } from '../context';
|
|
4
|
-
import { withReduxProvider } from './redux';
|
|
5
|
-
|
|
6
|
-
var withLode = (consumer, examples, declarations) => {
|
|
7
|
-
return React.createElement(LodeContext.Provider, {
|
|
8
|
-
value: {
|
|
9
|
-
examples,
|
|
10
|
-
declarations
|
|
11
|
-
}
|
|
12
|
-
}, consumer);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export var renderWithLode = (component, examples, declarations, options) => {
|
|
16
|
-
return renderWithTheme(withLode(component, examples, declarations), options);
|
|
17
|
-
};
|
|
18
|
-
export var renderWithReduxProviderAndLode = (component, examples, declarations, store, options) => renderWithTheme(withReduxProvider(withLode(component, examples, declarations), store), options);
|
|
19
|
-
//# sourceMappingURL=render_with_lode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/test-utils/render_with_lode.tsx"],"names":["React","renderWithTheme","LodeContext","withReduxProvider","withLode","consumer","examples","declarations","renderWithLode","component","options","renderWithReduxProviderAndLode","store"],"mappings":"AA2BA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,SAASC,eAAT,QAAgC,+BAAhC;AAEA,SAASC,WAAT,QAA4B,YAA5B;AAEA,SAASC,iBAAT,QAAkC,SAAlC;;AAEA,IAAMC,QAAQ,GAAG,CACfC,QADe,EAEfC,QAFe,EAGfC,YAHe,KAIZ;AACH,SACE,oBAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAE;AAAED,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AAA7B,KACGF,QADH,CADF;AAKD,CAVD;;AAYA,OAAO,IAAMG,cAAc,GAAG,CAC5BC,SAD4B,EAE5BH,QAF4B,EAG5BC,YAH4B,EAI5BG,OAJ4B,KAKzB;AACH,SAAOT,eAAe,CAACG,QAAQ,CAACK,SAAD,EAAYH,QAAZ,EAAsBC,YAAtB,CAAT,EAA8CG,OAA9C,CAAtB;AACD,CAPM;AASP,OAAO,IAAMC,8BAA8B,GAAG,CAC5CF,SAD4C,EAE5CH,QAF4C,EAG5CC,YAH4C,EAI5CK,KAJ4C,EAK5CF,OAL4C,KAO5CT,eAAe,CACbE,iBAAiB,CAACC,QAAQ,CAACK,SAAD,EAAYH,QAAZ,EAAsBC,YAAtB,CAAT,EAA8CK,KAA9C,CADJ,EAEbF,OAFa,CAPV","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ReactElement } from 'react'\nimport React from 'react'\nimport type { RenderOptions } from '@testing-library/react'\nimport type { Store } from 'redux'\n\nimport { renderWithTheme } from '@looker/components-test-utils'\nimport type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen'\nimport { LodeContext } from '../context'\nimport type { RootState } from '../state'\nimport { withReduxProvider } from './redux'\n\nconst withLode = (\n consumer: ReactElement<any>,\n examples: IExampleMine,\n declarations?: IDeclarationMine\n) => {\n return (\n <LodeContext.Provider value={{ examples, declarations }}>\n {consumer}\n </LodeContext.Provider>\n )\n}\n\nexport const renderWithLode = (\n component: ReactElement<any>,\n examples: IExampleMine,\n declarations?: IDeclarationMine,\n options?: Omit<RenderOptions, 'queries'>\n) => {\n return renderWithTheme(withLode(component, examples, declarations), options)\n}\n\nexport const renderWithReduxProviderAndLode = (\n component: ReactElement<any>,\n examples: IExampleMine,\n declarations?: IDeclarationMine,\n store?: Store<RootState>,\n options?: Omit<RenderOptions, 'queries'>\n) =>\n renderWithTheme(\n withReduxProvider(withLode(component, examples, declarations), store),\n options\n )\n"],"file":"render_with_lode.js"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
-
|
|
3
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
|
-
export var getThemeOverrides = useGoogleFonts => useGoogleFonts ? {
|
|
8
|
-
loadGoogleFonts: true,
|
|
9
|
-
themeCustomizations: {
|
|
10
|
-
fontFamilies: {
|
|
11
|
-
brand: 'Google Sans'
|
|
12
|
-
},
|
|
13
|
-
colors: {
|
|
14
|
-
key: '#1A73E8'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
} : {
|
|
18
|
-
themeCustomizations: {
|
|
19
|
-
colors: {
|
|
20
|
-
key: '#1A73E8'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export class StandaloneEnvAdaptor {
|
|
25
|
-
constructor() {
|
|
26
|
-
_defineProperty(this, "_themeOverrides", void 0);
|
|
27
|
-
|
|
28
|
-
var {
|
|
29
|
-
hostname
|
|
30
|
-
} = location;
|
|
31
|
-
this._themeOverrides = getThemeOverrides(hostname.endsWith('.looker.com') || hostname.endsWith('.google.com') || hostname === 'localhost' || hostname.startsWith('looker-developer-portal') && hostname.endsWith('.web.app'));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
localStorageGetItem(key) {
|
|
35
|
-
return _asyncToGenerator(function* () {
|
|
36
|
-
return localStorage.getItem(key);
|
|
37
|
-
})();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
localStorageSetItem(key, value) {
|
|
41
|
-
return _asyncToGenerator(function* () {
|
|
42
|
-
yield localStorage.setItem(key, value);
|
|
43
|
-
})();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
localStorageRemoveItem(key) {
|
|
47
|
-
return _asyncToGenerator(function* () {
|
|
48
|
-
yield localStorage.removeItem(key);
|
|
49
|
-
})();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
themeOverrides() {
|
|
53
|
-
return this._themeOverrides;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
openBrowserWindow(url, target) {
|
|
57
|
-
window.open(url, target);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
logError(_error, _componentStack) {}
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
export var EnvAdaptorConstants;
|
|
64
|
-
|
|
65
|
-
(function (EnvAdaptorConstants) {
|
|
66
|
-
EnvAdaptorConstants["LOCALSTORAGE_SDK_LANGUAGE_KEY"] = "sdkLanguage";
|
|
67
|
-
EnvAdaptorConstants["LOCALSTORAGE_SETTINGS_KEY"] = "settings";
|
|
68
|
-
})(EnvAdaptorConstants || (EnvAdaptorConstants = {}));
|
|
69
|
-
|
|
70
|
-
var envAdaptor;
|
|
71
|
-
export var registerEnvAdaptor = adaptor => {
|
|
72
|
-
envAdaptor = adaptor;
|
|
73
|
-
};
|
|
74
|
-
export var unregisterEnvAdaptor = () => {
|
|
75
|
-
envAdaptor = undefined;
|
|
76
|
-
};
|
|
77
|
-
export var getEnvAdaptor = () => {
|
|
78
|
-
if (!envAdaptor) {
|
|
79
|
-
throw new Error('Environment adaptor not initialized.');
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return envAdaptor;
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=envAdaptor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/envAdaptor.ts"],"names":["getThemeOverrides","useGoogleFonts","loadGoogleFonts","themeCustomizations","fontFamilies","brand","colors","key","StandaloneEnvAdaptor","constructor","hostname","location","_themeOverrides","endsWith","startsWith","localStorageGetItem","localStorage","getItem","localStorageSetItem","value","setItem","localStorageRemoveItem","removeItem","themeOverrides","openBrowserWindow","url","target","window","open","logError","_error","_componentStack","EnvAdaptorConstants","envAdaptor","registerEnvAdaptor","adaptor","unregisterEnvAdaptor","undefined","getEnvAdaptor","Error"],"mappings":";;;;;;AAyDA,OAAO,IAAMA,iBAAiB,GAAIC,cAAD,IAC/BA,cAAc,GACV;AACEC,EAAAA,eAAe,EAAE,IADnB;AAEEC,EAAAA,mBAAmB,EAAE;AACnBC,IAAAA,YAAY,EAAE;AAAEC,MAAAA,KAAK,EAAE;AAAT,KADK;AAEnBC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,GAAG,EAAE;AAAP;AAFW;AAFvB,CADU,GAQV;AACEJ,EAAAA,mBAAmB,EAAE;AACnBG,IAAAA,MAAM,EAAE;AAAEC,MAAAA,GAAG,EAAE;AAAP;AADW;AADvB,CATC;AAkBP,OAAO,MAAMC,oBAAN,CAAsD;AAG3DC,EAAAA,WAAW,GAAG;AAAA;;AACZ,QAAM;AAAEC,MAAAA;AAAF,QAAeC,QAArB;AACA,SAAKC,eAAL,GAAuBZ,iBAAiB,CACtCU,QAAQ,CAACG,QAAT,CAAkB,aAAlB,KACEH,QAAQ,CAACG,QAAT,CAAkB,aAAlB,CADF,IAEEH,QAAQ,KAAK,WAFf,IAMGA,QAAQ,CAACI,UAAT,CAAoB,yBAApB,KACCJ,QAAQ,CAACG,QAAT,CAAkB,UAAlB,CARkC,CAAxC;AAUD;;AAEKE,EAAAA,mBAAmB,CAACR,GAAD,EAAc;AAAA;AACrC,aAAOS,YAAY,CAACC,OAAb,CAAqBV,GAArB,CAAP;AADqC;AAEtC;;AAEKW,EAAAA,mBAAmB,CAACX,GAAD,EAAcY,KAAd,EAA6B;AAAA;AACpD,YAAMH,YAAY,CAACI,OAAb,CAAqBb,GAArB,EAA0BY,KAA1B,CAAN;AADoD;AAErD;;AAEKE,EAAAA,sBAAsB,CAACd,GAAD,EAAc;AAAA;AACxC,YAAMS,YAAY,CAACM,UAAb,CAAwBf,GAAxB,CAAN;AADwC;AAEzC;;AAEDgB,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKX,eAAZ;AACD;;AAEDY,EAAAA,iBAAiB,CAACC,GAAD,EAAcC,MAAd,EAA+B;AAC9CC,IAAAA,MAAM,CAACC,IAAP,CAAYH,GAAZ,EAAiBC,MAAjB;AACD;;AAEDG,EAAAA,QAAQ,CAACC,MAAD,EAAgBC,eAAhB,EAA+C,CAEtD;;AAvC0D;AA0C7D,WAAYC,mBAAZ;;WAAYA,mB;AAAAA,EAAAA,mB;AAAAA,EAAAA,mB;GAAAA,mB,KAAAA,mB;;AAKZ,IAAIC,UAAJ;AAKA,OAAO,IAAMC,kBAAkB,GAAIC,OAAD,IAA8B;AAC9DF,EAAAA,UAAU,GAAGE,OAAb;AACD,CAFM;AAOP,OAAO,IAAMC,oBAAoB,GAAG,MAAM;AACxCH,EAAAA,UAAU,GAAGI,SAAb;AACD,CAFM;AAOP,OAAO,IAAMC,aAAa,GAAG,MAAM;AACjC,MAAI,CAACL,UAAL,EAAiB;AACf,UAAM,IAAIM,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACD,SAAON,UAAP;AACD,CALM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ThemeCustomizations } from '@looker/design-tokens'\n\n/**\n * NOTE: This interface should describe all methods that require an adaptor when running in standalone vs extension mode\n * Examples include: local storage operations, writing to clipboard and various link navigation functions amongst others\n */\nexport interface IApixEnvAdaptor {\n /** Method for retrieving a keyed value from local storage */\n localStorageGetItem(key: string): Promise<string | null>\n /** Method for setting a keyed value in local storage */\n localStorageSetItem(key: string, value: string): void\n /** Method for removing a keyed value from local storage */\n localStorageRemoveItem(key: string): void\n /** Theme settings for extension */\n themeOverrides(): ThemeOverrides\n /** Open a new browser window with the given url and target */\n openBrowserWindow: (url: string, target?: string) => void\n /** error logger */\n logError: (error: Error, componentStack: string) => void\n}\n\n/**\n * Theme overrides used to load google fonts in Google environments only.\n * Google fonts should NOT be used when it is not obvious that a Google\n * system is being used (for example an embedded extension).\n */\nexport interface ThemeOverrides {\n loadGoogleFonts?: boolean\n themeCustomizations?: ThemeCustomizations\n}\n\nexport const getThemeOverrides = (useGoogleFonts: boolean): ThemeOverrides =>\n useGoogleFonts\n ? {\n loadGoogleFonts: true,\n themeCustomizations: {\n fontFamilies: { brand: 'Google Sans' },\n colors: { key: '#1A73E8' },\n },\n }\n : {\n themeCustomizations: {\n colors: { key: '#1A73E8' },\n },\n }\n\n/**\n * An adaptor class for interacting with browser APIs when running in standalone mode\n */\nexport class StandaloneEnvAdaptor implements IApixEnvAdaptor {\n private _themeOverrides: ThemeOverrides\n\n constructor() {\n const { hostname } = location\n this._themeOverrides = getThemeOverrides(\n hostname.endsWith('.looker.com') ||\n hostname.endsWith('.google.com') ||\n hostname === 'localhost' ||\n // Include firebase staging dev portal for now. Can be removed\n // when dev portal gets its own APIX project. Also includes\n // PRs.\n (hostname.startsWith('looker-developer-portal') &&\n hostname.endsWith('.web.app'))\n )\n }\n\n async localStorageGetItem(key: string) {\n return localStorage.getItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await localStorage.setItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await localStorage.removeItem(key)\n }\n\n themeOverrides() {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n window.open(url, target)\n }\n\n logError(_error: Error, _componentStack: string): void {\n // noop - error logging for standalone APIX TBD\n }\n}\n\nexport enum EnvAdaptorConstants {\n LOCALSTORAGE_SDK_LANGUAGE_KEY = 'sdkLanguage',\n LOCALSTORAGE_SETTINGS_KEY = 'settings',\n}\n\nlet envAdaptor: IApixEnvAdaptor | undefined\n\n/**\n * Register the environment adaptor. The API Explorer will automatically call this.\n */\nexport const registerEnvAdaptor = (adaptor: IApixEnvAdaptor) => {\n envAdaptor = adaptor\n}\n\n/**\n * Unregister the envAdaptor. The API Explorer will automatically call this when it is unmounted.\n */\nexport const unregisterEnvAdaptor = () => {\n envAdaptor = undefined\n}\n\n/**\n * Global access to the envAdaptor. An error will be thrown if accessed prematurely.\n */\nexport const getEnvAdaptor = () => {\n if (!envAdaptor) {\n throw new Error('Environment adaptor not initialized.')\n }\n return envAdaptor\n}\n"],"file":"envAdaptor.js"}
|
package/lib/reducers/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './spec';
|
package/lib/reducers/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _spec = require("./spec");
|
|
8
|
-
|
|
9
|
-
Object.keys(_spec).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _spec[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _spec[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/reducers/index.ts"],"names":[],"mappings":";;;;;;AAyBA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './spec'\n"],"file":"index.js"}
|