dce-reactkit 3.2.2-beta.4 → 3.2.2-beta.5

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/dist/cjs/index.js CHANGED
@@ -530,6 +530,18 @@ const LogBuiltInMetadata = {
530
530
  },
531
531
  };
532
532
 
533
+ /**
534
+ * Allowed log levels
535
+ * @author Gabe Abrams
536
+ */
537
+ var LogLevel;
538
+ (function (LogLevel) {
539
+ LogLevel["Warn"] = "Warn";
540
+ LogLevel["Info"] = "Info";
541
+ LogLevel["Debug"] = "Debug";
542
+ })(LogLevel || (LogLevel = {}));
543
+ var LogLevel$1 = LogLevel;
544
+
533
545
  // Keep track of whether or not session expiry has already been handled
534
546
  let sessionAlreadyExpired = false;
535
547
  /*------------------------------------------------------------------------*/
@@ -648,7 +660,7 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
648
660
  * @author Gabe Abrams
649
661
  */
650
662
  const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
651
- var _a, _b, _c, _d, _e, _f;
663
+ var _a, _b, _c, _d, _e, _f, _g;
652
664
  return visitServerEndpoint({
653
665
  path: LOG_ROUTE_PATH,
654
666
  method: 'POST',
@@ -657,8 +669,9 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* ()
657
669
  ? opts.context
658
670
  : ((_b = ((_a = opts.context) !== null && _a !== void 0 ? _a : {})._) !== null && _b !== void 0 ? _b : LogBuiltInMetadata.Context.Uncategorized)),
659
671
  subcontext: ((_c = opts.subcontext) !== null && _c !== void 0 ? _c : LogBuiltInMetadata.Context.Uncategorized),
660
- tags: JSON.stringify((_d = opts.tags) !== null && _d !== void 0 ? _d : []),
661
- metadata: JSON.stringify((_e = opts.metadata) !== null && _e !== void 0 ? _e : {}),
672
+ level: ((_d = opts.level) !== null && _d !== void 0 ? _d : LogLevel$1.Info),
673
+ tags: JSON.stringify((_e = opts.tags) !== null && _e !== void 0 ? _e : []),
674
+ metadata: JSON.stringify((_f = opts.metadata) !== null && _f !== void 0 ? _f : {}),
662
675
  errorMessage: (opts.error
663
676
  ? opts.error.message
664
677
  : undefined),
@@ -669,7 +682,7 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* ()
669
682
  ? opts.error.stack
670
683
  : undefined),
671
684
  target: (opts.action
672
- ? ((_f = opts.target) !== null && _f !== void 0 ? _f : LogBuiltInMetadata.Target.NoSpecificTarget)
685
+ ? ((_g = opts.target) !== null && _g !== void 0 ? _g : LogBuiltInMetadata.Target.NoSpecificTarget)
673
686
  : undefined),
674
687
  action: (opts.action
675
688
  ? opts.action
@@ -4070,7 +4083,7 @@ const initServer = (opts) => {
4070
4083
  * @param {number} month the month to query (e.g. 1 = January)
4071
4084
  * @returns {Log[]} list of logs from the given month
4072
4085
  */
4073
- opts.app.post(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler({
4086
+ opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler({
4074
4087
  paramTypes: {
4075
4088
  year: ParamType$1.Int,
4076
4089
  month: ParamType$1.Int,
@@ -4389,18 +4402,6 @@ const parseUserAgent = (userAgent) => {
4389
4402
  };
4390
4403
  };
4391
4404
 
4392
- /**
4393
- * Allowed log levels
4394
- * @author Gabe Abrams
4395
- */
4396
- var LogLevel;
4397
- (function (LogLevel) {
4398
- LogLevel["Warn"] = "Warn";
4399
- LogLevel["Info"] = "Info";
4400
- LogLevel["Debug"] = "Debug";
4401
- })(LogLevel || (LogLevel = {}));
4402
- var LogLevel$1 = LogLevel;
4403
-
4404
4405
  /**
4405
4406
  * Generate an express API route handler
4406
4407
  * @author Gabe Abrams