dce-expresskit 4.3.5 → 5.0.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.
Files changed (42) hide show
  1. package/lib/helpers/addDBEditorEndpoints/generateEndpointPath.js +2 -1
  2. package/lib/helpers/addDBEditorEndpoints/generateEndpointPath.js.map +1 -1
  3. package/lib/helpers/addDBEditorEndpoints/index.js +5 -5
  4. package/lib/helpers/addDBEditorEndpoints/index.js.map +1 -1
  5. package/lib/helpers/dataSigner.js +13 -13
  6. package/lib/helpers/dataSigner.js.map +1 -1
  7. package/lib/helpers/genRouteHandler.d.ts +1 -1
  8. package/lib/helpers/genRouteHandler.js +35 -35
  9. package/lib/helpers/genRouteHandler.js.map +1 -1
  10. package/lib/helpers/getLogReviewerLogs.d.ts +1 -1
  11. package/lib/helpers/getLogReviewerLogs.js +5 -5
  12. package/lib/helpers/getLogReviewerLogs.js.map +1 -1
  13. package/lib/helpers/handleError.js +2 -2
  14. package/lib/helpers/handleError.js.map +1 -1
  15. package/lib/helpers/initExpressKitCollections.d.ts +1 -1
  16. package/lib/helpers/initServer.d.ts +1 -1
  17. package/lib/helpers/initServer.js +21 -21
  18. package/lib/helpers/initServer.js.map +1 -1
  19. package/lib/helpers/visitEndpointOnAnotherServer/index.js +5 -5
  20. package/lib/helpers/visitEndpointOnAnotherServer/index.js.map +1 -1
  21. package/lib/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.js +7 -7
  22. package/lib/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.js.map +1 -1
  23. package/lib/html/genErrorPage.d.ts +1 -1
  24. package/lib/html/genErrorPage.js +4 -4
  25. package/lib/html/genErrorPage.js.map +1 -1
  26. package/lib/index.d.ts +1 -1
  27. package/lib/index.js +45 -45
  28. package/lib/index.js.map +1 -1
  29. package/package.json +2 -8
  30. package/src/helpers/addDBEditorEndpoints/generateEndpointPath.ts +2 -2
  31. package/src/helpers/addDBEditorEndpoints/index.ts +2 -2
  32. package/src/helpers/dataSigner.ts +2 -2
  33. package/src/helpers/genRouteHandler.ts +9 -9
  34. package/src/helpers/getLogReviewerLogs.ts +2 -2
  35. package/src/helpers/handleError.ts +2 -3
  36. package/src/helpers/initExpressKitCollections.ts +2 -2
  37. package/src/helpers/initServer.ts +3 -3
  38. package/src/helpers/visitEndpointOnAnotherServer/index.ts +5 -5
  39. package/src/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.ts +2 -2
  40. package/src/html/genErrorPage.ts +4 -7
  41. package/src/index.ts +2 -2
  42. package/src/errors/ErrorWithCode.tsx +0 -15
@@ -50,8 +50,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- // Import dce-reactkit
54
- var dce_reactkit_1 = require("dce-reactkit");
53
+ // Import dce-commonkit
54
+ var dce_commonkit_1 = require("dce-commonkit");
55
55
  // Import shared helpers
56
56
  var genRouteHandler_1 = __importDefault(require("./genRouteHandler"));
57
57
  var getLogReviewerLogs_1 = __importDefault(require("./getLogReviewerLogs"));
@@ -63,7 +63,7 @@ var initExpressKitCollections_1 = require("./initExpressKitCollections");
63
63
  /* Main */
64
64
  /*------------------------------------------------------------------------*/
65
65
  /**
66
- * Prepare dce-reactkit to run on the server
66
+ * Prepare dce-commonkit to run on the server
67
67
  * @author Gabe Abrams
68
68
  * @param opts object containing all arguments
69
69
  * @param opts.app express app from inside of the postprocessor function that
@@ -92,18 +92,18 @@ var initServer = function (opts) {
92
92
  * @param {LogAction} [action] the type of action performed on the target
93
93
  * @returns {Log}
94
94
  */
95
- opts.app.post(dce_reactkit_1.LOG_ROUTE_PATH, (0, genRouteHandler_1.default)({
95
+ opts.app.post(dce_commonkit_1.LOG_ROUTE_PATH, (0, genRouteHandler_1.default)({
96
96
  paramTypes: {
97
- context: dce_reactkit_1.ParamType.String,
98
- subcontext: dce_reactkit_1.ParamType.String,
99
- tags: dce_reactkit_1.ParamType.JSON,
100
- level: dce_reactkit_1.ParamType.String,
101
- metadata: dce_reactkit_1.ParamType.JSON,
102
- errorMessage: dce_reactkit_1.ParamType.StringOptional,
103
- errorCode: dce_reactkit_1.ParamType.StringOptional,
104
- errorStack: dce_reactkit_1.ParamType.StringOptional,
105
- target: dce_reactkit_1.ParamType.StringOptional,
106
- action: dce_reactkit_1.ParamType.StringOptional,
97
+ context: dce_commonkit_1.ParamType.String,
98
+ subcontext: dce_commonkit_1.ParamType.String,
99
+ tags: dce_commonkit_1.ParamType.JSON,
100
+ level: dce_commonkit_1.ParamType.String,
101
+ metadata: dce_commonkit_1.ParamType.JSON,
102
+ errorMessage: dce_commonkit_1.ParamType.StringOptional,
103
+ errorCode: dce_commonkit_1.ParamType.StringOptional,
104
+ errorStack: dce_commonkit_1.ParamType.StringOptional,
105
+ target: dce_commonkit_1.ParamType.StringOptional,
106
+ action: dce_commonkit_1.ParamType.StringOptional,
107
107
  },
108
108
  handler: function (_a) {
109
109
  var params = _a.params, logServerEvent = _a.logServerEvent;
@@ -183,7 +183,7 @@ var initServer = function (opts) {
183
183
  * @author Gabe Abrams
184
184
  * @returns {boolean} true if user has access
185
185
  */
186
- opts.app.get(dce_reactkit_1.LOG_REVIEW_STATUS_ROUTE, (0, genRouteHandler_1.default)({
186
+ opts.app.get(dce_commonkit_1.LOG_REVIEW_STATUS_ROUTE, (0, genRouteHandler_1.default)({
187
187
  handler: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
188
188
  var userId, isAdmin, canReview;
189
189
  var params = _b.params;
@@ -208,11 +208,11 @@ var initServer = function (opts) {
208
208
  * @param filters the filters to apply to the logs
209
209
  * @returns {Log[]} list of logs that match the filters
210
210
  */
211
- opts.app.get(dce_reactkit_1.LOG_REVIEW_GET_LOGS_ROUTE, (0, genRouteHandler_1.default)({
211
+ opts.app.get(dce_commonkit_1.LOG_REVIEW_GET_LOGS_ROUTE, (0, genRouteHandler_1.default)({
212
212
  paramTypes: {
213
- pageNumber: dce_reactkit_1.ParamType.Int,
214
- filters: dce_reactkit_1.ParamType.JSON,
215
- countDocuments: dce_reactkit_1.ParamType.Boolean,
213
+ pageNumber: dce_commonkit_1.ParamType.Int,
214
+ filters: dce_commonkit_1.ParamType.JSON,
215
+ countDocuments: dce_commonkit_1.ParamType.Boolean,
216
216
  },
217
217
  handler: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
218
218
  var pageNumber, userId, isAdmin, filters, countDocuments, canReview, logCollection, response;
@@ -225,7 +225,7 @@ var initServer = function (opts) {
225
225
  case 1:
226
226
  canReview = _c.sent();
227
227
  if (!canReview) {
228
- throw new dce_reactkit_1.ErrorWithCode('You cannot access this resource because you do not have the appropriate permissions.', ExpressKitErrorCode_1.default.NotAllowedToReviewLogs);
228
+ throw new dce_commonkit_1.ErrorWithCode('You cannot access this resource because you do not have the appropriate permissions.', ExpressKitErrorCode_1.default.NotAllowedToReviewLogs);
229
229
  }
230
230
  return [4 /*yield*/, (0, initExpressKitCollections_1.internalGetLogCollection)()];
231
231
  case 2:
@@ -254,7 +254,7 @@ var initServer = function (opts) {
254
254
  * a select admin, simply because this route starts with the select admin
255
255
  * prefix, it will result in an error
256
256
  */
257
- opts.app.get(dce_reactkit_1.SELECT_ADMIN_CHECK_ROUTE, (0, genRouteHandler_1.default)({
257
+ opts.app.get(dce_commonkit_1.SELECT_ADMIN_CHECK_ROUTE, (0, genRouteHandler_1.default)({
258
258
  handler: function () { return __awaiter(void 0, void 0, void 0, function () {
259
259
  return __generator(this, function (_a) {
260
260
  return [2 /*return*/, true];
@@ -1 +1 @@
1
- {"version":3,"file":"initServer.js","sourceRoot":"","sources":["../../src/helpers/initServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,sBAAsB;AACtB,6CAQsB;AAEtB,wBAAwB;AACxB,sEAAgD;AAChD,4EAAsD;AAEtD,sBAAsB;AACtB,q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tF,6BAAmB,CAAC,sBAAsB,CAC3C,CAAC;wBACJ,CAAC;wBAGqB,qBAAM,IAAA,oDAAwB,GAAE,EAAA;;wBAAhD,aAAa,GAAG,SAAgC;wBAGrC,qBAAM,IAAA,4BAAkB,EAAC;gCACxC,UAAU,YAAA;gCACV,OAAO,SAAA;gCACP,cAAc,gBAAA;gCACd,aAAa,eAAA;6BACd,CAAC,EAAA;;wBALI,QAAQ,GAAG,SAKf;wBAEF,kBAAkB;wBAClB,sBAAO,QAAQ,EAAC;;;aACjB;KACF,CAAC,CACH,CAAC;IAEF,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAE5C;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,CAAC,GAAG,CACV,wCAAwB,EACxB,IAAA,yBAAe,EAAC;QACd,OAAO,EAAE;;gBACP,sBAAO,IAAI,EAAC;;aACb;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -39,8 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- // Import dce-reactkit
43
- var dce_reactkit_1 = require("dce-reactkit");
42
+ // Import dce-commonkit
43
+ var dce_commonkit_1 = require("dce-commonkit");
44
44
  // Import shared types
45
45
  var sendServerToServerRequest_1 = __importDefault(require("./sendServerToServerRequest"));
46
46
  /*------------------------------------------------------------------------*/
@@ -71,13 +71,13 @@ var visitEndpointOnAnotherServer = function (opts) { return __awaiter(void 0, vo
71
71
  response = _a.sent();
72
72
  // Check for failure
73
73
  if (!response || !response.body) {
74
- throw new dce_reactkit_1.ErrorWithCode('We didn\'t get a response from the other server. Please check the network between the two connection.', dce_reactkit_1.ReactKitErrorCode.NoResponse);
74
+ throw new dce_commonkit_1.ErrorWithCode('We didn\'t get a response from the other server. Please check the network between the two connection.', dce_commonkit_1.CommonKitErrorCode.NoResponse);
75
75
  }
76
76
  if (!response.body.success) {
77
77
  // Other errors
78
- throw new dce_reactkit_1.ErrorWithCode((response.body.message
78
+ throw new dce_commonkit_1.ErrorWithCode((response.body.message
79
79
  || 'An unknown error occurred. Please contact an admin.'), (response.body.code
80
- || dce_reactkit_1.ReactKitErrorCode.NoCode));
80
+ || dce_commonkit_1.CommonKitErrorCode.NoCode));
81
81
  }
82
82
  body = response.body.body;
83
83
  // Return
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/visitEndpointOnAnotherServer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,6CAGsB;AAEtB,sBAAsB;AACtB,0FAAoE;AAEpE,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E;;;;;;;;;GASG;AACH,IAAM,4BAA4B,GAAG,UACnC,IAMC;;;;oBAGgB,qBAAM,IAAA,mCAAyB,EAAC;oBAC/C,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,YAAY,EAAE,IAAI,CAAC,YAAY;iBAChC,CAAC,EAAA;;gBANI,QAAQ,GAAG,SAMf;gBAEF,oBAAoB;gBACpB,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAChC,MAAM,IAAI,4BAAa,CACrB,uGAAuG,EACvG,gCAAiB,CAAC,UAAU,CAC7B,CAAC;gBACJ,CAAC;gBACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;oBAC3B,eAAe;oBACf,MAAM,IAAI,4BAAa,CACrB,CACE,QAAQ,CAAC,IAAI,CAAC,OAAO;2BAClB,qDAAqD,CACzD,EACD,CACE,QAAQ,CAAC,IAAI,CAA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K,QAAQ,CAAC,IAAI,KAAlB,CAAmB;gBAE/B,SAAS;gBACT,sBAAO,IAAI,EAAC;;;KACb,CAAC;AAEF,kBAAe,4BAA4B,CAAC"}
@@ -42,8 +42,8 @@ var _a;
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  // Import libs
44
44
  var qs_1 = __importDefault(require("qs"));
45
- // Import dce-reactkit
46
- var dce_reactkit_1 = require("dce-reactkit");
45
+ // Import dce-commonkit
46
+ var dce_commonkit_1 = require("dce-commonkit");
47
47
  // Import data signer
48
48
  var dataSigner_1 = require("../dataSigner");
49
49
  // Import shared types
@@ -70,7 +70,7 @@ var credentials = (((_a = process.env.DCEKIT_CROSS_SERVER_CREDENTIALS) !== null
70
70
  var parts = str.split(':');
71
71
  // Check for errors
72
72
  if (parts.length !== 3) {
73
- throw new dce_reactkit_1.ErrorWithCode('Invalid DCEKIT_CROSS_SERVER_CREDENTIALS format. Each credential must be in the format |host:key:secret|', ExpressKitErrorCode_1.default.InvalidCrossServerCredentialsFormat);
73
+ throw new dce_commonkit_1.ErrorWithCode('Invalid DCEKIT_CROSS_SERVER_CREDENTIALS format. Each credential must be in the format |host:key:secret|', ExpressKitErrorCode_1.default.InvalidCrossServerCredentialsFormat);
74
74
  }
75
75
  // Return the credential
76
76
  return {
@@ -94,7 +94,7 @@ var getCrossServerCredential = function (host) {
94
94
  return cred.host.toLowerCase() === host.toLowerCase();
95
95
  });
96
96
  if (!credential) {
97
- throw new dce_reactkit_1.ErrorWithCode('Cannot send cross-server signed request there was no credential that matched the host that the request is being sent to.', ExpressKitErrorCode_1.default.CrossServerNoCredentialsToSignWith);
97
+ throw new dce_commonkit_1.ErrorWithCode('Cannot send cross-server signed request there was no credential that matched the host that the request is being sent to.', ExpressKitErrorCode_1.default.CrossServerNoCredentialsToSignWith);
98
98
  }
99
99
  // Return credential
100
100
  return credential;
@@ -218,16 +218,16 @@ var sendServerToServerRequest = function (opts) { return __awaiter(void 0, void
218
218
  }];
219
219
  case 9:
220
220
  err_1 = _b.sent();
221
- throw new dce_reactkit_1.ErrorWithCode("Failed to parse response as ".concat(opts.responseType, ": ").concat(err_1 === null || err_1 === void 0 ? void 0 : err_1.message), ExpressKitErrorCode_1.default.ResponseParseError);
221
+ throw new dce_commonkit_1.ErrorWithCode("Failed to parse response as ".concat(opts.responseType, ": ").concat(err_1 === null || err_1 === void 0 ? void 0 : err_1.message), ExpressKitErrorCode_1.default.ResponseParseError);
222
222
  case 10: return [3 /*break*/, 12];
223
223
  case 11:
224
224
  err_2 = _b.sent();
225
225
  // Self-signed certificate error:
226
226
  if ((_a = err_2 === null || err_2 === void 0 ? void 0 : err_2.message) === null || _a === void 0 ? void 0 : _a.includes('self signed certificate')) {
227
- throw new dce_reactkit_1.ErrorWithCode('We refused to send a request because the receiver has self-signed certificates.', ExpressKitErrorCode_1.default.SelfSigned);
227
+ throw new dce_commonkit_1.ErrorWithCode('We refused to send a request because the receiver has self-signed certificates.', ExpressKitErrorCode_1.default.SelfSigned);
228
228
  }
229
229
  // No tries left
230
- throw new dce_reactkit_1.ErrorWithCode("We encountered an error when trying to send a network request. If this issue persists, contact an admin. Error: ".concat(err_2 === null || err_2 === void 0 ? void 0 : err_2.message), ExpressKitErrorCode_1.default.NotConnected);
230
+ throw new dce_commonkit_1.ErrorWithCode("We encountered an error when trying to send a network request. If this issue persists, contact an admin. Error: ".concat(err_2 === null || err_2 === void 0 ? void 0 : err_2.message), ExpressKitErrorCode_1.default.NotConnected);
231
231
  case 12: return [2 /*return*/];
232
232
  }
233
233
  });
@@ -1 +1 @@
1
- {"version":3,"file":"sendServerToServerRequest.js","sourceRoot":"","sources":["../../../src/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,0CAAoB;AAEpB,sBAAsB;AACtB,6CAEsB;AAEtB,qBAAqB;AACrB,4CAA4C;AAE5C,sBAAsB;AAC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AAC,UAAU,CAC/B,CAAC;gBACJ,CAAC;gBAED,gBAAgB;gBAChB,MAAM,IAAI,4BAAa,CACrB,0HAAoH,KAAW,aAAX,KAAG,uBAAH,KAAG,CAAU,OAAO,CAAE,EAC1I,6BAAmB,CAAC,YAAY,CACjC,CAAC;;;;KAEL,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"sendServerToServerRequest.js","sourceRoot":"","sources":["../../../src/helpers/visitEndpointOnAnotherServer/sendServerToServerRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,0CAAoB;AAEpB,uBAAuB;AACvB,+CAEuB;AAEvB,qBAAqB;AACrB,4CAA4C;AAE5C,sBAAsB;AACtB,wFAAkE;AAElE,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAE5E;;;EAGE;AAEF,IAAM,WAAW,GAIX,CACF,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,+BAA+B,mCAAI,EAAE,CAAC;IACjD,uCAAuC;KACtC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,aAAa;KACZ,KAAK,CAAC,GAAG,CAAC;IACX,uBAAuB;KACtB,MAAM,CAAC,UAAC,GAAG;IACV,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/B,CAAC,CAAC;IACF,0BAA0B;KACzB,GAAG,CAAC,UAAC,GAAG;IACP,aAAa;IACb,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE7B,mBAAmB;IACnB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,6BAAa,CACrB,yGAAyG,EACzG,6BAAmB,CAAC,mCAAmC,CACxD,CAAC;IACJ,CAAC;IAED,wBAAwB;IACxB,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAA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B,CAAC;;;YAGvC,kBAAkB;YAClB,sBAAO;oBACL,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,OAAO,EAAE,iBAAe;iBACzB,EAAC;;;gBAEF,MAAM,IAAI,6BAAa,CACrB,sCAA+B,IAAI,CAAC,YAAY,eAAM,KAAW,aAAX,KAAG,uBAAH,KAAG,CAAU,OAAO,CAAE,EAC5E,6BAAmB,CAAC,kBAAkB,CACvC,CAAC;;;;gBAGJ,iCAAiC;gBACjC,IAAI,MAAC,KAAW,aAAX,KAAG,uBAAH,KAAG,CAAU,OAAO,0CAAE,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC;oBAC/D,MAAM,IAAI,6BAAa,CACrB,iFAAiF,EACjF,6BAAmB,CAAC,UAAU,CAC/B,CAAC;gBACJ,CAAC;gBAED,gBAAgB;gBAChB,MAAM,IAAI,6BAAa,CACrB,0HAAoH,KAAW,aAAX,KAAG,uBAAH,KAAG,CAAU,OAAO,CAAE,EAC1I,6BAAmB,CAAC,YAAY,CACjC,CAAC;;;;KAEL,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * @param [opts.title=An Error Occurred] title of the error box
6
6
  * @param [opts.description=An unknown server error occurred. Please contact support.]
7
7
  * a human-readable description of the error
8
- * @param [opts.code=ReactKitErrorCode.NoCode] error code to show
8
+ * @param [opts.code=CommonKitErrorCode.NoCode] error code to show
9
9
  * @param [opts.pageTitle=opts.title] title of the page/tab if it differs from
10
10
  * the title of the error
11
11
  * @returns html of the page
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Import dce-reactkit
4
- var dce_reactkit_1 = require("dce-reactkit");
3
+ // Import dce-commonkit
4
+ var dce_commonkit_1 = require("dce-commonkit");
5
5
  /**
6
6
  * Generate a static error page
7
7
  * @author Gabe Abrams
@@ -9,7 +9,7 @@ var dce_reactkit_1 = require("dce-reactkit");
9
9
  * @param [opts.title=An Error Occurred] title of the error box
10
10
  * @param [opts.description=An unknown server error occurred. Please contact support.]
11
11
  * a human-readable description of the error
12
- * @param [opts.code=ReactKitErrorCode.NoCode] error code to show
12
+ * @param [opts.code=CommonKitErrorCode.NoCode] error code to show
13
13
  * @param [opts.pageTitle=opts.title] title of the page/tab if it differs from
14
14
  * the title of the error
15
15
  * @returns html of the page
@@ -20,7 +20,7 @@ var genErrorPage = function (opts) {
20
20
  var title = ((_a = opts.title) !== null && _a !== void 0 ? _a : 'An Error Occurred');
21
21
  var pageTitle = ((_b = opts.pageTitle) !== null && _b !== void 0 ? _b : title);
22
22
  var description = ((_c = opts.description) !== null && _c !== void 0 ? _c : 'An unknown server error occurred. Please contact support.');
23
- var code = ((_d = opts.code) !== null && _d !== void 0 ? _d : dce_reactkit_1.ReactKitErrorCode.NoCode);
23
+ var code = ((_d = opts.code) !== null && _d !== void 0 ? _d : dce_commonkit_1.CommonKitErrorCode.NoCode);
24
24
  return "\n<head>\n <!-- Metadata -->\n <meta\n name=\"viewport\"\n content=\"width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0\"\n >\n\n <!-- Title -->\n <title>".concat(pageTitle, "</title>\n\n <!-- Bootstrap -->\n <link\n rel=\"stylesheet\"\n href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.1/css/bootstrap.min.css\"\n integrity=\"sha512-siwe/oXMhSjGCwLn+scraPOWrJxHlUgMBMZXdPe2Tnk3I0x3ESCoLz7WZ5NTH6SZrywMY+PB1cjyqJ5jAluCOg==\"\n crossorigin=\"anonymous\"\n referrerpolicy=\"no-referrer\"\n />\n <script\n src=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.1/js/bootstrap.min.js\"\n integrity=\"sha512-vyRAVI0IEm6LI/fVSv/Wq/d0KUfrg3hJq2Qz5FlfER69sf3ZHlOrsLriNm49FxnpUGmhx+TaJKwJ+ByTLKT+Yg==\"\n crossorigin=\"anonymous\"\n referrerpolicy=\"no-referrer\"\n ></script>\n\n <!-- FontAwesome -->\n <link\n rel=\"stylesheet\"\n href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css\"\n integrity=\"sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==\"\n crossorigin=\"anonymous\"\n referrerpolicy=\"no-referrer\"\n />\n\n <!-- Style -->\n <style>\n .DCEReactKit-pop-in {\n animation-name: DCEReactKit-pop-in;\n animation-duration: 0.5s;\n animation-iteration-count: 1;\n animation-timing-function: ease-out;\n animation-fill-mode: both;\n\n transform-origin: center;\n }\n\n @keyframes DCEReactKit-pop-in {\n 0% {\n opacity: 0;\n transform: scale(0.9);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n .DCEReactKit-slide-in {\n animation-name: DCEReactKit-slide-in;\n animation-duration: 1s;\n animation-iteration-count: 1;\n animation-timing-function: ease-out;\n animation-fill-mode: both;\n animation-delay: 0.2s;\n }\n\n @keyframes DCEReactKit-slide-in {\n 0% {\n opacity: 0;\n transform: translate(0, 0.3em);\n }\n 100% {\n opacity: 1;\n transform: translate(0, 0);\n }\n }\n </style>\n</head>\n\n<!-- Body -->\n<body class=\"bg-dark text-center pt-3 ps-3 pe-3\">\n <!-- Alert -->\n <div\n class=\"DCEReactKit-pop-in alert alert-warning d-inline-block\"\n style=\"width: 50em; max-width: 100%\"\n >\n <!-- Title -->\n <h2>\n <i class=\"me-1 fa-solid fa-triangle-exclamation\"></i>\n ").concat(title, "\n </h2>\n <!-- Description -->\n <div>\n ").concat(description, "\n </div>\n </div>\n\n <!-- Error Code -->\n <div class=\"DCEReactKit-slide-in text-light\">\n <strong>\n Error Code:\n </strong>\n ").concat(code, "\n </div>\n</body>\n ");
25
25
  };
26
26
  exports.default = genErrorPage;
@@ -1 +1 @@
1
- {"version":3,"file":"genErrorPage.js","sourceRoot":"","sources":["../../src/html/genErrorPage.ts"],"names":[],"mappings":";;AAAA,sBAAsB;AACtB,6CAAiD;AAKjD;;;;;;;;;;;GAWG;AACH,IAAM,YAAY,GAAG,UACnB,IAKM;;IALN,qBAAA,EAAA,SAKM;IAEN,IAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,mBAAmB,CAAC,CAAC;IAClD,IAAM,SAAS,GAAG,CAAC,MAAA,IAAI,CAAC,SAAS,mCAAI,KAAK,CAAC,CAAC;IAC5C,IAAM,WAAW,GAAG,CAClB,MAAA,IAAI,CAAC,WAAW,mCACb,2DAA2D,CAC/D,CAAC;IACF,IAAM,IAAI,GAAG,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,gCAAiB,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,2MASE,SAAS,uuEAiFZ,KAAK,qEAIL,WAAW,qKASb,IAAI,4BAGP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"genErrorPage.js","sourceRoot":"","sources":["../../src/html/genErrorPage.ts"],"names":[],"mappings":";;AAAA,uBAAuB;AACvB,+CAAmD;AAEnD;;;;;;;;;;;GAWG;AACH,IAAM,YAAY,GAAG,UACnB,IAKM;;IALN,qBAAA,EAAA,SAKM;IAEN,IAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,mBAAmB,CAAC,CAAC;IAClD,IAAM,SAAS,GAAG,CAAC,MAAA,IAAI,CAAC,SAAS,mCAAI,KAAK,CAAC,CAAC;IAC5C,IAAM,WAAW,GAAG,CAClB,MAAA,IAAI,CAAC,WAAW,mCACb,2DAA2D,CAC/D,CAAC;IACF,IAAM,IAAI,GAAG,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,kCAAkB,CAAC,MAAM,CAAC,CAAC;IAEtD,OAAO,2MASE,SAAS,uuEAiFZ,KAAK,qEAIL,WAAW,qKASb,IAAI,4BAGP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, getTimestampFromTimeInfoInET, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, extractProp, compareArraysByProp, getLocalTimeInfo, genCommaList, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, ErrorWithCode, ParamType } from 'dce-reactkit';
1
+ import { abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, getTimestampFromTimeInfoInET, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, extractProp, compareArraysByProp, getLocalTimeInfo, genCommaList, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, ErrorWithCode, ParamType } from 'dce-commonkit';
2
2
  import initServer from './helpers/initServer';
3
3
  import genRouteHandler from './helpers/genRouteHandler';
4
4
  import handleError from './helpers/handleError';
package/lib/index.js CHANGED
@@ -38,51 +38,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.LogBuiltInMetadata = exports.LogAction = exports.LogSource = exports.LogType = exports.DayOfWeek = exports.visitEndpointOnAnotherServer = exports.addDBEditorEndpoints = exports.getLogCollection = exports.initExpressKitCollections = exports.handleSuccess = exports.handleError = exports.genRouteHandler = exports.initServer = exports.shuffleArray = exports.capitalize = exports.someAsync = exports.mapAsync = exports.forEachAsync = exports.filterAsync = exports.everyAsync = exports.prefixWithAOrAn = exports.getLocalTimeInfo = exports.genCommaList = exports.compareArraysByProp = exports.extractProp = exports.genCSV = exports.getMonthName = exports.parallelLimit = exports.onlyKeepLetters = exports.stringsToHumanReadableList = exports.getPartOfDay = exports.getHumanReadableDate = exports.startMinWait = exports.getTimestampFromTimeInfoInET = exports.getTimeInfoInET = exports.getOrdinal = exports.waitMs = exports.sum = exports.roundToNumDecimals = exports.padZerosLeft = exports.padDecimalZeros = exports.forceNumIntoBounds = exports.floorToNumDecimals = exports.ceilToNumDecimals = exports.avg = exports.abbreviate = exports.DAY_IN_MS = exports.HOUR_IN_MS = exports.MINUTE_IN_MS = exports.ErrorWithCode = void 0;
40
40
  exports.ParamType = void 0;
41
- // Import dce-reactkit
42
- var dce_reactkit_1 = require("dce-reactkit");
43
- Object.defineProperty(exports, "abbreviate", { enumerable: true, get: function () { return dce_reactkit_1.abbreviate; } });
44
- Object.defineProperty(exports, "avg", { enumerable: true, get: function () { return dce_reactkit_1.avg; } });
45
- Object.defineProperty(exports, "ceilToNumDecimals", { enumerable: true, get: function () { return dce_reactkit_1.ceilToNumDecimals; } });
46
- Object.defineProperty(exports, "floorToNumDecimals", { enumerable: true, get: function () { return dce_reactkit_1.floorToNumDecimals; } });
47
- Object.defineProperty(exports, "forceNumIntoBounds", { enumerable: true, get: function () { return dce_reactkit_1.forceNumIntoBounds; } });
48
- Object.defineProperty(exports, "padDecimalZeros", { enumerable: true, get: function () { return dce_reactkit_1.padDecimalZeros; } });
49
- Object.defineProperty(exports, "padZerosLeft", { enumerable: true, get: function () { return dce_reactkit_1.padZerosLeft; } });
50
- Object.defineProperty(exports, "roundToNumDecimals", { enumerable: true, get: function () { return dce_reactkit_1.roundToNumDecimals; } });
51
- Object.defineProperty(exports, "sum", { enumerable: true, get: function () { return dce_reactkit_1.sum; } });
52
- Object.defineProperty(exports, "waitMs", { enumerable: true, get: function () { return dce_reactkit_1.waitMs; } });
53
- Object.defineProperty(exports, "getOrdinal", { enumerable: true, get: function () { return dce_reactkit_1.getOrdinal; } });
54
- Object.defineProperty(exports, "getTimeInfoInET", { enumerable: true, get: function () { return dce_reactkit_1.getTimeInfoInET; } });
55
- Object.defineProperty(exports, "getTimestampFromTimeInfoInET", { enumerable: true, get: function () { return dce_reactkit_1.getTimestampFromTimeInfoInET; } });
56
- Object.defineProperty(exports, "startMinWait", { enumerable: true, get: function () { return dce_reactkit_1.startMinWait; } });
57
- Object.defineProperty(exports, "getHumanReadableDate", { enumerable: true, get: function () { return dce_reactkit_1.getHumanReadableDate; } });
58
- Object.defineProperty(exports, "getPartOfDay", { enumerable: true, get: function () { return dce_reactkit_1.getPartOfDay; } });
59
- Object.defineProperty(exports, "stringsToHumanReadableList", { enumerable: true, get: function () { return dce_reactkit_1.stringsToHumanReadableList; } });
60
- Object.defineProperty(exports, "onlyKeepLetters", { enumerable: true, get: function () { return dce_reactkit_1.onlyKeepLetters; } });
61
- Object.defineProperty(exports, "parallelLimit", { enumerable: true, get: function () { return dce_reactkit_1.parallelLimit; } });
62
- Object.defineProperty(exports, "getMonthName", { enumerable: true, get: function () { return dce_reactkit_1.getMonthName; } });
63
- Object.defineProperty(exports, "genCSV", { enumerable: true, get: function () { return dce_reactkit_1.genCSV; } });
64
- Object.defineProperty(exports, "extractProp", { enumerable: true, get: function () { return dce_reactkit_1.extractProp; } });
65
- Object.defineProperty(exports, "compareArraysByProp", { enumerable: true, get: function () { return dce_reactkit_1.compareArraysByProp; } });
66
- Object.defineProperty(exports, "getLocalTimeInfo", { enumerable: true, get: function () { return dce_reactkit_1.getLocalTimeInfo; } });
67
- Object.defineProperty(exports, "genCommaList", { enumerable: true, get: function () { return dce_reactkit_1.genCommaList; } });
68
- Object.defineProperty(exports, "prefixWithAOrAn", { enumerable: true, get: function () { return dce_reactkit_1.prefixWithAOrAn; } });
69
- Object.defineProperty(exports, "everyAsync", { enumerable: true, get: function () { return dce_reactkit_1.everyAsync; } });
70
- Object.defineProperty(exports, "filterAsync", { enumerable: true, get: function () { return dce_reactkit_1.filterAsync; } });
71
- Object.defineProperty(exports, "forEachAsync", { enumerable: true, get: function () { return dce_reactkit_1.forEachAsync; } });
72
- Object.defineProperty(exports, "mapAsync", { enumerable: true, get: function () { return dce_reactkit_1.mapAsync; } });
73
- Object.defineProperty(exports, "someAsync", { enumerable: true, get: function () { return dce_reactkit_1.someAsync; } });
74
- Object.defineProperty(exports, "capitalize", { enumerable: true, get: function () { return dce_reactkit_1.capitalize; } });
75
- Object.defineProperty(exports, "shuffleArray", { enumerable: true, get: function () { return dce_reactkit_1.shuffleArray; } });
76
- Object.defineProperty(exports, "DayOfWeek", { enumerable: true, get: function () { return dce_reactkit_1.DayOfWeek; } });
77
- Object.defineProperty(exports, "LogType", { enumerable: true, get: function () { return dce_reactkit_1.LogType; } });
78
- Object.defineProperty(exports, "LogSource", { enumerable: true, get: function () { return dce_reactkit_1.LogSource; } });
79
- Object.defineProperty(exports, "LogAction", { enumerable: true, get: function () { return dce_reactkit_1.LogAction; } });
80
- Object.defineProperty(exports, "LogBuiltInMetadata", { enumerable: true, get: function () { return dce_reactkit_1.LogBuiltInMetadata; } });
81
- Object.defineProperty(exports, "MINUTE_IN_MS", { enumerable: true, get: function () { return dce_reactkit_1.MINUTE_IN_MS; } });
82
- Object.defineProperty(exports, "HOUR_IN_MS", { enumerable: true, get: function () { return dce_reactkit_1.HOUR_IN_MS; } });
83
- Object.defineProperty(exports, "DAY_IN_MS", { enumerable: true, get: function () { return dce_reactkit_1.DAY_IN_MS; } });
84
- Object.defineProperty(exports, "ErrorWithCode", { enumerable: true, get: function () { return dce_reactkit_1.ErrorWithCode; } });
85
- Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return dce_reactkit_1.ParamType; } });
41
+ // Import dce-commonkit
42
+ var dce_commonkit_1 = require("dce-commonkit");
43
+ Object.defineProperty(exports, "abbreviate", { enumerable: true, get: function () { return dce_commonkit_1.abbreviate; } });
44
+ Object.defineProperty(exports, "avg", { enumerable: true, get: function () { return dce_commonkit_1.avg; } });
45
+ Object.defineProperty(exports, "ceilToNumDecimals", { enumerable: true, get: function () { return dce_commonkit_1.ceilToNumDecimals; } });
46
+ Object.defineProperty(exports, "floorToNumDecimals", { enumerable: true, get: function () { return dce_commonkit_1.floorToNumDecimals; } });
47
+ Object.defineProperty(exports, "forceNumIntoBounds", { enumerable: true, get: function () { return dce_commonkit_1.forceNumIntoBounds; } });
48
+ Object.defineProperty(exports, "padDecimalZeros", { enumerable: true, get: function () { return dce_commonkit_1.padDecimalZeros; } });
49
+ Object.defineProperty(exports, "padZerosLeft", { enumerable: true, get: function () { return dce_commonkit_1.padZerosLeft; } });
50
+ Object.defineProperty(exports, "roundToNumDecimals", { enumerable: true, get: function () { return dce_commonkit_1.roundToNumDecimals; } });
51
+ Object.defineProperty(exports, "sum", { enumerable: true, get: function () { return dce_commonkit_1.sum; } });
52
+ Object.defineProperty(exports, "waitMs", { enumerable: true, get: function () { return dce_commonkit_1.waitMs; } });
53
+ Object.defineProperty(exports, "getOrdinal", { enumerable: true, get: function () { return dce_commonkit_1.getOrdinal; } });
54
+ Object.defineProperty(exports, "getTimeInfoInET", { enumerable: true, get: function () { return dce_commonkit_1.getTimeInfoInET; } });
55
+ Object.defineProperty(exports, "getTimestampFromTimeInfoInET", { enumerable: true, get: function () { return dce_commonkit_1.getTimestampFromTimeInfoInET; } });
56
+ Object.defineProperty(exports, "startMinWait", { enumerable: true, get: function () { return dce_commonkit_1.startMinWait; } });
57
+ Object.defineProperty(exports, "getHumanReadableDate", { enumerable: true, get: function () { return dce_commonkit_1.getHumanReadableDate; } });
58
+ Object.defineProperty(exports, "getPartOfDay", { enumerable: true, get: function () { return dce_commonkit_1.getPartOfDay; } });
59
+ Object.defineProperty(exports, "stringsToHumanReadableList", { enumerable: true, get: function () { return dce_commonkit_1.stringsToHumanReadableList; } });
60
+ Object.defineProperty(exports, "onlyKeepLetters", { enumerable: true, get: function () { return dce_commonkit_1.onlyKeepLetters; } });
61
+ Object.defineProperty(exports, "parallelLimit", { enumerable: true, get: function () { return dce_commonkit_1.parallelLimit; } });
62
+ Object.defineProperty(exports, "getMonthName", { enumerable: true, get: function () { return dce_commonkit_1.getMonthName; } });
63
+ Object.defineProperty(exports, "genCSV", { enumerable: true, get: function () { return dce_commonkit_1.genCSV; } });
64
+ Object.defineProperty(exports, "extractProp", { enumerable: true, get: function () { return dce_commonkit_1.extractProp; } });
65
+ Object.defineProperty(exports, "compareArraysByProp", { enumerable: true, get: function () { return dce_commonkit_1.compareArraysByProp; } });
66
+ Object.defineProperty(exports, "getLocalTimeInfo", { enumerable: true, get: function () { return dce_commonkit_1.getLocalTimeInfo; } });
67
+ Object.defineProperty(exports, "genCommaList", { enumerable: true, get: function () { return dce_commonkit_1.genCommaList; } });
68
+ Object.defineProperty(exports, "prefixWithAOrAn", { enumerable: true, get: function () { return dce_commonkit_1.prefixWithAOrAn; } });
69
+ Object.defineProperty(exports, "everyAsync", { enumerable: true, get: function () { return dce_commonkit_1.everyAsync; } });
70
+ Object.defineProperty(exports, "filterAsync", { enumerable: true, get: function () { return dce_commonkit_1.filterAsync; } });
71
+ Object.defineProperty(exports, "forEachAsync", { enumerable: true, get: function () { return dce_commonkit_1.forEachAsync; } });
72
+ Object.defineProperty(exports, "mapAsync", { enumerable: true, get: function () { return dce_commonkit_1.mapAsync; } });
73
+ Object.defineProperty(exports, "someAsync", { enumerable: true, get: function () { return dce_commonkit_1.someAsync; } });
74
+ Object.defineProperty(exports, "capitalize", { enumerable: true, get: function () { return dce_commonkit_1.capitalize; } });
75
+ Object.defineProperty(exports, "shuffleArray", { enumerable: true, get: function () { return dce_commonkit_1.shuffleArray; } });
76
+ Object.defineProperty(exports, "DayOfWeek", { enumerable: true, get: function () { return dce_commonkit_1.DayOfWeek; } });
77
+ Object.defineProperty(exports, "LogType", { enumerable: true, get: function () { return dce_commonkit_1.LogType; } });
78
+ Object.defineProperty(exports, "LogSource", { enumerable: true, get: function () { return dce_commonkit_1.LogSource; } });
79
+ Object.defineProperty(exports, "LogAction", { enumerable: true, get: function () { return dce_commonkit_1.LogAction; } });
80
+ Object.defineProperty(exports, "LogBuiltInMetadata", { enumerable: true, get: function () { return dce_commonkit_1.LogBuiltInMetadata; } });
81
+ Object.defineProperty(exports, "MINUTE_IN_MS", { enumerable: true, get: function () { return dce_commonkit_1.MINUTE_IN_MS; } });
82
+ Object.defineProperty(exports, "HOUR_IN_MS", { enumerable: true, get: function () { return dce_commonkit_1.HOUR_IN_MS; } });
83
+ Object.defineProperty(exports, "DAY_IN_MS", { enumerable: true, get: function () { return dce_commonkit_1.DAY_IN_MS; } });
84
+ Object.defineProperty(exports, "ErrorWithCode", { enumerable: true, get: function () { return dce_commonkit_1.ErrorWithCode; } });
85
+ Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return dce_commonkit_1.ParamType; } });
86
86
  // Import helpers
87
87
  var initServer_1 = __importDefault(require("./helpers/initServer"));
88
88
  exports.initServer = initServer_1.default;
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,6CA+CsB;AAuBpB,2FArEA,yBAAU,OAqEA;AACV,oFArEA,kBAAG,OAqEA;AACH,kGArEA,gCAAiB,OAqEA;AACjB,mGArEA,iCAAkB,OAqEA;AAClB,mGArEA,iCAAkB,OAqEA;AAClB,gGArEA,8BAAe,OAqEA;AACf,6FArEA,2BAAY,OAqEA;AACZ,mGArEA,iCAAkB,OAqEA;AAClB,oFArEA,kBAAG,OAqEA;AACH,uFArEA,qBAAM,OAqEA;AACN,2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oDhG,oCApDK,mCAAyB,CAoDL;AACzB,iGArDkC,4CAAgB,OAqDlC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,+CA+CuB;AAuBrB,2FArEA,0BAAU,OAqEA;AACV,oFArEA,mBAAG,OAqEA;AACH,kGArEA,iCAAiB,OAqEA;AACjB,mGArEA,kCAAkB,OAqEA;AAClB,mGArEA,kCAAkB,OAqEA;AAClB,gGArEA,+BAAe,OAqEA;AACf,6FArEA,4BAAY,OAqEA;AACZ,mGArEA,kCAAkB,OAqEA;AAClB,oFArEA,mBAAG,OAqEA;AACH,uFArEA,sBAAM,OAqEA;AACN,2FArEA,0BAAU,OAqEA;AACV,gGArEA,+BAAe,OAqEA;AACf,6GArEA,4CAA4B,OAqEA;AAC5B,6FArEA,4BAAY,OAqEA;AACZ,qGArEA,oCAAoB,OAqEA;AACpB,6FArEA,4BAAY,OAqEA;AACZ,2GArEA,0CAA0B,OAqEA;AAC1B,gGArEA,+BAAe,OAqEA;AACf,8FArEA,6BAAa,OAqEA;AACb,6FArEA,4BAAY,OAqEA;AACZ,uFArEA,sBAAM,OAqEA;AACN,4FArEA,2BAAW,OAqEA;AACX,oGArEA,mCAAmB,OAqEA;AAEnB,iGAtEA,gCAAgB,OAsEA;AADhB,6FApEA,4BAAY,OAoEA;AAEZ,gGArEA,+BAAe,OAqEA;AACf,2FArEA,0BAAU,OAqEA;AACV,4FArEA,2BAAW,OAqEA;AACX,6FArEA,4BAAY,OAqEA;AACZ,yFArEA,wBAAQ,OAqEA;AACR,0FArEA,yBAAS,OAqEA;AACT,2FArEA,0BAAU,OAqEA;AACV,6FArEA,4BAAY,OAqEA;AAWZ,0FA/EA,yBAAS,OA+EA;AAET,wFA/EA,uBAAO,OA+EA;AACP,0FA/EA,yBAAS,OA+EA;AACT,0FA/EA,yBAAS,OA+EA;AACT,mGA/EA,kCAAkB,OA+EA;AApDlB,6FAxBA,4BAAY,OAwBA;AACZ,2FAxBA,0BAAU,OAwBA;AACV,0FAxBA,yBAAS,OAwBA;AAJT,8FAnBA,6BAAa,OAmBA;AA2Db,0FA7EA,yBAAS,OA6EA;AA1EX,iBAAiB;AACjB,oEAA8C;AAsD5C,qBAtDK,oBAAU,CAsDL;AArDZ,8EAAwD;AAsDtD,0BAtDK,yBAAe,CAsDL;AArDjB,sEAAgD;AAsD9C,sBAtDK,qBAAW,CAsDL;AArDb,0EAAoD;AAsDlD,wBAtDK,uBAAa,CAsDL;AArDf,wFAAkE;AAwDhE,+BAxDK,8BAAoB,CAwDL;AAvDtB,wGAAkF;AAwDhF,uCAxDK,sCAA4B,CAwDL;AAvD9B,+FAAkG;AAoDhG,oCApDK,mCAAyB,CAoDL;AACzB,iGArDkC,4CAAgB,OAqDlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-expresskit",
3
- "version": "4.3.5",
3
+ "version": "5.0.0",
4
4
  "description": "Shared functions, helpers, and tools for Harvard DCE Express-based servers",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -20,13 +20,7 @@
20
20
  "Toolkit"
21
21
  ],
22
22
  "dependencies": {
23
- "@fortawesome/fontawesome-svg-core": "^6.7.2",
24
- "@fortawesome/free-regular-svg-icons": "^6.7.2",
25
- "@fortawesome/free-solid-svg-icons": "^6.7.2",
26
- "@fortawesome/react-fontawesome": "^0.2.2",
27
- "bootstrap": "^5.3.3",
28
- "dce-reactkit": "^4.3.4",
29
- "react": "^19.2.1"
23
+ "dce-commonkit": "^5.0.0"
30
24
  },
31
25
  "peerDependencies": {
32
26
  "caccl": "^x.x.x",
@@ -5,12 +5,12 @@
5
5
  * @param [adminsOnly] true if the endpoint is for admins only
6
6
  * @returns the endpoint path
7
7
  */
8
- const generateEndpointPath = (collectionName: string, adminsOnly?: boolean) => {
8
+ const generateEndpointPath = (collectionName: string, adminsOnly: boolean = true) => {
9
9
  // Determine prefix based on whether the endpoint is for admins only
10
10
  const userPath = adminsOnly ? 'admin' : 'ttm';
11
11
 
12
12
  // Return the endpoint path
13
- return `/api/${userPath}/dce-reactkit/dbeditor/${collectionName}`;
13
+ return `/api/${userPath}/dce-commonkit/dbeditor/${collectionName}`;
14
14
  };
15
15
 
16
16
  export default generateEndpointPath;
@@ -1,10 +1,10 @@
1
1
  // Import express
2
2
  import express from 'express';
3
3
 
4
- // Import dce-reactkit
4
+ // Import dce-commonkit
5
5
  import {
6
6
  ParamType,
7
- } from 'dce-reactkit';
7
+ } from 'dce-commonkit';
8
8
 
9
9
  // Import shared helpers
10
10
  import genRouteHandler from '../genRouteHandler';
@@ -1,8 +1,8 @@
1
- // Import dce-reactkit
1
+ // Import dce-commonkit
2
2
  import {
3
3
  ErrorWithCode,
4
4
  MINUTE_IN_MS,
5
- } from 'dce-reactkit';
5
+ } from 'dce-commonkit';
6
6
 
7
7
  // Import oauth
8
8
  import oauth from 'oauth-signature';
@@ -1,4 +1,4 @@
1
- // Import dce-reactkit
1
+ // Import dce-commonkit
2
2
  import {
3
3
  getTimeInfoInET,
4
4
  LogFunction,
@@ -11,9 +11,9 @@ import {
11
11
  LogAction,
12
12
  LogLevel,
13
13
  ParamType,
14
- ReactKitErrorCode,
14
+ CommonKitErrorCode,
15
15
  LogSource,
16
- } from 'dce-reactkit';
16
+ } from 'dce-commonkit';
17
17
 
18
18
  // Import caccl
19
19
  import { getLaunchInfo } from 'caccl/server';
@@ -382,7 +382,7 @@ const genRouteHandler = (
382
382
  res,
383
383
  {
384
384
  message: 'Your session has expired. Please refresh the page and try again.',
385
- code: ReactKitErrorCode.SessionExpired,
385
+ code: CommonKitErrorCode.SessionExpired,
386
386
  status: 401,
387
387
  },
388
388
  );
@@ -437,7 +437,7 @@ const genRouteHandler = (
437
437
  res,
438
438
  {
439
439
  message: 'Your session was invalid. Please refresh the page and try again.',
440
- code: ReactKitErrorCode.SessionExpired,
440
+ code: CommonKitErrorCode.SessionExpired,
441
441
  status: 401,
442
442
  },
443
443
  );
@@ -686,7 +686,7 @@ const genRouteHandler = (
686
686
  ? {
687
687
  type: LogType.Error,
688
688
  errorMessage: (logOpts as any).error.message ?? 'Unknown message',
689
- errorCode: (logOpts as any).error.code ?? ReactKitErrorCode.NoCode,
689
+ errorCode: (logOpts as any).error.code ?? CommonKitErrorCode.NoCode,
690
690
  errorStack: (logOpts as any).error.stack ?? 'No stack',
691
691
  }
692
692
  : {
@@ -730,10 +730,10 @@ const genRouteHandler = (
730
730
  } else if (log.type === LogType.Error) {
731
731
  // Print to console
732
732
  // eslint-disable-next-line no-console
733
- console.error('dce-reactkit error log:', log);
733
+ console.error('dce error log:', log);
734
734
  } else {
735
735
  // eslint-disable-next-line no-console
736
- console.log('dce-reactkit action log:', log);
736
+ console.log('dce action log:', log);
737
737
  }
738
738
 
739
739
  // Return log entry
@@ -840,7 +840,7 @@ const genRouteHandler = (
840
840
  * @param [renderOpts.title=An Error Occurred] title of the error box
841
841
  * @param [renderOpts.description=An unknown server error occurred. Please contact support.]
842
842
  * a human-readable description of the error
843
- * @param [renderOpts.code=ReactKitErrorCode.NoCode] error code to show
843
+ * @param [renderOpts.code=CommonKitErrorCode.NoCode] error code to show
844
844
  * @param [renderOpts.pageTitle=renderOpts.title] title of the page/tab if it differs from
845
845
  * the title of the error
846
846
  * @param [renderOpts.status=500] http status code
@@ -1,13 +1,13 @@
1
1
  // Import dce-mango
2
2
  import { Collection } from 'dce-mango';
3
3
 
4
- // Import dce-reactkit
4
+ // Import dce-commonkit
5
5
  import {
6
6
  DAY_IN_MS,
7
7
  Log,
8
8
  LogReviewerFilterState,
9
9
  LogType
10
- } from 'dce-reactkit';
10
+ } from 'dce-commonkit';
11
11
 
12
12
  // Import shared types
13
13
  import LOG_REVIEW_PAGE_SIZE from '../constants/LOG_REVIEW_PAGE_SIZE';
@@ -1,6 +1,5 @@
1
1
  // Import shared types
2
- import { ReactKitErrorCode } from 'dce-reactkit';
3
- import ExpressKitErrorCode from '../types/ExpressKitErrorCode';
2
+ import { CommonKitErrorCode } from 'dce-commonkit';
4
3
 
5
4
  /**
6
5
  * Handle an error and respond to the client
@@ -42,7 +41,7 @@ const handleError = (
42
41
  }
43
42
 
44
43
  // Get the error code
45
- const code = (error.code || ReactKitErrorCode.NoCode);
44
+ const code = (error.code || CommonKitErrorCode.NoCode);
46
45
 
47
46
  // Get the status code
48
47
  const status = (error.status || 500);
@@ -1,8 +1,8 @@
1
1
  // Import dce-mango
2
2
  import { Collection as MangoCollection } from 'dce-mango';
3
3
 
4
- // Import dce-reactkit
5
- import { Log } from 'dce-reactkit';
4
+ // Import dce-commonkit
5
+ import { Log } from 'dce-commonkit';
6
6
 
7
7
  // Import shared types
8
8
  import CrossServerCredential from '../types/CrossServerCredential';
@@ -1,7 +1,7 @@
1
1
  // Import express
2
2
  import express from 'express';
3
3
 
4
- // Import dce-reactkit
4
+ // Import dce-commonkit
5
5
  import {
6
6
  ParamType,
7
7
  LogFunction,
@@ -10,7 +10,7 @@ import {
10
10
  LOG_REVIEW_GET_LOGS_ROUTE,
11
11
  SELECT_ADMIN_CHECK_ROUTE,
12
12
  ErrorWithCode,
13
- } from 'dce-reactkit';
13
+ } from 'dce-commonkit';
14
14
 
15
15
  // Import shared helpers
16
16
  import genRouteHandler from './genRouteHandler';
@@ -30,7 +30,7 @@ import {
30
30
  /*------------------------------------------------------------------------*/
31
31
 
32
32
  /**
33
- * Prepare dce-reactkit to run on the server
33
+ * Prepare dce-commonkit to run on the server
34
34
  * @author Gabe Abrams
35
35
  * @param opts object containing all arguments
36
36
  * @param opts.app express app from inside of the postprocessor function that