@learncard/types 5.7.0 → 5.8.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/types.esm.js CHANGED
@@ -506,7 +506,7 @@ var LCNProfileValidator = z9.object({
506
506
  bio: z9.string().default("").describe("Longer bio for the profile."),
507
507
  did: z9.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
508
508
  isPrivate: z9.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
509
- email: z9.string().optional().describe("Contact email address for the profile."),
509
+ email: z9.string().optional().describe("Contact email address for the profile. (deprecated)"),
510
510
  image: z9.string().optional().describe("Profile image URL for the profile."),
511
511
  heroImage: z9.string().optional().describe("Hero image URL for the profile."),
512
512
  websiteLink: z9.string().optional().describe("Website link for the profile."),
@@ -633,7 +633,8 @@ var BoostValidator = z9.object({
633
633
  status: LCNBoostStatus.optional(),
634
634
  autoConnectRecipients: z9.boolean().optional(),
635
635
  meta: z9.record(z9.any()).optional(),
636
- claimPermissions: BoostPermissionsValidator.optional()
636
+ claimPermissions: BoostPermissionsValidator.optional(),
637
+ allowAnyoneToCreateChildren: z9.boolean().optional()
637
638
  });
638
639
  var BoostQueryValidator = z9.object({
639
640
  uri: StringQuery,
@@ -674,7 +675,8 @@ var LCNSigningAuthorityForUserValidator = z9.object({
674
675
  name: z9.string().max(15).regex(/^[a-z0-9-]+$/, {
675
676
  message: "The input string must contain only lowercase letters, numbers, and hyphens."
676
677
  }),
677
- did: z9.string()
678
+ did: z9.string(),
679
+ isPrimary: z9.boolean().optional()
678
680
  })
679
681
  });
680
682
  var AutoBoostConfigValidator = z9.object({
@@ -855,16 +857,33 @@ var LCNNotificationTypeEnumValidator = z9.enum([
855
857
  "BOOST_ACCEPTED",
856
858
  "PRESENTATION_REQUEST",
857
859
  "PRESENTATION_RECEIVED",
858
- "CONSENT_FLOW_TRANSACTION"
860
+ "CONSENT_FLOW_TRANSACTION",
861
+ "ISSUANCE_CLAIMED",
862
+ "ISSUANCE_DELIVERED"
859
863
  ]);
860
864
  var LCNNotificationMessageValidator = z9.object({
861
865
  title: z9.string().optional(),
862
866
  body: z9.string().optional()
863
867
  });
868
+ var LCNInboxContactMethodValidator = z9.object({
869
+ type: z9.string(),
870
+ value: z9.string()
871
+ });
872
+ var LCNInboxStatusEnumValidator = z9.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
873
+ var LCNNotificationInboxValidator = z9.object({
874
+ issuanceId: z9.string(),
875
+ status: LCNInboxStatusEnumValidator,
876
+ recipient: z9.object({
877
+ contactMethod: LCNInboxContactMethodValidator.optional(),
878
+ learnCardId: z9.string().optional()
879
+ }),
880
+ timestamp: z9.string().datetime().optional()
881
+ });
864
882
  var LCNNotificationDataValidator = z9.object({
865
883
  vcUris: z9.array(z9.string()).optional(),
866
884
  vpUris: z9.array(z9.string()).optional(),
867
- transaction: ConsentFlowTransactionValidator.optional()
885
+ transaction: ConsentFlowTransactionValidator.optional(),
886
+ inbox: LCNNotificationInboxValidator.optional()
868
887
  });
869
888
  var LCNNotificationValidator = z9.object({
870
889
  type: LCNNotificationTypeEnumValidator,
@@ -872,7 +891,8 @@ var LCNNotificationValidator = z9.object({
872
891
  from: LCNProfileValidator.partial().and(z9.object({ did: z9.string() })),
873
892
  message: LCNNotificationMessageValidator.optional(),
874
893
  data: LCNNotificationDataValidator.optional(),
875
- sent: z9.string().datetime().optional()
894
+ sent: z9.string().datetime().optional(),
895
+ webhookUrl: z9.string().optional()
876
896
  });
877
897
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
878
898
  var AuthGrantValidator = z9.object({
@@ -896,6 +916,135 @@ var AuthGrantQueryValidator = z9.object({
896
916
  description: StringQuery,
897
917
  status: AuthGrantStatusValidator
898
918
  }).partial();
919
+ var contactMethodBase = z9.object({
920
+ id: z9.string(),
921
+ isVerified: z9.boolean(),
922
+ verifiedAt: z9.string().optional(),
923
+ isPrimary: z9.boolean(),
924
+ createdAt: z9.string()
925
+ });
926
+ var ContactMethodValidator = z9.discriminatedUnion("type", [
927
+ z9.object({
928
+ type: z9.literal("email"),
929
+ value: z9.string().email()
930
+ }).merge(contactMethodBase),
931
+ z9.object({
932
+ type: z9.literal("phone"),
933
+ value: z9.string()
934
+ // Can be improved with a regex later
935
+ }).merge(contactMethodBase)
936
+ ]);
937
+ var createContactMethodBase = z9.object({
938
+ isVerified: z9.boolean().optional(),
939
+ isPrimary: z9.boolean().optional()
940
+ });
941
+ var ContactMethodCreateValidator = z9.discriminatedUnion("type", [
942
+ z9.object({
943
+ type: z9.literal("email"),
944
+ value: z9.string().email()
945
+ }).merge(createContactMethodBase),
946
+ z9.object({
947
+ type: z9.literal("phone"),
948
+ value: z9.string()
949
+ }).merge(createContactMethodBase)
950
+ ]);
951
+ var ContactMethodQueryValidator = z9.discriminatedUnion("type", [
952
+ z9.object({
953
+ type: z9.literal("email"),
954
+ value: z9.string().email()
955
+ }),
956
+ z9.object({
957
+ type: z9.literal("phone"),
958
+ value: z9.string()
959
+ })
960
+ ]);
961
+ var ContactMethodVerificationRequestValidator = z9.object({
962
+ value: z9.string(),
963
+ type: z9.enum(["email", "phone"])
964
+ });
965
+ var ContactMethodVerificationValidator = z9.object({
966
+ token: z9.string()
967
+ });
968
+ var SetPrimaryContactMethodValidator = z9.object({
969
+ contactMethodId: z9.string()
970
+ });
971
+ var InboxCredentialValidator = z9.object({
972
+ id: z9.string(),
973
+ credential: z9.string(),
974
+ isSigned: z9.boolean(),
975
+ currentStatus: LCNInboxStatusEnumValidator,
976
+ expiresAt: z9.string(),
977
+ createdAt: z9.string(),
978
+ issuerDid: z9.string(),
979
+ webhookUrl: z9.string().optional(),
980
+ "signingAuthority.endpoint": z9.string().optional(),
981
+ "signingAuthority.name": z9.string().optional()
982
+ });
983
+ var PaginatedInboxCredentialsValidator = z9.object({
984
+ hasMore: z9.boolean(),
985
+ records: z9.array(InboxCredentialValidator),
986
+ cursor: z9.string().optional()
987
+ });
988
+ var InboxCredentialQueryValidator = z9.object({
989
+ currentStatus: LCNInboxStatusEnumValidator,
990
+ id: z9.string(),
991
+ isSigned: z9.boolean(),
992
+ issuerDid: z9.string()
993
+ }).partial();
994
+ var IssueInboxSigningAuthorityValidator = z9.object({
995
+ endpoint: z9.string().url(),
996
+ name: z9.string()
997
+ });
998
+ var IssueInboxCredentialValidator = z9.object({
999
+ // === CORE DATA (Required) ===
1000
+ // WHAT is being sent and WHO is it for?
1001
+ recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
1002
+ credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),
1003
+ // === OPTIONAL FEATURES ===
1004
+ // Add major, distinct features at the top level.
1005
+ //consentRequest: ConsentRequestValidator.optional(),
1006
+ // === PROCESS CONFIGURATION (Optional) ===
1007
+ // HOW should this issuance be handled?
1008
+ configuration: z9.object({
1009
+ signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),
1010
+ webhookUrl: z9.string().url().optional().describe("The webhook URL to receive credential issuance events."),
1011
+ expiresInDays: z9.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
1012
+ // --- For User-Facing Delivery (Email/SMS) ---
1013
+ delivery: z9.object({
1014
+ suppress: z9.boolean().optional().default(false).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),
1015
+ template: z9.object({
1016
+ id: z9.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),
1017
+ model: z9.object({
1018
+ issuer: z9.object({
1019
+ name: z9.string().optional().describe('The name of the organization (e.g., "State University").'),
1020
+ logoUrl: z9.string().url().optional().describe("The URL of the organization's logo.")
1021
+ }).optional(),
1022
+ credential: z9.object({
1023
+ name: z9.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
1024
+ type: z9.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
1025
+ }).optional(),
1026
+ recipient: z9.object({
1027
+ name: z9.string().optional().describe('The name of the recipient (e.g., "John Doe").')
1028
+ }).optional()
1029
+ }).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")
1030
+ }).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
1031
+ }).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")
1032
+ }).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
1033
+ });
1034
+ var IssueInboxCredentialResponseValidator = z9.object({
1035
+ issuanceId: z9.string(),
1036
+ status: LCNInboxStatusEnumValidator,
1037
+ recipient: ContactMethodQueryValidator,
1038
+ claimUrl: z9.string().url().optional(),
1039
+ recipientDid: z9.string().optional()
1040
+ });
1041
+ var ClaimTokenValidator = z9.object({
1042
+ token: z9.string(),
1043
+ contactMethodId: z9.string(),
1044
+ createdAt: z9.string(),
1045
+ expiresAt: z9.string(),
1046
+ used: z9.boolean()
1047
+ });
899
1048
  export {
900
1049
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
901
1050
  AchievementCredentialValidator,
@@ -918,6 +1067,7 @@ export {
918
1067
  ClaimHookQueryValidator,
919
1068
  ClaimHookTypeValidator,
920
1069
  ClaimHookValidator,
1070
+ ClaimTokenValidator,
921
1071
  ConsentFlowContractDataForDidValidator,
922
1072
  ConsentFlowContractDataValidator,
923
1073
  ConsentFlowContractDetailsValidator,
@@ -932,6 +1082,11 @@ export {
932
1082
  ConsentFlowTransactionActionValidator,
933
1083
  ConsentFlowTransactionValidator,
934
1084
  ConsentFlowTransactionsQueryValidator,
1085
+ ContactMethodCreateValidator,
1086
+ ContactMethodQueryValidator,
1087
+ ContactMethodValidator,
1088
+ ContactMethodVerificationRequestValidator,
1089
+ ContactMethodVerificationValidator,
935
1090
  ContextValidator,
936
1091
  ContractCredentialValidator,
937
1092
  CredentialInfoValidator,
@@ -953,6 +1108,11 @@ export {
953
1108
  IdentifierTypeValidator,
954
1109
  IdentityObjectValidator,
955
1110
  ImageValidator,
1111
+ InboxCredentialQueryValidator,
1112
+ InboxCredentialValidator,
1113
+ IssueInboxCredentialResponseValidator,
1114
+ IssueInboxCredentialValidator,
1115
+ IssueInboxSigningAuthorityValidator,
956
1116
  JWERecipientHeaderValidator,
957
1117
  JWERecipientValidator,
958
1118
  JWEValidator,
@@ -962,7 +1122,10 @@ export {
962
1122
  LCNBoostClaimLinkOptionsValidator,
963
1123
  LCNBoostClaimLinkSigningAuthorityValidator,
964
1124
  LCNBoostStatus,
1125
+ LCNInboxContactMethodValidator,
1126
+ LCNInboxStatusEnumValidator,
965
1127
  LCNNotificationDataValidator,
1128
+ LCNNotificationInboxValidator,
966
1129
  LCNNotificationMessageValidator,
967
1130
  LCNNotificationTypeEnumValidator,
968
1131
  LCNNotificationValidator,
@@ -985,6 +1148,7 @@ export {
985
1148
  PaginatedContractCredentialsValidator,
986
1149
  PaginatedEncryptedCredentialRecordsValidator,
987
1150
  PaginatedEncryptedRecordsValidator,
1151
+ PaginatedInboxCredentialsValidator,
988
1152
  PaginatedLCNProfileManagersValidator,
989
1153
  PaginatedLCNProfilesAndManagersValidator,
990
1154
  PaginatedLCNProfilesValidator,
@@ -1002,6 +1166,7 @@ export {
1002
1166
  RubricCriterionValidator,
1003
1167
  SentCredentialInfoValidator,
1004
1168
  ServiceValidator,
1169
+ SetPrimaryContactMethodValidator,
1005
1170
  StringQuery,
1006
1171
  TermsOfUseValidator,
1007
1172
  UnsignedAchievementCredentialValidator,