Configuration
/**
* Sidecar Config for middleware/chatgpt-extract.ts
*/
module.exports = {
title: "chatgpt-extract.ts",
description: "Auto-generated draft",
};
---
title: "Route Flow: ssutil/src/middleware/chatgpt-extract.ts"
---
flowchart TD
title["Route Flow: ssutil/src/middleware/chatgpt-extract.ts"]
style title fill:none,stroke:none,color:#B4976A,font-size:18px
extractWithChatGPT{{"extractWithChatGPT"}}
style extractWithChatGPT fill:#161b22,color:#fff,stroke:#c2a35d
linkStyle default stroke:#c2a35d,stroke-width:2px,color:#fff
classDef default color:#fff
---
title: "AST Structure: ssutil/src/middleware/chatgpt-extract.ts"
---
graph TD
n0["SF"]
n1["ID"]
n0 --> n1
n3["ScrapeResult"]
n1 --> n3
n3 --> n2
style n3 stroke-dasharray:5,stroke:#B4976A
n2["./platformscrape"]
style n2 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1
n4["FD: extractWithChatGPT"]
n0 --> n4
n25["IS"]
n4 --> n25
n30["NE"]
n25 --> n30
n33["VS"]
n4 --> n33
n35["VD: truncatedHtml"]
n33 --> n35
n38["BE"]
n35 --> n38
n45["BE"]
n35 --> n45
n46["CE: html.substring"]
n45 --> n46
n56["VS"]
n4 --> n56
n58["VD: prompt"]
n56 --> n58
n68["TS"]
n4 --> n68
n70["VS"]
n68 --> n70
n72["VD: response"]
n70 --> n72
n75["CE: fetch"]
n72 --> n75
n97["CE: JSON.stringify"]
n75 --> n97
n98["IS"]
n68 --> n98
n104["VS"]
n98 --> n104
n106["VD: errorText"]
n104 --> n106
n109["CE: response.text"]
n106 --> n109
n111["NE"]
n98 --> n111
n123["VS"]
n68 --> n123
n125["VD: data"]
n123 --> n125
n129["CE: response.json"]
n125 --> n129
n148["VS"]
n68 --> n148
n150["VD: content"]
n148 --> n150
n164["IS"]
n68 --> n164
n169["NE"]
n164 --> n169
n172["VS"]
n68 --> n172
n174["VD: cleanedContent"]
n172 --> n174
n176["CE: content.trim"]
n174 --> n176
n180["IS"]
n68 --> n180
n181["CE: cleanedContent.startsWith"]
n180 --> n181
n188["BE"]
n180 --> n188
n191["CE: cleanedContent.replace(/^```json\s*/i, '').replace"]
n188 --> n191
n193["CE: cleanedContent.replace"]
n191 --> n193
n197["IS"]
n180 --> n197
n198["CE: cleanedContent.startsWith"]
n197 --> n198
n205["BE"]
n197 --> n205
n208["CE: cleanedContent.replace(/^```\s*/i, '').replace"]
n205 --> n208
n209["VS"]
n68 --> n209
n211["VD: extracted"]
n209 --> n211
n214["CE: JSON.parse"]
n211 --> n214
n223["IS"]
n68 --> n223
n224["BE"]
n223 --> n224
n229["CE: extracted.logoUrl.startsWith"]
n224 --> n229
n238["BE"]
n223 --> n238
n243["BE"]
n238 --> n243
n249["IS"]
n68 --> n249
n250["BE"]
n249 --> n250
n255["CE: extracted.dealer_url.startsWith"]
n250 --> n255
n264["BE"]
n249 --> n264
n269["BE"]
n264 --> n269
n275["IS"]
n68 --> n275
n280["IS"]
n275 --> n280
n282["CE: Array.isArray"]
n280 --> n282
n291["BE"]
n280 --> n291
n301["BE"]
n275 --> n301
n306["CE: extracted.address.map"]
n301 --> n306
n312["AF"]
n306 --> n312
n313["RS"]
n68 --> n313
n316["VD: error"]
n68 --> n316
n319["IS"]
n68 --> n319
n320["BE"]
n319 --> n320
n326["CE: console.error"]
n319 --> n326
n332["RS"]
n319 --> n332
style n0 fill:#5E377B,color:#fff,stroke:#B4976A
linkStyle default stroke:#c2a35d,stroke-width:1px,opacity:0.6
AF ArrowFunctionBE BinaryExpressionCE CallExpressionFD FunctionDeclarationIS IfStatementID ImportDeclarationNE NewExpressionRS ReturnStatementSF SourceFileTS TryStatementVD VariableDeclarationVS VariableStatement