solarnetwork-api-core
    Preparing search index...

    Class DatumSourceFinder

    Class to find the available datum sources for a set of node datum URL helpers.

    This helper is useful for finding what source IDs are avaialble for a set of nodes. It returns an object with node ID properties with associated source ID array values, for example:

    { 123: ["a", "b", "c"] }
    
    // the simple case, all available sources for just one SolarNode
    const filter = new DatumFilter();
    filter.nodeId = 123;
    const sources = await new DatumSourceFinder(new SolarQueryApi(), filter).fetch();
    // find all sources matching a wildcard pattern within the past day
    const filter2 = new DatumFilter();
    filter2.startDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
    filter2.sourceId = '/power/**';
    const sources2 = await new DatumSourceFinder(new SolarQueryApi(), filter2).fetch();
    // find all sources across multiple SolarNodes
    const filter3 = new DatumFilter();
    filter3.nodeId = 234;
    const sources3 = await new DatumSourceFinder(new SolarQueryApi(), [urlHelper1, urlHelper3]).fetch();

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    The URL helper instance to use.

    An authorization builder to use to make authenticated HTTP requests.

    Methods

    • Create a URL fetch requestor.

      The returned function can be passed to d3.queue or invoked directly.

      Type Parameters

      • V

      Parameters

      • url: string

        the URL to request.

      • OptionalsignUrl: string

        the URL to sign (might be different to url if a proxy is used)

      • Optionaldelay: number

        an optional number of milliseconds to sleep before initiating the request

      Returns (cb: LoaderDataCallbackFn<V>) => void

      a function that accepts a callback argument