import { type Attribute } from "../attributes"; import type { ObjectAttribute } from "../attributes/types"; import type { DataRules } from "../data-streams/types"; import type { DataRulesAttributesField, ForecastBody, Nql } from "./types"; /** * Convert an NQL object to a Forecast body. * @param {Nql} nqlObject - The NQL object to convert. * @returns {Promise} - Returns a promise that resolves with the converted ForecastBody. * @throws {Error} - Throws an error if price filter conditions are not met. */ export declare function convertNqlObjectToForecastBody(nqlObject: Nql): Promise; /** * Looks for an attribute with the given name and checks if it is of type 'object'. * * @param {Attribute[]} attributes - An array of attributes to search through. * @param {string} name - The name of the attribute to look for. * @returns {ObjectAttribute | undefined} Returns the attribute if found and is of type 'object', otherwise returns undefined. * * @example * // Assuming attributes is an array of Attribute objects with properties 'name', 'type', and optionally 'properties'. * const attributes = [{ name: 'person', type: 'object', properties: { name: 'John Doe' } }]; * // Returns { name: 'person', type: 'object', properties: { name: 'John Doe' } } * isObject(attributes, 'person'); */ export declare function isObject(attributes: Attribute[], name: string): ObjectAttribute | undefined; /** * Finds an attribute with the given name, and if it is of type 'object', returns the names of its properties. * * @param {Attribute[]} attributes - An array of attributes to search through. * @param {string} name - The name of the attribute to look for. * @returns {string[]} An array containing the names of the properties if the attribute is of type 'object', otherwise an empty array. * * @example * // Assuming attributes is an array of Attribute objects with properties 'name', 'type', and optionally 'properties'. * const attributes = [{ name: 'person', type: 'object', properties: { name: 'John Doe' } }]; * // Returns ['name'] * findAttributeProperties(attributes, 'person'); */ export declare function findAttributeProperties(attributes: Attribute[], name: string): string[]; /** * Builds an array of field objects with names based on the given attribute and properties. * * @param {string} attribute - The primary attribute to be prefixed to each field. * @param {string[]} properties - An array of properties that will be appended to the attribute to form the field names. * @returns {DataRulesAttributesField[]} An array of field objects, where each object has a 'field' property which is a combination of the attribute and property, and an 'exported' property set to true. * * @example * // Returns [{ field: 'person.name', exported: true }, { field: 'person.age', exported: true }] * buildField('person', ['name', 'age']); */ export declare function buildField(attribute: string, properties: string[]): DataRulesAttributesField[]; /** * Generates the SQL FROM clause based on the given data rules. * * @param {DataRules} dataRules - The data rules specifying the datasets, attributes, and filters. * @returns {string} The SQL FROM clause. */ export declare function generateFromClause(dataRules: DataRules): string; /** * Converts the provided data rules into an SQL query. * * @param {DataRules} dataRules - The data rules specifying the datasets, attributes, and filters. * @returns {string} The generated SQL query. */ export declare function dataRulesToSQL(dataRules: DataRules): string;