@learncard/types 5.17.3 → 5.17.5

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.
Files changed (49) hide show
  1. package/README.md +5 -5
  2. package/dist/bitstring-status-list.d.ts +1 -1
  3. package/dist/bitstring-status-list.d.ts.map +1 -1
  4. package/dist/clr.d.ts +1 -1
  5. package/dist/clr.d.ts.map +1 -1
  6. package/dist/credential-format.d.ts +1 -1
  7. package/dist/credential-format.d.ts.map +1 -1
  8. package/dist/crypto.d.ts +1 -1
  9. package/dist/crypto.d.ts.map +1 -1
  10. package/dist/did.d.ts +1 -1
  11. package/dist/did.d.ts.map +1 -1
  12. package/dist/lcn.d.ts +137 -134
  13. package/dist/lcn.d.ts.map +1 -1
  14. package/dist/learncard.d.ts +1 -1
  15. package/dist/learncard.d.ts.map +1 -1
  16. package/dist/learncloud.d.ts +1 -1
  17. package/dist/learncloud.d.ts.map +1 -1
  18. package/dist/mongo.d.ts +1 -1
  19. package/dist/mongo.d.ts.map +1 -1
  20. package/dist/obv3.d.ts +1 -1
  21. package/dist/obv3.d.ts.map +1 -1
  22. package/dist/queries.d.ts +4 -4
  23. package/dist/queries.d.ts.map +1 -1
  24. package/dist/types.cjs.development.cjs +4307 -2430
  25. package/dist/types.cjs.development.cjs.map +4 -4
  26. package/dist/types.cjs.production.min.cjs +56 -14
  27. package/dist/types.cjs.production.min.cjs.map +4 -4
  28. package/dist/types.esm.js +19 -22
  29. package/dist/types.esm.js.map +2 -2
  30. package/dist/vc.d.ts +1 -1
  31. package/dist/vc.d.ts.map +1 -1
  32. package/package.json +64 -59
  33. package/src/auth.ts +460 -0
  34. package/src/bitstring-status-list.ts +44 -0
  35. package/src/clr.ts +68 -0
  36. package/src/credential-format.ts +154 -0
  37. package/src/crypto.ts +41 -0
  38. package/src/did.ts +47 -0
  39. package/src/helpers.ts +10 -0
  40. package/src/index.ts +17 -0
  41. package/src/lcn.ts +2181 -0
  42. package/src/learncard.ts +123 -0
  43. package/src/learncloud.ts +26 -0
  44. package/src/mongo.ts +14 -0
  45. package/src/obv3.ts +252 -0
  46. package/src/queries.ts +56 -0
  47. package/src/registries.ts +9 -0
  48. package/src/vc.ts +221 -0
  49. package/src/wasm.ts +1 -0
package/dist/types.esm.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/vc.ts
5
- import { z } from "zod";
5
+ import { z } from "zod/v4";
6
6
  var ContextValidator = z.array(z.string().or(z.record(z.string(), z.any())));
7
7
  var AchievementCriteriaValidator = z.object({
8
8
  type: z.string().optional(),
@@ -161,10 +161,10 @@ var VPValidator = UnsignedVPValidator.extend({
161
161
  });
162
162
 
163
163
  // src/did.ts
164
- import { z as z3 } from "zod";
164
+ import { z as z3 } from "zod/v4";
165
165
 
166
166
  // src/crypto.ts
167
- import { z as z2 } from "zod";
167
+ import { z as z2 } from "zod/v4";
168
168
  var JWKValidator = z2.object({
169
169
  kty: z2.string(),
170
170
  crv: z2.string(),
@@ -231,7 +231,7 @@ var DidDocumentValidator = z3.object({
231
231
  }).catchall(z3.any());
232
232
 
233
233
  // src/obv3.ts
234
- import { z as z4 } from "zod";
234
+ import { z as z4 } from "zod/v4";
235
235
  var AlignmentTargetTypeValidator = z4.enum([
236
236
  "ceasn:Competency",
237
237
  "ceterms:Credential",
@@ -419,7 +419,7 @@ var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.exte
419
419
  });
420
420
 
421
421
  // src/clr.ts
422
- import { z as z5 } from "zod";
422
+ import { z as z5 } from "zod/v4";
423
423
  var AssociationTypeValidator = z5.enum([
424
424
  "exactMatchOf",
425
425
  "extends",
@@ -458,7 +458,7 @@ var ClrCredentialValidator = UnsignedClrCredentialValidator.extend({
458
458
  });
459
459
 
460
460
  // src/credential-format.ts
461
- import { z as z6 } from "zod";
461
+ import { z as z6 } from "zod/v4";
462
462
  var CredentialFormatValidator = z6.enum([
463
463
  "w3c-vc-2.0",
464
464
  "w3c-vc-1.1",
@@ -480,7 +480,7 @@ var isStoredCredentialEnvelope = /* @__PURE__ */ __name((value) => {
480
480
  }, "isStoredCredentialEnvelope");
481
481
 
482
482
  // src/learncard.ts
483
- import { z as z7 } from "zod";
483
+ import { z as z7 } from "zod/v4";
484
484
  var StatusCheckEntryValidator = z7.object({
485
485
  /**
486
486
  * The `credentialStatus.type` as it appeared on the credential.
@@ -545,10 +545,10 @@ var CredentialRecordValidator = z7.object({
545
545
  }).catchall(z7.any());
546
546
 
547
547
  // src/learncloud.ts
548
- import { z as z9 } from "zod";
548
+ import { z as z9 } from "zod/v4";
549
549
 
550
550
  // src/mongo.ts
551
- import { z as z8 } from "zod";
551
+ import { z as z8 } from "zod/v4";
552
552
  var PaginationOptionsValidator = z8.object({
553
553
  limit: z8.number(),
554
554
  cursor: z8.string().optional(),
@@ -572,22 +572,15 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
572
572
  });
573
573
 
574
574
  // src/lcn.ts
575
- import { z as z11 } from "zod";
575
+ import { z as z11 } from "zod/v4";
576
576
 
577
577
  // src/queries.ts
578
- import { z as z10 } from "zod";
578
+ import { z as z10 } from "zod/v4";
579
579
  var parseRegexString = /* @__PURE__ */ __name((regexStr) => {
580
580
  const match = regexStr.match(/^\/(.*)\/([gimsuy]*)$/);
581
581
  if (!match) throw new Error("Invalid RegExp string format");
582
582
  return { pattern: match[1], flags: match[2] };
583
583
  }, "parseRegexString");
584
- var withStringOverride = /* @__PURE__ */ __name((schema) => {
585
- const metaSchema = schema;
586
- if (typeof metaSchema.meta === "function") {
587
- return metaSchema.meta({ override: { type: "string" } });
588
- }
589
- return schema;
590
- }, "withStringOverride");
591
584
  var RegExpStringValidator = z10.string().refine(
592
585
  (str) => {
593
586
  try {
@@ -607,8 +600,11 @@ var RegExpStringValidator = z10.string().refine(
607
600
  } catch (error) {
608
601
  throw new Error(`Invalid RegExp: ${error.message}`);
609
602
  }
610
- });
611
- var RegExpValidator = withStringOverride(z10.instanceof(RegExp).or(RegExpStringValidator));
603
+ }).meta({ override: { type: "string" } });
604
+ var RegExpValidator = z10.preprocess(
605
+ (value) => value instanceof RegExp ? `/${value.source}/${value.flags}` : value,
606
+ RegExpStringValidator
607
+ );
612
608
  var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator }));
613
609
  var StringQuery = z10.union([
614
610
  BaseStringQuery,
@@ -1821,7 +1817,8 @@ var RequestLearnerContextEventValidator = z11.object({
1821
1817
  includePersonalData: z11.boolean().optional().default(false),
1822
1818
  format: z11.enum(["prompt", "structured"]).optional().default("prompt"),
1823
1819
  instructions: z11.string().optional(),
1824
- detailLevel: z11.enum(["compact", "expanded"]).optional().default("compact")
1820
+ detailLevel: z11.enum(["compact", "expanded"]).optional().default("compact"),
1821
+ waitForSync: z11.boolean().optional().default(false)
1825
1822
  });
1826
1823
  var SummaryCredentialKeywordValidator = z11.object({
1827
1824
  occupations: z11.array(z11.string()).nullable(),
@@ -1973,7 +1970,7 @@ var AuthSessionError = class extends Error {
1973
1970
  };
1974
1971
 
1975
1972
  // src/bitstring-status-list.ts
1976
- import { z as z12 } from "zod";
1973
+ import { z as z12 } from "zod/v4";
1977
1974
  var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
1978
1975
  var DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131072;
1979
1976
  var BitstringStatusPurposeValidator = z12.enum(BITSTRING_STATUS_PURPOSES);