@learncard/types 5.23.0 → 5.23.2
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/auth.d.ts +63 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/obv3.d.ts +2 -0
- package/dist/obv3.d.ts.map +1 -1
- package/dist/skillIcons.d.ts +18 -0
- package/dist/skillIcons.d.ts.map +1 -0
- package/dist/types.cjs.development.cjs +30 -1
- package/dist/types.cjs.development.cjs.map +3 -3
- package/dist/types.cjs.production.min.cjs +6 -6
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +31 -1
- package/dist/types.esm.js.map +4 -4
- package/dist/vc.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/auth.ts +65 -3
- package/src/index.ts +1 -0
- package/src/obv3.ts +1 -0
- package/src/skillIcons.ts +31 -0
- package/src/vc.test.ts +10 -3
- package/src/vc.ts +13 -1
package/dist/types.esm.js
CHANGED
|
@@ -146,7 +146,18 @@ var ProofValidator = z.object({
|
|
|
146
146
|
verificationMethod: z.string(),
|
|
147
147
|
jws: z.string().optional()
|
|
148
148
|
}).catchall(z.any()).superRefine((proof, ctx) => {
|
|
149
|
-
if (proof.created === void 0 &&
|
|
149
|
+
if (proof.created === void 0 && // These standardized Data Integrity suites make created optional.
|
|
150
|
+
// Keep the prior requirement for legacy and unknown proof suites.
|
|
151
|
+
// https://www.w3.org/TR/vc-di-eddsa/#proof-configuration-eddsa-jcs-2022
|
|
152
|
+
// https://www.w3.org/TR/vc-di-bbs/#proof-configuration
|
|
153
|
+
(proof.type !== "DataIntegrityProof" || ![
|
|
154
|
+
"ecdsa-rdfc-2019",
|
|
155
|
+
"ecdsa-jcs-2019",
|
|
156
|
+
"ecdsa-sd-2023",
|
|
157
|
+
"eddsa-rdfc-2022",
|
|
158
|
+
"eddsa-jcs-2022",
|
|
159
|
+
"bbs-2023"
|
|
160
|
+
].includes(proof.cryptosuite))) {
|
|
150
161
|
ctx.addIssue({
|
|
151
162
|
code: "custom",
|
|
152
163
|
path: ["created"],
|
|
@@ -414,6 +425,7 @@ var AchievementSubjectValidator = z4.object({
|
|
|
414
425
|
term: z4.string().optional()
|
|
415
426
|
}).catchall(z4.any());
|
|
416
427
|
var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
428
|
+
awardedDate: z4.string().optional(),
|
|
417
429
|
name: z4.string().optional(),
|
|
418
430
|
description: z4.string().optional(),
|
|
419
431
|
image: ImageValidator.optional(),
|
|
@@ -3304,6 +3316,20 @@ var ShareLinkPublicContentViewValidator = z16.object({
|
|
|
3304
3316
|
contentUrl: z16.string(),
|
|
3305
3317
|
receipt: z16.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
3306
3318
|
}).strict();
|
|
3319
|
+
|
|
3320
|
+
// src/skillIcons.ts
|
|
3321
|
+
import { z as z17 } from "zod";
|
|
3322
|
+
var SKILL_ICON_MAX_NAMES_PER_REQUEST = 100;
|
|
3323
|
+
var SKILL_ICON_MAX_CHARACTERS_PER_REQUEST = 2500;
|
|
3324
|
+
var SkillIconNamesValidator = z17.array(z17.string().nonempty()).min(1).max(SKILL_ICON_MAX_NAMES_PER_REQUEST, {
|
|
3325
|
+
message: `A maximum of ${SKILL_ICON_MAX_NAMES_PER_REQUEST} skill names can be sent per request`
|
|
3326
|
+
}).refine(
|
|
3327
|
+
(names) => names.reduce((total, name) => total + name.length, 0) <= SKILL_ICON_MAX_CHARACTERS_PER_REQUEST,
|
|
3328
|
+
{
|
|
3329
|
+
message: `Skill names may total at most ${SKILL_ICON_MAX_CHARACTERS_PER_REQUEST} characters per request`
|
|
3330
|
+
}
|
|
3331
|
+
);
|
|
3332
|
+
var GenerateSkillIconsInputValidator = z17.object({ names: SkillIconNamesValidator });
|
|
3307
3333
|
export {
|
|
3308
3334
|
ACT_AS_HEADER,
|
|
3309
3335
|
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
|
|
@@ -3451,6 +3477,7 @@ export {
|
|
|
3451
3477
|
FlatAuthGrantValidator,
|
|
3452
3478
|
FrameworkWithSkillsValidator,
|
|
3453
3479
|
FullClaimHookValidator,
|
|
3480
|
+
GenerateSkillIconsInputValidator,
|
|
3454
3481
|
GeoCoordinatesValidator,
|
|
3455
3482
|
GetCounterEventValidator,
|
|
3456
3483
|
GetCountersEventValidator,
|
|
@@ -3611,6 +3638,8 @@ export {
|
|
|
3611
3638
|
SHARE_RECOVERY_PROTOCOL,
|
|
3612
3639
|
SHARE_TAG_BYTES,
|
|
3613
3640
|
SHARE_VIEW_RECEIPT_TTL_SECONDS,
|
|
3641
|
+
SKILL_ICON_MAX_CHARACTERS_PER_REQUEST,
|
|
3642
|
+
SKILL_ICON_MAX_NAMES_PER_REQUEST,
|
|
3614
3643
|
SendAiSessionCredentialEventValidator,
|
|
3615
3644
|
SendBoostInputValidator,
|
|
3616
3645
|
SendBoostResponseValidator,
|
|
@@ -3663,6 +3692,7 @@ export {
|
|
|
3663
3692
|
SkillFrameworkQueryValidator,
|
|
3664
3693
|
SkillFrameworkStatusEnum,
|
|
3665
3694
|
SkillFrameworkValidator,
|
|
3695
|
+
SkillIconNamesValidator,
|
|
3666
3696
|
SkillQueryValidator,
|
|
3667
3697
|
SkillSemanticSearchInputValidator,
|
|
3668
3698
|
SkillSemanticSearchResultItemValidator,
|