@learncard/types 5.23.0 → 5.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.esm.js CHANGED
@@ -146,7 +146,18 @@ var ProofValidator = z.object({
146
146
  verificationMethod: z.string(),
147
147
  jws: z.string().optional()
148
148
  }).catchall(z.any()).superRefine((proof, ctx) => {
149
- if (proof.created === void 0 && (proof.type !== "DataIntegrityProof" || proof.cryptosuite !== "ecdsa-rdfc-2019")) {
149
+ if (proof.created === void 0 && // These standardized Data Integrity suites make created optional.
150
+ // Keep the prior requirement for legacy and unknown proof suites.
151
+ // https://www.w3.org/TR/vc-di-eddsa/#proof-configuration-eddsa-jcs-2022
152
+ // https://www.w3.org/TR/vc-di-bbs/#proof-configuration
153
+ (proof.type !== "DataIntegrityProof" || ![
154
+ "ecdsa-rdfc-2019",
155
+ "ecdsa-jcs-2019",
156
+ "ecdsa-sd-2023",
157
+ "eddsa-rdfc-2022",
158
+ "eddsa-jcs-2022",
159
+ "bbs-2023"
160
+ ].includes(proof.cryptosuite))) {
150
161
  ctx.addIssue({
151
162
  code: "custom",
152
163
  path: ["created"],