@studyportals/domain-client 6.0.0-11 → 6.0.0-12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/domain-client",
3
- "version": "6.0.0-11",
3
+ "version": "6.0.0-12",
4
4
  "description": "Responsible for fetching data from the Domain API",
5
5
  "main": "index.js",
6
6
  "author": "StudyPortals B.V.",
@@ -21,7 +21,7 @@
21
21
  "publish-major": "npm version major && npm run prepare-dist && npm publish ./bin",
22
22
  "publish-minor": "npm version minor && npm run prepare-dist && npm publish ./bin",
23
23
  "publish-patch": "npm version patch && npm run prepare-dist && npm publish ./bin",
24
- "publish-current": "npm run prepare-dist && npm publish ./bin --tag beta"
24
+ "publish-current": "npm run prepare-dist && npm publish ./bin --tag=beta"
25
25
  },
26
26
  "husky": {
27
27
  "hooks": {
@@ -33,7 +33,6 @@
33
33
  "typescript": "^5.9.2"
34
34
  },
35
35
  "devDependencies": {
36
- "@bufbuild/protobuf": "^2.6.2",
37
36
  "@studyportals/code-style": "^2.0.4",
38
37
  "@testdeck/mocha": "^0.3.3",
39
38
  "@types/axios": "^0.14.0",
@@ -25,6 +25,7 @@ export class DomainClient {
25
25
  }
26
26
  try {
27
27
  const response = await fetch(url, { headers });
28
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
28
29
  const data = await response.json();
29
30
  if (!response.ok || data.status !== 200) {
30
31
  this.handleErrors(data);
@@ -58,7 +59,7 @@ export class DomainClient {
58
59
  }
59
60
  }
60
61
  async decompressModelData(compressedData) {
61
- const bytes = Uint8Array.from(Buffer.from(compressedData, 'base64'));
62
+ const bytes = Uint8Array.from(atob(compressedData), c => c.charCodeAt(0));
62
63
  const stream = new DecompressionStream('deflate');
63
64
  const response = new Response(bytes);
64
65
  const decompressedStream = response.body?.pipeThrough(stream);
@@ -3,6 +3,7 @@ export class InternalLinkFactory {
3
3
  constructor(portalMap) {
4
4
  this.portalMap = portalMap;
5
5
  }
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
7
  create(link, parameters) {
7
8
  const getPortalType = link['getPortalType'];
8
9
  const portalType = getPortalType ? getPortalType() : null;
package/test.js CHANGED
@@ -1,5 +1,7 @@
1
- import { PublicMiniProgrammeCardClient } from "./";
1
+ import { PublicMiniProgrammeCardClient, PublicScholarshipCardClient } from "./";
2
2
  const client = new PublicMiniProgrammeCardClient('https://681.domain-api.tst.prtl.co', 1, undefined, new Map());
3
+ const client2 = new PublicScholarshipCardClient('https://681.domain-api.tst.prtl.co', undefined, 1, new Map());
3
4
  (async () => {
4
5
  console.log(await client.fetch(70942));
6
+ console.log(await client2.fetch(2842));
5
7
  })();