@looker/api-explorer 0.9.64 → 0.9.67
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 +57 -0
- package/e2e/diffScene.spec.ts +16 -16
- package/e2e/e2e.spec.ts +4 -4
- package/e2e/helpers.ts +1 -1
- package/lib/ApiExplorer.js.map +1 -1
- package/lib/components/DocSdkUsage/DocSdkExampleCell.js.map +1 -1
- package/lib/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/components/DocSdkUsage/utils.js.map +1 -1
- package/lib/components/DocTitle/DocTitle.js.map +1 -1
- package/lib/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.js.map +1 -1
- package/lib/components/ExploreType/ExploreProperty.js.map +1 -1
- package/lib/components/ExploreType/ExploreType.js.map +1 -1
- package/lib/components/SideNav/SideNavMethodTags.js.map +1 -1
- package/lib/components/SideNav/SideNavMethods.js.map +1 -1
- package/lib/components/SideNav/SideNavTypeTags.js.map +1 -1
- package/lib/components/SideNav/SideNavTypes.js.map +1 -1
- package/lib/components/SideNav/searchUtils.js.map +1 -1
- package/lib/esm/ApiExplorer.js.map +1 -1
- package/lib/esm/components/DocSdkUsage/DocSdkExampleCell.js.map +1 -1
- package/lib/esm/components/DocSdkUsage/DocSdkUsage.js.map +1 -1
- package/lib/esm/components/DocSdkUsage/utils.js.map +1 -1
- package/lib/esm/components/DocTitle/DocTitle.js.map +1 -1
- package/lib/esm/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.js.map +1 -1
- package/lib/esm/components/ExploreType/ExploreProperty.js.map +1 -1
- package/lib/esm/components/ExploreType/ExploreType.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavMethodTags.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavMethods.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavTypeTags.js.map +1 -1
- package/lib/esm/components/SideNav/SideNavTypes.js.map +1 -1
- package/lib/esm/components/SideNav/searchUtils.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DiffScene.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
- package/lib/esm/scenes/DiffScene/DocDiff/docDiffUtils.js.map +1 -1
- package/lib/esm/scenes/DiffScene/diffUtils.js.map +1 -1
- package/lib/esm/scenes/ErrorDetailScene/ErrorDetailScene.js.map +1 -1
- package/lib/esm/scenes/MethodScene/components/DocRequestBody.js.map +1 -1
- package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponseTypes.js.map +1 -1
- package/lib/esm/scenes/MethodScene/components/DocResponses/DocResponses.js.map +1 -1
- package/lib/esm/scenes/MethodScene/components/DocResponses/utils.js.map +1 -1
- package/lib/esm/scenes/MethodTagScene/MethodTagScene.js.map +1 -1
- package/lib/esm/scenes/MethodTagScene/utils.js.map +1 -1
- package/lib/esm/scenes/TypeTagScene/TypeTagScene.js.map +1 -1
- package/lib/esm/scenes/TypeTagScene/utils.js.map +1 -1
- package/lib/esm/state/specs/sagas.js.map +1 -1
- package/lib/esm/state/store.js.map +1 -1
- package/lib/esm/utils/apixAdaptor.js.map +1 -1
- package/lib/esm/utils/hooks/navigation.js.map +1 -1
- package/lib/esm/utils/sdkLanguage.js.map +1 -1
- package/lib/scenes/DiffScene/DiffScene.js.map +1 -1
- package/lib/scenes/DiffScene/DocDiff/DocDiff.js.map +1 -1
- package/lib/scenes/DiffScene/DocDiff/docDiffUtils.js.map +1 -1
- package/lib/scenes/DiffScene/diffUtils.js.map +1 -1
- package/lib/scenes/ErrorDetailScene/ErrorDetailScene.js.map +1 -1
- package/lib/scenes/MethodScene/components/DocRequestBody.js.map +1 -1
- package/lib/scenes/MethodScene/components/DocResponses/DocResponseTypes.js.map +1 -1
- package/lib/scenes/MethodScene/components/DocResponses/DocResponses.js.map +1 -1
- package/lib/scenes/MethodScene/components/DocResponses/utils.js.map +1 -1
- package/lib/scenes/MethodTagScene/MethodTagScene.js.map +1 -1
- package/lib/scenes/MethodTagScene/utils.js.map +1 -1
- package/lib/scenes/TypeTagScene/TypeTagScene.js.map +1 -1
- package/lib/scenes/TypeTagScene/utils.js.map +1 -1
- package/lib/state/lodes/slice.d.ts +5 -1
- package/lib/state/settings/slice.d.ts +9 -2
- package/lib/state/specs/sagas.js.map +1 -1
- package/lib/state/specs/slice.d.ts +8 -1
- package/lib/state/store.js.map +1 -1
- package/lib/test-utils/lodes.d.ts +1 -1
- package/lib/test-utils/redux.d.ts +2 -2
- package/lib/test-utils/router.d.ts +1 -1
- package/lib/utils/apixAdaptor.js.map +1 -1
- package/lib/utils/hooks/navigation.js.map +1 -1
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/sdkLanguage.js.map +1 -1
- package/package.json +10 -10
- package/src/ApiExplorer.tsx +1 -1
- package/src/components/DocMarkdown/utils.spec.ts +2 -2
- package/src/components/DocPseudo/DocParam.spec.tsx +2 -2
- package/src/components/DocPseudo/DocParams.spec.tsx +2 -2
- package/src/components/DocPseudo/DocPseudo.spec.tsx +1 -1
- package/src/components/DocSDKs/DocSDKs.spec.tsx +2 -2
- package/src/components/DocSdkUsage/DocSdkExampleCell.tsx +1 -1
- package/src/components/DocSdkUsage/DocSdkUsage.tsx +1 -1
- package/src/components/DocSdkUsage/utils.ts +3 -2
- package/src/components/DocTitle/DocTitle.tsx +1 -1
- package/src/components/ErrorBoundary/components/SomethingWentWrong/SomethingWentWrong.tsx +11 -11
- package/src/components/ExploreType/ExploreProperty.tsx +2 -2
- package/src/components/ExploreType/ExploreType.tsx +1 -1
- package/src/components/SelectorContainer/SdkLanguageSelector.spec.tsx +3 -3
- package/src/components/SideNav/SideNavMethodTags.tsx +1 -1
- package/src/components/SideNav/SideNavMethods.spec.tsx +1 -1
- package/src/components/SideNav/SideNavMethods.tsx +1 -1
- package/src/components/SideNav/SideNavTypeTags.tsx +1 -1
- package/src/components/SideNav/SideNavTypes.tsx +1 -1
- package/src/components/SideNav/searchUtils.ts +1 -1
- package/src/scenes/DiffScene/DiffScene.tsx +2 -2
- package/src/scenes/DiffScene/DocDiff/DocDiff.tsx +2 -2
- package/src/scenes/DiffScene/DocDiff/docDiffUtils.tsx +2 -2
- package/src/scenes/DiffScene/diffUtils.ts +1 -1
- package/src/scenes/ErrorDetailScene/ErrorDetailScene.tsx +1 -1
- package/src/scenes/MethodScene/components/DocOperation.spec.tsx +1 -1
- package/src/scenes/MethodScene/components/DocRequestBody.tsx +1 -1
- package/src/scenes/MethodScene/components/DocResponses/DocResponseTypes.tsx +1 -1
- package/src/scenes/MethodScene/components/DocResponses/DocResponses.tsx +1 -1
- package/src/scenes/MethodScene/components/DocResponses/utils.spec.ts +1 -1
- package/src/scenes/MethodScene/components/DocResponses/utils.ts +1 -1
- package/src/scenes/MethodTagScene/MethodTagScene.tsx +2 -2
- package/src/scenes/MethodTagScene/utils.ts +1 -1
- package/src/scenes/TypeTagScene/TypeTagScene.tsx +2 -4
- package/src/scenes/TypeTagScene/utils.ts +1 -1
- package/src/state/specs/sagas.ts +1 -1
- package/src/state/store.ts +1 -1
- package/src/utils/apixAdaptor.ts +1 -4
- package/src/utils/hooks/navigation.ts +1 -1
- package/src/utils/path.spec.ts +5 -5
- package/src/utils/sdkLanguage.spec.ts +1 -1
- package/src/utils/sdkLanguage.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeTagScene.js","names":["_react","_interopRequireWildcard","require","_components","_reactRouterDom","_reactRedux","_components2","_utils","_state","_utils2","_utils3","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","TypeTagScene","_ref","api","specKey","typeTag","useParams","location","useLocation","navigate","buildPathWithGlobalParams","navigateWithGlobalParams","useNavigation","selectedTagFilter","useSelector","selectTagFilter","setTagFilterAction","useSettingActions","tagFilter","setTagFilter","useState","useTagStoreSync","handleChange","filter","pathname","toLowerCase","useEffect","searchParams","URLSearchParams","search","verbParam","isValidFilter","toUpperCase","types","typeTags","concat","createElement","Fragment","tag","values","spec","tags","find","name","metaTypes","getMetaTypes","ApixSection","DocTitle","description","ButtonToggle","mb","mt","value","onChange","ButtonItem","key","px","py","map","op","type","index","metaType","toString","Link","to","buildTypePath","Grid","columns","DocTypeSummary","exports"],"sources":["../../../src/scenes/TypeTagScene/TypeTagScene.tsx"],"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 type { FC } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport { ButtonItem, ButtonToggle, Grid } from '@looker/components';\nimport type { ApiModel } from '@looker/sdk-codegen';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { useSelector } from 'react-redux';\nimport { ApixSection, DocTitle, DocTypeSummary, Link } from '../../components';\nimport { buildTypePath, isValidFilter, useNavigation } from '../../utils';\nimport { selectTagFilter, useSettingActions } from '../../state';\nimport { useTagStoreSync } from '../utils';\nimport { getMetaTypes } from './utils';\n\ninterface TypeTagSceneProps {\n api: ApiModel;\n}\n\ninterface TypeTagSceneParams {\n specKey: string;\n typeTag: string;\n}\n\nexport const TypeTagScene: FC<TypeTagSceneProps> = ({ api }) => {\n const { specKey, typeTag } = useParams<TypeTagSceneParams>();\n const location = useLocation();\n const { navigate, buildPathWithGlobalParams, navigateWithGlobalParams } =\n useNavigation();\n const selectedTagFilter = useSelector(selectTagFilter);\n const { setTagFilterAction } = useSettingActions();\n const [tagFilter, setTagFilter] = useState(selectedTagFilter);\n useTagStoreSync();\n\n const handleChange = (filter: string) => {\n navigate(location.pathname, {\n t: filter === 'ALL' ? null : filter.toLowerCase(),\n });\n };\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n let verbParam = searchParams.get('t') || 'ALL';\n verbParam = isValidFilter(location.pathname, verbParam)\n ? verbParam.toUpperCase()\n : 'ALL';\n setTagFilterAction({\n tagFilter: verbParam,\n });\n }, [location.search]);\n\n const types = api.typeTags[typeTag];\n useEffect(() => {\n if (!types) {\n navigateWithGlobalParams(`/${specKey}/types`);\n }\n }, [types]);\n\n useEffect(() => {\n setTagFilter(selectedTagFilter);\n }, [selectedTagFilter]);\n\n if (!types) {\n return <></>;\n }\n\n const tag = Object.values(api.spec.tags!).find(
|
|
1
|
+
{"version":3,"file":"TypeTagScene.js","names":["_react","_interopRequireWildcard","require","_components","_reactRouterDom","_reactRedux","_components2","_utils","_state","_utils2","_utils3","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","TypeTagScene","_ref","api","specKey","typeTag","useParams","location","useLocation","navigate","buildPathWithGlobalParams","navigateWithGlobalParams","useNavigation","selectedTagFilter","useSelector","selectTagFilter","setTagFilterAction","useSettingActions","tagFilter","setTagFilter","useState","useTagStoreSync","handleChange","filter","pathname","toLowerCase","useEffect","searchParams","URLSearchParams","search","verbParam","isValidFilter","toUpperCase","types","typeTags","concat","createElement","Fragment","tag","values","spec","tags","find","name","metaTypes","getMetaTypes","ApixSection","DocTitle","description","ButtonToggle","mb","mt","value","onChange","ButtonItem","key","px","py","map","op","type","index","metaType","toString","Link","to","buildTypePath","Grid","columns","DocTypeSummary","exports"],"sources":["../../../src/scenes/TypeTagScene/TypeTagScene.tsx"],"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 type { FC } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport { ButtonItem, ButtonToggle, Grid } from '@looker/components';\nimport type { ApiModel } from '@looker/sdk-codegen';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { useSelector } from 'react-redux';\nimport { ApixSection, DocTitle, DocTypeSummary, Link } from '../../components';\nimport { buildTypePath, isValidFilter, useNavigation } from '../../utils';\nimport { selectTagFilter, useSettingActions } from '../../state';\nimport { useTagStoreSync } from '../utils';\nimport { getMetaTypes } from './utils';\n\ninterface TypeTagSceneProps {\n api: ApiModel;\n}\n\ninterface TypeTagSceneParams {\n specKey: string;\n typeTag: string;\n}\n\nexport const TypeTagScene: FC<TypeTagSceneProps> = ({ api }) => {\n const { specKey, typeTag } = useParams<TypeTagSceneParams>();\n const location = useLocation();\n const { navigate, buildPathWithGlobalParams, navigateWithGlobalParams } =\n useNavigation();\n const selectedTagFilter = useSelector(selectTagFilter);\n const { setTagFilterAction } = useSettingActions();\n const [tagFilter, setTagFilter] = useState(selectedTagFilter);\n useTagStoreSync();\n\n const handleChange = (filter: string) => {\n navigate(location.pathname, {\n t: filter === 'ALL' ? null : filter.toLowerCase(),\n });\n };\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n let verbParam = searchParams.get('t') || 'ALL';\n verbParam = isValidFilter(location.pathname, verbParam)\n ? verbParam.toUpperCase()\n : 'ALL';\n setTagFilterAction({\n tagFilter: verbParam,\n });\n }, [location.search]);\n\n const types = api.typeTags[typeTag];\n useEffect(() => {\n if (!types) {\n navigateWithGlobalParams(`/${specKey}/types`);\n }\n }, [types]);\n\n useEffect(() => {\n setTagFilter(selectedTagFilter);\n }, [selectedTagFilter]);\n\n if (!types) {\n return <></>;\n }\n\n const tag = Object.values(api.spec.tags!).find(tag => tag.name === typeTag)!;\n const metaTypes = getMetaTypes(types);\n return (\n <ApixSection>\n <DocTitle>{`${tag.name}: ${tag.description}`}</DocTitle>\n <ButtonToggle\n mb=\"small\"\n mt=\"xlarge\"\n value={tagFilter}\n onChange={handleChange}\n >\n <ButtonItem key=\"ALL\" px=\"large\" py=\"xsmall\">\n ALL\n </ButtonItem>\n {metaTypes.map(op => (\n <ButtonItem key={op} px=\"large\" py=\"xsmall\">\n {op}\n </ButtonItem>\n ))}\n </ButtonToggle>\n {Object.values(types).map(\n (type, index) =>\n (selectedTagFilter === 'ALL' ||\n selectedTagFilter === type.metaType.toString().toUpperCase()) && (\n <Link\n key={index}\n to={buildPathWithGlobalParams(\n buildTypePath(specKey, tag.name, type.name)\n )}\n >\n <Grid columns={1} py=\"xsm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CAAC;AAACU,OAAA,CAAArE,YAAA,GAAAA,YAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["getMetaTypes","types","typeSet","Set","Object","values","forEach","type","add","metaType","toString","toUpperCase","Array","from","exports"],"sources":["../../../src/scenes/TypeTagScene/utils.ts"],"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 { TypeList } from '@looker/sdk-codegen';\n\n/**\n * Given a list of types it returns a list of distinct types\n * @param types A list of types\n */\nexport const getMetaTypes = (types: TypeList) => {\n const typeSet = new Set<string>();\n Object.values(types).forEach(
|
|
1
|
+
{"version":3,"file":"utils.js","names":["getMetaTypes","types","typeSet","Set","Object","values","forEach","type","add","metaType","toString","toUpperCase","Array","from","exports"],"sources":["../../../src/scenes/TypeTagScene/utils.ts"],"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 { TypeList } from '@looker/sdk-codegen';\n\n/**\n * Given a list of types it returns a list of distinct types\n * @param types A list of types\n */\nexport const getMetaTypes = (types: TypeList) => {\n const typeSet = new Set<string>();\n Object.values(types).forEach(type => {\n typeSet.add(type.metaType.toString().toUpperCase());\n });\n return Array.from(typeSet.values());\n};\n"],"mappings":";;;;;;AAgCO,IAAMA,YAAY,GAAIC,KAAe,IAAK;EAC/C,IAAMC,OAAO,GAAG,IAAIC,GAAG,CAAS,CAAC;EACjCC,MAAM,CAACC,MAAM,CAACJ,KAAK,CAAC,CAACK,OAAO,CAACC,IAAI,IAAI;IACnCL,OAAO,CAACM,GAAG,CAACD,IAAI,CAACE,QAAQ,CAACC,QAAQ,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,CAAC;EACrD,CAAC,CAAC;EACF,OAAOC,KAAK,CAACC,IAAI,CAACX,OAAO,CAACG,MAAM,CAAC,CAAC,CAAC;AACrC,CAAC;AAACS,OAAA,CAAAd,YAAA,GAAAA,YAAA"}
|
|
@@ -21,5 +21,9 @@ export declare const lodeActions: import("@reduxjs/toolkit").CaseReducerActions<
|
|
|
21
21
|
initLodesSuccessAction(state: import("immer/dist/internal").WritableDraft<LodesState>, action: PayloadAction<InitSuccessAction>): void;
|
|
22
22
|
initLodesFailureAction(state: import("immer/dist/internal").WritableDraft<LodesState>, action: PayloadAction<Error>): void;
|
|
23
23
|
}, "lodes">;
|
|
24
|
-
export declare const useLodeActions: () =>
|
|
24
|
+
export declare const useLodeActions: () => import("@reduxjs/toolkit").CaseReducerActions<{
|
|
25
|
+
initLodesAction(_state: import("immer/dist/internal").WritableDraft<LodesState>, _action: PayloadAction<InitPayload>): void;
|
|
26
|
+
initLodesSuccessAction(state: import("immer/dist/internal").WritableDraft<LodesState>, action: PayloadAction<InitSuccessAction>): void;
|
|
27
|
+
initLodesFailureAction(state: import("immer/dist/internal").WritableDraft<LodesState>, action: PayloadAction<Error>): void;
|
|
28
|
+
}>, useLodesStoreState: () => LodesState;
|
|
25
29
|
export {};
|
|
@@ -13,7 +13,7 @@ export interface SettingState extends UserDefinedSettings {
|
|
|
13
13
|
export declare const defaultSettings: {
|
|
14
14
|
sdkLanguage: string;
|
|
15
15
|
searchPattern: string;
|
|
16
|
-
searchCriteria:
|
|
16
|
+
searchCriteria: SearchCriterionTerm[];
|
|
17
17
|
tagFilter: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const defaultSettingsState: SettingState;
|
|
@@ -37,5 +37,12 @@ export declare const settingActions: import("@reduxjs/toolkit").CaseReducerActio
|
|
|
37
37
|
setSearchPatternAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<SetSearchPatternAction>): void;
|
|
38
38
|
setTagFilterAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<SetTagFilterAction>): void;
|
|
39
39
|
}, "settings">;
|
|
40
|
-
export declare const useSettingActions: () =>
|
|
40
|
+
export declare const useSettingActions: () => import("@reduxjs/toolkit").CaseReducerActions<{
|
|
41
|
+
initSettingsAction(): void;
|
|
42
|
+
initSettingsSuccessAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<InitSuccessPayload>): void;
|
|
43
|
+
initSettingsFailureAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<Error>): void;
|
|
44
|
+
setSdkLanguageAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<SetSdkLanguageAction>): void;
|
|
45
|
+
setSearchPatternAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<SetSearchPatternAction>): void;
|
|
46
|
+
setTagFilterAction(state: import("immer/dist/internal").WritableDraft<SettingState>, action: PayloadAction<SetTagFilterAction>): void;
|
|
47
|
+
}>, useSettingStoreState: () => SettingState;
|
|
41
48
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sagas.js","names":["_typedReduxSaga","require","_utils","_slice","initSaga","action","initSpecsSuccessAction","initSpecsFailureAction","specActions","adaptor","getApixAdaptor","specs","call","currentSpecKey","payload","specKey","Object","values","find","spec","status","key","put","error","console","Error","message","setCurrentSpecSaga","setCurrentSpecSuccessAction","setCurrentSpecFailureAction","select","state","newSpec","api","saga","initSpecsAction","setCurrentSpecAction","takeEvery"],"sources":["../../../src/state/specs/sagas.ts"],"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 type { SpecItem, SpecList } from '@looker/sdk-codegen';\nimport { call, put, select, takeEvery } from 'typed-redux-saga';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport { getApixAdaptor } from '../../utils';\nimport type { RootState } from '../store';\nimport type { InitSpecsAction, SetCurrentSpecAction } from './slice';\nimport { specActions } from './slice';\n\nfunction* initSaga(action: PayloadAction<InitSpecsAction>) {\n const { initSpecsSuccessAction, initSpecsFailureAction } = specActions;\n const adaptor = getApixAdaptor();\n\n try {\n const specs: SpecList = yield* call([adaptor, 'fetchSpecList']);\n let currentSpecKey = action.payload.specKey;\n if (!currentSpecKey || !specs[currentSpecKey]) {\n // if current spec key is invalid or not assigned, default to the first \"current\" spec\n currentSpecKey = Object.values(specs).find(\n
|
|
1
|
+
{"version":3,"file":"sagas.js","names":["_typedReduxSaga","require","_utils","_slice","initSaga","action","initSpecsSuccessAction","initSpecsFailureAction","specActions","adaptor","getApixAdaptor","specs","call","currentSpecKey","payload","specKey","Object","values","find","spec","status","key","put","error","console","Error","message","setCurrentSpecSaga","setCurrentSpecSuccessAction","setCurrentSpecFailureAction","select","state","newSpec","api","saga","initSpecsAction","setCurrentSpecAction","takeEvery"],"sources":["../../../src/state/specs/sagas.ts"],"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 type { SpecItem, SpecList } from '@looker/sdk-codegen';\nimport { call, put, select, takeEvery } from 'typed-redux-saga';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport { getApixAdaptor } from '../../utils';\nimport type { RootState } from '../store';\nimport type { InitSpecsAction, SetCurrentSpecAction } from './slice';\nimport { specActions } from './slice';\n\nfunction* initSaga(action: PayloadAction<InitSpecsAction>) {\n const { initSpecsSuccessAction, initSpecsFailureAction } = specActions;\n const adaptor = getApixAdaptor();\n\n try {\n const specs: SpecList = yield* call([adaptor, 'fetchSpecList']);\n let currentSpecKey = action.payload.specKey;\n if (!currentSpecKey || !specs[currentSpecKey]) {\n // if current spec key is invalid or not assigned, default to the first \"current\" spec\n currentSpecKey = Object.values(specs).find(\n spec => spec.status === 'current'\n )!.key;\n }\n const spec = yield* call([adaptor, 'fetchSpec'], specs[currentSpecKey]);\n specs[currentSpecKey] = spec;\n yield* put(initSpecsSuccessAction({ specs, currentSpecKey }));\n } catch (error: any) {\n // TODO if an error occurs here extension api explorer hangs.\n // Needs to be fixed. For now report the error.\n console.error(error);\n yield* put(initSpecsFailureAction(new Error(error.message)));\n }\n}\n\nfunction* setCurrentSpecSaga(action: PayloadAction<SetCurrentSpecAction>) {\n const { setCurrentSpecSuccessAction, setCurrentSpecFailureAction } =\n specActions;\n const adaptor = getApixAdaptor();\n const spec: SpecItem = yield* select(\n (state: RootState) => state.specs.specs[action.payload.currentSpecKey]\n );\n\n try {\n const newSpec = yield* call([adaptor, 'fetchSpec'], spec);\n yield* put(\n setCurrentSpecSuccessAction({\n api: newSpec.api!,\n currentSpecKey: action.payload.currentSpecKey,\n })\n );\n } catch (error: any) {\n console.error(error);\n yield put(setCurrentSpecFailureAction(new Error(error.message)));\n }\n}\n\nexport function* saga() {\n const { initSpecsAction, setCurrentSpecAction } = specActions;\n\n yield* takeEvery(initSpecsAction, initSaga);\n yield* takeEvery(setCurrentSpecAction, setCurrentSpecSaga);\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,eAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AAEA,UAAUG,QAAQA,CAACC,MAAsC,EAAE;EACzD,IAAM;IAAEC,sBAAsB;IAAEC;EAAuB,CAAC,GAAGC,kBAAW;EACtE,IAAMC,OAAO,GAAG,IAAAC,qBAAc,EAAC,CAAC;EAEhC,IAAI;IACF,IAAMC,KAAe,GAAG,OAAO,IAAAC,oBAAI,EAAC,CAACH,OAAO,EAAE,eAAe,CAAC,CAAC;IAC/D,IAAII,cAAc,GAAGR,MAAM,CAACS,OAAO,CAACC,OAAO;IAC3C,IAAI,CAACF,cAAc,IAAI,CAACF,KAAK,CAACE,cAAc,CAAC,EAAE;MAE7CA,cAAc,GAAGG,MAAM,CAACC,MAAM,CAACN,KAAK,CAAC,CAACO,IAAI,CACxCC,IAAI,IAAIA,IAAI,CAACC,MAAM,KAAK,SAC1B,CAAC,CAAEC,GAAG;IACR;IACA,IAAMF,IAAI,GAAG,OAAO,IAAAP,oBAAI,EAAC,CAACH,OAAO,EAAE,WAAW,CAAC,EAAEE,KAAK,CAACE,cAAc,CAAC,CAAC;IACvEF,KAAK,CAACE,cAAc,CAAC,GAAGM,IAAI;IAC5B,O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,EAACD,oBAAoB,EAAET,kBAAkB,CAAC;AAC5D"}
|
|
@@ -38,5 +38,12 @@ export declare const specActions: import("@reduxjs/toolkit").CaseReducerActions<
|
|
|
38
38
|
setCurrentSpecSuccessAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<SetCurrentSpecSuccessAction>): void;
|
|
39
39
|
setCurrentSpecFailureAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<Error>): void;
|
|
40
40
|
}, "specs">;
|
|
41
|
-
export declare const useSpecActions: () =>
|
|
41
|
+
export declare const useSpecActions: () => import("@reduxjs/toolkit").CaseReducerActions<{
|
|
42
|
+
initSpecsAction(state: import("immer/dist/internal").WritableDraft<SpecState>, _action: PayloadAction<InitSpecsAction>): void;
|
|
43
|
+
initSpecsSuccessAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<InitSpecsSuccessPayload>): void;
|
|
44
|
+
initSpecsFailureAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<Error>): void;
|
|
45
|
+
setCurrentSpecAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<SetCurrentSpecAction>): void;
|
|
46
|
+
setCurrentSpecSuccessAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<SetCurrentSpecSuccessAction>): void;
|
|
47
|
+
setCurrentSpecFailureAction(state: import("immer/dist/internal").WritableDraft<SpecState>, action: PayloadAction<Error>): void;
|
|
48
|
+
}>, useSpecStoreState: () => SpecState;
|
|
42
49
|
export {};
|
package/lib/state/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","names":["_redux","require","_map","_interopRequireDefault","_settings","_lodes","_specs","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","isInitSuccessAction","action","_action$payload","payload","specs","actionSanitizer","_id","sanitizeSpecs","stateSanitizer","state","_index","specList","map","spec","api","undefined","specContent","devTools","process","env","NODE_ENV","store","exports","createStore","preloadedState","settings","defaultSettingsState","lodes","defaultLodesState","defaultSpecsState","reducer","settingsSlice","lodesSlice","specsSlice"],"sources":["../../src/state/store.ts"],"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 { createStore } from '@looker/redux';\nimport type { DevToolsEnhancerOptions, PayloadAction } from '@reduxjs/toolkit';\nimport type { Action } from 'redux';\nimport map from 'lodash/map';\nimport type { SpecList } from '@looker/sdk-codegen';\n\nimport type { SettingState } from './settings';\nimport { defaultSettingsState, settingsSlice } from './settings';\nimport type { LodesState } from './lodes';\nimport { defaultLodesState, lodesSlice } from './lodes';\nimport type { InitSpecsSuccessPayload, SpecState } from './specs';\nimport { defaultSpecsState, specsSlice } from './specs';\n\nconst isInitSuccessAction = (\n action: any\n): action is PayloadAction<InitSpecsSuccessPayload> => !!action.payload?.specs;\n\nconst actionSanitizer = <A extends Partial<Action>>(\n action: A,\n _id: number\n): A => {\n if (isInitSuccessAction(action)) {\n action = {\n ...action,\n payload: {\n ...action.payload,\n specs: sanitizeSpecs(action.payload.specs),\n },\n };\n }\n return action;\n};\n\nconst stateSanitizer = <S extends Partial<RootState>>(\n state: S,\n _index: number\n): S => {\n if (state.specs) {\n return {\n ...state,\n specs: {\n ...state.specs,\n specs: sanitizeSpecs(state.specs.specs),\n },\n };\n }\n return state;\n};\n\nconst sanitizeSpecs = (specList: SpecList) =>\n map(specList,
|
|
1
|
+
{"version":3,"file":"store.js","names":["_redux","require","_map","_interopRequireDefault","_settings","_lodes","_specs","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","isInitSuccessAction","action","_action$payload","payload","specs","actionSanitizer","_id","sanitizeSpecs","stateSanitizer","state","_index","specList","map","spec","api","undefined","specContent","devTools","process","env","NODE_ENV","store","exports","createStore","preloadedState","settings","defaultSettingsState","lodes","defaultLodesState","defaultSpecsState","reducer","settingsSlice","lodesSlice","specsSlice"],"sources":["../../src/state/store.ts"],"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 { createStore } from '@looker/redux';\nimport type { DevToolsEnhancerOptions, PayloadAction } from '@reduxjs/toolkit';\nimport type { Action } from 'redux';\nimport map from 'lodash/map';\nimport type { SpecList } from '@looker/sdk-codegen';\n\nimport type { SettingState } from './settings';\nimport { defaultSettingsState, settingsSlice } from './settings';\nimport type { LodesState } from './lodes';\nimport { defaultLodesState, lodesSlice } from './lodes';\nimport type { InitSpecsSuccessPayload, SpecState } from './specs';\nimport { defaultSpecsState, specsSlice } from './specs';\n\nconst isInitSuccessAction = (\n action: any\n): action is PayloadAction<InitSpecsSuccessPayload> => !!action.payload?.specs;\n\nconst actionSanitizer = <A extends Partial<Action>>(\n action: A,\n _id: number\n): A => {\n if (isInitSuccessAction(action)) {\n action = {\n ...action,\n payload: {\n ...action.payload,\n specs: sanitizeSpecs(action.payload.specs),\n },\n };\n }\n return action;\n};\n\nconst stateSanitizer = <S extends Partial<RootState>>(\n state: S,\n _index: number\n): S => {\n if (state.specs) {\n return {\n ...state,\n specs: {\n ...state.specs,\n specs: sanitizeSpecs(state.specs.specs),\n },\n };\n }\n return state;\n};\n\nconst sanitizeSpecs = (specList: SpecList) =>\n map(specList, spec => ({\n ...spec,\n api: spec.api ? '<api>' : undefined,\n specContent: spec.specContent ? '<specContent>' : undefined,\n })) as unknown as SpecList;\n\nconst devTools =\n process.env.NODE_ENV !== 'production'\n ? ({ actionSanitizer, stateSanitizer } as DevToolsEnhancerOptions)\n : false;\n\nexport const store = createStore({\n devTools,\n preloadedState: {\n settings: defaultSettingsState,\n lodes: defaultLodesState,\n specs: defaultSpecsState,\n },\n reducer: {\n settings: settingsSlice.reducer,\n lodes: lodesSlice.reducer,\n specs: specsSlice.reducer,\n },\n});\n\nexport interface RootState {\n settings: SettingState;\n lodes: LodesState;\n specs: SpecState;\n}\n"],"mappings":";;;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAIA,IAAAG,SAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAAwD,SAAAE,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CA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AAC;EACDC,OAAO,EAAE;IACPL,QAAQ,EAAEM,uBAAa,CAACD,OAAO;IAC/BH,KAAK,EAAEK,iBAAU,CAACF,OAAO;IACzB1B,KAAK,EAAE6B,iBAAU,CAACH;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { IDeclarationMine, IExampleMine } from '@looker/sdk-codegen';
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
import type { RenderOptions } from '@testing-library/react';
|
|
4
|
-
export declare const renderWithLode: (consumers: ReactElement<any>, examples: IExampleMine, declarations?: IDeclarationMine, options?: Omit<RenderOptions<any>,
|
|
4
|
+
export declare const renderWithLode: (consumers: ReactElement<any>, examples: IExampleMine, declarations?: IDeclarationMine, options?: Omit<RenderOptions<any>, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
@@ -4,8 +4,8 @@ import type { Store } from 'redux';
|
|
|
4
4
|
import type { RenderOptions } from '@testing-library/react';
|
|
5
5
|
import type { LodesState, RootState, SettingState, SpecState } from '../state';
|
|
6
6
|
export declare const withReduxProvider: (consumers: ReactElement<any>, store?: Store<RootState>) => React.JSX.Element;
|
|
7
|
-
export declare const renderWithReduxProvider: (consumers: ReactElement<any>, store?: Store<RootState>, options?: Omit<RenderOptions<any>,
|
|
8
|
-
export declare const renderWithRouterAndReduxProvider: (consumers: ReactElement<any>, initialEntries?: string[], store?: Store<RootState>, options?: Omit<RenderOptions<any>,
|
|
7
|
+
export declare const renderWithReduxProvider: (consumers: ReactElement<any>, store?: Store<RootState>, options?: Omit<RenderOptions<any>, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
8
|
+
export declare const renderWithRouterAndReduxProvider: (consumers: ReactElement<any>, initialEntries?: string[], store?: Store<RootState>, options?: Omit<RenderOptions<any>, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
9
9
|
export declare const preloadedState: RootState;
|
|
10
10
|
type DeepPartial<T> = {
|
|
11
11
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
@@ -2,4 +2,4 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { RenderOptions } from '@testing-library/react';
|
|
4
4
|
export declare const withRouter: (children: ReactElement<any> | ReactElement[], initialEntries?: string[]) => React.JSX.Element;
|
|
5
|
-
export declare const renderWithRouter: (children: ReactElement<any> | ReactElement[], initialEntries?: string[], options?: Omit<RenderOptions<any>,
|
|
5
|
+
export declare const renderWithRouter: (children: ReactElement<any> | ReactElement[], initialEntries?: string[], options?: Omit<RenderOptions<any>, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apixAdaptor.js","names":["_extensionUtils","require","_sdkCodegen","_runIt","_cloneDeep","_interopRequireDefault","_adaptorUtils","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","getApixAdaptor","getEnvAdaptor","exports","ApixAdaptor","BrowserAdaptor","constructor","sdk","fallbackVersionsUrl","fetchSpecList","versionsUrl","_this","data","localStorageGetItem","RunItConfigKey","config","JSON","parse","RunItNoConfig","url","base_url","concat","versions","authSession","transport","rawRequest","specs","getSpecsFromVersions","body","fetchSpec","spec","_spec","cloneDeep","specURL","fullify","origin","api","fallbackFetch","funFetch"],"sources":["../../src/utils/apixAdaptor.ts"],"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 type { IEnvironmentAdaptor } from '@looker/extension-utils';\nimport { BrowserAdaptor, getEnvAdaptor } from '@looker/extension-utils';\nimport type { IAPIMethods } from '@looker/sdk-rtl';\nimport type { SpecItem, SpecList } from '@looker/sdk-codegen';\nimport { getSpecsFromVersions } from '@looker/sdk-codegen';\nimport { RunItConfigKey, RunItNoConfig } from '@looker/run-it';\nimport cloneDeep from 'lodash/cloneDeep';\n\nimport { fallbackFetch, fullify, funFetch } from './adaptorUtils';\n\nexport interface IApixAdaptor extends IEnvironmentAdaptor {\n fetchSpecList(versionsUrl?: string): Promise<SpecList>;\n fetchSpec(spec: SpecItem): Promise<SpecItem>;\n}\n\nexport const getApixAdaptor = () => getEnvAdaptor() as IApixAdaptor;\n\nexport class ApixAdaptor extends BrowserAdaptor implements IApixAdaptor {\n constructor(
|
|
1
|
+
{"version":3,"file":"apixAdaptor.js","names":["_extensionUtils","require","_sdkCodegen","_runIt","_cloneDeep","_interopRequireDefault","_adaptorUtils","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","getApixAdaptor","getEnvAdaptor","exports","ApixAdaptor","BrowserAdaptor","constructor","sdk","fallbackVersionsUrl","fetchSpecList","versionsUrl","_this","data","localStorageGetItem","RunItConfigKey","config","JSON","parse","RunItNoConfig","url","base_url","concat","versions","authSession","transport","rawRequest","specs","getSpecsFromVersions","body","fetchSpec","spec","_spec","cloneDeep","specURL","fullify","origin","api","fallbackFetch","funFetch"],"sources":["../../src/utils/apixAdaptor.ts"],"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 type { IEnvironmentAdaptor } from '@looker/extension-utils';\nimport { BrowserAdaptor, getEnvAdaptor } from '@looker/extension-utils';\nimport type { IAPIMethods } from '@looker/sdk-rtl';\nimport type { SpecItem, SpecList } from '@looker/sdk-codegen';\nimport { getSpecsFromVersions } from '@looker/sdk-codegen';\nimport { RunItConfigKey, RunItNoConfig } from '@looker/run-it';\nimport cloneDeep from 'lodash/cloneDeep';\n\nimport { fallbackFetch, fullify, funFetch } from './adaptorUtils';\n\nexport interface IApixAdaptor extends IEnvironmentAdaptor {\n fetchSpecList(versionsUrl?: string): Promise<SpecList>;\n fetchSpec(spec: SpecItem): Promise<SpecItem>;\n}\n\nexport const getApixAdaptor = () => getEnvAdaptor() as IApixAdaptor;\n\nexport class ApixAdaptor extends BrowserAdaptor implements IApixAdaptor {\n constructor(sdk: IAPIMethods, private readonly fallbackVersionsUrl: string) {\n super(sdk);\n }\n\n async fetchSpecList(versionsUrl?: string): Promise<SpecList> {\n const data = await this.localStorageGetItem(RunItConfigKey);\n const config = data ? JSON.parse(data) : RunItNoConfig;\n let url: string;\n\n if (versionsUrl) {\n url = versionsUrl;\n } else {\n url = config.base_url\n ? `${config.base_url}/versions`\n : `${this.fallbackVersionsUrl}/versions.json`;\n }\n\n const versions = await this.sdk.authSession.transport.rawRequest(\n 'GET',\n url\n );\n const specs = await getSpecsFromVersions(JSON.parse(versions.body));\n return specs;\n }\n\n async fetchSpec(spec: SpecItem): Promise<SpecItem> {\n const _spec = cloneDeep(spec);\n _spec.specURL = fullify(spec.specURL!, origin);\n _spec.api = await fallbackFetch(_spec, funFetch);\n return _spec;\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,eAAA,GAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,aAAA,GAAAL,OAAA;AAAkE,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KA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CAACK,QAAQ,oBAAAC,MAAA,CACfV,KAAI,CAACH,mBAAmB,mBAAgB;MACjD;MAEA,IAAMc,QAAQ,SAASX,KAAI,CAACJ,GAAG,CAACgB,WAAW,CAACC,SAAS,CAACC,UAAU,CAC9D,KAAK,EACLN,GACF,CAAC;MACD,IAAMO,KAAK,SAAS,IAAAC,gCAAoB,EAACX,IAAI,CAACC,KAAK,CAACK,QAAQ,CAACM,IAAI,CAAC,CAAC;MACnE,OAAOF,KAAK;IAAC;EACf;EAEMG,SAASA,CAACC,IAAc,EAAqB;IAAA,OAAArC,iBAAA;MACjD,IAAMsC,KAAK,GAAG,IAAAC,kBAAS,EAACF,IAAI,CAAC;MAC7BC,KAAK,CAACE,OAAO,GAAG,IAAAC,qBAAO,EAACJ,IAAI,CAACG,OAAO,EAAGE,MAAM,CAAC;MAC9CJ,KAAK,CAACK,GAAG,SAAS,IAAAC,2BAAa,EAACN,KAAK,EAAEO,sBAAQ,CAAC;MAChD,OAAOP,KAAK;IAAC;EACf;AACF;AAAC5B,OAAA,CAAAC,WAAA,GAAAA,WAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","names":["_reactRouterDom","require","GLOBAL_PARAMS","useNavigation","history","useHistory","navigate","path","queryParams","urlParams","URLSearchParams","location","search","undefined","push","pathname","toString","Object","keys","forEach","key","delete","_queryParams","set","buildPathWithGlobalParams","otherParams","arguments","length","params","includes","globalParams","additionalParams","entries","_ref","value","concat","queryString","navigateWithGlobalParams","exports"],"sources":["../../../src/utils/hooks/navigation.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { useHistory } from 'react-router-dom';\n\nconst GLOBAL_PARAMS = ['s', 'sdk'];\n\ninterface QueryParamProps {\n /** Search Query **/\n s?: string | null;\n /** Chosen SDK Language **/\n sdk?: string | null;\n /** Tag Scene Filter **/\n t?: string | null;\n}\n\n/**\n * Hook for navigating to given route with query params\n */\nexport const useNavigation = () => {\n const history = useHistory();\n\n /**\n * Navigates to path including provided search parameters\n *\n * @param path Pathname to navigate to\n * @param queryParams Hash of query param name/value pairs to include in the destination url\n */\n const navigate = (path: string, queryParams?: QueryParamProps | null) => {\n const urlParams = new URLSearchParams(history.location.search);\n\n if (queryParams === undefined) {\n // if params passed in is undefined, maintain existing parameters in the URL\n history.push({ pathname: path, search: urlParams.toString() });\n } else if (queryParams === null) {\n // if params passed in is null, remove all parameters from the URL\n history.push({ pathname: path });\n } else {\n // push each key as new param to URL, excluding entries with value null\n Object.keys(queryParams).forEach(
|
|
1
|
+
{"version":3,"file":"navigation.js","names":["_reactRouterDom","require","GLOBAL_PARAMS","useNavigation","history","useHistory","navigate","path","queryParams","urlParams","URLSearchParams","location","search","undefined","push","pathname","toString","Object","keys","forEach","key","delete","_queryParams","set","buildPathWithGlobalParams","otherParams","arguments","length","params","includes","globalParams","additionalParams","entries","_ref","value","concat","queryString","navigateWithGlobalParams","exports"],"sources":["../../../src/utils/hooks/navigation.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { useHistory } from 'react-router-dom';\n\nconst GLOBAL_PARAMS = ['s', 'sdk'];\n\ninterface QueryParamProps {\n /** Search Query **/\n s?: string | null;\n /** Chosen SDK Language **/\n sdk?: string | null;\n /** Tag Scene Filter **/\n t?: string | null;\n}\n\n/**\n * Hook for navigating to given route with query params\n */\nexport const useNavigation = () => {\n const history = useHistory();\n\n /**\n * Navigates to path including provided search parameters\n *\n * @param path Pathname to navigate to\n * @param queryParams Hash of query param name/value pairs to include in the destination url\n */\n const navigate = (path: string, queryParams?: QueryParamProps | null) => {\n const urlParams = new URLSearchParams(history.location.search);\n\n if (queryParams === undefined) {\n // if params passed in is undefined, maintain existing parameters in the URL\n history.push({ pathname: path, search: urlParams.toString() });\n } else if (queryParams === null) {\n // if params passed in is null, remove all parameters from the URL\n history.push({ pathname: path });\n } else {\n // push each key as new param to URL, excluding entries with value null\n Object.keys(queryParams).forEach(key => {\n if (\n queryParams[key as keyof QueryParamProps] === null ||\n queryParams[key as keyof QueryParamProps] === ''\n ) {\n urlParams.delete(key);\n } else {\n urlParams.set(key, queryParams[key as keyof QueryParamProps] ?? '');\n }\n });\n history.push({ pathname: path, search: urlParams.toString() });\n }\n };\n\n /**\n * Builds path to a scene and removes any scene-specific URL parameters\n *\n * @param path the destination path\n * @param otherParams other query parameters to append to url\n * @returns a path excluding scene-specific search parameters\n */\n const buildPathWithGlobalParams = (path: string, otherParams = {}) => {\n const params = new URLSearchParams(history.location.search);\n\n for (const key of params.keys()) {\n if (!GLOBAL_PARAMS.includes(key)) {\n params.delete(key);\n }\n }\n const globalParams = params.toString();\n\n let additionalParams = '';\n Object.entries(otherParams).forEach(([key, value]) => {\n additionalParams += `${key}=${value}`;\n });\n\n let queryString = '';\n if (globalParams) {\n queryString = globalParams;\n }\n\n if (additionalParams) {\n queryString += globalParams ? `&${additionalParams}` : additionalParams;\n }\n\n return `${path}${queryString ? `?${queryString}` : ''}`;\n };\n\n /**\n * Navigates to a scene removing any scene-specific URL parameters\n *\n * @param path Pathname to navigate to\n */\n const navigateWithGlobalParams = (path: string) => {\n history.push(buildPathWithGlobalParams(path));\n };\n\n return {\n navigate,\n navigateWithGlobalParams,\n buildPathWithGlobalParams,\n };\n};\n"],"mappings":";;;;;;AAyBA,IAAAA,eAAA,GAAAC,OAAA;AAEA,IAAMC,aAAa,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AAc3B,IAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,IAAMC,OAAO,GAAG,IAAAC,0BAAU,EAAC,CAAC;EAQ5B,IAAMC,QAAQ,GAAGA,CAACC,IAAY,EAAEC,WAAoC,KAAK;IACvE,IAAMC,SAAS,GAAG,IAAIC,eAAe,CAACN,OAAO,CAACO,QAAQ,CAACC,MAAM,CAAC;IAE9D,IAAIJ,WAAW,KAAKK,SAAS,EAAE;MAE7BT,OAAO,CAACU,IAA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,IAAMU,YAAY,GAAGF,MAAM,CAACZ,QAAQ,CAAC,CAAC;IAEtC,IAAIe,gBAAgB,GAAG,EAAE;IACzBd,MAAM,CAACe,OAAO,CAACP,WAAW,CAAC,CAACN,OAAO,CAACc,IAAA,IAAkB;MAAA,IAAjB,CAACb,GAAG,EAAEc,KAAK,CAAC,GAAAD,IAAA;MAC/CF,gBAAgB,OAAAI,MAAA,CAAOf,GAAG,OAAAe,MAAA,CAAID,KAAK,CAAE;IACvC,CAAC,CAAC;IAEF,IAAIE,WAAW,GAAG,EAAE;IACpB,IAAIN,YAAY,EAAE;MAChBM,WAAW,GAAGN,YAAY;IAC5B;IAEA,IAAIC,gBAAgB,EAAE;MACpBK,WAAW,IAAIN,YAAY,OAAAK,MAAA,CAAOJ,gBAAgB,IAAKA,gBAAgB;IACzE;IAEA,UAAAI,MAAA,CAAU5B,IAAI,EAAA4B,MAAA,CAAGC,WAAW,OAAAD,MAAA,CAAOC,WAAW,IAAK,EAAE;EACvD,CAAC;EAOD,IAAMC,wBAAwB,GAAI9B,IAAY,IAAK;IACjDH,OAAO,CAACU,IAAI,CAACU,yBAAyB,CAACjB,IAAI,CAAC,CAAC;EAC/C,CAAC;EAED,OAAO;IACLD,QAAQ;IACR+B,wBAAwB;IACxBb;EACF,CAAC;AACH,CAAC;AAACc,OAAA,CAAAnC,aAAA,GAAAA,aAAA"}
|
package/lib/utils/path.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const buildMethodPath: (specKey: string, tag: string, methodName:
|
|
|
6
6
|
export declare const buildTypePath: (specKey: string, tag: string, typeName: string, params?: string) => string;
|
|
7
7
|
export declare const diffPath = "diff";
|
|
8
8
|
export declare const oAuthPath = "oauth";
|
|
9
|
-
export declare const isMethod: (item: IMethod | IType) =>
|
|
9
|
+
export declare const isMethod: (item: IMethod | IType) => item is IMethod;
|
|
10
10
|
export declare const buildPath: (api: ApiModel, item: IMethod | IType, specKey: string) => string;
|
|
11
11
|
export declare const getSpecKey: (location: HLocation | Location) => string | null;
|
|
12
12
|
export declare const getSceneType: (path: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkLanguage.js","names":["_sdkCodegen","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","allAlias","exports","allSdkLanguages","languages","codeGenerators","gen","alias","extension","toString","match","language","findSdk","label","entries","localeCompare","sensitivity"],"sources":["../../src/utils/sdkLanguage.ts"],"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 { ArgValues } from '@looker/sdk-codegen';\nimport { codeGenerators } from '@looker/sdk-codegen';\n\nexport const allAlias = 'all';\n\n/**\n * Gets all supported sdk languages\n * @returns mapping of sdk language aliases to name\n */\nexport const allSdkLanguages = (): Record<string, string> => {\n const languages: ArgValues = {};\n codeGenerators.forEach(
|
|
1
|
+
{"version":3,"file":"sdkLanguage.js","names":["_sdkCodegen","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","allAlias","exports","allSdkLanguages","languages","codeGenerators","gen","alias","extension","toString","match","language","findSdk","label","entries","localeCompare","sensitivity"],"sources":["../../src/utils/sdkLanguage.ts"],"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 { ArgValues } from '@looker/sdk-codegen';\nimport { codeGenerators } from '@looker/sdk-codegen';\n\nexport const allAlias = 'all';\n\n/**\n * Gets all supported sdk languages\n * @returns mapping of sdk language aliases to name\n */\nexport const allSdkLanguages = (): Record<string, string> => {\n const languages: ArgValues = {};\n codeGenerators.forEach(gen => {\n const alias = gen.extension.toString().match(/\\.(\\w+)\\b/)![1];\n languages[alias] = gen.language;\n });\n\n return { ...languages, [allAlias]: 'All' };\n};\n\n/**\n * Searches for sdk language details given label\n * @param label label to search by\n * @returns language name and alias\n */\nexport const findSdk = (label: string) => {\n const languages = allSdkLanguages();\n let match = { alias: allAlias, language: languages[allAlias] };\n for (const [alias, language] of Object.entries(languages)) {\n if (\n !label.localeCompare(alias, 'en', { sensitivity: 'base' }) ||\n !label.localeCompare(language, 'en', { sensitivity: 'base' })\n ) {\n match = { alias, language };\n break;\n }\n }\n return match;\n};\n"],"mappings":";;;;;;AA2BA,IAAAA,WAAA,GAAAC,OAAA;AAAqD,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAA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AG,CAACE,SAAS,CAACC,QAAQ,CAAC,CAAC,CAACC,KAAK,CAAC,WAAW,CAAC,CAAE,CAAC,CAAC;IAC7DN,SAAS,CAACG,KAAK,CAAC,GAAGD,GAAG,CAACK,QAAQ;EACjC,CAAC,CAAC;EAEF,OAAAhC,aAAA,CAAAA,aAAA,KAAYyB,SAAS;IAAE,CAACH,QAAQ,GAAG;EAAK;AAC1C,CAAC;AAACC,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAOK,IAAMS,OAAO,GAAIC,KAAa,IAAK;EACxC,IAAMT,SAAS,GAAGD,eAAe,CAAC,CAAC;EACnC,IAAIO,KAAK,GAAG;IAAEH,KAAK,EAAEN,QAAQ;IAAEU,QAAQ,EAAEP,SAAS,CAACH,QAAQ;EAAE,CAAC;EAC9D,KAAK,IAAM,CAACM,KAAK,EAAEI,QAAQ,CAAC,IAAIzC,MAAM,CAAC4C,OAAO,CAACV,SAAS,CAAC,EAAE;IACzD,IACE,CAACS,KAAK,CAACE,aAAa,CAACR,KAAK,EAAE,IAAI,EAAE;MAAES,WAAW,EAAE;IAAO,CAAC,CAAC,IAC1D,CAACH,KAAK,CAACE,aAAa,CAACJ,QAAQ,EAAE,IAAI,EAAE;MAAEK,WAAW,EAAE;IAAO,CAAC,CAAC,EAC7D;MACAN,KAAK,GAAG;QAAEH,KAAK;QAAEI;MAAS,CAAC;MAC3B;IACF;EACF;EACA,OAAOD,KAAK;AACd,CAAC;AAACR,OAAA,CAAAU,OAAA,GAAAA,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looker/api-explorer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.67",
|
|
4
4
|
"description": "Looker API Explorer",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@looker/components-test-utils": "^1.5.27",
|
|
36
|
-
"@looker/sdk-codegen-scripts": "21.5.
|
|
37
|
-
"@looker/sdk-node": "24.
|
|
36
|
+
"@looker/sdk-codegen-scripts": "21.5.24",
|
|
37
|
+
"@looker/sdk-node": "24.16.2",
|
|
38
38
|
"@styled-icons/styled-icon": "^10.6.3",
|
|
39
39
|
"@testing-library/jest-dom": "5.16.5",
|
|
40
40
|
"@testing-library/react": "12.1.5",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"webpack-merge": "^5.7.3"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@looker/code-editor": "0.1.
|
|
73
|
+
"@looker/code-editor": "0.1.34",
|
|
74
74
|
"@looker/components": "^4.1.3",
|
|
75
75
|
"@looker/design-tokens": "^3.1.0",
|
|
76
|
-
"@looker/extension-utils": "0.1.
|
|
76
|
+
"@looker/extension-utils": "0.1.44",
|
|
77
77
|
"@looker/icons": "^1.5.21",
|
|
78
78
|
"@looker/redux": "^0.0.1",
|
|
79
|
-
"@looker/run-it": "0.9.
|
|
80
|
-
"@looker/sdk": "24.
|
|
81
|
-
"@looker/sdk-codegen": "21.9.
|
|
82
|
-
"@looker/sdk-rtl": "21.6.
|
|
79
|
+
"@looker/run-it": "0.9.67",
|
|
80
|
+
"@looker/sdk": "24.16.2",
|
|
81
|
+
"@looker/sdk-codegen": "21.9.3",
|
|
82
|
+
"@looker/sdk-rtl": "21.6.3",
|
|
83
83
|
"@reduxjs/toolkit": "^1.9.3",
|
|
84
84
|
"@styled-icons/material": "^10.47.0",
|
|
85
85
|
"@styled-icons/material-outlined": "^10.47.0",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"styled-components": "^5.3.1",
|
|
98
98
|
"typed-redux-saga": "^1.5.0"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e7e30025690483553a16231c9218cd6f7e65a59b"
|
|
101
101
|
}
|
package/src/ApiExplorer.tsx
CHANGED
|
@@ -103,7 +103,7 @@ export const ApiExplorer: FC<ApiExplorerProps> = ({
|
|
|
103
103
|
|
|
104
104
|
const hasNavigationToggle = useCallback((e: MessageEvent<any>) => {
|
|
105
105
|
if (e.origin === window.origin && e.data.action === 'toggle_sidebar') {
|
|
106
|
-
setHasNavigation(
|
|
106
|
+
setHasNavigation(currentHasNavigation => !currentHasNavigation);
|
|
107
107
|
}
|
|
108
108
|
}, []);
|
|
109
109
|
|
|
@@ -29,7 +29,7 @@ describe('DocMarkdown utils', () => {
|
|
|
29
29
|
describe('hashbang url remapping', () => {
|
|
30
30
|
test.each(['#!/methodTag', '#!/4.0/methodTag'])(
|
|
31
31
|
'it correctly maps %s tag urls',
|
|
32
|
-
|
|
32
|
+
url => {
|
|
33
33
|
const result = remapHashURL('4.0', url);
|
|
34
34
|
expect(result).toEqual('/4.0/methods/methodTag');
|
|
35
35
|
}
|
|
@@ -37,7 +37,7 @@ describe('DocMarkdown utils', () => {
|
|
|
37
37
|
|
|
38
38
|
test.each(['#!/4.0/methodTag/methodName', '#!/methodTag/methodName'])(
|
|
39
39
|
'it correctly maps %s method urls ',
|
|
40
|
-
|
|
40
|
+
hashbangUrl => {
|
|
41
41
|
const result = remapHashURL('4.0', hashbangUrl);
|
|
42
42
|
expect(result).toEqual('/4.0/methods/methodTag/methodName');
|
|
43
43
|
}
|
|
@@ -33,8 +33,8 @@ import { DocParam } from './DocParam';
|
|
|
33
33
|
|
|
34
34
|
describe('DocParam', () => {
|
|
35
35
|
const allParams = api.methods.run_look.allParams;
|
|
36
|
-
const optionalParam = allParams.filter(
|
|
37
|
-
const requiredParam = allParams.filter(
|
|
36
|
+
const optionalParam = allParams.filter(val => !val.required)[0];
|
|
37
|
+
const requiredParam = allParams.filter(val => val.required)[0];
|
|
38
38
|
|
|
39
39
|
test('it renders', () => {
|
|
40
40
|
renderWithTheme(<DocParam parameter={requiredParam} />);
|
|
@@ -53,8 +53,8 @@ describe('DocParams', () => {
|
|
|
53
53
|
|
|
54
54
|
test('it works when method has both required and optional params', () => {
|
|
55
55
|
const params = api.methods.user.allParams;
|
|
56
|
-
const requiredParams = params.filter(
|
|
57
|
-
const optionalParams = params.filter(
|
|
56
|
+
const requiredParams = params.filter(param => param.required);
|
|
57
|
+
const optionalParams = params.filter(param => !param.required);
|
|
58
58
|
expect(requiredParams).toHaveLength(1);
|
|
59
59
|
expect(optionalParams).toHaveLength(1);
|
|
60
60
|
|
|
@@ -37,7 +37,7 @@ describe('DocPseudo', () => {
|
|
|
37
37
|
renderWithTheme(<DocPseudo method={method} />);
|
|
38
38
|
expect(screen.getByText(method.name, { exact: false })).toBeInTheDocument();
|
|
39
39
|
|
|
40
|
-
method.params.forEach(
|
|
40
|
+
method.params.forEach(param => {
|
|
41
41
|
expect(
|
|
42
42
|
screen.getByText(param.name, { exact: false })
|
|
43
43
|
).toBeInTheDocument();
|
|
@@ -35,7 +35,7 @@ import { DocSDKs } from './DocSDKs';
|
|
|
35
35
|
|
|
36
36
|
describe('DocSDKs', () => {
|
|
37
37
|
let store: Store<RootState>;
|
|
38
|
-
const supportedLanguages = codeGenerators.map(
|
|
38
|
+
const supportedLanguages = codeGenerators.map(g => g.language);
|
|
39
39
|
const pattern = new RegExp(`${supportedLanguages.join('|')}`);
|
|
40
40
|
|
|
41
41
|
beforeAll(() => {
|
|
@@ -64,7 +64,7 @@ describe('DocSDKs', () => {
|
|
|
64
64
|
|
|
65
65
|
test.each(supportedLanguages)(
|
|
66
66
|
'it can render a %s method declaration',
|
|
67
|
-
|
|
67
|
+
sdkLanguage => {
|
|
68
68
|
store = createTestStore({
|
|
69
69
|
settings: {
|
|
70
70
|
initialized: false,
|
|
@@ -29,7 +29,7 @@ import { DataTableCell, Span } from '@looker/components';
|
|
|
29
29
|
|
|
30
30
|
import { getTableItemBottomBorder } from './utils';
|
|
31
31
|
|
|
32
|
-
export const DocSdkExampleCell: FC<PropsWithChildren<any>> =
|
|
32
|
+
export const DocSdkExampleCell: FC<PropsWithChildren<any>> = props => (
|
|
33
33
|
<DataTableCell
|
|
34
34
|
style={{ borderBottom: getTableItemBottomBorder(props.hideBorderBottom) }}
|
|
35
35
|
>
|
|
@@ -110,7 +110,7 @@ export function prepareExampleDataTable(
|
|
|
110
110
|
const languageExamples = findExamples(examples, language, operationId);
|
|
111
111
|
return [
|
|
112
112
|
...result,
|
|
113
|
-
...languageExamples.map(
|
|
113
|
+
...languageExamples.map(exampleLink => {
|
|
114
114
|
return {
|
|
115
115
|
filename: getFileNameFromPath(exampleLink.tooltip),
|
|
116
116
|
line: exampleLink.lineNumber,
|
|
@@ -120,7 +120,8 @@ export function prepareExampleDataTable(
|
|
|
120
120
|
};
|
|
121
121
|
}),
|
|
122
122
|
];
|
|
123
|
-
},
|
|
123
|
+
},
|
|
124
|
+
[]);
|
|
124
125
|
|
|
125
126
|
const pageExamples = tableExamples.filter(
|
|
126
127
|
(example, index) =>
|
|
@@ -50,26 +50,26 @@ export const SomethingWentWrong: React.FC<SomethingWentWrongProps> = ({
|
|
|
50
50
|
|
|
51
51
|
const OuterFlex = styled(Flex)`
|
|
52
52
|
width: 100%;
|
|
53
|
-
margin-top: ${
|
|
53
|
+
margin-top: ${props => props.theme.space.xxxxlarge};
|
|
54
54
|
justify-content: center;
|
|
55
55
|
flex-direction: column;
|
|
56
56
|
align-items: center;
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
59
|
const HeaderText = styled.h1`
|
|
60
|
-
margin-top: ${
|
|
60
|
+
margin-top: ${props => props.theme.space.large};
|
|
61
61
|
text-align: center;
|
|
62
|
-
font-family: ${
|
|
63
|
-
font-weight: ${
|
|
64
|
-
font-size: ${
|
|
65
|
-
color: ${
|
|
62
|
+
font-family: ${props => props.theme.fonts.brand};
|
|
63
|
+
font-weight: ${props => props.theme.fontWeights.normal};
|
|
64
|
+
font-size: ${props => props.theme.fontSizes.xxxxlarge};
|
|
65
|
+
color: ${props => props.theme.colors.text5};
|
|
66
66
|
`;
|
|
67
67
|
|
|
68
68
|
const ActionMessage = styled.h3`
|
|
69
|
-
margin-top: ${
|
|
69
|
+
margin-top: ${props => props.theme.space.small};
|
|
70
70
|
text-align: center;
|
|
71
|
-
font-family: ${
|
|
72
|
-
font-weight: ${
|
|
73
|
-
font-size: ${
|
|
74
|
-
color: ${
|
|
71
|
+
font-family: ${props => props.theme.fonts.brand};
|
|
72
|
+
font-weight: ${props => props.theme.fontWeights.normal};
|
|
73
|
+
font-size: ${props => props.theme.fontSizes.large};
|
|
74
|
+
color: ${props => props.theme.colors.text3};
|
|
75
75
|
`;
|
|
@@ -149,7 +149,7 @@ export const ExplorePropertyReadOnly: FC<ExplorePropertyProps> = ({
|
|
|
149
149
|
* @param property to describe
|
|
150
150
|
* @constructor
|
|
151
151
|
*/
|
|
152
|
-
const DescriptionParagraph: FC =
|
|
152
|
+
const DescriptionParagraph: FC = props => (
|
|
153
153
|
<Paragraph fontSize="small" m="none" {...props} />
|
|
154
154
|
);
|
|
155
155
|
|
|
@@ -270,7 +270,7 @@ export const ExplorePropertyType: FC<ExplorePropertyTypeProps> = ({
|
|
|
270
270
|
density={-3}
|
|
271
271
|
detail={<ExplorePropertyDetail api={api} property={property} />}
|
|
272
272
|
>
|
|
273
|
-
{Object.values(props).map(
|
|
273
|
+
{Object.values(props).map(property => (
|
|
274
274
|
<ExploreProperty
|
|
275
275
|
api={api}
|
|
276
276
|
key={property.fullName}
|