{"version":3,"file":"OpenBadgesHttpModuleConfig.mjs","names":[],"sources":["../../src/http/OpenBadgesHttpModuleConfig.ts"],"sourcesContent":["import type { Router } from 'express'\n\nimport { importExpress } from './router'\n\nexport type OpenBadgesHttpModuleConfigOptions = {\n  baseUrl: string\n  router?: Router\n  defaultSubjectId?: string\n  providerName?: string\n  privacyPolicyUrl?: string\n  termsOfServiceUrl?: string\n  requireConsent?: boolean\n  useTenantRouting?: boolean\n  actorParamName?: string\n  didWebId?: string\n  endpoints?: {\n    discovery?: string\n    jwks?: string\n    didDocument?: string\n    registration?: string\n    authorize?: string\n    token?: string\n    revoke?: string\n    introspect?: string\n    consent?: string\n    profile?: string\n    credentials?: string\n    statusList?: string\n    refresh?: string\n  }\n}\n\nexport class OpenBadgesHttpModuleConfig {\n  private readonly options: OpenBadgesHttpModuleConfigOptions\n  public readonly router: Router\n\n  public constructor(options: OpenBadgesHttpModuleConfigOptions) {\n    this.options = options\n    this.router = options.router ?? importExpress().Router()\n  }\n\n  public get baseUrl() {\n    return this.options.baseUrl\n  }\n\n  public get defaultSubjectId() {\n    return this.options.defaultSubjectId\n  }\n\n  public get discoveryPath() {\n    return this.options.endpoints?.discovery ?? '/ims/ob/v3p0/discovery'\n  }\n\n  public get jwksPath() {\n    return this.options.endpoints?.jwks ?? '/.well-known/jwks.json'\n  }\n\n  public get didDocumentPath() {\n    return this.options.endpoints?.didDocument ?? '/.well-known/did.json'\n  }\n\n  public get registrationPath() {\n    return this.options.endpoints?.registration ?? '/connect/register'\n  }\n\n  public get authorizePath() {\n    return this.options.endpoints?.authorize ?? '/authorize'\n  }\n\n  public get tokenPath() {\n    return this.options.endpoints?.token ?? '/token'\n  }\n\n  public get revokePath() {\n    return this.options.endpoints?.revoke ?? '/revoke'\n  }\n\n  public get introspectPath() {\n    return this.options.endpoints?.introspect ?? '/introspect'\n  }\n\n  public get profilePath() {\n    return this.options.endpoints?.profile ?? '/ims/ob/v3p0/profile'\n  }\n\n  public get credentialsPath() {\n    return this.options.endpoints?.credentials ?? '/ims/ob/v3p0/credentials'\n  }\n\n  public get providerName() {\n    return this.options.providerName\n  }\n\n  public get privacyPolicyUrl() {\n    return this.options.privacyPolicyUrl\n  }\n\n  public get termsOfServiceUrl() {\n    return this.options.termsOfServiceUrl\n  }\n\n  public get requireConsent() {\n    return this.options.requireConsent ?? false\n  }\n\n  public get useTenantRouting() {\n    return this.options.useTenantRouting ?? false\n  }\n\n  public get actorParamName() {\n    return this.options.actorParamName ?? 'actorId'\n  }\n\n  public get didWebId() {\n    return this.options.didWebId\n  }\n\n  public get consentPath() {\n    return this.options.endpoints?.consent ?? '/consent'\n  }\n\n  public get statusListPath() {\n    return this.options.endpoints?.statusList ?? '/status-list'\n  }\n\n  public get refreshPath() {\n    return this.options.endpoints?.refresh ?? '/ims/ob/v3p0/credentials/refresh'\n  }\n}\n"],"mappings":";;;aAEwC;AA8BxC,IAAa,6BAAb,MAAwC;CAItC,AAAO,YAAY,SAA4C;AAC7D,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,eAAe,CAAC,QAAQ;;CAG1D,IAAW,UAAU;AACnB,SAAO,KAAK,QAAQ;;CAGtB,IAAW,mBAAmB;AAC5B,SAAO,KAAK,QAAQ;;CAGtB,IAAW,gBAAgB;AACzB,SAAO,KAAK,QAAQ,WAAW,aAAa;;CAG9C,IAAW,WAAW;AACpB,SAAO,KAAK,QAAQ,WAAW,QAAQ;;CAGzC,IAAW,kBAAkB;AAC3B,SAAO,KAAK,QAAQ,WAAW,eAAe;;CAGhD,IAAW,mBAAmB;AAC5B,SAAO,KAAK,QAAQ,WAAW,gBAAgB;;CAGjD,IAAW,gBAAgB;AACzB,SAAO,KAAK,QAAQ,WAAW,aAAa;;CAG9C,IAAW,YAAY;AACrB,SAAO,KAAK,QAAQ,WAAW,SAAS;;CAG1C,IAAW,aAAa;AACtB,SAAO,KAAK,QAAQ,WAAW,UAAU;;CAG3C,IAAW,iBAAiB;AAC1B,SAAO,KAAK,QAAQ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