@sipgate/integration-bridge 0.12.3 → 0.12.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.
@@ -2,8 +2,9 @@
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");
5
6
  function errorHandlerMiddleware(error, req, res, next) {
6
- if (error instanceof models_1.ServerError) {
7
+ if (error instanceof models_1.ServerError || error instanceof refresh_error_model_1.RefreshError) {
7
8
  res.status(error.status).send(error.message);
8
9
  return;
9
10
  }
@@ -1 +1 @@
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"}
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"}
@@ -10,6 +10,6 @@ export interface APIPhoneNumber {
10
10
  */
11
11
  phoneNumber: string;
12
12
  }
13
- export declare type APIContact = BaseContact & ContactResult & {
13
+ export type APIContact = BaseContact & ContactResult & {
14
14
  phoneNumbers: APIPhoneNumber[];
15
15
  };
@@ -9,4 +9,4 @@ export interface CacheItemStateCached {
9
9
  export interface CacheItemStateFetching {
10
10
  state: CacheItemStateType.FETCHING;
11
11
  }
12
- export declare type CacheItemState = CacheItemStateCached | CacheItemStateFetching;
12
+ export type CacheItemState = CacheItemStateCached | CacheItemStateFetching;
@@ -3,7 +3,7 @@ export declare enum CallParticipantType {
3
3
  LOCAL = "local",
4
4
  REMOTE = "remote"
5
5
  }
6
- export declare type CallParticipant = {
6
+ export type CallParticipant = {
7
7
  type: CallParticipantType;
8
8
  phoneNumber: string;
9
9
  };
@@ -1,6 +1,6 @@
1
1
  import { CacheItemState } from "./cache-item-state.model";
2
2
  import { Contact } from "./contact.model";
3
- declare type FreshValueUpdater = (key: string) => Promise<Contact[]>;
3
+ type FreshValueUpdater = (key: string) => Promise<Contact[]>;
4
4
  export interface ContactCache {
5
5
  get: (key: string, getFreshValue?: FreshValueUpdater) => Promise<Contact[] | CacheItemState>;
6
6
  set: (key: string, value: Contact[]) => Promise<void>;
@@ -17,27 +17,27 @@ export declare enum PhoneNumberType {
17
17
  DIRECT_DIAL = "DIRECT_DIAL",
18
18
  STANDARD = "STANDARD"
19
19
  }
20
- export declare type PhoneNumber = {
20
+ export type PhoneNumber = {
21
21
  label: PhoneNumberLabel | string;
22
22
  phoneNumber: string;
23
23
  };
24
- export declare type BaseContact = {
24
+ export type BaseContact = {
25
25
  name: string | null;
26
26
  firstName: string | null;
27
27
  lastName: string | null;
28
28
  email: string | null;
29
29
  organization: string | null;
30
30
  };
31
- export declare type ContactResult = {
31
+ export type ContactResult = {
32
32
  id: string;
33
33
  contactUrl: string | null;
34
34
  avatarUrl: string | null;
35
35
  readonly?: boolean;
36
36
  };
37
- export declare type ContactTemplate = BaseContact & {
37
+ export type ContactTemplate = BaseContact & {
38
38
  phoneNumbers: PhoneNumber[];
39
39
  };
40
- export declare type ContactUpdate = ContactTemplate & {
40
+ export type ContactUpdate = ContactTemplate & {
41
41
  id: string;
42
42
  };
43
- export declare type Contact = ContactTemplate & ContactResult;
43
+ export type Contact = ContactTemplate & ContactResult;
@@ -1,5 +1,5 @@
1
1
  import { Router } from "express";
2
- export declare type CustomRouter = {
2
+ export type CustomRouter = {
3
3
  path: string;
4
4
  router: Router;
5
5
  };
@@ -9,5 +9,6 @@ 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";
12
13
  export * from "./server-error.model";
13
14
  export * from "./user.model";
@@ -25,6 +25,7 @@ __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);
28
29
  __exportStar(require("./server-error.model"), exports);
29
30
  __exportStar(require("./user.model"), exports);
30
31
  //# 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,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,wDAAsC;AACtC,uDAAqC;AACrC,+CAA6B"}
@@ -0,0 +1,4 @@
1
+ export declare class RefreshError extends Error {
2
+ status: number;
3
+ constructor();
4
+ }
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sipgate/integration-bridge",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "sipgate Integration Bridge Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,12 +66,12 @@
66
66
  "@types/redis": "4.0.10",
67
67
  "husky": "8.0.2",
68
68
  "jest": "28.1.3",
69
- "lint-staged": "13.0.3",
69
+ "lint-staged": "13.0.4",
70
70
  "node-mocks-http": "1.12.1",
71
- "prettier": "2.7.1",
71
+ "prettier": "2.8.0",
72
72
  "rimraf": "3.0.2",
73
73
  "ts-jest": "28.0.8",
74
- "typescript": "4.8.4"
74
+ "typescript": "4.9.3"
75
75
  },
76
76
  "dependencies": {
77
77
  "ajv": "^8.11.0",