@studyportals/insight-composer-api-interface 1.0.0-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.d.ts +4 -0
- package/index.js +3 -0
- package/index.js.map +1 -0
- package/package.json +29 -0
- package/src/insight-composer-api-client.d.ts +6 -0
- package/src/insight-composer-api-client.js +7 -0
- package/src/insight-composer-api-client.js.map +1 -0
- package/src/programmes/programmes-insights-input.interface.d.ts +24 -0
- package/src/programmes/programmes-insights-input.interface.js +2 -0
- package/src/programmes/programmes-insights-input.interface.js.map +1 -0
- package/src/programmes/programmes-insights.interface.d.ts +5 -0
- package/src/programmes/programmes-insights.interface.js +2 -0
- package/src/programmes/programmes-insights.interface.js.map +1 -0
- package/src/request-base.d.ts +6 -0
- package/src/request-base.js +18 -0
- package/src/request-base.js.map +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InsightComposerApiClient } from "./src/insight-composer-api-client";
|
|
2
|
+
import { IProgrammesInsightsInput } from "./src/programmes/programmes-insights-input.interface";
|
|
3
|
+
import { IProgrammesInsights } from "./src/programmes/programmes-insights.interface";
|
|
4
|
+
export { InsightComposerApiClient, IProgrammesInsightsInput, IProgrammesInsights };
|
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAI7E,OAAO,EACN,wBAAwB,EAGxB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@studyportals/insight-composer-api-interface",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "Typescript library containing resources that facilitate integration with Insight Composer API",
|
|
5
|
+
"main": "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
|
+
"@types/superagent": "^8.1.9",
|
|
21
|
+
"superagent": "^10.2.3",
|
|
22
|
+
"typescript": "^5.9.3"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@studyportals/mb-platform-http-requests": "^2.8.0",
|
|
26
|
+
"@studyportals/search-api-interface": "^3.8.0",
|
|
27
|
+
"@studyportals/search-filters": "^6.3.1"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IProgrammesInsightsInput } from "./programmes/programmes-insights-input.interface";
|
|
2
|
+
import { RequestBase } from "./request-base";
|
|
3
|
+
import { IProgrammesInsights } from "./programmes/programmes-insights.interface";
|
|
4
|
+
export declare class InsightComposerApiClient extends RequestBase {
|
|
5
|
+
getProgrammesInsights(input: IProgrammesInsightsInput): Promise<IProgrammesInsights>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RequestBase } from "./request-base";
|
|
2
|
+
export class InsightComposerApiClient extends RequestBase {
|
|
3
|
+
async getProgrammesInsights(input) {
|
|
4
|
+
return (await this.getRequest(`programmes`, input)).body;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=insight-composer-api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-composer-api-client.js","sourceRoot":"","sources":["../../src/insight-composer-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACxD,KAAK,CAAC,qBAAqB,CAAC,KAA+B;QAC1D,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,KAAK,CAA2B,CAAA,CAAC,IAA2B,CAAC;IAC1G,CAAC;CACD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ProgrammeSortType, TextSearchAlgorithmType } from "@studyportals/search-api-interface";
|
|
2
|
+
import { AttendanceFilterOptionValue, DegreeTypeFilterOptionValue, DurationFilterOptionValue, EducationLevelFilterOptionValue, EducationalFormFilterOptionValue, FormatFilterOptionValue, SpecialProgrammesFilterOptionValue } from "@studyportals/search-filters/server-side";
|
|
3
|
+
export interface IProgrammesInsightsInput {
|
|
4
|
+
readonly attendances?: AttendanceFilterOptionValue[];
|
|
5
|
+
readonly degreeTypes?: DegreeTypeFilterOptionValue[];
|
|
6
|
+
readonly disciplines?: number[];
|
|
7
|
+
readonly durations?: DurationFilterOptionValue[];
|
|
8
|
+
readonly educationalLevels?: EducationLevelFilterOptionValue[];
|
|
9
|
+
readonly educationalForms?: EducationalFormFilterOptionValue[];
|
|
10
|
+
readonly densities?: FormatFilterOptionValue[];
|
|
11
|
+
readonly text?: string;
|
|
12
|
+
readonly areaIds?: number[];
|
|
13
|
+
readonly regionIds?: number[];
|
|
14
|
+
readonly countryIsoCodes?: string[];
|
|
15
|
+
readonly organisationIds?: number[];
|
|
16
|
+
readonly specialProgrammes?: SpecialProgrammesFilterOptionValue[];
|
|
17
|
+
readonly tuitionFeeMin?: number;
|
|
18
|
+
readonly tuitionFeeMax?: number;
|
|
19
|
+
readonly nationalityCountryIso?: string;
|
|
20
|
+
readonly sortBy: ProgrammeSortType;
|
|
21
|
+
readonly suggestionSize?: number;
|
|
22
|
+
readonly campaignTypes?: string[];
|
|
23
|
+
readonly textSearchAlgorithm?: TextSearchAlgorithmType;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"programmes-insights-input.interface.js","sourceRoot":"","sources":["../../../src/programmes/programmes-insights-input.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"programmes-insights.interface.js","sourceRoot":"","sources":["../../../src/programmes/programmes-insights.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as superagent from "superagent";
|
|
2
|
+
export class RequestBase {
|
|
3
|
+
publicUrl;
|
|
4
|
+
constructor(apiUriBase) {
|
|
5
|
+
this.publicUrl = `${apiUriBase}/insights/`;
|
|
6
|
+
}
|
|
7
|
+
async getRequest(relative = "", query = "", apiKey = "") {
|
|
8
|
+
const request = superagent.get(this.buildBaseUrl(relative))
|
|
9
|
+
.set("Content-Type", "application/json")
|
|
10
|
+
.set("x-api-key", apiKey)
|
|
11
|
+
.query(query);
|
|
12
|
+
return await request.send();
|
|
13
|
+
}
|
|
14
|
+
buildBaseUrl(relative) {
|
|
15
|
+
return `${this.publicUrl}${relative}`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=request-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-base.js","sourceRoot":"","sources":["../../src/request-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,MAAM,OAAO,WAAW;IACf,SAAS,CAAS;IAE1B,YAAY,UAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,GAAG,UAAU,YAAY,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAE,QAAsC,EAAE,EAAE,SAAiB,EAAE;QAC3G,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACzD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC;aACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QAEf,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAEO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,SAAS,GAAG,QAAQ,EAAE,CAAC;IACvC,CAAC;CACD"}
|