Files
wehub-resource-sync d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

151 lines
4.4 KiB
TypeScript

import { GoogleSheetsIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
export const googleSheetsPollingTrigger: TriggerConfig = {
id: 'google_sheets_poller',
name: 'Google Sheets New Row Trigger',
provider: 'google-sheets',
description: 'Triggers when new rows are added to a Google Sheet',
version: '1.0.0',
icon: GoogleSheetsIcon,
polling: true,
subBlocks: [
{
id: 'triggerCredentials',
title: 'Credentials',
type: 'oauth-input',
description: 'Connect your Google account to access Google Sheets.',
serviceId: 'google-sheets',
requiredScopes: [],
required: true,
mode: 'trigger',
canonicalParamId: 'oauthCredential',
},
{
id: 'spreadsheetId',
title: 'Spreadsheet',
type: 'file-selector',
description: 'The spreadsheet to monitor for new rows.',
required: true,
mode: 'trigger',
canonicalParamId: 'spreadsheetId',
serviceId: 'google-sheets',
selectorKey: 'google.drive',
mimeType: 'application/vnd.google-apps.spreadsheet',
dependsOn: ['triggerCredentials'],
},
{
id: 'manualSpreadsheetId',
title: 'Spreadsheet ID',
type: 'short-input',
placeholder: 'ID from URL: docs.google.com/spreadsheets/d/{ID}/edit',
description: 'The spreadsheet to monitor for new rows.',
required: true,
mode: 'trigger-advanced',
canonicalParamId: 'spreadsheetId',
},
{
id: 'sheetName',
title: 'Sheet Tab',
type: 'sheet-selector',
description: 'The sheet tab to monitor for new rows.',
required: true,
mode: 'trigger',
canonicalParamId: 'sheetName',
serviceId: 'google-sheets',
selectorKey: 'google.sheets',
selectorAllowSearch: false,
dependsOn: { all: ['triggerCredentials'], any: ['spreadsheetId', 'manualSpreadsheetId'] },
},
{
id: 'manualSheetName',
title: 'Sheet Tab Name',
type: 'short-input',
placeholder: 'Enter sheet tab name (e.g., Sheet1)',
description: 'The sheet tab to monitor for new rows.',
required: true,
mode: 'trigger-advanced',
canonicalParamId: 'sheetName',
},
{
id: 'valueRenderOption',
title: 'Value Render',
type: 'dropdown',
options: [
{ id: 'FORMATTED_VALUE', label: 'Formatted Value' },
{ id: 'UNFORMATTED_VALUE', label: 'Unformatted Value' },
{ id: 'FORMULA', label: 'Formula' },
],
defaultValue: 'FORMATTED_VALUE',
description:
'How values are rendered. Formatted returns display strings, Unformatted returns raw numbers/booleans, Formula returns the formula text.',
required: false,
mode: 'trigger',
},
{
id: 'dateTimeRenderOption',
title: 'Date/Time Render',
type: 'dropdown',
options: [
{ id: 'SERIAL_NUMBER', label: 'Serial Number' },
{ id: 'FORMATTED_STRING', label: 'Formatted String' },
],
defaultValue: 'SERIAL_NUMBER',
description:
'How dates and times are rendered. Only applies when Value Render is not "Formatted Value".',
required: false,
mode: 'trigger',
},
{
id: 'triggerInstructions',
title: 'Setup Instructions',
hideFromPreview: true,
type: 'text',
defaultValue: [
'Connect your Google account using OAuth credentials',
'Select the spreadsheet to monitor',
'Select the sheet tab to monitor',
'The system will automatically detect new rows appended to the sheet',
]
.map(
(instruction, index) =>
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
)
.join(''),
mode: 'trigger',
},
],
outputs: {
row: {
type: 'json',
description: 'Row data mapped to column headers from row 1',
},
rawRow: {
type: 'json',
description: 'Raw row values as an array',
},
headers: {
type: 'json',
description: 'Column headers from row 1',
},
rowNumber: {
type: 'number',
description: 'The 1-based row number of the new row',
},
spreadsheetId: {
type: 'string',
description: 'The spreadsheet ID',
},
sheetName: {
type: 'string',
description: 'The sheet tab name',
},
timestamp: {
type: 'string',
description: 'Event timestamp in ISO format',
},
},
}