@vergelijkdirect/insurance-transmission-client 1.3.38 → 1.3.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vergelijkdirect/insurance-transmission-client",
3
- "version": "1.3.38",
3
+ "version": "1.3.39",
4
4
  "description": "",
5
5
  "main": "./src/js/index.js",
6
6
  "scripts": {
@@ -0,0 +1,7 @@
1
+ import BaseResource from "./base.resource";
2
+ import { EnvironmentInterface } from "../interfaces";
3
+ declare class GoogleResource extends BaseResource {
4
+ protected getBaseUrl(env: EnvironmentInterface): string;
5
+ getReviews(): Promise<any>;
6
+ }
7
+ export default GoogleResource;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ var base_resource_1 = require("./base.resource");
19
+ var GoogleResource = /** @class */ (function (_super) {
20
+ __extends(GoogleResource, _super);
21
+ function GoogleResource() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ GoogleResource.prototype.getBaseUrl = function (env) {
25
+ return "".concat(env.api.baseUrl, "/v1");
26
+ };
27
+ GoogleResource.prototype.getReviews = function () {
28
+ return this.http({
29
+ method: 'get',
30
+ url: "/google/reviews",
31
+ });
32
+ };
33
+ return GoogleResource;
34
+ }(base_resource_1.default));
35
+ exports.default = GoogleResource;
@@ -18,3 +18,4 @@ export { default as ComparisonModuleResource } from "./comparison-module.resourc
18
18
  export { default as DocumentResource } from "./document.resource";
19
19
  export { default as ComparisonResource } from "./comparison.resource";
20
20
  export { default as DataValidationResource } from "./data-validation.resource";
21
+ export { default as GoogleResource } from "./google.resource";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataValidationResource = exports.ComparisonResource = exports.DocumentResource = exports.ComparisonModuleResource = exports.PartnerResource = exports.LegalAssistanceResource = exports.LiabilityResource = exports.HousingResource = exports.HouseholdResource = exports.PackageResource = exports.BikeResource = exports.CaravanResource = exports.CarResource = exports.BusinessCarResource = exports.MotorResource = exports.MopedResource = exports.HomeResource = exports.DataResource = exports.LoanResource = exports.PetResource = void 0;
3
+ exports.GoogleResource = exports.DataValidationResource = exports.ComparisonResource = exports.DocumentResource = exports.ComparisonModuleResource = exports.PartnerResource = exports.LegalAssistanceResource = exports.LiabilityResource = exports.HousingResource = exports.HouseholdResource = exports.PackageResource = exports.BikeResource = exports.CaravanResource = exports.CarResource = exports.BusinessCarResource = exports.MotorResource = exports.MopedResource = exports.HomeResource = exports.DataResource = exports.LoanResource = exports.PetResource = void 0;
4
4
  var pet_resource_1 = require("./pet.resource");
5
5
  Object.defineProperty(exports, "PetResource", { enumerable: true, get: function () { return pet_resource_1.default; } });
6
6
  var loan_resource_1 = require("./loan.resource");
@@ -41,3 +41,5 @@ var comparison_resource_1 = require("./comparison.resource");
41
41
  Object.defineProperty(exports, "ComparisonResource", { enumerable: true, get: function () { return comparison_resource_1.default; } });
42
42
  var data_validation_resource_1 = require("./data-validation.resource");
43
43
  Object.defineProperty(exports, "DataValidationResource", { enumerable: true, get: function () { return data_validation_resource_1.default; } });
44
+ var google_resource_1 = require("./google.resource");
45
+ Object.defineProperty(exports, "GoogleResource", { enumerable: true, get: function () { return google_resource_1.default; } });
@@ -0,0 +1,6 @@
1
+ declare class GoogleService {
2
+ private client;
3
+ constructor();
4
+ getReviews(): Promise<any>;
5
+ }
6
+ export default GoogleService;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var google_resource_1 = require("../resources/google.resource");
4
+ var GoogleService = /** @class */ (function () {
5
+ function GoogleService() {
6
+ this.client = new google_resource_1.default();
7
+ }
8
+ GoogleService.prototype.getReviews = function () {
9
+ return this.client.getReviews();
10
+ };
11
+ return GoogleService;
12
+ }());
13
+ exports.default = GoogleService;
@@ -23,3 +23,4 @@ export { default as BusinessCarService } from "./car-business.service";
23
23
  export { default as CarService } from "./car.service";
24
24
  export { default as TravelService } from "./travel.service";
25
25
  export { default as UserService } from "./user.service";
26
+ export { default as GoogleService } from "./google.service";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserService = exports.TravelService = exports.CarService = exports.BusinessCarService = exports.DataValidationService = exports.ComparisonService = exports.DocumentService = exports.PackageService = exports.ConfigurationsService = exports.ComparisonModuleService = exports.PartnerService = exports.LegalAssistanceService = exports.LiabilityService = exports.HousingService = exports.V1Service = exports.HouseholdService = exports.BikeService = exports.CaravanService = exports.MotorService = exports.MopedService = exports.HomeService = exports.LoanService = exports.PetService = exports.RateService = exports.DataService = void 0;
3
+ exports.GoogleService = exports.UserService = exports.TravelService = exports.CarService = exports.BusinessCarService = exports.DataValidationService = exports.ComparisonService = exports.DocumentService = exports.PackageService = exports.ConfigurationsService = exports.ComparisonModuleService = exports.PartnerService = exports.LegalAssistanceService = exports.LiabilityService = exports.HousingService = exports.V1Service = exports.HouseholdService = exports.BikeService = exports.CaravanService = exports.MotorService = exports.MopedService = exports.HomeService = exports.LoanService = exports.PetService = exports.RateService = exports.DataService = void 0;
4
4
  var data_service_1 = require("./data.service");
5
5
  Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return data_service_1.default; } });
6
6
  var rate_service_1 = require("./rate.service");
@@ -51,3 +51,5 @@ var travel_service_1 = require("./travel.service");
51
51
  Object.defineProperty(exports, "TravelService", { enumerable: true, get: function () { return travel_service_1.default; } });
52
52
  var user_service_1 = require("./user.service");
53
53
  Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return user_service_1.default; } });
54
+ var google_service_1 = require("./google.service");
55
+ Object.defineProperty(exports, "GoogleService", { enumerable: true, get: function () { return google_service_1.default; } });
@@ -1,27 +0,0 @@
1
- import { EnvironmentInterface, RateInterface, StorageInterface } from "../interfaces";
2
- declare class ShoppingCardClient {
3
- private products;
4
- private packageService;
5
- private totalPrice;
6
- private totalDiscount;
7
- private subTotal;
8
- private totalCosts;
9
- private storageManager;
10
- onCalculating: boolean;
11
- constructor(storageManager: StorageInterface, env: EnvironmentInterface);
12
- configure(config: EnvironmentInterface): this;
13
- addProduct(rate: RateInterface): this;
14
- setProducts(products: any): this;
15
- getTotalCosts(): number;
16
- getTotalPrice(): number;
17
- getTotalDiscount(): number;
18
- getSubTotal(): number;
19
- getProducts(): any;
20
- setCalculations(calculations: any): this;
21
- initFromStore(): void;
22
- resetCard(): void;
23
- productsCount(): any;
24
- private commit;
25
- private calculatePackage;
26
- }
27
- export default ShoppingCardClient;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var core_1 = require("../core");
4
- var package_service_1 = require("../services/package.service");
5
- var ShoppingCardClient = /** @class */ (function () {
6
- function ShoppingCardClient(storageManager, env) {
7
- this.products = [];
8
- this.totalPrice = 0;
9
- this.totalDiscount = 0;
10
- this.subTotal = 0;
11
- this.totalCosts = 0;
12
- this.onCalculating = false;
13
- this.storageManager = storageManager;
14
- this.configure(env);
15
- this.packageService = new package_service_1.default();
16
- }
17
- ShoppingCardClient.prototype.configure = function (config) {
18
- var injector = core_1.Injector.instance;
19
- injector.constant('environment', config);
20
- return this;
21
- };
22
- ShoppingCardClient.prototype.addProduct = function (rate) {
23
- var rateData = rate.getData();
24
- this.products.push(rateData);
25
- this.calculatePackage();
26
- return this;
27
- };
28
- ShoppingCardClient.prototype.setProducts = function (products) {
29
- this.products = products;
30
- this.calculatePackage();
31
- return this;
32
- };
33
- ShoppingCardClient.prototype.getTotalCosts = function () {
34
- return this.totalCosts;
35
- };
36
- ShoppingCardClient.prototype.getTotalPrice = function () {
37
- return this.totalPrice;
38
- };
39
- ShoppingCardClient.prototype.getTotalDiscount = function () {
40
- return this.totalDiscount;
41
- };
42
- ShoppingCardClient.prototype.getSubTotal = function () {
43
- return this.subTotal;
44
- };
45
- ShoppingCardClient.prototype.getProducts = function () {
46
- return this.products;
47
- };
48
- ShoppingCardClient.prototype.setCalculations = function (calculations) {
49
- this.subTotal = calculations.NettoPremium;
50
- this.totalPrice = calculations.Premium;
51
- this.totalDiscount = calculations.PackageDiscount;
52
- this.totalCosts = calculations.TotalCosts;
53
- this.commit();
54
- return this;
55
- };
56
- ShoppingCardClient.prototype.initFromStore = function () {
57
- this.products = this.storageManager.get('products');
58
- this.totalPrice = this.storageManager.get('totalPrice');
59
- this.totalDiscount = this.storageManager.get('totalDiscount');
60
- this.subTotal = this.storageManager.get('subTotal');
61
- this.totalCosts = this.storageManager.get('totalCosts');
62
- };
63
- ShoppingCardClient.prototype.resetCard = function () {
64
- this.products = [];
65
- this.totalPrice = 0;
66
- this.totalDiscount = 0;
67
- this.subTotal = 0;
68
- this.commit();
69
- };
70
- ShoppingCardClient.prototype.productsCount = function () {
71
- return this.products.length;
72
- };
73
- ShoppingCardClient.prototype.commit = function () {
74
- this.storageManager.put('products', this.products);
75
- this.storageManager.put('totalPrice', this.totalPrice);
76
- this.storageManager.put('totalDiscount', this.totalDiscount);
77
- this.storageManager.put('subTotal', this.subTotal);
78
- this.storageManager.put('totalCosts', this.totalCosts);
79
- return this;
80
- };
81
- ShoppingCardClient.prototype.calculatePackage = function () {
82
- var _this = this;
83
- this.onCalculating = true;
84
- this.packageService.calculatePackage(this.getProducts())
85
- .then(function (calculations) {
86
- _this.setCalculations(calculations);
87
- _this.onCalculating = false;
88
- })
89
- .catch(function (error) {
90
- console.error(error);
91
- _this.onCalculating = false;
92
- });
93
- };
94
- return ShoppingCardClient;
95
- }());
96
- exports.default = ShoppingCardClient;
@@ -1,8 +0,0 @@
1
- interface AbstractRateInterface {
2
- Price: number;
3
- CompanyName: string;
4
- CompanyLogoUrl: string;
5
- Identifier: string;
6
- Coverage: any;
7
- }
8
- export default AbstractRateInterface;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export default function (insuranceCategory: string): any;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function default_1(insuranceCategory) {
4
- var map = {
5
- 'moped': 'brommer',
6
- 'pet': 'dieren',
7
- 'motor': 'motor',
8
- 'home': 'woon',
9
- 'household': 'woon',
10
- 'liability': 'woon',
11
- 'legal-assistance': 'rechtsbijstand',
12
- 'caravan': 'caravan',
13
- 'bike': 'fiets',
14
- 'car': 'car',
15
- };
16
- return map[insuranceCategory];
17
- }
18
- exports.default = default_1;