@studyportals/domain-client 7.0.1-beta.3 → 7.0.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -1
- package/index.d.ts +0 -91
- package/protobuf/Area.d.ts +0 -11
- package/protobuf/Area.js +0 -30
- package/protobuf/Article.d.ts +0 -60
- package/protobuf/Article.js +0 -226
- package/protobuf/Body.d.ts +0 -11
- package/protobuf/Body.js +0 -30
- package/protobuf/CampaignInformation.d.ts +0 -11
- package/protobuf/CampaignInformation.js +0 -30
- package/protobuf/ClickTracking.d.ts +0 -11
- package/protobuf/ClickTracking.js +0 -30
- package/protobuf/CommercialEntity.d.ts +0 -14
- package/protobuf/CommercialEntity.js +0 -48
- package/protobuf/Cover.d.ts +0 -10
- package/protobuf/Cover.js +0 -26
- package/protobuf/Deadline.d.ts +0 -11
- package/protobuf/Deadline.js +0 -30
- package/protobuf/Degree.d.ts +0 -16
- package/protobuf/Degree.js +0 -50
- package/protobuf/Description.d.ts +0 -16
- package/protobuf/Description.js +0 -45
- package/protobuf/Discipline.d.ts +0 -26
- package/protobuf/Discipline.js +0 -84
- package/protobuf/Duration.d.ts +0 -11
- package/protobuf/Duration.js +0 -30
- package/protobuf/EnglishRequirement.d.ts +0 -11
- package/protobuf/EnglishRequirement.js +0 -30
- package/protobuf/EssentialInformation.d.ts +0 -17
- package/protobuf/EssentialInformation.js +0 -54
- package/protobuf/File.d.ts +0 -22
- package/protobuf/File.js +0 -74
- package/protobuf/GPARequirement.d.ts +0 -11
- package/protobuf/GPARequirement.js +0 -30
- package/protobuf/InternalLink.d.ts +0 -12
- package/protobuf/InternalLink.js +0 -30
- package/protobuf/Link.d.ts +0 -11
- package/protobuf/Link.js +0 -30
- package/protobuf/LivingCost.d.ts +0 -11
- package/protobuf/LivingCost.js +0 -30
- package/protobuf/Location.d.ts +0 -18
- package/protobuf/Location.js +0 -56
- package/protobuf/Logo.d.ts +0 -10
- package/protobuf/Logo.js +0 -26
- package/protobuf/MiniProgrammeCard.d.ts +0 -18
- package/protobuf/MiniProgrammeCard.js +0 -50
- package/protobuf/OptionalLink.d.ts +0 -12
- package/protobuf/OptionalLink.js +0 -34
- package/protobuf/Organisation.d.ts +0 -211
- package/protobuf/Organisation.js +0 -853
- package/protobuf/OrganisationInformation.d.ts +0 -9
- package/protobuf/OrganisationInformation.js +0 -20
- package/protobuf/OrganisationRanking.d.ts +0 -15
- package/protobuf/OrganisationRanking.js +0 -41
- package/protobuf/Person.d.ts +0 -14
- package/protobuf/Person.js +0 -40
- package/protobuf/ProgrammeCard.d.ts +0 -60
- package/protobuf/ProgrammeCard.js +0 -197
- package/protobuf/ProgrammeGrid.d.ts +0 -14
- package/protobuf/ProgrammeGrid.js +0 -37
- package/protobuf/Ranking.d.ts +0 -22
- package/protobuf/Ranking.js +0 -76
- package/protobuf/RankingInstitute.d.ts +0 -15
- package/protobuf/RankingInstitute.js +0 -44
- package/protobuf/Review.d.ts +0 -17
- package/protobuf/Review.js +0 -52
- package/protobuf/ReviewRating.d.ts +0 -12
- package/protobuf/ReviewRating.js +0 -34
- package/protobuf/RichText.d.ts +0 -10
- package/protobuf/RichText.js +0 -28
- package/protobuf/SocialLink.d.ts +0 -21
- package/protobuf/SocialLink.js +0 -70
- package/protobuf/StartDate.d.ts +0 -13
- package/protobuf/StartDate.js +0 -38
- package/protobuf/Timing.d.ts +0 -17
- package/protobuf/Timing.js +0 -49
- package/protobuf/Topic.d.ts +0 -10
- package/protobuf/Topic.js +0 -26
- package/protobuf/TrackedLink.d.ts +0 -13
- package/protobuf/TrackedLink.js +0 -36
- package/protobuf/Tracking.d.ts +0 -18
- package/protobuf/Tracking.js +0 -58
- package/protobuf/TuitionFee.d.ts +0 -13
- package/protobuf/TuitionFee.js +0 -38
- package/protobuf/Unibuddy.d.ts +0 -10
- package/protobuf/Unibuddy.js +0 -26
- package/protobuf/index.d.ts +0 -45
- package/protobuf/index.js +0 -45
- package/src/clients/article-detail-page-client.d.ts +0 -8
- package/src/clients/article-detail-page-client.js +0 -16
- package/src/clients/index.d.ts +0 -7
- package/src/clients/index.js +0 -7
- package/src/clients/organisation-page-client.d.ts +0 -8
- package/src/clients/organisation-page-client.js +0 -16
- package/src/clients/protobuf-client.d.ts +0 -14
- package/src/clients/protobuf-client.js +0 -26
- package/src/clients/public-mini-programme-card-client.d.ts +0 -8
- package/src/clients/public-mini-programme-card-client.js +0 -16
- package/src/domain-client.d.ts +0 -14
- package/src/domain-client.js +0 -91
- package/src/exceptions/bad-request-exception.d.ts +0 -2
- package/src/exceptions/bad-request-exception.js +0 -2
- package/src/exceptions/client-exception.d.ts +0 -2
- package/src/exceptions/client-exception.js +0 -2
- package/src/exceptions/internal-server-exception.d.ts +0 -2
- package/src/exceptions/internal-server-exception.js +0 -2
- package/src/exceptions/not-found-exception.d.ts +0 -2
- package/src/exceptions/not-found-exception.js +0 -2
- package/src/exceptions/property-not-available-exception.d.ts +0 -2
- package/src/exceptions/property-not-available-exception.js +0 -2
- package/src/factories/DateFactory.d.ts +0 -5
- package/src/factories/DateFactory.js +0 -5
- package/src/factories/InternalLinkFactory.d.ts +0 -9
- package/src/factories/InternalLinkFactory.js +0 -22
- package/src/i-api-response.d.ts +0 -6
- package/src/i-api-response.js +0 -1
- package/src/i-class-factory.d.ts +0 -4
- package/src/i-class-factory.js +0 -1
- package/src/i-model-description.d.ts +0 -7
- package/src/i-model-description.js +0 -5
- package/src/model-client.d.ts +0 -16
- package/src/model-client.js +0 -43
- package/src/model-factory.d.ts +0 -11
- package/src/model-factory.js +0 -68
- package/src/models/bestfit-programme/bestfit-programme-client.d.ts +0 -7
- package/src/models/bestfit-programme/bestfit-programme-client.js +0 -12
- package/src/models/bestfit-programme/i-best-fit-programme.d.ts +0 -82
- package/src/models/bestfit-programme/i-best-fit-programme.js +0 -1
- package/src/models/bestfit-programme/i-city.d.ts +0 -14
- package/src/models/bestfit-programme/i-city.js +0 -1
- package/src/models/bestfit-programme/i-living-cost.d.ts +0 -20
- package/src/models/bestfit-programme/i-living-cost.js +0 -1
- package/src/models/city-search-document/city-search-document-client.d.ts +0 -7
- package/src/models/city-search-document/city-search-document-client.js +0 -12
- package/src/models/city-search-document/i-city-search-document.d.ts +0 -7
- package/src/models/city-search-document/i-city-search-document.js +0 -1
- package/src/models/common/i-city.d.ts +0 -14
- package/src/models/common/i-city.js +0 -1
- package/src/models/common/i-country.d.ts +0 -20
- package/src/models/common/i-country.js +0 -1
- package/src/models/common/i-english-requirements.d.ts +0 -51
- package/src/models/common/i-english-requirements.js +0 -1
- package/src/models/common/i-g-p-a-requirement.d.ts +0 -20
- package/src/models/common/i-g-p-a-requirement.js +0 -1
- package/src/models/common/i-internal-link.d.ts +0 -28
- package/src/models/common/i-internal-link.js +0 -1
- package/src/models/common/i-logo.d.ts +0 -14
- package/src/models/common/i-logo.js +0 -1
- package/src/models/common/i-review-rating.d.ts +0 -26
- package/src/models/common/i-review-rating.js +0 -1
- package/src/models/common/i-tuition-fee.d.ts +0 -50
- package/src/models/common/i-tuition-fee.js +0 -1
- package/src/models/copilot-country/copilot-country-client.d.ts +0 -7
- package/src/models/copilot-country/copilot-country-client.js +0 -12
- package/src/models/copilot-country/i-copilot-country.d.ts +0 -39
- package/src/models/copilot-country/i-copilot-country.js +0 -1
- package/src/models/copilot-country/i-copilot-ranking-card.d.ts +0 -38
- package/src/models/copilot-country/i-copilot-ranking-card.js +0 -1
- package/src/models/copilot-programme/copilot-programme-client.d.ts +0 -7
- package/src/models/copilot-programme/copilot-programme-client.js +0 -12
- package/src/models/copilot-programme/i-copilot-programme.d.ts +0 -125
- package/src/models/copilot-programme/i-copilot-programme.js +0 -1
- package/src/models/customerio-organisation/customerio-organisation-client.d.ts +0 -7
- package/src/models/customerio-organisation/customerio-organisation-client.js +0 -12
- package/src/models/customerio-organisation/i-customer-io-organisation.d.ts +0 -35
- package/src/models/customerio-organisation/i-customer-io-organisation.js +0 -1
- package/src/models/customerio-organisation/i-review.d.ts +0 -7
- package/src/models/customerio-organisation/i-review.js +0 -1
- package/src/models/customerio-programme/customerio-programme-client.d.ts +0 -7
- package/src/models/customerio-programme/customerio-programme-client.js +0 -12
- package/src/models/customerio-programme/i-customer-io-programme.d.ts +0 -107
- package/src/models/customerio-programme/i-customer-io-programme.js +0 -1
- package/src/models/customerio-programme/i-internal-link.d.ts +0 -28
- package/src/models/customerio-programme/i-internal-link.js +0 -1
- package/src/models/faq-static-content/i-faq-static-content.d.ts +0 -10
- package/src/models/faq-static-content/i-faq-static-content.js +0 -1
- package/src/models/faq-static-content/i-faq.d.ts +0 -4
- package/src/models/faq-static-content/i-faq.js +0 -1
- package/src/models/faq-static-content/i-static-content-url.d.ts +0 -4
- package/src/models/faq-static-content/i-static-content-url.js +0 -1
- package/src/models/faq-static-content/i-static-content.d.ts +0 -5
- package/src/models/faq-static-content/i-static-content.js +0 -1
- package/src/models/faq-static-content/public-faq-static-content-client.d.ts +0 -7
- package/src/models/faq-static-content/public-faq-static-content-client.js +0 -12
- package/src/models/organisation-card/i-organisation-card.d.ts +0 -39
- package/src/models/organisation-card/i-organisation-card.js +0 -1
- package/src/models/organisation-card/i-ranking-discipline.d.ts +0 -4
- package/src/models/organisation-card/i-ranking-discipline.js +0 -1
- package/src/models/organisation-card/organisation-card-client.d.ts +0 -7
- package/src/models/organisation-card/organisation-card-client.js +0 -12
- package/src/models/organisation-for-search/i-organisation-for-search.d.ts +0 -32
- package/src/models/organisation-for-search/i-organisation-for-search.js +0 -1
- package/src/models/organisation-for-search/public-organisation-for-search-client.d.ts +0 -7
- package/src/models/organisation-for-search/public-organisation-for-search-client.js +0 -12
- package/src/models/organisation-search-document/i-organisation-search-document.d.ts +0 -158
- package/src/models/organisation-search-document/i-organisation-search-document.js +0 -1
- package/src/models/organisation-search-document/organisation-search-document-client.d.ts +0 -7
- package/src/models/organisation-search-document/organisation-search-document-client.js +0 -12
- package/src/models/programme-card/i-click-tracking-data.d.ts +0 -5
- package/src/models/programme-card/i-click-tracking-data.js +0 -1
- package/src/models/programme-card/i-cover.d.ts +0 -14
- package/src/models/programme-card/i-cover.js +0 -1
- package/src/models/programme-card/i-deadline.d.ts +0 -20
- package/src/models/programme-card/i-deadline.js +0 -1
- package/src/models/programme-card/i-duration.d.ts +0 -40
- package/src/models/programme-card/i-duration.js +0 -1
- package/src/models/programme-card/i-internal-link.d.ts +0 -28
- package/src/models/programme-card/i-internal-link.js +0 -1
- package/src/models/programme-card/i-link.d.ts +0 -22
- package/src/models/programme-card/i-link.js +0 -1
- package/src/models/programme-card/i-location.d.ts +0 -12
- package/src/models/programme-card/i-location.js +0 -1
- package/src/models/programme-card/i-logo.d.ts +0 -14
- package/src/models/programme-card/i-logo.js +0 -1
- package/src/models/programme-card/i-optional-link.d.ts +0 -23
- package/src/models/programme-card/i-optional-link.js +0 -1
- package/src/models/programme-card/i-programme-card.d.ts +0 -212
- package/src/models/programme-card/i-programme-card.js +0 -1
- package/src/models/programme-card/i-start-date.d.ts +0 -33
- package/src/models/programme-card/i-start-date.js +0 -1
- package/src/models/programme-card/i-timing.d.ts +0 -45
- package/src/models/programme-card/i-timing.js +0 -1
- package/src/models/programme-card/i-tracked-link.d.ts +0 -29
- package/src/models/programme-card/i-tracked-link.js +0 -1
- package/src/models/programme-card/i-tracking.d.ts +0 -46
- package/src/models/programme-card/i-tracking.js +0 -1
- package/src/models/programme-card/i-tuition-fee.d.ts +0 -50
- package/src/models/programme-card/i-tuition-fee.js +0 -1
- package/src/models/programme-card/programme-card-client.d.ts +0 -7
- package/src/models/programme-card/programme-card-client.js +0 -12
- package/src/models/ranking-cards/i-ranking.d.ts +0 -18
- package/src/models/ranking-cards/i-ranking.js +0 -1
- package/src/models/scholarship-card/i-scholarship-card-v2.d.ts +0 -20
- package/src/models/scholarship-card/i-scholarship-card-v2.js +0 -1
- package/src/models/scholarship-card/i-scholarship-card.d.ts +0 -15
- package/src/models/scholarship-card/i-scholarship-card.js +0 -1
- package/src/models/scholarship-card/public-scholarship-card-client.d.ts +0 -7
- package/src/models/scholarship-card/public-scholarship-card-client.js +0 -12
- package/src/models/scholarship-card/scholarship-card-v2-client.d.ts +0 -7
- package/src/models/scholarship-card/scholarship-card-v2-client.js +0 -12
- package/src/models/scholarship-search-document/i-scholarship-search-document.d.ts +0 -38
- package/src/models/scholarship-search-document/i-scholarship-search-document.js +0 -1
- package/src/models/scholarship-search-document/scholarship-search-document-client.d.ts +0 -7
- package/src/models/scholarship-search-document/scholarship-search-document-client.js +0 -12
- package/src/models/search-discipline/i-search-discipline.d.ts +0 -26
- package/src/models/search-discipline/i-search-discipline.js +0 -1
- package/src/models/search-discipline/public-search-discipline-client.d.ts +0 -7
- package/src/models/search-discipline/public-search-discipline-client.js +0 -12
- package/src/models/search-projection/i-geo-targeting-configuration.d.ts +0 -38
- package/src/models/search-projection/i-geo-targeting-configuration.js +0 -1
- package/src/models/search-projection/i-geo-targeting-values.d.ts +0 -30
- package/src/models/search-projection/i-geo-targeting-values.js +0 -1
- package/src/models/search-projection/i-organisation-values.d.ts +0 -46
- package/src/models/search-projection/i-organisation-values.js +0 -1
- package/src/models/search-projection/i-premium-values.d.ts +0 -35
- package/src/models/search-projection/i-premium-values.js +0 -1
- package/src/models/search-projection/i-search-projection.d.ts +0 -186
- package/src/models/search-projection/i-search-projection.js +0 -1
- package/src/models/search-projection/i-tuition-values.d.ts +0 -50
- package/src/models/search-projection/i-tuition-values.js +0 -1
- package/src/models/search-projection/search-projection-client.d.ts +0 -7
- package/src/models/search-projection/search-projection-client.js +0 -12
- package/src/models/sitemap-articles-info/i-sitemap-article-info.d.ts +0 -26
- package/src/models/sitemap-articles-info/i-sitemap-article-info.js +0 -1
- package/src/models/sitemap-articles-info/sitemap-articles-info-client.d.ts +0 -7
- package/src/models/sitemap-articles-info/sitemap-articles-info-client.js +0 -12
- package/src/models/sitemap-cities-info/i-sitemap-city-info.d.ts +0 -14
- package/src/models/sitemap-cities-info/i-sitemap-city-info.js +0 -1
- package/src/models/sitemap-cities-info/sitemap-cities-info-client.d.ts +0 -7
- package/src/models/sitemap-cities-info/sitemap-cities-info-client.js +0 -12
- package/src/models/sitemap-countries-info/i-sitemap-country-info.d.ts +0 -14
- package/src/models/sitemap-countries-info/i-sitemap-country-info.js +0 -1
- package/src/models/sitemap-countries-info/sitemap-countries-info-client.d.ts +0 -7
- package/src/models/sitemap-countries-info/sitemap-countries-info-client.js +0 -12
- package/src/models/sitemap-country-degree-info/i-degree-info.d.ts +0 -14
- package/src/models/sitemap-country-degree-info/i-degree-info.js +0 -1
- package/src/models/sitemap-country-degree-info/i-sitemap-country-degree-info.d.ts +0 -11
- package/src/models/sitemap-country-degree-info/i-sitemap-country-degree-info.js +0 -1
- package/src/models/sitemap-country-degree-info/sitemap-country-degree-info-client.d.ts +0 -7
- package/src/models/sitemap-country-degree-info/sitemap-country-degree-info-client.js +0 -12
- package/src/models/sitemap-disciplines-info/i-sitemap-discipline-info.d.ts +0 -14
- package/src/models/sitemap-disciplines-info/i-sitemap-discipline-info.js +0 -1
- package/src/models/sitemap-disciplines-info/sitemap-disciplines-info-client.d.ts +0 -7
- package/src/models/sitemap-disciplines-info/sitemap-disciplines-info-client.js +0 -12
- package/src/models/sitemap-organisations-info/i-sitemap-organisation-info.d.ts +0 -26
- package/src/models/sitemap-organisations-info/i-sitemap-organisation-info.js +0 -1
- package/src/models/sitemap-organisations-info/sitemap-organisations-info-client.d.ts +0 -7
- package/src/models/sitemap-organisations-info/sitemap-organisations-info-client.js +0 -12
- package/src/models/sitemap-programme-info/i-sitemap-programme-info.d.ts +0 -26
- package/src/models/sitemap-programme-info/i-sitemap-programme-info.js +0 -1
- package/src/models/sitemap-programme-info/sitemap-programme-info-client.d.ts +0 -7
- package/src/models/sitemap-programme-info/sitemap-programme-info-client.js +0 -12
- package/src/models/sitemap-rankings-info/i-sitemap-rankings-info.d.ts +0 -14
- package/src/models/sitemap-rankings-info/i-sitemap-rankings-info.js +0 -1
- package/src/models/sitemap-rankings-info/sitemap-rankings-info-client.d.ts +0 -7
- package/src/models/sitemap-rankings-info/sitemap-rankings-info-client.js +0 -12
- package/src/types/portal-map.d.ts +0 -2
- package/src/types/portal-map.js +0 -1
- package/src/types/portal-type.d.ts +0 -7
- package/src/types/portal-type.js +0 -8
- package/src/types.d.ts +0 -4
- package/src/types.js +0 -1
package/protobuf/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Automatically generated by barrelsby.
|
|
3
|
-
*/
|
|
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";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Article } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export declare class ArticleDetailPageClient extends ProtobufClient<Article> {
|
|
4
|
-
protected constructModel(data: Record<string, any>): Article;
|
|
5
|
-
protected getModelName(): string;
|
|
6
|
-
protected getVersion(): string;
|
|
7
|
-
isPublic(): boolean;
|
|
8
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Article } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export class ArticleDetailPageClient extends ProtobufClient {
|
|
4
|
-
constructModel(data) {
|
|
5
|
-
return Article.fromJSON(data);
|
|
6
|
-
}
|
|
7
|
-
getModelName() {
|
|
8
|
-
return 'article-detail-page';
|
|
9
|
-
}
|
|
10
|
-
getVersion() {
|
|
11
|
-
return 'v1';
|
|
12
|
-
}
|
|
13
|
-
isPublic() {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/src/clients/index.d.ts
DELETED
package/src/clients/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Organisation } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export declare class OrganisationPageClient extends ProtobufClient<Organisation> {
|
|
4
|
-
protected constructModel(data: Record<string, any>): Organisation;
|
|
5
|
-
protected getModelName(): string;
|
|
6
|
-
protected getVersion(): string;
|
|
7
|
-
isPublic(): boolean;
|
|
8
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Organisation } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export class OrganisationPageClient extends ProtobufClient {
|
|
4
|
-
constructModel(data) {
|
|
5
|
-
return Organisation.fromJSON(data);
|
|
6
|
-
}
|
|
7
|
-
getModelName() {
|
|
8
|
-
return 'organisation-page';
|
|
9
|
-
}
|
|
10
|
-
getVersion() {
|
|
11
|
-
return 'v1';
|
|
12
|
-
}
|
|
13
|
-
isPublic() {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PortalMap } from "../types/portal-map";
|
|
2
|
-
import { PortalType } from "../types/portal-type";
|
|
3
|
-
export declare abstract class ProtobufClient<T> {
|
|
4
|
-
static portalMap: PortalMap;
|
|
5
|
-
private readonly domainClient;
|
|
6
|
-
constructor(baseUrl: string, seed: number, apiKey?: string, portalMap?: PortalMap);
|
|
7
|
-
fetch(id: number): Promise<T>;
|
|
8
|
-
fetchMultiple(ids: number[]): Promise<T[]>;
|
|
9
|
-
protected abstract constructModel(data: Record<string, any>): T;
|
|
10
|
-
protected abstract getModelName(): string;
|
|
11
|
-
protected abstract getVersion(): string;
|
|
12
|
-
abstract isPublic(): boolean;
|
|
13
|
-
static transformUrlUsingPortalMap(path: string, portalType: PortalType): string;
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DomainClient } from "../domain-client";
|
|
2
|
-
export class ProtobufClient {
|
|
3
|
-
static portalMap = new Map();
|
|
4
|
-
domainClient;
|
|
5
|
-
constructor(baseUrl, seed, apiKey, portalMap) {
|
|
6
|
-
if (portalMap) {
|
|
7
|
-
ProtobufClient.portalMap = portalMap;
|
|
8
|
-
}
|
|
9
|
-
this.domainClient = new DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
|
|
10
|
-
}
|
|
11
|
-
async fetch(id) {
|
|
12
|
-
const results = await this.domainClient.doRequest([id]);
|
|
13
|
-
return this.constructModel(results[0]);
|
|
14
|
-
}
|
|
15
|
-
async fetchMultiple(ids) {
|
|
16
|
-
const results = await this.domainClient.doRequest(ids);
|
|
17
|
-
return results.map((data) => this.constructModel(data));
|
|
18
|
-
}
|
|
19
|
-
static transformUrlUsingPortalMap(path, portalType) {
|
|
20
|
-
const baseUrl = ProtobufClient.portalMap.get(portalType);
|
|
21
|
-
if (baseUrl && !path.includes('https')) {
|
|
22
|
-
return baseUrl + path;
|
|
23
|
-
}
|
|
24
|
-
return path;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MiniProgrammeCard } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export declare class PublicMiniProgrammeCardClient extends ProtobufClient<MiniProgrammeCard> {
|
|
4
|
-
protected constructModel(data: Record<string, any>): MiniProgrammeCard;
|
|
5
|
-
protected getModelName(): string;
|
|
6
|
-
protected getVersion(): string;
|
|
7
|
-
isPublic(): boolean;
|
|
8
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MiniProgrammeCard } from "../../protobuf";
|
|
2
|
-
import { ProtobufClient } from "./protobuf-client";
|
|
3
|
-
export class PublicMiniProgrammeCardClient extends ProtobufClient {
|
|
4
|
-
constructModel(data) {
|
|
5
|
-
return MiniProgrammeCard.fromJSON(data);
|
|
6
|
-
}
|
|
7
|
-
getModelName() {
|
|
8
|
-
return 'mini-programme-card';
|
|
9
|
-
}
|
|
10
|
-
getVersion() {
|
|
11
|
-
return 'v1';
|
|
12
|
-
}
|
|
13
|
-
isPublic() {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/src/domain-client.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class DomainClient<T> {
|
|
2
|
-
readonly baseUrl: string;
|
|
3
|
-
readonly apiKey: string | undefined;
|
|
4
|
-
readonly model: string;
|
|
5
|
-
readonly version: string;
|
|
6
|
-
readonly isPublic: boolean;
|
|
7
|
-
readonly seed: number;
|
|
8
|
-
constructor(baseUrl: string, apiKey: string | undefined, model: string, version: string, isPublic: boolean, seed: number);
|
|
9
|
-
doRequest(ids: number[]): Promise<T[]>;
|
|
10
|
-
private decompressModelData;
|
|
11
|
-
private handleErrors;
|
|
12
|
-
private buildUrl;
|
|
13
|
-
private shouldAddPublicPrefix;
|
|
14
|
-
}
|
package/src/domain-client.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { BadRequestException } from "./exceptions/bad-request-exception";
|
|
2
|
-
import { InternalServerException } from "./exceptions/internal-server-exception";
|
|
3
|
-
import { NotFoundException } from "./exceptions/not-found-exception";
|
|
4
|
-
const decoder = new TextDecoder();
|
|
5
|
-
export class DomainClient {
|
|
6
|
-
baseUrl;
|
|
7
|
-
apiKey;
|
|
8
|
-
model;
|
|
9
|
-
version;
|
|
10
|
-
isPublic;
|
|
11
|
-
seed;
|
|
12
|
-
constructor(baseUrl, apiKey, model, version, isPublic, seed) {
|
|
13
|
-
this.baseUrl = baseUrl;
|
|
14
|
-
this.apiKey = apiKey;
|
|
15
|
-
this.model = model;
|
|
16
|
-
this.version = version;
|
|
17
|
-
this.isPublic = isPublic;
|
|
18
|
-
this.seed = seed;
|
|
19
|
-
}
|
|
20
|
-
async doRequest(ids) {
|
|
21
|
-
const url = `${this.baseUrl}/${this.buildUrl(ids)}`;
|
|
22
|
-
const headers = {};
|
|
23
|
-
if (this.apiKey !== undefined) {
|
|
24
|
-
headers["x-api-key"] = this.apiKey;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const response = await fetch(url, { headers });
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
29
|
-
const data = await response.json();
|
|
30
|
-
if (!response.ok || data.status !== 200) {
|
|
31
|
-
this.handleErrors(data);
|
|
32
|
-
}
|
|
33
|
-
const models = [];
|
|
34
|
-
for (const id of ids) {
|
|
35
|
-
const modelData = data.data[id];
|
|
36
|
-
if (!modelData) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
if (typeof modelData === 'string') {
|
|
40
|
-
try {
|
|
41
|
-
models.push(await this.decompressModelData(modelData));
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error(error);
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
models.push(modelData);
|
|
50
|
-
}
|
|
51
|
-
return models;
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
console.error('Error fetching data from API:', error);
|
|
55
|
-
if (error instanceof InternalServerException || error instanceof BadRequestException || error instanceof NotFoundException) {
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
throw new InternalServerException('Unable to fetch data from the API', error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async decompressModelData(compressedData) {
|
|
62
|
-
const bytes = Uint8Array.from(atob(compressedData), c => c.charCodeAt(0));
|
|
63
|
-
const stream = new DecompressionStream('deflate');
|
|
64
|
-
const response = new Response(bytes);
|
|
65
|
-
const decompressedStream = response.body?.pipeThrough(stream);
|
|
66
|
-
const decompressedBytes = new Uint8Array(await new Response(decompressedStream).arrayBuffer());
|
|
67
|
-
return JSON.parse(decoder.decode(decompressedBytes));
|
|
68
|
-
}
|
|
69
|
-
handleErrors(response) {
|
|
70
|
-
if (!response.status) {
|
|
71
|
-
throw new InternalServerException(response.message);
|
|
72
|
-
}
|
|
73
|
-
if (response.status === 400) {
|
|
74
|
-
throw new BadRequestException(response.message);
|
|
75
|
-
}
|
|
76
|
-
if (response.status === 404) {
|
|
77
|
-
throw new NotFoundException(response.message);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
buildUrl(ids) {
|
|
81
|
-
const publicPrefix = this.shouldAddPublicPrefix() ? 'public/' : '';
|
|
82
|
-
let query = `${publicPrefix}${this.model}/${this.version}/?seed=${this.seed}`;
|
|
83
|
-
for (const id of ids) {
|
|
84
|
-
query += `&id=${id}`;
|
|
85
|
-
}
|
|
86
|
-
return query;
|
|
87
|
-
}
|
|
88
|
-
shouldAddPublicPrefix() {
|
|
89
|
-
return this.isPublic && this.apiKey === undefined;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IClassFactory } from "../i-class-factory";
|
|
2
|
-
import { CallableReturnType, Model } from "../types";
|
|
3
|
-
import { PortalMap } from "../types/portal-map";
|
|
4
|
-
export declare class InternalLinkFactory implements IClassFactory {
|
|
5
|
-
private portalMap;
|
|
6
|
-
constructor(portalMap: PortalMap);
|
|
7
|
-
create(link: Model, parameters?: unknown): CallableReturnType;
|
|
8
|
-
private getPortalBaseUrl;
|
|
9
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export class InternalLinkFactory {
|
|
2
|
-
portalMap;
|
|
3
|
-
constructor(portalMap) {
|
|
4
|
-
this.portalMap = portalMap;
|
|
5
|
-
}
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
create(link, parameters) {
|
|
8
|
-
const getPortalType = link['getPortalType'];
|
|
9
|
-
const portalType = getPortalType ? getPortalType() : null;
|
|
10
|
-
const portalBaseUrl = portalType ? this.getPortalBaseUrl(portalType) : '';
|
|
11
|
-
const getUrl = link['getUrl'];
|
|
12
|
-
if (getUrl) {
|
|
13
|
-
const path = getUrl();
|
|
14
|
-
link['getUrl'] = () => portalBaseUrl + path;
|
|
15
|
-
}
|
|
16
|
-
return link;
|
|
17
|
-
}
|
|
18
|
-
getPortalBaseUrl(portalType) {
|
|
19
|
-
const url = this.portalMap.get(portalType);
|
|
20
|
-
return url || '';
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/i-api-response.d.ts
DELETED
package/src/i-api-response.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/i-class-factory.d.ts
DELETED
package/src/i-class-factory.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/model-client.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IModelDescription } from "./i-model-description";
|
|
2
|
-
import { PortalMap } from "./types/portal-map";
|
|
3
|
-
export declare abstract class ModelClient<T> {
|
|
4
|
-
private readonly domainClient;
|
|
5
|
-
private readonly modelFactory;
|
|
6
|
-
constructor(baseUrl?: string, apiKey?: string, seed?: number, portalMap?: PortalMap);
|
|
7
|
-
fetch(id: number): Promise<T>;
|
|
8
|
-
fetchDescription(id: number): Promise<IModelDescription>;
|
|
9
|
-
fetchMultiple(ids: number[]): Promise<T[]>;
|
|
10
|
-
fetchMultipleDescriptions(ids: number[]): Promise<IModelDescription[]>;
|
|
11
|
-
fromDescription(description: IModelDescription): T;
|
|
12
|
-
fromDescriptions(descriptions: IModelDescription[]): T[];
|
|
13
|
-
protected abstract getModelName(): string;
|
|
14
|
-
protected abstract getVersion(): string;
|
|
15
|
-
abstract isPublic(): boolean;
|
|
16
|
-
}
|
package/src/model-client.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DomainClient } from "./domain-client";
|
|
2
|
-
import { ClientException } from "./exceptions/client-exception";
|
|
3
|
-
import { ModelFactory } from "./model-factory";
|
|
4
|
-
export class ModelClient {
|
|
5
|
-
domainClient;
|
|
6
|
-
modelFactory;
|
|
7
|
-
constructor(baseUrl, apiKey, seed, portalMap) {
|
|
8
|
-
if (!baseUrl || !seed) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
this.modelFactory = new ModelFactory(portalMap);
|
|
12
|
-
this.domainClient = new DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
|
|
13
|
-
}
|
|
14
|
-
async fetch(id) {
|
|
15
|
-
const modelDescriptions = await this.fetchDescription(id);
|
|
16
|
-
return this.modelFactory.fromDescription(modelDescriptions);
|
|
17
|
-
}
|
|
18
|
-
async fetchDescription(id) {
|
|
19
|
-
if (!this.domainClient) {
|
|
20
|
-
throw new ClientException("Offline mode active: did you provide all parameters " +
|
|
21
|
-
"in the constructor?");
|
|
22
|
-
}
|
|
23
|
-
const result = await this.domainClient.doRequest([id]);
|
|
24
|
-
return result[0];
|
|
25
|
-
}
|
|
26
|
-
async fetchMultiple(ids) {
|
|
27
|
-
const descriptions = await this.fetchMultipleDescriptions(ids);
|
|
28
|
-
return this.modelFactory.fromDescriptions(descriptions);
|
|
29
|
-
}
|
|
30
|
-
async fetchMultipleDescriptions(ids) {
|
|
31
|
-
if (!this.domainClient) {
|
|
32
|
-
throw new ClientException('Offline mode active: did you provide all parameters ' +
|
|
33
|
-
'in the constructor?');
|
|
34
|
-
}
|
|
35
|
-
return await this.domainClient.doRequest(ids);
|
|
36
|
-
}
|
|
37
|
-
fromDescription(description) {
|
|
38
|
-
return this.modelFactory.fromDescription(description);
|
|
39
|
-
}
|
|
40
|
-
fromDescriptions(descriptions) {
|
|
41
|
-
return this.modelFactory.fromDescriptions(descriptions);
|
|
42
|
-
}
|
|
43
|
-
}
|
package/src/model-factory.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IModelDescription } from "./i-model-description";
|
|
2
|
-
import { PortalMap } from "./types/portal-map";
|
|
3
|
-
export declare class ModelFactory<T> {
|
|
4
|
-
private customClassFactories;
|
|
5
|
-
constructor(portalMap?: PortalMap);
|
|
6
|
-
fromDescription(data: IModelDescription): T;
|
|
7
|
-
fromDescriptions(data: IModelDescription[]): T[];
|
|
8
|
-
private unpackClass;
|
|
9
|
-
private getCallable;
|
|
10
|
-
private unpackArray;
|
|
11
|
-
}
|
package/src/model-factory.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 {
|
|
6
|
-
customClassFactories;
|
|
7
|
-
constructor(portalMap = new Map()) {
|
|
8
|
-
const factories = new Map();
|
|
9
|
-
factories.set('IInternalLink', new InternalLinkFactory(portalMap));
|
|
10
|
-
factories.set('SerializableDateTime', new DateFactory());
|
|
11
|
-
this.customClassFactories = factories;
|
|
12
|
-
}
|
|
13
|
-
fromDescription(data) {
|
|
14
|
-
return this.unpackClass(data);
|
|
15
|
-
}
|
|
16
|
-
fromDescriptions(data) {
|
|
17
|
-
const models = [];
|
|
18
|
-
for (const modelDescription of data) {
|
|
19
|
-
models.push(this.unpackClass(modelDescription));
|
|
20
|
-
}
|
|
21
|
-
return models;
|
|
22
|
-
}
|
|
23
|
-
unpackClass(data) {
|
|
24
|
-
const unpacked = {};
|
|
25
|
-
for (const functionName in data.func) {
|
|
26
|
-
unpacked[functionName] = this.getCallable(functionName, data);
|
|
27
|
-
}
|
|
28
|
-
const factory = this.customClassFactories.get(data.class);
|
|
29
|
-
if (factory !== undefined) {
|
|
30
|
-
return factory.create(unpacked, data.parameters);
|
|
31
|
-
}
|
|
32
|
-
return unpacked;
|
|
33
|
-
}
|
|
34
|
-
getCallable(functionName, data) {
|
|
35
|
-
const propertyName = functionName.substr(3);
|
|
36
|
-
const canShowFunction = 'canShow' + propertyName;
|
|
37
|
-
const value = data.func[functionName];
|
|
38
|
-
let returnValue;
|
|
39
|
-
if (isModelDescription(value)) {
|
|
40
|
-
returnValue = this.unpackClass(value);
|
|
41
|
-
}
|
|
42
|
-
else if (Array.isArray(value)) {
|
|
43
|
-
returnValue = this.unpackArray(value);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
returnValue = value;
|
|
47
|
-
}
|
|
48
|
-
if (canShowFunction in data.func) {
|
|
49
|
-
return () => {
|
|
50
|
-
if (data.func[canShowFunction] === false) {
|
|
51
|
-
throw new PropertyNotAvailableException(`Property '${propertyName}' not available`);
|
|
52
|
-
}
|
|
53
|
-
return returnValue;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return () => {
|
|
57
|
-
return returnValue;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
unpackArray(list) {
|
|
61
|
-
return list.map(item => {
|
|
62
|
-
if (isModelDescription(item)) {
|
|
63
|
-
return this.unpackClass(item);
|
|
64
|
-
}
|
|
65
|
-
return item;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IBestFitProgramme } from "../../..";
|
|
2
|
-
import { ModelClient } from "../../model-client";
|
|
3
|
-
export declare class BestfitProgrammeClient extends ModelClient<IBestFitProgramme> {
|
|
4
|
-
protected getModelName(): string;
|
|
5
|
-
protected getVersion(): string;
|
|
6
|
-
isPublic(): boolean;
|
|
7
|
-
}
|