@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
|
@@ -19591,6 +19591,42 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
|
19591
19591
|
var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
|
|
19592
19592
|
proof: ProofValidator.or(ProofValidator.array())
|
|
19593
19593
|
});
|
|
19594
|
+
var AssociationTypeValidator = external_exports.enum([
|
|
19595
|
+
"exactMatchOf",
|
|
19596
|
+
"extends",
|
|
19597
|
+
"isChildOf",
|
|
19598
|
+
"isParentOf",
|
|
19599
|
+
"isPartOf",
|
|
19600
|
+
"isPeerOf",
|
|
19601
|
+
"isRelatedTo",
|
|
19602
|
+
"precedes",
|
|
19603
|
+
"replacedBy"
|
|
19604
|
+
]).or(external_exports.string());
|
|
19605
|
+
var AssociationValidator = external_exports.object({
|
|
19606
|
+
type: external_exports.string().array().nonempty(),
|
|
19607
|
+
associationType: AssociationTypeValidator,
|
|
19608
|
+
sourceId: external_exports.string().optional(),
|
|
19609
|
+
targetId: external_exports.string()
|
|
19610
|
+
}).catchall(external_exports.any());
|
|
19611
|
+
var ClrSubjectValidator = external_exports.object({
|
|
19612
|
+
id: external_exports.string().optional(),
|
|
19613
|
+
type: external_exports.string().array().nonempty(),
|
|
19614
|
+
identifier: external_exports.any().array().optional(),
|
|
19615
|
+
achievement: AchievementValidator.array().optional(),
|
|
19616
|
+
association: AssociationValidator.array().optional(),
|
|
19617
|
+
verifiableCredential: external_exports.any().array().optional()
|
|
19618
|
+
}).catchall(external_exports.any());
|
|
19619
|
+
var UnsignedClrCredentialValidator = UnsignedVCValidator.extend({
|
|
19620
|
+
name: external_exports.string().optional(),
|
|
19621
|
+
description: external_exports.string().optional(),
|
|
19622
|
+
image: ImageValidator.optional(),
|
|
19623
|
+
credentialSubject: ClrSubjectValidator.or(ClrSubjectValidator.array()),
|
|
19624
|
+
endorsement: EndorsementCredentialValidator.array().optional(),
|
|
19625
|
+
partial: external_exports.boolean().optional()
|
|
19626
|
+
});
|
|
19627
|
+
var ClrCredentialValidator = UnsignedClrCredentialValidator.extend({
|
|
19628
|
+
proof: ProofValidator.or(ProofValidator.array())
|
|
19629
|
+
});
|
|
19594
19630
|
var VerificationCheckValidator = external_exports.object({
|
|
19595
19631
|
checks: external_exports.string().array(),
|
|
19596
19632
|
warnings: external_exports.string().array(),
|
|
@@ -19942,10 +19978,16 @@ var SendBrandingOptionsValidator = external_exports.object({
|
|
|
19942
19978
|
credentialName: external_exports.string().optional().describe("Display name for the credential"),
|
|
19943
19979
|
recipientName: external_exports.string().optional().describe("Name of the recipient for personalization")
|
|
19944
19980
|
});
|
|
19981
|
+
var GuardianStatusValidator = external_exports.enum([
|
|
19982
|
+
"AWAITING_GUARDIAN",
|
|
19983
|
+
"GUARDIAN_APPROVED",
|
|
19984
|
+
"GUARDIAN_REJECTED"
|
|
19985
|
+
]);
|
|
19945
19986
|
var SendOptionsValidator = external_exports.object({
|
|
19946
19987
|
webhookUrl: external_exports.string().url().optional().describe("Webhook URL to receive claim notifications"),
|
|
19947
19988
|
suppressDelivery: external_exports.boolean().optional().describe("If true, returns claimUrl without sending email/SMS"),
|
|
19948
|
-
branding: SendBrandingOptionsValidator.optional().describe("Branding for email/SMS delivery")
|
|
19989
|
+
branding: SendBrandingOptionsValidator.optional().describe("Branding for email/SMS delivery"),
|
|
19990
|
+
guardianEmail: external_exports.string().email().optional().describe("Guardian email that must approve before student can claim")
|
|
19949
19991
|
});
|
|
19950
19992
|
var SendBoostInputValidator = external_exports.object({
|
|
19951
19993
|
type: external_exports.literal("boost"),
|
|
@@ -19962,11 +20004,25 @@ var SendBoostInputValidator = external_exports.object({
|
|
|
19962
20004
|
}).refine((data) => data.templateUri || data.template || data.signedCredential, {
|
|
19963
20005
|
message: "Either templateUri, template, or signedCredential must be provided.",
|
|
19964
20006
|
path: ["templateUri"]
|
|
19965
|
-
})
|
|
20007
|
+
}).refine(
|
|
20008
|
+
(data) => {
|
|
20009
|
+
if (data.options?.guardianEmail) {
|
|
20010
|
+
return data.options.guardianEmail.toLowerCase() !== data.recipient.toLowerCase();
|
|
20011
|
+
}
|
|
20012
|
+
return true;
|
|
20013
|
+
},
|
|
20014
|
+
{
|
|
20015
|
+
message: "guardianEmail must differ from recipient (self-approval not allowed)",
|
|
20016
|
+
path: ["options", "guardianEmail"]
|
|
20017
|
+
}
|
|
20018
|
+
);
|
|
19966
20019
|
var SendInboxResponseValidator = external_exports.object({
|
|
19967
20020
|
issuanceId: external_exports.string(),
|
|
19968
20021
|
status: external_exports.enum(["PENDING", "ISSUED", "EXPIRED", "DELIVERED", "CLAIMED"]),
|
|
19969
|
-
claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true")
|
|
20022
|
+
claimUrl: external_exports.string().url().optional().describe("Present when suppressDelivery=true"),
|
|
20023
|
+
guardianStatus: GuardianStatusValidator.optional().describe(
|
|
20024
|
+
"Present when guardianEmail was specified"
|
|
20025
|
+
)
|
|
19970
20026
|
});
|
|
19971
20027
|
var SendBoostResponseValidator = external_exports.object({
|
|
19972
20028
|
type: external_exports.literal("boost"),
|
|
@@ -20203,7 +20259,11 @@ var LCNNotificationTypeEnumValidator = external_exports.enum([
|
|
|
20203
20259
|
"APP_LISTING_APPROVED",
|
|
20204
20260
|
"APP_LISTING_REJECTED",
|
|
20205
20261
|
"APP_LISTING_WITHDRAWN",
|
|
20206
|
-
"DEVICE_LINK_REQUEST"
|
|
20262
|
+
"DEVICE_LINK_REQUEST",
|
|
20263
|
+
"GUARDIAN_APPROVAL_PENDING",
|
|
20264
|
+
"GUARDIAN_APPROVED",
|
|
20265
|
+
"GUARDIAN_REJECTED",
|
|
20266
|
+
"APP_NOTIFICATION"
|
|
20207
20267
|
]);
|
|
20208
20268
|
var LCNNotificationMessageValidator = external_exports.object({
|
|
20209
20269
|
title: external_exports.string().optional(),
|
|
@@ -20241,7 +20301,10 @@ var LCNNotificationDataValidator = external_exports.object({
|
|
|
20241
20301
|
var LCNNotificationValidator = external_exports.object({
|
|
20242
20302
|
type: LCNNotificationTypeEnumValidator,
|
|
20243
20303
|
to: LCNProfileValidator.partial().and(external_exports.object({ did: external_exports.string() })),
|
|
20244
|
-
from:
|
|
20304
|
+
from: external_exports.union([
|
|
20305
|
+
external_exports.string(),
|
|
20306
|
+
LCNProfileValidator.partial().and(external_exports.object({ did: external_exports.string() }))
|
|
20307
|
+
]),
|
|
20245
20308
|
message: LCNNotificationMessageValidator.optional(),
|
|
20246
20309
|
data: LCNNotificationDataValidator.optional(),
|
|
20247
20310
|
sent: external_exports.iso.datetime().optional(),
|
|
@@ -20346,7 +20409,12 @@ var InboxCredentialValidator = external_exports.object({
|
|
|
20346
20409
|
signingAuthority: external_exports.object({
|
|
20347
20410
|
endpoint: external_exports.string().optional(),
|
|
20348
20411
|
name: external_exports.string().optional()
|
|
20349
|
-
}).optional()
|
|
20412
|
+
}).optional(),
|
|
20413
|
+
// Guardian gate fields (all optional — absent on pre-existing credentials)
|
|
20414
|
+
guardianEmail: external_exports.string().email().optional(),
|
|
20415
|
+
guardianStatus: GuardianStatusValidator.optional(),
|
|
20416
|
+
guardianApprovedAt: external_exports.string().optional(),
|
|
20417
|
+
guardianApprovedByDid: external_exports.string().optional()
|
|
20350
20418
|
});
|
|
20351
20419
|
var PaginatedInboxCredentialsValidator = external_exports.object({
|
|
20352
20420
|
hasMore: external_exports.boolean(),
|
|
@@ -20814,11 +20882,86 @@ var GetTemplateRecipientsEventValidator = external_exports.object({
|
|
|
20814
20882
|
}).refine((input) => Boolean(input.templateAlias) !== Boolean(input.boostUri), {
|
|
20815
20883
|
message: "Exactly one of templateAlias or boostUri is required"
|
|
20816
20884
|
});
|
|
20885
|
+
var RequestLearnerContextEventValidator = external_exports.object({
|
|
20886
|
+
type: external_exports.literal("request-learner-context"),
|
|
20887
|
+
includeCredentials: external_exports.boolean().optional().default(true),
|
|
20888
|
+
includePersonalData: external_exports.boolean().optional().default(false),
|
|
20889
|
+
format: external_exports.enum(["prompt", "structured"]).optional().default("prompt"),
|
|
20890
|
+
instructions: external_exports.string().optional(),
|
|
20891
|
+
detailLevel: external_exports.enum(["compact", "expanded"]).optional().default("compact")
|
|
20892
|
+
});
|
|
20893
|
+
var SummaryCredentialKeywordValidator = external_exports.object({
|
|
20894
|
+
occupations: external_exports.array(external_exports.string()).nullable(),
|
|
20895
|
+
careers: external_exports.array(external_exports.string()).nullable(),
|
|
20896
|
+
jobs: external_exports.array(external_exports.string()).nullable(),
|
|
20897
|
+
skills: external_exports.array(external_exports.string()).nullable(),
|
|
20898
|
+
fieldOfStudy: external_exports.string().nullable()
|
|
20899
|
+
});
|
|
20900
|
+
var SummaryCredentialDataValidator = external_exports.object({
|
|
20901
|
+
title: external_exports.string().describe("Short, concise title for the learning session or credential"),
|
|
20902
|
+
summary: external_exports.string().describe("Comprehensive summary of what happened during the session"),
|
|
20903
|
+
learned: external_exports.array(external_exports.string()).describe("Bullet points of key knowledge gained"),
|
|
20904
|
+
skills: external_exports.array(
|
|
20905
|
+
external_exports.object({
|
|
20906
|
+
title: external_exports.string().describe("Name of the skill category"),
|
|
20907
|
+
description: external_exports.string().describe("Detailed description of what this skill category involves")
|
|
20908
|
+
})
|
|
20909
|
+
).describe("Categorized skills learned during the session"),
|
|
20910
|
+
nextSteps: external_exports.array(
|
|
20911
|
+
external_exports.object({
|
|
20912
|
+
title: external_exports.string().describe("Title of the suggested next step"),
|
|
20913
|
+
description: external_exports.string().describe("Description explaining why this next step is recommended"),
|
|
20914
|
+
keywords: SummaryCredentialKeywordValidator.optional().describe(
|
|
20915
|
+
"Optional taxonomy keywords for occupations/careers/jobs/skills/fieldOfStudy. Omit if not relevant."
|
|
20916
|
+
)
|
|
20917
|
+
})
|
|
20918
|
+
).describe("Recommended follow-up activities or learning modules"),
|
|
20919
|
+
reflections: external_exports.array(
|
|
20920
|
+
external_exports.object({
|
|
20921
|
+
title: external_exports.string().describe("Title of the reflection"),
|
|
20922
|
+
description: external_exports.string().describe("Detailed description of what this reflection involves")
|
|
20923
|
+
})
|
|
20924
|
+
).describe("Reflections on the learning experience")
|
|
20925
|
+
});
|
|
20926
|
+
var SendAiSessionCredentialEventValidator = external_exports.object({
|
|
20927
|
+
type: external_exports.literal("send-ai-session-credential"),
|
|
20928
|
+
sessionTitle: external_exports.string(),
|
|
20929
|
+
summaryData: SummaryCredentialDataValidator,
|
|
20930
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
20931
|
+
});
|
|
20932
|
+
var SendNotificationEventValidator = external_exports.object({
|
|
20933
|
+
type: external_exports.literal("send-notification"),
|
|
20934
|
+
title: external_exports.string().optional(),
|
|
20935
|
+
body: external_exports.string().optional(),
|
|
20936
|
+
actionPath: external_exports.string().optional(),
|
|
20937
|
+
category: external_exports.string().optional(),
|
|
20938
|
+
priority: external_exports.enum(["normal", "high"]).optional()
|
|
20939
|
+
});
|
|
20940
|
+
var counterKeyValidator = external_exports.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "Key must be alphanumeric with _ or -");
|
|
20941
|
+
var IncrementCounterEventValidator = external_exports.object({
|
|
20942
|
+
type: external_exports.literal("increment-counter"),
|
|
20943
|
+
key: counterKeyValidator,
|
|
20944
|
+
amount: external_exports.number().int().finite()
|
|
20945
|
+
});
|
|
20946
|
+
var GetCounterEventValidator = external_exports.object({
|
|
20947
|
+
type: external_exports.literal("get-counter"),
|
|
20948
|
+
key: counterKeyValidator
|
|
20949
|
+
});
|
|
20950
|
+
var GetCountersEventValidator = external_exports.object({
|
|
20951
|
+
type: external_exports.literal("get-counters"),
|
|
20952
|
+
keys: external_exports.array(counterKeyValidator).min(1).max(50).optional()
|
|
20953
|
+
});
|
|
20817
20954
|
var AppEventValidator = external_exports.discriminatedUnion("type", [
|
|
20818
20955
|
SendCredentialEventValidator,
|
|
20819
20956
|
CheckCredentialEventValidator,
|
|
20820
20957
|
CheckIssuanceStatusEventValidator,
|
|
20821
|
-
GetTemplateRecipientsEventValidator
|
|
20958
|
+
GetTemplateRecipientsEventValidator,
|
|
20959
|
+
RequestLearnerContextEventValidator,
|
|
20960
|
+
SendAiSessionCredentialEventValidator,
|
|
20961
|
+
SendNotificationEventValidator,
|
|
20962
|
+
IncrementCounterEventValidator,
|
|
20963
|
+
GetCounterEventValidator,
|
|
20964
|
+
GetCountersEventValidator
|
|
20822
20965
|
]);
|
|
20823
20966
|
var AppEventInputValidator = external_exports.object({
|
|
20824
20967
|
listingId: external_exports.string(),
|
|
@@ -20849,7 +20992,7 @@ var CredentialActivityValidator = external_exports.object({
|
|
|
20849
20992
|
activityId: external_exports.string(),
|
|
20850
20993
|
eventType: CredentialActivityEventTypeValidator,
|
|
20851
20994
|
timestamp: external_exports.string(),
|
|
20852
|
-
actorProfileId: external_exports.string(),
|
|
20995
|
+
actorProfileId: external_exports.string().optional(),
|
|
20853
20996
|
recipientType: CredentialActivityRecipientTypeValidator,
|
|
20854
20997
|
recipientIdentifier: external_exports.string(),
|
|
20855
20998
|
boostUri: external_exports.string().optional(),
|
|
@@ -21264,7 +21407,28 @@ var getLearnCloudPlugin = /* @__PURE__ */ __name(async (initialLearnCard, url2,
|
|
|
21264
21407
|
...recipients
|
|
21265
21408
|
]);
|
|
21266
21409
|
return client.storage.store.mutate({ item: jwe });
|
|
21267
|
-
}, "uploadEncrypted")
|
|
21410
|
+
}, "uploadEncrypted"),
|
|
21411
|
+
delete: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
21412
|
+
_learnCard.debug?.("learnCard.store['LearnCloud'].delete", { uri });
|
|
21413
|
+
let deleted = false;
|
|
21414
|
+
try {
|
|
21415
|
+
deleted = Boolean(await client.storage.delete.mutate({ uri }));
|
|
21416
|
+
} catch (error46) {
|
|
21417
|
+
_learnCard.debug?.("LearnCloud store.delete storage.delete failed", error46);
|
|
21418
|
+
}
|
|
21419
|
+
if (!deleted) return false;
|
|
21420
|
+
try {
|
|
21421
|
+
const records = await _learnCard.index.LearnCloud.get({ uri });
|
|
21422
|
+
for (const record2 of records) {
|
|
21423
|
+
await _learnCard.index.LearnCloud.remove(record2.id, {
|
|
21424
|
+
cache: "skip-cache"
|
|
21425
|
+
});
|
|
21426
|
+
}
|
|
21427
|
+
} catch (error46) {
|
|
21428
|
+
_learnCard.debug?.("LearnCloud store.delete index cleanup failed", error46);
|
|
21429
|
+
}
|
|
21430
|
+
return true;
|
|
21431
|
+
}, "delete")
|
|
21268
21432
|
},
|
|
21269
21433
|
index: {
|
|
21270
21434
|
get: /* @__PURE__ */ __name(async (_learnCard, query) => {
|