@learncard/didkey-plugin 1.0.12 → 1.0.13
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/didkey-plugin.cjs.development.js +74 -49
- package/dist/didkey-plugin.cjs.development.js.map +3 -3
- package/dist/didkey-plugin.cjs.production.min.js +1 -1
- package/dist/didkey-plugin.cjs.production.min.js.map +3 -3
- package/dist/didkey-plugin.esm.js +73 -49
- package/dist/didkey-plugin.esm.js.map +3 -3
- package/package.json +4 -4
@@ -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(
|
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(
|
926
|
-
|
927
|
-
|
928
|
-
|
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(
|
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(
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
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(
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
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(
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
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(
|
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(
|
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(
|
4166
|
-
|
4167
|
-
|
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);
|