( authorizationUrl: string, )
| 264 | * can only declare RFC scopes, so this host-level quirk must apply to both |
| 265 | * first-party and workspace-owned HubSpot OAuth clients. */ |
| 266 | export const providerAuthorizeExtras = ( |
| 267 | authorizationUrl: string, |
| 268 | ): Readonly<Record<string, string>> => { |
| 269 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL() throws on invalid input → no provider extras |
| 270 | try { |
| 271 | const host = new URL(authorizationUrl).host.toLowerCase(); |
| 272 | if (host === "accounts.google.com") { |
| 273 | return { access_type: "offline", prompt: "consent" }; |
| 274 | } |
| 275 | if (host === "app.hubspot.com") { |
| 276 | return { optional_scope: HUBSPOT_OPTIONAL_SCOPES.join(" ") }; |
| 277 | } |
| 278 | } catch { |
| 279 | // Unparseable authorization URL — let buildAuthorizationUrl surface the error. |
| 280 | } |
| 281 | return {}; |
| 282 | }; |
| 283 | |
| 284 | /** Provider-specific scopes embedded in an integration's authorization |
| 285 | * endpoint. HubSpot models app-optional permissions with the non-standard |
no outgoing calls
no test coverage detected