@learncard/helpers 1.0.19 → 1.0.20
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.
@@ -105,6 +105,7 @@ var require_types_cjs_development = __commonJS({
|
|
105
105
|
LCNNotificationTypeEnumValidator: () => LCNNotificationTypeEnumValidator,
|
106
106
|
LCNNotificationValidator: () => LCNNotificationValidator,
|
107
107
|
LCNProfileConnectionStatusEnum: () => LCNProfileConnectionStatusEnum,
|
108
|
+
LCNProfileQueryValidator: () => LCNProfileQueryValidator,
|
108
109
|
LCNProfileValidator: () => LCNProfileValidator,
|
109
110
|
LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
|
110
111
|
LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
|
@@ -130,7 +131,6 @@ var require_types_cjs_development = __commonJS({
|
|
130
131
|
RubricCriterionValidator: () => RubricCriterionValidator,
|
131
132
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator,
|
132
133
|
ServiceValidator: () => ServiceValidator,
|
133
|
-
StringQuery: () => StringQuery,
|
134
134
|
UnsignedAchievementCredentialValidator: () => UnsignedAchievementCredentialValidator,
|
135
135
|
UnsignedVCValidator: () => UnsignedVCValidator,
|
136
136
|
UnsignedVPValidator: () => UnsignedVPValidator,
|
@@ -3881,6 +3881,35 @@ var require_types_cjs_development = __commonJS({
|
|
3881
3881
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
3882
3882
|
records: EncryptedCredentialRecordValidator.array()
|
3883
3883
|
});
|
3884
|
+
var parseRegexString = /* @__PURE__ */ __name2((regexStr) => {
|
3885
|
+
const match = regexStr.match(/^\/(.*)\/([gimsuy]*)$/);
|
3886
|
+
if (!match)
|
3887
|
+
throw new Error("Invalid RegExp string format");
|
3888
|
+
return { pattern: match[1], flags: match[2] };
|
3889
|
+
}, "parseRegexString");
|
3890
|
+
var RegExpValidator = mod.instanceof(RegExp).or(
|
3891
|
+
mod.string().refine(
|
3892
|
+
(str) => {
|
3893
|
+
try {
|
3894
|
+
parseRegexString(str);
|
3895
|
+
return true;
|
3896
|
+
} catch (e) {
|
3897
|
+
return false;
|
3898
|
+
}
|
3899
|
+
},
|
3900
|
+
{
|
3901
|
+
message: "Invalid RegExp string format. Must be in format '/pattern/flags'"
|
3902
|
+
}
|
3903
|
+
).transform((str) => {
|
3904
|
+
const { pattern, flags } = parseRegexString(str);
|
3905
|
+
try {
|
3906
|
+
return new RegExp(pattern, flags);
|
3907
|
+
} catch (error) {
|
3908
|
+
throw new Error(`Invalid RegExp: ${error.message}`);
|
3909
|
+
}
|
3910
|
+
})
|
3911
|
+
);
|
3912
|
+
var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: RegExpValidator }));
|
3884
3913
|
var LCNProfileValidator = mod.object({
|
3885
3914
|
profileId: mod.string().min(3).max(40),
|
3886
3915
|
displayName: mod.string().default(""),
|
@@ -3895,6 +3924,16 @@ var require_types_cjs_development = __commonJS({
|
|
3895
3924
|
type: mod.string().optional(),
|
3896
3925
|
notificationsWebhook: mod.string().url().startsWith("http").optional()
|
3897
3926
|
});
|
3927
|
+
var LCNProfileQueryValidator = mod.object({
|
3928
|
+
profileId: StringQuery,
|
3929
|
+
displayName: StringQuery,
|
3930
|
+
shortBio: StringQuery,
|
3931
|
+
bio: StringQuery,
|
3932
|
+
email: StringQuery,
|
3933
|
+
websiteLink: StringQuery,
|
3934
|
+
isServiceProfile: mod.boolean(),
|
3935
|
+
type: StringQuery
|
3936
|
+
}).partial();
|
3898
3937
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
3899
3938
|
records: LCNProfileValidator.array()
|
3900
3939
|
});
|
@@ -3935,7 +3974,6 @@ var require_types_cjs_development = __commonJS({
|
|
3935
3974
|
meta: mod.record(mod.any()).optional(),
|
3936
3975
|
claimPermissions: BoostPermissionsValidator.optional()
|
3937
3976
|
});
|
3938
|
-
var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: mod.instanceof(RegExp) }));
|
3939
3977
|
var BoostQueryValidator = mod.object({
|
3940
3978
|
uri: StringQuery,
|
3941
3979
|
name: StringQuery,
|