Skip to content

Commit 956c96f

Browse files
committed
fix(docs): stop truncating quoted descriptions, tighten the cleanup guard
Review findings from round 1. - parseSubBlockObject read string properties with a single `['"]…[^'"]+…['"]` character class, which ends the match at the first quote of either kind. Any description holding an apostrophe inside a double-quoted string was cut mid-word ("Your app", "Found in your Zoom app"). Matches the opening quote to its own closing quote now, reusing the alternation the tool-description extractor already used. Restores full text across calendly, gmail, google_sheets, hubspot, intercom, whatsapp, and zoom. - The stale-doc cleanup guard tested for a bare `MANUAL-CONTENT-START` substring, so a stray or unterminated marker would pin a stale page that has nothing recoverable. It now gates on what extractManualContent actually returns.
1 parent 0cd6553 commit 956c96f

8 files changed

Lines changed: 48 additions & 32 deletions

File tree

apps/docs/content/docs/en/integrations/calendly.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Trigger workflow when someone cancels a scheduled event on Calendly
306306
| Parameter | Type | Required | Description |
307307
| --------- | ---- | -------- | ----------- |
308308
| `apiKey` | string | Yes | Personal Access Token |
309-
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from |
309+
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from "Get Current User" operation. |
310310

311311
#### Output
312312

@@ -361,7 +361,7 @@ Trigger workflow when someone schedules a new event on Calendly
361361
| Parameter | Type | Required | Description |
362362
| --------- | ---- | -------- | ----------- |
363363
| `apiKey` | string | Yes | Personal Access Token |
364-
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from |
364+
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from "Get Current User" operation. |
365365

366366
#### Output
367367

@@ -416,7 +416,7 @@ Trigger workflow when someone submits a Calendly routing form
416416
| Parameter | Type | Required | Description |
417417
| --------- | ---- | -------- | ----------- |
418418
| `apiKey` | string | Yes | Personal Access Token |
419-
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from |
419+
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from "Get Current User" operation. |
420420

421421
#### Output
422422

@@ -451,7 +451,7 @@ Trigger workflow from any Calendly webhook event
451451
| Parameter | Type | Required | Description |
452452
| --------- | ---- | -------- | ----------- |
453453
| `apiKey` | string | Yes | Personal Access Token |
454-
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from |
454+
| `organization` | string | Yes | Organization URI for the webhook subscription. Get this from "Get Current User" operation. |
455455

456456
#### Output
457457

apps/docs/content/docs/en/integrations/gmail.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Triggers when new emails are received in Gmail (requires Gmail credentials)
333333
| `triggerCredentials` | string | Yes | This trigger requires google email credentials to access your account. |
334334
| `labelIds` | string | No | Choose which Gmail labels to monitor. Leave empty to monitor all emails. |
335335
| `labelFilterBehavior` | string | Yes | Include only emails with selected labels, or exclude emails with selected labels |
336-
| `searchQuery` | string | No | Optional Gmail search query to filter emails. Use the same format as Gmail search box \(e.g., |
336+
| `searchQuery` | string | No | Optional Gmail search query to filter emails. Use the same format as Gmail search box \(e.g., "subject:invoice", "from:boss@company.com", "has:attachment"\). Leave empty to search all emails. |
337337
| `markAsRead` | boolean | No | Automatically mark emails as read after processing |
338338
| `includeAttachments` | boolean | No | Download and include email attachments in the trigger payload |
339339

apps/docs/content/docs/en/integrations/google_sheets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Triggers when new rows are added to a Google Sheet
404404
| `sheetName` | sheet-selector | Yes | The sheet tab to monitor for new rows. |
405405
| `manualSheetName` | string | Yes | The sheet tab to monitor for new rows. |
406406
| `valueRenderOption` | string | No | How values are rendered. Formatted returns display strings, Unformatted returns raw numbers/booleans, Formula returns the formula text. |
407-
| `dateTimeRenderOption` | string | No | How dates and times are rendered. Only applies when Value Render is not |
407+
| `dateTimeRenderOption` | string | No | How dates and times are rendered. Only applies when Value Render is not "Formatted Value". |
408408

409409
#### Output
410410

apps/docs/content/docs/en/integrations/hubspot.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,15 +2060,15 @@ Triggers when HubSpot CRM records (contacts, companies, deals, tickets, custom o
20602060
| --------- | ---- | -------- | ----------- |
20612061
| `triggerCredentials` | string | Yes | Connect a HubSpot account so Sim can poll your CRM on your behalf. |
20622062
| `objectType` | string | Yes | What you want to watch. |
2063-
| `customObjectTypeId` | string | No | HubSpot custom object type ID \(e.g. |
2063+
| `customObjectTypeId` | string | No | HubSpot custom object type ID \(e.g. "2-12345"\). Find it in HubSpot Settings → Objects → Custom Objects. |
20642064
| `listId` | string | No | The HubSpot list to watch for new members. |
20652065
| `eventType` | string | No | Created fires once per new record. Updated fires on any modification. Property Changed fires only when the chosen property changes value. |
20662066
| `targetPropertyName` | string | No | Fires only when this specific property changes value on a record. |
20672067
| `properties` | string | No | Properties to include on each record. Leave empty to use sensible defaults. Sim always includes the timestamps it needs internally. |
20682068
| `pipelineId` | string | No | Restrict to a single pipeline. |
20692069
| `stageId` | string | No | Restrict to a single stage within the selected pipeline. |
20702070
| `ownerId` | string | No | Restrict to records owned by a specific HubSpot user. |
2071-
| `filters` | string | No | JSON array of HubSpot search filters, AND-combined. Each item: \{ |
2071+
| `filters` | string | No | JSON array of HubSpot search filters, AND-combined. Each item: \{"propertyName":"...","operator":"EQ","value":"..."\}. Operators: EQ, NEQ, CONTAINS_TOKEN, NOT_CONTAINS_TOKEN, GT, GTE, LT, LTE, BETWEEN, IN, NOT_IN, HAS_PROPERTY, NOT_HAS_PROPERTY. |
20722072
| `maxRecordsPerPoll` | string | No | Soft cap on records emitted per poll \(default 50, max 1000\). Excess rolls over to the next poll. |
20732073

20742074
#### Output

apps/docs/content/docs/en/integrations/intercom.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ Trigger workflow when a new lead is created in Intercom
11011101

11021102
| Parameter | Type | Required | Description |
11031103
| --------- | ---- | -------- | ----------- |
1104-
| `webhookSecret` | string | No | Your app |
1104+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
11051105

11061106
#### Output
11071107

@@ -1126,7 +1126,7 @@ Trigger workflow when a conversation is closed in Intercom
11261126

11271127
| Parameter | Type | Required | Description |
11281128
| --------- | ---- | -------- | ----------- |
1129-
| `webhookSecret` | string | No | Your app |
1129+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
11301130

11311131
#### Output
11321132

@@ -1151,7 +1151,7 @@ Trigger workflow when a new conversation is created in Intercom
11511151

11521152
| Parameter | Type | Required | Description |
11531153
| --------- | ---- | -------- | ----------- |
1154-
| `webhookSecret` | string | No | Your app |
1154+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
11551155

11561156
#### Output
11571157

@@ -1176,7 +1176,7 @@ Trigger workflow when someone replies to an Intercom conversation
11761176

11771177
| Parameter | Type | Required | Description |
11781178
| --------- | ---- | -------- | ----------- |
1179-
| `webhookSecret` | string | No | Your app |
1179+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
11801180

11811181
#### Output
11821182

@@ -1201,7 +1201,7 @@ Trigger workflow when a new user is created in Intercom
12011201

12021202
| Parameter | Type | Required | Description |
12031203
| --------- | ---- | -------- | ----------- |
1204-
| `webhookSecret` | string | No | Your app |
1204+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
12051205

12061206
#### Output
12071207

@@ -1226,7 +1226,7 @@ Trigger workflow on any Intercom webhook event
12261226

12271227
| Parameter | Type | Required | Description |
12281228
| --------- | ---- | -------- | ----------- |
1229-
| `webhookSecret` | string | No | Your app |
1229+
| `webhookSecret` | string | No | Your app's Client Secret from the Developer Hub. Used to verify webhook authenticity via X-Hub-Signature. |
12301230

12311231
#### Output
12321232

apps/docs/content/docs/en/integrations/whatsapp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Trigger workflow from WhatsApp incoming messages and message status webhooks
369369

370370
| Parameter | Type | Required | Description |
371371
| --------- | ---- | -------- | ----------- |
372-
| `verificationToken` | string | Yes | Enter any secure token here. You |
372+
| `verificationToken` | string | Yes | Enter any secure token here. You'll need to provide the same token in your WhatsApp Business Platform dashboard. |
373373
| `appSecret` | string | Yes | Required for WhatsApp POST signature verification. Sim uses it to validate the X-Hub-Signature-256 header on every webhook delivery. |
374374

375375
#### Output

apps/docs/content/docs/en/integrations/zoom.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Trigger workflow when a Zoom meeting ends
431431

432432
| Parameter | Type | Required | Description |
433433
| --------- | ---- | -------- | ----------- |
434-
| `secretToken` | string | Yes | Found in your Zoom app |
434+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
435435

436436
#### Output
437437

@@ -454,7 +454,7 @@ Trigger workflow when a Zoom meeting starts
454454

455455
| Parameter | Type | Required | Description |
456456
| --------- | ---- | -------- | ----------- |
457-
| `secretToken` | string | Yes | Found in your Zoom app |
457+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
458458

459459
#### Output
460460

@@ -477,7 +477,7 @@ Trigger workflow when a participant joins a Zoom meeting
477477

478478
| Parameter | Type | Required | Description |
479479
| --------- | ---- | -------- | ----------- |
480-
| `secretToken` | string | Yes | Found in your Zoom app |
480+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
481481

482482
#### Output
483483

@@ -500,7 +500,7 @@ Trigger workflow when a participant leaves a Zoom meeting
500500

501501
| Parameter | Type | Required | Description |
502502
| --------- | ---- | -------- | ----------- |
503-
| `secretToken` | string | Yes | Found in your Zoom app |
503+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
504504

505505
#### Output
506506

@@ -523,7 +523,7 @@ Trigger workflow when a Zoom cloud recording is completed
523523

524524
| Parameter | Type | Required | Description |
525525
| --------- | ---- | -------- | ----------- |
526-
| `secretToken` | string | Yes | Found in your Zoom app |
526+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
527527

528528
#### Output
529529

@@ -546,7 +546,7 @@ Trigger workflow on any Zoom webhook event
546546

547547
| Parameter | Type | Required | Description |
548548
| --------- | ---- | -------- | ----------- |
549-
| `secretToken` | string | Yes | Found in your Zoom app |
549+
| `secretToken` | string | Yes | Found in your Zoom app's Features page. Required for endpoint validation and webhook signature verification. |
550550

551551
#### Output
552552

scripts/generate-docs.ts

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,7 +3237,10 @@ function cleanupStaleToolDocs(validToolDocs: Set<string>): void {
32373237
// MANUAL-CONTENT blocks: the writer merges against the file on disk, and a
32383238
// deleted file reads as "no manual content". Whenever the two filters
32393239
// disagree, keep the prose and let the mismatch be fixed deliberately.
3240-
if (/MANUAL-CONTENT-START/.test(fs.readFileSync(docPath, 'utf-8'))) {
3240+
// Gate on what `extractManualContent` can actually recover — a stray or
3241+
// unterminated start marker preserves nothing, so it must not pin the page.
3242+
const manualSections = extractManualContent(fs.readFileSync(docPath, 'utf-8'))
3243+
if (Object.values(manualSections).some((section) => section.length > 0)) {
32413244
console.warn(
32423245
`⚠ Keeping ${blockType}.mdx: considered stale but holds MANUAL-CONTENT. ` +
32433246
`Add it to a doc-emitting set or delete it by hand once the content is migrated.`
@@ -3558,12 +3561,26 @@ function resolveConstStringValue(constName: string, content: string): string | n
35583561
* Returns null for blocks that should be skipped (UI-only IDs, text type, readOnly).
35593562
* Accepts optional `resolverContent` to resolve const-reference field IDs.
35603563
*/
3564+
/**
3565+
* Read a quoted string property, matching the opening quote to its own closing
3566+
* quote. A single `['"]…[^'"]+…['"]` character class ends the match at the
3567+
* first quote of *either* kind, so an apostrophe inside a double-quoted string
3568+
* ("Doesn't fire…") truncates the value mid-word.
3569+
*/
3570+
function matchQuotedProperty(content: string, propName: string): string | undefined {
3571+
const match = new RegExp(`\\b${propName}\\s*:\\s*(?:'([^']*)'|"([^"]*)"|\`([^\`]*)\`)`).exec(
3572+
content
3573+
)
3574+
if (!match) return undefined
3575+
return match[1] ?? match[2] ?? match[3]
3576+
}
3577+
35613578
function parseSubBlockObject(
35623579
obj: string,
35633580
uiOnlyIds: Set<string>,
35643581
resolverContent?: string
35653582
): TriggerConfigField | null {
3566-
let id: string | undefined = /\bid\s*:\s*['"]([^'"]+)['"]/.exec(obj)?.[1]
3583+
let id: string | undefined = matchQuotedProperty(obj, 'id')
35673584

35683585
// Handle const-reference ids: `id: SCREAMING_CASE_IDENTIFIER`
35693586
if (!id) {
@@ -3575,25 +3592,24 @@ function parseSubBlockObject(
35753592

35763593
if (!id || uiOnlyIds.has(id)) return null
35773594

3578-
const typeMatch = /\btype\s*:\s*['"]([^'"]+)['"]/.exec(obj)
3579-
if (typeMatch?.[1] === 'text') return null
3595+
const type = matchQuotedProperty(obj, 'type')
3596+
if (type === 'text') return null
35803597
if (/\breadOnly\s*:\s*true/.test(obj)) return null
35813598

3582-
const titleMatch = /\btitle\s*:\s*['"]([^'"]+)['"]/.exec(obj)
3599+
const title = matchQuotedProperty(obj, 'title')
35833600
const requiredMatch = /\brequired\s*:\s*(true)/.exec(obj)
3584-
const placeholderMatch = /\bplaceholder\s*:\s*['"]([^'"]+)['"]/.exec(obj)
3585-
const descMatch = /\bdescription\s*:\s*['"]([^'"]+)['"]/.exec(obj)
3601+
const placeholder = matchQuotedProperty(obj, 'placeholder')
35863602

35873603
// Use title as description fallback so oauth-input and other fields without
35883604
// an explicit description still show something meaningful in the docs table.
3589-
const description = descMatch?.[1] ?? (titleMatch ? `${titleMatch[1]}` : undefined)
3605+
const description = matchQuotedProperty(obj, 'description') ?? title
35903606

35913607
return {
35923608
id,
3593-
title: titleMatch?.[1] ?? id,
3594-
type: typeMatch?.[1] ?? 'short-input',
3609+
title: title ?? id,
3610+
type: type ?? 'short-input',
35953611
required: Boolean(requiredMatch),
3596-
placeholder: placeholderMatch?.[1],
3612+
placeholder,
35973613
description,
35983614
}
35993615
}

0 commit comments

Comments
 (0)