import { BaseOpenApiV3_1ConverterNode, } from "../../../BaseOpenApiV3_1Converter.node";
import { extendType } from "../../../utils/extendType";
import { X_FERN_BEARER_TOKEN } from "../fernExtension.consts";
export class XFernBearerTokenConverterNode extends BaseOpenApiV3_1ConverterNode {
    bearerTokenVariableName;
    bearerTokenEnvVar;
    constructor(args) {
        super(args);
        this.safeParse();
    }
    parse() {
        const bearerToken = extendType(this.input)[X_FERN_BEARER_TOKEN];
        this.bearerTokenVariableName = bearerToken?.name;
        this.bearerTokenEnvVar = bearerToken?.env;
    }
    convert() {
        return {
            tokenVariableName: this.bearerTokenVariableName,
            tokenEnvVar: this.bearerTokenEnvVar,
        };
    }
}
