@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,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 UserResource = /** @class */ (function (_super) {
20
+ __extends(UserResource, _super);
21
+ function UserResource() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ UserResource.prototype.getBaseUrl = function (env) {
25
+ return "".concat(env.api.baseUrl, "/v2/user");
26
+ };
27
+ UserResource.prototype.create = function (data) {
28
+ return this.http({
29
+ method: 'post',
30
+ data: data
31
+ });
32
+ };
33
+ return UserResource;
34
+ }(base_resource_1.default));
35
+ exports.default = UserResource;
@@ -0,0 +1,22 @@
1
+ import CategoryResource from "./categories.resource";
2
+ import { EnvironmentInterface } from "../interfaces";
3
+ declare class V1Resource extends CategoryResource {
4
+ protected getBaseUrl(env: EnvironmentInterface): string;
5
+ protected getAvailableServices(): string[];
6
+ protected getCategory(): string;
7
+ getDog(): Promise<any>;
8
+ getCat(): Promise<any>;
9
+ getDogsRates(data: any): Promise<any>;
10
+ getCatsRates(data: any): Promise<any>;
11
+ getPetFilters(): Promise<any>;
12
+ getHealthPackageInfo(packageId: number, extraPackageId: number, data: any): Promise<any>;
13
+ getHealthRates(data: any): Promise<any>;
14
+ getBikesRates(data: any): Promise<any>;
15
+ getBikesFilters(): Promise<any>;
16
+ getBikesTermins(): Promise<any>;
17
+ getCarCoverages(): Promise<any>;
18
+ getCarsRates(license_plate: string, data: any): Promise<any>;
19
+ getExtraOptions(auto_category_id: number): Promise<any>;
20
+ getVergelijkdirectAdditionalCoverages(data: any): Promise<any>;
21
+ }
22
+ export default V1Resource;
@@ -0,0 +1,119 @@
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 V1Resource = /** @class */ (function (_super) {
20
+ __extends(V1Resource, _super);
21
+ function V1Resource() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ V1Resource.prototype.getBaseUrl = function (env) {
25
+ return "".concat(env.api.baseUrl, "/v1/categories");
26
+ };
27
+ V1Resource.prototype.getAvailableServices = function () {
28
+ return [];
29
+ };
30
+ V1Resource.prototype.getCategory = function () {
31
+ return "";
32
+ };
33
+ V1Resource.prototype.getDog = function () {
34
+ return this.http({
35
+ method: 'get',
36
+ url: "/get/dogs",
37
+ });
38
+ };
39
+ V1Resource.prototype.getCat = function () {
40
+ return this.http({
41
+ method: 'get',
42
+ url: "/get/cats",
43
+ });
44
+ };
45
+ V1Resource.prototype.getDogsRates = function (data) {
46
+ return this.http({
47
+ method: 'get',
48
+ url: '/dogs/rates?' + new URLSearchParams(data),
49
+ });
50
+ };
51
+ V1Resource.prototype.getCatsRates = function (data) {
52
+ return this.http({
53
+ method: 'get',
54
+ url: '/cats/rates?' + new URLSearchParams(data),
55
+ });
56
+ };
57
+ V1Resource.prototype.getPetFilters = function () {
58
+ return this.http({
59
+ method: 'get',
60
+ url: "/pets/filters",
61
+ });
62
+ };
63
+ V1Resource.prototype.getHealthPackageInfo = function (packageId, extraPackageId, data) {
64
+ return this.http({
65
+ method: 'get',
66
+ url: "/health/package/".concat(packageId, "/").concat(extraPackageId, "?") + new URLSearchParams(data),
67
+ });
68
+ };
69
+ V1Resource.prototype.getHealthRates = function (data) {
70
+ return this.http({
71
+ method: 'get',
72
+ url: '/health/rates?' + new URLSearchParams(data),
73
+ });
74
+ };
75
+ V1Resource.prototype.getBikesRates = function (data) {
76
+ return this.http({
77
+ method: 'get',
78
+ url: '/bikes/rates?' + new URLSearchParams(data),
79
+ });
80
+ };
81
+ V1Resource.prototype.getBikesFilters = function () {
82
+ return this.http({
83
+ method: 'get',
84
+ url: '/bikes/filters',
85
+ });
86
+ };
87
+ V1Resource.prototype.getBikesTermins = function () {
88
+ return this.http({
89
+ method: 'get',
90
+ url: '/bikes/termins',
91
+ });
92
+ };
93
+ V1Resource.prototype.getCarCoverages = function () {
94
+ return this.http({
95
+ method: 'get',
96
+ url: '/car/coverages',
97
+ });
98
+ };
99
+ V1Resource.prototype.getCarsRates = function (license_plate, data) {
100
+ return this.http({
101
+ method: 'get',
102
+ url: "/cars/".concat(license_plate, "/rates?") + new URLSearchParams(data),
103
+ });
104
+ };
105
+ V1Resource.prototype.getExtraOptions = function (auto_category_id) {
106
+ return this.http({
107
+ method: 'get',
108
+ url: "/extra/options/".concat(auto_category_id),
109
+ });
110
+ };
111
+ V1Resource.prototype.getVergelijkdirectAdditionalCoverages = function (data) {
112
+ return this.http({
113
+ method: 'post',
114
+ url: '/pet/vergelijkdirect/additional_coverages?' + new URLSearchParams(data),
115
+ });
116
+ };
117
+ return V1Resource;
118
+ }(categories_resource_1.default));
119
+ exports.default = V1Resource;
@@ -0,0 +1,10 @@
1
+ import { RateCollection } from "../models";
2
+ import { CalculateRatesInterface } from "../interfaces";
3
+ import RateService from "./rate.service";
4
+ declare class BikeService extends RateService implements CalculateRatesInterface {
5
+ private client;
6
+ constructor();
7
+ getRates(data: any): Promise<RateCollection>;
8
+ getEnraRates(data: any): Promise<RateCollection>;
9
+ }
10
+ export default BikeService;
@@ -0,0 +1,97 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ var resources_1 = require("../resources");
55
+ var models_1 = require("../models");
56
+ var handlers_1 = require("../handlers");
57
+ var utils_1 = require("../utils");
58
+ var rate_service_1 = require("./rate.service");
59
+ var BikeService = /** @class */ (function (_super) {
60
+ __extends(BikeService, _super);
61
+ function BikeService() {
62
+ var _this = _super.call(this) || this;
63
+ _this.client = new resources_1.BikeResource();
64
+ return _this;
65
+ }
66
+ BikeService.prototype.getRates = function (data) {
67
+ return __awaiter(this, void 0, void 0, function () {
68
+ var services, rates;
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0: return [4 /*yield*/, this.client.getRates(data)];
72
+ case 1:
73
+ services = _a.sent();
74
+ rates = this.handleRates(services);
75
+ return [2 /*return*/, new models_1.RateCollection('bike', rates.sort(utils_1.sortBy.price))];
76
+ }
77
+ });
78
+ });
79
+ };
80
+ BikeService.prototype.getEnraRates = function (data) {
81
+ return __awaiter(this, void 0, void 0, function () {
82
+ var enra, rateHandler, rates;
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
85
+ case 0: return [4 /*yield*/, this.client.getEnraRates(data)];
86
+ case 1:
87
+ enra = _a.sent();
88
+ rateHandler = new handlers_1.RateHandler(enra);
89
+ rates = rateHandler.handle();
90
+ return [2 /*return*/, new models_1.RateCollection('bike', rates.sort(utils_1.sortBy.price))];
91
+ }
92
+ });
93
+ });
94
+ };
95
+ return BikeService;
96
+ }(rate_service_1.default));
97
+ exports.default = BikeService;
@@ -0,0 +1,14 @@
1
+ import { RateCollection } from "../models";
2
+ import { AdditionalCoverageInterface, CalculateRatesInterface } from "../interfaces";
3
+ import { RateService } from "./index";
4
+ declare class CarService extends RateService implements CalculateRatesInterface {
5
+ private client;
6
+ constructor();
7
+ findCar(licensePlate: string): Promise<any>;
8
+ checkValidity(data: any): Promise<any>;
9
+ getRates(data: any): Promise<RateCollection>;
10
+ getRiskAdditionalCoverages(data: any): Promise<AdditionalCoverageInterface[] | []>;
11
+ getRollsAdditionalCoverages(data: any): Promise<AdditionalCoverageInterface[] | []>;
12
+ getMoneyviewAdditionalCoverages(data: any): Promise<AdditionalCoverageInterface[] | []>;
13
+ }
14
+ export default CarService;
@@ -0,0 +1,108 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ var resources_1 = require("../resources");
55
+ var models_1 = require("../models");
56
+ var utils_1 = require("../utils");
57
+ var index_1 = require("./index");
58
+ var CarService = /** @class */ (function (_super) {
59
+ __extends(CarService, _super);
60
+ function CarService() {
61
+ var _this = _super.call(this) || this;
62
+ _this.client = new resources_1.CarResource();
63
+ return _this;
64
+ }
65
+ CarService.prototype.findCar = function (licensePlate) {
66
+ return this.client.findCar(licensePlate);
67
+ };
68
+ CarService.prototype.checkValidity = function (data) {
69
+ return this.client.checkValidity(data);
70
+ };
71
+ CarService.prototype.getRates = function (data) {
72
+ return __awaiter(this, void 0, void 0, function () {
73
+ var services, rates;
74
+ return __generator(this, function (_a) {
75
+ switch (_a.label) {
76
+ case 0: return [4 /*yield*/, this.client.getRates(data)];
77
+ case 1:
78
+ services = _a.sent();
79
+ rates = this.handleRates(services);
80
+ return [2 /*return*/, new models_1.RateCollection('car', rates.sort(utils_1.sortBy.price))];
81
+ }
82
+ });
83
+ });
84
+ };
85
+ CarService.prototype.getRiskAdditionalCoverages = function (data) {
86
+ return __awaiter(this, void 0, void 0, function () {
87
+ return __generator(this, function (_a) {
88
+ return [2 /*return*/, this.client.getRiskAdditionalCoverages(data)];
89
+ });
90
+ });
91
+ };
92
+ CarService.prototype.getRollsAdditionalCoverages = function (data) {
93
+ return __awaiter(this, void 0, void 0, function () {
94
+ return __generator(this, function (_a) {
95
+ return [2 /*return*/, this.client.getRollsAdditionalCoverages(data)];
96
+ });
97
+ });
98
+ };
99
+ CarService.prototype.getMoneyviewAdditionalCoverages = function (data) {
100
+ return __awaiter(this, void 0, void 0, function () {
101
+ return __generator(this, function (_a) {
102
+ return [2 /*return*/, this.client.getMoneyviewAdditionalCoverages(data)];
103
+ });
104
+ });
105
+ };
106
+ return CarService;
107
+ }(index_1.RateService));
108
+ exports.default = CarService;
@@ -0,0 +1,15 @@
1
+ import { RateCollection } from "../models";
2
+ import { CalculateRatesInterface } from "../interfaces";
3
+ import { RateService } from "./index";
4
+ declare class CaravanService extends RateService implements CalculateRatesInterface {
5
+ private client;
6
+ constructor();
7
+ getRates(data: any): Promise<RateCollection>;
8
+ getCoverageRateComparison(data: any): Promise<RateCollection>;
9
+ getCaravanBrands(data: any): Promise<any>;
10
+ getCaravanVDBrands(data: any): Promise<any>;
11
+ getCaravanModels(data: any): Promise<any>;
12
+ getCaravanTypes(data: any): Promise<any>;
13
+ getCaravanCatalogPrice(data: any): Promise<any>;
14
+ }
15
+ export default CaravanService;
@@ -0,0 +1,130 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ var resources_1 = require("../resources");
55
+ var models_1 = require("../models");
56
+ var utils_1 = require("../utils");
57
+ var index_1 = require("./index");
58
+ var CaravanService = /** @class */ (function (_super) {
59
+ __extends(CaravanService, _super);
60
+ function CaravanService() {
61
+ var _this = _super.call(this) || this;
62
+ _this.client = new resources_1.CaravanResource();
63
+ return _this;
64
+ }
65
+ CaravanService.prototype.getRates = function (data) {
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ var services, rates;
68
+ return __generator(this, function (_a) {
69
+ switch (_a.label) {
70
+ case 0: return [4 /*yield*/, this.client.getRates(data)];
71
+ case 1:
72
+ services = _a.sent();
73
+ rates = this.handleRates(services);
74
+ return [2 /*return*/, new models_1.RateCollection('caravan', rates.sort(utils_1.sortBy.price))];
75
+ }
76
+ });
77
+ });
78
+ };
79
+ CaravanService.prototype.getCoverageRateComparison = function (data) {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var services, rates;
82
+ return __generator(this, function (_a) {
83
+ switch (_a.label) {
84
+ case 0: return [4 /*yield*/, this.client.getCoverageRateComparison(data)];
85
+ case 1:
86
+ services = _a.sent();
87
+ rates = this.handleRates(services);
88
+ return [2 /*return*/, new models_1.RateCollection('caravan', (0, utils_1.compareRateByCoverage)(rates))];
89
+ }
90
+ });
91
+ });
92
+ };
93
+ CaravanService.prototype.getCaravanBrands = function (data) {
94
+ return __awaiter(this, void 0, void 0, function () {
95
+ return __generator(this, function (_a) {
96
+ return [2 /*return*/, this.client.getCaravanBrands(data)];
97
+ });
98
+ });
99
+ };
100
+ CaravanService.prototype.getCaravanVDBrands = function (data) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ return __generator(this, function (_a) {
103
+ return [2 /*return*/, this.client.getCaravanVDBrands(data)];
104
+ });
105
+ });
106
+ };
107
+ CaravanService.prototype.getCaravanModels = function (data) {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ return __generator(this, function (_a) {
110
+ return [2 /*return*/, this.client.getCaravanModels(data)];
111
+ });
112
+ });
113
+ };
114
+ CaravanService.prototype.getCaravanTypes = function (data) {
115
+ return __awaiter(this, void 0, void 0, function () {
116
+ return __generator(this, function (_a) {
117
+ return [2 /*return*/, this.client.getCaravanTypes(data)];
118
+ });
119
+ });
120
+ };
121
+ CaravanService.prototype.getCaravanCatalogPrice = function (data) {
122
+ return __awaiter(this, void 0, void 0, function () {
123
+ return __generator(this, function (_a) {
124
+ return [2 /*return*/, this.client.getCaravanCatalogPrice(data)];
125
+ });
126
+ });
127
+ };
128
+ return CaravanService;
129
+ }(index_1.RateService));
130
+ exports.default = CaravanService;
@@ -0,0 +1,7 @@
1
+ declare class ComparisonModuleService {
2
+ private client;
3
+ constructor();
4
+ getInitializationData(): Promise<any>;
5
+ getScriptSource(): Promise<any>;
6
+ }
7
+ export default ComparisonModuleService;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var resources_1 = require("../resources");
4
+ var ComparisonModuleService = /** @class */ (function () {
5
+ function ComparisonModuleService() {
6
+ this.client = new resources_1.ComparisonModuleResource();
7
+ }
8
+ ComparisonModuleService.prototype.getInitializationData = function () {
9
+ return this.client.getInitializationData();
10
+ };
11
+ ComparisonModuleService.prototype.getScriptSource = function () {
12
+ return this.client.getScriptSource();
13
+ };
14
+ return ComparisonModuleService;
15
+ }());
16
+ exports.default = ComparisonModuleService;
@@ -0,0 +1,9 @@
1
+ import { ComparisonInterface, UserInterface } from "../interfaces";
2
+ declare class ComparisonService {
3
+ private client;
4
+ constructor();
5
+ create(funnel: string, user?: UserInterface | null): Promise<ComparisonInterface>;
6
+ update(comparison: ComparisonInterface): Promise<ComparisonInterface>;
7
+ get(id: string): Promise<ComparisonInterface>;
8
+ }
9
+ export default ComparisonService;