/** * Google Docs Node - Version 2 * Discriminator: resource=document, operation=update */ interface Credentials { googleApi: CredentialReference; googleDocsOAuth2Api: CredentialReference; } export type GoogleDocsV2DocumentUpdateParams = { resource: 'document'; operation: 'update'; /** * Authentication * @default oAuth2 */ authentication?: 'oAuth2' | 'serviceAccount' | Expression; /** * The ID in the document URL (or just paste the whole URL) */ documentURL?: string | Expression | PlaceholderValue; /** * Whether to return a simplified version of the response instead of the raw data * @default true */ simple?: boolean | Expression; /** * Actions applied to update the document * @default {"actionFields":[{"object":"text","action":"insert","locationChoice":"endOfSegmentLocation","index":0,"text":""}]} */ actionsUi?: { /** Action Fields */ actionFields?: Array<{ /** The update object * @default text */ object?: 'footer' | 'header' | 'namedRange' | 'pageBreak' | 'paragraphBullets' | 'positionedObject' | 'table' | 'tableColumn' | 'tableRow' | 'text' | Expression; /** The update action * @displayOptions.show { object: ["text"] } */ action?: 'replaceAll' | 'insert' | Expression; /** The update action * @displayOptions.show { object: ["footer", "header", "namedRange", "paragraphBullets"] } */ action?: 'create' | 'delete' | Expression; /** The update action * @displayOptions.show { object: ["tableColumn", "tableRow"] } */ action?: 'delete' | 'insert' | Expression; /** The update action * @displayOptions.show { object: ["pageBreak", "table"] } */ action?: 'insert' | Expression; /** The update action * @displayOptions.show { object: ["positionedObject"] } */ action?: 'delete' | Expression; /** The location where to create the object * @displayOptions.show { object: ["footer", "header", "paragraphBullets", "namedRange"], action: ["create"] } * @default body */ insertSegment?: 'header' | 'body' | 'footer' | Expression; /** The ID of the header, footer or footnote. The <code>Document → Get</code> operation lists all segment IDs (make sure you disable the <code>simple</code> toggle). * @displayOptions.show { object: ["footer", "header", "paragraphBullets", "namedRange"], action: ["create"] } * @displayOptions.hide { insertSegment: ["body"] } */ segmentId?: string | Expression | PlaceholderValue; /** The zero-based index, relative to the beginning of the specified segment * @displayOptions.show { object: ["footer", "header"], action: ["create"] } * @default 0 */ index?: number | Expression; /** The name of the Named Range. Names do not need to be unique. * @displayOptions.show { object: ["namedRange"], action: ["create"] } */ name?: string | Expression | PlaceholderValue; /** The zero-based start index of this range * @displayOptions.show { object: ["namedRange"], action: ["create"] } * @default 0 */ startIndex?: number | Expression; /** The zero-based end index of this range * @displayOptions.show { object: ["namedRange"], action: ["create"] } * @default 0 */ endIndex?: number | Expression; /** The Preset pattern of bullet glyphs for list * @displayOptions.show { object: ["paragraphBullets"], action: ["create"] } * @default BULLET_DISC_CIRCLE_SQUARE */ bulletPreset?: 'BULLET_DISC_CIRCLE_SQUARE' | 'BULLET_CHECKBOX' | 'NUMBERED_DECIMAL_NESTED' | Expression; /** The ID of the footer to delete. To retrieve it, use the <code>get document</code> where you can find under <code>footers</code> attribute. * @displayOptions.show { object: ["footer"], action: ["delete"] } */ footerId?: string | Expression | PlaceholderValue; /** The ID of the header to delete. To retrieve it, use the <code>get document</code> where you can find under <code>headers</code> attribute. * @displayOptions.show { object: ["header"], action: ["delete"] } */ headerId?: string | Expression | PlaceholderValue; /** The value determines which range or ranges to delete * @displayOptions.show { object: ["namedRange"], action: ["delete"] } * @default namedRangeId */ namedRangeReference?: 'namedRangeId' | 'name' | Expression; /** The ID of the range * @displayOptions.show { object: ["namedRange"], action: ["delete"], namedRangeReference: ["namedRangeId"] } */ value?: string | Expression | PlaceholderValue; /** The name of the range * @displayOptions.show { object: ["namedRange"], action: ["delete"], namedRangeReference: ["name"] } */ value?: string | Expression | PlaceholderValue; /** The ID of the positioned object to delete (An object that is tied to a paragraph and positioned relative to its beginning), See the Google <a href="https://developers.google.com/docs/api/reference/rest/v1/documents#positionedobject" target="_blank">documentation</a> * @displayOptions.show { object: ["positionedObject"], action: ["delete"] } */ objectId?: string | Expression | PlaceholderValue; /** The location where to create the object * @displayOptions.show { object: ["pageBreak", "table", "tableColumn", "tableRow", "text"], action: ["insert"] } * @default body */ insertSegment?: 'header' | 'body' | 'footer' | Expression; /** The ID of the header, footer or footnote. The <code>Document → Get</code> operation lists all segment IDs (make sure you disable the <code>simple</code> toggle). * @displayOptions.show { object: ["pageBreak", "table", "tableColumn", "tableRow", "text"], action: ["insert"] } * @displayOptions.hide { insertSegment: ["body"] } */ segmentId?: string | Expression | PlaceholderValue; /** The location where the text will be inserted * @displayOptions.show { object: ["pageBreak"], action: ["insert"] } * @default endOfSegmentLocation */ locationChoice?: 'endOfSegmentLocation' | 'location' | Expression; /** The zero-based index, relative to the beginning of the specified segment * @displayOptions.show { locationChoice: ["location"], object: ["pageBreak"], action: ["insert"] } * @default 1 */ index?: number | Expression; /** The location where the text will be inserted * @displayOptions.show { object: ["table"], action: ["insert"] } * @default endOfSegmentLocation */ locationChoice?: 'endOfSegmentLocation' | 'location' | Expression; /** The zero-based index, relative to the beginning of the specified segment (use index + 1 to refer to a table) * @displayOptions.show { locationChoice: ["location"], object: ["table"], action: ["insert"] } * @default 1 */ index?: number | Expression; /** The number of rows in the table * @displayOptions.show { object: ["table"], action: ["insert"] } * @default 0 */ rows?: number | Expression; /** The number of columns in the table * @displayOptions.show { object: ["table"], action: ["insert"] } * @default 0 */ columns?: number | Expression; /** The location where the text will be inserted * @displayOptions.show { object: ["text"], action: ["insert"] } * @default endOfSegmentLocation */ locationChoice?: 'endOfSegmentLocation' | 'location' | Expression; /** The zero-based index, relative to the beginning of the specified segment * @displayOptions.show { locationChoice: ["location"], object: ["text"], action: ["insert"] } * @default 1 */ index?: number | Expression; /** The text to insert in the document * @displayOptions.show { object: ["text"], action: ["insert"] } */ text?: string | Expression | PlaceholderValue; /** The text to search for in the document * @displayOptions.show { object: ["text"], action: ["replaceAll"] } */ text?: string | Expression | PlaceholderValue; /** The text that will replace the matched text * @displayOptions.show { object: ["text"], action: ["replaceAll"] } */ replaceText?: string | Expression | PlaceholderValue; /** Whether the search should respect case sensitivity * @displayOptions.show { object: ["text"], action: ["replaceAll"] } * @default false */ matchCase?: boolean | Expression; /** The location where to create the object * @displayOptions.show { object: ["paragraphBullets", "tableColumn", "tableRow"], action: ["delete"] } * @default body */ insertSegment?: 'header' | 'body' | 'footer' | Expression; /** The ID of the header, footer or footnote. The <code>Document → Get</code> operation lists all segment IDs (make sure you disable the <code>simple</code> toggle). * @displayOptions.show { object: ["paragraphBullets", "tableColumn", "tableRow"], action: ["delete"] } * @displayOptions.hide { insertSegment: ["body"] } */ segmentId?: string | Expression | PlaceholderValue; /** The zero-based start index of this range * @displayOptions.show { object: ["paragraphBullets"] } * @default 0 */ startIndex?: number | Expression; /** The zero-based end index of this range * @displayOptions.show { object: ["paragraphBullets"] } * @default 0 */ endIndex?: number | Expression; /** Insert Position * @displayOptions.show { object: ["tableColumn", "tableRow"], action: ["insert"] } * @default true */ insertPosition?: false | true | Expression; /** The zero-based index, relative to the beginning of the specified segment (use index + 1 to refer to a table) * @displayOptions.show { object: ["tableColumn", "tableRow"] } * @default 1 */ index?: number | Expression; /** The zero-based row index * @displayOptions.show { object: ["tableColumn", "tableRow"] } * @default 0 */ rowIndex?: number | Expression; /** The zero-based column index * @displayOptions.show { object: ["tableColumn", "tableRow"] } * @default 0 */ columnIndex?: number | Expression; }>; }; /** * Update Fields * @default {} */ updateFields?: { /** Write Control Object */ writeControlObject?: { /** Determines how the changes are applied to the revision * @default requiredRevisionId */ control?: 'targetRevisionId' | 'requiredRevisionId' | Expression; /** Revision ID */ value?: string | Expression | PlaceholderValue; }; }; }; export type GoogleDocsV2DocumentUpdateOutput = { documentId?: string; }; export type GoogleDocsV2DocumentUpdateNode = { type: 'n8n-nodes-base.googleDocs'; version: 2; credentials?: Credentials; config: NodeConfig; output?: Items; };