@wg-npm/survey-service-api 0.1.272 → 0.2.0

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.
@@ -1,124 +1,90 @@
1
1
  import {
2
2
  PlanModel,
3
3
  PlanStatisticsModel,
4
- QuestionModel,
4
+ BaseQuestionModel as QuestionModel,
5
5
  ResponseModel,
6
6
  ResponseStatisticsModel,
7
- SurveyModel,
8
- TemplateModel
9
- } from "@wg-npm/survey-core";
7
+ SurveyModel
8
+ } from '@wg-npm/survey-core';
10
9
 
11
10
  export interface SurveyServiceOptions {
12
- baseUrl: string
13
- version: string
14
- httpDecorator: Function
11
+ baseUrl: string;
12
+ version: string;
13
+ httpDecorator: Function;
15
14
  }
16
15
 
17
- export interface AsyncSurveyService {
18
- loadTemplate(id: string): Promise<TemplateModel>
16
+ export interface SurveyService {
17
+ loadSurvey(id: string): Promise<SurveyModel>;
19
18
 
20
- loadTemplates(params: any): Promise<TemplateModel>
19
+ loadSurveys(params: any): Promise<SurveyModel[]>;
21
20
 
22
- createTemplate(survey: TemplateModel): Promise<TemplateModel>
21
+ createSurvey(survey: SurveyModel): Promise<SurveyModel>;
23
22
 
24
- updateTemplate(survey: TemplateModel): Promise<TemplateModel>
23
+ updateSurvey(survey: SurveyModel): Promise<SurveyModel>;
25
24
 
26
- deleteTemplate(id: string): Promise<void>
25
+ deleteSurvey(id: string): Promise<void>;
27
26
 
28
- loadSurvey(id: string): Promise<SurveyModel>
27
+ createQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
29
28
 
30
- loadSurveys(params: any): Promise<SurveyModel>
29
+ createQuestions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>;
31
30
 
32
- createSurvey(survey: SurveyModel): Promise<SurveyModel>
31
+ updateQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
33
32
 
34
- updateSurvey(survey: SurveyModel): Promise<SurveyModel>
33
+ updateQuestionsOptions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>;
35
34
 
36
- deleteSurvey(id: string): Promise<void>
35
+ moveQuestion(surveyId: string, questionId: string, index: number): Promise<void>;
37
36
 
38
- createQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>
37
+ deleteQuestion(surveyId: string, questionId: string): Promise<void>;
39
38
 
40
- createQuestions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>
39
+ loadResponse(id: string): Promise<ResponseModel>;
41
40
 
42
- updateQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>
41
+ loadResponses(params: any): Promise<ResponseModel>;
43
42
 
44
- updateQuestionsOptions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>
43
+ loadResponsesPost(params: any): Promise<ResponseModel>;
45
44
 
46
- moveQuestion(surveyId: string, questionId: string, index: number): Promise<void>
45
+ dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>;
47
46
 
48
- deleteQuestion(surveyId: string, questionId: string): Promise<void>
47
+ dispatchResponses(surveyId: string, respondentId: string, targets: Array<string>): Promise<ResponseModel>;
49
48
 
50
- loadResponse(id: string): Promise<ResponseModel>
49
+ dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>;
51
50
 
52
- loadResponses(params: any): Promise<ResponseModel>
51
+ updateResponse(response: ResponseModel): Promise<ResponseModel>;
53
52
 
54
- loadResponsesPost(params: any): Promise<ResponseModel>
53
+ loadMyPlans(params: any): Promise<ResponseModel>;
55
54
 
56
- dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>
55
+ loadPlans(params: any): Promise<PlanModel>;
57
56
 
58
- dispatchResponses(surveyId: string, respondentId: string, targets: Array<string>): Promise<ResponseModel>
57
+ loadPlanById(planId: string, params: any): Promise<PlanModel>;
59
58
 
60
- dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>
59
+ loadPlanWithFiltersById(planId: string, statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>;
61
60
 
62
- updateResponse(response: ResponseModel): Promise<ResponseModel>
61
+ loadPlanWithFiltersByIdAndTargetId(planId: string, targetId: string, statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>;
63
62
 
64
- loadMyPlans(params: any): Promise<ResponseModel>
63
+ createPlan(plan: PlanModel): Promise<PlanModel>;
65
64
 
66
- loadPlans(params: any): Promise<PlanModel>
65
+ updatePlan(plan: PlanModel): Promise<PlanModel>;
67
66
 
68
- loadPlanById(planId: string, params: any): Promise<PlanModel>
67
+ deletePlan(id: string): Promise<void>;
69
68
 
70
- loadPlanWithFiltersById(planId: string, statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>
69
+ loadStatisticsByAll(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
71
70
 
72
- loadPlanWithFiltersByIdAndTargetId(planId: string,
73
- targetId: string,
74
- statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>
71
+ loadStatisticsBySurvey(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
75
72
 
76
- createPlan(plan: PlanModel): Promise<PlanModel>
73
+ loadStatisticsByTargets(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
77
74
 
78
- updatePlan(plan: PlanModel): Promise<PlanModel>
75
+ loadStatisticsWithFiltersByAll(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
79
76
 
80
- deletePlan(id: string): Promise<void>
77
+ loadStatisticsWithFiltersBySurvey(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
81
78
 
82
- loadStatisticsByAll(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
79
+ loadStatisticsWithFiltersByTargets(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
83
80
 
84
- loadStatisticsBySurvey(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
81
+ loadStatisticsBySurveyAndTarget(data: any): Promise<ResponseStatisticsModel>;
85
82
 
86
- loadStatisticsByTargets(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
83
+ loadRespondents(params: any): Promise<ResponseModel>;
87
84
 
88
- loadStatisticsWithFiltersByAll(surveyId: string,
89
- statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
85
+ loadRespondentByPlanAndTarget(params: any): Promise<ResponseModel>;
90
86
 
91
- loadStatisticsWithFiltersBySurvey(surveyId: string,
92
- statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
87
+ get(url: string, params: any): Promise<Object>;
93
88
 
94
- loadStatisticsWithFiltersByTargets(surveyId: string,
95
- statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
96
-
97
- loadStatisticsBySurveyAndTarget(data: any): Promise<ResponseStatisticsModel>
98
-
99
- loadRespondents(params: any): Promise<ResponseModel>
100
-
101
- loadRespondentbyPlanAndTarget(params: any): Promise<ResponseModel>
102
-
103
- loadRespondentbyPlanAndTargetAndRespondentIds(planId: string, targetId: string, respondentIds: Array<number>): Promise<ResponseModel>
104
-
105
- get(url: string, params: any): Promise<Object>
106
-
107
- updatePlanStatistics(params: any): Promise<ResponseStatisticsModel>
108
-
109
- exportPlanStatisticsRawData(params: any): Promise<ResponseStatisticsModel>
89
+ updatePlanStatistics(params: any): Promise<ResponseStatisticsModel>;
110
90
  }
111
-
112
- export interface BlockingSurveyService {
113
- loadSurvey(id: string): SurveyModel
114
-
115
- createQuestion(surveyId: string, question: QuestionModel): QuestionModel
116
-
117
- updateQuestion(surveyId: string, question: QuestionModel): QuestionModel
118
-
119
- moveQuestion(surveyId: string, questionId: string, index: number): void
120
-
121
- deleteQuestion(surveyId: string, questionId: string): void
122
- }
123
-
124
-
package/types/index.d.ts CHANGED
@@ -1,28 +1,24 @@
1
1
  import _Vue from 'vue';
2
+ import './vue.d.ts';
2
3
  import { SurveyModel, QuestionModel } from '@wg-npm/survey-core';
3
4
 
4
5
  interface SurveyServiceOptions {
5
- baseUrl: string;
6
- version: string;
6
+ baseUrl: string;
7
+ version: string;
7
8
  }
8
- interface AsyncSurveyService {
9
- loadSurvey(id: string): Promise<SurveyModel>;
10
- createQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
11
- updateQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
12
- moveQuestion(surveyId: string, questionId: string, index: number): Promise<void>;
13
- deleteQuestion(surveyId: string, questionId: string): Promise<void>;
14
- }
15
- interface BlockingSurveyService {
16
- loadSurvey(id: string): SurveyModel;
17
- createQuestion(surveyId: string, question: QuestionModel): QuestionModel;
18
- updateQuestion(surveyId: string, question: QuestionModel): QuestionModel;
19
- moveQuestion(surveyId: string, questionId: string, index: number): void;
20
- deleteQuestion(surveyId: string, questionId: string): void;
9
+
10
+ interface SurveyService {
11
+ loadSurvey(id: string): Promise<SurveyModel>;
12
+ loadSurveys(params: any): Promise<SurveyModel[]>;
13
+ createQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
14
+ updateQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
15
+ moveQuestion(surveyId: string, questionId: string, index: number): Promise<void>;
16
+ deleteQuestion(surveyId: string, questionId: string): Promise<void>;
21
17
  }
22
18
 
23
19
  declare class SurveyServiceApiPlugin {
24
- static install(Vue: typeof _Vue, options: SurveyServiceOptions): void;
20
+ static install(Vue: typeof _Vue, options: SurveyServiceOptions): void;
25
21
  }
26
22
 
27
23
  export default SurveyServiceApiPlugin;
28
- export { AsyncSurveyService, BlockingSurveyService, SurveyServiceOptions };
24
+ export { SurveyService, SurveyServiceOptions };
package/types/vue.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import Vue from 'vue'
2
- import {AsyncSurveyService, BlockingSurveyService} from "./index";
1
+ import Vue from 'vue';
2
+ import { SurveyService } from './index';
3
+
4
+ declare module 'vue/types/options' {
5
+ interface ComponentOptions<V extends Vue> {
6
+ $surveyService?: SurveyService;
7
+ }
8
+ }
3
9
 
4
10
  declare module 'vue/types/vue' {
5
11
  interface Vue {
6
- $surveyService: AsyncSurveyService;
7
- $asyncSurveyService: AsyncSurveyService;
8
- $blockingSurveyService: BlockingSurveyService;
12
+ $surveyService: SurveyService;
9
13
  }
10
- }
11
14
 
12
- declare module 'vue/types/options' {
13
- interface ComponentOptions<V extends Vue> {
14
- surveyService?: AsyncSurveyService;
15
- asyncSurveyService?: AsyncSurveyService;
16
- blockingSurveyService?: BlockingSurveyService;
15
+ interface VueConstructor {
16
+ $surveyService: SurveyService;
17
17
  }
18
18
  }