import { runApiInterceptorsAfter } from "./interceptor-runner.js";
function normalizeIdentity(value) {
  if (!value) return "";
  return value;
}
async function runCustomRouteAfterInterceptors(args) {
  return runApiInterceptorsAfter({
    routePath: args.routePath,
    method: args.method,
    request: args.request,
    response: args.response,
    context: {
      em: args.context.em,
      container: args.context.container,
      userId: normalizeIdentity(args.context.userId),
      organizationId: normalizeIdentity(args.context.organizationId),
      tenantId: normalizeIdentity(args.context.tenantId),
      userFeatures: args.context.userFeatures ?? [],
      extensionHeaders: args.context.extensionHeaders
    },
    metadataByInterceptor: args.metadataByInterceptor
  });
}
export {
  runCustomRouteAfterInterceptors
};
//# sourceMappingURL=custom-route-interceptor.js.map
