nazar-salary 3.5.2 → 3.5.3

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 +26 -0
  2. package/index.js +15 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -864,10 +864,35 @@ declare module 'nazar-salary' {
864
864
  cover_image_url: string | null;
865
865
  /** percent 0–100, null until graded */
866
866
  totalGrade: number | null;
867
+ /** A1…C2, shown on the certificate check page; 'B2' until set */
868
+ languageLevel: AkcentLanguageLevel | string;
869
+ /** lessons with a teacher the student had; 12 until set */
870
+ lessonsDone: number;
871
+ /** lessons in the course; 12 until set */
872
+ lessonsTotal: number;
867
873
  /** null while the course is not completed */
868
874
  certificate: AkcentCertificate | null;
869
875
  }
870
876
 
877
+ export type AkcentLanguageLevel = 'A1' | 'A2' | 'B1' | 'B2' | 'C1' | 'C2';
878
+
879
+ /** Send only what changes; null puts the default back (B2, 12, 12). */
880
+ export interface UpdateAkcentCourseData {
881
+ languageLevel?: AkcentLanguageLevel | null;
882
+ /** 0–1000, not more than lessonsTotal */
883
+ lessonsDone?: number | null;
884
+ /** 1–1000 */
885
+ lessonsTotal?: number | null;
886
+ }
887
+
888
+ export interface UpdateAkcentCourseResponse {
889
+ userId: string;
890
+ courseId: number;
891
+ languageLevel: AkcentLanguageLevel | string;
892
+ lessonsDone: number;
893
+ lessonsTotal: number;
894
+ }
895
+
871
896
  export interface AkcentStudent {
872
897
  userId: string;
873
898
  firstName: string | null;
@@ -1851,6 +1876,7 @@ declare module 'nazar-salary' {
1851
1876
  resumeMyStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1852
1877
  getStudent(studentId: number): Promise<StudentDetail>;
1853
1878
  getStudentCertificates(studentId: number): Promise<StudentCertificatesResponse>;
1879
+ updateStudentCertificateCourse(studentId: number, courseId: number, data: UpdateAkcentCourseData): Promise<UpdateAkcentCourseResponse>;
1854
1880
  searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
1855
1881
  getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
1856
1882
  getMyStoppedStudents(params?: MyStoppedStudentsParams): Promise<MyStoppedStudentsResponse>;
package/index.js CHANGED
@@ -765,6 +765,21 @@ class SalaryAPI {
765
765
  return await this.client.get(`/api/v1/student/${studentId}/certificates`);
766
766
  }
767
767
 
768
+ /**
769
+ * Set language level and lessons held for one Akcent course (requireAuth: admin or owner manager)
770
+ * Shown on the certificate check page (verifyUrl). Send only what changes; null = default.
771
+ * @param {number} studentId - Student ID
772
+ * @param {number} courseId - Akcent course ID
773
+ * @param {object} data - { languageLevel?, lessonsDone?, lessonsTotal? }
774
+ * @returns {Promise<UpdateAkcentCourseResponse>}
775
+ */
776
+ async updateStudentCertificateCourse(studentId, courseId, data) {
777
+ return await this.client.put(
778
+ `/api/v1/student/${studentId}/certificates/courses/${courseId}`,
779
+ data,
780
+ );
781
+ }
782
+
768
783
  /**
769
784
  * Search students globally (Admin only)
770
785
  * 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.2",
3
+ "version": "3.5.3",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",