import { BaseFormBuilderAction, FormResponse } from '../../base/base-form-builder.action.js'; import { AxiosInstance } from 'axios'; /** * Google Forms API response structures */ export interface GoogleFormsAnswer { questionId: string; textAnswers?: { answers: Array<{ value: string; }>; }; fileUploadAnswers?: { answers: Array<{ fileId: string; fileName: string; mimeType: string; }>; }; grade?: { score: number; correct: boolean; }; } export interface GoogleFormsResponseItem { responseId: string; createTime: string; lastSubmittedTime: string; respondentEmail?: string; answers: Record; totalScore?: number; } export interface GoogleFormsResponsesResult { responses: GoogleFormsResponseItem[]; nextPageToken?: string; } export interface GoogleFormItem { questionItem?: { question: { questionId: string; required?: boolean; textQuestion?: { paragraph?: boolean; }; choiceQuestion?: { type?: string; options?: Array<{ value: string; }>; shuffle?: boolean; }; scaleQuestion?: { low: number; high: number; lowLabel?: string; highLabel?: string; }; dateQuestion?: { includeTime?: boolean; includeYear?: boolean; }; timeQuestion?: { duration?: boolean; }; fileUploadQuestion?: { folderId: string; types?: string[]; maxFiles?: number; maxFileSize?: string; }; rowQuestion?: { title: string; }; grading?: { pointValue: number; correctAnswers?: { answers: Array<{ value: string; }>; }; }; }; }; questionGroupItem?: { questions: any[]; grid?: { columns: { type: string; options: Array<{ value: string; }>; }; }; }; title?: string; description?: string; } export interface GoogleFormsDetails { formId: string; info: { title: string; documentTitle?: string; description?: string; }; settings?: { quizSettings?: { isQuiz?: boolean; }; }; items?: GoogleFormItem[]; revisionId?: string; responderUri?: string; linkedSheetId?: string; } /** * Base class for all Google Forms actions. * Handles Google Forms-specific authentication and API interaction patterns. * * Note: Google Forms API is read-only - there are no endpoints for creating or updating forms. */ export declare abstract class GoogleFormsBaseAction extends BaseFormBuilderAction { protected get formPlatform(): string; protected get integrationName(): string; protected get apiBaseUrl(): string; private axiosInstance; private currentAccessToken; /** * Get axios instance with Google Forms authentication (OAuth 2.0) */ protected getAxiosInstance(accessToken: string): AxiosInstance; /** * Get responses from a Google Form */ protected getGoogleFormsResponses(formId: string, accessToken: string, options?: { pageSize?: number; pageToken?: string; filter?: string; }): Promise; /** * Get all responses with automatic pagination using pageToken */ protected getAllGoogleFormsResponses(formId: string, accessToken: string, options?: { filter?: string; maxResponses?: number; }): Promise; /** * Get a single response by ID */ protected getSingleGoogleFormsResponse(formId: string, responseId: string, accessToken: string): Promise; /** * Get form details including questions and settings */ protected getGoogleFormsDetails(formId: string, accessToken: string): Promise; /** * Normalize Google Forms response to common format */ protected normalizeGoogleFormsResponse(gfResponse: GoogleFormsResponseItem, formDetails?: GoogleFormsDetails): FormResponse; /** * Handle Google Forms-specific errors */ protected handleGoogleFormsError(error: any): Error; /** * Sleep helper for rate limiting and pagination delays */ protected sleep(ms: number): Promise; /** * Format date for Google Forms API (RFC3339 format) */ protected formatGoogleFormsDate(date: Date): string; /** * Parse Google Forms date string (RFC3339 format) */ protected parseGoogleFormsDate(dateValue: string): Date; /** * Extract question information from form details * Useful for building comprehensive reports with question titles */ protected extractQuestions(formDetails: GoogleFormsDetails): Array<{ id: string; title: string; type: string; required: boolean; }>; /** * Check if a form is a quiz */ protected isQuiz(formDetails: GoogleFormsDetails): boolean; /** * Build filter string for Google Forms API * Filters use a SQL-like syntax: timestamp > "2024-01-01T00:00:00Z" */ protected buildFilter(conditions: { timestampAfter?: Date; timestampBefore?: Date; }): string | undefined; } //# sourceMappingURL=googleforms-base.action.d.ts.map