@learncard/types 5.9.1 → 5.11.0
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/crypto.d.ts +12 -296
- package/dist/crypto.d.ts.map +1 -1
- package/dist/did.d.ts +35 -2099
- package/dist/did.d.ts.map +1 -1
- package/dist/helpers.d.ts +4 -0
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lcn.d.ts +4154 -53811
- package/dist/lcn.d.ts.map +1 -1
- package/dist/learncard.d.ts +83 -949
- package/dist/learncard.d.ts.map +1 -1
- package/dist/learncloud.d.ts +30 -2478
- package/dist/learncloud.d.ts.map +1 -1
- package/dist/mongo.d.ts +2 -16
- package/dist/mongo.d.ts.map +1 -1
- package/dist/obv3.d.ts +1527 -40903
- package/dist/obv3.d.ts.map +1 -1
- package/dist/queries.d.ts +11 -39
- package/dist/queries.d.ts.map +1 -1
- package/dist/types.cjs.development.js +13734 -4624
- package/dist/types.cjs.development.js.map +4 -4
- package/dist/types.cjs.production.min.js +23 -1
- package/dist/types.cjs.production.min.js.map +4 -4
- package/dist/types.esm.js +201 -97
- package/dist/types.esm.js.map +3 -3
- package/dist/vc.d.ts +659 -20327
- package/dist/vc.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/types.esm.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/index.ts
|
|
5
|
-
import "zod-openapi/extend";
|
|
6
|
-
|
|
7
4
|
// src/vc.ts
|
|
8
5
|
import { z } from "zod";
|
|
9
|
-
var ContextValidator = z.array(z.string().or(z.record(z.any())));
|
|
6
|
+
var ContextValidator = z.array(z.string().or(z.record(z.string(), z.any())));
|
|
10
7
|
var AchievementCriteriaValidator = z.object({
|
|
11
8
|
type: z.string().optional(),
|
|
12
9
|
narrative: z.string().optional()
|
|
@@ -91,7 +88,15 @@ var CredentialStatusValidator = z.object({ type: z.string(), id: z.string() }).c
|
|
|
91
88
|
var CredentialSchemaValidator = z.object({ id: z.string(), type: z.string() }).catchall(z.any());
|
|
92
89
|
var RefreshServiceValidator = z.object({ id: z.string().optional(), type: z.string() }).catchall(z.any());
|
|
93
90
|
var TermsOfUseValidator = z.object({ type: z.string(), id: z.string().optional() }).catchall(z.any());
|
|
94
|
-
var VC2EvidenceValidator = z.object({
|
|
91
|
+
var VC2EvidenceValidator = z.object({
|
|
92
|
+
id: z.string().optional(),
|
|
93
|
+
type: z.array(z.string()).nonempty(),
|
|
94
|
+
name: z.string().optional(),
|
|
95
|
+
narrative: z.string().optional(),
|
|
96
|
+
description: z.string().optional(),
|
|
97
|
+
genre: z.string().optional(),
|
|
98
|
+
audience: z.string().optional()
|
|
99
|
+
}).catchall(z.any());
|
|
95
100
|
var UnsignedVCValidator = z.object({
|
|
96
101
|
"@context": ContextValidator,
|
|
97
102
|
id: z.string().optional(),
|
|
@@ -115,7 +120,7 @@ var UnsignedVCValidator = z.object({
|
|
|
115
120
|
validUntil: z.string().optional(),
|
|
116
121
|
status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
|
|
117
122
|
termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
|
|
118
|
-
evidence:
|
|
123
|
+
evidence: z.union([VC2EvidenceValidator, z.array(VC2EvidenceValidator)]).optional()
|
|
119
124
|
}).catchall(z.any());
|
|
120
125
|
var ProofValidator = z.object({
|
|
121
126
|
type: z.string(),
|
|
@@ -316,9 +321,18 @@ var ResultDescriptionValidator = z4.object({
|
|
|
316
321
|
valueMax: z4.string().optional(),
|
|
317
322
|
valueMin: z4.string().optional()
|
|
318
323
|
}).catchall(z4.any());
|
|
324
|
+
var EvidenceValidator = z4.object({
|
|
325
|
+
id: z4.string().optional(),
|
|
326
|
+
type: z4.array(z4.string()).nonempty(),
|
|
327
|
+
name: z4.string().optional(),
|
|
328
|
+
narrative: z4.string().optional(),
|
|
329
|
+
description: z4.string().optional(),
|
|
330
|
+
genre: z4.string().optional(),
|
|
331
|
+
audience: z4.string().optional()
|
|
332
|
+
}).catchall(z4.any());
|
|
319
333
|
var AchievementValidator = z4.object({
|
|
320
334
|
id: z4.string().optional(),
|
|
321
|
-
type: z4.
|
|
335
|
+
type: z4.array(z4.string()).nonempty(),
|
|
322
336
|
alignment: AlignmentValidator.array().optional(),
|
|
323
337
|
achievementType: AchievementTypeValidator.optional(),
|
|
324
338
|
creator: ProfileValidator.optional(),
|
|
@@ -335,7 +349,7 @@ var AchievementValidator = z4.object({
|
|
|
335
349
|
related: RelatedValidator.array().optional(),
|
|
336
350
|
resultDescription: ResultDescriptionValidator.array().optional(),
|
|
337
351
|
specialization: z4.string().optional(),
|
|
338
|
-
tag: z4.
|
|
352
|
+
tag: z4.array(z4.string()).optional(),
|
|
339
353
|
version: z4.string().optional()
|
|
340
354
|
}).catchall(z4.any());
|
|
341
355
|
var IdentityObjectValidator = z4.object({
|
|
@@ -377,15 +391,6 @@ var AchievementSubjectValidator = z4.object({
|
|
|
377
391
|
source: ProfileValidator.optional(),
|
|
378
392
|
term: z4.string().optional()
|
|
379
393
|
}).catchall(z4.any());
|
|
380
|
-
var EvidenceValidator = z4.object({
|
|
381
|
-
id: z4.string().optional(),
|
|
382
|
-
type: z4.string().or(z4.string().array().nonempty()),
|
|
383
|
-
narrative: z4.string().optional(),
|
|
384
|
-
name: z4.string().optional(),
|
|
385
|
-
description: z4.string().optional(),
|
|
386
|
-
genre: z4.string().optional(),
|
|
387
|
-
audience: z4.string().optional()
|
|
388
|
-
}).catchall(z4.any());
|
|
389
394
|
var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
390
395
|
name: z4.string().optional(),
|
|
391
396
|
description: z4.string().optional(),
|
|
@@ -393,8 +398,7 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
|
393
398
|
credentialSubject: AchievementSubjectValidator.or(
|
|
394
399
|
AchievementSubjectValidator.array()
|
|
395
400
|
),
|
|
396
|
-
endorsement: UnsignedVCValidator.array().optional()
|
|
397
|
-
evidence: EvidenceValidator.array().optional()
|
|
401
|
+
endorsement: UnsignedVCValidator.array().optional()
|
|
398
402
|
});
|
|
399
403
|
var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
|
|
400
404
|
proof: ProofValidator.or(ProofValidator.array())
|
|
@@ -452,40 +456,37 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
|
|
|
452
456
|
});
|
|
453
457
|
|
|
454
458
|
// src/lcn.ts
|
|
455
|
-
import { extendZodWithOpenApi } from "zod-openapi";
|
|
456
459
|
import { z as z9 } from "zod";
|
|
457
460
|
|
|
458
461
|
// src/queries.ts
|
|
459
462
|
import { z as z8 } from "zod";
|
|
460
463
|
var parseRegexString = /* @__PURE__ */ __name((regexStr) => {
|
|
461
464
|
const match = regexStr.match(/^\/(.*)\/([gimsuy]*)$/);
|
|
462
|
-
if (!match)
|
|
463
|
-
throw new Error("Invalid RegExp string format");
|
|
465
|
+
if (!match) throw new Error("Invalid RegExp string format");
|
|
464
466
|
return { pattern: match[1], flags: match[2] };
|
|
465
467
|
}, "parseRegexString");
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
(str) => {
|
|
469
|
-
try {
|
|
470
|
-
parseRegexString(str);
|
|
471
|
-
return true;
|
|
472
|
-
} catch {
|
|
473
|
-
return false;
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
message: "Invalid RegExp string format. Must be in format '/pattern/flags'"
|
|
478
|
-
}
|
|
479
|
-
).transform((str) => {
|
|
480
|
-
const { pattern, flags } = parseRegexString(str);
|
|
468
|
+
var RegExpStringValidator = z8.string().refine(
|
|
469
|
+
(str) => {
|
|
481
470
|
try {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
471
|
+
parseRegexString(str);
|
|
472
|
+
return true;
|
|
473
|
+
} catch {
|
|
474
|
+
return false;
|
|
485
475
|
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
message: "Invalid RegExp string format. Must be in format '/pattern/flags'"
|
|
479
|
+
}
|
|
480
|
+
).transform((str) => {
|
|
481
|
+
const { pattern, flags } = parseRegexString(str);
|
|
482
|
+
try {
|
|
483
|
+
return new RegExp(pattern, flags);
|
|
484
|
+
} catch (error) {
|
|
485
|
+
throw new Error(`Invalid RegExp: ${error.message}`);
|
|
486
|
+
}
|
|
487
|
+
}).meta({ override: { type: "string" } });
|
|
488
|
+
var RegExpValidator = z8.instanceof(RegExp).meta({ override: { type: "string" } }).or(RegExpStringValidator).meta({ override: { type: "string" } });
|
|
489
|
+
var BaseStringQuery = z8.string().or(z8.object({ $in: z8.string().array() })).or(z8.object({ $regex: RegExpValidator.meta({ override: { type: "string" } }) }));
|
|
489
490
|
var StringQuery = z8.union([
|
|
490
491
|
BaseStringQuery,
|
|
491
492
|
z8.object({
|
|
@@ -494,7 +495,6 @@ var StringQuery = z8.union([
|
|
|
494
495
|
]);
|
|
495
496
|
|
|
496
497
|
// src/lcn.ts
|
|
497
|
-
extendZodWithOpenApi(z9);
|
|
498
498
|
var LCNProfileDisplayValidator = z9.object({
|
|
499
499
|
backgroundColor: z9.string().optional(),
|
|
500
500
|
backgroundImage: z9.string().optional(),
|
|
@@ -578,9 +578,9 @@ var SentCredentialInfoValidator = z9.object({
|
|
|
578
578
|
uri: z9.string(),
|
|
579
579
|
to: z9.string(),
|
|
580
580
|
from: z9.string(),
|
|
581
|
-
sent: z9.
|
|
582
|
-
received: z9.
|
|
583
|
-
metadata: z9.record(z9.unknown()).optional()
|
|
581
|
+
sent: z9.iso.datetime(),
|
|
582
|
+
received: z9.iso.datetime().optional(),
|
|
583
|
+
metadata: z9.record(z9.string(), z9.unknown()).optional()
|
|
584
584
|
});
|
|
585
585
|
var BoostPermissionsValidator = z9.object({
|
|
586
586
|
role: z9.string(),
|
|
@@ -593,7 +593,7 @@ var BoostPermissionsValidator = z9.object({
|
|
|
593
593
|
canEditChildren: z9.string(),
|
|
594
594
|
canRevokeChildren: z9.string(),
|
|
595
595
|
canManageChildrenPermissions: z9.string(),
|
|
596
|
-
canManageChildrenProfiles: z9.boolean().
|
|
596
|
+
canManageChildrenProfiles: z9.boolean().optional(),
|
|
597
597
|
canViewAnalytics: z9.boolean()
|
|
598
598
|
});
|
|
599
599
|
var BoostPermissionsQueryValidator = z9.object({
|
|
@@ -613,7 +613,7 @@ var BoostPermissionsQueryValidator = z9.object({
|
|
|
613
613
|
var ClaimHookTypeValidator = z9.enum(["GRANT_PERMISSIONS", "ADD_ADMIN", "AUTO_CONNECT"]);
|
|
614
614
|
var ClaimHookValidator = z9.discriminatedUnion("type", [
|
|
615
615
|
z9.object({
|
|
616
|
-
type: z9.literal(ClaimHookTypeValidator.
|
|
616
|
+
type: z9.literal(ClaimHookTypeValidator.enum.GRANT_PERMISSIONS),
|
|
617
617
|
data: z9.object({
|
|
618
618
|
claimUri: z9.string(),
|
|
619
619
|
targetUri: z9.string(),
|
|
@@ -621,11 +621,11 @@ var ClaimHookValidator = z9.discriminatedUnion("type", [
|
|
|
621
621
|
})
|
|
622
622
|
}),
|
|
623
623
|
z9.object({
|
|
624
|
-
type: z9.literal(ClaimHookTypeValidator.
|
|
624
|
+
type: z9.literal(ClaimHookTypeValidator.enum.ADD_ADMIN),
|
|
625
625
|
data: z9.object({ claimUri: z9.string(), targetUri: z9.string() })
|
|
626
626
|
}),
|
|
627
627
|
z9.object({
|
|
628
|
-
type: z9.literal(ClaimHookTypeValidator.
|
|
628
|
+
type: z9.literal(ClaimHookTypeValidator.enum.AUTO_CONNECT),
|
|
629
629
|
data: z9.object({ claimUri: z9.string(), targetUri: z9.string() })
|
|
630
630
|
})
|
|
631
631
|
]);
|
|
@@ -634,9 +634,9 @@ var ClaimHookQueryValidator = z9.object({
|
|
|
634
634
|
data: z9.object({
|
|
635
635
|
claimUri: StringQuery,
|
|
636
636
|
targetUri: StringQuery,
|
|
637
|
-
permissions: BoostPermissionsQueryValidator
|
|
638
|
-
})
|
|
639
|
-
})
|
|
637
|
+
permissions: BoostPermissionsQueryValidator.partial()
|
|
638
|
+
}).partial()
|
|
639
|
+
});
|
|
640
640
|
var FullClaimHookValidator = z9.object({ id: z9.string(), createdAt: z9.string(), updatedAt: z9.string() }).and(ClaimHookValidator);
|
|
641
641
|
var PaginatedClaimHooksValidator = PaginationResponseValidator.extend({
|
|
642
642
|
records: FullClaimHookValidator.array()
|
|
@@ -649,8 +649,9 @@ var BoostValidator = z9.object({
|
|
|
649
649
|
category: z9.string().optional(),
|
|
650
650
|
status: LCNBoostStatus.optional(),
|
|
651
651
|
autoConnectRecipients: z9.boolean().optional(),
|
|
652
|
-
meta: z9.record(z9.any()).optional(),
|
|
652
|
+
meta: z9.record(z9.string(), z9.any()).optional(),
|
|
653
653
|
claimPermissions: BoostPermissionsValidator.optional(),
|
|
654
|
+
defaultPermissions: BoostPermissionsValidator.optional(),
|
|
654
655
|
allowAnyoneToCreateChildren: z9.boolean().optional()
|
|
655
656
|
});
|
|
656
657
|
var BaseBoostQueryValidator = z9.object({
|
|
@@ -658,7 +659,7 @@ var BaseBoostQueryValidator = z9.object({
|
|
|
658
659
|
name: StringQuery,
|
|
659
660
|
type: StringQuery,
|
|
660
661
|
category: StringQuery,
|
|
661
|
-
meta: z9.record(StringQuery),
|
|
662
|
+
meta: z9.record(z9.string(), StringQuery),
|
|
662
663
|
status: LCNBoostStatus.or(z9.object({ $in: LCNBoostStatus.array() })),
|
|
663
664
|
autoConnectRecipients: z9.boolean()
|
|
664
665
|
}).partial();
|
|
@@ -719,31 +720,62 @@ var AutoBoostConfigValidator = z9.object({
|
|
|
719
720
|
name: z9.string()
|
|
720
721
|
})
|
|
721
722
|
});
|
|
723
|
+
var SendBoostTemplateValidator = BoostValidator.partial().omit({ uri: true, claimPermissions: true }).extend({
|
|
724
|
+
credential: VCValidator.or(UnsignedVCValidator),
|
|
725
|
+
claimPermissions: BoostPermissionsValidator.partial().optional(),
|
|
726
|
+
skills: z9.array(z9.object({ frameworkId: z9.string(), id: z9.string() })).min(1).optional()
|
|
727
|
+
});
|
|
728
|
+
var SendBoostInputValidator = z9.object({
|
|
729
|
+
type: z9.literal("boost"),
|
|
730
|
+
recipient: z9.string(),
|
|
731
|
+
contractUri: z9.string().optional(),
|
|
732
|
+
templateUri: z9.string().optional(),
|
|
733
|
+
template: SendBoostTemplateValidator.optional(),
|
|
734
|
+
signedCredential: VCValidator.optional()
|
|
735
|
+
}).refine((data) => data.templateUri || data.template, {
|
|
736
|
+
message: "Either templateUri or template creation data must be provided.",
|
|
737
|
+
path: ["templateUri"]
|
|
738
|
+
});
|
|
739
|
+
var SendBoostResponseValidator = z9.object({
|
|
740
|
+
type: z9.literal("boost"),
|
|
741
|
+
credentialUri: z9.string(),
|
|
742
|
+
uri: z9.string()
|
|
743
|
+
});
|
|
744
|
+
var SendInputValidator = z9.discriminatedUnion("type", [SendBoostInputValidator]);
|
|
745
|
+
var SendResponseValidator = z9.discriminatedUnion("type", [SendBoostResponseValidator]);
|
|
722
746
|
var ConsentFlowTermsStatusValidator = z9.enum(["live", "stale", "withdrawn"]);
|
|
723
747
|
var ConsentFlowContractValidator = z9.object({
|
|
724
748
|
read: z9.object({
|
|
725
749
|
anonymize: z9.boolean().optional(),
|
|
726
750
|
credentials: z9.object({
|
|
727
751
|
categories: z9.record(
|
|
752
|
+
z9.string(),
|
|
728
753
|
z9.object({
|
|
729
754
|
required: z9.boolean(),
|
|
730
755
|
defaultEnabled: z9.boolean().optional()
|
|
731
756
|
})
|
|
732
757
|
).default({})
|
|
733
|
-
}).
|
|
734
|
-
personal: z9.record(
|
|
735
|
-
|
|
758
|
+
}).prefault({ categories: {} }),
|
|
759
|
+
personal: z9.record(
|
|
760
|
+
z9.string(),
|
|
761
|
+
z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })
|
|
762
|
+
).default({})
|
|
763
|
+
}).prefault({ credentials: { categories: {} }, personal: {} }),
|
|
736
764
|
write: z9.object({
|
|
737
765
|
credentials: z9.object({
|
|
738
766
|
categories: z9.record(
|
|
767
|
+
z9.string(),
|
|
739
768
|
z9.object({
|
|
740
769
|
required: z9.boolean(),
|
|
741
770
|
defaultEnabled: z9.boolean().optional()
|
|
742
771
|
})
|
|
743
772
|
).default({})
|
|
744
|
-
}).
|
|
745
|
-
personal: z9.record(
|
|
746
|
-
|
|
773
|
+
}).prefault({ categories: {} }),
|
|
774
|
+
personal: z9.record(
|
|
775
|
+
z9.string(),
|
|
776
|
+
z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })
|
|
777
|
+
).default({})
|
|
778
|
+
}).prefault({ credentials: { categories: {} }, personal: {} })
|
|
747
779
|
});
|
|
748
780
|
var ConsentFlowContractDetailsValidator = z9.object({
|
|
749
781
|
contract: ConsentFlowContractValidator,
|
|
@@ -767,8 +799,8 @@ var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend(
|
|
|
767
799
|
records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
|
|
768
800
|
});
|
|
769
801
|
var ConsentFlowContractDataValidator = z9.object({
|
|
770
|
-
credentials: z9.object({ categories: z9.record(z9.string().array()).default({}) }),
|
|
771
|
-
personal: z9.record(z9.string()).default({}),
|
|
802
|
+
credentials: z9.object({ categories: z9.record(z9.string(), z9.string().array()).default({}) }),
|
|
803
|
+
personal: z9.record(z9.string(), z9.string()).default({}),
|
|
772
804
|
date: z9.string()
|
|
773
805
|
});
|
|
774
806
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
@@ -776,7 +808,7 @@ var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
|
776
808
|
});
|
|
777
809
|
var ConsentFlowContractDataForDidValidator = z9.object({
|
|
778
810
|
credentials: z9.object({ category: z9.string(), uri: z9.string() }).array(),
|
|
779
|
-
personal: z9.record(z9.string()).default({}),
|
|
811
|
+
personal: z9.record(z9.string(), z9.string()).default({}),
|
|
780
812
|
date: z9.string(),
|
|
781
813
|
contractUri: z9.string()
|
|
782
814
|
});
|
|
@@ -795,14 +827,14 @@ var ConsentFlowTermsValidator = z9.object({
|
|
|
795
827
|
credentials: z9.object({
|
|
796
828
|
shareAll: z9.boolean().optional(),
|
|
797
829
|
sharing: z9.boolean().optional(),
|
|
798
|
-
categories: z9.record(ConsentFlowTermValidator).default({})
|
|
799
|
-
}).
|
|
800
|
-
personal: z9.record(z9.string()).default({})
|
|
801
|
-
}).
|
|
830
|
+
categories: z9.record(z9.string(), ConsentFlowTermValidator).default({})
|
|
831
|
+
}).prefault({ categories: {} }),
|
|
832
|
+
personal: z9.record(z9.string(), z9.string()).default({})
|
|
833
|
+
}).prefault({ credentials: { categories: {} }, personal: {} }),
|
|
802
834
|
write: z9.object({
|
|
803
|
-
credentials: z9.object({ categories: z9.record(z9.boolean()).default({}) }).
|
|
804
|
-
personal: z9.record(z9.boolean()).default({})
|
|
805
|
-
}).
|
|
835
|
+
credentials: z9.object({ categories: z9.record(z9.string(), z9.boolean()).default({}) }).prefault({ categories: {} }),
|
|
836
|
+
personal: z9.record(z9.string(), z9.boolean()).default({})
|
|
837
|
+
}).prefault({ credentials: { categories: {} }, personal: {} }),
|
|
806
838
|
deniedWriters: z9.array(z9.string()).optional()
|
|
807
839
|
});
|
|
808
840
|
var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
|
|
@@ -820,25 +852,25 @@ var ConsentFlowContractQueryValidator = z9.object({
|
|
|
820
852
|
read: z9.object({
|
|
821
853
|
anonymize: z9.boolean().optional(),
|
|
822
854
|
credentials: z9.object({
|
|
823
|
-
categories: z9.record(z9.object({ required: z9.boolean().optional() })).optional()
|
|
855
|
+
categories: z9.record(z9.string(), z9.object({ required: z9.boolean().optional() })).optional()
|
|
824
856
|
}).optional(),
|
|
825
|
-
personal: z9.record(z9.object({ required: z9.boolean().optional() })).optional()
|
|
857
|
+
personal: z9.record(z9.string(), z9.object({ required: z9.boolean().optional() })).optional()
|
|
826
858
|
}).optional(),
|
|
827
859
|
write: z9.object({
|
|
828
860
|
credentials: z9.object({
|
|
829
|
-
categories: z9.record(z9.object({ required: z9.boolean().optional() })).optional()
|
|
861
|
+
categories: z9.record(z9.string(), z9.object({ required: z9.boolean().optional() })).optional()
|
|
830
862
|
}).optional(),
|
|
831
|
-
personal: z9.record(z9.object({ required: z9.boolean().optional() })).optional()
|
|
863
|
+
personal: z9.record(z9.string(), z9.object({ required: z9.boolean().optional() })).optional()
|
|
832
864
|
}).optional()
|
|
833
865
|
});
|
|
834
866
|
var ConsentFlowDataQueryValidator = z9.object({
|
|
835
867
|
anonymize: z9.boolean().optional(),
|
|
836
|
-
credentials: z9.object({ categories: z9.record(z9.boolean()).optional() }).optional(),
|
|
837
|
-
personal: z9.record(z9.boolean()).optional()
|
|
868
|
+
credentials: z9.object({ categories: z9.record(z9.string(), z9.boolean()).optional() }).optional(),
|
|
869
|
+
personal: z9.record(z9.string(), z9.boolean()).optional()
|
|
838
870
|
});
|
|
839
871
|
var ConsentFlowDataForDidQueryValidator = z9.object({
|
|
840
|
-
credentials: z9.object({ categories: z9.record(z9.boolean()).optional() }).optional(),
|
|
841
|
-
personal: z9.record(z9.boolean()).optional(),
|
|
872
|
+
credentials: z9.object({ categories: z9.record(z9.string(), z9.boolean()).optional() }).optional(),
|
|
873
|
+
personal: z9.record(z9.string(), z9.boolean()).optional(),
|
|
842
874
|
id: StringQuery.optional()
|
|
843
875
|
});
|
|
844
876
|
var ConsentFlowTermsQueryValidator = z9.object({
|
|
@@ -847,13 +879,13 @@ var ConsentFlowTermsQueryValidator = z9.object({
|
|
|
847
879
|
credentials: z9.object({
|
|
848
880
|
shareAll: z9.boolean().optional(),
|
|
849
881
|
sharing: z9.boolean().optional(),
|
|
850
|
-
categories: z9.record(ConsentFlowTermValidator.optional()).optional()
|
|
882
|
+
categories: z9.record(z9.string(), ConsentFlowTermValidator.optional()).optional()
|
|
851
883
|
}).optional(),
|
|
852
|
-
personal: z9.record(z9.string()).optional()
|
|
884
|
+
personal: z9.record(z9.string(), z9.string()).optional()
|
|
853
885
|
}).optional(),
|
|
854
886
|
write: z9.object({
|
|
855
|
-
credentials: z9.object({ categories: z9.record(z9.boolean()).optional() }).optional(),
|
|
856
|
-
personal: z9.record(z9.boolean()).optional()
|
|
887
|
+
credentials: z9.object({ categories: z9.record(z9.string(), z9.boolean()).optional() }).optional(),
|
|
888
|
+
personal: z9.record(z9.string(), z9.boolean()).optional()
|
|
857
889
|
}).optional()
|
|
858
890
|
});
|
|
859
891
|
var ConsentFlowTransactionActionValidator = z9.enum([
|
|
@@ -919,7 +951,10 @@ var LCNNotificationTypeEnumValidator = z9.enum([
|
|
|
919
951
|
"ISSUANCE_CLAIMED",
|
|
920
952
|
"ISSUANCE_DELIVERED",
|
|
921
953
|
"ISSUANCE_ERROR",
|
|
922
|
-
"PROFILE_PARENT_APPROVED"
|
|
954
|
+
"PROFILE_PARENT_APPROVED",
|
|
955
|
+
"APP_LISTING_SUBMITTED",
|
|
956
|
+
"APP_LISTING_APPROVED",
|
|
957
|
+
"APP_LISTING_REJECTED"
|
|
923
958
|
]);
|
|
924
959
|
var LCNNotificationMessageValidator = z9.object({
|
|
925
960
|
title: z9.string().optional(),
|
|
@@ -945,22 +980,22 @@ var LCNNotificationInboxValidator = z9.object({
|
|
|
945
980
|
contactMethod: LCNInboxContactMethodValidator.optional(),
|
|
946
981
|
learnCardId: z9.string().optional()
|
|
947
982
|
}),
|
|
948
|
-
timestamp: z9.
|
|
983
|
+
timestamp: z9.iso.datetime().optional()
|
|
949
984
|
});
|
|
950
985
|
var LCNNotificationDataValidator = z9.object({
|
|
951
986
|
vcUris: z9.array(z9.string()).optional(),
|
|
952
987
|
vpUris: z9.array(z9.string()).optional(),
|
|
953
988
|
transaction: ConsentFlowTransactionValidator.optional(),
|
|
954
989
|
inbox: LCNNotificationInboxValidator.optional(),
|
|
955
|
-
metadata: z9.record(z9.unknown()).optional()
|
|
956
|
-
}).
|
|
990
|
+
metadata: z9.record(z9.string(), z9.unknown()).optional()
|
|
991
|
+
}).loose();
|
|
957
992
|
var LCNNotificationValidator = z9.object({
|
|
958
993
|
type: LCNNotificationTypeEnumValidator,
|
|
959
994
|
to: LCNProfileValidator.partial().and(z9.object({ did: z9.string() })),
|
|
960
995
|
from: LCNProfileValidator.partial().and(z9.object({ did: z9.string() })),
|
|
961
996
|
message: LCNNotificationMessageValidator.optional(),
|
|
962
997
|
data: LCNNotificationDataValidator.optional(),
|
|
963
|
-
sent: z9.
|
|
998
|
+
sent: z9.iso.datetime().optional(),
|
|
964
999
|
webhookUrl: z9.string().optional()
|
|
965
1000
|
});
|
|
966
1001
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
|
@@ -970,12 +1005,14 @@ var AuthGrantValidator = z9.object({
|
|
|
970
1005
|
description: z9.string().optional(),
|
|
971
1006
|
challenge: z9.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
|
|
972
1007
|
status: z9.enum(["revoked", "active"], {
|
|
973
|
-
|
|
974
|
-
|
|
1008
|
+
error: /* @__PURE__ */ __name((issue) => {
|
|
1009
|
+
if (issue.code === "invalid_value") return "Status must be either active or revoked";
|
|
1010
|
+
return "Status is required";
|
|
1011
|
+
}, "error")
|
|
975
1012
|
}),
|
|
976
1013
|
scope: z9.string(),
|
|
977
|
-
createdAt: z9.
|
|
978
|
-
expiresAt: z9.
|
|
1014
|
+
createdAt: z9.iso.datetime({ error: "createdAt must be a valid ISO 8601 datetime string" }),
|
|
1015
|
+
expiresAt: z9.iso.datetime({ error: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
|
|
979
1016
|
});
|
|
980
1017
|
var FlatAuthGrantValidator = z9.object({ id: z9.string() }).catchall(z9.any());
|
|
981
1018
|
var AuthGrantStatusValidator = z9.enum(["active", "revoked"]);
|
|
@@ -1079,7 +1116,7 @@ var IssueInboxCredentialValidator = z9.object({
|
|
|
1079
1116
|
// === CORE DATA (Required) ===
|
|
1080
1117
|
// WHAT is being sent and WHO is it for?
|
|
1081
1118
|
recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
|
|
1082
|
-
credential: VCValidator.
|
|
1119
|
+
credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).describe(
|
|
1083
1120
|
"The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."
|
|
1084
1121
|
),
|
|
1085
1122
|
// === OPTIONAL FEATURES ===
|
|
@@ -1143,7 +1180,7 @@ var IssueInboxCredentialResponseValidator = z9.object({
|
|
|
1143
1180
|
recipientDid: z9.string().optional()
|
|
1144
1181
|
});
|
|
1145
1182
|
var ClaimInboxCredentialValidator = z9.object({
|
|
1146
|
-
credential: VCValidator.
|
|
1183
|
+
credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).describe("The credential to issue."),
|
|
1147
1184
|
configuration: z9.object({
|
|
1148
1185
|
publishableKey: z9.string(),
|
|
1149
1186
|
signingAuthorityName: z9.string().optional()
|
|
@@ -1247,7 +1284,7 @@ var SkillTreeNodeValidator = SkillValidator.extend({
|
|
|
1247
1284
|
children: z9.array(z9.lazy(() => SkillTreeNodeValidator)),
|
|
1248
1285
|
hasChildren: z9.boolean(),
|
|
1249
1286
|
childrenCursor: z9.string().nullable().optional()
|
|
1250
|
-
})
|
|
1287
|
+
});
|
|
1251
1288
|
var PaginatedSkillTreeValidator = z9.object({
|
|
1252
1289
|
hasMore: z9.boolean(),
|
|
1253
1290
|
cursor: z9.string().nullable(),
|
|
@@ -1264,7 +1301,7 @@ var SkillTreeNodeInputValidator = z9.lazy(
|
|
|
1264
1301
|
status: SkillStatusEnum.optional(),
|
|
1265
1302
|
children: z9.array(SkillTreeNodeInputValidator).optional()
|
|
1266
1303
|
})
|
|
1267
|
-
)
|
|
1304
|
+
);
|
|
1268
1305
|
var LinkProviderFrameworkInputValidator = z9.object({
|
|
1269
1306
|
frameworkId: z9.string()
|
|
1270
1307
|
});
|
|
@@ -1380,6 +1417,60 @@ var FrameworkWithSkillsValidator = z9.object({
|
|
|
1380
1417
|
framework: SkillFrameworkValidator,
|
|
1381
1418
|
skills: PaginatedSkillTreeValidator
|
|
1382
1419
|
});
|
|
1420
|
+
var AppListingStatusValidator = z9.enum(["DRAFT", "PENDING_REVIEW", "LISTED", "ARCHIVED"]);
|
|
1421
|
+
var LaunchTypeValidator = z9.enum([
|
|
1422
|
+
"EMBEDDED_IFRAME",
|
|
1423
|
+
"SECOND_SCREEN",
|
|
1424
|
+
"DIRECT_LINK",
|
|
1425
|
+
"CONSENT_REDIRECT",
|
|
1426
|
+
"SERVER_HEADLESS",
|
|
1427
|
+
"AI_TUTOR"
|
|
1428
|
+
]);
|
|
1429
|
+
var PromotionLevelValidator = z9.enum([
|
|
1430
|
+
"FEATURED_CAROUSEL",
|
|
1431
|
+
"CURATED_LIST",
|
|
1432
|
+
"STANDARD",
|
|
1433
|
+
"DEMOTED"
|
|
1434
|
+
]);
|
|
1435
|
+
var AppStoreListingValidator = z9.object({
|
|
1436
|
+
listing_id: z9.string(),
|
|
1437
|
+
display_name: z9.string(),
|
|
1438
|
+
tagline: z9.string(),
|
|
1439
|
+
full_description: z9.string(),
|
|
1440
|
+
icon_url: z9.string(),
|
|
1441
|
+
app_listing_status: AppListingStatusValidator,
|
|
1442
|
+
launch_type: LaunchTypeValidator,
|
|
1443
|
+
launch_config_json: z9.string(),
|
|
1444
|
+
category: z9.string().optional(),
|
|
1445
|
+
promo_video_url: z9.string().optional(),
|
|
1446
|
+
promotion_level: PromotionLevelValidator.optional(),
|
|
1447
|
+
ios_app_store_id: z9.string().optional(),
|
|
1448
|
+
android_app_store_id: z9.string().optional(),
|
|
1449
|
+
privacy_policy_url: z9.string().optional(),
|
|
1450
|
+
terms_url: z9.string().optional(),
|
|
1451
|
+
highlights: z9.array(z9.string()).optional(),
|
|
1452
|
+
screenshots: z9.array(z9.string()).optional(),
|
|
1453
|
+
hero_background_color: z9.string().optional()
|
|
1454
|
+
});
|
|
1455
|
+
var AppStoreListingCreateValidator = AppStoreListingValidator.omit({
|
|
1456
|
+
listing_id: true,
|
|
1457
|
+
app_listing_status: true,
|
|
1458
|
+
promotion_level: true
|
|
1459
|
+
});
|
|
1460
|
+
var AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({
|
|
1461
|
+
listing_id: true,
|
|
1462
|
+
app_listing_status: true,
|
|
1463
|
+
promotion_level: true
|
|
1464
|
+
});
|
|
1465
|
+
var InstalledAppValidator = AppStoreListingValidator.extend({
|
|
1466
|
+
installed_at: z9.string()
|
|
1467
|
+
});
|
|
1468
|
+
var PaginatedAppStoreListingsValidator = PaginationResponseValidator.extend({
|
|
1469
|
+
records: AppStoreListingValidator.array()
|
|
1470
|
+
});
|
|
1471
|
+
var PaginatedInstalledAppsValidator = PaginationResponseValidator.extend({
|
|
1472
|
+
records: InstalledAppValidator.array()
|
|
1473
|
+
});
|
|
1383
1474
|
export {
|
|
1384
1475
|
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
|
|
1385
1476
|
AchievementCredentialValidator,
|
|
@@ -1391,6 +1482,10 @@ export {
|
|
|
1391
1482
|
AddressValidator,
|
|
1392
1483
|
AlignmentTargetTypeValidator,
|
|
1393
1484
|
AlignmentValidator,
|
|
1485
|
+
AppListingStatusValidator,
|
|
1486
|
+
AppStoreListingCreateValidator,
|
|
1487
|
+
AppStoreListingUpdateValidator,
|
|
1488
|
+
AppStoreListingValidator,
|
|
1394
1489
|
AuthGrantQueryValidator,
|
|
1395
1490
|
AuthGrantStatusValidator,
|
|
1396
1491
|
AuthGrantValidator,
|
|
@@ -1463,6 +1558,7 @@ export {
|
|
|
1463
1558
|
ImageValidator,
|
|
1464
1559
|
InboxCredentialQueryValidator,
|
|
1465
1560
|
InboxCredentialValidator,
|
|
1561
|
+
InstalledAppValidator,
|
|
1466
1562
|
IssueInboxCredentialResponseValidator,
|
|
1467
1563
|
IssueInboxCredentialValidator,
|
|
1468
1564
|
IssueInboxSigningAuthorityValidator,
|
|
@@ -1495,7 +1591,9 @@ export {
|
|
|
1495
1591
|
LCNProfileValidator,
|
|
1496
1592
|
LCNSigningAuthorityForUserValidator,
|
|
1497
1593
|
LCNSigningAuthorityValidator,
|
|
1594
|
+
LaunchTypeValidator,
|
|
1498
1595
|
LinkProviderFrameworkInputValidator,
|
|
1596
|
+
PaginatedAppStoreListingsValidator,
|
|
1499
1597
|
PaginatedBoostRecipientsValidator,
|
|
1500
1598
|
PaginatedBoostRecipientsWithChildrenValidator,
|
|
1501
1599
|
PaginatedBoostsValidator,
|
|
@@ -1509,6 +1607,7 @@ export {
|
|
|
1509
1607
|
PaginatedEncryptedCredentialRecordsValidator,
|
|
1510
1608
|
PaginatedEncryptedRecordsValidator,
|
|
1511
1609
|
PaginatedInboxCredentialsValidator,
|
|
1610
|
+
PaginatedInstalledAppsValidator,
|
|
1512
1611
|
PaginatedLCNIntegrationsValidator,
|
|
1513
1612
|
PaginatedLCNProfileManagersValidator,
|
|
1514
1613
|
PaginatedLCNProfilesAndManagersValidator,
|
|
@@ -1518,6 +1617,7 @@ export {
|
|
|
1518
1617
|
PaginationOptionsValidator,
|
|
1519
1618
|
PaginationResponseValidator,
|
|
1520
1619
|
ProfileValidator,
|
|
1620
|
+
PromotionLevelValidator,
|
|
1521
1621
|
ProofValidator,
|
|
1522
1622
|
RefreshServiceValidator,
|
|
1523
1623
|
RegExpValidator,
|
|
@@ -1529,6 +1629,10 @@ export {
|
|
|
1529
1629
|
ResultTypeValidator,
|
|
1530
1630
|
ResultValidator,
|
|
1531
1631
|
RubricCriterionValidator,
|
|
1632
|
+
SendBoostInputValidator,
|
|
1633
|
+
SendBoostResponseValidator,
|
|
1634
|
+
SendInputValidator,
|
|
1635
|
+
SendResponseValidator,
|
|
1532
1636
|
SentCredentialInfoValidator,
|
|
1533
1637
|
ServiceValidator,
|
|
1534
1638
|
SetPrimaryContactMethodValidator,
|