@vergelijkdirect/insurance-transmission-client 1.3.21

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.
Files changed (246) hide show
  1. package/README.md +79 -0
  2. package/package.json +33 -0
  3. package/src/js/adapters/index.d.ts +1 -0
  4. package/src/js/adapters/index.js +5 -0
  5. package/src/js/adapters/local-storage.adapter.d.ts +15 -0
  6. package/src/js/adapters/local-storage.adapter.js +56 -0
  7. package/src/js/clients/index.d.ts +1 -0
  8. package/src/js/clients/index.js +5 -0
  9. package/src/js/clients/insurance-transmission.client.d.ts +14 -0
  10. package/src/js/clients/insurance-transmission.client.js +88 -0
  11. package/src/js/core/http.client.d.ts +32 -0
  12. package/src/js/core/http.client.js +146 -0
  13. package/src/js/core/index.d.ts +2 -0
  14. package/src/js/core/index.js +7 -0
  15. package/src/js/core/injector.d.ts +17 -0
  16. package/src/js/core/injector.js +67 -0
  17. package/src/js/factories/api-service.factory.d.ts +4 -0
  18. package/src/js/factories/api-service.factory.js +50 -0
  19. package/src/js/factories/comparison.factory.d.ts +32 -0
  20. package/src/js/factories/comparison.factory.js +23 -0
  21. package/src/js/factories/index.d.ts +3 -0
  22. package/src/js/factories/index.js +9 -0
  23. package/src/js/factories/rate.factory.d.ts +6 -0
  24. package/src/js/factories/rate.factory.js +92 -0
  25. package/src/js/handlers/error.handler.d.ts +7 -0
  26. package/src/js/handlers/error.handler.js +12 -0
  27. package/src/js/handlers/index.d.ts +3 -0
  28. package/src/js/handlers/index.js +9 -0
  29. package/src/js/handlers/rate-handler.d.ts +10 -0
  30. package/src/js/handlers/rate-handler.js +70 -0
  31. package/src/js/handlers/response.handler.d.ts +7 -0
  32. package/src/js/handlers/response.handler.js +12 -0
  33. package/src/js/index.d.ts +5 -0
  34. package/src/js/index.js +21 -0
  35. package/src/js/interfaces/additional-coverage.interface.d.ts +8 -0
  36. package/src/js/interfaces/additional-coverage.interface.js +2 -0
  37. package/src/js/interfaces/calculate-rates.interface.d.ts +5 -0
  38. package/src/js/interfaces/calculate-rates.interface.js +2 -0
  39. package/src/js/interfaces/comparison/comparison-data-collection.interface.d.ts +16 -0
  40. package/src/js/interfaces/comparison/comparison-data-collection.interface.js +2 -0
  41. package/src/js/interfaces/comparison/comparison-insurance-data.interface.d.ts +8 -0
  42. package/src/js/interfaces/comparison/comparison-insurance-data.interface.js +2 -0
  43. package/src/js/interfaces/comparison/comparison-insurance.interface.d.ts +11 -0
  44. package/src/js/interfaces/comparison/comparison-insurance.interface.js +2 -0
  45. package/src/js/interfaces/comparison/comparison.interface.d.ts +8 -0
  46. package/src/js/interfaces/comparison/comparison.interface.js +2 -0
  47. package/src/js/interfaces/comparison/index.d.ts +4 -0
  48. package/src/js/interfaces/comparison/index.js +2 -0
  49. package/src/js/interfaces/environment.interface.d.ts +7 -0
  50. package/src/js/interfaces/environment.interface.js +2 -0
  51. package/src/js/interfaces/index.d.ts +10 -0
  52. package/src/js/interfaces/index.js +19 -0
  53. package/src/js/interfaces/moped-rate.interface.d.ts +38 -0
  54. package/src/js/interfaces/moped-rate.interface.js +2 -0
  55. package/src/js/interfaces/nextable.interface.d.ts +4 -0
  56. package/src/js/interfaces/nextable.interface.js +2 -0
  57. package/src/js/interfaces/rate.interface.d.ts +12 -0
  58. package/src/js/interfaces/rate.interface.js +2 -0
  59. package/src/js/interfaces/requests/additional-coverages-request.interface.d.ts +5 -0
  60. package/src/js/interfaces/requests/additional-coverages-request.interface.js +2 -0
  61. package/src/js/interfaces/requests/index.d.ts +2 -0
  62. package/src/js/interfaces/requests/index.js +2 -0
  63. package/src/js/interfaces/requests/moped-rate-request.interface.d.ts +21 -0
  64. package/src/js/interfaces/requests/moped-rate-request.interface.js +2 -0
  65. package/src/js/interfaces/storage.interface.d.ts +8 -0
  66. package/src/js/interfaces/storage.interface.js +2 -0
  67. package/src/js/interfaces/user.interface.d.ts +23 -0
  68. package/src/js/interfaces/user.interface.js +2 -0
  69. package/src/js/interfaces/utils/index.d.ts +2 -0
  70. package/src/js/interfaces/utils/index.js +2 -0
  71. package/src/js/interfaces/utils/timestampable.interface.d.ts +5 -0
  72. package/src/js/interfaces/utils/timestampable.interface.js +2 -0
  73. package/src/js/interfaces/utils/to-object.interface.d.ts +4 -0
  74. package/src/js/interfaces/utils/to-object.interface.js +2 -0
  75. package/src/js/maps/index.d.ts +2 -0
  76. package/src/js/maps/index.js +7 -0
  77. package/src/js/maps/insurance-key.config.d.ts +2 -0
  78. package/src/js/maps/insurance-key.config.js +13 -0
  79. package/src/js/maps/risk-insurance.map.d.ts +1 -0
  80. package/src/js/maps/risk-insurance.map.js +24 -0
  81. package/src/js/models/comparison/comparison-data-collection.model.d.ts +23 -0
  82. package/src/js/models/comparison/comparison-data-collection.model.js +149 -0
  83. package/src/js/models/comparison/comparison-insurance-data.model.d.ts +15 -0
  84. package/src/js/models/comparison/comparison-insurance-data.model.js +85 -0
  85. package/src/js/models/comparison/comparison-insurance.model.d.ts +17 -0
  86. package/src/js/models/comparison/comparison-insurance.model.js +43 -0
  87. package/src/js/models/comparison/comparison.model.d.ts +20 -0
  88. package/src/js/models/comparison/comparison.model.js +47 -0
  89. package/src/js/models/comparison/index.d.ts +4 -0
  90. package/src/js/models/comparison/index.js +11 -0
  91. package/src/js/models/configuration/configuration.model.d.ts +18 -0
  92. package/src/js/models/configuration/configuration.model.js +52 -0
  93. package/src/js/models/configuration/default-configuration.model.d.ts +5 -0
  94. package/src/js/models/configuration/default-configuration.model.js +34 -0
  95. package/src/js/models/configuration/index.d.ts +2 -0
  96. package/src/js/models/configuration/index.js +7 -0
  97. package/src/js/models/dkm-rate.model.d.ts +4 -0
  98. package/src/js/models/dkm-rate.model.js +26 -0
  99. package/src/js/models/documents.model.d.ts +9 -0
  100. package/src/js/models/documents.model.js +16 -0
  101. package/src/js/models/enra-model.d.ts +7 -0
  102. package/src/js/models/enra-model.js +30 -0
  103. package/src/js/models/index.d.ts +15 -0
  104. package/src/js/models/index.js +45 -0
  105. package/src/js/models/laka-rate.model.d.ts +7 -0
  106. package/src/js/models/laka-rate.model.js +29 -0
  107. package/src/js/models/moneyview-rate.model.d.ts +7 -0
  108. package/src/js/models/moneyview-rate.model.js +30 -0
  109. package/src/js/models/package-rate.model.d.ts +11 -0
  110. package/src/js/models/package-rate.model.js +109 -0
  111. package/src/js/models/pet/index.d.ts +1 -0
  112. package/src/js/models/pet/index.js +5 -0
  113. package/src/js/models/pet/petsecur-rate.model.d.ts +6 -0
  114. package/src/js/models/pet/petsecur-rate.model.js +29 -0
  115. package/src/js/models/rate-collection.model.d.ts +16 -0
  116. package/src/js/models/rate-collection.model.js +91 -0
  117. package/src/js/models/rate.model.d.ts +21 -0
  118. package/src/js/models/rate.model.js +108 -0
  119. package/src/js/models/risk-rate.model.d.ts +6 -0
  120. package/src/js/models/risk-rate.model.js +30 -0
  121. package/src/js/models/rolls-rate.model.d.ts +6 -0
  122. package/src/js/models/rolls-rate.model.js +30 -0
  123. package/src/js/models/undefined-rate.model.d.ts +7 -0
  124. package/src/js/models/undefined-rate.model.js +29 -0
  125. package/src/js/models/user.model.d.ts +36 -0
  126. package/src/js/models/user.model.js +115 -0
  127. package/src/js/models/vergelijkdirect-rate.model.d.ts +6 -0
  128. package/src/js/models/vergelijkdirect-rate.model.js +30 -0
  129. package/src/js/resources/base.resource.d.ts +9 -0
  130. package/src/js/resources/base.resource.js +12 -0
  131. package/src/js/resources/bike.resource.d.ts +8 -0
  132. package/src/js/resources/bike.resource.js +47 -0
  133. package/src/js/resources/car.resource.d.ts +12 -0
  134. package/src/js/resources/car.resource.js +70 -0
  135. package/src/js/resources/caravan.resource.d.ts +12 -0
  136. package/src/js/resources/caravan.resource.js +64 -0
  137. package/src/js/resources/categories.resource.d.ts +13 -0
  138. package/src/js/resources/categories.resource.js +123 -0
  139. package/src/js/resources/comparison-module.resource.d.ts +8 -0
  140. package/src/js/resources/comparison-module.resource.js +41 -0
  141. package/src/js/resources/comparison.resource.d.ts +9 -0
  142. package/src/js/resources/comparison.resource.js +48 -0
  143. package/src/js/resources/data-validation.resource.d.ts +9 -0
  144. package/src/js/resources/data-validation.resource.js +59 -0
  145. package/src/js/resources/data.resource.d.ts +10 -0
  146. package/src/js/resources/data.resource.js +80 -0
  147. package/src/js/resources/document.resource.d.ts +7 -0
  148. package/src/js/resources/document.resource.js +36 -0
  149. package/src/js/resources/home.resource.d.ts +10 -0
  150. package/src/js/resources/home.resource.js +57 -0
  151. package/src/js/resources/household.resource.d.ts +8 -0
  152. package/src/js/resources/household.resource.js +43 -0
  153. package/src/js/resources/housing.resource.d.ts +8 -0
  154. package/src/js/resources/housing.resource.js +44 -0
  155. package/src/js/resources/index.d.ts +19 -0
  156. package/src/js/resources/index.js +41 -0
  157. package/src/js/resources/legal-assistance.resource.d.ts +10 -0
  158. package/src/js/resources/legal-assistance.resource.js +57 -0
  159. package/src/js/resources/liability.resource.d.ts +6 -0
  160. package/src/js/resources/liability.resource.js +35 -0
  161. package/src/js/resources/loan.resource.d.ts +7 -0
  162. package/src/js/resources/loan.resource.js +35 -0
  163. package/src/js/resources/moped.resource.d.ts +13 -0
  164. package/src/js/resources/moped.resource.js +78 -0
  165. package/src/js/resources/motor.resource.d.ts +12 -0
  166. package/src/js/resources/motor.resource.js +70 -0
  167. package/src/js/resources/package.resource.d.ts +14 -0
  168. package/src/js/resources/package.resource.js +84 -0
  169. package/src/js/resources/partner.resource.d.ts +8 -0
  170. package/src/js/resources/partner.resource.js +42 -0
  171. package/src/js/resources/pet.resource.d.ts +8 -0
  172. package/src/js/resources/pet.resource.js +41 -0
  173. package/src/js/resources/travel.resource.d.ts +9 -0
  174. package/src/js/resources/travel.resource.js +49 -0
  175. package/src/js/resources/user.resource.d.ts +7 -0
  176. package/src/js/resources/user.resource.js +35 -0
  177. package/src/js/resources/v1.resource.d.ts +22 -0
  178. package/src/js/resources/v1.resource.js +119 -0
  179. package/src/js/services/bike.service.d.ts +10 -0
  180. package/src/js/services/bike.service.js +97 -0
  181. package/src/js/services/car.service.d.ts +14 -0
  182. package/src/js/services/car.service.js +108 -0
  183. package/src/js/services/caravan.service.d.ts +15 -0
  184. package/src/js/services/caravan.service.js +130 -0
  185. package/src/js/services/comparison-module.service.d.ts +7 -0
  186. package/src/js/services/comparison-module.service.js +16 -0
  187. package/src/js/services/comparison.service.d.ts +9 -0
  188. package/src/js/services/comparison.service.js +102 -0
  189. package/src/js/services/configurations.service.d.ts +12 -0
  190. package/src/js/services/configurations.service.js +81 -0
  191. package/src/js/services/data-validation.service.d.ts +8 -0
  192. package/src/js/services/data-validation.service.js +20 -0
  193. package/src/js/services/data.service.d.ts +9 -0
  194. package/src/js/services/data.service.js +74 -0
  195. package/src/js/services/document.service.d.ts +8 -0
  196. package/src/js/services/document.service.js +86 -0
  197. package/src/js/services/home.service.d.ts +12 -0
  198. package/src/js/services/home.service.js +90 -0
  199. package/src/js/services/household.service.d.ts +10 -0
  200. package/src/js/services/household.service.js +84 -0
  201. package/src/js/services/housing.service.d.ts +10 -0
  202. package/src/js/services/housing.service.js +97 -0
  203. package/src/js/services/index.d.ts +24 -0
  204. package/src/js/services/index.js +51 -0
  205. package/src/js/services/legal-assistance.service.d.ts +12 -0
  206. package/src/js/services/legal-assistance.service.js +90 -0
  207. package/src/js/services/liability.service.d.ts +9 -0
  208. package/src/js/services/liability.service.js +81 -0
  209. package/src/js/services/loan.service.d.ts +9 -0
  210. package/src/js/services/loan.service.js +80 -0
  211. package/src/js/services/moped.service.d.ts +16 -0
  212. package/src/js/services/moped.service.js +129 -0
  213. package/src/js/services/motor.service.d.ts +16 -0
  214. package/src/js/services/motor.service.js +128 -0
  215. package/src/js/services/package.service.d.ts +15 -0
  216. package/src/js/services/package.service.js +160 -0
  217. package/src/js/services/partner.service.d.ts +7 -0
  218. package/src/js/services/partner.service.js +17 -0
  219. package/src/js/services/pet.service.d.ts +10 -0
  220. package/src/js/services/pet.service.js +84 -0
  221. package/src/js/services/rate.service.d.ts +5 -0
  222. package/src/js/services/rate.service.js +43 -0
  223. package/src/js/services/travel.service.d.ts +11 -0
  224. package/src/js/services/travel.service.js +95 -0
  225. package/src/js/services/user.service.d.ts +6 -0
  226. package/src/js/services/user.service.js +13 -0
  227. package/src/js/services/v1.service.d.ts +19 -0
  228. package/src/js/services/v1.service.js +52 -0
  229. package/src/js/types/common/condition-url.type.d.ts +6 -0
  230. package/src/js/types/common/condition-url.type.js +2 -0
  231. package/src/js/types/common/index.d.ts +2 -0
  232. package/src/js/types/common/index.js +2 -0
  233. package/src/js/types/common/timestamps.type.d.ts +6 -0
  234. package/src/js/types/common/timestamps.type.js +2 -0
  235. package/src/js/types/index.d.ts +1 -0
  236. package/src/js/types/index.js +17 -0
  237. package/src/js/utils/compare-rate-by-coverage.util.d.ts +4 -0
  238. package/src/js/utils/compare-rate-by-coverage.util.js +64 -0
  239. package/src/js/utils/index.d.ts +2 -0
  240. package/src/js/utils/index.js +7 -0
  241. package/src/js/utils/range.util.d.ts +2 -0
  242. package/src/js/utils/range.util.js +5 -0
  243. package/src/js/utils/sorting.util.d.ts +5 -0
  244. package/src/js/utils/sorting.util.js +11 -0
  245. package/src/js/utils/supplierPlacementTracker.util.d.ts +4 -0
  246. package/src/js/utils/supplierPlacementTracker.util.js +18 -0
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var services_1 = require("../services");
40
+ var models_1 = require("../models");
41
+ var Rate = /** @class */ (function () {
42
+ function Rate(insuranceCategory, data) {
43
+ this.data = data;
44
+ this.insuranceCategory = insuranceCategory;
45
+ this.set('Category', insuranceCategory);
46
+ this.documentService = new services_1.DocumentService();
47
+ this.documents = this.fetchDocuments();
48
+ }
49
+ Rate.prototype.getData = function () {
50
+ return Object.assign({}, this.data);
51
+ };
52
+ Rate.prototype.get = function (key, defaultValue) {
53
+ if (defaultValue === void 0) { defaultValue = null; }
54
+ try {
55
+ return key.split('.')
56
+ .reduce(function (o, i) { return o[i]; }, this.getData());
57
+ }
58
+ catch (e) {
59
+ return defaultValue;
60
+ }
61
+ };
62
+ Rate.prototype.set = function (key, value) {
63
+ this.data[key] = value;
64
+ return this;
65
+ };
66
+ Rate.prototype.getPrice = function () {
67
+ return this.get('Price', 0);
68
+ };
69
+ Rate.prototype.getCoverage = function () {
70
+ return this.get('Coverage', 1);
71
+ };
72
+ Rate.prototype.getRates = function () {
73
+ return new models_1.RateCollection();
74
+ };
75
+ Rate.prototype.getCompanyName = function () {
76
+ return this.data['CompanyName'];
77
+ };
78
+ Rate.prototype.getInsuranceCategory = function () {
79
+ return this.insuranceCategory;
80
+ };
81
+ Rate.prototype.fetchDocuments = function () {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var _this = this;
84
+ return __generator(this, function (_a) {
85
+ return [2 /*return*/, (function () { return __awaiter(_this, void 0, void 0, function () {
86
+ return __generator(this, function (_a) {
87
+ return [2 /*return*/, new models_1.DocumentsModel({
88
+ ConditionUrls: this.get('ConditionUrls', []),
89
+ InsuranceCards: this.get('InsuranceCards', [])
90
+ })];
91
+ });
92
+ }); })];
93
+ });
94
+ });
95
+ };
96
+ Rate.prototype.getDocuments = function () {
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ return __generator(this, function (_a) {
99
+ switch (_a.label) {
100
+ case 0: return [4 /*yield*/, this.documents];
101
+ case 1: return [2 /*return*/, (_a.sent())()];
102
+ }
103
+ });
104
+ });
105
+ };
106
+ return Rate;
107
+ }());
108
+ exports.default = Rate;
@@ -0,0 +1,6 @@
1
+ import { RateInterface } from "../interfaces";
2
+ import { Rate } from "./";
3
+ declare class RiskRate extends Rate implements RateInterface {
4
+ getAdditionalCoverages(data: any): Promise<any>;
5
+ }
6
+ export default RiskRate;
@@ -0,0 +1,30 @@
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 _1 = require("./");
19
+ var factories_1 = require("../factories");
20
+ var RiskRate = /** @class */ (function (_super) {
21
+ __extends(RiskRate, _super);
22
+ function RiskRate() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ RiskRate.prototype.getAdditionalCoverages = function (data) {
26
+ return factories_1.ApiServiceFactory.get(this.insuranceCategory).getRiskAdditionalCoverages(data);
27
+ };
28
+ return RiskRate;
29
+ }(_1.Rate));
30
+ exports.default = RiskRate;
@@ -0,0 +1,6 @@
1
+ import { RateInterface } from "../interfaces";
2
+ import { Rate } from "./";
3
+ declare class RollsRate extends Rate implements RateInterface {
4
+ getAdditionalCoverages(data: any): Promise<any>;
5
+ }
6
+ export default RollsRate;
@@ -0,0 +1,30 @@
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 _1 = require("./");
19
+ var factories_1 = require("../factories");
20
+ var RollsRate = /** @class */ (function (_super) {
21
+ __extends(RollsRate, _super);
22
+ function RollsRate() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ RollsRate.prototype.getAdditionalCoverages = function (data) {
26
+ return factories_1.ApiServiceFactory.get(this.insuranceCategory).getRollsAdditionalCoverages(data);
27
+ };
28
+ return RollsRate;
29
+ }(_1.Rate));
30
+ exports.default = RollsRate;
@@ -0,0 +1,7 @@
1
+ import { RateInterface, AdditionalCoverageInterface, AdditionalCoveragesRequestInterface } from "../interfaces";
2
+ import { Rate } from "../models";
3
+ declare class UndefinedRate extends Rate implements RateInterface {
4
+ constructor();
5
+ getAdditionalCoverages(data: AdditionalCoveragesRequestInterface): Promise<AdditionalCoverageInterface[] | []>;
6
+ }
7
+ export default UndefinedRate;
@@ -0,0 +1,29 @@
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 models_1 = require("../models");
19
+ var UndefinedRate = /** @class */ (function (_super) {
20
+ __extends(UndefinedRate, _super);
21
+ function UndefinedRate() {
22
+ return _super.call(this, 'undefined', {}) || this;
23
+ }
24
+ UndefinedRate.prototype.getAdditionalCoverages = function (data) {
25
+ return Promise.resolve([]);
26
+ };
27
+ return UndefinedRate;
28
+ }(models_1.Rate));
29
+ exports.default = UndefinedRate;
@@ -0,0 +1,36 @@
1
+ import { UserInterface } from "../interfaces";
2
+ declare class User implements UserInterface {
3
+ private readonly publicId;
4
+ private email;
5
+ private name;
6
+ private last_name;
7
+ private zip_code;
8
+ private house_number;
9
+ private house_number_addition;
10
+ private birth_date;
11
+ private family_composition;
12
+ private detail;
13
+ constructor(user: any);
14
+ getName(): string | null;
15
+ getLastName(): string | null;
16
+ getPublicId(): number | null;
17
+ getEmail(): string | null;
18
+ getZipCode(): string | null;
19
+ getBirthDate(): string | null;
20
+ getHouseNumber(): number | null;
21
+ getHouseNumberAddition(): string | null;
22
+ getFamilyComposition(): string | null;
23
+ getDetail(key?: string | null): any;
24
+ setDetail(key: string | null | undefined, value: any): this;
25
+ setFamilyComposition(family_composition: string): this;
26
+ setHouseNumberAddition(house_number_addition: string): this;
27
+ setHouseNumber(house_number: number): this;
28
+ setBirthDate(birth_date: string): this;
29
+ setZipCode(zip_code: string): this;
30
+ setEmail(email: string): this;
31
+ setName(name: string): this;
32
+ setLastName(lastName: string): this;
33
+ static fromObject(data: any): User;
34
+ toObject(): any;
35
+ }
36
+ export default User;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var User = /** @class */ (function () {
4
+ function User(user) {
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
6
+ this.publicId = (_a = user.public_id) !== null && _a !== void 0 ? _a : null;
7
+ this.email = (_b = user.email) !== null && _b !== void 0 ? _b : null;
8
+ this.name = (_c = user.name) !== null && _c !== void 0 ? _c : null;
9
+ this.last_name = (_d = user.last_name) !== null && _d !== void 0 ? _d : null;
10
+ this.zip_code = (_e = user.zip_code) !== null && _e !== void 0 ? _e : null;
11
+ this.house_number = (_f = user.house_number) !== null && _f !== void 0 ? _f : null;
12
+ this.house_number_addition = (_g = user.house_number_addition) !== null && _g !== void 0 ? _g : null;
13
+ this.family_composition = (_h = user.family_composition) !== null && _h !== void 0 ? _h : null;
14
+ this.birth_date = (_j = user.birth_date) !== null && _j !== void 0 ? _j : null;
15
+ this.detail = (_k = user.detail) !== null && _k !== void 0 ? _k : null;
16
+ }
17
+ User.prototype.getName = function () {
18
+ return this.name;
19
+ };
20
+ User.prototype.getLastName = function () {
21
+ return this.last_name;
22
+ };
23
+ User.prototype.getPublicId = function () {
24
+ return this.publicId;
25
+ };
26
+ User.prototype.getEmail = function () {
27
+ return this.email;
28
+ };
29
+ User.prototype.getZipCode = function () {
30
+ return this.zip_code;
31
+ };
32
+ User.prototype.getBirthDate = function () {
33
+ return this.birth_date;
34
+ };
35
+ User.prototype.getHouseNumber = function () {
36
+ return this.house_number;
37
+ };
38
+ User.prototype.getHouseNumberAddition = function () {
39
+ return this.house_number_addition;
40
+ };
41
+ User.prototype.getFamilyComposition = function () {
42
+ return this.family_composition;
43
+ };
44
+ User.prototype.getDetail = function (key) {
45
+ if (key === void 0) { key = null; }
46
+ if (key === null) {
47
+ return this.detail;
48
+ }
49
+ if (this.detail.hasOwnProperty(key)) {
50
+ return this.detail[key];
51
+ }
52
+ return null;
53
+ };
54
+ User.prototype.setDetail = function (key, value) {
55
+ if (key === void 0) { key = null; }
56
+ if (key === null) {
57
+ this.detail = value;
58
+ }
59
+ else {
60
+ this.detail[key] = value;
61
+ }
62
+ return this;
63
+ };
64
+ User.prototype.setFamilyComposition = function (family_composition) {
65
+ this.family_composition = family_composition;
66
+ return this;
67
+ };
68
+ User.prototype.setHouseNumberAddition = function (house_number_addition) {
69
+ this.house_number_addition = house_number_addition;
70
+ return this;
71
+ };
72
+ User.prototype.setHouseNumber = function (house_number) {
73
+ this.house_number = house_number;
74
+ return this;
75
+ };
76
+ User.prototype.setBirthDate = function (birth_date) {
77
+ this.birth_date = birth_date;
78
+ return this;
79
+ };
80
+ User.prototype.setZipCode = function (zip_code) {
81
+ this.zip_code = zip_code;
82
+ return this;
83
+ };
84
+ User.prototype.setEmail = function (email) {
85
+ this.email = email;
86
+ return this;
87
+ };
88
+ User.prototype.setName = function (name) {
89
+ this.name = name;
90
+ return this;
91
+ };
92
+ User.prototype.setLastName = function (lastName) {
93
+ this.last_name = lastName;
94
+ return this;
95
+ };
96
+ User.fromObject = function (data) {
97
+ return new this(data);
98
+ };
99
+ User.prototype.toObject = function () {
100
+ return {
101
+ public_id: this.publicId,
102
+ email: this.email,
103
+ name: this.name,
104
+ last_name: this.last_name,
105
+ zip_code: this.zip_code,
106
+ birth_date: this.birth_date,
107
+ house_number: this.house_number,
108
+ house_number_addition: this.house_number_addition,
109
+ family_composition: this.family_composition,
110
+ detail: this.detail,
111
+ };
112
+ };
113
+ return User;
114
+ }());
115
+ exports.default = User;
@@ -0,0 +1,6 @@
1
+ import { RateInterface } from "../interfaces";
2
+ import Rate from "./rate.model";
3
+ declare class VergelijkdirectRate extends Rate implements RateInterface {
4
+ getAdditionalCoverages(data: any): Promise<any>;
5
+ }
6
+ export default VergelijkdirectRate;
@@ -0,0 +1,30 @@
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 rate_model_1 = require("./rate.model");
19
+ var factories_1 = require("../factories");
20
+ var VergelijkdirectRate = /** @class */ (function (_super) {
21
+ __extends(VergelijkdirectRate, _super);
22
+ function VergelijkdirectRate() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ VergelijkdirectRate.prototype.getAdditionalCoverages = function (data) {
26
+ return factories_1.ApiServiceFactory.get(this.insuranceCategory).getVergelijkdirectAdditionalCoverages(data);
27
+ };
28
+ return VergelijkdirectRate;
29
+ }(rate_model_1.default));
30
+ exports.default = VergelijkdirectRate;
@@ -0,0 +1,9 @@
1
+ import { HttpClient } from "../core";
2
+ import { EnvironmentInterface } from "../interfaces";
3
+ import { Invokable } from "invokable";
4
+ declare abstract class BaseResource {
5
+ protected http: HttpClient & HttpClient[typeof Invokable.call];
6
+ constructor();
7
+ protected abstract getBaseUrl(env: EnvironmentInterface): string;
8
+ }
9
+ export default BaseResource;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var core_1 = require("../core");
4
+ var invokable_1 = require("invokable");
5
+ var BaseResource = /** @class */ (function () {
6
+ function BaseResource() {
7
+ var env = core_1.Injector.instance.get('environment');
8
+ this.http = invokable_1.Invokable.create(new core_1.HttpClient(this.getBaseUrl(env)));
9
+ }
10
+ return BaseResource;
11
+ }());
12
+ exports.default = BaseResource;
@@ -0,0 +1,8 @@
1
+ import { NextableInterface } from "../interfaces";
2
+ import CategoryResource from "./categories.resource";
3
+ declare class BikeResource extends CategoryResource {
4
+ protected getCategory(): string;
5
+ protected getAvailableServices(): string[];
6
+ getEnraRates(data: any): Promise<NextableInterface>;
7
+ }
8
+ export default BikeResource;
@@ -0,0 +1,47 @@
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 handlers_1 = require("../handlers");
19
+ var categories_resource_1 = require("./categories.resource");
20
+ var BikeResource = /** @class */ (function (_super) {
21
+ __extends(BikeResource, _super);
22
+ function BikeResource() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ BikeResource.prototype.getCategory = function () {
26
+ return 'bike';
27
+ };
28
+ BikeResource.prototype.getAvailableServices = function () {
29
+ return [
30
+ 'risk',
31
+ 'laka',
32
+ 'enra',
33
+ 'vergelijkdirect'
34
+ ];
35
+ };
36
+ // enra should not be in rates request as we have enra rate in db
37
+ // this api we use on aanvragen to compare some Enra coverages
38
+ BikeResource.prototype.getEnraRates = function (data) {
39
+ return this.http({
40
+ method: 'post',
41
+ url: '/enra/rates',
42
+ data: data
43
+ }).then(function (r) { return new handlers_1.ResponseHandler(r); }).catch(function (e) { return new handlers_1.ErrorHandler(e); });
44
+ };
45
+ return BikeResource;
46
+ }(categories_resource_1.default));
47
+ exports.default = BikeResource;
@@ -0,0 +1,12 @@
1
+ import { AdditionalCoveragesRequestInterface } from "../interfaces";
2
+ import CategoriesResource from "./categories.resource";
3
+ declare class CarResource extends CategoriesResource {
4
+ protected getCategory(): string;
5
+ protected getAvailableServices(): string[];
6
+ findCar(licensePlate: string): Promise<any>;
7
+ checkValidity(data: any): Promise<any>;
8
+ getRiskAdditionalCoverages(data: AdditionalCoveragesRequestInterface): Promise<any>;
9
+ getMoneyviewAdditionalCoverages(data: AdditionalCoveragesRequestInterface): Promise<any>;
10
+ getRollsAdditionalCoverages(data: AdditionalCoveragesRequestInterface): Promise<any>;
11
+ }
12
+ export default CarResource;
@@ -0,0 +1,70 @@
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 categories_resource_1 = require("./categories.resource");
19
+ var CarResource = /** @class */ (function (_super) {
20
+ __extends(CarResource, _super);
21
+ function CarResource() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ CarResource.prototype.getCategory = function () {
25
+ return 'car';
26
+ };
27
+ CarResource.prototype.getAvailableServices = function () {
28
+ return [
29
+ 'risk',
30
+ 'moneyview',
31
+ 'rolls',
32
+ ];
33
+ };
34
+ CarResource.prototype.findCar = function (licensePlate) {
35
+ return this.http({
36
+ method: 'get',
37
+ url: "/find/".concat(licensePlate),
38
+ });
39
+ };
40
+ CarResource.prototype.checkValidity = function (data) {
41
+ return this.http({
42
+ method: 'post',
43
+ url: '/check_validity',
44
+ data: data,
45
+ });
46
+ };
47
+ CarResource.prototype.getRiskAdditionalCoverages = function (data) {
48
+ return this.http({
49
+ method: 'post',
50
+ url: '/risk/additional_coverages',
51
+ data: data,
52
+ });
53
+ };
54
+ CarResource.prototype.getMoneyviewAdditionalCoverages = function (data) {
55
+ return this.http({
56
+ method: 'post',
57
+ url: '/moneyview/additional_coverages',
58
+ data: data,
59
+ });
60
+ };
61
+ CarResource.prototype.getRollsAdditionalCoverages = function (data) {
62
+ return this.http({
63
+ method: 'post',
64
+ url: '/rolls/additional_coverages',
65
+ data: data,
66
+ });
67
+ };
68
+ return CarResource;
69
+ }(categories_resource_1.default));
70
+ exports.default = CarResource;
@@ -0,0 +1,12 @@
1
+ import { NextableInterface } from "../interfaces";
2
+ import CategoryResource from "./categories.resource";
3
+ declare class CaravanResource extends CategoryResource {
4
+ protected getCategory(): string;
5
+ protected getAvailableServices(): string[];
6
+ getCaravanBrands(data: any): Promise<NextableInterface>;
7
+ getCaravanVDBrands(data: any): Promise<NextableInterface>;
8
+ getCaravanModels(data: any): Promise<NextableInterface>;
9
+ getCaravanTypes(data: any): Promise<NextableInterface>;
10
+ getCaravanCatalogPrice(data: any): Promise<NextableInterface>;
11
+ }
12
+ export default CaravanResource;
@@ -0,0 +1,64 @@
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 categories_resource_1 = require("./categories.resource");
19
+ var CaravanResource = /** @class */ (function (_super) {
20
+ __extends(CaravanResource, _super);
21
+ function CaravanResource() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ CaravanResource.prototype.getCategory = function () {
25
+ return 'caravan';
26
+ };
27
+ CaravanResource.prototype.getAvailableServices = function () {
28
+ return [
29
+ 'risk',
30
+ ];
31
+ };
32
+ CaravanResource.prototype.getCaravanBrands = function (data) {
33
+ return this.http({
34
+ method: 'get',
35
+ url: '/brands?' + new URLSearchParams(data),
36
+ });
37
+ };
38
+ CaravanResource.prototype.getCaravanVDBrands = function (data) {
39
+ return this.http({
40
+ method: 'get',
41
+ url: '/vd-brands?' + new URLSearchParams(data),
42
+ });
43
+ };
44
+ CaravanResource.prototype.getCaravanModels = function (data) {
45
+ return this.http({
46
+ method: 'get',
47
+ url: '/models?' + new URLSearchParams(data),
48
+ });
49
+ };
50
+ CaravanResource.prototype.getCaravanTypes = function (data) {
51
+ return this.http({
52
+ method: 'get',
53
+ url: '/types?' + new URLSearchParams(data),
54
+ });
55
+ };
56
+ CaravanResource.prototype.getCaravanCatalogPrice = function (data) {
57
+ return this.http({
58
+ method: 'get',
59
+ url: '/catalog-price?' + new URLSearchParams(data),
60
+ });
61
+ };
62
+ return CaravanResource;
63
+ }(categories_resource_1.default));
64
+ exports.default = CaravanResource;