nazar-salary 3.5.1 → 3.5.2

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.
Files changed (3) hide show
  1. package/index.d.ts +35 -0
  2. package/index.js +10 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -849,6 +849,40 @@ declare module 'nazar-salary' {
849
849
  history: ProgressHistoryEntry[];
850
850
  }
851
851
 
852
+ export interface AkcentCertificate {
853
+ number: string | null;
854
+ /** epoch ms */
855
+ issuedAt: number;
856
+ verifyUrl: string | null;
857
+ /** public PDF link, supports ?lang=ru|kk|en */
858
+ downloadUrl: string | null;
859
+ }
860
+
861
+ export interface AkcentCourse {
862
+ courseId: number;
863
+ title: string;
864
+ cover_image_url: string | null;
865
+ /** percent 0–100, null until graded */
866
+ totalGrade: number | null;
867
+ /** null while the course is not completed */
868
+ certificate: AkcentCertificate | null;
869
+ }
870
+
871
+ export interface AkcentStudent {
872
+ userId: string;
873
+ firstName: string | null;
874
+ lastName: string | null;
875
+ logo_url: string | null;
876
+ phone: string | null;
877
+ courses: AkcentCourse[];
878
+ }
879
+
880
+ export interface StudentCertificatesResponse {
881
+ /** false — no Akcent student with this phone */
882
+ found: boolean;
883
+ student: AkcentStudent | null;
884
+ }
885
+
852
886
  export type StopReason = 'student_quit' | 'moved_away' | 'health_issues' | 'financial' | 'other' | 'refund';
853
887
 
854
888
  export interface StopStudentData {
@@ -1816,6 +1850,7 @@ declare module 'nazar-salary' {
1816
1850
  resumeStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1817
1851
  resumeMyStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1818
1852
  getStudent(studentId: number): Promise<StudentDetail>;
1853
+ getStudentCertificates(studentId: number): Promise<StudentCertificatesResponse>;
1819
1854
  searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
1820
1855
  getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
1821
1856
  getMyStoppedStudents(params?: MyStoppedStudentsParams): Promise<MyStoppedStudentsResponse>;
package/index.js CHANGED
@@ -755,6 +755,16 @@ class SalaryAPI {
755
755
  return await this.client.get(`/api/v1/student/${studentId}`);
756
756
  }
757
757
 
758
+ /**
759
+ * Get student's Akcent Online courses and certificates (requireAuth: admin or owner manager)
760
+ * The backend finds the student in Akcent by phone.
761
+ * @param {number} studentId - Student ID
762
+ * @returns {Promise<StudentCertificatesResponse>}
763
+ */
764
+ async getStudentCertificates(studentId) {
765
+ return await this.client.get(`/api/v1/student/${studentId}/certificates`);
766
+ }
767
+
758
768
  /**
759
769
  * Search students globally (Admin only)
760
770
  * By default returns only active records; pass is_active=false for stopped.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",