@sipgate/integration-bridge 0.12.3 → 0.12.4
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/middlewares/error-handler.middleware.js +2 -1
- package/dist/middlewares/error-handler.middleware.js.map +1 -1
- package/dist/models/api-contact.model.d.ts +1 -1
- package/dist/models/cache-item-state.model.d.ts +1 -1
- package/dist/models/call-event.model.d.ts +1 -1
- package/dist/models/contact-cache.model.d.ts +1 -1
- package/dist/models/contact.model.d.ts +6 -6
- package/dist/models/custom-router.model.d.ts +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/refresh-error.model.d.ts +4 -0
- package/dist/models/refresh-error.model.js +11 -0
- package/dist/models/refresh-error.model.js.map +1 -0
- package/package.json +2 -2
|
@@ -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;
|
|
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"}
|
|
@@ -9,4 +9,4 @@ export interface CacheItemStateCached {
|
|
|
9
9
|
export interface CacheItemStateFetching {
|
|
10
10
|
state: CacheItemStateType.FETCHING;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type CacheItemState = CacheItemStateCached | CacheItemStateFetching;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CacheItemState } from "./cache-item-state.model";
|
|
2
2
|
import { Contact } from "./contact.model";
|
|
3
|
-
|
|
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
|
|
20
|
+
export type PhoneNumber = {
|
|
21
21
|
label: PhoneNumberLabel | string;
|
|
22
22
|
phoneNumber: string;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
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
|
|
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
|
|
37
|
+
export type ContactTemplate = BaseContact & {
|
|
38
38
|
phoneNumbers: PhoneNumber[];
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type ContactUpdate = ContactTemplate & {
|
|
41
41
|
id: string;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
43
|
+
export type Contact = ContactTemplate & ContactResult;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/models/index.js
CHANGED
|
@@ -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
|
package/dist/models/index.js.map
CHANGED
|
@@ -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,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefreshError = void 0;
|
|
4
|
+
class RefreshError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(`Token Refresh Error${message ? `: ${message}` : ""}`);
|
|
7
|
+
this.status = 407;
|
|
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,YAAY,OAAgB;QAC1B,KAAK,CAAC,sBAAsB,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7D,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
|
+
"version": "0.12.4",
|
|
4
4
|
"description": "sipgate Integration Bridge Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"prettier": "2.7.1",
|
|
72
72
|
"rimraf": "3.0.2",
|
|
73
73
|
"ts-jest": "28.0.8",
|
|
74
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "4.9.3"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"ajv": "^8.11.0",
|