@learncard/didkey-plugin 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,7 +33,10 @@ var __copyProps = /* @__PURE__ */ __name((to, from, except, desc) => {
33
33
  }
34
34
  return to;
35
35
  }, "__copyProps");
36
- var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), "__toESM");
36
+ var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
38
+ mod
39
+ )), "__toESM");
37
40
  var require_types_cjs_development = __commonJS({
38
41
  "../learn-card-types/dist/types.cjs.development.js"(exports, module) {
39
42
  "use strict";
@@ -922,11 +925,14 @@ var require_types_cjs_development = __commonJS({
922
925
  const parsedType = this._getType(input);
923
926
  if (parsedType !== ZodParsedType.string) {
924
927
  const ctx2 = this._getOrReturnCtx(input);
925
- addIssueToContext(ctx2, {
926
- code: ZodIssueCode.invalid_type,
927
- expected: ZodParsedType.string,
928
- received: ctx2.parsedType
929
- });
928
+ addIssueToContext(
929
+ ctx2,
930
+ {
931
+ code: ZodIssueCode.invalid_type,
932
+ expected: ZodParsedType.string,
933
+ received: ctx2.parsedType
934
+ }
935
+ );
930
936
  return INVALID;
931
937
  }
932
938
  const status = new ParseStatus();
@@ -1936,7 +1942,9 @@ var require_types_cjs_development = __commonJS({
1936
1942
  const value = ctx.data[key];
1937
1943
  pairs.push({
1938
1944
  key: { status: "valid", value: key },
1939
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1945
+ value: catchall._parse(
1946
+ new ParseInputLazyPath(ctx, value, ctx.path, key)
1947
+ ),
1940
1948
  alwaysSet: key in ctx.data
1941
1949
  });
1942
1950
  }
@@ -3497,11 +3505,13 @@ var require_types_cjs_development = __commonJS({
3497
3505
  type: mod.string().optional(),
3498
3506
  narrative: mod.string().optional()
3499
3507
  });
3500
- var ImageValidator = mod.string().or(mod.object({
3501
- id: mod.string(),
3502
- type: mod.string(),
3503
- caption: mod.string().optional()
3504
- }));
3508
+ var ImageValidator = mod.string().or(
3509
+ mod.object({
3510
+ id: mod.string(),
3511
+ type: mod.string(),
3512
+ caption: mod.string().optional()
3513
+ })
3514
+ );
3505
3515
  var GeoCoordinatesValidator = mod.object({
3506
3516
  type: mod.string().min(1).or(mod.string().array().nonempty()),
3507
3517
  latitude: mod.number(),
@@ -3543,29 +3553,31 @@ var require_types_cjs_development = __commonJS({
3543
3553
  identifier: mod.string(),
3544
3554
  identifierType: IdentifierTypeValidator
3545
3555
  });
3546
- var ProfileValidator = mod.string().or(mod.object({
3547
- id: mod.string().optional(),
3548
- type: mod.string().or(mod.string().array().nonempty().optional()),
3549
- name: mod.string().optional(),
3550
- url: mod.string().optional(),
3551
- phone: mod.string().optional(),
3552
- description: mod.string().optional(),
3553
- endorsement: mod.any().array().optional(),
3554
- image: ImageValidator.optional(),
3555
- email: mod.string().email().optional(),
3556
- address: AddressValidator.optional(),
3557
- otherIdentifier: IdentifierEntryValidator.array().optional(),
3558
- official: mod.string().optional(),
3559
- parentOrg: mod.any().optional(),
3560
- familyName: mod.string().optional(),
3561
- givenName: mod.string().optional(),
3562
- additionalName: mod.string().optional(),
3563
- patronymicName: mod.string().optional(),
3564
- honorificPrefix: mod.string().optional(),
3565
- honorificSuffix: mod.string().optional(),
3566
- familyNamePrefix: mod.string().optional(),
3567
- dateOfBirth: mod.string().optional()
3568
- }).catchall(mod.any()));
3556
+ var ProfileValidator = mod.string().or(
3557
+ mod.object({
3558
+ id: mod.string().optional(),
3559
+ type: mod.string().or(mod.string().array().nonempty().optional()),
3560
+ name: mod.string().optional(),
3561
+ url: mod.string().optional(),
3562
+ phone: mod.string().optional(),
3563
+ description: mod.string().optional(),
3564
+ endorsement: mod.any().array().optional(),
3565
+ image: ImageValidator.optional(),
3566
+ email: mod.string().email().optional(),
3567
+ address: AddressValidator.optional(),
3568
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
3569
+ official: mod.string().optional(),
3570
+ parentOrg: mod.any().optional(),
3571
+ familyName: mod.string().optional(),
3572
+ givenName: mod.string().optional(),
3573
+ additionalName: mod.string().optional(),
3574
+ patronymicName: mod.string().optional(),
3575
+ honorificPrefix: mod.string().optional(),
3576
+ honorificSuffix: mod.string().optional(),
3577
+ familyNamePrefix: mod.string().optional(),
3578
+ dateOfBirth: mod.string().optional()
3579
+ }).catchall(mod.any())
3580
+ );
3569
3581
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3570
3582
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3571
3583
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
@@ -3634,15 +3646,17 @@ var require_types_cjs_development = __commonJS({
3634
3646
  aad: mod.string().optional(),
3635
3647
  recipients: JWERecipientValidator.array().optional()
3636
3648
  });
3637
- var VerificationMethodValidator = mod.string().or(mod.object({
3638
- "@context": ContextValidator.optional(),
3639
- id: mod.string(),
3640
- type: mod.string(),
3641
- controller: mod.string(),
3642
- publicKeyJwk: JWKValidator.optional(),
3643
- publicKeyBase58: mod.string().optional(),
3644
- blockChainAccountId: mod.string().optional()
3645
- }).catchall(mod.any()));
3649
+ var VerificationMethodValidator = mod.string().or(
3650
+ mod.object({
3651
+ "@context": ContextValidator.optional(),
3652
+ id: mod.string(),
3653
+ type: mod.string(),
3654
+ controller: mod.string(),
3655
+ publicKeyJwk: JWKValidator.optional(),
3656
+ publicKeyBase58: mod.string().optional(),
3657
+ blockChainAccountId: mod.string().optional()
3658
+ }).catchall(mod.any())
3659
+ );
3646
3660
  var ServiceValidator = mod.object({
3647
3661
  id: mod.string(),
3648
3662
  type: mod.string().or(mod.string().array().nonempty()),
@@ -3840,7 +3854,9 @@ var require_types_cjs_development = __commonJS({
3840
3854
  name: mod.string().optional(),
3841
3855
  description: mod.string().optional(),
3842
3856
  image: ImageValidator.optional(),
3843
- credentialSubject: AchievementSubjectValidator.or(AchievementSubjectValidator.array()),
3857
+ credentialSubject: AchievementSubjectValidator.or(
3858
+ AchievementSubjectValidator.array()
3859
+ ),
3844
3860
  endorsement: UnsignedVCValidator.array().optional(),
3845
3861
  evidence: EvidenceValidator.array().optional()
3846
3862
  });
@@ -4069,7 +4085,9 @@ var require_types_cjs_development = __commonJS({
4069
4085
  ]);
4070
4086
  var ConsentFlowTransactionsQueryValidator = mod.object({
4071
4087
  terms: ConsentFlowTermsQueryValidator.optional(),
4072
- action: ConsentFlowTransactionActionValidator.or(ConsentFlowTransactionActionValidator.array()).optional(),
4088
+ action: ConsentFlowTransactionActionValidator.or(
4089
+ ConsentFlowTransactionActionValidator.array()
4090
+ ).optional(),
4073
4091
  date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4074
4092
  expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4075
4093
  oneTime: mod.boolean().optional()
@@ -4162,9 +4180,15 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
4162
4180
  if (key.length > 64)
4163
4181
  throw new Error("Key must be less than 64 characters");
4164
4182
  if (key.length < 64) {
4165
- console.warn("Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes");
4166
- console.warn("Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!");
4167
- console.warn("See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details");
4183
+ console.warn(
4184
+ "Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes"
4185
+ );
4186
+ console.warn(
4187
+ "Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!"
4188
+ );
4189
+ console.warn(
4190
+ "See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details"
4191
+ );
4168
4192
  }
4169
4193
  const seed = key.padStart(64, "0");
4170
4194
  const seedBytes = toUint8Array(seed);