Adds _dynamic_import_js() helper (65 lines) that detects import() call expressions in JS/TS, resolves the module path (same logic as static imports including .js→.ts mapping and tsconfig aliases), and emits imports_from edges from the enclosing function. Hooked into walk_calls for JS/TS configs. Also adds tests/fixtures/dynamic_import.ts fixture and 5 new tests in tests/test_languages.py (all passing alongside 110 existing tests).
21 lines
609 B
TypeScript
21 lines
609 B
TypeScript
import { logger } from './logger';
|
|
|
|
async function processInbound(orgId: string, phone: string) {
|
|
const { shouldHandle, processMessage } = await import('./mayaEngine.js');
|
|
const handle = await shouldHandle(orgId, phone);
|
|
if (handle.sessionId) {
|
|
await processMessage({ orgId, phone }, handle.sessionId);
|
|
}
|
|
}
|
|
|
|
async function pollMessages(orgId: string) {
|
|
const { commsQueue } = await import('./queue.js');
|
|
await commsQueue.add('check-inbound', { orgId });
|
|
}
|
|
|
|
function syncOnly() {
|
|
logger.info('no dynamic imports here');
|
|
}
|
|
|
|
export { processInbound, pollMessages, syncOnly };
|