(action: {
api_host: string;
path: string;
})
| 185 | } |
| 186 | |
| 187 | export function endpointUrlFromAction(action: { |
| 188 | api_host: string; |
| 189 | path: string; |
| 190 | }): string { |
| 191 | // Ensure the base URL has a trailing slash |
| 192 | const base = action.api_host.endsWith("/") |
| 193 | ? action.api_host |
| 194 | : `${action.api_host}/`; |
| 195 | // Ensure the action path does not have a leading slash |
| 196 | const path = action.path.startsWith("/") ? action.path.slice(1) : action.path; |
| 197 | return base + path; |
| 198 | } |
| 199 | |
| 200 | export function bodyPropertiesFromRequestBodyContents( |
| 201 | requestBodyContents: Json, |
no outgoing calls
no test coverage detected