/** * Strict Zod schema for the OB 3.0 EndorsementCredential envelope (§B.1.7) and * its `EndorsementSubject` (§B.1.8). * * **envelope recognition only**. No semantic checks for endorsement content, no * auto-walk of `issuer.endorsement[]` / `achievement.endorsement[]` / * `credentialSubject.endorsement[]`, no recursive verification. Consumers who * want endorsement verification today extract embedded endorsements themselves * and call `verifier.verifyCredential(endorsement)` — recognition surfaces the * typed normalized form on the result so they can branch on `recognizedProfile * === 'obv3p0.endorsement'`. * * Reuses inner-class schemas (`Obv3p0Image`, `ProfileRefField`, * `JsonLdTypeField`) and shared envelope helpers (`Obv3p0ContextArray`, * `zodErrorToProblems`). * */ import { z } from 'zod'; import type { RecognitionResult } from '../../types/recognition.js'; /** * Open Badges 3.0 §B.1.8 — EndorsementSubject. * * Required: `id` (URI/IRI), `type` (must include 'EndorsementSubject'). * Optional in scope: `endorsementComment` (Markdown ≅ string). * * `passthrough` is used so vendor-extension fields survive * normalization without being silently dropped. */ export declare const Obv3p0EndorsementSubjectSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEffects]>, string[], string | string[]>, string[], string | string[]>; endorsementComment: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ id: z.ZodString; type: z.ZodEffects]>, string[], string | string[]>, string[], string | string[]>; endorsementComment: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; type: z.ZodEffects]>, string[], string | string[]>, string[], string | string[]>; endorsementComment: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; export type Obv3p0EndorsementSubject = z.infer; /** * Open Badges 3.0 §B.1.7 — EndorsementCredential envelope. * * Same TS7056 footnote as the OpenBadgeCredential envelope * applies: deep nesting (ProfileRef + Image + EndorsementSubject) * pushes inferred type emit past the compiler's serialization * limit, so the public export is annotated `z.ZodTypeAny` and the * companion type alias collapses to `Record`. * Runtime behavior is unaffected; consumers narrow via * `recognizedProfile === 'obv3p0.endorsement'` and cast to a * domain interface as needed. */ export declare const Obv3p0EndorsementCredentialSchema: z.ZodTypeAny; /** * The normalized OB 3.0 EndorsementCredential shape produced by * {@link parseObv3p0EndorsementCredential}. See the schema export's * note on TS7056 for why this is typed as a permissive record. */ export type Obv3p0EndorsementCredential = Record; /** * Parse an unknown into an `Obv3p0EndorsementCredential`. Returns * a {@link RecognitionResult} suitable for direct use as a * `RecognizerSpec.parse` implementation. */ export declare function parseObv3p0EndorsementCredential(credential: unknown): RecognitionResult; //# sourceMappingURL=endorsement-credential-v3p0.d.ts.map