@up-im/medotvet_sdk 0.0.17 → 0.0.19

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/README.md CHANGED
@@ -176,7 +176,7 @@ interface iUser {
176
176
  diploma_status: { id: DiplomaStatusValue, title: string } | null // 1-не загружен, 2-проверка, 3-принят, 4-отклонён
177
177
  diploma_files: string[] | null
178
178
  diploma_reject_reason: string | null
179
- test_status: number | null // 1-не пройден, 2-пройден (TestStatus)
179
+ test_status: { id: TestStatusValue, title: string } | null // 1-не пройден, 2-пройден (TestStatus)
180
180
  ref: iUserData | null // пригласивший пользователь
181
181
  my_ref_code: string | null // рефкод для приглашения других
182
182
  agreement: boolean | null
@@ -35,7 +35,10 @@ export declare class ApiSurvey extends ApiAbstract {
35
35
  */
36
36
  getOne({ id }: {
37
37
  id: number;
38
- }): Promise<iSurvey>;
38
+ }): Promise<{
39
+ item: iSurvey;
40
+ userSurvey: iUserSurvey | null;
41
+ }>;
39
42
  /**
40
43
  * Начать прохождение опроса
41
44
  * @param {number} surveyId - id опроса
@@ -46,10 +46,10 @@ class ApiSurvey extends abstract_1.ApiAbstract {
46
46
  * @param {number} id - id опроса
47
47
  */
48
48
  async getOne({ id }) {
49
- return (await this.fetcher({
49
+ return await this.fetcher({
50
50
  route: (0, apiRoute_1.apiRouteSurveyItem)(id),
51
51
  options: { addToken: true }
52
- })).item;
52
+ });
53
53
  }
54
54
  /**
55
55
  * Начать прохождение опроса
@@ -1,6 +1,7 @@
1
1
  import { DiplomaStatusValue } from "./diplomaStatus";
2
2
  import { iCity } from "./iCity";
3
3
  import { iSpecialization } from "./iSpecialization";
4
+ import { TestStatusValue } from "./testStatus";
4
5
  import { iUserData } from "./iUserData";
5
6
  import { UserRole, UserRoleKeys } from "./userRole";
6
7
  export interface iUser {
@@ -36,7 +37,10 @@ export interface iUser {
36
37
  } | null;
37
38
  diploma_files: string[] | null;
38
39
  diploma_reject_reason: string | null;
39
- test_status: number | null;
40
+ test_status: {
41
+ id: TestStatusValue;
42
+ title: string;
43
+ } | null;
40
44
  ref: iUserData | null;
41
45
  my_ref_code: string | null;
42
46
  agreement: boolean | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up-im/medotvet_sdk",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/api/survey.ts CHANGED
@@ -73,10 +73,10 @@ export class ApiSurvey extends ApiAbstract {
73
73
  * @param {number} id - id опроса
74
74
  */
75
75
  async getOne({ id }: { id: number }) {
76
- return (await this.fetcher<{ item: iSurvey }>({
76
+ return await this.fetcher<{ item: iSurvey, userSurvey: iUserSurvey | null }>({
77
77
  route: apiRouteSurveyItem(id),
78
78
  options: { addToken: true }
79
- })).item
79
+ })
80
80
  }
81
81
 
82
82
  /**
@@ -1,6 +1,7 @@
1
1
  import { DiplomaStatusValue } from "./diplomaStatus"
2
2
  import { iCity } from "./iCity"
3
3
  import { iSpecialization } from "./iSpecialization"
4
+ import { TestStatusValue } from "./testStatus"
4
5
  import { iUserData } from "./iUserData"
5
6
  import { UserRole, UserRoleKeys } from "./userRole"
6
7
 
@@ -32,7 +33,7 @@ export interface iUser {
32
33
  diploma_status: { id: DiplomaStatusValue, title: string } | null // 1-не загружен, 2-на проверке, 3-верифицирован, 4-отклонен (Medotvet)
33
34
  diploma_files: string[] | null // массив путей к файлам диплома (Medotvet)
34
35
  diploma_reject_reason: string | null // причина отклонения диплома (Medotvet)
35
- test_status: number | null // 0-не пройден, 1-пройден (Medotvet)
36
+ test_status: { id: TestStatusValue, title: string } | null // 1-не пройден, 2-пройден (Medotvet)
36
37
  ref: iUserData | null // друг, если не пустой то ввести промокод нельзя
37
38
  my_ref_code: string | null
38
39
  agreement: boolean | null