-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperations.tsp
More file actions
136 lines (126 loc) · 3.93 KB
/
Copy pathoperations.tsp
File metadata and controls
136 lines (126 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using Http;
@tag("Responses")
namespace CoreSystem.Responses {
@summary("Create Form Response")
@doc("Create a new draft response for a form. Each user may have at most one response per form.")
@route("/forms/{formId}/responses")
@post
op createFormResponse(@path formId: uuid): {
@statusCode statusCode: 201;
@body response: CreateResponse;
} | {
@statusCode statusCode: 400;
@body error: BadRequest;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Submit Form Response")
@doc("Submit all the answer in the form response.")
@route("/responses/{responseId}/submit")
@post
op submitFormResponse(@path responseId: uuid, @body req: AnswersRequest): {
@statusCode statusCode: 200;
@body response: SubmitResponse;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Cancel Form Response Submission")
@doc("Cancel a submitted response and revert it to draft. Only submitted responses can be canceled.")
@route("/responses/{responseId}/cancel")
@post
op cancelFormResponseSubmission(@path responseId: uuid): {
@statusCode statusCode: 200;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
} | {
@statusCode statusCode: 400;
@body error: BadRequest;
};
@summary("List Form Responses")
@doc("List all responses for a specific form.")
@route("/forms/{formId}/responses")
@get
op listFormResponses(@path formId: uuid): {
@statusCode statusCode: 200;
@body response: ListResponse;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Get My Form Responses")
@doc("Get all responses submitted by the currently logged-in user for a specific form.")
@route("/forms/{formId}/responses/me")
@get
op getMyFormResponses(@path formId: uuid): {
@statusCode statusCode: 200;
@body response: ListResponse;
} | {
@statusCode statusCode: 401;
@body error: Unauthorized;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Get Form Response")
@doc("Get the preview answer by response ID.")
@route("/forms/{formId}/responses/{responseId}")
@get
op getFormResponse(@path formId: uuid, @path responseId: uuid): {
@statusCode statusCode: 200;
@body response: GetFormResponse;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Delete Form Response")
@doc("Delete a response and all its associated data.")
@route("/forms/{formId}/responses/{responseId}")
@delete
op deleteFormResponse(@path formId: uuid, @path responseId: uuid): {
@statusCode statusCode: 204;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Preview Form Response Export")
@doc("Get a preview of the form responses based on selected question IDs.")
@route("/forms/{formId}/responses/export/preview")
@post
op previewFormResponseExport(@path formId: uuid, @body req: ExportPreviewRequest): {
@statusCode statusCode: 200;
@body response: ExportPreviewResponse;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Export Form Responses")
@doc("Download form responses in XLSX format.")
@route("/forms/{formId}/responses/export/download")
@post
op exportFormResponses(@path formId: uuid, @body req: ExportDownloadRequest): {
@statusCode statusCode: 200;
@header("Content-Type") contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
@header("Content-Disposition") contentDisposition: string;
@body response: bytes;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
@summary("Filter And Query Form Responses")
@doc("Filter and query form responses based on a list of selected question answers.")
@route("/forms/{formId}/responses/query")
@post
op filterAndQueryFormResponses(@path formId: uuid, @body req: AnswerFilterRequest): {
@statusCode statusCode: 200;
@body response: AnswerFilterResponse;
} | {
@statusCode statusCode: 400;
@body error: BadRequest;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
};
}