import { EndpointBuilder } from "./endpoint.js";
import { createRestateHandler } from "./handlers/generic.js";
import { LambdaHandler, isCompressionSupported } from "./handlers/lambda.js";

//#region src/endpoint/lambda_endpoint.ts
var LambdaEndpointImpl = class {
	builder = new 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 = isCompressionSupported();
		const lambdaHandler = new LambdaHandler(createRestateHandler(this.builder.build(), "REQUEST_RESPONSE", compressionEnabled ? { lambdaCompression: "zstd" } : {}), compressionEnabled);
		return lambdaHandler.handleRequest.bind(lambdaHandler);
	}
};

//#endregion
export { LambdaEndpointImpl };
//# sourceMappingURL=lambda_endpoint.js.map