@studyportals/domain-client 7.1.1-beta.0 → 7.1.1-beta.1

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 (152) hide show
  1. package/index.js +34 -81
  2. package/package.json +1 -1
  3. package/protobuf/Area.js +1 -4
  4. package/protobuf/Article.js +30 -33
  5. package/protobuf/Body.js +1 -4
  6. package/protobuf/CampaignInformation.js +1 -4
  7. package/protobuf/ClickTracking.js +1 -4
  8. package/protobuf/CommercialEntity.js +1 -4
  9. package/protobuf/Cover.js +1 -4
  10. package/protobuf/Deadline.js +1 -4
  11. package/protobuf/Degree.js +1 -4
  12. package/protobuf/Description.js +13 -16
  13. package/protobuf/Discipline.js +10 -13
  14. package/protobuf/Duration.js +1 -4
  15. package/protobuf/EnglishRequirement.js +1 -4
  16. package/protobuf/EssentialInformation.js +1 -4
  17. package/protobuf/File.js +3 -6
  18. package/protobuf/GPARequirement.js +1 -4
  19. package/protobuf/InternalLink.js +3 -6
  20. package/protobuf/Link.js +1 -4
  21. package/protobuf/LivingCost.js +1 -4
  22. package/protobuf/Location.js +8 -11
  23. package/protobuf/Logo.js +1 -4
  24. package/protobuf/MiniProgrammeCard.js +10 -13
  25. package/protobuf/OptionalLink.js +1 -4
  26. package/protobuf/Organisation.js +86 -89
  27. package/protobuf/OrganisationInformation.js +1 -4
  28. package/protobuf/OrganisationRanking.js +7 -10
  29. package/protobuf/Person.js +4 -7
  30. package/protobuf/ProgrammeCard.js +43 -46
  31. package/protobuf/ProgrammeGrid.js +9 -12
  32. package/protobuf/Ranking.js +6 -9
  33. package/protobuf/RankingInstitute.js +4 -7
  34. package/protobuf/Review.js +4 -7
  35. package/protobuf/ReviewRating.js +1 -4
  36. package/protobuf/RichText.js +1 -4
  37. package/protobuf/SocialLink.js +1 -4
  38. package/protobuf/StartDate.js +4 -7
  39. package/protobuf/Timing.js +7 -10
  40. package/protobuf/Topic.js +1 -4
  41. package/protobuf/TrackedLink.js +4 -7
  42. package/protobuf/Tracking.js +4 -7
  43. package/protobuf/TuitionFee.js +1 -4
  44. package/protobuf/Unibuddy.js +1 -4
  45. package/protobuf/index.js +42 -58
  46. package/src/clients/article-detail-page-client.js +4 -8
  47. package/src/clients/index.js +4 -20
  48. package/src/clients/organisation-page-client.js +4 -8
  49. package/src/clients/protobuf-client.js +3 -7
  50. package/src/clients/public-mini-programme-card-client.js +4 -8
  51. package/src/domain-client.js +9 -13
  52. package/src/exceptions/bad-request-exception.js +1 -5
  53. package/src/exceptions/client-exception.js +1 -5
  54. package/src/exceptions/internal-server-exception.js +1 -5
  55. package/src/exceptions/not-found-exception.js +1 -5
  56. package/src/exceptions/property-not-available-exception.js +1 -5
  57. package/src/factories/DateFactory.js +1 -5
  58. package/src/factories/InternalLinkFactory.js +1 -5
  59. package/src/i-api-response.js +1 -2
  60. package/src/i-class-factory.js +1 -2
  61. package/src/i-model-description.js +1 -4
  62. package/src/model-client.js +8 -12
  63. package/src/model-factory.js +10 -14
  64. package/src/models/bestfit-programme/bestfit-programme-client.js +2 -6
  65. package/src/models/bestfit-programme/i-best-fit-programme.js +1 -2
  66. package/src/models/bestfit-programme/i-city.js +1 -2
  67. package/src/models/bestfit-programme/i-living-cost.js +1 -2
  68. package/src/models/city-search-document/city-search-document-client.js +2 -6
  69. package/src/models/city-search-document/i-city-search-document.js +1 -2
  70. package/src/models/common/i-city.js +1 -2
  71. package/src/models/common/i-country.js +1 -2
  72. package/src/models/common/i-english-requirements.js +1 -2
  73. package/src/models/common/i-g-p-a-requirement.js +1 -2
  74. package/src/models/common/i-internal-link.js +1 -2
  75. package/src/models/common/i-logo.js +1 -2
  76. package/src/models/common/i-review-rating.js +1 -2
  77. package/src/models/common/i-tuition-fee.js +1 -2
  78. package/src/models/copilot-country/copilot-country-client.js +2 -6
  79. package/src/models/copilot-country/i-copilot-country.js +1 -2
  80. package/src/models/copilot-country/i-copilot-ranking-card.js +1 -2
  81. package/src/models/copilot-programme/copilot-programme-client.js +2 -6
  82. package/src/models/copilot-programme/i-copilot-programme.js +1 -2
  83. package/src/models/customerio-organisation/customerio-organisation-client.js +2 -6
  84. package/src/models/customerio-organisation/i-customer-io-organisation.js +1 -2
  85. package/src/models/customerio-organisation/i-review.js +1 -2
  86. package/src/models/customerio-programme/customerio-programme-client.js +2 -6
  87. package/src/models/customerio-programme/i-customer-io-programme.js +1 -2
  88. package/src/models/customerio-programme/i-internal-link.js +1 -2
  89. package/src/models/faq-static-content/i-faq-static-content.js +1 -2
  90. package/src/models/faq-static-content/i-faq.js +1 -2
  91. package/src/models/faq-static-content/i-static-content-url.js +1 -2
  92. package/src/models/faq-static-content/i-static-content.js +1 -2
  93. package/src/models/faq-static-content/public-faq-static-content-client.js +2 -6
  94. package/src/models/organisation-card/i-organisation-card.js +1 -2
  95. package/src/models/organisation-card/i-ranking-discipline.js +1 -2
  96. package/src/models/organisation-card/organisation-card-client.js +2 -6
  97. package/src/models/organisation-for-search/i-organisation-for-search.js +1 -2
  98. package/src/models/organisation-for-search/public-organisation-for-search-client.js +2 -6
  99. package/src/models/organisation-search-document/i-organisation-search-document.js +1 -2
  100. package/src/models/organisation-search-document/organisation-search-document-client.js +2 -6
  101. package/src/models/programme-card/i-click-tracking-data.js +1 -2
  102. package/src/models/programme-card/i-cover.js +1 -2
  103. package/src/models/programme-card/i-deadline.js +1 -2
  104. package/src/models/programme-card/i-duration.js +1 -2
  105. package/src/models/programme-card/i-internal-link.js +1 -2
  106. package/src/models/programme-card/i-link.js +1 -2
  107. package/src/models/programme-card/i-location.js +1 -2
  108. package/src/models/programme-card/i-logo.js +1 -2
  109. package/src/models/programme-card/i-optional-link.js +1 -2
  110. package/src/models/programme-card/i-programme-card.js +1 -2
  111. package/src/models/programme-card/i-start-date.js +1 -2
  112. package/src/models/programme-card/i-timing.js +1 -2
  113. package/src/models/programme-card/i-tracked-link.js +1 -2
  114. package/src/models/programme-card/i-tracking.js +1 -2
  115. package/src/models/programme-card/i-tuition-fee.js +1 -2
  116. package/src/models/programme-card/programme-card-client.js +2 -6
  117. package/src/models/ranking-cards/i-ranking.js +1 -2
  118. package/src/models/scholarship-card/i-scholarship-card-v2.js +1 -2
  119. package/src/models/scholarship-card/i-scholarship-card.js +1 -2
  120. package/src/models/scholarship-card/public-scholarship-card-client.js +2 -6
  121. package/src/models/scholarship-card/scholarship-card-v2-client.js +2 -6
  122. package/src/models/scholarship-search-document/i-scholarship-search-document.js +1 -2
  123. package/src/models/scholarship-search-document/scholarship-search-document-client.js +2 -6
  124. package/src/models/search-discipline/i-search-discipline.js +1 -2
  125. package/src/models/search-discipline/public-search-discipline-client.js +2 -6
  126. package/src/models/search-projection/i-geo-targeting-configuration.js +1 -2
  127. package/src/models/search-projection/i-geo-targeting-values.js +1 -2
  128. package/src/models/search-projection/i-organisation-values.js +1 -2
  129. package/src/models/search-projection/i-premium-values.js +1 -2
  130. package/src/models/search-projection/i-search-projection.js +1 -2
  131. package/src/models/search-projection/i-tuition-values.js +1 -2
  132. package/src/models/search-projection/search-projection-client.js +2 -6
  133. package/src/models/sitemap-articles-info/i-sitemap-article-info.js +1 -2
  134. package/src/models/sitemap-articles-info/sitemap-articles-info-client.js +2 -6
  135. package/src/models/sitemap-cities-info/i-sitemap-city-info.js +1 -2
  136. package/src/models/sitemap-cities-info/sitemap-cities-info-client.js +2 -6
  137. package/src/models/sitemap-countries-info/i-sitemap-country-info.js +1 -2
  138. package/src/models/sitemap-countries-info/sitemap-countries-info-client.js +2 -6
  139. package/src/models/sitemap-country-degree-info/i-degree-info.js +1 -2
  140. package/src/models/sitemap-country-degree-info/i-sitemap-country-degree-info.js +1 -2
  141. package/src/models/sitemap-country-degree-info/sitemap-country-degree-info-client.js +2 -6
  142. package/src/models/sitemap-disciplines-info/i-sitemap-discipline-info.js +1 -2
  143. package/src/models/sitemap-disciplines-info/sitemap-disciplines-info-client.js +2 -6
  144. package/src/models/sitemap-organisations-info/i-sitemap-organisation-info.js +1 -2
  145. package/src/models/sitemap-organisations-info/sitemap-organisations-info-client.js +2 -6
  146. package/src/models/sitemap-programme-info/i-sitemap-programme-info.js +1 -2
  147. package/src/models/sitemap-programme-info/sitemap-programme-info-client.js +2 -6
  148. package/src/models/sitemap-rankings-info/i-sitemap-rankings-info.js +1 -2
  149. package/src/models/sitemap-rankings-info/sitemap-rankings-info-client.js +2 -6
  150. package/src/types/portal-map.js +1 -2
  151. package/src/types/portal-type.js +2 -5
  152. package/src/types.js +1 -2
package/protobuf/index.js CHANGED
@@ -1,61 +1,45 @@
1
- "use strict";
2
1
  /**
3
2
  * @file Automatically generated by barrelsby.
4
3
  */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./Area.js"), exports);
21
- __exportStar(require("./Article.js"), exports);
22
- __exportStar(require("./Body.js"), exports);
23
- __exportStar(require("./CampaignInformation.js"), exports);
24
- __exportStar(require("./ClickTracking.js"), exports);
25
- __exportStar(require("./CommercialEntity.js"), exports);
26
- __exportStar(require("./Cover.js"), exports);
27
- __exportStar(require("./Deadline.js"), exports);
28
- __exportStar(require("./Degree.js"), exports);
29
- __exportStar(require("./Description.js"), exports);
30
- __exportStar(require("./Discipline.js"), exports);
31
- __exportStar(require("./Duration.js"), exports);
32
- __exportStar(require("./EnglishRequirement.js"), exports);
33
- __exportStar(require("./EssentialInformation.js"), exports);
34
- __exportStar(require("./File.js"), exports);
35
- __exportStar(require("./GPARequirement.js"), exports);
36
- __exportStar(require("./InternalLink.js"), exports);
37
- __exportStar(require("./Link.js"), exports);
38
- __exportStar(require("./LivingCost.js"), exports);
39
- __exportStar(require("./Location.js"), exports);
40
- __exportStar(require("./Logo.js"), exports);
41
- __exportStar(require("./MiniProgrammeCard.js"), exports);
42
- __exportStar(require("./OptionalLink.js"), exports);
43
- __exportStar(require("./Organisation.js"), exports);
44
- __exportStar(require("./OrganisationInformation.js"), exports);
45
- __exportStar(require("./OrganisationRanking.js"), exports);
46
- __exportStar(require("./Person.js"), exports);
47
- __exportStar(require("./ProgrammeCard.js"), exports);
48
- __exportStar(require("./ProgrammeGrid.js"), exports);
49
- __exportStar(require("./Ranking.js"), exports);
50
- __exportStar(require("./RankingInstitute.js"), exports);
51
- __exportStar(require("./Review.js"), exports);
52
- __exportStar(require("./ReviewRating.js"), exports);
53
- __exportStar(require("./RichText.js"), exports);
54
- __exportStar(require("./SocialLink.js"), exports);
55
- __exportStar(require("./StartDate.js"), exports);
56
- __exportStar(require("./Timing.js"), exports);
57
- __exportStar(require("./Topic.js"), exports);
58
- __exportStar(require("./TrackedLink.js"), exports);
59
- __exportStar(require("./Tracking.js"), exports);
60
- __exportStar(require("./TuitionFee.js"), exports);
61
- __exportStar(require("./Unibuddy.js"), exports);
4
+ export * from "./Area.js";
5
+ export * from "./Article.js";
6
+ export * from "./Body.js";
7
+ export * from "./CampaignInformation.js";
8
+ export * from "./ClickTracking.js";
9
+ export * from "./CommercialEntity.js";
10
+ export * from "./Cover.js";
11
+ export * from "./Deadline.js";
12
+ export * from "./Degree.js";
13
+ export * from "./Description.js";
14
+ export * from "./Discipline.js";
15
+ export * from "./Duration.js";
16
+ export * from "./EnglishRequirement.js";
17
+ export * from "./EssentialInformation.js";
18
+ export * from "./File.js";
19
+ export * from "./GPARequirement.js";
20
+ export * from "./InternalLink.js";
21
+ export * from "./Link.js";
22
+ export * from "./LivingCost.js";
23
+ export * from "./Location.js";
24
+ export * from "./Logo.js";
25
+ export * from "./MiniProgrammeCard.js";
26
+ export * from "./OptionalLink.js";
27
+ export * from "./Organisation.js";
28
+ export * from "./OrganisationInformation.js";
29
+ export * from "./OrganisationRanking.js";
30
+ export * from "./Person.js";
31
+ export * from "./ProgrammeCard.js";
32
+ export * from "./ProgrammeGrid.js";
33
+ export * from "./Ranking.js";
34
+ export * from "./RankingInstitute.js";
35
+ export * from "./Review.js";
36
+ export * from "./ReviewRating.js";
37
+ export * from "./RichText.js";
38
+ export * from "./SocialLink.js";
39
+ export * from "./StartDate.js";
40
+ export * from "./Timing.js";
41
+ export * from "./Topic.js";
42
+ export * from "./TrackedLink.js";
43
+ export * from "./Tracking.js";
44
+ export * from "./TuitionFee.js";
45
+ export * from "./Unibuddy.js";
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArticleDetailPageClient = void 0;
4
- const protobuf_1 = require("../../protobuf/index.js");
5
- const protobuf_client_1 = require("./protobuf-client.js");
6
- class ArticleDetailPageClient extends protobuf_client_1.ProtobufClient {
1
+ import { Article } from "../../protobuf/index.js";
2
+ import { ProtobufClient } from "./protobuf-client.js";
3
+ export class ArticleDetailPageClient extends ProtobufClient {
7
4
  constructModel(data) {
8
- return protobuf_1.Article.fromJSON(data);
5
+ return Article.fromJSON(data);
9
6
  }
10
7
  getModelName() {
11
8
  return 'article-detail-page';
@@ -17,4 +14,3 @@ class ArticleDetailPageClient extends protobuf_client_1.ProtobufClient {
17
14
  return false;
18
15
  }
19
16
  }
20
- exports.ArticleDetailPageClient = ArticleDetailPageClient;
@@ -1,23 +1,7 @@
1
- "use strict";
2
1
  /**
3
2
  * @file Automatically generated by barrelsby.
4
3
  */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./article-detail-page-client.js"), exports);
21
- __exportStar(require("./organisation-page-client.js"), exports);
22
- __exportStar(require("./protobuf-client.js"), exports);
23
- __exportStar(require("./public-mini-programme-card-client.js"), exports);
4
+ export * from "./article-detail-page-client.js";
5
+ export * from "./organisation-page-client.js";
6
+ export * from "./protobuf-client.js";
7
+ export * from "./public-mini-programme-card-client.js";
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganisationPageClient = void 0;
4
- const protobuf_1 = require("../../protobuf/index.js");
5
- const protobuf_client_1 = require("./protobuf-client.js");
6
- class OrganisationPageClient extends protobuf_client_1.ProtobufClient {
1
+ import { Organisation } from "../../protobuf/index.js";
2
+ import { ProtobufClient } from "./protobuf-client.js";
3
+ export class OrganisationPageClient extends ProtobufClient {
7
4
  constructModel(data) {
8
- return protobuf_1.Organisation.fromJSON(data);
5
+ return Organisation.fromJSON(data);
9
6
  }
10
7
  getModelName() {
11
8
  return 'organisation-page';
@@ -17,4 +14,3 @@ class OrganisationPageClient extends protobuf_client_1.ProtobufClient {
17
14
  return false;
18
15
  }
19
16
  }
20
- exports.OrganisationPageClient = OrganisationPageClient;
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProtobufClient = void 0;
4
- const domain_client_1 = require("../domain-client.js");
5
- class ProtobufClient {
1
+ import { DomainClient } from "../domain-client.js";
2
+ export class ProtobufClient {
6
3
  static portalMap = new Map();
7
4
  domainClient;
8
5
  constructor(baseUrl, seed, apiKey, portalMap) {
9
6
  if (portalMap) {
10
7
  ProtobufClient.portalMap = portalMap;
11
8
  }
12
- this.domainClient = new domain_client_1.DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
9
+ this.domainClient = new DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
13
10
  }
14
11
  async fetch(id) {
15
12
  const results = await this.domainClient.doRequest([id]);
@@ -27,4 +24,3 @@ class ProtobufClient {
27
24
  return path;
28
25
  }
29
26
  }
30
- exports.ProtobufClient = ProtobufClient;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PublicMiniProgrammeCardClient = void 0;
4
- const protobuf_1 = require("../../protobuf/index.js");
5
- const protobuf_client_1 = require("./protobuf-client.js");
6
- class PublicMiniProgrammeCardClient extends protobuf_client_1.ProtobufClient {
1
+ import { MiniProgrammeCard } from "../../protobuf/index.js";
2
+ import { ProtobufClient } from "./protobuf-client.js";
3
+ export class PublicMiniProgrammeCardClient extends ProtobufClient {
7
4
  constructModel(data) {
8
- return protobuf_1.MiniProgrammeCard.fromJSON(data);
5
+ return MiniProgrammeCard.fromJSON(data);
9
6
  }
10
7
  getModelName() {
11
8
  return 'mini-programme-card';
@@ -17,4 +14,3 @@ class PublicMiniProgrammeCardClient extends protobuf_client_1.ProtobufClient {
17
14
  return true;
18
15
  }
19
16
  }
20
- exports.PublicMiniProgrammeCardClient = PublicMiniProgrammeCardClient;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DomainClient = void 0;
4
- const bad_request_exception_1 = require("./exceptions/bad-request-exception.js");
5
- const internal_server_exception_1 = require("./exceptions/internal-server-exception.js");
6
- const not_found_exception_1 = require("./exceptions/not-found-exception.js");
1
+ import { BadRequestException } from "./exceptions/bad-request-exception.js";
2
+ import { InternalServerException } from "./exceptions/internal-server-exception.js";
3
+ import { NotFoundException } from "./exceptions/not-found-exception.js";
7
4
  const decoder = new TextDecoder();
8
- class DomainClient {
5
+ export class DomainClient {
9
6
  baseUrl;
10
7
  apiKey;
11
8
  model;
@@ -55,10 +52,10 @@ class DomainClient {
55
52
  }
56
53
  catch (error) {
57
54
  console.error('Error fetching data from API:', error);
58
- if (error instanceof internal_server_exception_1.InternalServerException || error instanceof bad_request_exception_1.BadRequestException || error instanceof not_found_exception_1.NotFoundException) {
55
+ if (error instanceof InternalServerException || error instanceof BadRequestException || error instanceof NotFoundException) {
59
56
  throw error;
60
57
  }
61
- throw new internal_server_exception_1.InternalServerException('Unable to fetch data from the API', error);
58
+ throw new InternalServerException('Unable to fetch data from the API', error);
62
59
  }
63
60
  }
64
61
  async decompressModelData(compressedData) {
@@ -71,13 +68,13 @@ class DomainClient {
71
68
  }
72
69
  handleErrors(response) {
73
70
  if (!response.status) {
74
- throw new internal_server_exception_1.InternalServerException(response.message);
71
+ throw new InternalServerException(response.message);
75
72
  }
76
73
  if (response.status === 400) {
77
- throw new bad_request_exception_1.BadRequestException(response.message);
74
+ throw new BadRequestException(response.message);
78
75
  }
79
76
  if (response.status === 404) {
80
- throw new not_found_exception_1.NotFoundException(response.message);
77
+ throw new NotFoundException(response.message);
81
78
  }
82
79
  }
83
80
  buildUrl(ids) {
@@ -92,4 +89,3 @@ class DomainClient {
92
89
  return this.isPublic && this.apiKey === undefined;
93
90
  }
94
91
  }
95
- exports.DomainClient = DomainClient;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BadRequestException = void 0;
4
- class BadRequestException extends Error {
1
+ export class BadRequestException extends Error {
5
2
  }
6
- exports.BadRequestException = BadRequestException;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientException = void 0;
4
- class ClientException extends Error {
1
+ export class ClientException extends Error {
5
2
  }
6
- exports.ClientException = ClientException;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InternalServerException = void 0;
4
- class InternalServerException extends Error {
1
+ export class InternalServerException extends Error {
5
2
  }
6
- exports.InternalServerException = InternalServerException;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotFoundException = void 0;
4
- class NotFoundException extends Error {
1
+ export class NotFoundException extends Error {
5
2
  }
6
- exports.NotFoundException = NotFoundException;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PropertyNotAvailableException = void 0;
4
- class PropertyNotAvailableException extends Error {
1
+ export class PropertyNotAvailableException extends Error {
5
2
  }
6
- exports.PropertyNotAvailableException = PropertyNotAvailableException;
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DateFactory = void 0;
4
- class DateFactory {
1
+ export class DateFactory {
5
2
  create(data, parameters) {
6
3
  return new Date(parameters[0]);
7
4
  }
8
5
  }
9
- exports.DateFactory = DateFactory;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InternalLinkFactory = void 0;
4
- class InternalLinkFactory {
1
+ export class InternalLinkFactory {
5
2
  portalMap;
6
3
  constructor(portalMap) {
7
4
  this.portalMap = portalMap;
@@ -23,4 +20,3 @@ class InternalLinkFactory {
23
20
  return url || '';
24
21
  }
25
22
  }
26
- exports.InternalLinkFactory = InternalLinkFactory;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isModelDescription = isModelDescription;
4
1
  // eslint-disable-next-line
5
- function isModelDescription(arg) {
2
+ export function isModelDescription(arg) {
6
3
  // eslint-disable-next-line
7
4
  return arg && arg.class && (arg.func || arg.parameters);
8
5
  }
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModelClient = void 0;
4
- const domain_client_1 = require("./domain-client.js");
5
- const client_exception_1 = require("./exceptions/client-exception.js");
6
- const model_factory_1 = require("./model-factory.js");
7
- class ModelClient {
1
+ import { DomainClient } from "./domain-client.js";
2
+ import { ClientException } from "./exceptions/client-exception.js";
3
+ import { ModelFactory } from "./model-factory.js";
4
+ export class ModelClient {
8
5
  domainClient;
9
6
  modelFactory;
10
7
  constructor(baseUrl, apiKey, seed, portalMap) {
11
8
  if (!baseUrl || !seed) {
12
9
  return;
13
10
  }
14
- this.modelFactory = new model_factory_1.ModelFactory(portalMap);
15
- this.domainClient = new domain_client_1.DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
11
+ this.modelFactory = new ModelFactory(portalMap);
12
+ this.domainClient = new DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
16
13
  }
17
14
  async fetch(id) {
18
15
  const modelDescriptions = await this.fetchDescription(id);
@@ -20,7 +17,7 @@ class ModelClient {
20
17
  }
21
18
  async fetchDescription(id) {
22
19
  if (!this.domainClient) {
23
- throw new client_exception_1.ClientException("Offline mode active: did you provide all parameters " +
20
+ throw new ClientException("Offline mode active: did you provide all parameters " +
24
21
  "in the constructor?");
25
22
  }
26
23
  const result = await this.domainClient.doRequest([id]);
@@ -32,7 +29,7 @@ class ModelClient {
32
29
  }
33
30
  async fetchMultipleDescriptions(ids) {
34
31
  if (!this.domainClient) {
35
- throw new client_exception_1.ClientException('Offline mode active: did you provide all parameters ' +
32
+ throw new ClientException('Offline mode active: did you provide all parameters ' +
36
33
  'in the constructor?');
37
34
  }
38
35
  return await this.domainClient.doRequest(ids);
@@ -44,4 +41,3 @@ class ModelClient {
44
41
  return this.modelFactory.fromDescriptions(descriptions);
45
42
  }
46
43
  }
47
- exports.ModelClient = ModelClient;
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModelFactory = void 0;
4
- const InternalLinkFactory_1 = require("./factories/InternalLinkFactory.js");
5
- const DateFactory_1 = require("./factories/DateFactory.js");
6
- const i_model_description_1 = require("./i-model-description.js");
7
- const property_not_available_exception_1 = require("./exceptions/property-not-available-exception.js");
8
- class ModelFactory {
1
+ import { InternalLinkFactory } from "./factories/InternalLinkFactory.js";
2
+ import { DateFactory } from "./factories/DateFactory.js";
3
+ import { isModelDescription } from "./i-model-description.js";
4
+ import { PropertyNotAvailableException } from "./exceptions/property-not-available-exception.js";
5
+ export class ModelFactory {
9
6
  customClassFactories;
10
7
  constructor(portalMap = new Map()) {
11
8
  const factories = new Map();
12
- factories.set('IInternalLink', new InternalLinkFactory_1.InternalLinkFactory(portalMap));
13
- factories.set('SerializableDateTime', new DateFactory_1.DateFactory());
9
+ factories.set('IInternalLink', new InternalLinkFactory(portalMap));
10
+ factories.set('SerializableDateTime', new DateFactory());
14
11
  this.customClassFactories = factories;
15
12
  }
16
13
  fromDescription(data) {
@@ -39,7 +36,7 @@ class ModelFactory {
39
36
  const canShowFunction = 'canShow' + propertyName;
40
37
  const value = data.func[functionName];
41
38
  let returnValue;
42
- if ((0, i_model_description_1.isModelDescription)(value)) {
39
+ if (isModelDescription(value)) {
43
40
  returnValue = this.unpackClass(value);
44
41
  }
45
42
  else if (Array.isArray(value)) {
@@ -51,7 +48,7 @@ class ModelFactory {
51
48
  if (canShowFunction in data.func) {
52
49
  return () => {
53
50
  if (data.func[canShowFunction] === false) {
54
- throw new property_not_available_exception_1.PropertyNotAvailableException(`Property '${propertyName}' not available`);
51
+ throw new PropertyNotAvailableException(`Property '${propertyName}' not available`);
55
52
  }
56
53
  return returnValue;
57
54
  };
@@ -62,11 +59,10 @@ class ModelFactory {
62
59
  }
63
60
  unpackArray(list) {
64
61
  return list.map(item => {
65
- if ((0, i_model_description_1.isModelDescription)(item)) {
62
+ if (isModelDescription(item)) {
66
63
  return this.unpackClass(item);
67
64
  }
68
65
  return item;
69
66
  });
70
67
  }
71
68
  }
72
- exports.ModelFactory = ModelFactory;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BestfitProgrammeClient = void 0;
4
- const model_client_1 = require("../../model-client.js");
5
- class BestfitProgrammeClient extends model_client_1.ModelClient {
1
+ import { ModelClient } from "../../model-client.js";
2
+ export class BestfitProgrammeClient extends ModelClient {
6
3
  getModelName() {
7
4
  return 'bestfit-programme';
8
5
  }
@@ -13,4 +10,3 @@ class BestfitProgrammeClient extends model_client_1.ModelClient {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.BestfitProgrammeClient = BestfitProgrammeClient;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CitySearchDocumentClient = void 0;
4
- const model_client_1 = require("../../model-client.js");
5
- class CitySearchDocumentClient extends model_client_1.ModelClient {
1
+ import { ModelClient } from "../../model-client.js";
2
+ export class CitySearchDocumentClient extends ModelClient {
6
3
  getModelName() {
7
4
  return 'city-search-document';
8
5
  }
@@ -13,4 +10,3 @@ class CitySearchDocumentClient extends model_client_1.ModelClient {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.CitySearchDocumentClient = CitySearchDocumentClient;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CopilotCountryClient = void 0;
4
- const model_client_1 = require("../../model-client.js");
5
- class CopilotCountryClient extends model_client_1.ModelClient {
1
+ import { ModelClient } from "../../model-client.js";
2
+ export class CopilotCountryClient extends ModelClient {
6
3
  getModelName() {
7
4
  return 'copilot-country';
8
5
  }
@@ -13,4 +10,3 @@ class CopilotCountryClient extends model_client_1.ModelClient {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.CopilotCountryClient = CopilotCountryClient;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CopilotProgrammeClient = void 0;
4
- const model_client_1 = require("../../model-client.js");
5
- class CopilotProgrammeClient extends model_client_1.ModelClient {
1
+ import { ModelClient } from "../../model-client.js";
2
+ export class CopilotProgrammeClient extends ModelClient {
6
3
  getModelName() {
7
4
  return 'copilot-programme';
8
5
  }
@@ -13,4 +10,3 @@ class CopilotProgrammeClient extends model_client_1.ModelClient {
13
10
  return false;
14
11
  }
15
12
  }
16
- exports.CopilotProgrammeClient = CopilotProgrammeClient;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};