@sipgate/integration-bridge 0.12.5 → 0.12.7

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.
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.errorHandlerMiddleware = void 0;
4
4
  const models_1 = require("../models");
5
- const refresh_error_model_1 = require("../models/refresh-error.model");
6
5
  function errorHandlerMiddleware(error, req, res, next) {
7
- if (error instanceof models_1.ServerError || error instanceof refresh_error_model_1.RefreshError) {
6
+ if (error instanceof models_1.ServerError) {
8
7
  res.status(error.status).send(error.message);
9
8
  return;
10
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.middleware.ts"],"names":[],"mappings":";;;AACA,sCAAwC;AACxC,uEAA6D;AAE7D,SAAgB,sBAAsB,CACpC,KAA0B,EAC1B,GAAY,EACZ,GAAa,EACb,IAAkB;IAElB,IAAI,KAAK,YAAY,oBAAW,IAAI,KAAK,YAAY,kCAAY,EAAE;QACjE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO;KACR;IAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAZD,wDAYC"}
1
+ {"version":3,"file":"error-handler.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.middleware.ts"],"names":[],"mappings":";;;AACA,sCAAwC;AAExC,SAAgB,sBAAsB,CACpC,KAA0B,EAC1B,GAAY,EACZ,GAAa,EACb,IAAkB;IAElB,IAAI,KAAK,YAAY,oBAAW,EAAE;QAChC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO;KACR;IAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAZD,wDAYC"}
@@ -9,6 +9,5 @@ export * from "./contact-cache.model";
9
9
  export * from "./contact.model";
10
10
  export * from "./controller.model";
11
11
  export * from "./custom-router.model";
12
- export * from "./refresh-error.model";
13
12
  export * from "./server-error.model";
14
13
  export * from "./user.model";
@@ -25,7 +25,6 @@ __exportStar(require("./contact-cache.model"), exports);
25
25
  __exportStar(require("./contact.model"), exports);
26
26
  __exportStar(require("./controller.model"), exports);
27
27
  __exportStar(require("./custom-router.model"), exports);
28
- __exportStar(require("./refresh-error.model"), exports);
29
28
  __exportStar(require("./server-error.model"), exports);
30
29
  __exportStar(require("./user.model"), exports);
31
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,kEAAgD;AAChD,wDAAsC;AACtC,qDAAmC;AACnC,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,wDAAsC;AACtC,uDAAqC;AACrC,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,kEAAgD;AAChD,wDAAsC;AACtC,qDAAmC;AACnC,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,uDAAqC;AACrC,+CAA6B"}
@@ -0,0 +1,3 @@
1
+ export declare enum IntegrationErrorType {
2
+ INTEGRATION_REFRESH_ERROR = "integration/refresh-error"
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntegrationErrorType = void 0;
4
+ var IntegrationErrorType;
5
+ (function (IntegrationErrorType) {
6
+ IntegrationErrorType["INTEGRATION_REFRESH_ERROR"] = "integration/refresh-error";
7
+ })(IntegrationErrorType = exports.IntegrationErrorType || (exports.IntegrationErrorType = {}));
8
+ //# sourceMappingURL=integration-error.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-error.model.js","sourceRoot":"","sources":["../../src/models/integration-error.model.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC9B,+EAAuD,CAAA;AACzD,CAAC,EAFW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAE/B"}
@@ -8,7 +8,8 @@ const normalizePhoneNumber = (phoneNumber) => phoneNumber.replace(/[^\d\w\+]/g,
8
8
  exports.normalizePhoneNumber = normalizePhoneNumber;
9
9
  const parsePhoneNumber = ({ label, phoneNumber }, locale) => {
10
10
  var _a, _b, _c;
11
- const type = (0, exports.isDirectDial)((0, exports.normalizePhoneNumber)(phoneNumber))
11
+ const isNumberDirectDial = (0, exports.isDirectDial)((0, exports.normalizePhoneNumber)(phoneNumber));
12
+ const type = isNumberDirectDial
12
13
  ? models_1.PhoneNumberType.DIRECT_DIAL
13
14
  : models_1.PhoneNumberType.STANDARD;
14
15
  try {
@@ -19,7 +20,7 @@ const parsePhoneNumber = ({ label, phoneNumber }, locale) => {
19
20
  return {
20
21
  label,
21
22
  type,
22
- e164,
23
+ e164: isNumberDirectDial ? phoneNumber : e164,
23
24
  localized: region === phoneNumberRegion
24
25
  ? (_b = parsedPhoneNumber.getNumber("national")) !== null && _b !== void 0 ? _b : phoneNumber
25
26
  : (_c = parsedPhoneNumber.getNumber("international")) !== null && _c !== void 0 ? _c : phoneNumber,
@@ -1 +1 @@
1
- {"version":3,"file":"phone-number-utils.js","sourceRoot":"","sources":["../../src/util/phone-number-utils.ts"],"names":[],"mappings":";;;A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AAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;YAC7C,SAAS,EACP,MAAM,KAAK,iBAAiB;gBAC1B,CAAC,CAAC,MAAA,iBAAiB,CAAC,SAAS,CAAC,UAAU,CAAC,mCAAI,WAAW;gBACxD,CAAC,CAAC,MAAA,iBAAiB,CAAC,SAAS,CAAC,eAAe,CAAC,mCAAI,WAAW;YACjE,WAAW,EAAE,IAAI;SAClB,CAAC;KACH;IAAC,WAAM;QACN,OAAO;YACL,KAAK;YACL,IAAI;YACJ,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,WAAW;YACtB,WAAW,EAAE,WAAW;SACzB,CAAC;KACH;AACH,CAAC,CAAC;AAhCW,QAAA,gBAAgB,oBAgC3B;AAEK,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAClD,OAAO,WAAW,CAAC,MAAM,GAAG,uBAAuB,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sipgate/integration-bridge",
3
- "version": "0.12.5",
3
+ "version": "0.12.7",
4
4
  "description": "sipgate Integration Bridge Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -62,11 +62,11 @@
62
62
  "@types/express": "4.17.14",
63
63
  "@types/jest": "28.1.8",
64
64
  "@types/lru-cache": "7.10.9",
65
- "@types/node": "18.11.9",
65
+ "@types/node": "18.11.10",
66
66
  "@types/redis": "4.0.10",
67
67
  "husky": "8.0.2",
68
68
  "jest": "28.1.3",
69
- "lint-staged": "13.0.4",
69
+ "lint-staged": "13.1.0",
70
70
  "node-mocks-http": "1.12.1",
71
71
  "prettier": "2.8.0",
72
72
  "rimraf": "3.0.2",
@@ -1,4 +0,0 @@
1
- export declare class RefreshError extends Error {
2
- status: number;
3
- constructor();
4
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RefreshError = void 0;
4
- class RefreshError extends Error {
5
- constructor() {
6
- super(`Invalid integration refresh token`);
7
- this.status = 400;
8
- }
9
- }
10
- exports.RefreshError = RefreshError;
11
- //# sourceMappingURL=refresh-error.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"refresh-error.model.js","sourceRoot":"","sources":["../../src/models/refresh-error.model.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC;QACE,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;CACF;AAPD,oCAOC"}