@learncard/learn-cloud-plugin 2.3.18 → 2.3.21
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/learn-cloud-plugin.cjs.development.js +173 -9
- package/dist/learn-cloud-plugin.cjs.development.js.map +2 -2
- package/dist/learn-cloud-plugin.cjs.production.min.js +11 -11
- package/dist/learn-cloud-plugin.cjs.production.min.js.map +3 -3
- package/dist/learn-cloud-plugin.esm.js +173 -9
- package/dist/learn-cloud-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -19582,6 +19582,42 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
|
19582
19582
|
var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
|
|
19583
19583
|
proof: ProofValidator.or(ProofValidator.array())
|
|
19584
19584
|
});
|
|
19585
|
+
var AssociationTypeValidator = external_exports.enum([
|
|
19586
|
+
"exactMatchOf",
|
|
19587
|
+
"extends",
|
|
19588
|
+
"isChildOf",
|
|
19589
|
+
"isParentOf",
|
|
19590
|
+
"isPartOf",
|
|
19591
|
+
"isPeerOf",
|
|
19592
|
+
"isRelatedTo",
|
|
19593
|
+
"precedes",
|
|
19594
|
+
"replacedBy"
|
|
19595
|
+
]).or(external_exports.string());
|
|
19596
|
+
var AssociationValidator = external_exports.object({
|
|
19597
|
+
type: external_exports.string().array().nonempty(),
|
|
19598
|
+
associationType: AssociationTypeValidator,
|
|
19599
|
+
sourceId: external_exports.string().optional(),
|
|
19600
|
+
targetId: external_exports.string()
|
|
19601
|
+
}).catchall(external_exports.any());
|
|
19602
|
+
var ClrSubjectValidator = external_exports.object({
|
|
19603
|
+
id: external_exports.string().optional(),
|
|
19604
|
+
type: external_exports.string().array().nonempty(),
|
|
19605
|
+
identifier: external_exports.any().array().optional(),
|
|
19606
|
+
achievement: AchievementValidator.array().optional(),
|
|
19607
|
+
association: AssociationValidator.array().optional(),
|
|
19608
|
+
verifiableCredential: external_exports.any().array().optional()
|
|
19609
|
+
}).catchall(external_exports.any());
|
|
19610
|
+
var UnsignedClrCredentialValidator = UnsignedVCValidator.extend({
|
|
19611
|
+
name: external_exports.string().optional(),
|
|
19612
|
+
description: external_exports.string().optional(),
|
|
19613
|
+
image: ImageValidator.optional(),
|
|
19614
|
+
credentialSubject: ClrSubjectValidator.or(ClrSubjectValidator.array()),
|
|
19615
|
+
endorsement: EndorsementCredentialValidator.array().optional(),
|
|
19616
|
+
partial: external_exports.boolean().optional()
|
|
19617
|
+
});
|
|
19618
|
+
var ClrCredentialValidator = UnsignedClrCredentialValidator.extend({
|
|
19619
|
+
proof: ProofValidator.or(ProofValidator.array())
|
|
19620
|
+
});
|
|
19585
19621
|
var VerificationCheckValidator = external_exports.object({
|
|
19586
19622
|
checks: external_exports.string().array(),
|
|
19587
19623
|
warnings: external_exports.string().array(),
|
|
@@ -19933,10 +19969,16 @@ var SendBrandingOptionsValidator = external_exports.object({
|
|
|
19933
19969
|
credentialName: external_exports.string().optional().describe("Display name for the credential"),
|
|
19934
19970
|
recipientName: external_exports.string().optional().describe("Name of the recipient for personalization")
|
|
19935
19971
|
});
|
|
19972
|
+
var GuardianStatusValidator = external_exports.enum([
|
|
19973
|
+
"AWAITING_GUARDIAN",
|
|
19974
|
+
"GUARDIAN_APPROVED",
|
|
19975
|
+
"GUARDIAN_REJECTED"
|
|
19976
|
+
]);
|
|
19936
19977
|
var SendOptionsValidator = external_exports.object({
|
|
19937
19978
|
webhookUrl: external_exports.string().url().optional().describe("Webhook URL to receive claim notifications"),
|
|
19938
19979
|
suppressDelivery: external_exports.boolean().optional().describe("If true, returns claimUrl without sending email/SMS"),
|
|
19939
|
-
branding: SendBrandingOptionsValidator.optional().describe("Branding for email/SMS delivery")
|
|
19980
|
+
branding: SendBrandingOptionsValidator.optional().describe("Branding for email/SMS delivery"),
|
|
19981
|
+
guardianEmail: external_exports.string().email().optional().describe("Guardian email that must approve before student can claim")
|
|
19940
19982
|
});
|
|
19941
19983
|
var SendBoostInputValidator = external_exports.object({
|
|
19942
19984
|
type: external_exports.literal("boost"),
|
|
@@ -19953,11 +19995,25 @@ var SendBoostInputValidator = external_exports.object({
|
|
|
19953
19995
|
}).refine((data) => data.templateUri || data.template || data.signedCredential, {
|
|
19954
19996
|
message: "Either templateUri, template, or signedCredential must be provided.",
|
|
19955
19997
|
path: ["templateUri"]
|
|
19956
|
-
})
|
|
19998
|
+
}).refine(
|
|
19999
|
+
(data) => {
|
|
20000
|
+
if (data.options?.guardianEmail) {
|
|
20001
|
+
return data.options.guardianEmail.toLowerCase() !== data.recipient.toLowerCase();
|
|
20002
|
+
}
|
|
20003
|
+
return true;
|
|
20004
|
+
},
|
|
20005
|
+
{
|
|
20006
|
+
message: "guardianEmail must differ from recipient (self-approval not allowed)",
|
|
20007
|
+
path: ["options", "guardianEmail"]
|
|
20008
|
+
}
|
|
20009
|
+
);
|
|
19957
20010
|
var SendInboxResponseValidator = external_exports.object({
|
|
19958
20011
|
issuanceId: external_exports.string(),
|
|
19959
20012
|
status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
|
|
19960
|
-
claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true")
|
|
20013
|
+
claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
|
|
20014
|
+
guardianStatus: GuardianStatusValidator.optional().describe(
|
|
20015
|
+
"Present when guardianEmail was specified"
|
|
20016
|
+
)
|
|
19961
20017
|
});
|
|
19962
20018
|
var SendBoostResponseValidator = external_exports.object({
|
|
19963
20019
|
type: external_exports.literal("boost"),
|
|
@@ -20194,7 +20250,11 @@ var LCNNotificationTypeEnumValidator = external_exports.enum([
|
|
|
20194
20250
|
"APP_LISTING_APPROVED",
|
|
20195
20251
|
"APP_LISTING_REJECTED",
|
|
20196
20252
|
"APP_LISTING_WITHDRAWN",
|
|
20197
|
-
"DEVICE_LINK_REQUEST"
|
|
20253
|
+
"DEVICE_LINK_REQUEST",
|
|
20254
|
+
"GUARDIAN_APPROVAL_PENDING",
|
|
20255
|
+
"GUARDIAN_APPROVED",
|
|
20256
|
+
"GUARDIAN_REJECTED",
|
|
20257
|
+
"APP_NOTIFICATION"
|
|
20198
20258
|
]);
|
|
20199
20259
|
var LCNNotificationMessageValidator = external_exports.object({
|
|
20200
20260
|
title: external_exports.string().optional(),
|
|
@@ -20232,7 +20292,10 @@ var LCNNotificationDataValidator = external_exports.object({
|
|
|
20232
20292
|
var LCNNotificationValidator = external_exports.object({
|
|
20233
20293
|
type: LCNNotificationTypeEnumValidator,
|
|
20234
20294
|
to: LCNProfileValidator.partial().and(external_exports.object({ did: external_exports.string() })),
|
|
20235
|
-
from:
|
|
20295
|
+
from: external_exports.union([
|
|
20296
|
+
external_exports.string(),
|
|
20297
|
+
LCNProfileValidator.partial().and(external_exports.object({ did: external_exports.string() }))
|
|
20298
|
+
]),
|
|
20236
20299
|
message: LCNNotificationMessageValidator.optional(),
|
|
20237
20300
|
data: LCNNotificationDataValidator.optional(),
|
|
20238
20301
|
sent: external_exports.iso.datetime().optional(),
|
|
@@ -20337,7 +20400,12 @@ var InboxCredentialValidator = external_exports.object({
|
|
|
20337
20400
|
signingAuthority: external_exports.object({
|
|
20338
20401
|
endpoint: external_exports.string().optional(),
|
|
20339
20402
|
name: external_exports.string().optional()
|
|
20340
|
-
}).optional()
|
|
20403
|
+
}).optional(),
|
|
20404
|
+
// Guardian gate fields (all optional — absent on pre-existing credentials)
|
|
20405
|
+
guardianEmail: external_exports.string().email().optional(),
|
|
20406
|
+
guardianStatus: GuardianStatusValidator.optional(),
|
|
20407
|
+
guardianApprovedAt: external_exports.string().optional(),
|
|
20408
|
+
guardianApprovedByDid: external_exports.string().optional()
|
|
20341
20409
|
});
|
|
20342
20410
|
var PaginatedInboxCredentialsValidator = external_exports.object({
|
|
20343
20411
|
hasMore: external_exports.boolean(),
|
|
@@ -20805,11 +20873,86 @@ var GetTemplateRecipientsEventValidator = external_exports.object({
|
|
|
20805
20873
|
}).refine((input) => Boolean(input.templateAlias) !== Boolean(input.boostUri), {
|
|
20806
20874
|
message: "Exactly one of templateAlias or boostUri is required"
|
|
20807
20875
|
});
|
|
20876
|
+
var RequestLearnerContextEventValidator = external_exports.object({
|
|
20877
|
+
type: external_exports.literal("request-learner-context"),
|
|
20878
|
+
includeCredentials: external_exports.boolean().optional().default(true),
|
|
20879
|
+
includePersonalData: external_exports.boolean().optional().default(false),
|
|
20880
|
+
format: external_exports.enum(["prompt", "structured"]).optional().default("prompt"),
|
|
20881
|
+
instructions: external_exports.string().optional(),
|
|
20882
|
+
detailLevel: external_exports.enum(["compact", "expanded"]).optional().default("compact")
|
|
20883
|
+
});
|
|
20884
|
+
var SummaryCredentialKeywordValidator = external_exports.object({
|
|
20885
|
+
occupations: external_exports.array(external_exports.string()).nullable(),
|
|
20886
|
+
careers: external_exports.array(external_exports.string()).nullable(),
|
|
20887
|
+
jobs: external_exports.array(external_exports.string()).nullable(),
|
|
20888
|
+
skills: external_exports.array(external_exports.string()).nullable(),
|
|
20889
|
+
fieldOfStudy: external_exports.string().nullable()
|
|
20890
|
+
});
|
|
20891
|
+
var SummaryCredentialDataValidator = external_exports.object({
|
|
20892
|
+
title: external_exports.string().describe("Short, concise title for the learning session or credential"),
|
|
20893
|
+
summary: external_exports.string().describe("Comprehensive summary of what happened during the session"),
|
|
20894
|
+
learned: external_exports.array(external_exports.string()).describe("Bullet points of key knowledge gained"),
|
|
20895
|
+
skills: external_exports.array(
|
|
20896
|
+
external_exports.object({
|
|
20897
|
+
title: external_exports.string().describe("Name of the skill category"),
|
|
20898
|
+
description: external_exports.string().describe("Detailed description of what this skill category involves")
|
|
20899
|
+
})
|
|
20900
|
+
).describe("Categorized skills learned during the session"),
|
|
20901
|
+
nextSteps: external_exports.array(
|
|
20902
|
+
external_exports.object({
|
|
20903
|
+
title: external_exports.string().describe("Title of the suggested next step"),
|
|
20904
|
+
description: external_exports.string().describe("Description explaining why this next step is recommended"),
|
|
20905
|
+
keywords: SummaryCredentialKeywordValidator.optional().describe(
|
|
20906
|
+
"Optional taxonomy keywords for occupations/careers/jobs/skills/fieldOfStudy. Omit if not relevant."
|
|
20907
|
+
)
|
|
20908
|
+
})
|
|
20909
|
+
).describe("Recommended follow-up activities or learning modules"),
|
|
20910
|
+
reflections: external_exports.array(
|
|
20911
|
+
external_exports.object({
|
|
20912
|
+
title: external_exports.string().describe("Title of the reflection"),
|
|
20913
|
+
description: external_exports.string().describe("Detailed description of what this reflection involves")
|
|
20914
|
+
})
|
|
20915
|
+
).describe("Reflections on the learning experience")
|
|
20916
|
+
});
|
|
20917
|
+
var SendAiSessionCredentialEventValidator = external_exports.object({
|
|
20918
|
+
type: external_exports.literal("send-ai-session-credential"),
|
|
20919
|
+
sessionTitle: external_exports.string(),
|
|
20920
|
+
summaryData: SummaryCredentialDataValidator,
|
|
20921
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
20922
|
+
});
|
|
20923
|
+
var SendNotificationEventValidator = external_exports.object({
|
|
20924
|
+
type: external_exports.literal("send-notification"),
|
|
20925
|
+
title: external_exports.string().optional(),
|
|
20926
|
+
body: external_exports.string().optional(),
|
|
20927
|
+
actionPath: external_exports.string().optional(),
|
|
20928
|
+
category: external_exports.string().optional(),
|
|
20929
|
+
priority: external_exports.enum(["normal", "high"]).optional()
|
|
20930
|
+
});
|
|
20931
|
+
var counterKeyValidator = external_exports.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "Key must be alphanumeric with _ or -");
|
|
20932
|
+
var IncrementCounterEventValidator = external_exports.object({
|
|
20933
|
+
type: external_exports.literal("increment-counter"),
|
|
20934
|
+
key: counterKeyValidator,
|
|
20935
|
+
amount: external_exports.number().int().finite()
|
|
20936
|
+
});
|
|
20937
|
+
var GetCounterEventValidator = external_exports.object({
|
|
20938
|
+
type: external_exports.literal("get-counter"),
|
|
20939
|
+
key: counterKeyValidator
|
|
20940
|
+
});
|
|
20941
|
+
var GetCountersEventValidator = external_exports.object({
|
|
20942
|
+
type: external_exports.literal("get-counters"),
|
|
20943
|
+
keys: external_exports.array(counterKeyValidator).min(1).max(50).optional()
|
|
20944
|
+
});
|
|
20808
20945
|
var AppEventValidator = external_exports.discriminatedUnion("type", [
|
|
20809
20946
|
SendCredentialEventValidator,
|
|
20810
20947
|
CheckCredentialEventValidator,
|
|
20811
20948
|
CheckIssuanceStatusEventValidator,
|
|
20812
|
-
GetTemplateRecipientsEventValidator
|
|
20949
|
+
GetTemplateRecipientsEventValidator,
|
|
20950
|
+
RequestLearnerContextEventValidator,
|
|
20951
|
+
SendAiSessionCredentialEventValidator,
|
|
20952
|
+
SendNotificationEventValidator,
|
|
20953
|
+
IncrementCounterEventValidator,
|
|
20954
|
+
GetCounterEventValidator,
|
|
20955
|
+
GetCountersEventValidator
|
|
20813
20956
|
]);
|
|
20814
20957
|
var AppEventInputValidator = external_exports.object({
|
|
20815
20958
|
listingId: external_exports.string(),
|
|
@@ -20840,7 +20983,7 @@ var CredentialActivityValidator = external_exports.object({
|
|
|
20840
20983
|
activityId: external_exports.string(),
|
|
20841
20984
|
eventType: CredentialActivityEventTypeValidator,
|
|
20842
20985
|
timestamp: external_exports.string(),
|
|
20843
|
-
actorProfileId: external_exports.string(),
|
|
20986
|
+
actorProfileId: external_exports.string().optional(),
|
|
20844
20987
|
recipientType: CredentialActivityRecipientTypeValidator,
|
|
20845
20988
|
recipientIdentifier: external_exports.string(),
|
|
20846
20989
|
boostUri: external_exports.string().optional(),
|
|
@@ -21255,7 +21398,28 @@ var getLearnCloudPlugin = /* @__PURE__ */ __name(async (initialLearnCard, url2,
|
|
|
21255
21398
|
...recipients
|
|
21256
21399
|
]);
|
|
21257
21400
|
return client.storage.store.mutate({ item: jwe });
|
|
21258
|
-
}, "uploadEncrypted")
|
|
21401
|
+
}, "uploadEncrypted"),
|
|
21402
|
+
delete: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
21403
|
+
_learnCard.debug?.("learnCard.store['LearnCloud'].delete", { uri });
|
|
21404
|
+
let deleted = false;
|
|
21405
|
+
try {
|
|
21406
|
+
deleted = Boolean(await client.storage.delete.mutate({ uri }));
|
|
21407
|
+
} catch (error46) {
|
|
21408
|
+
_learnCard.debug?.("LearnCloud store.delete storage.delete failed", error46);
|
|
21409
|
+
}
|
|
21410
|
+
if (!deleted) return false;
|
|
21411
|
+
try {
|
|
21412
|
+
const records = await _learnCard.index.LearnCloud.get({ uri });
|
|
21413
|
+
for (const record2 of records) {
|
|
21414
|
+
await _learnCard.index.LearnCloud.remove(record2.id, {
|
|
21415
|
+
cache: "skip-cache"
|
|
21416
|
+
});
|
|
21417
|
+
}
|
|
21418
|
+
} catch (error46) {
|
|
21419
|
+
_learnCard.debug?.("LearnCloud store.delete index cleanup failed", error46);
|
|
21420
|
+
}
|
|
21421
|
+
return true;
|
|
21422
|
+
}, "delete")
|
|
21259
21423
|
},
|
|
21260
21424
|
index: {
|
|
21261
21425
|
get: /* @__PURE__ */ __name(async (_learnCard, query) => {
|