@studyportals/search-api-interface 1.2.1 → 1.2.2-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.
- package/.eslintignore +1 -0
- package/.eslintrc.yml +4 -0
- package/{index.d.ts → bin/index.d.ts} +6 -1
- package/{index.js → bin/index.js} +7 -1
- package/bin/index.js.map +1 -0
- package/bin/package.json +31 -0
- package/bin/src/SearchApiClientBase.js.map +1 -0
- package/{src → bin/src}/organisations/DegreeTypeEnum.js +1 -1
- package/{src → bin/src}/organisations/DegreeTypeEnum.js.map +1 -1
- package/{src → bin/src}/organisations/DeliveryMethodEnum.js +1 -1
- package/{src → bin/src}/organisations/DeliveryMethodEnum.js.map +1 -1
- package/{src → bin/src}/organisations/SearchApiOrganisationClient.d.ts +1 -1
- package/{src → bin/src}/organisations/SearchApiOrganisationClient.js +1 -1
- package/{src → bin/src}/organisations/SearchApiOrganisationClient.js.map +1 -1
- package/bin/src/programmes/IProgrammeSearchFilters.d.ts +17 -0
- package/bin/src/programmes/IProgrammeSearchFilters.js +7 -0
- package/bin/src/programmes/IProgrammeSearchFilters.js.map +1 -0
- package/bin/src/programmes/IProgrammeSearchResponse.d.ts +5 -0
- package/bin/src/programmes/IProgrammeSearchResponse.js +3 -0
- package/bin/src/programmes/IProgrammeSearchResponse.js.map +1 -0
- package/bin/src/programmes/ProgrammeSearchFilters.d.ts +23 -0
- package/bin/src/programmes/ProgrammeSearchFilters.js +28 -0
- package/bin/src/programmes/ProgrammeSearchFilters.js.map +1 -0
- package/bin/src/programmes/ProgrammeSearchInput.d.ts +19 -0
- package/bin/src/programmes/ProgrammeSearchInput.js +3 -0
- package/bin/src/programmes/ProgrammeSearchInput.js.map +1 -0
- package/bin/src/programmes/SearchApiProgrammeClient.d.ts +12 -0
- package/bin/src/programmes/SearchApiProgrammeClient.js +40 -0
- package/bin/src/programmes/SearchApiProgrammeClient.js.map +1 -0
- package/bin/src/programmes/TuitionFeeFilterValueDTO.d.ts +4 -0
- package/bin/src/programmes/TuitionFeeFilterValueDTO.js +3 -0
- package/bin/src/programmes/TuitionFeeFilterValueDTO.js.map +1 -0
- package/index.ts +30 -0
- package/package.json +31 -29
- package/src/SearchApiClientBase.ts +10 -0
- package/src/organisations/DegreeTypeEnum.ts +7 -0
- package/src/organisations/DeliveryMethodEnum.ts +5 -0
- package/src/organisations/IOrganisationSearchFilters.ts +12 -0
- package/src/organisations/IOrganisationSearchResponse.ts +5 -0
- package/src/organisations/OrganisationSearchFilters.ts +65 -0
- package/src/organisations/OrganisationSearchInput.ts +14 -0
- package/src/organisations/SearchApiOrganisationClient.ts +42 -0
- package/src/programmes/IProgrammeSearchFilters.ts +28 -0
- package/src/programmes/IProgrammeSearchResponse.ts +5 -0
- package/src/programmes/ProgrammeSearchFilters.ts +60 -0
- package/src/programmes/ProgrammeSearchInput.ts +33 -0
- package/src/programmes/SearchApiProgrammeClient.ts +42 -0
- package/src/programmes/TuitionFeeFilterValueDTO.ts +4 -0
- package/tsconfig.json +47 -0
- package/index.js.map +0 -1
- package/src/organisations/SearchApiClientBase.js.map +0 -1
- /package/{src/organisations → bin/src}/SearchApiClientBase.d.ts +0 -0
- /package/{src/organisations → bin/src}/SearchApiClientBase.js +0 -0
- /package/{src → bin/src}/organisations/DegreeTypeEnum.d.ts +0 -0
- /package/{src → bin/src}/organisations/DeliveryMethodEnum.d.ts +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchFilters.d.ts +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchFilters.js +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchFilters.js.map +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchResponse.d.ts +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchResponse.js +0 -0
- /package/{src → bin/src}/organisations/IOrganisationSearchResponse.js.map +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchFilters.d.ts +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchFilters.js +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchFilters.js.map +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchInput.d.ts +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchInput.js +0 -0
- /package/{src → bin/src}/organisations/OrganisationSearchInput.js.map +0 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**/bin/**
|
package/.eslintrc.yml
ADDED
|
@@ -5,4 +5,9 @@ import { IOrganisationSearchResponse } from "./src/organisations/IOrganisationSe
|
|
|
5
5
|
import { OrganisationSearchFilters } from "./src/organisations/OrganisationSearchFilters";
|
|
6
6
|
import { OrganisationSearchInput } from "./src/organisations/OrganisationSearchInput";
|
|
7
7
|
import { SearchApiOrganisationClient } from "./src/organisations/SearchApiOrganisationClient";
|
|
8
|
-
|
|
8
|
+
import { IProgrammeSearchFilters } from "./src/programmes/IProgrammeSearchFilters";
|
|
9
|
+
import { IProgrammeSearchResponse } from "./src/programmes/IProgrammeSearchResponse";
|
|
10
|
+
import { ProgrammeSearchFilters } from "./src/programmes/ProgrammeSearchFilters";
|
|
11
|
+
import { ProgrammeSearchInput } from "./src/programmes/ProgrammeSearchInput";
|
|
12
|
+
import { SearchApiProgrammeClient } from "./src/programmes/SearchApiProgrammeClient";
|
|
13
|
+
export { SearchApiOrganisationClient, IOrganisationSearchResponse, IOrganisationSearchFilters, OrganisationSearchFilters, SearchApiProgrammeClient, IProgrammeSearchResponse, IProgrammeSearchFilters, ProgrammeSearchFilters, OrganisationSearchInput, ProgrammeSearchInput, DegreeTypeEnum, DeliveryMethodEnum };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeliveryMethodEnum = exports.DegreeTypeEnum = exports.OrganisationSearchFilters = exports.IOrganisationSearchFilters = exports.SearchApiOrganisationClient = void 0;
|
|
3
|
+
exports.DeliveryMethodEnum = exports.DegreeTypeEnum = exports.ProgrammeSearchFilters = exports.IProgrammeSearchFilters = exports.SearchApiProgrammeClient = exports.OrganisationSearchFilters = exports.IOrganisationSearchFilters = exports.SearchApiOrganisationClient = void 0;
|
|
4
4
|
const DegreeTypeEnum_1 = require("./src/organisations/DegreeTypeEnum");
|
|
5
5
|
Object.defineProperty(exports, "DegreeTypeEnum", { enumerable: true, get: function () { return DegreeTypeEnum_1.DegreeTypeEnum; } });
|
|
6
6
|
const DeliveryMethodEnum_1 = require("./src/organisations/DeliveryMethodEnum");
|
|
@@ -11,4 +11,10 @@ const OrganisationSearchFilters_1 = require("./src/organisations/OrganisationSea
|
|
|
11
11
|
Object.defineProperty(exports, "OrganisationSearchFilters", { enumerable: true, get: function () { return OrganisationSearchFilters_1.OrganisationSearchFilters; } });
|
|
12
12
|
const SearchApiOrganisationClient_1 = require("./src/organisations/SearchApiOrganisationClient");
|
|
13
13
|
Object.defineProperty(exports, "SearchApiOrganisationClient", { enumerable: true, get: function () { return SearchApiOrganisationClient_1.SearchApiOrganisationClient; } });
|
|
14
|
+
const IProgrammeSearchFilters_1 = require("./src/programmes/IProgrammeSearchFilters");
|
|
15
|
+
Object.defineProperty(exports, "IProgrammeSearchFilters", { enumerable: true, get: function () { return IProgrammeSearchFilters_1.IProgrammeSearchFilters; } });
|
|
16
|
+
const ProgrammeSearchFilters_1 = require("./src/programmes/ProgrammeSearchFilters");
|
|
17
|
+
Object.defineProperty(exports, "ProgrammeSearchFilters", { enumerable: true, get: function () { return ProgrammeSearchFilters_1.ProgrammeSearchFilters; } });
|
|
18
|
+
const SearchApiProgrammeClient_1 = require("./src/programmes/SearchApiProgrammeClient");
|
|
19
|
+
Object.defineProperty(exports, "SearchApiProgrammeClient", { enumerable: true, get: function () { return SearchApiProgrammeClient_1.SearchApiProgrammeClient; } });
|
|
14
20
|
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AA2BnE,+FA3BQ,+BAAc,OA2BR;AA1Bf,+EAA4E;AA2B3E,mGA3BQ,uCAAkB,OA2BR;AA1BnB,+FAA4F;AAc3F,2GAdQ,uDAA0B,OAcR;AAZ3B,6FAA0F;AAazF,0GAbQ,qDAAyB,OAaR;AAX1B,iGAA8F;AAQ7F,4GARQ,yDAA2B,OAQR;AAP5B,sFAAmF;AAclF,wGAdQ,iDAAuB,OAcR;AAZxB,oFAAiF;AAahF,uGAbQ,+CAAsB,OAaR;AAXvB,wFAAqF;AAQpF,yGARQ,mDAAwB,OAQR"}
|
package/bin/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@studyportals/search-api-interface",
|
|
3
|
+
"version": "1.2.2-1",
|
|
4
|
+
"description": "Typescript library containing resources that facilitate integration with SearchApi",
|
|
5
|
+
"main": "bin/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"compile": "rm -fR bin && npx tsc",
|
|
8
|
+
"deploy-patch": "npm version patch && npm run deploy",
|
|
9
|
+
"deploy-minor": "npm version minor && npm run deploy",
|
|
10
|
+
"deploy-major": "npm version major && npm run deploy",
|
|
11
|
+
"deploy-beta": "npm version prerelease && npm run prepare-deployment && npm publish ./bin --tag beta",
|
|
12
|
+
"deploy": "npm run prepare-deployment && npm publish ./bin",
|
|
13
|
+
"prepare-deployment": "npm run compile && cp package.json bin/package.json",
|
|
14
|
+
"lint": "eslint . --ext .ts",
|
|
15
|
+
"lint:fix": "eslint . --ext .ts --fix"
|
|
16
|
+
},
|
|
17
|
+
"author": "Seal Team Six",
|
|
18
|
+
"license": "BSD-3-Clause",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@studyportals/code-style": "^1.7.0",
|
|
21
|
+
"@types/superagent": "^4.1.15",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
23
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
24
|
+
"eslint": "^8.17.0",
|
|
25
|
+
"typescript": "^4.7.3",
|
|
26
|
+
"typescript-transform-paths": "^3.4.6"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@studyportals/search-filters": "^4.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchApiClientBase.js","sourceRoot":"","sources":["../../src/SearchApiClientBase.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC/B,YAAoC,MAAc,EAChC,UAAkB;QADA,WAAM,GAAN,MAAM,CAAQ;QAChC,eAAU,GAAV,UAAU,CAAQ;IAEpC,CAAC;IAES,YAAY,CAAC,WAAmB;QACzC,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;IAC3D,CAAC;CACD;AATD,kDASC"}
|
|
@@ -8,5 +8,5 @@ var DegreeTypeEnum;
|
|
|
8
8
|
DegreeTypeEnum[DegreeTypeEnum["PHD"] = 2] = "PHD";
|
|
9
9
|
DegreeTypeEnum[DegreeTypeEnum["DISTANCE_LEARNING"] = 3] = "DISTANCE_LEARNING";
|
|
10
10
|
DegreeTypeEnum[DegreeTypeEnum["SHORT_COURSES"] = 4] = "SHORT_COURSES";
|
|
11
|
-
})(DegreeTypeEnum
|
|
11
|
+
})(DegreeTypeEnum = exports.DegreeTypeEnum || (exports.DegreeTypeEnum = {}));
|
|
12
12
|
//# sourceMappingURL=DegreeTypeEnum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DegreeTypeEnum.js","sourceRoot":"","sources":["../../../src/organisations/DegreeTypeEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,uDAAU,CAAA;IACV,2DAAY,CAAA;IACZ,iDAAO,CAAA;IACP,6EAAqB,CAAA;IACrB,qEAAiB,CAAA;AAClB,CAAC,EANW,cAAc,
|
|
1
|
+
{"version":3,"file":"DegreeTypeEnum.js","sourceRoot":"","sources":["../../../src/organisations/DegreeTypeEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,uDAAU,CAAA;IACV,2DAAY,CAAA;IACZ,iDAAO,CAAA;IACP,6EAAqB,CAAA;IACrB,qEAAiB,CAAA;AAClB,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB"}
|
|
@@ -6,5 +6,5 @@ var DeliveryMethodEnum;
|
|
|
6
6
|
DeliveryMethodEnum["ONLINE"] = "online";
|
|
7
7
|
DeliveryMethodEnum["ON_CAMPUS"] = "oncampus";
|
|
8
8
|
DeliveryMethodEnum["BLENDED"] = "blended";
|
|
9
|
-
})(DeliveryMethodEnum
|
|
9
|
+
})(DeliveryMethodEnum = exports.DeliveryMethodEnum || (exports.DeliveryMethodEnum = {}));
|
|
10
10
|
//# sourceMappingURL=DeliveryMethodEnum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeliveryMethodEnum.js","sourceRoot":"","sources":["../../../src/organisations/DeliveryMethodEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC7B,uCAAiB,CAAA;IACjB,4CAAsB,CAAA;IACtB,yCAAmB,CAAA;AACpB,CAAC,EAJW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"DeliveryMethodEnum.js","sourceRoot":"","sources":["../../../src/organisations/DeliveryMethodEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC7B,uCAAiB,CAAA;IACjB,4CAAsB,CAAA;IACtB,yCAAmB,CAAA;AACpB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchApiClientBase } from "
|
|
1
|
+
import { SearchApiClientBase } from "../SearchApiClientBase";
|
|
2
2
|
import { IRequestSender, ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
|
|
3
3
|
import { IOrganisationCard } from "@studyportals/domain-client";
|
|
4
4
|
import { IOrganisationSearchResponse } from "./IOrganisationSearchResponse";
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SearchApiOrganisationClient = void 0;
|
|
13
|
-
const SearchApiClientBase_1 = require("
|
|
13
|
+
const SearchApiClientBase_1 = require("../SearchApiClientBase");
|
|
14
14
|
const domain_client_1 = require("@studyportals/domain-client");
|
|
15
15
|
class SearchApiOrganisationClient extends SearchApiClientBase_1.SearchApiClientBase {
|
|
16
16
|
constructor(apiUriBase, requestFactory, requestSender) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchApiOrganisationClient.js","sourceRoot":"","sources":["../../../src/organisations/SearchApiOrganisationClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"SearchApiOrganisationClient.js","sourceRoot":"","sources":["../../../src/organisations/SearchApiOrganisationClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA6D;AAE7D,+DAAwF;AAIxF,MAAa,2BAA4B,SAAQ,yCAAmB;IAMnE,YAAmB,UAAkB,EACpC,cAAyC,EACzC,aAA6B;QAE7B,KAAK,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QANnB,4BAAuB,GAAG,IAAI,sCAAsB,EAAE,CAAC;QAQvE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,uBAAuB,GAAG,IAAI,sCAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEY,WAAW,CAAC,OAAY,EAAE,UAAkB,EAAE,YAAoB;;YAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;iBAClE,KAAK,iCAAM,OAAO,KAAE,UAAU,EAAE,YAAY,IAAG,CAAC;YAElD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAiD,OAAO,CAAC,CAAC;YAEpH,uCACI,MAAM,KACT,aAAa,EAAE,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,IACvF;QACF,CAAC;KAAA;IAEY,SAAS,CAAC,OAAY,EAAE,UAAkB,EAAE,YAAoB;;YAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;iBACtE,KAAK,iCAAM,OAAO,KAAE,UAAU,EAAE,YAAY,IAAG,CAAC;YAElD,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAsC,OAAO,CAAC,CAAC;QAClG,CAAC;KAAA;CACD;AAnCD,kEAmCC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, DurationFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters";
|
|
2
|
+
import { TuitionFeeFilterValueDTO } from "./TuitionFeeFilterValueDTO";
|
|
3
|
+
export declare class IProgrammeSearchFilters {
|
|
4
|
+
readonly attendances?: AttendanceFilterOptionValue[];
|
|
5
|
+
readonly degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
6
|
+
readonly disciplines?: string[];
|
|
7
|
+
readonly durations?: DurationFilterOptionValue[];
|
|
8
|
+
readonly educationalLevels?: EducationLevelFilterOptionValue[];
|
|
9
|
+
readonly educationalForms?: EducationalFormFilterOptionValue[];
|
|
10
|
+
readonly keyword?: string;
|
|
11
|
+
readonly areaIds?: string[];
|
|
12
|
+
readonly regionIds?: string[];
|
|
13
|
+
readonly countryIsoCodes?: string[];
|
|
14
|
+
readonly organisationId?: string;
|
|
15
|
+
readonly specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
16
|
+
readonly tuitionFee?: TuitionFeeFilterValueDTO;
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IProgrammeSearchFilters = void 0;
|
|
4
|
+
class IProgrammeSearchFilters {
|
|
5
|
+
}
|
|
6
|
+
exports.IProgrammeSearchFilters = IProgrammeSearchFilters;
|
|
7
|
+
//# sourceMappingURL=IProgrammeSearchFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/IProgrammeSearchFilters.ts"],"names":[],"mappings":";;;AAWA,MAAa,uBAAuB;CAgBnC;AAhBD,0DAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IProgrammeSearchResponse.js","sourceRoot":"","sources":["../../../src/programmes/IProgrammeSearchResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IProgrammeSearchFilters } from "./IProgrammeSearchFilters";
|
|
2
|
+
import { ProgrammeSearchInput } from "./ProgrammeSearchInput";
|
|
3
|
+
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, DurationFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters";
|
|
4
|
+
export declare class ProgrammeSearchFilters implements IProgrammeSearchFilters {
|
|
5
|
+
attendances?: AttendanceFilterOptionValue[];
|
|
6
|
+
degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
7
|
+
disciplines?: string[];
|
|
8
|
+
durations?: DurationFilterOptionValue[];
|
|
9
|
+
educationalLevels?: EducationLevelFilterOptionValue[];
|
|
10
|
+
educationalForms?: EducationalFormFilterOptionValue[];
|
|
11
|
+
keyword?: string;
|
|
12
|
+
areaIds?: string[];
|
|
13
|
+
regionIds?: string[];
|
|
14
|
+
countryIsoCodes?: string[];
|
|
15
|
+
organisationId?: string;
|
|
16
|
+
specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
17
|
+
tuitionFee?: {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
};
|
|
21
|
+
from(input: ProgrammeSearchInput): IProgrammeSearchFilters;
|
|
22
|
+
private numbersToStringsOrUndefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProgrammeSearchFilters = void 0;
|
|
4
|
+
class ProgrammeSearchFilters {
|
|
5
|
+
from(input) {
|
|
6
|
+
this.attendances = input.attendances;
|
|
7
|
+
this.degreeTypes = input.degreeTypes;
|
|
8
|
+
this.disciplines = this.numbersToStringsOrUndefined(input.disciplines);
|
|
9
|
+
this.durations = input.durations;
|
|
10
|
+
this.educationalLevels = input.educationalLevels;
|
|
11
|
+
this.educationalForms = input.educationalForms;
|
|
12
|
+
this.keyword = input.keyword;
|
|
13
|
+
this.areaIds = this.numbersToStringsOrUndefined(input.areaIds);
|
|
14
|
+
this.regionIds = this.numbersToStringsOrUndefined(input.regionIds);
|
|
15
|
+
this.countryIsoCodes = input.countryIsoCodes;
|
|
16
|
+
this.organisationId = input.organisationId ? input.organisationId.toString() : undefined;
|
|
17
|
+
this.specialProgrammes = input.specialProgrammes;
|
|
18
|
+
this.tuitionFee = input.tuitionFee;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
numbersToStringsOrUndefined(values) {
|
|
22
|
+
if (values === undefined)
|
|
23
|
+
return;
|
|
24
|
+
return values.map(value => value.toString());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ProgrammeSearchFilters = ProgrammeSearchFilters;
|
|
28
|
+
//# sourceMappingURL=ProgrammeSearchFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/ProgrammeSearchFilters.ts"],"names":[],"mappings":";;;AAcA,MAAa,sBAAsB;IAoB3B,IAAI,CAAC,KAA2B;QACtC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAE7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAE7C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACzF,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAA;QAEhD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QAEnC,OAAO,IAAI,CAAC;IACb,CAAC;IAEO,2BAA2B,CAAC,MAA4B;QAC/D,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;CACD;AA7CD,wDA6CC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, DurationFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters";
|
|
2
|
+
import { TuitionFeeFilterValueDTO } from "./TuitionFeeFilterValueDTO";
|
|
3
|
+
export type ProgrammeSearchInput = {
|
|
4
|
+
resultSize: number;
|
|
5
|
+
resultOffset: number;
|
|
6
|
+
attendances?: AttendanceFilterOptionValue[];
|
|
7
|
+
degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
8
|
+
disciplines?: number[];
|
|
9
|
+
durations?: DurationFilterOptionValue[];
|
|
10
|
+
educationalLevels?: EducationLevelFilterOptionValue[];
|
|
11
|
+
educationalForms?: EducationalFormFilterOptionValue[];
|
|
12
|
+
keyword: string;
|
|
13
|
+
areaIds?: number[];
|
|
14
|
+
regionIds?: number[];
|
|
15
|
+
countryIsoCodes?: string[];
|
|
16
|
+
organisationId?: number;
|
|
17
|
+
specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
18
|
+
tuitionFee?: TuitionFeeFilterValueDTO;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgrammeSearchInput.js","sourceRoot":"","sources":["../../../src/programmes/ProgrammeSearchInput.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SearchApiClientBase } from "../SearchApiClientBase";
|
|
2
|
+
import { IRequestSender, ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
|
|
3
|
+
import { IProgrammeCard } from "@studyportals/domain-client";
|
|
4
|
+
import { IProgrammeSearchResponse } from "./IProgrammeSearchResponse";
|
|
5
|
+
export declare class SearchApiProgrammeClient extends SearchApiClientBase {
|
|
6
|
+
private readonly requestFactory;
|
|
7
|
+
private readonly requestSender;
|
|
8
|
+
private readonly organisationCardFactory;
|
|
9
|
+
constructor(apiUriBase: string, requestFactory: ISuperAgentRequestFactory, requestSender: IRequestSender);
|
|
10
|
+
searchCards(filters: any, resultSize: number, resultOffset: number): Promise<IProgrammeSearchResponse<IProgrammeCard>>;
|
|
11
|
+
searchIds(filters: any, resultSize: number, resultOffset: number): Promise<IProgrammeSearchResponse<string>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchApiProgrammeClient = void 0;
|
|
13
|
+
const SearchApiClientBase_1 = require("../SearchApiClientBase");
|
|
14
|
+
const domain_client_1 = require("@studyportals/domain-client");
|
|
15
|
+
class SearchApiProgrammeClient extends SearchApiClientBase_1.SearchApiClientBase {
|
|
16
|
+
constructor(apiUriBase, requestFactory, requestSender) {
|
|
17
|
+
super("organisations", apiUriBase);
|
|
18
|
+
this.organisationCardFactory = new domain_client_1.ProgrammeCardClient();
|
|
19
|
+
this.requestFactory = requestFactory;
|
|
20
|
+
this.requestSender = requestSender;
|
|
21
|
+
this.organisationCardFactory = new domain_client_1.ProgrammeCardClient("N/A", "N/A", 1);
|
|
22
|
+
}
|
|
23
|
+
searchCards(filters, resultSize, resultOffset) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const request = this.requestFactory.get(this.constructUri("search"))
|
|
26
|
+
.query(Object.assign(Object.assign({}, filters), { resultSize, resultOffset }));
|
|
27
|
+
const result = yield this.requestSender.sendAndExtractBody(request);
|
|
28
|
+
return Object.assign(Object.assign({}, result), { programmes: this.organisationCardFactory.fromDescriptions([...result.programmes]) });
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
searchIds(filters, resultSize, resultOffset) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const request = this.requestFactory.get(this.constructUri("search/ids"))
|
|
34
|
+
.query(Object.assign(Object.assign({}, filters), { resultSize, resultOffset }));
|
|
35
|
+
return yield this.requestSender.sendAndExtractBody(request);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.SearchApiProgrammeClient = SearchApiProgrammeClient;
|
|
40
|
+
//# sourceMappingURL=SearchApiProgrammeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchApiProgrammeClient.js","sourceRoot":"","sources":["../../../src/programmes/SearchApiProgrammeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA6D;AAG7D,+DAAkF;AAGlF,MAAa,wBAAyB,SAAQ,yCAAmB;IAMhE,YAAmB,UAAkB,EACpC,cAAyC,EACzC,aAA6B;QAE7B,KAAK,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QANnB,4BAAuB,GAAG,IAAI,mCAAmB,EAAE,CAAC;QAQpE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,uBAAuB,GAAG,IAAI,mCAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;IAEY,WAAW,CAAC,OAAY,EAAE,UAAkB,EAAE,YAAoB;;YAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;iBAClE,KAAK,iCAAM,OAAO,KAAE,UAAU,EAAE,YAAY,IAAG,CAAC;YAElD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAA8C,OAAO,CAAC,CAAC;YAEjH,uCACI,MAAM,KACT,UAAU,EAAE,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,IACjF;QACF,CAAC;KAAA;IAEY,SAAS,CAAC,OAAY,EAAE,UAAkB,EAAE,YAAoB;;YAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;iBACtE,KAAK,iCAAM,OAAO,KAAE,UAAU,EAAE,YAAY,IAAG,CAAC;YAElD,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAmC,OAAO,CAAC,CAAC;QAC/F,CAAC;KAAA;CACD;AAnCD,4DAmCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuitionFeeFilterValueDTO.js","sourceRoot":"","sources":["../../../src/programmes/TuitionFeeFilterValueDTO.ts"],"names":[],"mappings":""}
|
package/index.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DegreeTypeEnum } from "./src/organisations/DegreeTypeEnum";
|
|
2
|
+
import { DeliveryMethodEnum } from "./src/organisations/DeliveryMethodEnum";
|
|
3
|
+
import { IOrganisationSearchFilters } from "./src/organisations/IOrganisationSearchFilters";
|
|
4
|
+
import { IOrganisationSearchResponse } from "./src/organisations/IOrganisationSearchResponse";
|
|
5
|
+
import { OrganisationSearchFilters } from "./src/organisations/OrganisationSearchFilters";
|
|
6
|
+
import { OrganisationSearchInput } from "./src/organisations/OrganisationSearchInput";
|
|
7
|
+
import { SearchApiOrganisationClient } from "./src/organisations/SearchApiOrganisationClient";
|
|
8
|
+
import { IProgrammeSearchFilters } from "./src/programmes/IProgrammeSearchFilters";
|
|
9
|
+
import { IProgrammeSearchResponse } from "./src/programmes/IProgrammeSearchResponse";
|
|
10
|
+
import { ProgrammeSearchFilters } from "./src/programmes/ProgrammeSearchFilters";
|
|
11
|
+
import { ProgrammeSearchInput } from "./src/programmes/ProgrammeSearchInput";
|
|
12
|
+
import { SearchApiProgrammeClient } from "./src/programmes/SearchApiProgrammeClient";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SearchApiOrganisationClient,
|
|
16
|
+
IOrganisationSearchResponse,
|
|
17
|
+
IOrganisationSearchFilters,
|
|
18
|
+
OrganisationSearchFilters,
|
|
19
|
+
|
|
20
|
+
SearchApiProgrammeClient,
|
|
21
|
+
IProgrammeSearchResponse,
|
|
22
|
+
IProgrammeSearchFilters,
|
|
23
|
+
ProgrammeSearchFilters,
|
|
24
|
+
|
|
25
|
+
OrganisationSearchInput,
|
|
26
|
+
ProgrammeSearchInput,
|
|
27
|
+
|
|
28
|
+
DegreeTypeEnum,
|
|
29
|
+
DeliveryMethodEnum
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@studyportals/search-api-interface",
|
|
3
|
-
"version": "1.2.1",
|
|
4
|
-
"description": "Typescript library containing resources that facilitate integration with SearchApi",
|
|
5
|
-
"main": "bin/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"compile": "rm -fR bin && npx tsc",
|
|
8
|
-
"deploy-patch": "npm version patch && npm run deploy",
|
|
9
|
-
"deploy-minor": "npm version minor && npm run deploy",
|
|
10
|
-
"deploy-major": "npm version major && npm run deploy",
|
|
11
|
-
"deploy-beta": "npm version prerelease && npm run prepare-deployment && npm publish ./bin --tag beta",
|
|
12
|
-
"deploy": "npm run prepare-deployment && npm publish ./bin",
|
|
13
|
-
"prepare-deployment": "npm run compile && cp package.json bin/package.json",
|
|
14
|
-
"lint": "eslint . --ext .ts",
|
|
15
|
-
"lint:fix": "eslint . --ext .ts --fix"
|
|
16
|
-
},
|
|
17
|
-
"author": "Seal Team Six",
|
|
18
|
-
"license": "BSD-3-Clause",
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@studyportals/code-style": "^1.7.0",
|
|
21
|
-
"@types/superagent": "^4.1.15",
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
23
|
-
"@typescript-eslint/parser": "^5.27.0",
|
|
24
|
-
"eslint": "^8.17.0",
|
|
25
|
-
"typescript": "^4.7.3",
|
|
26
|
-
"typescript-transform-paths": "^3.4.6"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@studyportals/search-api-interface",
|
|
3
|
+
"version": "1.2.2-1",
|
|
4
|
+
"description": "Typescript library containing resources that facilitate integration with SearchApi",
|
|
5
|
+
"main": "bin/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"compile": "rm -fR bin && npx tsc",
|
|
8
|
+
"deploy-patch": "npm version patch && npm run deploy",
|
|
9
|
+
"deploy-minor": "npm version minor && npm run deploy",
|
|
10
|
+
"deploy-major": "npm version major && npm run deploy",
|
|
11
|
+
"deploy-beta": "npm version prerelease && npm run prepare-deployment && npm publish ./bin --tag beta",
|
|
12
|
+
"deploy": "npm run prepare-deployment && npm publish ./bin",
|
|
13
|
+
"prepare-deployment": "npm run compile && cp package.json bin/package.json",
|
|
14
|
+
"lint": "eslint . --ext .ts",
|
|
15
|
+
"lint:fix": "eslint . --ext .ts --fix"
|
|
16
|
+
},
|
|
17
|
+
"author": "Seal Team Six",
|
|
18
|
+
"license": "BSD-3-Clause",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@studyportals/code-style": "^1.7.0",
|
|
21
|
+
"@types/superagent": "^4.1.15",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
23
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
24
|
+
"eslint": "^8.17.0",
|
|
25
|
+
"typescript": "^4.7.3",
|
|
26
|
+
"typescript-transform-paths": "^3.4.6"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@studyportals/search-filters": "^4.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class SearchApiClientBase {
|
|
2
|
+
public constructor(private readonly domain: string,
|
|
3
|
+
private readonly apiUriBase: string
|
|
4
|
+
) {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
protected constructUri(relativeUri: string): string {
|
|
8
|
+
return `${this.apiUriBase}/${this.domain}/${relativeUri}`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DegreeTypeEnum } from "./DegreeTypeEnum";
|
|
2
|
+
import { DeliveryMethodEnum } from "./DeliveryMethodEnum";
|
|
3
|
+
|
|
4
|
+
export class IOrganisationSearchFilters {
|
|
5
|
+
readonly organisationId: string | undefined;
|
|
6
|
+
readonly degree: DegreeTypeEnum | undefined;
|
|
7
|
+
readonly disciplines: string[] | undefined;
|
|
8
|
+
readonly deliveryMethods: DeliveryMethodEnum[] | undefined;
|
|
9
|
+
readonly countryIsoCodes: string[] | undefined;
|
|
10
|
+
readonly regionIds: string[] | undefined;
|
|
11
|
+
readonly areaIds: string[] | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DegreeTypeEnum } from "./DegreeTypeEnum";
|
|
2
|
+
import { DeliveryMethodEnum } from "./DeliveryMethodEnum";
|
|
3
|
+
import { OrganisationSearchInput } from "./OrganisationSearchInput";
|
|
4
|
+
import { IOrganisationSearchFilters } from "./IOrganisationSearchFilters";
|
|
5
|
+
|
|
6
|
+
export class OrganisationSearchFilters implements IOrganisationSearchFilters {
|
|
7
|
+
public organisationId: string | undefined;
|
|
8
|
+
public degree: DegreeTypeEnum | undefined;
|
|
9
|
+
public disciplines: string[] | undefined;
|
|
10
|
+
public deliveryMethods: DeliveryMethodEnum[] | undefined;
|
|
11
|
+
public countryIsoCodes: string[] | undefined;
|
|
12
|
+
public regionIds: string[] | undefined;
|
|
13
|
+
public areaIds: string[] | undefined;
|
|
14
|
+
|
|
15
|
+
public from(input: OrganisationSearchInput): OrganisationSearchFilters {
|
|
16
|
+
this.organisationId = input.organisationId ? input.organisationId.toString() : undefined;
|
|
17
|
+
this.degree = input.degree;
|
|
18
|
+
this.deliveryMethods = input.deliveryMethods;
|
|
19
|
+
this.disciplines = this.numbersToStringsOrUndefined(input.disciplines);
|
|
20
|
+
this.countryIsoCodes = input.countryIsoCodes;
|
|
21
|
+
this.regionIds = this.numbersToStringsOrUndefined(input.regionIds);
|
|
22
|
+
this.areaIds = this.numbersToStringsOrUndefined(input.areaIds);
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public consideringId(id: string): OrganisationSearchFilters {
|
|
27
|
+
this.organisationId = id;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public consideringDegree(degree: DegreeTypeEnum): OrganisationSearchFilters {
|
|
32
|
+
this.degree = degree;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public consideringDisciplines(disciplines: string[]): OrganisationSearchFilters {
|
|
37
|
+
this.disciplines = disciplines;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public consideringDeliveryMethods(deliveryMethods: DeliveryMethodEnum[]): OrganisationSearchFilters {
|
|
42
|
+
this.deliveryMethods = deliveryMethods;
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public consideringCountryIsoCodes(countryIsoCodes: string[]): OrganisationSearchFilters {
|
|
47
|
+
this.countryIsoCodes = countryIsoCodes;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public consideringRegionIds(regionIds: string[]): OrganisationSearchFilters {
|
|
52
|
+
this.regionIds = regionIds;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public consideringAreaIds(areaIds: string[]): OrganisationSearchFilters {
|
|
57
|
+
this.areaIds = areaIds;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private numbersToStringsOrUndefined(values: number[] | undefined): string[] | undefined {
|
|
62
|
+
if (values === undefined) return;
|
|
63
|
+
return values.map(value => value.toString());
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DegreeTypeEnum } from "./DegreeTypeEnum";
|
|
2
|
+
import { DeliveryMethodEnum } from "./DeliveryMethodEnum";
|
|
3
|
+
|
|
4
|
+
export type OrganisationSearchInput = {
|
|
5
|
+
resultSize: number,
|
|
6
|
+
resultOffset: number,
|
|
7
|
+
organisationId?: number,
|
|
8
|
+
disciplines?: number[],
|
|
9
|
+
countryIsoCodes?: string[],
|
|
10
|
+
regionIds?: number[],
|
|
11
|
+
areaIds?: number[],
|
|
12
|
+
degree?: DegreeTypeEnum,
|
|
13
|
+
deliveryMethods?: DeliveryMethodEnum[]
|
|
14
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SearchApiClientBase } from "../SearchApiClientBase";
|
|
2
|
+
import { IRequestSender, ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
|
|
3
|
+
import { IOrganisationCard, OrganisationCardClient } from "@studyportals/domain-client";
|
|
4
|
+
import { IOrganisationSearchResponse } from "./IOrganisationSearchResponse";
|
|
5
|
+
import { IModelDescription } from "@studyportals/domain-client/src/i-model-description";
|
|
6
|
+
|
|
7
|
+
export class SearchApiOrganisationClient extends SearchApiClientBase {
|
|
8
|
+
|
|
9
|
+
private readonly requestFactory: ISuperAgentRequestFactory;
|
|
10
|
+
private readonly requestSender: IRequestSender;
|
|
11
|
+
private readonly organisationCardFactory = new OrganisationCardClient();
|
|
12
|
+
|
|
13
|
+
public constructor(apiUriBase: string,
|
|
14
|
+
requestFactory: ISuperAgentRequestFactory,
|
|
15
|
+
requestSender: IRequestSender
|
|
16
|
+
) {
|
|
17
|
+
super("organisations", apiUriBase);
|
|
18
|
+
|
|
19
|
+
this.requestFactory = requestFactory;
|
|
20
|
+
this.requestSender = requestSender;
|
|
21
|
+
this.organisationCardFactory = new OrganisationCardClient("N/A", "N/A", 1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async searchCards(filters: any, resultSize: number, resultOffset: number): Promise<IOrganisationSearchResponse<IOrganisationCard>> {
|
|
25
|
+
const request = this.requestFactory.get(this.constructUri("search"))
|
|
26
|
+
.query({ ...filters, resultSize, resultOffset });
|
|
27
|
+
|
|
28
|
+
const result = await this.requestSender.sendAndExtractBody<IOrganisationSearchResponse<IModelDescription>>(request);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
...result,
|
|
32
|
+
organisations: this.organisationCardFactory.fromDescriptions([...result.organisations])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public async searchIds(filters: any, resultSize: number, resultOffset: number): Promise<IOrganisationSearchResponse<string>> {
|
|
37
|
+
const request = this.requestFactory.get(this.constructUri("search/ids"))
|
|
38
|
+
.query({ ...filters, resultSize, resultOffset });
|
|
39
|
+
|
|
40
|
+
return await this.requestSender.sendAndExtractBody<IOrganisationSearchResponse<string>>(request);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AttendanceFilterOptionValue,
|
|
3
|
+
DegreeTypeFilterOptionValue,
|
|
4
|
+
DurationFilterOptionValue,
|
|
5
|
+
EducationLevelFilterOptionValue,
|
|
6
|
+
EducationalFormFilterOptionValue,
|
|
7
|
+
SpecialProgrammesFilterOptionValue
|
|
8
|
+
} from "@studyportals/search-filters";
|
|
9
|
+
|
|
10
|
+
import { TuitionFeeFilterValueDTO } from "./TuitionFeeFilterValueDTO";
|
|
11
|
+
|
|
12
|
+
export class IProgrammeSearchFilters {
|
|
13
|
+
readonly attendances?: AttendanceFilterOptionValue[];
|
|
14
|
+
readonly degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
15
|
+
readonly disciplines?: string[];
|
|
16
|
+
readonly durations?: DurationFilterOptionValue[];
|
|
17
|
+
readonly educationalLevels?: EducationLevelFilterOptionValue[];
|
|
18
|
+
readonly educationalForms?: EducationalFormFilterOptionValue[];
|
|
19
|
+
readonly keyword?: string;
|
|
20
|
+
|
|
21
|
+
readonly areaIds?: string[];
|
|
22
|
+
readonly regionIds?: string[];
|
|
23
|
+
readonly countryIsoCodes?: string[];
|
|
24
|
+
readonly organisationId?: string;
|
|
25
|
+
|
|
26
|
+
readonly specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
27
|
+
readonly tuitionFee?: TuitionFeeFilterValueDTO
|
|
28
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IProgrammeSearchFilters } from "./IProgrammeSearchFilters";
|
|
2
|
+
import { ProgrammeSearchInput } from "./ProgrammeSearchInput";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AttendanceFilterOptionValue,
|
|
6
|
+
DegreeTypeFilterOptionValue,
|
|
7
|
+
DurationFilterOptionValue,
|
|
8
|
+
EducationLevelFilterOptionValue,
|
|
9
|
+
EducationalFormFilterOptionValue,
|
|
10
|
+
SpecialProgrammesFilterOptionValue
|
|
11
|
+
} from "@studyportals/search-filters";
|
|
12
|
+
|
|
13
|
+
import { TuitionFeeFilterValueDTO } from "./TuitionFeeFilterValueDTO";
|
|
14
|
+
|
|
15
|
+
export class ProgrammeSearchFilters implements IProgrammeSearchFilters {
|
|
16
|
+
public attendances?: AttendanceFilterOptionValue[];
|
|
17
|
+
public degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
18
|
+
public disciplines?: string[];
|
|
19
|
+
public durations?: DurationFilterOptionValue[];
|
|
20
|
+
public educationalLevels?: EducationLevelFilterOptionValue[];
|
|
21
|
+
public educationalForms?: EducationalFormFilterOptionValue[];
|
|
22
|
+
public keyword?: string;
|
|
23
|
+
|
|
24
|
+
public areaIds?: string[];
|
|
25
|
+
public regionIds?: string[];
|
|
26
|
+
public countryIsoCodes?: string[];
|
|
27
|
+
public organisationId?: string;
|
|
28
|
+
|
|
29
|
+
public specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
30
|
+
public tuitionFee?: {
|
|
31
|
+
min: number
|
|
32
|
+
max: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public from(input: ProgrammeSearchInput): IProgrammeSearchFilters {
|
|
36
|
+
this.attendances = input.attendances;
|
|
37
|
+
this.degreeTypes = input.degreeTypes;
|
|
38
|
+
this.disciplines = this.numbersToStringsOrUndefined(input.disciplines);
|
|
39
|
+
this.durations = input.durations;
|
|
40
|
+
this.educationalLevels = input.educationalLevels;
|
|
41
|
+
this.educationalForms = input.educationalForms;
|
|
42
|
+
this.keyword = input.keyword;
|
|
43
|
+
|
|
44
|
+
this.areaIds = this.numbersToStringsOrUndefined(input.areaIds);
|
|
45
|
+
this.regionIds = this.numbersToStringsOrUndefined(input.regionIds);
|
|
46
|
+
this.countryIsoCodes = input.countryIsoCodes;
|
|
47
|
+
|
|
48
|
+
this.organisationId = input.organisationId ? input.organisationId.toString() : undefined;
|
|
49
|
+
this.specialProgrammes = input.specialProgrammes
|
|
50
|
+
|
|
51
|
+
this.tuitionFee = input.tuitionFee;
|
|
52
|
+
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private numbersToStringsOrUndefined(values: number[] | undefined): string[] | undefined {
|
|
57
|
+
if (values === undefined) return;
|
|
58
|
+
return values.map(value => value.toString());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AttendanceFilterOptionValue,
|
|
3
|
+
DegreeTypeFilterOptionValue,
|
|
4
|
+
DurationFilterOptionValue,
|
|
5
|
+
EducationLevelFilterOptionValue,
|
|
6
|
+
EducationalFormFilterOptionValue,
|
|
7
|
+
SpecialProgrammesFilterOptionValue
|
|
8
|
+
} from "@studyportals/search-filters";
|
|
9
|
+
|
|
10
|
+
import { TuitionFeeFilterValueDTO } from "./TuitionFeeFilterValueDTO";
|
|
11
|
+
|
|
12
|
+
export type ProgrammeSearchInput = {
|
|
13
|
+
resultSize: number,
|
|
14
|
+
resultOffset: number,
|
|
15
|
+
|
|
16
|
+
attendances?: AttendanceFilterOptionValue[],
|
|
17
|
+
degreeTypes?: DegreeTypeFilterOptionValue[],
|
|
18
|
+
disciplines?: number[],
|
|
19
|
+
durations?: DurationFilterOptionValue[],
|
|
20
|
+
educationalLevels?: EducationLevelFilterOptionValue[],
|
|
21
|
+
educationalForms?: EducationalFormFilterOptionValue[]
|
|
22
|
+
|
|
23
|
+
keyword: string
|
|
24
|
+
|
|
25
|
+
areaIds?: number[],
|
|
26
|
+
regionIds?: number[],
|
|
27
|
+
countryIsoCodes?: string[],
|
|
28
|
+
organisationId?: number,
|
|
29
|
+
|
|
30
|
+
specialProgrammes?: SpecialProgrammesFilterOptionValue[]
|
|
31
|
+
tuitionFee?: TuitionFeeFilterValueDTO
|
|
32
|
+
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SearchApiClientBase } from "../SearchApiClientBase";
|
|
2
|
+
import { IRequestSender, ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
|
|
3
|
+
import { IModelDescription } from "@studyportals/domain-client/src/i-model-description";
|
|
4
|
+
import { IProgrammeCard, ProgrammeCardClient } from "@studyportals/domain-client";
|
|
5
|
+
import { IProgrammeSearchResponse } from "./IProgrammeSearchResponse";
|
|
6
|
+
|
|
7
|
+
export class SearchApiProgrammeClient extends SearchApiClientBase {
|
|
8
|
+
|
|
9
|
+
private readonly requestFactory: ISuperAgentRequestFactory;
|
|
10
|
+
private readonly requestSender: IRequestSender;
|
|
11
|
+
private readonly organisationCardFactory = new ProgrammeCardClient();
|
|
12
|
+
|
|
13
|
+
public constructor(apiUriBase: string,
|
|
14
|
+
requestFactory: ISuperAgentRequestFactory,
|
|
15
|
+
requestSender: IRequestSender
|
|
16
|
+
) {
|
|
17
|
+
super("organisations", apiUriBase);
|
|
18
|
+
|
|
19
|
+
this.requestFactory = requestFactory;
|
|
20
|
+
this.requestSender = requestSender;
|
|
21
|
+
this.organisationCardFactory = new ProgrammeCardClient("N/A", "N/A", 1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async searchCards(filters: any, resultSize: number, resultOffset: number): Promise<IProgrammeSearchResponse<IProgrammeCard>> {
|
|
25
|
+
const request = this.requestFactory.get(this.constructUri("search"))
|
|
26
|
+
.query({ ...filters, resultSize, resultOffset });
|
|
27
|
+
|
|
28
|
+
const result = await this.requestSender.sendAndExtractBody<IProgrammeSearchResponse<IModelDescription>>(request);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
...result,
|
|
32
|
+
programmes: this.organisationCardFactory.fromDescriptions([...result.programmes])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public async searchIds(filters: any, resultSize: number, resultOffset: number): Promise<IProgrammeSearchResponse<string>> {
|
|
37
|
+
const request = this.requestFactory.get(this.constructUri("search/ids"))
|
|
38
|
+
.query({ ...filters, resultSize, resultOffset });
|
|
39
|
+
|
|
40
|
+
return await this.requestSender.sendAndExtractBody<IProgrammeSearchResponse<string>>(request);
|
|
41
|
+
}
|
|
42
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "bin",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"rootDirs": [
|
|
6
|
+
"./"
|
|
7
|
+
],
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"alwaysStrict": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"allowUnreachableCode": false,
|
|
13
|
+
"allowUnusedLabels": false,
|
|
14
|
+
"noUnusedLocals": false,
|
|
15
|
+
"noUnusedParameters": false,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitAny": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noImplicitThis": true,
|
|
20
|
+
"sourceMap": true,
|
|
21
|
+
"target": "ES6",
|
|
22
|
+
"module": "commonjs",
|
|
23
|
+
"experimentalDecorators": true,
|
|
24
|
+
"paths": {
|
|
25
|
+
"@/*": [
|
|
26
|
+
"./*"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"plugins": [
|
|
30
|
+
{
|
|
31
|
+
"transform": "typescript-transform-paths"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"transform": "typescript-transform-paths",
|
|
35
|
+
"afterDeclarations": true
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"typeRoots": [
|
|
40
|
+
"node_modules/@types/"
|
|
41
|
+
],
|
|
42
|
+
"exclude": [
|
|
43
|
+
"node_modules",
|
|
44
|
+
"bin",
|
|
45
|
+
".vscode"
|
|
46
|
+
]
|
|
47
|
+
}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AAgBnE,+FAhBQ,+BAAc,OAgBR;AAff,+EAA4E;AAgB3E,mGAhBQ,uCAAkB,OAgBR;AAfnB,+FAA4F;AAS3F,2GATQ,uDAA0B,OASR;AAP3B,6FAA0F;AAQzF,0GARQ,qDAAyB,OAQR;AAN1B,iGAA8F;AAG7F,4GAHQ,yDAA2B,OAGR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchApiClientBase.js","sourceRoot":"","sources":["../../../src/organisations/SearchApiClientBase.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC/B,YAAoC,MAAc,EAChC,UAAkB;QADA,WAAM,GAAN,MAAM,CAAQ;QAChC,eAAU,GAAV,UAAU,CAAQ;IAEpC,CAAC;IAES,YAAY,CAAC,WAAmB;QACzC,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;IAC3D,CAAC;CACD;AATD,kDASC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|