@studyportals/search-api-interface 1.2.2-9 → 1.2.3-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/package.json +31 -31
- package/src/facets/FacetOptionValue.d.ts +14 -0
- package/src/facets/FacetOptionValue.js +3 -0
- package/src/facets/FacetOptionValue.js.map +1 -0
- package/src/facets/IFacetFilters.d.ts +5 -0
- package/src/facets/IFacetFilters.js +3 -0
- package/src/facets/IFacetFilters.js.map +1 -0
- package/src/facets/IFacetValues.d.ts +6 -0
- package/src/facets/IFacetValues.js +3 -0
- package/src/facets/IFacetValues.js.map +1 -0
- package/src/programmes/IProgrammeSearchFilters.d.ts +3 -0
- package/src/programmes/IProgrammeSearchFilters.js.map +1 -1
- package/src/programmes/ProgrammeSearchFilters.d.ts +5 -0
- package/src/programmes/ProgrammeSearchFilters.js +15 -0
- package/src/programmes/ProgrammeSearchFilters.js.map +1 -1
- package/src/programmes/ProgrammeSearchInput.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@studyportals/search-api-interface",
|
|
3
|
-
"version": "1.2.
|
|
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": "^5.5.4",
|
|
26
|
-
"typescript-transform-paths": "^3.4.6"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@studyportals/search-filters": "4.3.1-5"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@studyportals/search-api-interface",
|
|
3
|
+
"version": "1.2.3-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": "^5.5.4",
|
|
26
|
+
"typescript-transform-paths": "^3.4.6"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@studyportals/search-filters": "4.3.1-5"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum FacetOptionValue {
|
|
2
|
+
ATTENDANCE = "attendances",
|
|
3
|
+
DEGREE_TYPE = "degreeTypes",
|
|
4
|
+
DISCIPLINES = "disciplines",
|
|
5
|
+
DURATIONS = "durations",
|
|
6
|
+
EDUCATIONAL_LEVELS = "educationalLevels",
|
|
7
|
+
EDUCATIONAL_FORMS = "educationalForms",
|
|
8
|
+
AREAS_IDS = "areaIds",
|
|
9
|
+
REGION_IDS = "regionIds",
|
|
10
|
+
COUNTRY_ISO_CODES = "countryIsoCodes",
|
|
11
|
+
ORGANISATIONS_IDS = "organisationIds",
|
|
12
|
+
SPECIAL_PROGRAMMES = "specialProgrammes",
|
|
13
|
+
NATIONALITY_ISO_CODE = "nationalityIsoCode"
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FacetOptionValue.js","sourceRoot":"","sources":["../../../src/facets/FacetOptionValue.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFacetFilters.js","sourceRoot":"","sources":["../../../src/facets/IFacetFilters.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFacetValues.js","sourceRoot":"","sources":["../../../src/facets/IFacetValues.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters/server";
|
|
2
2
|
import { RangeDTO } from "./RangeDTO";
|
|
3
|
+
import { IFacetFilters } from "../facets/IFacetFilters";
|
|
3
4
|
export declare class IProgrammeSearchFilters {
|
|
4
5
|
readonly attendances?: AttendanceFilterOptionValue[];
|
|
5
6
|
readonly degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
@@ -14,4 +15,6 @@ export declare class IProgrammeSearchFilters {
|
|
|
14
15
|
readonly organisationIds?: string[];
|
|
15
16
|
readonly specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
16
17
|
readonly tuitionFee?: RangeDTO;
|
|
18
|
+
readonly nationalityIsoCode?: string;
|
|
19
|
+
readonly facets: IFacetFilters;
|
|
17
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/IProgrammeSearchFilters.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/IProgrammeSearchFilters.ts"],"names":[],"mappings":";;;AAWA,MAAa,uBAAuB;CAoBnC;AApBD,0DAoBC"}
|
|
@@ -2,6 +2,7 @@ import { IProgrammeSearchFilters } from "./IProgrammeSearchFilters";
|
|
|
2
2
|
import { ProgrammeSearchInput } from "./ProgrammeSearchInput";
|
|
3
3
|
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters/server";
|
|
4
4
|
import { RangeDTO } from "./RangeDTO";
|
|
5
|
+
import { IFacetFilters } from "../facets/IFacetFilters";
|
|
5
6
|
export declare class ProgrammeSearchFilters implements IProgrammeSearchFilters {
|
|
6
7
|
attendances?: AttendanceFilterOptionValue[];
|
|
7
8
|
degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
@@ -16,8 +17,12 @@ export declare class ProgrammeSearchFilters implements IProgrammeSearchFilters {
|
|
|
16
17
|
organisationIds?: string[];
|
|
17
18
|
specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
18
19
|
tuitionFee?: RangeDTO;
|
|
20
|
+
nationalityIsoCode?: string;
|
|
21
|
+
facets: IFacetFilters;
|
|
19
22
|
from(input: ProgrammeSearchInput): IProgrammeSearchFilters;
|
|
20
23
|
private parseDurations;
|
|
21
24
|
private parseTuitionFee;
|
|
22
25
|
private numbersToStringsOrUndefined;
|
|
26
|
+
private parseFacets;
|
|
27
|
+
private parseFacetDurations;
|
|
23
28
|
}
|
|
@@ -14,8 +14,10 @@ class ProgrammeSearchFilters {
|
|
|
14
14
|
this.countryIsoCodes = input.countryIsoCodes;
|
|
15
15
|
this.organisationIds = input.organisationIds ? input.organisationIds.map(id => id.toString()) : undefined;
|
|
16
16
|
this.specialProgrammes = input.specialProgrammes;
|
|
17
|
+
this.nationalityIsoCode = input.nationalityIsoCode;
|
|
17
18
|
this.parseDurations(input);
|
|
18
19
|
this.parseTuitionFee(input);
|
|
20
|
+
this.parseFacets(input);
|
|
19
21
|
return this;
|
|
20
22
|
}
|
|
21
23
|
parseDurations(input) {
|
|
@@ -40,6 +42,19 @@ class ProgrammeSearchFilters {
|
|
|
40
42
|
return;
|
|
41
43
|
return values.map(value => value.toString());
|
|
42
44
|
}
|
|
45
|
+
parseFacets(input) {
|
|
46
|
+
this.facets.facets = input.facets.facets;
|
|
47
|
+
this.parseFacetDurations(input);
|
|
48
|
+
}
|
|
49
|
+
parseFacetDurations(input) {
|
|
50
|
+
if (!input.facets.durations)
|
|
51
|
+
return;
|
|
52
|
+
this.facets.durations = [];
|
|
53
|
+
for (const duration of input.facets.durations) {
|
|
54
|
+
const [min, max] = JSON.parse(duration);
|
|
55
|
+
this.facets.durations.push({ min, max });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
43
58
|
}
|
|
44
59
|
exports.ProgrammeSearchFilters = ProgrammeSearchFilters;
|
|
45
60
|
//# sourceMappingURL=ProgrammeSearchFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/ProgrammeSearchFilters.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ProgrammeSearchFilters.js","sourceRoot":"","sources":["../../../src/programmes/ProgrammeSearchFilters.ts"],"names":[],"mappings":";;;AAcA,MAAa,sBAAsB;IAqB3B,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,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,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1G,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;QAEnD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,eAAe,CAAC,KA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KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAC/C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAC,GAAG,EAAE,GAAG,EAAC,CAAC,CAAA;QACvC,CAAC;IACF,CAAC;CACD;AArFD,wDAqFC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, DurationFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters/server";
|
|
2
|
+
import { IFacetValues } from "../facets/IFacetValues";
|
|
2
3
|
export type ProgrammeSearchInput = {
|
|
3
4
|
resultSize: number;
|
|
4
5
|
resultOffset: number;
|
|
@@ -16,4 +17,6 @@ export type ProgrammeSearchInput = {
|
|
|
16
17
|
specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
17
18
|
tuitionFeeMin?: number;
|
|
18
19
|
tuitionFeeMax?: number;
|
|
20
|
+
nationalityIsoCode: string;
|
|
21
|
+
facets: IFacetValues;
|
|
19
22
|
};
|