// Stub for openid-client v6+（纯 ESM，含 `import * as oauth from 'oauth4webapi'`）。
// ts-jest 默认走 CJS 解析 → 加载真模块直接 `SyntaxError: Cannot use import statement outside a module`，
// 任何间接 import `app.module` 的 integration test 都会炸（全 15 模块 fail）。
//
// 方案：jest config 走 moduleNameMapper `^openid-client$` → 本 stub，让 require 顺利通过。
// SsoOidcClientService 在 integration test 里被 overrideProvider 替换，本 stub 内容不会被真调；
// production / dev 启动仍走真模块。
//
// 同模式：testing/backend/helpers/otplib-stub.ts。

type Fn = (...args: any[]) => any;
const noop: Fn = () => undefined;

export const discovery = noop;
export const buildAuthorizationUrl = noop;
export const authorizationCodeGrant = noop;
export const calculatePKCECodeChallenge = noop;
export const ClientSecretPost = noop;
export const allowInsecureRequests = noop;
export const randomPKCECodeVerifier = noop;
export const randomNonce = noop;
export const randomState = noop;
export class Configuration {}

export default {
  discovery,
  buildAuthorizationUrl,
  authorizationCodeGrant,
  calculatePKCECodeChallenge,
  ClientSecretPost,
  allowInsecureRequests,
  randomPKCECodeVerifier,
  randomNonce,
  randomState,
  Configuration,
};
