2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-06-27 02:48:24 -07:00
2021-12-03 00:44:16 -08:00
export const documentOperations : INodeProperties [ ] = [
2021-06-27 02:48:24 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-06-27 02:48:24 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2022-07-10 13:50:51 -07:00
action : 'Create a document' ,
2021-06-27 02:48:24 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
2022-07-10 13:50:51 -07:00
action : 'Get a document' ,
2021-06-27 02:48:24 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
2022-07-10 13:50:51 -07:00
action : 'Update a document' ,
2021-06-27 02:48:24 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-06-27 02:48:24 -07:00
2021-12-03 00:44:16 -08:00
export const documentFields : INodeProperties [ ] = [
2021-06-27 02:48:24 -07:00
/* -------------------------------------------------------------------------- */
/* document: create */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Drive Name or ID' ,
2021-06-27 02:48:24 -07:00
name : 'driveId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>' ,
2021-06-27 02:48:24 -07:00
typeOptions : {
loadOptionsMethod : 'getDrives' ,
} ,
default : 'myDrive' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Folder Name or ID' ,
2021-06-27 02:48:24 -07:00
name : 'folderId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>' ,
2021-06-27 02:48:24 -07:00
typeOptions : {
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'driveId' ] ,
2021-06-27 02:48:24 -07:00
loadOptionsMethod : 'getFolders' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
/* -------------------------------------------------------------------------- */
/* document: get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc ID or URL' ,
name : 'documentURL' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'get' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The ID in the document URL (or just paste the whole URL)' ,
2021-06-27 02:48:24 -07:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-06-27 02:48:24 -07:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'get' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : true ,
2022-05-20 14:47:24 -07:00
description : 'Whether to return a simplified version of the response instead of the raw data' ,
2021-06-27 02:48:24 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* document: update */
/* -------------------------------------------------------------------------- */
{
displayName : 'Doc ID or URL' ,
name : 'documentURL' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The ID in the document URL (or just paste the whole URL)' ,
2021-06-27 02:48:24 -07:00
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Simplify' ,
2021-06-27 02:48:24 -07:00
name : 'simple' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : true ,
2022-05-20 14:47:24 -07:00
description : 'Whether to return a simplified version of the response instead of the raw data' ,
2021-06-27 02:48:24 -07:00
} ,
{
displayName : 'Actions' ,
name : 'actionsUi' ,
2022-05-06 14:01:25 -07:00
description : 'Actions applied to update the document' ,
2021-06-27 02:48:24 -07:00
type : 'fixedCollection' ,
placeholder : 'Add Action' ,
typeOptions : {
multipleValues : true ,
} ,
default : {
actionFields : [
{
object : 'text' ,
action : 'insert' ,
locationChoice : 'endOfSegmentLocation' ,
index : 0 ,
text : '' ,
} ,
] ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
options : [
{
name : 'actionFields' ,
displayName : 'Action Fields' ,
values : [
// Object field
{
displayName : 'Object' ,
name : 'object' ,
type : 'options' ,
options : [
{
name : 'Footer' ,
value : 'footer' ,
} ,
{
name : 'Header' ,
value : 'header' ,
} ,
{
name : 'Named Range' ,
value : 'namedRange' ,
} ,
{
name : 'Page Break' ,
value : 'pageBreak' ,
} ,
{
name : 'Paragraph Bullets' ,
value : 'paragraphBullets' ,
} ,
{
name : 'Positioned Object' ,
value : 'positionedObject' ,
} ,
{
name : 'Table' ,
value : 'table' ,
} ,
{
name : 'Table Column' ,
value : 'tableColumn' ,
} ,
{
name : 'Table Row' ,
value : 'tableRow' ,
} ,
{
name : 'Text' ,
value : 'text' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The update object' ,
2021-06-27 02:48:24 -07:00
default : 'text' ,
} ,
// Action fields (depend on the Object field)
{
displayName : 'Action' ,
name : 'action' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'Find and Replace Text' ,
2021-06-27 02:48:24 -07:00
value : 'replaceAll' ,
} ,
{
name : 'Insert' ,
value : 'insert' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update action' ,
2021-06-27 02:48:24 -07:00
default : '' ,
} ,
{
displayName : 'Action' ,
name : 'action' ,
type : 'options' ,
options : [
{
name : 'Create' ,
value : 'create' ,
} ,
{
name : 'Delete' ,
value : 'delete' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'footer' , 'header' , 'namedRange' , 'paragraphBullets' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update action' ,
2021-06-27 02:48:24 -07:00
default : '' ,
} ,
{
displayName : 'Action' ,
name : 'action' ,
type : 'options' ,
options : [
{
name : 'Delete' ,
value : 'delete' ,
} ,
{
name : 'Insert' ,
value : 'insert' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'tableColumn' , 'tableRow' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update action' ,
2021-06-27 02:48:24 -07:00
default : '' ,
} ,
{
displayName : 'Action' ,
name : 'action' ,
type : 'options' ,
options : [
{
name : 'Insert' ,
value : 'insert' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'pageBreak' , 'table' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update action' ,
2021-06-27 02:48:24 -07:00
default : '' ,
} ,
{
displayName : 'Action' ,
name : 'action' ,
type : 'options' ,
options : [
{
name : 'Delete' ,
value : 'delete' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'positionedObject' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update action' ,
2021-06-27 02:48:24 -07:00
default : '' ,
} ,
// Shared Segment inputs for Create action (moved up for display purposes)
{
displayName : 'Insert Segment' ,
name : 'insertSegment' ,
type : 'options' ,
options : [
{
name : 'Header' ,
value : 'header' ,
} ,
{
name : 'Body' ,
value : 'body' ,
} ,
{
name : 'Footer' ,
value : 'footer' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where to create the object' ,
2021-06-27 02:48:24 -07:00
default : 'body' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'footer' , 'header' , 'paragraphBullets' , 'namedRange' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Segment ID' ,
name : 'segmentId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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).' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'footer' , 'header' , 'paragraphBullets' , 'namedRange' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
hide : {
2022-08-17 08:50:24 -07:00
insertSegment : [ 'body' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// Inputs fields
// create footer
// create header
{
displayName : 'Index' ,
name : 'index' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based index, relative to the beginning of the specified segment' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'footer' , 'header' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// create named range
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
description : 'The name of the Named Range. Names do not need to be unique.' ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Start Index' ,
name : 'startIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based start index of this range' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'End Index' ,
name : 'endIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based end index of this range' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// create bullets
{
displayName : 'Style' ,
name : 'bulletPreset' ,
type : 'options' ,
options : [
{
name : 'Bullet List' ,
value : 'BULLET_DISC_CIRCLE_SQUARE' ,
2022-08-17 08:50:24 -07:00
description :
'A bulleted list with a <code>DISC</code>, <code>CIRCLE</code> and <code>SQUARE</code> bullet glyph for the first 3 list nesting levels' ,
2021-06-27 02:48:24 -07:00
} ,
{
name : 'Checkbox List' ,
value : 'BULLET_CHECKBOX' ,
2022-08-17 08:50:24 -07:00
description :
'A bulleted list with CHECKBOX bullet glyphs for all list nesting levels' ,
2021-06-27 02:48:24 -07:00
} ,
{
name : 'Numbered List' ,
value : 'NUMBERED_DECIMAL_NESTED' ,
2022-08-17 08:50:24 -07:00
description :
"A numbered list with <code>DECIMAL</code> numeric glyphs separated by periods, where each nesting level uses the previous nesting level's glyph as a prefix. For example: 1., 1.1., 2., 2.2 ." ,
2021-06-27 02:48:24 -07:00
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The Preset pattern of bullet glyphs for list' ,
2021-06-27 02:48:24 -07:00
default : 'BULLET_DISC_CIRCLE_SQUARE' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'paragraphBullets' ] ,
action : [ 'create' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// delete footer
{
displayName : 'Footer ID' ,
name : 'footerId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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.' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'footer' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// delete header
{
displayName : 'Header ID' ,
name : 'headerId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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.' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'header' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// delete named range
{
2022-06-03 10:23:49 -07:00
displayName : 'Specify Range By' ,
2021-06-27 02:48:24 -07:00
name : 'namedRangeReference' ,
type : 'options' ,
options : [
{
name : 'ID' ,
value : 'namedRangeId' ,
} ,
{
name : 'Name' ,
value : 'name' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The value determines which range or ranges to delete' ,
2021-06-27 02:48:24 -07:00
default : 'namedRangeId' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'ID' ,
name : 'value' ,
type : 'string' ,
2022-05-06 14:01:25 -07:00
description : 'The ID of the range' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'delete' ] ,
namedRangeReference : [ 'namedRangeId' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Name' ,
name : 'value' ,
type : 'string' ,
2022-05-06 14:01:25 -07:00
description : 'The name of the range' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'namedRange' ] ,
action : [ 'delete' ] ,
namedRangeReference : [ 'name' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// delete bullets (shared inputs added below)
// delete positioned object
{
displayName : 'Object ID' ,
name : 'objectId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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/PositionedObject">documentation</a>' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'positionedObject' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// insert table column/row (shared inputs added below)
// delete table column/row (shared inputs added below)
// Shared Segment inputs for Insert action (moved up for display purposes)
{
displayName : 'Insert Segment' ,
name : 'insertSegment' ,
type : 'options' ,
options : [
{
name : 'Header' ,
value : 'header' ,
} ,
{
name : 'Body' ,
value : 'body' ,
} ,
{
name : 'Footer' ,
value : 'footer' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where to create the object' ,
2021-06-27 02:48:24 -07:00
default : 'body' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'pageBreak' , 'table' , 'tableColumn' , 'tableRow' , 'text' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Segment ID' ,
name : 'segmentId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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).' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'pageBreak' , 'table' , 'tableColumn' , 'tableRow' , 'text' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
hide : {
2022-08-17 08:50:24 -07:00
insertSegment : [ 'body' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// insert page break
{
displayName : 'Insert Location' ,
name : 'locationChoice' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'At End of Specific Position' ,
2021-06-27 02:48:24 -07:00
value : 'endOfSegmentLocation' ,
2022-08-17 08:50:24 -07:00
description :
'Inserts the text at the end of a header, footer, footnote, or document body' ,
2021-06-27 02:48:24 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'At Index' ,
2021-06-27 02:48:24 -07:00
value : 'location' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where the text will be inserted' ,
2021-06-27 02:48:24 -07:00
default : 'endOfSegmentLocation' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'pageBreak' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Index' ,
name : 'index' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based index, relative to the beginning of the specified segment' ,
2021-06-27 02:48:24 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
locationChoice : [ 'location' ] ,
object : [ 'pageBreak' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
} ,
default : 1 ,
} ,
// insert table
{
displayName : 'Insert Location' ,
name : 'locationChoice' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'At End of Specific Position' ,
2021-06-27 02:48:24 -07:00
value : 'endOfSegmentLocation' ,
2022-08-17 08:50:24 -07:00
description :
'Inserts the text at the end of a header, footer, footnote, or document body' ,
2021-06-27 02:48:24 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'At Index' ,
2021-06-27 02:48:24 -07:00
value : 'location' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where the text will be inserted' ,
2021-06-27 02:48:24 -07:00
default : 'endOfSegmentLocation' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'table' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Index' ,
name : 'index' ,
type : 'number' ,
2022-08-17 08:50:24 -07:00
description :
'The zero-based index, relative to the beginning of the specified segment (use index + 1 to refer to a table)' ,
2021-06-27 02:48:24 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
locationChoice : [ 'location' ] ,
object : [ 'table' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : 1 ,
typeOptions : {
minValue : 1 ,
} ,
} ,
{
displayName : 'Rows' ,
name : 'rows' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The number of rows in the table' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'table' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Columns' ,
name : 'columns' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The number of columns in the table' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'table' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// insert text
{
displayName : 'Insert Location' ,
name : 'locationChoice' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'At End of Specific Position' ,
2021-06-27 02:48:24 -07:00
value : 'endOfSegmentLocation' ,
2022-08-17 08:50:24 -07:00
description :
'Inserts the text at the end of a header, footer, footnote, or document body' ,
2021-06-27 02:48:24 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
name : 'At Index' ,
2021-06-27 02:48:24 -07:00
value : 'location' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where the text will be inserted' ,
2021-06-27 02:48:24 -07:00
default : 'endOfSegmentLocation' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Index' ,
name : 'index' ,
type : 'number' ,
typeOptions : {
minValue : 1 ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based index, relative to the beginning of the specified segment' ,
2021-06-27 02:48:24 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
locationChoice : [ 'location' ] ,
object : [ 'text' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
default : 1 ,
} ,
{
displayName : 'Text' ,
name : 'text' ,
type : 'string' ,
2022-05-06 14:01:25 -07:00
description : 'The text to insert in the document' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// replace all text
{
displayName : 'Old Text' ,
name : 'text' ,
type : 'string' ,
2022-05-06 14:01:25 -07:00
description : 'The text to search for in the document' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
action : [ 'replaceAll' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'New Text' ,
name : 'replaceText' ,
type : 'string' ,
2022-05-06 14:01:25 -07:00
description : 'The text that will replace the matched text' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
action : [ 'replaceAll' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Match Case' ,
name : 'matchCase' ,
type : 'boolean' ,
2022-06-20 07:54:01 -07:00
description : 'Whether the search should respect case sensitivity' ,
2021-06-27 02:48:24 -07:00
default : false ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'text' ] ,
action : [ 'replaceAll' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// Shared Segment inputs for Delete action
{
displayName : 'Insert Segment' ,
name : 'insertSegment' ,
type : 'options' ,
options : [
{
name : 'Header' ,
value : 'header' ,
} ,
{
name : 'Body' ,
value : 'body' ,
} ,
{
name : 'Footer' ,
value : 'footer' ,
} ,
] ,
2022-05-06 14:01:25 -07:00
description : 'The location where to create the object' ,
2021-06-27 02:48:24 -07:00
default : 'body' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'paragraphBullets' , 'tableColumn' , 'tableRow' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Segment ID' ,
name : 'segmentId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'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).' ,
2021-06-27 02:48:24 -07:00
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'paragraphBullets' , 'tableColumn' , 'tableRow' ] ,
action : [ 'delete' ] ,
2021-06-27 02:48:24 -07:00
} ,
hide : {
2022-08-17 08:50:24 -07:00
insertSegment : [ 'body' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// Shared inputs for paragraph bullets
{
displayName : 'Start Index' ,
name : 'startIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based start index of this range' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'paragraphBullets' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'End Index' ,
name : 'endIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based end index of this range' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'paragraphBullets' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
// Shared inputs for table column/row
{
displayName : 'Insert Position' ,
name : 'insertPosition' ,
type : 'options' ,
options : [
{
2022-06-03 10:23:49 -07:00
name : 'Before Content at Index' ,
2021-06-27 02:48:24 -07:00
value : false ,
} ,
{
2022-06-03 10:23:49 -07:00
name : 'After Content at Index' ,
2021-06-27 02:48:24 -07:00
value : true ,
} ,
] ,
default : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'tableColumn' , 'tableRow' ] ,
action : [ 'insert' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Index' ,
name : 'index' ,
type : 'number' ,
2022-08-17 08:50:24 -07:00
description :
'The zero-based index, relative to the beginning of the specified segment (use index + 1 to refer to a table)' ,
2021-06-27 02:48:24 -07:00
default : 1 ,
typeOptions : {
minValue : 1 ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'tableColumn' , 'tableRow' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Row Index' ,
name : 'rowIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based row index' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'tableColumn' , 'tableRow' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
{
displayName : 'Column Index' ,
name : 'columnIndex' ,
type : 'number' ,
2022-05-06 14:01:25 -07:00
description : 'The zero-based column index' ,
2021-06-27 02:48:24 -07:00
default : 0 ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
object : [ 'tableColumn' , 'tableRow' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'fixedCollection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'document' ] ,
2021-06-27 02:48:24 -07:00
} ,
} ,
options : [
{
displayName : 'Write Control Object' ,
name : 'writeControlObject' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Revision Mode' ,
2021-06-27 02:48:24 -07:00
name : 'control' ,
type : 'options' ,
options : [
{
name : 'Target' ,
value : 'targetRevisionId' ,
2022-08-17 08:50:24 -07:00
description :
'Apply changes to the latest revision. Otherwise changes will not be processed.' ,
2021-06-27 02:48:24 -07:00
} ,
{
name : 'Required' ,
value : 'requiredRevisionId' ,
2022-08-17 08:50:24 -07:00
description :
"Apply changes to the provided revision while incorporating other collaborators' changes. This mode is used for the recent revision, Otherwise changes will not be processed." ,
2021-06-27 02:48:24 -07:00
} ,
] ,
default : 'requiredRevisionId' ,
2022-05-06 14:01:25 -07:00
description : 'Determines how the changes are applied to the revision' ,
2021-06-27 02:48:24 -07:00
} ,
{
displayName : 'Revision ID' ,
name : 'value' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;