n8n-nodes-base
Version:
Base nodes of n8n
134 lines (128 loc) • 5.69 kB
text/typescript
/**
* Google Sheets Trigger Node - Version 1
* Starts the workflow when Google Sheets events occur
*/
export interface GoogleSheetsTriggerV1Params {
/**
* Time at which polling should occur
* @default {"item":[{"mode":"everyMinute"}]}
*/
pollTimes?: {
/** Item
*/
item?: Array<{
/** How often to trigger.
* @default everyDay
*/
mode?: 'everyMinute' | 'everyHour' | 'everyDay' | 'everyWeek' | 'everyMonth' | 'everyX' | 'custom' | Expression<string>;
/** The hour of the day to trigger (24h format)
* @displayOptions.hide { mode: ["custom", "everyHour", "everyMinute", "everyX"] }
* @default 14
*/
hour?: number | Expression<number>;
/** The minute of the day to trigger
* @displayOptions.hide { mode: ["custom", "everyMinute", "everyX"] }
* @default 0
*/
minute?: number | Expression<number>;
/** The day of the month to trigger
* @displayOptions.show { mode: ["everyMonth"] }
* @default 1
*/
dayOfMonth?: number | Expression<number>;
/** The weekday to trigger
* @displayOptions.show { mode: ["everyWeek"] }
* @default 1
*/
weekday?: '1' | '2' | '3' | '4' | '5' | '6' | '0' | Expression<string>;
/** Use custom cron expression. Values and ranges as follows:<ul><li>Seconds: 0-59</li><li>Minutes: 0 - 59</li><li>Hours: 0 - 23</li><li>Day of Month: 1 - 31</li><li>Months: 0 - 11 (Jan - Dec)</li><li>Day of Week: 0 - 6 (Sun - Sat)</li></ul>
* @displayOptions.show { mode: ["custom"] }
* @default * * * * * *
*/
cronExpression?: string | Expression<string> | PlaceholderValue;
/** All how many X minutes/hours it should trigger
* @displayOptions.show { mode: ["everyX"] }
* @default 2
*/
value?: number | Expression<number>;
/** If it should trigger all X minutes or hours
* @displayOptions.show { mode: ["everyX"] }
* @default hours
*/
unit?: 'minutes' | 'hours' | Expression<string>;
}>;
};
authentication?: unknown;
documentId?: { __rl: true; mode: 'list' | 'url' | 'id'; value: string; cachedResultName?: string };
sheetName?: { __rl: true; mode: 'list' | 'url' | 'id'; value: string; cachedResultName?: string };
/**
* It will be triggered also by newly created columns (if the 'Columns to Watch' option is not set)
* @default anyUpdate
*/
event?: 'rowAdded' | 'rowUpdate' | 'anyUpdate' | Expression<string>;
/**
* This option will be effective only when automatically executing the workflow
* @displayOptions.hide { event: ["rowAdded"] }
* @default new
*/
includeInOutput?: 'new' | 'old' | 'both' | Expression<string>;
options?: {
/** Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>
* @displayOptions.show { /event: ["anyUpdate", "rowUpdate"] }
* @default []
*/
columnsToWatch?: string[];
/** Data Location on Sheet
* @default {"values":{"rangeDefinition":"specifyRangeA1"}}
*/
dataLocationOnSheet?: {
/** Values
*/
values?: {
/** Range Definition
*/
rangeDefinition?: 'specifyRangeA1' | 'specifyRange' | Expression<string>;
/** Index of the row which contains the keys. Starts at 1. The incoming node data is matched to the keys for assignment. The matching is case sensitive.
* @hint First row is row 1
* @displayOptions.show { rangeDefinition: ["specifyRange"] }
* @default 1
*/
headerRow?: number | Expression<number>;
/** Index of the first row which contains the actual data and not the keys. Starts with 1.
* @hint First row is row 1
* @displayOptions.show { rangeDefinition: ["specifyRange"] }
* @default 2
*/
firstDataRow?: number | Expression<number>;
/** The table range to read from or to append data to. See the Google <a href="https://developers.google.com/sheets/api/guides/values#writing">documentation</a> for the details.
* @hint You can specify both the rows and the columns, e.g. C4:E7
* @displayOptions.show { rangeDefinition: ["specifyRangeA1"] }
*/
range?: string | Expression<string> | PlaceholderValue;
};
};
/** Determines how values will be rendered in the output. <a href="https://developers.google.com/sheets/api/reference/rest/v4/ValueRenderOption" target="_blank">More info</a>.
* @displayOptions.hide { /event: ["anyUpdate", "rowUpdate"] }
* @default UNFORMATTED_VALUE
*/
valueRender?: 'UNFORMATTED_VALUE' | 'FORMATTED_VALUE' | 'FORMULA' | Expression<string>;
/** Determines how dates should be rendered in the output. <a href="https://developers.google.com/sheets/api/reference/rest/v4/DateTimeRenderOption" target="_blank">More info</a>.
* @displayOptions.hide { /event: ["anyUpdate", "rowUpdate"] }
* @default SERIAL_NUMBER
*/
dateTimeRenderOption?: 'SERIAL_NUMBER' | 'FORMATTED_STRING' | Expression<string>;
};
}
export interface GoogleSheetsTriggerV1Credentials {
googleSheetsTriggerOAuth2Api: CredentialReference;
}
interface GoogleSheetsTriggerV1NodeBase {
type: 'n8n-nodes-base.googleSheetsTrigger';
version: 1;
credentials?: GoogleSheetsTriggerV1Credentials;
isTrigger: true;
}
export type GoogleSheetsTriggerV1ParamsNode = GoogleSheetsTriggerV1NodeBase & {
config: NodeConfig<GoogleSheetsTriggerV1Params>;
};
export type GoogleSheetsTriggerV1Node = GoogleSheetsTriggerV1ParamsNode;