@looker/extension-utils 0.1.23 → 0.1.25
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 +24 -0
- package/lib/APIErrorDisplay/APIErrorContent.js.map +1 -1
- package/lib/APIErrorDisplay/APIErrorDetails.js.map +1 -1
- package/lib/APIErrorDisplay/APIErrorDialog.js.map +1 -1
- package/lib/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
- package/lib/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
- package/lib/APIErrorDisplay/index.js.map +1 -1
- package/lib/APIErrorDisplay/utils.js.map +1 -1
- package/lib/ExtMarkdown.js.map +1 -1
- package/lib/OAuthForm/index.d.ts +1 -0
- package/lib/OAuthForm/index.js +17 -0
- package/lib/OAuthForm/index.js.map +1 -0
- package/lib/{esm/OAuthConfigForm/Collapser → OAuthForm/src/components}/CollapserCard.js +1 -1
- package/lib/OAuthForm/src/components/CollapserCard.js.map +1 -0
- package/lib/{OAuthConfigForm → OAuthForm/src/components}/ConfigHeading.js +1 -1
- package/lib/OAuthForm/src/components/ConfigHeading.js.map +1 -0
- package/lib/{OAuthConfigForm/OAuthConfigForm.d.ts → OAuthForm/src/components/OAuthForm.d.ts} +1 -1
- package/lib/{OAuthConfigForm/OAuthConfigForm.js → OAuthForm/src/components/OAuthForm.js} +70 -60
- package/lib/OAuthForm/src/components/OAuthForm.js.map +1 -0
- package/lib/OAuthForm/src/components/index.d.ts +1 -0
- package/lib/OAuthForm/src/components/index.js +13 -0
- package/lib/OAuthForm/src/components/index.js.map +1 -0
- package/lib/OAuthForm/src/index.d.ts +2 -0
- package/lib/OAuthForm/src/index.js +28 -0
- package/lib/OAuthForm/src/index.js.map +1 -0
- package/lib/OAuthForm/src/state/index.d.ts +1 -0
- package/lib/OAuthForm/src/state/index.js +13 -0
- package/lib/OAuthForm/src/state/index.js.map +1 -0
- package/lib/OAuthForm/src/state/slice.d.ts +64 -0
- package/lib/OAuthForm/src/state/slice.js +83 -0
- package/lib/OAuthForm/src/state/slice.js.map +1 -0
- package/lib/OAuthForm/src/utils.js.map +1 -0
- package/lib/OAuthScene.js.map +1 -1
- package/lib/adaptorUtils.js.map +1 -1
- package/lib/authUtils.js.map +1 -1
- package/lib/browserAdaptor.js.map +1 -1
- package/lib/esm/APIErrorDisplay/APIErrorContent.js.map +1 -1
- package/lib/esm/APIErrorDisplay/APIErrorDetails.js.map +1 -1
- package/lib/esm/APIErrorDisplay/APIErrorDialog.js.map +1 -1
- package/lib/esm/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
- package/lib/esm/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
- package/lib/esm/APIErrorDisplay/index.js.map +1 -1
- package/lib/esm/APIErrorDisplay/utils.js.map +1 -1
- package/lib/esm/ExtMarkdown.js.map +1 -1
- package/lib/esm/OAuthForm/index.js +17 -0
- package/lib/esm/OAuthForm/index.js.map +1 -0
- package/lib/{OAuthConfigForm/Collapser → esm/OAuthForm/src/components}/CollapserCard.js +1 -1
- package/lib/esm/OAuthForm/src/components/CollapserCard.js.map +1 -0
- package/lib/esm/{OAuthConfigForm → OAuthForm/src/components}/ConfigHeading.js +1 -1
- package/lib/esm/OAuthForm/src/components/ConfigHeading.js.map +1 -0
- package/lib/esm/{OAuthConfigForm/OAuthConfigForm.js → OAuthForm/src/components/OAuthForm.js} +70 -60
- package/lib/esm/OAuthForm/src/components/OAuthForm.js.map +1 -0
- package/lib/esm/OAuthForm/src/components/index.js +13 -0
- package/lib/esm/OAuthForm/src/components/index.js.map +1 -0
- package/lib/esm/OAuthForm/src/index.js +28 -0
- package/lib/esm/OAuthForm/src/index.js.map +1 -0
- package/lib/esm/OAuthForm/src/state/index.js +13 -0
- package/lib/esm/OAuthForm/src/state/index.js.map +1 -0
- package/lib/esm/OAuthForm/src/state/slice.js +83 -0
- package/lib/esm/OAuthForm/src/state/slice.js.map +1 -0
- package/lib/esm/OAuthForm/src/utils.js.map +1 -0
- package/lib/esm/OAuthScene.js.map +1 -1
- package/lib/esm/adaptorUtils.js.map +1 -1
- package/lib/esm/authUtils.js.map +1 -1
- package/lib/esm/browserAdaptor.js.map +1 -1
- package/lib/esm/extensionAdaptor.js.map +1 -1
- package/lib/esm/index.js +4 -4
- package/lib/esm/index.js.map +1 -1
- package/lib/extensionAdaptor.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/package.json +8 -5
- package/lib/OAuthConfigForm/Collapser/CollapserCard.js.map +0 -1
- package/lib/OAuthConfigForm/Collapser/index.d.ts +0 -1
- package/lib/OAuthConfigForm/Collapser/index.js +0 -13
- package/lib/OAuthConfigForm/Collapser/index.js.map +0 -1
- package/lib/OAuthConfigForm/ConfigHeading.js.map +0 -1
- package/lib/OAuthConfigForm/OAuthConfigForm.js.map +0 -1
- package/lib/OAuthConfigForm/index.d.ts +0 -1
- package/lib/OAuthConfigForm/index.js +0 -13
- package/lib/OAuthConfigForm/index.js.map +0 -1
- package/lib/OAuthConfigForm/utils.js.map +0 -1
- package/lib/esm/OAuthConfigForm/Collapser/CollapserCard.js.map +0 -1
- package/lib/esm/OAuthConfigForm/Collapser/index.js +0 -13
- package/lib/esm/OAuthConfigForm/Collapser/index.js.map +0 -1
- package/lib/esm/OAuthConfigForm/ConfigHeading.js.map +0 -1
- package/lib/esm/OAuthConfigForm/OAuthConfigForm.js.map +0 -1
- package/lib/esm/OAuthConfigForm/index.js +0 -13
- package/lib/esm/OAuthConfigForm/index.js.map +0 -1
- package/lib/esm/OAuthConfigForm/utils.js.map +0 -1
- /package/lib/{OAuthConfigForm/Collapser → OAuthForm/src/components}/CollapserCard.d.ts +0 -0
- /package/lib/{OAuthConfigForm → OAuthForm/src/components}/ConfigHeading.d.ts +0 -0
- /package/lib/{OAuthConfigForm → OAuthForm/src}/utils.d.ts +0 -0
- /package/lib/{OAuthConfigForm → OAuthForm/src}/utils.js +0 -0
- /package/lib/esm/{OAuthConfigForm → OAuthForm/src}/utils.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,30 @@
|
|
|
15
15
|
* @looker/extension-sdk-react bumped from ^23.4.0 to ^23.6.0
|
|
16
16
|
* @looker/sdk bumped from ^23.4.0 to ^23.6.0
|
|
17
17
|
|
|
18
|
+
### Dependencies
|
|
19
|
+
|
|
20
|
+
* The following workspace dependencies were updated
|
|
21
|
+
* dependencies
|
|
22
|
+
* @looker/extension-sdk bumped from ^23.8.0 to ^23.8.1
|
|
23
|
+
* @looker/extension-sdk-react bumped from ^23.8.0 to ^23.8.1
|
|
24
|
+
* @looker/sdk bumped from ^23.8.0 to ^23.8.1
|
|
25
|
+
|
|
26
|
+
## [0.1.24](https://github.com/looker-open-source/sdk-codegen/compare/extension-utils-v0.1.23...extension-utils-v0.1.24) (2023-05-11)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* replace @looker/redux for with npm dependency ([#1307](https://github.com/looker-open-source/sdk-codegen/issues/1307)) ([baa58db](https://github.com/looker-open-source/sdk-codegen/commit/baa58db1bce9d974384c63a0e11301f38774a7b2))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @looker/extension-sdk bumped from ^23.6.0 to ^23.8.0
|
|
39
|
+
* @looker/extension-sdk-react bumped from ^23.6.0 to ^23.8.0
|
|
40
|
+
* @looker/sdk bumped from ^23.6.0 to ^23.8.0
|
|
41
|
+
|
|
18
42
|
## [0.1.22](https://github.com/looker-open-source/sdk-codegen/compare/extension-utils-v0.1.21...extension-utils-v0.1.22) (2023-03-31)
|
|
19
43
|
|
|
20
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIErrorContent.js","names":["
|
|
1
|
+
{"version":3,"file":"APIErrorContent.js","names":["_react","_interopRequireWildcard","require","_sdkRtl","_adaptorUtils","_ExtMarkdown","_APIErrorDetails","_APIErrorDocLink","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","APIErrorContent","_ref","_error$documentation_","showDoc","doc","setDoc","useState","getDoc","useCallback","_ref2","docUrl","adaptor","getEnvAdaptor","errDoc","ErrorDoc","sdk","apiErrorDisplayFetch","content","_x","useEffect","documentation_url","createElement","Fragment","APIErrorDetails","APIErrorDocLink","ExtMarkdown","source","exports"],"sources":["../../src/APIErrorDisplay/APIErrorContent.tsx"],"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 */\n\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { ErrorDoc } from '@looker/sdk-rtl'\nimport { getEnvAdaptor } from '../adaptorUtils'\nimport { ExtMarkdown } from '../ExtMarkdown'\nimport { APIErrorDetails } from './APIErrorDetails'\nimport { APIErrorDocLink } from './APIErrorDocLink'\nimport type { APIErrorDisplayProps } from './APIErrorDisplay'\nimport { apiErrorDisplayFetch } from './utils'\n\n/**\n * Shows available content of an API Error response\n * @param error to display\n * @param showDoc true to retrieve the corresponding error markdown\n */\nexport const APIErrorContent = ({ error, showDoc }: APIErrorDisplayProps) => {\n const [doc, setDoc] = useState<string>('')\n const getDoc = useCallback(\n async (docUrl: string) => {\n const adaptor = getEnvAdaptor()\n const errDoc = new ErrorDoc(adaptor.sdk, apiErrorDisplayFetch)\n setDoc(await errDoc.content(docUrl))\n },\n [error]\n )\n\n useEffect(() => {\n if (showDoc && error && error.documentation_url) {\n getDoc(error.documentation_url)\n }\n }, [error, showDoc])\n\n return (\n <>\n <APIErrorDetails error={error} />\n {!showDoc && <APIErrorDocLink docUrl={error.documentation_url ?? ''} />}\n {showDoc && doc && <ExtMarkdown source={doc} />}\n </>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAA8C,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAA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EvD,MAAA,CAAAgB,OAAA,CAAAyD,aAAA,CAAAzE,MAAA,CAAAgB,OAAA,CAAA0D,QAAA,QACE1E,MAAA,CAAAgB,OAAA,CAAAyD,aAAA,CAACnE,gBAAA,CAAAqE,eAAe;IAACnC,KAAK,EAAEA;EAAM,EAAG,EAChC,CAACe,OAAO,IAAIvD,MAAA,CAAAgB,OAAA,CAAAyD,aAAA,CAAClE,gBAAA,CAAAqE,eAAe;IAACd,MAAM,GAAAR,qBAAA,GAAEd,KAAK,CAACgC,iBAAiB,cAAAlB,qBAAA,cAAAA,qBAAA,GAAI;EAAG,EAAG,EACtEC,OAAO,IAAIC,GAAG,IAAIxD,MAAA,CAAAgB,OAAA,CAAAyD,aAAA,CAACpE,YAAA,CAAAwE,WAAW;IAACC,MAAM,EAAEtB;EAAI,EAAG,CAC9C;AAEP,CAAC;AAAAuB,OAAA,CAAA3B,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIErrorDetails.js","names":["APIErrorDetails","error","errors","map","index","field","code","message"],"sources":["../../src/APIErrorDisplay/APIErrorDetails.tsx"],"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 */\n\nimport type { LookerSDKError } from '@looker/sdk-rtl'\nimport React from 'react'\nimport {\n Span,\n Table,\n TableBody,\n TableDataCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from '@looker/components'\n\ninterface APIErrorDetailsProps {\n error: LookerSDKError\n}\n\n/**\n * Shows the detailed API errors table\n *\n * Because documentation_url is currently identical with the main documentation_url\n * it is not included in the table\n *\n * @param error to display\n */\nexport const APIErrorDetails = ({ error }: APIErrorDetailsProps) => {\n if (!error?.errors) return <></>\n\n return (\n <Table>\n <TableHead>\n <TableRow>\n <TableHeaderCell p=\"xsmall\">Field</TableHeaderCell>\n <TableHeaderCell p=\"xsmall\">Code</TableHeaderCell>\n <TableHeaderCell p=\"xsmall\">Message</TableHeaderCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {error.errors.map(({ field, code, message }, index) => (\n <TableRow key={`${field}${index}`}>\n <TableDataCell p=\"xsmall\">{field}</TableDataCell>\n <TableDataCell p=\"xsmall\">{code}</TableDataCell>\n <TableDataCell p=\"xsmall\">\n <Span>{message}</Span>\n </TableDataCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AAQ2B;AAcpB,
|
|
1
|
+
{"version":3,"file":"APIErrorDetails.js","names":["_react","_interopRequireDefault","require","_components","obj","__esModule","default","APIErrorDetails","_ref","error","errors","createElement","Fragment","Table","TableHead","TableRow","TableHeaderCell","p","TableBody","map","_ref2","index","field","code","message","key","concat","TableDataCell","Span","exports"],"sources":["../../src/APIErrorDisplay/APIErrorDetails.tsx"],"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 */\n\nimport type { LookerSDKError } from '@looker/sdk-rtl'\nimport React from 'react'\nimport {\n Span,\n Table,\n TableBody,\n TableDataCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from '@looker/components'\n\ninterface APIErrorDetailsProps {\n error: LookerSDKError\n}\n\n/**\n * Shows the detailed API errors table\n *\n * Because documentation_url is currently identical with the main documentation_url\n * it is not included in the table\n *\n * @param error to display\n */\nexport const APIErrorDetails = ({ error }: APIErrorDetailsProps) => {\n if (!error?.errors) return <></>\n\n return (\n <Table>\n <TableHead>\n <TableRow>\n <TableHeaderCell p=\"xsmall\">Field</TableHeaderCell>\n <TableHeaderCell p=\"xsmall\">Code</TableHeaderCell>\n <TableHeaderCell p=\"xsmall\">Message</TableHeaderCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {error.errors.map(({ field, code, message }, index) => (\n <TableRow key={`${field}${index}`}>\n <TableDataCell p=\"xsmall\">{field}</TableDataCell>\n <TableDataCell p=\"xsmall\">{code}</TableDataCell>\n <TableDataCell p=\"xsmall\">\n <Span>{message}</Span>\n </TableD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AAJ,KAAA;IAAA,OACzCpB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAY,QAAQ;MAACU,GAAG,KAAAC,MAAA,CAAKJ,KAAK,EAAAI,MAAA,CAAGL,KAAK;IAAG,GAChCrB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAwB,aAAa;MAACV,CAAC,EAAC;IAAQ,GAAEK,KAAK,CAAiB,EACjDtB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAwB,aAAa;MAACV,CAAC,EAAC;IAAQ,GAAEM,IAAI,CAAiB,EAChDvB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAwB,aAAa;MAACV,CAAC,EAAC;IAAQ,GACvBjB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAyB,IAAI,QAAEJ,OAAO,CAAQ,CACR,CACP;EAAA,CACZ,CAAC,CACQ,CACN;AAEZ,CAAC;AAAAK,OAAA,CAAAtB,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIErrorDialog.js","names":["APIErrorDialog","error","isOpen","setOpen","showDoc","errorHeading"],"sources":["../../src/APIErrorDisplay/APIErrorDialog.tsx"],"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 */\n\nimport React from 'react'\nimport { Button, Dialog, DialogLayout } from '@looker/components'\nimport type { APIErrorDisplayProps } from './APIErrorDisplay'\nimport { APIErrorContent } from './APIErrorContent'\nimport { errorHeading } from './utils'\n\ninterface APIErrorDialogProps extends APIErrorDisplayProps {\n /** toggle for dialog being open */\n isOpen: boolean\n /** callback for toggling the dialog display */\n setOpen: (open: boolean) => void\n}\n\nexport const APIErrorDialog = ({\n error,\n isOpen,\n setOpen,\n showDoc = false,\n}: APIErrorDialogProps) => (\n <Dialog\n isOpen={isOpen}\n content={\n <DialogLayout\n header={errorHeading(error)}\n footer={\n <Button size=\"xsmall\" onClick={() => setOpen && setOpen(false)}>\n OK\n </Button>\n }\n >\n <APIErrorContent error={error} showDoc={showDoc} />\n </DialogLayout>\n }\n />\n)\n"],"mappings":";;;;;;AA0BA;AACA;AAEA;AACA;AAAsC;AAS/B,
|
|
1
|
+
{"version":3,"file":"APIErrorDialog.js","names":["_react","_interopRequireDefault","require","_components","_APIErrorContent","_utils","obj","__esModule","default","APIErrorDialog","_ref","error","isOpen","setOpen","showDoc","createElement","Dialog","content","DialogLayout","header","errorHeading","footer","Button","size","onClick","APIErrorContent","exports"],"sources":["../../src/APIErrorDisplay/APIErrorDialog.tsx"],"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 */\n\nimport React from 'react'\nimport { Button, Dialog, DialogLayout } from '@looker/components'\nimport type { APIErrorDisplayProps } from './APIErrorDisplay'\nimport { APIErrorContent } from './APIErrorContent'\nimport { errorHeading } from './utils'\n\ninterface APIErrorDialogProps extends APIErrorDisplayProps {\n /** toggle for dialog being open */\n isOpen: boolean\n /** callback for toggling the dialog display */\n setOpen: (open: boolean) => void\n}\n\nexport const APIErrorDialog = ({\n error,\n isOpen,\n setOpen,\n showDoc = false,\n}: APIErrorDialogProps) => (\n <Dialog\n isOpen={isOpen}\n content={\n <DialogLayout\n header={errorHeading(error)}\n footer={\n <Button size=\"xsmall\" onClick={() => setOpen && setOpen(false)}>\n OK\n </Button>\n }\n >\n <APIErrorContent error={error} showDoc={showDoc} />\n </DialogLayout>\n }\n />\n)\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAsC,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAS/B,IAAMG,cAAc,GAAGC,IAAA;EAAA,IAAC;IAC7BC,KAAK;IACLC,MAAM;IACNC,OAAO;IACPC,OAAO,GAAG;EACS,CAAC,GAAAJ,IAAA;EAAA,OACpBV,MAAA,CAAAQ,OAAA,CAAAO,aAAA,CAACZ,WAAA,CAAAa,MAAM;IACLJ,MAAM,EAAEA,MAAO;IACfK,OAAO,EACLjB,MAAA,CAAAQ,OAAA,CAAAO,aAAA,CAACZ,WAAA,CAAAe,YAAY;MACXC,MAAM,EAAE,IAAAC,mBAAY,EAACT,KAAK,CAAE;MAC5BU,MAAM,EACJrB,MAAA,CAAAQ,OAAA,CAAAO,aAAA,CAACZ,WAAA,CAAAmB,MAAM;QAACC,IAAI,EAAC,QAAQ;QAACC,OAAO,EAAEA,CAAA,KAAMX,OAAO,IAAIA,OAAO,CAAC,KAAK;MAAE,GAAC,IAEhE;IACD,GAEDb,MAAA,CAAAQ,OAAA,CAAAO,aAAA,CAACX,gBAAA,CAAAqB,eAAe;MAACd,KAAK,EAAEA,KAAM;MAACG,OAAO,EAAEA;IAAQ,EAAG;EAEtD,EACD;AAAA,CACH;AAAAY,OAAA,CAAAjB,cAAA,GAAAA,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIErrorDisplay.js","names":["APIErrorDisplay","error","showDoc","errorHeading"],"sources":["../../src/APIErrorDisplay/APIErrorDisplay.tsx"],"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 */\n\nimport React from 'react'\nimport type { LookerSDKError } from '@looker/sdk-rtl'\nimport { Heading, SpaceVertical } from '@looker/components'\nimport { APIErrorContent } from './APIErrorContent'\nimport { errorHeading } from './utils'\n\nexport interface APIErrorDisplayProps {\n /** Populated SDK error information, which may contain detailed errors */\n error: LookerSDKError\n /** true to retrieve the markdown error document from the CDN and display it instead of a link */\n showDoc?: boolean\n}\n\n/**\n * Show API error information in the parent React component\n * @param error to display\n * @param showDoc true to fetch the error document markdown. false for a clickable link\n */\nexport const APIErrorDisplay = ({\n error,\n showDoc = false,\n}: APIErrorDisplayProps) => {\n return (\n <>\n {error && (\n <SpaceVertical>\n <Heading type=\"h2\">{errorHeading(error)}</Heading>\n <APIErrorContent error={error} showDoc={showDoc} />\n </SpaceVertical>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AA0BA;AAEA;AACA;AACA;AAAsC;AAc/B,
|
|
1
|
+
{"version":3,"file":"APIErrorDisplay.js","names":["_react","_interopRequireDefault","require","_components","_APIErrorContent","_utils","obj","__esModule","default","APIErrorDisplay","_ref","error","showDoc","createElement","Fragment","SpaceVertical","Heading","type","errorHeading","APIErrorContent","exports"],"sources":["../../src/APIErrorDisplay/APIErrorDisplay.tsx"],"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 */\n\nimport React from 'react'\nimport type { LookerSDKError } from '@looker/sdk-rtl'\nimport { Heading, SpaceVertical } from '@looker/components'\nimport { APIErrorContent } from './APIErrorContent'\nimport { errorHeading } from './utils'\n\nexport interface APIErrorDisplayProps {\n /** Populated SDK error information, which may contain detailed errors */\n error: LookerSDKError\n /** true to retrieve the markdown error document from the CDN and display it instead of a link */\n showDoc?: boolean\n}\n\n/**\n * Show API error information in the parent React component\n * @param error to display\n * @param showDoc true to fetch the error document markdown. false for a clickable link\n */\nexport const APIErrorDisplay = ({\n error,\n showDoc = false,\n}: APIErrorDisplayProps) => {\n return (\n <>\n {error && (\n <SpaceVertical>\n <Heading type=\"h2\">{errorHeading(error)}</Heading>\n <APIErrorContent error={error} showDoc={showDoc} />\n </SpaceVertical>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAsC,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc/B,IAAMG,eAAe,GAAGC,IAAA,IAGH;EAAA,IAHI;IAC9BC,KAAK;IACLC,OAAO,GAAG;EACU,CAAC,GAAAF,IAAA;EACrB,OACEV,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAAAb,MAAA,CAAAQ,OAAA,CAAAM,QAAA,QACGH,KAAK,IACJX,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACV,WAAA,CAAAY,aAAa,QACZf,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACV,WAAA,CAAAa,OAAO;IAACC,IAAI,EAAC;EAAI,GAAE,IAAAC,mBAAY,EAACP,KAAK,CAAC,CAAW,EAClDX,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,gBAAA,CAAAe,eAAe;IAACR,KAAK,EAAEA,KAAM;IAACC,OAAO,EAAEA;EAAQ,EAAG,CAEtD,CACA;AAEP,CAAC;AAAAQ,OAAA,CAAAX,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIErrorDocLink.js","names":["APIErrorDocLink","docUrl","onClick","e","preventDefault","adaptor","getEnvAdaptor","openBrowserWindow","currentTarget","href"],"sources":["../../src/APIErrorDisplay/APIErrorDocLink.tsx"],"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 */\n\nimport React from 'react'\nimport { Link } from '@looker/components'\nimport { getEnvAdaptor } from '../adaptorUtils'\n\ninterface APIErrorDocLinkProps {\n docUrl?: string\n}\n\nexport const APIErrorDocLink = ({ docUrl }: APIErrorDocLinkProps) => {\n const onClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault()\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(e.currentTarget.href)\n }\n\n if (!docUrl) return <></>\n return (\n <Link href={docUrl} key={docUrl} onClick={onClick}>\n More information\n </Link>\n )\n}\n"],"mappings":";;;;;;AA0BA;AACA;AACA;AAA+C;AAMxC,
|
|
1
|
+
{"version":3,"file":"APIErrorDocLink.js","names":["_react","_interopRequireDefault","require","_components","_adaptorUtils","obj","__esModule","default","APIErrorDocLink","_ref","docUrl","onClick","e","preventDefault","adaptor","getEnvAdaptor","openBrowserWindow","currentTarget","href","createElement","Fragment","Link","key","exports"],"sources":["../../src/APIErrorDisplay/APIErrorDocLink.tsx"],"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 */\n\nimport React from 'react'\nimport { Link } from '@looker/components'\nimport { getEnvAdaptor } from '../adaptorUtils'\n\ninterface APIErrorDocLinkProps {\n docUrl?: string\n}\n\nexport const APIErrorDocLink = ({ docUrl }: APIErrorDocLinkProps) => {\n const onClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault()\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(e.currentTarget.href)\n }\n\n if (!docUrl) return <></>\n return (\n <Link href={docUrl} key={docUrl} onClick={onClick}>\n More information\n </Link>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA+C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMxC,IAAMG,eAAe,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EAC9D,IAAME,OAAO,GAAIC,CAAsC,IAAK;IAC1DA,CAAC,CAACC,cAAc,EAAE;IAClB,IAAMC,OAAO,GAAG,IAAAC,2BAAa,GAAE;IAC/BD,OAAO,CAACE,iBAAiB,CAACJ,CAAC,CAACK,aAAa,CAACC,IAAI,CAAC;EACjD,CAAC;EAED,IAAI,CAACR,MAAM,EAAE,OAAOV,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAAnB,MAAA,CAAAO,OAAA,CAAAa,QAAA,OAAK;EACzB,OACEpB,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,WAAA,CAAAkB,IAAI;IAACH,IAAI,EAAER,MAAO;IAACY,GAAG,EAAEZ,MAAO;IAACC,OAAO,EAAEA;EAAQ,GAAC,kBAEnD,CAAO;AAEX,CAAC;AAAAY,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/APIErrorDisplay/index.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 */\n\nexport * from './APIErrorDialog'\nexport * from './APIErrorDisplay'\nexport { apiErrorDisplayFetch } from './utils'\n"],"mappings":";;;;;;;;;;;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_APIErrorDialog","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_APIErrorDisplay","_utils"],"sources":["../../src/APIErrorDisplay/index.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 */\n\nexport * from './APIErrorDialog'\nexport * from './APIErrorDisplay'\nexport { apiErrorDisplayFetch } from './utils'\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAAA,eAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,eAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,eAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAb,eAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,gBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,gBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,gBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,gBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,MAAA,GAAAd,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["errorHeading","error","message","apiErrorDisplayFetch","_sdk","url","fetched","fetch","mode","result","text","stop","indexOf","substring","trim"],"sources":["../../src/APIErrorDisplay/utils.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 */\n\nimport type { LookerSDKError, IAPIMethods } from '@looker/sdk-rtl'\n\n/**\n * Default the heading to 'Unknown error' if error.message is blank for any reason\n * @param error for heading\n */\nexport const errorHeading = (error: LookerSDKError) =>\n error.message || 'Unknown error'\n\n/**\n * this callback function used by the ErrorDoc constructor gets and truncates\n * API error documents for use within API Explorer\n * @param _sdk required as a parameter, but it's ignored in this function\n * @param url of document (either index.json or md) to fetch\n */\nexport const apiErrorDisplayFetch = async (_sdk: IAPIMethods, url: string) => {\n const fetched = await fetch(url, { mode: 'cors' })\n let result = await fetched.text()\n const stop = result.indexOf('## API Response Type')\n if (stop > 0) {\n result = result.substring(0, stop - 1).trim()\n }\n return result\n}\n"],"mappings":";;;;;;;;AAgCO,IAAMA,YAAY,GAAIC,KAAqB,IAChDA,KAAK,CAACC,OAAO,IAAI,eAAe;
|
|
1
|
+
{"version":3,"file":"utils.js","names":["errorHeading","error","message","exports","apiErrorDisplayFetch","_ref","_asyncToGenerator","_sdk","url","fetched","fetch","mode","result","text","stop","indexOf","substring","trim","_x","_x2","apply","arguments"],"sources":["../../src/APIErrorDisplay/utils.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 */\n\nimport type { LookerSDKError, IAPIMethods } from '@looker/sdk-rtl'\n\n/**\n * Default the heading to 'Unknown error' if error.message is blank for any reason\n * @param error for heading\n */\nexport const errorHeading = (error: LookerSDKError) =>\n error.message || 'Unknown error'\n\n/**\n * this callback function used by the ErrorDoc constructor gets and truncates\n * API error documents for use within API Explorer\n * @param _sdk required as a parameter, but it's ignored in this function\n * @param url of document (either index.json or md) to fetch\n */\nexport const apiErrorDisplayFetch = async (_sdk: IAPIMethods, url: string) => {\n const fetched = await fetch(url, { mode: 'cors' })\n let result = await fetched.text()\n const stop = result.indexOf('## API Response Type')\n if (stop > 0) {\n result = result.substring(0, stop - 1).trim()\n }\n return result\n}\n"],"mappings":";;;;;;;;AAgCO,IAAMA,YAAY,GAAIC,KAAqB,IAChDA,KAAK,CAACC,OAAO,IAAI,eAAe;AAAAC,OAAA,CAAAH,YAAA,GAAAA,YAAA;AAQ3B,IAAMI,oBAAoB;EAAA,IAAAC,IAAA,GAAAC,iBAAA,CAAG,WAAOC,IAAiB,EAAEC,GAAW,EAAK;IAC5E,IAAMC,OAAO,SAASC,KAAK,CAACF,GAAG,EAAE;MAAEG,IAAI,EAAE;IAAO,CAAC,CAAC;IAClD,IAAIC,MAAM,SAASH,OAAO,CAACI,IAAI,EAAE;IACjC,IAAMC,IAAI,GAAGF,MAAM,CAACG,OAAO,CAAC,sBAAsB,CAAC;IACnD,IAAID,IAAI,GAAG,CAAC,EAAE;MACZF,MAAM,GAAGA,MAAM,CAACI,SAAS,CAAC,CAAC,EAAEF,IAAI,GAAG,CAAC,CAAC,CAACG,IAAI,EAAE;IAC/C;IACA,OAAOL,MAAM;EACf,CAAC;EAAA,gBARYR,oBAAoBA,CAAAc,EAAA,EAAAC,GAAA;IAAA,OAAAd,IAAA,CAAAe,KAAA,OAAAC,SAAA;EAAA;AAAA,GAQhC;AAAAlB,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
package/lib/ExtMarkdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtMarkdown.js","names":["ExtMarkdown","source","pattern","transformLinkUri","linkClickHandler","paragraphOverride","openBrowserWindow","_pathname","href","adaptor","getEnvAdaptor"],"sources":["../src/ExtMarkdown.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 */\n\nimport type { FC, ReactNode } from 'react'\nimport React from 'react'\nimport { Markdown } from '@looker/code-editor'\nimport { getEnvAdaptor } from './adaptorUtils'\n\ninterface ExtMarkdownProps {\n source: string\n pattern?: string\n transformLinkUri?: (url: string) => string\n linkClickHandler?: (pathname: string, href: string) => void\n paragraphOverride?: ({ children }: { children: ReactNode }) => ReactNode\n}\n\n/**\n * Simple wrapper on the standard Markdown component to handle link clicks in an extension\n * @param source markdown to render\n * @param pattern search pattern\n * @param transformLinkUri link pattern transformer override\n * @param linkClickHandler defaults to ExtensionSDK.openBrowserWindow()\n * @param paragraphOverride override paragraph display handling\n */\nexport const ExtMarkdown: FC<ExtMarkdownProps> = ({\n source,\n pattern = '',\n transformLinkUri,\n linkClickHandler,\n paragraphOverride,\n}) => {\n const openBrowserWindow = (_pathname: string, href: string) => {\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(href)\n }\n\n return (\n <Markdown\n source={source}\n pattern={pattern}\n transformLinkUri={transformLinkUri}\n linkClickHandler={linkClickHandler || openBrowserWindow}\n paragraphOverride={paragraphOverride}\n />\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AACA;AAA8C;AAkBvC,
|
|
1
|
+
{"version":3,"file":"ExtMarkdown.js","names":["_react","_interopRequireDefault","require","_codeEditor","_adaptorUtils","obj","__esModule","default","ExtMarkdown","_ref","source","pattern","transformLinkUri","linkClickHandler","paragraphOverride","openBrowserWindow","_pathname","href","adaptor","getEnvAdaptor","createElement","Markdown","exports"],"sources":["../src/ExtMarkdown.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 */\n\nimport type { FC, ReactNode } from 'react'\nimport React from 'react'\nimport { Markdown } from '@looker/code-editor'\nimport { getEnvAdaptor } from './adaptorUtils'\n\ninterface ExtMarkdownProps {\n source: string\n pattern?: string\n transformLinkUri?: (url: string) => string\n linkClickHandler?: (pathname: string, href: string) => void\n paragraphOverride?: ({ children }: { children: ReactNode }) => ReactNode\n}\n\n/**\n * Simple wrapper on the standard Markdown component to handle link clicks in an extension\n * @param source markdown to render\n * @param pattern search pattern\n * @param transformLinkUri link pattern transformer override\n * @param linkClickHandler defaults to ExtensionSDK.openBrowserWindow()\n * @param paragraphOverride override paragraph display handling\n */\nexport const ExtMarkdown: FC<ExtMarkdownProps> = ({\n source,\n pattern = '',\n transformLinkUri,\n linkClickHandler,\n paragraphOverride,\n}) => {\n const openBrowserWindow = (_pathname: string, href: string) => {\n const adaptor = getEnvAdaptor()\n adaptor.openBrowserWindow(href)\n }\n\n return (\n <Markdown\n source={source}\n pattern={pattern}\n transformLinkUri={transformLinkUri}\n linkClickHandler={linkClickHandler || openBrowserWindow}\n paragraphOverride={paragraphOverride}\n />\n )\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA8C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAkBvC,IAAMG,WAAiC,GAAGC,IAAA,IAM3C;EAAA,IAN4C;IAChDC,MAAM;IACNC,OAAO,GAAG,EAAE;IACZC,gBAAgB;IAChBC,gBAAgB;IAChBC;EACF,CAAC,GAAAL,IAAA;EACC,IAAMM,iBAAiB,GAAGA,CAACC,SAAiB,EAAEC,IAAY,KAAK;IAC7D,IAAMC,OAAO,GAAG,IAAAC,2BAAa,GAAE;IAC/BD,OAAO,CAACH,iBAAiB,CAACE,IAAI,CAAC;EACjC,CAAC;EAED,OACEjB,MAAA,CAAAO,OAAA,CAAAa,aAAA,CAACjB,WAAA,CAAAkB,QAAQ;IACPX,MAAM,EAAEA,MAAO;IACfC,OAAO,EAAEA,OAAQ;IACjBC,gBAAgB,EAAEA,gBAAiB;IACnCC,gBAAgB,EAAEA,gBAAgB,IAAIE,iBAAkB;IACxDD,iBAAiB,EAAEA;EAAkB,EACrC;AAEN,CAAC;AAAAQ,OAAA,CAAAd,WAAA,GAAAA,WAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _src = require("./src");
|
|
7
|
+
Object.keys(_src).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _src[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _src[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_src","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/OAuthForm/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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 './src'\n"],"mappings":";;;;;AAyBA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,IAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,IAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -7,7 +7,7 @@ exports.CollapserCard = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _components = require("@looker/components");
|
|
9
9
|
var _material = require("@styled-icons/material");
|
|
10
|
-
var _ConfigHeading = require("
|
|
10
|
+
var _ConfigHeading = require("./ConfigHeading");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
var CollapserCard = _ref => {
|
|
13
13
|
var {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapserCard.js","names":["_react","_interopRequireDefault","require","_components","_material","_ConfigHeading","obj","__esModule","default","CollapserCard","_ref","id","heading","children","defaultOpen","divider","level","value","toggle","useToggle","createElement","Box2","display","flexDirection","Divider","appearance","Accordion2","indicatorPosition","isOpen","toggleOpen","indicatorIcons","close","ArrowRight","open","ArrowDropDown","label","ConfigHeading","as","pb","exports"],"sources":["../../../../src/OAuthForm/src/components/CollapserCard.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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, ReactElement } from 'react'\nimport React from 'react'\nimport { useToggle, Accordion2, Divider, Box2 } from '@looker/components'\nimport { ArrowRight, ArrowDropDown } from '@styled-icons/material'\nimport { ConfigHeading } from './ConfigHeading'\n\ninterface CollapserCardProps {\n id?: string\n heading: string\n children: ReactElement\n defaultOpen?: boolean\n divider?: boolean\n}\n\n/**\n * Render a collapsable header and children\n */\nexport const CollapserCard: FC<CollapserCardProps> = ({\n id,\n heading,\n children,\n defaultOpen = true,\n divider = true,\n}) => {\n const level = divider ? 'h3' : 'h4'\n const { value, toggle } = useToggle(defaultOpen)\n\n return (\n <Box2 display=\"flex\" flexDirection=\"column\">\n {divider && <Divider appearance=\"light\" />}\n <Accordion2\n id={id}\n indicatorPosition=\"left\"\n isOpen={value}\n toggleOpen={toggle}\n indicatorIcons={{ close: <ArrowRight />, open: <ArrowDropDown /> }}\n label={<ConfigHeading as={level}>{heading}</ConfigHeading>}\n >\n <Box2 pb=\"xlarge\">{children}</Box2>\n </Accordion2>\n </Box2>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAA+C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAaxC,IAAMG,aAAqC,GAAGC,IAAA,IAM/C;EAAA,IANgD;IACpDC,EAAE;IACFC,OAAO;IACPC,QAAQ;IACRC,WAAW,GAAG,IAAI;IAClBC,OAAO,GAAG;EACZ,CAAC,GAAAL,IAAA;EACC,IAAMM,KAAK,GAAGD,OAAO,GAAG,IAAI,GAAG,IAAI;EACnC,IAAM;IAAEE,KAAK;IAAEC;EAAO,CAAC,GAAG,IAAAC,qBAAS,EAACL,WAAW,CAAC;EAEhD,OACEd,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACjB,WAAA,CAAAkB,IAAI;IAACC,OAAO,EAAC,MAAM;IAACC,aAAa,EAAC;EAAQ,GACxCR,OAAO,IAAIf,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACjB,WAAA,CAAAqB,OAAO;IAACC,UAAU,EAAC;EAAO,EAAG,EAC1CzB,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACjB,WAAA,CAAAuB,UAAU;IACTf,EAAE,EAAEA,EAAG;IACPgB,iBAAiB,EAAC,MAAM;IACxBC,MAAM,EAAEX,KAAM;IACdY,UAAU,EAAEX,MAAO;IACnBY,cAAc,EAAE;MAAEC,KAAK,EAAE/B,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAAChB,SAAA,CAAA4B,UAAU,OAAG;MAAEC,IAAI,EAAEjC,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAAChB,SAAA,CAAA8B,aAAa;IAAI,CAAE;IACnEC,KAAK,EAAEnC,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACf,cAAA,CAAA+B,aAAa;MAACC,EAAE,EAAErB;IAAM,GAAEJ,OAAO;EAAkB,GAE3DZ,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACjB,WAAA,CAAAkB,IAAI;IAACiB,EAAE,EAAC;EAAQ,GAAEzB,QAAQ,CAAQ,CACxB,CACR;AAEX,CAAC;AAAA0B,OAAA,CAAA9B,aAAA,GAAAA,aAAA"}
|
|
@@ -18,7 +18,7 @@ var ConfigHeading = (0, _styledComponents.default)(_components.Heading).attrs(_r
|
|
|
18
18
|
};
|
|
19
19
|
}).withConfig({
|
|
20
20
|
displayName: "ConfigHeading",
|
|
21
|
-
componentId: "sc-
|
|
21
|
+
componentId: "sc-1tkgwv3-0"
|
|
22
22
|
})([""]);
|
|
23
23
|
exports.ConfigHeading = ConfigHeading;
|
|
24
24
|
//# sourceMappingURL=ConfigHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigHeading.js","names":["_styledComponents","_interopRequireDefault","require","_components","obj","__esModule","default","ConfigHeading","styled","Heading","attrs","_ref","mb","pt","withConfig","displayName","componentId","exports"],"sources":["../../../../src/OAuthForm/src/components/ConfigHeading.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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 styled from 'styled-components'\nimport { Heading } from '@looker/components'\nimport type { HeadingProps } from '@looker/components'\n\nexport const ConfigHeading = styled(Heading).attrs(\n ({ mb = 'xsmall', pt = 'xsmall' }: HeadingProps) => ({ mb, pt })\n)``\n"],"mappings":";;;;;;AAyBA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGrC,IAAMG,aAAa,GAAG,IAAAC,yBAAM,EAACC,mBAAO,CAAC,CAACC,KAAK,CAChDC,IAAA;EAAA,IAAC;IAAEC,EAAE,GAAG,QAAQ;IAAEC,EAAE,GAAG;EAAuB,CAAC,GAAAF,IAAA;EAAA,OAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC;AAAA,CAAC,CACjE,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAAAC,OAAA,CAAAV,aAAA,GAAAA,aAAA"}
|
package/lib/{OAuthConfigForm/OAuthConfigForm.d.ts → OAuthForm/src/components/OAuthForm.d.ts}
RENAMED
|
@@ -6,5 +6,5 @@ interface ConfigFormProps {
|
|
|
6
6
|
clientId: string;
|
|
7
7
|
clientLabel: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const OAuthForm: ({ setHasConfig, clientId, clientLabel, configKey, }: ConfigFormProps) => JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.readyToLogin = exports.
|
|
6
|
+
exports.readyToLogin = exports.OAuthForm = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _components = require("@looker/components");
|
|
9
9
|
var _codeEditor = require("@looker/code-editor");
|
|
10
10
|
var _reactRouterDom = require("react-router-dom");
|
|
11
|
-
var _ = require("
|
|
11
|
+
var _ = require("../../..");
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var _slice = require("../state/slice");
|
|
14
|
+
var _CollapserCard = require("./CollapserCard");
|
|
12
15
|
var _ConfigHeading = require("./ConfigHeading");
|
|
13
|
-
var _Collapser = require("./Collapser");
|
|
14
|
-
var _utils = require("./utils");
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -27,7 +28,7 @@ var EmptyConfig = {
|
|
|
27
28
|
base_url: '',
|
|
28
29
|
looker_url: ''
|
|
29
30
|
};
|
|
30
|
-
var
|
|
31
|
+
var OAuthForm = _ref => {
|
|
31
32
|
var {
|
|
32
33
|
setHasConfig,
|
|
33
34
|
clientId,
|
|
@@ -36,32 +37,29 @@ var OAuthConfigForm = _ref => {
|
|
|
36
37
|
} = _ref;
|
|
37
38
|
var location = (0, _reactRouterDom.useLocation)();
|
|
38
39
|
var redirect_uri = (0, _.appPath)(location, '/oauth');
|
|
39
|
-
var appConfig = "// client_guid=".concat(clientId, "\n{\n
|
|
40
|
+
var appConfig = "// client_guid=".concat(clientId, "\n {\n \"redirect_uri\": \"").concat(redirect_uri, "\",\n \"display_name\": \"CORS ").concat(clientLabel, "\",\n \"description\": \"Looker ").concat(clientLabel, " using CORS\",\n \"enabled\": true\n }\n ");
|
|
40
41
|
var adaptor = (0, _.getEnvAdaptor)();
|
|
41
42
|
var sdk = adaptor.sdk;
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
var {
|
|
44
|
+
setApiServerUrlAction,
|
|
45
|
+
updateApiServerUrlAction,
|
|
46
|
+
setFetchedUrlAction,
|
|
47
|
+
setWebUrlAction,
|
|
48
|
+
clearFormAction,
|
|
49
|
+
updateMessageBarAction,
|
|
50
|
+
verifyErrorAction,
|
|
51
|
+
saveNewConfigAction
|
|
52
|
+
} = (0, _slice.useOAuthFormActions)();
|
|
53
|
+
var {
|
|
54
|
+
apiServerUrl,
|
|
55
|
+
fetchedUrl,
|
|
56
|
+
webUrl,
|
|
57
|
+
messageBar,
|
|
58
|
+
validationMessages,
|
|
59
|
+
savedConfig
|
|
60
|
+
} = (0, _slice.useOAuthFormState)();
|
|
59
61
|
var isConfigured = () => {
|
|
60
|
-
return apiServerUrl ===
|
|
61
|
-
};
|
|
62
|
-
var fetchError = message => {
|
|
63
|
-
setWebUrl('');
|
|
64
|
-
updateMessageBar('critical', message);
|
|
62
|
+
return apiServerUrl === savedConfig.base_url && webUrl === savedConfig.looker_url && apiServerUrl !== '' && webUrl !== '';
|
|
65
63
|
};
|
|
66
64
|
var saveConfig = (baseUrl, webUrl) => {
|
|
67
65
|
var data = {
|
|
@@ -71,24 +69,29 @@ var OAuthConfigForm = _ref => {
|
|
|
71
69
|
redirect_uri
|
|
72
70
|
};
|
|
73
71
|
localStorage.setItem(configKey, JSON.stringify(data));
|
|
72
|
+
saveNewConfigAction(data);
|
|
74
73
|
if (setHasConfig) setHasConfig(true);
|
|
75
|
-
setSaved(data);
|
|
76
|
-
updateMessageBar('positive', "Saved ".concat(webUrl, " as OAuth server"));
|
|
77
74
|
};
|
|
78
75
|
var verifyUrl = function () {
|
|
79
76
|
var _ref2 = _asyncToGenerator(function* () {
|
|
80
|
-
|
|
77
|
+
updateMessageBarAction({
|
|
78
|
+
intent: messageBar.intent,
|
|
79
|
+
text: ''
|
|
80
|
+
});
|
|
81
81
|
var versionsUrl = "".concat(apiServerUrl, "/versions");
|
|
82
82
|
try {
|
|
83
|
-
|
|
83
|
+
setFetchedUrlAction(apiServerUrl);
|
|
84
84
|
var versions = yield (0, _utils.getVersions)(versionsUrl);
|
|
85
85
|
if (versions) {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
updateMessageBarAction({
|
|
87
|
+
intent: 'positive',
|
|
88
|
+
text: "Configuration is valid"
|
|
89
|
+
});
|
|
90
|
+
setWebUrlAction(versions.web_server_url);
|
|
88
91
|
}
|
|
89
92
|
return versions;
|
|
90
93
|
} catch (e) {
|
|
91
|
-
|
|
94
|
+
verifyErrorAction(e.message);
|
|
92
95
|
return undefined;
|
|
93
96
|
}
|
|
94
97
|
});
|
|
@@ -113,15 +116,13 @@ var OAuthConfigForm = _ref => {
|
|
|
113
116
|
var handleClear = function () {
|
|
114
117
|
var _ref4 = _asyncToGenerator(function* (_e) {
|
|
115
118
|
localStorage.removeItem(configKey);
|
|
116
|
-
|
|
117
|
-
setFetchedUrl('');
|
|
118
|
-
setWebUrl('');
|
|
119
|
-
setMessageBarText('');
|
|
120
|
-
setMessageBarIntent('critical');
|
|
121
|
-
setSaved(EmptyConfig);
|
|
119
|
+
clearFormAction();
|
|
122
120
|
if (setHasConfig) setHasConfig(false);
|
|
123
121
|
if (isAuthenticated()) {
|
|
124
|
-
|
|
122
|
+
updateMessageBarAction({
|
|
123
|
+
intent: 'warn',
|
|
124
|
+
text: "Please reload the browser page to log out"
|
|
125
|
+
});
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
128
|
return function handleClear(_x) {
|
|
@@ -131,20 +132,23 @@ var OAuthConfigForm = _ref => {
|
|
|
131
132
|
var handleUrlChange = event => {
|
|
132
133
|
var name = event.currentTarget.name;
|
|
133
134
|
var value = event.currentTarget.value;
|
|
135
|
+
var newApiServerUrl = value;
|
|
134
136
|
var newValidationMessages = _objectSpread({}, validationMessages);
|
|
135
|
-
setApiServerUrl(value);
|
|
136
|
-
setWebUrl('');
|
|
137
137
|
var url = (0, _utils.validateUrl)(value);
|
|
138
138
|
if (url) {
|
|
139
139
|
delete newValidationMessages[name];
|
|
140
|
-
|
|
140
|
+
newApiServerUrl = url;
|
|
141
141
|
} else {
|
|
142
142
|
newValidationMessages[name] = {
|
|
143
143
|
message: "'".concat(value, "' is not a valid url"),
|
|
144
144
|
type: 'error'
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
updateApiServerUrlAction({
|
|
148
|
+
apiServerUrl: newApiServerUrl,
|
|
149
|
+
webUrl: '',
|
|
150
|
+
validationMessages: newValidationMessages
|
|
151
|
+
});
|
|
148
152
|
};
|
|
149
153
|
var isAuthenticated = () => sdk.authSession.isAuthenticated();
|
|
150
154
|
var verifyButtonDisabled = apiServerUrl.trim().length === 0 || Object.keys(validationMessages).length > 0;
|
|
@@ -161,23 +165,29 @@ var OAuthConfigForm = _ref => {
|
|
|
161
165
|
};
|
|
162
166
|
}();
|
|
163
167
|
(0, _react.useEffect)(() => {
|
|
164
|
-
var data =
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
var data = localStorage.getItem(configKey);
|
|
169
|
+
var result = data ? JSON.parse(data) : EmptyConfig;
|
|
170
|
+
if (result.base_url && result.looker_url) {
|
|
171
|
+
var {
|
|
172
|
+
base_url,
|
|
173
|
+
looker_url
|
|
174
|
+
} = result;
|
|
175
|
+
setApiServerUrlAction(base_url);
|
|
176
|
+
setWebUrlAction(looker_url);
|
|
177
|
+
}
|
|
171
178
|
}, []);
|
|
172
179
|
return _react.default.createElement(_components.SpaceVertical, {
|
|
173
180
|
gap: "u2"
|
|
174
181
|
}, _react.default.createElement(_ConfigHeading.ConfigHeading, null, "Looker OAuth Configuration"), _react.default.createElement(_components.Span, {
|
|
175
182
|
fontSize: "small"
|
|
176
183
|
}, "To configure Looker OAuth, you need to supply your API server URL, then authenticate into your Looker Instance"), _react.default.createElement(_components.MessageBar, {
|
|
177
|
-
intent:
|
|
178
|
-
onPrimaryClick: () =>
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
intent: messageBar.intent,
|
|
185
|
+
onPrimaryClick: () => updateMessageBarAction({
|
|
186
|
+
intent: messageBar.intent,
|
|
187
|
+
text: ''
|
|
188
|
+
}),
|
|
189
|
+
visible: messageBar.text !== ''
|
|
190
|
+
}, messageBar.text), _react.default.createElement(_CollapserCard.CollapserCard, {
|
|
181
191
|
heading: "1. Supply API Server URL",
|
|
182
192
|
id: "server_config",
|
|
183
193
|
divider: false,
|
|
@@ -237,7 +247,7 @@ var OAuthConfigForm = _ref => {
|
|
|
237
247
|
mr: "small"
|
|
238
248
|
}, "Save"))))), _react.default.createElement(_components.Divider, {
|
|
239
249
|
appearance: "light"
|
|
240
|
-
}), _react.default.createElement(
|
|
250
|
+
}), _react.default.createElement(_CollapserCard.CollapserCard, {
|
|
241
251
|
heading: "2. Login to instance",
|
|
242
252
|
divider: false,
|
|
243
253
|
id: "login_section",
|
|
@@ -252,5 +262,5 @@ var OAuthConfigForm = _ref => {
|
|
|
252
262
|
disabled: loginButtonDisabled
|
|
253
263
|
}, "Login")))));
|
|
254
264
|
};
|
|
255
|
-
exports.
|
|
256
|
-
//# sourceMappingURL=
|
|
265
|
+
exports.OAuthForm = OAuthForm;
|
|
266
|
+
//# sourceMappingURL=OAuthForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthForm.js","names":["_react","_interopRequireWildcard","require","_components","_codeEditor","_reactRouterDom","_","_utils","_slice","_CollapserCard","_ConfigHeading","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","asyncGeneratorStep","gen","resolve","reject","_next","_throw","info","error","done","Promise","then","_asyncToGenerator","fn","self","args","err","readyToLogin","exports","EmptyConfig","base_url","looker_url","OAuthForm","_ref","setHasConfig","clientId","clientLabel","configKey","location","useLocation","redirect_uri","appPath","appConfig","concat","adaptor","getEnvAdaptor","sdk","setApiServerUrlAction","updateApiServerUrlAction","setFetchedUrlAction","setWebUrlAction","clearFormAction","updateMessageBarAction","verifyErrorAction","saveNewConfigAction","useOAuthFormActions","apiServerUrl","fetchedUrl","webUrl","messageBar","validationMessages","savedConfig","useOAuthFormState","isConfigured","saveConfig","baseUrl","data","client_id","localStorage","setItem","JSON","stringify","verifyUrl","_ref2","intent","text","versionsUrl","versions","getVersions","web_server_url","e","message","handleSave","_ref3","api_server_url","handleVerify","handleClear","_ref4","_e","removeItem","isAuthenticated","_x","handleUrlChange","event","name","currentTarget","newApiServerUrl","newValidationMessages","url","validateUrl","type","authSession","verifyButtonDisabled","trim","saveButtonDisabled","clearButtonDisabled","loginButtonDisabled","handleLogin","_ref5","preventDefault","login","_x2","useEffect","getItem","result","parse","createElement","SpaceVertical","gap","ConfigHeading","Span","fontSize","MessageBar","onPrimaryClick","visible","CollapserCard","heading","id","divider","defaultOpen","pt","px","Form","Fieldset","legend","FieldText","required","label","placeholder","onChange","disabled","Fragment","Paragraph","Link","href","window","origin","CodeCopy","language","code","Space","Tooltip","content","ButtonTransparent","onClick","mr","Button","Divider","appearance"],"sources":["../../../../src/OAuthForm/src/components/OAuthForm.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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 { BaseSyntheticEvent, Dispatch, FormEvent } from 'react'\nimport React, { useEffect } from 'react'\nimport type { ValidationMessages } from '@looker/components'\nimport {\n Button,\n ButtonTransparent,\n Divider,\n Fieldset,\n FieldText,\n Form,\n MessageBar,\n Paragraph,\n Link,\n Space,\n SpaceVertical,\n Span,\n Tooltip,\n} from '@looker/components'\nimport { CodeCopy } from '@looker/code-editor'\nimport type { ILookerVersions } from '@looker/sdk-codegen'\nimport { useLocation } from 'react-router-dom'\nimport { appPath, getEnvAdaptor } from '../../..'\nimport { getVersions, validateUrl } from '../utils'\nimport { useOAuthFormActions, useOAuthFormState } from '../state/slice'\nimport { CollapserCard } from './CollapserCard'\nimport { ConfigHeading } from './ConfigHeading'\n\nexport const readyToLogin =\n 'OAuth is configured but your browser session is not authenticated. Click Login.'\n\nconst EmptyConfig = { base_url: '', looker_url: '' }\n\ninterface ConfigFormProps {\n /** A set state callback which allows for editing, setting or clearing OAuth configuration parameters if present */\n setHasConfig?: Dispatch<boolean>\n /** Local storage key value for storing config parameters */\n configKey: string\n /** OAuth client id */\n clientId: string\n /** OAuth client display label */\n clientLabel: string\n}\n\nexport const OAuthForm = ({\n setHasConfig,\n clientId,\n clientLabel,\n configKey,\n}: ConfigFormProps) => {\n const location = useLocation()\n const redirect_uri = appPath(location, '/oauth')\n const appConfig = `// client_guid=${clientId}\n {\n \"redirect_uri\": \"${redirect_uri}\",\n \"display_name\": \"CORS ${clientLabel}\",\n \"description\": \"Looker ${clientLabel} using CORS\",\n \"enabled\": true\n }\n `\n const adaptor = getEnvAdaptor()\n const sdk = adaptor.sdk\n\n const {\n setApiServerUrlAction,\n updateApiServerUrlAction,\n setFetchedUrlAction,\n setWebUrlAction,\n clearFormAction,\n updateMessageBarAction,\n verifyErrorAction,\n saveNewConfigAction,\n } = useOAuthFormActions()\n const {\n apiServerUrl,\n fetchedUrl,\n webUrl,\n messageBar,\n validationMessages,\n savedConfig,\n } = useOAuthFormState()\n\n const isConfigured = () => {\n return (\n apiServerUrl === savedConfig.base_url &&\n webUrl === savedConfig.looker_url &&\n apiServerUrl !== '' &&\n webUrl !== ''\n )\n }\n\n const saveConfig = (baseUrl: string, webUrl: string) => {\n const data = {\n base_url: baseUrl,\n looker_url: webUrl,\n client_id: clientId,\n redirect_uri,\n }\n localStorage.setItem(configKey, JSON.stringify(data))\n saveNewConfigAction(data)\n if (setHasConfig) setHasConfig(true)\n }\n\n const verifyUrl = async (): Promise<ILookerVersions | undefined> => {\n updateMessageBarAction({ intent: messageBar.intent, text: '' })\n const versionsUrl = `${apiServerUrl}/versions`\n try {\n setFetchedUrlAction(apiServerUrl)\n\n const versions = await getVersions(versionsUrl)\n\n if (versions) {\n updateMessageBarAction({\n intent: 'positive',\n text: `Configuration is valid`,\n })\n setWebUrlAction(versions.web_server_url)\n }\n\n return versions\n } catch (e: any) {\n verifyErrorAction(e.message)\n return undefined\n }\n }\n\n const handleSave = async () => {\n const versions = await verifyUrl()\n if (versions) {\n saveConfig(versions.api_server_url, versions.web_server_url)\n }\n }\n\n const handleVerify = () => {\n verifyUrl()\n }\n\n const handleClear = async (_e: BaseSyntheticEvent) => {\n localStorage.removeItem(configKey)\n clearFormAction()\n\n if (setHasConfig) setHasConfig(false)\n if (isAuthenticated()) {\n updateMessageBarAction({\n intent: 'warn',\n text: `Please reload the browser page to log out`,\n })\n }\n }\n\n const handleUrlChange = (event: FormEvent<HTMLInputElement>) => {\n const name = event.currentTarget.name\n const value = event.currentTarget.value\n let newApiServerUrl = value\n\n const newValidationMessages = { ...validationMessages }\n\n const url = validateUrl(value)\n if (url) {\n delete newValidationMessages[name]\n // Update URL if it's been cleaned up\n newApiServerUrl = url\n } else {\n newValidationMessages[name] = {\n message: `'${value}' is not a valid url`,\n type: 'error',\n }\n }\n\n updateApiServerUrlAction({\n apiServerUrl: newApiServerUrl,\n webUrl: '',\n validationMessages: newValidationMessages as ValidationMessages,\n })\n }\n\n const isAuthenticated = () => sdk.authSession.isAuthenticated()\n\n const verifyButtonDisabled =\n apiServerUrl.trim().length === 0 ||\n Object.keys(validationMessages).length > 0\n\n const saveButtonDisabled =\n verifyButtonDisabled || webUrl.trim().length === 0 || isConfigured()\n\n const clearButtonDisabled = apiServerUrl.trim().length === 0\n\n const loginButtonDisabled =\n verifyButtonDisabled || !isConfigured() || isAuthenticated()\n\n const handleLogin = async (e: BaseSyntheticEvent) => {\n e.preventDefault()\n // This will set storage variables and return to OAuthScene when successful\n await adaptor.login()\n }\n\n useEffect(() => {\n // Get config values from localstorage\n const data = localStorage.getItem(configKey)\n const result = data ? JSON.parse(data) : EmptyConfig\n if (result.base_url && result.looker_url) {\n const { base_url, looker_url } = result\n setApiServerUrlAction(base_url)\n setWebUrlAction(looker_url)\n }\n }, [])\n\n return (\n <SpaceVertical gap=\"u2\">\n <ConfigHeading>Looker OAuth Configuration</ConfigHeading>\n <Span fontSize=\"small\">\n To configure Looker OAuth, you need to supply your API server URL, then\n authenticate into your Looker Instance\n </Span>\n <MessageBar\n intent={messageBar.intent}\n onPrimaryClick={() =>\n updateMessageBarAction({ intent: messageBar.intent, text: '' })\n }\n visible={messageBar.text !== ''}\n >\n {messageBar.text}\n </MessageBar>\n <CollapserCard\n heading=\"1. Supply API Server URL\"\n id=\"server_config\"\n divider={false}\n defaultOpen={!isAuthenticated()}\n >\n <SpaceVertical gap=\"u2\" pt=\"u3\" px=\"u6\">\n <Form validationMessages={validationMessages}>\n <Fieldset legend=\"Server locations\">\n <FieldText\n required\n label=\"API server URL\"\n placeholder=\"typically https://myserver.looker.com:19999\"\n name=\"baseUrl\"\n value={apiServerUrl}\n onChange={handleUrlChange}\n />\n <FieldText\n label=\"OAuth server URL\"\n placeholder=\"Click 'Verify' to retrieve\"\n name=\"webUrl\"\n value={webUrl}\n disabled={true}\n />\n </Fieldset>\n </Form>\n {fetchedUrl && (\n <>\n <Paragraph fontSize=\"small\">\n On {fetchedUrl}, enable {clientLabel} as a{' '}\n <Link\n href=\"https://github.com/looker-open-source/sdk-codegen/blob/main/docs/cors.md#reference-implementation\"\n target=\"_blank\"\n >\n Looker OAuth client\n </Link>{' '}\n by adding \"{(window as any).location.origin}\" to the{' '}\n <Link href={`${webUrl}/admin/embed`} target=\"_blank\">\n Embedded Domain Allowlist\n </Link>\n . If API Explorer is also installed, the configuration below can\n be used to{' '}\n <Link\n href={`${fetchedUrl}/extensions/marketplace_extension_api_explorer::api-explorer/4.0/methods/Auth/register_oauth_client_app`}\n target=\"_blank\"\n >\n register this API Explorer instance\n </Link>{' '}\n as an OAuth client.\n </Paragraph>\n <CodeCopy key=\"appConfig\" language=\"json\" code={appConfig} />\n </>\n )}\n <Space>\n <Tooltip content=\"Clear the configuration values\">\n <ButtonTransparent\n onClick={handleClear}\n disabled={clearButtonDisabled}\n >\n Clear\n </ButtonTransparent>\n </Tooltip>\n <Tooltip content={`Verify ${apiServerUrl}`}>\n <ButtonTransparent\n disabled={verifyButtonDisabled}\n onClick={handleVerify}\n mr=\"small\"\n >\n Verify\n </ButtonTransparent>\n </Tooltip>\n <Tooltip content=\"Save the configuration for this browser\">\n <Button\n disabled={saveButtonDisabled}\n onClick={handleSave}\n mr=\"small\"\n >\n Save\n </Button>\n </Tooltip>\n </Space>\n </SpaceVertical>\n </CollapserCard>\n <Divider appearance=\"light\" />\n <CollapserCard\n heading=\"2. Login to instance\"\n divider={false}\n id=\"login_section\"\n defaultOpen={!isAuthenticated()}\n >\n <SpaceVertical pt=\"u3\" px=\"u6\">\n {isAuthenticated() ? (\n <Span>You are already logged in. Reload the page to log out.</Span>\n ) : isConfigured() ? (\n <>\n <Span>{readyToLogin}</Span>\n </>\n ) : (\n <Span>\n You will be able to login after you Verify your API Server URL\n </Span>\n )}\n <Tooltip content={`Login to ${webUrl} using OAuth`}>\n <Button onClick={handleLogin} disabled={loginButtonDisabled}>\n Login\n </Button>\n </Tooltip>\n </SpaceVertical>\n </CollapserCard>\n </SpaceVertical>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAeA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,CAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAA+C,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAe,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,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e,EAAE,GAChBrJ,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAC5K,WAAA,CAAAgL,IAAI,QAAC,wDAAsD,CAAO,GACjEzD,YAAY,EAAE,GAChB1H,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAA/K,MAAA,CAAAkB,OAAA,CAAAsL,QAAA,QACExM,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAC5K,WAAA,CAAAgL,IAAI,QAAE7F,YAAY,CAAQ,CAC1B,GAEHtF,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAC5K,WAAA,CAAAgL,IAAI,QAAC,gEAEN,CACD,EACDnL,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAC5K,WAAA,CAAA+M,OAAO;IAACC,OAAO,cAAA7G,MAAA,CAAce,MAAM;EAAe,GACjDrH,MAAA,CAAAkB,OAAA,CAAA6J,aAAA,CAAC5K,WAAA,CAAAoN,MAAM;IAACF,OAAO,EAAE/C,WAAY;IAACiC,QAAQ,EAAElC;EAAoB,GAAC,OAE7D,CAAS,CACD,CACI,CACF,CACF;AAEpB,CAAC;AAAA9E,OAAA,CAAAI,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OAuthForm } from './OAuthForm';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "OAuthForm", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _OAuthForm.OAuthForm;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _OAuthForm = require("./OAuthForm");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_OAuthForm","require"],"sources":["../../../../src/OAuthForm/src/components/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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 { OAuthForm } from './OAuthForm'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,UAAA,GAAAC,OAAA"}
|