()
| 25 | } |
| 26 | |
| 27 | export async function getMaterializeEndpoints() { |
| 28 | // When running inside the Docker composition (via mzcompose), endpoints are |
| 29 | // passed as environment variables so we can reach services by hostname. |
| 30 | if (process.env.MZ_INTERNAL_SQL_HOST && process.env.MZ_INTERNAL_HTTP_HOST) { |
| 31 | return { |
| 32 | internalSql: { |
| 33 | host: process.env.MZ_INTERNAL_SQL_HOST, |
| 34 | port: parseInt(process.env.MZ_INTERNAL_SQL_PORT ?? "6877"), |
| 35 | }, |
| 36 | internalHttp: { |
| 37 | host: process.env.MZ_INTERNAL_HTTP_HOST, |
| 38 | port: parseInt(process.env.MZ_INTERNAL_HTTP_PORT ?? "6878"), |
| 39 | }, |
| 40 | }; |
| 41 | } |
| 42 | |
| 43 | // Fallback: resolve host-mapped ports via mzcompose (for local development). |
| 44 | const internalSql = await getMaterializeEndpoint(6877); |
| 45 | const internalHttp = await getMaterializeEndpoint(6878); |
| 46 | |
| 47 | return { internalSql, internalHttp }; |
| 48 | } |
| 49 | |
| 50 | export const dedenterWithEscapeSpecialCharacters = dedent.withOptions({ |
| 51 | escapeSpecialCharacters: true, |
no test coverage detected