@learncard/didkey-plugin 1.0.11 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/didkey-plugin.cjs.development.js +83 -50
- 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 +82 -50
- 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";
|
@@ -113,6 +116,8 @@ var require_types_cjs_development = __commonJS({
|
|
113
116
|
LCNProfileValidator: () => LCNProfileValidator,
|
114
117
|
LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
|
115
118
|
LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
|
119
|
+
PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator,
|
120
|
+
PaginatedBoostsValidator: () => PaginatedBoostsValidator,
|
116
121
|
PaginatedConsentFlowContractsValidator: () => PaginatedConsentFlowContractsValidator,
|
117
122
|
PaginatedConsentFlowDataValidator: () => PaginatedConsentFlowDataValidator,
|
118
123
|
PaginatedConsentFlowTermsValidator: () => PaginatedConsentFlowTermsValidator,
|
@@ -920,11 +925,14 @@ var require_types_cjs_development = __commonJS({
|
|
920
925
|
const parsedType = this._getType(input);
|
921
926
|
if (parsedType !== ZodParsedType.string) {
|
922
927
|
const ctx2 = this._getOrReturnCtx(input);
|
923
|
-
addIssueToContext(
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
+
addIssueToContext(
|
929
|
+
ctx2,
|
930
|
+
{
|
931
|
+
code: ZodIssueCode.invalid_type,
|
932
|
+
expected: ZodParsedType.string,
|
933
|
+
received: ctx2.parsedType
|
934
|
+
}
|
935
|
+
);
|
928
936
|
return INVALID;
|
929
937
|
}
|
930
938
|
const status = new ParseStatus();
|
@@ -1934,7 +1942,9 @@ var require_types_cjs_development = __commonJS({
|
|
1934
1942
|
const value = ctx.data[key];
|
1935
1943
|
pairs.push({
|
1936
1944
|
key: { status: "valid", value: key },
|
1937
|
-
value: catchall._parse(
|
1945
|
+
value: catchall._parse(
|
1946
|
+
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
1947
|
+
),
|
1938
1948
|
alwaysSet: key in ctx.data
|
1939
1949
|
});
|
1940
1950
|
}
|
@@ -3495,11 +3505,13 @@ var require_types_cjs_development = __commonJS({
|
|
3495
3505
|
type: mod.string().optional(),
|
3496
3506
|
narrative: mod.string().optional()
|
3497
3507
|
});
|
3498
|
-
var ImageValidator = mod.string().or(
|
3499
|
-
|
3500
|
-
|
3501
|
-
|
3502
|
-
|
3508
|
+
var ImageValidator = mod.string().or(
|
3509
|
+
mod.object({
|
3510
|
+
id: mod.string(),
|
3511
|
+
type: mod.string(),
|
3512
|
+
caption: mod.string().optional()
|
3513
|
+
})
|
3514
|
+
);
|
3503
3515
|
var GeoCoordinatesValidator = mod.object({
|
3504
3516
|
type: mod.string().min(1).or(mod.string().array().nonempty()),
|
3505
3517
|
latitude: mod.number(),
|
@@ -3541,29 +3553,31 @@ var require_types_cjs_development = __commonJS({
|
|
3541
3553
|
identifier: mod.string(),
|
3542
3554
|
identifierType: IdentifierTypeValidator
|
3543
3555
|
});
|
3544
|
-
var ProfileValidator = mod.string().or(
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
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
|
+
);
|
3567
3581
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
3568
3582
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
|
3569
3583
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
|
@@ -3632,15 +3646,17 @@ var require_types_cjs_development = __commonJS({
|
|
3632
3646
|
aad: mod.string().optional(),
|
3633
3647
|
recipients: JWERecipientValidator.array().optional()
|
3634
3648
|
});
|
3635
|
-
var VerificationMethodValidator = mod.string().or(
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
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
|
+
);
|
3644
3660
|
var ServiceValidator = mod.object({
|
3645
3661
|
id: mod.string(),
|
3646
3662
|
type: mod.string().or(mod.string().array().nonempty()),
|
@@ -3838,7 +3854,9 @@ var require_types_cjs_development = __commonJS({
|
|
3838
3854
|
name: mod.string().optional(),
|
3839
3855
|
description: mod.string().optional(),
|
3840
3856
|
image: ImageValidator.optional(),
|
3841
|
-
credentialSubject: AchievementSubjectValidator.or(
|
3857
|
+
credentialSubject: AchievementSubjectValidator.or(
|
3858
|
+
AchievementSubjectValidator.array()
|
3859
|
+
),
|
3842
3860
|
endorsement: UnsignedVCValidator.array().optional(),
|
3843
3861
|
evidence: EvidenceValidator.array().optional()
|
3844
3862
|
});
|
@@ -3897,7 +3915,7 @@ var require_types_cjs_development = __commonJS({
|
|
3897
3915
|
websiteLink: mod.string().optional(),
|
3898
3916
|
isServiceProfile: mod.boolean().default(false).optional(),
|
3899
3917
|
type: mod.string().optional(),
|
3900
|
-
notificationsWebhook: mod.string().url().startsWith("
|
3918
|
+
notificationsWebhook: mod.string().url().startsWith("http").optional()
|
3901
3919
|
});
|
3902
3920
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
3903
3921
|
records: LCNProfileValidator.array()
|
@@ -3924,11 +3942,17 @@ var require_types_cjs_development = __commonJS({
|
|
3924
3942
|
status: LCNBoostStatus.optional(),
|
3925
3943
|
autoConnectRecipients: mod.boolean().optional()
|
3926
3944
|
});
|
3945
|
+
var PaginatedBoostsValidator = PaginationResponseValidator.extend({
|
3946
|
+
records: BoostValidator.array()
|
3947
|
+
});
|
3927
3948
|
var BoostRecipientValidator = mod.object({
|
3928
3949
|
to: LCNProfileValidator,
|
3929
3950
|
from: mod.string(),
|
3930
3951
|
received: mod.string().optional()
|
3931
3952
|
});
|
3953
|
+
var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
|
3954
|
+
records: BoostRecipientValidator.array()
|
3955
|
+
});
|
3932
3956
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
3933
3957
|
endpoint: mod.string(),
|
3934
3958
|
name: mod.string(),
|
@@ -4061,7 +4085,9 @@ var require_types_cjs_development = __commonJS({
|
|
4061
4085
|
]);
|
4062
4086
|
var ConsentFlowTransactionsQueryValidator = mod.object({
|
4063
4087
|
terms: ConsentFlowTermsQueryValidator.optional(),
|
4064
|
-
action: ConsentFlowTransactionActionValidator.or(
|
4088
|
+
action: ConsentFlowTransactionActionValidator.or(
|
4089
|
+
ConsentFlowTransactionActionValidator.array()
|
4090
|
+
).optional(),
|
4065
4091
|
date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
|
4066
4092
|
expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
|
4067
4093
|
oneTime: mod.boolean().optional()
|
@@ -4154,9 +4180,15 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
|
|
4154
4180
|
if (key.length > 64)
|
4155
4181
|
throw new Error("Key must be less than 64 characters");
|
4156
4182
|
if (key.length < 64) {
|
4157
|
-
console.warn(
|
4158
|
-
|
4159
|
-
|
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
|
+
);
|
4160
4192
|
}
|
4161
4193
|
const seed = key.padStart(64, "0");
|
4162
4194
|
const seedBytes = toUint8Array(seed);
|