@learncard/types 5.17.1 → 5.17.3
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/credential-format.d.ts +52 -12
- package/dist/credential-format.d.ts.map +1 -1
- package/dist/lcn.d.ts +35 -0
- package/dist/lcn.d.ts.map +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/types.cjs.development.cjs +30 -7
- package/dist/types.cjs.development.cjs.map +2 -2
- package/dist/types.cjs.production.min.cjs +5 -5
- package/dist/types.cjs.production.min.cjs.map +3 -3
- package/dist/types.esm.js +30 -7
- package/dist/types.esm.js.map +3 -3
- package/package.json +1 -1
package/dist/types.esm.js
CHANGED
|
@@ -467,6 +467,17 @@ var CredentialFormatValidator = z6.enum([
|
|
|
467
467
|
"vc+sd-jwt",
|
|
468
468
|
"mso_mdoc"
|
|
469
469
|
]);
|
|
470
|
+
var StoredCredentialEnvelopeValidator = z6.object({
|
|
471
|
+
format: CredentialFormatValidator,
|
|
472
|
+
data: z6.string()
|
|
473
|
+
}).passthrough();
|
|
474
|
+
var isStoredCredentialEnvelope = /* @__PURE__ */ __name((value) => {
|
|
475
|
+
if (!value || typeof value !== "object") return false;
|
|
476
|
+
const candidate = value;
|
|
477
|
+
if (typeof candidate.format !== "string") return false;
|
|
478
|
+
if (!CredentialFormatValidator.safeParse(candidate.format).success) return false;
|
|
479
|
+
return typeof candidate.data === "string" || candidate.data instanceof Uint8Array;
|
|
480
|
+
}, "isStoredCredentialEnvelope");
|
|
470
481
|
|
|
471
482
|
// src/learncard.ts
|
|
472
483
|
import { z as z7 } from "zod";
|
|
@@ -570,6 +581,13 @@ var parseRegexString = /* @__PURE__ */ __name((regexStr) => {
|
|
|
570
581
|
if (!match) throw new Error("Invalid RegExp string format");
|
|
571
582
|
return { pattern: match[1], flags: match[2] };
|
|
572
583
|
}, "parseRegexString");
|
|
584
|
+
var withStringOverride = /* @__PURE__ */ __name((schema) => {
|
|
585
|
+
const metaSchema = schema;
|
|
586
|
+
if (typeof metaSchema.meta === "function") {
|
|
587
|
+
return metaSchema.meta({ override: { type: "string" } });
|
|
588
|
+
}
|
|
589
|
+
return schema;
|
|
590
|
+
}, "withStringOverride");
|
|
573
591
|
var RegExpStringValidator = z10.string().refine(
|
|
574
592
|
(str) => {
|
|
575
593
|
try {
|
|
@@ -589,9 +607,9 @@ var RegExpStringValidator = z10.string().refine(
|
|
|
589
607
|
} catch (error) {
|
|
590
608
|
throw new Error(`Invalid RegExp: ${error.message}`);
|
|
591
609
|
}
|
|
592
|
-
})
|
|
593
|
-
var RegExpValidator = z10.instanceof(RegExp).
|
|
594
|
-
var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator
|
|
610
|
+
});
|
|
611
|
+
var RegExpValidator = withStringOverride(z10.instanceof(RegExp).or(RegExpStringValidator));
|
|
612
|
+
var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator }));
|
|
595
613
|
var StringQuery = z10.union([
|
|
596
614
|
BaseStringQuery,
|
|
597
615
|
z10.object({
|
|
@@ -817,7 +835,8 @@ var BoostRecipientValidator = z11.object({
|
|
|
817
835
|
to: LCNVisibleProfileValidator,
|
|
818
836
|
from: z11.string(),
|
|
819
837
|
received: z11.string().optional(),
|
|
820
|
-
uri: z11.string().optional()
|
|
838
|
+
uri: z11.string().optional(),
|
|
839
|
+
status: z11.enum(["active", "revoked", "suspended"]).optional()
|
|
821
840
|
});
|
|
822
841
|
var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
|
|
823
842
|
records: BoostRecipientValidator.array()
|
|
@@ -827,7 +846,8 @@ var BoostRecipientWithChildrenValidator = z11.object({
|
|
|
827
846
|
from: z11.string(),
|
|
828
847
|
received: z11.string().optional(),
|
|
829
848
|
boostUris: z11.array(z11.string()),
|
|
830
|
-
credentialUris: z11.array(z11.string()).optional()
|
|
849
|
+
credentialUris: z11.array(z11.string()).optional(),
|
|
850
|
+
status: z11.enum(["active", "revoked", "suspended"]).optional()
|
|
831
851
|
});
|
|
832
852
|
var PaginatedBoostRecipientsWithChildrenValidator = PaginationResponseValidator.extend({
|
|
833
853
|
records: BoostRecipientWithChildrenValidator.array()
|
|
@@ -1913,7 +1933,8 @@ var CredentialActivityValidator = z11.object({
|
|
|
1913
1933
|
inboxCredentialId: z11.string().optional(),
|
|
1914
1934
|
integrationId: z11.string().optional(),
|
|
1915
1935
|
source: CredentialActivitySourceTypeValidator,
|
|
1916
|
-
metadata: z11.record(z11.string(), z11.unknown()).optional()
|
|
1936
|
+
metadata: z11.record(z11.string(), z11.unknown()).optional(),
|
|
1937
|
+
status: z11.enum(["active", "revoked", "suspended"]).optional()
|
|
1917
1938
|
});
|
|
1918
1939
|
var CredentialActivityWithDetailsValidator = CredentialActivityValidator.extend({
|
|
1919
1940
|
boost: z11.object({
|
|
@@ -2213,6 +2234,7 @@ export {
|
|
|
2213
2234
|
SkillTreeNodeValidator,
|
|
2214
2235
|
SkillValidator,
|
|
2215
2236
|
StatusCheckEntryValidator,
|
|
2237
|
+
StoredCredentialEnvelopeValidator,
|
|
2216
2238
|
StringQuery,
|
|
2217
2239
|
SummaryCredentialDataValidator,
|
|
2218
2240
|
SummaryCredentialKeywordValidator,
|
|
@@ -2233,5 +2255,6 @@ export {
|
|
|
2233
2255
|
VerificationItemValidator,
|
|
2234
2256
|
VerificationMethodValidator,
|
|
2235
2257
|
VerificationStatusEnum,
|
|
2236
|
-
VerificationStatusValidator
|
|
2258
|
+
VerificationStatusValidator,
|
|
2259
|
+
isStoredCredentialEnvelope
|
|
2237
2260
|
};
|