@looker/extension-utils 0.1.22 → 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 +32 -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} +112 -146
- 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} +112 -146
- 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/lib/esm/{OAuthConfigForm/OAuthConfigForm.js → OAuthForm/src/components/OAuthForm.js}
RENAMED
|
@@ -3,39 +3,32 @@
|
|
|
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
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
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; }
|
|
20
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
20
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
21
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
22
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
24
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
24
25
|
var readyToLogin = 'OAuth is configured but your browser session is not authenticated. Click Login.';
|
|
25
26
|
exports.readyToLogin = readyToLogin;
|
|
26
|
-
var POSITIVE = 'positive';
|
|
27
|
-
var defaultFieldValues = {
|
|
28
|
-
baseUrl: '',
|
|
29
|
-
fetchedUrl: '',
|
|
30
|
-
webUrl: '',
|
|
31
|
-
fetchResult: '',
|
|
32
|
-
fetchIntent: POSITIVE
|
|
33
|
-
};
|
|
34
27
|
var EmptyConfig = {
|
|
35
28
|
base_url: '',
|
|
36
29
|
looker_url: ''
|
|
37
30
|
};
|
|
38
|
-
var
|
|
31
|
+
var OAuthForm = _ref => {
|
|
39
32
|
var {
|
|
40
33
|
setHasConfig,
|
|
41
34
|
clientId,
|
|
@@ -44,62 +37,29 @@ var OAuthConfigForm = _ref => {
|
|
|
44
37
|
} = _ref;
|
|
45
38
|
var location = (0, _reactRouterDom.useLocation)();
|
|
46
39
|
var redirect_uri = (0, _.appPath)(location, '/oauth');
|
|
47
|
-
var
|
|
48
|
-
var WEB_URL = 'webUrl';
|
|
49
|
-
var FETCH_INTENT = 'fetchIntent';
|
|
50
|
-
var FETCH_RESULT = 'fetchResult';
|
|
51
|
-
var CRITICAL = 'critical';
|
|
52
|
-
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
|
+
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 ");
|
|
53
41
|
var adaptor = (0, _.getEnvAdaptor)();
|
|
54
42
|
var sdk = adaptor.sdk;
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return _objectSpread(_objectSpread({}, previousFields), nameOrValues);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
(0, _react.useEffect)(() => {
|
|
78
|
-
var data = getConfig();
|
|
79
|
-
var {
|
|
80
|
-
base_url,
|
|
81
|
-
looker_url
|
|
82
|
-
} = data;
|
|
83
|
-
setSaved(data);
|
|
84
|
-
updateFields({
|
|
85
|
-
[BASE_URL]: base_url,
|
|
86
|
-
[WEB_URL]: looker_url,
|
|
87
|
-
[FETCH_INTENT]: base_url !== '' && looker_url !== '' ? POSITIVE : CRITICAL
|
|
88
|
-
});
|
|
89
|
-
}, []);
|
|
90
|
-
var [validationMessages, setValidationMessages] = (0, _react.useState)({});
|
|
91
|
-
var updateMessage = (intent, message) => {
|
|
92
|
-
updateFields({
|
|
93
|
-
[FETCH_RESULT]: message,
|
|
94
|
-
[FETCH_INTENT]: intent
|
|
95
|
-
});
|
|
96
|
-
};
|
|
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)();
|
|
97
61
|
var isConfigured = () => {
|
|
98
|
-
return
|
|
99
|
-
};
|
|
100
|
-
var fetchError = message => {
|
|
101
|
-
updateFields(WEB_URL, '');
|
|
102
|
-
updateMessage(CRITICAL, message);
|
|
62
|
+
return apiServerUrl === savedConfig.base_url && webUrl === savedConfig.looker_url && apiServerUrl !== '' && webUrl !== '';
|
|
103
63
|
};
|
|
104
64
|
var saveConfig = (baseUrl, webUrl) => {
|
|
105
65
|
var data = {
|
|
@@ -108,120 +68,126 @@ var OAuthConfigForm = _ref => {
|
|
|
108
68
|
client_id: clientId,
|
|
109
69
|
redirect_uri
|
|
110
70
|
};
|
|
111
|
-
updateFields({
|
|
112
|
-
[BASE_URL]: baseUrl,
|
|
113
|
-
[WEB_URL]: webUrl
|
|
114
|
-
});
|
|
115
71
|
localStorage.setItem(configKey, JSON.stringify(data));
|
|
72
|
+
saveNewConfigAction(data);
|
|
116
73
|
if (setHasConfig) setHasConfig(true);
|
|
117
|
-
setSaved(data);
|
|
118
|
-
updateMessage(POSITIVE, "Saved ".concat(webUrl, " as OAuth server"));
|
|
119
74
|
};
|
|
120
|
-
var
|
|
121
|
-
var _ref2 = _asyncToGenerator(function* (
|
|
122
|
-
|
|
123
|
-
|
|
75
|
+
var verifyUrl = function () {
|
|
76
|
+
var _ref2 = _asyncToGenerator(function* () {
|
|
77
|
+
updateMessageBarAction({
|
|
78
|
+
intent: messageBar.intent,
|
|
79
|
+
text: ''
|
|
80
|
+
});
|
|
81
|
+
var versionsUrl = "".concat(apiServerUrl, "/versions");
|
|
124
82
|
try {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
updateFields({
|
|
134
|
-
[BASE_URL]: baseUrl,
|
|
135
|
-
[WEB_URL]: webUrl
|
|
136
|
-
});
|
|
137
|
-
if (save) {
|
|
138
|
-
saveConfig(baseUrl, webUrl);
|
|
83
|
+
setFetchedUrlAction(apiServerUrl);
|
|
84
|
+
var versions = yield (0, _utils.getVersions)(versionsUrl);
|
|
85
|
+
if (versions) {
|
|
86
|
+
updateMessageBarAction({
|
|
87
|
+
intent: 'positive',
|
|
88
|
+
text: "Configuration is valid"
|
|
89
|
+
});
|
|
90
|
+
setWebUrlAction(versions.web_server_url);
|
|
139
91
|
}
|
|
92
|
+
return versions;
|
|
140
93
|
} catch (e) {
|
|
141
|
-
|
|
94
|
+
verifyErrorAction(e.message);
|
|
95
|
+
return undefined;
|
|
142
96
|
}
|
|
143
97
|
});
|
|
144
|
-
return function
|
|
98
|
+
return function verifyUrl() {
|
|
145
99
|
return _ref2.apply(this, arguments);
|
|
146
100
|
};
|
|
147
101
|
}();
|
|
148
102
|
var handleSave = function () {
|
|
149
|
-
var _ref3 = _asyncToGenerator(function* (
|
|
150
|
-
yield
|
|
103
|
+
var _ref3 = _asyncToGenerator(function* () {
|
|
104
|
+
var versions = yield verifyUrl();
|
|
105
|
+
if (versions) {
|
|
106
|
+
saveConfig(versions.api_server_url, versions.web_server_url);
|
|
107
|
+
}
|
|
151
108
|
});
|
|
152
|
-
return function handleSave(
|
|
109
|
+
return function handleSave() {
|
|
153
110
|
return _ref3.apply(this, arguments);
|
|
154
111
|
};
|
|
155
112
|
}();
|
|
156
|
-
var handleVerify =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
});
|
|
160
|
-
return function handleVerify(_x4) {
|
|
161
|
-
return _ref4.apply(this, arguments);
|
|
162
|
-
};
|
|
163
|
-
}();
|
|
113
|
+
var handleVerify = () => {
|
|
114
|
+
verifyUrl();
|
|
115
|
+
};
|
|
164
116
|
var handleClear = function () {
|
|
165
|
-
var
|
|
117
|
+
var _ref4 = _asyncToGenerator(function* (_e) {
|
|
166
118
|
localStorage.removeItem(configKey);
|
|
167
|
-
|
|
168
|
-
[BASE_URL]: '',
|
|
169
|
-
[WEB_URL]: '',
|
|
170
|
-
[FETCH_INTENT]: CRITICAL,
|
|
171
|
-
[FETCH_RESULT]: ''
|
|
172
|
-
});
|
|
173
|
-
setSaved(EmptyConfig);
|
|
119
|
+
clearFormAction();
|
|
174
120
|
if (setHasConfig) setHasConfig(false);
|
|
175
121
|
if (isAuthenticated()) {
|
|
176
|
-
|
|
122
|
+
updateMessageBarAction({
|
|
123
|
+
intent: 'warn',
|
|
124
|
+
text: "Please reload the browser page to log out"
|
|
125
|
+
});
|
|
177
126
|
}
|
|
178
127
|
});
|
|
179
|
-
return function handleClear(
|
|
180
|
-
return
|
|
128
|
+
return function handleClear(_x) {
|
|
129
|
+
return _ref4.apply(this, arguments);
|
|
181
130
|
};
|
|
182
131
|
}();
|
|
183
132
|
var handleUrlChange = event => {
|
|
184
133
|
var name = event.currentTarget.name;
|
|
134
|
+
var value = event.currentTarget.value;
|
|
135
|
+
var newApiServerUrl = value;
|
|
185
136
|
var newValidationMessages = _objectSpread({}, validationMessages);
|
|
186
|
-
var url = (0, _utils.validateUrl)(
|
|
137
|
+
var url = (0, _utils.validateUrl)(value);
|
|
187
138
|
if (url) {
|
|
188
139
|
delete newValidationMessages[name];
|
|
189
|
-
|
|
140
|
+
newApiServerUrl = url;
|
|
190
141
|
} else {
|
|
191
142
|
newValidationMessages[name] = {
|
|
192
|
-
message: "'".concat(
|
|
143
|
+
message: "'".concat(value, "' is not a valid url"),
|
|
193
144
|
type: 'error'
|
|
194
145
|
};
|
|
195
146
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
147
|
+
updateApiServerUrlAction({
|
|
148
|
+
apiServerUrl: newApiServerUrl,
|
|
149
|
+
webUrl: '',
|
|
150
|
+
validationMessages: newValidationMessages
|
|
199
151
|
});
|
|
200
|
-
setValidationMessages(newValidationMessages);
|
|
201
152
|
};
|
|
202
153
|
var isAuthenticated = () => sdk.authSession.isAuthenticated();
|
|
203
|
-
var verifyButtonDisabled =
|
|
204
|
-
var saveButtonDisabled = verifyButtonDisabled ||
|
|
205
|
-
var clearButtonDisabled =
|
|
154
|
+
var verifyButtonDisabled = apiServerUrl.trim().length === 0 || Object.keys(validationMessages).length > 0;
|
|
155
|
+
var saveButtonDisabled = verifyButtonDisabled || webUrl.trim().length === 0 || isConfigured();
|
|
156
|
+
var clearButtonDisabled = apiServerUrl.trim().length === 0;
|
|
206
157
|
var loginButtonDisabled = verifyButtonDisabled || !isConfigured() || isAuthenticated();
|
|
207
158
|
var handleLogin = function () {
|
|
208
|
-
var
|
|
159
|
+
var _ref5 = _asyncToGenerator(function* (e) {
|
|
209
160
|
e.preventDefault();
|
|
210
161
|
yield adaptor.login();
|
|
211
162
|
});
|
|
212
|
-
return function handleLogin(
|
|
213
|
-
return
|
|
163
|
+
return function handleLogin(_x2) {
|
|
164
|
+
return _ref5.apply(this, arguments);
|
|
214
165
|
};
|
|
215
166
|
}();
|
|
167
|
+
(0, _react.useEffect)(() => {
|
|
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
|
+
}
|
|
178
|
+
}, []);
|
|
216
179
|
return _react.default.createElement(_components.SpaceVertical, {
|
|
217
180
|
gap: "u2"
|
|
218
181
|
}, _react.default.createElement(_ConfigHeading.ConfigHeading, null, "Looker OAuth Configuration"), _react.default.createElement(_components.Span, {
|
|
219
182
|
fontSize: "small"
|
|
220
183
|
}, "To configure Looker OAuth, you need to supply your API server URL, then authenticate into your Looker Instance"), _react.default.createElement(_components.MessageBar, {
|
|
221
|
-
intent:
|
|
222
|
-
onPrimaryClick: () =>
|
|
223
|
-
|
|
224
|
-
|
|
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, {
|
|
225
191
|
heading: "1. Supply API Server URL",
|
|
226
192
|
id: "server_config",
|
|
227
193
|
divider: false,
|
|
@@ -238,25 +204,25 @@ var OAuthConfigForm = _ref => {
|
|
|
238
204
|
required: true,
|
|
239
205
|
label: "API server URL",
|
|
240
206
|
placeholder: "typically https://myserver.looker.com:19999",
|
|
241
|
-
name:
|
|
242
|
-
value:
|
|
207
|
+
name: "baseUrl",
|
|
208
|
+
value: apiServerUrl,
|
|
243
209
|
onChange: handleUrlChange
|
|
244
210
|
}), _react.default.createElement(_components.FieldText, {
|
|
245
211
|
label: "OAuth server URL",
|
|
246
212
|
placeholder: "Click 'Verify' to retrieve",
|
|
247
|
-
name:
|
|
248
|
-
value:
|
|
213
|
+
name: "webUrl",
|
|
214
|
+
value: webUrl,
|
|
249
215
|
disabled: true
|
|
250
|
-
}))),
|
|
216
|
+
}))), fetchedUrl && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_components.Paragraph, {
|
|
251
217
|
fontSize: "small"
|
|
252
|
-
}, "On ",
|
|
218
|
+
}, "On ", fetchedUrl, ", enable ", clientLabel, " as a", ' ', _react.default.createElement(_components.Link, {
|
|
253
219
|
href: "https://github.com/looker-open-source/sdk-codegen/blob/main/docs/cors.md#reference-implementation",
|
|
254
220
|
target: "_blank"
|
|
255
221
|
}, "Looker OAuth client"), ' ', "by adding \"", window.location.origin, "\" to the", ' ', _react.default.createElement(_components.Link, {
|
|
256
|
-
href: "".concat(
|
|
222
|
+
href: "".concat(webUrl, "/admin/embed"),
|
|
257
223
|
target: "_blank"
|
|
258
224
|
}, "Embedded Domain Allowlist"), ". If API Explorer is also installed, the configuration below can be used to", ' ', _react.default.createElement(_components.Link, {
|
|
259
|
-
href: "".concat(
|
|
225
|
+
href: "".concat(fetchedUrl, "/extensions/marketplace_extension_api_explorer::api-explorer/4.0/methods/Auth/register_oauth_client_app"),
|
|
260
226
|
target: "_blank"
|
|
261
227
|
}, "register this API Explorer instance"), ' ', "as an OAuth client."), _react.default.createElement(_codeEditor.CodeCopy, {
|
|
262
228
|
key: "appConfig",
|
|
@@ -268,7 +234,7 @@ var OAuthConfigForm = _ref => {
|
|
|
268
234
|
onClick: handleClear,
|
|
269
235
|
disabled: clearButtonDisabled
|
|
270
236
|
}, "Clear")), _react.default.createElement(_components.Tooltip, {
|
|
271
|
-
content: "Verify ".concat(
|
|
237
|
+
content: "Verify ".concat(apiServerUrl)
|
|
272
238
|
}, _react.default.createElement(_components.ButtonTransparent, {
|
|
273
239
|
disabled: verifyButtonDisabled,
|
|
274
240
|
onClick: handleVerify,
|
|
@@ -281,7 +247,7 @@ var OAuthConfigForm = _ref => {
|
|
|
281
247
|
mr: "small"
|
|
282
248
|
}, "Save"))))), _react.default.createElement(_components.Divider, {
|
|
283
249
|
appearance: "light"
|
|
284
|
-
}), _react.default.createElement(
|
|
250
|
+
}), _react.default.createElement(_CollapserCard.CollapserCard, {
|
|
285
251
|
heading: "2. Login to instance",
|
|
286
252
|
divider: false,
|
|
287
253
|
id: "login_section",
|
|
@@ -290,11 +256,11 @@ var OAuthConfigForm = _ref => {
|
|
|
290
256
|
pt: "u3",
|
|
291
257
|
px: "u6"
|
|
292
258
|
}, isAuthenticated() ? _react.default.createElement(_components.Span, null, "You are already logged in. Reload the page to log out.") : isConfigured() ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_components.Span, null, readyToLogin)) : _react.default.createElement(_components.Span, null, "You will be able to login after you Verify your API Server URL"), _react.default.createElement(_components.Tooltip, {
|
|
293
|
-
content: "Login to ".concat(
|
|
259
|
+
content: "Login to ".concat(webUrl, " using OAuth")
|
|
294
260
|
}, _react.default.createElement(_components.Button, {
|
|
295
261
|
onClick: handleLogin,
|
|
296
262
|
disabled: loginButtonDisabled
|
|
297
263
|
}, "Login")))));
|
|
298
264
|
};
|
|
299
|
-
exports.
|
|
300
|
-
//# 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,uBAA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EAAoB,GAAC,OAE7D,CAAS,CACD,CACI,CACF,CACF;AAEpB,CAAC;AAAA9E,OAAA,CAAAI,SAAA,GAAAA,SAAA"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _components = require("./components");
|
|
7
|
+
Object.keys(_components).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _components[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _state = require("./state");
|
|
18
|
+
Object.keys(_state).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _state[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _state[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_components","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_state"],"sources":["../../../../src/OAuthForm/src/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 './components'\nexport * from './state'\n"],"mappings":";;;;;AAyBA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "OAuthFormSlice", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _slice.OAuthFormSlice;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _slice = require("./slice");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_slice","require"],"sources":["../../../../../src/OAuthForm/src/state/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 { OAuthFormSlice } from './slice'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useOAuthFormState = exports.useOAuthFormActions = exports.oAuthFormActions = exports.defaultOAuthFormState = exports.SLICE_NAME = exports.OAuthFormSlice = void 0;
|
|
7
|
+
var _redux = require("@looker/redux");
|
|
8
|
+
var _toolkit = require("@reduxjs/toolkit");
|
|
9
|
+
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; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
var SLICE_NAME = 'OAuthForm';
|
|
15
|
+
exports.SLICE_NAME = SLICE_NAME;
|
|
16
|
+
var defaultOAuthFormState = {
|
|
17
|
+
apiServerUrl: '',
|
|
18
|
+
fetchedUrl: '',
|
|
19
|
+
webUrl: '',
|
|
20
|
+
messageBar: {
|
|
21
|
+
text: '',
|
|
22
|
+
intent: 'positive'
|
|
23
|
+
},
|
|
24
|
+
validationMessages: {},
|
|
25
|
+
savedConfig: {
|
|
26
|
+
base_url: '',
|
|
27
|
+
looker_url: ''
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.defaultOAuthFormState = defaultOAuthFormState;
|
|
31
|
+
var OAuthFormSlice = (0, _toolkit.createSlice)({
|
|
32
|
+
name: SLICE_NAME,
|
|
33
|
+
initialState: defaultOAuthFormState,
|
|
34
|
+
reducers: {
|
|
35
|
+
clearFormAction(_state) {
|
|
36
|
+
return _objectSpread({}, defaultOAuthFormState);
|
|
37
|
+
},
|
|
38
|
+
saveNewConfigAction(state, action) {
|
|
39
|
+
state.savedConfig = {
|
|
40
|
+
base_url: action.payload.base_url,
|
|
41
|
+
looker_url: action.payload.looker_url
|
|
42
|
+
};
|
|
43
|
+
state.messageBar = {
|
|
44
|
+
intent: 'positive',
|
|
45
|
+
text: "Saved ".concat(action.payload.looker_url, " as OAuth server")
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
setApiServerUrlAction(state, action) {
|
|
49
|
+
state.apiServerUrl = action.payload;
|
|
50
|
+
},
|
|
51
|
+
setFetchedUrlAction(state, action) {
|
|
52
|
+
state.fetchedUrl = action.payload;
|
|
53
|
+
},
|
|
54
|
+
setWebUrlAction(state, action) {
|
|
55
|
+
state.webUrl = action.payload;
|
|
56
|
+
},
|
|
57
|
+
updateApiServerUrlAction(state, action) {
|
|
58
|
+
state.apiServerUrl = action.payload.apiServerUrl;
|
|
59
|
+
state.webUrl = action.payload.webUrl;
|
|
60
|
+
state.validationMessages = action.payload.validationMessages;
|
|
61
|
+
},
|
|
62
|
+
updateMessageBarAction(state, action) {
|
|
63
|
+
state.messageBar = action.payload;
|
|
64
|
+
},
|
|
65
|
+
verifyErrorAction(state, action) {
|
|
66
|
+
state.messageBar = {
|
|
67
|
+
intent: 'critical',
|
|
68
|
+
text: action.payload
|
|
69
|
+
};
|
|
70
|
+
state.webUrl = '';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
exports.OAuthFormSlice = OAuthFormSlice;
|
|
75
|
+
var oAuthFormActions = OAuthFormSlice.actions;
|
|
76
|
+
exports.oAuthFormActions = oAuthFormActions;
|
|
77
|
+
var {
|
|
78
|
+
useActions: useOAuthFormActions,
|
|
79
|
+
useStoreState: useOAuthFormState
|
|
80
|
+
} = (0, _redux.createSliceHooks)(OAuthFormSlice);
|
|
81
|
+
exports.useOAuthFormState = useOAuthFormState;
|
|
82
|
+
exports.useOAuthFormActions = useOAuthFormActions;
|
|
83
|
+
//# sourceMappingURL=slice.js.map
|