import { Types } from '@genesislcap/expression-builder'; import type { JSONSchema7 } from 'json-schema'; import { Genesis } from './types'; export * from './types'; /** * Takes in a valid response from `connect.getJsonSchema(resourceName)` and maps it to * a JsonSchema extended with the genesisType metadata for a field * * @public */ export declare function mapGenesisJsonSchema(jsonSchemResponse: { OUTBOUND: JSONSchema7; }): Genesis.JSONSchema7; /** * Maps fields contained in a JSON schema block enhanced with genesisType metadata * to the field shape required by the expression builder component. * * Only sets the properties that are *required*. Optional properties, such as * `defaultValue`, must be explicitly set by the user separately. * * @example * ```ts * import { mapGenesisJsonSchema, mapJsonSchemaFieldToExprBuilderField } from '@genesislcap/foundation-utils'; * * const response = await connect.getJsonSchema("RESOURCE_NAME"); * // Assuming the response is valid, requires checking * const schema = mapGenesisJsonSchema(response); * const fields = Object.entries(schema.properties).map(mapJsonSchemaFieldToExprBuilderField); * ``` * @public */ export declare function mapJsonSchemaFieldToExprBuilderField([name, schema]: [ string, Genesis.FieldJsonSchema ]): Types.Field | null; //# sourceMappingURL=index.d.ts.map