-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathtypes.ts
More file actions
270 lines (236 loc) · 5.98 KB
/
Copy pathtypes.ts
File metadata and controls
270 lines (236 loc) · 5.98 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
import type { ToolResponse } from '@/tools/types'
// ============================================
// Common Types
// ============================================
export interface GoogleFormsResponse {
responseId?: string
createTime?: string
lastSubmittedTime?: string
answers?: Record<string, unknown>
respondentEmail?: string
totalScore?: number
[key: string]: unknown
}
export interface GoogleFormsResponseList {
responses?: GoogleFormsResponse[]
nextPageToken?: string
}
interface GoogleFormsInfo {
title?: string
description?: string
documentTitle?: string
}
interface GoogleFormsSettings {
quizSettings?: {
isQuiz?: boolean
}
emailCollectionType?:
| 'EMAIL_COLLECTION_TYPE_UNSPECIFIED'
| 'DO_NOT_COLLECT'
| 'VERIFIED'
| 'RESPONDER_INPUT'
[key: string]: unknown
}
interface GoogleFormsPublishState {
isPublished?: boolean
isAcceptingResponses?: boolean
}
export interface GoogleFormsPublishSettings {
publishState?: GoogleFormsPublishState
}
interface GoogleFormsItem {
itemId?: string
title?: string
description?: string
questionItem?: Record<string, unknown>
questionGroupItem?: Record<string, unknown>
pageBreakItem?: Record<string, unknown>
textItem?: Record<string, unknown>
imageItem?: Record<string, unknown>
videoItem?: Record<string, unknown>
}
export interface GoogleForm {
formId?: string
info?: GoogleFormsInfo
settings?: GoogleFormsSettings
items?: GoogleFormsItem[]
revisionId?: string
responderUri?: string
linkedSheetId?: string
publishSettings?: GoogleFormsPublishSettings
}
export interface GoogleFormsWatch {
id?: string
target?: {
topic?: {
topicName?: string
}
}
eventType?: 'EVENT_TYPE_UNSPECIFIED' | 'SCHEMA' | 'RESPONSES'
createTime?: string
expireTime?: string
state?: 'STATE_UNSPECIFIED' | 'ACTIVE' | 'SUSPENDED'
errorType?: string
}
// ============================================
// Get Responses Params
// ============================================
export interface GoogleFormsGetResponsesParams {
accessToken: string
formId: string
responseId?: string
pageSize?: number
pageToken?: string
filter?: string
}
// ============================================
// Get Form Params & Response
// ============================================
export interface GoogleFormsGetFormParams {
accessToken: string
formId: string
}
export interface GoogleFormsGetFormResponse extends ToolResponse {
output: {
formId: string
title: string | null
description: string | null
documentTitle: string | null
responderUri: string | null
linkedSheetId: string | null
revisionId: string | null
items: GoogleFormsItem[]
settings: GoogleFormsSettings | null
publishSettings: GoogleFormsPublishSettings | null
}
}
// ============================================
// Create Form Params & Response
// ============================================
export interface GoogleFormsCreateFormParams {
accessToken: string
title: string
documentTitle?: string
unpublished?: boolean
}
export interface GoogleFormsCreateFormResponse extends ToolResponse {
output: {
formId: string
title: string | null
documentTitle: string | null
responderUri: string | null
revisionId: string | null
}
}
// ============================================
// Batch Update Params & Response
// ============================================
interface GoogleFormsBatchUpdateRequest {
updateFormInfo?: {
info: Partial<GoogleFormsInfo>
updateMask: string
}
updateSettings?: {
settings: Partial<GoogleFormsSettings>
updateMask: string
}
createItem?: {
item: GoogleFormsItem
location: { index: number }
}
updateItem?: {
item: GoogleFormsItem
location: { index: number }
updateMask: string
}
moveItem?: {
originalLocation: { index: number }
newLocation: { index: number }
}
deleteItem?: {
location: { index: number }
}
}
export interface GoogleFormsBatchUpdateParams {
accessToken: string
formId: string
requests: GoogleFormsBatchUpdateRequest[]
includeFormInResponse?: boolean
}
export interface GoogleFormsBatchUpdateResponse extends ToolResponse {
output: {
replies: Record<string, unknown>[]
writeControl: {
requiredRevisionId?: string
targetRevisionId?: string
} | null
form: GoogleForm | null
}
}
// ============================================
// Set Publish Settings Params & Response
// ============================================
export interface GoogleFormsSetPublishSettingsParams {
accessToken: string
formId: string
isPublished: boolean
isAcceptingResponses?: boolean
}
export interface GoogleFormsSetPublishSettingsResponse extends ToolResponse {
output: {
formId: string
publishSettings: GoogleFormsPublishSettings
}
}
// ============================================
// Watch Params & Responses
// ============================================
export interface GoogleFormsCreateWatchParams {
accessToken: string
formId: string
eventType: 'SCHEMA' | 'RESPONSES'
topicName: string
watchId?: string
}
export interface GoogleFormsCreateWatchResponse extends ToolResponse {
output: {
id: string
eventType: string
topicName: string | null
createTime: string | null
expireTime: string | null
state: string | null
}
}
export interface GoogleFormsListWatchesParams {
accessToken: string
formId: string
}
export interface GoogleFormsListWatchesResponse extends ToolResponse {
output: {
watches: GoogleFormsWatch[]
}
}
export interface GoogleFormsDeleteWatchParams {
accessToken: string
formId: string
watchId: string
}
export interface GoogleFormsDeleteWatchResponse extends ToolResponse {
output: {
deleted: boolean
}
}
export interface GoogleFormsRenewWatchParams {
accessToken: string
formId: string
watchId: string
}
export interface GoogleFormsRenewWatchResponse extends ToolResponse {
output: {
id: string
eventType: string | null
expireTime: string | null
state: string | null
}
}