@studyportals/grogu-api-interface 1.0.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.
@@ -0,0 +1,8 @@
1
+ import { ContentTypeId } from "./content-type-id.enum";
2
+ import { ContentType } from "./content-type.enum";
3
+ export interface IContentInput {
4
+ pageType: ContentType;
5
+ contentType: ContentTypeId;
6
+ parameters: Record<string, string | string[]>;
7
+ additionalParameters?: Record<string, string | string[]>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=content-input.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-input.interface.js","sourceRoot":"","sources":["../content-input.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare enum ContentTypeId {
2
+ STATIC_CONTENT = "static-content"
3
+ }
@@ -0,0 +1,5 @@
1
+ export var ContentTypeId;
2
+ (function (ContentTypeId) {
3
+ ContentTypeId["STATIC_CONTENT"] = "static-content";
4
+ })(ContentTypeId || (ContentTypeId = {}));
5
+ //# sourceMappingURL=content-type-id.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-type-id.enum.js","sourceRoot":"","sources":["../content-type-id.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACxB,kDAAiC,CAAA;AAClC,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB"}
@@ -0,0 +1,3 @@
1
+ export declare enum ContentType {
2
+ UNIVERSITY_SEARCH_STATIC_CONTENT = "university-search-static-content"
3
+ }
@@ -0,0 +1,5 @@
1
+ export var ContentType;
2
+ (function (ContentType) {
3
+ ContentType["UNIVERSITY_SEARCH_STATIC_CONTENT"] = "university-search-static-content";
4
+ })(ContentType || (ContentType = {}));
5
+ //# sourceMappingURL=content-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-type.enum.js","sourceRoot":"","sources":["../content-type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;IACtB,oFAAqE,CAAA;AACtE,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB"}
@@ -0,0 +1,4 @@
1
+ import { RequestBase } from "./request-base";
2
+ export declare class GroguApiClient extends RequestBase {
3
+ getContent(body: any): Promise<string>;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { RequestBase } from "./request-base";
2
+ export class GroguApiClient extends RequestBase {
3
+ async getContent(body) {
4
+ const result = await this.postRequest(body);
5
+ const resultBody = result.body;
6
+ return resultBody.content;
7
+ }
8
+ }
9
+ //# sourceMappingURL=grogu-api-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grogu-api-client.js","sourceRoot":"","sources":["../grogu-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC9C,KAAK,CAAC,UAAU,CAAC,IAAS;QACzB,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"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { IContentInput } from "./content-input.interface";
2
+ import { ContentTypeId } from "./content-type-id.enum";
3
+ import { ContentType } from "./content-type.enum";
4
+ import { GroguApiClient } from "./grogu-api-client";
5
+ export { GroguApiClient, IContentInput, ContentType, ContentTypeId, };
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { ContentTypeId } from "./content-type-id.enum";
2
+ import { ContentType } from "./content-type.enum";
3
+ import { GroguApiClient } from "./grogu-api-client";
4
+ export { GroguApiClient, ContentType, ContentTypeId, };
5
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACN,cAAc,EAEd,WAAW,EACX,aAAa,GACb,CAAA"}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@studyportals/grogu-api-interface",
3
+ "version": "1.0.0",
4
+ "description": "Typescript library containing resources that facilitate integration with Grogu 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
+ },
15
+ "author": "Seal Team Six",
16
+ "license": "BSD-3-Clause",
17
+ "devDependencies": {
18
+ "@types/superagent": "^8.1.9",
19
+ "superagent": "^10.2.3",
20
+ "typescript": "^5.9.3"
21
+ },
22
+ "dependencies": {
23
+ "@studyportals/mb-platform-http-requests": "^2.8.0",
24
+ "@studyportals/search-api-interface": "^3.8.0",
25
+ "@studyportals/search-filters": "^6.3.1"
26
+ }
27
+ }
@@ -0,0 +1,7 @@
1
+ import { APIGatewayProxyResult } from "aws-lambda";
2
+ export declare class RequestBase {
3
+ private publicUrl;
4
+ constructor(apiUriBase: string);
5
+ postRequest(body: string, relative?: string): Promise<APIGatewayProxyResult>;
6
+ private buildBaseUrl;
7
+ }
@@ -0,0 +1,16 @@
1
+ import * as superagent from "superagent";
2
+ export class RequestBase {
3
+ publicUrl;
4
+ constructor(apiUriBase) {
5
+ this.publicUrl = `${apiUriBase}/v2/content/`;
6
+ }
7
+ async postRequest(body, relative = "") {
8
+ const request = superagent.post(this.buildBaseUrl(relative))
9
+ .set("Content-Type", "application/json");
10
+ return await request.send(body);
11
+ }
12
+ buildBaseUrl(relative) {
13
+ return `${this.publicUrl}${relative}`;
14
+ }
15
+ }
16
+ //# sourceMappingURL=request-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-base.js","sourceRoot":"","sources":["../request-base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,MAAM,OAAO,WAAW;IACf,SAAS,CAAS;IAE1B,YAAY,UAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,GAAG,UAAU,cAAc,CAAC;IAC9C,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,WAAmB,EAAE;QAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aAC1D,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;QAEzC,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAEO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,SAAS,GAAG,QAAQ,EAAE,CAAC;IACvC,CAAC;CACD"}