@learncard/helpers 1.3.10 → 1.3.12

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.
@@ -130,11 +130,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
130
130
  credentialStatus: z.ZodOptional<z.ZodUnion<[
131
131
  z.ZodObject<{
132
132
  type: z.ZodString;
133
- id: z.ZodString;
133
+ id: z.ZodOptional<z.ZodString>;
134
134
  }, z.core.$catchall<z.ZodAny>>,
135
135
  z.ZodArray<z.ZodObject<{
136
136
  type: z.ZodString;
137
- id: z.ZodString;
137
+ id: z.ZodOptional<z.ZodString>;
138
138
  }, z.core.$catchall<z.ZodAny>>>
139
139
  ]>>;
140
140
  name: z.ZodOptional<z.ZodString>;
@@ -144,11 +144,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
144
144
  status: z.ZodOptional<z.ZodUnion<[
145
145
  z.ZodObject<{
146
146
  type: z.ZodString;
147
- id: z.ZodString;
147
+ id: z.ZodOptional<z.ZodString>;
148
148
  }, z.core.$catchall<z.ZodAny>>,
149
149
  z.ZodArray<z.ZodObject<{
150
150
  type: z.ZodString;
151
- id: z.ZodString;
151
+ id: z.ZodOptional<z.ZodString>;
152
152
  }, z.core.$catchall<z.ZodAny>>>
153
153
  ]>>;
154
154
  termsOfUse: z.ZodOptional<z.ZodUnion<[
@@ -334,11 +334,11 @@ declare const VCValidator: z.ZodObject<{
334
334
  credentialStatus: z.ZodOptional<z.ZodUnion<[
335
335
  z.ZodObject<{
336
336
  type: z.ZodString;
337
- id: z.ZodString;
337
+ id: z.ZodOptional<z.ZodString>;
338
338
  }, z.core.$catchall<z.ZodAny>>,
339
339
  z.ZodArray<z.ZodObject<{
340
340
  type: z.ZodString;
341
- id: z.ZodString;
341
+ id: z.ZodOptional<z.ZodString>;
342
342
  }, z.core.$catchall<z.ZodAny>>>
343
343
  ]>>;
344
344
  name: z.ZodOptional<z.ZodString>;
@@ -348,11 +348,11 @@ declare const VCValidator: z.ZodObject<{
348
348
  status: z.ZodOptional<z.ZodUnion<[
349
349
  z.ZodObject<{
350
350
  type: z.ZodString;
351
- id: z.ZodString;
351
+ id: z.ZodOptional<z.ZodString>;
352
352
  }, z.core.$catchall<z.ZodAny>>,
353
353
  z.ZodArray<z.ZodObject<{
354
354
  type: z.ZodString;
355
- id: z.ZodString;
355
+ id: z.ZodOptional<z.ZodString>;
356
356
  }, z.core.$catchall<z.ZodAny>>>
357
357
  ]>>;
358
358
  termsOfUse: z.ZodOptional<z.ZodUnion<[
@@ -554,7 +554,10 @@ declare const BitstringStatusListEntryValidator: z.ZodObject<{
554
554
  revocation: "revocation";
555
555
  suspension: "suspension";
556
556
  }>;
557
- statusListIndex: z.ZodString;
557
+ statusListIndex: z.ZodUnion<[
558
+ z.ZodString,
559
+ z.ZodNumber
560
+ ]>;
558
561
  statusListCredential: z.ZodString;
559
562
  }, z.core.$strip>;
560
563
  export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
package/dist/helpers.d.ts CHANGED
@@ -130,11 +130,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
130
130
  credentialStatus: z.ZodOptional<z.ZodUnion<[
131
131
  z.ZodObject<{
132
132
  type: z.ZodString;
133
- id: z.ZodString;
133
+ id: z.ZodOptional<z.ZodString>;
134
134
  }, z.core.$catchall<z.ZodAny>>,
135
135
  z.ZodArray<z.ZodObject<{
136
136
  type: z.ZodString;
137
- id: z.ZodString;
137
+ id: z.ZodOptional<z.ZodString>;
138
138
  }, z.core.$catchall<z.ZodAny>>>
139
139
  ]>>;
140
140
  name: z.ZodOptional<z.ZodString>;
@@ -144,11 +144,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
144
144
  status: z.ZodOptional<z.ZodUnion<[
145
145
  z.ZodObject<{
146
146
  type: z.ZodString;
147
- id: z.ZodString;
147
+ id: z.ZodOptional<z.ZodString>;
148
148
  }, z.core.$catchall<z.ZodAny>>,
149
149
  z.ZodArray<z.ZodObject<{
150
150
  type: z.ZodString;
151
- id: z.ZodString;
151
+ id: z.ZodOptional<z.ZodString>;
152
152
  }, z.core.$catchall<z.ZodAny>>>
153
153
  ]>>;
154
154
  termsOfUse: z.ZodOptional<z.ZodUnion<[
@@ -334,11 +334,11 @@ declare const VCValidator: z.ZodObject<{
334
334
  credentialStatus: z.ZodOptional<z.ZodUnion<[
335
335
  z.ZodObject<{
336
336
  type: z.ZodString;
337
- id: z.ZodString;
337
+ id: z.ZodOptional<z.ZodString>;
338
338
  }, z.core.$catchall<z.ZodAny>>,
339
339
  z.ZodArray<z.ZodObject<{
340
340
  type: z.ZodString;
341
- id: z.ZodString;
341
+ id: z.ZodOptional<z.ZodString>;
342
342
  }, z.core.$catchall<z.ZodAny>>>
343
343
  ]>>;
344
344
  name: z.ZodOptional<z.ZodString>;
@@ -348,11 +348,11 @@ declare const VCValidator: z.ZodObject<{
348
348
  status: z.ZodOptional<z.ZodUnion<[
349
349
  z.ZodObject<{
350
350
  type: z.ZodString;
351
- id: z.ZodString;
351
+ id: z.ZodOptional<z.ZodString>;
352
352
  }, z.core.$catchall<z.ZodAny>>,
353
353
  z.ZodArray<z.ZodObject<{
354
354
  type: z.ZodString;
355
- id: z.ZodString;
355
+ id: z.ZodOptional<z.ZodString>;
356
356
  }, z.core.$catchall<z.ZodAny>>>
357
357
  ]>>;
358
358
  termsOfUse: z.ZodOptional<z.ZodUnion<[
@@ -554,7 +554,10 @@ declare const BitstringStatusListEntryValidator: z.ZodObject<{
554
554
  revocation: "revocation";
555
555
  suspension: "suspension";
556
556
  }>;
557
- statusListIndex: z.ZodString;
557
+ statusListIndex: z.ZodUnion<[
558
+ z.ZodString,
559
+ z.ZodNumber
560
+ ]>;
558
561
  statusListCredential: z.ZodString;
559
562
  }, z.core.$strip>;
560
563
  export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
@@ -15675,7 +15675,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15675
15675
  }).catchall(external_exports.any())
15676
15676
  );
15677
15677
  var CredentialSubjectValidator = external_exports.object({ id: external_exports.string().optional() }).catchall(external_exports.any());
15678
- var CredentialStatusValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string() }).catchall(external_exports.any());
15678
+ var CredentialStatusValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string().optional() }).catchall(external_exports.any());
15679
15679
  var CredentialSchemaValidator = external_exports.object({ id: external_exports.string(), type: external_exports.string() }).catchall(external_exports.any());
15680
15680
  var RefreshServiceValidator = external_exports.object({ id: external_exports.string().optional(), type: external_exports.string() }).catchall(external_exports.any());
15681
15681
  var TermsOfUseValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string().optional() }).catchall(external_exports.any());
@@ -16076,8 +16076,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16076
16076
  statusListIndex: external_exports.string().optional()
16077
16077
  });
16078
16078
  var VerificationCheckValidator = external_exports.object({
16079
+ /**
16080
+ * Checks that completed successfully. This does not imply that warnings can be ignored.
16081
+ */
16079
16082
  checks: external_exports.string().array(),
16083
+ /**
16084
+ * Security-relevant conditions that did not prevent the requested cryptographic checks from
16085
+ * completing. In particular, a non-DID issuer warning means the signature is valid but the
16086
+ * named URL issuer's authorization of that signing key was not established.
16087
+ */
16080
16088
  warnings: external_exports.string().array(),
16089
+ /** Verification failures that prevented one or more requested checks from succeeding. */
16081
16090
  errors: external_exports.string().array(),
16082
16091
  /**
16083
16092
  * Per-entry results for the `credentialStatus` check, populated
@@ -17538,7 +17547,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17538
17547
  id: external_exports.string().optional(),
17539
17548
  type: external_exports.literal("BitstringStatusListEntry"),
17540
17549
  statusPurpose: BitstringStatusPurposeValidator,
17541
- statusListIndex: external_exports.string(),
17550
+ statusListIndex: external_exports.string().or(external_exports.number().int().nonnegative()),
17542
17551
  statusListCredential: external_exports.string()
17543
17552
  });
17544
17553
  var AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({
@@ -18046,7 +18055,8 @@ var getCredentialStatusArray = /* @__PURE__ */ __name((credential) => {
18046
18055
  var isBitstringStatusListEntry = /* @__PURE__ */ __name((status) => {
18047
18056
  if (!status || typeof status !== "object") return false;
18048
18057
  const record = status;
18049
- return record.type === "BitstringStatusListEntry" && (record.statusPurpose === "revocation" || record.statusPurpose === "suspension") && typeof record.statusListIndex === "string" && typeof record.statusListCredential === "string";
18058
+ const statusListIndex = record.statusListIndex;
18059
+ return record.type === "BitstringStatusListEntry" && (record.statusPurpose === "revocation" || record.statusPurpose === "suspension") && (typeof statusListIndex === "string" || typeof statusListIndex === "number" && Number.isInteger(statusListIndex) && statusListIndex >= 0) && typeof record.statusListCredential === "string";
18050
18060
  }, "isBitstringStatusListEntry");
18051
18061
  var getBitstringStatusListEntries = /* @__PURE__ */ __name((credential) => {
18052
18062
  if (!credential || typeof credential !== "object" || Array.isArray(credential)) return [];