@learncard/helpers 1.1.11 → 1.1.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/helpers.esm.js
CHANGED
@@ -45,6 +45,7 @@ var require_types_cjs_development = __commonJS({
|
|
45
45
|
var __toCommonJS = /* @__PURE__ */ __name((mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2), "__toCommonJS");
|
46
46
|
var src_exports = {};
|
47
47
|
__export(src_exports, {
|
48
|
+
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
|
48
49
|
AchievementCredentialValidator: () => AchievementCredentialValidator,
|
49
50
|
AchievementCriteriaValidator: () => AchievementCriteriaValidator,
|
50
51
|
AchievementSubjectValidator: () => AchievementSubjectValidator,
|
@@ -53,6 +54,9 @@ var require_types_cjs_development = __commonJS({
|
|
53
54
|
AddressValidator: () => AddressValidator,
|
54
55
|
AlignmentTargetTypeValidator: () => AlignmentTargetTypeValidator,
|
55
56
|
AlignmentValidator: () => AlignmentValidator,
|
57
|
+
AuthGrantQueryValidator: () => AuthGrantQueryValidator,
|
58
|
+
AuthGrantStatusValidator: () => AuthGrantStatusValidator,
|
59
|
+
AuthGrantValidator: () => AuthGrantValidator,
|
56
60
|
AutoBoostConfigValidator: () => AutoBoostConfigValidator,
|
57
61
|
BoostPermissionsQueryValidator: () => BoostPermissionsQueryValidator,
|
58
62
|
BoostPermissionsValidator: () => BoostPermissionsValidator,
|
@@ -90,6 +94,7 @@ var require_types_cjs_development = __commonJS({
|
|
90
94
|
EndorsementCredentialValidator: () => EndorsementCredentialValidator,
|
91
95
|
EndorsementSubjectValidator: () => EndorsementSubjectValidator,
|
92
96
|
EvidenceValidator: () => EvidenceValidator,
|
97
|
+
FlatAuthGrantValidator: () => FlatAuthGrantValidator,
|
93
98
|
FullClaimHookValidator: () => FullClaimHookValidator,
|
94
99
|
GeoCoordinatesValidator: () => GeoCoordinatesValidator,
|
95
100
|
IdentifierEntryValidator: () => IdentifierEntryValidator,
|
@@ -136,6 +141,7 @@ var require_types_cjs_development = __commonJS({
|
|
136
141
|
ProfileValidator: () => ProfileValidator,
|
137
142
|
ProofValidator: () => ProofValidator,
|
138
143
|
RefreshServiceValidator: () => RefreshServiceValidator,
|
144
|
+
RegExpValidator: () => RegExpValidator,
|
139
145
|
RelatedValidator: () => RelatedValidator,
|
140
146
|
ResultDescriptionValidator: () => ResultDescriptionValidator,
|
141
147
|
ResultStatusTypeValidator: () => ResultStatusTypeValidator,
|
@@ -144,9 +150,12 @@ var require_types_cjs_development = __commonJS({
|
|
144
150
|
RubricCriterionValidator: () => RubricCriterionValidator,
|
145
151
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator,
|
146
152
|
ServiceValidator: () => ServiceValidator,
|
153
|
+
StringQuery: () => StringQuery,
|
154
|
+
TermsOfUseValidator: () => TermsOfUseValidator,
|
147
155
|
UnsignedAchievementCredentialValidator: () => UnsignedAchievementCredentialValidator,
|
148
156
|
UnsignedVCValidator: () => UnsignedVCValidator,
|
149
157
|
UnsignedVPValidator: () => UnsignedVPValidator,
|
158
|
+
VC2EvidenceValidator: () => VC2EvidenceValidator,
|
150
159
|
VCValidator: () => VCValidator,
|
151
160
|
VPValidator: () => VPValidator,
|
152
161
|
VerificationCheckValidator: () => VerificationCheckValidator,
|
@@ -3572,18 +3581,31 @@ var require_types_cjs_development = __commonJS({
|
|
3572
3581
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
3573
3582
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
|
3574
3583
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
|
3575
|
-
var RefreshServiceValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
|
3584
|
+
var RefreshServiceValidator = mod.object({ id: mod.string().optional(), type: mod.string() }).catchall(mod.any());
|
3585
|
+
var TermsOfUseValidator = mod.object({ type: mod.string(), id: mod.string().optional() }).catchall(mod.any());
|
3586
|
+
var VC2EvidenceValidator = mod.object({ type: mod.string().or(mod.string().array().nonempty()), id: mod.string().optional() }).catchall(mod.any());
|
3576
3587
|
var UnsignedVCValidator = mod.object({
|
3577
3588
|
"@context": ContextValidator,
|
3578
3589
|
id: mod.string().optional(),
|
3579
3590
|
type: mod.string().array().nonempty(),
|
3580
3591
|
issuer: ProfileValidator,
|
3581
|
-
issuanceDate: mod.string(),
|
3582
|
-
expirationDate: mod.string().optional(),
|
3583
3592
|
credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),
|
3584
|
-
|
3585
|
-
credentialSchema: CredentialSchemaValidator.
|
3586
|
-
|
3593
|
+
refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),
|
3594
|
+
credentialSchema: CredentialSchemaValidator.or(
|
3595
|
+
CredentialSchemaValidator.array()
|
3596
|
+
).optional(),
|
3597
|
+
issuanceDate: mod.string().optional(),
|
3598
|
+
expirationDate: mod.string().optional(),
|
3599
|
+
credentialStatus: CredentialStatusValidator.or(
|
3600
|
+
CredentialStatusValidator.array()
|
3601
|
+
).optional(),
|
3602
|
+
name: mod.string().optional(),
|
3603
|
+
description: mod.string().optional(),
|
3604
|
+
validFrom: mod.string().optional(),
|
3605
|
+
validUntil: mod.string().optional(),
|
3606
|
+
status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
|
3607
|
+
termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
|
3608
|
+
evidence: VC2EvidenceValidator.or(VC2EvidenceValidator.array()).optional()
|
3587
3609
|
}).catchall(mod.any());
|
3588
3610
|
var ProofValidator = mod.object({
|
3589
3611
|
type: mod.string(),
|
@@ -3835,7 +3857,7 @@ var require_types_cjs_development = __commonJS({
|
|
3835
3857
|
}).catchall(mod.any());
|
3836
3858
|
var EvidenceValidator = mod.object({
|
3837
3859
|
id: mod.string().optional(),
|
3838
|
-
type: mod.string().array().nonempty(),
|
3860
|
+
type: mod.string().or(mod.string().array().nonempty()),
|
3839
3861
|
narrative: mod.string().optional(),
|
3840
3862
|
name: mod.string().optional(),
|
3841
3863
|
description: mod.string().optional(),
|
@@ -4308,6 +4330,28 @@ var require_types_cjs_development = __commonJS({
|
|
4308
4330
|
data: LCNNotificationDataValidator.optional(),
|
4309
4331
|
sent: mod.string().datetime().optional()
|
4310
4332
|
});
|
4333
|
+
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
4334
|
+
var AuthGrantValidator = mod.object({
|
4335
|
+
id: mod.string(),
|
4336
|
+
name: mod.string(),
|
4337
|
+
description: mod.string().optional(),
|
4338
|
+
challenge: mod.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
|
4339
|
+
status: mod.enum(["revoked", "active"], {
|
4340
|
+
required_error: "Status is required",
|
4341
|
+
invalid_type_error: "Status must be either active or revoked"
|
4342
|
+
}),
|
4343
|
+
scope: mod.string(),
|
4344
|
+
createdAt: mod.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
|
4345
|
+
expiresAt: mod.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
|
4346
|
+
});
|
4347
|
+
var FlatAuthGrantValidator = mod.object({ id: mod.string() }).catchall(mod.any());
|
4348
|
+
var AuthGrantStatusValidator = mod.enum(["active", "revoked"]);
|
4349
|
+
var AuthGrantQueryValidator = mod.object({
|
4350
|
+
id: StringQuery,
|
4351
|
+
name: StringQuery,
|
4352
|
+
description: StringQuery,
|
4353
|
+
status: AuthGrantStatusValidator
|
4354
|
+
}).partial();
|
4311
4355
|
}
|
4312
4356
|
});
|
4313
4357
|
|