@learncard/didkey-plugin 1.0.11 → 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 +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
@@ -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(
|
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";
|
@@ -136,6 +140,8 @@ var require_types_cjs_development = __commonJS({
|
|
136
140
|
LCNProfileValidator: () => LCNProfileValidator,
|
137
141
|
LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
|
138
142
|
LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
|
143
|
+
PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator,
|
144
|
+
PaginatedBoostsValidator: () => PaginatedBoostsValidator,
|
139
145
|
PaginatedConsentFlowContractsValidator: () => PaginatedConsentFlowContractsValidator,
|
140
146
|
PaginatedConsentFlowDataValidator: () => PaginatedConsentFlowDataValidator,
|
141
147
|
PaginatedConsentFlowTermsValidator: () => PaginatedConsentFlowTermsValidator,
|
@@ -943,11 +949,14 @@ var require_types_cjs_development = __commonJS({
|
|
943
949
|
const parsedType = this._getType(input);
|
944
950
|
if (parsedType !== ZodParsedType.string) {
|
945
951
|
const ctx2 = this._getOrReturnCtx(input);
|
946
|
-
addIssueToContext(
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
952
|
+
addIssueToContext(
|
953
|
+
ctx2,
|
954
|
+
{
|
955
|
+
code: ZodIssueCode.invalid_type,
|
956
|
+
expected: ZodParsedType.string,
|
957
|
+
received: ctx2.parsedType
|
958
|
+
}
|
959
|
+
);
|
951
960
|
return INVALID;
|
952
961
|
}
|
953
962
|
const status = new ParseStatus();
|
@@ -1957,7 +1966,9 @@ var require_types_cjs_development = __commonJS({
|
|
1957
1966
|
const value = ctx.data[key];
|
1958
1967
|
pairs.push({
|
1959
1968
|
key: { status: "valid", value: key },
|
1960
|
-
value: catchall._parse(
|
1969
|
+
value: catchall._parse(
|
1970
|
+
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
1971
|
+
),
|
1961
1972
|
alwaysSet: key in ctx.data
|
1962
1973
|
});
|
1963
1974
|
}
|
@@ -3518,11 +3529,13 @@ var require_types_cjs_development = __commonJS({
|
|
3518
3529
|
type: mod.string().optional(),
|
3519
3530
|
narrative: mod.string().optional()
|
3520
3531
|
});
|
3521
|
-
var ImageValidator = mod.string().or(
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3532
|
+
var ImageValidator = mod.string().or(
|
3533
|
+
mod.object({
|
3534
|
+
id: mod.string(),
|
3535
|
+
type: mod.string(),
|
3536
|
+
caption: mod.string().optional()
|
3537
|
+
})
|
3538
|
+
);
|
3526
3539
|
var GeoCoordinatesValidator = mod.object({
|
3527
3540
|
type: mod.string().min(1).or(mod.string().array().nonempty()),
|
3528
3541
|
latitude: mod.number(),
|
@@ -3564,29 +3577,31 @@ var require_types_cjs_development = __commonJS({
|
|
3564
3577
|
identifier: mod.string(),
|
3565
3578
|
identifierType: IdentifierTypeValidator
|
3566
3579
|
});
|
3567
|
-
var ProfileValidator = mod.string().or(
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3580
|
-
|
3581
|
-
|
3582
|
-
|
3583
|
-
|
3584
|
-
|
3585
|
-
|
3586
|
-
|
3587
|
-
|
3588
|
-
|
3589
|
-
|
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
|
+
);
|
3590
3605
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
3591
3606
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
|
3592
3607
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
|
@@ -3655,15 +3670,17 @@ var require_types_cjs_development = __commonJS({
|
|
3655
3670
|
aad: mod.string().optional(),
|
3656
3671
|
recipients: JWERecipientValidator.array().optional()
|
3657
3672
|
});
|
3658
|
-
var VerificationMethodValidator = mod.string().or(
|
3659
|
-
|
3660
|
-
|
3661
|
-
|
3662
|
-
|
3663
|
-
|
3664
|
-
|
3665
|
-
|
3666
|
-
|
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
|
+
);
|
3667
3684
|
var ServiceValidator = mod.object({
|
3668
3685
|
id: mod.string(),
|
3669
3686
|
type: mod.string().or(mod.string().array().nonempty()),
|
@@ -3861,7 +3878,9 @@ var require_types_cjs_development = __commonJS({
|
|
3861
3878
|
name: mod.string().optional(),
|
3862
3879
|
description: mod.string().optional(),
|
3863
3880
|
image: ImageValidator.optional(),
|
3864
|
-
credentialSubject: AchievementSubjectValidator.or(
|
3881
|
+
credentialSubject: AchievementSubjectValidator.or(
|
3882
|
+
AchievementSubjectValidator.array()
|
3883
|
+
),
|
3865
3884
|
endorsement: UnsignedVCValidator.array().optional(),
|
3866
3885
|
evidence: EvidenceValidator.array().optional()
|
3867
3886
|
});
|
@@ -3920,7 +3939,7 @@ var require_types_cjs_development = __commonJS({
|
|
3920
3939
|
websiteLink: mod.string().optional(),
|
3921
3940
|
isServiceProfile: mod.boolean().default(false).optional(),
|
3922
3941
|
type: mod.string().optional(),
|
3923
|
-
notificationsWebhook: mod.string().url().startsWith("
|
3942
|
+
notificationsWebhook: mod.string().url().startsWith("http").optional()
|
3924
3943
|
});
|
3925
3944
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
3926
3945
|
records: LCNProfileValidator.array()
|
@@ -3947,11 +3966,17 @@ var require_types_cjs_development = __commonJS({
|
|
3947
3966
|
status: LCNBoostStatus.optional(),
|
3948
3967
|
autoConnectRecipients: mod.boolean().optional()
|
3949
3968
|
});
|
3969
|
+
var PaginatedBoostsValidator = PaginationResponseValidator.extend({
|
3970
|
+
records: BoostValidator.array()
|
3971
|
+
});
|
3950
3972
|
var BoostRecipientValidator = mod.object({
|
3951
3973
|
to: LCNProfileValidator,
|
3952
3974
|
from: mod.string(),
|
3953
3975
|
received: mod.string().optional()
|
3954
3976
|
});
|
3977
|
+
var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
|
3978
|
+
records: BoostRecipientValidator.array()
|
3979
|
+
});
|
3955
3980
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
3956
3981
|
endpoint: mod.string(),
|
3957
3982
|
name: mod.string(),
|
@@ -4084,7 +4109,9 @@ var require_types_cjs_development = __commonJS({
|
|
4084
4109
|
]);
|
4085
4110
|
var ConsentFlowTransactionsQueryValidator = mod.object({
|
4086
4111
|
terms: ConsentFlowTermsQueryValidator.optional(),
|
4087
|
-
action: ConsentFlowTransactionActionValidator.or(
|
4112
|
+
action: ConsentFlowTransactionActionValidator.or(
|
4113
|
+
ConsentFlowTransactionActionValidator.array()
|
4114
|
+
).optional(),
|
4088
4115
|
date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
|
4089
4116
|
expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
|
4090
4117
|
oneTime: mod.boolean().optional()
|
@@ -4177,9 +4204,15 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
|
|
4177
4204
|
if (key.length > 64)
|
4178
4205
|
throw new Error("Key must be less than 64 characters");
|
4179
4206
|
if (key.length < 64) {
|
4180
|
-
console.warn(
|
4181
|
-
|
4182
|
-
|
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
|
+
);
|
4183
4216
|
}
|
4184
4217
|
const seed = key.padStart(64, "0");
|
4185
4218
|
const seedBytes = toUint8Array(seed);
|