@studyportals/grogu-api-interface 1.3.0 → 2.1.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.
@@ -1,4 +1,5 @@
1
1
  export declare enum ContentType {
2
2
  UNIVERSITY_SEARCH_STATIC_CONTENT = "university-search-static-content",
3
- UNI_RANKING_SEARCH_STATIC_CONTENT = "uni-ranking-search-static-content"
3
+ UNI_RANKING_SEARCH_STATIC_CONTENT = "uni-ranking-search-static-content",
4
+ PROGRAMME_SEARCH_STATIC_CONTENT = "programme-search-static-content"
4
5
  }
@@ -2,5 +2,6 @@ export var ContentType;
2
2
  (function (ContentType) {
3
3
  ContentType["UNIVERSITY_SEARCH_STATIC_CONTENT"] = "university-search-static-content";
4
4
  ContentType["UNI_RANKING_SEARCH_STATIC_CONTENT"] = "uni-ranking-search-static-content";
5
+ ContentType["PROGRAMME_SEARCH_STATIC_CONTENT"] = "programme-search-static-content";
5
6
  })(ContentType || (ContentType = {}));
6
7
  //# sourceMappingURL=content-type.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-type.enum.js","sourceRoot":"","sources":["../content-type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,oFAAqE,CAAA;IACrE,sFAAuE,CAAA;AACxE,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
1
+ {"version":3,"file":"content-type.enum.js","sourceRoot":"","sources":["../content-type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,oFAAqE,CAAA;IACrE,sFAAuE,CAAA;IACvE,kFAAmE,CAAA;AACpE,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB"}
@@ -2,5 +2,5 @@ import { IContentInput } from "./content-input.interface";
2
2
  import { RequestBase } from "./request-base";
3
3
  export declare class EcsGroguApiClient extends RequestBase {
4
4
  constructor(apiUriBase: string);
5
- getContent(body: IContentInput): Promise<string>;
5
+ getContent(body: IContentInput): Promise<string | null>;
6
6
  }
@@ -6,8 +6,11 @@ export class EcsGroguApiClient extends RequestBase {
6
6
  }
7
7
  async getContent(body) {
8
8
  const result = await this.postRequest(body);
9
+ if (result.statusCode === 204 || !result.body) {
10
+ return null;
11
+ }
9
12
  const resultBody = result.body;
10
- return resultBody.content;
13
+ return resultBody.content ?? null;
11
14
  }
12
15
  }
13
16
  //# sourceMappingURL=ecs-grogu-api-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecs-grogu-api-client.js","sourceRoot":"","sources":["../ecs-grogu-api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAEjD,YAAY,UAAkB;QAC7B,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/D,KAAK,CAAC,GAAG,QAAQ,cAAc,kBAAkB,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAmB;QACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAoC,CAAC;QAC/D,OAAO,UAAU,CAAC,OAAO,CAAC;IAC3B,CAAC;CACD"}
1
+ {"version":3,"file":"ecs-grogu-api-client.js","sourceRoot":"","sources":["../ecs-grogu-api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAEjD,YAAY,UAAkB;QAC7B,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/D,KAAK,CAAC,GAAG,QAAQ,cAAc,kBAAkB,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAmB;QACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAA8C,CAAC;QACzE,OAAO,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC;IACnC,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/grogu-api-interface",
3
- "version": "1.3.0",
3
+ "version": "2.1.0-beta.0",
4
4
  "description": "Typescript library containing resources that facilitate integration with Grogu API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "deploy-patch": "npm version patch && npm run deploy",
9
9
  "deploy-minor": "npm version minor && npm run deploy",
10
10
  "deploy-major": "npm version major && npm run deploy",
11
- "deploy-beta": "npm version prerelease && npm run prepare-deployment && npm publish ./bin --tag beta",
11
+ "deploy-beta": "npm run prepare-deployment && npm publish ./bin --tag beta",
12
12
  "deploy": "npm run prepare-deployment && npm publish ./bin",
13
13
  "prepare-deployment": "npm run compile && cp package.json bin/package.json"
14
14
  },