juno-erp-client 1.0.0 → 1.0.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.
package/dist/index.d.ts CHANGED
@@ -194,5 +194,15 @@ export declare class JunoClient {
194
194
  * @returns A promise resolving to an array of TransferDetailsOfStudent objects.
195
195
  */
196
196
  getTransferDetailsOfStudent(): Promise<TransferDetailsOfStudent[]>;
197
+ /**
198
+ * Constructs a URL for fetching profile pictures of the logged in student
199
+ * @returns the URL for fetching profile picture
200
+ * **/
201
+ getProfilePictureUrl(): string;
202
+ /**
203
+ * Fetches the profile picture of the logged in student
204
+ * @returns the profile picture of the logged in student
205
+ * **/
206
+ getProfilePicture(): Promise<string>;
197
207
  }
198
208
  export * from './types';
package/dist/index.js CHANGED
@@ -636,6 +636,28 @@ class JunoClient {
636
636
  return response.data;
637
637
  });
638
638
  }
639
+ /**
640
+ * Constructs a URL for fetching profile pictures of the logged in student
641
+ * @returns the URL for fetching profile picture
642
+ * **/
643
+ getProfilePictureUrl() {
644
+ return `${this.api.defaults.baseURL}/getStudentProfileImage.json`;
645
+ }
646
+ /**
647
+ * Fetches the profile picture of the logged in student
648
+ * @returns the profile picture of the logged in student
649
+ * **/
650
+ getProfilePicture() {
651
+ return __awaiter(this, void 0, void 0, function* () {
652
+ const response = yield this.api.get('/restApi/getStudentProfileImageById.png', {
653
+ headers: {
654
+ 'Referer': `${this.api.defaults.baseURL}/stu_myDashBoard.htm`,
655
+ }
656
+ });
657
+ this.logDebug('getProfilePicture', response.data);
658
+ return response.data;
659
+ });
660
+ }
639
661
  }
640
662
  exports.JunoClient = JunoClient;
641
663
  // Export types for convenience
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juno-erp-client",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A high-level TypeScript API wrapper for the JUNO Campus ERP platform, supporting automated login and session persistence.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",