const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
const require_errors = require('./types/errors.cjs');
const require_promises = require('./promises.cjs');
const require_context = require('./context.cjs');
const require_rpc = require('./types/rpc.cjs');
const require_internal = require('./internal.cjs');
const require_common_api = require('./common_api.cjs');
const require_fetch_endpoint = require('./endpoint/fetch_endpoint.cjs');
const require_withOptions = require('./endpoint/withOptions.cjs');
let __restatedev_restate_sdk_core = require("@restatedev/restate-sdk-core");
__restatedev_restate_sdk_core = require_rolldown_runtime.__toESM(__restatedev_restate_sdk_core);

//#region src/fetch.ts
/**
* Create a new {@link RestateEndpoint} in request response protocol mode.
* Bidirectional mode (must be served over http2) can be enabled with .enableHttp2()
* @deprecated Please use {@link createEndpointHandler}
*/
function endpoint() {
	return new require_fetch_endpoint.FetchEndpointImpl("REQUEST_RESPONSE");
}
/**
* Creates a Fetch handler that encapsulates all the Restate services served by this endpoint.
*
* @param {FetchEndpointOptions} options - Configuration options for the endpoint handler.
* @returns A fetch handler function.
*
* @example
* A typical request-response handler would look like this:
* ```
* import { createEndpointHandler } from "@restatedev/restate-sdk/fetch";
*
* export const handler = createEndpointHandler({ services: [myService] })
*
* @example
* A typical bidirectional handler (works with http2 and some http1.1 servers) would look like this:
* ```
* import { createEndpointHandler } from "@restatedev/restate-sdk/fetch";
*
* export const handler = createEndpointHandler({ services: [myService], bidirectional: true })
*
*/
function createEndpointHandler(options) {
	return require_withOptions.withOptions(new require_fetch_endpoint.FetchEndpointImpl(options.bidirectional ? "BIDI_STREAM" : "REQUEST_RESPONSE"), options).handler().fetch;
}

//#endregion
exports.CancelledError = require_errors.CancelledError;
exports.CombineablePromise = require_common_api.CombineablePromise;
exports.InvocationIdParser = require_context.InvocationIdParser;
exports.Opts = require_rpc.Opts;
exports.RestateError = require_errors.RestateError;
exports.RestatePromise = require_context.RestatePromise;
exports.RetryableError = require_errors.RetryableError;
exports.SendOpts = require_rpc.SendOpts;
exports.TerminalError = require_errors.TerminalError;
exports.TimeoutError = require_errors.TimeoutError;
exports.createEndpointHandler = createEndpointHandler;
exports.createObjectHandler = require_common_api.createObjectHandler;
exports.createObjectSharedHandler = require_common_api.createObjectSharedHandler;
exports.createServiceHandler = require_common_api.createServiceHandler;
exports.createWorkflowHandler = require_common_api.createWorkflowHandler;
exports.createWorkflowSharedHandler = require_common_api.createWorkflowSharedHandler;
exports.endpoint = endpoint;
Object.defineProperty(exports, 'handlers', {
  enumerable: true,
  get: function () {
    return require_rpc.handlers;
  }
});
Object.defineProperty(exports, 'internal', {
  enumerable: true,
  get: function () {
    return require_internal.internal_exports;
  }
});
exports.isRestatePromise = require_promises.isRestatePromise;
exports.object = require_rpc.object;
Object.defineProperty(exports, 'rpc', {
  enumerable: true,
  get: function () {
    return require_rpc.rpc;
  }
});
Object.defineProperty(exports, 'serde', {
  enumerable: true,
  get: function () {
    return __restatedev_restate_sdk_core.serde;
  }
});
exports.service = require_rpc.service;
exports.workflow = require_rpc.workflow;