@studyportals/grogu-api-interface 1.2.0 → 1.2.1-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.
@@ -0,0 +1,6 @@
1
+ import { IContentInput } from "./content-input.interface";
2
+ import { RequestBase } from "./request-base";
3
+ export declare class EcsGroguApiClient extends RequestBase {
4
+ constructor(apiUriBase: string);
5
+ getContent(body: IContentInput): Promise<string>;
6
+ }
@@ -0,0 +1,13 @@
1
+ import { RequestBase } from "./request-base";
2
+ export class EcsGroguApiClient extends RequestBase {
3
+ constructor(apiUriBase) {
4
+ const [protocol, urlWithoutProtocol] = apiUriBase.split("://");
5
+ super(`${protocol}://content.${urlWithoutProtocol}`);
6
+ }
7
+ async getContent(body) {
8
+ const result = await this.postRequest(body);
9
+ const resultBody = result.body;
10
+ return resultBody.content;
11
+ }
12
+ }
13
+ //# sourceMappingURL=ecs-grogu-api-client.js.map
@@ -0,0 +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,5 +1,6 @@
1
1
  import { IContentInput } from "./content-input.interface";
2
2
  import { RequestBase } from "./request-base";
3
3
  export declare class GroguApiClient extends RequestBase {
4
+ constructor(apiUriBase: string);
4
5
  getContent(body: IContentInput): Promise<string>;
5
6
  }
@@ -1,5 +1,8 @@
1
1
  import { RequestBase } from "./request-base";
2
2
  export class GroguApiClient extends RequestBase {
3
+ constructor(apiUriBase) {
4
+ super(`${apiUriBase}/v2/content/`);
5
+ }
3
6
  async getContent(body) {
4
7
  const result = await this.postRequest(body);
5
8
  const resultBody = result.body;
@@ -1 +1 @@
1
- {"version":3,"file":"grogu-api-client.js","sourceRoot":"","sources":["../grogu-api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC9C,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":"grogu-api-client.js","sourceRoot":"","sources":["../grogu-api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAE9C,YAAY,UAAkB;QAC7B,KAAK,CAAC,GAAG,UAAU,cAAc,CAAC,CAAC;IACpC,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"}
package/index.d.ts CHANGED
@@ -2,4 +2,5 @@ import { IContentInput } from "./content-input.interface";
2
2
  import { ContentTypeId } from "./content-type-id.enum";
3
3
  import { ContentType } from "./content-type.enum";
4
4
  import { GroguApiClient } from "./grogu-api-client";
5
- export { GroguApiClient, IContentInput, ContentType, ContentTypeId, };
5
+ import { EcsGroguApiClient } from "./ecs-grogu-api-client";
6
+ export { GroguApiClient, IContentInput, ContentType, ContentTypeId, EcsGroguApiClient };
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ContentTypeId } from "./content-type-id.enum";
2
2
  import { ContentType } from "./content-type.enum";
3
3
  import { GroguApiClient } from "./grogu-api-client";
4
- export { GroguApiClient, ContentType, ContentTypeId, };
4
+ import { EcsGroguApiClient } from "./ecs-grogu-api-client";
5
+ export { GroguApiClient, ContentType, ContentTypeId, EcsGroguApiClient };
5
6
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +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"}
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;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EACN,cAAc,EAEd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/grogu-api-interface",
3
- "version": "1.2.0",
3
+ "version": "1.2.1-1",
4
4
  "description": "Typescript library containing resources that facilitate integration with Grogu API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "typescript": "^5.9.3"
21
21
  },
22
22
  "dependencies": {
23
+ "@studyportals/grogu-api-interface": "^1.2.1-0",
23
24
  "@studyportals/mb-platform-http-requests": "^2.8.0",
24
25
  "@studyportals/search-api-interface": "^5.0.0",
25
26
  "@studyportals/search-filters": "^6.3.1"
package/request-base.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { APIGatewayProxyResult } from "aws-lambda";
2
2
  export declare class RequestBase {
3
- private publicUrl;
4
- constructor(apiUriBase: string);
3
+ private readonly url;
4
+ constructor(url: string);
5
5
  postRequest(body: string | object | undefined, relative?: string): Promise<APIGatewayProxyResult>;
6
6
  private buildBaseUrl;
7
7
  }
package/request-base.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as superagent from "superagent";
2
2
  export class RequestBase {
3
- publicUrl;
4
- constructor(apiUriBase) {
5
- this.publicUrl = `${apiUriBase}/v2/content/`;
3
+ url;
4
+ constructor(url) {
5
+ this.url = url;
6
6
  }
7
7
  async postRequest(body, relative = "") {
8
8
  const request = superagent.post(this.buildBaseUrl(relative))
@@ -10,7 +10,7 @@ export class RequestBase {
10
10
  return await request.send(body);
11
11
  }
12
12
  buildBaseUrl(relative) {
13
- return `${this.publicUrl}${relative}`;
13
+ return `${this.url}${relative}`;
14
14
  }
15
15
  }
16
16
  //# sourceMappingURL=request-base.js.map
@@ -1 +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,IAAiC,EAAE,WAAmB,EAAE;QAChF,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"}
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;IAEM;IAA7B,YAA6B,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAErC,KAAK,CAAC,WAAW,CAAC,IAAiC,EAAE,WAAmB,EAAE;QAChF,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,GAAG,GAAG,QAAQ,EAAE,CAAC;IACjC,CAAC;CACD"}