@learncard/types 5.19.0 → 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/vc.d.ts CHANGED
@@ -351,7 +351,7 @@ export declare const UnsignedVCValidator: z.ZodObject<{
351
351
  export type UnsignedVC = z.infer<typeof UnsignedVCValidator>;
352
352
  export declare const ProofValidator: z.ZodObject<{
353
353
  type: z.ZodString;
354
- created: z.ZodString;
354
+ created: z.ZodOptional<z.ZodString>;
355
355
  challenge: z.ZodOptional<z.ZodString>;
356
356
  domain: z.ZodOptional<z.ZodString>;
357
357
  nonce: z.ZodOptional<z.ZodString>;
@@ -510,7 +510,7 @@ export declare const VCValidator: z.ZodObject<{
510
510
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>>;
511
511
  proof: z.ZodUnion<[z.ZodObject<{
512
512
  type: z.ZodString;
513
- created: z.ZodString;
513
+ created: z.ZodOptional<z.ZodString>;
514
514
  challenge: z.ZodOptional<z.ZodString>;
515
515
  domain: z.ZodOptional<z.ZodString>;
516
516
  nonce: z.ZodOptional<z.ZodString>;
@@ -519,7 +519,7 @@ export declare const VCValidator: z.ZodObject<{
519
519
  jws: z.ZodOptional<z.ZodString>;
520
520
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
521
521
  type: z.ZodString;
522
- created: z.ZodString;
522
+ created: z.ZodOptional<z.ZodString>;
523
523
  challenge: z.ZodOptional<z.ZodString>;
524
524
  domain: z.ZodOptional<z.ZodString>;
525
525
  nonce: z.ZodOptional<z.ZodString>;
@@ -683,7 +683,7 @@ export declare const UnsignedVPValidator: z.ZodObject<{
683
683
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>>;
684
684
  proof: z.ZodUnion<[z.ZodObject<{
685
685
  type: z.ZodString;
686
- created: z.ZodString;
686
+ created: z.ZodOptional<z.ZodString>;
687
687
  challenge: z.ZodOptional<z.ZodString>;
688
688
  domain: z.ZodOptional<z.ZodString>;
689
689
  nonce: z.ZodOptional<z.ZodString>;
@@ -692,7 +692,7 @@ export declare const UnsignedVPValidator: z.ZodObject<{
692
692
  jws: z.ZodOptional<z.ZodString>;
693
693
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
694
694
  type: z.ZodString;
695
- created: z.ZodString;
695
+ created: z.ZodOptional<z.ZodString>;
696
696
  challenge: z.ZodOptional<z.ZodString>;
697
697
  domain: z.ZodOptional<z.ZodString>;
698
698
  nonce: z.ZodOptional<z.ZodString>;
@@ -850,7 +850,7 @@ export declare const UnsignedVPValidator: z.ZodObject<{
850
850
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>>;
851
851
  proof: z.ZodUnion<[z.ZodObject<{
852
852
  type: z.ZodString;
853
- created: z.ZodString;
853
+ created: z.ZodOptional<z.ZodString>;
854
854
  challenge: z.ZodOptional<z.ZodString>;
855
855
  domain: z.ZodOptional<z.ZodString>;
856
856
  nonce: z.ZodOptional<z.ZodString>;
@@ -859,7 +859,7 @@ export declare const UnsignedVPValidator: z.ZodObject<{
859
859
  jws: z.ZodOptional<z.ZodString>;
860
860
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
861
861
  type: z.ZodString;
862
- created: z.ZodString;
862
+ created: z.ZodOptional<z.ZodString>;
863
863
  challenge: z.ZodOptional<z.ZodString>;
864
864
  domain: z.ZodOptional<z.ZodString>;
865
865
  nonce: z.ZodOptional<z.ZodString>;
@@ -1025,7 +1025,7 @@ export declare const VPValidator: z.ZodObject<{
1025
1025
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>>;
1026
1026
  proof: z.ZodUnion<[z.ZodObject<{
1027
1027
  type: z.ZodString;
1028
- created: z.ZodString;
1028
+ created: z.ZodOptional<z.ZodString>;
1029
1029
  challenge: z.ZodOptional<z.ZodString>;
1030
1030
  domain: z.ZodOptional<z.ZodString>;
1031
1031
  nonce: z.ZodOptional<z.ZodString>;
@@ -1034,7 +1034,7 @@ export declare const VPValidator: z.ZodObject<{
1034
1034
  jws: z.ZodOptional<z.ZodString>;
1035
1035
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
1036
1036
  type: z.ZodString;
1037
- created: z.ZodString;
1037
+ created: z.ZodOptional<z.ZodString>;
1038
1038
  challenge: z.ZodOptional<z.ZodString>;
1039
1039
  domain: z.ZodOptional<z.ZodString>;
1040
1040
  nonce: z.ZodOptional<z.ZodString>;
@@ -1192,7 +1192,7 @@ export declare const VPValidator: z.ZodObject<{
1192
1192
  }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>>;
1193
1193
  proof: z.ZodUnion<[z.ZodObject<{
1194
1194
  type: z.ZodString;
1195
- created: z.ZodString;
1195
+ created: z.ZodOptional<z.ZodString>;
1196
1196
  challenge: z.ZodOptional<z.ZodString>;
1197
1197
  domain: z.ZodOptional<z.ZodString>;
1198
1198
  nonce: z.ZodOptional<z.ZodString>;
@@ -1201,7 +1201,7 @@ export declare const VPValidator: z.ZodObject<{
1201
1201
  jws: z.ZodOptional<z.ZodString>;
1202
1202
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
1203
1203
  type: z.ZodString;
1204
- created: z.ZodString;
1204
+ created: z.ZodOptional<z.ZodString>;
1205
1205
  challenge: z.ZodOptional<z.ZodString>;
1206
1206
  domain: z.ZodOptional<z.ZodString>;
1207
1207
  nonce: z.ZodOptional<z.ZodString>;
@@ -1213,7 +1213,7 @@ export declare const VPValidator: z.ZodObject<{
1213
1213
  holder: z.ZodOptional<z.ZodString>;
1214
1214
  proof: z.ZodUnion<[z.ZodObject<{
1215
1215
  type: z.ZodString;
1216
- created: z.ZodString;
1216
+ created: z.ZodOptional<z.ZodString>;
1217
1217
  challenge: z.ZodOptional<z.ZodString>;
1218
1218
  domain: z.ZodOptional<z.ZodString>;
1219
1219
  nonce: z.ZodOptional<z.ZodString>;
@@ -1222,7 +1222,7 @@ export declare const VPValidator: z.ZodObject<{
1222
1222
  jws: z.ZodOptional<z.ZodString>;
1223
1223
  }, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
1224
1224
  type: z.ZodString;
1225
- created: z.ZodString;
1225
+ created: z.ZodOptional<z.ZodString>;
1226
1226
  challenge: z.ZodOptional<z.ZodString>;
1227
1227
  domain: z.ZodOptional<z.ZodString>;
1228
1228
  nonce: z.ZodOptional<z.ZodString>;
package/dist/vc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vc.d.ts","sourceRoot":"","sources":["../src/vc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,gBAAgB,2EAAwD,CAAC;AACtF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvD,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAE/E,eAAO,MAAM,cAAc;;;;mBAM1B,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEnD,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAErE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;iBAU3B,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;iBAqBjB,CAAC;AACpB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC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["../src/vc.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@learncard/types",
3
- "version": "5.19.0",
3
+ "version": "5.20.0",
4
4
  "description": "Shared types for learn card",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/src/lcn.ts CHANGED
@@ -707,21 +707,6 @@ export const PaginatedConsentFlowDataValidator = PaginationResponseValidator.ext
707
707
  });
708
708
  export type PaginatedConsentFlowData = z.infer<typeof PaginatedConsentFlowDataValidator>;
709
709
 
710
- export const ConsentFlowContractDataForDidValidator = z.object({
711
- credentials: z.object({ category: z.string(), uri: z.string() }).array(),
712
- personal: z.record(z.string(), z.string()).default({}),
713
- date: z.string(),
714
- contractUri: z.string(),
715
- });
716
- export type ConsentFlowContractDataForDid = z.infer<typeof ConsentFlowContractDataForDidValidator>;
717
-
718
- export const PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
719
- records: ConsentFlowContractDataForDidValidator.array(),
720
- });
721
- export type PaginatedConsentFlowDataForDid = z.infer<
722
- typeof PaginatedConsentFlowDataForDidValidator
723
- >;
724
-
725
710
  export const ConsentFlowTermValidator = z.object({
726
711
  sharing: z.boolean().optional(),
727
712
  shared: z.string().array().optional(),
@@ -771,6 +756,42 @@ export const PaginatedConsentFlowTermsValidator = PaginationResponseValidator.ex
771
756
  });
772
757
  export type PaginatedConsentFlowTerms = z.infer<typeof PaginatedConsentFlowTermsValidator>;
773
758
 
759
+ export const ConsentFlowGuardianApprovalValidator = z.object({
760
+ guardianProfileId: z.string(),
761
+ guardianDid: z.string(),
762
+ approvedAt: z.string().datetime(),
763
+ contractUpdatedAt: z.string(),
764
+ });
765
+ export type ConsentFlowGuardianApproval = z.infer<typeof ConsentFlowGuardianApprovalValidator>;
766
+
767
+ export const ConsentFlowContractDataForDidValidator = z.object({
768
+ credentials: z.object({ category: z.string(), uri: z.string() }).array(),
769
+ personal: z.record(z.string(), z.string()).default({}),
770
+ date: z.string(),
771
+ createdAt: z.string().optional(),
772
+ contractUpdatedAt: z.string(),
773
+ contractExpiresAt: z.string().optional(),
774
+ reasonForAccessing: z.string().optional(),
775
+ guardian: z.object({
776
+ required: z.boolean(),
777
+ approved: z.boolean(),
778
+ approval: ConsentFlowGuardianApprovalValidator.optional(),
779
+ }),
780
+ contractUri: z.string(),
781
+ termsUri: z.string(),
782
+ status: ConsentFlowTermsStatusValidator,
783
+ expiresAt: z.string().optional(),
784
+ terms: ConsentFlowTermsValidator,
785
+ });
786
+ export type ConsentFlowContractDataForDid = z.infer<typeof ConsentFlowContractDataForDidValidator>;
787
+
788
+ export const PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
789
+ records: ConsentFlowContractDataForDidValidator.array(),
790
+ });
791
+ export type PaginatedConsentFlowDataForDid = z.infer<
792
+ typeof PaginatedConsentFlowDataForDidValidator
793
+ >;
794
+
774
795
  export const ConsentFlowContractQueryValidator = z.object({
775
796
  read: z
776
797
  .object({
@@ -884,6 +905,7 @@ export const ConsentFlowTransactionValidator = z.object({
884
905
  expiresAt: z.string().optional(),
885
906
  oneTime: z.boolean().optional(),
886
907
  terms: ConsentFlowTermsValidator.optional(),
908
+ guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),
887
909
  id: z.string(),
888
910
  action: ConsentFlowTransactionActionValidator,
889
911
  date: z.string(),
package/src/vc.test.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { expect, test } from 'vitest';
2
+ import { ProofValidator } from './vc';
3
+
4
+ test('only final ecdsa-rdfc-2019 DataIntegrityProofs may omit created', () => {
5
+ const proof = {
6
+ type: 'DataIntegrityProof',
7
+ cryptosuite: 'ecdsa-rdfc-2019',
8
+ proofPurpose: 'authentication',
9
+ verificationMethod: 'did:example:holder#key',
10
+ proofValue: 'zSignature',
11
+ };
12
+
13
+ expect(ProofValidator.parse(proof)).toEqual(proof);
14
+ const legacy = { ...proof, cryptosuite: 'eddsa-rdfc-2022' };
15
+ expect(ProofValidator.safeParse(legacy).success).toBe(false);
16
+ expect(ProofValidator.safeParse({ ...legacy, created: '2026-01-01T00:00:00Z' }).success).toBe(
17
+ true
18
+ );
19
+ expect(ProofValidator.safeParse({ ...proof, type: 'Ed25519Signature2018' }).success).toBe(
20
+ false
21
+ );
22
+ expect(ProofValidator.safeParse({ ...proof, created: null }).success).toBe(false);
23
+ });
24
+
25
+ test('malformed final-suite proofs identify missing required fields rather than created', () => {
26
+ const result = ProofValidator.safeParse({
27
+ type: 'DataIntegrityProof',
28
+ cryptosuite: 'ecdsa-rdfc-2019',
29
+ proofPurpose: 'authentication',
30
+ proofValue: 'zSignature',
31
+ });
32
+
33
+ expect(result.success).toBe(false);
34
+ expect(result.error?.issues.map(issue => issue.path)).toEqual([['verificationMethod']]);
35
+ });
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({