@studyportals/domain-client 4.13.0-beta.0 → 4.13.1-beta.0
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/index.js +31 -63
- package/index.js.map +1 -1
- package/package.json +14 -23
- package/src/domain-client.d.ts +4 -0
- package/src/domain-client.js +42 -30
- package/src/domain-client.js.map +1 -1
- package/src/exceptions/bad-request-exception.js +1 -5
- package/src/exceptions/bad-request-exception.js.map +1 -1
- package/src/exceptions/client-exception.js +1 -5
- package/src/exceptions/client-exception.js.map +1 -1
- package/src/exceptions/internal-server-exception.js +1 -5
- package/src/exceptions/internal-server-exception.js.map +1 -1
- package/src/exceptions/not-found-exception.js +1 -5
- package/src/exceptions/not-found-exception.js.map +1 -1
- package/src/exceptions/property-not-available-exception.js +1 -5
- package/src/exceptions/property-not-available-exception.js.map +1 -1
- package/src/factories/DateFactory.js +1 -5
- package/src/factories/DateFactory.js.map +1 -1
- package/src/factories/InternalLinkFactory.js +1 -5
- package/src/factories/InternalLinkFactory.js.map +1 -1
- package/src/i-api-response.js +1 -2
- package/src/i-class-factory.js +1 -2
- package/src/i-model-description.js +1 -5
- package/src/i-model-description.js.map +1 -1
- package/src/model-client.js +42 -29
- package/src/model-client.js.map +1 -1
- package/src/model-factory.js +10 -14
- package/src/model-factory.js.map +1 -1
- package/src/models/bestfit-programme/bestfit-programme-client.js +2 -6
- package/src/models/bestfit-programme/bestfit-programme-client.js.map +1 -1
- package/src/models/bestfit-programme/i-best-fit-programme.js +1 -2
- package/src/models/bestfit-programme/i-city.js +1 -2
- package/src/models/bestfit-programme/i-living-cost.js +1 -2
- package/src/models/common/i-city.js +1 -2
- package/src/models/common/i-country.js +1 -2
- package/src/models/common/i-english-requirements.js +1 -2
- package/src/models/common/i-g-p-a-requirement.js +1 -2
- package/src/models/common/i-internal-link.js +1 -2
- package/src/models/common/i-logo.js +1 -2
- package/src/models/common/i-tuition-fee.js +1 -2
- package/src/models/compare-programme/compare-programme-client.js +2 -6
- package/src/models/compare-programme/compare-programme-client.js.map +1 -1
- package/src/models/compare-programme/i-compare-programme.js +1 -2
- package/src/models/copilot-country/copilot-country-client.js +2 -6
- package/src/models/copilot-country/copilot-country-client.js.map +1 -1
- package/src/models/copilot-country/i-copilot-country.js +1 -2
- package/src/models/copilot-country/i-copilot-ranking-card.js +1 -2
- package/src/models/copilot-programme/copilot-programme-client.js +2 -6
- package/src/models/copilot-programme/copilot-programme-client.js.map +1 -1
- package/src/models/copilot-programme/i-copilot-programme.js +1 -2
- package/src/models/customerio-organisation/customerio-organisation-client.js +2 -6
- package/src/models/customerio-organisation/customerio-organisation-client.js.map +1 -1
- package/src/models/customerio-organisation/i-customer-io-organisation.js +1 -2
- package/src/models/customerio-organisation/i-review.js +1 -2
- package/src/models/customerio-programme/customerio-programme-client.js +2 -6
- package/src/models/customerio-programme/customerio-programme-client.js.map +1 -1
- package/src/models/customerio-programme/i-customer-io-programme.js +1 -2
- package/src/models/customerio-programme/i-internal-link.js +1 -2
- package/src/models/organisation-card/i-organisation-card.js +1 -2
- package/src/models/organisation-card/i-ranking-discipline.js +1 -2
- package/src/models/organisation-card/organisation-card-client.js +2 -6
- package/src/models/organisation-card/organisation-card-client.js.map +1 -1
- package/src/models/organisation-for-search/i-organisation-for-search.js +1 -2
- package/src/models/organisation-for-search/public-organisation-for-search-client.js +2 -6
- package/src/models/organisation-for-search/public-organisation-for-search-client.js.map +1 -1
- package/src/models/organisation-search-document/i-organisation-search-document.js +1 -2
- package/src/models/organisation-search-document/organisation-search-document-client.js +2 -6
- package/src/models/organisation-search-document/organisation-search-document-client.js.map +1 -1
- package/src/models/programme-card/i-click-tracking-data.js +1 -2
- package/src/models/programme-card/i-cover.js +1 -2
- package/src/models/programme-card/i-deadline.js +1 -2
- package/src/models/programme-card/i-duration.js +1 -2
- package/src/models/programme-card/i-internal-link.js +1 -2
- package/src/models/programme-card/i-link.js +1 -2
- package/src/models/programme-card/i-location.js +1 -2
- package/src/models/programme-card/i-logo.js +1 -2
- package/src/models/programme-card/i-optional-link.js +1 -2
- package/src/models/programme-card/i-programme-card.js +1 -2
- package/src/models/programme-card/i-start-date.js +1 -2
- package/src/models/programme-card/i-timing.js +1 -2
- package/src/models/programme-card/i-tracked-link.js +1 -2
- package/src/models/programme-card/i-tracking.js +1 -2
- package/src/models/programme-card/i-tuition-fee.js +1 -2
- package/src/models/programme-card/programme-card-client.js +2 -6
- package/src/models/programme-card/programme-card-client.js.map +1 -1
- package/src/models/ranking-cards/i-ranking-card.js +1 -2
- package/src/models/ranking-cards/i-ranking-cards.js +1 -2
- package/src/models/ranking-cards/i-ranking.js +1 -2
- package/src/models/ranking-cards/public-ranking-cards-client.js +2 -6
- package/src/models/ranking-cards/public-ranking-cards-client.js.map +1 -1
- package/src/models/scholarship-card/i-scholarship-card.js +1 -2
- package/src/models/scholarship-card/public-scholarship-card-client.js +2 -6
- package/src/models/scholarship-card/public-scholarship-card-client.js.map +1 -1
- package/src/models/search-country-faq/i-search-country-faq.js +1 -2
- package/src/models/search-country-faq/public-search-country-faq-client.js +2 -6
- package/src/models/search-country-faq/public-search-country-faq-client.js.map +1 -1
- package/src/models/search-discipline/i-search-discipline.js +1 -2
- package/src/models/search-discipline/public-search-discipline-client.js +2 -6
- package/src/models/search-discipline/public-search-discipline-client.js.map +1 -1
- package/src/models/search-projection/i-geo-targeting-configuration.js +1 -2
- package/src/models/search-projection/i-geo-targeting-values.js +1 -2
- package/src/models/search-projection/i-organisation-values.js +1 -2
- package/src/models/search-projection/i-premium-values.js +1 -2
- package/src/models/search-projection/i-search-projection.js +1 -2
- package/src/models/search-projection/i-tuition-values.js +1 -2
- package/src/models/search-projection/search-projection-client.js +2 -6
- package/src/models/search-projection/search-projection-client.js.map +1 -1
- package/src/models/sitemap-articles-info/i-sitemap-article-info.js +1 -2
- package/src/models/sitemap-articles-info/sitemap-articles-info-client.js +2 -6
- package/src/models/sitemap-articles-info/sitemap-articles-info-client.js.map +1 -1
- package/src/models/sitemap-cities-info/i-sitemap-city-info.js +1 -2
- package/src/models/sitemap-cities-info/sitemap-cities-info-client.js +2 -6
- package/src/models/sitemap-cities-info/sitemap-cities-info-client.js.map +1 -1
- package/src/models/sitemap-countries-info/i-sitemap-country-info.js +1 -2
- package/src/models/sitemap-countries-info/sitemap-countries-info-client.js +2 -6
- package/src/models/sitemap-countries-info/sitemap-countries-info-client.js.map +1 -1
- package/src/models/sitemap-country-degree-info/i-degree-info.js +1 -2
- package/src/models/sitemap-country-degree-info/i-sitemap-country-degree-info.js +1 -2
- package/src/models/sitemap-country-degree-info/sitemap-country-degree-info-client.js +2 -6
- package/src/models/sitemap-country-degree-info/sitemap-country-degree-info-client.js.map +1 -1
- package/src/models/sitemap-disciplines-info/i-sitemap-discipline-info.js +1 -2
- package/src/models/sitemap-disciplines-info/sitemap-disciplines-info-client.js +2 -6
- package/src/models/sitemap-disciplines-info/sitemap-disciplines-info-client.js.map +1 -1
- package/src/models/sitemap-organisations-info/i-sitemap-organisation-info.js +1 -2
- package/src/models/sitemap-organisations-info/sitemap-organisations-info-client.js +2 -6
- package/src/models/sitemap-organisations-info/sitemap-organisations-info-client.js.map +1 -1
- package/src/models/sitemap-programme-info/i-sitemap-programme-info.js +1 -2
- package/src/models/sitemap-programme-info/sitemap-programme-info-client.js +2 -6
- package/src/models/sitemap-programme-info/sitemap-programme-info-client.js.map +1 -1
- package/src/models/sitemap-rankings-info/i-sitemap-rankings-info.js +1 -2
- package/src/models/sitemap-rankings-info/sitemap-rankings-info-client.js +2 -6
- package/src/models/sitemap-rankings-info/sitemap-rankings-info-client.js.map +1 -1
- package/src/types/portal-map.js +1 -2
- package/src/types/portal-type.js +2 -5
- package/src/types/portal-type.js.map +1 -1
- package/src/types.js +1 -2
package/index.js
CHANGED
|
@@ -1,64 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const sitemap_disciplines_info_client_1 = require("./src/models/sitemap-disciplines-info/sitemap-disciplines-info-client");
|
|
33
|
-
Object.defineProperty(exports, "SitemapDisciplinesInfoClient", { enumerable: true, get: function () { return sitemap_disciplines_info_client_1.SitemapDisciplinesInfoClient; } });
|
|
34
|
-
const customerio_organisation_client_1 = require("./src/models/customerio-organisation/customerio-organisation-client");
|
|
35
|
-
Object.defineProperty(exports, "CustomerIOOrganisationClient", { enumerable: true, get: function () { return customerio_organisation_client_1.CustomerIOOrganisationClient; } });
|
|
36
|
-
const sitemap_organisations_info_client_1 = require("./src/models/sitemap-organisations-info/sitemap-organisations-info-client");
|
|
37
|
-
Object.defineProperty(exports, "SitemapOrganisationsInfoClient", { enumerable: true, get: function () { return sitemap_organisations_info_client_1.SitemapOrganisationsInfoClient; } });
|
|
38
|
-
const organisation_card_client_1 = require("./src/models/organisation-card/organisation-card-client");
|
|
39
|
-
Object.defineProperty(exports, "OrganisationCardClient", { enumerable: true, get: function () { return organisation_card_client_1.OrganisationCardClient; } });
|
|
40
|
-
const organisation_search_document_client_1 = require("./src/models/organisation-search-document/organisation-search-document-client");
|
|
41
|
-
Object.defineProperty(exports, "OrganisationSearchDocumentClient", { enumerable: true, get: function () { return organisation_search_document_client_1.OrganisationSearchDocumentClient; } });
|
|
42
|
-
const sitemap_rankings_info_client_1 = require("./src/models/sitemap-rankings-info/sitemap-rankings-info-client");
|
|
43
|
-
Object.defineProperty(exports, "SitemapRankingsInfoClient", { enumerable: true, get: function () { return sitemap_rankings_info_client_1.SitemapRankingsInfoClient; } });
|
|
44
|
-
const sitemap_articles_info_client_1 = require("./src/models/sitemap-articles-info/sitemap-articles-info-client");
|
|
45
|
-
Object.defineProperty(exports, "SitemapArticlesInfoClient", { enumerable: true, get: function () { return sitemap_articles_info_client_1.SitemapArticlesInfoClient; } });
|
|
46
|
-
const sitemap_cities_info_client_1 = require("./src/models/sitemap-cities-info/sitemap-cities-info-client");
|
|
47
|
-
Object.defineProperty(exports, "SitemapCitiesInfoClient", { enumerable: true, get: function () { return sitemap_cities_info_client_1.SitemapCitiesInfoClient; } });
|
|
48
|
-
const public_scholarship_card_client_1 = require("./src/models/scholarship-card/public-scholarship-card-client");
|
|
49
|
-
Object.defineProperty(exports, "PublicScholarshipCardClient", { enumerable: true, get: function () { return public_scholarship_card_client_1.PublicScholarshipCardClient; } });
|
|
50
|
-
const public_ranking_cards_client_1 = require("./src/models/ranking-cards/public-ranking-cards-client");
|
|
51
|
-
Object.defineProperty(exports, "PublicRankingCardsClient", { enumerable: true, get: function () { return public_ranking_cards_client_1.PublicRankingCardsClient; } });
|
|
52
|
-
const portal_type_1 = require("./src/types/portal-type");
|
|
53
|
-
Object.defineProperty(exports, "PortalType", { enumerable: true, get: function () { return portal_type_1.PortalType; } });
|
|
54
|
-
const model_client_1 = require("./src/model-client");
|
|
55
|
-
Object.defineProperty(exports, "ModelClient", { enumerable: true, get: function () { return model_client_1.ModelClient; } });
|
|
56
|
-
const compare_programme_client_1 = require("./src/models/compare-programme/compare-programme-client");
|
|
57
|
-
Object.defineProperty(exports, "CompareProgrammeClient", { enumerable: true, get: function () { return compare_programme_client_1.CompareProgrammeClient; } });
|
|
58
|
-
const public_organisation_for_search_client_1 = require("./src/models/organisation-for-search/public-organisation-for-search-client");
|
|
59
|
-
Object.defineProperty(exports, "PublicOrganisationForSearchClient", { enumerable: true, get: function () { return public_organisation_for_search_client_1.PublicOrganisationForSearchClient; } });
|
|
60
|
-
const copilot_programme_client_1 = require("./src/models/copilot-programme/copilot-programme-client");
|
|
61
|
-
Object.defineProperty(exports, "CopilotProgrammeClient", { enumerable: true, get: function () { return copilot_programme_client_1.CopilotProgrammeClient; } });
|
|
62
|
-
const copilot_country_client_1 = require("./src/models/copilot-country/copilot-country-client");
|
|
63
|
-
Object.defineProperty(exports, "CopilotCountryClient", { enumerable: true, get: function () { return copilot_country_client_1.CopilotCountryClient; } });
|
|
1
|
+
import { BadRequestException } from "./src/exceptions/bad-request-exception";
|
|
2
|
+
import { ClientException } from "./src/exceptions/client-exception";
|
|
3
|
+
import { InternalServerException } from "./src/exceptions/internal-server-exception";
|
|
4
|
+
import { NotFoundException } from "./src/exceptions/not-found-exception";
|
|
5
|
+
import { PropertyNotAvailableException } from "./src/exceptions/property-not-available-exception";
|
|
6
|
+
import { ProgrammeCardClient } from "./src/models/programme-card/programme-card-client";
|
|
7
|
+
import { SearchProjectionClient } from "./src/models/search-projection/search-projection-client";
|
|
8
|
+
import { BestfitProgrammeClient } from "./src/models/bestfit-programme/bestfit-programme-client";
|
|
9
|
+
import { CustomerIOProgrammeClient } from "./src/models/customerio-programme/customerio-programme-client";
|
|
10
|
+
import { SitemapProgrammeInfoClient } from "./src/models/sitemap-programme-info/sitemap-programme-info-client";
|
|
11
|
+
import { PublicSearchCountryFaqClient } from "./src/models/search-country-faq/public-search-country-faq-client";
|
|
12
|
+
import { SitemapCountriesInfoClient } from "./src/models/sitemap-countries-info/sitemap-countries-info-client";
|
|
13
|
+
import { SitemapCountryDegreeInfoClient } from "./src/models/sitemap-country-degree-info/sitemap-country-degree-info-client";
|
|
14
|
+
import { PublicSearchDisciplineClient } from "./src/models/search-discipline/public-search-discipline-client";
|
|
15
|
+
import { SitemapDisciplinesInfoClient } from "./src/models/sitemap-disciplines-info/sitemap-disciplines-info-client";
|
|
16
|
+
import { CustomerIOOrganisationClient } from "./src/models/customerio-organisation/customerio-organisation-client";
|
|
17
|
+
import { SitemapOrganisationsInfoClient } from "./src/models/sitemap-organisations-info/sitemap-organisations-info-client";
|
|
18
|
+
import { OrganisationCardClient } from "./src/models/organisation-card/organisation-card-client";
|
|
19
|
+
import { OrganisationSearchDocumentClient } from "./src/models/organisation-search-document/organisation-search-document-client";
|
|
20
|
+
import { SitemapRankingsInfoClient } from "./src/models/sitemap-rankings-info/sitemap-rankings-info-client";
|
|
21
|
+
import { SitemapArticlesInfoClient } from "./src/models/sitemap-articles-info/sitemap-articles-info-client";
|
|
22
|
+
import { SitemapCitiesInfoClient } from "./src/models/sitemap-cities-info/sitemap-cities-info-client";
|
|
23
|
+
import { PublicScholarshipCardClient } from "./src/models/scholarship-card/public-scholarship-card-client";
|
|
24
|
+
import { PublicRankingCardsClient } from './src/models/ranking-cards/public-ranking-cards-client';
|
|
25
|
+
import { PortalType } from "./src/types/portal-type";
|
|
26
|
+
import { ModelClient } from "./src/model-client";
|
|
27
|
+
import { CompareProgrammeClient } from "./src/models/compare-programme/compare-programme-client";
|
|
28
|
+
import { PublicOrganisationForSearchClient } from "./src/models/organisation-for-search/public-organisation-for-search-client";
|
|
29
|
+
import { CopilotProgrammeClient } from "./src/models/copilot-programme/copilot-programme-client";
|
|
30
|
+
import { CopilotCountryClient } from "./src/models/copilot-country/copilot-country-client";
|
|
31
|
+
export { BadRequestException, ClientException, InternalServerException, NotFoundException, PropertyNotAvailableException, ProgrammeCardClient, SearchProjectionClient, BestfitProgrammeClient, CustomerIOProgrammeClient, SitemapProgrammeInfoClient, PublicSearchCountryFaqClient, SitemapCountriesInfoClient, SitemapCountryDegreeInfoClient, PublicSearchDisciplineClient, SitemapDisciplinesInfoClient, CustomerIOOrganisationClient, SitemapOrganisationsInfoClient, OrganisationSearchDocumentClient, SitemapRankingsInfoClient, SitemapArticlesInfoClient, SitemapCitiesInfoClient, PublicScholarshipCardClient, PublicRankingCardsClient, CompareProgrammeClient, PortalType, ModelClient, PublicOrganisationForSearchClient, OrganisationCardClient, CopilotProgrammeClient, CopilotCountryClient };
|
|
64
32
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAA;AAajG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAOxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AAIjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AAMjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAE1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mEAAmE,CAAC;AAE/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,kEAAkE,CAAC;AAEhH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mEAAmE,CAAC;AAG/G,OAAO,EAAE,8BAA8B,EAAE,MAAM,6EAA6E,CAAC;AAE7H,OAAO,EAAE,4BAA4B,EAAE,MAAM,gEAAgE,CAAC;AAE9G,OAAO,EAAE,4BAA4B,EAAE,MAAM,uEAAuE,CAAC;AAKrH,OAAO,EAAE,4BAA4B,EAAE,MAAM,qEAAqE,CAAC;AAEnH,OAAO,EAAE,8BAA8B,EAAE,MAAM,2EAA2E,CAAC;AAG3H,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AAEjG,OAAO,EAAE,gCAAgC,EAAE,MAAM,+EAA+E,CAAC;AAEjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,6DAA6D,CAAC;AAEtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAC;AAI3G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAA;AAEhG,OAAO,EAAE,iCAAiC,EAAE,MAAM,4EAA4E,CAAA;AAE9H,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAA;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAA;AAG1F,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,EAa7B,mBAAmB,EAOnB,sBAAsB,EAItB,sBAAsB,EAMtB,yBAAyB,EAEzB,0BAA0B,EAE1B,4BAA4B,EAE5B,0BAA0B,EAG1B,8BAA8B,EAE9B,4BAA4B,EAE5B,4BAA4B,EAK5B,4BAA4B,EAE5B,8BAA8B,EAE9B,gCAAgC,EAEhC,yBAAyB,EAEzB,yBAAyB,EAEzB,uBAAuB,EAEvB,2BAA2B,EAI3B,wBAAwB,EAExB,sBAAsB,EACtB,UAAU,EAEV,WAAW,EAEX,iCAAiC,EAGjC,sBAAsB,EAGtB,sBAAsB,EACtB,oBAAoB,EAEpB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/domain-client",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.1-beta.0",
|
|
4
4
|
"description": "Responsible for fetching data from the Domain API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "StudyPortals B.V.",
|
|
7
|
-
"contributors": [
|
|
8
|
-
"braaibander <danny@studyportals.com>"
|
|
9
|
-
],
|
|
10
7
|
"license": "BSD-3-Clause",
|
|
11
8
|
"scripts": {
|
|
12
9
|
"test": "mocha --reporter spec \"tests/**/*.test.ts\"",
|
|
@@ -15,7 +12,7 @@
|
|
|
15
12
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
16
13
|
"pre-push": "npm run test && npm run coverage && npm run lint",
|
|
17
14
|
"prepare-dist": "npm run test && rm -fR bin && npx tsc && cp package.json bin/package.json && rm -fR bin/tests",
|
|
18
|
-
"publish-beta": "npm run prepare-dist && npm publish ./bin --tag beta",
|
|
15
|
+
"publish-beta": "npm version prerelease --preid=beta && npm run prepare-dist && npm publish ./bin --tag beta",
|
|
19
16
|
"publish-major": "npm version major && npm run prepare-dist && npm publish ./bin",
|
|
20
17
|
"publish-minor": "npm version minor && npm run prepare-dist && npm publish ./bin",
|
|
21
18
|
"publish-patch": "npm version patch && npm run prepare-dist && npm publish ./bin",
|
|
@@ -26,30 +23,24 @@
|
|
|
26
23
|
"pre-push": "npm run pre-push"
|
|
27
24
|
}
|
|
28
25
|
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"axios": "^1.6.0"
|
|
31
|
-
},
|
|
32
26
|
"devDependencies": {
|
|
33
|
-
"@studyportals/code-style": "^2.0.
|
|
27
|
+
"@studyportals/code-style": "^2.0.5",
|
|
34
28
|
"@testdeck/mocha": "^0.3.3",
|
|
35
|
-
"@types/
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/moxios": "^0.4.9",
|
|
38
|
-
"@types/node": "^14.14.8",
|
|
29
|
+
"@types/mocha": "^10.0.9",
|
|
30
|
+
"@types/node": "^22.7.5",
|
|
39
31
|
"@types/reflect-metadata": "^0.1.0",
|
|
40
|
-
"@
|
|
41
|
-
"@typescript-eslint/parser": "^4.8.1",
|
|
42
|
-
"eslint": "^7.13.0",
|
|
43
|
-
"eslint-plugin-import": "^2.22.1",
|
|
44
|
-
"eslint-plugin-mocha": "^10.1.0",
|
|
32
|
+
"@types/sinon": "^17.0.3",
|
|
45
33
|
"husky": "^4.3.0",
|
|
46
|
-
"mocha": "^10.
|
|
47
|
-
"moxios": "^0.4.0",
|
|
34
|
+
"mocha": "^10.7.3",
|
|
48
35
|
"nyc": "^15.1.0",
|
|
49
36
|
"source-map-support": "^0.5.19",
|
|
50
|
-
"
|
|
51
|
-
"tslint": "^6.1.3",
|
|
37
|
+
"tsx": "^4.19.1",
|
|
52
38
|
"typemoq": "^2.1.0",
|
|
53
|
-
"typescript": "^
|
|
39
|
+
"typescript": "^5.6.3"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"fetch-mock": "^11.1.5",
|
|
43
|
+
"node-fetch": "^3.3.2",
|
|
44
|
+
"sinon": "^19.0.2"
|
|
54
45
|
}
|
|
55
46
|
}
|
package/src/domain-client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IApiResponse } from "./i-api-response";
|
|
1
2
|
import { IModelDescription } from "./i-model-description";
|
|
2
3
|
export declare class DomainClient {
|
|
3
4
|
readonly baseUrl: string;
|
|
@@ -8,6 +9,9 @@ export declare class DomainClient {
|
|
|
8
9
|
readonly seed: number;
|
|
9
10
|
constructor(baseUrl: string, apiKey: string | undefined, model: string, version: string, isPublic: boolean, seed: number);
|
|
10
11
|
doRequest(ids: number[]): Promise<IModelDescription[]>;
|
|
12
|
+
fetching(url: string, headers: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
}): Promise<IApiResponse>;
|
|
11
15
|
private handleErrors;
|
|
12
16
|
private buildUrl;
|
|
13
17
|
private shouldAddPublicPrefix;
|
package/src/domain-client.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { BadRequestException } from "./exceptions/bad-request-exception";
|
|
11
|
+
import { InternalServerException } from "./exceptions/internal-server-exception";
|
|
12
|
+
import { NotFoundException } from "./exceptions/not-found-exception";
|
|
13
|
+
import fetch from "node-fetch";
|
|
14
|
+
export class DomainClient {
|
|
9
15
|
constructor(baseUrl, apiKey, model, version, isPublic, seed) {
|
|
10
16
|
this.baseUrl = baseUrl;
|
|
11
17
|
this.apiKey = apiKey;
|
|
@@ -14,35 +20,42 @@ class DomainClient {
|
|
|
14
20
|
this.isPublic = isPublic;
|
|
15
21
|
this.seed = seed;
|
|
16
22
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const axiosResponse = await axios_1.default.get(url, config);
|
|
25
|
-
const response = axiosResponse.data;
|
|
26
|
-
this.handleErrors(response);
|
|
27
|
-
const models = [];
|
|
28
|
-
for (const id of ids) {
|
|
29
|
-
const modelData = response.data[id];
|
|
30
|
-
if (!modelData) {
|
|
31
|
-
continue;
|
|
23
|
+
doRequest(ids) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const url = this.buildUrl(ids);
|
|
26
|
+
const headers = {};
|
|
27
|
+
if (this.apiKey !== undefined) {
|
|
28
|
+
headers['x-api-key'] = this.apiKey;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const data = yield this.fetching(url, headers);
|
|
31
|
+
this.handleErrors(data);
|
|
32
|
+
const models = [];
|
|
33
|
+
for (const id of ids) {
|
|
34
|
+
const modelData = data.data[id];
|
|
35
|
+
if (!modelData) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
models.push(modelData);
|
|
39
|
+
}
|
|
40
|
+
return models;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
fetching(url, headers) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield fetch(url, { headers });
|
|
46
|
+
const data = yield response.json();
|
|
47
|
+
return data;
|
|
48
|
+
});
|
|
36
49
|
}
|
|
37
50
|
handleErrors(response) {
|
|
38
51
|
if (!response.status) {
|
|
39
|
-
throw new
|
|
52
|
+
throw new InternalServerException(response.message);
|
|
40
53
|
}
|
|
41
54
|
if (response.status === 400) {
|
|
42
|
-
throw new
|
|
55
|
+
throw new BadRequestException(response.message);
|
|
43
56
|
}
|
|
44
57
|
if (response.status === 404) {
|
|
45
|
-
throw new
|
|
58
|
+
throw new NotFoundException(response.message);
|
|
46
59
|
}
|
|
47
60
|
}
|
|
48
61
|
buildUrl(ids) {
|
|
@@ -57,5 +70,4 @@ class DomainClient {
|
|
|
57
70
|
return this.isPublic && this.apiKey === undefined;
|
|
58
71
|
}
|
|
59
72
|
}
|
|
60
|
-
exports.DomainClient = DomainClient;
|
|
61
73
|
//# sourceMappingURL=domain-client.js.map
|
package/src/domain-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-client.js","sourceRoot":"","sources":["../../src/domain-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"domain-client.js","sourceRoot":"","sources":["../../src/domain-client.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,uB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EAAE,OAAO,EAAE,CAAC,CAAC;YAC/C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAkB,CAAC;YACnD,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IAEO,YAAY,CAAC,QAAsB;QAC1C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtB,MAAM,IAAI,uBAAuB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC7B,MAAM,IAAI,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC7B,MAAM,IAAI,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;IAEO,QAAQ,CAAC,GAAa;QAC7B,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,IAAI,KAAK,GAAG,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9E,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACtB,KAAK,IAAI,OAAO,EAAE,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,qBAAqB;QAC5B,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC;IACnD,CAAC;CACD"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
7
3
|
//# sourceMappingURL=bad-request-exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bad-request-exception.js","sourceRoot":"","sources":["../../../src/exceptions/bad-request-exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bad-request-exception.js","sourceRoot":"","sources":["../../../src/exceptions/bad-request-exception.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,mBAAoB,SAAQ,KAAK;CAC7C"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
7
3
|
//# sourceMappingURL=client-exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-exception.js","sourceRoot":"","sources":["../../../src/exceptions/client-exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client-exception.js","sourceRoot":"","sources":["../../../src/exceptions/client-exception.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAgB,SAAQ,KAAK;CACzC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
7
3
|
//# sourceMappingURL=internal-server-exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-server-exception.js","sourceRoot":"","sources":["../../../src/exceptions/internal-server-exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-server-exception.js","sourceRoot":"","sources":["../../../src/exceptions/internal-server-exception.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;CACjD"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
7
3
|
//# sourceMappingURL=not-found-exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-found-exception.js","sourceRoot":"","sources":["../../../src/exceptions/not-found-exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"not-found-exception.js","sourceRoot":"","sources":["../../../src/exceptions/not-found-exception.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAC3C"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
7
3
|
//# sourceMappingURL=property-not-available-exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-not-available-exception.js","sourceRoot":"","sources":["../../../src/exceptions/property-not-available-exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-not-available-exception.js","sourceRoot":"","sources":["../../../src/exceptions/property-not-available-exception.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,6BAA8B,SAAQ,KAAK;CACvD"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
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;
|
|
10
6
|
//# sourceMappingURL=DateFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFactory.js","sourceRoot":"","sources":["../../../src/factories/DateFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateFactory.js","sourceRoot":"","sources":["../../../src/factories/DateFactory.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,WAAW;IAChB,MAAM,CAAC,IAAW,EAAE,UAAoB;QAC9C,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;CACD"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InternalLinkFactory = void 0;
|
|
4
|
-
class InternalLinkFactory {
|
|
1
|
+
export class InternalLinkFactory {
|
|
5
2
|
constructor(portalMap) {
|
|
6
3
|
this.portalMap = portalMap;
|
|
7
4
|
}
|
|
@@ -16,5 +13,4 @@ class InternalLinkFactory {
|
|
|
16
13
|
return url || '';
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.InternalLinkFactory = InternalLinkFactory;
|
|
20
16
|
//# sourceMappingURL=InternalLinkFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalLinkFactory.js","sourceRoot":"","sources":["../../../src/factories/InternalLinkFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InternalLinkFactory.js","sourceRoot":"","sources":["../../../src/factories/InternalLinkFactory.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,mBAAmB;IAG/B,YAAY,SAAoB;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,IAAW;QACxB,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,EAAgB,CAAC,CAAC;QAEhF,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAY,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAW,EAAE,CAAC,aAAa,GAAG,IAAI,CAAC;QAEpD,OAAO,IAAI,CAAC;IACb,CAAC;IAEO,gBAAgB,CAAC,UAAsB;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,GAAG,IAAI,EAAE,CAAC;IAClB,CAAC;CAED"}
|
package/src/i-api-response.js
CHANGED
package/src/i-class-factory.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isModelDescription = void 0;
|
|
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
|
}
|
|
9
|
-
exports.isModelDescription = isModelDescription;
|
|
10
6
|
//# sourceMappingURL=i-model-description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-model-description.js","sourceRoot":"","sources":["../../src/i-model-description.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i-model-description.js","sourceRoot":"","sources":["../../src/i-model-description.ts"],"names":[],"mappings":"AAQA,2BAA2B;AAC3B,MAAM,UAAU,kBAAkB,CAAC,GAAQ;IAC1C,2BAA2B;IAC3B,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AACzD,CAAC"}
|
package/src/model-client.js
CHANGED
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { DomainClient } from "./domain-client";
|
|
11
|
+
import { ClientException } from "./exceptions/client-exception";
|
|
12
|
+
import { ModelFactory } from "./model-factory";
|
|
13
|
+
export class ModelClient {
|
|
8
14
|
constructor(baseUrl, apiKey, seed, portalMap) {
|
|
9
15
|
if (!baseUrl || !seed) {
|
|
10
16
|
return;
|
|
11
17
|
}
|
|
12
|
-
this.modelFactory = new
|
|
13
|
-
this.domainClient = new
|
|
18
|
+
this.modelFactory = new ModelFactory(portalMap);
|
|
19
|
+
this.domainClient = new DomainClient(baseUrl, apiKey, this.getModelName(), this.getVersion(), this.isPublic(), seed);
|
|
14
20
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
fetch(id) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const modelDescriptions = yield this.fetchDescription(id);
|
|
24
|
+
return this.modelFactory.fromDescription(modelDescriptions);
|
|
25
|
+
});
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
fetchDescription(id) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
if (!this.domainClient) {
|
|
30
|
+
throw new ClientException("Offline mode active: did you provide all parameters " +
|
|
31
|
+
"in the constructor?");
|
|
32
|
+
}
|
|
33
|
+
const result = yield this.domainClient.doRequest([id]);
|
|
34
|
+
return result[0];
|
|
35
|
+
});
|
|
26
36
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
fetchMultiple(ids) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const descriptions = yield this.fetchMultipleDescriptions(ids);
|
|
40
|
+
return this.modelFactory.fromDescriptions(descriptions);
|
|
41
|
+
});
|
|
30
42
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
fetchMultipleDescriptions(ids) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
if (!this.domainClient) {
|
|
46
|
+
throw new ClientException('Offline mode active: did you provide all parameters ' +
|
|
47
|
+
'in the constructor?');
|
|
48
|
+
}
|
|
49
|
+
return yield this.domainClient.doRequest(ids);
|
|
50
|
+
});
|
|
37
51
|
}
|
|
38
52
|
fromDescription(description) {
|
|
39
53
|
return this.modelFactory.fromDescription(description);
|
|
@@ -42,5 +56,4 @@ class ModelClient {
|
|
|
42
56
|
return this.modelFactory.fromDescriptions(descriptions);
|
|
43
57
|
}
|
|
44
58
|
}
|
|
45
|
-
exports.ModelClient = ModelClient;
|
|
46
59
|
//# sourceMappingURL=model-client.js.map
|
package/src/model-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-client.js","sourceRoot":"","sources":["../../src/model-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-client.js","sourceRoot":"","sources":["../../src/model-client.ts"],"names":[],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