@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.
- package/dist/survey-service-api.esm.js +174 -2768
- package/package.json +52 -31
- package/src/axios.ts +8 -8
- package/src/index.ts +10 -17
- package/src/survey-service-impl.ts +199 -307
- package/src/survey-service.ts +44 -78
- package/types/index.d.ts +13 -17
- package/types/vue.d.ts +11 -11
- package/dist/survey-service-api.common.js +0 -2774
- package/dist/survey-service-api.esm.browser.js +0 -2817
- package/dist/survey-service-api.esm.browser.min.js +0 -16
- package/dist/survey-service-api.js +0 -2778
- package/dist/survey-service-api.min.js +0 -16
- package/src/index.d.ts +0 -6
- package/src/index.js +0 -15
- package/src/index.js.map +0 -1
package/src/survey-service.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
18
|
-
|
|
16
|
+
export interface SurveyService {
|
|
17
|
+
loadSurvey(id: string): Promise<SurveyModel>;
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
loadSurveys(params: any): Promise<SurveyModel[]>;
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
createSurvey(survey: SurveyModel): Promise<SurveyModel>;
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
updateSurvey(survey: SurveyModel): Promise<SurveyModel>;
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
deleteSurvey(id: string): Promise<void>;
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
createQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
createQuestions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>;
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
updateQuestion(surveyId: string, question: QuestionModel): Promise<QuestionModel>;
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
updateQuestionsOptions(surveyId: string, questions: Array<QuestionModel>): Promise<QuestionModel>;
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
moveQuestion(surveyId: string, questionId: string, index: number): Promise<void>;
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
deleteQuestion(surveyId: string, questionId: string): Promise<void>;
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
loadResponse(id: string): Promise<ResponseModel>;
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
loadResponses(params: any): Promise<ResponseModel>;
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
loadResponsesPost(params: any): Promise<ResponseModel>;
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>;
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
dispatchResponses(surveyId: string, respondentId: string, targets: Array<string>): Promise<ResponseModel>;
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
dispatchResponse(surveyId: string, response: ResponseModel): Promise<ResponseModel>;
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
updateResponse(response: ResponseModel): Promise<ResponseModel>;
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
loadMyPlans(params: any): Promise<ResponseModel>;
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
loadPlans(params: any): Promise<PlanModel>;
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
loadPlanById(planId: string, params: any): Promise<PlanModel>;
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
loadPlanWithFiltersById(planId: string, statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>;
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
loadPlanWithFiltersByIdAndTargetId(planId: string, targetId: string, statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>;
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
createPlan(plan: PlanModel): Promise<PlanModel>;
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
updatePlan(plan: PlanModel): Promise<PlanModel>;
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
deletePlan(id: string): Promise<void>;
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
loadStatisticsByAll(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
targetId: string,
|
|
74
|
-
statistics: PlanStatisticsModel): Promise<PlanStatisticsModel>
|
|
71
|
+
loadStatisticsBySurvey(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
loadStatisticsByTargets(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
77
74
|
|
|
78
|
-
|
|
75
|
+
loadStatisticsWithFiltersByAll(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
loadStatisticsWithFiltersBySurvey(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
loadStatisticsWithFiltersByTargets(surveyId: string, statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>;
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
loadStatisticsBySurveyAndTarget(data: any): Promise<ResponseStatisticsModel>;
|
|
85
82
|
|
|
86
|
-
|
|
83
|
+
loadRespondents(params: any): Promise<ResponseModel>;
|
|
87
84
|
|
|
88
|
-
|
|
89
|
-
statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
|
|
85
|
+
loadRespondentByPlanAndTarget(params: any): Promise<ResponseModel>;
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
statistics: ResponseStatisticsModel): Promise<ResponseStatisticsModel>
|
|
87
|
+
get(url: string, params: any): Promise<Object>;
|
|
93
88
|
|
|
94
|
-
|
|
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
|
-
|
|
6
|
-
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
version: string;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
20
|
+
static install(Vue: typeof _Vue, options: SurveyServiceOptions): void;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
export default SurveyServiceApiPlugin;
|
|
28
|
-
export {
|
|
24
|
+
export { SurveyService, SurveyServiceOptions };
|
package/types/vue.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import {
|
|
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:
|
|
7
|
-
$asyncSurveyService: AsyncSurveyService;
|
|
8
|
-
$blockingSurveyService: BlockingSurveyService;
|
|
12
|
+
$surveyService: SurveyService;
|
|
9
13
|
}
|
|
10
|
-
}
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
surveyService?: AsyncSurveyService;
|
|
15
|
-
asyncSurveyService?: AsyncSurveyService;
|
|
16
|
-
blockingSurveyService?: BlockingSurveyService;
|
|
15
|
+
interface VueConstructor {
|
|
16
|
+
$surveyService: SurveyService;
|
|
17
17
|
}
|
|
18
18
|
}
|