const require_endpoint = require('./endpoint.cjs');
const require_generic = require('./handlers/generic.cjs');
const require_lambda = require('./handlers/lambda.cjs');

//#region src/endpoint/lambda_endpoint.ts
var LambdaEndpointImpl = class {
	builder = new require_endpoint.EndpointBuilder();
	bind(definition) {
		this.builder.bind(definition);
		return this;
	}
	withIdentityV1(...keys) {
		this.builder.addIdentityKeys(...keys);
		return this;
	}
	defaultServiceOptions(options) {
		this.builder.setDefaultServiceOptions(options);
		return this;
	}
	setLogger(logger) {
		this.builder.setLogger(logger);
		return this;
	}
	journalValueCodecProvider(codecProvider) {
		this.builder.setJournalValueCodecProvider(codecProvider);
		return this;
	}
	handler() {
		const compressionEnabled = require_lambda.isCompressionSupported();
		const lambdaHandler = new require_lambda.LambdaHandler(require_generic.createRestateHandler(this.builder.build(), "REQUEST_RESPONSE", compressionEnabled ? { lambdaCompression: "zstd" } : {}), compressionEnabled);
		return lambdaHandler.handleRequest.bind(lambdaHandler);
	}
};

//#endregion
exports.LambdaEndpointImpl = LambdaEndpointImpl;