import { BooleanValue, RecordValue, StringValue, } from '@coveo/bueno';
import { requiredNonEmptyString } from '../utils/validate-payload.js';
export const engineConfigurationDefinitions = {
    organizationId: requiredNonEmptyString,
    accessToken: requiredNonEmptyString,
    name: new StringValue({
        required: false,
        emptyAllowed: false,
    }),
    analytics: new RecordValue({
        options: {
            required: false,
        },
        values: {
            enabled: new BooleanValue({
                required: false,
            }),
            originContext: new StringValue({
                required: false,
            }),
            originLevel2: new StringValue({
                required: false,
            }),
            originLevel3: new StringValue({
                required: false,
            }),
            analyticsMode: new StringValue({
                constrainTo: ['legacy', 'next'],
                required: false,
                default: 'next',
            }),
            proxyBaseUrl: new StringValue({
                required: false,
                url: true,
            }),
            trackingId: new StringValue({
                required: false,
                emptyAllowed: false,
                regex: /^[a-zA-Z0-9_\-.]{1,100}$/,
            }),
        },
    }),
    environment: new StringValue({
        required: false,
        default: 'prod',
        constrainTo: ['prod', 'hipaa', 'stg', 'dev'],
    }),
};
export function getSampleEngineConfiguration() {
    return {
        organizationId: 'searchuisamples',
        // This API key is intentionally public — it belongs to a sample organization used for samples/docs.
        accessToken: 'xx564559b1-0045-48e1-953c-3addd1ee4457',
    };
}
