@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.
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -56,7 +57,10 @@ var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {
56
57
  }
57
58
  return to;
58
59
  }, "__copyProps");
59
- var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), "__toESM");
60
+ var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
61
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
62
+ mod
63
+ )), "__toESM");
60
64
  var require_types_cjs_development = __commonJS({
61
65
  "../learn-card-types/dist/types.cjs.development.js"(exports, module2) {
62
66
  "use strict";
@@ -945,11 +949,14 @@ var require_types_cjs_development = __commonJS({
945
949
  const parsedType = this._getType(input);
946
950
  if (parsedType !== ZodParsedType.string) {
947
951
  const ctx2 = this._getOrReturnCtx(input);
948
- addIssueToContext(ctx2, {
949
- code: ZodIssueCode.invalid_type,
950
- expected: ZodParsedType.string,
951
- received: ctx2.parsedType
952
- });
952
+ addIssueToContext(
953
+ ctx2,
954
+ {
955
+ code: ZodIssueCode.invalid_type,
956
+ expected: ZodParsedType.string,
957
+ received: ctx2.parsedType
958
+ }
959
+ );
953
960
  return INVALID;
954
961
  }
955
962
  const status = new ParseStatus();
@@ -1959,7 +1966,9 @@ var require_types_cjs_development = __commonJS({
1959
1966
  const value = ctx.data[key];
1960
1967
  pairs.push({
1961
1968
  key: { status: "valid", value: key },
1962
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1969
+ value: catchall._parse(
1970
+ new ParseInputLazyPath(ctx, value, ctx.path, key)
1971
+ ),
1963
1972
  alwaysSet: key in ctx.data
1964
1973
  });
1965
1974
  }
@@ -3520,11 +3529,13 @@ var require_types_cjs_development = __commonJS({
3520
3529
  type: mod.string().optional(),
3521
3530
  narrative: mod.string().optional()
3522
3531
  });
3523
- var ImageValidator = mod.string().or(mod.object({
3524
- id: mod.string(),
3525
- type: mod.string(),
3526
- caption: mod.string().optional()
3527
- }));
3532
+ var ImageValidator = mod.string().or(
3533
+ mod.object({
3534
+ id: mod.string(),
3535
+ type: mod.string(),
3536
+ caption: mod.string().optional()
3537
+ })
3538
+ );
3528
3539
  var GeoCoordinatesValidator = mod.object({
3529
3540
  type: mod.string().min(1).or(mod.string().array().nonempty()),
3530
3541
  latitude: mod.number(),
@@ -3566,29 +3577,31 @@ var require_types_cjs_development = __commonJS({
3566
3577
  identifier: mod.string(),
3567
3578
  identifierType: IdentifierTypeValidator
3568
3579
  });
3569
- var ProfileValidator = mod.string().or(mod.object({
3570
- id: mod.string().optional(),
3571
- type: mod.string().or(mod.string().array().nonempty().optional()),
3572
- name: mod.string().optional(),
3573
- url: mod.string().optional(),
3574
- phone: mod.string().optional(),
3575
- description: mod.string().optional(),
3576
- endorsement: mod.any().array().optional(),
3577
- image: ImageValidator.optional(),
3578
- email: mod.string().email().optional(),
3579
- address: AddressValidator.optional(),
3580
- otherIdentifier: IdentifierEntryValidator.array().optional(),
3581
- official: mod.string().optional(),
3582
- parentOrg: mod.any().optional(),
3583
- familyName: mod.string().optional(),
3584
- givenName: mod.string().optional(),
3585
- additionalName: mod.string().optional(),
3586
- patronymicName: mod.string().optional(),
3587
- honorificPrefix: mod.string().optional(),
3588
- honorificSuffix: mod.string().optional(),
3589
- familyNamePrefix: mod.string().optional(),
3590
- dateOfBirth: mod.string().optional()
3591
- }).catchall(mod.any()));
3580
+ var ProfileValidator = mod.string().or(
3581
+ mod.object({
3582
+ id: mod.string().optional(),
3583
+ type: mod.string().or(mod.string().array().nonempty().optional()),
3584
+ name: mod.string().optional(),
3585
+ url: mod.string().optional(),
3586
+ phone: mod.string().optional(),
3587
+ description: mod.string().optional(),
3588
+ endorsement: mod.any().array().optional(),
3589
+ image: ImageValidator.optional(),
3590
+ email: mod.string().email().optional(),
3591
+ address: AddressValidator.optional(),
3592
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
3593
+ official: mod.string().optional(),
3594
+ parentOrg: mod.any().optional(),
3595
+ familyName: mod.string().optional(),
3596
+ givenName: mod.string().optional(),
3597
+ additionalName: mod.string().optional(),
3598
+ patronymicName: mod.string().optional(),
3599
+ honorificPrefix: mod.string().optional(),
3600
+ honorificSuffix: mod.string().optional(),
3601
+ familyNamePrefix: mod.string().optional(),
3602
+ dateOfBirth: mod.string().optional()
3603
+ }).catchall(mod.any())
3604
+ );
3592
3605
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3593
3606
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3594
3607
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
@@ -3657,15 +3670,17 @@ var require_types_cjs_development = __commonJS({
3657
3670
  aad: mod.string().optional(),
3658
3671
  recipients: JWERecipientValidator.array().optional()
3659
3672
  });
3660
- var VerificationMethodValidator = mod.string().or(mod.object({
3661
- "@context": ContextValidator.optional(),
3662
- id: mod.string(),
3663
- type: mod.string(),
3664
- controller: mod.string(),
3665
- publicKeyJwk: JWKValidator.optional(),
3666
- publicKeyBase58: mod.string().optional(),
3667
- blockChainAccountId: mod.string().optional()
3668
- }).catchall(mod.any()));
3673
+ var VerificationMethodValidator = mod.string().or(
3674
+ mod.object({
3675
+ "@context": ContextValidator.optional(),
3676
+ id: mod.string(),
3677
+ type: mod.string(),
3678
+ controller: mod.string(),
3679
+ publicKeyJwk: JWKValidator.optional(),
3680
+ publicKeyBase58: mod.string().optional(),
3681
+ blockChainAccountId: mod.string().optional()
3682
+ }).catchall(mod.any())
3683
+ );
3669
3684
  var ServiceValidator = mod.object({
3670
3685
  id: mod.string(),
3671
3686
  type: mod.string().or(mod.string().array().nonempty()),
@@ -3863,7 +3878,9 @@ var require_types_cjs_development = __commonJS({
3863
3878
  name: mod.string().optional(),
3864
3879
  description: mod.string().optional(),
3865
3880
  image: ImageValidator.optional(),
3866
- credentialSubject: AchievementSubjectValidator.or(AchievementSubjectValidator.array()),
3881
+ credentialSubject: AchievementSubjectValidator.or(
3882
+ AchievementSubjectValidator.array()
3883
+ ),
3867
3884
  endorsement: UnsignedVCValidator.array().optional(),
3868
3885
  evidence: EvidenceValidator.array().optional()
3869
3886
  });
@@ -4092,7 +4109,9 @@ var require_types_cjs_development = __commonJS({
4092
4109
  ]);
4093
4110
  var ConsentFlowTransactionsQueryValidator = mod.object({
4094
4111
  terms: ConsentFlowTermsQueryValidator.optional(),
4095
- action: ConsentFlowTransactionActionValidator.or(ConsentFlowTransactionActionValidator.array()).optional(),
4112
+ action: ConsentFlowTransactionActionValidator.or(
4113
+ ConsentFlowTransactionActionValidator.array()
4114
+ ).optional(),
4096
4115
  date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4097
4116
  expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4098
4117
  oneTime: mod.boolean().optional()
@@ -4185,9 +4204,15 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
4185
4204
  if (key.length > 64)
4186
4205
  throw new Error("Key must be less than 64 characters");
4187
4206
  if (key.length < 64) {
4188
- console.warn("Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes");
4189
- console.warn("Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!");
4190
- console.warn("See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details");
4207
+ console.warn(
4208
+ "Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes"
4209
+ );
4210
+ console.warn(
4211
+ "Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!"
4212
+ );
4213
+ console.warn(
4214
+ "See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details"
4215
+ );
4191
4216
  }
4192
4217
  const seed = key.padStart(64, "0");
4193
4218
  const seedBytes = toUint8Array(seed);