@learncard/types 5.8.11 → 5.9.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
@@ -452,6 +452,7 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
452
452
  });
453
453
 
454
454
  // src/lcn.ts
455
+ import { extendZodWithOpenApi } from "zod-openapi";
455
456
  import { z as z9 } from "zod";
456
457
 
457
458
  // src/queries.ts
@@ -484,9 +485,16 @@ var RegExpValidator = z8.instanceof(RegExp).or(
484
485
  }
485
486
  })
486
487
  );
487
- var StringQuery = z8.string().or(z8.object({ $in: z8.string().array() })).or(z8.object({ $regex: RegExpValidator }));
488
+ var BaseStringQuery = z8.string().or(z8.object({ $in: z8.string().array() })).or(z8.object({ $regex: RegExpValidator }));
489
+ var StringQuery = z8.union([
490
+ BaseStringQuery,
491
+ z8.object({
492
+ $or: BaseStringQuery.array()
493
+ })
494
+ ]);
488
495
 
489
496
  // src/lcn.ts
497
+ extendZodWithOpenApi(z9);
490
498
  var LCNProfileDisplayValidator = z9.object({
491
499
  backgroundColor: z9.string().optional(),
492
500
  backgroundImage: z9.string().optional(),
@@ -644,7 +652,7 @@ var BoostValidator = z9.object({
644
652
  claimPermissions: BoostPermissionsValidator.optional(),
645
653
  allowAnyoneToCreateChildren: z9.boolean().optional()
646
654
  });
647
- var BoostQueryValidator = z9.object({
655
+ var BaseBoostQueryValidator = z9.object({
648
656
  uri: StringQuery,
649
657
  name: StringQuery,
650
658
  type: StringQuery,
@@ -653,6 +661,12 @@ var BoostQueryValidator = z9.object({
653
661
  status: LCNBoostStatus.or(z9.object({ $in: LCNBoostStatus.array() })),
654
662
  autoConnectRecipients: z9.boolean()
655
663
  }).partial();
664
+ var BoostQueryValidator = z9.union([
665
+ z9.object({
666
+ $or: BaseBoostQueryValidator.array()
667
+ }),
668
+ BaseBoostQueryValidator
669
+ ]);
656
670
  var PaginatedBoostsValidator = PaginationResponseValidator.extend({
657
671
  records: BoostValidator.array()
658
672
  });
@@ -708,11 +722,25 @@ var ConsentFlowTermsStatusValidator = z9.enum(["live", "stale", "withdrawn"]);
708
722
  var ConsentFlowContractValidator = z9.object({
709
723
  read: z9.object({
710
724
  anonymize: z9.boolean().optional(),
711
- credentials: z9.object({ categories: z9.record(z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })).default({}) }).default({}),
725
+ credentials: z9.object({
726
+ categories: z9.record(
727
+ z9.object({
728
+ required: z9.boolean(),
729
+ defaultEnabled: z9.boolean().optional()
730
+ })
731
+ ).default({})
732
+ }).default({}),
712
733
  personal: z9.record(z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })).default({})
713
734
  }).default({}),
714
735
  write: z9.object({
715
- credentials: z9.object({ categories: z9.record(z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })).default({}) }).default({}),
736
+ credentials: z9.object({
737
+ categories: z9.record(
738
+ z9.object({
739
+ required: z9.boolean(),
740
+ defaultEnabled: z9.boolean().optional()
741
+ })
742
+ ).default({})
743
+ }).default({}),
716
744
  personal: z9.record(z9.object({ required: z9.boolean(), defaultEnabled: z9.boolean().optional() })).default({})
717
745
  }).default({})
718
746
  });
@@ -855,6 +883,17 @@ var ConsentFlowTransactionValidator = z9.object({
855
883
  var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
856
884
  records: ConsentFlowTransactionValidator.array()
857
885
  });
886
+ var BaseSkillFrameworkQueryValidator = z9.object({
887
+ id: StringQuery,
888
+ name: StringQuery,
889
+ description: StringQuery,
890
+ sourceURI: StringQuery,
891
+ status: StringQuery
892
+ }).partial();
893
+ var SkillFrameworkQueryValidator = z9.union([
894
+ z9.object({ $or: BaseSkillFrameworkQueryValidator.array() }),
895
+ BaseSkillFrameworkQueryValidator
896
+ ]);
858
897
  var ContractCredentialValidator = z9.object({
859
898
  credentialUri: z9.string(),
860
899
  termsUri: z9.string(),
@@ -1038,37 +1077,61 @@ var IssueInboxCredentialValidator = z9.object({
1038
1077
  // === CORE DATA (Required) ===
1039
1078
  // WHAT is being sent and WHO is it for?
1040
1079
  recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
1041
- 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."),
1080
+ credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe(
1081
+ "The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."
1082
+ ),
1042
1083
  // === OPTIONAL FEATURES ===
1043
1084
  // Add major, distinct features at the top level.
1044
1085
  //consentRequest: ConsentRequestValidator.optional(),
1045
1086
  // === PROCESS CONFIGURATION (Optional) ===
1046
1087
  // HOW should this issuance be handled?
1047
1088
  configuration: z9.object({
1048
- 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."),
1089
+ signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
1090
+ "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."
1091
+ ),
1049
1092
  webhookUrl: z9.string().url().optional().describe("The webhook URL to receive credential issuance events."),
1050
1093
  expiresInDays: z9.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
1051
1094
  // --- For User-Facing Delivery (Email/SMS) ---
1052
1095
  delivery: z9.object({
1053
- 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."),
1096
+ suppress: z9.boolean().optional().default(false).describe(
1097
+ "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."
1098
+ ),
1054
1099
  template: z9.object({
1055
- 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."),
1100
+ id: z9.enum(["universal-inbox-claim"]).optional().describe(
1101
+ "The template ID to use for the credential delivery. If not provided, the default template will be used."
1102
+ ),
1056
1103
  model: z9.object({
1057
1104
  issuer: z9.object({
1058
- name: z9.string().optional().describe('The name of the organization (e.g., "State University").'),
1105
+ name: z9.string().optional().describe(
1106
+ 'The name of the organization (e.g., "State University").'
1107
+ ),
1059
1108
  logoUrl: z9.string().url().optional().describe("The URL of the organization's logo.")
1060
1109
  }).optional(),
1061
1110
  credential: z9.object({
1062
- name: z9.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
1063
- type: z9.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
1111
+ name: z9.string().optional().describe(
1112
+ 'The name of the credential (e.g., "Bachelor of Science").'
1113
+ ),
1114
+ type: z9.string().optional().describe(
1115
+ 'The type of the credential (e.g., "degree", "certificate").'
1116
+ )
1064
1117
  }).optional(),
1065
1118
  recipient: z9.object({
1066
- name: z9.string().optional().describe('The name of the recipient (e.g., "John Doe").')
1119
+ name: z9.string().optional().describe(
1120
+ 'The name of the recipient (e.g., "John Doe").'
1121
+ )
1067
1122
  }).optional()
1068
- }).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.")
1069
- }).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
1070
- }).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.")
1071
- }).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
1123
+ }).describe(
1124
+ "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."
1125
+ )
1126
+ }).optional().describe(
1127
+ "The template to use for the credential delivery. If not provided, the default template will be used."
1128
+ )
1129
+ }).optional().describe(
1130
+ "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."
1131
+ )
1132
+ }).optional().describe(
1133
+ "Configuration for the credential issuance. If not provided, the default configuration will be used."
1134
+ )
1072
1135
  });
1073
1136
  var IssueInboxCredentialResponseValidator = z9.object({
1074
1137
  issuanceId: z9.string(),
@@ -1130,6 +1193,191 @@ var ClaimTokenValidator = z9.object({
1130
1193
  expiresAt: z9.string(),
1131
1194
  used: z9.boolean()
1132
1195
  });
1196
+ var TagValidator = z9.object({
1197
+ id: z9.string(),
1198
+ name: z9.string().min(1),
1199
+ slug: z9.string().min(1),
1200
+ createdAt: z9.string().optional(),
1201
+ updatedAt: z9.string().optional()
1202
+ });
1203
+ var SkillStatusEnum = z9.enum(["active", "archived"]);
1204
+ var SkillValidator = z9.object({
1205
+ id: z9.string(),
1206
+ statement: z9.string(),
1207
+ description: z9.string().optional(),
1208
+ code: z9.string().optional(),
1209
+ icon: z9.string().optional(),
1210
+ type: z9.string().default("skill"),
1211
+ status: SkillStatusEnum.default("active"),
1212
+ frameworkId: z9.string().optional(),
1213
+ createdAt: z9.string().optional(),
1214
+ updatedAt: z9.string().optional()
1215
+ });
1216
+ var BaseSkillQueryValidator = z9.object({
1217
+ id: StringQuery,
1218
+ statement: StringQuery,
1219
+ description: StringQuery,
1220
+ code: StringQuery,
1221
+ type: StringQuery,
1222
+ status: SkillStatusEnum.or(z9.object({ $in: SkillStatusEnum.array() }))
1223
+ }).partial();
1224
+ var SkillQueryValidator = z9.union([
1225
+ z9.object({
1226
+ $or: BaseSkillQueryValidator.array()
1227
+ }),
1228
+ BaseSkillQueryValidator
1229
+ ]);
1230
+ var SkillFrameworkStatusEnum = z9.enum(["active", "archived"]);
1231
+ var SkillFrameworkValidator = z9.object({
1232
+ id: z9.string(),
1233
+ name: z9.string(),
1234
+ description: z9.string().optional(),
1235
+ image: z9.string().optional(),
1236
+ sourceURI: z9.string().url().optional(),
1237
+ status: SkillFrameworkStatusEnum.default("active"),
1238
+ createdAt: z9.string().optional(),
1239
+ updatedAt: z9.string().optional()
1240
+ });
1241
+ var PaginatedSkillFrameworksValidator = PaginationResponseValidator.extend({
1242
+ records: SkillFrameworkValidator.array()
1243
+ });
1244
+ var SkillTreeNodeValidator = SkillValidator.extend({
1245
+ children: z9.array(z9.lazy(() => SkillTreeNodeValidator)),
1246
+ hasChildren: z9.boolean(),
1247
+ childrenCursor: z9.string().nullable().optional()
1248
+ }).openapi({ ref: "SkillTreeNode" });
1249
+ var PaginatedSkillTreeValidator = z9.object({
1250
+ hasMore: z9.boolean(),
1251
+ cursor: z9.string().nullable(),
1252
+ records: z9.array(SkillTreeNodeValidator)
1253
+ });
1254
+ var SkillTreeNodeInputValidator = z9.lazy(
1255
+ () => z9.object({
1256
+ id: z9.string().optional(),
1257
+ statement: z9.string(),
1258
+ description: z9.string().optional(),
1259
+ code: z9.string().optional(),
1260
+ icon: z9.string().optional(),
1261
+ type: z9.string().optional(),
1262
+ status: SkillStatusEnum.optional(),
1263
+ children: z9.array(SkillTreeNodeInputValidator).optional()
1264
+ })
1265
+ ).openapi({ ref: "SkillTreeNodeInput" });
1266
+ var LinkProviderFrameworkInputValidator = z9.object({
1267
+ frameworkId: z9.string()
1268
+ });
1269
+ var CreateManagedFrameworkInputValidator = z9.object({
1270
+ id: z9.string().optional(),
1271
+ name: z9.string().min(1),
1272
+ description: z9.string().optional(),
1273
+ image: z9.string().optional(),
1274
+ sourceURI: z9.string().url().optional(),
1275
+ status: SkillFrameworkStatusEnum.optional(),
1276
+ skills: z9.array(SkillTreeNodeInputValidator).optional(),
1277
+ boostUris: z9.array(z9.string()).optional()
1278
+ });
1279
+ var UpdateFrameworkInputValidator = z9.object({
1280
+ id: z9.string(),
1281
+ name: z9.string().min(1).optional(),
1282
+ description: z9.string().optional(),
1283
+ image: z9.string().optional(),
1284
+ sourceURI: z9.string().url().optional(),
1285
+ status: SkillFrameworkStatusEnum.optional()
1286
+ }).refine(
1287
+ (data) => data.name !== void 0 || data.description !== void 0 || data.image !== void 0 || data.sourceURI !== void 0 || data.status !== void 0,
1288
+ {
1289
+ message: "At least one field must be provided to update",
1290
+ path: ["name"]
1291
+ }
1292
+ );
1293
+ var DeleteFrameworkInputValidator = z9.object({ id: z9.string() });
1294
+ var CreateManagedFrameworkBatchInputValidator = z9.object({
1295
+ frameworks: z9.array(
1296
+ CreateManagedFrameworkInputValidator.extend({
1297
+ skills: z9.array(SkillTreeNodeInputValidator).optional()
1298
+ })
1299
+ ).min(1)
1300
+ });
1301
+ var SkillFrameworkAdminInputValidator = z9.object({
1302
+ frameworkId: z9.string(),
1303
+ profileId: z9.string()
1304
+ });
1305
+ var SkillFrameworkIdInputValidator = z9.object({ frameworkId: z9.string() });
1306
+ var SkillFrameworkAdminsValidator = LCNProfileValidator.array();
1307
+ var SyncFrameworkInputValidator = z9.object({ id: z9.string() });
1308
+ var AddTagInputValidator = z9.object({
1309
+ slug: z9.string().min(1),
1310
+ name: z9.string().min(1)
1311
+ });
1312
+ var CreateSkillInputValidator = z9.object({
1313
+ frameworkId: z9.string(),
1314
+ skill: SkillTreeNodeInputValidator,
1315
+ parentId: z9.string().nullable().optional()
1316
+ });
1317
+ var UpdateSkillInputValidator = z9.object({
1318
+ frameworkId: z9.string(),
1319
+ id: z9.string(),
1320
+ statement: z9.string().optional(),
1321
+ description: z9.string().optional(),
1322
+ code: z9.string().optional(),
1323
+ icon: z9.string().optional(),
1324
+ type: z9.string().optional(),
1325
+ status: SkillStatusEnum.optional()
1326
+ }).refine(
1327
+ (data) => data.statement !== void 0 || data.description !== void 0 || data.code !== void 0 || data.icon !== void 0 || data.type !== void 0 || data.status !== void 0,
1328
+ {
1329
+ message: "At least one field must be provided to update a skill",
1330
+ path: ["statement"]
1331
+ }
1332
+ );
1333
+ var SkillDeletionStrategyValidator = z9.enum(["recursive", "reparent"]);
1334
+ var DeleteSkillInputValidator = z9.object({
1335
+ frameworkId: z9.string(),
1336
+ id: z9.string(),
1337
+ strategy: SkillDeletionStrategyValidator.optional().default("reparent")
1338
+ });
1339
+ var CreateSkillsBatchInputValidator = z9.object({
1340
+ frameworkId: z9.string(),
1341
+ skills: z9.array(SkillTreeNodeInputValidator).min(1),
1342
+ parentId: z9.string().nullable().optional()
1343
+ });
1344
+ var ReplaceSkillFrameworkSkillsInputValidator = z9.object({
1345
+ frameworkId: z9.string(),
1346
+ skills: z9.array(SkillTreeNodeInputValidator).min(0)
1347
+ });
1348
+ var ReplaceSkillFrameworkSkillsResultValidator = z9.object({
1349
+ created: z9.number().int().min(0),
1350
+ updated: z9.number().int().min(0),
1351
+ deleted: z9.number().int().min(0),
1352
+ unchanged: z9.number().int().min(0),
1353
+ total: z9.number().int().min(0)
1354
+ });
1355
+ var CountSkillsInputValidator = z9.object({
1356
+ frameworkId: z9.string(),
1357
+ skillId: z9.string().optional(),
1358
+ recursive: z9.boolean().optional().default(false),
1359
+ onlyCountCompetencies: z9.boolean().optional().default(false)
1360
+ });
1361
+ var CountSkillsResultValidator = z9.object({
1362
+ count: z9.number().int().min(0)
1363
+ });
1364
+ var GetFullSkillTreeInputValidator = z9.object({
1365
+ frameworkId: z9.string()
1366
+ });
1367
+ var GetFullSkillTreeResultValidator = z9.object({
1368
+ skills: z9.array(SkillTreeNodeValidator)
1369
+ });
1370
+ var GetSkillPathInputValidator = z9.object({
1371
+ frameworkId: z9.string(),
1372
+ skillId: z9.string()
1373
+ });
1374
+ var GetSkillPathResultValidator = z9.object({
1375
+ path: z9.array(SkillValidator)
1376
+ });
1377
+ var FrameworkWithSkillsValidator = z9.object({
1378
+ framework: SkillFrameworkValidator,
1379
+ skills: PaginatedSkillTreeValidator
1380
+ });
1133
1381
  export {
1134
1382
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
1135
1383
  AchievementCredentialValidator,
@@ -1137,6 +1385,7 @@ export {
1137
1385
  AchievementSubjectValidator,
1138
1386
  AchievementTypeValidator,
1139
1387
  AchievementValidator,
1388
+ AddTagInputValidator,
1140
1389
  AddressValidator,
1141
1390
  AlignmentTargetTypeValidator,
1142
1391
  AlignmentValidator,
@@ -1176,14 +1425,22 @@ export {
1176
1425
  ContactMethodVerificationValidator,
1177
1426
  ContextValidator,
1178
1427
  ContractCredentialValidator,
1428
+ CountSkillsInputValidator,
1429
+ CountSkillsResultValidator,
1179
1430
  CreateContactMethodSessionResponseValidator,
1180
1431
  CreateContactMethodSessionValidator,
1432
+ CreateManagedFrameworkBatchInputValidator,
1433
+ CreateManagedFrameworkInputValidator,
1434
+ CreateSkillInputValidator,
1435
+ CreateSkillsBatchInputValidator,
1181
1436
  CredentialInfoValidator,
1182
1437
  CredentialRecordValidator,
1183
1438
  CredentialSchemaValidator,
1184
1439
  CredentialStatusValidator,
1185
1440
  CredentialSubjectValidator,
1186
1441
  CriteriaValidator,
1442
+ DeleteFrameworkInputValidator,
1443
+ DeleteSkillInputValidator,
1187
1444
  DidDocumentValidator,
1188
1445
  EncryptedCredentialRecordValidator,
1189
1446
  EncryptedRecordValidator,
@@ -1191,8 +1448,13 @@ export {
1191
1448
  EndorsementSubjectValidator,
1192
1449
  EvidenceValidator,
1193
1450
  FlatAuthGrantValidator,
1451
+ FrameworkWithSkillsValidator,
1194
1452
  FullClaimHookValidator,
1195
1453
  GeoCoordinatesValidator,
1454
+ GetFullSkillTreeInputValidator,
1455
+ GetFullSkillTreeResultValidator,
1456
+ GetSkillPathInputValidator,
1457
+ GetSkillPathResultValidator,
1196
1458
  IdentifierEntryValidator,
1197
1459
  IdentifierTypeValidator,
1198
1460
  IdentityObjectValidator,
@@ -1231,6 +1493,7 @@ export {
1231
1493
  LCNProfileValidator,
1232
1494
  LCNSigningAuthorityForUserValidator,
1233
1495
  LCNSigningAuthorityValidator,
1496
+ LinkProviderFrameworkInputValidator,
1234
1497
  PaginatedBoostRecipientsValidator,
1235
1498
  PaginatedBoostRecipientsWithChildrenValidator,
1236
1499
  PaginatedBoostsValidator,
@@ -1248,6 +1511,8 @@ export {
1248
1511
  PaginatedLCNProfileManagersValidator,
1249
1512
  PaginatedLCNProfilesAndManagersValidator,
1250
1513
  PaginatedLCNProfilesValidator,
1514
+ PaginatedSkillFrameworksValidator,
1515
+ PaginatedSkillTreeValidator,
1251
1516
  PaginationOptionsValidator,
1252
1517
  PaginationResponseValidator,
1253
1518
  ProfileValidator,
@@ -1255,6 +1520,8 @@ export {
1255
1520
  RefreshServiceValidator,
1256
1521
  RegExpValidator,
1257
1522
  RelatedValidator,
1523
+ ReplaceSkillFrameworkSkillsInputValidator,
1524
+ ReplaceSkillFrameworkSkillsResultValidator,
1258
1525
  ResultDescriptionValidator,
1259
1526
  ResultStatusTypeValidator,
1260
1527
  ResultTypeValidator,
@@ -1263,11 +1530,27 @@ export {
1263
1530
  SentCredentialInfoValidator,
1264
1531
  ServiceValidator,
1265
1532
  SetPrimaryContactMethodValidator,
1533
+ SkillDeletionStrategyValidator,
1534
+ SkillFrameworkAdminInputValidator,
1535
+ SkillFrameworkAdminsValidator,
1536
+ SkillFrameworkIdInputValidator,
1537
+ SkillFrameworkQueryValidator,
1538
+ SkillFrameworkStatusEnum,
1539
+ SkillFrameworkValidator,
1540
+ SkillQueryValidator,
1541
+ SkillStatusEnum,
1542
+ SkillTreeNodeInputValidator,
1543
+ SkillTreeNodeValidator,
1544
+ SkillValidator,
1266
1545
  StringQuery,
1546
+ SyncFrameworkInputValidator,
1547
+ TagValidator,
1267
1548
  TermsOfUseValidator,
1268
1549
  UnsignedAchievementCredentialValidator,
1269
1550
  UnsignedVCValidator,
1270
1551
  UnsignedVPValidator,
1552
+ UpdateFrameworkInputValidator,
1553
+ UpdateSkillInputValidator,
1271
1554
  VC2EvidenceValidator,
1272
1555
  VCValidator,
1273
1556
  VPValidator,