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