@learncard/types 5.18.3 → 5.20.0
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/clr.d.ts +8 -8
- package/dist/credential-refresh.d.ts +1634 -0
- package/dist/credential-refresh.d.ts.map +1 -0
- package/dist/did.d.ts +2 -2
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lcn.d.ts +196 -51
- package/dist/lcn.d.ts.map +1 -1
- package/dist/obv3.d.ts +8 -8
- package/dist/types.cjs.development.cjs +269 -15
- package/dist/types.cjs.development.cjs.map +3 -3
- package/dist/types.cjs.production.min.cjs +7 -7
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +270 -15
- package/dist/types.esm.js.map +4 -4
- package/dist/vc.d.ts +13 -13
- package/dist/vc.d.ts.map +1 -1
- package/dist/vc.test.d.ts +2 -0
- package/dist/vc.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/credential-refresh.ts +336 -0
- package/src/index.ts +1 -0
- package/src/lcn.ts +66 -18
- package/src/vc.test.ts +35 -0
- package/src/vc.ts +14 -2
package/src/vc.ts
CHANGED
|
@@ -188,7 +188,7 @@ export type UnsignedVC = z.infer<typeof UnsignedVCValidator>;
|
|
|
188
188
|
export const ProofValidator = z
|
|
189
189
|
.object({
|
|
190
190
|
type: z.string(),
|
|
191
|
-
created: z.string(),
|
|
191
|
+
created: z.string().optional(),
|
|
192
192
|
challenge: z.string().optional(),
|
|
193
193
|
domain: z.string().optional(),
|
|
194
194
|
nonce: z.string().optional(),
|
|
@@ -196,7 +196,19 @@ export const ProofValidator = z
|
|
|
196
196
|
verificationMethod: z.string(),
|
|
197
197
|
jws: z.string().optional(),
|
|
198
198
|
})
|
|
199
|
-
.catchall(z.any())
|
|
199
|
+
.catchall(z.any())
|
|
200
|
+
.superRefine((proof, ctx) => {
|
|
201
|
+
if (
|
|
202
|
+
proof.created === undefined &&
|
|
203
|
+
(proof.type !== 'DataIntegrityProof' || proof.cryptosuite !== 'ecdsa-rdfc-2019')
|
|
204
|
+
) {
|
|
205
|
+
ctx.addIssue({
|
|
206
|
+
code: 'custom',
|
|
207
|
+
path: ['created'],
|
|
208
|
+
message: 'created is required for this proof suite',
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
});
|
|
200
212
|
export type Proof = z.infer<typeof ProofValidator>;
|
|
201
213
|
|
|
202
214
|
export const VCValidator = UnsignedVCValidator.extend({
|