@sipgate/integration-bridge 0.19.11 → 0.19.13

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,4 +1,4 @@
1
- import { IntegrationEntity, IntegrationEntityType } from "./integration-entity.model";
1
+ import { IntegrationEntity, IntegrationEntityType, LabeledIntegrationEntity } from "./integration-entity.model";
2
2
  export declare enum PhoneNumberLabel {
3
3
  WORK = "WORK",
4
4
  MOBILE = "MOBILE",
@@ -35,7 +35,7 @@ export type ContactResult = {
35
35
  contactUrl: string | null;
36
36
  avatarUrl: string | null;
37
37
  readonly?: boolean;
38
- relatesTo?: IntegrationEntity[];
38
+ relatesTo?: IntegrationEntity[] | LabeledIntegrationEntity[];
39
39
  };
40
40
  export type ContactTemplate = BaseContact & {
41
41
  phoneNumbers: PhoneNumber[];
@@ -1 +1 @@
1
- {"version":3,"file":"contact.model.js","sourceRoot":"","sources":["../../src/models/contact.model.ts"],"names":[],"mappings":";;;AAKA,IAAY,gBAcX;AAdD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,mCAAe,CAAA;IACf,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;IACf,6CAAyB,CAAA;AAC3B,CAAC,EAdW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAc3B;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B"}
1
+ {"version":3,"file":"contact.model.js","sourceRoot":"","sources":["../../src/models/contact.model.ts"],"names":[],"mappings":";;;AAMA,IAAY,gBAcX;AAdD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,mCAAe,CAAA;IACf,6CAAyB,CAAA;IACzB,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;IACf,6CAAyB,CAAA;AAC3B,CAAC,EAdW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAc3B;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B"}
@@ -3,6 +3,7 @@ export declare enum IntegrationErrorType {
3
3
  INTEGRATION_REFRESH_ERROR = "integration/refresh-error",
4
4
  INTEGRATION_ERROR_FORBIDDEN = "integration/error/forbidden",
5
5
  INTEGRATION_ERROR_UNAVAILABLE = "integration/error/unavailable",
6
+ INTEGRATION_ERROR_LICENSE_ACCESS_LIMITED = "integration/error/license-access-limited",
6
7
  ENTITY_ERROR_CONFLICT = "entity/error/conflict",
7
8
  ENTITY_NOT_FOUND = "entity/not-found",
8
9
  CONTACT_CREATE_ERROR_CONFLICT = "contact/create-error/conflict",
@@ -8,6 +8,7 @@ var IntegrationErrorType;
8
8
  IntegrationErrorType["INTEGRATION_REFRESH_ERROR"] = "integration/refresh-error";
9
9
  IntegrationErrorType["INTEGRATION_ERROR_FORBIDDEN"] = "integration/error/forbidden";
10
10
  IntegrationErrorType["INTEGRATION_ERROR_UNAVAILABLE"] = "integration/error/unavailable";
11
+ IntegrationErrorType["INTEGRATION_ERROR_LICENSE_ACCESS_LIMITED"] = "integration/error/license-access-limited";
11
12
  IntegrationErrorType["ENTITY_ERROR_CONFLICT"] = "entity/error/conflict";
12
13
  IntegrationErrorType["ENTITY_NOT_FOUND"] = "entity/not-found";
13
14
  IntegrationErrorType["CONTACT_CREATE_ERROR_CONFLICT"] = "contact/create-error/conflict";
@@ -1 +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,2EAAmD,CAAA;IAEnD,0EAA0E;IAC1E,+EAAuD,CAAA;IACvD,mFAA2D,CAAA;IAC3D,uFAA+D,CAAA;IAE/D,uEAA+C,CAAA;IAC/C,6DAAqC,CAAA;IAErC,uFAA+D,CAAA;IAC/D,mGAA2E,CAAA;IAC3E,yFAAiE,CAAA;IACjE,6FAAqE,CAAA;AACvE,CAAC,EAfW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAe/B;AAEY,QAAA,yBAAyB,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"integration-error.model.js","sourceRoot":"","sources":["../../src/models/integration-error.model.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAgBX;AAhBD,WAAY,oBAAoB;IAC9B,2EAAmD,CAAA;IAEnD,0EAA0E;IAC1E,+EAAuD,CAAA;IACvD,mFAA2D,CAAA;IAC3D,uFAA+D,CAAA;IAC/D,6GAAqF,CAAA;IAErF,uEAA+C,CAAA;IAC/C,6DAAqC,CAAA;IAErC,uFAA+D,CAAA;IAC/D,mGAA2E,CAAA;IAC3E,yFAAiE,CAAA;IACjE,6FAAqE,CAAA;AACvE,CAAC,EAhBW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAgB/B;AAEY,QAAA,yBAAyB,GAAG,GAAG,CAAC"}
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PubSubClient = void 0;
13
13
  const pubsub_1 = require("@google-cloud/pubsub");
14
- const server_error_model_1 = require("./server-error.model");
14
+ const timeout_1 = require("../util/timeout");
15
15
  const PUBLISH_TIMEOUT = 10000;
16
16
  class PubSubClient {
17
17
  constructor(topicName) {
@@ -23,13 +23,12 @@ class PubSubClient {
23
23
  if (!this.topicName) {
24
24
  throw new Error("No pubsub topic name provided.");
25
25
  }
26
- const timeout = (ms) => new Promise((_, reject) => setTimeout(() => reject(new server_error_model_1.ServerError(500, "Could not publish message in time, did you forget to run gcloud auth application-default login?")), ms));
27
26
  const json = JSON.stringify(message);
28
27
  const dataBuffer = Buffer.from(json);
29
28
  const topic = this.client.topic(this.topicName);
30
29
  yield Promise.race([
31
30
  topic.publishMessage({ data: dataBuffer }),
32
- timeout(PUBLISH_TIMEOUT),
31
+ (0, timeout_1.timeout)(PUBLISH_TIMEOUT, "Could not publish message in time. Did you forget to authenticate with GCP? (gcloud auth application-default login)"),
33
32
  ]);
34
33
  });
35
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub-client.model.js","sourceRoot":"","sources":["../../src/models/pubsub-client.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8C;AAE9C,6DAAmD;AAEnD,MAAM,eAAe,GAAG,KAAM,CAAC;AAC/B,MAAa,YAAY;IAIvB,YAAY,SAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEK,cAAc,CAAC,OAA8B;;YACjD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;aACnD;YAED,MAAM,OAAO,GAAG,CAAC,EAAU,EAAE,EAAE,CAC7B,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACxB,UAAU,CACR,GAAG,EAAE,CACH,MAAM,CACJ,IAAI,gCAAW,CACb,GAAG,EACH,iGAAiG,CAClG,CACF,EACH,EAAE,CACH,CACF,CAAC;YAEJ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC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,0 +1 @@
1
+ export declare const timeout: (timeMs: number, errorMessage: string) => Promise<unknown>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timeout = void 0;
4
+ const models_1 = require("../models");
5
+ const timeout = (timeMs, errorMessage) => new Promise((_, reject) => setTimeout(() => reject(new models_1.ServerError(500, errorMessage)), timeMs));
6
+ exports.timeout = timeout;
7
+ //# sourceMappingURL=timeout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../src/util/timeout.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AAEjC,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,YAAoB,EAAE,EAAE,CAC9D,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACxB,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,oBAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CACrE,CAAC;AAHS,QAAA,OAAO,WAGhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sipgate/integration-bridge",
3
- "version": "0.19.11",
3
+ "version": "0.19.13",
4
4
  "description": "sipgate Integration Bridge Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",