LCOV - code coverage report
Current view: top level - dashql-app/src/connections/clfn - clfn_specs.ts Coverage Total Hit
Test: DashQL d805a4b Lines: 100.0 % 8 8
Test Date: 2026-11-09 20:22:13

            Line data    Source code
       1              : import type { ClientFunctionSpec } from './clfn_spec.js';
       2              : 
       3              : /// The client function specs of extensions/, as JSON that Bazel generates from their sources. Each one is a chunk of its own, so that a
       4              : /// connection only loads it when it needs it.
       5            1 : const SPECS = import.meta.glob<ClientFunctionSpec>('@dashql/extensions/*/clfn/spec/spec.json', { import: 'default' });
       6              : 
       7              : /// Load the client function spec of an extension by its folder in extensions/, such as `d360-api`
       8            1 : export async function loadClientFunctionSpec(folder: string): Promise<ClientFunctionSpec> {
       9            1 :     const suffix = `/${folder}/clfn/spec/spec.json`;
      10            1 :     const load = Object.entries(SPECS).find(([path]) => path.endsWith(suffix))?.[1];
      11            1 :     if (load === undefined) {
      12            1 :         throw new Error(`no extension in the folder ${folder}`);
      13              :     }
      14            1 :     return load();
      15            1 : }
        

Generated by: LCOV version 2.0-1