@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/types.esm.js CHANGED
@@ -138,14 +138,22 @@ var UnsignedVCValidator = z.object({
138
138
  }).catchall(z.any());
139
139
  var ProofValidator = z.object({
140
140
  type: z.string(),
141
- created: z.string(),
141
+ created: z.string().optional(),
142
142
  challenge: z.string().optional(),
143
143
  domain: z.string().optional(),
144
144
  nonce: z.string().optional(),
145
145
  proofPurpose: z.string(),
146
146
  verificationMethod: z.string(),
147
147
  jws: z.string().optional()
148
- }).catchall(z.any());
148
+ }).catchall(z.any()).superRefine((proof, ctx) => {
149
+ if (proof.created === void 0 && (proof.type !== "DataIntegrityProof" || proof.cryptosuite !== "ecdsa-rdfc-2019")) {
150
+ ctx.addIssue({
151
+ code: "custom",
152
+ path: ["created"],
153
+ message: "created is required for this proof suite"
154
+ });
155
+ }
156
+ });
149
157
  var VCValidator = UnsignedVCValidator.extend({
150
158
  proof: ProofValidator.or(ProofValidator.array())
151
159
  });
@@ -1066,15 +1074,6 @@ var ConsentFlowContractDataValidator = z11.object({
1066
1074
  var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
1067
1075
  records: ConsentFlowContractDataValidator.array()
1068
1076
  });
1069
- var ConsentFlowContractDataForDidValidator = z11.object({
1070
- credentials: z11.object({ category: z11.string(), uri: z11.string() }).array(),
1071
- personal: z11.record(z11.string(), z11.string()).default({}),
1072
- date: z11.string(),
1073
- contractUri: z11.string()
1074
- });
1075
- var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
1076
- records: ConsentFlowContractDataForDidValidator.array()
1077
- });
1078
1077
  var ConsentFlowTermValidator = z11.object({
1079
1078
  sharing: z11.boolean().optional(),
1080
1079
  shared: z11.string().array().optional(),
@@ -1108,6 +1107,34 @@ var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
1108
1107
  status: ConsentFlowTermsStatusValidator
1109
1108
  }).array()
1110
1109
  });
1110
+ var ConsentFlowGuardianApprovalValidator = z11.object({
1111
+ guardianProfileId: z11.string(),
1112
+ guardianDid: z11.string(),
1113
+ approvedAt: z11.string().datetime(),
1114
+ contractUpdatedAt: z11.string()
1115
+ });
1116
+ var ConsentFlowContractDataForDidValidator = z11.object({
1117
+ credentials: z11.object({ category: z11.string(), uri: z11.string() }).array(),
1118
+ personal: z11.record(z11.string(), z11.string()).default({}),
1119
+ date: z11.string(),
1120
+ createdAt: z11.string().optional(),
1121
+ contractUpdatedAt: z11.string(),
1122
+ contractExpiresAt: z11.string().optional(),
1123
+ reasonForAccessing: z11.string().optional(),
1124
+ guardian: z11.object({
1125
+ required: z11.boolean(),
1126
+ approved: z11.boolean(),
1127
+ approval: ConsentFlowGuardianApprovalValidator.optional()
1128
+ }),
1129
+ contractUri: z11.string(),
1130
+ termsUri: z11.string(),
1131
+ status: ConsentFlowTermsStatusValidator,
1132
+ expiresAt: z11.string().optional(),
1133
+ terms: ConsentFlowTermsValidator
1134
+ });
1135
+ var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
1136
+ records: ConsentFlowContractDataForDidValidator.array()
1137
+ });
1111
1138
  var ConsentFlowContractQueryValidator = z11.object({
1112
1139
  read: z11.object({
1113
1140
  anonymize: z11.boolean().optional(),
@@ -1168,6 +1195,7 @@ var ConsentFlowTransactionValidator = z11.object({
1168
1195
  expiresAt: z11.string().optional(),
1169
1196
  oneTime: z11.boolean().optional(),
1170
1197
  terms: ConsentFlowTermsValidator.optional(),
1198
+ guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),
1171
1199
  id: z11.string(),
1172
1200
  action: ConsentFlowTransactionActionValidator,
1173
1201
  date: z11.string(),
@@ -2397,6 +2425,7 @@ export {
2397
2425
  ConsentFlowContractValidator,
2398
2426
  ConsentFlowDataForDidQueryValidator,
2399
2427
  ConsentFlowDataQueryValidator,
2428
+ ConsentFlowGuardianApprovalValidator,
2400
2429
  ConsentFlowTermValidator,
2401
2430
  ConsentFlowTermsQueryValidator,
2402
2431
  ConsentFlowTermsStatusValidator,