@edx/frontend-platform 4.1.0 → 4.3.0
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/README.md +9 -9
- package/analytics/MockAnalyticsService.js.map +1 -1
- package/analytics/SegmentAnalyticsService.js.map +1 -1
- package/auth/AxiosCsrfTokenService.js.map +1 -1
- package/auth/AxiosJwtAuthService.js +5 -0
- package/auth/AxiosJwtAuthService.js.map +1 -1
- package/auth/AxiosJwtTokenService.js.map +1 -1
- package/auth/LocalForageCache.js.map +1 -1
- package/auth/MockAuthService.js.map +1 -1
- package/auth/interceptors/createCsrfTokenProviderInterceptor.js.map +1 -1
- package/auth/interceptors/createJwtTokenProviderInterceptor.js.map +1 -1
- package/auth/interceptors/createRetryInterceptor.js.map +1 -1
- package/auth/interface.js.map +1 -1
- package/auth/utils.js.map +1 -1
- package/config.js.map +1 -1
- package/i18n/countries.js.map +1 -1
- package/i18n/injectIntlWithShim.js.map +1 -1
- package/i18n/languages.js.map +1 -1
- package/i18n/lib.js.map +1 -1
- package/i18n/scripts/intl-imports.js.map +1 -1
- package/i18n/scripts/transifex-utils.js.map +1 -1
- package/initialize.js +41 -29
- package/initialize.js.map +1 -1
- package/logging/MockLoggingService.js +6 -0
- package/logging/MockLoggingService.js.map +1 -1
- package/logging/NewRelicLoggingService.js +27 -2
- package/logging/NewRelicLoggingService.js.map +1 -1
- package/logging/interface.js +10 -0
- package/logging/interface.js.map +1 -1
- package/package.json +6 -6
- package/react/AppProvider.js.map +1 -1
- package/react/AuthenticatedPageRoute.js.map +1 -1
- package/react/ErrorBoundary.js.map +1 -1
- package/react/ErrorPage.js.map +1 -1
- package/react/OptionalReduxProvider.js.map +1 -1
- package/react/PageRoute.js.map +1 -1
- package/scripts/GoogleAnalyticsLoader.js +57 -0
- package/scripts/GoogleAnalyticsLoader.js.map +1 -0
- package/scripts/index.js +3 -0
- package/scripts/index.js.map +1 -0
- package/testing/initializeMockApp.js.map +1 -1
- package/utils.js.map +1 -1
package/initialize.js
CHANGED
|
@@ -60,6 +60,7 @@ import { publish } from './pubSub';
|
|
|
60
60
|
import { getConfig, mergeConfig } from './config';
|
|
61
61
|
import { configure as configureLogging, getLoggingService, NewRelicLoggingService, logError } from './logging';
|
|
62
62
|
import { configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser } from './analytics';
|
|
63
|
+
import { GoogleAnalyticsLoader } from './scripts';
|
|
63
64
|
import { getAuthenticatedHttpClient, configure as configureAuth, ensureAuthenticatedUser, fetchAuthenticatedUser, hydrateAuthenticatedUser, getAuthenticatedUser, AxiosJwtAuthService } from './auth';
|
|
64
65
|
import { configure as configureI18n } from './i18n';
|
|
65
66
|
import { APP_PUBSUB_INITIALIZED, APP_CONFIG_INITIALIZED, APP_AUTH_INITIALIZED, APP_I18N_INITIALIZED, APP_LOGGING_INITIALIZED, APP_ANALYTICS_INITIALIZED, APP_READY, APP_INIT_ERROR } from './constants';
|
|
@@ -157,15 +158,6 @@ function _auth() {
|
|
|
157
158
|
export function runtimeConfig() {
|
|
158
159
|
return _runtimeConfig.apply(this, arguments);
|
|
159
160
|
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* The default handler for the initialization lifecycle's `analytics` phase.
|
|
163
|
-
*
|
|
164
|
-
* The handler is responsible for identifying authenticated and anonymous users with the analytics
|
|
165
|
-
* service. This is a pre-requisite for sending analytics events, thus, we do it during the
|
|
166
|
-
* initialization sequence so that analytics is ready once the application's UI code starts to load.
|
|
167
|
-
*
|
|
168
|
-
*/
|
|
169
161
|
function _runtimeConfig() {
|
|
170
162
|
_runtimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
171
163
|
var _getConfig, MFE_CONFIG_API_URL, APP_ID, apiConfig, apiService, params, url, _yield$apiService$get, data;
|
|
@@ -212,6 +204,21 @@ function _runtimeConfig() {
|
|
|
212
204
|
}));
|
|
213
205
|
return _runtimeConfig.apply(this, arguments);
|
|
214
206
|
}
|
|
207
|
+
export function loadExternalScripts(externalScripts, data) {
|
|
208
|
+
externalScripts.forEach(function (ExternalScript) {
|
|
209
|
+
var script = new ExternalScript(data);
|
|
210
|
+
script.loadScript();
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The default handler for the initialization lifecycle's `analytics` phase.
|
|
216
|
+
*
|
|
217
|
+
* The handler is responsible for identifying authenticated and anonymous users with the analytics
|
|
218
|
+
* service. This is a pre-requisite for sending analytics events, thus, we do it during the
|
|
219
|
+
* initialization sequence so that analytics is ready once the application's UI code starts to load.
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
215
222
|
export function analytics() {
|
|
216
223
|
return _analytics.apply(this, arguments);
|
|
217
224
|
}
|
|
@@ -299,6 +306,8 @@ function applyOverrideHandlers(overrides) {
|
|
|
299
306
|
* @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`
|
|
300
307
|
* implementation to use.
|
|
301
308
|
* @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.
|
|
309
|
+
* @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.
|
|
310
|
+
* By default added GoogleAnalyticsLoader.
|
|
302
311
|
* @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login
|
|
303
312
|
* redirection for unauthenticated users. Defaults to false, meaning that by default the
|
|
304
313
|
* application will allow anonymous/unauthenticated sessions.
|
|
@@ -318,11 +327,11 @@ export function initialize(_x4) {
|
|
|
318
327
|
}
|
|
319
328
|
function _initialize() {
|
|
320
329
|
_initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref2) {
|
|
321
|
-
var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers;
|
|
330
|
+
var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$externalScripts, externalScripts, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers;
|
|
322
331
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
323
332
|
while (1) switch (_context6.prev = _context6.next) {
|
|
324
333
|
case 0:
|
|
325
|
-
_ref2$loggingService = _ref2.loggingService, loggingService = _ref2$loggingService === void 0 ? NewRelicLoggingService : _ref2$loggingService, _ref2$analyticsServic = _ref2.analyticsService, analyticsService = _ref2$analyticsServic === void 0 ? SegmentAnalyticsService : _ref2$analyticsServic, _ref2$authService = _ref2.authService, authService = _ref2$authService === void 0 ? AxiosJwtAuthService : _ref2$authService, _ref2$authMiddleware = _ref2.authMiddleware, authMiddleware = _ref2$authMiddleware === void 0 ? [] : _ref2$authMiddleware, _ref2$requireAuthenti = _ref2.requireAuthenticatedUser, requireUser = _ref2$requireAuthenti === void 0 ? false : _ref2$requireAuthenti, _ref2$hydrateAuthenti = _ref2.hydrateAuthenticatedUser, hydrateUser = _ref2$hydrateAuthenti === void 0 ? false : _ref2$hydrateAuthenti, messages = _ref2.messages, _ref2$handlers = _ref2.handlers, overrideHandlers = _ref2$handlers === void 0 ? {} : _ref2$handlers;
|
|
334
|
+
_ref2$loggingService = _ref2.loggingService, loggingService = _ref2$loggingService === void 0 ? NewRelicLoggingService : _ref2$loggingService, _ref2$analyticsServic = _ref2.analyticsService, analyticsService = _ref2$analyticsServic === void 0 ? SegmentAnalyticsService : _ref2$analyticsServic, _ref2$authService = _ref2.authService, authService = _ref2$authService === void 0 ? AxiosJwtAuthService : _ref2$authService, _ref2$authMiddleware = _ref2.authMiddleware, authMiddleware = _ref2$authMiddleware === void 0 ? [] : _ref2$authMiddleware, _ref2$externalScripts = _ref2.externalScripts, externalScripts = _ref2$externalScripts === void 0 ? [GoogleAnalyticsLoader] : _ref2$externalScripts, _ref2$requireAuthenti = _ref2.requireAuthenticatedUser, requireUser = _ref2$requireAuthenti === void 0 ? false : _ref2$requireAuthenti, _ref2$hydrateAuthenti = _ref2.hydrateAuthenticatedUser, hydrateUser = _ref2$hydrateAuthenti === void 0 ? false : _ref2$hydrateAuthenti, messages = _ref2.messages, _ref2$handlers = _ref2.handlers, overrideHandlers = _ref2$handlers === void 0 ? {} : _ref2$handlers;
|
|
326
335
|
handlers = applyOverrideHandlers(overrideHandlers);
|
|
327
336
|
_context6.prev = 2;
|
|
328
337
|
_context6.next = 5;
|
|
@@ -338,14 +347,17 @@ function _initialize() {
|
|
|
338
347
|
return runtimeConfig();
|
|
339
348
|
case 10:
|
|
340
349
|
publish(APP_CONFIG_INITIALIZED);
|
|
350
|
+
loadExternalScripts(externalScripts, {
|
|
351
|
+
config: getConfig()
|
|
352
|
+
});
|
|
341
353
|
|
|
342
354
|
// Logging
|
|
343
355
|
configureLogging(loggingService, {
|
|
344
356
|
config: getConfig()
|
|
345
357
|
});
|
|
346
|
-
_context6.next =
|
|
358
|
+
_context6.next = 15;
|
|
347
359
|
return handlers.logging();
|
|
348
|
-
case
|
|
360
|
+
case 15:
|
|
349
361
|
publish(APP_LOGGING_INITIALIZED);
|
|
350
362
|
|
|
351
363
|
// Authentication
|
|
@@ -354,9 +366,9 @@ function _initialize() {
|
|
|
354
366
|
config: getConfig(),
|
|
355
367
|
middleware: authMiddleware
|
|
356
368
|
});
|
|
357
|
-
_context6.next =
|
|
369
|
+
_context6.next = 19;
|
|
358
370
|
return handlers.auth(requireUser, hydrateUser);
|
|
359
|
-
case
|
|
371
|
+
case 19:
|
|
360
372
|
publish(APP_AUTH_INITIALIZED);
|
|
361
373
|
|
|
362
374
|
// Analytics
|
|
@@ -365,9 +377,9 @@ function _initialize() {
|
|
|
365
377
|
loggingService: getLoggingService(),
|
|
366
378
|
httpClient: getAuthenticatedHttpClient()
|
|
367
379
|
});
|
|
368
|
-
_context6.next =
|
|
380
|
+
_context6.next = 23;
|
|
369
381
|
return handlers.analytics();
|
|
370
|
-
case
|
|
382
|
+
case 23:
|
|
371
383
|
publish(APP_ANALYTICS_INITIALIZED);
|
|
372
384
|
|
|
373
385
|
// Internationalization
|
|
@@ -376,34 +388,34 @@ function _initialize() {
|
|
|
376
388
|
config: getConfig(),
|
|
377
389
|
loggingService: getLoggingService()
|
|
378
390
|
});
|
|
379
|
-
_context6.next =
|
|
391
|
+
_context6.next = 27;
|
|
380
392
|
return handlers.i18n();
|
|
381
|
-
case
|
|
393
|
+
case 27:
|
|
382
394
|
publish(APP_I18N_INITIALIZED);
|
|
383
395
|
|
|
384
396
|
// Application Ready
|
|
385
|
-
_context6.next =
|
|
397
|
+
_context6.next = 30;
|
|
386
398
|
return handlers.ready();
|
|
387
|
-
case
|
|
399
|
+
case 30:
|
|
388
400
|
publish(APP_READY);
|
|
389
|
-
_context6.next =
|
|
401
|
+
_context6.next = 39;
|
|
390
402
|
break;
|
|
391
|
-
case
|
|
392
|
-
_context6.prev =
|
|
403
|
+
case 33:
|
|
404
|
+
_context6.prev = 33;
|
|
393
405
|
_context6.t0 = _context6["catch"](2);
|
|
394
406
|
if (_context6.t0.isRedirecting) {
|
|
395
|
-
_context6.next =
|
|
407
|
+
_context6.next = 39;
|
|
396
408
|
break;
|
|
397
409
|
}
|
|
398
|
-
_context6.next =
|
|
410
|
+
_context6.next = 38;
|
|
399
411
|
return handlers.initError(_context6.t0);
|
|
400
|
-
case 37:
|
|
401
|
-
publish(APP_INIT_ERROR, _context6.t0);
|
|
402
412
|
case 38:
|
|
413
|
+
publish(APP_INIT_ERROR, _context6.t0);
|
|
414
|
+
case 39:
|
|
403
415
|
case "end":
|
|
404
416
|
return _context6.stop();
|
|
405
417
|
}
|
|
406
|
-
}, _callee6, null, [[2,
|
|
418
|
+
}, _callee6, null, [[2, 33]]);
|
|
407
419
|
}));
|
|
408
420
|
return _initialize.apply(this, arguments);
|
|
409
421
|
}
|
package/initialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,KAAA,KAAAC,OAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,cAAA,GAAAF,OAAA,CAAAG,QAAA,kBAAAC,mBAAA,GAAAJ,OAAA,CAAAK,aAAA,uBAAAC,iBAAA,GAAAN,OAAA,CAAAO,WAAA,8BAAAC,O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,kBAAkB,CAAC+F,gBAAgB,EAAE;YACnCZ,MAAM,EAAE1F,SAAS,EAAE;YACnBoG,cAAc,EAAEhG,iBAAiB,EAAE;YACnCiH,UAAU,EAAE1G,0BAA0B;UACxC,CAAC,CAAC;UAACuG,SAAA,CAAArL,IAAA;UAAA,OACGmL,QAAQ,CAACtC,SAAS,EAAE;QAAA;UAC1B3E,OAAO,CAACyB,yBAAyB,CAAC;;UAElC;UACAN,aAAa,CAAC;YACZ2F,QAAQ,EAARA,QAAQ;YACRnB,MAAM,EAAE1F,SAAS,EAAE;YACnBoG,cAAc,EAAEhG,iBAAiB;UACnC,CAAC,CAAC;UAAC8G,SAAA,CAAArL,IAAA;UAAA,OACGmL,QAAQ,CAACpB,IAAI,EAAE;QAAA;UACrB7F,OAAO,CAACuB,oBAAoB,CAAC;;UAE7B;UAAA4F,SAAA,CAAArL,IAAA;UAAA,OACMmL,QAAQ,CAACnB,KAAK,EAAE;QAAA;UACtB9F,OAAO,CAAC0B,SAAS,CAAC;UAACyF,SAAA,CAAArL,IAAA;UAAA;QAAA;UAAAqL,SAAA,CAAA/I,IAAA;UAAA+I,SAAA,CAAA3C,EAAA,GAAA2C,SAAA;UAAA,IAEdA,SAAA,CAAA3C,EAAA,CAAM+C,aAAa;YAAAJ,SAAA,CAAArL,IAAA;YAAA;UAAA;UAAAqL,SAAA,CAAArL,IAAA;UAAA,OAEhBmL,QAAQ,CAAChF,SAAS,CAAAkF,SAAA,CAAA3C,EAAA,CAAO;QAAA;UAC/BxE,OAAO,CAAC2B,cAAc,EAAAwF,SAAA,CAAA3C,EAAA,CAAQ;QAAC;QAAA;UAAA,OAAA2C,SAAA,CAAA5I,IAAA;MAAA;IAAA,GAAA2H,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAApG,KAAA,OAAAD,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,I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AAC;UACpC,CAAC,CAAC;UAACqH,SAAA,CAAA5L,IAAA;UAAA,OACG0L,QAAQ,CAACrB,IAAI,CAAC,CAAC;QAAA;UACrBnG,OAAO,CAACwB,oBAAoB,CAAC;;UAE7B;UAAAkG,SAAA,CAAA5L,IAAA;UAAA,OACM0L,QAAQ,CAACpB,KAAK,CAAC,CAAC;QAAA;UACtBpG,OAAO,CAAC2B,SAAS,CAAC;UAAC+F,SAAA,CAAA5L,IAAA;UAAA;QAAA;UAAA4L,SAAA,CAAAtJ,IAAA;UAAAsJ,SAAA,CAAAjD,EAAA,GAAAiD,SAAA;UAAA,IAEdA,SAAA,CAAAjD,EAAA,CAAMqD,aAAa;YAAAJ,SAAA,CAAA5L,IAAA;YAAA;UAAA;UAAA4L,SAAA,CAAA5L,IAAA;UAAA,OAEhB0L,QAAQ,CAACtF,SAAS,CAAAwF,SAAA,CAAAjD,EAAM,CAAC;QAAA;UAC/BzE,OAAO,CAAC4B,cAAc,EAAA8F,SAAA,CAAAjD,EAAO,CAAC;QAAC;QAAA;UAAA,OAAAiD,SAAA,CAAAnJ,IAAA;MAAA;IAAA,GAAAiI,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAA1G,KAAA,OAAAD,SAAA;AAAA"}
|
|
@@ -26,6 +26,12 @@ var MockLoggingService = /*#__PURE__*/_createClass(function MockLoggingService()
|
|
|
26
26
|
* @memberof MockLoggingService
|
|
27
27
|
*/
|
|
28
28
|
_defineProperty(this, "logError", jest.fn());
|
|
29
|
+
/**
|
|
30
|
+
* Implemented as a jest.fn()
|
|
31
|
+
*
|
|
32
|
+
* @memberof MockLoggingService
|
|
33
|
+
*/
|
|
34
|
+
_defineProperty(this, "setCustomAttribute", jest.fn());
|
|
29
35
|
});
|
|
30
36
|
export default MockLoggingService;
|
|
31
37
|
//# sourceMappingURL=MockLoggingService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockLoggingService.js","names":["MockLoggingService","_createClass","_classCallCheck","_defineProperty","jest","fn"],"sources":["../../src/logging/MockLoggingService.js"],"sourcesContent":["/**\n * The MockLoggingService implements both logInfo and logError as jest mock functions via\n * jest.fn(). It has no other functionality.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nclass MockLoggingService {\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logInfo = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logError = jest.fn();\n}\n\nexport default MockLoggingService;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMA,kBAAkB,gBAAAC,YAAA,UAAAD,mBAAA;EAAAE,eAAA,OAAAF,kBAAA;EACtB;AACF;AACA;AACA;AACA;EAJEG,eAAA,kBAKUC,IAAI,CAACC,EAAE,
|
|
1
|
+
{"version":3,"file":"MockLoggingService.js","names":["MockLoggingService","_createClass","_classCallCheck","_defineProperty","jest","fn"],"sources":["../../src/logging/MockLoggingService.js"],"sourcesContent":["/**\n * The MockLoggingService implements both logInfo and logError as jest mock functions via\n * jest.fn(). It has no other functionality.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nclass MockLoggingService {\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logInfo = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logError = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n setCustomAttribute = jest.fn();\n}\n\nexport default MockLoggingService;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMA,kBAAkB,gBAAAC,YAAA,UAAAD,mBAAA;EAAAE,eAAA,OAAAF,kBAAA;EACtB;AACF;AACA;AACA;AACA;EAJEG,eAAA,kBAKUC,IAAI,CAACC,EAAE,CAAC,CAAC;EAEnB;AACF;AACA;AACA;AACA;EAJEF,eAAA,mBAKWC,IAAI,CAACC,EAAE,CAAC,CAAC;EAEpB;AACF;AACA;AACA;AACA;EAJEF,eAAA,6BAKqBC,IAAI,CAACC,EAAE,CAAC,CAAC;AAAA;AAGhC,eAAeL,kBAAkB"}
|
|
@@ -30,10 +30,11 @@ var pageActionNameInfo = 'INFO';
|
|
|
30
30
|
var pageActionNameIgnoredError = 'IGNORED_ERROR';
|
|
31
31
|
function sendPageAction(actionName, message, customAttributes) {
|
|
32
32
|
if (process.env.NODE_ENV === 'development') {
|
|
33
|
-
console.log(message, customAttributes); // eslint-disable-line
|
|
33
|
+
console.log(actionName, message, customAttributes); // eslint-disable-line
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (window && typeof window.newrelic !== 'undefined') {
|
|
37
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/
|
|
37
38
|
window.newrelic.addPageAction(actionName, _objectSpread({
|
|
38
39
|
message: message
|
|
39
40
|
}, customAttributes));
|
|
@@ -45,9 +46,20 @@ function sendError(error, customAttributes) {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
if (window && typeof window.newrelic !== 'undefined') {
|
|
49
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/
|
|
48
50
|
window.newrelic.noticeError(fixErrorLength(error), customAttributes);
|
|
49
51
|
}
|
|
50
52
|
}
|
|
53
|
+
function _setCustomAttribute(name, value) {
|
|
54
|
+
if (process.env.NODE_ENV === 'development') {
|
|
55
|
+
console.log(name, value); // eslint-disable-line
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (window && typeof window.newrelic !== 'undefined') {
|
|
59
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/
|
|
60
|
+
window.newrelic.setCustomAttribute(name, value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
51
63
|
|
|
52
64
|
/**
|
|
53
65
|
* The NewRelicLoggingService is a concrete implementation of the logging service interface that
|
|
@@ -75,7 +87,8 @@ function sendError(error, customAttributes) {
|
|
|
75
87
|
* ```
|
|
76
88
|
*
|
|
77
89
|
* You can also add your own custom metrics as an additional argument, or see the code to find
|
|
78
|
-
* other standard custom attributes.
|
|
90
|
+
* other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged
|
|
91
|
+
* in users via the auth service (AuthAxiosJwtService).
|
|
79
92
|
*
|
|
80
93
|
* Requires the NewRelic Browser JavaScript snippet.
|
|
81
94
|
*
|
|
@@ -163,6 +176,18 @@ var NewRelicLoggingService = /*#__PURE__*/function () {
|
|
|
163
176
|
sendError(errorStringOrObject, allCustomAttributes);
|
|
164
177
|
}
|
|
165
178
|
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Sets a custom attribute that will be included with all subsequent log messages.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} name
|
|
184
|
+
* @param {string|number|null} value
|
|
185
|
+
*/
|
|
186
|
+
}, {
|
|
187
|
+
key: "setCustomAttribute",
|
|
188
|
+
value: function setCustomAttribute(name, value) {
|
|
189
|
+
_setCustomAttribute(name, value);
|
|
190
|
+
}
|
|
166
191
|
}]);
|
|
167
192
|
return NewRelicLoggingService;
|
|
168
193
|
}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","value","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes.\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,gBAAgB,GAAG,IAAI;AAEpC,SAASC,cAAcA,CAACC,KAAK,EAAE;EAC7B,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,MAAM,GAAGJ,gBAAgB,EAAE;IAC5D,IAAMK,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACL,KAAK,CAAC;IAC3CG,cAAc,CAACF,OAAO,GAAGE,cAAc,CAACF,OAAO,CAACK,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;IAC9E,OAAOK,cAAc;EACvB;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACE,MAAM,GAAGJ,gBAAgB,EAAE;IAChE,OAAOE,KAAK,CAACM,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;EAC7C;EACA,OAAOE,KAAK;AACd;;AAEA;AACA,IAAMO,kBAAkB,GAAG,MAAM;AACjC,IAAMC,0BAA0B,GAAG,eAAe;AAElD,SAASC,cAAcA,CAACC,UAAU,EAAET,OAAO,EAAEU,gBAAgB,EAAE;EAC7D,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ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A,mBAAmB,GAAG,EAAE,CAAC;MACxH,IAAI,IAAI,CAACZ,mBAAmB,IAAIgB,YAAY,CAACC,KAAK,CAAC,IAAI,CAACjB,mBAAmB,CAAC,EAAE;QAC5E;QACAnB,cAAc,CAACD,0BAA0B,EAAEoC,YAAY,EAAEF,mBAAmB,CAAC;MAC/E,CAAC,MAAM;QACL;QACArB,SAAS,CAACmB,mBAAmB,EAAEE,mBAAmB,CAAC;MACrD;IACF;EAAC;EAAA,OAAAnB,sBAAA;AAAA;AAAA,SAlFkBA,sBAAsB,IAAAuB,OAAA"}
|
|
1
|
+
{"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","setCustomAttribute","name","value","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(actionName, message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\nfunction setCustomAttribute(name, value) {\n if (process.env.NODE_ENV === 'development') {\n console.log(name, value); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/\n window.newrelic.setCustomAttribute(name, value);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged\n * in users via the auth service (AuthAxiosJwtService).\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n\n /**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\n setCustomAttribute(name, value) {\n setCustomAttribute(name, value);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,gBAAgB,GAAG,IAAI;AAEpC,SAASC,cAAcA,CAACC,KAAK,EAAE;EAC7B,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,MAAM,GAAGJ,gBAAgB,EAAE;IAC5D,IAAMK,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACL,KAAK,CAAC;IAC3CG,cAAc,CAACF,OAAO,GAAGE,cAAc,CAACF,OAAO,CAACK,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;IAC9E,OAAOK,cAAc;EACvB;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACE,MAAM,GAAGJ,gBAAgB,EAAE;IAChE,OAAOE,KAAK,CAACM,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;EAC7C;EACA,OAAOE,KAAK;AACd;;AAEA;AACA,IAAMO,kBAAkB,GAAG,MAAM;AACjC,IAAMC,0BAA0B,GAAG,eAAe;AAElD,SAASC,cAAcA,CAACC,UAAU,E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C,SAAA,QAAAP,SAAA,GAAAO,SAAA,MAAG,CAAC,CAAC;MACjD,IAAMM,qBAAqB,GAAGD,mBAAmB,CAAC/B,gBAAgB,IAAI,CAAC,CAAC;MACxE,IAAIiC,mBAAmB,GAAAxB,aAAA,CAAAA,aAAA,KAAQuB,qBAAqB,GAAKhC,gBAAgB,CAAE;MAC3E,IAAIP,MAAM,CAACyC,IAAI,CAACD,mBAAmB,CAAC,CAAC1C,MAAM,KAAK,CAAC,EAAE;QACjD;QACA0C,mBAAmB,GAAGd,SAAS;MACjC;;MAEA;AACJ;AACA;AACA;AACA;MACI,IAAMgB,YAAY,GAAGJ,mBAAmB,CAACzC,OAAO,KAAK,OAAOyC,mBAAmB,KAAK,QAAQ,GAAGA,mBAAmB,GAAG,EAAE,CAAC;MACxH,IAAI,IAAI,CAACX,mBAAmB,IAAIe,YAAY,CAACC,KAAK,CAAC,IAAI,CAAChB,mBAAmB,CAAC,EAAE;QAC5E;QACAtB,cAAc,CAACD,0BAA0B,EAAEsC,YAAY,EAAEF,mBAAmB,CAAC;MAC/E,CAAC,MAAM;QACL;QACAvB,SAAS,CAACqB,mBAAmB,EAAEE,mBAAmB,CAAC;MACrD;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAV,GAAA;IAAAT,KAAA,EAMA,SAAAF,mBAAmBC,IAAI,EAAEC,KAAK,EAAE;MAC9BF,mBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;IACjC;EAAC;EAAA,OAAAC,sBAAA;AAAA;AAAA,SA5FkBA,sBAAsB,IAAAsB,OAAA"}
|
package/logging/interface.js
CHANGED
|
@@ -68,6 +68,16 @@ export function logError(errorStringOrObject, customAttributes) {
|
|
|
68
68
|
return service.logError(errorStringOrObject, customAttributes);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Sets a custom attribute that will be included with all subsequent log messages.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {string|number|null} value
|
|
76
|
+
*/
|
|
77
|
+
export function setCustomAttribute(name, value) {
|
|
78
|
+
return service.setCustomAttribute(name, value);
|
|
79
|
+
}
|
|
80
|
+
|
|
71
81
|
/**
|
|
72
82
|
*
|
|
73
83
|
* @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.
|
package/logging/interface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAAC;AAED,IAAMC,YAAY,GAAG;EACnBC,OAAO,EAAEN,SAAS,CAACO,IAAI,CAACH,UAAU;EAClCI,QAAQ,EAAER,SAAS,CAACO,IAAI,CAACH;AAC3B,CAAC;AAED,IAAIK,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,cAAc,EAAEC,OAAO,EAAE;EACjDZ,SAAS,CAACa,cAAc,CAACZ,YAAY,EAAEW,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;EACtEH,OAAO,GAAG,IAAIE,cAAc,CAACC,OAAO,CAAC;EACrCZ,SAAS,CAACa,cAAc,CAACR,YAAY,EAAEI,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC;EAC7E,OAAOA,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,OAAOA,CAACQ,uBAAuB,EAAEC,gBAAgB,EAAE;EACjE,OAAON,OAAO,CAACH,OAAO,CAACQ,uBAAuB,EAAEC,gBAAgB,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASP,QAAQA,CAACQ,mBAAmB,EAAED,gBAAgB,EAAE;EAC9D,OAAON,OAAO,CAACD,QAAQ,CAACQ,mBAAmB,EAAED,gBAAgB,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAAA,EAAG;EAClC,IAAI,
|
|
1
|
+
{"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","setCustomAttribute","name","value","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\nexport function setCustomAttribute(name, value) {\n return service.setCustomAttribute(name, value);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAA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AAI;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edx/frontend-platform",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Foundational application framework for Open edX micro-frontend applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"homepage": "https://github.com/openedx/frontend-platform#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@edx/brand": "npm:@edx/brand-openedx@1.2.0",
|
|
36
|
-
"@edx/browserslist-config": "1.
|
|
37
|
-
"@edx/frontend-build": "12.
|
|
36
|
+
"@edx/browserslist-config": "1.2.0",
|
|
37
|
+
"@edx/frontend-build": "12.8.27",
|
|
38
38
|
"@edx/paragon": "^20.30.1",
|
|
39
39
|
"@testing-library/react-hooks": "^8.0.1",
|
|
40
40
|
"axios-mock-adapter": "^1.21.3",
|
|
41
|
-
"core-js": "3.
|
|
41
|
+
"core-js": "3.30.2",
|
|
42
42
|
"enzyme": "3.11.0",
|
|
43
43
|
"enzyme-adapter-react-16": "1.15.7",
|
|
44
44
|
"husky": "8.0.3",
|
|
45
|
-
"jsdoc": "
|
|
46
|
-
"nodemon": "2.0.
|
|
45
|
+
"jsdoc": "^4.0.0",
|
|
46
|
+
"nodemon": "2.0.22",
|
|
47
47
|
"prop-types": "15.8.1",
|
|
48
48
|
"react": "16.14.0",
|
|
49
49
|
"react-dom": "16.14.0",
|
package/react/AppProvider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","history","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","AppProvider","_ref","store","children","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport { history } from '../initialize';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n <Router history={history}>\n {children}\n </Router>\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n};\n\nAppProvider.defaultProps = {\n store: null,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,SAAS;AAChE,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,OAAO,QAAQ,eAAe;AACvC,SACEC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EACnD,IAAAC,SAAA,GAA4BtB,QAAQ,CAACW,SAAS,
|
|
1
|
+
{"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","history","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","AppProvider","_ref","store","children","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport { history } from '../initialize';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n <Router history={history}>\n {children}\n </Router>\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n};\n\nAppProvider.defaultProps = {\n store: null,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,SAAS;AAChE,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,OAAO,QAAQ,eAAe;AACvC,SACEC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA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KAAA,CAAAqC,aAAA,CAAC/B,aAAa,qBACZN,KAAA,CAAAqC,aAAA,CAAC9B,UAAU,CAACgC,QAAQ;IAClBC,KAAK,EAAEJ;EAAgB,gBAEvBpC,KAAA,CAAAqC,aAAA,CAAChC,qBAAqB;IAACgB,KAAK,EAAEA;EAAM,gBAClCrB,KAAA,CAAAqC,aAAA,CAACjC,MAAM;IAACU,OAAO,EAAEA;EAAQ,GACtBQ,QACK,CACa,CACJ,CACR,CACH,CAAC;AAEnB;AAEAH,WAAW,CAACsB,SAAS,GAAG;EACtB;EACApB,KAAK,EAAElB,SAAS,CAACuC,MAAM;EACvBpB,QAAQ,EAAEnB,SAAS,CAACwC,IAAI,CAACC;AAC3B,CAAC;AAEDzB,WAAW,CAAC0B,YAAY,GAAG;EACzBxB,KAAK,EAAE;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","useRouteMatch","AppContext","PageRoute","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","props","_objectWithoutProperties","_excluded","_useContext","authenticatedUser","match","path","exact","strict","sensitive","destination","global","location","href","assign","createElement","propTypes","string","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouteMatch } from 'react-router-dom';\n\nimport AppContext from './AppContext';\nimport PageRoute from './PageRoute';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageRoute`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageRoute\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, ...props }) {\n const { authenticatedUser } = useContext(AppContext);\n\n const match = useRouteMatch({\n // eslint-disable-next-line react/prop-types\n path: props.path,\n // eslint-disable-next-line react/prop-types\n exact: props.exact,\n // eslint-disable-next-line react/prop-types\n strict: props.strict,\n // eslint-disable-next-line react/prop-types\n sensitive: props.sensitive,\n });\n\n if (authenticatedUser === null) {\n if (match) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n }\n // This emulates a Route's way of displaying nothing if the route's path doesn't match the\n // current URL.\n return null;\n }\n return (\n <PageRoute {...props} />\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACpE,IAAAC,WAAA,GAA8BZ,UAAU,CAACG,UAAU,CAAC;IAA5CU,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EAEzB,IAAMC,KAAK,GAAGZ,aAAa,CAAC;IAC1B;IACAa,IAAI,EAAEN,KAAK,CAACM,IAAI;IAChB;IACAC,KAAK,EAAEP,KAAK,CAACO,KAAK;IAClB;IACAC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpB;IACAC,SAAS,EAAET,KAAK,CAACS;EACnB,CAAC,CAAC;EAEF,IAAIL,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAIC,KAAK,EAAE;MACT,IAAMK,WAAW,GAAGX,WAAW,IAAIH,mBAAmB,CAACe,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;MAC5EF,MAAM,CAACC,QAAQ,CAACE,MAAM,CAACJ,WAAW,CAAC;IACrC;IACA;IACA;IACA,OAAO,IAAI;EACb;EACA,oBACEpB,KAAA,CAAAyB,aAAA,CAACpB,SAAS,EAAKK,
|
|
1
|
+
{"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","useRouteMatch","AppContext","PageRoute","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","props","_objectWithoutProperties","_excluded","_useContext","authenticatedUser","match","path","exact","strict","sensitive","destination","global","location","href","assign","createElement","propTypes","string","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouteMatch } from 'react-router-dom';\n\nimport AppContext from './AppContext';\nimport PageRoute from './PageRoute';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageRoute`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageRoute\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, ...props }) {\n const { authenticatedUser } = useContext(AppContext);\n\n const match = useRouteMatch({\n // eslint-disable-next-line react/prop-types\n path: props.path,\n // eslint-disable-next-line react/prop-types\n exact: props.exact,\n // eslint-disable-next-line react/prop-types\n strict: props.strict,\n // eslint-disable-next-line react/prop-types\n sensitive: props.sensitive,\n });\n\n if (authenticatedUser === null) {\n if (match) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n }\n // This emulates a Route's way of displaying nothing if the route's path doesn't match the\n // current URL.\n return null;\n }\n return (\n <PageRoute {...props} />\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACpE,IAAAC,WAAA,GAA8BZ,UAAU,CAACG,UAAU,CAAC;IAA5CU,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EAEzB,IAAMC,KAAK,GAAGZ,aAAa,CAAC;IAC1B;IACAa,IAAI,EAAEN,KAAK,CAACM,IAAI;IAChB;IACAC,KAAK,EAAEP,KAAK,CAACO,KAAK;IAClB;IACAC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpB;IACAC,SAAS,EAAET,KAAK,CAACS;EACnB,CAAC,CAAC;EAEF,IAAIL,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAIC,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