@churchapps/helpers 1.1.0 → 1.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorHelper.d.ts","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI9E,qBAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,EAAC,MAAM;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAC;IACpG,MAAM,CAAC,kBAAkB,EAAC,CAAC,QAAQ,EAAC,iBAAiB,KAAK,IAAI,CAAC;IAE/D,MAAM,CAAC,IAAI,GAAI,YAAW,MAAM,qBAAqB,EAAE,oBAAmB,CAAC,QAAQ,EAAC,iBAAiB,KAAK,IAAI,UAG7G;IAED,MAAM,CAAC,QAAQ,GAAI,WAAU,MAAM,EAAE,SAAQ,MAAM,EAAE,SAAQ,MAAM,UAmBlE;CAEF"}
1
+ {"version":3,"file":"ErrorHelper.d.ts","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI9E,qBAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,EAAE,MAAM;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACtG,MAAM,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAEjE,MAAM,CAAC,IAAI,GAAI,YAAY,MAAM,qBAAqB,EAAE,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,UAGhH;IAED,MAAM,CAAC,QAAQ,GAAI,WAAW,MAAM,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM,UAqBrE;CAGF"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorHelper = void 0;
4
- const ApiHelper_1 = require("./ApiHelper");
5
4
  class ErrorHelper {
6
5
  static getAppData;
7
6
  static customErrorHandler;
@@ -24,7 +23,8 @@ class ErrorHelper {
24
23
  };
25
24
  if (log.errorType === "401" && log.message.indexOf("/users/login") > -1)
26
25
  return;
27
- ApiHelper_1.ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
26
+ //temporarily disabled error logging
27
+ //ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
28
28
  if (ErrorHelper.customErrorHandler)
29
29
  ErrorHelper.customErrorHandler(log);
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorHelper.js","sourceRoot":"","sources":["../src/ErrorHelper.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAGxC,MAAa,WAAW;IAEtB,MAAM,CAAC,UAAU,CAAmF;IACpG,MAAM,CAAC,kBAAkB,CAAsC;IAE/D,MAAM,CAAC,IAAI,GAAG,CAAC,UAAsC,EAAE,kBAAuD,EAAE,EAAE;QAChH,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;QACpC,WAAW,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACtD,CAAC,CAAA;IAED,MAAM,CAAC,QAAQ,GAAG,CAAC,SAAgB,EAAE,OAAc,EAAE,OAAc,EAAE,EAAE;QACrE,IAAI,IAAI,CAAC,UAAU,EACnB,CAAC;YACC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/B,MAAM,GAAG,GAAqB;gBAC5B,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,SAAS,EAAE,IAAI,IAAI,EAA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AAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,OAAO;gBAChB,OAAO,EAAE,OAAO;aACjB,CAAA;YAED,IAAI,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO;YAChF,oCAAoC;YACpC,6DAA6D;YAC7D,IAAI,WAAW,CAAC,kBAAkB;gBAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,CAAA;;AA/BH,kCAkCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@churchapps/helpers",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Library of helper functions not specific to any one ChurchApps project or framework.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -4,19 +4,20 @@ import { ApiHelper } from "./ApiHelper";
4
4
 
5
5
  export class ErrorHelper {
6
6
 
7
- static getAppData:() => { churchId: string, userId: string, originUrl: string, application: string};
8
- static customErrorHandler:(errorLog:ErrorLogInterface) => void;
7
+ static getAppData: () => { churchId: string, userId: string, originUrl: string, application: string };
8
+ static customErrorHandler: (errorLog: ErrorLogInterface) => void;
9
9
 
10
- static init = (getAppData:() => ErrorAppDataInterface, customErrorHandler:(errorLog:ErrorLogInterface) => void) => {
10
+ static init = (getAppData: () => ErrorAppDataInterface, customErrorHandler: (errorLog: ErrorLogInterface) => void) => {
11
11
  ErrorHelper.getAppData = getAppData;
12
12
  ErrorHelper.customErrorHandler = customErrorHandler;
13
13
  }
14
14
 
15
- static logError = (errorType:string, message:string, details:string) => {
16
- if (this.getAppData)
17
- {
15
+ static logError = (errorType: string, message: string, details: string) => {
16
+
17
+
18
+ if (this.getAppData) {
18
19
  const data = this.getAppData();
19
- const log:ErrorLogInterface = {
20
+ const log: ErrorLogInterface = {
20
21
  application: data.application,
21
22
  errorTime: new Date(),
22
23
  userId: data.userId,
@@ -27,10 +28,12 @@ export class ErrorHelper {
27
28
  details: details
28
29
  }
29
30
 
30
- if (log.errorType==="401" && log.message.indexOf("/users/login")>-1) return;
31
- ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
31
+ if (log.errorType === "401" && log.message.indexOf("/users/login") > -1) return;
32
+ //temporarily disabled error logging
33
+ //ApiHelper.postAnonymous("/errors", [log], "MembershipApi");
32
34
  if (ErrorHelper.customErrorHandler) ErrorHelper.customErrorHandler(log);
33
35
  }
34
36
  }
35
37
 
38
+
36
39
  }